diff --git a/src/apps/bin/sharutils-4.2.1/ABOUT-NLS b/src/apps/bin/sharutils-4.2.1/ABOUT-NLS new file mode 100644 index 0000000000..f923c842a8 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/ABOUT-NLS @@ -0,0 +1,203 @@ +Notes on the GNU Translation Project +************************************ + + GNU is going international! The GNU Translation Project is a way to +get maintainers, translators and users all together, so GNU will +gradually become able to speak many native languages. A few packages +already provide native language translation for their messages. + + If you found this `ABOUT-NLS' file inside a GNU 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 at translations should 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. + +One advise in advance +===================== + + If you want to exploit the full power of the GNU `gettext' package +you should configure it using + + --with-gnu-gettext. + + No existing implementation at this point provides so many useful +features (such as locale alias or message inheritance). It is also not +possible to provide this additional functionality on top of a catgets +implementation. + + Future versions of GNU `gettext' will very likely provide even more +functionality. So it might be a good idea to change to GNU `gettext' +as soon as possible. + +INSTALL Matters +=============== + + Some GNU 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 provides +usable `catgets' or `gettext' functions. If neither is available, the +GNU `gettext' own library will be used. However, installers may use +special options at configuration time for changing this behaviour. The +commands: + + ./configure --with-gnu-gettext + ./configure --disable-nls + +will respectively bypass system `catgets' or `gettext' to use GNU +`gettext', 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 be not what is 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-gnu-gettext + +to prevent auto-detection. + + Internationalized packages have usually many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations are disabled, all those available 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. + +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 +ISO 639 `LL' two-letter code prior to using the programs in the +package. For example, let's suppose that you speak German. At the +shell prompt, merely execute `setenv LANG de' (in `csh') or +`export LANG; LANG=de' (in `sh'). This can be done from your `.login' +or `.profile' file, once and for all. Packages which are not +internationalized will merely ignore the setting of this variable. + +Translating Teams +================= + + The GNU `gettext' tool set contains *everything* maintainers need +for internationalizing their packages for messages. It also contains +quite useful tools for helping translators at localizing messages to +their native language, once a package has already been +internationalized. + + To achieve the GNU Translation Project, we need many 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 translating team has its own mailing list, courtesy of Linux +International. You may reach your translating team at the address +`LL@li.org', replacing LL by the two-letter ISO 639 code for your +language. Language codes are *not* the same as country codes given in +ISO 3166. The following translating teams exist, as of November 1995: + + Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en', + Esperanto `eo', Finnish `fi', French `fr', Irish `ga', German + `de', Greek `el', Italian `it', Japanese `ja', Indonesian `in', + Norwegian `no', Persian `fa', Polish `pl', Portuguese `pt', + Russian `ru', Spanish `es', Swedish `sv', Telugu `te' and Turkish + `tr'. + +For example, you may reach the Chinese translating team by writing to +`zh@li.org'. + + 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, Swedish people can send a message to +`sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members should be interested in *working* at +translations, or at solving translational difficulties, rather than +merely lurking around. If your team does not exist yet and you want to +start one, please write to `gnu-translation@prep.ai.mit.edu'; you will +then reach the GNU coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology used in GNU. Proven linguistic skill are praised more +than programming skill, here. For the time being, please avoid +subscribing to the English team unless explicitely invited to do so. + +Available Packages +================== + + Languages are not equally supported in all GNU packages. The +following matrix shows the current state of GNU internationalization, +as of November 1995. Listed are: internationalized packages, and +languages for which work is in progress, or about to start. + + See note cs de en fr it ja nl no pt sv + \ .-------------------------------. + chess (1) | X / X | + clisp | X X X | + diffutils (2) | / . | + fileutils | . / | + flex (3) | / . | + m4 | - / - - . - | + gettext | X / X X X | + ptx | - / - - | + recode | - / - - - | + sh-utils | . / . | + sharutils | X / X X X X X | + tar | X / X - X X | + textutils | . / . | + wdiff | - - / - - | + `-------------------------------' + cs de en fr it ja nl no pt sv + + The interpretation legend and notes are: + +`/' + There is no PO file, this package merely defaults to this language. + +`.' + The effort of localizing this package has been undertaken by + someone, or by a translating team, and work is, or should be in + progress. + +`-' + A PO file for this package and this language is completed and is + currently available in a pretest release, or is all ready for + inclusion in the next release of this package. + +`X' + The localization of this package to this particular language is + fully completed, and now distributed through an official release. + +(1) + This package is translated to specific languages by methods + predating GNU `gettext'. Translations are all kept on disk files, + and sources contain numbers where one normally expects strings. + +(2) + This package is planned to switch to GNU `gettext'. For the time + being, it uses temporary means for internationalization. + +(3) + This package has its translatable strings marked, but does not use + GNU `gettext'. A convenience patch may be available separately. + + If November 1995 seems to be old, you may fetch a more recent copy +of this `ABOUT-NLS' file on most GNU archive sites. + diff --git a/src/apps/bin/sharutils-4.2.1/AUTHORS b/src/apps/bin/sharutils-4.2.1/AUTHORS new file mode 100644 index 0000000000..dc946ff500 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/AUTHORS @@ -0,0 +1,16 @@ +Authors of GNU shar utilities. + +The following contributions warranted legal paper exchanges with the +Free Software Foundation. Also see files ChangeLog and THANKS. + +UUDECODE, UUENCODE, XXDECODE, XXENCODE David J. Camp +Disclaims programs. + +UUDECODE, UUENCODE, XXDECODE, XXENCODE Washington University +Disclaims programs by David J. Camp. + +SHARUTILS Ulrich Drepper Germany 1968 8/3/95 +Assigns past and future changes to Sharutils. + +SHARUTILS Jan Djarv Swedish 1963 9/8/95 +Assigns the manual "Shar man pages" diff --git a/src/apps/bin/sharutils-4.2.1/BACKLOG b/src/apps/bin/sharutils-4.2.1/BACKLOG new file mode 100644 index 0000000000..5c6af27796 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/BACKLOG @@ -0,0 +1,290 @@ +# Summary of pending email for GNU sharutils 4.1.4. +# Last updated: Friday, February 24, 1995. +# +# You may use this BACKLOG file for checking if I still have an +# unprocessed report of yours, or just to have a feeling of how +# this package is evolving (or not :-). Please be kind enough to +# check here before reporting again a problem that is not solved +# in this release. +# +# When I will process a report from you, you may reasonably count +# on the fact that I will give you some feedback at that time. +# By merely re-sending a report I already have, you are just putting +# more burden on my shoulders, and surely not making things go +# any faster. +# +# I could of course withhold a release until all reported problems +# are solved. This would not always be practical, nor fair for +# the community, when some of all reported bugs are solved indeed. +# So I have to cut the pear in halves, draw a line somewhere, and +# still make releases once in a while. +# +# About the principle of the BACKLOG file itself, my opinion is that +# users deserve to know where maintenance stands for what they use. +# Ignorance is sometimes more comfortable, but does not change facts. +# If commercial companies were indeed publishing their own internal +# bug lists, I think you would feel more secure with GNU software! + + +rmail/announce + 1. 31 Aug 93 uuencode/uudecode + 2. 07 Jun 94 shar/unshar + 3. 08 Jul 94 GNU shar? + 4. 02 Sep 94 Release: GNU shar 4.0 + 5. 30 Oct 94 Prerelease: GNU sharutils 4.0.1 + 6. 06 Nov 94 Release: GNU sharutils 4.1 + 7. 29 Nov 94 Prerelease: GNU sharutils 4.1.1 + 8. 30 Nov 94 Disappearance of uuencode 1.0 + 9. 01 Dec 94 Prerelease: GNU sharutils 4.1.3 +10. 24 Feb 95 Prerelease: GNU sharutils 4.1.4 + +rmail/brik + 1. 07 Nov 94 Re: is this tar file ok? + 2. 07 Nov 94 GNUicizing brik? + 3. 09 Nov 94 Re: GNUicizing brik? + 4. 10 Nov 94 1) GNU tar, 2) GNU brik? :-) + 5. 10 Nov 94 Re: 1) GNU tar, 2) GNU brik? :-) + 6. 12 Nov 94 brik + 7. 12 Nov 94 brik in GNU shar utilities + 8. 12 Nov 94 Re: brik in GNU shar utilities + 9. 12 Nov 94 Re: brik in GNU shar utilities +10. 13 Nov 94 brik +11. 14 Nov 94 Re: brik +12. 29 Nov 94 Re: brik +13. 29 Nov 94 Re: brik +14. 30 Nov 94 Re: brik +15. 04 Dec 94 Re: brik +16. 04 Dec 94 Re: brik +17. 04 Dec 94 Re: brik +18. 05 Jan 95 Re: brik +19. 05 Jan 95 Re: brik +20. 05 Jan 95 Re: brik +21. 06 Jan 95 Re: brik +22. 27 Jan 95 Legaleese for brik? +23. 27 Jan 95 Re: Legaleese for brik? +24. 12 Feb 95 brik, and uucode + +rmail/documentation + 1. 11 Nov 94 Release: GNU sharutils 4.1 + 2. 11 Nov 94 Re: Release: GNU sharutils 4.1 + 3. 11 Nov 94 Re: Release: GNU sharutils 4.1 + 4. 11 Nov 94 Release: GNU sharutils 4.1 + 5. 11 Nov 94 Re: Release: GNU sharutils 4.1 + 6. 11 Nov 94 Re: Release: GNU sharutils 4.1 + 7. 16 Nov 94 Re: sharutils + 8. 30 Nov 94 Re: Suggestion for Sharutils (feature) + 9. 30 Nov 94 Re: Prerelease: GNU sharutils +10. 30 Nov 94 Re: Suggestion for Sharutils (feature) +11. 11 Feb 95 sh, shar, unshar - explications + +rmail/remote-cvs + 1. 13 Feb 95 [jimb@totoro.bio.indiana.edu: remote CV + 2. 13 Feb 95 [zoo@armadillo.com: Re: remote CVS?] + 3. 13 Feb 95 [kingdon@cygnus.com: Re: remote CVS?] + 4. 13 Feb 95 [zoo@armadillo.com: Re: remote CVS?] + 5. 13 Feb 95 [kingdon@cygnus.com: Re: remote CVS?] + 6. 13 Feb 95 [stig@inse.com: Re: remote CVS?] + 7. 13 Feb 95 [karl@owl.hq.ileaf.com: even more remot + 8. 13 Feb 95 [Ollivier.Robert@hsc.fr.net: Re: even m + 9. 13 Feb 95 [jc@irbs.com: Re: even more remote CVS? + +rmail/remsync + 1. 18 Oct 94 (none) + 2. 18 Oct 94 remsync chez gnu.ai + 3. 18 Oct 94 remsync + 4. 19 Oct 94 remsync pour wdiff recu sur gnux + 5. 23 Oct 94 Ignores ignored? + 6. 28 Oct 94 (none) + 7. 28 Oct 94 (none) + 8. 28 Oct 94 (none) + 9. 02 Nov 94 (none) +10. 03 Nov 94 remsync +11. 03 Nov 94 Full path would be better +12. 24 Oct 94 remsync - modifier... +13. 25 Oct 94 Hebdomadaire... +14. 26 Oct 94 (none) +15. 26 Oct 94 shar: .remsync.tar.gz +16. 26 Oct 94 shar: .remsync.tar.gz +17. 26 Oct 94 shar: .remsync.tar.gz +18. 26 Oct 94 (none) +19. 26 Oct 94 remsync: 1) Prudence 2) Mario +20. 26 Oct 94 (none) +21. 27 Oct 94 shar: remsync.in +22. 27 Oct 94 shar: .remsync.tar.gz +23. 03 Nov 94 presentation a RISQ 95 +24. 04 Nov 94 Re: presentation a RISQ 95 +25. 08 Nov 94 remsync - idées +26. 13 Oct 94 (none) +27. 18 Oct 94 Bug Perl +28. 22 Oct 94 Returned mail: User unknown +29. 04 Nov 94 Re: presentation a RISQ 95 +30. 03 Nov 94 presentation a RISQ 95 +31. 03 Nov 94 Full path would be better +32. 21 Nov 94 RISQ95: programme preliminaire et pre-inscript +33. 21 Nov 94 RISQ95: programme preliminaire et pre-inscrip +34. 07 Dec 94 RISQ95 - Vos coordonnees +35. 07 Dec 94 RISQ95: Conferenciers - Speakers +36. 07 Dec 94 RISQ95: Conferenciers - Speakers +37. 09 Dec 94 Re: RISQ95 - Vos coordonnees +38. 09 Dec 94 Re: RISQ95: Conferenciers - Speakers +39. 09 Dec 94 Re: RISQ95: Conferenciers - Speakers +40. 12 Dec 94 RAPPEL: Conferenciers - Speakers RISQ95 +41. 12 Dec 94 RAPPEL: Conferenciers - Speakers RISQ95 +42. 13 Dec 94 (none) +43. 13 Dec 94 RCVS Duplicate copies ? +44. 13 Dec 94 Re: RCVS Duplicate copies ? +45. 20 Dec 94 (none) +46. 22 Dec 94 (none) +47. 23 Dec 94 remsync - Diagnose locally missi +48. 31 Dec 94 Bug remsync +49. 31 Dec 94 Will CVS 1.4 learn to track moving files? +50. 12 Jan 95 RISQ95: programme final +51. 12 Jan 95 RISQ95: programme final +52. 24 Jan 95 remsync !? +53. 24 Jan 95 remsync vs PAGER +54. 26 Jan 95 (none) +55. 27 Jan 95 (none) +56. 29 Jan 95 (none) +57. 29 Jan 95 Récent envoi àUniforum +58. 29 Jan 95 Envoi Uniforum (bis) +59. 29 Jan 95 Message Uniforum (ter) +60. 06 Feb 95 Remsync. +61. 06 Feb 95 Re: Remsync. +62. 06 Feb 95 remsync to be included in GNU shar utilities +63. 06 Feb 95 remsync to be included in GNU shar utilities + +rmail/shar-archive-headers + 1. 15 Oct 94 shar 4.0 vs cshar + 2. 15 Oct 94 Re: shar 4.0 vs cshar + 3. 19 Oct 94 GNU Shar 4.1 extensions? + 4. 19 Oct 94 Re: GNU Shar 4.1 extensions? + 5. 23 Oct 94 Re: GNU Shar 4.1 extensions? + 6. 23 Oct 94 shar-4.0-4.1.patch + 7. 07 Nov 94 Re: small enhancement to sharutils-4.1 + 8. 16 Jan 95 saving the headers in unshar + 9. 26 Jan 95 Re: saving the headers in unshar + +rmail/shar-backups + 1. 26 Jan 95 Re: saving the headers in unshar + 2. 27 Jan 95 backups [was: Re: saving the headers in unshar] + +rmail/shar-documentation + 1. Tue Sep 6 Re: Solution for [Re: shar 4.0 make shar.dvi p + 2. Tue Sep 6 Re: Solution for [Re: shar 4.0 make shar.dvi p + 3. 09 Sep 94 Comments about shar-4.0 + 4. 11 Sep 94 Re: shar 4.0 [was: Re: disk buffering in Linux + 5. 12 Sep 94 Say a word about GNU touch + 6. 16 Sep 94 comments on shar 4.0 doc + 7. 10 Sep 94 Returned mail: Host unknown + 8. 03 Sep 94 GNU shar 4.0 + +rmail/shar-old-bug + 1. 27 Sep 90 shar 3.49 details + 2. 27 Sep 90 Other problems requiring -F with shar [was: macros.ed] + +rmail/shar-touch + 1. 17 Nov 94 Suggested change to shar + 2. 17 Nov 94 Re: Suggested change to shar + +rmail/shar-user-id + 1. 23 Dec 94 shar: RMAIL0 + +rmail/shar-walkdown-bug + 1. 12 Sep 94 Shar 4.0: bug in walkdo + 2. 13 Sep 94 Re: Shar 4.0: bug in walkdown + 3. 12 Feb 95 sharutils-4.1: problem sharing `.' + +rmail/shar-without-fork + 1. 07 Sep 94 Shar 4.0: avoid fork() + +rmail/unshar-new-o-option + 1. 09 Sep 94 Suggestion for unshar 4.0 + +rmail/unshar-slowness + 1. 31 Oct 94 Re: sharutils-4.0.1 + 2. 10 Nov 94 Optimizing unshar + 3. 11 Nov 94 Re: Optimizing unshar + 4. 11 Nov 94 Re: Optimizing unshar + 5. 11 Nov 94 Re: Optimizing unshar + 6. 11 Nov 94 Re: Optimizing unshar + 7. 11 Nov 94 Re: Optimizing unshar + 8. 11 Nov 94 Re: Optimizing unshar + +rmail/unshar-standalone + 1. 03 Sep 94 shar/unshar + 2. 06 Sep 94 Re: shar/unshar + +rmail/uu-bigger-specs + 1. 05 Sep 93 Re: uuencode/uudecode + 2. 07 Sep 93 Re: GNU uudecode: why no GNU btoa? + 3. 03 Mar 94 uuencode 1.0: Ultrix, use of spaces, no table + 4. 02 Jul 94 Some slight patchs for uuencode-1 + 5. 16 Nov 94 sharutils + 6. 17 Nov 94 Re: sharutils + 7. 30 Nov 94 Re: Prerelease: GNU sharutils + 8. 21 Nov 94 uudecode enhancement + 9. 11 Feb 95 uucode pas requis pour Gilles +10. 03 Oct 94 Re: uuencode 1.0: Ultrix, use of spaces, no t +11. 03 Oct 94 Re: uuencode 1.0: Ultrix, use of spaces, no table, not r +12. 02 Sep 93 Re: uuencode/uudecode +13. 16 Feb 95 Hint: uudecode/uuencode + +rmail/uu-documentation + 1. 02 Sep 93 DOS uuencode and uudecode + 2. 13 Oct 93 Re: uuencode + 3. 17 Jul 89 uudecode + 4. 02 Dec 90 Re: uudecode alias security hole? + 5. 17 Jun 91 Re: is uudecode dangerous? + 6. 19 Jun 91 Re: is uudecode dangerous? ; chown? + 7. 01 Mar 90 Re: which archiver/compresser/encoder/decoder + 8. 03 Nov 94 Re: Documentation diffs, & a comment. + +rmail/uu-new-w-option + 1. 29 Oct 94 New `uudecode -w' option for easy multipart deco + 2. 29 Oct 94 Re: New `uudecode -w' option for easy multipart decoding + 3. 29 Oct 94 Re: New `uudecode -w' option for easy multipart + 4. 29 Oct 94 New `uudecode -w' option for easy m + +admin/abe/RMAIL + 1. 17 Jan 91 abe and directories; dabe and Turbo-C + 2. 27 Jan 91 Re: abe part numbering + 3. 11 Feb 91 Possible bug with b= option + 4. 11 Feb 91 Re: Possible bug with b= optio + 5. 15 Jul 92 Minor problem in dabe.c + 6. 23 Sep 94 Re: Possible bug with b= option + 7. 24 Sep 94 Re: Possible bug with b= option + 8. 24 Sep 94 Re: Possible bug with b= option + 9. 24 Sep 94 Re: Possible bug with b= option +10. 24 Sep 94 Re: Possible bug with b= option +11. 24 Sep 94 Re: Possible bug with b= option +12. 26 Sep 94 Re: Possible bug with b= option + +admin/apple/RMAIL + 1. 30 Jun 87 Comb + +admin/btoa/RMAIL + 1. 20 Sep 94 shar, uuencode, atob + 2. 20 Sep 94 Re: shar, uuencode, atob + 3. 29 Jul 94 Re: GNU shar, -M and you + 4. 28 Jul 94 Re: GNU shar, -M and you + 5. 09 Oct 92 version of atob with factor of 2 speedup + 6. 26 Sep 93 GNU encode 1.0 - still + 7. 30 Dec 89 Re: BTOA 5.2 + 8. 30 Dec 89 BTOA 5.2 + 9. 31 Dec 89 diffs for btoa 5.2 under MSDOS +10. 18 Jul 90 shar blues +11. 20 Sep 94 Re: shar, uuencode, atob +12. 24 Sep 94 Re: shar, uuencode, atob + +admin/mailbin/RMAIL + 1. 05 Dec 94 Re: mailbin.200 - part 1 of 6 + 2. 05 Dec 94 mailbin.200 - part 1 of 6 + +admin/uu-c/RMAIL + 1. 26 Oct 91 UUDOALL.ZIP - More flexible uudecod + +admin/xx-c/RMAIL + 1. 21 Feb 90 XXENCODE/XXDECODE + 2. 06 Nov 90 UUXFER20.ZIP - Comprehensive UU/XX en + 3. 29 Nov 94 {uu,xx}{en,de}code + 4. 29 Nov 94 Returned mail: Service unavailab diff --git a/src/apps/bin/sharutils-4.2.1/COPYING b/src/apps/bin/sharutils-4.2.1/COPYING new file mode 100644 index 0000000000..a43ea2126f --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/src/apps/bin/sharutils-4.2.1/ChangeLog b/src/apps/bin/sharutils-4.2.1/ChangeLog new file mode 100644 index 0000000000..888448391d --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/ChangeLog @@ -0,0 +1,970 @@ +Mon Dec 4 00:44:40 1995 Ulrich Drepper + + * configure.in (VERSION): Bump to 4.2. + +Sat Dec 2 03:17:01 1995 Ulrich Drepper + + * configure.in: Add handling of README-alpha file. If current + version is a test release we ship this file. Inspired by Jim + Meyering's configure.in. + + * Makefile.in (DISTFILES): Add @DIST_ALPHA@. + +Sun Nov 26 00:39:10 1995 Ulrich Drepper + + * configure.in: Fix fatal bug: have to add AC_C_BIGENDIAN test. + Else the MD5 sum on big endian machines is wrong! + + * configure.in: We don't need to test for shar. We are installing it. + +Sat Nov 25 16:16:22 1995 Ulrich Drepper + + * README: Some corrections around ABOUT-NLS by Franc,ois Pinard. + +Fri Nov 24 19:59:53 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Change README.NLS to ABOUT-NLS. + +Tue Nov 21 16:30:51 1995 Ulrich Drepper + + * aclocal.m4 (ud_GNU_GETTEXT): Always create intl/. + + * Makefile.in: + Make recursion loop aware of Make's -k option. Kudos to Jim Meyering. + + * Makefile.in: Make default goal `all' and depend on `all-recursice'. + +Tue Nov 14 12:55:50 1995 Ulrich Drepper + + * configure.in (VERSION): Bump to 4.1.12. + (ALL_LINGUAS): Add ja_JP.EUC. + +Tue Nov 7 13:46:39 1995 Ulrich Drepper + + * aclocal.m4 (ud_WITH_NLS): + Set LIBS to correct value and filter out -intl if necessary. + +Mon Nov 6 16:47:58 1995 Ulrich Drepper + + * aclocal.m4 (ud_PATH_LISP): + Remove macro. We don't need it in sharutils. + +Sun Nov 5 21:45:55 1995 Ulrich Drepper + + * aclocal.m4: + Franc,ois reported that po2tbl.sed is not always generated. + +Sun Nov 5 18:20:33 1995 Ulrich Drepper + + * configure.in (VERSION): Bump to 4.1.11. + + * Makefile.in (DISTFILES): Don't distributs NLS, but README.NLS. + +Sun Nov 5 13:33:00 1995 Ulrich Drepper + + * Makefile.in (dist): Suppress error message when ln failed. + + * configure.in (VERSION): Bump to 4.1.10. + +Sat Nov 4 23:37:53 1995 Ulrich Drepper + + * aclocal.m4: + Fix typo: "Do not you" -> "Do not use". Reported by Tom Tromey. + +Sun Oct 29 12:02:42 1995 Ulrich Drepper + + * configure.in: Replace AC_INSTALL_PROG with fp_INSTALL_PROG. + + * aclocal.m4 (fp_PROG_INSTALL): New macro by Franc,ois Pinard. + +Sat Oct 28 23:32:04 1995 Ulrich Drepper + + * aclocal.m4: + Test for dcgettext function when gettext is found in C library. This + works around the missing function in Solaris 2.3. + +Fri Oct 27 02:29:59 1995 Ulrich Drepper + + * aclocal.m4: + Use single quotes where possible. Reported by Christian von Roques. + +Tue Sep 26 00:52:59 1995 Ulrich Drepper + + * aclocal.m4 (md_PATH_PROG): Quote argument to echo. + +Mon Sep 25 22:15:36 1995 Ulrich Drepper + + * aclocal.m4 (md_PATH_PROG): + Use this new macro instead of AC_PATH_PROG for msgfmt and + xgettext program. This warns about uses of OpenWin versions (Wrgg). + +Sun Sep 24 10:49:40 1995 Ulrich Drepper + + * aclocal.m4: Protect second use of ac_cv_func_stpcpy, too. + + * aclocal.m4: + Move definition of INTLSUB to right place. We don't need to compile + this directory for systems which have the gettext functions. + + * configure.in (AC_REPLACE_FUNCS): + Add stpcpy. Reported by Nelson Beebe and Jim Meyering. + +Sat Sep 23 22:49:35 1995 Ulrich Drepper + + * configure.in (VERSION): Bump to 4.1.9. + + * aclocal.m4 (stpcpy): + Fix bug where test gets empty argument when stpcpy is not available. + Reported by Nelson Beebe. + + * configure.in (VERSION): Bump to 4.1.8. + +Fri Sep 22 23:47:00 1995 Ulrich Drepper + + * acconfig.h (HAVE_STPCPY): Add symbol for work around. + + * configure.in (AC_C_INLINE): Add this test. + +Thu Sep 21 19:12:32 1995 Ulrich Drepper + + * aclocal.m4: Add aclocal.m4 from gettext-0.9.4. + + * configure.in (AC_OUTPUT): Add po/po2tbl.sed. + +Wed Sep 20 23:51:55 1995 Ulrich Drepper + + * configure.in (uucode): + In case of cached value set MAN1PAGES and MAN5PAGES. Was only + done for uncached case before. + + * Makefile.in (install-man): New rule for install man pages. + + * configure.in (VERSION): Bump to 4.1.7. + +Thu Sep 7 00:19:52 1995 Ulrich Drepper + + * Makefile.in (dist): + Use o option for tar to generated more general tar files. + + * Makefile.in (dist): Don't use long --gzip option for tar. + +Sat Aug 19 23:36:03 1995 Ulrich Drepper + + * aclocal.m4: Update to aclocal.m4 from gettext-0.9.3 from 950818. + +Tue Aug 15 16:47:46 1995 Ulrich Drepper + + * Makefile.in (dist): Remove `copying instead' message. + +Tue Aug 15 12:23:16 1995 Ulrich Drepper + + * configure.in: + Make sure that .gmo catalogs are always installed if NLS is selected. + + * aclocal.m4: Update NLS macros from gettext-0.9.2. + +Thu Aug 10 22:36:39 1995 Ulrich Drepper + + * Makefile.in (SUBDIRS): Add contrib. + +Thu Aug 3 00:03:01 1995 Ulrich Drepper + + * configure.in, aclocal.m4, acconfig.h: Complete rewrite after + changing to non-flat directory structure and usage of GNU gettext. + +Wed Aug 2 23:59:57 1995 Ulrich Drepper + + * Makefile.in: Complete rewrite for non-flat directory structure + and usage of GNU gettext. + +Tue Jun 13 08:23:35 1995 =?ISO-8859-1?Q?Fran=E7ois_Pinard?= (pinard@icule) + + * shar.c: Replace all references to _sharEXT.tmp by _sh$$.EXT, so + many unshar may execute in parallel in the same directory. + Reported by Jim Meyering. + +Wed May 17 14:07:08 1995 =?ISO-8859-1?Q?Fran=E7ois_Pinard?= (pinard@icule) + + * pt.po: New file, for Portuguese. + * configure.in (LINGUAS): Adjusted. + Reported by Antonio Esteves. + +Wed May 3 20:49:53 1995 =?ISO-8859-1?Q?Fran=E7ois_Pinard?= (pinard@icule) + + * mailshar.in: Add `-s SIZE' option. Use test instead of [. + +Tue May 2 23:15:01 1995 =?ISO-8859-1?Q?Fran=E7ois_Pinard?= (pinard@icule) + + * uuencode.c (encode): Use comma operator when assignment in test. + * uudecode.c (DEC), uuencode.c (ENC): Capitalize macro arguments. + * system.h (memcpy), shar.c (ISASCII): Avoid superfluous + parentheses in macro definitions. + +Tue Apr 25 18:55:26 1995 François Pinard (pinard@icule) + + * shar.c (shar): Capitalize SKIPPING messages. These are nearly + errors, and so, they should call for the eye of the user. + +Sun Mar 26 08:48:27 1995 François Pinard (pinard@icule) + + * remsync.in: Use Emacs file variables to announce Perl mode + instead of using the first line. This confuses some shells. + Reported by Andrey A. Chernov. + + * configure.in: Define and substitute MAN1PAGES and MAN5PAGES, + according to --disable-uucode. + * Makefile.in: Adjusted accordingly. + Reported by Andrey A. Chernov. + + * configure.in: Define SCRIPTS separately from PROGRAMS. Use + fp_PROG_INSTALL instead of AC_PROG_INSTALL. + * Makefile.in: Adjusted accordingly. + Reported by Andrey A. Chernov. + +Fri Mar 24 07:57:57 1995 François Pinard (pinard@icule) + + * shar.c (shar): Silence the `Saving...' messages under --quiet. + Reported by Karl Berry. + +Sun Mar 19 10:32:45 1995 François Pinard (pinard@icule) + + * configure.in: Remove GLOCALE, add LINGUAS, use fp_WITH_CATALOGS. + * Makefile.in: Modify accordingly. + * acconfig.h: Add description for WITH_CATALOGS. + * system.h: Use WITH_CATALOGS to define _() differently. + +Fri Feb 24 20:09:20 1995 Francois Pinard (pinard@icule) + + * Makefile.in (clean): Remove mail-files, mailshar and remsync. + Reported by Eric Backus. + + * contrib/Makefile.in: Replace /doc par /contrib everywhere. The + technique used for making this file shows! + Reported by Eric Backus, Joshua R. Poulson and Kaveh R. Ghazi. + + * configure.in: Put gdiff test in parentheses, because Bourne + shell otherwise complains about an inexisting program. + Reported by Kaveh R. Ghazi. + +Tue Feb 21 23:57:25 1995 Francois Pinard (pinard@icule) + + * Prerelease 4.1.4. + + * configure.in, Makefile.in: Replace `date' by `echo timestamp'. + Reported by Greg McGary and Jim Meyering. + +Sun Feb 19 12:06:20 1995 Francois Pinard (pinard@icule) + + * Makefile.in: Support an ID file. Do not distribute TAGS. + Reported by Greg McGary. + +Sun Feb 12 07:21:05 1995 Francois Pinard (pinard@icule) + + Start distributing contrib: + * contrib/*: New files, not detailed nor maintained here. + * configure.in: Set make. Output contrib/Makefile. + * Makefile.in (distclean, dist, dist-shar): Execute in contrib/. + + Start distributing remsync: + * configure.in: Merge remsync's configure.in. + * Makefile.in: Merge remsync's Makefile.in + * mail-files.in, mailshar.in, remsync.in, remsync.texi: New files. + +Sun Feb 5 07:37:19 1995 Francois Pinard (pinard@icule) + + * Makefile.in (maintainer-clean): New name for realclean. + +Sat Dec 17 14:57:41 1994 Francois Pinard (pinard@icule) + + * configure.in: Check for isascii. + * shar.c: Properly define ISASCII after including . + (shar): Use ISASCII before checks if not mandatory prefix mode. + Reported by Bruno Haible and Jim Meyering. + +Tue Dec 13 10:17:57 1994 Francois Pinard (pinard@icule) + + * system.h: Remove STDC_HEADERS test before including , + as HAVE_STRING_H should be able to decide this alone. + +Sat Dec 3 20:04:39 1994 Francois Pinard (pinard@icule) + + * libintl.c: Unprotoize it once and for all. + * Makefile.in: Do not unprotoize libintl.c. With old compilers, + the special rule ensuring LOCALEDIR is defined was bypassed. + Reported by Kaveh R. Ghazi. + + * Makefile.in (realclean): Delete stamp-cod. + Reported by Eric Backus. + +Thu Dec 1 13:36:57 1994 Francois Pinard (pinard@icule) + + * nl.tt: New file, for Dutch. + Reported by Andries E. Brouwer. + +Wed Nov 30 11:01:29 1994 Francois Pinard (pinard@icule) + + * Prerelease 4.1.3. + + * Makefile.in: Install catalog files as `.msg', not `.cat'. + + * configure.in, Makefile.in, acconfig.h, shar.c, unshar.c, + uudecode.c, uuencode.c: Rename PRODUCT to PACKAGE. + Reported by Noah Friedman. + + * configure.in, Makefile.in: Rename GNULOCALE to GLOCALE. + Reported by Richard Stallman. + + * configure.in: Use AC_CHECK_PROG to check for extract-msgs. + Reported by Kaveh R. Ghazi. + + * Makefile.in: Replace libintl.o by libintl$O. + Reported by Kaveh R. Ghazi. + + * system.h: Define setlocale(,) to empty if not HAVE_LOCALE_H. + * shar.c, unshar.c, uudecode.c, uuencode.c: Avoid HAVE_LOCALE_H. + Reported by Jim Meyering and Paul Eggert. + + * shar.c (main): Give "+..." to getopt for repairing the -p option. + `-p -B sv.tt -T shar.c' was turned into `-p -B -T sv.tt shar.c' by + getopt_long, which makes both files be treated as text. + Reported by Jan Djarv. + + * sv.tt: New file, for Swedish. + Reported by Jan Djarv. + + * de.tt: New file, for German. + Reported by Ulrich Drepper. + +Tue Nov 29 19:13:44 1994 Francois Pinard (pinard@icule) + + * shar.c: Change archive_type_position from long to off_t. + * unshar.c (find_archive): Idem for start argument, and position. + * (unarchive_shar_file): Idem for current_position. + Reported by David J. MacKenzie. + + * Makefile.in (locale.c): Add a missing semicolon. + Reported by Bill Aten, Eric Backus and Jan Djarv. + +Mon Nov 28 19:04:56 1994 Francois Pinard (pinard@icule) + + * Prerelease 4.1.1. + + * configure.in: Check if GNU locale available, then substitute + GNULOCALE by yes or no, accordingly. + * Makefile.in: Merely touch locale.c, fr.cat or $(PRODUCT).cod, when + GNU locale is not available. + + * shar.c (shar): Double file_type by file_type_remote, localizing + only the first, and use appropriately. + +Sun Nov 27 14:36:57 1994 Francois Pinard (pinard@icule) + + * Makefile.in: Implement CATALOGS and locale.c. + * libintl.h: New. + * libintl.c: New, inspired by GNU locale gettext.c. + * fr.tt: New translation file for French. + + * Makefile.in: Normalize using temporaries for redirected-to files. + +Sat Nov 26 20:41:23 1994 Francois Pinard (pinard@icule) + + * configure.in: Check for . + * system.h, shar.c, uudecode.c, uuencode.c: Rename _ to __P. + * system.h: Include if we have it. Always include + , then declare _ as gettext. + * shar.c, unshar.c, uudecode.c, uuencode.c: Call setlocale if we + have . Use _ macro over all localizable strings. + +Tue Nov 15 23:13:18 1994 Francois Pinard (pinard@icule) + + * shar.c: Do not include , since it is already + included indirectly via "system.h". + Reported by Harlan Stenn and Kaveh R. Ghazi. + +Thu Nov 10 02:05:43 1994 Francois Pinard (pinard@icule) + + * shar.c (shar): Use putc instead of fputc. + * unshar.c (unarchive_shar_file): Use getc and putc, instead of + fgetc and fputc. + +Wed Nov 9 12:50:00 1994 Francois Pinard (pinard@icule) + + * Makefile.in (install-man): Do not transform the source name of + uuencode.5 while installing, only the destination name. + Reported by David MacKenzie. + +Tue Nov 8 11:44:00 1994 Francois Pinard (pinard@icule) + + * shar.c (main): Output the `Created N files' in quiet mode only. + When not quiet, we already get one message per archive generated. + +Mon Nov 7 15:09:11 1994 Francois Pinard (pinard@icule) + + * Makefile.in (stamp-vti): Use new -r option to date. + + * shar.c: Allow more flexibility in -o by allowing a sprintf + format. When no `%' characters in format, do as before. + (open_output, close_output): New routines. Also check result + returned by fopen and fclose. + Reported by Paul A. Vixie. + +Sat Nov 5 15:57:17 1994 Francois Pinard (pinard@icule) + + * Version 4.1. + + * Makefile.in (realclean): Also remove stamp-vti. + Reported by Eric Backus. + + * uudecode.c: Declare getpwnam. + Reported by Christopher Sawtell. + + * configure.in: Check is stat macros are dependable. + * system.h: Include and define permission bits. + Conditionnaly define S_ISDIR and S_ISREG. + * shar.c: Use S_ISDIR and S_ISREG. + * uudecode.c, uuencode.c: Delete code now in "system.h". + Reported by Andy Seaborne. + +Wed Nov 2 00:24:41 1994 Francois Pinard (pinard@icule) + + * shar.c: Delete verbose_mode and -v, which was a poor choice for + meaning *no*-verbose. Instead, introduce quiet_mode and + quiet_unshar_mode, driven by new options -q and -Q. + Reported by Christopher Sawtell. + + * uuencode.c: Normalize usage (), use EXIT_* symbols and error (). + * uudecode.c: Idem. Also rename rval to exit_status. + + Some systems (DEC Alpha OSF 2.0) declares basename with a + non-const argument in , so conflicting with "system.h". + * configure.in: Check for basename, replace it when not found. + + * configure.in: Check for const only after having found possible + ANSIfying compiler flags, this is of no use to check it before. + + * Makefile.in: Adjusted. + * system.h: Use a degenerated prototype when basename found. + Reported by Kaveh R. Ghazi and Nelson Beebe. + +Tue Nov 1 23:11:26 1994 Francois Pinard (pinard@icule) + + * uudecode.c, uuencode.c: Remove inclusion of and + , already included from "system.h". + Reported by Christopher Sawtell. + + * configure.in: Check if closedir return void. CLOSEDIR_VOID was + already tested in shar.c, but the symbol not configured. + Reported by Karl Vogel, Kaveh Ghazi and Michael Rendell. + +Mon Oct 31 20:59:16 1994 Francois Pinard (pinard@icule) + + * Makefile.in (BACKLOG): Goal deleted. It was depending on files + which are not part of the distribution. + + * uudecode.c, uuencode.c: Declare program_name const char *, not + static char *. + Reported by Andy Seaborne, Eric Backus, Joseph E. Sacco, Karl + Vogel and Kaveh R. Ghazi. + +Sun Oct 30 08:30:35 1994 Francois Pinard (pinard@icule) + + * configure.in: Check for fchmod. + * uudecode.c: Use chmod if fchmod does not exist. + Reported by Andrew Walduck, Andrew B. Smith, Bill Campbell, + Christopher Sawtell, Donald Page, Elliott Pacetti and Robert J.C. + Kyanko. + + * configure.in: Check for memcpy and strchr. + * system.h: Rearrange how mem* and str* are used. + Reported by Kaveh R. Ghazi. + + * configure.in: When cross-compiling, do not check if characters + are unsigned, and let __CHAR_UNSIGNED__ undefined. This is safe. + Reported by David MacKenzie. + + * system.h: Use #if rather than #ifdef to check __STDC__. + + * Makefile.in: Clean up, following the one in GNU m4. I will not + detail all the changes here. + * configure.in: Likewise. Also added --disable-uucode. + + * acconfig.h: Document PRODUCT and VERSION. + * version.c: Deleted. + * shar.h: Delete previous VERSION definition. + * shar.c, unshar.c, uudecode.c, uuencode.c: Use PRODUCT and VERSION. + * Makefile.in: Adjusted. + + * system.h: Renamed from shar.h. All includers adjusted. + * alloca.c: New, from elsewhere. + * configure.in: Configure alloca. + * Makefile.in: Adjusted. + + * Makefile.in (BACKLOG): New. Distribute file BACKLOG. + + * Makefile.in (TAGS): Distribute it. Clean it in realclean. + Reported by Karl Berry. + +Sat Oct 15 21:57:42 1994 Francois Pinard (pinard@icule) + + * remsync/configure.in: Find Perl path and substitute in remsync. + * remsync/remsync.in: New name for remsync.pl. Use @PERL@ in it. + * remsync/Makefile.in: Adjusted. + Reported by Jim Meyering. + +Sun Oct 9 08:43:28 1994 Francois Pinard (pinard@icule) + + * shar.h: Get rid of CONFIG_BROKETS. + +Wed Oct 5 01:52:22 1994 Francois Pinard (pinard@icule) + + * Corrected various bugs and improve a few functionnalities in + remsync/. No need for a detailed ChangeLog here, before the + package is released for true. I will only reported other's + changes for now. + +Sat Sep 24 09:49:22 1994 Francois Pinard (pinard@icule) + + * encode.c: New name for uushar.c. + * Makefile.in: Adjusted. + +Fri Sep 23 08:20:10 1994 Francois Pinard (pinard@icule) + + * uudecode.c: Include before . + Reported by Andrew Walduck, Christopher Sawtell, Gregory Neil + Shapiro, Horst von Brand, Ian Jackson, Karl Berry, Kaveh R. Ghazi, + Ken Olstad, Meade Roberts, Nelson H. F. Beebe and Richard Segal. + + * Makefile.in: Handle uudecode and uuencode installation. + (man1dir, man1ext): Renamed from mandir and manext. + (libshutl.a): Renamed from libshar.a. + (check): New, from GNU uuencode-1.0's Makefile.in. + * testdata, uudecode.c, uudecode.1, uuencode.c, uuencode.1, + uuencode.5, version.c : New, from GNU uuencode-1.0. + + Rename the package from shar to sharutils: + * shar.h (VERSION): Define to "GNU sharutils M.N", instead of only + numbers, to account for the change in the name of the package. + * shar.c (generate_full_header, main): Adapt. + * unshar.c (main): Adapt. + * sharutils.texi: Renamed from shar.texinfo. + * Makefile.in: Adjust file names for documents. + + * shar.c (main): Initialize program_name from argv[0] without + basename'ing it. + * unshar.c (main): Idem. + Reported by Karl Berry. + +Tue Sep 13 12:52:40 1994 Francois Pinard (pinard@icule) + + * shar.c (generate_configure): Echo a message suggesting the + installation of GNU touch when no valid touch is found. + +Thu Sep 8 21:33:43 1994 Francois Pinard (pinard@icule) + + * configure.in: Use AC_FUNC_STRFTIME. + +Tue Sep 6 12:08:49 1994 Francois Pinard (pinard@icule) + + * Makefile.in (TAGS): Remove -t from etags call. + +Fri Sep 2 14:19:09 1994 Francois Pinard (pinard@icule) + + * whoami.c: Include prior to . + * configure.in: Check for . + Reported by Michael Rendell. + +Thu Sep 1 19:28:36 1994 Francois Pinard (pinard@icule) + + * Version 4.0. + + * shar.c: Replace optional_prefix_mode with mandatory_prefix_mode, + with inverted meaning. + (main): Delay setting the mode to after parameter decoding. + Initialize to -T instead of -M in vanilla mode, if not otherwise + set. Diagnose any override. + Reported by Eric Backus. + + * Makefile.in (LIBOBJS): Cut the line differently, so \ will be + followed by something even if @LIBOBJS@ sustitutes to nothing. + Reported by Andy Seaborne and Dave Anglin. + +Wed Aug 31 12:14:04 1994 Francois Pinard (pinard@icule) + + * Makefile.in (distclean): Delete config.log. + +Sun Aug 28 14:38:07 1994 Francois Pinard (pinard@icule) + + * shar.c (main): Cast byte_is_binary to (char *) for memset's. + Reported by Joseph E. Sacco. + +Fri Aug 26 16:23:58 1994 Francois Pinard (pinard@icule) + + * unshar.c (matched_by): Initialize pattern_cursor and + result_cursor to NULL, for fails to be properly handled. + Reported by Joseph E. Sacco. + + * shar.c (shar): Give some value to input and remaining_size. + Reported by Joseph E. Sacco. + +Thu Aug 25 14:52:28 1994 Francois Pinard (pinard@icule) + + * shar.c (main): In vanilla mode (-V), defaults to text mode (-T) + instead of mixed mode (-M). + Reported by Eric Backus. + + * shar.c (generate_configure): New name for generate_touch_test. + When -X, configure a way for doing echo without newline, copying + the trick from Autoconf 2.0's AC_PROG_ECHO_N. Do something simple + when in vanilla mode. + (shar): Do not use newlines with questions. Rename shar_reply to + shar_skip, with meaning reversed, other little cleanups. + + * shar.c (generate_configure): Configure if /dev/tty exists, + copying the trick from older GNU tar configure.in. Do not use + /dev/tty when in vanilla mode. + (shar): Possibly use /dev/tty to read the user reply. This + should help using unshar to read shars generated with -X. + Reported by Eric Backus. + + * configure.in: Replace mktime if missing. + * mktime.c: New, from elsewhere. + * Makefile.in: Distribute it. + Reported by Karl Vogel and Kaveh R. Ghazi. + +Wed Aug 24 08:54:03 1994 Francois Pinard (pinard@icule) + + * configure.in: Implement --with-dmalloc. + * acconfig.h: Document WITH_DMALLOC. + * shar.h: Add code for when WITH_DMALLOC. + + * shar.c (walktree): To know how to initialize restore_name, check + local_name_copy, not restore_name! + Reported by Andy Seaborne. + +Tue Aug 23 20:13:38 1994 Francois Pinard (pinard@icule) + + * shar.c (mode_string): Declare argument unsigned, instead of + unsigned short. This eliminates warnings on some systems. + (shar): Cast masked st_mode to unsigned int, for matching format. + * unshar.c (main): Cast getpid to int, for matching format. + + * configure.in: Use `-g -O' instead of `-g' as CFLAGS default + value, when GNU C is being used. Delay testing for presets. + + * Makefile.in (dist, shar): Correct for when a different build + directory. + + * configure.in: Replace strftime if missing, and study struct tm. + * strftime.c: New, from elsewhere. + * Makefile.in: Distribute it. + * shar.c (generate_full_header): Use it, instead of printing UTC. + Reported by Ulrich Drepper. + + * shar.c (walktree): Merge both versions, using NO_WALKTREE to + choose which heart to execute. Remove length limitation on names. + Copy the received name, remove trailing slashes from the copy + before further processing, free the copy at end. Trailing + backslashes were showing duplicated in the generated shar. Use + basename instead of explicit code. + (walkdown): Revised. Remove length parameter on call. Remove + length limitations on names. Do not restore the string terminator + for error messages, since the original string is not altered anymore. + * xstrdup.c: New, from elsewhere. + * Makefile.in: Compile it, distribute it. + * shar.h: Declare xstrdup. Also declare xrealloc. + + * shar.c, unshar.c: Remove register specifiers. + + * shar.c: Refresh for Autoconf 2.0 renamings about dirent. + Reported by Karl Vogel and Kaveh R. Ghazi. + +Mon Aug 15 12:46:19 1994 Francois Pinard (pinard@icule) + + Get rid of warnings in unshar.c about undeclared system functions. + * shar.h: Include if we have it. + * shar.c: Don't. + Reported by Joseph E. Sacco. + + * shar.c (shar): Define file_type earlier, for error messages. + Reported by Andy Seaborne and Joseph E. Sacco. + +Sat Aug 13 09:19:01 1994 Francois Pinard (pinard@icule) + + * configure.in: Check for . + * shar.h: Include if we have it. + + * shar.c (mode_string): Renamed from mode_map. Remove unused + code, `t' editing, and second argument. + (generate_one_header_line): Do not pass a second NULL argument to + mode_string. Do not mask out bits which are untested anyway. + +Fri Aug 12 09:57:07 1994 Francois Pinard (pinard@icule) + + * shar.c (shar): Use `uudecode FILE < FILE' instead of just + `uudecode < FILE', for those uudecode unwilling to merely read + their standard input. This will work only when -P is used. + Reported by Laurent Bourbeau. + +Thu Aug 11 01:16:36 1994 Francois Pinard (pinard@icule) + + * shar.c (shar): Add newlines to incomplete lines inside the + reading loop, instead of after it; because fgets should not alter + the buffer when it returns NULL. Also remove useless similar + lines in code for switching files. + Reported by Eric Backus. + +Wed Aug 10 14:12:42 1994 Francois Pinard (pinard@icule) + + * shar.c (shar): Completely avoid sed, compress, gzip and uuencode + for empty files. Just touch or empty files instead, while ensuring + restoration of access modes and time stamps, as usual. + Reported by Eric Backus. + + * shar.c (usage): Say that -M, not -T, is the default. + Reported by Eric Backus. + + * Makefile.in (prefix, exec_prefix): Get value from configure. + Reported by Eric Backus and Gordon Joly. + + * configure.in: Use a memset replacement as required. + * memset.c: New, from elsewhere. + * Makefile.in: Use it, distribute it. + Reported by Karl Vogel and Kaveh R. Ghazi. + +Tue Aug 9 13:44:28 1994 Francois Pinard (pinard@icule) + + * configure.in: Updated for Autoconf 2.0. + * Makefile.in (distclean): Remove config.cache. + +Sat Jul 30 11:52:43 1994 Francois Pinard (pinard@icule) + + * shar.c (generate_full_header): Use time_t instead of long. + Reported by David J. MacKenzie and Michael Rendell. + +Fri Jul 29 08:53:32 1994 Francois Pinard (pinard@icule) + + * shar.c (usage): Improve the wording, here and there. + Reported by Karl Berry. + +Thu Jul 28 17:26:00 1994 Francois Pinard (pinard@icule) + + * shar.c (shar): Capitalize `Saving...' messages, also use lower + case for file types. + + * unshar.c (unarchive_shar_file): Use `sh -s - -c' if pass_c_flag. + Bash as sh diagnosed a missing argument to -c with `sh -s -c'. + + * shar.c (shar): For mixed mode determination, look for special + characters in the input file, instead of calling `file' on the + input file and studying its output. + (main): Initialize the byte_is_binary table. + * configure.in: Find out if characters are signed or not. + Reported by Andrey A. Chernov and Jan Djarv. + + * shar.c (shar): Do not try completing an incomplete line with a + newline, if that incomplete line contains no character. This case + occurs for an empty file, in particular. + Reported by Eric Backus and Jan Djarv. + + * shar.c (set_file_mode): New routine. Use it at places where the + various file_mode variables were set. + (main): Allow for intermixing -M when -p. Make -M the default. + Reported by Eric Backus and Karl Berry. + +Thu Jul 21 21:04:12 1994 Francois Pinard (pinard@icule) + + * Makefile.in (realclean): Do not remove stamp-h.in. + Reported by Karl Berry. + +Tue Jul 19 09:58:03 1994 Francois Pinard (pinard@icule) + + * Avoid declaring getpwuid with POSIX, as per GNU find 3.8. + Reported by Kaveh R. Ghazi. + +Mon Jul 18 21:06:41 1994 Francois Pinard (pinard@icule) + + * Makefile.in: Use $(binprefix). + Reported by Gordon Joly. + +Sat Jul 16 09:28:47 1994 Francois Pinard (pinard@icule) + + * shar.c: Change `shar' by `GNU shar' wherever the program + identifies itself. + * unshar.c: Change `unshar' by `GNU unshar' wherever the program + identifies itself. + + * shar.texinfo: New documentation. + * Makefile.in: Prepare and install GNU documentation. This solves + a problem about exit status for an if with no else in install. + (install): Do not install man pages anymore, they are obsolete. + (install-man): New goal, for those who do want obsolete things. + Reported by Karl Berry. + +Fri Jul 15 11:19:10 1994 Francois Pinard (pinard@icule) + + * Version 3.52.3. + + * shar.c: Add -z and -Z options, change --compressed-files to + --compress and --gzipped-files to --gzip, also --uuencoded-files + to --uuencode for uniformity. Have -C tell it will be deprecated. + Reported by Noah Friedman. + + * shar.c: Rename --normal-files to --text-files, --maybe-uuencoded + to --mixed-uuencode. + + * shar.c (main): Dynamically initialize output to stdout, instead + of statically. GNU libc does not allow stdout as a constant. + Reported by Joseph E. Sacco. + + * shar.c (shar): Protect lines already starting with the sed + prefix, so `X' will be preserved at beginning of lines. + Reported by Eric Backus. + +Thu Jul 14 10:14:44 1994 Francois Pinard (pinard@icule) + + * Version 3.52.2. + + * shar.c, unshar.c: Install long options, --help and --version. + + * shar.c (walktree, walkdown): Use walker_t instead of explicit + functionnal argument, for easing ansi2knr's life. + Reported by Andy Seaborne, Karl Vogel and Thomas E. Dickey. + +Wed Jul 13 15:23:55 1994 Francois Pinard (pinard@icule) + + * basename.c: New, from elsewhere. + * shar.h: Declare basename. Remove strrchr definition. + * Makefile.in: Adjusted. + * shar.c: Use basename instead of strrchr. + + * shar.c (shar): Correct a few things in the generated scripts... + Indent them the way configure scripts are. Protect restored file + name with quotes when used with chown. Limit shar work file names + to 12 characters beginning with `_shar' and ending with `.tmp'. + Have work shell variables begin with `shar_'. For reading the + part number, use cat inside backticks instead of a parenthesized + subshell. Avoid using the `true' program or script, use the `:' + shell construct instead. Avoid using `test X -a Y', use `test X + && test Y' instead. + +Tue Jul 12 00:07:14 1994 Francois Pinard (pinard@icule) + + The following starts a general cleanup, which will slowly continue + as things evolve, without further entries in this ChangeLog. + * all: Make better use of const, static. Remove unused variables, + rename all others. Uniformize exit codes, error messages, etc. + * shar.h: Renamed from system.h. Move in some common declarations + from other modules, add missing declarations. + * Makefile.in: Adjusted. + + * Makefile.in (dist-shar): New goal. Since shar parts have to be + unshared in sequence, we can rely on the order in which files are + shar'ed to induce a good topological order in the timestamps at + the receiving site. DISTFILES ordering is important from now on. + Reported by Thomas E. Dickey. + + * shar.c (setTOUCH): Ensure that touch does use the date, the + previous test was grepping standard error, it was doomed to fail. + Reported by Bill Aten and Thomas E. Dickey. + + * shar.c: Use the touch feature by default in generated shars, the + timestamps should be transmitted as far as possible. Warn at + unshar time if a shar file needs touch, and if touch is found to + be unusable. Try to avoid clashes when there are many unshar's + running in parallel. This code is not completely solid, yet the + probability of a clash is far weaker than before. + + * Makefile.in (distclean): Remove stamp-h. + (realclean): Remove stamp-h.in. + Reported by Thomas E. Dickey. + +Mon Jul 11 22:34:53 1994 Francois Pinard (pinard@icule) + + * shar.c (shar): Consider a tilde at the beginning of a line as + special. This avoids trouble when using an old version of mail to + send a shar file. + Reported by Karl Vogel. + + * system.h: Remove declaration of malloc and realloc, they are + unused. + Declare voidstar depending on __STDC__. + Check PROTOTYPES instead of __STDC__ for defining _(). + + * shar.c: Declare xmalloc. Use it instead of malloc. + Remove some useless code to report memory allocation errors. + + * Makefile.in (clean): Remove ansi2knr executable. + Reported by Karl Vogel. + + * Makefile.in (install): Do not try installing shar.info, it does + not exist yet. + Reported by Bill Aten, Karl Vogel and Thomas E. Dickey. + + * configure.in: Have CFLAGS and LDFLAGS substituted from the + environment. + Reported by Karl Vogel. + + * configure.in: Use special defines fo AIX and Minix. + +Fri Jul 8 00:17:45 1994 Francois Pinard (pinard@icule) + + * ansi2knr.1: New file, from elsewhere. + * Makefile.in (DISTFILES): Distribute it. + + * shar.c, unshar.c, uushar.c, who@where.c: Merge in successive + diffs from 3.49 towards 3.52, privately sent around 1990-10. + Reported by Richard H. Gumpertz. + + * remsync/mail-files: Wait only 4 seconds between mailings, + instead of 8. + +Tue Jun 7 00:05:11 1994 Francois Pinard (pinard@icule) + + * remsync/find-mailer: Use -f instead of -x. Not only -x is not + portable enough, but if a ~/Mail directory exists, it is wrongly + selected. + Reported by Bernd Nordhausen. + +Sun Jun 5 16:02:15 1994 Francois Pinard (pinard@icule) + + * Version 3.52.1. + + * shar.c, unshar.c, uushar.c, who@where.c: From shar 3.49 + distribution. Remove various logs and group them into file + ChangeLog.shar. Indent sources to GNU standards. Modify as + needed for auto-configuration. Replace perror() by error(). + Replace both getwd() and getcwd() by xgetcwd(). + + * unshar.c: Remove getopt functions, for GNU getopt is used + instead. + + * shar.c: Add -G and -gN for gzip compression. + + * Initial packaging for remsync, but not distributed yet. + mailshar now uses gzip instead of compress, by default. + +This branch pops out of shar, version 3.49, as published on alt.sources +on 1990-09-24. For previous history, see ChangeLog.OLD. + +Mon Aug 23 15:32:00 1993 Ian Lance Taylor (ian@airs.com) + + * Version 1.0 (for uuencode/uudecode). + +Previous history for remsync. + + * May 1994: Single Perl script, named remsync, replacing the + previous corresponding shell scripts mailsync and resync. A clean + rewrap was needed because, after adding many added features, the + scripts became intricate and hard to maintain. I also added other + functionalities, among which the possibility of interactive use. + + * 1992: Shell scripts for synchronization of directory trees: + mailsync, resync. They were depending on many GNU tools. + + * 1992: Shell scripts for automatic selection of a mailer, later + condensed into find-mailer. + + * 1991: Shell scripts for file mailing: mail-file, mailshar, and + many others too specialized for being included here. + + diff --git a/src/apps/bin/sharutils-4.2.1/ChangeLog.OLD b/src/apps/bin/sharutils-4.2.1/ChangeLog.OLD new file mode 100644 index 0000000000..0296cd278e --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/ChangeLog.OLD @@ -0,0 +1,228 @@ +Makefile +======== + +# makefile for shar +# +# $Header: /tmp/bonefish/open-beos/current/src/apps/bin/sharutils-4.2.1/ChangeLog.OLD,v 1.1 2004/03/02 02:51:51 michaelphipps Exp $ +# +#+:EDITS: +#:09-17-1990-12:25-rhg@cps.com-added -DMAXNAMLEN=MAX_NAME to CFLAGS for RT AIX +#:09-17-1990-11:28-rhg@cps.com-replaced NO_DIRENT with USE_DIR and USE_NDIR +#:09-12-1990-21:58-rhg@cps.com-moved strip from before to after cp to ${BINDIR} +#:09-09-1990-20:12-rhg@cps.com-added CLOSEDIR_VOID +#:09-09-1990-11:31-bill@netagw.com-add SHELL variable/-ldir for XENIX/UNIX 386 +#:08-07-1990-21:25-rhg@cps.com-compress man pages if MANEXT ends with .Z +#:08-05-1990-23:50-rhg@cps.com-add post and compressed. +#:08-05-1990-12:19-rhg@cps.com-add LIBS and -ldirent +#:08-04-1990-18:51-rhg@cps.com-add CC, LD; move strip; reorder chgrp/chown. +#:05-14-1990-17:33-wht@n4hgf-add -F 5000 for XENIX 286 +#:05-14-1990-17:32-bill@netagw.com-expanded Makefile +#:03-28-1990-14:54-wht@n4hgf-for 3.10, add who@where.c + +shar.c +====== + +char RCS_ID[] = "$Header: /tmp/bonefish/open-beos/current/src/apps/bin/sharutils-4.2.1/ChangeLog.OLD,v 1.1 2004/03/02 02:51:51 michaelphipps Exp $"; + +/*+:EDITS: */ +/*:09-27-1990-23:40-rhg@cps.com-added check for '.' to the OptPREFIX check */ +/*:09-27-1990-17:10-rhg@cps.com-added USE_GETCWD and getcwd */ +/*:09-27-1990-17:10-rhg@cps.com-added Delim_len to fix PREFIX (yes, again) */ +/*:09-17-1990-11:28-rhg@cps.com-replaced NO_DIRENT with USE_DIR and USE_NDIR */ +/*:09-12-1990-21:55-rhg@cps.com-added check for isgraph undefined (old BSD) */ +/*:09-12-1990-14:24-rhg@cps.com-added missing return(0) to walkdown */ +/*:09-12-1990-14:13-rhg@cps.com-deleted some redundant, unused, code */ +/*:09-12-1990-00:28-rhg@cps.com-added more directions to the shar header */ +/*:09-09-1990-20:12-rhg@cps.com-added CLOSEDIR_VOID */ +/*:09-09-1990-18:42-rhg@cps.com-added check for "From" under OptPREFIX */ +/*:09-09-1990-11:55-rhg@cps.com-modified code under NOT STR(N)CMP_IS_FAST */ +/*:09-08-1990-21:20-rhg@cps.com-added NO_DIRENT for SunOS 3 sys/dir.h */ +/*:09-08-1990-21:04-rhg@cps.com-fixed bug in PREFIX check: strcmp(line,Delim) */ +/*:08-06-1990-00:40-rhg@cps.com-revised Cut message to be more explanatory */ +/*:08-05-1990-14:04-rhg@cps.com-merged Rname into walktree */ +/*:08-05-1990-12:11-rhg@cps.com-added walktree & support for sharing dirs */ +/*:08-05-1990-09:05-rhg@cps.com-change -Bn, -t, and -b to -bn, -T, and -B */ +/*:08-04-1990-15:31-rhg@cps.com-added -Bn to set compress -bn (default 12) */ +/*:08-04-1990-15:31-rhg@cps.com-changed shar3_???_.tmp to _shar_???_.tmp */ +/*:08-04-1990-15:22-rhg@cps.com-added check for "exit 0" under OptPREFIX */ +/*:08-04-1990-14:32-rhg@cps.com-added -m to generate TOUCH (default off) */ +/*:08-04-1990-14:18-rhg@cps.com-reversed the meaning of -x and deleted -O */ +/*:06-14-1990-14:48-rhg@cps.com-made Split and eXists compatible. +/*:06-14-1990-14:18-rhg@cps.com-made -x the default and added -O +/*:06-14-1990-12:44-rhg@cps.com-always terminate the && and report failures +/*:06-14-1990-12:28-rhg@cps.com-clear mkdir_already between -l files +/*:06-14-1990-12:14-rhg@cps.com-change PREFIX from a #define to an int variable. +/*:04-19-1990-22:49-rhg@cps.com-get rid of "set" so "sh sharfil -c" will work */ +/*:04-19-1990-21:52-rhg@cps.com-add -F to clear OptPREFIX */ +/*:04-18-1990-08:49-rhg@cps.com-add OptPREFIX (for now, always on) */ +/*:07-09-1990-19:24-wht@n4hgf-back to fgrep amc -- fits more -m touches */ +/*:07-01-1990-18:37-wht@n4hgf-wait() needed after fork() */ +/*:05-19-1990-02:47-wht@n4hgf-change fgrep amc to mmdd */ +/*:05-16-1990-01:53-wht@n4hgf-Archive-name had extra period sometimes */ +/*:05-10-1990-20:39-wht@n4hgf-altos does not not like at-sign in filenames */ +/*:05-10-1990-13:38-wht@n4hgf-add -V Vanilla mode */ +/*:05-07-1990-00:06-wht@n4hgf-test all mallocs for Purity Of Essence */ +/*:05-07-1990-00:06-wht@n4hgf-add -S switch */ +/*:05-05-1990-01:37-relay.EU.net!rivm!a3-dont assume vax is running BSD */ +/*:04-18-1990-02:01-wht@n4hgf-3.20 rhg@cps.com did all the NICE work */ +/*:04-17-1990-14:30-rhg@cps.com-pretty up if-then-else-fi in shar file */ +/*:04-17-1990-12:13-rhg@cps.com-add Split and renamed old -l to -L */ +/*:04-17-1990-12:13-rhg@cps.com-add -c option to shar file execution */ +/*:04-17-1990-11:20-rhg@cps.com-simplify TOUCH logic in shar file */ +/*:04-17-1990-10:27-rhg@cps.com-create setTOUCH to avoid duplicate code */ +/*:04-17-1990-04:43-rhg@cps.com-add missing && to commands in shar file(s) */ +/*:04-17-1990-02:03-rhg@cps.com-add Compress */ +/*:04-16-1990-17:08-rhg@cps.com-add AvoidPipes as well as code to use pipes */ +/*:04-03-1990-20:09-wht@n4hgf-3.11 */ +/*:04-01-1990-13:20-pat@rwing-correct case on M option in getopt() call */ +/*:04-01-1990-13:50-pat@rwing-change defaults on -v, -w to be on */ +/*:03-29-1990-18:23-wht@n4hgf-add automatic sequent support */ +/*:03-28-1990-15:56-wht@n4hgf-add mode and length net.bandwidth chrome */ +/*:03-28-1990-14:23-wht@n4hgf-correct some runtime diagnostics */ +/*:11-14-1989-02:21-wht-SHAR_EOF was botched if last file char not newline */ +/*:11-02-1989-14:11-wht-add touch -am */ + +/* + Shar puts readable text files together in a package + from which they are easy to extract. + earlier attribution wht@n4hgf has: decvax!microsof!uw-beave!jim + (James Gosling at CMU) + */ +/* + * I have made several mods to this program: + * + * 1) the -----Cut Here-----... now preceds the script. + * 2) the cat has been changed to a sed which removes a prefix + * character from the beginning of each line of the extracted + * file, this prefix character is added to each line of the archived + * files and is not the same as the first character of the + * file delimeter. + * 3) added several options: + * -c - add the -----Cut Here-----... line. + * -d'del' - change the file delimeter to del. + * -s - cause the resulting script to print the wc of + * the orignal file and the wc of the extracted + * file. + * + * Michael A. Thompson + * Dalhousie University + * Halifax, N.S., Canada. + */ + +/* + * I, too, have been hacking this code. This is the version on sixhub + * bill davidsen (davidsen@sixhub.uucp) + * + * - added support for binary files + * - automatic creation of limited size multiple file archives, + * each of which may be unpacked separately, and with sequence + * checking. + * - support for mixed text and binary files + * - preserve file permissions + * - restore to filename rather than pathname + * + */ +/* + * One good hack deserves another ... this version generates shell + * code which attempts to create missing directories + * handle deviants sun, vax, pyr (pyramid), SCO XENIX/UNIX automatically + * for sequent, add -DBSD42 + * force Verbose on + * if unsharing system's touch Sys V compatible (allows touch -m), + * restore file dates + * -n switch puts an alpha "name" in header + * -a (if also -n) puts "Submitted-by:" & "Archive-name: /part## + * use getopt + * as well as some other chrome-plated junque + * ...!gatech!emory!tridom!wht (wht%n4hgf@gatech.edu) Warren Tucker + * + * 3.11 - Fri Apr 6 14:21:51 EDT 1990 + * With due deference to davidsen@sixhub, more changes..... copies + * of this, like 3.10, were mailed to him: + * From wht Fri Apr 6 15:14:30 1990 remote from n4hgf + * Received: by n4hgf.UUCP (smail2.5-UNIX/386 5.3.2) + * id AA01781; 6 Apr 90 15:14:30 EDT (Fri) + * Date: Fri, 6 Apr 90 15:14:30 EDT + * X-Mailer: Mail User's Shell (6.5 4/17/89) + * From: wht@n4hgf (Warren Tucker) + * To: davidsen@sixhub + * Subject: shar 3.11 + * X-Bang-Reply-to: gatech!n4hgf!wht -or- emory!tridom!n4hgf!wht + * Reply-to: wht%n4hgf@gatech.edu + * Message-Id: <9004061514.AA01781@n4hgf.UUCP> + * + * 1. changes suggested by pat@rwing (Pat Myrto) and silvert@cs.dal.ca + * (Bill Silvert) + * 2. fixes to who_am_i code in who@where.c + * + * 3.20 - Wed Apr 18 01:58:32 EDT 1990 + * changes were made per edit notes by + From: gatech!mailrus!uunet!cpsolv.CPS.COM!rhg (Richard H. Gumpertz) + * ...!gatech!n4hgf!wht (wht%n4hgf@gatech.edu) Warren Tucker + * + */ + +unshar.c +======== + +char RCS_ID[] = "$Header: /tmp/bonefish/open-beos/current/src/apps/bin/sharutils-4.2.1/ChangeLog.OLD,v 1.1 2004/03/02 02:51:51 michaelphipps Exp $"; + +/* HISTORY + * 27-Sep-90 Richard H. Gumpertz (rhg@cps.com) + * add check for EXTERNAL_GETOPT to suppress the built-in getopt. (The + * builtin getopt is nice because it makes unshar more easily portable.) + * 12-Sep-90 Richard H. Gumpertz (rhg@cps.com) + * use fprintf instead of printf when printing error return from getwd. + * deleted unused initialization of more_to_read in process. + * changed ch from char to int in process so the EOF check would work. + * 4-Aug-90 Richard H. Gumpertz (rhg@cps.com) + * renamed -c and -C to -e and -E and added -c flag (passed through to sh) + * 24-Apr-90 Richard H. Gumpertz (rhg@cps.com) + * rewrote ENC() to use a more efficient formula + * 19-Apr-90 Colas Nahaboo (colas@mirsa.inria.fr) + * added -c and -C flags to read from concatenated archives + * 1-Feb-85 Guido van Rossum (guido@mcvax) at CWI, Amsterdam + * Added missing 'quit' routine; + * added -d flag to change to directory first; + * added filter mode (read stdin when no arguments); + * added 'getopt' to get flags (makes it self-contained). + * 29-Jan-85 Michael Mauldin (mlm) at Carnegie-Mellon University + * Created. + ****************************************************************/ +/*+:EDITS: */ +/*:08-04-1990-15:54-rhg@cps.com-changes listed above (-c/-C => -e/-E, new -c) */ +/*:05-05-1990-01:37-relay.EU.net!rivm!a3-dont assume vax is running BSD */ +/*:04-19-1990-15:20-wht@n4hgf-fix so -d doesnt make argv files unreachable */ +/*:04-19-1990-15:06-wht@n4hgf-colas@mirsa patches had expanded tabs */ +/*:04-10-1990-22:02-wht@n4hgf-stdin failed sometimes-can not seek on pipe */ + +And for stlmatch: + + * HISTORY + * 18-May-82 Michael Mauldin (mlm) at Carnegie-Mellon University + * Ripped out of CMU lib for Rog-O-Matic portability + * 20-Nov-79 Steven Shafer (sas) at Carnegie-Mellon University + * Rewritten for VAX from Ken Greer's routine. + * + * Originally from klg (Ken Greer) on IUS/SUS UNIX + +uushar.c +======== + +/* $Header: /tmp/bonefish/open-beos/current/src/apps/bin/sharutils-4.2.1/ChangeLog.OLD,v 1.1 2004/03/02 02:51:51 michaelphipps Exp $ */ + +who@where.c +=========== + +/* $Header: /tmp/bonefish/open-beos/current/src/apps/bin/sharutils-4.2.1/ChangeLog.OLD,v 1.1 2004/03/02 02:51:51 michaelphipps Exp $ */ + + ...!gatech!kd4nc!n4hgf!wht (wht%n4hgf@gatech.edu) + +/*+:EDITS: */ +/*:09-12-1990-01:04-rhg@cps.com-added declarations of strcpy and strcat */ +/*:09-09-1990-19:49-rhg@cps.com-added explicit return statement to who_where */ +/*:04-03-1990-19:55-wht@n4hgf-get rid of complicated who_am_i */ +/*:04-01-1990-13:30-pat@rwing-use utsname.nodename instead of sysname */ +/*:04-02-1990-12:12-wht@n4hgf-sigh... some pwd.h dont declare functions */ +/*:03-29-1990-18:23-wht@n4hgf-add automatic sequent support */ +/*:03-28-1990-15:24-wht@n4hgf-creation */ diff --git a/src/apps/bin/sharutils-4.2.1/INSTALL b/src/apps/bin/sharutils-4.2.1/INSTALL new file mode 100644 index 0000000000..0338fbce27 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/INSTALL @@ -0,0 +1,167 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source 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'. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Using a Different Build Directory +================================= + + You can compile the package in a different directory from the one +containing the source code. Doing so allows you to compile it on more +than one kind of computer at the same time. 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 `..'. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Save the results of the tests in FILE instead of `config.cache'. + Set FILE to `/dev/null' to disable caching, for debugging + `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + diff --git a/src/apps/bin/sharutils-4.2.1/Jamfile b/src/apps/bin/sharutils-4.2.1/Jamfile new file mode 100644 index 0000000000..b3976f87a2 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/Jamfile @@ -0,0 +1,4 @@ +SubDir OBOS_TOP src apps bin sharutils-4.2.1 ; + +SubInclude OBOS_TOP src apps bin sharutils-4.2.1 lib ; +SubInclude OBOS_TOP src apps bin sharutils-4.2.1 src ; diff --git a/src/apps/bin/sharutils-4.2.1/Makefile b/src/apps/bin/sharutils-4.2.1/Makefile new file mode 100644 index 0000000000..29026d0a16 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/Makefile @@ -0,0 +1,119 @@ +# Generated automatically from Makefile.in by configure. +# Main makefile for GNU Shar utility package. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = sharutils +VERSION = 4.2.1 + +SHELL = /bin/sh + + +srcdir = . + +DISTFILES = COPYING AUTHORS BACKLOG ChangeLog ChangeLog.OLD INSTALL \ +Makefile.in ABOUT-NLS NEWS README README.OLD THANKS TODO \ +acconfig.h aclocal.m4 config.h.in configure configure.in install-sh \ +mkinstalldirs stamp-h.in README-alpha + +SUBDIRS = doc lib po intl src checks contrib + +all: all-recursive + +all-recursive install install-exec install-data uninstall TAGS ID \ +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive check: config.h Makefile + for subdir in $(SUBDIRS); do \ + target=`echo $@|sed 's/-recursive//'`; \ + echo making $$target in $$subdir; \ + (cd $$subdir && $(MAKE) $$target) \ + || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + +install-man: config.h Makefile + echo making $@ in doc + cd doc && $(MAKE) $@ + +distdir = $(PACKAGE)-$(VERSION) +dist: Makefile + rm -fr $(distdir) + mkdir $(distdir) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + for subdir in $(SUBDIRS); do \ + mkdir $(distdir)/$$subdir || exit 1; \ + (cd $$subdir && $(MAKE) $@) || exit 1; \ + done + tar zchovf $(distdir).tar.gz $(distdir) + rm -fr $(distdir) + +tags: TAGS +id: ID + +mostlyclean: mostlyclean-recursive mostlyclean-local + +clean: clean-recursive clean-local + +distclean: distclean-recursive distclean-local + rm -f config.status + +maintainer-clean: maintainer-clean-recursive maintainer-clean-local + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f config.status + +mostlyclean-local: + +clean-local: mostlyclean-local + +distclean-local: clean-local + rm -f Makefile config.cache config.h config.log stamp-h tupdate.perl + +maintainer-clean-local: distclean-local + +check: + +dvi info: + cd doc && $(MAKE) $@ + +# For understanding the following see the autoconf manual. +configure: configure.in aclocal.m4 + cd $(srcdir) && autoconf + +# autoheader might not change config.h.in +config.h.in: stamp-h.in +stamp-h.in: configure.in acconfig.h + cd $(srcdir) && autoheader + rm -f $(srcdir)/stamp-h.in && echo timestamp > $(srcdir)/stamp-h.in + +#config.status might not change config.h +# Don't rerun config.status if we just configured. +config.h: stamp-h +stamp-h: config.h.in config.status + test ! -f stamp-h || ./config.status + rm -f stamp-h && echo timestamp > stamp-h + +Makefile: Makefile.in config.status + ./config.status + +config.status: configure config.h.in + ./config.status --recheck + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/Makefile.in b/src/apps/bin/sharutils-4.2.1/Makefile.in new file mode 100644 index 0000000000..e6d074014c --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/Makefile.in @@ -0,0 +1,119 @@ +# Main makefile for GNU Shar utility package. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +VPATH = @srcdir@ + +DISTFILES = COPYING AUTHORS BACKLOG ChangeLog ChangeLog.OLD INSTALL \ +Makefile.in ABOUT-NLS NEWS README README.OLD THANKS TODO \ +acconfig.h aclocal.m4 config.h.in configure configure.in install-sh \ +mkinstalldirs stamp-h.in @DIST_ALPHA@ + +SUBDIRS = doc lib @POSUB@ @INTLSUB@ src checks contrib + +all: all-recursive + +all-recursive install install-exec install-data uninstall TAGS ID \ +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive check: config.h Makefile + for subdir in $(SUBDIRS); do \ + target=`echo $@|sed 's/-recursive//'`; \ + echo making $$target in $$subdir; \ + (cd $$subdir && $(MAKE) $$target) \ + || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + +install-man: config.h Makefile + echo making $@ in doc + cd doc && $(MAKE) $@ + +distdir = $(PACKAGE)-$(VERSION) +dist: Makefile + rm -fr $(distdir) + mkdir $(distdir) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + for subdir in $(SUBDIRS); do \ + mkdir $(distdir)/$$subdir || exit 1; \ + (cd $$subdir && $(MAKE) $@) || exit 1; \ + done + tar zchovf $(distdir).tar.gz $(distdir) + rm -fr $(distdir) + +tags: TAGS +id: ID + +mostlyclean: mostlyclean-recursive mostlyclean-local + +clean: clean-recursive clean-local + +distclean: distclean-recursive distclean-local + rm -f config.status + +maintainer-clean: maintainer-clean-recursive maintainer-clean-local + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f config.status + +mostlyclean-local: + +clean-local: mostlyclean-local + +distclean-local: clean-local + rm -f Makefile config.cache config.h config.log stamp-h tupdate.perl + +maintainer-clean-local: distclean-local + +check: + +dvi info: + cd doc && $(MAKE) $@ + +# For understanding the following see the autoconf manual. +configure: configure.in aclocal.m4 + cd $(srcdir) && autoconf + +# autoheader might not change config.h.in +config.h.in: stamp-h.in +stamp-h.in: configure.in acconfig.h + cd $(srcdir) && autoheader + rm -f $(srcdir)/stamp-h.in && echo timestamp > $(srcdir)/stamp-h.in + +#config.status might not change config.h +# Don't rerun config.status if we just configured. +config.h: stamp-h +stamp-h: config.h.in config.status + test ! -f stamp-h || ./config.status + rm -f stamp-h && echo timestamp > stamp-h + +Makefile: Makefile.in config.status + ./config.status + +config.status: configure config.h.in + ./config.status --recheck + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/NEWS b/src/apps/bin/sharutils-4.2.1/NEWS new file mode 100644 index 0000000000..f46e4ef5a3 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/NEWS @@ -0,0 +1,76 @@ +GNU sharutils NEWS - User visible changes. +Copyright (C) 1994, 1995 Free Software Foundation, Inc. + +Version 4.2 - November 1995, by François Pinard & Ulrich Drepper + +* New `mailshar' is a wrapper around `shar' and electronic mail. + +* New `remsync' is a Perl script which uses `mailshar' to help +synchronizing remote directories, for sites connected only by email. + +* Programs (but not scripts) may now speak Dutch, French, German +and Swedish. + +* Option -o offers better control over where to insert the part numbering +in the file name. + +* There are the beginnings of a contrib directory. + +* Produced shell archive are now internationalized, too + +* uuencode/uudecode are now compliant to the latest POSIX.2d draft + (more options, new encoding). + +* Updated man pages for shar/unshar by Jan Djarv + +* Speed up unshar a little bit. + +* Protect against transmission error by using MD5 sum. The old wc sum + is more or less useless, but still the fallback solution. + +Version 4.1 - November 1994, by François Pinard + +* GNU shar 4.0 and GNU uuencode 1.0 distributions have been merged +into this GNU sharutils package, which replaces both. So this release +introduces `uuencode' and `uudecode', over `shar' and `unshar'. + +* Option --no-verbose (-v) is being replaced by two different options: +first is --quiet or --silent (-q), second is --quiet-unshar (-Q). + +Version 4.0 - September 1994, by François Pinard + +* The distribution includes a Texinfo manual and Info documentation. +Jan Djarv updated the man pages. + +* Mixed mode (-M) mode works reliably and is the default, intermixing +types within file lists (-p) allows `-M'. + +* When piping is forbidden (-P), the shar scripts are usable by +uudecode's requiring an argument as well as by those unable to +process one. + +* Interactive scripts (-X) better protect themselves against +`unshar' programs and procedures. The query format is nicer. + +Version 3.52.3 - July 1994, by François Pinard + +* --gzip (-z) replaces --gzipped-files (-G). --compress (-Z) +replaces --compressed-files (-C). -C is kept for a while, but +gives a warning about being deprecated. + +Version 3.52.2 - July 1994, by François Pinard + +* Long options, among which --help and --version. + +* Tildas are protected at the beginning of a line. + +* Setting timestamps is attempted by default, using an improved +check of the local `touch' program at unshar time. + +* Generated shar scripts are cleaner on various details. + +Version 3.52.1 - June 1994, by François Pinard + +* New options -G and -g to use gzip while making shar files. + +See file `ChangeLog.OLD' for prior history about shar and unshar. diff --git a/src/apps/bin/sharutils-4.2.1/README b/src/apps/bin/sharutils-4.2.1/README new file mode 100644 index 0000000000..1e3f1e5310 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/README @@ -0,0 +1,48 @@ +This is the set of GNU shar utilities. + +`shar' makes so-called shell archives out of many files, preparing +them for transmission by electronic mail services. `unshar' helps +unpacking shell archives after reception. The core of both programs +is initially derived from public domain. Some modules and other +code sections are freely borrowed from other GNU distributions, +bringing `shar' under the terms of the GNU General Public License. + +`uuencode' prepares a file for transmission over an electronic channel +which ignores or otherwise mangles the eight bit (high order bit) of +bytes. `uudecode' does the converse transformation. They are derived +from the BSD NET/2 distribution, but enchanced with the features +described in recent POSIX standards. If you have more powerful +`uuencode' and `uudecode' already available, you may want to use +`./configure --disable-uucode' to prevent their installation. + +`remsync' allows for remote synchronization of directory trees, +using electronic mail. This part of sharutils is still alpha. +You should have already installed Perl, gzip, GNU diff, GNU tar +and GNU shar prior to installing remsync package. Only Perl is +really mandatory, write to me if you feel like helping to remove +the other dependencies. + +Beside the Perl script `remsync' and its shell scripts the whole +package now is internationalized. This includes the generated shell +scripts. As described in the `ABOUT-NLS' file you have various +options for handling this internationalization but this package is +special in one point: it always needs the GNU message catalog files to +be installed. Therefore it might be a good idea to always use the GNU +gettext functions and not the functions provided by your system. This +is of course not needed if your system uses GNU gettext in its system +library. + +See file `ABOUT-NLS' for how to customize this program to your language. +See file `BACKLOG' for a summary of pending mail and articles. +See file `COPYING' for copying conditions. +See file `INSTALL' for compilation and installation instructions. +See file `NEWS' for a list of major changes in the current release. +See file `THANKS' for a list of contributors. + +Jan Djarv takes care of the man pages, otherwise unsupported, and +their installation is kept separate from `make install'. You use +`make install-man' for them. Better think GNU and switch to Info. + +Your feedback will help us to make a better and more portable +product. Mail suggestions and bug reports (including documentation +errors) for this program to `bug-gnu-utils@prep.ai.mit.edu'. diff --git a/src/apps/bin/sharutils-4.2.1/README.OLD b/src/apps/bin/sharutils-4.2.1/README.OLD new file mode 100644 index 0000000000..5d11720751 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/README.OLD @@ -0,0 +1,273 @@ +This file last revised Sat Aug 4 17:15:01 CDT 1990 + +Here is shar 3.52, an updated version of shar 3.49, derived from 'shar2'. +This offering is the work of many people. Thanks to wht@n4hgf.Mt-Park.GA.US +(Warren Tucker), rhg@CPS.COM (Richard H. Gumpertz), colas@avahi.inria.fr +(Colas Nahaboo), bill@netagw.com (Bill Aten), marks@rex.cs.tulane.edu, and +maaaany others. + +This version's shar: +1) generates shell code which attempts to create missing directories +2) generates shell code which will force overwriting of files when passed + the '-c' option. +3) allows entire directories to be archived +4) handle deviants sun, vax, pyramid, sequent, and SCO XENIX/UNIX + automatically; for system V systems I did not catch, add -DSYS5 + to CFLAGS; for other BSD-like systems, add -DBSD42 +5) if unsharing system's touch is Sys V compatible (allows touch -m), + the unshar process restores file dates (-m switch) +6) An archive name may be specified for inclusion in the header + of the shar files (-n switch) +7) allows automatic generation of "Submitted-by: who@where" & + "Archive-name: /part##" headers +8) uses getopt; no good system library should be without a copy + but it is readily available (like look in unshar.c) +9) includes other chrome-plated bells, whistles, and junque + +This version's unshar: +1) can change directory before unsharing +2) can unshar from standard in, from a COLLECTION of shars, + from a file containing multiple concatenated shars, + or a mixture of shar files and concatenated-shar files. +3) can pass the '-c' option on to the script being extracted. +4) does not have a Social Security number. + +------------------------ shar usage ----------------------------------- +shar 3.52 +usage: shar [ options ] file ... + shar -S [ options ] +-V produce "vanilla" shars demanding little of the unshar environment +-v verbose messages OFF while executing +-m restore file modification dates & times with "touch" commands +-w don't check with 'wc -c' after unpack +-a generate Submitted-by: & Archive-name: headers +-nXXX use XXX as the name of the archive (documentation) +-s override automatically determined submitter name +-x overwrite existing files without checking if they already exist +-X interactively overwrite existing files (NOT FOR NET SHARS) +-B treat all files as binary, use uuencode +-T treat all files as text (default) +-C compress and uuencode all files +-bXX pass -bXX (default 12) to compress when compressing (implies -C) +-p allow positional parameter options. The options "-B" and "-B" + and "-C" may be embedded, and files to the right of the + option will be processed in the specified mode +-M mixed mode. Determine if the files are text or + binary and archive correctly. +-P use temp files instead of pipes in the shar file +-F force the prefix character on every line (even if not required) +-c start the shar with a cut line +-f restore by filename only, rather than path +-dXXX use XXX to delimit the files in the shar +-oXXX (or -o XXX) output to file XXX.01 thru XXX.nn +-lXX limit output file size to XXk bytes (but don't split files) +-LXX limit output file size to XXk bytes (may split files) +-S read files to wrap from stdin, ignoring argument line + +The -S option reads filenames one per line from stdin; input +format must be similar to 'find' output, except that if -p +is specified, -B, -T or -C may be used (on lines by themselves) +e.g., find . -type f -print | sort | shar -C -l50 -o /tmp/big + +The 'o' option is required if the 'l' or 'L' option is used +The 'n' option is required if the 'a' option is used + +-a generates sharname/part## headers. If the -a argument contains +a '/', then /part is not appended +The automatic submitter name is trivial: essentially `whoami`@`uname` + +------------------------ unshar usage ----------------------------------- +Unshar has no usage built in. It has default actions when invoked +with no arguments (read from stdin). + +Usage: unshar [ -d directory ] [ -c ] [ -e | -E exit_line ] [ files ... ] + + The -c flag is passed through to the shell as a parameter to the script + It can unshar shar files concatenated in one file, with the + the "-e" command, which separates files by recognizing the + "exit 0" string at the beginning of a line + + (The -E string option allows you to specify this string, thus + -e is equivalent to -E "exit 0") + + The -d flag tells unshar to change directory before unsharing + +--------------------- history ----------------------------------------- +Changes since 3.11: kudos to rhg@CPS.COM (Richard H. Gumpertz) + +1. The -l switch still specifies a maximum size for the generated + shar files, but now it prevents files from spanning shar parts. + Shars generated using this method may be unpacked in any order. + +2. The old -l switch functionality is precisely emulated by using the + the -L switch. That is, archived files may be split across parts. + Shars generated using this method must still be unpacked in order. + +3. The -C switch causes files to be compressed, then uuencoded. + Unpacking reverses the process. + +4. The -P causes the shar to use temp files instead of pipes in + the unshar process. + +5. The -f causes files to be resotred by name only (i.e., strip + directory portion of input filenames before placing the name + into the shar. + + +Changes since 3.20: kudos to colas@avahi.inria.fr (Colas Nahaboo) + +1. The Archived-name: header no longer uses "/part" if there is + a "/" in the -n name. Thus + -n xyzzy procduces: + xyzzy/part01 + xyzzy/part02 + + -n xyzzy/patch procduces: + xyzzy/patch01 + xyzzy/patch02 + + -n xyzzy/patch01. procduces: + xyzzy/patch01.01 + xyzzy/patch01.02 +2. The Archive-name part number other than part01 had no leading zero + in the number. + +3. The "Submitted-by:" header was missing the hyphen (minus for olde + UNIX hackres). + +4. The unshar program may now unshar a whole mailbox or concatenation + of shar files. + + -C "string" looks for "string" at the beginning of the line to + break the file into individual shar files + -c is equivalent to -C "exit 0" + + This of course will only work if there is something in the shar + file recognizable to terminate the shar. Some shars dont have + "exit 0" at the end. However, a clue: most/many .signatures have + "--" on a line right before them. + +5. Unshar -d (change directory) no longer makes argv files unreachable. + I had never used the feature until the other day. I guess the + author has used in only for unsharing from stdin. + +Changes since 3.21: thanks to Adri Verhoef, + +1. Some vaxen do not run BSD. I guess I knew this, but -er- + here is Adri's note: +> Hi Warren, +> +> I encountered a problem trying to get 'shar3.21' to compile on System V +> on a vax. Yes, can you believe it? We run System V Release 3.0 on VAXen! +> The shar3.21 code assumes that you are BSD if you're on a vax. This is not +> always true! What I did to get the code compiled on System V, was: +> (+) edit the Makefile and add -DSYS5 to CFLAGS. +> (+) edit all the C-source files to circumcise compiler warnings +> ("SYS5 redefined"). +> + +He made a suggestion about having a localize.sh edit a distribution +Makefile, but for now, I'll just suggest you add -DSYS5 to CFLAGS +manually. + +2. jhd@irfu.se (Jan Dj{rv, sorry about the screwed up character + translation, Jan) wrote man pages. Thanks! + +Changes since 3.22: thanks to Dennis Boylan + +1. The new -S option allows the list of files to be packed + to be read from the standard input rather than from the + command line. + +2. A few purist checks were made to ensure fork() or malloc() + doesn't fail and excite the "if 20 hours of your time is + free then why isn't 200?" crowd (who probably will never see + this revision anyway :-)) + +Changes since 3.23: + +1. The -V mode was added. + +2. Altos doesn't like the '@' in filenames. The filename format + was changed. Thanks to rhg@cps.com. + +Changes since 3.24: + +1. Man pages were revised by gam@netcom (Gordon Moffet). Thanks. + +2. When -L was specified, the "Starting ..." message was not +produced on standard error (with or without -v). + +3. When using -X, the 'not for net' warning was printed on standard +output rather thsn standard error. + +4. marks@rex.cs.tulane.edu reccommends adding -F 5000 to the load + line of unshar when using on XENIX 286 to avoid stack overflow + core dumps. I added this information to an excellkent remake + of the Makefile by bill@netagw.com. + +Changes since 3.25: + +1. Fixed one minor bug with -a/-n. The period supplied when a + slash appears in the -n name was omitted. This is a hatefully + small bug to fix and reissue a whole release, but + a) several new names are on the sharlist now and they have + only 3.24 to work with, + b) this will surely sync us all up, and + c) I think it will put shar to bed for a while ("no known bugs + at this ti ... bus error core dumped"). + +Changes since 3.27: + +1. The unshar-time test for a touch -m facility now greps for + 'mmdd', not '[-amc]', making it more universally successful. + +2. NOTE: there is still a problem with -n arguments using + a 'x/y' construct, but I don't know how to properly generalize + it so you'll have to edit shars made with some uses of -a + with -n x/y. + +3. This is surely my last work on this. It does everything + I needed and more. Thanks for all the help and suggestions. + It seems as though we didn't precipitate 'death of the shar' + after all :-) :-) :-). + +Changes since 3.32: + +1. Several bug fixes. + +2. Inverted the meaning of '-x'; the new default is to NOT overwrite. + +3. Added '-c' checking when unpacking so the recipient can force overwrites. + +4. Made '-L' work even with files not being overwritten. + +5. Added '-m' and changed the default behavior to not generate TOUCH commands. + +6. Added '-F'; the default is to suppress the extra 'X' at the beginning of + each line unless it is needed (i.e., the first character of the line is + already 'X' or is a non-graphic). + +7. Renamed '-b' and '-t' to '-B' and '-T', respectively. + +8. Added '-bn' for use with compression (calls compress with -bn). + +9. Renamed the temporary files used in unpacking from shar3_???_.tmp to + _shar_???_.tmp. + +10. Directories may now be passed to shar; a recursive directory walk is + performed. This feature may be disabled by compiling with -DNO_WALKTREE. + +Changes since 3.43: + +1. Several more minor bug fixes. + +2. Added support for BSD-style and -ldir. + +3. Added more usage directions to the shar header. + +Changes since 3.49: + +1. Added more support for Unix variations. + +2. A few more very minor bug fixes. diff --git a/src/apps/bin/sharutils-4.2.1/THANKS b/src/apps/bin/sharutils-4.2.1/THANKS new file mode 100644 index 0000000000..6795ce6a9b --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/THANKS @@ -0,0 +1,72 @@ +The shar and unshar programs is the collective work of many authors. +Many people contributed to shar by reporting problems, suggesting +various improvements or submitting actual code. Here is a list of +these people. Help me keeping it complete and exempt of errors. + +Andrew B. Smith abs@maunsell.co.uk +Andrew Walduck amewaldu@undergrad.math.uwaterloo.ca +Andrey A. Chernov ache@astral.msk.su +Andries E. Brouwer aeb@win.tue.nl +Andy Seaborne afs@hplb.hpl.hp.com +Antonio Esteves esteves@di.uminho.pt +Bernd Nordhausen bernd@passage.com +Bill Aten bill@netagw.com +Bill Campbell bill@celestial.com +Bill Silvert silvert@cs.dal.ca +Bruno Haible haible@ma2s2.mathematik.uni-karlsruhe.de +Christian von Roques roques@pond.sub.org +Christopher Sawtell chris@gerty.equinox.gen.nz +Colas Nahaboo colas@mirsa.inria.fr +David J. MacKenzie djm@uunet.uu.net +Dennis Boylan nanovx!dennis +Donald Page donaldp@sco.com +Elliott Pacetti epacet@unf6.cis.unf.edu +Elvia Lopez Hurtado elvial@ctsmex.attmail.com +Eric Backus ericb@lsid.hp.com +François Pinard pinard@iro.umontreal.ca +Gordon Joly G.Joly@cs.ucl.ac.uk +Gordon Moffet netcom!gam +Greg McGary gkm@magilla.cichlid.com +Gregory Neil Shapiro gshapiro@wpi.edu +Harlan Stenn harlan@mumps.pfcs.com +Horst von Brand vonbrand@inf.utfsm.cl +Ian Jackson iwj@cam-orl.co.uk +Jan Djarv Jan.Djarv@sa.erisoft.se +James Gosling James.Gosling@eng.sun.com +Jim Meyering meyering@acm.org +Joseph E. Sacco jsacco@ssl.com +Joshua R. Poulson jrp@plaza.ds.adp.com +Karl Berry kb@cs.umb.edu +Karl Vogel vogelke@c-17igp.wpafb.af.mil +Kaveh R. Ghazi ghazi@noc.rutgers.edu +Ken Olstad olstad@msc.edu +Laurent Bourbeau bpi!bourbeau +Meade Roberts meade@plaza.ds.adp.com +Michael A. Thompson mike@iotek.ns.ca +Michael Mauldin mlm@cs.cmu.edu +Michael Rendell michael@cs.mun.ca +Nelson H. F. Beebe beebe@math.utah.edu +Noah Friedman friedman@gnu.ai.mit.edu +Pat Myrto rwing!pat +Paul A. Vixie paul@vix.com +Paul Eggert eggert@twinsun.com +Richard H. Gumpertz rhg@cps.com +Richard Segal segal@cs.washington.edu +Richard Stallman rms@prep.ai.mit.edu +Robert J.C. Kyanko rob@rjck.oau.org +Roderick Schertler roderick@gate.net +Thomas E. Dickey dickey@clark.net +Ulrich Drepper drepper@gnu.ai.mit.edu +Warren Tucker wht@n4hgf.atl.ga.us +William Davidsen davidsen@tmr.com + + +Thanks to all members of the translation teams for the different +languages. Mentioned here are the persons who sent the catalogs: + +Dutch: Andries E. Brouwer aeb@win.tue.nl +French: François Pinard pinard@iro.umontreal.ca +German: Ulrich Drepper drepper@gnu.ai.mit.edu +Japanese: Sakai Kiyotaka ksakai@netwk.ntt-at.co.jp +Portugese: Antonio Esteves esteves@di.uminho.pt +Svedish: Jan Djarv Jan.Djarv@sa.erisoft.se diff --git a/src/apps/bin/sharutils-4.2.1/TODO b/src/apps/bin/sharutils-4.2.1/TODO new file mode 100644 index 0000000000..11becc4276 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/TODO @@ -0,0 +1,82 @@ +* TODO file for GNU sharutils + +Tell if you feel like volunteering for any +of these ideas, listed more or less in decreasing order of priority. +Some TODO items are implicit from received email. See file BACKLOG. + +(One more word. This list already existed when I took over the task +of maintaining sharutils. I have not investigated the list enough +to say this will also be correct for me. But Franc,ois and I often +agree so it is likely.) + + +.# Next release +The next release will have these changes: +. + better integrate uucode with the others, code-wise + + +.@ ChangeLog + +.* Short term +. + Utiliser guillemets français dans fr.tt +. + convert uucode documentation into sharutils.texi +. + remove many fixed limits, everywhere +. + delete useless code, among which some matching features +. + simplify further `:' vs `true' usage, the latter might be avoided +. + remsync matters +. - documentation +The documentation is still rudimentary, but might help you to +understand what is going on. Many examples in some quick start +node might help. In any case, criticize it at will, and let me +use your comments as an incentive for further improvement. Any help +from native English speakers is appreciated. + +Carefully ensure that you have a backup of your synchronized trees +before your tries of remsync. It does work for me, but who knows if +it will not be dangerous in your particular setup. + +White lines, and lines beginning with \`#\', are comments. Command +keywords may be abbreviated to their first letter. Space between +successive keywords may be omitted. Variable arguments may often be +replaced by numeric index from lists. SITE may also be local or 0. +SITE_SET is a list of SITE, default is all. A ! prefix complements it. +The following commands are meant for automatic internal use: +. - handle receving files over symbolic links or directories +. - maintain a project title +. - no remote could also be local +. - diagnose /net/mnt_tmp/... directories +. - if deleting a scan, already registered files declared unexisting +. - have a paranoid option, in which diffs are always done +. - study if and how the symbolic links might be transported + +.* Medium term +. + integrate remsync script and documentation +. + have -C as synonymous for -d in shar + 1994-08-22, Karl Berry +. + speedup unshar, far too slow while matching sed input +. + construct some `make check' for shar/unshar +. + do something sensible with file permissions +. + study if the symbolic links might be transported +. + when local/remote directories are relative, this should be to ~user +. + do not send absolute files +. + add some `-h UNSHAR.HDR' option + 1994-08-19, Marty Leisner +. + decode options from a SHAR environment variable + 1994-08-30, Ulrich Drepper +. + remsync matters +. - have a command to rename a remote while keeping all its values +. - do something sensible with file permissions +. - qualify each scan with destination sites +. - emacslisp/menage.el to omit, have it reconstructed automatically instead +. - have an equivalence system for email addresses +. - avoid computing checksums for ignored files +. - have a master directory for .remsync's, have them located elsewhere +. - have a recursive mode finding all .remsync's in tree +. - provide encryption hooks, so people can use e.g. PGP or rot13 :-) + +.* Long term +. + automatically retrieve in correct sequence from a bunched file + 1994-08-24, Karl Berry +. + when -T, just reject binary files + 1994-08-29, Andrew A. Chernov + 1994-09-11, Eric Backus -- disagrees diff --git a/src/apps/bin/sharutils-4.2.1/acconfig.h b/src/apps/bin/sharutils-4.2.1/acconfig.h new file mode 100644 index 0000000000..852ac6c953 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/acconfig.h @@ -0,0 +1,36 @@ +/* Special definitions for sharutils, processed by autoheader. + Copyright (C) 1994 Free Software Foundation, Inc. + François Pinard , 1994. + Ulrich Drepper , 1995. +*/ + +/* Define if the current hostname may be found in /etc/systemid. */ +#undef HAVE_ETC_SYSTEMID + +/* Define to the name of the distribution. */ +#undef PACKAGE + +/* Define to 1 if ANSI function prototypes are usable. */ +#undef PROTOTYPES + +/* Define to the version of the distribution. */ +#undef VERSION + +/* Define to 1 for better use of the debugging malloc library. See + site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz. */ +#undef WITH_DMALLOC + +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if NLS is requested. */ +#undef ENABLE_NLS + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +#undef HAVE_CATGETS + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT + +/* Define as 1 if you have the stpcpy function. */ +#undef HAVE_STPCPY diff --git a/src/apps/bin/sharutils-4.2.1/aclocal.m4 b/src/apps/bin/sharutils-4.2.1/aclocal.m4 new file mode 100644 index 0000000000..93e4703247 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/aclocal.m4 @@ -0,0 +1,317 @@ +# Local additions to Autoconf macros. +# Copyright (C) 1992, 1994 Free Software Foundation, Inc. +# Francois Pinard , 1992. + +# NLS configuration macros added. +# Ulrich Drepper , August 1995. + +# @defmac AC_PROG_CC_STDC +# @maindex PROG_CC_STDC +# @ovindex CC +# If the C compiler in not in ANSI C mode by default, try to add an option +# to output variable @code{CC} to make it so. This macro tries various +# options that select ANSI C on some system or another. It considers the +# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and +# handles function prototypes correctly. +# +# If you use this macro, you should check after calling it whether the C +# compiler has been set to accept ANSI C; if not, the shell variable +# @code{ac_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source +# code in ANSI C, you can make an un-ANSIfied copy of it by using the +# program @code{ansi2knr}, which comes with Ghostscript. +# @end defmac + +define(fp_PROG_CC_STDC, +[AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) +AC_CACHE_VAL(ac_cv_prog_cc_stdc, +[ac_cv_prog_cc_stdc=no +ac_save_CFLAGS="$CFLAGS" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc +for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc +do + CFLAGS="$ac_save_CFLAGS $ac_arg" + AC_TRY_COMPILE( +[#if !defined(__STDC__) || __STDC__ != 1 +choke me +#endif +], [int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);};], +[ac_cv_prog_cc_stdc="$ac_arg"; break]) +done +CFLAGS="$ac_save_CFLAGS" +]) +AC_MSG_RESULT($ac_cv_prog_cc_stdc) +case "x$ac_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $ac_cv_prog_cc_stdc" ;; +esac +]) + +# Check for function prototypes. + +AC_DEFUN(fp_C_PROTOTYPES, +[AC_REQUIRE([fp_PROG_CC_STDC]) +AC_MSG_CHECKING([for function prototypes]) +if test "$ac_cv_prog_cc_stdc" != no; then + AC_MSG_RESULT(yes) + AC_DEFINE(PROTOTYPES) + U= ANSI2KNR= +else + AC_MSG_RESULT(no) + U=_ ANSI2KNR=ansi2knr +fi +AC_SUBST(U)dnl +AC_SUBST(ANSI2KNR)dnl +]) + +# Check if --with-dmalloc was given. + +AC_DEFUN(fp_WITH_DMALLOC, +[AC_MSG_CHECKING(if malloc debugging is wanted) +AC_ARG_WITH(dmalloc, +[ --with-dmalloc use dmalloc, as in dmalloc.tar.gz from + @/ftp.antaire.com:antaire/src/dmalloc.], +[if test "$withval" = yes; then + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_DMALLOC) + LIBS="$LIBS -ldmalloc" + LDFLAGS="$LDFLAGS -g" +else + AC_MSG_RESULT(no) +fi], [AC_MSG_RESULT(no)])]) + +dnl --------------------------------------------------------- ## +dnl Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ## +dnl substitution. ## +dnl --------------------------------------------------------- ## + +AC_DEFUN(fp_PROG_INSTALL, +[AC_PROG_INSTALL +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755' +AC_SUBST(INSTALL_SCRIPT)dnl +]) + +AC_DEFUN(md_PATH_PROG, + [AC_PATH_PROG($1,$2,$3)dnl + if echo $$1 | grep openwin > /dev/null; then + echo "WARNING: Do not use OpenWin's $2. (Better remove it.) >&AC_FD_MSG" + ac_cv_path_$1=$2 + $1=$2 + fi +]) + +dnl Check NLS options + +AC_DEFUN(ud_LC_MESSAGES, + [if test $ac_cv_header_locale_h = yes; then + AC_MSG_CHECKING([for LC_MESSAGES]) + AC_CACHE_VAL(ud_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + ud_cv_val_LC_MESSAGES=yes, ud_cv_val_LC_MESSAGES=no)]) + AC_MSG_RESULT($ud_cv_val_LC_MESSAGES) + if test $ud_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES) + fi + fi]) + +AC_DEFUN(ud_WITH_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], + nls_cv_use_nls=$enableval, nls_cv_use_nls=yes) + AC_MSG_RESULT($nls_cv_use_nls) + + dnl If we use NLS figure out what method + if test "$nls_cv_use_nls" = "yes"; then + AC_DEFINE(ENABLE_NLS) + AC_MSG_CHECKING([for explicitly using GNU gettext]) + AC_ARG_WITH(gnu-gettext, + [ --with-gnu-gettext use the GNU gettext library], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + if test "$nls_cv_force_use_gnu_gettext" = "yes"; then + nls_cv_use_gnu_gettext=yes + else + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If gettext or catgets are available (in this order) we + dnl use this. Else we have to fall back to GNU NLS library. + AC_CHECK_LIB(intl, main) + AC_CHECK_LIB(i, main) + CATOBJEXT=NONE + AC_CHECK_FUNC(gettext, + [AC_DEFINE(HAVE_GETTEXT) + AC_PATH_PROG(MSGFMT, msgfmt, no)dnl + if test "$MSGFMT" != "no"; then + AC_CHECK_FUNCS(dcgettext) + md_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)dnl + md_PATH_PROG(XGETTEXT, xgettext, xgettext)dnl + CATOBJEXT=.mo + INSTOBJEXT=.mo + DATADIRNAME=lib + fi]) + + if test "$CATOBJEXT" = "NONE"; then + dnl No gettext in C library. Try catgets next. + AC_CHECK_FUNC(catgets, + [AC_DEFINE(HAVE_CATGETS) + INTLOBJS="\$(CATOBJS)" + AC_PATH_PROG(GENCAT, gencat, no)dnl + if test "$GENCAT" != "no"; then + AC_PATH_PROGS(GMSGFMT, [gmsgfmt msgfmt], msgfmt)dnl + md_PATH_PROG(XGETTEXT, xgettext, xgettext)dnl + CATOBJEXT=.cat + INSTOBJEXT=.cat + DATADIRNAME=lib + INTLDEPS="../intl/libintl.a" + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + + # We need to process the intl/ and po/ directory. + INTLSUB=intl + fi]) + fi + + if test "$CATOBJEXT" = "NONE"; then + dnl Neither gettext nor catgets in included in the C library. + dnl Fall back on 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. + INTLOBJS="\$(GETTOBJS)" + md_PATH_PROG(MSGFMT, msgfmt, msgfmt)dnl + md_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)dnl + md_PATH_PROG(XGETTEXT, xgettext, xgettext)dnl + AC_SUBST(MSGFMT) + CATOBJEXT=.gmo + INSTOBJEXT=.mo + DATADIRNAME=share + INTLDEPS="../intl/libintl.a" + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + + # We need to process the intl/ directory. + INTLSUB=intl + fi + + # We need to process the po/ directory. + POSUB=po + else + DATADIRNAME=share + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLDEPS) + AC_SUBST(INTLLIBS) + AC_SUBST(INTLOBJS) + AC_SUBST(INTLSUB) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +AC_DEFUN(ud_GNU_GETTEXT, + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + + AC_CHECK_HEADERS([limits.h locale.h nl_types.h malloc.h string.h unistd.h values.h]) + AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp]) + + if test "${ac_cv_func_stpcpy+set}" != "set"; then + AC_CHECK_FUNCS(stpcpy) + fi + if test "${ac_cv_func_stpcpy}" = "yes"; then + AC_DEFINE(HAVE_STPCPY) + fi + + ud_LC_MESSAGES + ud_WITH_NLS + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl Determine which catalog format we have (if any is needed) + dnl For now we know about two different formats: + dnl Linux and the normal X/Open format + test -d intl || mkdir intl + if test "$CATOBJEXT" = ".cat"; then + AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) + + dnl Transform the SED scripts while copying because some dumb SEDs + dnl cannot handle comments. + sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed + fi + dnl po2tbl.sed is always needed. + sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ + $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + ]) diff --git a/src/apps/bin/sharutils-4.2.1/checks/ChangeLog b/src/apps/bin/sharutils-4.2.1/checks/ChangeLog new file mode 100644 index 0000000000..1dde0ce344 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/checks/ChangeLog @@ -0,0 +1,19 @@ +Sun Nov 5 13:33:52 1995 Ulrich Drepper + + * Makefile.in (dist): Suppress error message when ln failed. + +Tue Aug 15 18:16:22 1995 Ulrich Drepper + + * testdata: + Correct data for NUL padded output format. Previous algorithm did not + care for the content of the last bytes which are not filled be the + input data but are necessary for the last 3-byte group. + +Tue Aug 15 16:49:42 1995 Ulrich Drepper + + * Makefile.in (dist): Remove `copying instead' message. + +Thu Aug 3 00:16:48 1995 Ulrich Drepper + + * Makefile.in: Initial revision. + diff --git a/src/apps/bin/sharutils-4.2.1/checks/Makefile b/src/apps/bin/sharutils-4.2.1/checks/Makefile new file mode 100644 index 0000000000..f5b62d5650 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/checks/Makefile @@ -0,0 +1,72 @@ +# Generated automatically from Makefile.in by configure. +# Makefile for check subdirectory in GNU gettext package. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = sharutils +VERSION = 4.2.1 + +SHELL = /bin/sh + + +srcdir = . +top_srcdir = .. + +subdir = checks + + +TESTSRCS = testdata +DISTFILES = ChangeLog Makefile.in $(TESTSRCS) + +all: + +check: + rm -f test.bin test.tmp + ../src/uudecode $(srcdir)/testdata + ../src/uuencode test.bin test.bin > test.tmp + cmp $(srcdir)/testdata test.tmp || exit 1 + rm -f test.bin test.tmp + @echo ========================== + @echo All checks are successful. + @echo ========================== + +install uninstall tags TAGS id ID: + +mostlyclean: + rm -f core core.* *.tmp test.bin + +clean: mostlyclean + +distclean: clean + rm -f Makefile + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/checks/Makefile.in b/src/apps/bin/sharutils-4.2.1/checks/Makefile.in new file mode 100644 index 0000000000..6550c1ff73 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/checks/Makefile.in @@ -0,0 +1,72 @@ +# Makefile for check subdirectory in GNU gettext package. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +subdir = checks + + +TESTSRCS = testdata +DISTFILES = ChangeLog Makefile.in $(TESTSRCS) + +all: + +check: + rm -f test.bin test.tmp + ../src/uudecode $(srcdir)/testdata + ../src/uuencode test.bin test.bin > test.tmp + cmp $(srcdir)/testdata test.tmp || exit 1 + rm -f test.bin test.tmp + @echo ========================== + @echo All checks are successful. + @echo ========================== + +install uninstall tags TAGS id ID: + +mostlyclean: + rm -f core core.* *.tmp test.bin + +clean: mostlyclean + +distclean: clean + rm -f Makefile + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/checks/testdata b/src/apps/bin/sharutils-4.2.1/checks/testdata new file mode 100644 index 0000000000..2db6ca73f5 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/checks/testdata @@ -0,0 +1,9 @@ +begin 664 test.bin +M``$"`P0%!@<("0H+#`T.#Q`1$A,4%187&!D:&QP='A\@(2(C)"4F)R@I*BLL +M+2XO,#$R,S0U-C'EZ>WQ]?G^`@8*#A(6& +MAXB)BHN,C8Z/D)&2DY25EI>8F9J;G)V>GZ"AHJ.DI::GJ*FJJZRMKJ^PL;*S +MM+6VM[BYNKN\O;Z_P,'"P\3%QL?(R+CY.7FY^CIZNOL[>[O\/'R\_3U]O?X^?K[_/W^_P`` +` +end diff --git a/src/apps/bin/sharutils-4.2.1/config.cache b/src/apps/bin/sharutils-4.2.1/config.cache new file mode 100644 index 0000000000..97b1f4c508 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/config.cache @@ -0,0 +1,87 @@ +# 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. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +ac_cv_c_bigendian=${ac_cv_c_bigendian='no'} +ac_cv_c_char_unsigned=${ac_cv_c_char_unsigned='no'} +ac_cv_c_const=${ac_cv_c_const='yes'} +ac_cv_c_cross=${ac_cv_c_cross='no'} +ac_cv_c_inline=${ac_cv_c_inline='inline'} +ac_cv_func_alloca=${ac_cv_func_alloca='yes'} +ac_cv_func_basename=${ac_cv_func_basename='no'} +ac_cv_func_catgets=${ac_cv_func_catgets='no'} +ac_cv_func_closedir_void=${ac_cv_func_closedir_void='no'} +ac_cv_func_fchmod=${ac_cv_func_fchmod='no'} +ac_cv_func_getcwd=${ac_cv_func_getcwd='yes'} +ac_cv_func_getpagesize=${ac_cv_func_getpagesize='no'} +ac_cv_func_gettext=${ac_cv_func_gettext='no'} +ac_cv_func_isascii=${ac_cv_func_isascii='yes'} +ac_cv_func_memcpy=${ac_cv_func_memcpy='yes'} +ac_cv_func_memset=${ac_cv_func_memset='yes'} +ac_cv_func_mktime=${ac_cv_func_mktime='yes'} +ac_cv_func_mmap=${ac_cv_func_mmap='no'} +ac_cv_func_munmap=${ac_cv_func_munmap='no'} +ac_cv_func_putenv=${ac_cv_func_putenv='yes'} +ac_cv_func_setenv=${ac_cv_func_setenv='no'} +ac_cv_func_setlocale=${ac_cv_func_setlocale='yes'} +ac_cv_func_stpcpy=${ac_cv_func_stpcpy='yes'} +ac_cv_func_strcasecmp=${ac_cv_func_strcasecmp='yes'} +ac_cv_func_strchr=${ac_cv_func_strchr='yes'} +ac_cv_func_strerror=${ac_cv_func_strerror='yes'} +ac_cv_func_strftime=${ac_cv_func_strftime='yes'} +ac_cv_func_uname=${ac_cv_func_uname='yes'} +ac_cv_func_valloc=${ac_cv_func_valloc='yes'} +ac_cv_func_vprintf=${ac_cv_func_vprintf='yes'} +ac_cv_header_alloca_h=${ac_cv_header_alloca_h='yes'} +ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h='yes'} +ac_cv_header_limits_h=${ac_cv_header_limits_h='yes'} +ac_cv_header_locale_h=${ac_cv_header_locale_h='yes'} +ac_cv_header_malloc_h=${ac_cv_header_malloc_h='yes'} +ac_cv_header_memory_h=${ac_cv_header_memory_h='yes'} +ac_cv_header_minix_config_h=${ac_cv_header_minix_config_h='no'} +ac_cv_header_nl_types_h=${ac_cv_header_nl_types_h='no'} +ac_cv_header_stat_broken=${ac_cv_header_stat_broken='no'} +ac_cv_header_stdc=${ac_cv_header_stdc='yes'} +ac_cv_header_string_h=${ac_cv_header_string_h='yes'} +ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h='yes'} +ac_cv_header_unistd_h=${ac_cv_header_unistd_h='yes'} +ac_cv_header_values_h=${ac_cv_header_values_h='no'} +ac_cv_lib_dir=${ac_cv_lib_dir='no'} +ac_cv_lib_i=${ac_cv_lib_i='no'} +ac_cv_lib_intl=${ac_cv_lib_intl='no'} +ac_cv_path_DIFF=${ac_cv_path_DIFF='/bin/diff'} +ac_cv_path_GMSGFMT=${ac_cv_path_GMSGFMT='msgfmt'} +ac_cv_path_MAILER=${ac_cv_path_MAILER='/bin/mail'} +ac_cv_path_MSGFMT=${ac_cv_path_MSGFMT='msgfmt'} +ac_cv_path_PERL=${ac_cv_path_PERL='/boot/home/config/bin/perl'} +ac_cv_path_SH=${ac_cv_path_SH='/bin/sh'} +ac_cv_path_TAR=${ac_cv_path_TAR='/bin/tar'} +ac_cv_path_XGETTEXT=${ac_cv_path_XGETTEXT='xgettext'} +ac_cv_path_install=${ac_cv_path_install=''/bin/install -c''} +ac_cv_prog_CC=${ac_cv_prog_CC='gcc'} +ac_cv_prog_CPP=${ac_cv_prog_CPP=''gcc -E''} +ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB='ranlib'} +ac_cv_prog_cc_stdc=${ac_cv_prog_cc_stdc=''} +ac_cv_prog_gcc=${ac_cv_prog_gcc='yes'} +ac_cv_prog_gcc_g=${ac_cv_prog_gcc_g='yes'} +ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set='yes'} +ac_cv_struct_tm=${ac_cv_struct_tm='time.h'} +ac_cv_struct_tm_zone=${ac_cv_struct_tm_zone='yes'} +ac_cv_type_off_t=${ac_cv_type_off_t='yes'} +ac_cv_type_size_t=${ac_cv_type_size_t='yes'} +nls_cv_force_use_gnu_gettext=${nls_cv_force_use_gnu_gettext='no'} +nls_cv_header_intl=${nls_cv_header_intl='intl/libintl.h'} +nls_cv_header_libgt=${nls_cv_header_libgt='intl/libgettext.h'} +nls_cv_use_gnu_gettext=${nls_cv_use_gnu_gettext='yes'} +nls_cv_use_nls=${nls_cv_use_nls='yes'} +ud_cv_val_LC_MESSAGES=${ud_cv_val_LC_MESSAGES='yes'} diff --git a/src/apps/bin/sharutils-4.2.1/config.h b/src/apps/bin/sharutils-4.2.1/config.h new file mode 100644 index 0000000000..87548e008a --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/config.h @@ -0,0 +1,220 @@ +/* config.h. Generated automatically by configure. */ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define 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 + +/* Define if using alloca.c. */ +/* #undef C_ALLOCA */ + +/* Define if type char is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +/* #undef __CHAR_UNSIGNED__ */ +#endif + +/* Define if the closedir function returns void instead of int. */ +/* #undef CLOSEDIR_VOID */ + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* 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 if you have alloca, as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define if you have and it should be used (not on Ultrix). */ +#define HAVE_ALLOCA_H 1 + +/* Define if you don't have vprintf but do have _doprnt. */ +/* #undef HAVE_DOPRNT */ + +/* Define if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define if you have the strftime function. */ +#define HAVE_STRFTIME 1 + +/* Define if your struct tm has tm_zone. */ +#define HAVE_TM_ZONE 1 + +/* Define if you don't have tm_zone but do have the external array + tzname. */ +/* #undef HAVE_TZNAME */ + +/* Define if you have the vprintf function. */ +#define HAVE_VPRINTF 1 + +/* Define as __inline if that's what the C compiler calls it. */ +/* #undef inline */ + +/* Define if on MINIX. */ +/* #undef _MINIX */ + +/* Define to `long' if doesn't define. */ +/* #undef off_t */ + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define if you need to in order for stat and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ + +/* 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 run-time. + 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 if the `S_IS*' macros in do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if your declares struct tm. */ +/* #undef TM_IN_SYS_TIME */ + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define if the current hostname may be found in /etc/systemid. */ +/* #undef HAVE_ETC_SYSTEMID */ + +/* Define to the name of the distribution. */ +#define PACKAGE "sharutils" + +/* Define to 1 if ANSI function prototypes are usable. */ +#define PROTOTYPES 1 + +/* Define to the version of the distribution. */ +#define VERSION "4.2.1" + +/* Define to 1 for better use of the debugging malloc library. See + site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz. */ +/* #undef WITH_DMALLOC */ + +/* Define if your locale.h file contains LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if NLS is requested. */ +//#define ENABLE_NLS 1 + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +/* #undef HAVE_CATGETS */ + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +/* #undef HAVE_GETTEXT */ + +/* Define as 1 if you have the stpcpy function. */ +#define HAVE_STPCPY 1 + +/* Define if you have the basename function. */ +/* #undef HAVE_BASENAME */ + +/* Define if you have the dcgettext function. */ +/* #undef HAVE_DCGETTEXT */ + +/* Define if you have the fchmod function. */ +/* #undef HAVE_FCHMOD */ + +/* Define if you have the getcwd function. */ +#define HAVE_GETCWD 1 + +/* Define if you have the getpagesize function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define if you have the isascii function. */ +#define HAVE_ISASCII 1 + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY 1 + +/* Define if you have the munmap function. */ +/* #undef HAVE_MUNMAP */ + +/* Define if you have the putenv function. */ +#define HAVE_PUTENV 1 + +/* Define if you have the setenv function. */ +/* #undef HAVE_SETENV */ + +/* Define if you have the setlocale function. */ +#define HAVE_SETLOCALE 1 + +/* Define if you have the stpcpy function. */ +#define HAVE_STPCPY 1 + +/* Define if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* Define if you have the strchr function. */ +#define HAVE_STRCHR 1 + +/* Define if you have the strerror function. */ +#define HAVE_STRERROR 1 + +/* Define if you have the uname function. */ +#define HAVE_UNAME 1 + +/* Define if you have the valloc function. */ +#define HAVE_VALLOC 1 + +/* Define if you have the header file. */ +#define HAVE_DIRENT_H 1 + +/* Define if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_NDIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_NL_TYPES_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_VALUES_H */ + +/* Define if you have the i library (-li). */ +/* #undef HAVE_LIBI */ + +/* Define if you have the intl library (-lintl). */ +/* #undef HAVE_LIBINTL */ diff --git a/src/apps/bin/sharutils-4.2.1/config.h.in b/src/apps/bin/sharutils-4.2.1/config.h.in new file mode 100644 index 0000000000..ae79185512 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/config.h.in @@ -0,0 +1,219 @@ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define 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 + +/* Define if using alloca.c. */ +#undef C_ALLOCA + +/* Define if type char is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +#undef __CHAR_UNSIGNED__ +#endif + +/* Define if the closedir function returns void instead of int. */ +#undef CLOSEDIR_VOID + +/* Define to empty if the keyword does not work. */ +#undef const + +/* 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 if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME + +/* Define if your struct tm has tm_zone. */ +#undef HAVE_TM_ZONE + +/* Define if you don't have tm_zone but do have the external array + tzname. */ +#undef HAVE_TZNAME + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* 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 run-time. + 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 if the `S_IS*' macros in do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if your declares struct tm. */ +#undef TM_IN_SYS_TIME + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define if the current hostname may be found in /etc/systemid. */ +#undef HAVE_ETC_SYSTEMID + +/* Define to the name of the distribution. */ +#undef PACKAGE + +/* Define to 1 if ANSI function prototypes are usable. */ +#undef PROTOTYPES + +/* Define to the version of the distribution. */ +#undef VERSION + +/* Define to 1 for better use of the debugging malloc library. See + site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz. */ +#undef WITH_DMALLOC + +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if NLS is requested. */ +#undef ENABLE_NLS + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +#undef HAVE_CATGETS + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT + +/* Define as 1 if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define if you have the basename function. */ +#undef HAVE_BASENAME + +/* Define if you have the dcgettext function. */ +#undef HAVE_DCGETTEXT + +/* Define if you have the fchmod function. */ +#undef HAVE_FCHMOD + +/* Define if you have the getcwd function. */ +#undef HAVE_GETCWD + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the isascii function. */ +#undef HAVE_ISASCII + +/* Define if you have the memcpy function. */ +#undef HAVE_MEMCPY + +/* Define if you have the munmap function. */ +#undef HAVE_MUNMAP + +/* Define if you have the putenv function. */ +#undef HAVE_PUTENV + +/* Define if you have the setenv function. */ +#undef HAVE_SETENV + +/* Define if you have the setlocale function. */ +#undef HAVE_SETLOCALE + +/* Define if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the uname function. */ +#undef HAVE_UNAME + +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + +/* Define if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the header file. */ +#undef HAVE_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_NL_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the header file. */ +#undef HAVE_VALUES_H + +/* Define if you have the i library (-li). */ +#undef HAVE_LIBI + +/* Define if you have the intl library (-lintl). */ +#undef HAVE_LIBINTL diff --git a/src/apps/bin/sharutils-4.2.1/config.log b/src/apps/bin/sharutils-4.2.1/config.log new file mode 100644 index 0000000000..16ad1e36dd --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/config.log @@ -0,0 +1,100 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +gcc -E +gcc -E +gcc -E +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:1115: minix/config.h: No such file or directory +gcc -o conftest -g -O conftest.c +gcc -E +gcc -c -g -O conftest.c +gcc -c -g -O conftest.c +gcc -c -g -O conftest.c +gcc -c -g -O conftest.c +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure: In function `t': +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:1425: `bogus' undeclared (first use in this function) +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:1425: (Each undeclared identifier is reported only once +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:1425: for each function it appears in.) +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:1425: parse error before `endian' +gcc -o conftest -g -O conftest.c +gcc -E +gcc -E +gcc -E +gcc -E +gcc -E +gcc -E +gcc -c -g -O conftest.c +gcc -o conftest -g -O conftest.c -ldir +/boot/develop/tools/gnupro/bin/ld: cannot open -ldir: No such file or directory +collect2: ld returned 1 exit status +gcc -E +gcc -E +gcc -E +gcc -E +gcc -o conftest -g -O conftest.c +gcc -c -g -O conftest.c +gcc -c -g -O conftest.c +gcc -E +gcc -o conftest -g -O conftest.c +/tmp/ccyhLt2n.o: In function `t': +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:1951: undefined reference to `basename' +collect2: ld returned 1 exit status +gcc -o conftest -g -O conftest.c +/tmp/ccxZzBNi.o: In function `t': +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:1951: undefined reference to `fchmod' +collect2: ld returned 1 exit status +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:1940: warning: conflicting types for built-in function `memcpy' +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c -lintl +/boot/develop/tools/gnupro/bin/ld: cannot open -lintl: No such file or directory +collect2: ld returned 1 exit status +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:2419: warning: conflicting types for built-in function `memset' +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -E +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +/tmp/ccV9j0pv.o: In function `t': +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:2547: undefined reference to `getpagesize' +collect2: ld returned 1 exit status +gcc -o conftest -g -O conftest.c +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:2588: sys/mman.h: No such file or directory +gcc -E +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:2680: nl_types.h: No such file or directory +gcc -E +gcc -E +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:2680: values.h: No such file or directory +gcc -o conftest -g -O conftest.c +/tmp/ccMQX6EV.o: In function `t': +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:2730: undefined reference to `munmap' +collect2: ld returned 1 exit status +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +/tmp/ccT2ZPTm.o: In function `t': +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:2730: undefined reference to `setenv' +collect2: ld returned 1 exit status +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c +gcc -o conftest -g -O conftest.c -li +/boot/develop/tools/gnupro/bin/ld: cannot open -li: No such file or directory +collect2: ld returned 1 exit status +gcc -o conftest -g -O conftest.c +/tmp/ccdLAXjF.o: In function `t': +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:2984: undefined reference to `gettext' +collect2: ld returned 1 exit status +gcc -o conftest -g -O conftest.c +/tmp/ccavKo9h.o: In function `t': +/boot/home/Development/current/src/apps/bin/sharutils-4.2.1/configure:3189: undefined reference to `catgets' +collect2: ld returned 1 exit status diff --git a/src/apps/bin/sharutils-4.2.1/config.status b/src/apps/bin/sharutils-4.2.1/config.status new file mode 100755 index 0000000000..2935519830 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/config.status @@ -0,0 +1,411 @@ +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host : +# +# ./configure +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]" +for ac_option +do + case "$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion" + exec ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "./config.status generated by autoconf version 2.7" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "$ac_cs_usage"; exit 0 ;; + *) echo "$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=. +ac_given_INSTALL="/bin/install -c" + +trap 'rm -fr Makefile src/mail-files src/mailshar src/remsync contrib/Makefile lib/Makefile intl/Makefile intl/po2tbl.sed src/Makefile po/Makefile.in doc/Makefile checks/Makefile config.h conftest*; exit 1' 1 2 15 + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g; + s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF +/^[ ]*VPATH[ ]*=[^:]*$/d + +s%@CFLAGS@%-g -O%g +s%@CPPFLAGS@%%g +s%@CXXFLAGS@%%g +s%@DEFS@%-DHAVE_CONFIG_H%g +s%@LDFLAGS@%%g +s%@LIBS@%%g +s%@exec_prefix@%${prefix}%g +s%@prefix@%/usr/local%g +s%@program_transform_name@%s,x,x,%g +s%@bindir@%${exec_prefix}/bin%g +s%@sbindir@%${exec_prefix}/sbin%g +s%@libexecdir@%${exec_prefix}/libexec%g +s%@datadir@%${prefix}/share%g +s%@sysconfdir@%${prefix}/etc%g +s%@sharedstatedir@%${prefix}/com%g +s%@localstatedir@%${prefix}/var%g +s%@libdir@%${exec_prefix}/lib%g +s%@includedir@%${prefix}/include%g +s%@oldincludedir@%/usr/include%g +s%@infodir@%${prefix}/info%g +s%@mandir@%${prefix}/man%g +s%@PACKAGE@%sharutils%g +s%@VERSION@%4.2.1%g +s%@PROGRAMS@%shar unshar uudecode uuencode%g +s%@SCRIPTS@%mail-files mailshar remsync%g +s%@MAN1PAGES@%shar unshar uuencode uudecode%g +s%@MAN5PAGES@% uuencode%g +s%@DIST_ALPHA@%README-alpha%g +s%@CC@%gcc%g +s%@INSTALL_PROGRAM@%${INSTALL}%g +s%@INSTALL_DATA@%${INSTALL} -m 644%g +s%@INSTALL_SCRIPT@%${INSTALL} -m 755%g +s%@SET_MAKE@%%g +s%@RANLIB@%ranlib%g +s%@DIFF@%/bin/diff%g +s%@MAILER@%/bin/mail%g +s%@PERL@%/boot/home/config/bin/perl%g +s%@SH@%/bin/sh%g +s%@TAR@%/bin/tar%g +s%@CPP@%gcc -E%g +s%@U@%%g +s%@ANSI2KNR@%%g +s%@ALLOCA@%%g +s%@LIBOBJS@% basename.o%g +s%@MSGFMT@%msgfmt%g +s%@GMSGFMT@%msgfmt%g +s%@XGETTEXT@%xgettext%g +s%@GENCAT@%%g +s%@CATALOGS@% de.gmo fr.gmo ja_JP.EUC.gmo nl.gmo pt.gmo sv.gmo%g +s%@CATOBJEXT@%.gmo%g +s%@DATADIRNAME@%share%g +s%@GMOFILES@% de.gmo fr.gmo ja_JP.EUC.gmo nl.gmo pt.gmo sv.gmo%g +s%@INSTOBJEXT@%.mo%g +s%@INTLDEPS@%../intl/libintl.a%g +s%@INTLLIBS@%../intl/libintl.a%g +s%@INTLOBJS@%$(GETTOBJS)%g +s%@INTLSUB@%intl%g +s%@POFILES@% de.po fr.po ja_JP.EUC.po nl.po pt.po sv.po%g +s%@POSUB@%po%g + +CEOF + +CONFIG_FILES=${CONFIG_FILES-"Makefile src/mail-files src/mailshar src/remsync contrib/Makefile lib/Makefile intl/Makefile intl/po2tbl.sed src/Makefile po/Makefile.in doc/Makefile checks/Makefile"} +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust relative srcdir, etc. for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +fi; done +rm -f conftest.subs + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"} +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + cp $ac_given_srcdir/$ac_file_in conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + cat > conftest.frag < conftest.out + rm -f conftest.in + mv conftest.out conftest.in + + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +ac_sources="intl/libgettext.h" +ac_dests="intl/libintl.h" +srcdir=$ac_given_srcdir +while test -n "$ac_sources"; do + set $ac_dests; ac_dest=$1; shift; ac_dests=$* + set $ac_sources; ac_source=$1; shift; ac_sources=$* + + echo "linking $srcdir/$ac_source to $ac_dest" + + if test ! -r $srcdir/$ac_source; then + { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; } + fi + rm -f $ac_dest + + # Make relative symlinks. + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` + if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then + # The dest file is in a subdirectory. + test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" + ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dest_dir_suffix. + ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dest_dir_suffix= ac_dots= + fi + + case "$srcdir" in + [/$]*) ac_rel_source="$srcdir/$ac_source" ;; + *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; + esac + + # Make a symlink if possible; otherwise try a hard link. + if ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest; then : + else + { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; } + fi +done + +sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; \ + test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h +exit 0 diff --git a/src/apps/bin/sharutils-4.2.1/configure b/src/apps/bin/sharutils-4.2.1/configure new file mode 100755 index 0000000000..7a4a5d774c --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/configure @@ -0,0 +1,3955 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.7 +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --disable-uucode disable installation of uuencode and uudecode" +ac_help="$ac_help + --disable-nls do not use Native Language Support" +ac_help="$ac_help + --with-gnu-gettext use the GNU gettext library" +ac_help="$ac_help + --with-dmalloc use dmalloc, as in dmalloc.tar.gz from + @/ftp.antaire.com:antaire/src/dmalloc." + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= + +ac_prev= +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=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -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 ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$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" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + 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) + # 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 << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --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 +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$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" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + 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) + 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" ;; + + -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 ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.7" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + 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 "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=src/shar.c + +# 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 its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + 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 + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='echo $CPP $CPPFLAGS 1>&5; +$CPP $CPPFLAGS' +ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5; +${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' +ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5; +${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +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" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + + +PACKAGE=sharutils +VERSION=4.2.1 +ALL_LINGUAS="de fr ja_JP.EUC nl pt sv" +PROGRAMS="shar unshar" +SCRIPTS="mail-files mailshar" +MAN1PAGES="shar unshar" +MAN5PAGES= +cat >> confdefs.h <> confdefs.h <&6 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5 | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 +if test $ac_cv_prog_gcc = yes; then + GCC=yes + if test "${CFLAGS+set}" != set; then + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_gcc_g=yes +else + ac_cv_prog_gcc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 + if test $ac_cv_prog_gcc_g = yes; then + CFLAGS="-g -O" + else + CFLAGS="-O" + fi + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; 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 + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# 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 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_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. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&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_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755' + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +set dummy ${MAKE-make}; ac_make=$2 +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Carefully avoid gdiff for X as found on SGI systems. +if (DISPLAY= gdiff /dev/null /dev/null) 2> /dev/null; then + for ac_prog in gnudiff diffgnu gdiff diff +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_DIFF'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DIFF" in + /*) + ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DIFF="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DIFF="$ac_cv_path_DIFF" +if test -n "$DIFF"; then + echo "$ac_t""$DIFF" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$DIFF" && break +done +test -n "$DIFF" || DIFF="no" + +else + for ac_prog in gnudiff diffgnu diff +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_DIFF'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$DIFF" in + /*) + ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_DIFF="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +DIFF="$ac_cv_path_DIFF" +if test -n "$DIFF"; then + echo "$ac_t""$DIFF" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$DIFF" && break +done +test -n "$DIFF" || DIFF="no" + +fi + +PATH_save="$PATH"; PATH="$PATH:/usr/sbin:/usr/ucb:/usr/bin:/bin" +for ac_prog in Mail mailx elm mush mail +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_MAILER'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MAILER" in + /*) + ac_cv_path_MAILER="$MAILER" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_MAILER="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +MAILER="$ac_cv_path_MAILER" +if test -n "$MAILER"; then + echo "$ac_t""$MAILER" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$MAILER" && break +done +test -n "$MAILER" || MAILER="no" + +PATH="$PATH_save" + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PERL" in + /*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PERL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" + ;; +esac +fi +PERL="$ac_cv_path_PERL" +if test -n "$PERL"; then + echo "$ac_t""$PERL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +for ac_prog in bash sh +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_SH'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$SH" in + /*) + ac_cv_path_SH="$SH" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_SH="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +SH="$ac_cv_path_SH" +if test -n "$SH"; then + echo "$ac_t""$SH" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$SH" && break +done +test -n "$SH" || SH="no" + + +for ac_prog in gnutar targnu gtar tar +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$TAR" in + /*) + ac_cv_path_TAR="$TAR" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_TAR="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +TAR="$ac_cv_path_TAR" +if test -n "$TAR"; then + echo "$ac_t""$TAR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$TAR" && break +done +test -n "$TAR" || TAR="tar" + + +test $ac_cv_path_PERL = no || SCRIPTS="$SCRIPTS remsync" + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for AIX""... $ac_c" 1>&6 +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF +#define _ALL_SOURCE 1 +EOF + +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + +ac_safe=`echo "minix/config.h" | tr './\055' '___'` +echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + MINIX=yes +else + echo "$ac_t""no" 1>&6 +MINIX= +fi + +if test "$MINIX" = yes; then + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _POSIX_1_SOURCE 2 +EOF + + cat >> confdefs.h <<\EOF +#define _MINIX 1 +EOF + +fi + +# If we cannot run a trivial program, we must be cross compiling. +echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_cross=yes +else +cat > conftest.$ac_ext </dev/null; then + ac_cv_c_cross=no +else + ac_cv_c_cross=yes +fi +fi +rm -fr conftest* +fi + +echo "$ac_t""$ac_cv_c_cross" 1>&6 +cross_compiling=$ac_cv_c_cross + +if test $cross_compiling = no; then + echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$GCC" = yes; then + # GCC predefines this symbol on systems where it applies. +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_c_char_unsigned=yes +else + rm -rf conftest* + ac_cv_c_char_unsigned=no +fi +rm -f conftest* + +else +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else +cat > conftest.$ac_ext </dev/null; then + ac_cv_c_char_unsigned=yes +else + ac_cv_c_char_unsigned=no +fi +fi +rm -fr conftest* +fi +fi + +echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6 +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + cat >> confdefs.h <<\EOF +#define __CHAR_UNSIGNED__ 1 +EOF + +fi + +fi +echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_prog_cc_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CFLAGS="$CFLAGS" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc +for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc +do + CFLAGS="$ac_save_CFLAGS $ac_arg" + cat > conftest.$ac_ext <&6 +case "x$ac_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + + +echo $ac_n "checking for function prototypes""... $ac_c" 1>&6 +if test "$ac_cv_prog_cc_stdc" != no; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define PROTOTYPES 1 +EOF + + U= ANSI2KNR= +else + echo "$ac_t""no" 1>&6 + U=_ ANSI2KNR=ansi2knr +fi + +echo $ac_n "checking for working const""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + ac_cv_c_const=yes +else + rm -rf conftest* + ac_cv_c_const=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + +echo $ac_n "checking for inline""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <&6 +case "$ac_cv_c_inline" in + inline | yes) ;; + no) cat >> confdefs.h <<\EOF +#define inline +EOF + ;; + *) cat >> confdefs.h <&6 +if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat > conftest.$ac_ext < +#include +int main() { return 0; } +int t() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. +cat > conftest.$ac_ext < +#include +int main() { return 0; } +int t() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + ac_cv_c_bigendian=yes +else + rm -rf conftest* + ac_cv_c_bigendian=no +fi +rm -f conftest* + +fi +rm -f conftest* + +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else +cat > conftest.$ac_ext </dev/null; then + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +fi +rm -fr conftest* +fi +fi + +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + +fi + + +for ac_hdr in limits.h locale.h memory.h string.h sys/wait.h unistd.h +do +ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + cat >> confdefs.h <&6 +fi +done + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h +do +ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include <$ac_hdr> +int main() { return 0; } +int t() { +DIR *dirp = 0; +; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" +else + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'` + cat >> confdefs.h <&6 +fi +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then +echo $ac_n "checking for -ldir""... $ac_c" 1>&6 +ac_lib_var=`echo dir | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldir $LIBS" +cat > conftest.$ac_ext <&6 + LIBS="$LIBS -ldir" +else + echo "$ac_t""no" 1>&6 +fi + +else +echo $ac_n "checking for -lx""... $ac_c" 1>&6 +ac_lib_var=`echo x | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lx $LIBS" +cat > conftest.$ac_ext <&6 + LIBS="$LIBS -lx" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include + +#if defined(S_ISBLK) && defined(S_IFDIR) +# if S_ISBLK (S_IFDIR) +You lose. +# endif +#endif + +#if defined(S_ISBLK) && defined(S_IFCHR) +# if S_ISBLK (S_IFCHR) +You lose. +# endif +#endif + +#if defined(S_ISLNK) && defined(S_IFREG) +# if S_ISLNK (S_IFREG) +You lose. +# endif +#endif + +#if defined(S_ISSOCK) && defined(S_IFREG) +# if S_ISSOCK (S_IFREG) +You lose. +# endif +#endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "You lose" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_header_stat_broken=yes +else + rm -rf conftest* + ac_cv_header_stat_broken=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_header_stat_broken" 1>&6 +if test $ac_cv_header_stat_broken = yes; then + cat >> confdefs.h <<\EOF +#define STAT_MACROS_BROKEN 1 +EOF + +fi + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + 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 < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + 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 < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#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)) exit(2); +exit (0); } + +EOF +eval $ac_link +if test -s conftest && (./conftest; exit) 2>/dev/null; then + : +else + ac_cv_header_stdc=no +fi +fi +rm -fr conftest* +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { return 0; } +int t() { +struct tm *tp; tp->tm_sec; +; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + ac_cv_struct_tm=time.h +else + rm -rf conftest* + ac_cv_struct_tm=sys/time.h +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_struct_tm" 1>&6 +if test $ac_cv_struct_tm = sys/time.h; then + cat >> confdefs.h <<\EOF +#define TM_IN_SYS_TIME 1 +EOF + +fi + +echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include <$ac_cv_struct_tm> +int main() { return 0; } +int t() { +struct tm tm; tm.tm_zone; +; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + ac_cv_struct_tm_zone=yes +else + rm -rf conftest* + ac_cv_struct_tm_zone=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6 +if test "$ac_cv_struct_tm_zone" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_TM_ZONE 1 +EOF + +else + echo $ac_n "checking for tzname""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifndef tzname /* For SGI. */ +extern char *tzname[]; /* RS6000 and others reject char **tzname. */ +#endif +int main() { return 0; } +int t() { +atoi(*tzname); +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + ac_cv_var_tzname=yes +else + rm -rf conftest* + ac_cv_var_tzname=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_var_tzname" 1>&6 + if test $ac_cv_var_tzname = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_TZNAME 1 +EOF + + fi +fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "size_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + + +for ac_func in basename fchmod getcwd isascii memcpy strchr strerror uname +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char $ac_func(); + +int main() { return 0; } +int t() { + +/* 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 +#else +$ac_func(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { return 0; } +int t() { +char *p = alloca(2 * sizeof(int)); +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + ac_cv_header_alloca_h=yes +else + rm -rf conftest* + ac_cv_header_alloca_h=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 +if test $ac_cv_header_alloca_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ALLOCA_H 1 +EOF + +fi + +echo $ac_n "checking for alloca""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif + +int main() { return 0; } +int t() { +char *p = (char *) alloca(1); +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + ac_cv_func_alloca=yes +else + rm -rf conftest* + ac_cv_func_alloca=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_func_alloca" 1>&6 +if test $ac_cv_func_alloca = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ALLOCA 1 +EOF + +fi + +if test $ac_cv_func_alloca = no; then + # 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=alloca.o + cat >> confdefs.h <<\EOF +#define C_ALLOCA 1 +EOF + + +echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5 | + egrep "webecray" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_os_cray=yes +else + rm -rf conftest* + ac_cv_os_cray=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_os_cray" 1>&6 +if test $ac_cv_os_cray = yes; then +for ac_func in _getb67 GETB67 getb67; do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char $ac_func(); + +int main() { return 0; } +int t() { + +/* 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 +#else +$ac_func(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <&6 +fi + +done +fi + +echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_stack_direction=0 +else +cat > conftest.$ac_ext < addr) ? 1 : -1; +} +main () +{ + exit (find_stack_direction() < 0); +} +EOF +eval $ac_link +if test -s conftest && (./conftest; exit) 2>/dev/null; then + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +fi +rm -fr conftest* +fi + +echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 +cat >> confdefs.h <&6 +if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_closedir_void=yes +else +cat > conftest.$ac_ext < +#include <$ac_header_dirent> +int closedir(); main() { exit(closedir(opendir(".")) != 0); } +EOF +eval $ac_link +if test -s conftest && (./conftest; exit) 2>/dev/null; then + ac_cv_func_closedir_void=no +else + ac_cv_func_closedir_void=yes +fi +fi +rm -fr conftest* +fi + +echo "$ac_t""$ac_cv_func_closedir_void" 1>&6 +if test $ac_cv_func_closedir_void = yes; then + cat >> confdefs.h <<\EOF +#define CLOSEDIR_VOID 1 +EOF + +fi + +# strftime is in -lintl on SCO UNIX. +echo $ac_n "checking for -lintl""... $ac_c" 1>&6 +ac_lib_var=`echo intl | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lintl $LIBS" +cat > conftest.$ac_ext <&6 + LIBS="-lintl $LIBS" +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for strftime""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char strftime(); + +int main() { return 0; } +int t() { + +/* 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_strftime) || defined (__stub___strftime) +choke me +#else +strftime(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_strftime=yes" +else + rm -rf conftest* + eval "ac_cv_func_strftime=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_STRFTIME 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for vprintf""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char vprintf(); + +int main() { return 0; } +int t() { + +/* 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_vprintf) || defined (__stub___vprintf) +choke me +#else +vprintf(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_vprintf=yes" +else + rm -rf conftest* + eval "ac_cv_func_vprintf=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_VPRINTF 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +if test "$ac_cv_func_vprintf" != yes; then +echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char _doprnt(); + +int main() { return 0; } +int t() { + +/* 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__doprnt) || defined (__stub____doprnt) +choke me +#else +_doprnt(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func__doprnt=yes" +else + rm -rf conftest* + eval "ac_cv_func__doprnt=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_DOPRNT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +fi + +for ac_func in memset mktime stpcpy strftime +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char $ac_func(); + +int main() { return 0; } +int t() { + +/* 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 +#else +$ac_func(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +LIBOBJS="$LIBOBJS ${ac_func}.o" +fi + +done + +test "$ac_cv_func_basename" = yes || LIBOBJS="$LIBOBJS basename.o" + +echo $ac_n "checking for /etc/systemid""... $ac_c" 1>&6 +if test -f /etc/systemid; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_ETC_SYSTEMID 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking if uuencode and uudecode are wanted""... $ac_c" 1>&6 +# Check whether --enable-uucode or --disable-uucode was given. +if test "${enable_uucode+set}" = set; then + enableval="$enable_uucode" + if test "$enableval" = yes; then + echo "$ac_t""yes" 1>&6 + PROGRAMS="$PROGRAMS uudecode uuencode" + # uuencode.1 should install first, for uudecode.1 will be a link to it. + MAN1PAGES="$MAN1PAGES uuencode uudecode" + MAN5PAGES="$MAN5PAGES uuencode" +else + echo "$ac_t""no" 1>&6 +fi +else + + echo "$ac_t""yes" 1>&6 + PROGRAMS="$PROGRAMS uudecode uuencode" + # uuencode.1 should install first, for uudecode.1 will be a link to it. + MAN1PAGES="$MAN1PAGES uuencode uudecode" + MAN5PAGES="$MAN5PAGES uuencode" + +fi + + +echo $ac_n "checking for off_t""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "off_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_off_t=yes +else + rm -rf conftest* + ac_cv_type_off_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_off_t" 1>&6 +if test $ac_cv_type_off_t = no; then + cat >> confdefs.h <<\EOF +#define off_t long +EOF + +fi + +for ac_func in valloc getpagesize +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char $ac_func(); + +int main() { return 0; } +int t() { + +/* 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 +#else +$ac_func(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +echo $ac_n "checking for working mmap""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_mmap'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_mmap=no +else +cat > conftest.$ac_ext < +#include +#include + +#ifndef HAVE_GETPAGESIZE +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif +# else +# ifdef NBPC +# define getpagesize() NBPC +# else +# define getpagesize() PAGESIZE /* SVR4 */ +# endif +# endif +# endif +#endif + +#ifndef HAVE_VALLOC +# define valloc malloc +#endif + +#ifdef __cplusplus +extern "C" { void *valloc(unsigned), *malloc(unsigned); } +#else +char *valloc(), *malloc(); +#endif + +int +main() +{ + char *buf1, *buf2, *buf3; + int i = getpagesize(), j; + int i2 = i * 2; + int fd; + + buf1 = (char *)valloc(i2); + buf2 = (char *)valloc(i); + buf3 = (char *)malloc(i2); + for (j = 0; j < i2; ++j) + *(buf1 + j) = rand(); + fd = open("conftestmmap", O_CREAT | O_RDWR, 0666); + write(fd, buf1, i2); + mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0); + for (j = 0; j < i; ++j) + if (*(buf1 + j) != *(buf2 + j)) + exit(1); + lseek(fd, (long)i, 0); + read(fd, buf2, i); /* read into mapped memory -- file should not change */ + /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */ + lseek(fd, (long)0, 0); + read(fd, buf3, i2); + for (j = 0; j < i2; ++j) + if (*(buf1 + j) != *(buf3 + j)) + exit(1); + exit(0); +} + +EOF +eval $ac_link +if test -s conftest && (./conftest; exit) 2>/dev/null; then + ac_cv_func_mmap=yes +else + ac_cv_func_mmap=no +fi +fi +rm -fr conftest* +fi + +echo "$ac_t""$ac_cv_func_mmap" 1>&6 +if test $ac_cv_func_mmap = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_MMAP 1 +EOF + +fi + + + for ac_hdr in limits.h locale.h nl_types.h malloc.h string.h unistd.h values.h +do +ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + cat >> confdefs.h <&6 +fi +done + + for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char $ac_func(); + +int main() { return 0; } +int t() { + +/* 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 +#else +$ac_func(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test "${ac_cv_func_stpcpy+set}" != "set"; then + for ac_func in stpcpy +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char $ac_func(); + +int main() { return 0; } +int t() { + +/* 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 +#else +$ac_func(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + fi + if test "${ac_cv_func_stpcpy}" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_STPCPY 1 +EOF + + fi + + if test $ac_cv_header_locale_h = yes; then + echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 + if eval "test \"`echo '$''{'ud_cv_val_LC_MESSAGES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { return 0; } +int t() { +return LC_MESSAGES +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + ud_cv_val_LC_MESSAGES=yes +else + rm -rf conftest* + ud_cv_val_LC_MESSAGES=no +fi +rm -f conftest* + +fi + + echo "$ac_t""$ud_cv_val_LC_MESSAGES" 1>&6 + if test $ud_cv_val_LC_MESSAGES = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LC_MESSAGES 1 +EOF + + fi + fi + echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 + # Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + nls_cv_use_nls=$enableval +else + nls_cv_use_nls=yes +fi + + echo "$ac_t""$nls_cv_use_nls" 1>&6 + + if test "$nls_cv_use_nls" = "yes"; then + cat >> confdefs.h <<\EOF +#define ENABLE_NLS 1 +EOF + + echo $ac_n "checking for explicitly using GNU gettext""... $ac_c" 1>&6 + # Check whether --with-gnu-gettext or --without-gnu-gettext was given. +if test "${with_gnu_gettext+set}" = set; then + withval="$with_gnu_gettext" + nls_cv_force_use_gnu_gettext=$withval +else + nls_cv_force_use_gnu_gettext=no +fi + + echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 + + if test "$nls_cv_force_use_gnu_gettext" = "yes"; then + nls_cv_use_gnu_gettext=yes + else + echo $ac_n "checking for -lintl""... $ac_c" 1>&6 +ac_lib_var=`echo intl | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lintl $LIBS" +cat > conftest.$ac_ext <&6 + ac_tr_lib=HAVE_LIB`echo intl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for -li""... $ac_c" 1>&6 +ac_lib_var=`echo i | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-li $LIBS" +cat > conftest.$ac_ext <&6 + ac_tr_lib=HAVE_LIB`echo i | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi + + CATOBJEXT=NONE + echo $ac_n "checking for gettext""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_gettext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char gettext(); + +int main() { return 0; } +int t() { + +/* 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_gettext) || defined (__stub___gettext) +choke me +#else +gettext(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_gettext=yes" +else + rm -rf conftest* + eval "ac_cv_func_gettext=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'gettext`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_GETTEXT 1 +EOF + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test -n "$MSGFMT"; then + echo "$ac_t""$MSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if test "$MSGFMT" != "no"; then + for ac_func in dcgettext +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char $ac_func(); + +int main() { return 0; } +int t() { + +/* 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 +#else +$ac_func(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_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 "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if echo $GMSGFMT | grep openwin > /dev/null; then + echo "WARNING: Do not use OpenWin's gmsgfmt. (Better remove it.) >&6" + ac_cv_path_GMSGFMT=gmsgfmt + GMSGFMT=gmsgfmt + fi + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT="xgettext" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test -n "$XGETTEXT"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if echo $XGETTEXT | grep openwin > /dev/null; then + echo "WARNING: Do not use OpenWin's xgettext. (Better remove it.) >&6" + ac_cv_path_XGETTEXT=xgettext + XGETTEXT=xgettext + fi + CATOBJEXT=.mo + INSTOBJEXT=.mo + DATADIRNAME=lib + fi +else + echo "$ac_t""no" 1>&6 +fi + + + if test "$CATOBJEXT" = "NONE"; then + echo $ac_n "checking for catgets""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +char catgets(); + +int main() { return 0; } +int t() { + +/* 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_catgets) || defined (__stub___catgets) +choke me +#else +catgets(); +#endif + +; return 0; } +EOF +if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_func_catgets=yes" +else + rm -rf conftest* + eval "ac_cv_func_catgets=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_CATGETS 1 +EOF + + INTLOBJS="\$(CATOBJS)" + # Extract the first word of "gencat", so it can be a program name with args. +set dummy gencat; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GENCAT" in + /*) + ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GENCAT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no" + ;; +esac +fi +GENCAT="$ac_cv_path_GENCAT" +if test -n "$GENCAT"; then + echo "$ac_t""$GENCAT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if test "$GENCAT" != "no"; then + for ac_prog in gmsgfmt msgfmt +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$GMSGFMT" && break +done +test -n "$GMSGFMT" || GMSGFMT="msgfmt" + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT="xgettext" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test -n "$XGETTEXT"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if echo $XGETTEXT | grep openwin > /dev/null; then + echo "WARNING: Do not use OpenWin's xgettext. (Better remove it.) >&6" + ac_cv_path_XGETTEXT=xgettext + XGETTEXT=xgettext + fi + CATOBJEXT=.cat + INSTOBJEXT=.cat + DATADIRNAME=lib + INTLDEPS="../intl/libintl.a" + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + + # We need to process the intl/ and po/ directory. + INTLSUB=intl + fi +else + echo "$ac_t""no" 1>&6 +fi + + fi + + if test "$CATOBJEXT" = "NONE"; then + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + INTLOBJS="\$(GETTOBJS)" + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test -n "$MSGFMT"; then + echo "$ac_t""$MSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if echo $MSGFMT | grep openwin > /dev/null; then + echo "WARNING: Do not use OpenWin's msgfmt. (Better remove it.) >&6" + ac_cv_path_MSGFMT=msgfmt + MSGFMT=msgfmt + fi + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_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 "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if echo $GMSGFMT | grep openwin > /dev/null; then + echo "WARNING: Do not use OpenWin's gmsgfmt. (Better remove it.) >&6" + ac_cv_path_GMSGFMT=gmsgfmt + GMSGFMT=gmsgfmt + fi + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT="xgettext" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test -n "$XGETTEXT"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if echo $XGETTEXT | grep openwin > /dev/null; then + echo "WARNING: Do not use OpenWin's xgettext. (Better remove it.) >&6" + ac_cv_path_XGETTEXT=xgettext + XGETTEXT=xgettext + fi + + CATOBJEXT=.gmo + INSTOBJEXT=.mo + DATADIRNAME=share + INTLDEPS="../intl/libintl.a" + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + + # We need to process the intl/ directory. + INTLSUB=intl + fi + + # We need to process the po/ directory. + POSUB=po + else + DATADIRNAME=share + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + + + + + + + + + + + + + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + echo "$ac_t""$LINGUAS" 1>&6 + fi + + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + test -d intl || mkdir intl + if test "$CATOBJEXT" = ".cat"; then + ac_safe=`echo "linux/version.h" | tr './\055' '___'` +echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + msgformat=linux +else + echo "$ac_t""no" 1>&6 +msgformat=xopen +fi + + + sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed + fi + sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ + $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed + + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + +echo $ac_n "checking if malloc debugging is wanted""... $ac_c" 1>&6 +# Check whether --with-dmalloc or --without-dmalloc was given. +if test "${with_dmalloc+set}" = set; then + withval="$with_dmalloc" + if test "$withval" = yes; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define WITH_DMALLOC 1 +EOF + + LIBS="$LIBS -ldmalloc" + LDFLAGS="$LDFLAGS -g" +else + echo "$ac_t""no" 1>&6 +fi +else + echo "$ac_t""no" 1>&6 +fi + + +# sharutils is somewhat special about internationalization in that it +# always requires the GNU .mo files installed. +if test "x$CATOBJEXT" = "x.mo" || test "x$CATOBJEXT" = "x.cat"; then + new_CATALOGS="" + for cat in $CATALOGS; do + lang=`echo $cat | sed "s/\(.*\)\..*/\1/"` + new_CATALOGS="$new_CATALOGS $cat $lang.gmo" + done + CATALOGS="$new_CATALOGS" +fi + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# 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. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# 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. +(set) 2>&1 | + sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ + >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.7" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile src/mail-files src/mailshar src/remsync contrib/Makefile \ + lib/Makefile intl/Makefile intl/po2tbl.sed src/Makefile \ + po/Makefile.in doc/Makefile checks/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@PROGRAMS@%$PROGRAMS%g +s%@SCRIPTS@%$SCRIPTS%g +s%@MAN1PAGES@%$MAN1PAGES%g +s%@MAN5PAGES@%$MAN5PAGES%g +s%@DIST_ALPHA@%$DIST_ALPHA%g +s%@CC@%$CC%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@SET_MAKE@%$SET_MAKE%g +s%@RANLIB@%$RANLIB%g +s%@DIFF@%$DIFF%g +s%@MAILER@%$MAILER%g +s%@PERL@%$PERL%g +s%@SH@%$SH%g +s%@TAR@%$TAR%g +s%@CPP@%$CPP%g +s%@U@%$U%g +s%@ANSI2KNR@%$ANSI2KNR%g +s%@ALLOCA@%$ALLOCA%g +s%@LIBOBJS@%$LIBOBJS%g +s%@MSGFMT@%$MSGFMT%g +s%@GMSGFMT@%$GMSGFMT%g +s%@XGETTEXT@%$XGETTEXT%g +s%@GENCAT@%$GENCAT%g +s%@CATALOGS@%$CATALOGS%g +s%@CATOBJEXT@%$CATOBJEXT%g +s%@DATADIRNAME@%$DATADIRNAME%g +s%@GMOFILES@%$GMOFILES%g +s%@INSTOBJEXT@%$INSTOBJEXT%g +s%@INTLDEPS@%$INTLDEPS%g +s%@INTLLIBS@%$INTLLIBS%g +s%@INTLOBJS@%$INTLOBJS%g +s%@INTLSUB@%$INTLSUB%g +s%@POFILES@%$POFILES%g +s%@POSUB@%$POSUB%g + +CEOF +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust relative srcdir, etc. for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +fi; done +rm -f conftest.subs + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"} +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + cp $ac_given_srcdir/$ac_file_in conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #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. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. +# Maximum number of lines to put in a single here document. +ac_max_here_lines=12 + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +srcdir=$ac_given_srcdir +while test -n "$ac_sources"; do + set $ac_dests; ac_dest=$1; shift; ac_dests=$* + set $ac_sources; ac_source=$1; shift; ac_sources=$* + + echo "linking $srcdir/$ac_source to $ac_dest" + + if test ! -r $srcdir/$ac_source; then + { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; } + fi + rm -f $ac_dest + + # Make relative symlinks. + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` + if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then + # The dest file is in a subdirectory. + test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" + ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dest_dir_suffix. + ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dest_dir_suffix= ac_dots= + fi + + case "$srcdir" in + [/$]*) ac_rel_source="$srcdir/$ac_source" ;; + *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; + esac + + # Make a symlink if possible; otherwise try a hard link. + if ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest; then : + else + { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; } + fi +done + +sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; \ + test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/src/apps/bin/sharutils-4.2.1/configure.in b/src/apps/bin/sharutils-4.2.1/configure.in new file mode 100644 index 0000000000..4b0f5849de --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/configure.in @@ -0,0 +1,138 @@ +# Configure template for GNU shar utilities. +# Copyright (C) 1994 Free Software Foundation, Inc. +# Process this file with autoconf to produce a configure script. + +# FIXME: AC_HAVE_HEADERS(sys/time.h) +# FIXME: AC_HAVE_FUNCS(gethostname getwd) + +AC_INIT(src/shar.c) +AC_CONFIG_HEADER(config.h) +AC_ARG_PROGRAM + +PACKAGE=sharutils +VERSION=4.2.1 +ALL_LINGUAS="de fr ja_JP.EUC nl pt sv" +PROGRAMS="shar unshar" +SCRIPTS="mail-files mailshar" +MAN1PAGES="shar unshar" +MAN5PAGES= +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") +AC_DEFINE_UNQUOTED(VERSION, "$VERSION") +AC_SUBST(PACKAGE) +AC_SUBST(VERSION) +AC_SUBST(PROGRAMS) +AC_SUBST(SCRIPTS) +AC_SUBST(MAN1PAGES) +AC_SUBST(MAN5PAGES) + +changequote(,)dnl +case $VERSION in + [0-9]*.[0-9]*.[0-9]*) DIST_ALPHA="README-alpha";; + *) DIST_ALPHA=;; +esac +changequote([, ])dnl +AC_SUBST(DIST_ALPHA) + +AC_PROG_CC +fp_PROG_INSTALL +AC_PROG_MAKE_SET +AC_PROG_RANLIB + +dnl FIXME: Check that it is GNU diff indeed. +# Carefully avoid gdiff for X as found on SGI systems. +if (DISPLAY= gdiff /dev/null /dev/null) 2> /dev/null; then + AC_PATH_PROGS(DIFF, gnudiff diffgnu gdiff diff, no) +else + AC_PATH_PROGS(DIFF, gnudiff diffgnu diff, no) +fi + +dnl FIXME: Check that mailer accepts -s. +PATH_save="$PATH"; PATH="$PATH:/usr/sbin:/usr/ucb:/usr/bin:/bin" +AC_PATH_PROGS(MAILER, Mail mailx elm mush mail, no) +PATH="$PATH_save" + +dnl FIXME: Check that perl was found. +AC_PATH_PROG(PERL, perl, no) + +AC_PATH_PROGS(SH, bash sh, no) + +dnl FIXME: Check that it is GNU tar indeed. +AC_PATH_PROGS(TAR, gnutar targnu gtar tar, tar) + +test $ac_cv_path_PERL = no || SCRIPTS="$SCRIPTS remsync" + +AC_AIX +AC_ISC_POSIX +AC_MINIX +AC_C_CROSS +if test $cross_compiling = no; then + AC_C_CHAR_UNSIGNED +fi +fp_C_PROTOTYPES +AC_C_CONST +AC_C_INLINE +AC_C_BIGENDIAN + +AC_CHECK_HEADERS(limits.h locale.h memory.h string.h sys/wait.h unistd.h) +AC_HEADER_DIRENT +AC_HEADER_STAT +AC_HEADER_STDC +AC_STRUCT_TIMEZONE +AC_TYPE_SIZE_T + +AC_CHECK_FUNCS(basename fchmod getcwd isascii memcpy strchr strerror uname) +AC_FUNC_ALLOCA +AC_FUNC_CLOSEDIR_VOID +AC_FUNC_STRFTIME +AC_FUNC_VPRINTF +AC_REPLACE_FUNCS(memset mktime stpcpy strftime) +test "$ac_cv_func_basename" = yes || LIBOBJS="$LIBOBJS basename.o" + +AC_MSG_CHECKING(for /etc/systemid) +if test -f /etc/systemid; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ETC_SYSTEMID) +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(if uuencode and uudecode are wanted) +AC_ARG_ENABLE(uucode, +[ --disable-uucode disable installation of uuencode and uudecode], +[if test "$enableval" = yes; then + AC_MSG_RESULT(yes) + PROGRAMS="$PROGRAMS uudecode uuencode" + # uuencode.1 should install first, for uudecode.1 will be a link to it. + MAN1PAGES="$MAN1PAGES uuencode uudecode" + MAN5PAGES="$MAN5PAGES uuencode" +else + AC_MSG_RESULT(no) +fi], [ + AC_MSG_RESULT(yes) + PROGRAMS="$PROGRAMS uudecode uuencode" + # uuencode.1 should install first, for uudecode.1 will be a link to it. + MAN1PAGES="$MAN1PAGES uuencode uudecode" + MAN5PAGES="$MAN5PAGES uuencode" +]) + +ud_GNU_GETTEXT +fp_WITH_DMALLOC + +# sharutils is somewhat special about internationalization in that it +# always requires the GNU .mo files installed. +if test "x$CATOBJEXT" = "x.mo" || test "x$CATOBJEXT" = "x.cat"; then + new_CATALOGS="" + for cat in $CATALOGS; do + lang=`echo $cat | sed "s/\(.*\)\..*/\1/"` + new_CATALOGS="$new_CATALOGS $cat $lang.gmo" + done + CATALOGS="$new_CATALOGS" +fi + +AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) + +AC_OUTPUT([Makefile src/mail-files src/mailshar src/remsync contrib/Makefile \ + lib/Makefile intl/Makefile intl/po2tbl.sed src/Makefile \ + po/Makefile.in doc/Makefile checks/Makefile], +[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; \ + test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h]) diff --git a/src/apps/bin/sharutils-4.2.1/contrib/Makefile b/src/apps/bin/sharutils-4.2.1/contrib/Makefile new file mode 100644 index 0000000000..dd7f297deb --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/Makefile @@ -0,0 +1,64 @@ +# Generated automatically from Makefile.in by configure. +# Makefile for GNU shar utilities, contribution directory. +# Copyright (C) 1995 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = sharutils +VERSION = 4.2.1 + +SHELL = /bin/sh +srcdir = . + +subdir = contrib + +.SUFFIXES: + +DISTFILES = Makefile.in shar.sh shar2.sh bas-README uudecode.bas \ +pas-README pas-R.Marks pas-diffs uudecode.pas uuencode.pas \ +uudecode.pl uuencode.pl + +all: + +check: + +install: + +uninstall: + +mostlyclean: + +clean: mostlyclean + +distclean: clean + rm -f Makefile + +maintainer-clean: distclean + @echo "This command is intended only for maintainers to use;" + @echo "rebuilding the deleted files may require special tools." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: $(DISTFILES) + @for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: ../config.status Makefile.in + cd .. && CONFIG_FILES=contrib/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/contrib/Makefile.in b/src/apps/bin/sharutils-4.2.1/contrib/Makefile.in new file mode 100644 index 0000000000..37a265fa02 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/Makefile.in @@ -0,0 +1,64 @@ +# Makefile for GNU shar utilities, contribution directory. +# Copyright (C) 1995 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +srcdir = @srcdir@ +VPATH = @srcdir@ + +subdir = contrib + +.SUFFIXES: + +DISTFILES = Makefile.in shar.sh shar2.sh bas-README uudecode.bas \ +pas-README pas-R.Marks pas-diffs uudecode.pas uuencode.pas \ +uudecode.pl uuencode.pl + +all: + +check: + +install: + +uninstall: + +mostlyclean: + +clean: mostlyclean + +distclean: clean + rm -f Makefile + +maintainer-clean: distclean + @echo "This command is intended only for maintainers to use;" + @echo "rebuilding the deleted files may require special tools." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: $(DISTFILES) + @for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: ../config.status Makefile.in + cd .. && CONFIG_FILES=contrib/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/contrib/bas-README b/src/apps/bin/sharutils-4.2.1/contrib/bas-README new file mode 100644 index 0000000000..e1c787d2e8 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/bas-README @@ -0,0 +1,25 @@ +Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site hoptoad.uucp +From: rde@ukc.ac.uk (R.D.Eager) +Newsgroups: net.sources +Subject: Revised UUDECODE in MS-BASIC +Date: 14 Mar 86 11:53:53 GMT +Date-Received: 15 Mar 86 13:45:45 GMT +Reply-To: rde@ukc.ac.uk (R.D.Eager) + +A while ago I posted a UUDECODE program, written in Microsoft Basic, +to net.sources. Judging from the number of replies I had, people +are finding this useful if they don't have access to the public +domain UUDECODE, or to a C compiler. + +I found one or two problems recently; the main one was that it would +not create an output file of more than 64K due to an undocumented +feature of MS-BASIC. Here is a corrected version; as always, I +suggest you compile it if you want the run time to be finite. + + Bob Eager + + rde@ukc.UUCP + rde@ukc + ...!mcvax!ukc!rde + + Phone: +44 227 66822 ext 7589 diff --git a/src/apps/bin/sharutils-4.2.1/contrib/pas-R.Marks b/src/apps/bin/sharutils-4.2.1/contrib/pas-R.Marks new file mode 100644 index 0000000000..915ad89096 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/pas-R.Marks @@ -0,0 +1,25 @@ +From: rmarks@KSP.Unisys.COM (Richard Marks) +Newsgroups: comp.binaries.ibm.pc.archives +Subject: UUENCODE/DECODE 4.20 +Date: 14 Aug 91 14:26:44 GMT + +I have just send in my latest UUENCODE/DECODE package to c.b.i.p +for posting. This is level 4.20. + +This package has been out for four years. It is fast and it automatically +handles multi-section decoding - with automatic CRC testing. Just +save submissions as foo1.uue, foo2.uue, etc.; download to the PC; and +enter UUDECODE FOO. + +Also this package handles lots of variations in checksums and character +permutations. This includes XXencode/decode. + +The 4.20 version replaces the 4.13 version. It is a minor update with +some improved error messages, beeping to alert for errors, and detection +of some additional character permutations. Also the prior default for the +encode was to put a checksum on each line; now with the use of full file +CRC's, the default has been changed to turn this off. + +Regards, +Richard Marks +rmarks@MDC.unisys.COM diff --git a/src/apps/bin/sharutils-4.2.1/contrib/pas-README b/src/apps/bin/sharutils-4.2.1/contrib/pas-README new file mode 100644 index 0000000000..0a31d26e63 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/pas-README @@ -0,0 +1,45 @@ +Here are versions of uuencode and uudecode that will work on an IBM +PC. There is a version for Turbo Pascal and one for Microsoft C. +Porting them into other machines, languages or dialects should not +pose a large problem. + +Sorry about the lack of documentation, but the programs are easy to +use, so you should not have a problem. I don't know why a UNIX +site would not have these in the first place, but at least your +manual should tell you how to use them. If you are not using UNIX +at all, you have my sympathy. + +The Pascal programs' author is unknown. The C programs were +provided by Don Kneller. + +Tom Reingold +Rockefeller University +New York City +UUCP: {seismo | harvard | ihnp4}!cmcl2!rna!rocky2!reintom +BITNET: REINTOM@ROCKVAX +ARPANET: reintom@rockefeller.arpa + +====================================================================== + +Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site hoptoad.uucp +From: darmon@polaris.UUCP (Pierre Darmon) +Newsgroups: net.sources +Subject: Modified Turbo Pascal uudecode/encode. More user-friendly. +Date: 30 Oct 86 01:12:40 GMT +Date-Received: +Reply-To: darmon@polaris.UUCP (Pierre Darmon) +Organization: IBM Research, Yorktown Heights, N.Y. + +The following are the Turbo Pascal source files for uudecode and uuencode, +modified from the net posting to display the remaining bytes to be processed, +instead of filling up the screen with periods. It also displays the percentage +left. See my previous posting to net.micro,net.micro.pc and net.sources for +details. + +Enjoy! + +-- + +Pierre Darmon, IBM Thomas J. Watson Research Center. +.....seismo!philabs!polaris!darmon. +darmon.yktvmz.ibm@csnet-relay diff --git a/src/apps/bin/sharutils-4.2.1/contrib/pas-diffs b/src/apps/bin/sharutils-4.2.1/contrib/pas-diffs new file mode 100644 index 0000000000..29032f45de --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/pas-diffs @@ -0,0 +1,144 @@ +diff -u 870527-ibm-pc/README 861030-darmon/README +--- 870527-ibm-pc/README Wed May 27 00:12:39 1987 ++++ 861030-darmon/README Sat Feb 11 20:45:04 1995 +@@ -1,20 +1,23 @@ +-Here are versions of uuencode and uudecode that will work on an IBM +-PC. There is a version for Turbo Pascal and one for Microsoft C. +-Porting them into other machines, languages or dialects should not +-pose a large problem. ++Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site hoptoad.uucp ++From: darmon@polaris.UUCP (Pierre Darmon) ++Newsgroups: net.sources ++Subject: Modified Turbo Pascal uudecode/encode. More user-friendly. ++Date: 30 Oct 86 01:12:40 GMT ++Date-Received: ++Reply-To: darmon@polaris.UUCP (Pierre Darmon) ++Organization: IBM Research, Yorktown Heights, N.Y. + +-Sorry about the lack of documentation, but the programs are easy to +-use, so you should not have a problem. I don't know why a UNIX +-site would not have these in the first place, but at least your +-manual should tell you how to use them. If you are not using UNIX +-at all, you have my sympathy. ++The following are the Turbo Pascal source files for uudecode and uuencode, ++modified from the net posting to display the remaining bytes to be processed, ++instead of filling up the screen with periods. It also displays the percentage ++left. See my previous posting to net.micro,net.micro.pc and net.sources for ++details. + +-The Pascal programs' author is unknown. The C programs were +-provided by Don Kneller. ++Enjoy! + +-Tom Reingold +-Rockefeller University +-New York City +-UUCP: {seismo | harvard | ihnp4}!cmcl2!rna!rocky2!reintom +-BITNET: REINTOM@ROCKVAX +-ARPANET: reintom@rockefeller.arpa ++ ++-- ++ ++Pierre Darmon, IBM Thomas J. Watson Research Center. ++.....seismo!philabs!polaris!darmon. ++darmon.yktvmz.ibm@csnet-relay +Only in 861030-darmon: diffs +diff -u 870527-ibm-pc/uudecode.pas 861030-darmon/uudecode.pas +--- 870527-ibm-pc/uudecode.pas Wed May 27 00:12:39 1987 ++++ 861030-darmon/uudecode.pas Sat Feb 11 20:44:32 1995 +@@ -6,9 +6,11 @@ + TYPE string80 = string[80]; + + VAR infile: text; ++ fi : file of byte; + outfile: file of byte; + lineNum: integer; + line: string80; ++ size,remaining :real; + + procedure Abort(message: string80); + +@@ -23,8 +25,11 @@ + + begin {NextLine} + LineNum := succ(LineNum); +- write('.'); +- readln(infile, s) ++ {write('.');} ++ readln(infile, s); ++ remaining:=remaining-length(s)-2; {-2 is for CR/LF} ++ write('bytes remaining: ',remaining:7:0,' (', ++ remaining/size*100.0:3:0,'%)',chr(13)); + end; {NextLine} + + procedure Init; +@@ -43,7 +48,11 @@ + reset(infile); + {$i+} + if IOresult > 0 then abort (concat('Can''t open ', infilename)); +- writeln ('Decoding ', infilename) ++ writeln ('Decoding ', infilename); ++ assign(fi,infilename); reset(fi); ++ size:=FileSize(fi); close(fi); ++ if size < 0 then size:=size+65536.0; ++ remaining:=size; + end; {GetInFile} + + procedure GetOutFile; +@@ -158,7 +167,7 @@ + then abort('Illegal character in line.'); + { write(line[lineindex]:2);} + if line[lineindex] = '`' then nextch := ' ' +- else nextch := line[lineIndex] ++ else nextch := line[lineIndex] + end; {nextch} + + procedure DecodeByte; +diff -u 870527-ibm-pc/uuencode.pas 861030-darmon/uuencode.pas +--- 870527-ibm-pc/uuencode.pas Wed May 27 00:12:40 1987 ++++ 861030-darmon/uuencode.pas Sat Feb 11 20:44:51 1995 +@@ -18,6 +18,7 @@ + line: array [0..59] of char; + hunk: array [0..2] of byte; + chars: array [0..3] of byte; ++ size,remaining :real; + + { procedure debug; + +@@ -70,6 +71,9 @@ + reset (infile); + {$i+} + if IOResult > 0 then abort (concat ('Can''t open file ', infilename)); ++ size:=FileSize(infile); ++ if size < 0 then size:=size+65536.0; ++ remaining:=size; + write('Uuencoding file ', infilename); + + i := pos('.', infilename); +@@ -131,7 +135,9 @@ + end; {writeout} + + begin {FlushLine} +- write ('.'); ++ {write ('.');} ++ write('bytes remaining: ',remaining:7:0,' (', ++ remaining/size*100.0:3:0,'%)',chr(13)); + writeout(chr(bytesInLine + offset)); + for i := 0 to pred(lineLength) do + writeout(line[i]); +@@ -167,6 +173,7 @@ + begin {encode1}; + if numbytes = bytesperhunk then flushhunk; + read (infile, hunk[numbytes]); ++ remaining:=remaining-1; + numbytes := succ(numbytes) + end; {encode1} + +@@ -190,5 +197,6 @@ + begin {uuencode} + init; + while not eof (infile) do encode1; +- terminate ++ terminate; ++ writeln; + end. {uuencode} diff --git a/src/apps/bin/sharutils-4.2.1/contrib/shar.sh b/src/apps/bin/sharutils-4.2.1/contrib/shar.sh new file mode 100644 index 0000000000..3a9783a998 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/shar.sh @@ -0,0 +1,176 @@ +#!/bin/sh +# UNISRC_ID: @(#)shar.sh 27.1 84/12/17 +: Make a shell archive package + +# Usage: $0 [-b] [-c] [-t] [-v] files... > package +# See the manual entry for details. + + +# Initialize: + +diagnostic='eval echo >&2' # diagnostics to stderr by default. +trap '$diagnostic "$0: quitting early"; exit 1' 1 2 3 15 +base_option=FALSE # use pathnames, not basenames. +check_option=FALSE # don't generate integrity check. +USAGE='Usage: $0 \[-b] \[-c] \[-t] \[-v] files... \> package' + + +# Extract and digest options, if any: +# +# Un-comment the "-)" line below to treat single dashes as a no-op. +# Commented means single dashes elicit a usage diagnostic. + +while [ -n "$1" ] # while there are more arguments, +do # digest them; stop when you find a non-option. + case "$1" in + -b) base_option=TRUE; shift;; + -c) check_option=TRUE; shift;; + -v) verbose=TRUE; shift;; + -t) verbose=TRUE; diagnostic='eval echo >/dev/tty'; shift;; +### -) shift;; # if uncommented, eat single dashes. + -*) $diagnostic $USAGE; exit 1;; # die at illegal options. + *) break;; # non-option found. + esac +done + + +# Check remaining arguments, which should be just a list of files: + +if [ $# = 0 ] +then # no arguments left! + $diagnostic $USAGE + exit 1 +fi + + +# Check the cupboard to see if the ingredients are all there: + +contents='' # no files so far. +contdirs='' # no directories so far. + +for arg # for all files specified, +do # establish the archive name. + if [ -f "$arg" ] + then # file exists and is not a directory. + case $base_option in + TRUE) unpack_name=`basename "$arg"` ;; + FALSE) unpack_name="$arg" ;; + esac + + contents="$contents $unpack_name" + + elif [ -d "$arg" ] + then # file exists and is a directory. + case $base_option in + TRUE) $diagnostic '$0: cannot archive directory "$arg" with -b option.' + exit 1 ;; + FALSE) contdirs="$contdirs $arg/ " ;; + esac + + else # not a plain file and not a directory. + $diagnostic '$0: cannot archive "$arg"' + exit 1 + fi +done + + +# Emit the prologue: +# (The leading newline is for those who type csh instead of sh.) + +cat < \"$unpack_name\" <<'$separator'" + sed -e 's/^[.~@]/@&/' -e 's/^From/@&/' "$arg" + echo $separator + fi + + # Emit chmod to set permissions on the extracted file; + # this keels over if the filename contains "?". + ls -ld $arg | sed \ + -e 's/^.\(...\)\(...\)\(...\).*/u=\1,g=\2,o=\3/' \ + -e 's/-//g' \ + -e 's?.*?chmod & '"$unpack_name?" + echo " " +done + + +# If the -c option was given, emit the checking epilogue: +# (The sed script converts files to basenames so it works regardless of -b.) + +if [ $check_option = TRUE ] +then + echo 'echo Inspecting for damage in transit...' + echo 'temp=/tmp/shar$$; dtemp=/tmp/.shar$$' + echo 'trap "rm -f $temp $dtemp; exit" 0 1 2 3 15' + echo 'cat > $temp <<\!!!' + case $base_option in + TRUE) wc $@ | sed 's=[^ ]*/==' ;; + FALSE) wc $contents | sed 's=[^ ]*/==' ;; + esac + echo '!!!' + echo "wc $contents | sed 's=[^ ]*/==' | "'diff -b $temp - >$dtemp' + echo 'if [ -s $dtemp ]' + echo 'then echo "Ouch [diff of wc output]:" ; cat $dtemp' + echo 'else echo "No problems found."' + echo 'fi' +fi + + +# Finish up: + +echo 'exit 0' # sharchives unpack even if junk follows. +exit 0 diff --git a/src/apps/bin/sharutils-4.2.1/contrib/shar2.sh b/src/apps/bin/sharutils-4.2.1/contrib/shar2.sh new file mode 100644 index 0000000000..e7a6b6ac56 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/shar2.sh @@ -0,0 +1,74 @@ +#!/bin/sh - +# +# Copyright (c) 1990 The Regents of the University of California. +# 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. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. +# +# @(#)shar.sh 5.2 (Berkeley) 5/23/90 +# + +if [ $# -eq 0 ]; then + echo 'usage: shar file ...' + exit 1 +fi + +cat << EOF +# This is a shell archive. Save it in a file, remove anything before +# this line, and then unpack it by entering "sh file". Note, it may +# create directories; files and directories will be owned by you and +# have default permissions. +# +# This archive contains: +# +EOF + +for i +do + echo "# $i" +done + +echo "#" + +for i +do + if [ -d $i ]; then + echo "echo c - $i" + echo "mkdir $i > /dev/null 2>&1" + else + echo "echo x - $i" + echo "sed 's/^X//' >$i << 'END-of-$i'" + sed 's/^/X/' $i + echo "END-of-$i" + fi +done +echo exit +echo "" + +exit 0 diff --git a/src/apps/bin/sharutils-4.2.1/contrib/uudecode.bas b/src/apps/bin/sharutils-4.2.1/contrib/uudecode.bas new file mode 100644 index 0000000000..ff7fc30afa --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/uudecode.bas @@ -0,0 +1,78 @@ +1000 KEY OFF +1001 DEFINT A-Z +1010 REM Trap error opening input file +1020 ON ERROR GOTO 1600 +1030 CLS +1040 LOCATE 5,11 +1050 PRINT STRING$(40," ") +1060 LOCATE 5,11 +1070 INPUT "Enter name of input file: ", INFILE$ +1080 OPEN INFILE$ FOR INPUT AS #1 +1090 LOCATE 8,10 +1100 PRINT STRING$(40," ") +1110 REM Trap error opening output file +1120 ON ERROR GOTO 1640 +1130 LOCATE 8,10 +1140 INPUT "Enter name of output file: ", OUTFILE$ +1150 OPEN "R", #2,OUTFILE$, 1 +1160 FIELD #2, 1 AS N$ +1170 REM Trap error at end of file +1180 ON ERROR GOTO 1680 +1190 REM Search for header line +1200 LINE INPUT #1,A$ +1210 IF LEFT$(A$,5) <>"begin" THEN 1200 +1220 LOCATE 11,10 +1230 PRINT "Header = ";A$ +1240 SP = ASC(" ") +1250 DIM BUF(100) +1260 RECNO# = 1 +1270 REM Main loop +1280 LINE INPUT #1, A$ +1290 P = 0 +1300 COUNT = ASC(LEFT$(A$,1)) - SP +1310 IF COUNT = 64 THEN COUNT = 0 +1320 IF COUNT = 0 THEN 1560 +1330 ADJ = COUNT MOD 4 +1340 FOR I = 2 TO LEN(A$) STEP 4 +1350 X1 = ASC(MID$(A$,I,I)) - SP +1360 IF X1 = 64 THEN X1 = 0 +1370 X2 = ASC(MID$(A$,I+1,I+1)) - SP +1380 IF X2 = 64 THEN X2 = 0 +1390 X3 = ASC(MID$(A$,I+2,I+2)) - SP +1400 IF X3 = 64 THEN X3 = 0 +1410 X4 = ASC(MID$(A$,I+3,I+3)) - SP +1420 IF X4 = 64 THEN X4 = 0 +1430 P = P + 1 +1440 BUF(P) = (X2\16) + (X1*4) +1450 P = P + 1 +1460 BUF(P) = (X3\4) + ((X2 MOD 16) * 16) +1470 P = P + 1 +1480 BUF(P) = X4 + ((X3 MOD 4) * 64) +1490 NEXT I +1500 FOR I = 1 TO P +1510 LSET N$ = CHR$(BUF(I)) +1520 PUT #2, RECNO# +1530 RECNO# = RECNO# + 1 +1540 NEXT I +1550 GOTO 1280 +1560 END +1570 REM +1580 REM Error trapping routines +1590 REM +1600 LOCATE 22,20 +1610 PRINT "Can't open input file" +1620 GOSUB 1740 +1630 RESUME 1020 +1640 LOCATE 22,20 +1650 PRINT "Can't open output file" +1660 GOSUB 1740 +1670 RESUME 1090 +1680 LOCATE 22,20 +1690 PRINT "Header line not found" +1700 GOSUB 1740 +1710 LOCATE 24,1 +1720 END +1740 FOR I = 1 TO 5000: NEXT I +1750 LOCATE 22,20 +1760 PRINT STRING$(30," ") +1770 RETURN diff --git a/src/apps/bin/sharutils-4.2.1/contrib/uudecode.pas b/src/apps/bin/sharutils-4.2.1/contrib/uudecode.pas new file mode 100644 index 0000000000..2c80fef6f5 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/uudecode.pas @@ -0,0 +1,224 @@ +program uudecode; + + CONST defaultSuffix = '.uue'; + offset = 32; + + TYPE string80 = string[80]; + + VAR infile: text; + fi : file of byte; + outfile: file of byte; + lineNum: integer; + line: string80; + size,remaining :real; + + procedure Abort(message: string80); + + begin {abort} + writeln; + if lineNum > 0 then write('Line ', lineNum, ': '); + writeln(message); + halt + end; {Abort} + + procedure NextLine(var s: string80); + + begin {NextLine} + LineNum := succ(LineNum); + {write('.');} + readln(infile, s); + remaining:=remaining-length(s)-2; {-2 is for CR/LF} + write('bytes remaining: ',remaining:7:0,' (', + remaining/size*100.0:3:0,'%)',chr(13)); + end; {NextLine} + + procedure Init; + + procedure GetInFile; + + VAR infilename: string80; + + begin {GetInFile} + if ParamCount = 0 then abort ('Usage: uudecode '); + infilename := ParamStr(1); + if pos('.', infilename) = 0 + then infilename := concat(infilename, defaultSuffix); + assign(infile, infilename); + {$i-} + reset(infile); + {$i+} + if IOresult > 0 then abort (concat('Can''t open ', infilename)); + writeln ('Decoding ', infilename); + assign(fi,infilename); reset(fi); + size:=FileSize(fi); close(fi); + if size < 0 then size:=size+65536.0; + remaining:=size; + end; {GetInFile} + + procedure GetOutFile; + + var header, mode, outfilename: string80; + ch: char; + + procedure ParseHeader; + + VAR index: integer; + + Procedure NextWord(var word:string80; var index: integer); + + begin {nextword} + word := ''; + while header[index] = ' ' do + begin + index := succ(index); + if index > length(header) then abort ('Incomplete header') + end; + while header[index] <> ' ' do + begin + word := concat(word, header[index]); + index := succ(index) + end + end; {NextWord} + + begin {ParseHeader} + header := concat(header, ' '); + index := 7; + NextWord(mode, index); + NextWord(outfilename, index) + end; {ParseHeader} + + begin {GetOutFile} + if eof(infile) then abort('Nothing to decode.'); + NextLine (header); + while not ((copy(header, 1, 6) = 'begin ') or eof(infile)) do + NextLine(header); + writeln; + if eof(infile) then abort('Nothing to decode.'); + ParseHeader; + assign(outfile, outfilename); + writeln ('Destination is ', outfilename); + {$i-} + reset(outfile); + {$i+} + if IOresult = 0 then + begin + write ('Overwrite current ', outfilename, '? [Y/N] '); + repeat + read (kbd, ch); + ch := UpCase(ch) + until ch in ['Y', 'N']; + writeln(ch); + if ch = 'N' then abort ('Overwrite cancelled.') + end; + rewrite (outfile); + end; {GetOutFile} + + begin {init} + lineNum := 0; + GetInFile; + GetOutFile; + end; { init} + + Function CheckLine: boolean; + + begin {CheckLine} + if line = '' then abort ('Blank line in file'); + CheckLine := not (line[1] in [' ', '`']) + end; {CheckLine} + + + procedure DecodeLine; + + VAR lineIndex, byteNum, count, i: integer; + chars: array [0..3] of byte; + hunk: array [0..2] of byte; + +{ procedure debug; + + var i: integer; + + procedure writebin(x: byte); + + var i: integer; + + begin + for i := 1 to 8 do + begin + write ((x and $80) shr 7); + x := x shl 1 + end; + write (' ') + end; + + begin + writeln; + for i := 0 to 3 do writebin(chars[i]); + writeln; + for i := 0 to 2 do writebin(hunk[i]); + writeln + end; } + + function nextch: char; + + begin {nextch} + lineIndex := succ(lineIndex); + if lineIndex > length(line) then abort('Line too short.'); + if not (line[lineindex] in [' '..'`']) + then abort('Illegal character in line.'); +{ write(line[lineindex]:2);} + if line[lineindex] = '`' then nextch := ' ' + else nextch := line[lineIndex] + end; {nextch} + + procedure DecodeByte; + + procedure GetNextHunk; + + VAR i: integer; + + begin {GetNextHunk} + for i := 0 to 3 do chars[i] := ord(nextch) - offset; + hunk[0] := (chars[0] shl 2) + (chars[1] shr 4); + hunk[1] := (chars[1] shl 4) + (chars[2] shr 2); + hunk[2] := (chars[2] shl 6) + chars[3]; + byteNum := 0 {; + debug } + end; {GetNextHunk} + + begin {DecodeByte} + if byteNum = 3 then GetNextHunk; + write (outfile, hunk[byteNum]); + {writeln(bytenum, ' ', hunk[byteNum]);} + byteNum := succ(byteNum) + end; {DecodeByte} + + begin {DecodeLine} + lineIndex := 0; + byteNum := 3; + count := (ord(nextch) - offset); + for i := 1 to count do DecodeByte + end; {DecodeLine} + + procedure terminate; + + var trailer: string80; + + begin {terminate} + if eof(infile) then abort ('Abnormal end.'); + NextLine (trailer); + if length (trailer) < 3 then abort ('Abnormal end.'); + if copy (trailer, 1, 3) <> 'end' then abort ('Abnormal end.'); + close (infile); + close (outfile) + end; + + begin {uudecode} + init; + NextLine(line); + while CheckLine do + begin + DecodeLine; + NextLine(line) + end; + terminate + end. diff --git a/src/apps/bin/sharutils-4.2.1/contrib/uudecode.pl b/src/apps/bin/sharutils-4.2.1/contrib/uudecode.pl new file mode 100644 index 0000000000..42f090fcd0 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/uudecode.pl @@ -0,0 +1,24 @@ +# uuencode in Perl. +# Copyright (C) 1995 Free Software Foundation, Inc. +# François Pinard , 1995. + +# `perl uudecode.pl FILES' will decode all uuencoded files found in +# all input FILES, stripping headers and other non uuencoded data. + +while (<>) +{ + if (/^begin [0-7][0-7][0-7] ([^\n ]+)$/) + { + open (OUTPUT, ">$1") || die "Cannot create $1\n"; + binmode OUTPUT; + while (<>) + { + last if /^end$/; + $block = unpack ("u", $_); + print OUTPUT $block; + } + close OUTPUT; + } +} + +exit 0; diff --git a/src/apps/bin/sharutils-4.2.1/contrib/uuencode.pas b/src/apps/bin/sharutils-4.2.1/contrib/uuencode.pas new file mode 100644 index 0000000000..c30a289d67 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/uuencode.pas @@ -0,0 +1,202 @@ +Program uuencode; + + CONST header = 'begin'; + trailer = 'end'; + defaultMode = '644'; + defaultExtension = '.uue'; + offset = 32; + charsPerLine = 60; + bytesPerHunk = 3; + sixBitMask = $3F; + + TYPE string80 = string[80]; + + VAR infile: file of byte; + outfile: text; + infilename, outfilename, mode: string80; + lineLength, numbytes, bytesInLine: integer; + line: array [0..59] of char; + hunk: array [0..2] of byte; + chars: array [0..3] of byte; + size,remaining :real; + +{ procedure debug; + + var i: integer; + + procedure writebin(x: byte); + + var i: integer; + + begin + for i := 1 to 8 do + begin + write ((x and $80) shr 7); + x := x shl 1 + end; + write (' ') + end; + + begin + for i := 0 to 2 do writebin(hunk[i]); + writeln; + for i := 0 to 3 do writebin(chars[i]); + writeln; + for i := 0 to 3 do writebin(chars[i] and sixBitMask); + writeln + end; } + + procedure Abort (message: string80); + + begin {abort} + writeln(message); + close(infile); + close(outfile); + halt + end; {abort} + + procedure Init; + + procedure GetFiles; + + VAR i: integer; + temp: string80; + ch: char; + + begin {GetFiles} + if ParamCount < 1 then abort ('No input file specified.'); + infilename := ParamStr(1); + {$I-} + assign (infile, infilename); + reset (infile); + {$i+} + if IOResult > 0 then abort (concat ('Can''t open file ', infilename)); + size:=FileSize(infile); + if size < 0 then size:=size+65536.0; + remaining:=size; + write('Uuencoding file ', infilename); + + i := pos('.', infilename); + if i = 0 + then outfilename := infilename + else outfilename := copy (infilename, 1, pred(i)); + mode := defaultMode; + if ParamCount > 1 then + for i := 2 to ParamCount do + begin + temp := Paramstr(i); + if temp[1] in ['0'..'9'] + then mode := temp + else outfilename := temp + end; + if pos ('.', outfilename) = 0 + then outfilename := concat(outfilename, defaultExtension); + assign (outfile, outfilename); + writeln (' to file ', outfilename, '.'); + + {$i-} + reset(outfile); + {$i+} + if IOresult = 0 then + begin + Write ('Overwrite current ', outfilename, '? [Y/N] '); + repeat + read (kbd, ch); + ch := Upcase(ch) + until ch in ['Y', 'N']; + writeln (ch); + if ch = 'N' then abort(concat (outfilename, ' not overwritten.')) + end; + close(outfile); + + {$i-} + rewrite(outfile); + {$i+} + if ioresult > 0 then abort(concat('Can''t open ', outfilename)); + end; {getfiles} + + begin {Init} + GetFiles; + bytesInLine := 0; + lineLength := 0; + numbytes := 0; + writeln (outfile, header, ' ', mode, ' ', infilename); + end; {init} + + procedure FlushLine; + + VAR i: integer; + + procedure writeout(ch: char); + + begin {writeout} + if ch = ' ' then write(outfile, '`') + else write(outfile, ch) + end; {writeout} + + begin {FlushLine} + {write ('.');} + write('bytes remaining: ',remaining:7:0,' (', + remaining/size*100.0:3:0,'%)',chr(13)); + writeout(chr(bytesInLine + offset)); + for i := 0 to pred(lineLength) do + writeout(line[i]); + writeln (outfile); + lineLength := 0; + bytesInLine := 0 + end; {FlushLine} + + procedure FlushHunk; + + VAR i: integer; + + begin {FlushHunk} + if lineLength = charsPerLine then FlushLine; + chars[0] := hunk[0] shr 2; + chars[1] := (hunk[0] shl 4) + (hunk[1] shr 4); + chars[2] := (hunk[1] shl 2) + (hunk[2] shr 6); + chars[3] := hunk[2] and sixBitMask; + {debug;} + for i := 0 to 3 do + begin + line[lineLength] := chr((chars[i] and sixBitMask) + offset); + {write(line[linelength]:2);} + lineLength := succ(lineLength) + end; + {writeln;} + bytesInLine := bytesInLine + numbytes; + numbytes := 0 + end; {FlushHunk} + + procedure encode1; + + begin {encode1}; + if numbytes = bytesperhunk then flushhunk; + read (infile, hunk[numbytes]); + remaining:=remaining-1; + numbytes := succ(numbytes) + end; {encode1} + + procedure terminate; + + begin {terminate} + if numbytes > 0 then flushhunk; + if lineLength > 0 + then + begin + flushLine; + flushLine; + end + else flushline; + writeln (outfile, trailer); + close (outfile); + close (infile); + end; {terminate} + + + begin {uuencode} + init; + while not eof (infile) do encode1; + terminate; + writeln; + end. {uuencode} diff --git a/src/apps/bin/sharutils-4.2.1/contrib/uuencode.pl b/src/apps/bin/sharutils-4.2.1/contrib/uuencode.pl new file mode 100644 index 0000000000..e15f71dd72 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/contrib/uuencode.pl @@ -0,0 +1,10 @@ +# uuencode in Perl - non tested. +# Copyright (C) 1995 Free Software Foundation, Inc. +# François Pinard , 1995. + +print "begin 644 $ARGV[0]\n"; +print pack ("u", $bloc) while read (STDIN, $bloc, 45); +print "`\n"; +print "end\n"; + +exit 0; diff --git a/src/apps/bin/sharutils-4.2.1/doc/ChangeLog b/src/apps/bin/sharutils-4.2.1/doc/ChangeLog new file mode 100644 index 0000000000..e08c7dfcaf --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/ChangeLog @@ -0,0 +1,65 @@ +Mon Dec 4 16:51:38 1995 Ulrich Drepper + + * unshar.1, shar.1: Update for 4.2 by Jan Djarv. + +Thu Nov 30 23:16:17 1995 Ulrich Drepper + + * remsync.texi: According to D.E.Knuth and Karl Berry `nonzero' is + preferable to `non-zero'. + +Sat Nov 25 02:45:11 1995 Ulrich Drepper + + * Makefile.in (version.texi): Also depend on ../configure.in. + + * unshar.1, sharutils.texi: + Correct double `in`. Reported by Nelson Beebe. + + * remsync.texi: Correct double `the`. Reported by Nelson Beebe. + +Sun Nov 5 13:33:39 1995 Ulrich Drepper + + * Makefile.in (dist): Suppress error message when ln failed. + +Sat Oct 28 01:50:37 1995 Ulrich Drepper + + * sharutils.texi: Document -f option of unshar. + +Tue Sep 26 14:25:20 1995 Ulrich Drepper + + * uuencode.1: Typo. + + * uuencode.1: Document P1003.2b/D11 changes. + +Sun Sep 24 16:28:34 1995 Ulrich Drepper + + * sharutils.texi: Add some comments about transmission checks. + +Wed Sep 20 23:51:03 1995 Ulrich Drepper + + * Makefile.in (transform): + New variable. Gets its value from configure. + (man1dir, man1ext, man5dir, man5ext): New variables for man page + installation. + (install-man): Correct some bugs. + + * Makefile.in (MAN1PAGES, MAN5PAGES): Let configure set the values. + (install-man, uninstall-man): The for $(MAN5PAGES) to be empty; some + shells don't like empty for argument lists. + + * unshar.1, shar.1: Changes for 4.1.6 by Jan Djarv. + +Tue Aug 15 16:58:58 1995 Ulrich Drepper + + * Makefile.in (dist): Remove `copying instead' message. + +Thu Aug 10 22:34:12 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): + Was two times sharutils.info and remsync.info. Change one of + them to sharutils.texi and remsync.texi. + Reported by Franc,ois Pinard. + +Thu Aug 3 00:27:20 1995 Ulrich Drepper + + * Makefile.in: Initial revision. + diff --git a/src/apps/bin/sharutils-4.2.1/doc/Makefile b/src/apps/bin/sharutils-4.2.1/doc/Makefile new file mode 100644 index 0000000000..f7b95a2604 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/Makefile @@ -0,0 +1,156 @@ +# Generated automatically from Makefile.in by configure. +# Makefile for GNU Shar utility package documentation. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = sharutils +VERSION = 4.2.1 + +SHELL = /bin/sh +srcdir = . +top_srcdir = .. + +transform = s,x,x, +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +MAKEINFO = makeinfo +TEXI2DVI = texi2dvi +TOUCH = echo timestamp > + +DISTFILES = ChangeLog Makefile.in mdate-sh sharutils.texi remsync.texi \ +shar.1 unshar.1 uuencode.1 uuencode.5 \ +texinfo.tex version.texi sharutils.info remsync.info stamp-vti +MAN1PAGES = shar unshar uuencode uudecode +MAN5PAGES = uuencode + +prefix = /usr/local +infodir = $(prefix)/info +mandir = $(prefix)/man +man1dir = $(mandir)/man1 +man1ext = .1 +man5dir = $(mandir)/man5 +man5ext = .5 +subdir = doc + +.SUFFIXES: + +default: all + +all info check: sharutils.info remsync.info + +sharutils.info: sharutils.texi version.texi + cd $(srcdir) && $(MAKEINFO) sharutils.texi + +remsync.info: remsync.texi version.texi + cd $(srcdir) && $(MAKEINFO) remsync.texi + +dvi: sharutils.dvi remsync.dvi + +sharutils.dvi: sharutils.texi texinfo.tex version.texi + $(TEXI2DVI) $(srcdir)/sharutils.texi + +remsync.dvi: remsync.texi texinfo.tex + $(TEXI2DVI) $(srcdir)/remsync.texi + +version.texi: stamp-vti +stamp-vti: sharutils.texi $(top_srcdir)/configure.in + echo "@set EDITION $(VERSION)" > version.tmp + echo "@set UPDATED `cd $(srcdir) \ + && $(SHELL) mdate-sh sharutils.texi`" >> version.tmp + echo "@set VERSION $(VERSION)" >> version.tmp + if cmp -s version.tmp version.texi; then \ + rm -f version.tmp; \ + else \ + mv -f version.tmp version.texi; \ + fi + $(TOUCH) $(srcdir)/stamp-vti + +install install-exec install-data: all +install: install-exec install-data +install-exec: +install-data: + $(top_srcdir)/mkinstalldirs $(infodir) + cd $(srcdir) && \ + for file in sharutils.info* remsync.info*; do \ + $(INSTALL_DATA) $$file $(infodir)/$$file; \ + done + +uninstall: + rm -f $(infodir)/sharutils.info* $(infodir)/remsync.info* + + +# man page installation is kept separate from install. Better think +# GNU and switch to Info. The following is for irreductible fellows. + +install-man: + $(top_srcdir)/mkinstalldirs $(man1dir) + test -z "$(MAN5PAGES)" || $(top_srcdir)/mkinstalldirs $(man5dir) + for name in $(MAN1PAGES); do \ + if test $$name = uudecode; then \ + rm -f $(man1dir)/`echo uudecode | sed '$(transform)'`$(man1ext); \ + man1base=`echo $(man1dir) | sed 's@.*/\(.*\)@&1@'`; \ + echo ".so $$man1base/uuencode$(man1ext)" \ + > $(man1dir)/`echo uudecode | sed '$(transform)'`$(man1ext); \ + else \ + $(INSTALL_DATA) $(srcdir)/$$name.1 \ + $(man1dir)/`echo $$name | sed '$(transform)'`$(man1ext); \ + fi; \ + done + test -z "$(MAN5PAGES)" || \ + for name in $(MAN5PAGES); do \ + $(INSTALL_DATA) $(srcdir)/$$name.5 \ + $(man5dir)/`echo $$name | sed '$(transform)'`$(man5ext); \ + done + +uninstall-man: + for name in $(MAN1PAGES); do \ + rm -f $(man1dir)/`echo $$name | sed '$(transform)'`$(man1ext); \ + done + test -z "$(MAN5PAGES)" || \ + for name in $(MAN5PAGES); do \ + rm -f $(man5dir)/`echo $$name | sed '$(transform)'`$(man5ext); \ + done + + +TAGS ID: + +mostlyclean: + rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.log *.pg *.toc *.tp *.vr + rm -f *.tmp + +clean: mostlyclean + +distclean: clean + rm -f Makefile + +maintainer-clean: distclean + @echo "This command is intended only for maintainers to use;" + @echo "rebuilding the deleted files may require special tools." + rm -f stamp-vti version.texi sharutils.info* remsync.info* + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/doc/Makefile.in b/src/apps/bin/sharutils-4.2.1/doc/Makefile.in new file mode 100644 index 0000000000..1de7cdd983 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/Makefile.in @@ -0,0 +1,156 @@ +# Makefile for GNU Shar utility package documentation. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +transform = @program_transform_name@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MAKEINFO = makeinfo +TEXI2DVI = texi2dvi +TOUCH = echo timestamp > + +DISTFILES = ChangeLog Makefile.in mdate-sh sharutils.texi remsync.texi \ +shar.1 unshar.1 uuencode.1 uuencode.5 \ +texinfo.tex version.texi sharutils.info remsync.info stamp-vti +MAN1PAGES = @MAN1PAGES@ +MAN5PAGES = @MAN5PAGES@ + +prefix = @prefix@ +infodir = $(prefix)/info +mandir = $(prefix)/man +man1dir = $(mandir)/man1 +man1ext = .1 +man5dir = $(mandir)/man5 +man5ext = .5 +subdir = doc + +.SUFFIXES: + +default: all + +all info check: sharutils.info remsync.info + +sharutils.info: sharutils.texi version.texi + cd $(srcdir) && $(MAKEINFO) sharutils.texi + +remsync.info: remsync.texi version.texi + cd $(srcdir) && $(MAKEINFO) remsync.texi + +dvi: sharutils.dvi remsync.dvi + +sharutils.dvi: sharutils.texi texinfo.tex version.texi + $(TEXI2DVI) $(srcdir)/sharutils.texi + +remsync.dvi: remsync.texi texinfo.tex + $(TEXI2DVI) $(srcdir)/remsync.texi + +version.texi: stamp-vti +stamp-vti: sharutils.texi $(top_srcdir)/configure.in + echo "@set EDITION $(VERSION)" > version.tmp + echo "@set UPDATED `cd $(srcdir) \ + && $(SHELL) mdate-sh sharutils.texi`" >> version.tmp + echo "@set VERSION $(VERSION)" >> version.tmp + if cmp -s version.tmp version.texi; then \ + rm -f version.tmp; \ + else \ + mv -f version.tmp version.texi; \ + fi + $(TOUCH) $(srcdir)/stamp-vti + +install install-exec install-data: all +install: install-exec install-data +install-exec: +install-data: + $(top_srcdir)/mkinstalldirs $(infodir) + cd $(srcdir) && \ + for file in sharutils.info* remsync.info*; do \ + $(INSTALL_DATA) $$file $(infodir)/$$file; \ + done + +uninstall: + rm -f $(infodir)/sharutils.info* $(infodir)/remsync.info* + + +# man page installation is kept separate from install. Better think +# GNU and switch to Info. The following is for irreductible fellows. + +install-man: + $(top_srcdir)/mkinstalldirs $(man1dir) + test -z "$(MAN5PAGES)" || $(top_srcdir)/mkinstalldirs $(man5dir) + for name in $(MAN1PAGES); do \ + if test $$name = uudecode; then \ + rm -f $(man1dir)/`echo uudecode | sed '$(transform)'`$(man1ext); \ + man1base=`echo $(man1dir) | sed 's@.*/\(.*\)@&1@'`; \ + echo ".so $$man1base/uuencode$(man1ext)" \ + > $(man1dir)/`echo uudecode | sed '$(transform)'`$(man1ext); \ + else \ + $(INSTALL_DATA) $(srcdir)/$$name.1 \ + $(man1dir)/`echo $$name | sed '$(transform)'`$(man1ext); \ + fi; \ + done + test -z "$(MAN5PAGES)" || \ + for name in $(MAN5PAGES); do \ + $(INSTALL_DATA) $(srcdir)/$$name.5 \ + $(man5dir)/`echo $$name | sed '$(transform)'`$(man5ext); \ + done + +uninstall-man: + for name in $(MAN1PAGES); do \ + rm -f $(man1dir)/`echo $$name | sed '$(transform)'`$(man1ext); \ + done + test -z "$(MAN5PAGES)" || \ + for name in $(MAN5PAGES); do \ + rm -f $(man5dir)/`echo $$name | sed '$(transform)'`$(man5ext); \ + done + + +TAGS ID: + +mostlyclean: + rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.log *.pg *.toc *.tp *.vr + rm -f *.tmp + +clean: mostlyclean + +distclean: clean + rm -f Makefile + +maintainer-clean: distclean + @echo "This command is intended only for maintainers to use;" + @echo "rebuilding the deleted files may require special tools." + rm -f stamp-vti version.texi sharutils.info* remsync.info* + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/doc/mdate-sh b/src/apps/bin/sharutils-4.2.1/doc/mdate-sh new file mode 100755 index 0000000000..29e5fbb7b8 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/mdate-sh @@ -0,0 +1,92 @@ +#!/bin/sh +# mdate-sh - get modification time of a file and pretty-print it +# Copyright (C) 1995 Software Foundation, Inc. +# Written by Ulrich Drepper , June 1995 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +# Get the extended ls output of the file. +if ls -L /dev/null 1>/dev/null 2>&1; then + set - `ls -L -l $1` +else + set - `ls -l $1` +fi +# The month is at least the fourth argument. +# (3 shifts here, the next inside the loop) +shift +shift +shift + +# Find the month. Next argument is day, followed by the year or time. +month= +until test $month +do + shift + case $1 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; + esac +done + +day=$2 + +# Here we have to deal with the problem that the ls output gives either +# the time of day or the year. +case $3 in + *:*) set `date`; year=$7 + case $2 in + Jan) nummonthtod=1;; + Feb) nummonthtod=2;; + Mar) nummonthtod=3;; + Apr) nummonthtod=4;; + May) nummonthtod=5;; + Jun) nummonthtod=6;; + Jul) nummonthtod=7;; + Aug) nummonthtod=8;; + Sep) nummonthtod=9;; + Oct) nummonthtod=10;; + Nov) nummonthtod=11;; + Dec) nummonthtod=12;; + esac + # For the first six month of the year the time notation can also + # be used for file modified in the last year. + if (expr $nummonth \> $nummonthtod) > /dev/null; + then + year=`expr year - 1` + fi + ;; + *) year=$3;; +esac + +# The result. +echo $day $month $year diff --git a/src/apps/bin/sharutils-4.2.1/doc/remsync.info b/src/apps/bin/sharutils-4.2.1/doc/remsync.info new file mode 100644 index 0000000000..fea209832c --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/remsync.info @@ -0,0 +1,709 @@ +This is Info file remsync.info, produced by Makeinfo-1.63 from the +input file remsync.texi. + + This file documents the `remsync' command and friends, which have +the purpose of synchronizing remote directory trees using email. + + Copyright (C) 1994 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: remsync.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) + +`remsync' +********* + + `remsync' allows for remote synchronization of directory trees, +using electronic mail. + + The current `remsync' release is 1.3. This is an alpha state +product, and this documentation is still sketchy. + +* Menu: + +* Overview:: Overview of `remsync' and friends +* Remsync:: Specifications of program `remsync' +* Services:: Specifications of other service programs +* Formats:: Related file formats +* Miscellaneous:: + + -- The Detailed Node Listing -- + +Overview of `remsync' and friends + +* Internals:: How `remsync' works +* Quick start:: Quick start at using `remsync' + +Quick start at using `remsync' + +* Invoking remsync:: The `remsync' command and arguments + +Specifications of program `remsync' + +* Invoking remsync:: The `remsync' command and arguments +* Conveniences:: Automatic mechanisms in the `remsync' program +* Commands:: Commands for `remsync' + +The `remsync' command and arguments + +* Conveniences:: Automatic mechanisms in the `remsync' program +* Commands:: Commands for `remsync' + +Specifications of other service programs + +* Invoking mailshar:: The `mailshar' command and arguments +* Invoking mail-files:: The `mail-files' command and arguments +* Invoking find-mailer:: The `find-mailer' command and arguments + +Related file formats + +* Xremsync:: Format of the `.remsync' file +* Package:: Format of transiting packages + +Various considerations + +* News:: Using News distribution instead? +* Previous:: Documentation for obsolete scripts + +Documentation for obsolete scripts + +* mailsync:: mailsync +* resync:: resync + + +File: remsync.info, Node: Overview, Next: Remsync, Prev: Top, Up: Top + +Overview of `remsync' and friends +********************************* + + The `remsync' program allows for transmitting, over email, selected +parts of directories for trying to maintain up-to-date files over many +sites. It sends out and processes incoming specially packaged files +using `shar', `tar', `gzip' and electronic mail programs. + + There is no *master* site, each site has an equal opportunity to +modify files, and modified files are propagated. Among many other +commands, the `broadcast' command sends an update package from the +current site to all others, the `process' command is used to apply +update packages locally after reception from remote sites. + + The unit of transmission is whole files. For now, whenever a module +is modified, it is silently synchronized only if it has been modified at +only one place. The merging has to be done at the site where the +discrepancy is observed, from where it is propagated again. + +* Menu: + +* Internals:: How `remsync' works +* Quick start:: Quick start at using `remsync' + + +File: remsync.info, Node: Internals, Next: Quick start, Prev: Overview, Up: Overview + +How `remsync' works +=================== + + How does `remsync' keep track of what is in sync, and what isn't? +*Note Xremsync::, for a the documentation on the `.remsync' file +format. I understand that a mere description of the format does not +replace an explanation, but in the meantime, you might guess from the +format how the program works. + + All files are summarized by a checksum, computed by the `sum' +program. There are a few variants of `sum' computing checksums in +incompatible ways, under the control of options. `remsync' attempts to +retrieve on each site a compatible way to do it, and complains if it +cannot. + + `remsync' does not compare dates or sizes. Experience shown that the +best version of a file is not necessarily the one with the latest +timestamp. The best version for a site is the current version on this +site, as decided by its maintainer there, and this is this version that +will be propagated. + + Each site has an idea of the checksum of a file for all other sites. +These checksums are not necessarily identical, for sites do not +necessarily propagate to all others, and the propagation network maybe +incomplete or asymmetrical in various ways. + + Propagation is never done unattended. The user on a site has to call +`remsync broadcast' to issue synchronization packages for other sites. +If this is never done, the local modifications will never leave the +site. The user also has to call `remsync process' to apply received +synchronization packages. Applying a package does not automatically +broadcast it further (maybe this could change?). + + If a site A propagates some files to sites B and D, but not C, site +B is informed that site D also received these files, and site D is +informed that site B also received these files, so they will not +propagate again the same files to one another. However, both site B +and D are susceptible to propagate further the same files to site C. + + It may happen that a site refuses to update a file, or modifies a +file after having been received, or merges versions, or whatever. So, +sites may have a wrong opinion of the file contents on other sites. +These differences level down after a few exchanges, and it is very +unlikely that a file would not be propagated when it should have. + + This scheme works only when the various people handling the various +files have confidence in one each other. If site B modifies a file +after having received it from site A, the file will eventually be +propagated back to site A. If the original file stayed undisturbed on +site A, that is, if `remsync' proves that site B correctly knew the +checksum of the original file, then the file will be replaced on site A +without any user confirmation. So, the user on site A has to trust the +changes made by the user on site B. + + If the original file on site A had been modified after having been +sent in a synchronization package, than it is the responsibility of the +user on site A to correctly merge the local modifications with the +modifications observed in the file as received from site B. This +responsibility is real, since the merged file will later be propagated +to the other sites in an authoritative way. + + +File: remsync.info, Node: Quick start, Prev: Internals, Up: Overview + +Quick start at using `remsync' +============================== + + +File: remsync.info, Node: Remsync, Next: Services, Prev: Overview, Up: Top + +Specifications of program `remsync' +*********************************** + +* Menu: + +* Invoking remsync:: The `remsync' command and arguments +* Conveniences:: Automatic mechanisms in the `remsync' program +* Commands:: Commands for `remsync' + + +File: remsync.info, Node: Invoking remsync, Next: Conveniences, Prev: Remsync, Up: Remsync + +The `remsync' command and arguments +=================================== + + At the shell prompt, calling the command `remsync' without any +parameters initiates an interactive dialog, in which the user types +commands and receives feedback from the program. + + The command `remsync', given at the shell prompt, may have +arguments, in which case these arguments taken together form one +`remsync' interactive command. However, `--help' and `--version' +options are interpreted especially, with their usual effect in GNU. +Once this command has been executed, no more commands are taken from +the user and `remsync' terminates execution. This allows for using +`remsync' in some kind of batch mode. It is unwise to redirect +`remsync' standard input, because user interactions might often be +needed in ways difficult to predict in advance. + + The two most common usages of `remsync' are the commands: + + remsync b + remsync p + + The first example executes the `broadcast' command, which sends +synchronization packages to all connected remote sites for the current +local directory tree. + + The second example executes the `process' command, which studies and +complies with a synchronisation package saved in the current directory +(not necessarily into the synchronized directory tree), under the usual +file name `remsync.tar.gz'. + +* Menu: + +* Conveniences:: Automatic mechanisms in the `remsync' program +* Commands:: Commands for `remsync' + + +File: remsync.info, Node: Conveniences, Next: Commands, Prev: Invoking remsync, Up: Remsync + +Automatic mechanisms in the `remsync' program +============================================= + + The following points apply to many of the `remsync' commands. We +describe them here once and for all. + + * The file `.remsync' describes the various properties for the + current synchronization. It is kept right in the top directory of + a synchronized directory tree. Some commands may be executed + without any need for this file. The program waits as far as + possible before reading it. + + * If the `.remsync' file is not found when required, and only then, + the user is interactively asked to fill a questionnaire about it. + + * If the `.remsync' file has been logically modified after having + been read, or if it just has been created, the program will save + it back on disk. But it will do so only before reading another + `.remsync' file, or just before exit. A preexisting `.remsync' + will be renamed to `.remsync.bak' before it is rewritten, when + this is done, any previous `.remsync.bak' file is discarded. + + * Many commands refer to previously entered information by repeating + this information. For example, one can refer to a particular + `scan' statement by entering the wildcard to be scanned by this + statement. An alternative method of specifying a statement + consists in using the decimal number which appears between square + brackets in the result of a `list' command. + + * Whenever a site list must be given, it is a space separated list of + remote sites. If the list is preceeded by a bang (!), the list is + complemented, that is, the sites that will be operated upon are all + those *not* appearing in the list. As a special case, if the site + list is completely empty, then all sites are selected. + + +File: remsync.info, Node: Commands, Prev: Conveniences, Up: Remsync + +Commands for `remsync' +====================== + + Program commands to `remsync' may be given interactively by the user +sitten at a terminal. They can come from the arguments of the +`remsync' call at the shell level. Internally, the `process' command +might obey many sub-commands found in a received synchronization +package. + + Program commands are given one per line. Lines beginning with a +sharp (#) and white lines are ignored, they are meant to increase +clarity or to introduce user comments. With only a few exceptions, +commands are introduced by a keyword and often contains other keywords. +In all cases, the keywords specific to `remsync' may be abbreviated to +their first letter. When there are many keywords in succession, the +space separating them may be omitted. So the following commands are +all equivalent: + + list remote + l remote + list r + l r + listremote + lr + +while the following are not legal: + + l rem + lisremote + + Below, for clarity, keywords are written in full and separated by +spaces. Commands often accept parameters, which are then separated by +spaces. All available commands are given in the table. The first few +commands do not pre-require the file `.remsync'. The last three +commands are almost never used interactively, but rather automatically +triggered while `process''ing received synchronization packages. + +`?' + Display a quick help summary of available commands. + +`!' [ SHELL-COMMAND ] + If SHELL-COMMAND has been given, execute it right now as a shell + command. When not given, rather start an interactive shell. + Exiting from the shell will return to this program. The started + shell is taken from the `SHELL' environment variable if set, else + `sh' is used. + +`quit' + Leave the program normally and return to the shell. + +`abort' + Leave the program with a nonzero exit status and return to the + shell. No attempt is made to save a logically modified `.remsync' + file. + +`visit' DIRECTORY + Select another synchronized directory tree for any subsequent + operation. DIRECTORY is the top directory of the synchronized + directory tree. + +`process' [ FILE ] +`list' [ TYPE ] + List all known statements about some information TYPE. Allowable + keywords for TYPE are `local', `remote', `scan', `ignore' and + `files'. The keyword `files' asks for all empty statements (see + later). If TYPE is omitted, then list all known statements for + all types, except those given by `files'. + +[ `create' ] TYPE VALUE + Create a new statement introducing a VALUE for a given TYPE. + Allowable keywords for TYPE are `remote', `scan' and `ignore'. + The `create' keyword may be omitted. + + For `create' `ignore', when the pattern is preceeded by a bang + (!), the condition is reversed. That is, only those files which + do match the pattern will be kept for synchronization. + +`delete' TYPE VALUE + Delete an existing statement supporting some VALUE for a given + TYPE. Allowable keywords for TYPE are `remote', `scan' and + `ignore'. + +`email' REMOTE VALUE + Modify the electronic mail address associated with some REMOTE + site, giving it a new VALUE. The special `local' keyword for + REMOTE may be used to modify the local electronic mail address. + +`home' REMOTE VALUE + Modify the top directory of the synchronized directory tree + associated with some REMOTE site, giving it a new VALUE. The + special `local' keyword for REMOTE may be used to modify the local + top directory. + +`broadcast' SITE_LIST + Send by electronic mail an update package to all sites from + SITE_LIST, containing for each site all and only those files which + are known to be different between the remote site and here. + +`version' VERSION + This command is not meant for interactive use. It establishes the + `remsync' version needed to process the incoming commands. + +`from' SITE_LIST + This command is not really meant for interactive use. The first + site from the SITE_LIST is the remote site which originated the + synchronization package. All the others are all the sites, + including here, which were meant to be synchronized by the + `broadcast' command that was issued at the originating remote site. + +`sum' FILE CHECKSUM + This command is not really meant for interactive use. It declares + the CHECKSUM value of a particular FILE at the originating remote + site. Also, if at least one `sum' command is received, then it is + guaranteed that the originating remote site sent one `sum' command + for each and every file to be synchronized, so any found local + file which was not subject of any `sum' command does not exist + remotely. + +`if' FILE CHECKSUM PACKAGED + This command is not really meant for interactive use. It directs + the `remsync' program to check if a local FILE has a given + CHECKSUM. If the checksum agrees, then the local file will be + replaced by the PACKAGED file, as found in the received + synchronization invoice. + + +File: remsync.info, Node: Services, Next: Formats, Prev: Remsync, Up: Top + +Specifications of other service programs +**************************************** + +* Menu: + +* Invoking mailshar:: The `mailshar' command and arguments +* Invoking mail-files:: The `mail-files' command and arguments +* Invoking find-mailer:: The `find-mailer' command and arguments + + +File: remsync.info, Node: Invoking mailshar, Next: Invoking mail-files, Prev: Services, Up: Services + +The `mailshar' command and arguments +==================================== + + +File: remsync.info, Node: Invoking mail-files, Next: Invoking find-mailer, Prev: Invoking mailshar, Up: Services + +The `mail-files' command and arguments +====================================== + + +File: remsync.info, Node: Invoking find-mailer, Prev: Invoking mail-files, Up: Services + +The `find-mailer' command and arguments +======================================= + + +File: remsync.info, Node: Formats, Next: Miscellaneous, Prev: Services, Up: Top + +Related file formats +******************** + +* Menu: + +* Xremsync:: Format of the `.remsync' file +* Package:: Format of transiting packages + + +File: remsync.info, Node: Xremsync, Next: Package, Prev: Formats, Up: Formats + +Format of the `.remsync' file +============================= + + The `.remsync' file saves all the information a site needs for +properly synchronizing a directory tree with remote sites. Even if it +is meant to be editable using any ASCII editor, it has a very precise +format and one should be very careful while modifying it. The +`.remsync' file is better handled through the `remsync' program and +commands. + + The `.remsync' file is made up of statements, one per line. Each +line begins with a statement keyword followed by a single TAB, then by +one or more parameters. The keyword may be omitted, in this case, the +keyword is said to be *empty*, and the line begins immediately with the +TAB. After the TAB, if there are two parameters or more, they should +all be separated with a single space. There should not be any space +between the last parameter and the end of line (unless there are +explicit empty parameters). + + The following table gives the possible keywords. Their order of +presentation in the table is also the order of appearance in the +`.remsync' file. + +`remsync' + This statement identifies the `.remsync' format. The only + parameter states the file format version. + +`local' + This statement should appear exactly once, and has exactly two + parameters. The first parameter gives the electronic mail address + the other sites should use for sending synchronization packages + here. The second parameter gives the name of the local directory + tree to synchronize, in absolute notation. + +`remote' + This statement may appear zero, one or more times. Each occurrence + connects the synchronized directory tree to another tree on a + remote site. The first parameter gives one electronic mail + address where to send remote synchronization packages. The second + parameter gives the name of the corresponding directory tree for + this remote electronic mail address, in absolute notation. + +`scan' + This statement may appear zero, one or more times. When it does + not appear at all, the whole local directory tree will always be + scanned, searching for files to synchronize. When the statement + appears at least once, the whole local directory tree will not be + scanned, but only those files or directories appearing in one of + these statements. Each `scan' statement has exactly one + parameter, giving one file or directory to be studied. These are + usually given relative to top directory of the local + synchronization directory tree. Shell wildcards are acceptable. + +`ignore' + This statement may appear zero, one or more times. Each + occurrence has one parameter giving a regular expression, + according to Perl syntax for regular expressions. These REGEXPs + are applied against each file resulting from the scan. If any of + the `ignore' expression matches one of resulting file, the file is + discarded and is not subject to remote synchronization. + + After all the statements beginning by the previous keywords, the +`.remsync' file usually contains many statements having the empty +keyword. The empty keyword statement may appear zero, one or more +times. Each occurrence list one file being remotely synchronized. The +first parameter gives an explicit file name, usually given relative to +the top directory of the local synchronized directory tree. Shell +wildcards are *not* acceptable. + + Besides the file name parameter, there are supplementary parameters +to each empty keyword statement, each corresponding to one remote +statement in the `.remsync' file. The second parameter corresponds to +the first remote, the third parameter corresponds to the second remote, +etc. If there are more remote statements than supplementary parameters, +missing parameters are considered to be empty. + + Each supplementary parameter usually gives the last known checksum +value for this particular file, as computed on its corresponding +*remote* site. The parameter contains a dash `-' while the remote +checksum is unknown. The checksum value for the *local* copy of the +file is never kept anywhere in the `.remsync' file. The special value +`666' indicates a checksum from hell, used when the remote file is +known to exist, but for which contradictory information has been +received from various sources. + + +File: remsync.info, Node: Package, Prev: Xremsync, Up: Formats + +Format of transiting packages +============================= + + +File: remsync.info, Node: Miscellaneous, Prev: Formats, Up: Top + +Various considerations +********************** + +* Menu: + +* News:: Using News distribution instead? +* Previous:: Documentation for obsolete scripts + + +File: remsync.info, Node: News, Next: Previous, Prev: Miscellaneous, Up: Miscellaneous + +Using News distribution instead? +================================ + + One correspondent thinks that perhaps the news distribution mechanism +could be pressed into service for this job. I could have started from +C-news, say, instead of from scratch, and have progressively bent +C-news to behave like I wanted. + + My feeling is that the route was shorter as I did it, from scratch, +that it would have been from C-news. Of course, I could have removed +the heavy administrative details of C-news: the history and `expire', +the daemons, the `cron' entries, etc., then added the interactive +features and specialized behaviors, but all this clean up would +certainly have took energies. Right now, non counting the subsidiary +scripts and shar/unshar sources, the heart of the result is a single +(1200 lines) script written in Perl, which I find fairly more smaller +and maintainable than a patched C-news distribution would have been. + + +File: remsync.info, Node: Previous, Prev: News, Up: Miscellaneous + +Documentation for obsolete scripts +================================== + + This is merely a place holder for previous documentation, waiting +that I clean it up. You have no interest in reading further down. + +* Menu: + +* mailsync:: mailsync +* resync:: resync + + +File: remsync.info, Node: mailsync, Next: resync, Prev: Previous, Up: Previous + +mailsync +-------- + + Usage: mailsync [ OPTION ] ... [ EMAIL_ADDRESS ] [ DIRECTORY ] + or: mailsync [ OPTION ] ... SYNC_DIRECTORY + + Option -i simply sends a `ihave' package, with no bulk files. +Option -n inhibits any destructive operation and mailing. + + In the first form of the call, find a synchronisation directory in +DIRECTORY aimed towards some EMAIL_ADDRESS, then proceed with this +synchronisation directory. EMAIL_ADDRESS may be the name of a file +containing a distribution list. If EMAIL_ADDRESS is not specified, all +the synchronisation directories at the top level in DIRECTORY are +processed in turn. If DIRECTORY is not specified, the current +directory is used. + + In the second form of the call, proceed only with the given +synchronisation directory SYNC_DIRECTORY. + + For proceeding with a synchronisation directory, whatever the form of +the call was, this script reads the `ident' files it contains to set +the local user and directory and the remote user and directory. Then, +selected files under the local directory which are modified in regard +to the corresponding files in the remote directory are turned into a +synchronisation package which is mailed to the remote user. + + The list of selected files or directories to synchronize from the +local directory are given in the `list' file in the synchronisation +directory. If this `list' file is missing, all files under the local +directory are synchronized. + + What I usually do is to `cd' at the top of the directory tree to be +synchronized, then to type `mailsync' without parameters. This will +automatically prepare as many synchronisation packages as there are +mirror systems, then email multipart shars to each of them. Note that +the synchronisation package is not identical for each mirror system, +because they do not usually have the same state of synchronisation. + + `mailsync' will refuse to work if anything needs to be hand cleaned +from a previous execution of `mailsync' or `resync'. Check for some +remaining `_syncbulk' or `_synctemp' directory, or for a `_syncrm' +script. + + TODO: + - interrogate the user if `ident' file missing. + - automatically construct the local user address. + - create the synchronisation directory on the fly. + - avoid duplicating work as far as possible for multiple sends. + - have a quicker mode, depending on stamps, not on checksums. + - never send core, executables, backups, `.nsf*', `*/_synctemp/*', etc. + + +File: remsync.info, Node: resync, Prev: mailsync, Up: Previous + +resync +------ + + Usage: resync [ OPTION ]... TAR_FILE + or: resync [ OPTION ]... UNTARED_DIRECTORY + + Given a tar file produced by mailsync at some remote end and already +reconstructed on this end using unshar, or a directory containing the +already untared invoice, apply the synchronization package locally. + + Option -n inhibits destroying or creating files, but does everything +else. It will in particular create a synchronization directory if +necessary, produce the `_syncbulk' directory and the `_syncrm' script. + + The synchronization directory for the package is automatically +retrieved or, if not found, created and initialized. `resync' keeps +telling you what it is doing. + + There are a few cases when a resync should not complete without +manual intervention. The common case is that several sites update the +very same files differently since they were last resync'ed, and then +mailsync to each other. The prerequisite checksum will then fail, and +the files are then kept into the `_syncbulk' tree, which has a shape +similar to the directory tree in which the files where supposed to go. +For GNU Emacs users, a very handy package, called emerge, written by +Dale Worley , helps reconciling two files +interactiveley. The `_syncbulk' tree should be explicitely deleted +after the hand synchronisation. + + Another case of human intervention is when files are deleted at the +mailsync'ing site. By choice, all deletions on the receiving side are +accumulated in a `_syncrm' script, which is not executed automatically. +Explicitely executed, `_syncrm' will remove any file in the receiving +tree which does not exist anymore on the sender system. I often edit +`_syncrm' before executing it, to remove the unwanted deletions (beware +the double negation :-). The script removes itself. + + All the temporary files, while resynchronizing, are held in +`_synctemp', which is deleted afterwards; if something goes wrong, this +directory should also be cleaned out by hand. `resync' will refuse to +work if anything remains to be hand cleaned. + + TODO: + - interrogates the user if missing receiving directory in `ident'. + - allow `remote.sum' to be empty or non-existent. + + + +Tag Table: +Node: Top942 +Node: Overview2742 +Node: Internals3868 +Node: Quick start7142 +Node: Remsync7280 +Node: Invoking remsync7622 +Node: Conveniences9180 +Node: Commands11084 +Node: Services16240 +Node: Invoking mailshar16605 +Node: Invoking mail-files16788 +Node: Invoking find-mailer16987 +Node: Formats17162 +Node: Xremsync17410 +Node: Package21832 +Node: Miscellaneous21962 +Node: News22205 +Node: Previous23229 +Node: mailsync23583 +Node: resync26135 + +End Tag Table diff --git a/src/apps/bin/sharutils-4.2.1/doc/remsync.texi b/src/apps/bin/sharutils-4.2.1/doc/remsync.texi new file mode 100644 index 0000000000..6a7d2bb6ce --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/remsync.texi @@ -0,0 +1,722 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename remsync.info +@settitle @code{remsync} reference manual +@finalout +@setchapternewpage odd +@c %**end of header + +@ifinfo +This file documents the @code{remsync} command and friends, which have +the purpose of synchronizing remote directory trees using email. + +Copyright (C) 1994 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries copying permission +notice identical to this one except for the removal of this paragraph +(this paragraph not being relevant to the printed manual). + +@end ignore +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation approved +by the Foundation. +@end ifinfo + +@titlepage +@title remsync, version 1.3 +@subtitle A remote synchronization utility +@subtitle Edition 1.3, June 1994 +@author by @value{Francois} Pinard + +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 1994 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation approved +by the Foundation. +@end titlepage + +@ifinfo +@node Top, Overview, (dir), (dir) +@top @code{remsync} + +@code{remsync} allows for remote synchronization of directory trees, +using electronic mail. + +The current @code{remsync} release is 1.3. This is an alpha state +product, and this documentation is still sketchy. + +@menu +* Overview:: Overview of @code{remsync} and friends +* Remsync:: Specifications of program @code{remsync} +* Services:: Specifications of other service programs +* Formats:: Related file formats +* Miscellaneous:: + + --- The Detailed Node Listing --- + +Overview of @code{remsync} and friends + +* Internals:: How @code{remsync} works +* Quick start:: Quick start at using @code{remsync} + +Quick start at using @code{remsync} + +* Invoking remsync:: The @code{remsync} command and arguments + +Specifications of program @code{remsync} + +* Invoking remsync:: The @code{remsync} command and arguments +* Conveniences:: Automatic mechanisms in the @code{remsync} program +* Commands:: Commands for @code{remsync} + +The @code{remsync} command and arguments + +* Conveniences:: Automatic mechanisms in the @code{remsync} program +* Commands:: Commands for @code{remsync} + +Specifications of other service programs + +* Invoking mailshar:: The @code{mailshar} command and arguments +* Invoking mail-files:: The @code{mail-files} command and arguments +* Invoking find-mailer:: The @code{find-mailer} command and arguments + +Related file formats + +* Xremsync:: Format of the @file{.remsync} file +* Package:: Format of transiting packages + +Various considerations + +* News:: Using News distribution instead? +* Previous:: Documentation for obsolete scripts + +Documentation for obsolete scripts + +* mailsync:: mailsync +* resync:: resync +@end menu + +@end ifinfo + +@node Overview, Remsync, Top, Top +@chapter Overview of @code{remsync} and friends + +The @code{remsync} program allows for transmitting, over email, selected +parts of directories for trying to maintain up-to-date files over many +sites. It sends out and processes incoming specially packaged files +using @code{shar}, @code{tar}, @code{gzip} and electronic mail programs. + +There is no @emph{master} site, each site has an equal opportunity to +modify files, and modified files are propagated. Among many other +commands, the @code{broadcast} command sends an update package from the +current site to all others, the @code{process} command is used to apply +update packages locally after reception from remote sites. + +The unit of transmission is whole files. For now, whenever a module is +modified, it is silently synchronized only if it has been modified at +only one place. The merging has to be done at the site where the +discrepancy is observed, from where it is propagated again. + +@menu +* Internals:: How @code{remsync} works +* Quick start:: Quick start at using @code{remsync} +@end menu + +@node Internals, Quick start, Overview, Overview +@section How @code{remsync} works + +How does @code{remsync} keep track of what is in sync, and what isn't? +@xref{Xremsync}, for a the documentation on the @file{.remsync} file +format. I understand that a mere description of the format does not +replace an explanation, but in the meantime, you might guess from the +format how the program works. + +All files are summarized by a checksum, computed by the @code{sum} program. +There are a few variants of @code{sum} computing checksums in incompatible +ways, under the control of options. @code{remsync} attempts to retrieve on +each site a compatible way to do it, and complains if it cannot. + +@code{remsync} does not compare dates or sizes. Experience shown that the +best version of a file is not necessarily the one with the latest +timestamp. The best version for a site is the current version on this +site, as decided by its maintainer there, and this is this version +that will be propagated. + +Each site has an idea of the checksum of a file for all other sites. +These checksums are not necessarily identical, for sites do not +necessarily propagate to all others, and the propagation network maybe +incomplete or asymmetrical in various ways. + +Propagation is never done unattended. The user on a site has to call +@code{remsync broadcast} to issue synchronization packages for other sites. +If this is never done, the local modifications will never leave the +site. The user also has to call @code{remsync process} to apply received +synchronization packages. Applying a package does not automatically +broadcast it further (maybe this could change?). + +If a site @var{A} propagates some files to sites @var{B} and @var{D}, +but not @var{C}, site @var{B} is informed that site @var{D} also +received these files, and site @var{D} is informed that site @var{B} +also received these files, so they will not propagate again the same +files to one another. However, both site @var{B} and @var{D} are +susceptible to propagate further the same files to site @var{C}. + +It may happen that a site refuses to update a file, or modifies a file +after having been received, or merges versions, or whatever. So, +sites may have a wrong opinion of the file contents on other sites. +These differences level down after a few exchanges, and it is very +unlikely that a file would not be propagated when it should have. + +This scheme works only when the various people handling the various +files have confidence in one each other. If site @var{B} modifies a +file after having received it from site @var{A}, the file will +eventually be propagated back to site @var{A}. If the original file +stayed undisturbed on site @var{A}, that is, if @code{remsync} proves +that site @var{B} correctly knew the checksum of the original file, then +the file will be replaced on site @var{A} without any user confirmation. +So, the user on site A has to trust the changes made by the user on site +@var{B}. + +If the original file on site @var{A} had been modified after having been +sent in a synchronization package, than it is the responsibility of the +user on site @var{A} to correctly merge the local modifications with the +modifications observed in the file as received from site @var{B}. This +responsibility is real, since the merged file will later be propagated +to the other sites in an authoritative way. + +@node Quick start, , Internals, Overview +@section Quick start at using @code{remsync} + +@node Remsync, Services, Overview, Top +@chapter Specifications of program @code{remsync} + +@menu +* Invoking remsync:: The @code{remsync} command and arguments +* Conveniences:: Automatic mechanisms in the @code{remsync} program +* Commands:: Commands for @code{remsync} +@end menu + +@node Invoking remsync, Conveniences, Remsync, Remsync +@section The @code{remsync} command and arguments + +At the shell prompt, calling the command @code{remsync} without any +parameters initiates an interactive dialog, in which the user types +commands and receives feedback from the program. + +The command @code{remsync}, given at the shell prompt, may have +arguments, in which case these arguments taken together form one +@code{remsync} interactive command. However, @samp{--help} and +@samp{--version} options are interpreted especially, with their usual +effect in GNU. Once this command has been executed, no more commands +are taken from the user and @code{remsync} terminates execution. +This allows for using @code{remsync} in some kind of batch mode. +It is unwise to redirect @code{remsync} standard input, because +user interactions might often be needed in ways difficult to predict +in advance. + +The two most common usages of @code{remsync} are the commands: + +@example +remsync b +remsync p +@end example + +The first example executes the @code{broadcast} command, which sends +synchronization packages to all connected remote sites for the current +local directory tree. + +The second example executes the @code{process} command, which studies +and complies with a synchronisation package saved in the current +directory (not necessarily into the synchronized directory tree), under +the usual file name @file{remsync.tar.gz}. + +@menu +* Conveniences:: Automatic mechanisms in the @code{remsync} program +* Commands:: Commands for @code{remsync} +@end menu + +@node Conveniences, Commands, Invoking remsync, Remsync +@section Automatic mechanisms in the @code{remsync} program + +The following points apply to many of the @code{remsync} commands. +We describe them here once and for all. + +@itemize @bullet + +@item +The file @file{.remsync} describes the various properties for the +current synchronization. It is kept right in the top directory of a +synchronized directory tree. Some commands may be executed without any +need for this file. The program waits as far as possible before reading +it. + +@item +If the @file{.remsync} file is not found when required, and only then, +the user is interactively asked to fill a questionnaire about it. + +@item +If the @file{.remsync} file has been logically modified after having +been read, or if it just has been created, the program will save it back +on disk. But it will do so only before reading another @file{.remsync} +file, or just before exit. A preexisting @file{.remsync} will be +renamed to @file{.remsync.bak} before it is rewritten, when this is +done, any previous @file{.remsync.bak} file is discarded. + +@item +Many commands refer to previously entered information by repeating this +information. For example, one can refer to a particular @code{scan} +statement by entering the wildcard to be scanned by this statement. +An alternative method of specifying a statement consists in using the +decimal number which appears between square brackets in the result +of a @code{list} command. + +@item +Whenever a site list must be given, it is a space separated list of +remote sites. If the list is preceeded by a bang (@key{!}), the list is +complemented, that is, the sites that will be operated upon are all +those @emph{not} appearing in the list. As a special case, if the site +list is completely empty, then all sites are selected. + +@end itemize + +@node Commands, , Conveniences, Remsync +@section Commands for @code{remsync} + +Program commands to @code{remsync} may be given interactively by the +user sitten at a terminal. They can come from the arguments of the +@code{remsync} call at the shell level. Internally, the @code{process} +command might obey many sub-commands found in a received synchronization +package. + +Program commands are given one per line. Lines beginning with a sharp +(@key{#}) and white lines are ignored, they are meant to increase +clarity or to introduce user comments. With only a few exceptions, +commands are introduced by a keyword and often contains other keywords. +In all cases, the keywords specific to @code{remsync} may be abbreviated +to their first letter. When there are many keywords in succession, the +space separating them may be omitted. So the following commands are +all equivalent: + +@example +list remote +l remote +list r +l r +listremote +lr +@end example + +@noindent +while the following are not legal: + +@example +l rem +lisremote +@end example + +Below, for clarity, keywords are written in full and separated by +spaces. Commands often accept parameters, which are then separated by +spaces. All available commands are given in the table. The first few +commands do not pre-require the file @file{.remsync}. The last three +commands are almost never used interactively, but rather automatically +triggered while @code{process}'ing received synchronization packages. + +@table @asis + +@item @code{?} + +Display a quick help summary of available commands. + +@item @code{!} [ @var{shell-command} ] + +If @var{shell-command} has been given, execute it right now as a shell +command. When not given, rather start an interactive shell. Exiting +from the shell will return to this program. The started shell is taken +from the @code{SHELL} environment variable if set, else @code{sh} is +used. + +@item @code{quit} + +Leave the program normally and return to the shell. + +@item @code{abort} + +Leave the program with a nonzero exit status and return to the shell. +No attempt is made to save a logically modified @file{.remsync} file. + +@item @code{visit} @var{directory} + +Select another synchronized directory tree for any subsequent operation. +@var{directory} is the top directory of the synchronized directory tree. + +@item @code{process} [ @var{file} ] + +@item @code{list} [ @var{type} ] + +List all known statements about some information @var{type}. Allowable +keywords for @var{type} are @code{local}, @code{remote}, @code{scan}, +@code{ignore} and @code{files}. The keyword @code{files} asks for all +empty statements (see later). If @var{type} is omitted, then list all +known statements for all types, except those given by @code{files}. + +@item [ @code{create} ] @var{type} @var{value} + +Create a new statement introducing a @var{value} for a given @var{type}. +Allowable keywords for @var{type} are @code{remote}, @code{scan} and +@code{ignore}. The @code{create} keyword may be omitted. + +For @code{create} @code{ignore}, when the pattern is preceeded by a bang +(@key{!}), the condition is reversed. That is, only those files which +do match the pattern will be kept for synchronization. + +@item @code{delete} @var{type} @var{value} + +Delete an existing statement supporting some @var{value} for a given +@var{type}. Allowable keywords for @var{type} are @code{remote}, +@code{scan} and @code{ignore}. + +@item @code{email} @var{remote} @var{value} + +Modify the electronic mail address associated with some @var{remote} +site, giving it a new @var{value}. The special @code{local} keyword for +@var{remote} may be used to modify the local electronic mail address. + +@item @code{home} @var{remote} @var{value} + +Modify the top directory of the synchronized directory tree associated +with some @var{remote} site, giving it a new @var{value}. The special +@code{local} keyword for @var{remote} may be used to modify the local +top directory. + +@item @code{broadcast} @var{site_list} + +Send by electronic mail an update package to all sites from +@var{site_list}, containing for each site all and only those files which +are known to be different between the remote site and here. + +@item @code{version} @var{version} + +This command is not meant for interactive use. It establishes the +@code{remsync} version needed to process the incoming commands. + +@item @code{from} @var{site_list} + +This command is not really meant for interactive use. The first site +from the @var{site_list} is the remote site which originated the +synchronization package. All the others are all the sites, including +here, which were meant to be synchronized by the @code{broadcast} +command that was issued at the originating remote site. + +@item @code{sum} @var{file} @var{checksum} + +This command is not really meant for interactive use. It declares the +@var{checksum} value of a particular @var{file} at the originating +remote site. Also, if at least one @code{sum} command is received, then +it is guaranteed that the originating remote site sent one @code{sum} +command for each and every file to be synchronized, so any found local +file which was not subject of any @code{sum} command does not exist +remotely. + +@item @code{if} @var{file} @var{checksum} @var{packaged} + +This command is not really meant for interactive use. It directs the +@code{remsync} program to check if a local @var{file} has a given +@var{checksum}. If the checksum agrees, then the local file will be +replaced by the @var{packaged} file, as found in the received +synchronization invoice. + +@end table + +@node Services, Formats, Remsync, Top +@chapter Specifications of other service programs + +@menu +* Invoking mailshar:: The @code{mailshar} command and arguments +* Invoking mail-files:: The @code{mail-files} command and arguments +* Invoking find-mailer:: The @code{find-mailer} command and arguments +@end menu + +@node Invoking mailshar, Invoking mail-files, Services, Services +@section The @code{mailshar} command and arguments + +@node Invoking mail-files, Invoking find-mailer, Invoking mailshar, Services +@section The @code{mail-files} command and arguments + +@node Invoking find-mailer, , Invoking mail-files, Services +@section The @code{find-mailer} command and arguments + +@node Formats, Miscellaneous, Services, Top +@chapter Related file formats + +@menu +* Xremsync:: Format of the @file{.remsync} file +* Package:: Format of transiting packages +@end menu + +@node Xremsync, Package, Formats, Formats +@section Format of the @file{.remsync} file + +The @file{.remsync} file saves all the information a site needs for +properly synchronizing a directory tree with remote sites. Even if it +is meant to be editable using any ASCII editor, it has a very precise +format and one should be very careful while modifying it. The +@file{.remsync} file is better handled through the @code{remsync} +program and commands. + +The @file{.remsync} file is made up of statements, one per line. Each +line begins with a statement keyword followed by a single @key{TAB}, +then by one or more parameters. The keyword may be omitted, in this +case, the keyword is said to be @emph{empty}, and the line begins +immediately with the @key{TAB}. After the @key{TAB}, if there are two +parameters or more, they should all be separated with a single space. +There should not be any space between the last parameter and the end of +line (unless there are explicit empty parameters). + +The following table gives the possible keywords. Their order of +presentation in the table is also the order of appearance in the +@file{.remsync} file. + +@table @code + +@item remsync +This statement identifies the @file{.remsync} format. The only +parameter states the file format version. + +@item local +This statement should appear exactly once, and has exactly two +parameters. The first parameter gives the electronic mail address the +other sites should use for sending synchronization packages here. The +second parameter gives the name of the local directory tree to +synchronize, in absolute notation. + +@item remote +This statement may appear zero, one or more times. Each occurrence +connects the synchronized directory tree to another tree on a remote +site. The first parameter gives one electronic mail address where to +send remote synchronization packages. The second parameter gives the +name of the corresponding directory tree for this remote electronic mail +address, in absolute notation. + +@item scan +This statement may appear zero, one or more times. When it does not +appear at all, the whole local directory tree will always be scanned, +searching for files to synchronize. When the statement appears at least +once, the whole local directory tree will not be scanned, but only those +files or directories appearing in one of these statements. Each +@code{scan} statement has exactly one parameter, giving one file or +directory to be studied. These are usually given relative to top +directory of the local synchronization directory tree. Shell wildcards +are acceptable. + +@item ignore +This statement may appear zero, one or more times. Each occurrence has +one parameter giving a regular expression, according to Perl syntax for +regular expressions. These @var{regexp}s are applied against each file +resulting from the scan. If any of the @code{ignore} expression matches +one of resulting file, the file is discarded and is not subject to +remote synchronization. + +@end table + +After all the statements beginning by the previous keywords, the +@file{.remsync} file usually contains many statements having the empty +keyword. The empty keyword statement may appear zero, one or more +times. Each occurrence list one file being remotely synchronized. The +first parameter gives an explicit file name, usually given relative to +the top directory of the local synchronized directory tree. Shell +wildcards are @emph{not} acceptable. + +Besides the file name parameter, there are supplementary parameters to +each empty keyword statement, each corresponding to one remote statement +in the @file{.remsync} file. The second parameter corresponds to the +first remote, the third parameter corresponds to the second remote, etc. +If there are more remote statements than supplementary parameters, +missing parameters are considered to be empty. + +Each supplementary parameter usually gives the last known checksum +value for this particular file, as computed on its corresponding +@emph{remote} site. The parameter contains a dash @kbd{-} while the +remote checksum is unknown. The checksum value for the @emph{local} +copy of the file is never kept anywhere in the @file{.remsync} file. +The special value @samp{666} indicates a checksum from hell, used +when the remote file is known to exist, but for which contradictory +information has been received from various sources. + +@node Package, , Xremsync, Formats +@section Format of transiting packages + +@node Miscellaneous, , Formats, Top +@chapter Various considerations + +@menu +* News:: Using News distribution instead? +* Previous:: Documentation for obsolete scripts +@end menu + +@node News, Previous, Miscellaneous, Miscellaneous +@section Using News distribution instead? + +One correspondent thinks that perhaps the news distribution mechanism +could be pressed into service for this job. I could have started +from C-news, say, instead of from scratch, and have progressively +bent C-news to behave like I wanted. + +My feeling is that the route was shorter as I did it, from scratch, +that it would have been from C-news. Of course, I could have +removed the heavy administrative details of C-news: the history and +@code{expire}, the daemons, the @code{cron} entries, etc., then added +the interactive features and specialized behaviors, but all this clean +up would certainly have took energies. Right now, non counting the +subsidiary scripts and shar/unshar sources, the heart of the result +is a single (1200 lines) script written in Perl, which I find fairly +more smaller and maintainable than a patched C-news distribution +would have been. + +@node Previous, , News, Miscellaneous +@section Documentation for obsolete scripts + +This is merely a place holder for previous documentation, waiting that I +clean it up. You have no interest in reading further down. + +@menu +* mailsync:: mailsync +* resync:: resync +@end menu + +@node mailsync, resync, Previous, Previous +@subsection mailsync + +@example +Usage: mailsync [ OPTION ] ... [ EMAIL_ADDRESS ] [ DIRECTORY ] + or: mailsync [ OPTION ] ... SYNC_DIRECTORY +@end example + +Option -i simply sends a @code{ihave} package, with no bulk files. +Option -n inhibits any destructive operation and mailing. + +In the first form of the call, find a synchronisation directory in +DIRECTORY aimed towards some EMAIL_ADDRESS, then proceed with this +synchronisation directory. EMAIL_ADDRESS may be the name of a file +containing a distribution list. If EMAIL_ADDRESS is not specified, +all the synchronisation directories at the top level in DIRECTORY are +processed in turn. If DIRECTORY is not specified, the current +directory is used. + +In the second form of the call, proceed only with the given +synchronisation directory SYNC_DIRECTORY. + +For proceeding with a synchronisation directory, whatever the form of +the call was, this script reads the @code{ident} files it contains to set +the local user and directory and the remote user and directory. Then, +selected files under the local directory which are modified in regard +to the corresponding files in the remote directory are turned into a +synchronisation package which is mailed to the remote user. + +The list of selected files or directories to synchronize from the +local directory are given in the @code{list} file in the synchronisation +directory. If this @code{list} file is missing, all files under the +local directory are synchronized. + +What I usually do is to @code{cd} at the top of the directory tree to be +synchronized, then to type @code{mailsync} without parameters. This will +automatically prepare as many synchronisation packages as there are +mirror systems, then email multipart shars to each of them. Note that +the synchronisation package is not identical for each mirror system, +because they do not usually have the same state of synchronisation. + +@code{mailsync} will refuse to work if anything needs to be hand cleaned +from a previous execution of @code{mailsync} or @code{resync}. Check +for some remaining @file{_syncbulk} or @file{_synctemp} directory, or +for a @file{_syncrm} script. + +@example +TODO: +- interrogate the user if @file{ident} file missing. +- automatically construct the local user address. +- create the synchronisation directory on the fly. +- avoid duplicating work as far as possible for multiple sends. +- have a quicker mode, depending on stamps, not on checksums. +- never send core, executables, backups, @file{.nsf*}, @file{*/_synctemp/*}, etc. +@end example + +@node resync, , mailsync, Previous +@subsection resync + +@example +Usage: resync [ OPTION ]... TAR_FILE + or: resync [ OPTION ]... UNTARED_DIRECTORY +@end example + +Given a tar file produced by mailsync at some remote end and already +reconstructed on this end using unshar, or a directory containing the +already untared invoice, apply the synchronization package locally. + +Option -n inhibits destroying or creating files, but does everything +else. It will in particular create a synchronization directory if +necessary, produce the @file{_syncbulk} directory and the @file{_syncrm} +script. + +The synchronization directory for the package is automatically +retrieved or, if not found, created and initialized. @code{resync} keeps +telling you what it is doing. + +There are a few cases when a resync should not complete without manual +intervention. The common case is that several sites update the very +same files differently since they were last resync'ed, and then +mailsync to each other. The prerequisite checksum will then fail, and +the files are then kept into the @file{_syncbulk} tree, which has a shape +similar to the directory tree in which the files where supposed to go. +For GNU Emacs users, a very handy package, called emerge, written by +Dale Worley , helps reconciling two files +interactiveley. The @file{_syncbulk} tree should be explicitely deleted +after the hand synchronisation. + +Another case of human intervention is when files are deleted at the +mailsync'ing site. By choice, all deletions on the receiving side are +accumulated in a @file{_syncrm} script, which is not executed automatically. +Explicitely executed, @file{_syncrm} will remove any file in the receiving +tree which does not exist anymore on the sender system. I often edit +@file{_syncrm} before executing it, to remove the unwanted deletions (beware +the double negation :-). The script removes itself. + +All the temporary files, while resynchronizing, are held in @file{_synctemp}, +which is deleted afterwards; if something goes wrong, this directory +should also be cleaned out by hand. @code{resync} will refuse to work if +anything remains to be hand cleaned. + +@display +TODO: +- interrogates the user if missing receiving directory in @file{ident}. +- allow @file{remote.sum} to be empty or non-existent. +@end display + +@contents +@bye + +@c Local Variables: +@c texinfo-column-for-description: 24 +@c End: diff --git a/src/apps/bin/sharutils-4.2.1/doc/shar.1 b/src/apps/bin/sharutils-4.2.1/doc/shar.1 new file mode 100644 index 0000000000..2f6fee2811 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/shar.1 @@ -0,0 +1,243 @@ +.TH SHAR 1 "September 10, 1995" +.SH NAME +shar \- create shell archives +.SH SYNOPSIS +.nf +shar [ options ] file ... +shar \-S [ options ] +.fi +.SH DESCRIPTION +Shar +creates "shell archives" (or shar files) which are in text format +and can be mailed. These files may be unpacked later by executing them +with /bin/sh. The resulting archive is sent to standard out unless the +\f2\-o\f1 option is given. A wide range of features provide extensive +flexibility in manufacturing shars and in specifying shar "smartness". +Archives may be "vanilla" or comprehensive. +.SH OPTIONS +.PP +Options have a one letter version starting with \- or a long version starting +with \-\-. The exception is \f2\-\-help\f1, \f2\-\-version\f1, +\f2\-\-no-i18n\f1 and \f2\-\-print-text-domain-dir\f1 which does not +have short versions. +Mandatory arguments to long options are mandatory for short options too. +Options can be given in any order. Some options depend on each other: +.nf + The \f2\-o\f1 option is required if the \f2\-l\f1 or \f2\-L\f1 option is used. + The \f2\-n\f1 option is required if the \f2\-a\f1 option is used. + See \f2\-V\f1 below. +.fi +.SS "Giving feedback:" +.IP "\f2\-\-help\f1" +Print a help summary on standard output, then immediately exits. +.IP "\f2\-\-version\f1" +Print the version number of the program on standard output, +then immediately exits. +.IP "\f2\-q\f1 \f2\-\-quiet\f1 \f2\-\-silent\f1" +Do not output verbose messages locally when producing the archive. +.SS "Selecting files:" +.IP "\f2\-p\f1 \f2\-\-intermix-type\f1" +Allow positional parameter options. The options \f2\-B\f1, \f2\-T\f1, +\f2-z\f1 and \f2\-Z\f1 may be embedded, and files to the right of the +option will be processed in the specified mode. +.IP "\f2\-S\f1 \f2\-\-stdin-file-list\f1" +Read list of files to be packed from the standard input rather +than from the command line. Input must be in a form similar to +that generated by the find command, one filename per line. This +switch is especially useful when the command line will not hold +the list of files to be packed. For example: +.nf + +find . \-type f \-print | sort | shar \-S \-Z \-L50 \-o /tmp/big + +.fi +If \f2\-p\f1 is specified on the command line, then the options +\f2\-B\f1, \f2\-T\f1, \f2\-z\f1 and \f2\-Z\f1 may be +included in the standard input (on a line separate from filenames). +The maximum number of lines of standard input, file names and +options, may not exceed 1024. +.SS "Splitting output:" +.IP "\f2\-o\f1 XXX \f2\-\-output-prefix=\f1XXX" +Save the archive to files XXX.01 thru XXX.nn instead of sending it to +standard out. +Must be used when the \f2\-l\f1 or the \f2\-L\f1 switches are used. +.IP "\f2\-l\f1 XX \f2\-\-whole-size-limit=\f1XX" +Limit the output file size to XXk bytes but don't split input files. +.IP "\f2\-L\f1 XX \f2\-\-split-size-limit=\f1XX" +Limit output file size to XXk bytes and split files if necessary. The archive +parts created with this option must be unpacked in correct order. +.SS "Controlling the shar headers:" +.IP "\f2\-n\f1 name \f2\-\-archive-name=\f1name" +Name of archive to be included in the header of the shar files. +See the \f2\-a\f1 switch. +.IP "\f2\-s\f1 who@where \f2\-\-submitter=\f1who@where" +Override automatically determined submitter name. +.IP "\f2\-a\f1 \f2\-\-net-headers\f1" +Allows automatic generation of headers: +.nf + Submitted-by: who@where + Archive-name: /part## +.fi +The must be given with the \f2\-n\f1 switch. +If name includes a '/' "/part" isn't used. Thus: +.RS 10m +.nf +.ta 30n +\-n xyzzy produces: + xyzzy/part01 + xyzzy/part02 + +\-n xyzzy/patch produces: + xyzzy/patch01 + xyzzy/patch02 + +\-n xyzzy/patch01. produces: + xyzzy/patch01.01 + xyzzy/patch01.02 +.RE +.fi +.IP "" +The who@where can be +explicitly stated with the \f2\-s\f1 switch if the default isn't appropriate. +Who@where is essentially built as `whoami`@`uname`. +.IP "\f2\-c\f1 \f2\-\-cut-mark\f1" +Start the shar with a cut line. A line saying 'Cut here' is placed at the +start of each output file. +.SS "Selecting how files are stocked:" +.IP "\f2\-M\f1 \f2\-\-mixed-uuencode\f1" +Mixed mode. Determine if the files are text or binary and archive +correctly (default). Files found to be binary are uudecoded prior to packing +(USE OF UUENCODE IS NOT APPRECIATED BY MANY ON THE NET). +.IP "\f2\-T\f1 \f2\-\-text-files\f1" +Treat all files as text. +.IP "\f2\-B\f1 \f2\-\-uuencode\f1" +Treat all files as binary, use uuencode prior to packing. This increases the +size of the archive. The recipient must have uudecode in order to unpack. +(USE OF UUENCODE IS NOT APPRECIATED BY MANY ON THE NET). +.IP "\f2\-z\f1 \f2\-\-gzip\f1" +Gzip and uuencode all files prior to packing. The recipient must have +uudecode and gzip in order to unpack +(USE OF UUENCODE AND GZIP IS NOT APPRECIATED BY MANY ON THE NET). +.IP "\f2\-g\f1 LEVEL \f2\-\-level-for-gzip=\f1LEVEL" +When doing compression, use '\-LEVEL' as a parameter to gzip. Default is 9. +The \f2\-g\f1 option turns on the \f2\-z\f1 option by default. +.IP "\f2\-Z\f1 \f2\-\-compress\f1" +Compress and uuencode all files prior to packing. The recipient must have +uudecode and compress in order to unpack +(USE OF UUENCODE AND COMPRESS IS NOT APPRECIATED BY MANY ON THE NET). +Option \f2\-C\f1 is synonymous to \f2\-Z\f1, but is being deprecated. +.IP "\f2\-b\f1 BITS \f2\-\-bits-per-code=\f1BITS" +When doing compression, use '\-bBITS' as a parameter to compress. +The \f2\-B\f1 option turns on the \f2\-Z\f1 option by default. Default value +is 12. +.SS "Protecting against transmission errors:" +.IP "\f2\-w\f1 \f2\-\-no-character-count\f1" +Do NOT check each file with 'wc \-c' after unpack. The default is to check. +.IP "\f2\-D\f1 \f2\-\-no-md5-digest\f1" +Do NOT use 'md5sum' digest to verify the unpacked files. The default is to +check. +.IP "\f2\-F\f1 \f2\-\-force-prefix\f1" +Forces the prefix character (normally 'X' unless the parameter to the \f2\-d\f1 +option starts with 'X') to be prepended to every line even if +not required. This option may slightly increase the size of the archive, +especially if \f2\-B\f1 or \f2\-Z\f1 is used. +.IP "\f2\-d\f1 XXX \f2\-\-here-delimiter=\f1XXX" +Use XXX to delimit the files in the shar instead of SHAR_EOF. +This is for those who want to personalize their shar files. +.SS "Producing different kinds of shars:" +.IP "\f2\-V\f1 \f2\-\-vanilla-operation\f1" +Produce "vanilla" shars which rely only upon the existence of sed and +echo in the unsharing environment. In addition, "if test" must also +be supported unless the \f2\-x\f1 option is used. The \f2\-V\f1 silently +disables options offensive to the "network cop" (or "brown shirt"), +but does warn you if it is specified with \f2\-B\f1, \f2-z\f1, +\f2\-Z\f1, \f2\-p\f1 or \f2\-M\f1 (any of which does or might +require uudecode, gzip or compress in the unsharing environment). +.IP "\f2\-P\f1 \f2\-\-no-piping\f1" +Use temporary files instead of pipes in the shar file. +.IP "\f2\-x\f1 \f2\-\-no-check-existing\f1" +Overwrite existing files without checking. +If neither \f2\-x\f1 nor \f2\-X\f1 is specified, the unpack will +check for and not overwrite existing files when unpacking the archive. +If \f2\-c\f1 is passed as a parameter to the script when unpacking: + +.RS 10m +sh archive -c +.RE +.IP "" +then existing files will be overwritten unconditionally. +.IP "\f2\-X\f1 \f2\-\-query-user\f1" +When unpacking, interactively ask the user if files should be overwritten. +(DO NOT USE FOR SHARS SUBMITTED TO THE NET). +.IP "\f2\-m\f1 \f2\-\-no-timestamp\f1" +Avoid generating 'touch' commands to restore the file modification +dates when unpacking files from the archive. +.IP "\f2\-Q\f1 \f2\-\-quiet-unshar\f1" +Verbose OFF. Disables the inclusion of comments to be output when the archive +is unpacked. +.IP "\f2\-f\f1 \f2\-\-basename\f1" +Restore by filename only, rather than path. This option causes only file +names to be used, which is useful when building a shar from several +directories, or another directory. Note that if a directory name is passed +to shar, the substructure of that directory will be restored whether \f2\-f\f1 +is specified or not. +.SS "Internationalization:" +.IP "\f2\-\-no-i18n\f1" +Do not produce internationalized shell archives, use default english messages. +By default, shar produces archives that will try to output messages in +the unpackers preferred language (as determined by the LANG/LC_MESSAGES +environmental variables) when they are unpacked. +If no message file for the unpackers language is found at unpack time, +messages will be in english. +.IP "\f2\-\-print-text-domain-dir\f1" +Prints the directory shar looks in to find messages files for different +languages, then immediately exits. +.SH EXAMPLES +.nf +.ta 37n +shar *.c > cprog.shar # all C prog sources +shar \-Q *.[ch] > cprog.shar # non-verbose, .c and .h files +shar \-B \-l28 \-oarc.sh *.arc # all binary .arc files, into + # files arc.sh.01 thru arc.sh.NN +shar \-f /lcl/src/u*.c > u.sh # use only the filenames +.ta +.fi +.SH WARNINGS +.PP +No chmod or touch is ever generated for directories created when unpacking. +Thus, if a directory is given to shar, the protection and +modification dates of corresponding unpacked directory +may not match those of the original. +.PP +If a directory is passed to shar, it may be scanned more than once. Therefore, +one should be careful not change the directory while shar is running. +.PP +Be careful that the output file(s) are not included in the inputs or shar +may loop until the disk fills up. Be particularly careful when a directory +is passed to shar that the output files are not in that directory +(or a subdirectory of that directory). +.PP +Use of the \f2\-B\f1, \f2\-z\f1 or \f2\-Z\f1, and especially +\f2\-M\f1, may slow the archive process considerably, depending on +the number of files. +.PP +Use of \f2\-X\f1 produces shars which \f2WILL\f1 cause problems +with many unshar procedures. Use this feature only for archives +to be passed among agreeable parties. Certainly, \f2\-X\f1 is NOT +for shell archives which are to be submitted to Usenet. Usage of +\f2\-B\f1, \f2\-z\f1 or \f2\-Z\f1 in net shars will cause you to +be flamed off the earth. Not using \f2\-m\f1 or not using \f2\-F\f1 +may also get you occasional complaints. +.SH SEE ALSO +.PP +unshar(1) +.SH DIAGNOSTICS +.PP +Error messages for illegal or incompatible options, +for non-regular, missing or inaccessible files or for (unlikely) +memory allocation failure. +.SH AUTHORS +The shar and unshar programs is the collective work of many authors. +Many people contributed by reporting problems, suggesting +various improvements or submitting actual code. A list of +these people is in the THANKS file in the sharutils distribution. diff --git a/src/apps/bin/sharutils-4.2.1/doc/sharutils.info b/src/apps/bin/sharutils-4.2.1/doc/sharutils.info new file mode 100644 index 0000000000..facbaa1c34 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/sharutils.info @@ -0,0 +1,578 @@ +This is Info file sharutils.info, produced by Makeinfo-1.63 from the +input file sharutils.texi. + +START-INFO-DIR-ENTRY +* Shar utilities: (sharutils). GNU shar utilities. +* mail-files: (sharutils)mail-files invocation. Send files to remote site. +* mailshar: (sharutils)mailshar invocation. Make and send a shell archive. +* remsync: (sharutils)remsync invocation. Synchronize remote files. +* shar: (sharutils)shar invocation. Make a shell archive. +* unshar: (sharutils)unshar invocation. Explode a shell archive. +* uudecode: (sharutils)uudecode invocation. Restore file from 7-bits. +* uuencode: (sharutils)uuencode invocation. Force binary file to 7-bits. +END-INFO-DIR-ENTRY + + This file documents the GNU set of shar utilities. + + Copyright (C) 1994 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: sharutils.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) + +GNU `shar' utilities +******************** + + GNU `shar' makes so-called shell archives out of many files, +preparing them for transmission by electronic mail services. GNU +`unshar' helps unpacking shell archives after reception. This is +release 4.1.9. + +* Menu: + +* Introduction:: Introduction to both programs +* shar invocation:: Invoking the `shar' program +* unshar invocation:: Invoking the `unshar' program +* Miscellaneous:: Miscellaneous considerations + + -- The Detailed Node Listing -- + +Creating shell archives + +* Selecting:: Selecting files +* Splitting:: Splitting output +* Headers:: Controlling the shar headers +* Stocking:: Selecting how files are stocked +* Transmission:: Protecting against transmission +* Kinds:: Producing different kinds of shar + + +File: sharutils.info, Node: Introduction, Next: shar invocation, Prev: Top, Up: Top + +Introduction to both programs +***************************** + + GNU `shar' makes so-called shell archives out of many files, +preparing them for transmission by electronic mail services. A "shell +archive" is a collection of files that can be unpacked by `/bin/sh'. A +wide range of features provide extensive flexibility in manufacturing +shars and in specifying shar *smartness*. For example, `shar' may +compress files, uuencode binary files, split long files and construct +multi-part mailings, ensure correct unsharing order, and provide +simplistic checksums. *Note shar invocation::. + + GNU `unshar' scans a set of mail messages looking for the start of +shell archives. It will automatically strip off the mail headers and +other introductory text. The archive bodies are then unpacked by a +copy of the shell. `unshar' may also process files containing +concatenated shell archives. *Note unshar invocation::. + + GNU `shar' has a long history. All along this long road, numerous +users contributed various improvements. The file `THANKS', from the +GNU `shar' distribution, contain all names still having valid email +addresses, as far as we know. + + Please help me getting the history straight, for the following +information is approximative. James Gosling wrote the public domain +`shar 1.x'. William Davidsen rewrote it as `shar 2.x'. Warren Tucker +brought modifications and called it `shar 3.x'. Richard Gumpertz +maintained it until 1990. Franc,ois Pinard, from the public domain +`shar 3.49', made `GNU shar 4.x', in 1994. Some modules and other code +sections were freely borrowed from other GNU distributions, bringing +this `shar' under the terms of the GNU General Public License. + + Your feedback helps us to make a better and more portable product. +Mail suggestions and bug reports (including documentation errors) for +these programs to `bug-gnu-utils@prep.ai.mit.edu'. + + +File: sharutils.info, Node: shar invocation, Next: unshar invocation, Prev: Introduction, Up: Top + +Invoking the `shar' program +*************************** + + The format of the `shar' command is one of: + + shar [ OPTION ] ... FILE ... + shar -S [ OPTION ] ... + + In the first form, the file list is given as command arguments. In +the second form, the file list is read from standard input. The +resulting archive is sent to standard output unless the `-o' option is +given. + + Options can be given in any order. Some options depend on each +other: the `-o' option is required if the `-l' or `-L' option is used. +The `-n' option is required if the `-a' option is used. Also see `-V' +below. + + Some options are special purpose: + +`--help' + Print a help summary on standard output, then immediately exits. + +`--version' + Print the version number of the program on standard output, then + immediately exits. + +`-q' +`--quiet' + Verbose *off* at `shar' time. Messages are usually issued on + standard error to let the user follow the progress, while making + the archives. This option inhibits these messages. + +* Menu: + +* Selecting:: Selecting files +* Splitting:: Splitting output +* Headers:: Controlling the shar headers +* Stocking:: Selecting how files are stocked +* Transmission:: Protecting against transmission +* Kinds:: Producing different kinds of shar + + +File: sharutils.info, Node: Selecting, Next: Splitting, Prev: shar invocation, Up: shar invocation + +Selecting files +=============== + +`-p' +`--intermix-type' + Allow positional parameter options. The options `-M', `-B', `-T', + `-z' and `-Z' may be embedded, and files to the right of the + option will be processed in the specified mode. Without the `-p' + option, embedded options would be interpreted as file names. + *Note Stocking:: for more information on these options. + +`-S' +`--stdin-file-list' + Read list of files to be packed from the standard input rather + than from the command line. Input must be one file name per line. + This switch is especially useful when the command line will not + hold the list of files to be packed. For example: + + find . -type f -print | shar -S -o /tmp/big.shar + + If `-p' is specified on the command line, then the options `-M', + `-B', `-T', `-z' and `-Z' may be included in the standard input + (on a line separate from file names). The maximum number of lines + of standard input, file names and options, may not exceed 1024. + + +File: sharutils.info, Node: Splitting, Next: Headers, Prev: Selecting, Up: shar invocation + +Splitting output +================ + +`-o PREFIX' +`--output-prefix=PREFIX' + Save the archive to files `PREFIX.01' through `PREFIX.NNN' instead + of standard output. This option *must* be used when the `-l' or + the `-L' switches are used. + + When PREFIX contains any `%' character, PREFIX is then interpreted + as a `sprintf' format, which should be able to display a single + decimal number. When PREFIX does not contain such a `%' + character, the string `.%02d' is internally appended. + +`-l SIZE' +`--whole-size-limit=SIZE' + Limit the output file size to SIZE times 1024 bytes but don't + split input files. This allows the recipient of the shell archives + to unpack them in any order. + +`-L SIZE' +`--split-size-limit=SIZE' + Limit output file size to SIZE times 1024 bytes and split files if + necessary. The archives created with this option must be unpacked + in the correct order. If the recipient of the shell archives + wants to put all of them in a single folder, she shall save them + in the correct order for `unshar', used with option `-e', to + unpack them all at once. *Note unshar invocation::. + + For people used to saving all the shell archives into a single mail + folder, care must be taken to save them in the appropriate order. + For those having the appropriate tools (like Masanobu Umeda's + `rmailsort' package for GNU Emacs), shell archives can be saved in + any order, then sorted by increasing date (or send time) before + massive unpacking. + + +File: sharutils.info, Node: Headers, Next: Stocking, Prev: Splitting, Up: shar invocation + +Controlling the shar headers +============================ + +`-n NAME' +`--archive-name=NAME' + Name of archive to be included in the header of the shar files. + Also see the `-a' switch further down. + +`-s ADDRESS' +`--submitter=ADDRESS' + The `-s' option allows for overriding the email address for the + submitter, for when the default is not appropriate. The + automatically determined address looks like `USERNAME@HOSTNAME'. + +`-a' +`--net-headers' + Allows automatic generation of headers: + + Submitted-by: ADDRESS + Archive-name: NAME/partNN + + The NAME must be given with the `-n' switch. If name includes a + `/', then `/part' isn't used. Thus `-n xyzzy' produces: + xyzzy/part01 + xyzzy/part02 + + while `-n xyzzy/patch' produces: + xyzzy/patch01 + xyzzy/patch02 + + and `-n xyzzy/patch01.' produces: + xyzzy/patch01.01 + xyzzy/patch01.02 + +`-c' +`--cut-mark' + Start the shar with a cut line. A line saying `Cut here' is + placed at the start of each output file. + + +File: sharutils.info, Node: Stocking, Next: Transmission, Prev: Headers, Up: shar invocation + +Selecting how files are stocked +=============================== + +`-T' +`--text-files' + Treat all files as text, regardless of their contents. + +`-B' +`--uuencode' + Treat all files as binary, use `uuencode' prior to packing. This + increases the size of the archive. The recipient must have + `uudecode' in order to unpack. + + Use of `uuencode' is not appreciated by many on the net, because + people like to readily see, by mere inspection of a shell archive, + what it is about. + +`-M' +`--mixed-uuencode' + Mixed mode. Automatically determine if the files are text or + binary and archive correctly. Files found to be binary are + uuencoded prior to packing. This option is selected by default. + + For a file is considered to be a text file, instead of a binary + file, all the following should be true simultaneously: + 1. The file does not contain any ASCII control character besides + BS (backspace), HT (horizontal tab), LF (new line) or FF + (form feed). + + 2. The file does not contains a DEL (delete). + + 3. The file contains no character with its eighth-bit set. + + 4. The file, unless totally empty, terminates with a LF + (newline). + + 5. No line in the file contains more than 200 characters. For + counting purpose, lines are separated by a LF (newline). + +`-z' +`--gzip' + Use `gzip' and `uuencode' on all files prior to packing. The + recipient must have `uudecode' and `gzip' (used with `-d') in + order to unpack. + + Usage of `-z' in net shars will cause you to be flamed off the + earth. + +`-g LEVEL' +`--level-for-gzip=LEVEL' + When doing compression, use `-LEVEL' as a parameter to `gzip'. + The `-g' option turns on the `-z' option by default. The default + value is 9, that is, maximum compression. + +`-Z' +`--compress' + Use `compress' and `uuencode' on all files prior to packing. The + recipient must have `uudecode' and `compress' (used with `-d') in + order to unpack. Option `-C' is a synonymous for `-Z', but is + deprecated. + + Usage of `-Z' in net shars will cause you to be flamed off the + earth. + +`-b BITS' +`--bits-per-code=BITS' + When doing compression, use `-bX' as a parameter to `compress'. + The `-B' option turns on the `-Z' option by default. The default + value is 12, foreseeing the memory limitations of some `compress' + programs on smallish systems, at `unshar' time. + + +File: sharutils.info, Node: Transmission, Next: Kinds, Prev: Stocking, Up: shar invocation + +Protecting against transmission errors +====================================== + + Transmission of shell archives is not always free of errors. So one +should make consistency checks on the receiving site. A very simple +(and unreliable) method is running the UNIX `wc' tool on the output +file. This can report the number of characters in the file. + + As one can guess this does not catch all errors. Especially +changing of a character value does not change the computed check sum. +To achieve this goal better method were invented and standardized. One +very strong is MD5 (MD = message digests). This is standardized in RFC +1321. The produced shell scripts do not force the `md5sum' program to +be installed on the system. This is necessary because it is not yet +part of every UNIX. The program is however not necessary for producing +the shell archive. + +`-w' +`--no-character-count' + Do *not* check with `wc -c' after unpack. The default is to check. + +`-D' +`--no-md5-digest' + Do *not* check with `md5sum' after unpack. The default is to + check. + +`-F' +`--force-prefix' + Prepend the prefix character to every line even if not required. + This option may slightly increase the size of the archive, + especially if `-B' or `-Z' is used. Normally, the prefix character + is `X'. If the parameter to the `-d' option starts with `X', then + the prefix character becomes `Y'. + +`-d STRING' +`--here-delimiter=STRING' + Use STRING to delimit the files in the shar instead of `SHAR_EOF'. + This is for those who want to personalize their shar files. + + +File: sharutils.info, Node: Kinds, Prev: Transmission, Up: shar invocation + +Producing different kinds of shars +================================== + +`-V' +`--vanilla-operation' + This option produces "vanilla" shars which rely only upon the + existence of `echo', `test' and `sed' in the unpacking environment. + + The `-V' disables options offensive to the "network cop" (or + "brown shirt"). It also changes the default from mixed mode `-M' + to text mode `-T'. Warnings are produced if option `-B', `-z', + `-Z', `-p' or `-M' is specified (any of which does or might + require `uudecode', `gzip' or `compress' in the unpacking + environment). + +`-P' +`--no-piping' + In the shar file, use a temporary file to hold the file to + `uudecode', instead of using pipes. This option is mandatory when + you know the unpacking `uudecode' is unwilling to merely read its + standard input. Richard Marks wrote what is certainly the most + (in)famous of these, for MSDOS :-). + + (Here is a side note from the maintainer. Why isnt't this option + the default? In the past history of `shar', it was decided that + piping was better, surely because it is less demanding on disk + space, and people seem to be happy with this. Besides, I think + that the `uudecode' from Richard Marks, on MSDOS, is wrong in + refusing to handle `stdin'. So far that I remember, he has the + strong opinion that a program without any parameters should give + its `--help' output. Besides that, should I say, his `uuencode' + and `uudecode' programs are full-featured, one of the most + complete set I ever saw. But Richard will not release his + sources, he wants to stay in control.) + +`-x' +`--no-check-existing' + Overwrite existing files without checking. If neither `-x' nor + `-X' is specified, when unpacking itself, the shell archive will + check for and not overwrite existing files (unless `-c' is passed + as a parameter to the script when unpacking). + +`-X' +`--query-user' + Interactively overwrite existing files. + + Use of `-X' produces shars which *will* cause problems with some + `unshar'-style procedures, particularily when used together with + vanilla mode (`-V'). Use this feature mainly for archives to be + passed among agreeable parties. Certainly, `-X' is *not* for + shell archives which are to be submitted to Usenet or other public + networks. + + The problem is that `unshar' programs or procedures often feed + `/bin/sh' from its standard input, thus putting `/bin/sh' and the + shell archive script in competition for input lines. As an + attempt to alleviate this problem, `shar' will try to detect if + `/dev/tty' exists at the receiving site and will use it to read + user replies. But this does not work in all cases, it may happen + that the receiving user will have to avoid using `unshar' programs + or procedures, and call `/bin/sh' directly. In vanilla mode, + using `/dev/tty' is not even attempted. + +`-m' +`--no-timestamp' + Avoid generating `touch' commands to restore the file modification + dates when unpacking files from the archive. + + When the timestamp relationship is not preserved, some files like + `configure' or `*.info' may be uselessly remade after unpacking. + This is why, when this option is not used, a special effort is + made to restore timestamps, + +`-Q' +`--quiet-unshar' + Verbose *off* at `unshar' time. Disables the inclusion of + comments to be output when the archive is unpacked. + +`-f' +`--basename' + Use only the last file name component of each input file name, + ignoring any prefix directories. This is sometimes useful when + building a shar from several directories, or another directory. + If a directory name is passed to `shar', the substructure of that + directory will be restored whether `-f' is specified or not. + + +File: sharutils.info, Node: unshar invocation, Next: Miscellaneous, Prev: shar invocation, Up: Top + +Invoking the `unshar' program +***************************** + + The format of the `unshar' command is: + + unshar [ OPTION ] ... [ FILE ... ] + + Each FILE is processed in turn, as a shell archive or a collection +of shell archives. If no files are given, then standard input is +processed instead. + + Options: + +`--version' + Print the version number of the program on standard output, then + immediately exits. + +`--help' + Print an help summary on standard output, then immediately exits. + +`-d DIRECTORY' +`--directory=DIRECTORY' + Change directory to DIRECTORY before unpacking any files. + +`-c' +`--overwrite' +`-f' +`--force' + Passed as an option to the shar file. Many shell archive scripts + (including those produced by `shar' 3.40 and newer) accepts a `-c' + argument to indicate that existing files should be overwritten. + + The option `-f' is provided for a more unique interface. Many + programs (such as `cp' and `mv') use this option to trigger the + very same action. + +`-e' +`--exit-0' + This option exists mainly for people who collect many shell + archives into a single mail folder. With this option, `unshar' + isolates each different shell archive from the others which have + been put in the same file, unpacking each in turn, from the + beginning of the file towards its end. Its proper operation + relies on the fact that many shar files are terminated by a + `exit 0' at the beginning of a line. + + Option `-e' is internally equivalent to `-E "exit 0"'. + +`-E STRING' +`--split-at=STRING' + This option works like `-e', but it allows you to specify the + string that separates archives if `exit 0' isn't appropriate. + + For example, noticing that most `.signatures' have a `--' on a + line right before them, one can sometimes use `--split-at=--' for + splitting shell archives which lack the `exit 0' line at end. The + signature will then be skipped altogether with the headers of the + following message. + + +File: sharutils.info, Node: Miscellaneous, Prev: unshar invocation, Up: Top + +Miscellaneous considerations +**************************** + + Here is a place-holder for many considerations which do not fit +elsewhere, while not worth a section for themselves. + + Be careful that the output file(s) are not included in the inputs or +`shar' may loop until the disk fills up. Be particularly careful when +a directory is passed to `shar' that the output files are not in that +directory (or a subdirectory of that directory). + + When a directory is passed to `shar', it may be scanned more than +once, to conserve memory. Therefore, one should be careful to not +change the directory contents while `shar' is running. + + No attempt is made to restore the protection and modification dates +for directories, even if this is done by default for files. Thus, if a +directory is given to `shar', the protection and modification dates of +corresponding unpacked directory may not match those of the original. + + Use of the `-M' or `-B' options will slow down the archive process. +Use of the `-z' or `-Z' options may slow the archive process +considerably. + + Let us conclude by a showing a few examples of `shar' usage: + + shar *.c > cprog.shar + shar -Q *.[ch] > cprog.shar + shar -B -l28 -oarc.sh. *.arc + shar -f /lcl/src/u*.c > u.sh + +The first shows how to make a shell archive out of all C program +sources. The second produces a shell archive with all `.c' and `.h' +files, which unpacks silently. The third gives a shell archive of all +uuencoded `.arc' files, into files `arc.sh.01' through to `arc.sh.NNN'. +The last example gives a shell archive which will use only the file +names at unpack time. + + + +Tag Table: +Node: Top1489 +Node: Introduction2494 +Node: shar invocation4478 +Node: Selecting5980 +Node: Splitting7111 +Node: Headers8750 +Node: Stocking9915 +Node: Transmission12494 +Node: Kinds14174 +Node: unshar invocation18124 +Node: Miscellaneous20237 + +End Tag Table diff --git a/src/apps/bin/sharutils-4.2.1/doc/sharutils.texi b/src/apps/bin/sharutils-4.2.1/doc/sharutils.texi new file mode 100644 index 0000000000..9a58695624 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/sharutils.texi @@ -0,0 +1,657 @@ +\input texinfo +@c %**start of header +@setfilename sharutils.info +@settitle GNU @code{shar} utilities +@finalout +@c %**end of header + +@include version.texi + +@ifinfo +@set Francois Franc,ois +@end ifinfo +@tex +@set Francois Fran\noexpand\ptexc cois +@end tex + +@ifinfo +@format +START-INFO-DIR-ENTRY +* Shar utilities: (sharutils). GNU shar utilities. +* mail-files: (sharutils)mail-files invocation. Send files to remote site. +* mailshar: (sharutils)mailshar invocation. Make and send a shell archive. +* remsync: (sharutils)remsync invocation. Synchronize remote files. +* shar: (sharutils)shar invocation. Make a shell archive. +* unshar: (sharutils)unshar invocation. Explode a shell archive. +* uudecode: (sharutils)uudecode invocation. Restore file from 7-bits. +* uuencode: (sharutils)uuencode invocation. Force binary file to 7-bits. +END-INFO-DIR-ENTRY +@end format +@end ifinfo + +@ifinfo +This file documents the GNU set of shar utilities. + +Copyright (C) 1994 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries copying permission +notice identical to this one except for the removal of this paragraph +(this paragraph not being relevant to the printed manual). + +@end ignore +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation approved +by the Foundation. +@end ifinfo + +@titlepage +@title GNU sharutils, version @value{VERSION} +@subtitle A set of shell archiver utilities +@subtitle Edition @value{EDITION}, @value{UPDATED} +@author Jan Dj@"arv +@author @value{Francois} Pinard + +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 1994 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation approved +by the Foundation. +@end titlepage + +@ifinfo +@node Top, Introduction, (dir), (dir) +@top GNU @code{shar} utilities + +@c @item @b{@code{sharutils}} @value{hfillkludge} (UtilD, SrcCD (??)) +@c +GNU @code{shar} makes so-called shell archives out of many files, +preparing them for transmission by electronic mail services. +GNU @code{unshar} helps unpacking shell archives after reception. +This is release @value{VERSION}. + +@menu +* Introduction:: Introduction to both programs +* shar invocation:: Invoking the @code{shar} program +* unshar invocation:: Invoking the @code{unshar} program +* Miscellaneous:: Miscellaneous considerations + + --- The Detailed Node Listing --- + +Creating shell archives + +* Selecting:: Selecting files +* Splitting:: Splitting output +* Headers:: Controlling the shar headers +* Stocking:: Selecting how files are stocked +* Transmission:: Protecting against transmission +* Kinds:: Producing different kinds of shar +@end menu + +@end ifinfo + +@node Introduction, shar invocation, Top, Top +@chapter Introduction to both programs + +GNU @code{shar} makes so-called shell archives out of many files, +preparing them for transmission by electronic mail services. +A @dfn{shell archive} is a collection of files that can be unpacked by +@code{/bin/sh}. A wide range of features provide extensive flexibility +in manufacturing shars and in specifying shar @emph{smartness}. For +example, @code{shar} may compress files, uuencode binary files, split +long files and construct multi-part mailings, ensure correct unsharing +order, and provide simplistic checksums. @xref{shar invocation}. + +GNU @code{unshar} scans a set of mail messages looking for the start +of shell archives. It will automatically strip off the mail headers +and other introductory text. The archive bodies are then unpacked by +a copy of the shell. @code{unshar} may also process files containing +concatenated shell archives. @xref{unshar invocation}. + +GNU @code{shar} has a long history. All along this long road, numerous +users contributed various improvements. The file @file{THANKS}, from +the GNU @code{shar} distribution, contain all names still having +valid email addresses, as far as we know. + +Please help me getting the history straight, for the following +information is approximative. James Gosling wrote the public domain +@code{shar 1.x}. William Davidsen rewrote it as @code{shar 2.x}. +Warren Tucker brought modifications and called it @code{shar 3.x}. +Richard Gumpertz maintained it until 1990. @value{Francois} Pinard, +from the public domain @code{shar 3.49}, made @code{GNU shar 4.x}, +in 1994. Some modules and other code sections were freely borrowed +from other GNU distributions, bringing this @code{shar} under the +terms of the GNU General Public License. + +Your feedback helps us to make a better and more portable product. +Mail suggestions and bug reports (including documentation errors) +for these programs to @file{bug-gnu-utils@@prep.ai.mit.edu}. + +@node shar invocation, unshar invocation, Introduction, Top +@chapter Invoking the @code{shar} program +@pindex shar + +The format of the @code{shar} command is one of: + +@example +shar [ @var{option} ] @dots{} @var{file} @dots{} +shar -S [ @var{option} ] @dots{} +@end example + +In the first form, the file list is given as command arguments. In the +second form, the file list is read from standard input. The resulting +archive is sent to standard output unless the @code{-o} option is given. + +Options can be given in any order. Some options depend on each other: +the @code{-o} option is required if the @code{-l} or @code{-L} option +is used. The @code{-n} option is required if the @code{-a} option +is used. Also see @code{-V} below. + +Some options are special purpose: + +@table @code + +@item --help +Print a help summary on standard output, then immediately exits. + +@item --version +Print the version number of the program on standard output, then +immediately exits. + +@item -q +@itemx --quiet +Verbose @emph{off} at @code{shar} time. Messages are usually issued +on standard error to let the user follow the progress, while making +the archives. This option inhibits these messages. + +@end table + +@menu +* Selecting:: Selecting files +* Splitting:: Splitting output +* Headers:: Controlling the shar headers +* Stocking:: Selecting how files are stocked +* Transmission:: Protecting against transmission +* Kinds:: Producing different kinds of shar +@end menu + +@node Selecting, Splitting, shar invocation, shar invocation +@section Selecting files + +@table @code + +@item -p +@itemx --intermix-type +Allow positional parameter options. The options @code{-M}, @code{-B}, +@code{-T}, @code{-z} and @code{-Z} may be embedded, and files to +the right of the option will be processed in the specified mode. +Without the @code{-p} option, embedded options would be interpreted +as file names. @xref{Stocking} for more information on these options. + +@item -S +@itemx --stdin-file-list +Read list of files to be packed from the standard input rather +than from the command line. Input must be one file name per line. +This switch is especially useful when the command line will not hold +the list of files to be packed. For example: + +@example +find . -type f -print | shar -S -o /tmp/big.shar +@end example + +If @code{-p} is specified on the command line, then the options +@code{-M}, @code{-B}, @code{-T}, @code{-z} and @code{-Z} may be +included in the standard input (on a line separate from file names). +The maximum number of lines of standard input, file names and options, +may not exceed 1024. + +@end table + +@node Splitting, Headers, Selecting, shar invocation +@section Splitting output + +@table @code + +@item -o @var{@var{prefix}} +@itemx --output-prefix=@var{prefix} +Save the archive to files @file{@var{prefix}.01} through +@file{@var{prefix}.@var{nnn}} instead of standard output. This option +@emph{must} be used when the @code{-l} or the @code{-L} switches +are used. + +When @var{prefix} contains any @samp{%} character, @var{prefix} is then +interpreted as a @code{sprintf} format, which should be able to display +a single decimal number. When @var{prefix} does not contain such a +@samp{%} character, the string @samp{.%02d} is internally appended. + +@item -l @var{size} +@itemx --whole-size-limit=@var{size} +Limit the output file size to @var{size} times 1024 bytes but don't +split input files. This allows the recipient of the shell archives +to unpack them in any order. + +@item -L @var{size} +@itemx --split-size-limit=@var{size} +Limit output file size to @var{size} times 1024 bytes and split files +if necessary. The archives created with this option must be unpacked +in the correct order. If the recipient of the shell archives wants to +put all of them in a single folder, she shall save them in the correct +order for @code{unshar}, used with option @code{-e}, to unpack them +all at once. @xref{unshar invocation}. + +For people used to saving all the shell archives into a single mail +folder, care must be taken to save them in the appropriate order. +For those having the appropriate tools (like Masanobu Umeda's +@code{rmailsort} package for GNU Emacs), shell archives can be saved +in any order, then sorted by increasing date (or send time) before +massive unpacking. + +@end table + +@node Headers, Stocking, Splitting, shar invocation +@section Controlling the shar headers + +@table @code + +@item -n @var{name} +@itemx --archive-name=@var{name} +Name of archive to be included in the header of the shar files. +Also see the @code{-a} switch further down. + +@item -s @var{address} +@itemx --submitter=@var{address} +The @code{-s} option allows for overriding the email address for the +submitter, for when the default is not appropriate. The automatically +determined address looks like @file{@var{username}@@@var{hostname}}. + +@item -a +@itemx --net-headers +Allows automatic generation of headers: + +@example +Submitted-by: @var{address} +Archive-name: @var{name}/part@var{nn} +@end example + +The @var{name} must be given with the @code{-n} switch. If name +includes a @samp{/}, then @samp{/part} isn't used. Thus +@samp{-n xyzzy} produces: +@example +xyzzy/part01 +xyzzy/part02 +@end example + +@noindent +while @samp{-n xyzzy/patch} produces: +@example +xyzzy/patch01 +xyzzy/patch02 +@end example + +@noindent +and @samp{-n xyzzy/patch01.} produces: +@example +xyzzy/patch01.01 +xyzzy/patch01.02 +@end example + +@item -c +@itemx --cut-mark +Start the shar with a cut line. A line saying @samp{Cut here} is +placed at the start of each output file. + +@end table + +@node Stocking, Transmission, Headers, shar invocation +@section Selecting how files are stocked + +@table @code + +@item -T +@itemx --text-files +Treat all files as text, regardless of their contents. + +@item -B +@itemx --uuencode +Treat all files as binary, use @code{uuencode} prior to packing. This +increases the size of the archive. The recipient must have +@code{uudecode} in order to unpack. + +@display +Use of @code{uuencode} is not appreciated by many on the net, because +people like to readily see, by mere inspection of a shell archive, +what it is about. +@end display + +@item -M +@itemx --mixed-uuencode +Mixed mode. Automatically determine if the files are text or binary +and archive correctly. Files found to be binary are uuencoded prior +to packing. This option is selected by default. + +For a file is considered to be a text file, instead of a binary file, +all the following should be true simultaneously: +@enumerate +@item +The file does not contain any ASCII control character besides @key{BS} +(backspace), @key{HT} (horizontal tab), @key{LF} (new line) or @key{FF} +(form feed). +@item +The file does not contains a @key{DEL} (delete). +@item +The file contains no character with its eighth-bit set. +@item +The file, unless totally empty, terminates with a @key{LF} (newline). +@item +No line in the file contains more than 200 characters. For counting +purpose, lines are separated by a @key{LF} (newline). +@end enumerate + +@item -z +@itemx --gzip +Use @code{gzip} and @code{uuencode} on all files prior to packing. +The recipient must have @code{uudecode} and @code{gzip} (used with +@code{-d}) in order to unpack. + +Usage of @code{-z} in net shars will cause you to be flamed off +the earth. + +@item -g @var{level} +@itemx --level-for-gzip=@var{level} +When doing compression, use @code{-@var{level}} as a parameter to +@code{gzip}. The @code{-g} option turns on the @code{-z} option +by default. The default value is 9, that is, maximum compression. + +@item -Z +@itemx --compress +Use @code{compress} and @code{uuencode} on all files prior to packing. +The recipient must have @code{uudecode} and @code{compress} (used +with @code{-d}) in order to unpack. Option @code{-C} is a synonymous +for @code{-Z}, but is deprecated. + +Usage of @code{-Z} in net shars will cause you to be flamed off +the earth. + +@item -b @var{bits} +@itemx --bits-per-code=@var{bits} +When doing compression, use @code{-b@var{x}} as a parameter to +@code{compress}. The @code{-B} option turns on the @code{-Z} +option by default. The default value is 12, foreseeing the memory +limitations of some @code{compress} programs on smallish systems, at +@code{unshar} time. + +@end table + +@node Transmission, Kinds, Stocking, shar invocation +@section Protecting against transmission errors + +Transmission of shell archives is not always free of errors. So one +should make consistency checks on the receiving site. A very simple +(and unreliable) method is running the UNIX @code{wc} tool on the output +file. This can report the number of characters in the file. + +As one can guess this does not catch all errors. Especially changing of +a character value does not change the computed check sum. To achieve +this goal better method were invented and standardized. One very strong +is MD5 (MD = message digests). This is standardized in RFC 1321. The +produced shell scripts do not force the @code{md5sum} program to be +installed on the system. This is necessary because it is not yet part +of every UNIX. The program is however not necessary for producing the +shell archive. + +@table @code + +@item -w +@itemx --no-character-count +Do @emph{not} check with @samp{wc -c} after unpack. The default is +to check. + +@item -D +@itemx --no-md5-digest +Do @emph{not} check with @samp{md5sum} after unpack. The default is +to check. + +@item -F +@itemx --force-prefix +Prepend the prefix character to every line even if not required. +This option may slightly increase the size of the archive, especially +if @code{-B} or @code{-Z} is used. Normally, the prefix character +is @samp{X}. If the parameter to the @code{-d} option starts with +@samp{X}, then the prefix character becomes @samp{Y}. + +@item -d @var{string} +@itemx --here-delimiter=@var{string} +Use @var{string} to delimit the files in the shar instead of +@samp{SHAR_EOF}. This is for those who want to personalize their +shar files. + +@end table + +@node Kinds, , Transmission, shar invocation +@section Producing different kinds of shars + +@table @code + +@item -V +@itemx --vanilla-operation +This option produces @dfn{vanilla} shars which rely only upon the +existence of @code{echo}, @code{test} and @code{sed} in the unpacking +environment. + +The @code{-V} disables options offensive to the @dfn{network cop} +(or @dfn{brown shirt}). It also changes the default from mixed mode +@code{-M} to text mode @code{-T}. Warnings are produced if option +@code{-B}, @code{-z}, @code{-Z}, @code{-p} or @code{-M} is specified +(any of which does or might require @code{uudecode}, @code{gzip} or +@code{compress} in the unpacking environment). + +@item -P +@itemx --no-piping +In the shar file, use a temporary file to hold the file to +@code{uudecode}, instead of using pipes. This option is mandatory +when you know the unpacking @code{uudecode} is unwilling to merely +read its standard input. Richard Marks wrote what is certainly the +most (in)famous of these, for MSDOS :-). + +(Here is a side note from the maintainer. Why isnt't this option +the default? In the past history of @code{shar}, it was decided +that piping was better, surely because it is less demanding on disk +space, and people seem to be happy with this. Besides, I think +that the @code{uudecode} from Richard Marks, on MSDOS, is wrong in +refusing to handle @code{stdin}. So far that I remember, he has +the strong opinion that a program without any parameters should +give its @code{--help} output. Besides that, should I say, his +@code{uuencode} and @code{uudecode} programs are full-featured, one +of the most complete set I ever saw. But Richard will not release +his sources, he wants to stay in control.) + +@item -x +@itemx --no-check-existing +Overwrite existing files without checking. If neither @code{-x} nor +@code{-X} is specified, when unpacking itself, the shell archive will +check for and not overwrite existing files (unless @code{-c} is passed +as a parameter to the script when unpacking). + +@item -X +@itemx --query-user +Interactively overwrite existing files. + +Use of @code{-X} produces shars which @emph{will} cause problems +with some @code{unshar}-style procedures, particularily when used +together with vanilla mode (@code{-V}). Use this feature mainly for +archives to be passed among agreeable parties. Certainly, @code{-X} +is @emph{not} for shell archives which are to be submitted to Usenet +or other public networks. + +The problem is that @code{unshar} programs or procedures often feed +@file{/bin/sh} from its standard input, thus putting @file{/bin/sh} +and the shell archive script in competition for input lines. As an +attempt to alleviate this problem, @code{shar} will try to detect if +@file{/dev/tty} exists at the receiving site and will use it to read +user replies. But this does not work in all cases, it may happen that +the receiving user will have to avoid using @code{unshar} programs +or procedures, and call @code{/bin/sh} directly. In vanilla mode, +using @file{/dev/tty} is not even attempted. + +@item -m +@itemx --no-timestamp +Avoid generating @code{touch} commands to restore the file modification +dates when unpacking files from the archive. + +When the timestamp relationship is not preserved, some files like +@file{configure} or @file{*.info} may be uselessly remade after +unpacking. This is why, when this option is not used, a special +effort is made to restore timestamps, + +@item -Q +@itemx --quiet-unshar +Verbose @emph{off} at @code{unshar} time. Disables the inclusion of +comments to be output when the archive is unpacked. + +@item -f +@itemx --basename +Use only the last file name component of each input file name, ignoring +any prefix directories. This is sometimes useful when building a shar +from several directories, or another directory. If a directory name +is passed to @code{shar}, the substructure of that directory will be +restored whether @code{-f} is specified or not. + +@end table + +@node unshar invocation, Miscellaneous, shar invocation, Top +@chapter Invoking the @code{unshar} program +@pindex unshar + +The format of the @code{unshar} command is: + +@example +unshar [ @var{option} ] @dots{} [ @var{file} @dots{} ] +@end example + +Each @var{file} is processed in turn, as a shell archive or a +collection of shell archives. If no files are given, then standard +input is processed instead. + +Options: + +@table @code + +@item --version +Print the version number of the program on standard output, then +immediately exits. + +@item --help +Print an help summary on standard output, then immediately exits. + +@item -d @var{directory} +@itemx --directory=@var{directory} +Change directory to @var{directory} before unpacking any files. + +@item -c +@itemx --overwrite +@item -f +@itemx --force +Passed as an option to the shar file. Many shell archive scripts +(including those produced by @code{shar} 3.40 and newer) accepts +a @code{-c} argument to indicate that existing files should be +overwritten. + +The option @code{-f} is provided for a more unique interface. Many +programs (such as @code{cp} and @code{mv}) use this option to trigger +the very same action. + +@item -e +@itemx --exit-0 +This option exists mainly for people who collect many shell archives +into a single mail folder. With this option, @code{unshar} isolates +each different shell archive from the others which have been put in the +same file, unpacking each in turn, from the beginning of the file +towards its end. Its proper operation relies on the fact that many shar +files are terminated by a @w{@samp{exit 0}} at the beginning of a line. + +Option @code{-e} is internally equivalent to @w{@code{-E "exit 0"}}. + +@item -E @var{string} +@itemx --split-at=@var{string} +This option works like @code{-e}, but it allows you to specify the +string that separates archives if @samp{exit 0} isn't appropriate. + +For example, noticing that most @file{.signatures} have a @samp{--} on +a line right before them, one can sometimes use @samp{--split-at=--} +for splitting shell archives which lack the @samp{exit 0} line at end. +The signature will then be skipped altogether with the headers of +the following message. + +@end table + +@node Miscellaneous, , unshar invocation, Top +@chapter Miscellaneous considerations + +Here is a place-holder for many considerations which do not fit +elsewhere, while not worth a section for themselves. + +Be careful that the output file(s) are not included in the inputs +or @code{shar} may loop until the disk fills up. Be particularly +careful when a directory is passed to @code{shar} that the output +files are not in that directory (or a subdirectory of that directory). + +When a directory is passed to @code{shar}, it may be scanned more +than once, to conserve memory. Therefore, one should be careful to +not change the directory contents while @code{shar} is running. + +No attempt is made to restore the protection and modification dates +for directories, even if this is done by default for files. Thus, if +a directory is given to @code{shar}, the protection and modification +dates of corresponding unpacked directory may not match those of +the original. + +Use of the @code{-M} or @code{-B} options will slow down the archive +process. Use of the @code{-z} or @code{-Z} options may slow the +archive process considerably. + +Let us conclude by a showing a few examples of @code{shar} usage: + +@example +shar *.c > cprog.shar +shar -Q *.[ch] > cprog.shar +shar -B -l28 -oarc.sh. *.arc +shar -f /lcl/src/u*.c > u.sh +@end example + +@noindent +The first shows how to make a shell archive out of all C program +sources. The second produces a shell archive with all @file{.c} +and @file{.h} files, which unpacks silently. The third gives a shell +archive of all uuencoded @file{.arc} files, into files @file{arc.sh.01} +through to @file{arc.sh.@var{nnn}}. The last example gives a shell +archive which will use only the file names at unpack time. + +@contents +@bye + +@c Local variables: +@c texinfo-column-for-description: 32 +@c End: diff --git a/src/apps/bin/sharutils-4.2.1/doc/stamp-vti b/src/apps/bin/sharutils-4.2.1/doc/stamp-vti new file mode 100644 index 0000000000..9788f70238 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/stamp-vti @@ -0,0 +1 @@ +timestamp diff --git a/src/apps/bin/sharutils-4.2.1/doc/texinfo.tex b/src/apps/bin/sharutils-4.2.1/doc/texinfo.tex new file mode 100644 index 0000000000..b3dee313bf --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/texinfo.tex @@ -0,0 +1,4430 @@ +%% TeX macros to handle texinfo files + +% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 1994 Free Software Foundation, Inc. + +%This texinfo.tex 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, or (at +%your option) any later version. + +%This texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write +%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +%Boston, MA 02111-1307, USA. + +%In other words, you are welcome to use, share and improve this program. +%You are forbidden to forbid anyone else to use, share and improve +%what you give them. Help stamp out software-hoarding! + + +% Send bug reports to bug-texinfo@prep.ai.mit.edu. +% Please include a *precise* test case in each bug report. + + +% Make it possible to create a .fmt file just by loading this file: +% if the underlying format is not loaded, start by loading it now. +% Added by gildea November 1993. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi + +% This automatically updates the version number based on RCS. +\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} +\deftexinfoversion$Revision: 1.1 $ +\message{Loading texinfo package [Version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}\message{} + \catcode`+=\active \catcode`\_=\active} + +% Save some parts of plain tex whose names we will redefine. + +\let\ptextilde=\~ +\let\ptexlbrace=\{ +\let\ptexrbrace=\} +\let\ptexdots=\dots +\let\ptexdot=\. +\let\ptexstar=\* +\let\ptexend=\end +\let\ptexbullet=\bullet +\let\ptexb=\b +\let\ptexc=\c +\let\ptexi=\i +\let\ptext=\t +\let\ptexl=\l +\let\ptexL=\L + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\lvvmode\penalty\tiepenalty\ } +} +\let\~ = \tie % And make it available as @~. + +\message{Basics,} +\chardef\other=12 + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Set up fixed words for English. +\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi% +\def\putwordInfo{Info}% +\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi% +\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi% +\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi% +\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi% +\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi% +\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi% +\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi% +\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi% +\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi% + +% Ignore a token. +% +\def\gobble#1{} + +\hyphenation{ap-pen-dix} +\hyphenation{mini-buf-fer mini-buf-fers} +\hyphenation{eshell} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen \bindingoffset \bindingoffset=0pt +\newdimen \normaloffset \normaloffset=\hoffset +\newdimen\pagewidth \newdimen\pageheight +\pagewidth=\hsize \pageheight=\vsize + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\def\loggingall{\tracingcommands2 \tracingstats2 + \tracingpages1 \tracingoutput1 \tracinglostchars1 + \tracingmacros2 \tracingparagraphs1 \tracingrestores1 + \showboxbreadth\maxdimen\showboxdepth\maxdimen +}% + +%---------------------Begin change----------------------- +% +%%%% For @cropmarks command. +% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\cornerlong \newdimen\cornerthick +\newdimen \topandbottommargin +\newdimen \outerhsize \newdimen \outervsize +\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks +\outerhsize=7in +%\outervsize=9.5in +% Alternative @smallbook page size is 9.25in +\outervsize=9.25in +\topandbottommargin=.75in +% +%---------------------End change----------------------- + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions itself, but you have to call it yourself. +\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} +\def\onepageout#1{\hoffset=\normaloffset +\ifodd\pageno \advance\hoffset by \bindingoffset +\else \advance\hoffset by -\bindingoffset\fi +{\escapechar=`\\\relax % makes sure backslash is used in output files. +\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% +{\let\hsize=\pagewidth \makefootline}}}% +\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} + +%%%% For @cropmarks command %%%% + +% Here is a modification of the main output routine for Near East Publications +% This provides right-angle cropmarks at all four corners. +% The contents of the page are centerlined into the cropmarks, +% and any desired binding offset is added as an \hskip on either +% site of the centerlined box. (P. A. MacKay, 12 November, 1986) +% +\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up +{\escapechar=`\\\relax % makes sure backslash is used in output files. + \shipout + \vbox to \outervsize{\hsize=\outerhsize + \vbox{\line{\ewtop\hfill\ewtop}} + \nointerlineskip + \line{\vbox{\moveleft\cornerthick\nstop} + \hfill + \vbox{\moveright\cornerthick\nstop}} + \vskip \topandbottommargin + \centerline{\ifodd\pageno\hskip\bindingoffset\fi + \vbox{ + {\let\hsize=\pagewidth \makeheadline} + \pagebody{#1} + {\let\hsize=\pagewidth \makefootline}} + \ifodd\pageno\else\hskip\bindingoffset\fi} + \vskip \topandbottommargin plus1fill minus1fill + \boxmaxdepth\cornerthick + \line{\vbox{\moveleft\cornerthick\nsbot} + \hfill + \vbox{\moveright\cornerthick\nsbot}} + \nointerlineskip + \vbox{\line{\ewbot\hfill\ewbot}} + }} + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi} +% +% Do @cropmarks to get crop marks +\def\cropmarks{\let\onepageout=\croppageout } + +\newinsert\margin \dimen\margin=\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1 \unvbox#1 +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg#1{% + \let\next = #1% + \begingroup + \obeylines + \futurelet\temp\parseargx +} + +% If the next token is an obeyed space (from an @example environment or +% the like), remove it and recurse. Otherwise, we're done. +\def\parseargx{% + % \obeyedspace is defined far below, after the definition of \sepspaces. + \ifx\obeyedspace\temp + \expandafter\parseargdiscardspace + \else + \expandafter\parseargline + \fi +} + +% Remove a single space (as the delimiter token to the macro call). +{\obeyspaces % + \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + % + % First remove any @c comment, then any @comment. + % Result of each macro is put in \toks0. + \argremovec #1\c\relax % + \expandafter\argremovecomment \the\toks0 \comment\relax % + % + % Call the caller's macro, saved as \next in \parsearg. + \expandafter\next\expandafter{\the\toks0}% + }% +} + +% Since all \c{,omment} does is throw away the argument, we can let TeX +% do that for us. The \relax here is matched by the \relax in the call +% in \parseargline; it could be more or less anything, its purpose is +% just to delimit the argument to the \c. +\def\argremovec#1\c#2\relax{\toks0 = {#1}} +\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} + +% \argremovec{,omment} might leave us with trailing spaces, though; e.g., +% @end itemize @c foo +% will have two active spaces as part of the argument with the +% `itemize'. Here we remove all active spaces from #1, and assign the +% result to \toks0. +% +% This loses if there are any *other* active characters besides spaces +% in the argument -- _ ^ +, for example -- since they get expanded. +% Fortunately, Texinfo does not define any such commands. (If it ever +% does, the catcode of the characters in questionwill have to be changed +% here.) But this means we cannot call \removeactivespaces as part of +% \argremovec{,omment}, since @c uses \parsearg, and thus the argument +% that \parsearg gets might well have any character at all in it. +% +\def\removeactivespaces#1{% + \begingroup + \ignoreactivespaces + \edef\temp{#1}% + \global\toks0 = \expandafter{\temp}% + \endgroup +} + +% Change the active space to expand to nothing. +% +\begingroup + \obeyspaces + \gdef\ignoreactivespaces{\obeyspaces\let =\empty} +\endgroup + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +%% These are used to keep @begin/@end levels from running away +%% Call \inENV within environments (after a \begingroup) +\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} +\def\ENVcheck{% +\ifENV\errmessage{Still within an environment. Type Return to continue.} +\endgroup\fi} % This is not perfect, but it should reduce lossage + +% @begin foo is the same as @foo, for now. +\newhelp\EMsimple{Type to continue.} + +\outer\def\begin{\parsearg\beginxxx} + +\def\beginxxx #1{% +\expandafter\ifx\csname #1\endcsname\relax +{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else +\csname #1\endcsname\fi} + +% @end foo executes the definition of \Efoo. +% +\def\end{\parsearg\endxxx} +\def\endxxx #1{% + \removeactivespaces{#1}% + \edef\endthing{\the\toks0}% + % + \expandafter\ifx\csname E\endthing\endcsname\relax + \expandafter\ifx\csname \endthing\endcsname\relax + % There's no \foo, i.e., no ``environment'' foo. + \errhelp = \EMsimple + \errmessage{Undefined command `@end \endthing'}% + \else + \unmatchedenderror\endthing + \fi + \else + % Everything's ok; the right environment has been started. + \csname E\endthing\endcsname + \fi +} + +% There is an environment #1, but it hasn't been started. Give an error. +% +\def\unmatchedenderror#1{% + \errhelp = \EMsimple + \errmessage{This `@end #1' doesn't have a matching `@#1'}% +} + +% Define the control sequence \E#1 to give an unmatched @end error. +% +\def\defineunmatchedend#1{% + \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% +} + + +% Single-spacing is done by various environments (specifically, in +% \nonfillstart and \quotations). +\newskip\singlespaceskip \singlespaceskip = 12.5pt +\def\singlespace{% + % Why was this kern here? It messes up equalizing space above and below + % environments. --karl, 6may93 + %{\advance \baselineskip by -\singlespaceskip + %\kern \baselineskip}% + \setleading \singlespaceskip +} + +%% Simple single-character @ commands + +% @@ prints an @ +% Kludge this until the fonts are right (grr). +\def\@{{\tt \char '100}} + +% This is turned off because it was never documented +% and you can use @w{...} around a quote to suppress ligatures. +%% Define @` and @' to be the same as ` and ' +%% but suppressing ligatures. +%\def\`{{`}} +%\def\'{{'}} + +% Used to generate quoted braces. + +\def\mylbrace {{\tt \char '173}} +\def\myrbrace {{\tt \char '175}} +\let\{=\mylbrace +\let\}=\myrbrace + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\hfil\break\hbox{}\ignorespaces} + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=3000 } + +% @enddots{} is an end-of-sentence ellipsis. +\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000} + +% @! is an end-of-sentence bang. +\gdef\!{!\spacefactor=3000 } + +% @? is an end-of-sentence query. +\gdef\?{?\spacefactor=3000 } + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +\def\group{\begingroup + \ifnum\catcode13=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + % + % The \vtop we start below produces a box with normal height and large + % depth; thus, TeX puts \baselineskip glue before it, and (when the + % next line of text is done) \lineskip glue after it. (See p.82 of + % the TeXbook.) Thus, space below is not quite equal to space + % above. But it's pretty close. + \def\Egroup{% + \egroup % End the \vtop. + \endgroup % End the \group. + }% + % + \vtop\bgroup + % We have to put a strut on the last line in case the @group is in + % the midst of an example, rather than completely enclosing it. + % Otherwise, the interline space between the last line of the group + % and the first line afterwards is too small. But we can't put the + % strut in \Egroup, since there it would be on a line by itself. + % Hence this just inserts a strut at the beginning of each line. + \everypar = {\strut}% + % + % Since we have a strut on every line, we don't need any of TeX's + % normal interline spacing. + \offinterlineskip + % + % OK, but now we have to do something about blank + % lines in the input in @example-like environments, which normally + % just turn into \lisppar, which will insert no space now that we've + % turned off the interline space. Simplest is to make them be an + % empty paragraph. + \ifx\par\lisppar + \edef\par{\leavevmode \par}% + % + % Reset ^^M's definition to new definition of \par. + \obeylines + \fi + % + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +\def\need{\parsearg\needx} + +% Old definition--didn't work. +%\def\needx #1{\par % +%% This method tries to make TeX break the page naturally +%% if the depth of the box does not fit. +%{\baselineskip=0pt% +%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000 +%\prevdepth=-1000pt +%}} + +\def\needx#1{% + % Go into vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % Don't add any leading before our big empty box, but allow a page + % break, since the best break might be right here. + \allowbreak + \nointerlineskip + \vtop to #1\mil{\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak +} + +% @br forces paragraph break + +\let\br = \par + +% @dots{} output some dots + +\def\dots{$\ldots$} + +% @page forces the start of a new page + +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\def\exdent{\parsearg\exdentyyy} +\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} + +% This defn is used inside nofill environments such as @example. +\def\nofillexdent{\parsearg\nofillexdentyyy} +\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount +\leftline{\hskip\leftskip{\rm#1}}}} + +%\hbox{{\rm#1}}\hfil\break}} + +% @include file insert text of that file as input. + +\def\include{\parsearg\includezzz} +%Use \input\thisfile to avoid blank after \input, which may be an active +%char (in which case the blank would become the \input argument). +%The grouping keeps the value of \thisfile correct even when @include +%is nested. +\def\includezzz #1{\begingroup +\def\thisfile{#1}\input\thisfile +\endgroup} + +\def\thisfile{} + +% @center line outputs that line, centered + +\def\center{\parsearg\centerzzz} +\def\centerzzz #1{{\advance\hsize by -\leftskip +\advance\hsize by -\rightskip +\centerline{#1}}} + +% @sp n outputs n lines of vertical space + +\def\sp{\parsearg\spxxx} +\def\spxxx #1{\par \vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment + +\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other% +\parsearg \commentxxx} + +\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } + +\let\c=\comment + +% Prevent errors for section commands. +% Used in @ignore and in failing conditionals. +\def\ignoresections{% +\let\chapter=\relax +\let\unnumbered=\relax +\let\top=\relax +\let\unnumberedsec=\relax +\let\unnumberedsection=\relax +\let\unnumberedsubsec=\relax +\let\unnumberedsubsection=\relax +\let\unnumberedsubsubsec=\relax +\let\unnumberedsubsubsection=\relax +\let\section=\relax +\let\subsec=\relax +\let\subsubsec=\relax +\let\subsection=\relax +\let\subsubsection=\relax +\let\appendix=\relax +\let\appendixsec=\relax +\let\appendixsection=\relax +\let\appendixsubsec=\relax +\let\appendixsubsection=\relax +\let\appendixsubsubsec=\relax +\let\appendixsubsubsection=\relax +\let\contents=\relax +\let\smallbook=\relax +\let\titlepage=\relax +} + +% Used in nested conditionals, where we have to parse the Texinfo source +% and so want to turn off most commands, in case they are used +% incorrectly. +% +\def\ignoremorecommands{% + \let\defcv = \relax + \let\deffn = \relax + \let\deffnx = \relax + \let\defindex = \relax + \let\defivar = \relax + \let\defmac = \relax + \let\defmethod = \relax + \let\defop = \relax + \let\defopt = \relax + \let\defspec = \relax + \let\deftp = \relax + \let\deftypefn = \relax + \let\deftypefun = \relax + \let\deftypevar = \relax + \let\deftypevr = \relax + \let\defun = \relax + \let\defvar = \relax + \let\defvr = \relax + \let\ref = \relax + \let\xref = \relax + \let\printindex = \relax + \let\pxref = \relax + \let\settitle = \relax + \let\include = \relax + \let\lowersections = \relax + \let\down = \relax + \let\raisesections = \relax + \let\up = \relax + \let\set = \relax + \let\clear = \relax + \let\item = \relax + \let\message = \relax +} + +% Ignore @ignore ... @end ignore. +% +\def\ignore{\doignore{ignore}} + +% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text. +% +\def\ifinfo{\doignore{ifinfo}} +\def\ifhtml{\doignore{ifhtml}} +\def\html{\doignore{html}} +\def\menu{\doignore{menu}} +\def\direntry{\doignore{direntry}} + +% Ignore text until a line `@end #1'. +% +\def\doignore#1{\begingroup + % Don't complain about control sequences we have declared \outer. + \ignoresections + % + % Define a command to swallow text until we reach `@end #1'. + \long\def\doignoretext##1\end #1{\enddoignore}% + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \catcode32 = 10 + % + % And now expand that command. + \doignoretext +} + +% What we do to finish off ignored text. +% +\def\enddoignore{\endgroup\ignorespaces}% + +\newif\ifwarnedobs\warnedobsfalse +\def\obstexwarn{% + \ifwarnedobs\relax\else + % We need to warn folks that they may have trouble with TeX 3.0. + % This uses \immediate\write16 rather than \message to get newlines. + \immediate\write16{} + \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} + \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} + \immediate\write16{If you are running another version of TeX, relax.} + \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} + \immediate\write16{ Then upgrade your TeX installation if you can.} + \immediate\write16{If you are stuck with version 3.0, run the} + \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} + \immediate\write16{ to use a workaround.} + \immediate\write16{} + \warnedobstrue + \fi +} + +% **In TeX 3.0, setting text in \nullfont hangs tex. For a +% workaround (which requires the file ``dummy.tfm'' to be installed), +% uncomment the following line: +%%%%%\font\nullfont=dummy\let\obstexwarn=\relax + +% Ignore text, except that we keep track of conditional commands for +% purposes of nesting, up to an `@end #1' command. +% +\def\nestedignore#1{% + \obstexwarn + % We must actually expand the ignored text to look for the @end + % command, so that nested ignore constructs work. Thus, we put the + % text into a \vbox and then do nothing with the result. To minimize + % the change of memory overflow, we follow the approach outlined on + % page 401 of the TeXbook: make the current font be a dummy font. + % + \setbox0 = \vbox\bgroup + % Don't complain about control sequences we have declared \outer. + \ignoresections + % + % Define `@end #1' to end the box, which will in turn undefine the + % @end command again. + \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% + % + % We are going to be parsing Texinfo commands. Most cause no + % trouble when they are used incorrectly, but some commands do + % complicated argument parsing or otherwise get confused, so we + % undefine them. + % + % We can't do anything about stray @-signs, unfortunately; + % they'll produce `undefined control sequence' errors. + \ignoremorecommands + % + % Set the current font to be \nullfont, a TeX primitive, and define + % all the font commands to also use \nullfont. We don't use + % dummy.tfm, as suggested in the TeXbook, because not all sites + % might have that installed. Therefore, math mode will still + % produce output, but that should be an extremely small amount of + % stuff compared to the main input. + % + \nullfont + \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont + \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont + \let\tensf = \nullfont + % Similarly for index fonts (mostly for their use in + % smallexample) + \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont + \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont + \let\indsf = \nullfont + % + % Don't complain when characters are missing from the fonts. + \tracinglostchars = 0 + % + % Don't bother to do space factor calculations. + \frenchspacing + % + % Don't report underfull hboxes. + \hbadness = 10000 + % + % Do minimal line-breaking. + \pretolerance = 10000 + % + % Do not execute instructions in @tex + \def\tex{\doignore{tex}} +} + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% +\def\set{\parsearg\setxxx} +\def\setxxx#1{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + \def\temp{#2}% + \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty + \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. + \fi +} +% Can't use \xdef to pre-expand #2 and save some time, since \temp or +% \next or other control sequences that we've defined might get us into +% an infinite loop. Consider `@set foo @cite{bar}'. +\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\def\clear{\parsearg\clearxxx} +\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} + +% @value{foo} gets the text saved in variable foo. +% +\def\value#1{\expandafter + \ifx\csname SET#1\endcsname\relax + {\{No value for ``#1''\}} + \else \csname SET#1\endcsname \fi} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +\def\ifset{\parsearg\ifsetxxx} +\def\ifsetxxx #1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \expandafter\ifsetfail + \else + \expandafter\ifsetsucceed + \fi +} +\def\ifsetsucceed{\conditionalsucceed{ifset}} +\def\ifsetfail{\nestedignore{ifset}} +\defineunmatchedend{ifset} + +% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +\def\ifclear{\parsearg\ifclearxxx} +\def\ifclearxxx #1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \expandafter\ifclearsucceed + \else + \expandafter\ifclearfail + \fi +} +\def\ifclearsucceed{\conditionalsucceed{ifclear}} +\def\ifclearfail{\nestedignore{ifclear}} +\defineunmatchedend{ifclear} + +% @iftex always succeeds; we read the text following, through @end +% iftex). But `@end iftex' should be valid only after an @iftex. +% +\def\iftex{\conditionalsucceed{iftex}} +\defineunmatchedend{iftex} + +% We can't just want to start a group at @iftex (for example) and end it +% at @end iftex, since then @set commands inside the conditional have no +% effect (they'd get reverted at the end of the group). So we must +% define \Eiftex to redefine itself to be its previous value. (We can't +% just define it to fail again with an ``unmatched end'' error, since +% the @ifset might be nested.) +% +\def\conditionalsucceed#1{% + \edef\temp{% + % Remember the current value of \E#1. + \let\nece{prevE#1} = \nece{E#1}% + % + % At the `@end #1', redefine \E#1 to be its previous value. + \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% + }% + \temp +} + +% We need to expand lots of \csname's, but we don't want to expand the +% control sequences after we've constructed them. +% +\def\nece#1{\expandafter\noexpand\csname#1\endcsname} + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math means output in math mode. +% We don't use $'s directly in the definition of \math because control +% sequences like \math are expanded when the toc file is written. Then, +% we read the toc file back, the $'s will be normal characters (as they +% should be, according to the definition of Texinfo). So we must use a +% control sequence to switch into and out of math mode. +% +% This isn't quite enough for @math to work properly in indices, but it +% seems unlikely it will ever be needed there. +% +\let\implicitmath = $ +\def\math#1{\implicitmath #1\implicitmath} + +% @bullet and @minus need the same treatment as @math, just above. +\def\bullet{\implicitmath\ptexbullet\implicitmath} +\def\minus{\implicitmath-\implicitmath} + +\def\node{\ENVcheck\parsearg\nodezzz} +\def\nodezzz#1{\nodexxx [#1,]} +\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +\let\nwnode=\node +\let\lastnode=\relax + +\def\donoderef{\ifx\lastnode\relax\else +\expandafter\expandafter\expandafter\setref{\lastnode}\fi +\global\let\lastnode=\relax} + +\def\unnumbnoderef{\ifx\lastnode\relax\else +\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi +\global\let\lastnode=\relax} + +\def\appendixnoderef{\ifx\lastnode\relax\else +\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi +\global\let\lastnode=\relax} + +\let\refill=\relax + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \readauxfile + \opencontents + \openindices + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \global\let\setfilename=\comment % Ignore extra @setfilename cmds. + \comment % Ignore the actual filename. +} + +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +\message{fonts,} + +% Font-change commands. + +% Texinfo supports the sans serif font style, which plain TeX does not. +% So we set up a \sf analogous to plain's \rm, etc. +\newfam\sffam +\def\sf{\fam=\sffam \tensf} +\let\li = \sf % Sometimes we call it \li, not \sf. + +%% Try out Computer Modern fonts at \magstephalf +\let\mainmagstep=\magstephalf + +% Set the font macro #1 to the font named #2, adding on the +% specified font prefix (normally `cm'). +\def\setfont#1#2{\font#1=\fontprefix#2} + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\undefined +\def\fontprefix{cm} +\fi + +\ifx\bigger\relax +\let\mainmagstep=\magstep1 +\setfont\textrm{r12} +\setfont\texttt{tt12} +\else +\setfont\textrm{r10 scaled \mainmagstep} +\setfont\texttt{tt10 scaled \mainmagstep} +\fi +% Instead of cmb10, you many want to use cmbx10. +% cmbx10 is a prettier font on its own, but cmb10 +% looks better when embedded in a line with cmr10. +\setfont\textbf{b10 scaled \mainmagstep} +\setfont\textit{ti10 scaled \mainmagstep} +\setfont\textsl{sl10 scaled \mainmagstep} +\setfont\textsf{ss10 scaled \mainmagstep} +\setfont\textsc{csc10 scaled \mainmagstep} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep + +% A few fonts for @defun, etc. +\setfont\defbf{bx10 scaled \magstep1} %was 1314 +\setfont\deftt{tt10 scaled \magstep1} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} + +% Fonts for indices and small examples. +% We actually use the slanted font rather than the italic, +% because texinfo normally uses the slanted fonts for that. +% Do not make many font distinctions in general in the index, since they +% aren't very useful. +\setfont\ninett{tt9} +\setfont\indrm{r9} +\setfont\indit{sl9} +\let\indsl=\indit +\let\indtt=\ninett +\let\indsf=\indrm +\let\indbf=\indrm +\setfont\indsc{csc10 at 9pt} +\font\indi=cmmi9 +\font\indsy=cmsy9 + +% Fonts for headings +\setfont\chaprm{bx12 scaled \magstep2} +\setfont\chapit{ti12 scaled \magstep2} +\setfont\chapsl{sl12 scaled \magstep2} +\setfont\chaptt{tt12 scaled \magstep2} +\setfont\chapsf{ss12 scaled \magstep2} +\let\chapbf=\chaprm +\setfont\chapsc{csc10 scaled\magstep3} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 + +\setfont\secrm{bx12 scaled \magstep1} +\setfont\secit{ti12 scaled \magstep1} +\setfont\secsl{sl12 scaled \magstep1} +\setfont\sectt{tt12 scaled \magstep1} +\setfont\secsf{ss12 scaled \magstep1} +\setfont\secbf{bx12 scaled \magstep1} +\setfont\secsc{csc10 scaled\magstep2} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 + +% \setfont\ssecrm{bx10 scaled \magstep1} % This size an font looked bad. +% \setfont\ssecit{cmti10 scaled \magstep1} % The letters were too crowded. +% \setfont\ssecsl{sl10 scaled \magstep1} +% \setfont\ssectt{tt10 scaled \magstep1} +% \setfont\ssecsf{ss10 scaled \magstep1} + +%\setfont\ssecrm{b10 scaled 1315} % Note the use of cmb rather than cmbx. +%\setfont\ssecit{ti10 scaled 1315} % Also, the size is a little larger than +%\setfont\ssecsl{sl10 scaled 1315} % being scaled magstep1. +%\setfont\ssectt{tt10 scaled 1315} +%\setfont\ssecsf{ss10 scaled 1315} + +%\let\ssecbf=\ssecrm + +\setfont\ssecrm{bx12 scaled \magstephalf} +\setfont\ssecit{ti12 scaled \magstephalf} +\setfont\ssecsl{sl12 scaled \magstephalf} +\setfont\ssectt{tt12 scaled \magstephalf} +\setfont\ssecsf{ss12 scaled \magstephalf} +\setfont\ssecbf{bx12 scaled \magstephalf} +\setfont\ssecsc{csc10 scaled \magstep1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled \magstep1 +% The smallcaps and symbol fonts should actually be scaled \magstep1.5, +% but that is not a standard magnification. + +% Fonts for title page: +\setfont\titlerm{bx12 scaled \magstep3} +\let\authorrm = \secrm + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts, we +% don't bother to reset \scriptfont and \scriptscriptfont (which would +% also require loading a lot more fonts). +% +\def\resetmathfonts{% + \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy + \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf + \textfont\ttfam = \tentt \textfont\sffam = \tensf +} + + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this so that font changes will continue to work +% in math mode, where it is the current \fam that is relevant in most +% cases, not the current. Plain TeX does, for example, +% \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need +% to redefine \bf itself. +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \resetmathfonts} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \resetmathfonts} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \resetmathfonts} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \resetmathfonts} +\def\indexfonts{% + \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl + \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc + \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy + \resetmathfonts} + +% Set up the default fonts, so we can use them for creating boxes. +% +\textfonts + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Fonts for short table of contents. +\setfont\shortcontrm{r12} +\setfont\shortcontbf{bx12} +\setfont\shortcontsl{sl12} + +%% Add scribe-like font environments, plus @l for inline lisp (usually sans +%% serif) and @ii for TeX italic + +% \smartitalic{ARG} outputs arg in italics, followed by an italic correction +% unless the following character is such as not to need one. +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} +\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx} + +\let\i=\smartitalic +\let\var=\smartitalic +\let\dfn=\smartitalic +\let\emph=\smartitalic +\let\cite=\smartitalic + +\def\b#1{{\bf #1}} +\let\strong=\b + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +\def\t#1{% + {\tt \rawbackslash \frenchspacing #1}% + \null +} +\let\ttfont=\t +\def\samp #1{`\tclose{#1}'\null} +\def\key #1{{\tt \nohyphenation \uppercase{#1}}\null} +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +\let\file=\samp + +% @code is a modification of @t, +% which makes spaces the same size as normal in the surrounding text. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \frenchspacing + #1% + }% + \null +} + +% We *must* turn on hyphenation at `-' and `_' in \code. +% Otherwise, it is too hard to avoid overful hboxes +% in the Emacs manual, the Library manual, etc. + +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate an a dash. +% -- rms. +{ +\catcode`\-=\active +\catcode`\_=\active +\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} +% The following is used by \doprintindex to insure that long function names +% wrap around. It is necessary for - and _ to be active before the index is +% read from the file, as \entry parses the arguments long before \code is +% ever called. -- mycroft +\global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} +} + +\def\realdash{-} +\def\realunder{_} +\def\codedash{-\discretionary{}{}{}} +\def\codeunder{\normalunderscore\discretionary{}{}{}} +\def\codex #1{\tclose{#1}\endgroup} + +%\let\exp=\tclose %Was temporary + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. + +\def\xkey{\key} +\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% +\ifx\one\xkey\ifx\threex\three \key{#2}% +\else\tclose{\look}\fi +\else\tclose{\look}\fi} + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of +% @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} + +\def\l#1{{\li #1}\null} % + +\def\r#1{{\rm #1}} % roman font +% Use of \lowercase was suggested. +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\def\titlefont#1{{\titlerm #1}} + +\newif\ifseenauthor +\newif\iffinishedtitlepage + +\def\shorttitlepage{\parsearg\shorttitlepagezzz} +\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\def\titlepage{\begingroup \parindent=0pt \textfonts + \let\subtitlerm=\tenrm +% I deinstalled the following change because \cmr12 is undefined. +% This change was not in the ChangeLog anyway. --rms. +% \let\subtitlerm=\cmr12 + \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% + % + \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% + % + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % + % Now you can print the title using @title. + \def\title{\parsearg\titlezzz}% + \def\titlezzz##1{\leftline{\titlefont{##1}} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Now you can put text using @subtitle. + \def\subtitle{\parsearg\subtitlezzz}% + \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% + % + % @author should come last, but may come many times. + \def\author{\parsearg\authorzzz}% + \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi + {\authorfont \leftline{##1}}}% + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \oldpage + \let\page = \oldpage + \hbox{}}% +% \def\page{\oldpage \hbox{}} +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + \HEADINGSon +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +%%% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks \evenheadline % Token sequence for heading line of even pages +\newtoks \oddheadline % Token sequence for heading line of odd pages +\newtoks \evenfootline % Token sequence for footing line of even pages +\newtoks \oddfootline % Token sequence for footing line of odd pages + +% Now make Tex use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + +\def\evenheading{\parsearg\evenheadingxxx} +\def\oddheading{\parsearg\oddheadingxxx} +\def\everyheading{\parsearg\everyheadingxxx} + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\oddfooting{\parsearg\oddfootingxxx} +\def\everyfooting{\parsearg\everyfootingxxx} + +{\catcode`\@=0 % + +\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} +\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} +\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish} +\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} +\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} +\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% +\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish} +\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} +\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} +% +}% unbind the catcode of @. + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\HEADINGSoff{ +\global\evenheadline={\hfil} \global\evenfootline={\hfil} +\global\oddheadline={\hfil} \global\oddfootline={\hfil}} +\HEADINGSoff +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{ +%\pagealignmacro +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +} +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{ +%\pagealignmacro +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +} + +% Subroutines used in generating headings +% Produces Day Month Year style of output. +\def\today{\number\day\space +\ifcase\month\or +January\or February\or March\or April\or May\or June\or +July\or August\or September\or October\or November\or December\fi +\space\number\year} + +% Use this if you want the Month Day, Year style of output. +%\def\today{\ifcase\month\or +%January\or February\or March\or April\or May\or June\or +%July\or August\or September\or October\or November\or December\fi +%\space\number\day, \number\year} + +% @settitle line... specifies the title of the document, for headings +% It generates no output of its own + +\def\thistitle{No Title} +\def\settitle{\parsearg\settitlezzz} +\def\settitlezzz #1{\gdef\thistitle{#1}} + +\message{tables,} + +% @tabs -- simple alignment + +% These don't work. For one thing, \+ is defined as outer. +% So these macros cannot even be defined. + +%\def\tabs{\parsearg\tabszzz} +%\def\tabszzz #1{\settabs\+#1\cr} +%\def\tabline{\parsearg\tablinezzz} +%\def\tablinezzz #1{\+#1\cr} +%\def\&{&} + +% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @vtable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} +\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} + +\def\internalBkitem{\smallbreak \parsearg\kitemzzz} +\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} + +\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% + \itemzzz {#1}} + +\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% + \itemzzz {#1}} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemfont{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % Be sure we are not still in the middle of a paragraph. + %{\parskip = 0in + %\par + %}% + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. Unfortunately + % we can't prevent a possible page break at the following + % \baselineskip glue. + \nobreak + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. Since that + % text will be indented by \tableindent, we make the item text be in + % a zero-width box. + \noindent + \rlap{\hskip -\tableindent\box0}\ignorespaces% + \endgroup% + \itemxneedsnegativevskiptrue% + \fi +} + +\def\item{\errmessage{@item while not in a table}} +\def\itemx{\errmessage{@itemx while not in a table}} +\def\kitem{\errmessage{@kitem while not in a table}} +\def\kitemx{\errmessage{@kitemx while not in a table}} +\def\xitem{\errmessage{@xitem while not in a table}} +\def\xitemx{\errmessage{@xitemx while not in a table}} + +%% Contains a kludge to get @end[description] to work +\def\description{\tablez{\dontindex}{1}{}{}{}{}} + +\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} +{\obeylines\obeyspaces% +\gdef\tablex #1^^M{% +\tabley\dontindex#1 \endtabley}} + +\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} +{\obeylines\obeyspaces% +\gdef\ftablex #1^^M{% +\tabley\fnitemindex#1 \endtabley +\def\Eftable{\endgraf\afterenvbreak\endgroup}% +\let\Etable=\relax}} + +\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} +{\obeylines\obeyspaces% +\gdef\vtablex #1^^M{% +\tabley\vritemindex#1 \endtabley +\def\Evtable{\endgraf\afterenvbreak\endgroup}% +\let\Etable=\relax}} + +\def\dontindex #1{} +\def\fnitemindex #1{\doind {fn}{\code{#1}}}% +\def\vritemindex #1{\doind {vr}{\code{#1}}}% + +{\obeyspaces % +\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% +\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} + +\def\tablez #1#2#3#4#5#6{% +\aboveenvbreak % +\begingroup % +\def\Edescription{\Etable}% Necessary kludge. +\let\itemindex=#1% +\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % +\ifnum 0#4>0 \tableindent=#4\mil \fi % +\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % +\def\itemfont{#2}% +\itemmax=\tableindent % +\advance \itemmax by -\itemmargin % +\advance \leftskip by \tableindent % +\exdentamount=\tableindent +\parindent = 0pt +\parskip = \smallskipamount +\ifdim \parskip=0pt \parskip=2pt \fi% +\def\Etable{\endgraf\afterenvbreak\endgroup}% +\let\item = \internalBitem % +\let\itemx = \internalBitemx % +\let\kitem = \internalBkitem % +\let\kitemx = \internalBkitemx % +\let\xitem = \internalBxitem % +\let\xitemx = \internalBxitemx % +} + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\def\itemize{\parsearg\itemizezzz} + +\def\itemizezzz #1{% + \begingroup % ended by the @end itemsize + \itemizey {#1}{\Eitemize} +} + +\def\itemizey #1#2{% +\aboveenvbreak % +\itemmax=\itemindent % +\advance \itemmax by -\itemmargin % +\advance \leftskip by \itemindent % +\exdentamount=\itemindent +\parindent = 0pt % +\parskip = \smallskipamount % +\ifdim \parskip=0pt \parskip=2pt \fi% +\def#2{\endgraf\afterenvbreak\endgroup}% +\def\itemcontents{#1}% +\let\item=\itemizeitem} + +% Set sfcode to normal for the chars that usually have another value. +% These are `.?!:;,' +\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 + \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\def\enumerate{\parsearg\enumeratezzz} +\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + \begingroup % ended by the @end enumerate + % + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a . + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call itemizey, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \itemizey{#1.}\Eenumerate\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + +% Definition of @item while inside @itemize. + +\def\itemizeitem{% +\advance\itemno by 1 +{\let\par=\endgraf \smallbreak}% +\ifhmode \errmessage{\in hmode at itemizeitem}\fi +{\parskip=0in \hskip 0pt +\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% +\vadjust{\penalty 1200}}% +\flushcr} + +% @multitable macros +% Amy Hendrickson, 8/18/94 +% +% @multitable ... @endmultitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @percentofhsize .2 .3 .5 +% @item ... +% +% Numbers following @percentofhsize are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab, @multicolumn or @endmulticolumn do not need to be on their +% own lines, but it will not hurt if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @endmultitable + +% Default dimensions may be reset by user. +% @intableparskip will set vertical space between paragraphs in table. +% @intableparindent will set paragraph indent in table. +% @spacebetweencols will set horizontal space to be left between columns. +% @spacebetweenlines will set vertical space to be left between lines. + +%%%% +% Dimensions + +\newdimen\intableparskip +\newdimen\intableparindent +\newdimen\spacebetweencols +\newdimen\spacebetweenlines +\intableparskip=0pt +\intableparindent=6pt +\spacebetweencols=12pt +\spacebetweenlines=12pt + +%%%% +% Macros used to set up halign preamble: +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\percentofhsize\relax +\def\xpercentofhsize{\percentofhsize} +\newif\ifsetpercent + +\newcount\colcount +\def\setuptable#1{\def\firstarg{#1}% +\ifx\firstarg\xendsetuptable\let\go\relax% +\else + \ifx\firstarg\xpercentofhsize\global\setpercenttrue% + \else + \ifsetpercent + \if#1.\else% + \global\advance\colcount by1 % + \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% + \fi + \else + \global\advance\colcount by1 + \setbox0=\hbox{#1}% + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi% + \fi% + \let\go\setuptable% +\fi\go} +%%%% +% multitable syntax +\def\tab{&} + +%%%% +% @multitable ... @endmultitable definitions: + +\def\multitable#1\item{\bgroup +\let\item\cr +\tolerance=9500 +\hbadness=9500 +\parskip=\intableparskip +\parindent=\intableparindent +\overfullrule=0pt +\global\colcount=0\relax% +\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% + % To parse everything between @multitable and @item : +\def\one{#1}\expandafter\setuptable\one\endsetuptable + % Need to reset this to 0 after \setuptable. +\global\colcount=0\relax% + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. +\halign\bgroup&\global\advance\colcount by 1\relax% +\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname + % In order to keep entries from bumping into each other + % we will add a \leftskip of \spacebetweencols to all columns after + % the first one. + % If a template has been used, we will add \spacebetweencols + % to the width of each template entry. + % If user has set preamble in terms of percent of \hsize + % we will use that dimension as the width of the column, and + % the \leftskip will keep entries from bumping into each other. + % Table will start at left margin and final column will justify at + % right margin. +\ifnum\colcount=1 +\else + \ifsetpercent + \else + % If user has set preamble in terms of percent of \hsize + % we will advance \hsize by \spacebetweencols + \advance\hsize by \spacebetweencols + \fi + % In either case we will make \leftskip=\spacebetweencols: +\leftskip=\spacebetweencols +\fi +\noindent##}\cr% + % \everycr will reset column counter, \colcount, at the end of + % each line. Every column entry will cause \colcount to advance by one. + % The table preamble + % looks at the current \colcount to find the correct column width. +\global\everycr{\noalign{\nointerlineskip\vskip\spacebetweenlines +\filbreak%% keeps underfull box messages off when table breaks over pages. +\global\colcount=0\relax}}} + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within \newindex. +{\catcode`\@=11 +\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. + +\def\newindex #1{ +\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file +\openout \csname#1indfile\endcsname \jobname.#1 % Open the file +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\noexpand\doindex {#1}} +} + +% @defindex foo == \newindex{foo} + +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. + +\def\newcodeindex #1{ +\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file +\openout \csname#1indfile\endcsname \jobname.#1 % Open the file +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\noexpand\docodeindex {#1}} +} + +\def\defcodeindex{\parsearg\newcodeindex} + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +\def\synindex #1 #2 {% +\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname +\expandafter\let\csname#1indfile\endcsname=\synindexfoo +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\noexpand\doindex {#2}}% +} + +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +\def\syncodeindex #1 #2 {% +\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname +\expandafter\let\csname#1indfile\endcsname=\synindexfoo +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\noexpand\docodeindex {#2}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +\def\indexdummies{% +% Take care of the plain tex accent commands. +\def\"{\realbackslash "}% +\def\`{\realbackslash `}% +\def\'{\realbackslash '}% +\def\^{\realbackslash ^}% +\def\~{\realbackslash ~}% +\def\={\realbackslash =}% +\def\b{\realbackslash b}% +\def\c{\realbackslash c}% +\def\d{\realbackslash d}% +\def\u{\realbackslash u}% +\def\v{\realbackslash v}% +\def\H{\realbackslash H}% +% Take care of the plain tex special European modified letters. +\def\oe{\realbackslash oe}% +\def\ae{\realbackslash ae}% +\def\aa{\realbackslash aa}% +\def\OE{\realbackslash OE}% +\def\AE{\realbackslash AE}% +\def\AA{\realbackslash AA}% +\def\o{\realbackslash o}% +\def\O{\realbackslash O}% +\def\l{\realbackslash l}% +\def\L{\realbackslash L}% +\def\ss{\realbackslash ss}% +% Take care of texinfo commands likely to appear in an index entry. +\def\_{{\realbackslash _}}% +\def\w{\realbackslash w }% +\def\bf{\realbackslash bf }% +\def\rm{\realbackslash rm }% +\def\sl{\realbackslash sl }% +\def\sf{\realbackslash sf}% +\def\tt{\realbackslash tt}% +\def\gtr{\realbackslash gtr}% +\def\less{\realbackslash less}% +\def\hat{\realbackslash hat}% +\def\char{\realbackslash char}% +\def\TeX{\realbackslash TeX}% +\def\dots{\realbackslash dots }% +\def\copyright{\realbackslash copyright }% +\def\tclose##1{\realbackslash tclose {##1}}% +\def\code##1{\realbackslash code {##1}}% +\def\samp##1{\realbackslash samp {##1}}% +\def\t##1{\realbackslash r {##1}}% +\def\r##1{\realbackslash r {##1}}% +\def\i##1{\realbackslash i {##1}}% +\def\b##1{\realbackslash b {##1}}% +\def\cite##1{\realbackslash cite {##1}}% +\def\key##1{\realbackslash key {##1}}% +\def\file##1{\realbackslash file {##1}}% +\def\var##1{\realbackslash var {##1}}% +\def\kbd##1{\realbackslash kbd {##1}}% +\def\dfn##1{\realbackslash dfn {##1}}% +\def\emph##1{\realbackslash emph {##1}}% +\unsepspaces +} + +% If an index command is used in an @example environment, any spaces +% therein should become regular spaces in the raw index file, not the +% expansion of \tie (\\leavevmode \penalty \@M \ ). +{\obeyspaces + \gdef\unsepspaces{\obeyspaces\let =\space}} + +% \indexnofonts no-ops all font-change commands. +% This is used when outputting the strings to sort the index by. +\def\indexdummyfont#1{#1} +\def\indexdummytex{TeX} +\def\indexdummydots{...} + +\def\indexnofonts{% +% Just ignore accents. +\let\"=\indexdummyfont +\let\`=\indexdummyfont +\let\'=\indexdummyfont +\let\^=\indexdummyfont +\let\~=\indexdummyfont +\let\==\indexdummyfont +\let\b=\indexdummyfont +\let\c=\indexdummyfont +\let\d=\indexdummyfont +\let\u=\indexdummyfont +\let\v=\indexdummyfont +\let\H=\indexdummyfont +% Take care of the plain tex special European modified letters. +\def\oe{oe}% +\def\ae{ae}% +\def\aa{aa}% +\def\OE{OE}% +\def\AE{AE}% +\def\AA{AA}% +\def\o{o}% +\def\O{O}% +\def\l{l}% +\def\L{L}% +\def\ss{ss}% +\let\w=\indexdummyfont +\let\t=\indexdummyfont +\let\r=\indexdummyfont +\let\i=\indexdummyfont +\let\b=\indexdummyfont +\let\emph=\indexdummyfont +\let\strong=\indexdummyfont +\let\cite=\indexdummyfont +\let\sc=\indexdummyfont +%Don't no-op \tt, since it isn't a user-level command +% and is used in the definitions of the active chars like <, >, |... +%\let\tt=\indexdummyfont +\let\tclose=\indexdummyfont +\let\code=\indexdummyfont +\let\file=\indexdummyfont +\let\samp=\indexdummyfont +\let\kbd=\indexdummyfont +\let\key=\indexdummyfont +\let\var=\indexdummyfont +\let\TeX=\indexdummytex +\let\dots=\indexdummydots +} + +% To define \realbackslash, we must make \ not be an escape. +% We must first make another character (@) an escape +% so we do not become unable to do a definition. + +{\catcode`\@=0 \catcode`\\=\other +@gdef@realbackslash{\}} + +\let\indexbackslash=0 %overridden during \printindex. + +\let\SETmarginindex=\relax %initialize! +% workhorse for all \fooindexes +% #1 is name of index, #2 is stuff to put there +\def\doind #1#2{% +% Put the index entry in the margin if desired. +\ifx\SETmarginindex\relax\else% +\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% +\fi% +{\count10=\lastpenalty % +{\indexdummies % Must do this here, since \bf, etc expand at this stage +\escapechar=`\\% +{\let\folio=0% Expand all macros now EXCEPT \folio +\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now +% so it will be output as is; and it will print as backslash in the indx. +% +% Now process the index-string once, with all font commands turned off, +% to get the string to sort the index by. +{\indexnofonts +\xdef\temp1{#2}% +}% +% Now produce the complete index entry. We process the index-string again, +% this time with font commands expanded, to get what to print in the index. +\edef\temp{% +\write \csname#1indfile\endcsname{% +\realbackslash entry {\temp1}{\folio}{#2}}}% +\temp }% +}\penalty\count10}} + +\def\dosubind #1#2#3{% +{\count10=\lastpenalty % +{\indexdummies % Must do this here, since \bf, etc expand at this stage +\escapechar=`\\% +{\let\folio=0% +\def\rawbackslashxx{\indexbackslash}% +% +% Now process the index-string once, with all font commands turned off, +% to get the string to sort the index by. +{\indexnofonts +\xdef\temp1{#2 #3}% +}% +% Now produce the complete index entry. We process the index-string again, +% this time with font commands expanded, to get what to print in the index. +\edef\temp{% +\write \csname#1indfile\endcsname{% +\realbackslash entry {\temp1}{\folio}{#2}{#3}}}% +\temp }% +}\penalty\count10}} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% This is what you call to cause a particular index to get printed. +% Write +% @unnumbered Function Index +% @printindex fn + +\def\printindex{\parsearg\doprintindex} + +\def\doprintindex#1{% + \tex + \dobreak \chapheadingskip {10000} + \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other + \catcode`\$=\other + \catcode`\~=\other + \indexbreaks + % + % The following don't help, since the chars were translated + % when the raw index was written, and their fonts were discarded + % due to \indexnofonts. + %\catcode`\"=\active + %\catcode`\^=\active + %\catcode`\_=\active + %\catcode`\|=\active + %\catcode`\<=\active + %\catcode`\>=\active + % % + \def\indexbackslash{\rawbackslashxx} + \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt + \begindoublecolumns + % + % See if the index file exists and is nonempty. + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + (Index is nonexistent) + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + (Index is empty) + \else + \input \jobname.#1s + \fi + \fi + \closein 1 + \enddoublecolumns + \Etex +} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +% Same as \bigskipamount except no shrink. +% \balancecolumns gets confused if there is any shrink. +\newskip\initialskipamount \initialskipamount 12pt plus4pt + +\def\initial #1{% +{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt +\ifdim\lastskip<\initialskipamount +\removelastskip \penalty-200 \vskip \initialskipamount\fi +\line{\secbf#1\hfill}\kern 2pt\penalty10000}} + +% This typesets a paragraph consisting of #1, dot leaders, and then #2 +% flush to the right margin. It is used for index and table of contents +% entries. The paragraph is indented by \leftskip. +% +\def\entry #1#2{\begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent=2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % Start a ``paragraph'' for the index entry so the line breaking + % parameters we've set above will have an effect. + \noindent + % + % Insert the text of the index entry. TeX will do line-breaking on it. + #1% + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \def\tempa{{\rm }}% + \def\tempb{#2}% + \edef\tempc{\tempa}% + \edef\tempd{\tempb}% + \ifx\tempc\tempd\ \else% + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ #2% The page number ends the paragraph. + \fi% + \par +\endgroup} + +% Like \dotfill except takes at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm + +\def\secondary #1#2{ +{\parfillskip=0in \parskip=0in +\hangindent =1in \hangafter=1 +\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par +}} + +%% Define two-column mode, which is used in indexes. +%% Adapted from the TeXbook, page 416. +\catcode `\@=11 + +\newbox\partialpage + +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup + % Grab any single-column material above us. + \output = {\global\setbox\partialpage + =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% + \eject + % + % Now switch to the double-column output routine. + \output={\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it once. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +- < + % 1pt) as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize = 2\vsize + \doublecolumnpagegoal +} + +\def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage} + +\def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth + \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage + \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1} + \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3} + \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi + \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi +} +\def\doublecolumnpagegoal{% + \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@ +} +\def\pagesofar{\unvbox\partialpage % + \hsize=\doublecolumnhsize % have to restore this since output routine + \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} +\def\doublecolumnout{% + \setbox5=\copy255 + {\vbadness=10000 \doublecolumnsplit} + \ifvbox255 + \setbox0=\vtop to\dimen@{\unvbox0} + \setbox2=\vtop to\dimen@{\unvbox2} + \onepageout\pagesofar \unvbox255 \penalty\outputpenalty + \else + \setbox0=\vbox{\unvbox5} + \ifvbox0 + \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip + \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth + {\vbadness=10000 + \loop \global\setbox5=\copy0 + \setbox1=\vsplit5 to\dimen@ + \setbox3=\vsplit5 to\dimen@ + \ifvbox5 \global\advance\dimen@ by1pt \repeat + \setbox0=\vbox to\dimen@{\unvbox1} + \setbox2=\vbox to\dimen@{\unvbox3} + \global\setbox\partialpage=\vbox{\pagesofar} + \doublecolumnpagegoal + } + \fi + \fi +} + +\catcode `\@=\other +\message{sectioning,} +% Define chapters, sections, etc. + +\newcount \chapno +\newcount \secno \secno=0 +\newcount \subsecno \subsecno=0 +\newcount \subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount \appendixno \appendixno = `\@ +\def\appendixletter{\char\the\appendixno} + +\newwrite \contentsfile +% This is called from \setfilename. +\def\opencontents{\openout \contentsfile = \jobname.toc} + +% Each @chapter defines this as the name of the chapter. +% page headings and footings can use it. @section does likewise + +\def\thischapter{} \def\thissection{} +\def\seccheck#1{\if \pageno<0 % +\errmessage{@#1 not allowed after generating table of contents}\fi +% +} + +\def\chapternofonts{% +\let\rawbackslash=\relax% +\let\frenchspacing=\relax% +\def\result{\realbackslash result} +\def\equiv{\realbackslash equiv} +\def\expansion{\realbackslash expansion} +\def\print{\realbackslash print} +\def\TeX{\realbackslash TeX} +\def\dots{\realbackslash dots} +\def\copyright{\realbackslash copyright} +\def\tt{\realbackslash tt} +\def\bf{\realbackslash bf } +\def\w{\realbackslash w} +\def\less{\realbackslash less} +\def\gtr{\realbackslash gtr} +\def\hat{\realbackslash hat} +\def\char{\realbackslash char} +\def\tclose##1{\realbackslash tclose {##1}} +\def\code##1{\realbackslash code {##1}} +\def\samp##1{\realbackslash samp {##1}} +\def\r##1{\realbackslash r {##1}} +\def\b##1{\realbackslash b {##1}} +\def\key##1{\realbackslash key {##1}} +\def\file##1{\realbackslash file {##1}} +\def\kbd##1{\realbackslash kbd {##1}} +% These are redefined because @smartitalic wouldn't work inside xdef. +\def\i##1{\realbackslash i {##1}} +\def\cite##1{\realbackslash cite {##1}} +\def\var##1{\realbackslash var {##1}} +\def\emph##1{\realbackslash emph {##1}} +\def\dfn##1{\realbackslash dfn {##1}} +} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raise/lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% Choose a numbered-heading macro +% #1 is heading level if unmodified by @raisesections or @lowersections +% #2 is text for heading +\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 +\ifcase\absseclevel + \chapterzzz{#2} +\or + \seczzz{#2} +\or + \numberedsubseczzz{#2} +\or + \numberedsubsubseczzz{#2} +\else + \ifnum \absseclevel<0 + \chapterzzz{#2} + \else + \numberedsubsubseczzz{#2} + \fi +\fi +} + +% like \numhead, but chooses appendix heading levels +\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 +\ifcase\absseclevel + \appendixzzz{#2} +\or + \appendixsectionzzz{#2} +\or + \appendixsubseczzz{#2} +\or + \appendixsubsubseczzz{#2} +\else + \ifnum \absseclevel<0 + \appendixzzz{#2} + \else + \appendixsubsubseczzz{#2} + \fi +\fi +} + +% like \numhead, but chooses numberless heading levels +\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 +\ifcase\absseclevel + \unnumberedzzz{#2} +\or + \unnumberedseczzz{#2} +\or + \unnumberedsubseczzz{#2} +\or + \unnumberedsubsubseczzz{#2} +\else + \ifnum \absseclevel<0 + \unnumberedzzz{#2} + \else + \unnumberedsubsubseczzz{#2} + \fi +\fi +} + + +\def\thischaptername{No Chapter Title} +\outer\def\chapter{\parsearg\chapteryyy} +\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz #1{\seccheck{chapter}% +\secno=0 \subsecno=0 \subsubsecno=0 +\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}% +\chapmacro {#1}{\the\chapno}% +\gdef\thissection{#1}% +\gdef\thischaptername{#1}% +% We don't substitute the actual chapter name into \thischapter +% because we don't want its macros evaluated now. +\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% +{\chapternofonts% +\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\donoderef % +\global\let\section = \numberedsec +\global\let\subsection = \numberedsubsec +\global\let\subsubsection = \numberedsubsubsec +}} + +\outer\def\appendix{\parsearg\appendixyyy} +\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz #1{\seccheck{appendix}% +\secno=0 \subsecno=0 \subsubsecno=0 +\global\advance \appendixno by 1 \message{Appendix \appendixletter}% +\chapmacro {#1}{\putwordAppendix{} \appendixletter}% +\gdef\thissection{#1}% +\gdef\thischaptername{#1}% +\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% +{\chapternofonts% +\edef\temp{{\realbackslash chapentry + {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\appendixnoderef % +\global\let\section = \appendixsec +\global\let\subsection = \appendixsubsec +\global\let\subsubsection = \appendixsubsubsec +}} + +\outer\def\top{\parsearg\unnumberedyyy} +\outer\def\unnumbered{\parsearg\unnumberedyyy} +\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz #1{\seccheck{unnumbered}% +\secno=0 \subsecno=0 \subsubsecno=0 +% +% This used to be simply \message{#1}, but TeX fully expands the +% argument to \message. Therefore, if #1 contained @-commands, TeX +% expanded them. For example, in `@unnumbered The @cite{Book}', TeX +% expanded @cite (which turns out to cause errors because \cite is meant +% to be executed, not expanded). +% +% Anyway, we don't want the fully-expanded definition of @cite to appear +% as a result of the \message, we just want `@cite' itself. We use +% \the to achieve this: TeX expands \the only once, +% simply yielding the contents of the . +\toks0 = {#1}\message{(\the\toks0)}% +% +\unnumbchapmacro {#1}% +\gdef\thischapter{#1}\gdef\thissection{#1}% +{\chapternofonts% +\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\unnumbnoderef % +\global\let\section = \unnumberedsec +\global\let\subsection = \unnumberedsubsec +\global\let\subsubsection = \unnumberedsubsubsec +}} + +\outer\def\numberedsec{\parsearg\secyyy} +\def\secyyy #1{\numhead1{#1}} % normally calls seczzz +\def\seczzz #1{\seccheck{section}% +\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % +\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% +{\chapternofonts% +\edef\temp{{\realbackslash secentry % +{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\donoderef % +\penalty 10000 % +}} + +\outer\def\appendixsection{\parsearg\appendixsecyyy} +\outer\def\appendixsec{\parsearg\appendixsecyyy} +\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz #1{\seccheck{appendixsection}% +\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % +\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% +{\chapternofonts% +\edef\temp{{\realbackslash secentry % +{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\appendixnoderef % +\penalty 10000 % +}} + +\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} +\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz #1{\seccheck{unnumberedsec}% +\plainsecheading {#1}\gdef\thissection{#1}% +{\chapternofonts% +\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\unnumbnoderef % +\penalty 10000 % +}} + +\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} +\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz #1{\seccheck{subsection}% +\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % +\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% +{\chapternofonts% +\edef\temp{{\realbackslash subsecentry % +{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\donoderef % +\penalty 10000 % +}} + +\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} +\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz #1{\seccheck{appendixsubsec}% +\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % +\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% +{\chapternofonts% +\edef\temp{{\realbackslash subsecentry % +{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\appendixnoderef % +\penalty 10000 % +}} + +\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} +\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% +\plainsecheading {#1}\gdef\thissection{#1}% +{\chapternofonts% +\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\unnumbnoderef % +\penalty 10000 % +}} + +\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} +\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz #1{\seccheck{subsubsection}% +\gdef\thissection{#1}\global\advance \subsubsecno by 1 % +\subsubsecheading {#1} + {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% +{\chapternofonts% +\edef\temp{{\realbackslash subsubsecentry % + {#1} + {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} + {\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\donoderef % +\penalty 10000 % +}} + +\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} +\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% +\gdef\thissection{#1}\global\advance \subsubsecno by 1 % +\subsubsecheading {#1} + {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% +{\chapternofonts% +\edef\temp{{\realbackslash subsubsecentry{#1}% + {\appendixletter} + {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\appendixnoderef % +\penalty 10000 % +}} + +\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} +\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% +\plainsecheading {#1}\gdef\thissection{#1}% +{\chapternofonts% +\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% +\escapechar=`\\% +\write \contentsfile \temp % +\unnumbnoderef % +\penalty 10000 % +}} + +% These are variants which are not "outer", so they can appear in @ifinfo. +% Actually, they should now be obsolete; ordinary section commands should work. +\def\infotop{\parsearg\unnumberedzzz} +\def\infounnumbered{\parsearg\unnumberedzzz} +\def\infounnumberedsec{\parsearg\unnumberedseczzz} +\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} +\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} + +\def\infoappendix{\parsearg\appendixzzz} +\def\infoappendixsec{\parsearg\appendixseczzz} +\def\infoappendixsubsec{\parsearg\appendixsubseczzz} +\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} + +\def\infochapter{\parsearg\chapterzzz} +\def\infosection{\parsearg\sectionzzz} +\def\infosubsection{\parsearg\subsectionzzz} +\def\infosubsubsection{\parsearg\subsubsectionzzz} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\global\let\section = \numberedsec +\global\let\subsection = \numberedsubsec +\global\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +% NOTE on use of \vbox for chapter headings, section headings, and +% such: +% 1) We use \vbox rather than the earlier \line to permit +% overlong headings to fold. +% 2) \hyphenpenalty is set to 10000 because hyphenation in a +% heading is obnoxious; this forbids it. +% 3) Likewise, headings look best if no \parindent is used, and +% if justification is not attempted. Hence \raggedright. + + +\def\majorheading{\parsearg\majorheadingzzz} +\def\majorheadingzzz #1{% +{\advance\chapheadingskip by 10pt \chapbreak }% +{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\penalty 200} + +\def\chapheading{\parsearg\chapheadingzzz} +\def\chapheadingzzz #1{\chapbreak % +{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\penalty 200} + +\def\heading{\parsearg\secheadingi} + +\def\subheading{\parsearg\subsecheadingi} + +\def\subsubheading{\parsearg\subsubsecheadingi} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +%%% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} + +%%% Define plain chapter starts, and page on/off switching for it +% Parameter controlling skip before chapter headings (if needed) + +\newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt + +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{ +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{ +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{ +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +\def\CHAPFplain{ +\global\let\chapmacro=\chfplain +\global\let\unnumbchapmacro=\unnchfplain} + +\def\chfplain #1#2{% + \pchapsepmacro + {% + \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #2\enspace #1}% + }% + \bigskip + \penalty5000 +} + +\def\unnchfplain #1{% +\pchapsepmacro % +{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\penalty 10000 % +} +\CHAPFplain % The default + +\def\unnchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\penalty 10000 % +} + +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} + +\def\CHAPFopen{ +\global\let\chapmacro=\chfopen +\global\let\unnumbchapmacro=\unnchfopen} + +% Parameter controlling skip before section headings. + +\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt +\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} + +\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt +\def\secheadingbreak{\dobreak \secheadingskip {-1000}} + +% @paragraphindent is defined for the Info formatting commands only. +\let\paragraphindent=\comment + +% Section fonts are the base font at magstep2, which produces +% a size a bit more than 14 points in the default situation. + +\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} +\def\plainsecheading #1{\secheadingi {#1}} +\def\secheadingi #1{{\advance \secheadingskip by \parskip % +\secheadingbreak}% +{\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}% +\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } + + +% Subsection fonts are the base font at magstep1, +% which produces a size of 12 points. + +\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} +\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % +\subsecheadingbreak}% +{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}% +\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } + +\def\subsubsecfonts{\subsecfonts} % Maybe this should change: + % Perhaps make sssec fonts scaled + % magstep half +\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} +\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % +\subsecheadingbreak}% +{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}% +\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} + + +\message{toc printing,} + +% Finish up the main text and prepare to read what we've written +% to \contentsfile. + +\newskip\contentsrightmargin \contentsrightmargin=1in +\def\startcontents#1{% + \pagealignmacro + \immediate\closeout \contentsfile + \ifnum \pageno>0 + \pageno = -1 % Request roman numbered pages. + \fi + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \unnumbchapmacro{#1}\def\thischapter{}% + \begingroup % Set up to handle contents files properly. + \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 + \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. +} + + +% Normal (long) toc. +\outer\def\contents{% + \startcontents{\putwordTableofContents}% + \input \jobname.toc + \endgroup + \vfill \eject +} + +% And just the chapters. +\outer\def\summarycontents{% + \startcontents{\putwordShortContents}% + % + \let\chapentry = \shortchapentry + \let\unnumbchapentry = \shortunnumberedentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl + \rm + \advance\baselineskip by 1pt % Open it up a little. + \def\secentry ##1##2##3##4{} + \def\unnumbsecentry ##1##2{} + \def\subsecentry ##1##2##3##4##5{} + \def\unnumbsubsecentry ##1##2{} + \def\subsubsecentry ##1##2##3##4##5##6{} + \def\unnumbsubsubsecentry ##1##2{} + \input \jobname.toc + \endgroup + \vfill \eject +} +\let\shortcontents = \summarycontents + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Chapter-level things, for both the long and short contents. +\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} + +% See comments in \dochapentry re vbox and related settings +\def\shortchapentry#1#2#3{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}% +} + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter. +% We could simplify the code here by writing out an \appendixentry +% command in the toc file for appendices, instead of using \chapentry +% for both, but it doesn't seem worth it. +\setbox0 = \hbox{\shortcontrm \putwordAppendix } +\newdimen\shortappendixwidth \shortappendixwidth = \wd0 + +\def\shortchaplabel#1{% + % We typeset #1 in a box of constant width, regardless of the text of + % #1, so the chapter titles will come out aligned. + \setbox0 = \hbox{#1}% + \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi + % + % This space should be plenty, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in in \shortchapentry above.) + \advance\dimen0 by 1.1em + \hbox to \dimen0{#1\hfil}% +} + +\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} +\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}} + +% Sections. +\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} +\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} + +% Subsections. +\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} +\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} + +% And subsubsections. +\def\subsubsecentry#1#2#3#4#5#6{% + \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} +\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} + + +% This parameter controls the indentation of the various levels. +\newdimen\tocindent \tocindent = 3pc + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we would want to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip\baselineskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno{#2}}% + \endgroup + \nobreak\vskip .25\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno{#2}}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno{#2}}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno{#2}}% +\endgroup} + +% Final typesetting of a toc entry; we use the same \entry macro as for +% the index entries, but we want to suppress hyphenation here. (We +% can't do that in the \entry macro, since index entries might consist +% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) +% +% \turnoffactive is for the sake of @" used for umlauts. +\def\tocentry#1#2{\begingroup + \hyphenpenalty = 10000 + \entry{\turnoffactive #1}{\turnoffactive #2}% +\endgroup} + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\let\subsecentryfonts = \textfonts +\let\subsubsecentryfonts = \textfonts + + +\message{environments,} + +% Since these characters are used in examples, it should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% Furthermore, these definitions must come after we define our fonts. +\newbox\dblarrowbox \newbox\longdblarrowbox +\newbox\pushcharbox \newbox\bullbox +\newbox\equivbox \newbox\errorbox + +\let\ptexequiv = \equiv + +%{\tentt +%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} +%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} +%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} +%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} +% Adapted from the manmac format (p.420 of TeXbook) +%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex +% depth .1ex\hfil} +%} + +\def\point{$\star$} + +\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} + +\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% Adapted from the TeXbook's \boxit. +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} + +\global\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{ + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} + +% The @error{} command. +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @tex ... @end tex escapes into raw Tex temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain tex @ character. + +\def\tex{\begingroup +\catcode `\\=0 \catcode `\{=1 \catcode `\}=2 +\catcode `\$=3 \catcode `\&=4 \catcode `\#=6 +\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie +\catcode `\%=14 +\catcode 43=12 +\catcode`\"=12 +\catcode`\==12 +\catcode`\|=12 +\catcode`\<=12 +\catcode`\>=12 +\escapechar=`\\ +% +\let\~=\ptextilde +\let\{=\ptexlbrace +\let\}=\ptexrbrace +\let\.=\ptexdot +\let\*=\ptexstar +\let\dots=\ptexdots +\def\@{@}% +\let\bullet=\ptexbullet +\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl +\let\L=\ptexL +% +\let\Etex=\endgroup} + +% Define @lisp ... @endlisp. +% @lisp does a \begingroup so it can rebind things, +% including the definition of @endlisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% Make each space character in the input produce a normal interword +% space in the output. Don't allow a line break at this space, as this +% is used only in environments like @example, where each line of input +% should produce a line of output anyway. +% +{\obeyspaces % +\gdef\sepspaces{\obeyspaces\let =\tie}} + +% Define \obeyedspace to be our active space, whatever it is. This is +% for use in \parsearg. +{\sepspaces% +\global\let\obeyedspace= } + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip +% +\def\aboveenvbreak{{\advance\envskipamount by \parskip +\endgraf \ifdim\lastskip<\envskipamount +\removelastskip \penalty-50 \vskip\envskipamount \fi}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. +\let\nonarrowing=\relax + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \cartouche: draw rectangle w/rounded corners around argument +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\long\def\cartouche{% +\begingroup + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt %we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18pt % allow for 3pt kerns on either +% side, and for 6pt waste from +% each corner char + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing=\comment + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \hsize=\cartinner + \kern3pt + \begingroup + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip +\def\Ecartouche{% + \endgroup + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup +\endgroup +}} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\def\nonfillstart{% + \aboveenvbreak + \inENV % This group ends at the end of the body + \hfuzz = 12pt % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \singlespace + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + \parindent = 0pt + \emergencystretch = 0pt % don't try to avoid overfull boxes + % @cartouche defines \nonarrowing to inhibit narrowing + % at next level down. + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \let\exdent=\nofillexdent + \let\nonarrowing=\relax + \fi +} + +% To ending an @example-like environment, we first end the paragraph +% (via \afterenvbreak's vertical glue), and then the group. That way we +% keep the zero \parskip that the environments set -- \parskip glue +% will be inserted at the beginning of the next paragraph in the +% document, after the environment. +% +\def\nonfillfinish{\afterenvbreak\endgroup}% + +% This macro is +\def\lisp{\begingroup + \nonfillstart + \let\Elisp = \nonfillfinish + \tt + \rawbackslash % have \ input char produce \ char from current font + \gobble +} + +% Define the \E... control sequence only if we are inside the +% environment, so the error checking in \end will work. +% +% We must call \lisp last in the definition, since it reads the +% return following the @example (or whatever) command. +% +\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} +\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp} +\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp} + +% @smallexample and @smalllisp. This is not used unless the @smallbook +% command is given. Originally contributed by Pavel@xerox. +% +\def\smalllispx{\begingroup + \nonfillstart + \let\Esmalllisp = \nonfillfinish + \let\Esmallexample = \nonfillfinish + % + % Smaller interline space and fonts for small examples. + \setleading{10pt}% + \indexfonts \tt + \rawbackslash % make \ output the \ character from the current font (tt) + \gobble +} + +% This is @display; same as @lisp except use roman font. +% +\def\display{\begingroup + \nonfillstart + \let\Edisplay = \nonfillfinish + \gobble +} + +% This is @format; same as @display except don't narrow margins. +% +\def\format{\begingroup + \let\nonarrowing = t + \nonfillstart + \let\Eformat = \nonfillfinish + \gobble +} + +% @flushleft (same as @format) and @flushright. +% +\def\flushleft{\begingroup + \let\nonarrowing = t + \nonfillstart + \let\Eflushleft = \nonfillfinish + \gobble +} +\def\flushright{\begingroup + \let\nonarrowing = t + \nonfillstart + \let\Eflushright = \nonfillfinish + \advance\leftskip by 0pt plus 1fill + \gobble} + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. +% +\def\quotation{% + \begingroup\inENV %This group ends at the end of the @quotation body + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \singlespace + \parindent=0pt + % We have retained a nonzero parskip for the environment, since we're + % doing normal filling. So to avoid extra space below the environment... + \def\Equotation{\parskip = 0pt \nonfillfinish}% + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \advance\rightskip by \lispnarrowing + \exdentamount = \lispnarrowing + \let\nonarrowing = \relax + \fi +} + +\message{defuns,} +% Define formatter for defuns +% First, allow user to change definition object font (\df) internally +\def\setdeffont #1 {\csname DEF#1\endcsname} + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deftypemargin \deftypemargin=12pt +\newskip\deflastargmargin \deflastargmargin=18pt + +\newcount\parencount +% define \functionparens, which makes ( and ) and & do special things. +% \functionparens affects the group it is contained in. +\def\activeparens{% +\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active +\catcode`\[=\active \catcode`\]=\active} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +\global\let(=\lparen \global\let)=\rparen +\global\let[=\lbrack \global\let]=\rbrack + +\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } +\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} +% This is used to turn on special parens +% but make & act ordinary (given that it's active). +\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} + +% Definitions of (, ) and & used in args for functions. +% This is the definition of ( outside of all parentheses. +\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested % +\global\advance\parencount by 1 } +% +% This is the definition of ( when already inside a level of parens. +\gdef\opnested{\char`\(\global\advance\parencount by 1 } +% +\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. +% also in that case restore the outer-level definition of (. +\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi +\global\advance \parencount by -1 } +% If we encounter &foo, then turn on ()-hacking afterwards +\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } +% +\gdef\normalparens{\boldbrax\let&=\ampnr} +} % End of definition inside \activeparens +%% These parens (in \boldbrax) actually are a little bolder than the +%% contained text. This is especially needed for [ and ] +\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&} +\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} + +% First, defname, which formats the header line itself. +% #1 should be the function name. +% #2 should be the type of definition, such as "Function". + +\def\defname #1#2{% +% Get the values of \leftskip and \rightskip as they were +% outside the @def... +\dimen2=\leftskip +\advance\dimen2 by -\defbodyindent +\dimen3=\rightskip +\advance\dimen3 by -\defbodyindent +\noindent % +\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% +\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line +\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations +\parshape 2 0in \dimen0 \defargsindent \dimen1 % +% Now output arg 2 ("Function" or some such) +% ending at \deftypemargin from the right margin, +% but stuck inside a box of width 0 so it does not interfere with linebreaking +{% Adjust \hsize to exclude the ambient margins, +% so that \rightline will obey them. +\advance \hsize by -\dimen2 \advance \hsize by -\dimen3 +\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}% +% Make all lines underfull and no complaints: +\tolerance=10000 \hbadness=10000 +\advance\leftskip by -\defbodyindent +\exdentamount=\defbodyindent +{\df #1}\enskip % Generate function name +} + +% Actually process the body of a definition +% #1 should be the terminating control sequence, such as \Edefun. +% #2 should be the "another name" control sequence, such as \defunx. +% #3 should be the control sequence that actually processes the header, +% such as \defunheader. + +\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2{\begingroup\obeylines\activeparens\spacesplit#3}% +\parindent=0in +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup % +\catcode 61=\active % 61 is `=' +\obeylines\activeparens\spacesplit#3} + +\def\defmethparsebody #1#2#3#4 {\begingroup\inENV % +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% +\parindent=0in +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} + +\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2##1 ##2 {\def#4{##1}% +\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% +\parindent=0in +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup\obeylines\activeparens\spacesplit{#3{#5}}} + +% These parsing functions are similar to the preceding ones +% except that they do not make parens into active characters. +% These are used for "variables" since they have no arguments. + +\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2{\begingroup\obeylines\spacesplit#3}% +\parindent=0in +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup % +\catcode 61=\active % +\obeylines\spacesplit#3} + +% This is used for \def{tp,vr}parsebody. It could probably be used for +% some of the others, too, with some judicious conditionals. +% +\def\parsebodycommon#1#2#3{% + \begingroup\inENV % + \medbreak % + % Define the end token that this defining construct specifies + % so that it will exit this group. + \def#1{\endgraf\endgroup\medbreak}% + \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% + \parindent=0in + \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent + \exdentamount=\defbodyindent + \begingroup\obeylines +} + +\def\defvrparsebody#1#2#3#4 {% + \parsebodycommon{#1}{#2}{#3}% + \spacesplit{#3{#4}}% +} + +% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the +% type is just `struct', because we lose the braces in `{struct +% termios}' when \spacesplit reads its undelimited argument. Sigh. +% \let\deftpparsebody=\defvrparsebody +% +% So, to get around this, we put \empty in with the type name. That +% way, TeX won't find exactly `{...}' as an undelimited argument, and +% won't strip off the braces. +% +\def\deftpparsebody #1#2#3#4 {% + \parsebodycommon{#1}{#2}{#3}% + \spacesplit{\parsetpheaderline{#3{#4}}}\empty +} + +% Fine, but then we have to eventually remove the \empty *and* the +% braces (if any). That's what this does, putting the result in \tptemp. +% +\def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}% + +% After \spacesplit has done its work, this is called -- #1 is the final +% thing to call, #2 the type name (which starts with \empty), and #3 +% (which might be empty) the arguments. +% +\def\parsetpheaderline#1#2#3{% + \removeemptybraces#2\relax + #1{\tptemp}{#3}% +}% + +\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2##1 ##2 {\def#4{##1}% +\begingroup\obeylines\spacesplit{#3{##2}}}% +\parindent=0in +\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup\obeylines\spacesplit{#3{#5}}} + +% Split up #2 at the first space token. +% call #1 with two arguments: +% the first is all of #2 before the space token, +% the second is all of #2 after that space token. +% If #2 contains no space token, all of it is passed as the first arg +% and the second is passed as empty. + +{\obeylines +\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% +\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% +\ifx\relax #3% +#1{#2}{}\else #1{#2}{#3#4}\fi}} + +% So much for the things common to all kinds of definitions. + +% Define @defun. + +% First, define the processing that is wanted for arguments of \defun +% Use this to expand the args and terminate the paragraph they make up + +\def\defunargs #1{\functionparens \sl +% Expand, preventing hyphenation at `-' chars. +% Note that groups don't affect changes in \hyphenchar. +\hyphenchar\tensl=0 +#1% +\hyphenchar\tensl=45 +\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi% +\interlinepenalty=10000 +\advance\rightskip by 0pt plus 1fil +\endgraf\penalty 10000\vskip -\parskip\penalty 10000% +} + +\def\deftypefunargs #1{% +% Expand, preventing hyphenation at `-' chars. +% Note that groups don't affect changes in \hyphenchar. +% Use \boldbraxnoamp, not \functionparens, so that & is not special. +\boldbraxnoamp +\tclose{#1}% avoid \code because of side effects on active chars +\interlinepenalty=10000 +\advance\rightskip by 0pt plus 1fil +\endgraf\penalty 10000\vskip -\parskip\penalty 10000% +} + +% Do complete processing of one @defun or @defunx line already parsed. + +% @deffn Command forward-char nchars + +\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} + +\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% +\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defun == @deffn Function + +\def\defun{\defparsebody\Edefun\defunx\defunheader} + +\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index +\begingroup\defname {#1}{Function}% +\defunargs {#2}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @deftypefun int foobar (int @var{foo}, float @var{bar}) + +\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} + +% #1 is the data type. #2 is the name and args. +\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} +% #1 is the data type, #2 the name, #3 the args. +\def\deftypefunheaderx #1#2 #3\relax{% +\doind {fn}{\code{#2}}% Make entry in function index +\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}% +\deftypefunargs {#3}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) + +\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} + +% \defheaderxcond#1\relax$$$ +% puts #1 in @code, followed by a space, but does nothing if #1 is null. +\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi} + +% #1 is the classification. #2 is the data type. #3 is the name and args. +\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} +% #1 is the classification, #2 the data type, #3 the name, #4 the args. +\def\deftypefnheaderx #1#2#3 #4\relax{% +\doind {fn}{\code{#3}}% Make entry in function index +\begingroup +\normalparens % notably, turn off `&' magic, which prevents +% at least some C++ text from working +\defname {\defheaderxcond#2\relax$$$#3}{#1}% +\deftypefunargs {#4}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defmac == @deffn Macro + +\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} + +\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index +\begingroup\defname {#1}{Macro}% +\defunargs {#2}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defspec == @deffn Special Form + +\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} + +\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index +\begingroup\defname {#1}{Special Form}% +\defunargs {#2}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% This definition is run if you use @defunx +% anywhere other than immediately after a @defun or @defunx. + +\def\deffnx #1 {\errmessage{@deffnx in invalid context}} +\def\defunx #1 {\errmessage{@defunx in invalid context}} +\def\defmacx #1 {\errmessage{@defmacx in invalid context}} +\def\defspecx #1 {\errmessage{@defspecx in invalid context}} +\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} +\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} + +% @defmethod, and so on + +% @defop {Funny Method} foo-class frobnicate argument + +\def\defop #1 {\def\defoptype{#1}% +\defopparsebody\Edefop\defopx\defopheader\defoptype} + +\def\defopheader #1#2#3{% +\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index +\begingroup\defname {#2}{\defoptype{} on #1}% +\defunargs {#3}\endgroup % +} + +% @defmethod == @defop Method + +\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} + +\def\defmethodheader #1#2#3{% +\dosubind {fn}{\code{#2}}{on #1}% entry in function index +\begingroup\defname {#2}{Method on #1}% +\defunargs {#3}\endgroup % +} + +% @defcv {Class Option} foo-class foo-flag + +\def\defcv #1 {\def\defcvtype{#1}% +\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} + +\def\defcvarheader #1#2#3{% +\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index +\begingroup\defname {#2}{\defcvtype{} of #1}% +\defvarargs {#3}\endgroup % +} + +% @defivar == @defcv {Instance Variable} + +\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} + +\def\defivarheader #1#2#3{% +\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index +\begingroup\defname {#2}{Instance Variable of #1}% +\defvarargs {#3}\endgroup % +} + +% These definitions are run if you use @defmethodx, etc., +% anywhere other than immediately after a @defmethod, etc. + +\def\defopx #1 {\errmessage{@defopx in invalid context}} +\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}} +\def\defcvx #1 {\errmessage{@defcvx in invalid context}} +\def\defivarx #1 {\errmessage{@defivarx in invalid context}} + +% Now @defvar + +% First, define the processing that is wanted for arguments of @defvar. +% This is actually simple: just print them in roman. +% This must expand the args and terminate the paragraph they make up +\def\defvarargs #1{\normalparens #1% +\interlinepenalty=10000 +\endgraf\penalty 10000\vskip -\parskip\penalty 10000} + +% @defvr Counter foo-count + +\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} + +\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% +\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} + +% @defvar == @defvr Variable + +\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} + +\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index +\begingroup\defname {#1}{Variable}% +\defvarargs {#2}\endgroup % +} + +% @defopt == @defvr {User Option} + +\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} + +\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index +\begingroup\defname {#1}{User Option}% +\defvarargs {#2}\endgroup % +} + +% @deftypevar int foobar + +\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} + +% #1 is the data type. #2 is the name. +\def\deftypevarheader #1#2{% +\doind {vr}{\code{#2}}% Make entry in variables index +\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% +\interlinepenalty=10000 +\endgraf\penalty 10000\vskip -\parskip\penalty 10000 +\endgroup} + +% @deftypevr {Global Flag} int enable + +\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} + +\def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}% +\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} +\interlinepenalty=10000 +\endgraf\penalty 10000\vskip -\parskip\penalty 10000 +\endgroup} + +% This definition is run if you use @defvarx +% anywhere other than immediately after a @defvar or @defvarx. + +\def\defvrx #1 {\errmessage{@defvrx in invalid context}} +\def\defvarx #1 {\errmessage{@defvarx in invalid context}} +\def\defoptx #1 {\errmessage{@defoptx in invalid context}} +\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}} +\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}} + +% Now define @deftp +% Args are printed in bold, a slight difference from @defvar. + +\def\deftpargs #1{\bf \defvarargs{#1}} + +% @deftp Class window height width ... + +\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} + +\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% +\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} + +% This definition is run if you use @deftpx, etc +% anywhere other than immediately after a @deftp, etc. + +\def\deftpx #1 {\errmessage{@deftpx in invalid context}} + +\message{cross reference,} +% Define cross-reference macros +\newwrite \auxfile + +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% \setref{foo} defines a cross-reference point named foo. + +\def\setref#1{% +\dosetq{#1-title}{Ytitle}% +\dosetq{#1-pg}{Ypagenumber}% +\dosetq{#1-snt}{Ysectionnumberandtype}} + +\def\unnumbsetref#1{% +\dosetq{#1-title}{Ytitle}% +\dosetq{#1-pg}{Ypagenumber}% +\dosetq{#1-snt}{Ynothing}} + +\def\appendixsetref#1{% +\dosetq{#1-title}{Ytitle}% +\dosetq{#1-pg}{Ypagenumber}% +\dosetq{#1-snt}{Yappendixletterandtype}} + +% \xref, \pxref, and \ref generate cross-references to specified points. +% For \xrefX, #1 is the node name, #2 the name of the Info +% cross-reference, #3 the printed node name, #4 the name of the Info +% file, #5 the name of the printed manual. All but the node name can be +% omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \def\printedmanual{\ignorespaces #5}% + \def\printednodename{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual}% + \setbox0=\hbox{\printednodename}% + \ifdim \wd0 = 0pt + % No printed node name was explicitly given. + \ifx\SETxref-automatic-section-title\thisisundefined + % Use the node name inside the square brackets. + \def\printednodename{\ignorespaces #1}% + \else + % Use the actual chapter/section title appear inside + % the square brackets. Use the real section title if we have it. + \ifdim \wd1>0pt% + % It is in another manual, so we don't have it. + \def\printednodename{\ignorespaces #1}% + \else + \ifhavexrefs + % We know the real title if we have the xref values. + \def\printednodename{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printednodename{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordsection{} ``\printednodename'' in \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive \refx{#1-snt}{}}% + \space [\printednodename],\space + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi +\endgroup} + +% \dosetq is the interface for calls from other macros + +% Use \turnoffactive so that punctuation chars such as underscore +% work in node names. +\def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% +\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% +\next}} + +% \internalsetq {foo}{page} expands into +% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} +% When the aux file is read, ' is the escape character + +\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} + +% Things to be expanded by \internalsetq + +\def\Ypagenumber{\folio} + +\def\Ytitle{\thissection} + +\def\Ynothing{} + +\def\Ysectionnumberandtype{% +\ifnum\secno=0 \putwordChapter\xreftie\the\chapno % +\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % +\else \ifnum \subsubsecno=0 % +\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % +\else % +\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % +\fi \fi \fi } + +\def\Yappendixletterandtype{% +\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% +\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % +\else \ifnum \subsubsecno=0 % +\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % +\else % +\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % +\fi \fi \fi } + +\gdef\xreftie{'tie} + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Non-3.0. +\else + \def\linenumber{\the\inputlineno:\space} +\fi + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. + +\def\refx#1#2{% + \expandafter\ifx\csname X#1\endcsname\relax + % If not defined, say something at least. + $\langle$un\-de\-fined$\rangle$% + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \else + % It's defined, so just use it. + \csname X#1\endcsname + \fi + #2% Output the suffix in any case. +} + +% Read the last existing aux file, if any. No error if none exists. + +% This is the macro invoked by entries in the aux file. +\def\xrdef #1#2{ +{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} + +\def\readauxfile{% +\begingroup +\catcode `\^^@=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\^^C=\other +\catcode `\^^D=\other +\catcode `\^^E=\other +\catcode `\^^F=\other +\catcode `\^^G=\other +\catcode `\^^H=\other +\catcode `\ =\other +\catcode `\^^L=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode `\=\other +\catcode 26=\other +\catcode `\^^[=\other +\catcode `\^^\=\other +\catcode `\^^]=\other +\catcode `\^^^=\other +\catcode `\^^_=\other +\catcode `\@=\other +\catcode `\^=\other +\catcode `\~=\other +\catcode `\[=\other +\catcode `\]=\other +\catcode`\"=\other +\catcode`\_=\other +\catcode`\|=\other +\catcode`\<=\other +\catcode`\>=\other +\catcode `\$=\other +\catcode `\#=\other +\catcode `\&=\other +% `\+ does not work, so use 43. +\catcode 43=\other +% Make the characters 128-255 be printing characters +{% + \count 1=128 + \def\loop{% + \catcode\count 1=\other + \advance\count 1 by 1 + \ifnum \count 1<256 \loop \fi + }% +}% +% the aux file uses ' as the escape. +% Turn off \ as an escape so we do not lose on +% entries which were dumped with control sequences in their names. +% For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ +% Reference to such entries still does not work the way one would wish, +% but at least they do not bomb out when the aux file is read in. +\catcode `\{=1 \catcode `\}=2 +\catcode `\%=\other +\catcode `\'=0 +\catcode`\^=7 % to make ^^e4 etc usable in xref tags +\catcode `\\=\other +\openin 1 \jobname.aux +\ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue +\global\warnedobstrue +\fi +% Open the new aux file. Tex will close it automatically at exit. +\openout \auxfile=\jobname.aux +\endgroup} + + +% Footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for info output only.. +\let\footnotestyle=\comment + +\let\ptexfootnote=\footnote + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \footnotezzz +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +\long\gdef\footnotezzz#1{\insert\footins{% + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + % Hang the footnote text off the number. + \hang + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + #1\strut}% +} + +}%end \catcode `\@=11 + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +\def\setleading#1{% + \normalbaselineskip = #1\relax + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt} + + +% End of control word definitions. + +\message{and turning on texinfo input format.} + +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% Set some numeric style parameters, for 8.5 x 11 format. + +%\hsize = 6.5in +\newdimen\defaultparindent \defaultparindent = 15pt +\parindent = \defaultparindent +\parskip 18pt plus 1pt +\setleading{15pt} +\advance\topskip by 1.2cm + +% Prevent underfull vbox error messages. +\vbadness=10000 + +% Following George Bush, just get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. This makes it come to about 9pt for the 8.5x11 format. +% +\ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% +\else + \emergencystretch = \hsize + \divide\emergencystretch by 45 +\fi + +% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) +\def\smallbook{ + +% These values for secheadingskip and subsecheadingskip are +% experiments. RJC 7 Aug 1992 +\global\secheadingskip = 17pt plus 6pt minus 3pt +\global\subsecheadingskip = 14pt plus 6pt minus 3pt + +\global\lispnarrowing = 0.3in +\setleading{12pt} +\advance\topskip by -1cm +\global\parskip 3pt plus 1pt +\global\hsize = 5in +\global\vsize=7.5in +\global\tolerance=700 +\global\hfuzz=1pt +\global\contentsrightmargin=0pt +\global\deftypemargin=0pt +\global\defbodyindent=.5cm + +\global\pagewidth=\hsize +\global\pageheight=\vsize + +\global\let\smalllisp=\smalllispx +\global\let\smallexample=\smalllispx +\global\def\Esmallexample{\Esmalllisp} +} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{ +\global\tolerance=700 +\global\hfuzz=1pt +\setleading{12pt} +\global\parskip 15pt plus 1pt + +\global\vsize= 53\baselineskip +\advance\vsize by \topskip +%\global\hsize= 5.85in % A4 wide 10pt +\global\hsize= 6.5in +\global\outerhsize=\hsize +\global\advance\outerhsize by 0.5in +\global\outervsize=\vsize +\global\advance\outervsize by 0.6in + +\global\pagewidth=\hsize +\global\pageheight=\vsize +} + +% Allow control of the text dimensions. Parameters in order: textheight; +% textwidth; \voffset; \hoffset (!); binding offset. All require a dimension; +% header is additional; added length extends the bottom of the page. + +\def\changepagesizes#1#2#3#4#5{ + \global\vsize= #1 + \advance\vsize by \topskip + \global\voffset= #3 + \global\hsize= #2 + \global\outerhsize=\hsize + \global\advance\outerhsize by 0.5in + \global\outervsize=\vsize + \global\advance\outervsize by 0.6in + \global\pagewidth=\hsize + \global\pageheight=\vsize + \global\normaloffset= #4 + \global\bindingoffset= #5} + +% This layout is compatible with Latex on A4 paper. + +\def\afourlatex{\changepagesizes{22cm}{15cm}{7mm}{4.6mm}{5mm}} + +% Use @afourwide to print on European A4 paper in wide format. +\def\afourwide{\afourpaper +\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}} + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other +\catcode`\~=\other +\catcode`\^=\other +\catcode`\_=\other +\catcode`\|=\other +\catcode`\<=\other +\catcode`\>=\other +\catcode`\+=\other +\def\normaldoublequote{"} +\def\normaltilde{~} +\def\normalcaret{^} +\def\normalunderscore{_} +\def\normalverticalbar{|} +\def\normalless{<} +\def\normalgreater{>} +\def\normalplus{+} + +% This macro is used to make a character print one way in ttfont +% where it can probably just be output, and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=\active +\def\activedoublequote{{\tt \char '042}} +\let"=\activedoublequote +\catcode`\~=\active +\def~{{\tt \char '176}} +\chardef\hat=`\^ +\catcode`\^=\active +\def\auxhat{\def^{'hat}} +\def^{{\tt \hat}} + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +% Subroutine for the previous macro. +\def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}} + +% \lvvmode is equivalent in function to \leavevmode. +% Using \leavevmode runs into trouble when written out to +% an index file due to the expansion of \leavevmode into ``\unhbox +% \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our +% magic tricks with @. +\def\lvvmode{\vbox to 0pt{}} + +\catcode`\|=\active +\def|{{\tt \char '174}} +\chardef \less=`\< +\catcode`\<=\active +\def<{{\tt \less}} +\chardef \gtr=`\> +\catcode`\>=\active +\def>{{\tt \gtr}} +\catcode`\+=\active +\def+{{\tt \char 43}} +%\catcode 27=\active +%\def^^[{$\diamondsuit$} + +% Set up an active definition for =, but don't enable it most of the time. +{\catcode`\==\active +\global\def={{\tt \char 61}}} + +\catcode`+=\active +\catcode`\_=\active + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +\catcode`\@=0 + +% \rawbackslashxx output one backslash character in current font +\global\chardef\rawbackslashxx=`\\ +%{\catcode`\\=\other +%@gdef@rawbackslashxx{\}} + +% \rawbackslash redefines \ as input to do \rawbackslashxx. +{\catcode`\\=\active +@gdef@rawbackslash{@let\=@rawbackslashxx }} + +% \normalbackslash outputs one backslash in fixed width font. +\def\normalbackslash{{\tt\rawbackslashxx}} + +% Say @foo, not \foo, in error messages. +\escapechar=`\@ + +% \catcode 17=0 % Define control-q +\catcode`\\=\active + +% Used sometimes to turn off (effectively) the active characters +% even after parsing them. +@def@turnoffactive{@let"=@normaldoublequote +@let\=@realbackslash +@let~=@normaltilde +@let^=@normalcaret +@let_=@normalunderscore +@let|=@normalverticalbar +@let<=@normalless +@let>=@normalgreater +@let+=@normalplus} + +@def@normalturnoffactive{@let"=@normaldoublequote +@let\=@normalbackslash +@let~=@normaltilde +@let^=@normalcaret +@let_=@normalunderscore +@let|=@normalverticalbar +@let<=@normalless +@let>=@normalgreater +@let+=@normalplus} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\{ in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also back turn on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active @catcode`@_=@active} + +%% These look ok in all fonts, so just make them not special. The @rm below +%% makes sure that the current font starts out as the newly loaded cmr10 +@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other + +@textfonts +@rm + +@c Local variables: +@c page-delimiter: "^\\\\message" +@c End: diff --git a/src/apps/bin/sharutils-4.2.1/doc/unshar.1 b/src/apps/bin/sharutils-4.2.1/doc/unshar.1 new file mode 100644 index 0000000000..7d1f57d99f --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/unshar.1 @@ -0,0 +1,56 @@ +.TH UNSHAR 1 "September 10, 1995" +.SH NAME +unshar \- unpack a shar file +.SH SYNOPSIS +unshar [ options ] [ file ... ] +.SH DESCRIPTION +.PP +Unshar scans mail messages looking for the start of a shell archive. It +then passes the archive through a copy of the shell to unpack it. It +will accept multiple files. If no files are given, standard input is used. +.SH OPTIONS +.PP +Options have a one letter version starting with \- or a long version starting +with \-\-. The exception is \f2\-\-help\f1 and \f2\-\-version\f1, +which does not have a short version. +.IP "\f2\-\-version\f1" +Print the version number of the program on standard output, +then immediately exits. +.IP "\f2\-\-help\f1" +Print a help summary on standard output, then immediately exits. +.IP "\f2\-d\f1 DIRECTORY \f2\-\-directory=\f1DIRECTORY" +Change directory to DIRECTORY before unpacking any files. +.IP "\f2\-c\f1 \f2\-\-overwrite\f1" +Passed as an option to the shar file. Many shell archive scripts +(including those produced by `shar' 3.40 and newer) accepts a \f2\-c\f1 +argument to indicate that existing files should be overwritten. +.IP "\f2\-e\f1 \f2\-\-exit-0\f1" +This option exists mainly for people who collect many shell +archives into a single mail folder. With this option, `unshar' +isolates each different shell archive from the others which have +been put in the same file, unpacking each in turn, from the +beginning of the file towards its end. Its proper operation +relies on the fact that many shar files are terminated by a +`exit 0' at the beginning of a line. + +Option \f2\-e\f1 is internally equivalent to \f2\-E\f1 "exit 0". +.IP "\f2\-E\f1 STRING \f2\-\-split-at=\f1STRING" +This option works like \f2\-e\f1, but it allows you to specify the +string that separates archives if `exit 0' isn't appropriate. + +For example, noticing that most `.signatures' have a `\-\-' on a +line right before them, one can sometimes use `\f2\-\-split-at\f1=\-\-' for +splitting shell archives which lack the `exit 0' line at end. The +signature will then be skipped altogether with the headers of the +following message. +.IP "\f2\-f\f1 \f2\-\-force\f1" +The same as \f2\-c\f1. +.SH SEE ALSO +shar(1) +.SH DIAGNOSTICS +Any message from the shell may be displayed. +.SH AUTHORS +The shar and unshar programs is the collective work of many authors. +Many people contributed by reporting problems, suggesting +various improvements or submitting actual code. A list of +these people is in the THANKS file in the sharutils distribution. diff --git a/src/apps/bin/sharutils-4.2.1/doc/uuencode.1 b/src/apps/bin/sharutils-4.2.1/doc/uuencode.1 new file mode 100644 index 0000000000..90767a786e --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/uuencode.1 @@ -0,0 +1,129 @@ +'.\" Copyright (c) 1980, 1990 The Regents of the University of California. +'.\" 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. Redistributions in binary form must reproduce the above copyright +'.\" notice, this list of conditions and the following disclaimer in the +'.\" documentation and/or other materials provided with the distribution. +'.\" 3. All advertising materials mentioning features or use of this software +'.\" must display the following acknowledgement: +'.\" This product includes software developed by the University of +'.\" California, Berkeley and its contributors. +'.\" 4. Neither the name of the University nor the names of its contributors +'.\" may be used to endorse or promote products derived from this software +'.\" without specific prior written permission. +'.\" +'.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. +'.\" +'.\" Modified from +'.\" @(#)uuencode.1 6.9 (Berkeley) 4/23/91 +'.\" +.TH uuencode 1 +.SH NAME +uuencode \- encode a binary file +.PP +uudecode \- decode a file created by uuencode +.SH SYNOPSIS +.B uuencode +[\-m] [ file ] name +.PP +.B uudecode +[-o outfile] [ file ]... +.SH DESCRIPTION +.I Uuencode +and +.I uudecode +are used to transmit binary files over transmission mediums +that do not support other than simple +ASCII +data. +.PP +.I Uuencode +reads +.I file +(or by default the standard input) and writes an encoded version +to the standard output. +The encoding uses only printing +ASCII +characters and includes the +mode of the file and the operand +.I name +for use by +.I uudecode. +If +.I name +is +.I /dev/stdout +the result will be written to standard output. By default the standard +UU encoding format will be used. If the option +.I \-m +is given on the command line +.B base64 +encoding is used instead. +.PP +.I Uudecode +transforms +uuencoded +.I files +(or by default, the standard input) into the original form. +The resulting file is named +.I name +(or +.I outfile +if the \-o option is given) +and will have the mode of the original file except that setuid +and execute bits are not retained. If +.I outfile +or +.I name +is /dev/stdout the result will be written to standard output. +.I Uudecode +ignores any leading and trailing lines. The program can automatically decide +which of the both supported encoding schemes are used. +.SH EXAMPLES +The following example packages up a source tree, compresses it, +uuencodes it and mails it to a user on another system. +When +.I uudecode +is run on the target system, the file ``src_tree.tar.Z'' will be +created which may then be uncompressed and extracted into the original +tree. +.PP +.IP +.NF +tar cf \- src_tree \&| compress \&| +uuencode src_tree.tar.Z \&| mail sys1!sys2!user +.FI +.LP +.SH SEE ALSO +compress(1), mail(1), uucp(1), uuencode(5) +.SH STANDARDS +This implementation is compliant with P1003.2b/D11. +.SH BUGS +If more than one file is given to +.I uudecode +and the \-o option is given or more than one +.I name +in the encoded files are the same the result is probably not what is expected. +.PP +The encoded form of the file is expanded by 37% for UU encoding and by 35% +for base64 encoding (3 bytes become 4 plus control information). +.SH HISTORY +The +.I uuencode +command appeared in +BSD 4.0. diff --git a/src/apps/bin/sharutils-4.2.1/doc/uuencode.5 b/src/apps/bin/sharutils-4.2.1/doc/uuencode.5 new file mode 100644 index 0000000000..7aa375ae2d --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/uuencode.5 @@ -0,0 +1,93 @@ +'.\" Copyright (c) 1989, 1991 The Regents of the University of California. +'.\" 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. Redistributions in binary form must reproduce the above copyright +'.\" notice, this list of conditions and the following disclaimer in the +'.\" documentation and/or other materials provided with the distribution. +'.\" 3. All advertising materials mentioning features or use of this software +'.\" must display the following acknowledgement: +'.\" This product includes software developed by the University of +'.\" California, Berkeley and its contributors. +'.\" 4. Neither the name of the University nor the names of its contributors +'.\" may be used to endorse or promote products derived from this software +'.\" without specific prior written permission. +'.\" +'.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. +'.\" +'.\" @(#)uuencode.format.5 6.4 (Berkeley) 5/10/91 +'.\" +.TH UUENCODE 5 +.SH NAME +uuencode \- format of an encoded uuencode file +.SH DESCRIPTION +Files output by +uuencode(1) +consist of a header line, +followed by a number of body lines, +and a trailer line. +The +uudecode(1) +command +will ignore any lines preceding the header or +following the trailer. +Lines preceding a header must not, of course, +look like a header. +.PP +The header line is distinguished by having the first +6 characters +.I begin\ \& +The word +.I begin +is followed by a mode (in octal), +and a string which names the remote file. +A space separates the three items in the header line. +.PP +The body consists of a number of lines, each at most 62 characters +long (including the trailing newline). +These consist of a character count, +followed by encoded characters, +followed by a newline. +The character count is a single printing character, +and represents an integer, the number of bytes +the rest of the line represents. +Such integers are always in the range from 0 to 63 and can +be determined by subtracting the character space (octal 40) +from the character. +.PP +Groups of 3 bytes are stored in 4 characters, 6 bits per character. +All are offset by a space to make the characters printing. +The last line may be shorter than the normal 45 bytes. +If the size is not a multiple of 3, this fact can be determined +by the value of the count on the last line. +Extra garbage will be included to make the character count a multiple +of 4. +The body is terminated by a line with a count of zero. +This line consists of one +ASCII +space. +.PP +The trailer line consists of +.I end +on a line by itself. +.SH SEE ALSO +uuencode(1), uudecode(1), uusend(1), uucp(1), mail(1) +.SH HISTORY +The +.I uuencode +file format appeared in +BSD 4.0 . diff --git a/src/apps/bin/sharutils-4.2.1/doc/version.texi b/src/apps/bin/sharutils-4.2.1/doc/version.texi new file mode 100644 index 0000000000..0eefe4eb5b --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/doc/version.texi @@ -0,0 +1,3 @@ +@set EDITION 4.1.9 +@set UPDATED 28 October +@set VERSION 4.1.9 diff --git a/src/apps/bin/sharutils-4.2.1/install-sh b/src/apps/bin/sharutils-4.2.1/install-sh new file mode 100755 index 0000000000..ab74c882e9 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/install-sh @@ -0,0 +1,238 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5. +# +# 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. +# + + +# 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}" + +tranformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/src/apps/bin/sharutils-4.2.1/intl/ChangeLog b/src/apps/bin/sharutils-4.2.1/intl/ChangeLog new file mode 100644 index 0000000000..6bda59584e --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/ChangeLog @@ -0,0 +1,693 @@ +Sat Dec 2 22:51:38 1995 Marcus Daniels + + * cat-compat.c (textdomain): + Reverse order in which files are tried you load. First + try local file, when this failed absolute path. + +Wed Nov 29 02:03:53 1995 Nelson H. F. Beebe + + * cat-compat.c (bindtextdomain): Add missing { }. + +Sun Nov 26 18:21:41 1995 Ulrich Drepper + + * libintl.inst: Add missing __P definition. Reported by Nelson Beebe. + + * Makefile.in: + Add dummy `all' and `dvi' goals. Reported by Tom Tromey. + +Sat Nov 25 16:12:01 1995 Franc,ois Pinard + + * hash-string.h: Capitalize arguments of macros. + +Sat Nov 25 12:01:36 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Prevent files names longer than 13 + characters. libintl.h.glibc->libintl.glibc, + libintl.h.install->libintl.inst. Reported by Joshua R. Poulson. + +Sat Nov 25 11:31:12 1995 Eric Backus + + * dcgettext.c: Fix bug in preprocessor conditionals. + +Sat Nov 25 02:35:27 1995 Nelson H. F. Beebe + + * libgettext.h: Solaris cc does not understand + #if !SYMBOL1 && !SYMBOL2. Sad but true. + +Thu Nov 23 16:22:14 1995 Ulrich Drepper + + * hash-string.h (hash_string): + Fix for machine with >32 bit `unsigned long's. + + * dcgettext.c (DCGETTEXT): + Fix horrible bug in loop for alternative translation. + +Thu Nov 23 01:45:29 1995 Ulrich Drepper + + * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed: + Some further simplifications in message number generation. + +Mon Nov 20 21:08:43 1995 Ulrich Drepper + + * libintl.h.glibc: Use __const instead of const in prototypes. + + * Makefile.in (install-src): + Install libintl.h.install instead of libintl.h. This + is a stripped-down version. Suggested by Peter Miller. + + * libintl.h.install, libintl.h.glibc: Initial revision. + + * localealias.c (_nl_expand_alias, read_alias_file): + Protect prototypes in type casts by __P. + +Tue Nov 14 16:43:58 1995 Ulrich Drepper + + * hash-string.h: Correct prototype for hash_string. + +Sun Nov 12 12:42:30 1995 Ulrich Drepper + + * hash-string.h (hash_string): Add prototype. + + * gettextP.h: Fix copyright. + (SWAP): Add prototype. + +Wed Nov 8 22:56:33 1995 Ulrich Drepper + + * localealias.c (read_alias_file): Forgot sizeof. + Avoid calling *printf function. This introduces a big overhead. + Patch by Roland McGrath. + +Tue Nov 7 14:21:08 1995 Ulrich Drepper + + * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy. + + * finddomain.c (stpcpy): + Define substitution function local. The macro was to flaky. + + * cat-compat.c: Fix typo. + + * xopen-msg.sed, linux-msg.sed: + While bringing message number to right place only accept digits. + + * linux-msg.sed, xopen-msg.sed: Now that the counter does not have + leading 0s we don't need to remove them. Reported by Marcus + Daniels. + + * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in + dependency. Reported by Marcus Daniels. + + * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement. + Generally cleanup using #if instead of #ifndef. + + * Makefile.in: Correct typos in comment. By Franc,ois Pinard. + +Mon Nov 6 00:27:02 1995 Ulrich Drepper + + * Makefile.in (install-src): Don't install libintl.h and libintl.a + if we use an available gettext implementation. + +Sun Nov 5 22:02:08 1995 Ulrich Drepper + + * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS. Reported + by Franc,ois Pinard. + + * libgettext.h: Use #if instead of #ifdef/#ifndef. + + * finddomain.c: + Comments describing what has to be done should start with FIXME. + +Sun Nov 5 19:38:01 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Split. Use DISTFILES with normal meaning. + DISTFILES.common names the files common to both dist goals. + DISTFILES.gettext are the files only distributed in GNU gettext. + +Sun Nov 5 17:32:54 1995 Ulrich Drepper + + * dcgettext.c (DCGETTEXT): Correct searching in derived locales. + This was necessary since a change in _nl_find_msg several weeks + ago. I really don't know this is still not fixed. + +Sun Nov 5 12:43:12 1995 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL. This + might mark a special condition. + + * finddomain.c (make_entry_rec): Don't make illegal entry as decided. + + * Makefile.in (dist): Suppress error message when ln failed. + Get files from $(srcdir) explicitly. + + * libgettext.h (gettext_const): Rename to gettext_noop. + +Fri Nov 3 07:36:50 1995 Ulrich Drepper + + * finddomain.c (make_entry_rec): + Protect against wrong locale names by testing mask. + + * libgettext.h (gettext_const): Add macro definition. + Capitalize macro arguments. + +Thu Nov 2 23:15:51 1995 Ulrich Drepper + + * finddomain.c (_nl_find_domain): + Test for pointer != NULL before accessing value. + Reported by Tom Tromey. + + * gettext.c (NULL): + Define as (void*)0 instad of 0. Reported by Franc,ois Pinard. + +Mon Oct 30 21:28:52 1995 Ulrich Drepper + + * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering. + +Sat Oct 28 23:20:47 1995 Ulrich Drepper + + * libgettext.h: Disable dcgettext optimization for Solaris 2.3. + + * localealias.c (alias_compare): + Peter Miller reported that tolower in some systems is + even dumber than I thought. Protect call by `isupper'. + +Fri Oct 27 22:22:51 1995 Ulrich Drepper + + * Makefile.in (libdir, includedir): New variables. + (install-src): Install libintl.a and libintl.h in correct dirs. + +Fri Oct 27 22:07:29 1995 Ulrich Drepper + + * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c. + + * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques. + + * localealias.c: + Fix typo and superflous test. Reported by Christian von Roques. + +Fri Oct 6 11:52:05 1995 Ulrich Drepper + + * finddomain.c (_nl_find_domain): + Correct some remainder from the pre-CEN syntax. Now + we don't have a constant number of successors anymore. + +Wed Sep 27 21:41:13 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Add libintl.h.glibc. + + * Makefile.in (dist-libc): Add goal for packing sources for glibc. + (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc. + + * loadmsgcat.c: Forget to continue #if line. + + * localealias.c: + [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name + space clean. + + * dcgettext.c, finddomain.c: Better comment to last change. + + * loadmsgcat.c: + [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to + __fstat, __open, __close, __read, __mmap, and __munmap resp + to keep ANSI C name space clean. + + * finddomain.c: + [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean. + + * dcgettext.c: + [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to + keep ANSI C name space clean. + + * libgettext.h: + Include sys/types.h for those old SysV systems out there. + Reported by Francesco Potorti`. + + * loadmsgcat.c (use_mmap): Define if compiled for glibc. + + * bindtextdom.c: Include all those standard headers + unconditionally if _LIBC is defined. + + * finddomain.c: Fix 2 times defiend -> defined. + + * textdomain.c: Include libintl.h instead of libgettext.h when + compiling for glibc. Include all those standard headers + unconditionally if _LIBC is defined. + + * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc. + + * gettext.c: + Include libintl.h instead of libgettext.h when compiling for glibc. + Get NULL from stddef.h if we compile for glibc. + + * finddomain.c: Include libintl.h instead of libgettext.h when + compiling for glibc. Include all those standard headers + unconditionally if _LIBC is defined. + + * dcgettext.c: Include all those standard headers unconditionally + if _LIBC is defined. + + * dgettext.c: If compiled in glibc include libintl.h instead of + libgettext.h. + (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc. + + * dcgettext.c: If compiled in glibc include libintl.h instead of + libgettext.h. + (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc. + + * bindtextdom.c: + If compiled in glibc include libintl.h instead of libgettext.h. + +Mon Sep 25 22:23:06 1995 Ulrich Drepper + + * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0. + Reported by Marcus Daniels. + + * cat-compat.c (bindtextdomain): + String used in putenv must not be recycled. + Reported by Marcus Daniels. + + * libgettext.h (__USE_GNU_GETTEXT): + Additional symbol to signal that we use GNU gettext + library. + + * cat-compat.c (bindtextdomain): + Fix bug with the strange stpcpy replacement. + Reported by Nelson Beebe. + +Sat Sep 23 08:23:51 1995 Ulrich Drepper + + * cat-compat.c: Include for stpcpy prototype. + + * localealias.c (read_alias_file): + While expand strdup code temporary variable `cp' hided + higher level variable with same name. Rename to `tp'. + + * textdomain.c (textdomain): + Avoid warning by using temporary variable in strdup code. + + * finddomain.c (_nl_find_domain): Remove unused variable `application'. + +Thu Sep 21 15:51:44 1995 Ulrich Drepper + + * localealias.c (alias_compare): + Use strcasecmp() only if available. Else use + implementation in place. + + * intl-compat.c: + Wrapper functions now call *__ functions instead of __*. + + * libgettext.h: Declare prototypes for *__ functions instead for __*. + + * cat-compat.c, loadmsgcat.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + + * bindtextdom.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + Rename to bindtextdomain__ if not used in GNU C Library. + + * dgettext.c: + Rename function to dgettext__ if not used in GNU C Library. + + * gettext.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + Functions now called gettext__ if not used in GNU C Library. + + * dcgettext.c, localealias.c, textdomain.c, finddomain.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + +Sun Sep 17 23:14:49 1995 Ulrich Drepper + + * finddomain.c: Correct some bugs in handling of CEN standard + locale definitions. + +Thu Sep 7 01:49:28 1995 Ulrich Drepper + + * finddomain.c: Implement CEN syntax. + + * gettextP.h (loaded_domain): Extend number of successors to 31. + +Sat Aug 19 19:25:29 1995 Ulrich Drepper + + * Makefile.in (aliaspath): Remove path to X11 locale dir. + + * Makefile.in: Make install-src depend on install. This helps + gettext to install the sources and other packages can use the + install goal. + +Sat Aug 19 15:19:33 1995 Ulrich Drepper + + * Makefile.in (uninstall): Remove stuff installed by install-src. + +Tue Aug 15 13:13:53 1995 Ulrich Drepper + + * VERSION.in: Initial revision. + + * Makefile.in (DISTFILES): + Add VERSION file. This is not necessary for gettext, but + for other packages using this library. + +Tue Aug 15 06:16:44 1995 Ulrich Drepper + + * gettextP.h (_nl_find_domain): + New prototype after changing search strategy. + + * finddomain.c (_nl_find_domain): + We now try only to find a specified catalog. Fall back to other + catalogs listed in the locale list is now done in __dcgettext. + + * dcgettext.c (__dcgettext): + Now we provide message fall back even to different languages. + I.e. if a message is not available in one language all the other + in the locale list a tried. Formerly fall back was only possible + within one language. Implemented by moving one loop from + _nl_find_domain to here. + +Mon Aug 14 23:45:50 1995 Ulrich Drepper + + * Makefile.in (gettextsrcdir): + Directory where source of GNU gettext library are made + available. + (INSTALL, INSTALL_DATA): Programs used for installing sources. + (gettext-src): New. Rule to install GNU gettext sources for use in + gettextize shell script. + +Sun Aug 13 14:40:48 1995 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): + Use mmap for loading only when munmap function is + also available. + + * Makefile.in (install): Depend on `all' goal. + +Wed Aug 9 11:04:33 1995 Ulrich Drepper + + * localealias.c (read_alias_file): + Do not overwrite '\n' when terminating alias value string. + + * localealias.c (read_alias_file): + Handle long lines. Ignore the rest not fitting in + the buffer after the initial `fgets' call. + +Wed Aug 9 00:54:29 1995 Ulrich Drepper + + * gettextP.h (_nl_load_domain): + Add prototype, replacing prototype for _nl_load_msg_cat. + + * finddomain.c (_nl_find_domain): + Remove unneeded variable filename and filename_len. + (expand_alias): Remove prototype because functions does not + exist anymore. + + * localealias.c (read_alias_file): + Change type of fname_len parameter to int. + (xmalloc): Add prototype. + + * loadmsgcat.c: Better prototypes for xmalloc. + +Tue Aug 8 22:30:39 1995 Ulrich Drepper + + * finddomain.c (_nl_find_domain): + Allow alias name to be constructed from the four components. + + * Makefile.in (aliaspath): New variable. Set to preliminary value. + (SOURCES): Add localealias.c. + (OBJECTS): Add localealias.o. + + * gettextP.h: Add prototype for _nl_expand_alias. + + * finddomain.c: Aliasing handled in intl/localealias.c. + + * localealias.c: Aliasing for locale names. + + * bindtextdom.c: Better prototypes for xmalloc and xstrdup. + +Mon Aug 7 23:47:42 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): gettext.perl is now found in misc/. + + * cat-compat.c (bindtextdomain): + Correct implementation. dirname parameter was not used. + Reported by Marcus Daniels. + + * gettextP.h (loaded_domain): + New fields `successor' and `decided' for oo, lazy + message handling implementation. + + * dcgettext.c: + Adopt for oo, lazy message handliing. + Now we can inherit translations from less specific locales. + (find_msg): New function. + + * loadmsgcat.c, finddomain.c: + Complete rewrite. Implement oo, lazy message handling :-). + We now have an additional environment variable `LANGUAGE' with + a higher priority than LC_ALL for the LC_MESSAGE locale. + Here we can set a colon separated list of specifications each + of the form `language[_territory[.codeset]][@modifier]'. + +Sat Aug 5 09:55:42 1995 Ulrich Drepper + + * finddomain.c (unistd.h): + Include to get _PC_PATH_MAX defined on system having it. + +Fri Aug 4 22:42:00 1995 Ulrich Drepper + + * finddomain.c (stpcpy): Include prototype. + + * Makefile.in (dist): Remove `copying instead' message. + +Wed Aug 2 18:52:03 1995 Ulrich Drepper + + * Makefile.in (ID, TAGS): Do not use $^. + +Tue Aug 1 20:07:11 1995 Ulrich Drepper + + * Makefile.in (TAGS, ID): Use $^ as command argument. + (TAGS): Give etags -o option t write to current directory, + not $(srcdir). + (ID): Use $(srcdir) instead os $(top_srcdir)/src. + (distclean): Remove ID. + +Sun Jul 30 11:51:46 1995 Ulrich Drepper + + * Makefile.in (gnulocaledir): + New variable, always using share/ for data directory. + (DEFS): Add GNULOCALEDIR, used in finddomain.c. + + * finddomain.c (_nl_default_dirname): + Set to GNULOCALEDIR, because it always has to point + to the directory where GNU gettext Library writes it to. + + * intl-compat.c (textdomain, bindtextdomain): + Undefine macros before function definition. + +Sat Jul 22 01:10:02 1995 Ulrich Drepper + + * libgettext.h (_LIBINTL_H): + Protect definition in case where this file is included as + libgettext.h on Solaris machines. Add comment about this. + +Wed Jul 19 02:36:42 1995 Ulrich Drepper + + * intl-compat.c (textdomain): Correct typo. + +Wed Jul 19 01:51:35 1995 Ulrich Drepper + + * dcgettext.c (dcgettext): Function now called __dcgettext. + + * dgettext.c (dgettext): Now called __dgettext and calls + __dcgettext. + + * gettext.c (gettext): + Function now called __gettext and calls __dgettext. + + * textdomain.c (textdomain): Function now called __textdomain. + + * bindtextdom.c (bindtextdomain): Function now called + __bindtextdomain. + + * intl-compat.c: Initial revision. + + * Makefile.in (SOURCES): Add intl-compat.c. + (OBJECTS): We always compile the GNU gettext library functions. + OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o, + and intl-compat.o. + (GETTOBJS): Contains now only intl-compat.o. + + * libgettext.h: + Re-include protection matches dualistic character of libgettext.h. + For all functions in GNU gettext library define __ counter part. + + * finddomain.c (strchr): Define as index if not found in C library. + (_nl_find_domain): For relative paths paste / in between. + +Tue Jul 18 16:37:45 1995 Ulrich Drepper + + * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h. + + * xopen-msg.sed: Fix bug with `msgstr ""' lines. + A little bit better comments. + +Tue Jul 18 01:18:27 1995 Ulrich Drepper + + * Makefile.in: + po-mode.el, makelinks, combine-sh are now found in ../misc. + + * po-mode.el, makelinks, combine-sh, elisp-comp: + Moved to ../misc/. + + * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__. + +Sun Jul 16 22:33:02 1995 Ulrich Drepper + + * Makefile.in (INSTALL, INSTALL_DATA): New variables. + (install-data, uninstall): Install/uninstall .elc file. + + * po-mode.el (Installation comment): + Add .pox as possible extension of .po files. + +Sun Jul 16 13:23:27 1995 Ulrich Drepper + + * elisp-comp: Complete new version by Franc,ois: This does not + fail when not compiling in the source directory. + +Sun Jul 16 00:12:17 1995 Ulrich Drepper + + * Makefile.in (../po/cat-id-tbl.o): + Use $(MAKE) instead of make for recursive make. + + * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh. + (install-exec): Add missing dummy goal. + (install-data, uninstall): @ in multi-line shell command at + beginning, not in front of echo. Reported by Eric Backus. + +Sat Jul 15 00:21:28 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): + Rename libgettext.perl to gettext.perl to fit in 14 chars + file systems. + + * gettext.perl: + Rename to gettext.perl to fit in 14 chars file systems. + +Thu Jul 13 23:17:20 1995 Ulrich Drepper + + * cat-compat.c: If !STDC_HEADERS try to include malloc.h. + +Thu Jul 13 20:55:02 1995 Ulrich Drepper + + * po2tbl.sed.in: Pretty printing. + + * linux-msg.sed, xopen-msg.sed: + Correct bugs with handling substitute flags in branches. + + * hash-string.h (hash_string): + Old K&R compilers don't under stand `unsigned char'. + + * gettext.h (nls_uint32): + Some old K&R compilers (eg HP) don't understand `unsigned int'. + + * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes. + +Thu Jul 13 01:34:33 1995 Ulrich Drepper + + * Makefile.in (ELCFILES): New variable. + (DISTFILES): Add elisp-comp. + Add implicit rule for .el -> .elc compilation. + (install-data): install $ELCFILES + (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp. + + * elisp-comp: Initial revision + +Wed Jul 12 16:14:52 1995 Ulrich Drepper + + * Makefile.in: + cat-id-tbl.c is now found in po/. This enables us to use an identical + intl/ directory in all packages. + + * dcgettext.c (dcgettext): hashing does not work for table size <= 2. + + * textdomain.c: fix typo (#if def -> #if defined) + +Tue Jul 11 18:44:43 1995 Ulrich Drepper + + * Makefile.in (stamp-cat-id): use top_srcdir to address source files + (DISTFILES,distclean): move tupdate.perl to src/ + + * po-to-tbl.sed.in: + add additional jump to clear change flag to recognize multiline strings + +Tue Jul 11 01:32:50 1995 Ulrich Drepper + + * textdomain.c: Protect inclusion of stdlib.h and string.h. + + * loadmsgcat.c: Protect inclusion of stdlib.h. + + * libgettext.h: Protect inclusion of locale.h. + Allow use in C++ programs. + Define NULL is not happened already. + + * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of + po-to-tbl.sed. + (distclean): remove po-to-tbl.sed and tupdate.perl. + + * tupdate.perl.in: Substitute Perl path even in exec line. + Don't include entries without translation from old .po file. + +Tue Jul 4 00:41:51 1995 Ulrich Drepper + + * tupdate.perl.in: use "Updated: " in msgid "". + + * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR). + Define getenv if !__STDC__. + + * bindtextdom.c: Protect stdlib.h and string.h inclusion. + Define free if !__STDC__. + + * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR. + Define free if !__STDC__. + + * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR. + +Mon Jul 3 23:56:30 1995 Ulrich Drepper + + * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR. + Remove unneeded $(srcdir) from Makefile.in dependency. + + * makelinks: Add copyright and short description. + + * po-mode.el: Last version for 0.7. + + * tupdate.perl.in: Fix die message. + + * dcgettext.c: Protect include of string.h. + + * gettext.c: Protect include of stdlib.h and further tries to get NULL. + + * finddomain.c: Some corrections in includes. + + * Makefile.in (INCLUDES): Prune list correct path to Makefile.in. + + * po-to-tbl.sed: Adopt for new .po file format. + + * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format. + +Sun Jul 2 23:55:03 1995 Ulrich Drepper + + * tupdate.perl.in: Complete rewrite for new .po file format. + +Sun Jul 2 02:06:50 1995 Ulrich Drepper + + * First official release. This directory contains all the code + needed to internationalize own packages. It provides functions + which allow to use the X/Open catgets function with an interface + like the Uniforum gettext function. For system which does not + have neither of those a complete implementation is provided. + + diff --git a/src/apps/bin/sharutils-4.2.1/intl/Makefile b/src/apps/bin/sharutils-4.2.1/intl/Makefile new file mode 100644 index 0000000000..b847ff5330 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/Makefile @@ -0,0 +1,166 @@ +# Generated automatically from Makefile.in by configure. +# Makefile for directory with message catalog handling in GNU NLS Utilities. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = sharutils +VERSION = 4.2.1 + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} +transform = s,x,x, +libdir = $(prefix)/lib +includedir = $(prefix)/include +datadir = $(prefix)/share +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext +aliaspath = $(localedir):. +subdir = intl + +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 + +AR = ar +CC = gcc +RANLIB = ranlib + +DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \ +-DLOCALE_ALIAS_PATH=\"$(aliaspath)\" -DHAVE_CONFIG_H +CFLAGS = -g -O + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +HEADERS = $(COMHDRS) libgettext.h +COMHDRS = gettext.h gettextP.h hash-string.h +SOURCES = $(COMSRCS) intl-compat.c cat-compat.c +COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ +finddomain.c loadmsgcat.c localealias.c textdomain.c +OBJECTS = $(GETTOBJS) bindtextdom.o dcgettext.o dgettext.o gettext.o \ +finddomain.o loadmsgcat.o localealias.o textdomain.o +CATOBJS = cat-compat.o ../po/cat-id-tbl.o +GETTOBJS = intl-compat.o +DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \ +xopen-msg.sed $(HEADERS) $(SOURCES) +DISTFILES = $(DISTFILES.common) VERSION +DISTFILES.gettext = $(DISTFILES.common) libintl.glibc libintl.inst + +.SUFFIXES: +.SUFFIXES: .c .o +.c.o: + $(COMPILE) $< + +INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib + +all: libintl.a + + +libintl.a: $(OBJECTS) + rm -f $@ + $(AR) cru $@ $(OBJECTS) + $(RANLIB) $@ + +../po/cat-id-tbl.o: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot + cd ../po && $(MAKE) cat-id-tbl.o + +check install: all + +# This installation goal is only used in GNU gettext. Packages which +# only use the library should use install instead. +# +# We must not install the libintl.h/libintl.a files if we are on a system +# which has the gettext() function in its C library or in a separate +# library. A special case is where configure found a previously installed +# GNU gettext library. If you want to use the one which comes with this +# version of the package, you have to use `configure --with-gnu-gettext'. +install-src: install + $(top_srcdir)/mkinstalldirs $(libdir) $(includedir) $(gettextsrcdir) + if test -f libintl.h; then \ + $(INSTALL_DATA) $(srcdir)/libintl.inst \ + $(includedir)/libintl.h; \ + $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \ + fi + cd $(srcdir) && \ + for file in $(DISTFILES.common); do \ + $(INSTALL_DATA) $$file $(gettextsrcdir)/intl-$$file; \ + done + $(INSTALL_DATA) VERSION $(gettextsrcdir)/intl-VERSION + +uninstall: + for file in $(DISTFILES); do \ + rm -f $(gettextsrcdir)/intl-$$file; \ + done + +info dvi: + +$(OBJECTS): ../config.h libgettext.h +bindtextdom.o finddomain.o loadmsgcat.o: gettextP.h gettext.h +dcgettext.o: gettextP.h gettext.h hash-string.h + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) + +id: ID + +ID: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) + + +mostlyclean: + rm -f *.a *.o core core.* + +clean: mostlyclean + +distclean: clean + rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +# This dist goal is only used in GNU gettext. GNU gettext needs not contain +# the file `VERSION' but contains some other files which should not be +# distributed in other packages. +dist-gettext: Makefile $(DISTFILES.gettext) + for file in $(DISTFILES.gettext); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +dist-libc: + tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc + +Makefile: Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/intl/Makefile.in b/src/apps/bin/sharutils-4.2.1/intl/Makefile.in new file mode 100644 index 0000000000..2a05735516 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/Makefile.in @@ -0,0 +1,166 @@ +# Makefile for directory with message catalog handling in GNU NLS Utilities. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +transform = @program_transform_name@ +libdir = $(prefix)/lib +includedir = $(prefix)/include +datadir = $(prefix)/@DATADIRNAME@ +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext +aliaspath = $(localedir):. +subdir = intl + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +AR = ar +CC = @CC@ +RANLIB = @RANLIB@ + +DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \ +-DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@ +CFLAGS = @CFLAGS@ + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +HEADERS = $(COMHDRS) libgettext.h +COMHDRS = gettext.h gettextP.h hash-string.h +SOURCES = $(COMSRCS) intl-compat.c cat-compat.c +COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ +finddomain.c loadmsgcat.c localealias.c textdomain.c +OBJECTS = @INTLOBJS@ bindtextdom.o dcgettext.o dgettext.o gettext.o \ +finddomain.o loadmsgcat.o localealias.o textdomain.o +CATOBJS = cat-compat.o ../po/cat-id-tbl.o +GETTOBJS = intl-compat.o +DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \ +xopen-msg.sed $(HEADERS) $(SOURCES) +DISTFILES = $(DISTFILES.common) VERSION +DISTFILES.gettext = $(DISTFILES.common) libintl.glibc libintl.inst + +.SUFFIXES: +.SUFFIXES: .c .o +.c.o: + $(COMPILE) $< + +INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib + +all: libintl.a + + +libintl.a: $(OBJECTS) + rm -f $@ + $(AR) cru $@ $(OBJECTS) + $(RANLIB) $@ + +../po/cat-id-tbl.o: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot + cd ../po && $(MAKE) cat-id-tbl.o + +check install: all + +# This installation goal is only used in GNU gettext. Packages which +# only use the library should use install instead. +# +# We must not install the libintl.h/libintl.a files if we are on a system +# which has the gettext() function in its C library or in a separate +# library. A special case is where configure found a previously installed +# GNU gettext library. If you want to use the one which comes with this +# version of the package, you have to use `configure --with-gnu-gettext'. +install-src: install + $(top_srcdir)/mkinstalldirs $(libdir) $(includedir) $(gettextsrcdir) + if test -f libintl.h; then \ + $(INSTALL_DATA) $(srcdir)/libintl.inst \ + $(includedir)/libintl.h; \ + $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \ + fi + cd $(srcdir) && \ + for file in $(DISTFILES.common); do \ + $(INSTALL_DATA) $$file $(gettextsrcdir)/intl-$$file; \ + done + $(INSTALL_DATA) VERSION $(gettextsrcdir)/intl-VERSION + +uninstall: + for file in $(DISTFILES); do \ + rm -f $(gettextsrcdir)/intl-$$file; \ + done + +info dvi: + +$(OBJECTS): ../config.h libgettext.h +bindtextdom.o finddomain.o loadmsgcat.o: gettextP.h gettext.h +dcgettext.o: gettextP.h gettext.h hash-string.h + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) + +id: ID + +ID: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) + + +mostlyclean: + rm -f *.a *.o core core.* + +clean: mostlyclean + +distclean: clean + rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +# This dist goal is only used in GNU gettext. GNU gettext needs not contain +# the file `VERSION' but contains some other files which should not be +# distributed in other packages. +dist-gettext: Makefile $(DISTFILES.gettext) + for file in $(DISTFILES.gettext); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +dist-libc: + tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc + +Makefile: Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/intl/VERSION b/src/apps/bin/sharutils-4.2.1/intl/VERSION new file mode 100644 index 0000000000..cf0454e945 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/VERSION @@ -0,0 +1 @@ +GNU gettext library from gettext-0.10 diff --git a/src/apps/bin/sharutils-4.2.1/intl/bindtextdom.c b/src/apps/bin/sharutils-4.2.1/intl/bindtextdom.c new file mode 100644 index 0000000000..bd9f422654 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/bindtextdom.c @@ -0,0 +1,172 @@ +/* bindtextdom.c -- implementation of the bindtextdomain(3) function + Copyright (C) 1995 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined STDC_HEADERS || defined _LIBC +# include +#else +# ifdef HAVE_MALLOC_H +# include +# else +void free (); +# endif +#endif + +#if defined HAVE_STRING_H || defined _LIBC +# include +#else +# include +#endif + +#ifdef _LIBC +# include +#else +# include "libgettext.h" +#endif +#include "gettext.h" +#include "gettextP.h" + +/* @@ end of prolog @@ */ + +/* Contains the default location of the message catalogs. */ +extern const char _nl_default_dirname[]; + +/* List with bindings of specific domains. */ +extern struct binding *_nl_domain_bindings; + + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define BINDTEXTDOMAIN __bindtextdomain +#else +# define BINDTEXTDOMAIN bindtextdomain__ +#endif + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +char * +BINDTEXTDOMAIN (domainname, dirname) + const char *domainname; + const char *dirname; +{ + struct binding *binding; + + /* Some sanity checks. */ + if (domainname == NULL || domainname[0] == '\0') + return NULL; + + for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) + { + int compare = strcmp (domainname, binding->domainname); + if (compare == 0) + /* We found it! */ + break; + if (compare < 0) + { + /* It is not in the list. */ + binding = NULL; + break; + } + } + + if (dirname == NULL) + /* The current binding has be to returned. */ + return binding == NULL ? (char *) _nl_default_dirname : binding->dirname; + + if (binding != NULL) + { + /* The domain is already bound. Replace the old binding. */ + char *new_dirname; + + if (strcmp (dirname, _nl_default_dirname) == 0) + new_dirname = (char *) _nl_default_dirname; + else + { + size_t len = strlen (dirname) + 1; + new_dirname = (char *) malloc (len); + if (new_dirname == NULL) + return NULL; + + memcpy (new_dirname, dirname, len); + } + + if (strcmp (binding->dirname, _nl_default_dirname) != 0) + free (binding->dirname); + + binding->dirname = new_dirname; + } + else + { + /* We have to create a new binding. */ + size_t len; + struct binding *new_binding = + (struct binding *) malloc (sizeof (*new_binding)); + + if (new_binding == NULL) + return NULL; + + len = strlen (domainname) + 1; + new_binding->domainname = (char *) malloc (len); + if (new_binding->domainname == NULL) + return NULL; + memcpy (new_binding->domainname, domainname, len); + + if (strcmp (dirname, _nl_default_dirname) == 0) + new_binding->dirname = (char *) _nl_default_dirname; + else + { + len = strlen (dirname) + 1; + new_binding->dirname = (char *) malloc (len); + if (new_binding->dirname == NULL) + return NULL; + memcpy (new_binding->dirname, dirname, len); + } + + /* Now enqueue it. */ + if (_nl_domain_bindings == NULL + || strcmp (domainname, _nl_domain_bindings->domainname) < 0) + { + new_binding->next = _nl_domain_bindings; + _nl_domain_bindings = new_binding; + } + else + { + binding = _nl_domain_bindings; + while (binding->next != NULL + && strcmp (domainname, binding->next->domainname) > 0) + binding = binding->next; + + new_binding->next = binding->next; + binding->next = new_binding; + } + + binding = new_binding; + } + + return binding->dirname; +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__bindtextdomain, bindtextdomain); +#endif diff --git a/src/apps/bin/sharutils-4.2.1/intl/bindtextdom.o b/src/apps/bin/sharutils-4.2.1/intl/bindtextdom.o new file mode 100644 index 0000000000..551fc7983e Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/bindtextdom.o differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/cat-compat.c b/src/apps/bin/sharutils-4.2.1/intl/cat-compat.c new file mode 100644 index 0000000000..39fcfb43a0 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/cat-compat.c @@ -0,0 +1,252 @@ +/* Compatibility code for gettext-using-catgets interface. + Copyright (C) 1995 Free Software Foundation, Inc. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#ifdef STDC_HEADERS +# include +# include +#else +char *getenv (); +# ifdef HAVE_MALLOC_H +# include +# endif +#endif + +#ifdef HAVE_NL_TYPES_H +# include +#endif + +#include "libgettext.h" + +/* @@ end of prolog @@ */ + +/* The catalog descriptor. */ +static nl_catd catalog = (nl_catd) -1; + +/* Name of the default catalog. */ +static const char default_catalog_name[] = "messages"; + +/* Name of currently used catalog. */ +static const char *catalog_name = default_catalog_name; + +/* Get ID for given string. If not found return -1. */ +static int msg_to_cat_id __P ((const char *msg)); + +/* Substitution for systems lacking this function in their C library. */ +#if !_LIBC && !HAVE_STPCPY +static char *stpcpy __P ((char *dest, const char *src)); +#endif + + +/* Set currently used domain/catalog. */ +char * +textdomain (domainname) + const char *domainname; +{ + nl_catd new_catalog; + char *new_name; + size_t new_name_len; + char *lang; + +#if HAVE_SETLOCALE && HAVE_LC_MESSAGES && HAVE_SETLOCALE_NULL + lang = setlocale (LC_MESSAGES, NULL); +#else + lang = getenv ("LC_ALL"); + if (lang == NULL || lang[0] == '\0') + { + lang = getenv ("LC_MESSAGES"); + if (lang == NULL || lang[0] == '\0') + lang = getenv ("LANG"); + } +#endif + if (lang == NULL || lang[0] == '\0') + lang = "C"; + + /* See whether name of currently used domain is asked. */ + if (domainname == NULL) + return (char *) catalog_name; + + if (domainname[0] == '\0') + domainname = default_catalog_name; + + /* Compute length of added path element. */ + new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang) + + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1 + + sizeof (".cat"); + + new_name = (char *) malloc (new_name_len); + if (new_name == NULL) + return NULL; + + strcpy (new_name, PACKAGE); + new_catalog = catopen (new_name, 0); + + if (new_catalog == (nl_catd) -1) + { + /* NLSPATH search didn't work, try absolute path */ + sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang, + PACKAGE); + new_catalog = catopen (new_name, 0); + + if (new_catalog == (nl_catd) -1) + { + free (new_name); + return (char *) catalog_name; + } + } + + /* Close old catalog. */ + if (catalog != (nl_catd) -1) + catclose (catalog); + if (catalog_name != default_catalog_name) + free ((char *) catalog_name); + + catalog = new_catalog; + catalog_name = new_name; + + return (char *) catalog_name; +} + +char * +bindtextdomain (domainname, dirname) + const char *domainname; + const char *dirname; +{ +#if HAVE_SETENV || HAVE_PUTENV + char *old_val, *new_val, *cp; + size_t new_val_len; + + /* This does not make much sense here but to be compatible do it. */ + if (domainname == NULL) + return NULL; + + /* Compute length of added path element. If we use setenv we don't need + the first byts for NLSPATH=, but why complicate the code for this + peanuts. */ + new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname) + + sizeof ("/%L/LC_MESSAGES/%N.cat"); + + old_val = getenv ("NLSPATH"); + if (old_val == NULL || old_val[0] == '\0') + { + old_val = NULL; + new_val_len += 1 + sizeof (LOCALEDIR) - 1 + + sizeof ("/%L/LC_MESSAGES/%N.cat"); + } + else + new_val_len += strlen (old_val); + + new_val = (char *) malloc (new_val_len); + if (new_val == NULL) + return NULL; + +# if HAVE_SETENV + cp = new_val; +# else + cp = stpcpy (new_val, "NLSPATH="); +# endif + + cp = stpcpy (cp, dirname); + cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:"); + + if (old_val == NULL) + { +# if __STDC__ + stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat"); +# else + + cp = stpcpy (cp, LOCALEDIR); + stpcpy (cp, "/%L/LC_MESSAGES/%N.cat"); +# endif + } + else + stpcpy (cp, old_val); + +# if HAVE_SETENV + setenv ("NLSPATH", new_val, 1); + free (new_val); +# else + putenv (new_val); + /* Do *not* free the environment entry we just entered. It is used + from now on. */ +# endif + +#endif + + return (char *) domainname; +} + +#undef gettext +char * +gettext (msg) + const char *msg; +{ + int msgid; + + if (msg == NULL || catalog == (nl_catd) -1) + return (char *) msg; + + /* Get the message from the catalog. We always use set number 1. + The message ID is computed by the function `msg_to_cat_id' + which works on the table generated by `po-to-tbl'. */ + msgid = msg_to_cat_id (msg); + if (msgid == -1) + return (char *) msg; + + return catgets (catalog, 1, msgid, (char *) msg); +} + +/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries + for the one equal to msg. If it is found return the ID. In case when + the string is not found return -1. */ +static int +msg_to_cat_id (msg) + const char *msg; +{ + int cnt; + + for (cnt = 0; cnt < _msg_tbl_length; ++cnt) + if (strcmp (msg, _msg_tbl[cnt]._msg) == 0) + return _msg_tbl[cnt]._msg_number; + + return -1; +} + + +/* @@ begin of epilog @@ */ + +/* We don't want libintl.a to depend on any other library. So we + avoid the non-standard function stpcpy. In GNU C Library this + function is available, though. Also allow the symbol HAVE_STPCPY + to be defined. */ +#if !_LIBC && !HAVE_STPCPY +static char * +stpcpy (dest, src) + char *dest; + const char *src; +{ + while ((*dest++ = *src++) != '\0') + /* Do nothing. */ ; + return dest - 1; +} +#endif diff --git a/src/apps/bin/sharutils-4.2.1/intl/dcgettext.c b/src/apps/bin/sharutils-4.2.1/intl/dcgettext.c new file mode 100644 index 0000000000..911bc5c788 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/dcgettext.c @@ -0,0 +1,522 @@ +/* dcgettext.c -- implemenatation of the dcgettext(3) function + Copyright (C) 1995 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +#endif + +#include +#ifndef errno +extern int errno; +#endif + +#if defined STDC_HEADERS || defined _LIBC +# include +#else +char *getenv (); +# ifdef HAVE_MALLOC_H +# include +# else +void free (); +# endif +#endif + +#if defined HAVE_STRING_H || defined _LIBC +# include +#else +# include +#endif +#if !HAVE_STRCHR && !defined _LIBC +# ifndef strchr +# define strchr index +# endif +#endif + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#include "gettext.h" +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgettext.h" +#endif +#include "hash-string.h" + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# define getcwd __getcwd +# define stpcpy __stpcpy +#endif + +#if !defined HAVE_GETCWD && !defined _LIBC +char *getwd (); +# define getcwd(buf, max) getwd (buf) +#else +char *getcwd (); +#endif + +/* Amount to increase buffer size by in each try. */ +#define PATH_INCR 32 + +/* The following is from pathmax.h. */ +/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define + PATH_MAX but might cause redefinition warnings when sys/param.h is + later included (as on MORE/BSD 4.3). */ +#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__)) +# include +#endif + +#ifndef _POSIX_PATH_MAX +# define _POSIX_PATH_MAX 255 +#endif + +#if !defined(PATH_MAX) && defined(_PC_PATH_MAX) +# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) +#endif + +/* Don't include sys/param.h if it already has been. */ +#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN) +# include +#endif + +#if !defined(PATH_MAX) && defined(MAXPATHLEN) +# define PATH_MAX MAXPATHLEN +#endif + +#ifndef PATH_MAX +# define PATH_MAX _POSIX_PATH_MAX +#endif + +/* XPG3 defines the result of `setlocale (category, NULL)' as: + ``Directs `setlocale()' to query `category' and return the current + setting of `local'.'' + However it does not specify the exact format. And even worse: POSIX + defines this not at all. So we can use this feature only on selected + system (e.g. those using GNU C Library). */ +#ifdef _LIBC +# define HAVE_LOCALE_NULL +#endif + +/* Name of the default domain used for gettext(3) prior any call to + textdomain(3). The default value for this is "messages". */ +const char _nl_default_default_domain[] = "messages"; + +/* Value used as the default domain for gettext(3). */ +const char *_nl_current_default_domain = _nl_default_default_domain; + +/* Contains the default location of the message catalogs. */ +const char _nl_default_dirname[] = GNULOCALEDIR; + +/* List with bindings of specific domains created by bindtextdomain() + calls. */ +struct binding *_nl_domain_bindings; + +/* Prototypes for local functions. */ +static char *find_msg __P ((struct loaded_domain *domain, const char *msgid)); +static const char *category_to_name __P((int category)); +static const char *guess_category_value __P((int category, + const char *categoryname)); + + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DCGETTEXT __dcgettext +#else +# define DCGETTEXT dcgettext__ +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +char * +DCGETTEXT (domainname, msgid, category) + const char *domainname; + const char *msgid; + int category; +{ + struct loaded_domain *domain; + struct binding *binding; + const char *categoryname; + const char *categoryvalue; + char *dirname, *xdomainname; + char *single_locale; + char *retval; + + /* If no real MSGID is given return NULL. */ + if (msgid == NULL) + return NULL; + + /* If DOMAINNAME is NULL, we are interested in the default domain. If + CATEGORY is not LC_MESSAGES this might not make much sense but the + defintion left this undefined. */ + if (domainname == NULL) + domainname = _nl_current_default_domain; + + /* First find matching binding. */ + for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) + { + int compare = strcmp (domainname, binding->domainname); + if (compare == 0) + /* We found it! */ + break; + if (compare < 0) + { + /* It is not in the list. */ + binding = NULL; + break; + } + } + + if (binding == NULL) + dirname = (char *) _nl_default_dirname; + else if (binding->dirname[0] == '/') + dirname = binding->dirname; + else + { + /* We have a relative path. Make it absolute now. */ + size_t dirname_len = strlen (binding->dirname) + 1; + size_t path_max; + char *ret; + + path_max = (unsigned) PATH_MAX; + path_max += 2; /* The getcwd docs say to do this. */ + + dirname = (char *) alloca (path_max + dirname_len); + + errno = 0; + while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE) + { + path_max += PATH_INCR; + dirname = (char *) alloca (path_max + dirname_len); + errno = 0; + } + + if (ret == NULL) + /* We cannot get the current working directory. Don't signal an + error but simply return the default string. */ + return (char *) msgid; + + /* We don't want libintl.a to depend on any other library. So + we avoid the non-standard function stpcpy. In GNU C Library + this function is available, though. Also allow the symbol + HAVE_STPCPY to be defined. */ +#if defined _LIBC || defined HAVE_STPCPY + stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); +#else + strcat (dirname, "/"); + strcat (dirname, binding->dirname); +#endif + } + + /* Now determine the symbolic name of CATEGORY and its value. */ + categoryname = category_to_name (category); + categoryvalue = guess_category_value (category, categoryname); + + xdomainname = (char *) alloca (strlen (categoryname) + + strlen (domainname) + 5); + /* We don't want libintl.a to depend on any other library. So we + avoid the non-standard function stpcpy. In GNU C Library this + function is available, though. Also allow the symbol HAVE_STPCPY + to be defined. */ +#if defined _LIBC || defined HAVE_STPCPY + stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), + domainname), + ".mo"); +#else + strcpy (xdomainname, categoryname); + strcat (xdomainname, "/"); + strcat (xdomainname, domainname); + strcat (xdomainname, ".mo"); +#endif + + /* Creating working area. */ + single_locale = (char *) alloca (strlen (categoryvalue) + 1); + + + /* Search for the given string. This is a loop because we perhaps + got an ordered list of languages to consider for th translation. */ + while (1) + { + /* Make CATEGORYVALUE point to the next element of the list. */ + while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') + ++categoryvalue; + if (categoryvalue[0] == '\0') + { + /* The whole contents of CATEGORYVALUE has been searched but + no valid entry has been found. We solve this situation + by implicitely appending a "C" entry, i.e. no translation + will take place. */ + single_locale[0] = 'C'; + single_locale[1] = '\0'; + } + else + { + char *cp = single_locale; + while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') + *cp++ = *categoryvalue++; + *cp = '\0'; + } + + /* If the current locale value is C (or POSIX) we don't load a + domain. Return the MSGID. */ + if (strcmp (single_locale, "C") == 0 + || strcmp (single_locale, "POSIX") == 0) + return (char *) msgid; + + + /* Find structure describing the message catalog matching the + DOMAINNAME and CATEGORY. */ + domain = _nl_find_domain (dirname, single_locale, xdomainname); + + if (domain != NULL) + { + retval = find_msg (domain, msgid); + + if (retval == NULL) + { + int cnt; + + for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) + { + retval = find_msg (domain->successor[cnt], msgid); + + if (retval != NULL) + break; + } + } + + if (retval != NULL) + return retval; + } + } + /* NOTREACHED */ +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__dcgettext, dcgettext); +#endif + + +static char * +find_msg (domain, msgid) + struct loaded_domain *domain; + const char *msgid; +{ + size_t top, act, bottom; + + if (domain->decided == 0) + _nl_load_domain (domain); + + if (domain->data == NULL) + return NULL; + + /* Locate the MSGID and its translation. */ + if (domain->hash_size > 2 && domain->hash_tab != NULL) + { + /* Use the hashing table. */ + nls_uint32 len = strlen (msgid); + nls_uint32 hash_val = hash_string (msgid); + nls_uint32 idx = hash_val % domain->hash_size; + nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); + nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]); + + if (nstr == 0) + /* Hash table entry is empty. */ + return NULL; + + if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len + && strcmp (msgid, + domain->data + W (domain->must_swap, + domain->orig_tab[nstr - 1].offset)) == 0) + return (char *) domain->data + W (domain->must_swap, + domain->trans_tab[nstr - 1].offset); + + while (1) + { + if (idx >= W (domain->must_swap, domain->hash_size) - incr) + idx -= W (domain->must_swap, domain->hash_size) - incr; + else + idx += incr; + + nstr = W (domain->must_swap, domain->hash_tab[idx]); + if (nstr == 0) + /* Hash table entry is empty. */ + return NULL; + + if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len + && strcmp (msgid, + domain->data + W (domain->must_swap, + domain->orig_tab[nstr - 1].offset)) + == 0) + return (char *) domain->data + + W (domain->must_swap, domain->trans_tab[nstr - 1].offset); + } + /* NOTREACHED */ + } + + /* Now we try the default method: binary search in the sorted + array of messages. */ + bottom = 0; + top = domain->nstrings; + while (bottom < top) + { + int cmp_val; + + act = (bottom + top) / 2; + cmp_val = strcmp (msgid, domain->data + + W (domain->must_swap, + domain->orig_tab[act].offset)); + if (cmp_val < 0) + top = act; + else if (cmp_val > 0) + bottom = act + 1; + else + break; + } + + /* If an translation is found return this. */ + return bottom >= top ? NULL : (char *) domain->data + + W (domain->must_swap, + domain->trans_tab[act].offset); +} + + +/* Return string representation of locale CATEGORY. */ +static const char *category_to_name (category) + int category; +{ + const char *retval; + + switch (category) + { +#ifdef LC_COLLATE + case LC_COLLATE: + retval = "LC_COLLATE"; + break; +#endif +#ifdef LC_CTYPE + case LC_CTYPE: + retval = "LC_CTYPE"; + break; +#endif +#ifdef LC_MONETARY + case LC_MONETARY: + retval = "LC_MONETARY"; + break; +#endif +#ifdef LC_NUMERIC + case LC_NUMERIC: + retval = "LC_NUMERIC"; + break; +#endif +#ifdef LC_TIME + case LC_TIME: + retval = "LC_TIME"; + break; +#endif +#ifdef LC_MESSAGES + case LC_MESSAGES: + retval = "LC_MESSAGES"; + break; +#endif +#ifdef LC_RESPONSE + case LC_RESPONSE: + retval = "LC_RESPONSE"; + break; +#endif +#ifdef LC_ALL + case LC_ALL: + /* This might not make sense but is perhaps better than any other + value. */ + retval = "LC_ALL"; + break; +#endif + default: + /* If you have a better idea for a default value let me know. */ + retval = "LC_XXX"; + } + + return retval; +} + +/* Guess value of current locale from value of the environment variables. */ +static const char *guess_category_value (category, categoryname) + int category; + const char *categoryname; +{ + const char *retval; + + /* The highest priority value is the `LANGUAGE' environment + variable. This is a GNU extension. */ + retval = getenv ("LANGUAGE"); + if (retval != NULL && retval[0] != '\0') + return retval; + + /* `LANGUAGE' is not set. So we have to proceed with the POSIX + methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some + systems this can be done by the `setlocale' function itself. */ +#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL + return setlocale (category, NULL); +#else + /* Setting of LC_ALL overwrites all other. */ + retval = getenv ("LC_ALL"); + if (retval != NULL && retval[0] != '\0') + return retval; + + /* Next comes the name of the desired category. */ + retval = getenv (categoryname); + if (retval != NULL && retval[0] != '\0') + return retval; + + /* Last possibility is the LANG environment variable. */ + retval = getenv ("LANG"); + if (retval != NULL && retval[0] != '\0') + return retval; + + /* We use C as the default domain. POSIX says this is implementation + defined. */ + return "C"; +#endif +} diff --git a/src/apps/bin/sharutils-4.2.1/intl/dcgettext.o b/src/apps/bin/sharutils-4.2.1/intl/dcgettext.o new file mode 100644 index 0000000000..6b535b205e Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/dcgettext.o differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/dgettext.c b/src/apps/bin/sharutils-4.2.1/intl/dgettext.c new file mode 100644 index 0000000000..2fde6770f7 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/dgettext.c @@ -0,0 +1,59 @@ +/* dgettext.c -- implementation of the dgettext(3) function + Copyright (C) 1995 Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined HAVE_LOCALE_H || defined _LIBC +# include +#endif + +#ifdef _LIBC +# include +#else +# include "libgettext.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DGETTEXT __dgettext +# define DCGETTEXT __dcgettext +#else +# define DGETTEXT dgettext__ +# define DCGETTEXT dcgettext__ +#endif + +/* Look up MSGID in the DOMAINNAME message catalog of the current + LC_MESSAGES locale. */ +char * +DGETTEXT (domainname, msgid) + const char *domainname; + const char *msgid; +{ + return DCGETTEXT (domainname, msgid, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__dgettext, dgettext); +#endif diff --git a/src/apps/bin/sharutils-4.2.1/intl/dgettext.o b/src/apps/bin/sharutils-4.2.1/intl/dgettext.o new file mode 100644 index 0000000000..bf8d8afdf8 Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/dgettext.o differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/finddomain.c b/src/apps/bin/sharutils-4.2.1/intl/finddomain.c new file mode 100644 index 0000000000..007a87e075 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/finddomain.c @@ -0,0 +1,503 @@ +/* finddomain.c -- handle list of needed message catalogs + Copyright (C) 1995 Software Foundation, Inc. + Written by Ulrich Drepper , 1995. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#if defined STDC_HEADERS || defined _LIBC +# include +#else +# ifdef HAVE_MALLOC_H +# include +# else +void free (); +# endif +#endif + +#if defined HAVE_STRING_H || defined _LIBC +# include +#else +# include +#endif +#if !HAVE_STRCHR && !defined _LIBC +# ifndef strchr +# define strchr index +# endif +#endif + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#include "gettext.h" +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgettext.h" +#endif + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# define stpcpy __stpcpy +#endif + +/* Encoding of locale name parts. */ +#define CEN_REVISION 1 +#define CEN_SPONSOR 2 +#define CEN_SPECIAL 4 +#define XPG_CODESET 8 +#define TERRITORY 16 +#define CEN_AUDIENCE 32 +#define XPG_MODIFIER 64 + +#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) +#define XPG_SPECIFIC (XPG_CODESET|XPG_MODIFIER) + + +/* List of already loaded domains. */ +static struct loaded_domain *_nl_loaded_domains; + +/* Prototypes for local functions. */ +static struct loaded_domain *make_entry_rec __P ((const char *dirname, + int mask, + const char *language, + const char *territory, + const char *codeset, + const char *modifier, + const char *special, + const char *sponsor, + const char *revision, + const char *domainname, + int do_allocate)); + +/* Substitution for systems lacking this function in their C library. */ +#if !_LIBC && !HAVE_STPCPY +static char *stpcpy __P ((char *dest, const char *src)); +#endif + + +/* Return a data structure describing the message catalog described by + the DOMAINNAME and CATEGORY parameters with respect to the currently + established bindings. */ +struct loaded_domain * +_nl_find_domain (dirname, locale, domainname) + const char *dirname; + char *locale; + const char *domainname; +{ + enum { undecided, xpg, cen } syntax; + struct loaded_domain *retval; + const char *language; + const char *modifier = NULL; + const char *territory = NULL; + const char *codeset = NULL; + const char *special = NULL; + const char *sponsor = NULL; + const char *revision = NULL; + const char *alias_value = NULL; + char *cp; + int mask; + + /* CATEGORYVALUE now possibly contains a colon separated list of + locales. Each single locale can consist of up to four recognized + parts for the XPG syntax: + + language[_territory[.codeset]][@modifier] + + and six parts for the CEN syntax: + + language[_territory][+audience][+special][,sponsor][_revision] + + Beside the first all of them are allowed to be missing. If the + full specified locale is not found, the less specific one are + looked for. The various part will be stripped of according to + the following order: + (1) revision + (2) sponsor + (3) special + (4) codeset + (5) territory + (6) audience/modifier + */ + + /* If we have already tested for this locale entry there has to + be one data set in the list of loaded domains. */ + retval = make_entry_rec (dirname, 0, locale, NULL, NULL, NULL, + NULL, NULL, NULL, domainname, 0); + if (retval != NULL) + { + /* We know something about this locale. */ + int cnt; + + if (retval->decided == 0) + _nl_load_domain (retval); /* @@@ */ + + if (retval->data != NULL) + return retval; + + for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) + { + if (retval->successor[cnt]->decided == 0) + _nl_load_domain (retval->successor[cnt]); + + if (retval->successor[cnt]->data != NULL) + break; + } + + /* We really found some usable information. */ + return cnt >= 0 ? retval : NULL; + /* NOTREACHED */ + } + + /* See whether the locale value is an alias. If yes its value + *overwrites* the alias name. No test for the original value is + done. */ + alias_value = _nl_expand_alias (locale); + if (alias_value != NULL) + { + size_t len = strlen (alias_value) + 1; + locale = (char *) malloc (len); + if (locale == NULL) + return NULL; + + memcpy (locale, alias_value, len); + } + + /* Now we determine the single parts of the locale name. First + look for the language. Termination symbols are `_' and `@' if + we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ + mask = 0; + syntax = undecided; + language = cp = locale; + while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@' + && cp[0] != '+' && cp[0] != ',') + ++cp; + + if (language == cp) + /* This does not make sense: language has to be specified. Use + this entry as it is without exploding. Perhaps it is an alias. */ + cp = strchr (language, '\0'); + else if (cp[0] == '_') + { + /* Next is the territory. */ + cp[0] = '\0'; + territory = ++cp; + + while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' + && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') + ++cp; + + mask |= TERRITORY; + + if (cp[0] == '.') + { + /* Next is the codeset. */ + syntax = xpg; + cp[0] = '\0'; + codeset = ++cp; + + while (cp[0] != '\0' && cp[0] != '@') + ++cp; + + mask |= XPG_CODESET; + } + } + + if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) + { + /* Next is the modifier. */ + syntax = cp[0] == '@' ? xpg : cen; + cp[0] = '\0'; + modifier = ++cp; + + while (syntax == cen && cp[0] != '\0' && cp[0] != '+' + && cp[0] != ',' && cp[0] != '_') + ++cp; + + mask |= XPG_MODIFIER | CEN_AUDIENCE; + } + + if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) + { + syntax = cen; + + if (cp[0] == '+') + { + /* Next is special application (CEN syntax). */ + cp[0] = '\0'; + special = ++cp; + + while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') + ++cp; + + mask |= CEN_SPECIAL; + } + + if (cp[0] == ',') + { + /* Next is sponsor (CEN syntax). */ + cp[0] = '\0'; + sponsor = ++cp; + + while (cp[0] != '\0' && cp[0] != '_') + ++cp; + + mask |= CEN_SPONSOR; + } + + if (cp[0] == '_') + { + /* Next is revision (CEN syntax). */ + cp[0] = '\0'; + revision = ++cp; + + mask |= CEN_REVISION; + } + } + + /* For CEN sytnax values it might be important to have the + separator character in the file name, not for XPG syntax. */ + if (syntax == xpg) + { + if (territory != NULL && territory[0] == '\0') + mask &= ~TERRITORY; + + if (codeset != NULL && codeset[0] == '\0') + mask &= ~XPG_CODESET; + + if (modifier != NULL && modifier[0] == '\0') + mask &= ~XPG_MODIFIER; + } + + /* Create all possible locale entries which might be interested in + generalzation. */ + retval = make_entry_rec (dirname, mask, language, territory, codeset, + modifier, special, sponsor, revision, + domainname, 1); + if (retval == NULL) + /* This means we are out of core. */ + return NULL; + + if (retval->decided == 0) + _nl_load_domain (retval); + if (retval->data == NULL) + { + int cnt; + for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) + { + if (retval->successor[cnt]->decided == 0) + _nl_load_domain (retval->successor[cnt]); + if (retval->successor[cnt]->data != NULL) + break; + + /* Signal that locale is not available. */ + retval->successor[cnt] = NULL; + } + if (retval->successor[cnt] == NULL) + retval = NULL; + } + + /* The room for an alias was dynamically allocated. Free it now. */ + if (alias_value != NULL) + free (locale); + + return retval; +} + + +static struct loaded_domain * +make_entry_rec (dirname, mask, language, territory, codeset, modifier, + special, sponsor, revision, domain, do_allocate) + const char *dirname; + int mask; + const char *language; + const char *territory; + const char *codeset; + const char *modifier; + const char *special; + const char *sponsor; + const char *revision; + const char *domain; + int do_allocate; +{ + char *filename = NULL; + struct loaded_domain *last = NULL; + struct loaded_domain *retval; + char *cp; + size_t entries; + int cnt; + + + /* Process the current entry described by the MASK only when it is + valid. Because the mask can have in the first call bits from + both syntaces set this is necessary to prevent constructing + illegal local names. */ + /* FIXME: Rewrite because test is necessary only in first round. */ + if ((mask & CEN_SPECIFIC) == 0 || (mask & XPG_SPECIFIC) == 0) + { + /* Allocate room for the full file name. */ + filename = (char *) malloc (strlen (dirname) + 1 + + strlen (language) + + ((mask & TERRITORY) != 0 + ? strlen (territory) : 0) + + ((mask & XPG_CODESET) != 0 + ? strlen (codeset) : 0) + + ((mask & XPG_MODIFIER) != 0 ? + strlen (modifier) : 0) + + ((mask & CEN_SPECIAL) != 0 + ? strlen (special) : 0) + + ((mask & CEN_SPONSOR) != 0 + ? strlen (sponsor) : 0) + + ((mask & CEN_REVISION) != 0 + ? strlen (revision) : 0) + 1 + + strlen (domain) + 1); + + if (filename == NULL) + return NULL; + + retval = NULL; + last = NULL; + + /* Construct file name. */ + cp = stpcpy (filename, dirname); + *cp++ = '/'; + cp = stpcpy (cp, language); + + if ((mask & TERRITORY) != 0) + { + *cp++ = '_'; + cp = stpcpy (cp, territory); + } + if ((mask & XPG_CODESET) != 0) + { + *cp++ = '.'; + cp = stpcpy (cp, codeset); + } + if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0) + { + /* This component can be part of both syntaces but has different + leading characters. For CEN we use `+', else `@'. */ + *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; + cp = stpcpy (cp, modifier); + } + if ((mask & CEN_SPECIAL) != 0) + { + *cp++ = '+'; + cp = stpcpy (cp, special); + } + if ((mask & CEN_SPONSOR) != 0) + { + *cp++ = ','; + cp = stpcpy (cp, sponsor); + } + if ((mask & CEN_REVISION) != 0) + { + *cp++ = '_'; + cp = stpcpy (cp, revision); + } + + *cp++ = '/'; + stpcpy (cp, domain); + + /* Look in list of already loaded domains whether it is already + available. */ + last = NULL; + for (retval = _nl_loaded_domains; retval != NULL; retval = retval->next) + if (retval->filename != NULL) + { + int compare = strcmp (retval->filename, filename); + if (compare == 0) + /* We found it! */ + break; + if (compare < 0) + { + /* It's not in the list. */ + retval = NULL; + break; + } + + last = retval; + } + + if (retval != NULL || do_allocate == 0) + { + free (filename); + return retval; + } + } + + retval = (struct loaded_domain *) malloc (sizeof (*retval)); + if (retval == NULL) + return NULL; + + retval->filename = filename; + retval->decided = 0; + + if (last == NULL) + { + retval->next = _nl_loaded_domains; + _nl_loaded_domains = retval; + } + else + { + retval->next = last->next; + last->next = retval; + } + + entries = 0; + for (cnt = 126; cnt >= 0; --cnt) + if (cnt < mask && (cnt & ~mask) == 0 + && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)) + retval->successor[entries++] = make_entry_rec (dirname, cnt, + language, territory, + codeset, modifier, + special, sponsor, + revision, domain, 1); + retval->successor[entries] = NULL; + + return retval; +} + + +/* @@ begin of epilog @@ */ + +/* We don't want libintl.a to depend on any other library. So we + avoid the non-standard function stpcpy. In GNU C Library this + function is available, though. Also allow the symbol HAVE_STPCPY + to be defined. */ +#if !_LIBC && !HAVE_STPCPY +static char * +stpcpy (dest, src) + char *dest; + const char *src; +{ + while ((*dest++ = *src++) != '\0') + /* Do nothing. */ ; + return dest - 1; +} +#endif diff --git a/src/apps/bin/sharutils-4.2.1/intl/finddomain.o b/src/apps/bin/sharutils-4.2.1/intl/finddomain.o new file mode 100644 index 0000000000..7ff4244ea5 Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/finddomain.o differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/gettext.c b/src/apps/bin/sharutils-4.2.1/intl/gettext.c new file mode 100644 index 0000000000..7bed6369b4 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/gettext.c @@ -0,0 +1,70 @@ +/* gettext.c -- implementation of gettext(3) function + Copyright (C) 1995 Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef _LIBC +# define __need_NULL +# include +#else +# ifdef STDC_HEADERS +# include /* Just for NULL. */ +# else +# ifdef HAVE_STRING_H +# include +# else +# define NULL ((void *) 0) +# endif +# endif +#endif + +#ifdef _LIBC +# include +#else +# include "libgettext.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define GETTEXT __gettext +# define DGETTEXT __dgettext +#else +# define GETTEXT gettext__ +# define DGETTEXT dgettext__ +#endif + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +char * +GETTEXT (msgid) + const char *msgid; +{ + return DGETTEXT (NULL, msgid); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__gettext, gettext); +#endif diff --git a/src/apps/bin/sharutils-4.2.1/intl/gettext.h b/src/apps/bin/sharutils-4.2.1/intl/gettext.h new file mode 100644 index 0000000000..5190f09447 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/gettext.h @@ -0,0 +1,105 @@ +/* gettext.h - internal header for GNU gettext internationalization functions + Copyright (C) 1995 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 Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifndef _GETTEXT_H +#define _GETTEXT_H 1 + +#include + +#if HAVE_LIMITS_H || _LIBC +# include +#endif + +/* @@ end of prolog @@ */ + +/* The magic number of the GNU message catalog format. */ +#define _MAGIC 0x950412de +#define _MAGIC_SWAPPED 0xde120495 + +/* Revision number of the currently used .mo (binary) file format. */ +#define MO_REVISION_NUMBER 0 + +/* The following contortions are an attempt to use the C preprocessor + to determine an unsigned integral type that is 32 bits wide. An + alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but + doing that would require that the configure script compile and *run* + the resulting executable. Locally running cross-compiled executables + is usually not possible. */ + +#if __STDC__ +# define UINT_MAX_32_BITS 4294967295U +#else +# define UINT_MAX_32_BITS 0xFFFFFFFF +#endif + +/* If UINT_MAX isn't defined, assume it's a 32-bit type. + This should be valid for all systems GNU cares about because + that doesn't include 16-bit systems, and only modern systems + (that certainly have ) have 64+-bit integral types. */ + +#ifndef UINT_MAX +# define UINT_MAX UINT_MAX_32_BITS +#endif + +#if UINT_MAX == UINT_MAX_32_BITS +typedef unsigned nls_uint32; +#else +# if USHRT_MAX == UINT_MAX_32_BITS +typedef unsigned short nls_uint32; +# else +# if ULONG_MAX == UINT_MAX_32_BITS +typedef unsigned long nls_uint32; +# else + /* The following line is intended to throw an error. Using #error is + not portable enough. */ + "Cannot determine unsigned 32-bit data type." +# endif +# endif +#endif + + +/* Header for binary .mo file format. */ +struct mo_file_header +{ + /* The magic number. */ + nls_uint32 magic; + /* The revision number of the file format. */ + nls_uint32 revision; + /* The number of strings pairs. */ + nls_uint32 nstrings; + /* Offset of table with start offsets of original strings. */ + nls_uint32 orig_tab_offset; + /* Offset of table with start offsets of translation strings. */ + nls_uint32 trans_tab_offset; + /* Size of hashing table. */ + nls_uint32 hash_tab_size; + /* Offset of first hashing entry. */ + nls_uint32 hash_tab_offset; +}; + +struct string_desc +{ + /* Length of addressed string. */ + nls_uint32 length; + /* Offset of string in file. */ + nls_uint32 offset; +}; + +/* @@ begin of epilog @@ */ + +#endif /* gettext.h */ diff --git a/src/apps/bin/sharutils-4.2.1/intl/gettext.o b/src/apps/bin/sharutils-4.2.1/intl/gettext.o new file mode 100644 index 0000000000..b983866230 Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/gettext.o differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/gettextP.h b/src/apps/bin/sharutils-4.2.1/intl/gettextP.h new file mode 100644 index 0000000000..6d53ac1a15 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/gettextP.h @@ -0,0 +1,79 @@ +/* gettextP.h -- header describing internals of gettext library + Copyright (C) 1995 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _GETTEXTP_H +#define _GETTEXTP_H + +/* @@ end of prolog @@ */ + +#ifndef __P +# if __STDC__ +# define __P(args) args +# else +# define __P(args) () +# endif +#endif + +#ifndef W +# define W(flag, data) ((flag) ? SWAP (data) : (data)) +#endif + + +static nls_uint32 SWAP __P ((nls_uint32 i)); + +static inline nls_uint32 +SWAP (i) + nls_uint32 i; +{ + return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); +} + + +struct loaded_domain +{ + struct loaded_domain *next; + struct loaded_domain *successor[31]; + + const char *filename; + int decided; + + const char *data; + int must_swap; + nls_uint32 nstrings; + struct string_desc *orig_tab; + struct string_desc *trans_tab; + nls_uint32 hash_size; + nls_uint32 *hash_tab; +}; + +struct binding +{ + struct binding *next; + char *domainname; + char *dirname; +}; + +struct loaded_domain *_nl_find_domain __P ((const char *__dirname, + char *__locale, + const char *__domainname)); +void _nl_load_domain __P ((struct loaded_domain *__domain)); + +const char *_nl_expand_alias __P ((const char *__name)); + +/* @@ begin of epilog @@ */ + +#endif /* gettextP.h */ diff --git a/src/apps/bin/sharutils-4.2.1/intl/hash-string.h b/src/apps/bin/sharutils-4.2.1/intl/hash-string.h new file mode 100644 index 0000000000..3b38bd115c --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/hash-string.h @@ -0,0 +1,62 @@ +/* hash-string - Implements a string hashing function. + Copyright (C) 1995 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_VALUES_H +# include +#endif + +/* @@ end of prolog @@ */ + +#ifndef __P +# if __STDC__ +# define __P(Args) Args +# else +# define __P(Args) () +# endif +#endif + +/* We assume to have `unsigned long int' value with at least 32 bits. */ +#define HASHWORDBITS 32 + + +/* Defines the so called `hashpjw' function by P.J. Weinberger + [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, + 1986, 1987 Bell Telephone Laboratories, Inc.] */ +static unsigned long hash_string __P ((const char *__str_param)); + +static inline unsigned long +hash_string (str_param) + const char *str_param; +{ + unsigned long int hval, g; + const char *str = str_param; + + /* Compute the hash value for the given string. */ + hval = 0; + while (*str != '\0') + { + hval <<= 4; + hval += (unsigned long) *str++; + g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4)); + if (g != 0) + { + hval ^= g >> (HASHWORDBITS - 8); + hval ^= g; + } + } + return hval; +} diff --git a/src/apps/bin/sharutils-4.2.1/intl/intl-compat.c b/src/apps/bin/sharutils-4.2.1/intl/intl-compat.c new file mode 100644 index 0000000000..503efa0fa9 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/intl-compat.c @@ -0,0 +1,76 @@ +/* intl-compat.c - Stub functions to call gettext functions from GNU gettext + Library. + Copyright (C) 1995 Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "libgettext.h" + +/* @@ end of prolog @@ */ + + +#undef gettext +#undef dgettext +#undef dcgettext +#undef textdomain +#undef bindtextdomain + + +char * +bindtextdomain (domainname, dirname) + const char *domainname; + const char *dirname; +{ + return bindtextdomain__ (domainname, dirname); +} + + +char * +dcgettext (domainname, msgid, category) + const char *domainname; + const char *msgid; + int category; +{ + return dcgettext__ (domainname, msgid, category); +} + + +char * +dgettext (domainname, msgid) + const char *domainname; + const char *msgid; +{ + return dgettext__ (domainname, msgid); +} + + +char * +gettext (msgid) + const char *msgid; +{ + return gettext__ (msgid); +} + + +char * +textdomain (domainname) + const char *domainname; +{ + return textdomain__ (domainname); +} diff --git a/src/apps/bin/sharutils-4.2.1/intl/intl-compat.o b/src/apps/bin/sharutils-4.2.1/intl/intl-compat.o new file mode 100644 index 0000000000..0aeeb3c86a Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/intl-compat.o differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/libgettext.h b/src/apps/bin/sharutils-4.2.1/intl/libgettext.h new file mode 100644 index 0000000000..4570cdf4b5 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/libgettext.h @@ -0,0 +1,177 @@ +/* libgettext.h -- Message catalogs for internationalization. + Copyright (C) 1995 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Because on some systems (e.g. Solaris) we sometimes have to include + the systems libintl.h as well as this file we have more complex + include protection above. But the systems header might perhaps also + define _LIBINTL_H and therefore we have to protect the definition here. */ + +#if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H) +#if !_LIBINTL_H +# define _LIBINTL_H 1 +#endif +#define _LIBGETTEXT_H 1 + +/* We define an additional symbol to signal that we use the GNU + implementation of gettext. */ +#define __USE_GNU_GETTEXT 1 + +#include + +#if HAVE_LOCALE_H +# include +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +/* @@ end of prolog @@ */ + +#ifndef __P +# if __STDC__ +# define __P(args) args +# else +# define __P(args) () +# endif +#endif + +#ifndef NULL +# if !defined __cplusplus || defined __GNUC__ +# define NULL ((void *) 0) +# else +# define NULL (0) +# endif +#endif + +#if !HAVE_LC_MESSAGES +/* This value determines the behaviour of the gettext() and dgettext() + function. But some system does not have this defined. Define it + to a default value. */ +# define LC_MESSAGES (-1) +#endif + + +/* Declarations for gettext-using-catgets interface. Derived from + Jim Meyering's libintl.h. */ +struct _msg_ent +{ + const char *_msg; + int _msg_number; +}; + + +#if HAVE_CATGETS +/* These two variables are defined in the automatically by po-to-tbl.sed + generated file `cat-id-tbl.c'. */ +extern const struct _msg_ent _msg_tbl[]; +extern int _msg_tbl_length; +#endif + + +/* For automatical extraction of messages sometimes no real + translation is needed. Instead the string itself is the result. */ +#define gettext_noop(Str) (Str) + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +extern char *gettext __P ((const char *__msgid)); +extern char *gettext__ __P ((const char *__msgid)); + +/* Look up MSGID in the DOMAINNAME message catalog for the current + LC_MESSAGES locale. */ +extern char *dgettext __P ((const char *__domainname, const char *__msgid)); +extern char *dgettext__ __P ((const char *__domainname, const char *__msgid)); + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +extern char *dcgettext __P ((const char *__domainname, const char *__msgid, + int __category)); +extern char *dcgettext__ __P ((const char *__domainname, const char *__msgid, + int __category)); + + +/* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +extern char *textdomain __P ((const char *__domainname)); +extern char *textdomain__ __P ((const char *__domainname)); + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +extern char *bindtextdomain __P ((const char *__domainname, + const char *__dirname)); +extern char *bindtextdomain__ __P ((const char *__domainname, + const char *__dirname)); + +#if ENABLE_NLS + +/* Solaris 2.3 has the gettext function but dcgettext is missing. + So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4 + has dcgettext. */ +# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT) + +# define gettext(Msgid) \ + dgettext (NULL, Msgid) + +# define dgettext(Domainname, Msgid) \ + dcgettext (Domainname, Msgid, LC_MESSAGES) + +# if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7 +# define dcgettext(Domainname, Msgid, Category) \ + (__extension__ \ + ({ \ + char *result; \ + if (__builtin_constant_p (Msgid)) \ + { \ + extern int _nl_msg_cat_cntr; \ + static char *__translation__; \ + static int __catalog_counter__; \ + if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \ + { \ + __translation__ = \ + dcgettext__ ((Domainname), (Msgid), (Category)); \ + __catalog_counter__ = _nl_msg_cat_cntr; \ + } \ + result = __translation__; \ + } \ + else \ + result = dcgettext__ ((Domainname), (Msgid), (Category)); \ + result; \ + })) +# endif +# endif + +#else + +# define gettext(Msgid) (Msgid) +# define dgettext(Domainname, Msgid) (Msgid) +# define dcgettext(Domainname, Msgid, Category) (Msgid) +# define textdomain(Domainname) while (0) /* nothing */ +# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ + +#endif + +/* @@ begin of epilog @@ */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/apps/bin/sharutils-4.2.1/intl/libintl.a b/src/apps/bin/sharutils-4.2.1/intl/libintl.a new file mode 100644 index 0000000000..b9f6065131 Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/libintl.a differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/libintl.h b/src/apps/bin/sharutils-4.2.1/intl/libintl.h new file mode 100644 index 0000000000..4570cdf4b5 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/libintl.h @@ -0,0 +1,177 @@ +/* libgettext.h -- Message catalogs for internationalization. + Copyright (C) 1995 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Because on some systems (e.g. Solaris) we sometimes have to include + the systems libintl.h as well as this file we have more complex + include protection above. But the systems header might perhaps also + define _LIBINTL_H and therefore we have to protect the definition here. */ + +#if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H) +#if !_LIBINTL_H +# define _LIBINTL_H 1 +#endif +#define _LIBGETTEXT_H 1 + +/* We define an additional symbol to signal that we use the GNU + implementation of gettext. */ +#define __USE_GNU_GETTEXT 1 + +#include + +#if HAVE_LOCALE_H +# include +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +/* @@ end of prolog @@ */ + +#ifndef __P +# if __STDC__ +# define __P(args) args +# else +# define __P(args) () +# endif +#endif + +#ifndef NULL +# if !defined __cplusplus || defined __GNUC__ +# define NULL ((void *) 0) +# else +# define NULL (0) +# endif +#endif + +#if !HAVE_LC_MESSAGES +/* This value determines the behaviour of the gettext() and dgettext() + function. But some system does not have this defined. Define it + to a default value. */ +# define LC_MESSAGES (-1) +#endif + + +/* Declarations for gettext-using-catgets interface. Derived from + Jim Meyering's libintl.h. */ +struct _msg_ent +{ + const char *_msg; + int _msg_number; +}; + + +#if HAVE_CATGETS +/* These two variables are defined in the automatically by po-to-tbl.sed + generated file `cat-id-tbl.c'. */ +extern const struct _msg_ent _msg_tbl[]; +extern int _msg_tbl_length; +#endif + + +/* For automatical extraction of messages sometimes no real + translation is needed. Instead the string itself is the result. */ +#define gettext_noop(Str) (Str) + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +extern char *gettext __P ((const char *__msgid)); +extern char *gettext__ __P ((const char *__msgid)); + +/* Look up MSGID in the DOMAINNAME message catalog for the current + LC_MESSAGES locale. */ +extern char *dgettext __P ((const char *__domainname, const char *__msgid)); +extern char *dgettext__ __P ((const char *__domainname, const char *__msgid)); + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +extern char *dcgettext __P ((const char *__domainname, const char *__msgid, + int __category)); +extern char *dcgettext__ __P ((const char *__domainname, const char *__msgid, + int __category)); + + +/* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +extern char *textdomain __P ((const char *__domainname)); +extern char *textdomain__ __P ((const char *__domainname)); + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +extern char *bindtextdomain __P ((const char *__domainname, + const char *__dirname)); +extern char *bindtextdomain__ __P ((const char *__domainname, + const char *__dirname)); + +#if ENABLE_NLS + +/* Solaris 2.3 has the gettext function but dcgettext is missing. + So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4 + has dcgettext. */ +# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT) + +# define gettext(Msgid) \ + dgettext (NULL, Msgid) + +# define dgettext(Domainname, Msgid) \ + dcgettext (Domainname, Msgid, LC_MESSAGES) + +# if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7 +# define dcgettext(Domainname, Msgid, Category) \ + (__extension__ \ + ({ \ + char *result; \ + if (__builtin_constant_p (Msgid)) \ + { \ + extern int _nl_msg_cat_cntr; \ + static char *__translation__; \ + static int __catalog_counter__; \ + if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \ + { \ + __translation__ = \ + dcgettext__ ((Domainname), (Msgid), (Category)); \ + __catalog_counter__ = _nl_msg_cat_cntr; \ + } \ + result = __translation__; \ + } \ + else \ + result = dcgettext__ ((Domainname), (Msgid), (Category)); \ + result; \ + })) +# endif +# endif + +#else + +# define gettext(Msgid) (Msgid) +# define dgettext(Domainname, Msgid) (Msgid) +# define dcgettext(Domainname, Msgid, Category) (Msgid) +# define textdomain(Domainname) while (0) /* nothing */ +# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ + +#endif + +/* @@ begin of epilog @@ */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/apps/bin/sharutils-4.2.1/intl/linux-msg.sed b/src/apps/bin/sharutils-4.2.1/intl/linux-msg.sed new file mode 100644 index 0000000000..5918e720a9 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/linux-msg.sed @@ -0,0 +1,100 @@ +# po2msg.sed - Convert Uniforum style .po file to Linux style .msg file +# Copyright (C) 1995 Free Software Foundation, Inc. +# Ulrich Drepper , 1995. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# +# The first directive in the .msg should be the definition of the +# message set number. We use always set number 1. +# +1 { + i\ +$set 1 # Automatically created by po2msg.sed + h + s/.*/0/ + x +} +# +# Mitch's old catalog format does not allow comments. +# +# We copy the original message as a comment into the .msg file. +# +/^msgid/ { + s/msgid[ ]*"// +# +# This does not work now with the new format. +# /"$/! { +# s/\\$// +# s/$/ ... (more lines following)"/ +# } + x +# The following nice solution is by +# Bruno + td +# Increment a decimal number in pattern space. +# First hide trailing `9' digits. + :d + s/9\(_*\)$/_\1/ + td +# Assure at least one digit is available. + s/^\(_*\)$/0\1/ +# Increment the last digit. + s/8\(_*\)$/9\1/ + s/7\(_*\)$/8\1/ + s/6\(_*\)$/7\1/ + s/5\(_*\)$/6\1/ + s/4\(_*\)$/5\1/ + s/3\(_*\)$/4\1/ + s/2\(_*\)$/3\1/ + s/1\(_*\)$/2\1/ + s/0\(_*\)$/1\1/ +# Convert the hidden `9' digits to `0's. + s/_/0/g + x + G + s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p +} +# +# The .msg file contains, other then the .po file, only the translations +# but each given a unique ID. Starting from 1 and incrementing by 1 for +# each message we assign them to the messages. +# It is important that the .po file used to generate the cat-id-tbl.c file +# (with po-to-tbl) is the same as the one used here. (At least the order +# of declarations must not be changed.) +# +/^msgstr/ { + s/msgstr[ ]*"\(.*\)"/# \1/ +# Clear substitution flag. + tb +# Append the next line. + :b + N +# Look whether second part is continuation line. + s/\(.*\n\)"\(.*\)"/\1\2/ +# Yes, then branch. + ta + P + D +# Note that D includes a jump to the start!! +# We found a continuation line. But before printing insert '\'. + :a + s/\(.*\)\(\n.*\)/\1\\\2/ + P +# We cannot use D here. + s/.*\n\(.*\)/\1/ + tb +} +d diff --git a/src/apps/bin/sharutils-4.2.1/intl/loadmsgcat.c b/src/apps/bin/sharutils-4.2.1/intl/loadmsgcat.c new file mode 100644 index 0000000000..d98f365bf9 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/loadmsgcat.c @@ -0,0 +1,191 @@ +/* loadmsgcat.c -- load needed message catalogs + Copyright (C) 1995 Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#if defined STDC_HEADERS || defined _LIBC +# include +#endif + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC +# include +#endif + +#include "gettext.h" +#include "gettextP.h" + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# define fstat __fstat +# define open __open +# define close __close +# define read __read +# define mmap __mmap +# define munmap __munmap +#endif + +/* We need a sign, whether a new catalog was loaded, which can be associated + with all translations. This is important if the translations are + cached by one of GCC's features. */ +int _nl_msg_cat_cntr; + + +/* Load the message catalogs specified by FILENAME. If it is no valid + message catalog do nothing. */ +void +_nl_load_domain (domain) + struct loaded_domain *domain; +{ + int fd; + struct stat st; + struct mo_file_header *data = (struct mo_file_header *) -1; +#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ + || defined _LIBC + int use_mmap = 0; +#endif + + domain->decided = 1; + domain->data = NULL; + + /* If the record does not represent a valid locale the FILENAME + might be NULL. This can happen when according to the given + specification the locale file name is different for XPG and CEN + syntax. */ + if (domain->filename == NULL) + return; + + /* Try to open the addressed file. */ + fd = open (domain->filename, O_RDONLY); + if (fd == -1) + return; + + /* We must know about the size of the file. */ + if (fstat (fd, &st) != 0 + && st.st_size < (off_t) sizeof (struct mo_file_header)) + { + /* Something went wrong. */ + close (fd); + return; + } + +#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ + || defined _LIBC + /* Now we are ready to load the file. If mmap() is available we try + this first. If not available or it failed we try to load it. */ + data = (struct mo_file_header *) mmap (NULL, st.st_size, PROT_READ, + MAP_PRIVATE, fd, 0); + + if (data != (struct mo_file_header *) -1) + { + /* mmap() call was successful. */ + close (fd); + use_mmap = 1; + } +#endif + + /* If the data is not yet available (i.e. mmap'ed) we try to load + it manually. */ + if (data == (struct mo_file_header *) -1) + { + off_t to_read; + char *read_ptr; + + data = (struct mo_file_header *) malloc (st.st_size); + if (data == NULL) + return; + + to_read = st.st_size; + read_ptr = (char *) data; + do + { + long int nb = (long int) read (fd, read_ptr, to_read); + if (nb == -1) + { + close (fd); + return; + } + + read_ptr += nb; + to_read -= nb; + } + while (to_read > 0); + + close (fd); + } + + /* Using the magic number we can test whether it really is a message + catalog file. */ + if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED) + { + /* The magic number is wrong: not a message catalog file. */ +#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ + || defined _LIBC + if (use_mmap) + munmap ((caddr_t) data, st.st_size); + else +#endif + free (data); + return; + } + + domain->data = (char *) data; + domain->must_swap = data->magic != _MAGIC; + + /* Fill in the information about the available tables. */ + switch (W (domain->must_swap, data->revision)) + { + case 0: + domain->nstrings = W (domain->must_swap, data->nstrings); + domain->orig_tab = (struct string_desc *) + ((char *) data + W (domain->must_swap, data->orig_tab_offset)); + domain->trans_tab = (struct string_desc *) + ((char *) data + W (domain->must_swap, data->trans_tab_offset)); + domain->hash_size = W (domain->must_swap, data->hash_tab_size); + domain->hash_tab = (nls_uint32 *) + ((char *) data + W (domain->must_swap, data->hash_tab_offset)); + break; + default: + /* This is an illegal revision. */ +#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ + || defined _LIBC + if (use_mmap) + munmap ((caddr_t) data, st.st_size); + else +#endif + free (data); + domain->data = NULL; + return; + } + + /* Show that one domain is changed. This might make some cached + translation invalid. */ + ++_nl_msg_cat_cntr; +} diff --git a/src/apps/bin/sharutils-4.2.1/intl/loadmsgcat.o b/src/apps/bin/sharutils-4.2.1/intl/loadmsgcat.o new file mode 100644 index 0000000000..3155756a8f Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/loadmsgcat.o differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/localealias.c b/src/apps/bin/sharutils-4.2.1/intl/localealias.c new file mode 100644 index 0000000000..b432e91150 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/localealias.c @@ -0,0 +1,317 @@ +/* localealias.c -- handle aliases for locale names + Copyright (C) 1995 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +#endif + +#if defined STDC_HEADERS || defined _LIBC +# include +#else +char *getenv (); +# ifdef HAVE_MALLOC_H +# include +# else +void free (); +# endif +#endif + +#if defined HAVE_STRING_H || defined _LIBC +# include +#else +# include +#endif +#if !HAVE_STRCHR && !defined _LIBC +# ifndef strchr +# define strchr index +# endif +#endif + +#include "gettext.h" +#include "gettextP.h" + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# define strcasecmp __strcasecmp +#endif + +struct alias_map +{ + const char *alias; + const char *value; +}; + + +static struct alias_map *map; +static size_t nmap = 0; +static size_t maxmap = 0; + + +/* Prototypes for local functions. */ +static size_t read_alias_file __P ((const char *fname, int fname_len)); +static void extend_alias_table __P ((void)); +static int alias_compare __P ((const struct alias_map *map1, + const struct alias_map *map2)); + + +const char * +_nl_expand_alias (name) + const char *name; +{ + static const char *locale_alias_path = LOCALE_ALIAS_PATH; + struct alias_map *retval; + size_t added; + + do + { + struct alias_map item; + + item.alias = name; + + if (nmap > 0) + retval = (struct alias_map *) bsearch (&item, map, nmap, + sizeof (struct alias_map), + (int (*) __P ((const void *, + const void *))) + alias_compare); + else + retval = NULL; + + /* We really found an alias. Return the value. */ + if (retval != NULL) + return retval->value; + + /* Perhaps we can find another alias file. */ + added = 0; + while (added == 0 && locale_alias_path[0] != '\0') + { + const char *start; + + while (locale_alias_path[0] == ':') + ++locale_alias_path; + start = locale_alias_path; + + while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':') + ++locale_alias_path; + + if (start < locale_alias_path) + added = read_alias_file (start, locale_alias_path - start); + } + } + while (added != 0); + + return NULL; +} + + +static size_t +read_alias_file (fname, fname_len) + const char *fname; + int fname_len; +{ + FILE *fp; + char *full_fname; + size_t added; + static const char aliasfile[] = "/locale.alias"; + + full_fname = (char *) alloca (fname_len + sizeof aliasfile); + memcpy (full_fname, fname, fname_len); + memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); + + fp = fopen (full_fname, "r"); + if (fp == NULL) + return 0; + + added = 0; + while (!feof (fp)) + { + /* It is a reasonable approach to use a fix buffer here because + a) we are only interested in the first two fields + b) these fields must be usable as file names and so must not + be that long + */ + char buf[BUFSIZ]; + char *alias; + char *value; + char *cp; + + if (fgets (buf, BUFSIZ, fp) == NULL) + /* EOF reached. */ + break; + + cp = buf; + /* Ignore leading white space. */ + while (isspace (cp[0])) + ++cp; + + /* A leading '#' signals a comment line. */ + if (cp[0] != '\0' && cp[0] != '#') + { + alias = cp++; + while (cp[0] != '\0' && !isspace (cp[0])) + ++cp; + /* Terminate alias name. */ + if (cp[0] != '\0') + *cp++ = '\0'; + + /* Now look for the beginning of the value. */ + while (isspace (cp[0])) + ++cp; + + if (cp[0] != '\0') + { + char *tp; + size_t len; + + value = cp++; + while (cp[0] != '\0' && !isspace (cp[0])) + ++cp; + /* Terminate value. */ + if (cp[0] == '\n') + { + /* This has to be done to make the following test + for the end of line possible. We are looking for + the terminating '\n' which do not overwrite here. */ + *cp++ = '\0'; + *cp = '\n'; + } + else if (cp[0] != '\0') + *cp++ = '\0'; + + if (nmap >= maxmap) + extend_alias_table (); + + /* We cannot depend on strdup available in the libc. Sigh! */ + len = strlen (alias) + 1; + tp = (char *) malloc (len); + if (tp == NULL) + return added; + memcpy (tp, alias, len); + map[nmap].alias = tp; + + len = strlen (value) + 1; + tp = (char *) malloc (len); + if (tp == NULL) + return added; + memcpy (tp, value, len); + map[nmap].value = tp; + + ++nmap; + ++added; + } + } + + /* Possibily not the whole line fitted into the buffer. Ignore + the rest of the line. */ + while (strchr (cp, '\n') == NULL) + { + cp = buf; + if (fgets (buf, BUFSIZ, fp) == NULL) + /* Make sure the inner loop will be left. The outer loop + will exit at the `feof' test. */ + *cp = '\n'; + } + } + + /* Should we test for ferror()? I think we have to silently ignore + errors. --drepper */ + fclose (fp); + + if (added > 0) + qsort (map, nmap, sizeof (struct alias_map), + (int (*) __P ((const void *, const void *))) alias_compare); + + return added; +} + + +static void +extend_alias_table () +{ + size_t new_size; + struct alias_map *new_map; + + new_size = maxmap == 0 ? 100 : 2 * maxmap; + new_map = (struct alias_map *) malloc (new_size + * sizeof (struct alias_map)); + if (new_map == NULL) + /* Simply don't extend: we don't have any more core. */ + return; + + memcpy (new_map, map, nmap * sizeof (struct alias_map)); + + if (maxmap != 0) + free (map); + + map = new_map; + maxmap = new_size; +} + + +static int +alias_compare (map1, map2) + const struct alias_map *map1; + const struct alias_map *map2; +{ +#if defined _LIBC || defined HAVE_STRCASECMP + return strcasecmp (map1->alias, map2->alias); +#else + const unsigned char *p1 = (const unsigned char *) map1->alias; + const unsigned char *p2 = (const unsigned char *) map2->alias; + unsigned char c1, c2; + + if (p1 == p2) + return 0; + + do + { + /* I know this seems to be odd but the tolower() function in + some systems libc cannot handle nonalpha characters. */ + c1 = isupper (*p1) ? tolower (*p1) : *p1; + c2 = isupper (*p2) ? tolower (*p2) : *p2; + if (c1 == '\0') + break; + } + while (c1 == c2); + + return c1 - c2; +#endif +} diff --git a/src/apps/bin/sharutils-4.2.1/intl/localealias.o b/src/apps/bin/sharutils-4.2.1/intl/localealias.o new file mode 100644 index 0000000000..f13022478f Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/localealias.o differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/po2tbl.sed b/src/apps/bin/sharutils-4.2.1/intl/po2tbl.sed new file mode 100644 index 0000000000..b3bcca4d73 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/po2tbl.sed @@ -0,0 +1,102 @@ +# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets +# Copyright (C) 1995 Free Software Foundation, Inc. +# Ulrich Drepper , 1995. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +1 { + i\ +/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\ +\ +#if HAVE_CONFIG_H\ +# include \ +#endif\ +\ +#include "libgettext.h"\ +\ +const struct _msg_ent _msg_tbl[] = { + h + s/.*/0/ + x +} +# +# Write msgid entries in C array form. +# +/^msgid/ { + s/msgid[ ]*\(".*"\)/ {\1/ + tb +# Append the next line + :b + N +# Look whether second part is continuation line. + s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/ +# Yes, then branch. + ta +# Because we assume that the input file correctly formed the line +# just read cannot be again be a msgid line. So it's safe to ignore +# it. + s/\(.*\)\n.*/\1/ + bc +# We found a continuation line. But before printing insert '\'. + :a + s/\(.*\)\(\n.*\)/\1\\\2/ + P +# We cannot use D here. + s/.*\n\(.*\)/\1/ +# Some buggy seds do not clear the `successful substitution since last ``t''' +# flag on `N', so we do a `t' here to clear it. + tb +# Not reached + :c + x +# The following nice solution is by +# Bruno + td +# Increment a decimal number in pattern space. +# First hide trailing `9' digits. + :d + s/9\(_*\)$/_\1/ + td +# Assure at least one digit is available. + s/^\(_*\)$/0\1/ +# Increment the last digit. + s/8\(_*\)$/9\1/ + s/7\(_*\)$/8\1/ + s/6\(_*\)$/7\1/ + s/5\(_*\)$/6\1/ + s/4\(_*\)$/5\1/ + s/3\(_*\)$/4\1/ + s/2\(_*\)$/3\1/ + s/1\(_*\)$/2\1/ + s/0\(_*\)$/1\1/ +# Convert the hidden `9' digits to `0's. + s/_/0/g + x + G + s/\(.*\)\n\([0-9]*\)/\1, \2},/ + s/\(.*\)"$/\1/ + p +} +# +# Last line. +# +$ { + i\ +};\ + + g + s/0*\(.*\)/int _msg_tbl_length = \1;/p +} +d diff --git a/src/apps/bin/sharutils-4.2.1/intl/po2tbl.sed.in b/src/apps/bin/sharutils-4.2.1/intl/po2tbl.sed.in new file mode 100644 index 0000000000..b3bcca4d73 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/po2tbl.sed.in @@ -0,0 +1,102 @@ +# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets +# Copyright (C) 1995 Free Software Foundation, Inc. +# Ulrich Drepper , 1995. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +1 { + i\ +/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\ +\ +#if HAVE_CONFIG_H\ +# include \ +#endif\ +\ +#include "libgettext.h"\ +\ +const struct _msg_ent _msg_tbl[] = { + h + s/.*/0/ + x +} +# +# Write msgid entries in C array form. +# +/^msgid/ { + s/msgid[ ]*\(".*"\)/ {\1/ + tb +# Append the next line + :b + N +# Look whether second part is continuation line. + s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/ +# Yes, then branch. + ta +# Because we assume that the input file correctly formed the line +# just read cannot be again be a msgid line. So it's safe to ignore +# it. + s/\(.*\)\n.*/\1/ + bc +# We found a continuation line. But before printing insert '\'. + :a + s/\(.*\)\(\n.*\)/\1\\\2/ + P +# We cannot use D here. + s/.*\n\(.*\)/\1/ +# Some buggy seds do not clear the `successful substitution since last ``t''' +# flag on `N', so we do a `t' here to clear it. + tb +# Not reached + :c + x +# The following nice solution is by +# Bruno + td +# Increment a decimal number in pattern space. +# First hide trailing `9' digits. + :d + s/9\(_*\)$/_\1/ + td +# Assure at least one digit is available. + s/^\(_*\)$/0\1/ +# Increment the last digit. + s/8\(_*\)$/9\1/ + s/7\(_*\)$/8\1/ + s/6\(_*\)$/7\1/ + s/5\(_*\)$/6\1/ + s/4\(_*\)$/5\1/ + s/3\(_*\)$/4\1/ + s/2\(_*\)$/3\1/ + s/1\(_*\)$/2\1/ + s/0\(_*\)$/1\1/ +# Convert the hidden `9' digits to `0's. + s/_/0/g + x + G + s/\(.*\)\n\([0-9]*\)/\1, \2},/ + s/\(.*\)"$/\1/ + p +} +# +# Last line. +# +$ { + i\ +};\ + + g + s/0*\(.*\)/int _msg_tbl_length = \1;/p +} +d diff --git a/src/apps/bin/sharutils-4.2.1/intl/textdomain.c b/src/apps/bin/sharutils-4.2.1/intl/textdomain.c new file mode 100644 index 0000000000..c06642b268 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/textdomain.c @@ -0,0 +1,97 @@ +/* textdomain.c -- implementation of the textdomain(3) function + Copyright (C) 1995 Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined STDC_HEADERS || defined _LIBC +# include +#endif + +#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC +# include +#else +# include +#endif + +#ifdef _LIBC +# include +#else +# include "libgettext.h" +#endif + +/* @@ end of prolog @@ */ + +/* Name of the default text domain. */ +extern const char _nl_default_default_domain[]; + +/* Default text domain in which entries for gettext(3) are to be found. */ +extern const char *_nl_current_default_domain; + + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define TEXTDOMAIN __textdomain +#else +# define TEXTDOMAIN textdomain__ +#endif + +/* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +char * +TEXTDOMAIN (domainname) + const char *domainname; +{ + char *old; + + /* A NULL pointer requests the current setting. */ + if (domainname == NULL) + return (char *) _nl_current_default_domain; + + old = (char *) _nl_current_default_domain; + + /* If domain name is the null string set to default domain "messages". */ + if (domainname[0] == '\0' + || strcmp (domainname, _nl_default_default_domain) == 0) + _nl_current_default_domain = _nl_default_default_domain; + else + { + /* If the following malloc fails `_nl_current_default_domain' + will be NULL. This value will be returned and so signals we + are out of core. */ + size_t len = strlen (domainname) + 1; + char *cp = (char *) malloc (len); + if (cp != NULL) + memcpy (cp, domainname, len); + _nl_current_default_domain = cp; + } + + if (old != _nl_default_default_domain) + free (old); + + return (char *) _nl_current_default_domain; +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__textdomain, textdomain); +#endif diff --git a/src/apps/bin/sharutils-4.2.1/intl/textdomain.o b/src/apps/bin/sharutils-4.2.1/intl/textdomain.o new file mode 100644 index 0000000000..ceb4a0f2f4 Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/intl/textdomain.o differ diff --git a/src/apps/bin/sharutils-4.2.1/intl/xopen-msg.sed b/src/apps/bin/sharutils-4.2.1/intl/xopen-msg.sed new file mode 100644 index 0000000000..b19c0bbd0e --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/intl/xopen-msg.sed @@ -0,0 +1,104 @@ +# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file +# Copyright (C) 1995 Free Software Foundation, Inc. +# Ulrich Drepper , 1995. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# +# The first directive in the .msg should be the definition of the +# message set number. We use always set number 1. +# +1 { + i\ +$set 1 # Automatically created by po2msg.sed + h + s/.*/0/ + x +} +# +# We copy all comments into the .msg file. Perhaps they can help. +# +/^#/ s/^#[ ]*/$ /p +# +# We copy the original message as a comment into the .msg file. +# +/^msgid/ { +# Does not work now +# /"$/! { +# s/\\$// +# s/$/ ... (more lines following)"/ +# } + s/^msgid[ ]*"\(.*\)"$/$ Original Message: \1/ + p +} +# +# The .msg file contains, other then the .po file, only the translations +# but each given a unique ID. Starting from 1 and incrementing by 1 for +# each message we assign them to the messages. +# It is important that the .po file used to generate the cat-id-tbl.c file +# (with po-to-tbl) is the same as the one used here. (At least the order +# of declarations must not be changed.) +# +/^msgstr/ { + s/msgstr[ ]*"\(.*\)"/\1/ + x +# The following nice solution is by +# Bruno + td +# Increment a decimal number in pattern space. +# First hide trailing `9' digits. + :d + s/9\(_*\)$/_\1/ + td +# Assure at least one digit is available. + s/^\(_*\)$/0\1/ +# Increment the last digit. + s/8\(_*\)$/9\1/ + s/7\(_*\)$/8\1/ + s/6\(_*\)$/7\1/ + s/5\(_*\)$/6\1/ + s/4\(_*\)$/5\1/ + s/3\(_*\)$/4\1/ + s/2\(_*\)$/3\1/ + s/1\(_*\)$/2\1/ + s/0\(_*\)$/1\1/ +# Convert the hidden `9' digits to `0's. + s/_/0/g + x +# Bring the line in the format ` ' + G + s/^[^\n]*$/& / + s/\(.*\)\n\([0-9]*\)/\2 \1/ +# Clear flag from last substitution. + tb +# Append the next line. + :b + N +# Look whether second part is a continuation line. + s/\(.*\n\)"\(.*\)"/\1\2/ +# Yes, then branch. + ta + P + D +# Note that `D' includes a jump to the start!! +# We found a continuation line. But before printing insert '\'. + :a + s/\(.*\)\(\n.*\)/\1\\\2/ + P +# We cannot use the sed command `D' here + s/.*\n\(.*\)/\1/ + tb +} +d diff --git a/src/apps/bin/sharutils-4.2.1/lib/ChangeLog b/src/apps/bin/sharutils-4.2.1/lib/ChangeLog new file mode 100644 index 0000000000..c62501d525 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/ChangeLog @@ -0,0 +1,54 @@ +Tue Nov 21 16:28:58 1995 Ulrich Drepper + + * system.h: Add prototype for stpcpy. + +Thu Nov 16 20:52:11 1995 Ulrich Drepper + + * whoami.c (get_hostname): Prefer HAVE_UNAME before + HAVE_ETC_SYSTEMID. Seems not to work on DGUX systems. Hope this + does not break anything else. Reported by Roderick Schertler. + +Sun Nov 5 20:24:38 1995 Ulrich Drepper + + * system.h: Rename _N to N_. + +Sun Nov 5 13:33:16 1995 Ulrich Drepper + + * Makefile.in (dist): Suppress error message when ln failed. + + * system.h: + Rename macro _C to _N and use gettext_noop instead of gettext_const. + +Fri Nov 3 00:41:01 1995 Ulrich Drepper + + * system.h (_GTM): Remove macro. + (_C): Define according to gettext-0.9.7. Use gettext_const. + +Tue Oct 31 01:25:13 1995 Ulrich Drepper + + * Makefile.in (LINK, LDFLAGS, ANSI2KNR): Remove unused variables. + (ALLOCA, ALLOCA_SRC): Define variables and use in SOURCES and OBJECTS. + +Sat Sep 23 13:10:39 1995 Ulrich Drepper + + * Makefile.in (HEADERS): Add md5.h. + (SOURCES): Add md5.c. + (OBJECTS): Add md5.o. + +Tue Aug 15 16:48:38 1995 Ulrich Drepper + + * Makefile.in (dist): Remove `copying instead' message. + +Thu Aug 10 22:40:31 1995 Ulrich Drepper + + * Makefile.in (SOURCES): Add stpcpy.c. + Reported by Franc,ois Pinard. + + * system.h (_GTM): Add definition. + +Tue Aug 1 18:33:24 1995 Ulrich Drepper + + * Makefile.in: New file. + + * Sharutils is now not any more a flat directory structure. + diff --git a/src/apps/bin/sharutils-4.2.1/lib/Jamfile b/src/apps/bin/sharutils-4.2.1/lib/Jamfile new file mode 100644 index 0000000000..e1aad97e72 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/Jamfile @@ -0,0 +1,21 @@ +SubDir OBOS_TOP src apps bin sharutils-4.2.1 lib ; + +SubDirCcFlags += -DHAVE_CONFIG_H ; + +StaticLibrary sharutils : +alloca.c +basename.c +error.c +getopt.c +getopt1.c +md5.c +memset.c +mktime.c +stpcpy.c +strftime.c +whoami.c +xgetcwd.c +xmalloc.c +xstrdup.c +: STATIC_LIBRARY_DIR +; diff --git a/src/apps/bin/sharutils-4.2.1/lib/Makefile b/src/apps/bin/sharutils-4.2.1/lib/Makefile new file mode 100644 index 0000000000..4160b43707 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/Makefile @@ -0,0 +1,118 @@ +# Generated automatically from Makefile.in by configure. +# Makefile for the support library subdirectory of the GNU Shar Utilities +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = sharutils +VERSION = 4.2.1 + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +subdir = lib + +AR = ar +CC = gcc +RANLIB = ranlib + +DEFS = -DHAVE_CONFIG_H +CFLAGS = -g -O +CPPFLAGS = +LIBS = libshar.a + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +# If your system doesn't have alloca, or the one provided is bad, define this. +ALLOCA = +ALLOCA_SRC = alloca.c + +# If your systems has the GNU getopt functions available you may comment +# out the following line. +GETOPT = getopt.o getopt1.o +GETOPTSRC = getopt.c getopt1.c + +HEADERS = getopt.h md5.h pathmax.h system.h +SOURCES = $(ALLOCA_SRC) basename.c error.c $(GETOPTSRC) md5.c memset.c \ +mktime.c stpcpy.c strftime.c whoami.c xgetcwd.c xmalloc.c xstrdup.c +OBJECTS = $(ALLOCA) error.o $(GETOPT) md5.o xgetcwd.o xmalloc.o xstrdup.o \ +whoami.o basename.o +DISTFILES = ChangeLog Makefile.in $(HEADERS) $(SOURCES) + +.SUFFIXES: +.SUFFIXES: .c .o +.c.o: + $(COMPILE) $< + + +INCLUDES = -I$(srcdir) -I.. -I../intl -I$(top_srcdir)/intl + +all: libshar.a $(ANSI2KNR) + +libshar.a: $(OBJECTS) + rm -f libshar.a + $(AR) cru libshar.a $(OBJECTS) + $(RANLIB) libshar.a + +ansi2knr: ansi2knr.o + $(LINK) ansi2knr.o $(LIBS) + +install install-exec install-data: all + +uninstall: + +check: all + +$(OBJECTS): ../config.h +error.o getopt.o xmalloc.o: ../intl/libgettext.h +getopt.o: getopt.h + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) + +id: ID + +ID: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) + +mostlyclean: + rm -f *.a *.o core core.* + +clean: mostlyclean + +distclean: clean + rm -f Makefile ID TAGS ansi2knr + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: $(srcdir)/Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/lib/Makefile.in b/src/apps/bin/sharutils-4.2.1/lib/Makefile.in new file mode 100644 index 0000000000..ecc439e754 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/Makefile.in @@ -0,0 +1,118 @@ +# Makefile for the support library subdirectory of the GNU Shar Utilities +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +subdir = lib + +AR = ar +CC = @CC@ +RANLIB = @RANLIB@ + +DEFS = @DEFS@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LIBS = libshar.a + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +# If your system doesn't have alloca, or the one provided is bad, define this. +ALLOCA = @ALLOCA@ +ALLOCA_SRC = alloca.c + +# If your systems has the GNU getopt functions available you may comment +# out the following line. +GETOPT = getopt.o getopt1.o +GETOPTSRC = getopt.c getopt1.c + +HEADERS = getopt.h md5.h pathmax.h system.h +SOURCES = $(ALLOCA_SRC) basename.c error.c $(GETOPTSRC) md5.c memset.c \ +mktime.c stpcpy.c strftime.c whoami.c xgetcwd.c xmalloc.c xstrdup.c +OBJECTS = $(ALLOCA) error.o $(GETOPT) md5.o xgetcwd.o xmalloc.o xstrdup.o \ +whoami.o @LIBOBJS@ +DISTFILES = ChangeLog Makefile.in $(HEADERS) $(SOURCES) + +.SUFFIXES: +.SUFFIXES: .c .o +.c.o: + $(COMPILE) $< + + +INCLUDES = -I$(srcdir) -I.. -I../intl -I$(top_srcdir)/intl + +all: libshar.a $(ANSI2KNR) + +libshar.a: $(OBJECTS) + rm -f libshar.a + $(AR) cru libshar.a $(OBJECTS) + $(RANLIB) libshar.a + +ansi2knr: ansi2knr.o + $(LINK) ansi2knr.o $(LIBS) + +install install-exec install-data: all + +uninstall: + +check: all + +$(OBJECTS): ../config.h +error.o getopt.o xmalloc.o: ../intl/libgettext.h +getopt.o: getopt.h + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) + +id: ID + +ID: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) + +mostlyclean: + rm -f *.a *.o core core.* + +clean: mostlyclean + +distclean: clean + rm -f Makefile ID TAGS ansi2knr + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: $(srcdir)/Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/lib/alloca.c b/src/apps/bin/sharutils-4.2.1/lib/alloca.c new file mode 100644 index 0000000000..7020f32c88 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/alloca.c @@ -0,0 +1,492 @@ +/* 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 + +#ifdef emacs +#include "blockinput.h" +#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 +#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 + +#if __STDC__ +typedef void *pointer; +#else +typedef char *pointer; +#endif + +#define NULL 0 + +/* Different portions of Emacs need to call different versions of + malloc. The Emacs executable needs alloca to call xmalloc, because + ordinary malloc isn't protected from input signals. On the other + hand, the utilities in lib-src need alloca to call malloc; some of + them are very simple, and don't have an xmalloc routine. + + Non-Emacs programs expect this to call use xmalloc. + + Callers below should use malloc. */ + +#ifndef emacs +#define malloc xmalloc +#endif +extern pointer malloc (); + +/* 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 () +{ + 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. */ + +pointer +alloca (size) + unsigned 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 ((pointer) 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. */ + + { + register pointer new = malloc (sizeof (header) + size); + /* Address of header. */ + + ((header *) new)->h.next = last_alloca_header; + ((header *) new)->h.deep = depth; + + last_alloca_header = (header *) new; + + /* User storage begins just after header. */ + + return (pointer) ((char *) new + sizeof (header)); + } +} + +#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 */ diff --git a/src/apps/bin/sharutils-4.2.1/lib/basename.c b/src/apps/bin/sharutils-4.2.1/lib/basename.c new file mode 100644 index 0000000000..f3671f573e --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/basename.c @@ -0,0 +1,41 @@ +/* basename.c -- return the last element in a path + Copyright (C) 1990 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) +#include +#ifndef rindex +#define rindex strrchr +#endif +#else +#include +#endif + +/* Return NAME with any leading path stripped off. */ + +char * +basename (name) + char *name; +{ + char *base; + + base = rindex (name, '/'); + return base ? base + 1 : name; +} diff --git a/src/apps/bin/sharutils-4.2.1/lib/config.h b/src/apps/bin/sharutils-4.2.1/lib/config.h new file mode 100644 index 0000000000..87548e008a --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/config.h @@ -0,0 +1,220 @@ +/* config.h. Generated automatically by configure. */ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define 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 + +/* Define if using alloca.c. */ +/* #undef C_ALLOCA */ + +/* Define if type char is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +/* #undef __CHAR_UNSIGNED__ */ +#endif + +/* Define if the closedir function returns void instead of int. */ +/* #undef CLOSEDIR_VOID */ + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* 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 if you have alloca, as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define if you have and it should be used (not on Ultrix). */ +#define HAVE_ALLOCA_H 1 + +/* Define if you don't have vprintf but do have _doprnt. */ +/* #undef HAVE_DOPRNT */ + +/* Define if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define if you have the strftime function. */ +#define HAVE_STRFTIME 1 + +/* Define if your struct tm has tm_zone. */ +#define HAVE_TM_ZONE 1 + +/* Define if you don't have tm_zone but do have the external array + tzname. */ +/* #undef HAVE_TZNAME */ + +/* Define if you have the vprintf function. */ +#define HAVE_VPRINTF 1 + +/* Define as __inline if that's what the C compiler calls it. */ +/* #undef inline */ + +/* Define if on MINIX. */ +/* #undef _MINIX */ + +/* Define to `long' if doesn't define. */ +/* #undef off_t */ + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define if you need to in order for stat and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ + +/* 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 run-time. + 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 if the `S_IS*' macros in do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if your declares struct tm. */ +/* #undef TM_IN_SYS_TIME */ + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define if the current hostname may be found in /etc/systemid. */ +/* #undef HAVE_ETC_SYSTEMID */ + +/* Define to the name of the distribution. */ +#define PACKAGE "sharutils" + +/* Define to 1 if ANSI function prototypes are usable. */ +#define PROTOTYPES 1 + +/* Define to the version of the distribution. */ +#define VERSION "4.2.1" + +/* Define to 1 for better use of the debugging malloc library. See + site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz. */ +/* #undef WITH_DMALLOC */ + +/* Define if your locale.h file contains LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if NLS is requested. */ +//#define ENABLE_NLS 1 + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +/* #undef HAVE_CATGETS */ + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +/* #undef HAVE_GETTEXT */ + +/* Define as 1 if you have the stpcpy function. */ +#define HAVE_STPCPY 1 + +/* Define if you have the basename function. */ +/* #undef HAVE_BASENAME */ + +/* Define if you have the dcgettext function. */ +/* #undef HAVE_DCGETTEXT */ + +/* Define if you have the fchmod function. */ +/* #undef HAVE_FCHMOD */ + +/* Define if you have the getcwd function. */ +#define HAVE_GETCWD 1 + +/* Define if you have the getpagesize function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define if you have the isascii function. */ +#define HAVE_ISASCII 1 + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY 1 + +/* Define if you have the munmap function. */ +/* #undef HAVE_MUNMAP */ + +/* Define if you have the putenv function. */ +#define HAVE_PUTENV 1 + +/* Define if you have the setenv function. */ +/* #undef HAVE_SETENV */ + +/* Define if you have the setlocale function. */ +#define HAVE_SETLOCALE 1 + +/* Define if you have the stpcpy function. */ +#define HAVE_STPCPY 1 + +/* Define if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* Define if you have the strchr function. */ +#define HAVE_STRCHR 1 + +/* Define if you have the strerror function. */ +#define HAVE_STRERROR 1 + +/* Define if you have the uname function. */ +#define HAVE_UNAME 1 + +/* Define if you have the valloc function. */ +#define HAVE_VALLOC 1 + +/* Define if you have the header file. */ +#define HAVE_DIRENT_H 1 + +/* Define if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_NDIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_NL_TYPES_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_VALUES_H */ + +/* Define if you have the i library (-li). */ +/* #undef HAVE_LIBI */ + +/* Define if you have the intl library (-lintl). */ +/* #undef HAVE_LIBINTL */ diff --git a/src/apps/bin/sharutils-4.2.1/lib/error.c b/src/apps/bin/sharutils-4.2.1/lib/error.c new file mode 100644 index 0000000000..43f96ae28c --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/error.c @@ -0,0 +1,174 @@ +/* error.c -- error handler for noninteractive utilities + Copyright (C) 1990, 91, 92, 93, 94, 1995 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by David MacKenzie . */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#if HAVE_VPRINTF || HAVE_DOPRNT +# if __STDC__ +# include +# define VA_START(args, lastarg) va_start(args, lastarg) +# else +# include +# define VA_START(args, lastarg) va_start(args) +# endif +#else +# define va_alist a1, a2, a3, a4, a5, a6, a7, a8 +# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; +#endif + +#if STDC_HEADERS +# include +# include +#else +void exit (); +#endif + +//#include + +#define _(str) (str) + +/* 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) () = NULL; + +/* The calling program should define program_name and set it to the + name of the executing program. */ +extern char *program_name; + +#if HAVE_STRERROR +char *strerror (); +#else +static char * +private_strerror (errnum) + int errnum; +{ + extern char *sys_errlist[]; + extern int sys_nerr; + + if (errnum > 0 && errnum <= sys_nerr) + return sys_errlist[errnum]; + return _("Unknown system error"); +} +#define strerror private_strerror +#endif + +/* 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. */ +/* VARARGS */ + +void +#if defined(VA_START) && __STDC__ +error (int status, int errnum, const char *message, ...) +#else +error (status, errnum, message, va_alist) + int status; + int errnum; + char *message; + va_dcl +#endif +{ +#ifdef VA_START + va_list args; +#endif + + if (error_print_progname) + (*error_print_progname) (); + else + { + fflush (stdout); + fprintf (stderr, "%s: ", program_name); + } + +#ifdef VA_START + VA_START (args, message); +# if HAVE_VPRINTF + vfprintf (stderr, message, args); +# else + _doprnt (message, args, stderr); +# endif + va_end (args); +#else + fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); +#endif + + if (errnum) + fprintf (stderr, ": %s", strerror (errnum)); + putc ('\n', stderr); + fflush (stderr); + if (status) + exit (status); +} + +void +#if defined(VA_START) && __STDC__ +error_with_loc (int status, int errnum, const char *file_name, + size_t line_number, const char *message, ...) +#else +error_with_loc (status, errnum, file_name, line_number, message, va_alist) + int status; + int errnum; + char *file_name; + size_t line_number; + char *message; + va_dcl +#endif +{ +#ifdef VA_START + va_list args; +#endif + + if (error_print_progname) + (*error_print_progname) (); + else + { + fflush (stdout); + fprintf (stderr, "%s:", program_name); + } + + if (file_name != NULL) + fprintf (stderr, "%s:%d: ", file_name, line_number); + +#ifdef VA_START + VA_START (args, message); +# if HAVE_VPRINTF + vfprintf (stderr, message, args); +# else + _doprnt (message, args, stderr); +# endif + va_end (args); +#else + fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); +#endif + + if (errnum) + fprintf (stderr, ": %s", strerror (errnum)); + putc ('\n', stderr); + fflush (stderr); + if (status) + exit (status); +} diff --git a/src/apps/bin/sharutils-4.2.1/lib/getopt.c b/src/apps/bin/sharutils-4.2.1/lib/getopt.c new file mode 100644 index 0000000000..cabed347e9 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/getopt.c @@ -0,0 +1,756 @@ +/* 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 roland@gnu.ai.mit.edu + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94 + 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 + +#if !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +//#include + +#define _(str) gettext (str) + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. 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__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#if defined (__GNU_LIBRARY__) || defined (__sgi) +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +#include +#endif /* GNU C library. */ + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' 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. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the 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" + +/* 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 = NULL; + +/* 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 EOF, 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. */ + +/* XXX 1003.2 says this must be 1 before any call. */ +int optind = 0; + +/* 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. */ + +static char *nextchar; + +/* 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 = '?'; + +/* 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. + + 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 EOF with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Value of POSIXLY_CORRECT environment variable. */ +static char *posixly_correct; + +#if defined (__GNU_LIBRARY__) || defined (__sgi) +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +#include +#define my_index strchr +#else + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +char *getenv (); + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +#if !__STDC__ +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +#endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* 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. */ + +static int first_nonopt; +static int last_nonopt; + +/* 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 (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = 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. */ + + 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; + } + /* 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; + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +static const char * +_getopt_initialize (optstring) + const char *optstring; +{ + /* 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. */ + + first_nonopt = last_nonopt = optind = 1; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + + 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 `EOF'. + 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. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + 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. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + optarg = NULL; + + if (optind == 0) + optstring = _getopt_initialize (optstring); + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc + && (argv[optind][0] != '-' || argv[optind][1] == '\0')) + optind++; + last_nonopt = 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 (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + 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 (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return EOF; + } + + /* 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 ((argv[optind][0] != '-' || argv[optind][1] == '\0')) + { + if (ordering == REQUIRE_ORDER) + return EOF; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[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[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + +#ifdef lint /* Suppress `used before initialized' warning. */ + indfound = 0; +#endif + + /* 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, nextchar, nameend - nextchar)) + { + if (nameend - 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 (opterr) + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + 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) + optarg = nameend + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + } + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (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[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { + if (posixly_correct) + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); + else + fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); + } + optopt = c; + return '?'; + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + 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 == EOF) + 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 */ diff --git a/src/apps/bin/sharutils-4.2.1/lib/getopt.h b/src/apps/bin/sharutils-4.2.1/lib/getopt.h new file mode 100644 index 0000000000..37c187c7b8 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/getopt.h @@ -0,0 +1,129 @@ +/* Declarations for getopt. + Copyright (C) 1989, 1990, 1991, 1992, 1993 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#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 EOF, 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; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#if __STDC__ +#if defined(__GNU_LIBRARY__) +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* not __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* not __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ diff --git a/src/apps/bin/sharutils-4.2.1/lib/getopt1.c b/src/apps/bin/sharutils-4.2.1/lib/getopt1.c new file mode 100644 index 0000000000..14058e5543 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/getopt1.c @@ -0,0 +1,180 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 + 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "getopt.h" + +#if !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. 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__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#else +char *getenv (); +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* 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 (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +#include + +int +main (argc, argv) + 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 == EOF) + 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 */ diff --git a/src/apps/bin/sharutils-4.2.1/lib/md5.c b/src/apps/bin/sharutils-4.2.1/lib/md5.c new file mode 100644 index 0000000000..8114795d73 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/md5.c @@ -0,0 +1,366 @@ +/* md5.c - Functions to compute MD5 message digest of files or memory blocks + according to the definition of MD5 in RFC 1321 from April 1992. + Copyright (C) 1995 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Ulrich Drepper . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#if STDC_HEADERS +# include +# include +#else +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#include "md5.h" + +#ifdef WORDS_BIGENDIAN +# define SWAP(n) \ + (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) +#else +# define SWAP(n) (n) +#endif + + +/* This array contains the bytes used to pad the buffer to the next + 64-byte boundary. (RFC 1321, 3.1: Step 1) */ +static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; + + +/* Initialize structure containing state of computation. + (RFC 1321, 3.3: Step 3) */ +void +md5_init_ctx (ctx) + struct md5_ctx *ctx; +{ + ctx->A = 0x67452301; + ctx->B = 0xefcdab89; + ctx->C = 0x98badcfe; + ctx->D = 0x10325476; +} + +/* Put result from CTX in first 16 bytes following RESBUF. The result must + be in little endian byte order. */ +void * +md5_read_ctx (ctx, resbuf) + const struct md5_ctx *ctx; + void *resbuf; +{ + ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); + ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); + ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); + ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); + + return resbuf; +} + +/* Compute MD5 message digest for bytes read from STREAM. The + resulting message digest number will be written into the 16 bytes + beginning at RESBLOCK. */ +int +md5_stream (stream, resblock) + FILE *stream; + void *resblock; +{ + /* Important: BLOCKSIZE must be a multiple of 64. */ +#define BLOCKSIZE 4096 + struct md5_ctx ctx; + md5_uint32 len[2]; + char buffer[BLOCKSIZE + 72]; + size_t pad, sum; + + /* Initialize the computation context. */ + md5_init_ctx (&ctx); + + len[0] = 0; + len[1] = 0; + + /* Iterate over full file contents. */ + while (1) + { + /* We read the file in blocks of BLOCKSIZE bytes. One call of the + computation function processes the whole buffer so that with the + next round of the loop another block can be read. */ + size_t n; + sum = 0; + + /* Read block. Take care for partial reads. */ + do + { + n = fread (buffer, 1, BLOCKSIZE - sum, stream); + + sum += n; + } + while (sum < BLOCKSIZE && n != 0); + if (n == 0 && ferror (stream)) + return 1; + + /* RFC 1321 specifies the possible length of the file up to 2^64 bits. + Here we only compute the number of bytes. Do a double word + increment. */ + len[0] += sum; + if (len[0] < sum) + ++len[1]; + + /* If end of file is reached, end the loop. */ + if (n == 0) + break; + + /* Process buffer with BLOCKSIZE bytes. Note that + BLOCKSIZE % 64 == 0 + */ + md5_process_block (buffer, BLOCKSIZE, &ctx); + } + + /* We can copy 64 byte because the buffer is always big enough. FILLBUF + contains the needed bits. */ + memcpy (&buffer[sum], fillbuf, 64); + + /* Compute amount of padding bytes needed. Alignment is done to + (N + PAD) % 64 == 56 + There is always at least one byte padded. I.e. even the alignment + is correctly aligned 64 padding bytes are added. */ + pad = sum & 63; + pad = pad >= 56 ? 64 + 56 - pad : 56 - pad; + + /* Put the 64-bit file length in *bits* at the end of the buffer. */ + *(md5_uint32 *) &buffer[sum + pad] = SWAP (len[0] << 3); + *(md5_uint32 *) &buffer[sum + pad + 4] = SWAP ((len[1] << 3) + | (len[0] >> 29)); + + /* Process last bytes. */ + md5_process_block (buffer, sum + pad + 8, &ctx); + + /* Construct result in desired memory. */ + md5_read_ctx (&ctx, resblock); + return 0; +} + +/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The + result is always in little endian byte order, so that a byte-wise + output yields to the wanted ASCII representation of the message + digest. */ +void * +md5_buffer (buffer, len, resblock) + const char *buffer; + size_t len; + void *resblock; +{ + struct md5_ctx ctx; + char restbuf[64 + 72]; + size_t blocks = len & ~63; + size_t pad, rest; + + /* Initialize the computation context. */ + md5_init_ctx (&ctx); + + /* Process whole buffer but last len % 64 bytes. */ + md5_process_block (buffer, blocks, &ctx); + + /* REST bytes are not processed yet. */ + rest = len - blocks; + /* Copy to own buffer. */ + memcpy (restbuf, &buffer[blocks], rest); + /* Append needed fill bytes at end of buffer. We can copy 64 byte + because the buffer is always big enough. */ + memcpy (&restbuf[rest], fillbuf, 64); + + /* PAD bytes are used for padding to correct alignment. Note that + always at least one byte is padded. */ + pad = rest >= 56 ? 64 + 56 - rest : 56 - rest; + + /* Put length of buffer in *bits* in last eight bytes. */ + *(md5_uint32 *) &restbuf[rest + pad] = (md5_uint32) SWAP (len << 3); + *(md5_uint32 *) &restbuf[rest + pad + 4] = (md5_uint32) SWAP (len >> 29); + + /* Process last bytes. */ + md5_process_block (restbuf, rest + pad + 8, &ctx); + + /* Put result in desired memory area. */ + return md5_read_ctx (&ctx, resblock); +} + + +/* These are the four functions used in the four steps of the MD5 algorithm + and defined in the RFC 1321. The first function is a little bit optimized + (as found in Colin Plumbs public domain implementation). */ +/* #define FF(b, c, d) ((b & c) | (~b & d)) */ +#define FF(b, c, d) (d ^ (b & (c ^ d))) +#define FG(b, c, d) FF (d, b, c) +#define FH(b, c, d) (b ^ c ^ d) +#define FI(b, c, d) (c ^ (b | ~d)) + +/* Process LEN bytes of BUFFER, accumulating context into CTX. + It is assumed that LEN % 64 == 0. */ + +void +md5_process_block (buffer, len, ctx) + const void *buffer; + size_t len; + struct md5_ctx *ctx; +{ + md5_uint32 correct_words[16]; + const md5_uint32 *words = buffer; + size_t nwords = len / sizeof (md5_uint32); + const md5_uint32 *endp = words + nwords; + md5_uint32 A = ctx->A; + md5_uint32 B = ctx->B; + md5_uint32 C = ctx->C; + md5_uint32 D = ctx->D; + + /* Process all bytes in the buffer with 64 bytes in each round of + the loop. */ + while (words < endp) + { + md5_uint32 *cwp = correct_words; + md5_uint32 A_save = A; + md5_uint32 B_save = B; + md5_uint32 C_save = C; + md5_uint32 D_save = D; + + /* First round: using the given function, the context and a constant + the next context is computed. Because the algorithms processing + unit is a 32-bit word and it is determined to work on words in + little endian byte order we perhaps have to change the byte order + before the computation. To reduce the work for the next steps + we store the swapped words in the array CORRECT_WORDS. */ + +#define OP(a, b, c, d, s, T) \ + do \ + { \ + a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ + ++words; \ + CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + + /* It is unfortunate that C does not provide an operator for + cyclic rotation. Hope the C compiler is smart enough. */ +#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) + + /* Before we start, one word to the strange constants. + They are defined in RFC 1321 as + + T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 + */ + + /* Round 1. */ + OP (A, B, C, D, 7, 0xd76aa478); + OP (D, A, B, C, 12, 0xe8c7b756); + OP (C, D, A, B, 17, 0x242070db); + OP (B, C, D, A, 22, 0xc1bdceee); + OP (A, B, C, D, 7, 0xf57c0faf); + OP (D, A, B, C, 12, 0x4787c62a); + OP (C, D, A, B, 17, 0xa8304613); + OP (B, C, D, A, 22, 0xfd469501); + OP (A, B, C, D, 7, 0x698098d8); + OP (D, A, B, C, 12, 0x8b44f7af); + OP (C, D, A, B, 17, 0xffff5bb1); + OP (B, C, D, A, 22, 0x895cd7be); + OP (A, B, C, D, 7, 0x6b901122); + OP (D, A, B, C, 12, 0xfd987193); + OP (C, D, A, B, 17, 0xa679438e); + OP (B, C, D, A, 22, 0x49b40821); + + /* For the second to fourth round we have the possibly swapped words + in CORRECT_WORDS. Redefine the macro to take an additional first + argument specifying the function to use. */ +#undef OP +#define OP(f, a, b, c, d, k, s, T) \ + do \ + { \ + a += f (b, c, d) + correct_words[k] + T; \ + CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + + /* Round 2. */ + OP (FG, A, B, C, D, 1, 5, 0xf61e2562); + OP (FG, D, A, B, C, 6, 9, 0xc040b340); + OP (FG, C, D, A, B, 11, 14, 0x265e5a51); + OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); + OP (FG, A, B, C, D, 5, 5, 0xd62f105d); + OP (FG, D, A, B, C, 10, 9, 0x02441453); + OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); + OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); + OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); + OP (FG, D, A, B, C, 14, 9, 0xc33707d6); + OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); + OP (FG, B, C, D, A, 8, 20, 0x455a14ed); + OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); + OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); + OP (FG, C, D, A, B, 7, 14, 0x676f02d9); + OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); + + /* Round 3. */ + OP (FH, A, B, C, D, 5, 4, 0xfffa3942); + OP (FH, D, A, B, C, 8, 11, 0x8771f681); + OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); + OP (FH, B, C, D, A, 14, 23, 0xfde5380c); + OP (FH, A, B, C, D, 1, 4, 0xa4beea44); + OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); + OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); + OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); + OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); + OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); + OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); + OP (FH, B, C, D, A, 6, 23, 0x04881d05); + OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); + OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); + OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); + OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); + + /* Round 4. */ + OP (FI, A, B, C, D, 0, 6, 0xf4292244); + OP (FI, D, A, B, C, 7, 10, 0x432aff97); + OP (FI, C, D, A, B, 14, 15, 0xab9423a7); + OP (FI, B, C, D, A, 5, 21, 0xfc93a039); + OP (FI, A, B, C, D, 12, 6, 0x655b59c3); + OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); + OP (FI, C, D, A, B, 10, 15, 0xffeff47d); + OP (FI, B, C, D, A, 1, 21, 0x85845dd1); + OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); + OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); + OP (FI, C, D, A, B, 6, 15, 0xa3014314); + OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); + OP (FI, A, B, C, D, 4, 6, 0xf7537e82); + OP (FI, D, A, B, C, 11, 10, 0xbd3af235); + OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); + OP (FI, B, C, D, A, 9, 21, 0xeb86d391); + + /* Add the starting values of the context. */ + A += A_save; + B += B_save; + C += C_save; + D += D_save; + } + + /* Put checksum in context given as argument. */ + ctx->A = A; + ctx->B = B; + ctx->C = C; + ctx->D = D; +} diff --git a/src/apps/bin/sharutils-4.2.1/lib/md5.h b/src/apps/bin/sharutils-4.2.1/lib/md5.h new file mode 100644 index 0000000000..ed38c192d2 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/md5.h @@ -0,0 +1,115 @@ +/* md5.h - Declaration of functions and data types used for MD5 sum + computing library functions. + Copyright (C) 1995 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _MD5_H +#define _MD5_H + +#include + +#if defined HAVE_LIMITS_H || _LIBC +# include +#endif + +/* The following contortions are an attempt to use the C preprocessor + to determine an unsigned integral type that is 32 bits wide. An + alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but + doing that would require that the configure script compile and *run* + the resulting executable. Locally running cross-compiled executables + is usually not possible. */ + +#if defined __STDC__ && __STDC__ +# define UINT_MAX_32_BITS 4294967295U +#else +# define UINT_MAX_32_BITS 0xFFFFFFFF +#endif + +/* If UINT_MAX isn't defined, assume it's a 32-bit type. + This should be valid for all systems GNU cares about because + that doesn't include 16-bit systems, and only modern systems + (that certainly have ) have 64+-bit integral types. */ + +#ifndef UINT_MAX +# define UINT_MAX UINT_MAX_32_BITS +#endif + +#if UINT_MAX == UINT_MAX_32_BITS + typedef unsigned int md5_uint32; +#else +# if USHRT_MAX == UINT_MAX_32_BITS + typedef unsigned short md5_uint32; +# else +# if ULONG_MAX == UINT_MAX_32_BITS + typedef unsigned long md5_uint32; +# else + /* The following line is intended to evoke an error. + Using #error is not portable enough. */ + "Cannot determine unsigned 32-bit data type." +# endif +# endif +#endif + +#undef __P +#if defined (__STDC__) && __STDC__ +#define __P(x) x +#else +#define __P(x) () +#endif + +/* Structure to save state of computation between the single steps. */ +struct md5_ctx +{ + md5_uint32 A; + md5_uint32 B; + md5_uint32 C; + md5_uint32 D; +}; + +/* + * The following three functions are build up the low level used in + * the functions `md5_stream' and `md5_buffer'. + */ + +/* Initialize structure containing state of computation. + (RFC 1321, 3.3: Step 3) */ +void md5_init_ctx __P ((struct md5_ctx *ctx)); + +/* Starting with the result of former calls of this function (or the + initialzation function update the context for the next LEN bytes + starting at BUFFER. + It is necessary that LEN is a multiple of 64!!! */ +void md5_process_block __P ((const void *buffer, size_t len, + struct md5_ctx *ctx)); + +/* Put result from CTX in first 16 bytes following RESBUF. The result is + always in little endian byte order, so that a byte-wise output yields + to the wanted ASCII representation of the message digest. */ +void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); + + +/* Compute MD5 message digest for bytes read from STREAM. The + resulting message digest number will be written into the 16 bytes + beginning at RESBLOCK. */ +int md5_stream __P ((FILE *stream, void *resblock)); + +/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The + result is always in little endian byte order, so that a byte-wise + output yields to the wanted ASCII representation of the message + digest. */ +void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); + +#endif diff --git a/src/apps/bin/sharutils-4.2.1/lib/memset.c b/src/apps/bin/sharutils-4.2.1/lib/memset.c new file mode 100644 index 0000000000..e8bc87f325 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/memset.c @@ -0,0 +1,29 @@ +/* memset.c -- set an area of memory to a given value + Copyright (C) 1991 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +char * +memset (str, c, len) + char *str; + int c; + unsigned len; +{ + register char *st = str; + + while (len-- > 0) + *st++ = c; + return str; +} diff --git a/src/apps/bin/sharutils-4.2.1/lib/mktime.c b/src/apps/bin/sharutils-4.2.1/lib/mktime.c new file mode 100644 index 0000000000..b80c5064c9 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/mktime.c @@ -0,0 +1,503 @@ +/* Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Contributed by Noel Cragg (noel@cs.oberlin.edu), with fixes by + Michael E. Calwas (calwas@ttd.teradyne.com) and + Wade Hampton (tasi029@tmn.com). + + +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Define this to have a standalone program to test this implementation of + mktime. */ +/* #define DEBUG */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include /* Some systems define `time_t' here. */ +#include + + +#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 + +#ifndef __P +#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +#define __P(args) args +#else +#define __P(args) () +#endif /* GCC. */ +#endif /* Not __P. */ + +/* How many days are in each month. */ +const unsigned short int __mon_lengths[2][12] = + { + /* Normal years. */ + { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, + /* Leap years. */ + { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } + }; + + +static int times_through_search; /* This library routine should never + hang -- make sure we always return + when we're searching for a value */ + + +#ifdef DEBUG + +#include +#include + +int debugging_enabled = 0; + +/* Print the values in a `struct tm'. */ +static void +printtm (it) + struct tm *it; +{ + printf ("%02d/%02d/%04d %02d:%02d:%02d (%s) yday:%03d dst:%d gmtoffset:%ld", + it->tm_mon + 1, + it->tm_mday, + it->tm_year + 1900, + it->tm_hour, + it->tm_min, + it->tm_sec, + it->tm_zone, + it->tm_yday, + it->tm_isdst, + it->tm_gmtoff); +} +#endif + + +static time_t +dist_tm (t1, t2) + struct tm *t1; + struct tm *t2; +{ + time_t distance = 0; + unsigned long int v1, v2; + int diff_flag = 0; + + v1 = v2 = 0; + +#define doit(x, secs) \ + v1 += t1->x * secs; \ + v2 += t2->x * secs; \ + if (!diff_flag) \ + { \ + if (t1->x < t2->x) \ + diff_flag = -1; \ + else if (t1->x > t2->x) \ + diff_flag = 1; \ + } + + doit (tm_year, 31536000); /* Okay, not all years have 365 days. */ + doit (tm_mon, 2592000); /* Okay, not all months have 30 days. */ + doit (tm_mday, 86400); + doit (tm_hour, 3600); + doit (tm_min, 60); + doit (tm_sec, 1); + +#undef doit + + /* We should also make sure that the sign of DISTANCE is correct -- if + DIFF_FLAG is positive, the distance should be positive and vice versa. */ + + distance = (v1 > v2) ? (v1 - v2) : (v2 - v1); + if (diff_flag < 0) + distance = -distance; + + if (times_through_search > 20) /* Arbitrary # of calls, but makes sure we + never hang if there's a problem with + this algorithm. */ + { + distance = diff_flag; + } + + /* We need this DIFF_FLAG business because it is forseeable that the + distance may be zero when, in actuality, the two structures are + different. This is usually the case when the dates are 366 days apart + and one of the years is a leap year. */ + + if (distance == 0 && diff_flag) + distance = 86400 * diff_flag; + + return distance; +} + + +/* MKTIME converts the values in a struct tm to a time_t. The values + in tm_wday and tm_yday are ignored; other values can be put outside + of legal ranges since they will be normalized. This routine takes + care of that normalization. */ + +void +do_normalization (tmptr) + struct tm *tmptr; +{ + +#define normalize(foo,x,y,bar); \ + while (tmptr->foo < x) \ + { \ + tmptr->bar--; \ + tmptr->foo = (y - (x - tmptr->foo) + 1); \ + } \ + while (tmptr->foo > y) \ + { \ + tmptr->foo = (x + (tmptr->foo - y) - 1); \ + tmptr->bar++; \ + } + + normalize (tm_sec, 0, 59, tm_min); + normalize (tm_min, 0, 59, tm_hour); + normalize (tm_hour, 0, 23, tm_mday); + + /* Do the month first, so day range can be found. */ + normalize (tm_mon, 0, 11, tm_year); + + /* Since the day range modifies the month, we should be careful how + we reference the array of month lengths -- it is possible that + the month will go negative, hence the modulo... + + Also, tm_year is the year - 1900, so we have to 1900 to have it + work correctly. */ + + normalize (tm_mday, 1, + __mon_lengths[__isleap (tmptr->tm_year + 1900)] + [((tmptr->tm_mon < 0) + ? (12 + (tmptr->tm_mon % 12)) + : (tmptr->tm_mon % 12)) ], + tm_mon); + + /* Do the month again, because the day may have pushed it out of range. */ + normalize (tm_mon, 0, 11, tm_year); + + /* Do the day again, because the month may have changed the range. */ + normalize (tm_mday, 1, + __mon_lengths[__isleap (tmptr->tm_year + 1900)] + [((tmptr->tm_mon < 0) + ? (12 + (tmptr->tm_mon % 12)) + : (tmptr->tm_mon % 12)) ], + tm_mon); + +#ifdef DEBUG + if (debugging_enabled) + { + printf (" After normalizing:\n "); + printtm (tmptr); + putchar ('\n'); + } +#endif + +} + + +/* Here's where the work gets done. */ + +#define BAD_STRUCT_TM ((time_t) -1) + +time_t +_mktime_internal (timeptr, producer) + struct tm *timeptr; + struct tm *(*producer) __P ((const time_t *)); +{ + struct tm our_tm; /* our working space */ + struct tm *me = &our_tm; /* a pointer to the above */ + time_t result; /* the value we return */ + + *me = *timeptr; /* copy the struct tm that was passed + in by the caller */ + + + /***************************/ + /* Normalize the structure */ + /***************************/ + + /* This routine assumes that the value of TM_ISDST is -1, 0, or 1. + If the user didn't pass it in that way, fix it. */ + + if (me->tm_isdst > 0) + me->tm_isdst = 1; + else if (me->tm_isdst < 0) + me->tm_isdst = -1; + + do_normalization (me); + + /* Get out of here if it's not possible to represent this struct. + If any of the values in the normalized struct tm are negative, + our algorithms won't work. Luckily, we only need to check the + year at this point; normalization guarantees that all values will + be in correct ranges EXCEPT the year. */ + + if (me->tm_year < 0) + return BAD_STRUCT_TM; + + /*************************************************/ + /* Find the appropriate time_t for the structure */ + /*************************************************/ + + /* Modified b-search -- make intelligent guesses as to where the + time might lie along the timeline, assuming that our target time + lies a linear distance (w/o considering time jumps of a + particular region). + + Assume that time does not fluctuate at all along the timeline -- + e.g., assume that a day will always take 86400 seconds, etc. -- + and come up with a hypothetical value for the time_t + representation of the struct tm TARGET, in relation to the guess + variable -- it should be pretty close! + + After testing this, the maximum number of iterations that I had + on any number that I tried was 3! Not bad. + + The reason this is not a subroutine is that we will modify some + fields in the struct tm (yday and mday). I've never felt good + about side-effects when writing structured code... */ + + { + struct tm *guess_tm; + time_t guess = 0; + time_t distance = 0; + time_t last_distance = 0; + + times_through_search = 0; + + do + { + guess += distance; + + times_through_search++; + + guess_tm = (*producer) (&guess); + +#ifdef DEBUG + if (debugging_enabled) + { + printf (" Guessing time_t == %d\n ", (int) guess); + printtm (guess_tm); + putchar ('\n'); + } +#endif + + /* How far is our guess from the desired struct tm? */ + distance = dist_tm (me, guess_tm); + + /* Handle periods of time where a period of time is skipped. + For example, 2:15 3 April 1994 does not exist, because DST + is in effect. The distance function will alternately + return values of 3600 and -3600, because it doesn't know + that the requested time doesn't exist. In these situations + (even if the skip is not exactly an hour) the distances + returned will be the same, but alternating in sign. We + want the later time, so check to see that the distance is + oscillating and we've chosen the correct of the two + possibilities. + + Useful: 3 Apr 94 765356300, 30 Oct 94 783496000 */ + + if ((distance == -last_distance) && (distance < last_distance)) + { + /* If the caller specified that the DST flag was off, it's + not possible to represent this time. */ + if (me->tm_isdst == 0) + { +#ifdef DEBUG + printf (" Distance is oscillating -- dst flag nixes struct!\n"); +#endif + return BAD_STRUCT_TM; + } + +#ifdef DEBUG + printf (" Distance is oscillating -- chose the later time.\n"); +#endif + distance = 0; + } + + if ((distance == 0) && (me->tm_isdst != -1) + && (me->tm_isdst != guess_tm->tm_isdst)) + { + /* If we're in this code, we've got the right time but the + wrong daylight savings flag. We need to move away from + the time that we have and approach the other time from + the other direction. That is, if I've requested the + non-DST version of a time and I get the DST version + instead, I want to put us forward in time and search + backwards to get the other time. I checked all of the + configuration files for the tz package -- no entry + saves more than two hours, so I think we'll be safe by + moving 24 hours in one direction. IF THE AMOUNT OF + TIME SAVED IN THE CONFIGURATION FILES CHANGES, THIS + VALUE MAY NEED TO BE ADJUSTED. Luckily, we can never + have more than one level of overlaps, or this would + never work. */ + +#define SKIP_VALUE 86400 + + if (guess_tm->tm_isdst == 0) + /* we got the later one, but want the earlier one */ + distance = -SKIP_VALUE; + else + distance = SKIP_VALUE; + +#ifdef DEBUG + printf (" Got the right time, wrong DST value -- adjusting\n"); +#endif + } + + last_distance = distance; + + } while (distance != 0); + + /* Check to see that the dst flag matches */ + + if (me->tm_isdst != -1) + { + if (me->tm_isdst != guess_tm->tm_isdst) + { +#ifdef DEBUG + printf (" DST flag doesn't match! FIXME?\n"); +#endif + return BAD_STRUCT_TM; + } + } + + result = guess; /* Success! */ + + /* On successful completion, the values of tm_wday and tm_yday + have to be set appropriately. */ + + /* me->tm_yday = guess_tm->tm_yday; + me->tm_mday = guess_tm->tm_mday; */ + + *me = *guess_tm; + } + + /* Update the caller's version of the structure */ + + *timeptr = *me; + + return result; +} + +time_t +#ifdef DEBUG /* make it work even if the system's + libc has it's own mktime routine */ +my_mktime (timeptr) +#else +mktime (timeptr) +#endif + struct tm *timeptr; +{ + return _mktime_internal (timeptr, localtime); +} + +#ifdef DEBUG +void +main (argc, argv) + int argc; + char *argv[]; +{ + int time; + int result_time; + struct tm *tmptr; + + if (argc == 1) + { + long q; + + printf ("starting long test...\n"); + + for (q = 10000000; q < 1000000000; q += 599) + { + struct tm *tm = localtime ((time_t *) &q); + if ((q % 10000) == 0) { printf ("%ld\n", q); fflush (stdout); } + if (q != my_mktime (tm)) + { printf ("failed for %ld\n", q); fflush (stdout); } + } + + printf ("test finished\n"); + + exit (0); + } + + if (argc != 2) + { + printf ("wrong # of args\n"); + exit (0); + } + + debugging_enabled = 1; /* We want to see the info */ + + ++argv; + time = atoi (*argv); + + tmptr = localtime ((time_t *) &time); + printf ("Localtime tells us that a time_t of %d represents\n ", time); + printtm (tmptr); + putchar ('\n'); + + printf (" Given localtime's return val, mktime returns %d which is\n ", + (int) my_mktime (tmptr)); + printtm (tmptr); + putchar ('\n'); + +#if 0 + tmptr->tm_sec -= 20; + tmptr->tm_min -= 20; + tmptr->tm_hour -= 20; + tmptr->tm_mday -= 20; + tmptr->tm_mon -= 20; + tmptr->tm_year -= 20; + tmptr->tm_gmtoff -= 20000; /* This has no effect! */ + tmptr->tm_zone = NULL; /* Nor does this! */ + tmptr->tm_isdst = -1; +#endif + + tmptr->tm_hour += 1; + tmptr->tm_isdst = -1; + + printf ("\n\nchanged ranges: "); + printtm (tmptr); + putchar ('\n'); + + result_time = my_mktime (tmptr); + printf ("\nmktime: %d\n", result_time); + + tmptr->tm_isdst = 0; + + printf ("\n\nchanged ranges: "); + printtm (tmptr); + putchar ('\n'); + + result_time = my_mktime (tmptr); + printf ("\nmktime: %d\n", result_time); +} +#endif /* DEBUG */ + + +/* +Local Variables: +compile-command: "gcc -g mktime.c -o mktime -DDEBUG" +End: +*/ diff --git a/src/apps/bin/sharutils-4.2.1/lib/pathmax.h b/src/apps/bin/sharutils-4.2.1/lib/pathmax.h new file mode 100644 index 0000000000..9ee7b841da --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/pathmax.h @@ -0,0 +1,53 @@ +/* Define PATH_MAX somehow. Requires sys/types.h. + Copyright (C) 1992 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _PATHMAX_H +#define _PATHMAX_H + +#ifdef HAVE_UNISTD_H +#include +#endif + +/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define + PATH_MAX but might cause redefinition warnings when sys/param.h is + later included (as on MORE/BSD 4.3). */ +#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__)) +#include +#endif + +#ifndef _POSIX_PATH_MAX +#define _POSIX_PATH_MAX 255 +#endif + +#if !defined(PATH_MAX) && defined(_PC_PATH_MAX) +#define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) +#endif + +/* Don't include sys/param.h if it already has been. */ +#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN) +#include +#endif + +#if !defined(PATH_MAX) && defined(MAXPATHLEN) +#define PATH_MAX MAXPATHLEN +#endif + +#ifndef PATH_MAX +#define PATH_MAX _POSIX_PATH_MAX +#endif + +#endif /* _PATHMAX_H */ diff --git a/src/apps/bin/sharutils-4.2.1/lib/stpcpy.c b/src/apps/bin/sharutils-4.2.1/lib/stpcpy.c new file mode 100644 index 0000000000..0fb1417412 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/stpcpy.c @@ -0,0 +1,32 @@ +/* stpcpy.c -- copy a string and return pointer to end of new string + Copyright (C) 1989, 1990 Free Software Foundation. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ + +char * +stpcpy (dest, src) + char *dest; + const char *src; +{ + while ((*dest++ = *src++) != '\0') + /* Do nothing. */ ; + return dest - 1; +} diff --git a/src/apps/bin/sharutils-4.2.1/lib/strftime.c b/src/apps/bin/sharutils-4.2.1/lib/strftime.c new file mode 100644 index 0000000000..484852a72d --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/strftime.c @@ -0,0 +1,469 @@ +/* strftime - custom formatting of date and/or time + Copyright (C) 1989, 1991, 1992 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Note: this version of strftime lacks locale support, + but it is standalone. + + Performs `%' substitutions similar to those in printf. Except + where noted, substituted fields have a fixed size; numeric fields are + padded if necessary. Padding is with zeros by default; for fields + that display a single number, padding can be changed or inhibited by + following the `%' with one of the modifiers described below. Unknown + field specifiers are copied as normal characters. All other + characters are copied to the output without change. + + Supports a superset of the ANSI C field specifiers. + + Literal character fields: + % % + n newline + t tab + + Numeric modifiers (a nonstandard extension): + - do not pad the field + _ pad the field with spaces + + Time fields: + %H hour (00..23) + %I hour (01..12) + %k hour ( 0..23) + %l hour ( 1..12) + %M minute (00..59) + %p locale's AM or PM + %r time, 12-hour (hh:mm:ss [AP]M) + %R time, 24-hour (hh:mm) + %s time in seconds since 00:00:00, Jan 1, 1970 (a nonstandard extension) + %S second (00..61) + %T time, 24-hour (hh:mm:ss) + %X locale's time representation (%H:%M:%S) + %Z time zone (EDT), or nothing if no time zone is determinable + + Date fields: + %a locale's abbreviated weekday name (Sun..Sat) + %A locale's full weekday name, variable length (Sunday..Saturday) + %b locale's abbreviated month name (Jan..Dec) + %B locale's full month name, variable length (January..December) + %c locale's date and time (Sat Nov 04 12:02:33 EST 1989) + %C century (00..99) + %d day of month (01..31) + %e day of month ( 1..31) + %D date (mm/dd/yy) + %h same as %b + %j day of year (001..366) + %m month (01..12) + %U week number of year with Sunday as first day of week (00..53) + %w day of week (0..6) + %W week number of year with Monday as first day of week (00..53) + %x locale's date representation (mm/dd/yy) + %y last two digits of year (00..99) + %Y year (1970...) + + David MacKenzie */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#if defined(TM_IN_SYS_TIME) || (!defined(HAVE_TM_ZONE) && !defined(HAVE_TZNAME)) +#include +#else +#include +#endif + +#ifndef STDC_HEADERS +time_t mktime (); +#endif + +#if defined(HAVE_TZNAME) +extern char *tzname[2]; +#endif + +/* Types of padding for numbers in date and time. */ +enum padding +{ + none, blank, zero +}; + +static char const* const days[] = +{ + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" +}; + +static char const * const months[] = +{ + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" +}; + +/* Add character C to STRING and increment LENGTH, + unless LENGTH would exceed MAX. */ + +#define add_char(c) \ + do \ + { \ + if (length + 1 <= max) \ + string[length++] = (c); \ + } \ + while (0) + +/* Add a 2 digit number to STRING, padding if specified. + Return the number of characters added, up to MAX. */ + +static int +add_num2 (string, num, max, pad) + char *string; + int num; + int max; + enum padding pad; +{ + int top = num / 10; + int length = 0; + + if (top == 0 && pad == blank) + add_char (' '); + else if (top != 0 || pad == zero) + add_char (top + '0'); + add_char (num % 10 + '0'); + return length; +} + +/* Add a 3 digit number to STRING, padding if specified. + Return the number of characters added, up to MAX. */ + +static int +add_num3 (string, num, max, pad) + char *string; + int num; + int max; + enum padding pad; +{ + int top = num / 100; + int mid = (num - top * 100) / 10; + int length = 0; + + if (top == 0 && pad == blank) + add_char (' '); + else if (top != 0 || pad == zero) + add_char (top + '0'); + if (mid == 0 && top == 0 && pad == blank) + add_char (' '); + else if (mid != 0 || top != 0 || pad == zero) + add_char (mid + '0'); + add_char (num % 10 + '0'); + return length; +} + +/* Like strncpy except return the number of characters copied. */ + +static int +add_str (to, from, max) + char *to; + const char *from; + int max; +{ + int i; + + for (i = 0; from[i] && i <= max; ++i) + to[i] = from[i]; + return i; +} + +static int +add_num_time_t (string, max, num) + char *string; + int max; + time_t num; +{ + /* This buffer is large enough to hold the character representation + (including the trailing NUL) of any unsigned decimal quantity + whose binary representation fits in 128 bits. */ + char buf[40]; + int length; + + if (sizeof (num) > 16) + abort (); + sprintf (buf, "%lu", (unsigned long) num); + length = add_str (string, buf, max); + return length; +} + +/* Return the week in the year of the time in TM, with the weeks + starting on Sundays. */ + +static int +sun_week (tm) + struct tm *tm; +{ + int dl; + + /* Set `dl' to the day in the year of the last day of the week previous + to the one containing the day specified in TM. If the day specified + in TM is in the first week of the year, `dl' will be negative or 0. + Otherwise, calculate the number of complete weeks before our week + (dl / 7) and add any partial week at the start of the year (dl % 7). */ + dl = tm->tm_yday - tm->tm_wday; + return dl <= 0 ? 0 : dl / 7 + (dl % 7 != 0); +} + +/* Return the week in the year of the time in TM, with the weeks + starting on Mondays. */ + +static int +mon_week (tm) + struct tm *tm; +{ + int dl, wday; + + if (tm->tm_wday == 0) + wday = 6; + else + wday = tm->tm_wday - 1; + dl = tm->tm_yday - wday; + return dl <= 0 ? 0 : dl / 7 + (dl % 7 != 0); +} + +#if !defined(HAVE_TM_ZONE) && !defined(HAVE_TZNAME) +char * +zone_name (tp) + struct tm *tp; +{ + char *timezone (); + struct timeval tv; + struct timezone tz; + + gettimeofday (&tv, &tz); + return timezone (tz.tz_minuteswest, tp->tm_isdst); +} +#endif + +/* Format the time given in TM according to FORMAT, and put the + results in STRING. + Return the number of characters (not including terminating null) + that were put into STRING, or 0 if the length would have + exceeded MAX. */ + +size_t +strftime (string, max, format, tm) + char *string; + size_t max; + const char *format; + const struct tm *tm; +{ + enum padding pad; /* Type of padding to apply. */ + size_t length = 0; /* Characters put in STRING so far. */ + + for (; *format && length < max; ++format) + { + if (*format != '%') + add_char (*format); + else + { + ++format; + /* Modifiers: */ + if (*format == '-') + { + pad = none; + ++format; + } + else if (*format == '_') + { + pad = blank; + ++format; + } + else + pad = zero; + + switch (*format) + { + /* Literal character fields: */ + case 0: + case '%': + add_char ('%'); + break; + case 'n': + add_char ('\n'); + break; + case 't': + add_char ('\t'); + break; + default: + add_char (*format); + break; + + /* Time fields: */ + case 'H': + case 'k': + length += + add_num2 (&string[length], tm->tm_hour, max - length, + *format == 'H' ? pad : blank); + break; + case 'I': + case 'l': + { + int hour12; + + if (tm->tm_hour == 0) + hour12 = 12; + else if (tm->tm_hour > 12) + hour12 = tm->tm_hour - 12; + else + hour12 = tm->tm_hour; + length += + add_num2 (&string[length], hour12, max - length, + *format == 'I' ? pad : blank); + } + break; + case 'M': + length += + add_num2 (&string[length], tm->tm_min, max - length, pad); + break; + case 'p': + if (tm->tm_hour < 12) + add_char ('A'); + else + add_char ('P'); + add_char ('M'); + break; + case 'r': + length += + strftime (&string[length], max - length, "%I:%M:%S %p", tm); + break; + case 'R': + length += + strftime (&string[length], max - length, "%H:%M", tm); + break; + + case 's': + { + struct tm writable_tm; + writable_tm = *tm; + length += add_num_time_t (&string[length], max - length, + mktime (&writable_tm)); + } + break; + + case 'S': + length += + add_num2 (&string[length], tm->tm_sec, max - length, pad); + break; + case 'T': + length += + strftime (&string[length], max - length, "%H:%M:%S", tm); + break; + case 'X': + length += + strftime (&string[length], max - length, "%H:%M:%S", tm); + break; + case 'Z': +#ifdef HAVE_TM_ZONE + length += add_str (&string[length], tm->tm_zone, max - length); +#else +#ifdef HAVE_TZNAME + if (tm->tm_isdst && tzname[1] && *tzname[1]) + length += add_str (&string[length], tzname[1], max - length); + else + length += add_str (&string[length], tzname[0], max - length); +#else + length += add_str (&string[length], zone_name (tm), max - length); +#endif +#endif + break; + + /* Date fields: */ + case 'a': + add_char (days[tm->tm_wday][0]); + add_char (days[tm->tm_wday][1]); + add_char (days[tm->tm_wday][2]); + break; + case 'A': + length += + add_str (&string[length], days[tm->tm_wday], max - length); + break; + case 'b': + case 'h': + add_char (months[tm->tm_mon][0]); + add_char (months[tm->tm_mon][1]); + add_char (months[tm->tm_mon][2]); + break; + case 'B': + length += + add_str (&string[length], months[tm->tm_mon], max - length); + break; + case 'c': + length += + strftime (&string[length], max - length, + "%a %b %d %H:%M:%S %Z %Y", tm); + break; + case 'C': + length += + add_num2 (&string[length], (tm->tm_year + 1900) / 100, + max - length, pad); + break; + case 'd': + length += + add_num2 (&string[length], tm->tm_mday, max - length, pad); + break; + case 'e': + length += + add_num2 (&string[length], tm->tm_mday, max - length, blank); + break; + case 'D': + length += + strftime (&string[length], max - length, "%m/%d/%y", tm); + break; + case 'j': + length += + add_num3 (&string[length], tm->tm_yday + 1, max - length, pad); + break; + case 'm': + length += + add_num2 (&string[length], tm->tm_mon + 1, max - length, pad); + break; + case 'U': + length += + add_num2 (&string[length], sun_week (tm), max - length, pad); + break; + case 'w': + add_char (tm->tm_wday + '0'); + break; + case 'W': + length += + add_num2 (&string[length], mon_week (tm), max - length, pad); + break; + case 'x': + length += + strftime (&string[length], max - length, "%m/%d/%y", tm); + break; + case 'y': + length += + add_num2 (&string[length], tm->tm_year % 100, + max - length, pad); + break; + case 'Y': + add_char ((tm->tm_year + 1900) / 1000 + '0'); + length += + add_num3 (&string[length], + (1900 + tm->tm_year) % 1000, max - length, zero); + break; + } + } + } + add_char (0); + return length - 1; +} diff --git a/src/apps/bin/sharutils-4.2.1/lib/system.h b/src/apps/bin/sharutils-4.2.1/lib/system.h new file mode 100644 index 0000000000..208a2316b3 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/system.h @@ -0,0 +1,212 @@ +/* Shared definitions for GNU shar utilities. + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* AIX requires this to be the first thing in the file. */ +#if defined (_AIX) && !defined (__GNUC__) + #pragma alloca +#endif + +#ifdef __GNUC__ +# undef alloca +# define alloca(n) __builtin_alloca (n) +#else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifndef _AIX +extern char *alloca (); +# endif +# endif +#endif + +#if __STDC__ +# define voidstar void * +#else +# define voidstar char * +#endif + +#ifdef STDC_HEADERS +# include +#else +char *getenv (); +#endif + +/* 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 + +#if HAVE_STRING_H +# include +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +#else +# include +#endif +#if !HAVE_MEMCPY +# ifndef memcpy +# define memcpy(D, S, N) bcopy (S, D, N) +# endif +#endif +#if !HAVE_STRCHR +# ifndef strchr +# define strchr index +# endif +#endif + +/* Other header files. */ + +#include + +#include +#ifndef errno +extern int errno; +#endif + +#include + +#ifdef HAVE_SYS_WAIT_H +# include +#endif + +/* Get definitions for the file permission bits. */ + +#include + +#ifdef STAT_MACROS_BROKEN +# undef S_ISDIR +# undef S_ISREG +#endif + +#ifndef S_IFMT +# define S_IFMT 0170000 +#endif +#if !defined(S_ISDIR) && defined(S_IFDIR) +# define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR) +#endif +#if !defined(S_ISREG) && defined(S_IFREG) +# define S_ISREG(Mode) (((Mode) & S_IFMT) == S_IFREG) +#endif + +#ifndef S_IRWXU +# define S_IRWXU 0700 +#endif +#ifndef S_IRUSR +# define S_IRUSR 0400 +#endif +#ifndef S_IWUSR +# define S_IWUSR 0200 +#endif +#ifndef S_IXUSR +# define S_IXUSR 0100 +#endif + +#ifndef S_IRWXG +# define S_IRWXG 0070 +#endif +#ifndef S_IRGRP +# define S_IRGRP 0040 +#endif +#ifndef S_IWGRP +# define S_IWGRP 0020 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0010 +#endif + +#ifndef S_IRWXO +# define S_IRWXO 0007 +#endif +#ifndef S_IROTH +# define S_IROTH 0004 +#endif +#ifndef S_IWOTH +# define S_IWOTH 0002 +#endif +#ifndef S_IXOTH +# define S_IXOTH 0001 +#endif + +/* System functions. Even if we usually avoid declaring them, we cannot + avoid them all. */ + +#ifdef HAVE_UNISTD_H +# include +#endif + +FILE *fdopen (); +long ftell (); +FILE *popen (); + +/* GNU small library functions. */ + +#ifndef __P +# if PROTOTYPES +# define __P(Args) Args +# else +# define __P(Args) () +# endif +#endif + +#if HAVE_LOCALE_H +# include +#else +# define setlocale(Category, Locale) +#endif + +//#include + +#define _(Str) gettext (Str) +#ifdef gettext_noop +# define N_(Str) gettext_noop (Str) +#else +# define N_(Str) (Str) +#endif + + +#if HAVE_BASENAME +char *basename (); +#else +char *basename __P ((const char *)); +#endif +void error __P ((int, int, const char *, ...)); +char *xgetcwd __P ((void)); +voidstar xmalloc __P ((size_t)); +voidstar xrealloc __P ((voidstar, size_t)); +char *xstrdup __P ((const char *)); +char *stpcpy __P ((char *, const char *)); + +/* Global functions of the shar package. */ + +void copy_file_encoded __P ((FILE *, FILE *)); +char *get_submitter __P ((char *)); + +/* Debugging the memory allocator. */ + +#if WITH_DMALLOC +# define MALLOC_FUNC_CHECK +# include +#endif diff --git a/src/apps/bin/sharutils-4.2.1/lib/whoami.c b/src/apps/bin/sharutils-4.2.1/lib/whoami.c new file mode 100644 index 0000000000..82cf20663a --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/whoami.c @@ -0,0 +1,118 @@ +/* Find out who I am & where I am. + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "system.h" + +/* Size of buffers holding strings. */ +#define STRING_BUFFER_SIZE 64 + +#include + +/* On Ultrix 2.x, uses SYS_NMLEN, which is only defined in + . Sigh! */ + +#ifdef HAVE_UNAME +# ifdef HAVE_LIMITS_H +# include +# endif +# include +# include +#else +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef _POSIX_VERSION +struct passwd *getpwuid (); +#endif + +/*----------------. +| Get user name. | +`----------------*/ + +static const char * +get_username () +{ + struct passwd *passwd; + + passwd = getpwuid (getuid ()); + endpwent (); + if (passwd == NULL) + return "???"; + return passwd->pw_name; +} + +/*------------------------------------------------------. +| Do uname, gethostname, or read file (/etc/systemid). | +`------------------------------------------------------*/ + +static const char * +get_hostname () +{ +#if HAVE_UNAME + + static struct utsname hostname_buffer; + + uname (&hostname_buffer); + return hostname_buffer.nodename; + +#else +# if HAVE_ETC_SYSTEMID + + FILE *fpsid = fopen ("/etc/systemid", "r"); + static char buffer[STRING_BUFFER_SIZE]; + + if (!fpsid) + return "???"; + fgets (buffer, sizeof (buffer), fpsid); + fclose (fpsid); + buffer[strlen (buffer) - 1] = 0; + return buffer; + +# else + + static char hostname_buffer[STRING_BUFFER_SIZE]; + + gethostname (hostname_buffer, sizeof (hostname_buffer)); + return hostname_buffer; + +# endif +#endif +} + +/*------------------------------------------------------------------. +| Fill BUFFER with a string representing the username and hostname | +| separated by an `@' sign, and return a pointer to the constructed | +| string. If BUFFER is NULL, use an internal buffer instead. | +`------------------------------------------------------------------*/ + +char * +get_submitter (buffer) + char *buffer; +{ + static char static_buffer[STRING_BUFFER_SIZE]; + + if (!buffer) + buffer = static_buffer; + strcpy (buffer, get_username ()); + strcat (buffer, "@"); + return strcat (buffer, get_hostname ()); +} diff --git a/src/apps/bin/sharutils-4.2.1/lib/xgetcwd.c b/src/apps/bin/sharutils-4.2.1/lib/xgetcwd.c new file mode 100644 index 0000000000..1c1a7bd77e --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/xgetcwd.c @@ -0,0 +1,78 @@ +/* xgetcwd.c -- return current directory with unlimited length + Copyright (C) 1992 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by David MacKenzie . */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#ifndef errno +extern int errno; +#endif +#include +#include "pathmax.h" + +#ifndef HAVE_GETCWD +char *getwd (); +#define getcwd(buf, max) getwd (buf) +#else +char *getcwd (); +#endif + +/* Amount to increase buffer size by in each try. */ +#define PATH_INCR 32 + +char *xmalloc (); +char *xrealloc (); +void free (); + +/* Return the current directory, newly allocated, arbitrarily long. + Return NULL and set errno on error. */ + +char * +xgetcwd () +{ + char *cwd; + char *ret; + unsigned path_max; + + errno = 0; + path_max = (unsigned) PATH_MAX; + path_max += 2; /* The getcwd docs say to do this. */ + + cwd = xmalloc (path_max); + + errno = 0; + while ((ret = getcwd (cwd, path_max)) == NULL && errno == ERANGE) + { + path_max += PATH_INCR; + cwd = xrealloc (cwd, path_max); + errno = 0; + } + + if (ret == NULL) + { + int save_errno = errno; + free (cwd); + errno = save_errno; + return NULL; + } + return cwd; +} diff --git a/src/apps/bin/sharutils-4.2.1/lib/xmalloc.c b/src/apps/bin/sharutils-4.2.1/lib/xmalloc.c new file mode 100644 index 0000000000..ff147827f9 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/xmalloc.c @@ -0,0 +1,114 @@ +/* xmalloc.c -- malloc with out of memory checking + Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#if __STDC__ +#define VOID void +#else +#define VOID char +#endif + +#include + +#if STDC_HEADERS +#include +#else +VOID *calloc (); +VOID *malloc (); +VOID *realloc (); +void free (); +#endif + +//#include + +#define _(str) gettext (str) + +#ifndef EXIT_FAILURE +#define EXIT_FAILURE 4 +#endif + +/* Exit value when the requested amount of memory is not available. + The caller may set it to some other value. */ +int xmalloc_exit_failure = EXIT_FAILURE; + +#if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT) +void error (int, int, const char *, ...); +#else +void error (); +#endif + +static VOID * +fixup_null_alloc (n) + size_t n; +{ + VOID *p; + + p = 0; + if (n == 0) + p = malloc ((size_t) 1); + if (p == 0) + error (xmalloc_exit_failure, 0, _("memory exhausted")); + return p; +} + +/* Allocate N bytes of memory dynamically, with error checking. */ + +VOID * +xmalloc (n) + size_t n; +{ + VOID *p; + + p = malloc (n); + if (p == 0) + p = fixup_null_alloc (n); + return p; +} + +/* Allocate memory for N elements of S bytes, with error checking. */ + +VOID * +xcalloc (n, s) + size_t n, s; +{ + VOID *p; + + p = calloc (n, s); + if (p == 0) + p = fixup_null_alloc (n); + return p; +} + +/* Change the size of an allocated block of memory P to N bytes, + with error checking. + If P is NULL, run xmalloc. */ + +VOID * +xrealloc (p, n) + VOID *p; + size_t n; +{ + if (p == 0) + return xmalloc (n); + p = realloc (p, n); + if (p == 0) + p = fixup_null_alloc (n); + return p; +} diff --git a/src/apps/bin/sharutils-4.2.1/lib/xstrdup.c b/src/apps/bin/sharutils-4.2.1/lib/xstrdup.c new file mode 100644 index 0000000000..1b5b415b2b --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/lib/xstrdup.c @@ -0,0 +1,36 @@ +/* xstrdup.c -- copy a string with out of memory checking + Copyright (C) 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) +#include +#else +#include +#endif +char *xmalloc (); + +/* Return a newly allocated copy of STRING. */ + +char * +xstrdup (string) + char *string; +{ + return strcpy (xmalloc (strlen (string) + 1), string); +} diff --git a/src/apps/bin/sharutils-4.2.1/mkinstalldirs b/src/apps/bin/sharutils-4.2.1/mkinstalldirs new file mode 100755 index 0000000000..91f6d04e17 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/mkinstalldirs @@ -0,0 +1,32 @@ +#!/bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Last modified: 1994-03-25 +# Public domain + +errstatus=0 + +for file in ${1+"$@"} ; do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d in ${1+"$@"} ; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" || errstatus=$? + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/src/apps/bin/sharutils-4.2.1/po/ChangeLog b/src/apps/bin/sharutils-4.2.1/po/ChangeLog new file mode 100644 index 0000000000..4e6c329a19 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/ChangeLog @@ -0,0 +1,61 @@ +Mon Dec 4 16:55:15 1995 Ulrich Drepper + + * sv.po: Update for 4.2 by Jan Djarv. + + * fr.po: Small change. + +Sun Dec 3 01:24:49 1995 Ulrich Drepper + + * fr.po: Version for 4.2 by Franc,ois Pinard. + +Mon Nov 27 02:47:52 1995 Sakai Kiyotaka + + * ja_JP.EUC.po: Update for sharutils-4.1.12a. + +Sun Nov 26 02:23:53 1995 Ulrich Drepper + + * de.po: Removed double words in two line message. + +Fri Nov 24 19:57:59 1995 Ulrich Drepper + + * de.po: Last changes after using new xgettext program. + +Tue Nov 14 10:55:59 1995 Sakai Kiyotaka + + * ja_JP.EUC.po: Initial revision. + +Tue Oct 31 21:26:30 1995 Franc,ois Pinard + + * fr.po: Update for version for 4.1.9. + +Sat Oct 28 01:43:12 1995 Ulrich Drepper + + * fr.po, nl.po, pt.po, sv.po, de.po: + Removed message about fixed limit. + +Fri Oct 27 22:36:53 1995 Ulrich Drepper + + * de.po: Translation for 4.1.9. + +Fri Oct 6 02:22:27 1995 Jan Djarv + + * sv.po: Update of messages for sharutils-4.1.8. + +Sat Sep 23 15:35:23 1995 Ulrich Drepper + + * de.po: Last minute changes for 4.1.7. + +Tue Aug 15 06:49:56 1995 Ulrich Drepper + + * POTFILES.in: + New format of entries according to gettext-0.9.2. Now relative to + top level directory of project. + +Sun Aug 13 23:30:54 1995 Ulrich Drepper + + * sharutils.pot: Version knowing about lock directory. + +Thu Aug 3 00:30:27 1995 Ulrich Drepper + + * sharutils.pot, POTFILES.in, Makefile.in.in: Initial revision. + diff --git a/src/apps/bin/sharutils-4.2.1/po/Makefile b/src/apps/bin/sharutils-4.2.1/po/Makefile new file mode 100644 index 0000000000..ff4c994770 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/Makefile @@ -0,0 +1,216 @@ +# Generated automatically from Makefile.in.in by configure. +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = sharutils +VERSION = 4.2.1 + +SHELL = /bin/sh + + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} +datadir = $(prefix)/share +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext +subdir = po + +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 + +CC = gcc +GENCAT = +GMSGFMT = msgfmt +MSGFMT = msgfmt +XGETTEXT = xgettext +TUPDATE = tupdate + +DEFS = -DHAVE_CONFIG_H +CFLAGS = -g -O +CPPFLAGS = + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = de.po fr.po ja_JP.EUC.po nl.po pt.po sv.po +GMOFILES = de.gmo fr.gmo ja_JP.EUC.gmo nl.gmo pt.gmo sv.gmo +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + ../lib/error.c \ + ../lib/getopt.c \ + ../lib/xmalloc.c \ + ../src/shar.c \ + ../src/unshar.c \ + ../src/uudecode.c \ + ../src/uuencode.c + +CATALOGS = de.gmo fr.gmo ja_JP.EUC.gmo nl.gmo pt.gmo sv.gmo +CATOBJEXT = .gmo +INSTOBJEXT = .mo + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(TUPDATE) $(srcdir)/$(PACKAGE).pot $< > $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: cat-id-tbl.c $(CATALOGS) + +$(PACKAGE).pot: $(POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/POTFILES.in + if cmp -s $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; then \ + rm -f $(PACKAGE).po; \ + else \ + rm -f $(srcdir)/$(PACKAGE).pot \ + && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; \ + fi + +cat-id-tbl.c: stamp-cat-id +stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp.c + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp.c + if cmp -s cat-id-tbl.tmp.c $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp.c; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp.c $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-data: all + $(top_srcdir)/mkinstalldirs $(datadir) + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + if test "`echo $$cat | sed 's/.*\(\..*\)/\1/'`" = ".gmo"; then \ + destdir=$(gnulocaledir); \ + else \ + destdir=$(localedir); \ + fi; \ + lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + $(top_srcdir)/mkinstalldirs $$dir; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + fi; \ + done + +# This installation goal is only used in GNU gettext. Packages which +# only use the library should use install instead. +install-src: install + $(top_srcdir)/mkinstalldirs $(gettextsrcdir) + cd $(srcdir) && \ + $(INSTALL_DATA) Makefile.in.in $(gettextsrcdir)/po-Makefile.in.in + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp.c + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist dist-gettext: update-po $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \ + mv $$lang.po $$lang.old.po; \ + if $(TUPDATE) $(PACKAGE).pot $$lang.old.po > $$lang.po; then \ + rm -f $$lang.old.po; \ + else \ + echo "tupdate for $$cat failed!"; \ + rm -f $$lang.po; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" \ + -e '$$s/\(.*\) \\/\1/' < $(srcdir)/POTFILES.in > POTFILES ) + +Makefile: Makefile.in.in ../config.status POTFILES + cd .. && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/po/Makefile.in b/src/apps/bin/sharutils-4.2.1/po/Makefile.in new file mode 100644 index 0000000000..34d46cd32c --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/Makefile.in @@ -0,0 +1,209 @@ +# Generated automatically from Makefile.in.in by configure. +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = sharutils +VERSION = 4.2.1 + +SHELL = /bin/sh + + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} +datadir = $(prefix)/share +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext +subdir = po + +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 + +CC = gcc +GENCAT = +GMSGFMT = msgfmt +MSGFMT = msgfmt +XGETTEXT = xgettext +TUPDATE = tupdate + +DEFS = -DHAVE_CONFIG_H +CFLAGS = -g -O +CPPFLAGS = + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = de.po fr.po ja_JP.EUC.po nl.po pt.po sv.po +GMOFILES = de.gmo fr.gmo ja_JP.EUC.gmo nl.gmo pt.gmo sv.gmo +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + +CATALOGS = de.gmo fr.gmo ja_JP.EUC.gmo nl.gmo pt.gmo sv.gmo +CATOBJEXT = .gmo +INSTOBJEXT = .mo + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(TUPDATE) $(srcdir)/$(PACKAGE).pot $< > $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: cat-id-tbl.c $(CATALOGS) + +$(PACKAGE).pot: $(POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/POTFILES.in + if cmp -s $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; then \ + rm -f $(PACKAGE).po; \ + else \ + rm -f $(srcdir)/$(PACKAGE).pot \ + && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; \ + fi + +cat-id-tbl.c: stamp-cat-id +stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp.c + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp.c + if cmp -s cat-id-tbl.tmp.c $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp.c; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp.c $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-data: all + $(top_srcdir)/mkinstalldirs $(datadir) + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + if test "`echo $$cat | sed 's/.*\(\..*\)/\1/'`" = ".gmo"; then \ + destdir=$(gnulocaledir); \ + else \ + destdir=$(localedir); \ + fi; \ + lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + $(top_srcdir)/mkinstalldirs $$dir; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + fi; \ + done + +# This installation goal is only used in GNU gettext. Packages which +# only use the library should use install instead. +install-src: install + $(top_srcdir)/mkinstalldirs $(gettextsrcdir) + cd $(srcdir) && \ + $(INSTALL_DATA) Makefile.in.in $(gettextsrcdir)/po-Makefile.in.in + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp.c + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist dist-gettext: update-po $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \ + mv $$lang.po $$lang.old.po; \ + if $(TUPDATE) $(PACKAGE).pot $$lang.old.po > $$lang.po; then \ + rm -f $$lang.old.po; \ + else \ + echo "tupdate for $$cat failed!"; \ + rm -f $$lang.po; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" \ + -e '$$s/\(.*\) \\/\1/' < $(srcdir)/POTFILES.in > POTFILES ) + +Makefile: Makefile.in.in ../config.status POTFILES + cd .. && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/po/Makefile.in.in b/src/apps/bin/sharutils-4.2.1/po/Makefile.in.in new file mode 100644 index 0000000000..491f0fd12c --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/Makefile.in.in @@ -0,0 +1,209 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = $(prefix)/@DATADIRNAME@ +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext +subdir = po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +CC = @CC@ +GENCAT = @GENCAT@ +GMSGFMT = @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = @XGETTEXT@ +TUPDATE = tupdate + +DEFS = @DEFS@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +INSTOBJEXT = @INSTOBJEXT@ + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(TUPDATE) $(srcdir)/$(PACKAGE).pot $< > $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: cat-id-tbl.c $(CATALOGS) + +$(PACKAGE).pot: $(POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/POTFILES.in + if cmp -s $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; then \ + rm -f $(PACKAGE).po; \ + else \ + rm -f $(srcdir)/$(PACKAGE).pot \ + && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; \ + fi + +cat-id-tbl.c: stamp-cat-id +stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp.c + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp.c + if cmp -s cat-id-tbl.tmp.c $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp.c; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp.c $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-data: all + $(top_srcdir)/mkinstalldirs $(datadir) + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + if test "`echo $$cat | sed 's/.*\(\..*\)/\1/'`" = ".gmo"; then \ + destdir=$(gnulocaledir); \ + else \ + destdir=$(localedir); \ + fi; \ + lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + $(top_srcdir)/mkinstalldirs $$dir; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + fi; \ + done + +# This installation goal is only used in GNU gettext. Packages which +# only use the library should use install instead. +install-src: install + $(top_srcdir)/mkinstalldirs $(gettextsrcdir) + cd $(srcdir) && \ + $(INSTALL_DATA) Makefile.in.in $(gettextsrcdir)/po-Makefile.in.in + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp.c + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist dist-gettext: update-po $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \ + mv $$lang.po $$lang.old.po; \ + if $(TUPDATE) $(PACKAGE).pot $$lang.old.po > $$lang.po; then \ + rm -f $$lang.old.po; \ + else \ + echo "tupdate for $$cat failed!"; \ + rm -f $$lang.po; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" \ + -e '$$s/\(.*\) \\/\1/' < $(srcdir)/POTFILES.in > POTFILES ) + +Makefile: Makefile.in.in ../config.status POTFILES + cd .. && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/po/POTFILES b/src/apps/bin/sharutils-4.2.1/po/POTFILES new file mode 100644 index 0000000000..a591807c48 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/POTFILES @@ -0,0 +1,7 @@ + ../lib/error.c \ + ../lib/getopt.c \ + ../lib/xmalloc.c \ + ../src/shar.c \ + ../src/unshar.c \ + ../src/uudecode.c \ + ../src/uuencode.c diff --git a/src/apps/bin/sharutils-4.2.1/po/POTFILES.in b/src/apps/bin/sharutils-4.2.1/po/POTFILES.in new file mode 100644 index 0000000000..769d200647 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/POTFILES.in @@ -0,0 +1,13 @@ +# List of files which containing translatable strings. +# Copyright (C) 1995 Free Software Foundation, Inc. + +# Files from the compatibility library +lib/error.c +lib/getopt.c +lib/xmalloc.c + +# Package source files +src/shar.c +src/unshar.c +src/uudecode.c +src/uuencode.c diff --git a/src/apps/bin/sharutils-4.2.1/po/cat-id-tbl.c b/src/apps/bin/sharutils-4.2.1/po/cat-id-tbl.c new file mode 100644 index 0000000000..711005a6a2 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/cat-id-tbl.c @@ -0,0 +1,190 @@ +/* Automatically generated by po2tbl.sed from sharutils.pot. */ + +#if HAVE_CONFIG_H +# include +#endif + +#include "libgettext.h" + +const struct _msg_ent _msg_tbl[] = { + {"", 1}, + {"Unknown system error", 2}, + {"%s: option `%s' is ambiguous\n", 3}, + {"%s: option `--%s' doesn't allow an argument\n", 4}, + {"%s: option `%c%s' doesn't allow an argument\n", 5}, + {"%s: option `%s' requires an argument\n", 6}, + {"%s: unrecognized option `--%s'\n", 7}, + {"%s: unrecognized option `%c%s'\n", 8}, + {"%s: illegal option -- %c\n", 9}, + {"%s: invalid option -- %c\n", 10}, + {"%s: option requires an argument -- %c\n", 11}, + {"memory exhausted", 12}, + {"WARNING: not restoring timestamps. Consider getting and", 13}, + {"installing GNU \\`touch', distributed in GNU File Utilities...", 14}, + {"creating lock directory", 15}, + {"failed to create lock directory", 16}, + {"Too many directories for mkdir generation", 17}, + {"creating directory", 18}, + {"Cannot access %s", 19}, + {"-C is being deprecated, use -Z instead", 20}, + {"Cannot get current directory name", 21}, + {"Must unpack archives in sequence!", 22}, + {"Please unpack part", 23}, + {"next!", 24}, + {"%s: Not a regular file", 25}, + {"In shar: remaining size %ld\n", 26}, + {"Newfile, remaining %ld, ", 27}, + {"Limit still %d\n", 28}, + {"restore of", 29}, + {"failed", 30}, + {"End of part", 31}, + {"continue with part", 32}, + {"Starting file %s\n", 33}, + {"empty", 34}, + {"(empty)", 35}, + {"Cannot open file %s", 36}, + {"compressed", 37}, + {"gzipped", 38}, + {"binary", 39}, + {"(compressed)", 40}, + {"(gzipped)", 41}, + {"(binary)", 42}, + {"Could not fork", 43}, + {"File %s (%s)", 44}, + {"text", 45}, + {"(text)", 46}, + {"overwriting", 47}, + {"overwrite", 48}, + {"[no, yes, all, quit] (no)?", 49}, + {"extraction aborted", 50}, + {"SKIPPING", 51}, + {"(file already exists)", 52}, + {"Saving %s (%s)", 53}, + {"extracting", 54}, + {"End of", 55}, + {"archive", 56}, + {"part", 57}, + {"File", 58}, + {"is continued in part", 59}, + {"Please unpack part 1 first!", 60}, + {"STILL SKIPPING", 61}, + {"continuing file", 62}, + {"is complete", 63}, + {"uudecoding file", 64}, + {"uncompressing file", 65}, + {"gunzipping file", 66}, + {"MD5 check failed", 67}, + {"original size", 68}, + {"current size", 69}, + {"Opening `%s'", 70}, + {"Closing `%s'", 71}, + {"Try `%s --help' for more information.\n", 72}, + {"Usage: %s [OPTION]... [FILE]...\n", 73}, + {"Mandatory arguments to long options are mandatory for short options too.\n", 74}, + {"\ +\n\ +Giving feedback:\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ + -q, --quiet, --silent do not output verbose messages locally\n\ +\n\ +Selecting files:\n\ + -p, --intermix-type allow -[BTzZ] in file lists to change mode\n\ + -S, --stdin-file-list read file list from standard input\n\ +\n\ +Splitting output:\n\ + -o, --output-prefix=PREFIX output to file PREFIX.01 through PREFIX.NN\n\ + -l, --whole-size-limit=SIZE split archive, not files, to SIZE kilobytes\n\ + -L, --split-size-limit=SIZE split archive, or files, to SIZE kilobytes\n", 75}, + {"\ +\n\ +Controlling the shar headers:\n\ + -n, --archive-name=NAME use NAME to document the archive\n\ + -s, --submitter=ADDRESS override the submitter name\n\ + -a, --net-headers output Submitted-by: & Archive-name: headers\n\ + -c, --cut-mark start the shar with a cut line\n\ +\n\ +Selecting how files are stocked:\n\ + -M, --mixed-uuencode dynamically decide uuencoding (default)\n\ + -T, --text-files treat all files as text\n\ + -B, --uuencode treat all files as binary, use uuencode\n\ + -z, --gzip gzip and uuencode all files\n\ + -g, --level-for-gzip=LEVEL pass -LEVEL (default 9) to gzip\n\ + -Z, --compress compress and uuencode all files\n\ + -b, --bits-per-code=BITS pass -bBITS (default 12) to compress\n", 76}, + {"\ +\n\ +Protecting against transmission:\n\ + -w, --no-character-count do not use `wc -c' to check size\n\ + -D, --no-md5-digest do not use `md5sum' digest to verify\n\ + -F, --force-prefix force the prefix character on every line\n\ + -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n\ +\n\ +Producing different kinds of shars:\n\ + -V, --vanilla-operation produce very simple and undemanding shars\n\ + -P, --no-piping exclusively use temporary files at unshar time\n\ + -x, --no-check-existing blindly overwrite existing files\n\ + -X, --query-user ask user before overwriting files (not for Net)\n\ + -m, --no-timestamp do not restore file modification dates & times\n\ + -Q, --quiet-unshar avoid verbose messages at unshar time\n\ + -f, --basename restore in one directory, despite hierarchy\n\ + --no-i18n do not produce internationalized shell script\n", 77}, + {"\ +\n\ +Option -o is required with -l or -L, option -n is required with -a.\n\ +Option -g implies -z, option -b implies -Z.\n", 78}, + {"DEBUG was not selected at compile time", 79}, + {"Hard limit %dk\n", 80}, + {"Soft limit %dk\n", 81}, + {"WARNING: No user interaction in vanilla mode", 82}, + {"WARNING: Non-text storage options overridden", 83}, + {"No input files", 84}, + {"Cannot use -a option without -n", 85}, + {"Cannot use -l or -L option without -o", 86}, + {"PLEASE avoid -X shars on Usenet or public networks", 87}, + {"You have unpacked the last part", 88}, + {"Created %d files\n", 89}, + {"Found no shell commands in %s", 90}, + {"%s looks like raw C code, not a shell archive", 91}, + {"Found no shell commands after `cut' in %s", 92}, + {"%s is probably not a shell archive", 93}, + {"The `cut' line was followed by: %s", 94}, + {"Starting `sh' process", 95}, + {"\ +Mandatory arguments to long options are mandatory for short options too.\n\ +\n\ + -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n\ + -c, --overwrite pass -c to shar script for overwriting files\n\ + -e, --exit-0 same as `--split-at=\"exit 0\"'\n\ + -E, --split-at=STRING split concatenated shars after STRING\n\ + -f, --force same as `-c'\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ +\n\ +If no FILE, standard input is read.\n", 96}, + {"Cannot chdir to `%s'", 97}, + {"standard input", 98}, + {"%s: Short file", 99}, + {"%s: No `end' line", 100}, + {"%s: data following `=' padding character", 101}, + {"%s: illegal line", 102}, + {"%s: No `begin' line", 103}, + {"%s: Illegal ~user", 104}, + {"%s: No user `%s'", 105}, + {"Usage: %s [FILE]...\n", 106}, + {"\ +Mandatory arguments to long options are mandatory to short options too.\n\ + -h, --help display this help and exit\n\ + -v, --version output version information and exit\n\ + -o, --output-file=FILE direct output to FILE\n", 107}, + {"Read error", 108}, + {"Usage: %s [INFILE] REMOTEFILE\n", 109}, + {"\ +\n\ + -h, --help display this help and exit\n\ + -m, --base64 use base64 encoding as of RFC1521\n\ + -v, --version output version information and exit\n", 110}, + {"Write error", 111}, +}; + +int _msg_tbl_length = 111; diff --git a/src/apps/bin/sharutils-4.2.1/po/de.gmo b/src/apps/bin/sharutils-4.2.1/po/de.gmo new file mode 100644 index 0000000000..cf8a20786f Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/po/de.gmo differ diff --git a/src/apps/bin/sharutils-4.2.1/po/de.po b/src/apps/bin/sharutils-4.2.1/po/de.po new file mode 100644 index 0000000000..d9ea3cddfc --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/de.po @@ -0,0 +1,591 @@ +msgid "" +msgstr "" +"Date: 1995-08-02 02:00:57+0200\n" +"From: Ulrich Drepper \n" +"Xgettext-Options: --default-domain=sharutils --output-dir=. --add-comments --keyword=_\n" +"Files: ../../po/../lib/error.c ../../po/../lib/getopt.c\n" +" ../../po/../lib/xmalloc.c ../../po/../src/shar.c\n" +" ../../po/../src/unshar.c ../../po/../src/uudecode.c\n" +" ../../po/../src/uuencode.c\n" + +#: lib/error.c:73 +msgid "Unknown system error" +msgstr "unbekannter Systemfehler" + +#: lib/getopt.c:516 +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: Option `%s' ist mehrdeutig\n" + +#: lib/getopt.c:540 +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: Option `--%s' erwartet kein Argument\n" + +#. +option or -option +#: lib/getopt.c:545 +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: Option `%c%s' erwartet kein Argument\n" + +#: lib/getopt.c:559 +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: Option `%s' erwartet ein Argument\n" + +#. --option +#: lib/getopt.c:587 +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: unbekannte Option `--%s'\n" + +#: lib/getopt.c:591 +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: unbekannte Option `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:616 +msgid "%s: illegal option -- %c\n" +msgstr "%s: unzulässige Option -- %c\n" + +#: lib/getopt.c:618 +msgid "%s: invalid option -- %c\n" +msgstr "%s: ungültige Option -- %c\n" + +#: lib/getopt.c:652 +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: Option erwartet ein Argument -- %c\n" + +#: lib/xmalloc.c:67 +msgid "memory exhausted" +msgstr "virtueller Speicher erschöpft" + +#: src/shar.c:569 +msgid "WARNING: not restoring timestamps. Consider getting and" +msgstr "WARNUNG: Zeitstempel der Datei wird nicht richtig gesetzt. Vielleicht" + +#: src/shar.c:571 +msgid "installing GNU \\`touch', distributed in GNU File Utilities..." +msgstr "wollen Sie Sich GNU \\\\`touch' aus den GNU File Utilities besorgen..." + +#: src/shar.c:586 +msgid "creating lock directory" +msgstr "erzeuge Sicherungsverzeichnis" + +#: src/shar.c:587 +msgid "failed to create lock directory" +msgstr "Sicherungsverzeichnis konnte nicht angelegt werden" + +#: src/shar.c:617 +msgid "Too many directories for mkdir generation" +msgstr "Zuviele Verzeichnisse für mkdir Erzeugung" + +#: src/shar.c:626 +msgid "creating directory" +msgstr "erzeuge Verzeichnis" + +#: src/shar.c:675 src/shar.c:902 +msgid "Cannot access %s" +msgstr "Auf %s kann nicht zugegriffen werden" + +#: src/shar.c:728 src/shar.c:1858 +msgid "-C is being deprecated, use -Z instead" +msgstr "-C wird abgelehnt, benutze -Z statt dessen" + +#: src/shar.c:781 src/unshar.c:366 +msgid "Cannot get current directory name" +msgstr "Kann den Name des aktuellen Verzeichnisses nicht ermitteln" + +#: src/shar.c:867 +msgid "Must unpack archives in sequence!" +msgstr "Archiv muß in der richtigen Reihenfolge ausgepackt werden!" + +#: src/shar.c:868 src/shar.c:1401 +msgid "Please unpack part" +msgstr "Bitte als nächstes Teil" + +#: src/shar.c:868 src/shar.c:1402 +msgid "next!" +msgstr "auspacken!" + +#: src/shar.c:897 +msgid "%s: Not a regular file" +msgstr "%s: Keine reguläre Datei" + +#: src/shar.c:912 +msgid "In shar: remaining size %ld\n" +msgstr "In shar: verbleibende Größe %ld\n" + +#. Change to another file. +#: src/shar.c:923 src/shar.c:1307 +msgid "Newfile, remaining %ld, " +msgstr "Neue Datei, es verbleiben %ld" + +#: src/shar.c:924 src/shar.c:1308 +msgid "Limit still %d\n" +msgstr "Größe immer noch %d\n" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "restore of" +msgstr "Restaurierung von" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "failed" +msgstr "ist fehlgeschlagen" + +#: src/shar.c:941 src/shar.c:1327 +msgid "End of part" +msgstr "Ende von Teil" + +#: src/shar.c:942 src/shar.c:1328 +msgid "continue with part" +msgstr "mache weiter mit Teil" + +#: src/shar.c:955 src/shar.c:1418 +msgid "Starting file %s\n" +msgstr "Starte Datei %s\n" + +#: src/shar.c:990 +msgid "empty" +msgstr "leer" + +#: src/shar.c:991 +msgid "(empty)" +msgstr "(Leer)" + +#: src/shar.c:1015 +msgid "Cannot open file %s" +msgstr "Kann Datei %s nicht öffnen" + +#: src/shar.c:1052 +msgid "compressed" +msgstr "komprimiert" + +#: src/shar.c:1053 +msgid "gzipped" +msgstr "mit gzip erstellt" + +#: src/shar.c:1053 +msgid "binary" +msgstr "binär" + +#: src/shar.c:1054 +msgid "(compressed)" +msgstr "(mit `compress' komprimiert)" + +#: src/shar.c:1055 +msgid "(gzipped)" +msgstr "(mit `gzip' komprimiert)" + +#: src/shar.c:1056 +msgid "(binary)" +msgstr "(Binär)" + +#: src/shar.c:1069 +msgid "Could not fork" +msgstr "Konnte nicht fork'en" + +#: src/shar.c:1074 src/shar.c:1126 +msgid "File %s (%s)" +msgstr "Datei %s (%s)" + +#: src/shar.c:1120 +msgid "text" +msgstr "Text" + +#: src/shar.c:1121 +msgid "(text)" +msgstr "(Text)" + +#: src/shar.c:1167 +msgid "overwriting" +msgstr "überschreibe" + +#: src/shar.c:1168 +msgid "overwrite" +msgstr "überschreibe" + +#: src/shar.c:1169 +msgid "[no, yes, all, quit] (no)?" +msgstr "[nein (n), ja (y), alle (a), Ende (q)] (nein)?" + +#: src/shar.c:1170 +msgid "extraction aborted" +msgstr "Herausholen abgebrochen" + +#: src/shar.c:1171 src/shar.c:1176 +msgid "SKIPPING" +msgstr "ÜBERSPRINGE" + +#: src/shar.c:1176 +msgid "(file already exists)" +msgstr "(Datei existiert bereits)" + +#: src/shar.c:1194 +msgid "Saving %s (%s)" +msgstr "Speichere %s (%s)" + +#: src/shar.c:1199 +msgid "extracting" +msgstr "packe aus" + +#: src/shar.c:1333 +msgid "End of" +msgstr "Ende von" + +#: src/shar.c:1334 +msgid "archive" +msgstr "Archiv" + +#: src/shar.c:1335 +msgid "part" +msgstr "Teil" + +#: src/shar.c:1337 src/shar.c:1443 +msgid "File" +msgstr "Datei" + +#: src/shar.c:1338 +msgid "is continued in part" +msgstr "wird fortgesetzt in Teil" + +#: src/shar.c:1398 +msgid "Please unpack part 1 first!" +msgstr "Bitte packen Sie zuerst Teil 1 aus!" + +#: src/shar.c:1415 +msgid "STILL SKIPPING" +msgstr "ÜBERSPRINGE IMMER NOCH" + +#: src/shar.c:1422 +msgid "continuing file" +msgstr "setze fort Datei" + +#: src/shar.c:1443 +msgid "is complete" +msgstr "ist vollständig" + +#: src/shar.c:1452 +msgid "uudecoding file" +msgstr "Dekodiere mit `uudecode' Datei" + +#: src/shar.c:1466 +msgid "uncompressing file" +msgstr "Dekomprimiere mit `uncompress' Datei" + +#: src/shar.c:1477 +msgid "gunzipping file" +msgstr "Dekomprimiere mit `gunzip' Datei" + +#: src/shar.c:1539 +msgid "MD5 check failed" +msgstr "MD5 Test fehlgeschlagen" + +#: src/shar.c:1580 +msgid "original size" +msgstr "ursprüngliche Größe" + +#: src/shar.c:1581 +msgid "current size" +msgstr "jetzige Größe" + +#: src/shar.c:1630 +msgid "Opening `%s'" +msgstr "Öffne `%s'" + +#: src/shar.c:1641 +msgid "Closing `%s'" +msgstr "Schließe `%s'" + +#: src/shar.c:1653 src/unshar.c:302 src/uudecode.c:370 src/uuencode.c:211 +msgid "Try `%s --help' for more information.\n" +msgstr "`%s --help' gibt weitere Informationen.\n" + +#: src/shar.c:1657 src/unshar.c:306 +msgid "Usage: %s [OPTION]... [FILE]...\n" +msgstr "Aufruf: %s [OPTION]... [DATEI]...\n" + +#: src/shar.c:1658 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Notwendige Argumente für Optionen in Langform sind auch für die\n" +"Kurzform notwendig.\n" + +#: src/shar.c:1661 +msgid "" +"\n" +"Giving feedback:\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +" -q, --quiet, --silent do not output verbose messages locally\n" +"\n" +"Selecting files:\n" +" -p, --intermix-type allow -[BTzZ] in file lists to change mode\n" +" -S, --stdin-file-list read file list from standard input\n" +"\n" +"Splitting output:\n" +" -o, --output-prefix=PREFIX output to file PREFIX.01 through PREFIX.NN\n" +" -l, --whole-size-limit=SIZE split archive, not files, to SIZE kilobytes\n" +" -L, --split-size-limit=SIZE split archive, or files, to SIZE kilobytes\n" +msgstr "" +"\n" +"Programminformationen:\n" +" --help zeige diese Hilfe und beende\n" +" --version zeige Versionsnummer und beende\n" +" -q, --quiet, --silent keine ausführlichen Ausgabe\n" +"\n" +"Auswahl von Dateien:\n" +" -p, --intermix-type erlaube -[BTzZ] in Dateilisten um Modus zu ändern\n" +" -S, --stdin-file-list Lese Dateiliste von der Standard Eingabe\n" +"\n" +"Unterteilung der Ausgabe:\n" +" -o, --output-prefix=PRÄFIX gebe in Dateien PRÄFIX.01 bis PRÄFIX.NN aus\n" +" -l, --whole-size-limit=GRÖSSE unterteile Archiv, nicht Dateien, GRÖSSE KB\n" +" -L, --split-size-limit=GRÖSSE unterteile Archiv oder Dateien in GRÖSSE KB\n" + +#: src/shar.c:1677 +msgid "" +"\n" +"Controlling the shar headers:\n" +" -n, --archive-name=NAME use NAME to document the archive\n" +" -s, --submitter=ADDRESS override the submitter name\n" +" -a, --net-headers output Submitted-by: & Archive-name: headers\n" +" -c, --cut-mark start the shar with a cut line\n" +"\n" +"Selecting how files are stocked:\n" +" -M, --mixed-uuencode dynamically decide uuencoding (default)\n" +" -T, --text-files treat all files as text\n" +" -B, --uuencode treat all files as binary, use uuencode\n" +" -z, --gzip gzip and uuencode all files\n" +" -g, --level-for-gzip=LEVEL pass -LEVEL (default 9) to gzip\n" +" -Z, --compress compress and uuencode all files\n" +" -b, --bits-per-code=BITS pass -bBITS (default 12) to compress\n" +msgstr "" +"\n" +"Kontrolle des Shar Kopfes:\n" +" -n, --archive-name=NAME benenne Archiv mit NAME\n" +" -s, --submitter=ADRESSE überschreibe Namen des Senders\n" +" -a, --net-headers gebe Submitted-by: und Archive-name: aus\n" +" -c, --cut-mark starte shar mit einer Trennlinie\n" +"\n" +"Wie Dateien behandelt werden:\n" +" -M, --mixed-uuencode entscheide selbst über uuencoding (standard)\n" +" -T, --text-files alle Dateien sind Text\n" +" -B, --uuencode alle Dateien sind Binär, benutze uuencode\n" +" -z, --gzip wende gzip und uuencode auf alle Dateien an\n" +" -g, --level-for-gzip=STUFE rufe gzip mit -STUFE (standard 9) auf\n" +" -Z, --compress wende compress und uuencode auf alle Dateien an\n" +" -b, --bits-per-code=BITS rufe compress mit -BITS (standard 12) auf\n" + +#: src/shar.c:1694 +msgid "" +"\n" +"Protecting against transmission:\n" +" -w, --no-character-count do not use `wc -c' to check size\n" +" -D, --no-md5-digest do not use `md5sum' digest to verify\n" +" -F, --force-prefix force the prefix character on every line\n" +" -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n" +"\n" +"Producing different kinds of shars:\n" +" -V, --vanilla-operation produce very simple and undemanding shars\n" +" -P, --no-piping exclusively use temporary files at unshar time\n" +" -x, --no-check-existing blindly overwrite existing files\n" +" -X, --query-user ask user before overwriting files (not for Net)\n" +" -m, --no-timestamp do not restore file modification dates & times\n" +" -Q, --quiet-unshar avoid verbose messages at unshar time\n" +" -f, --basename restore in one directory, despite hierarchy\n" +" --no-i18n do not produce internationalized shell script\n" +msgstr "" +"\n" +"Sicherheit bei der Übertragung:\n" +" -w, --no-character-count keine Größenüberprüfung mit `wc -c'\n" +" -D, --no-md5-digest keine Überprüfung mit `md5sum'\n" +" -F, --force-prefix stelle Präfix-Zeichen jeder Zeile voran\n" +" -d, --here-delimiter=ZEICHENKETTE verwende ZEICHENKETTE zur Dateiabgrenzung\n" +"\n" +"Produziere verschiedene Arten von Shars:\n" +" -V, --vanilla-operation produziere ganz einfache und genügsame Shars\n" +" -P, --no-piping benutze temporäre Dateien bei Unshar\n" +" -x, --no-check-existing überschreibe existierende Datei ohne Warnung\n" +" -X, --query-user frage Benutzer vor Überschreiben (nicht für Netz)\n" +" -m, --no-timestamp stelle Datei Änderungszeit/-datum nicht wieder her\n" +" -Q, --quiet-unshar keine ausführlichen Meldungen bei Unshar\n" +" -f, --basename stelle Verzeichnis, keine Unterverzeichnisse, her\n" +" --no-i18n erzeuge kein internationalisiertes Shar Archiv\n" + +#: src/shar.c:1712 +msgid "" +"\n" +"Option -o is required with -l or -L, option -n is required with -a.\n" +"Option -g implies -z, option -b implies -Z.\n" +msgstr "" +"\n" +"Option -o ist notwendig für -l oder -L, Option -n ist notwendig für -a.\n" +"Option -g impliziert -z, Option -b impliziert -Z.\n" + +#: src/shar.c:1798 +msgid "DEBUG was not selected at compile time" +msgstr "DEBUG wurde zur Übersetzungszeit nicht angegeben" + +#: src/shar.c:1819 +msgid "Hard limit %dk\n" +msgstr "Hartes Limit %dk\n" + +#: src/shar.c:1886 +msgid "Soft limit %dk\n" +msgstr "Weiches Limit %dk\n" + +#: src/shar.c:1987 +msgid "WARNING: No user interaction in vanilla mode" +msgstr "ACHTUNG: keine Benutzer-Eingabe im `vanilla' Modus" + +#: src/shar.c:1998 +msgid "WARNING: Non-text storage options overridden" +msgstr "ACHTUNG: Non-Text Speicher Option überschrieben" + +#: src/shar.c:2054 +msgid "No input files" +msgstr "Keine Eingabe-Dateien" + +#: src/shar.c:2060 +msgid "Cannot use -a option without -n" +msgstr "Option -a kann nicht ohne -n genutzt werden" + +#: src/shar.c:2066 +msgid "Cannot use -l or -L option without -o" +msgstr "Die Optionen -l und -L können nicht ohne -o genutzt werden" + +#: src/shar.c:2078 +msgid "PLEASE avoid -X shars on Usenet or public networks" +msgstr "BITTE -X shars im Usenet oder öffentlichen Netzwerken vermeiden" + +#: src/shar.c:2119 +msgid "You have unpacked the last part" +msgstr "Sie haben den letzten Teil ausgepackt" + +#: src/shar.c:2121 +msgid "Created %d files\n" +msgstr "%d Datei(en) erzeugt\n" + +#: src/unshar.c:158 +msgid "Found no shell commands in %s" +msgstr "Habe in %s keine Shell-Kommandos gefunden" + +#: src/unshar.c:174 +msgid "%s looks like raw C code, not a shell archive" +msgstr "%s sieht wie reiner C Code aus, nicht wie ein Shell-Archiv" + +#: src/unshar.c:210 +msgid "Found no shell commands after `cut' in %s" +msgstr "Habe keine Shell-Kommandos nach `cut' in %s gefunden" + +#: src/unshar.c:231 +msgid "%s is probably not a shell archive" +msgstr "%s ist wahrscheinlich kein Shell-Archiv" + +#: src/unshar.c:232 +msgid "The `cut' line was followed by: %s" +msgstr "Die `cut' Zeile wurde gefolgt von: %s" + +#: src/unshar.c:258 +msgid "Starting `sh' process" +msgstr "Starte `sh' Prozeß" + +#: src/unshar.c:307 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +"\n" +" -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n" +" -c, --overwrite pass -c to shar script for overwriting files\n" +" -e, --exit-0 same as `--split-at=\"exit 0\"'\n" +" -E, --split-at=STRING split concatenated shars after STRING\n" +" -f, --force same as `-c'\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +"\n" +"If no FILE, standard input is read.\n" +msgstr "" +"Notwendige Argumente für Optionen in Langform sind auch für die\n" +"Kurzform notwendig.\n" +"\n" +" -d, --directory=VERZEICHNIS gehe vor Auspacken ins Verzeichnis VERZEICHNIS\n" +" -c, --overwrite gebe -c Option an shar Skript zum Überschreiben\n" +" -e, --exit-0 dasselbe wie `--split-at=\"exit 0\"'\n" +" -E, --split-at=STRING teile aneinanderhängende shars bei STRING\n" +" -f, --force das selbe wie `-c'\n" +" --help Zeige diese Meldung an und beende\n" +" --version Zeige die Versionsnummer und beende\n" +"\n" +"Wenn keine DATEI angegeben wird von stdin gelesen.\n" + +#: src/unshar.c:384 +msgid "Cannot chdir to `%s'" +msgstr "chdir auf Verzeichnis `%s' nicht möglich" + +#: src/unshar.c:441 +msgid "standard input" +msgstr "Standard Eingabe" + +#: src/uudecode.c:98 src/uudecode.c:196 +msgid "%s: Short file" +msgstr "%s: zu kurze Datei" + +#: src/uudecode.c:141 +msgid "%s: No `end' line" +msgstr "%s: Zeile mit `end' fehlt" + +#: src/uudecode.c:205 +msgid "%s: data following `=' padding character" +msgstr "%s: weitere Daten nach `=' Füllzeichen" + +#: src/uudecode.c:229 src/uudecode.c:237 src/uudecode.c:251 +msgid "%s: illegal line" +msgstr "%s: ungültige Zeile" + +#: src/uudecode.c:289 +msgid "%s: No `begin' line" +msgstr "%s: Zeile mit `begin' fehlt" + +#: src/uudecode.c:321 +msgid "%s: Illegal ~user" +msgstr "%s: Illegaler ~Benutzer" + +#: src/uudecode.c:328 +msgid "%s: No user `%s'" +msgstr "%s: Benutzer `%s' existiert nicht" + +#: src/uudecode.c:374 +msgid "Usage: %s [FILE]...\n" +msgstr "Aufruf: %s [Dateien]...\n" + +#: src/uudecode.c:375 +msgid "" +"Mandatory arguments to long options are mandatory to short options too.\n" +" -h, --help display this help and exit\n" +" -v, --version output version information and exit\n" +" -o, --output-file=FILE direct output to FILE\n" +msgstr "" +"Notwendige Argumente für Optionen in Langform sind auch für die\n" +"Kurzform notwendig.\n" +" -h, --help zeige diese Hilfe und beende\n" +" -v, --version zeige Versionsnummer und beende\n" +" -o, --output-file=DATEI leite Ausgabe in DATEI um\n" + +#: src/uuencode.c:198 +msgid "Read error" +msgstr "Lesefehler" + +#: src/uuencode.c:215 +msgid "Usage: %s [INFILE] REMOTEFILE\n" +msgstr "Aufruf: %s [EINGABE_DATEI] AUSGABE_DATEI\n" + +#: src/uuencode.c:216 +msgid "" +"\n" +" -h, --help display this help and exit\n" +" -m, --base64 use base64 encoding as of RFC1521\n" +" -v, --version output version information and exit\n" +msgstr "" +"\n" +" -h, --help zeige diese Hilfe und beende\n" +" -m, --base64 benutze Base64 Kodierung wie in RFC1521 beschrieben\n" +" -v, --version zeige Versionsnummer und beende\n" + +#: src/uuencode.c:297 +msgid "Write error" +msgstr "Schreibfehler" diff --git a/src/apps/bin/sharutils-4.2.1/po/fr.gmo b/src/apps/bin/sharutils-4.2.1/po/fr.gmo new file mode 100644 index 0000000000..43780df542 Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/po/fr.gmo differ diff --git a/src/apps/bin/sharutils-4.2.1/po/fr.po b/src/apps/bin/sharutils-4.2.1/po/fr.po new file mode 100644 index 0000000000..cc10ed3a7d --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/fr.po @@ -0,0 +1,591 @@ +msgid "" +msgstr "" +"Date: 1995-08-02 02:00:57+0200\n" +"From: Francois Pinard \n" +"Xgettext-Options: --default-domain=sharutils --output-dir=. --add-comments --keyword=_\n" +"Files: ../../po/../lib/error.c ../../po/../lib/getopt.c\n" +"\t ../../po/../lib/xmalloc.c ../../po/../src/shar.c\n" +"\t ../../po/../src/unshar.c ../../po/../src/uudecode.c\n" +"\t ../../po/../src/uuencode.c\n" + +#: lib/error.c:73 +msgid "Unknown system error" +msgstr "Erreur système inconnue" + +#: lib/getopt.c:516 +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: l'option «%s» est ambiguë\n" + +#: lib/getopt.c:540 +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: l'option «--%s» n'admet pas d'argument\n" + +#. +option or -option +#: lib/getopt.c:545 +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: l'option «%c%s» n'admet pas d'argument\n" + +#: lib/getopt.c:559 +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: l'option «%s» exige un argment\n" + +#. --option +#: lib/getopt.c:587 +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: l'option «--%s» n'est pas reconnue\n" + +#: lib/getopt.c:591 +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: l'option «%c%s» n'est pas reconnue\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:616 +msgid "%s: illegal option -- %c\n" +msgstr "%s: option illégale -- %c\n" + +#: lib/getopt.c:618 +msgid "%s: invalid option -- %c\n" +msgstr "%s: l'option est invalide -- %c\n" + +#: lib/getopt.c:652 +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'option exige un argument -- %c\n" + +#: lib/xmalloc.c:67 +msgid "memory exhausted" +msgstr "il manque de mémoire" + +#: src/shar.c:569 +msgid "WARNING: not restoring timestamps. Consider getting and" +msgstr "ATTENTION: les estampilles ne seront pas remises en place. Obtenez et" + +#: src/shar.c:571 +msgid "installing GNU \\`touch', distributed in GNU File Utilities..." +msgstr "installez «touch» de GNU, disponible dans les «GNU File Utilities»..." + +#: src/shar.c:586 +msgid "creating lock directory" +msgstr "création du répertoire verrou" + +#: src/shar.c:587 +msgid "failed to create lock directory" +msgstr "création non réussie du répertoire verrou" + +#: src/shar.c:617 +msgid "Too many directories for mkdir generation" +msgstr "Trop de répertoires à fabriquer" + +#: src/shar.c:626 +msgid "creating directory" +msgstr "création du répertoire" + +#: src/shar.c:675 src/shar.c:902 +msgid "Cannot access %s" +msgstr "Incapable d'accéder à %s" + +#: src/shar.c:728 src/shar.c:1858 +msgid "-C is being deprecated, use -Z instead" +msgstr "-C tombe en désuétude, utilisez -Z de préférence" + +#: src/shar.c:781 src/unshar.c:366 +msgid "Cannot get current directory name" +msgstr "Incapable d'obtenir le nom du répertoire courant" + +#: src/shar.c:867 +msgid "Must unpack archives in sequence!" +msgstr "Les archives doivent être dépaquetées dans l'ordre!" + +#: src/shar.c:868 src/shar.c:1401 +msgid "Please unpack part" +msgstr "Prière de dépaqueter le morceau" + +#: src/shar.c:868 src/shar.c:1402 +msgid "next!" +msgstr "ensuite!" + +#: src/shar.c:897 +msgid "%s: Not a regular file" +msgstr "%s: Pas un fichier ordinaire" + +#: src/shar.c:912 +msgid "In shar: remaining size %ld\n" +msgstr "Dans shar: espace encore disponible %ld\n" + +#. Change to another file. +#: src/shar.c:923 src/shar.c:1307 +msgid "Newfile, remaining %ld, " +msgstr "Nouveau fichier, espace encore disponible %ld," + +#: src/shar.c:924 src/shar.c:1308 +msgid "Limit still %d\n" +msgstr "La limite demeure %d\n" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "restore of" +msgstr "remise en place de" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "failed" +msgstr "n'a pas réussi" + +#: src/shar.c:941 src/shar.c:1327 +msgid "End of part" +msgstr "Fin du morceau" + +#: src/shar.c:942 src/shar.c:1328 +msgid "continue with part" +msgstr "continuer avec le morceau" + +#: src/shar.c:955 src/shar.c:1418 +msgid "Starting file %s\n" +msgstr "Traitement de %s\n" + +#: src/shar.c:990 +msgid "empty" +msgstr "vide" + +#: src/shar.c:991 +msgid "(empty)" +msgstr "(vide)" + +#: src/shar.c:1015 +msgid "Cannot open file %s" +msgstr "Incapable d'ouvrir le fichier %s" + +#: src/shar.c:1052 +msgid "compressed" +msgstr "via «compress»" + +#: src/shar.c:1053 +msgid "gzipped" +msgstr "via «gzip»" + +#: src/shar.c:1053 +msgid "binary" +msgstr "binaire" + +#: src/shar.c:1054 +msgid "(compressed)" +msgstr "(via «compress»)" + +#: src/shar.c:1055 +msgid "(gzipped)" +msgstr "(format «gzip»)" + +#: src/shar.c:1056 +msgid "(binary)" +msgstr "(binaire)" + +#: src/shar.c:1069 +msgid "Could not fork" +msgstr "Incapable d'effectuer un «fork»" + +#: src/shar.c:1074 src/shar.c:1126 +msgid "File %s (%s)" +msgstr "Fichier %s (%s)" + +#: src/shar.c:1120 +msgid "text" +msgstr "texte" + +#: src/shar.c:1121 +msgid "(text)" +msgstr "(texte)" + +#: src/shar.c:1167 +msgid "overwriting" +msgstr "écrasement" + +#: src/shar.c:1168 +msgid "overwrite" +msgstr "écrasement" + +#: src/shar.c:1169 +msgid "[no, yes, all, quit] (no)?" +msgstr "[n=non, y=oui, a=tout, q=quitter] (n)?" + +#: src/shar.c:1170 +msgid "extraction aborted" +msgstr "extraction abandonnée" + +#: src/shar.c:1171 src/shar.c:1176 +msgid "SKIPPING" +msgstr "EN TRAIN D'IGNORER" + +#: src/shar.c:1176 +msgid "(file already exists)" +msgstr "(le fichier existe déjà)" + +#: src/shar.c:1194 +msgid "Saving %s (%s)" +msgstr "Sauvegarde de %s (%s)" + +#: src/shar.c:1199 +msgid "extracting" +msgstr "extraction de" + +#: src/shar.c:1333 +msgid "End of" +msgstr "Fin de" + +#: src/shar.c:1334 +msgid "archive" +msgstr "l'archive" + +#: src/shar.c:1335 +msgid "part" +msgstr "morceau" + +#: src/shar.c:1337 src/shar.c:1443 +msgid "File" +msgstr "Le fichier" + +#: src/shar.c:1338 +msgid "is continued in part" +msgstr "se poursuit dans le morceau" + +#: src/shar.c:1398 +msgid "Please unpack part 1 first!" +msgstr "Prière de dépaqueter le premier morceau d'abord!" + +#: src/shar.c:1415 +msgid "STILL SKIPPING" +msgstr "TOUJOURS EN TRAIN D'IGNORER" + +#: src/shar.c:1422 +msgid "continuing file" +msgstr "suite du fichier" + +#: src/shar.c:1443 +msgid "is complete" +msgstr "est complet" + +#: src/shar.c:1452 +msgid "uudecoding file" +msgstr "«uudecode» du fichier" + +#: src/shar.c:1466 +msgid "uncompressing file" +msgstr "décompression du fichier" + +#: src/shar.c:1477 +msgid "gunzipping file" +msgstr "«gunzip» du fichier" + +#: src/shar.c:1539 +msgid "MD5 check failed" +msgstr "La vérification MD5 a flanché" + +#: src/shar.c:1580 +msgid "original size" +msgstr "dimension originale" + +#: src/shar.c:1581 +msgid "current size" +msgstr "dimension courante" + +#: src/shar.c:1630 +msgid "Opening `%s'" +msgstr "Début de traitement pour «%s»" + +#: src/shar.c:1641 +msgid "Closing `%s'" +msgstr "Fin de traitement pour «%s»" + +#: src/shar.c:1653 src/unshar.c:302 src/uudecode.c:370 src/uuencode.c:211 +msgid "Try `%s --help' for more information.\n" +msgstr "Pour plus d'information, essayez «%s --help».\n" + +#: src/shar.c:1657 src/unshar.c:306 +msgid "Usage: %s [OPTION]... [FILE]...\n" +msgstr "Usage: %s [OPTION]... [FICHIER]...\n" + +#: src/shar.c:1658 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Les arguments obligatoires pour la forme longue des options sont aussi\n" +"obligatoires pour les formes courtes qui leur correspondent.\n" + +#: src/shar.c:1661 +msgid "" +"\n" +"Giving feedback:\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +" -q, --quiet, --silent do not output verbose messages locally\n" +"\n" +"Selecting files:\n" +" -p, --intermix-type allow -[BTzZ] in file lists to change mode\n" +" -S, --stdin-file-list read file list from standard input\n" +"\n" +"Splitting output:\n" +" -o, --output-prefix=PREFIX output to file PREFIX.01 through PREFIX.NN\n" +" -l, --whole-size-limit=SIZE split archive, not files, to SIZE kilobytes\n" +" -L, --split-size-limit=SIZE split archive, or files, to SIZE kilobytes\n" +msgstr "" +"\n" +"Sorties informatives:\n" +" --help fournir ce message d'aide, puis terminer\n" +" --version identifier le programme, puis terminer\n" +" -q, --quiet, --silent éviter d'être verbeux localement\n" +"\n" +"Choix des fichiers:\n" +" -p, --intermix-type permettre -[BTzZ] parmi la liste des fichiers\n" +" -S, --stdin-file-list obtenir la liste des fichiers de l'entrée standard\n" +"\n" +"Découpage de la sortie:\n" +" -o, --output-prefix=PREFIXE produire PREFIXE.01 jusqu'à PREFIXE.NNN\n" +" -l, --whole-size-limit=GRANDEUR limiter à Ko/archive, fichiers entiers\n" +" -L, --split-size-limit=GRANDEUR limiter à Ko/archive, fichiers découpés\n" + +#: src/shar.c:1677 +msgid "" +"\n" +"Controlling the shar headers:\n" +" -n, --archive-name=NAME use NAME to document the archive\n" +" -s, --submitter=ADDRESS override the submitter name\n" +" -a, --net-headers output Submitted-by: & Archive-name: headers\n" +" -c, --cut-mark start the shar with a cut line\n" +"\n" +"Selecting how files are stocked:\n" +" -M, --mixed-uuencode dynamically decide uuencoding (default)\n" +" -T, --text-files treat all files as text\n" +" -B, --uuencode treat all files as binary, use uuencode\n" +" -z, --gzip gzip and uuencode all files\n" +" -g, --level-for-gzip=LEVEL pass -LEVEL (default 9) to gzip\n" +" -Z, --compress compress and uuencode all files\n" +" -b, --bits-per-code=BITS pass -bBITS (default 12) to compress\n" +msgstr "" +"\n" +"Contrôle des en-têtes:\n" +" -n, --archive-name=NOM donner NOM comme titre de l'archive\n" +" -s, --submitter=ADRESSE forcer le nom de l'originateur\n" +" -a, --net-headers produire Submitted-by: et Archive-name:\n" +" -c, --cut-mark placer une ligne de démarcation au début\n" +"\n" +"Méthodes de stockage:\n" +" -M, --mixed-uuencode décider l'uuencodage au vol (implicite)\n" +" -T, --text-files traiter tous les fichiers comme des textes\n" +" -B, --uuencode uuencoder tous les fichiers comme binaires\n" +" -z, --gzip utiliser «gzip» partout, uuencoder\n" +" -g, --level-for-gzip=NIVEAU fournir -NIVEAU (implicitement 9) à gzip\n" +" -Z, --compress utiliser «compress» partout, uuencoder\n" +" -b, --bits-per-code=BITS fournir -bBITS (implicitement 12) à compress\n" + +#: src/shar.c:1694 +msgid "" +"\n" +"Protecting against transmission:\n" +" -w, --no-character-count do not use `wc -c' to check size\n" +" -D, --no-md5-digest do not use `md5sum' digest to verify\n" +" -F, --force-prefix force the prefix character on every line\n" +" -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n" +"\n" +"Producing different kinds of shars:\n" +" -V, --vanilla-operation produce very simple and undemanding shars\n" +" -P, --no-piping exclusively use temporary files at unshar time\n" +" -x, --no-check-existing blindly overwrite existing files\n" +" -X, --query-user ask user before overwriting files (not for Net)\n" +" -m, --no-timestamp do not restore file modification dates & times\n" +" -Q, --quiet-unshar avoid verbose messages at unshar time\n" +" -f, --basename restore in one directory, despite hierarchy\n" +" --no-i18n do not produce internationalized shell script\n" +msgstr "" +"\n" +"Erreurs de transmission:\n" +" -w, --no-character-count ne pas vérifier la grandeur avec «wc -c»\n" +" -D, --no-md5-digest ne pas vérifier le contenu avec «md5sum»\n" +" -F, --force-prefix placer le caractère préfixe sur chaque ligne\n" +" -d, --here-delimiter=CHAINE terminer chaque fichier d'archive par CHAINE\n" +"\n" +"Modalités d'archivage:\n" +" -V, --vanilla-operation produire des archives simples et peu exigeantes\n" +" -P, --no-piping éviter toute tuyauterie UNIX au désarchivage\n" +" -x, --no-check-existing écraser allègrement les fichiers déjà existants\n" +" -X, --query-user demander avant d'écraser (*pas* pour le réseau)\n" +" -m, --no-timestamp ne pas remettre en place les dates des fichiers\n" +" -Q, --quiet-unshar éviter d'être verbeux pendant le désarchivage\n" +" -f, --basename désarchiver tout au même niveau de répertoire\n" +" --no-i18n produire un script non-internationalisé\n" + +#: src/shar.c:1712 +msgid "" +"\n" +"Option -o is required with -l or -L, option -n is required with -a.\n" +"Option -g implies -z, option -b implies -Z.\n" +msgstr "" +"\n" +"L'option -o est requise pour -l ou -L, l'option -n est requise pour -a.\n" +"L'option -g force -z, l'option -b force -Z.\n" + +#: src/shar.c:1798 +msgid "DEBUG was not selected at compile time" +msgstr "DEBUG n'était pas configuré durant la compilation" + +#: src/shar.c:1819 +msgid "Hard limit %dk\n" +msgstr "Limite à %dk pour fichiers découpés\n" + +#: src/shar.c:1886 +msgid "Soft limit %dk\n" +msgstr "Limite à %dk pour fichiers non-découpés\n" + +#: src/shar.c:1987 +msgid "WARNING: No user interaction in vanilla mode" +msgstr "ATTENTION: Pas d'intervention possible en mode «vanilla»" + +#: src/shar.c:1998 +msgid "WARNING: Non-text storage options overridden" +msgstr "ATTENTION: Annulation des options de stockage non-textes" + +#: src/shar.c:2054 +msgid "No input files" +msgstr "Aucun fichier à lire" + +#: src/shar.c:2060 +msgid "Cannot use -a option without -n" +msgstr "L'option -a exige aussi l'option -n" + +#: src/shar.c:2066 +msgid "Cannot use -l or -L option without -o" +msgstr "Les options -l ou -L exigent aussi l'option -o" + +#: src/shar.c:2078 +msgid "PLEASE avoid -X shars on Usenet or public networks" +msgstr "De grâce, évitez -X pour des archives shells largement diffusées" + +#: src/shar.c:2119 +msgid "You have unpacked the last part" +msgstr "Vous avez dépaqueté le dernier morceau" + +#: src/shar.c:2121 +msgid "Created %d files\n" +msgstr "%d fichiers ont été créés\n" + +#: src/unshar.c:158 +msgid "Found no shell commands in %s" +msgstr "Aucune commande pour le shell, dans %s" + +#: src/unshar.c:174 +msgid "%s looks like raw C code, not a shell archive" +msgstr "%s ressemble plus à du code C qu'à une archive shell" + +#: src/unshar.c:210 +msgid "Found no shell commands after `cut' in %s" +msgstr "Aucune commande pour le shell après la ligne de démarcation, dans %s" + +#: src/unshar.c:231 +msgid "%s is probably not a shell archive" +msgstr "%s n'est probablement pas une archive shell" + +#: src/unshar.c:232 +msgid "The `cut' line was followed by: %s" +msgstr "La ligne de démarcation était suivie par: %s" + +#: src/unshar.c:258 +msgid "Starting `sh' process" +msgstr "Démarrage du processus «sh»" + +#: src/unshar.c:307 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +"\n" +" -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n" +" -c, --overwrite pass -c to shar script for overwriting files\n" +" -e, --exit-0 same as `--split-at=\"exit 0\"'\n" +" -E, --split-at=STRING split concatenated shars after STRING\n" +" -f, --force same as `-c'\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +"\n" +"If no FILE, standard input is read.\n" +msgstr "" +"Les arguments obligatoires pour la forme longue des options sont aussi\n" +"obligatoires pour les formes courtes qui leur correspondent.\n" +"\n" +" -d, --directory=REPERTOIRE aller dans REPERTOIRE avant le dépaquetage\n" +" -c, --overwrite fournir -c à shar pour réécrire les fichiers\n" +" -e, --exit-0 même chose que «--split-at=\"exit 0\"»\n" +" -E, --split-at=CHAINE séparer les archives concaténées après CHAINE\n" +" -f, --force même chose que «-c»\n" +" --help fournir ce message d'aide, puis terminer\n" +" --version identifier le programme, puis terminer\n" +"\n" +"En l'absence de tout FICHIER, le programme lit l'entrée standard.\n" + +#: src/unshar.c:384 +msgid "Cannot chdir to `%s'" +msgstr "Ne peut changer le répertoire à «%s»" + +#: src/unshar.c:441 +msgid "standard input" +msgstr "entrée standard" + +#: src/uudecode.c:98 src/uudecode.c:196 +msgid "%s: Short file" +msgstr "%s: Fichier interrompu" + +#: src/uudecode.c:141 +msgid "%s: No `end' line" +msgstr "%s: Ligne «end» manquante" + +#: src/uudecode.c:205 +msgid "%s: data following `=' padding character" +msgstr "%s: quelque chose après un «=» de remplissage" + +#: src/uudecode.c:229 src/uudecode.c:237 src/uudecode.c:251 +msgid "%s: illegal line" +msgstr "%s: ligne illégale" + +#: src/uudecode.c:289 +msgid "%s: No `begin' line" +msgstr "%s: Ligne «begin» manquante" + +#: src/uudecode.c:321 +msgid "%s: Illegal ~user" +msgstr "%s: ~usager illégal" + +#: src/uudecode.c:328 +msgid "%s: No user `%s'" +msgstr "%s: Pas d'usager «%s»" + +#: src/uudecode.c:374 +msgid "Usage: %s [FILE]...\n" +msgstr "Usage: %s [FICHIER]...\n" + +#: src/uudecode.c:375 +msgid "" +"Mandatory arguments to long options are mandatory to short options too.\n" +" -h, --help display this help and exit\n" +" -v, --version output version information and exit\n" +" -o, --output-file=FILE direct output to FILE\n" +msgstr "" +"Les arguments obligatoires pour la forme longue des options sont aussi\n" +"obligatoires pour les formes courtes qui leur correspondent.\n" +"\n" +" -h, --help fournir ce message d'aide, puis terminer\n" +" -v, --version identifier le programme, puis terminer\n" + +#: src/uuencode.c:198 +msgid "Read error" +msgstr "Erreur en lecture" + +#: src/uuencode.c:215 +msgid "Usage: %s [INFILE] REMOTEFILE\n" +msgstr "Usage: %s [FICHIER_LOCAL] FICHIER_ELOIGNE\n" + +#: src/uuencode.c:216 +msgid "" +"\n" +" -h, --help display this help and exit\n" +" -m, --base64 use base64 encoding as of RFC1521\n" +" -v, --version output version information and exit\n" +msgstr "" +"\n" +" -h, --help fournir ce message d'aide, puis terminer\n" +" -m, --base64 utiliser le base64, tel que décrit dans RFC1521\n" +" -v, --version identifier le programme, puis terminer\n" + +#: src/uuencode.c:297 +msgid "Write error" +msgstr "Erreur d'écriture" diff --git a/src/apps/bin/sharutils-4.2.1/po/ja_JP.EUC.gmo b/src/apps/bin/sharutils-4.2.1/po/ja_JP.EUC.gmo new file mode 100644 index 0000000000..e3d36d7487 Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/po/ja_JP.EUC.gmo differ diff --git a/src/apps/bin/sharutils-4.2.1/po/ja_JP.EUC.po b/src/apps/bin/sharutils-4.2.1/po/ja_JP.EUC.po new file mode 100644 index 0000000000..7c370076ac --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/ja_JP.EUC.po @@ -0,0 +1,586 @@ +msgid "" +msgstr "" +"Date: 1995-11-14 13:00:00+0900\n" +"From: SAKAI Kiyotaka \n" +"Xgettext-Options: --default-domain=sharutils --output-dir=. --add-comments --keyword=_\n" +"Files: ../../po/../lib/error.c ../../po/../lib/getopt.c\n" +" ../../po/../lib/xmalloc.c ../../po/../src/shar.c\n" +" ../../po/../src/unshar.c ../../po/../src/uudecode.c\n" +" ../../po/../src/uuencode.c\n" + +#: lib/error.c:73 +msgid "Unknown system error" +msgstr "°ÕÌ£ÉÔÌÀ¤Î¥·¥¹¥Æ¥à¥¨¥é¡¼¤Ç¤¹" + +#: lib/getopt.c:516 +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: `%s' ¥ª¥×¥·¥ç¥ó¤ÏÉÔÌÀÎƤǤ¹\n" + +#: lib/getopt.c:540 +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó `--%s' ¤Ï°ú¿ô¤ò¼è¤ê¤Þ¤»¤ó\n" + +#. +option or -option +#: lib/getopt.c:545 +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: `%c%s' ¥ª¥×¥·¥ç¥ó¤Ï°ú¿ô¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó\n" + +#: lib/getopt.c:559 +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: `%s' ¥ª¥×¥·¥ç¥ó¤Ï°ú¿ô¤¬É¬ÍפǤ¹\n" + +#. --option +#: lib/getopt.c:587 +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó `--%s' ¤Ïǧ¼±¤Ç¤­¤Þ¤»¤ó\n" + +#: lib/getopt.c:591 +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó ¤Ï`%c%s' ¤Ïǧ¼±¤Ç¤­¤Þ¤»¤ó\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:616 +msgid "%s: illegal option -- %c\n" +msgstr "%s: %c ¤ÏÉÔÀµ¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹\n" + +#: lib/getopt.c:618 +msgid "%s: invalid option -- %c\n" +msgstr "%s: %c ¤ÏÉÔÀµ¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹\n" + +#: lib/getopt.c:652 +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: %c ¥ª¥×¥·¥ç¥ó¤Ï°ú¿ô¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹\n" + +#: lib/xmalloc.c:67 +msgid "memory exhausted" +msgstr "¥á¥â¥ê¡¼¤ò»È¤¤²Ì¤¿¤·¤Þ¤·¤¿" + +#: src/shar.c:569 +msgid "WARNING: not restoring timestamps. Consider getting and" +msgstr "·Ù¹ð: ¥¿¥¤¥à¡¦¥¹¥¿¥ó¥×¤òÌ᤹¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£Æþ¼ê¤¹¤ë¤³¤È¤ò¹Í¤¨¤Æ²¼¤µ¤¤" + +#: src/shar.c:571 +msgid "installing GNU \\`touch', distributed in GNU File Utilities..." +msgstr "GNU ¤Î File Utilities ¤ÇÇÛÉÛ¤µ¤ì¤Æ¤¤¤ë GNU \\`touch' ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:586 +msgid "creating lock directory" +msgstr "¥í¥Ã¥¯¡¦¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:587 +msgid "failed to create lock directory" +msgstr "¥í¥Ã¥¯¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ÎºîÀ®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿" + +#: src/shar.c:617 +msgid "Too many directories for mkdir generation" +msgstr "mkdir ¤ÇÀ¸À®¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¿ô¤¬Â¿¤¹¤®¤Þ¤¹" + +#: src/shar.c:626 +msgid "creating directory" +msgstr "¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:675 src/shar.c:902 +msgid "Cannot access %s" +msgstr "%s ¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤»¤ó" + +#: src/shar.c:728 src/shar.c:1858 +msgid "-C is being deprecated, use -Z instead" +msgstr "-C ¤ÏÈ¿ÂФǡ¢-Z ¤ò»È¤Ã¤Æ²¼¤µ¤¤" + +#: src/shar.c:781 src/unshar.c:366 +msgid "Cannot get current directory name" +msgstr "¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê̾¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó" + +#: src/shar.c:867 +msgid "Must unpack archives in sequence!" +msgstr "½çÈ֤˥¢¥ó¥Ñ¥Ã¥¯¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡ª" + +#: src/shar.c:868 src/shar.c:1401 +msgid "Please unpack part" +msgstr "¥Ñ¡¼¥È¤ò¥¢¥ó¥Ñ¥Ã¥¯¤·¤Æ²¼¤µ¤¤" + +#: src/shar.c:868 src/shar.c:1402 +msgid "next!" +msgstr "¼¡!" + +#: src/shar.c:897 +msgid "%s: Not a regular file" +msgstr "%s: Àµµ¬¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: src/shar.c:912 +msgid "In shar: remaining size %ld\n" +msgstr "shar: ¤ÎÃæ¤Ç¥µ¥¤¥º %ld ¤¬»Ä¤Ã¤Æ¤¤¤Þ¤¹\n" + +#. Change to another file. +#: src/shar.c:923 src/shar.c:1307 +msgid "Newfile, remaining %ld, " +msgstr "¿·µ¬¥Õ¥¡¥¤¥ë¤Ç¡¢%ld ¤¬»Ä¤Ã¤Æ¤¤¤Æ¡¢" + +#: src/shar.c:924 src/shar.c:1308 +msgid "Limit still %d\n" +msgstr "¤Þ¤À¥ê¥ß¥Ã¥È¤Ï %d ¤Ç¤¹\n" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "restore of" +msgstr "¤Î²óÉü" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "failed" +msgstr "¼ºÇÔ¤·¤Þ¤·¤¿" + +#: src/shar.c:941 src/shar.c:1327 +msgid "End of part" +msgstr "ºÇ¸å¤Î¥Ñ¡¼¥È" + +#: src/shar.c:942 src/shar.c:1328 +msgid "continue with part" +msgstr "¥Ñ¡¼¥È¤Ë³¤­¤Þ¤¹" + +#: src/shar.c:955 src/shar.c:1418 +msgid "Starting file %s\n" +msgstr "¥Õ¥¡¥¤¥ë %s ¤«¤é»Ï¤á¤Þ¤¹\n" + +#: src/shar.c:990 +msgid "empty" +msgstr "¶õ¤Î" + +#: src/shar.c:991 +msgid "(empty)" +msgstr "(¶õ)" + +#: src/shar.c:1015 +msgid "Cannot open file %s" +msgstr "¥Õ¥¡¥¤¥ë %s ¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Þ¤»¤ó" + +#: src/shar.c:1052 +msgid "compressed" +msgstr "compress ¤µ¤ì¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:1053 +msgid "gzipped" +msgstr "gzip ¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ç¤¹" + +#: src/shar.c:1053 +msgid "binary" +msgstr "¥Ð¥¤¥Ê¥ê¡¼" + +#: src/shar.c:1054 +msgid "(compressed)" +msgstr "(compress ¤µ¤ì¤Æ¤¤¤Þ¤¹)" + +#: src/shar.c:1055 +msgid "(gzipped)" +msgstr "(gzip ¤µ¤ì¤Æ¤¤¤Þ¤¹)" + +#: src/shar.c:1056 +msgid "(binary)" +msgstr "(¥Ð¥¤¥Ê¥ê¡¼)" + +#: src/shar.c:1069 +msgid "Could not fork" +msgstr "¥Õ¥©¡¼¥¯¤Ç¤­¤Þ¤»¤ó" + +#: src/shar.c:1074 src/shar.c:1126 +msgid "File %s (%s)" +msgstr "¥Õ¥¡¥¤¥ë %s (%s)" + +#: src/shar.c:1120 +msgid "text" +msgstr "¥Æ¥­¥¹¥È" + +#: src/shar.c:1121 +msgid "(text)" +msgstr "(¥Æ¥­¥¹¥È)" + +#: src/shar.c:1167 +msgid "overwriting" +msgstr "¾å½ñ¤­¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:1168 +msgid "overwrite" +msgstr "¾å½ñ¤­" + +#: src/shar.c:1169 +msgid "[no, yes, all, quit] (no)?" +msgstr "" + +#: src/shar.c:1170 +msgid "extraction aborted" +msgstr "Ãê½Ð¤òÃæÃǤ·¤Þ¤¹" + +#: src/shar.c:1171 src/shar.c:1176 +msgid "SKIPPING" +msgstr "Èô¤Ð¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:1176 +msgid "(file already exists)" +msgstr "(¥Õ¥¡¥¤¥ë¤Ï¤¹¤Ç¤Ë¸ºß¤·¤Æ¤¤¤Þ¤¹)" + +#: src/shar.c:1194 +msgid "Saving %s (%s)" +msgstr "%s (%s) ¤ò¥»¡¼¥Ö¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:1199 +msgid "extracting" +msgstr "Ãê½ÐÃæ" + +#: src/shar.c:1333 +msgid "End of" +msgstr "ºÇ¸å¤Î" + +#: src/shar.c:1334 +msgid "archive" +msgstr "¥¢¡¼¥«¥¤¥Ö" + +#: src/shar.c:1335 +msgid "part" +msgstr "¥Ñ¡¼¥È" + +#: src/shar.c:1337 src/shar.c:1443 +msgid "File" +msgstr "¥Õ¥¡¥¤¥ë" + +#: src/shar.c:1338 +msgid "is continued in part" +msgstr "¼¡¤Î¥Ñ¡¼¥È¤Ë³¤­¤Þ¤¹" + +#: src/shar.c:1398 +msgid "Please unpack part 1 first!" +msgstr "¥Ñ¡¼¥È1¤òºÇ½é¤Ë¥¢¥ó¥Ñ¥Ã¥¯¤·¤Æ²¼¤µ¤¤" + +#: src/shar.c:1415 +msgid "STILL SKIPPING" +msgstr "¤Þ¤ÀÈô¤Ð¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:1422 +msgid "continuing file" +msgstr "¥Õ¥¡¥¤¥ë¤Ë³¤­¤Þ¤¹" + +#: src/shar.c:1443 +msgid "is complete" +msgstr "½ªÎ»¤·¤Þ¤·¤¿" + +#: src/shar.c:1452 +msgid "uudecoding file" +msgstr "¥Õ¥¡¥¤¥ë¤ò uudecode ¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:1466 +msgid "uncompressing file" +msgstr "¥Õ¥¡¥¤¥ë¤ò uncompress ¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:1477 +msgid "gunzipping file" +msgstr "¥Õ¥¡¥¤¥ë¤ò gunzip ¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:1539 +msgid "MD5 check failed" +msgstr "MD5 ¥Á¥§¥Ã¥¯¤¬¼ºÇÔ¤·¤Þ¤·¤¿" + +#: src/shar.c:1580 +msgid "original size" +msgstr "¥ª¥ê¥¸¥Ê¥ë¡¦¥µ¥¤¥º" + +#: src/shar.c:1581 +msgid "current size" +msgstr "¸½ºß¤Î¥µ¥¤¥º" + +#: src/shar.c:1630 +msgid "Opening `%s'" +msgstr "%s ¤ò¥ª¡¼¥×¥ó¤·¤Æ¤¤¤Þ¤¹" + +#: src/shar.c:1641 +msgid "Closing `%s'" +msgstr "%s ¤òÊĤ¸¤Þ¤¹" + +#: src/shar.c:1653 src/unshar.c:302 src/uudecode.c:370 src/uuencode.c:211 +msgid "Try `%s --help' for more information.\n" +msgstr "¾Ü¤·¤¯¤Ï `%s --help' ¤ò¼Â¹Ô¤·¤Æ²¼¤µ¤¤¡£\n" + +#: src/shar.c:1657 src/unshar.c:306 +msgid "Usage: %s [OPTION]... [FILE]...\n" +msgstr "»ÈÍÑË¡: %s [¥ª¥×¥·¥ç¥ó]... [¥Õ¥¡¥¤¥ë]...\n" + +#: src/shar.c:1658 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "¥í¥ó¥°¡¦¥ª¥×¥·¥ç¥ó¤ÇɬÍפʰú¿ô¤Ï¡¢¥·¥ç¡¼¥È¡¦¥ª¥×¥·¥ç¥ó¤Ç¤âɬÍפǤ¹¡£\n" + +#: src/shar.c:1661 +msgid "" +"\n" +"Giving feedback:\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +" -q, --quiet, --silent do not output verbose messages locally\n" +"\n" +"Selecting files:\n" +" -p, --intermix-type allow -[BTzZ] in file lists to change mode\n" +" -S, --stdin-file-list read file list from standard input\n" +"\n" +"Splitting output:\n" +" -o, --output-prefix=PREFIX output to file PREFIX.01 through PREFIX.NN\n" +" -l, --whole-size-limit=SIZE split archive, not files, to SIZE kilobytes\n" +" -L, --split-size-limit=SIZE split archive, or files, to SIZE kilobytes\n" +msgstr "" +"\n" +"¾ðÊó¤Îɽ¼¨:\n" +" --help ¤³¤Î¥Ø¥ë¥×¤òɽ¼¨¤·¤Æ½ªÎ»\n" +" --version ¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɽ¼¨¤·¤Æ½ªÎ»\n" +" -q, --quiet, --silent ³Îǧ¤Î¤¿¤á¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤»¤ó\n" +"\n" +"¥Õ¥¡¥¤¥ë¤ÎÁªÂò:\n" +" -p, --intermix-type ¥â¡¼¥É¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë¥Õ¥¡¥¤¥ë¥ê¥¹¥È¤Ë -[BTzZ] ¤òµö¤¹\n" +" -S, --stdin-file-list ¥Õ¥¡¥¤¥ë¡¦¥ê¥¹¥È¤òɸ½àÆþÎϤ«¤éÆɤ߹þ¤à\n" +"\n" +"½ÐÎϤÎʬ³ä:\n" +" -o, --output-prefix=PREFIXE PREFIX.01 ¤«¤é PREFIX.NN ¤Ë½ÐÎÏ\n" +" -l, --whole-size-limit=GRANDEUR ¥Õ¥¡¥¤¥ë°Ê³°¤Î¥¢¡¼¥«¥¤¥Ö¤ò SIZE ¥­¥í¥Ð¥¤¥È¤Ëʬ³ä\n" +" -L, --split-size-limit=GRANDEUR ¥¢¡¼¥«¥¤¥Ö¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¤ò SIZE ¥­¥í¥Ð¥¤¥È¤Ëʬ³ä\n" + +#: src/shar.c:1677 +msgid "" +"\n" +"Controlling the shar headers:\n" +" -n, --archive-name=NAME use NAME to document the archive\n" +" -s, --submitter=ADDRESS override the submitter name\n" +" -a, --net-headers output Submitted-by: & Archive-name: headers\n" +" -c, --cut-mark start the shar with a cut line\n" +"\n" +"Selecting how files are stocked:\n" +" -M, --mixed-uuencode dynamically decide uuencoding (default)\n" +" -T, --text-files treat all files as text\n" +" -B, --uuencode treat all files as binary, use uuencode\n" +" -z, --gzip gzip and uuencode all files\n" +" -g, --level-for-gzip=LEVEL pass -LEVEL (default 9) to gzip\n" +" -Z, --compress compress and uuencode all files\n" +" -b, --bits-per-code=BITS pass -bBITS (default 12) to compress\n" +msgstr "" +"\n" +"shar ¤Î¥Ø¥Ã¥À¤ò¥³¥ó¥È¥í¡¼¥ë¤¹¤ë¥ª¥×¥·¥ç¥ó¤Ç¤¹:\n" +" -n, --archive-name=NAME ¥¢¡¼¥«¥¤¥Ö̾¤È¤·¤Æ NAME ¤ò»ÈÍÑ\n" +" -s, --submitter=ADRESSE ºîÀ®¼Ô̾¤ò¾å½ñ¤­\n" +" -a, --net-headers Submitted-by: ¤È Archive-name: ¤ò½ÐÎÏ\n" +" -c, --cut-mark cut line ¤Ç shar ¤ò»Ï¤á¤ë\n" +"\n" +"¤É¤Î¤è¤¦¤Ë³ÊǼ¤¹¤ë¤«¤ÎÁªÂò:\n" +" -M, --mixed-uuencode uuencode ¤òưŪ¤Ë·èÄê(¥Ç¥Õ¥©¥ë¥È)\n" +" -T, --text-files ¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò¥Æ¥­¥¹¥È¤È¤·¤Æ°·¤¦\n" +" -B, --uuencode ¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò¥Ð¥¤¥Ê¥ê¡¼¤È¤·¤Æ°·¤¤¡¢uuencode ¤ò»ÈÍÑ\n" +" -z, --gzip ¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò gzip ¤·¤Æ uuencode\n" +" -g, --level-for-gzip=LEVEL gzip ¤Î¥ì¥Ù¥ë¤ò»ØÄê (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 9)\n" +" -Z, --compress ¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò compress ¤·¤Æ uuencode\n" +" -b, --bits-per-code=BITS compress ¤ËÅϤ¹ -bBITS (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 12)\n" + +#: src/shar.c:1694 +msgid "" +"\n" +"Protecting against transmission:\n" +" -w, --no-character-count do not use `wc -c' to check size\n" +" -D, --no-md5-digest do not use `md5sum' digest to verify\n" +" -F, --force-prefix force the prefix character on every line\n" +" -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n" +"\n" +"Producing different kinds of shars:\n" +" -V, --vanilla-operation produce very simple and undemanding shars\n" +" -P, --no-piping exclusively use temporary files at unshar time\n" +" -x, --no-check-existing blindly overwrite existing files\n" +" -X, --query-user ask user before overwriting files (not for Net)\n" +" -m, --no-timestamp do not restore file modification dates & times\n" +" -Q, --quiet-unshar avoid verbose messages at unshar time\n" +" -f, --basename restore in one directory, despite hierarchy\n" +" --no-i18n do not produce internationalized shell script\n" +msgstr "" +"\n" +"ÊÑ´¹¤ËÂФ¹¤ëÊݸî:\n" +" -w, --no-character-count ¥µ¥¤¥º¤Î¥Á¥§¥Ã¥¯¤Ë `wc -c' ¤ò»ÈÍѤ·¤Ê¤¤\n" +" -D, --no-md5-digest ¥À¥¤¥¸¥§¥¹¥È¤Î¥Á¥§¥Ã¥¯¤Ë `md5sum' ¤ò»ÈÍѤ·¤Ê¤¤\n" +" -F, --force-prefix Á°ÃÖʸ»ú¤ò³Æ¹Ô¤ÎÁ°¤ËÃÖ¤¯\n" +" -d, --here-delimiter=STRING shar ¤Ç¥Õ¥¡¥¤¥ë¤òʬ³ä¤¹¤ë¼±ÊÌ»Ò¤Ë STRING ¤ò»ÈÍÑ\n" +"\n" +"²¿¼ïÎफ¤Î shar ¤òÀ¸À®:\n" +" -V, --vanilla-operation ´Ê·é¤Ê shar ¤òÀ¸À®\n" +" -P, --no-piping unshar »þ¤ËÇÓ¾Ū¤Ê°ì»þ¥Õ¥¡¥¤¥ë¤ò»ÈÍÑ\n" +" -x, --no-check-existing ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤âɬ¤º¾å½ñ¤­\n" +" -X, --query-user ¥Õ¥¡¥¤¥ë¤Î¾å½ñ¤­»þ¤Ë¥æ¡¼¥¶¤ËÌ䤤¹ç¤ï¤»¤ë (not for Net)\n" +" -m, --no-timestamp ¥Õ¥¡¥¤¥ë¤Î¹¹¿·»þ¹ï¤òÌᤵ¤Ê¤¤\n" +" -Q, --quiet-unshar unshar »þ¤Ë³Îǧ¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Ê¤¤\n" +" -f, --basename ³¬Áز½¤»¤º¤Ë¡¢1¤Ä¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÌ᤹\n" +" --no-i18n ¹ñºÝ²½¤µ¤ì¤¿¥·¥§¥ë¡¦¥¹¥¯¥ê¥×¥È¤òÀ¸À®¤·¤Ê¤¤\n" + +#: src/shar.c:1712 +msgid "" +"\n" +"Option -o is required with -l or -L, option -n is required with -a.\n" +"Option -g implies -z, option -b implies -Z.\n" +msgstr "" +"\n" +"¥ª¥×¥·¥ç¥ó -o ¤Ï -l ¤« -L ¤¬É¬Íפǡ¢¥ª¥×¥·¥ç¥ó -n ¤Ï -a ¤¬É¬ÍפǤ¹¡£\n" +"¥ª¥×¥·¥ç¥ó -g ¤Ï -z ¤ò´Þ¤ß¡¢¥ª¥×¥·¥ç¥ó -b ¤Ï -Z ¤ò´Þ¤ß¤Þ¤¹¡£\n" + +#: src/shar.c:1798 +msgid "DEBUG was not selected at compile time" +msgstr "¥³¥ó¥Ñ¥¤¥ë»þ¤Ë DEBUG ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó" + +#: src/shar.c:1819 +msgid "Hard limit %dk\n" +msgstr "¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤¬ %dk ¤Ç¤¹\n" + +#: src/shar.c:1886 +msgid "Soft limit %dk\n" +msgstr "¥½¥Õ¥È¥ê¥ß¥Ã¥È¤¬ %dk ¤Ç¤¹\n" + +#: src/shar.c:1987 +msgid "WARNING: No user interaction in vanilla mode" +msgstr "·Ù¹ð: ¥æ¡¼¥¶¤ÎÁê¸ßºîÍѤÇÀ¸¤Î¥â¡¼¥É¤Î¤â¤Î¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: src/shar.c:1998 +msgid "WARNING: Non-text storage options overridden" +msgstr "·Ù¹ð: ¥Æ¥­¥¹¥È¤Ç¤Ê¤¤³ÊǼ¥ª¥×¥·¥ç¥ó¤¬¾å½ñ¤­¤µ¤ì¤Þ¤·¤¿" + +#: src/shar.c:2054 +msgid "No input files" +msgstr "ÆþÎÏ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó" + +#: src/shar.c:2060 +msgid "Cannot use -a option without -n" +msgstr "-n ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤻ¤º¤Ë -a ¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó" + +#: src/shar.c:2066 +msgid "Cannot use -l or -L option without -o" +msgstr "-o ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤻ¤º¤Ë -l ¤Þ¤¿¤Ï -L ¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó" + +#: src/shar.c:2078 +msgid "PLEASE avoid -X shars on Usenet or public networks" +msgstr "Usenet ¤ä¸ø¶¦¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ç¤Ï -X shar ¤ò»ÈÍѤ·¤Ê¤¤¤Ç²¼¤µ¤¤" + +#: src/shar.c:2119 +msgid "You have unpacked the last part" +msgstr "ºÇ¸å¤Î¥Ñ¡¼¥È¤ò¥¢¥ó¥Ñ¥Ã¥¯¤·¤Þ¤·¤¿" + +#: src/shar.c:2121 +msgid "Created %d files\n" +msgstr "%d ¸Ä¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Þ¤·¤¿\n" + +#: src/unshar.c:158 +msgid "Found no shell commands in %s" +msgstr "%s ¤Ë¤Ï¥·¥å¥ë¡¦¥³¥Þ¥ó¥É¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó" + +#: src/unshar.c:174 +msgid "%s looks like raw C code, not a shell archive" +msgstr "%s ¤Ï C ¤Î¥³¡¼¥É¤Ç¡¢¥·¥å¥ë¥¢¡¼¥«¥¤¥Ö¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: src/unshar.c:210 +msgid "Found no shell commands after `cut' in %s" +msgstr "%s ¤Î `cut' ¤Î¸å¤Ë¥·¥§¥ë¥³¥Þ¥ó¥É¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£" + +#: src/unshar.c:231 +msgid "%s is probably not a shell archive" +msgstr "%s ¤Ï¡¢¤ª¤½¤é¤¯¥·¥§¥ë¡¦¥¢¡¼¥«¥¤¥Ö¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: src/unshar.c:232 +msgid "The `cut' line was followed by: %s" +msgstr "%s ¤Ë³¤¤¤Æ `cut' ¹Ô¤¬¤¢¤ê¤Þ¤¹" + +#: src/unshar.c:258 +msgid "Starting `sh' process" +msgstr "`sh' ¤Î¥×¥í¥»¥¹¤ò³«»Ï¤·¤Þ¤¹" + +#: src/unshar.c:307 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +"\n" +" -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n" +" -c, --overwrite pass -c to shar script for overwriting files\n" +" -e, --exit-0 same as `--split-at=\"exit 0\"'\n" +" -E, --split-at=STRING split concatenated shars after STRING\n" +" -f, --force same as `-c'\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +"\n" +"If no FILE, standard input is read.\n" +msgstr "" +"¥í¥ó¥°¡¦¥ª¥×¥·¥ç¥ó¤ÇɬÍפʰú¿ô¤Ï¡¢¥·¥ç¡¼¥È¡¦¥ª¥×¥·¥ç¥ó¤Ç¤âɬÍפǤ¹\n" +" -d, --directory=DIRECTORY ¥¢¥ó¥Ñ¥Ã¥¯¤ÎÁ°¤Ë DIRECTORY ¤Ë°ÜÆ°¤¹¤ë\n" +" -c, --overwrite ¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤¹¤ë¤è¤¦¤Ë -c ¤ò shar ¤ËÅϤ¹\n" +" -e, --exit-0 `--split-at=\"exit 0\"' ¤ÈƱ¤¸\n" +" -E, --split-at=STRING STRING ¤Î¸å¤í¤Ç·Ò¤¬¤Ã¤¿ shar ¤òʬ³ä\n" +" -f, --force `-c' ¤ÈƱ¤¸\n" +" --help ¤³¤Î¥Ø¥ë¥×¤òɽ¼¨¤·¤Æ½ªÎ»\n" +" --version ¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɽ¼¨¤·¤Æ½ªÎ»\n" +"\n" +"¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¡¢É¸½àÆþÎϤ¬»È¤ï¤ì¤Þ¤¹\n" + +#: src/unshar.c:384 +msgid "Cannot chdir to `%s'" +msgstr "%s ¤Ë°ÜÆ°¤Ç¤­¤Þ¤»¤ó" + +#: src/unshar.c:441 +msgid "standard input" +msgstr "ɸ½àÆþÎÏ" + +#: src/uudecode.c:98 src/uudecode.c:196 +msgid "%s: Short file" +msgstr "%s: ¥Õ¥¡¥¤¥ë¤¬Ã»¤¤¤Ç¤¹" + +#: src/uudecode.c:141 +msgid "%s: No `end' line" +msgstr "%s: `end' ¹Ô¤¬¤¢¤ê¤Þ¤»¤ó" + +#: src/uudecode.c:205 +msgid "%s: data following `=' padding character" +msgstr "%s: `=' ¤Ë³¤¯¥Ç¡¼¥¿¤Çʸ»úµÍ¤á¤·¤Þ¤¹" + +#: src/uudecode.c:229 src/uudecode.c:237 src/uudecode.c:251 +msgid "%s: illegal line" +msgstr "%s: ÉÔÀµ¤Ê¹Ô¤Ç¤¹" + +#: src/uudecode.c:289 +msgid "%s: No `begin' line" +msgstr "%s: `begin' ¹Ô¤¬¤¢¤ê¤Þ¤»¤ó" + +#: src/uudecode.c:321 +msgid "%s: Illegal ~user" +msgstr "%s: ~user ¤¬ÉÔÀµ¤Ç¤¹" + +#: src/uudecode.c:328 +msgid "%s: No user `%s'" +msgstr "%s: `%s' ¤È¤¤¤¦¥æ¡¼¥¶¡¼¤Ï¸ºß¤·¤Þ¤»¤ó" + +#: src/uudecode.c:374 +msgid "Usage: %s [FILE]...\n" +msgstr "»ÈÍÑË¡: %s [¥Õ¥¡¥¤¥ë]...\n" + +#: src/uudecode.c:375 +msgid "" +"Mandatory arguments to long options are mandatory to short options too.\n" +" -h, --help display this help and exit\n" +" -v, --version output version information and exit\n" +" -o, --output-file=FILE direct output to FILE\n" +msgstr "" +"¥í¥ó¥°¡¦¥ª¥×¥·¥ç¥ó¤ÇɬÍפʰú¿ô¤Ï¡¢¥·¥ç¡¼¥È¡¦¥ª¥×¥·¥ç¥ó¤Ç¤âɬÍפǤ¹\n" +" -h, --help ¤³¤Î¥Ø¥ë¥×¤òɽ¼¨¤·¤Æ½ªÎ»\n" +" -v, --version ¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɽ¼¨¤·¤Æ½ªÎ»\n" +" -o, --output-file=FILE ľÀÜ FILE ¤Ë½ÐÎÏ\n" + +#: src/uuencode.c:198 +msgid "Read error" +msgstr "Erreur en lecture" + +#: src/uuencode.c:215 +msgid "Usage: %s [INFILE] REMOTEFILE\n" +msgstr "»ÈÍÑË¡: %s [ÆþÎÏ¥Õ¥¡¥¤¥ë] ½ÐÎÏ¥Õ¥¡¥¤¥ë\n" + +#: src/uuencode.c:216 +msgid "" +"\n" +" -h, --help display this help and exit\n" +" -m, --base64 use base64 encoding as of RFC1521\n" +" -v, --version output version information and exit\n" +msgstr "" +"\n" +" -h, --help ¤³¤Î¥Ø¥ë¥×¤òɽ¼¨¤·¤Æ½ªÎ»\n" +" -m, --base64 RFC1521 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë base64 ¤ò»ÈÍÑ\n" +" -v, --version ¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɽ¼¨¤·¤Æ½ªÎ»\n" + +#: src/uuencode.c:297 +msgid "Write error" +msgstr "½ñ¤­¹þ¤ß¥¨¥é¡¼" diff --git a/src/apps/bin/sharutils-4.2.1/po/nl.gmo b/src/apps/bin/sharutils-4.2.1/po/nl.gmo new file mode 100644 index 0000000000..7fc3a0533c Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/po/nl.gmo differ diff --git a/src/apps/bin/sharutils-4.2.1/po/nl.po b/src/apps/bin/sharutils-4.2.1/po/nl.po new file mode 100644 index 0000000000..f0cb2438c8 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/nl.po @@ -0,0 +1,614 @@ +msgid "" +msgstr "" +"Date: 1995-08-02 02:00:57+0200\n" +"From: Ulrich Drepper \n" +"Xgettext-Options: --default-domain=sharutils --output-dir=. --add-comments --keyword=_\n" +"Files: ../../po/../lib/error.c ../../po/../lib/getopt.c\n" +" ../../po/../lib/xmalloc.c ../../po/../src/shar.c\n" +" ../../po/../src/unshar.c ../../po/../src/uudecode.c\n" +" ../../po/../src/uuencode.c\n" + +#: lib/error.c:73 +msgid "Unknown system error" +msgstr "" + +#: lib/getopt.c:516 +msgid "%s: option `%s' is ambiguous\n" +msgstr "" + +#: lib/getopt.c:540 +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "" + +#. +option or -option +#: lib/getopt.c:545 +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "" + +#: lib/getopt.c:559 +msgid "%s: option `%s' requires an argument\n" +msgstr "" + +#. --option +#: lib/getopt.c:587 +msgid "%s: unrecognized option `--%s'\n" +msgstr "" + +#: lib/getopt.c:591 +msgid "%s: unrecognized option `%c%s'\n" +msgstr "" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:616 +msgid "%s: illegal option -- %c\n" +msgstr "" + +#: lib/getopt.c:618 +msgid "%s: invalid option -- %c\n" +msgstr "" + +#: lib/getopt.c:652 +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: lib/xmalloc.c:67 +msgid "memory exhausted" +msgstr "" + +#: src/shar.c:569 +msgid "WARNING: not restoring timestamps. Consider getting and" +msgstr "" + +#: src/shar.c:571 +msgid "installing GNU \\`touch', distributed in GNU File Utilities..." +msgstr "" + +#: src/shar.c:586 +msgid "creating lock directory" +msgstr "" + +#: src/shar.c:587 +msgid "failed to create lock directory" +msgstr "" + +#: src/shar.c:617 +msgid "Too many directories for mkdir generation" +msgstr "Teveel directories om aan te maken" + +#: src/shar.c:626 +msgid "creating directory" +msgstr "" + +#: src/shar.c:675 src/shar.c:902 +msgid "Cannot access %s" +msgstr "Kan geen toegang krijgen tot %s" + +#: src/shar.c:728 src/shar.c:1858 +msgid "-C is being deprecated, use -Z instead" +msgstr "-C is verouderd, gebruik nu -Z" + +#: src/shar.c:781 src/unshar.c:366 +msgid "Cannot get current directory name" +msgstr "Kan de naam van het huidige directory niet vinden" + +#: src/shar.c:867 +msgid "Must unpack archives in sequence!" +msgstr "" + +#: src/shar.c:868 src/shar.c:1401 +msgid "Please unpack part" +msgstr "" + +#: src/shar.c:868 src/shar.c:1402 +msgid "next!" +msgstr "" + +#: src/shar.c:897 +msgid "%s: Not a regular file" +msgstr "%s: Geen gewoon bestand" + +#: src/shar.c:912 +msgid "In shar: remaining size %ld\n" +msgstr "In shar: resterende grootte %ld\n" + +#. Change to another file. +#: src/shar.c:923 src/shar.c:1307 +msgid "Newfile, remaining %ld, " +msgstr "Nieuw bestand, nu nog %ld" + +#: src/shar.c:924 src/shar.c:1308 +msgid "Limit still %d\n" +msgstr "Resterende grootte %d\n" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "restore of" +msgstr "" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "failed" +msgstr "" + +#: src/shar.c:941 src/shar.c:1327 +msgid "End of part" +msgstr "" + +#: src/shar.c:942 src/shar.c:1328 +msgid "continue with part" +msgstr "" + +#: src/shar.c:955 src/shar.c:1418 +msgid "Starting file %s\n" +msgstr "Begin met bestand %s\n" + +#: src/shar.c:990 +msgid "empty" +msgstr "leeg" + +#: src/shar.c:991 +msgid "(empty)" +msgstr "" + +#: src/shar.c:1015 +msgid "Cannot open file %s" +msgstr "Kan het bestand %s niet openen" + +#: src/shar.c:1052 +msgid "compressed" +msgstr "gecomprimeerd" + +#: src/shar.c:1053 +msgid "gzipped" +msgstr "gemaakt met gzip" + +#: src/shar.c:1053 +msgid "binary" +msgstr "binair" + +#: src/shar.c:1054 +msgid "(compressed)" +msgstr "" + +#: src/shar.c:1055 +msgid "(gzipped)" +msgstr "" + +#: src/shar.c:1056 +msgid "(binary)" +msgstr "" + +#: src/shar.c:1069 +msgid "Could not fork" +msgstr "`fork' faalde" + +#: src/shar.c:1074 src/shar.c:1126 +msgid "File %s (%s)" +msgstr "Bestand %s (%s)" + +#: src/shar.c:1120 +msgid "text" +msgstr "tekst" + +#: src/shar.c:1121 +msgid "(text)" +msgstr "" + +#: src/shar.c:1167 +msgid "overwriting" +msgstr "" + +#: src/shar.c:1168 +msgid "overwrite" +msgstr "" + +#: src/shar.c:1169 +msgid "[no, yes, all, quit] (no)?" +msgstr "" + +#: src/shar.c:1170 +msgid "extraction aborted" +msgstr "" + +#: src/shar.c:1171 src/shar.c:1176 +msgid "SKIPPING" +msgstr "" + +#: src/shar.c:1176 +msgid "(file already exists)" +msgstr "" + +#: src/shar.c:1194 +msgid "Saving %s (%s)" +msgstr "Stel %s (%s) veilig" + +#: src/shar.c:1199 +msgid "extracting" +msgstr "" + +#: src/shar.c:1333 +msgid "End of" +msgstr "" + +#: src/shar.c:1334 +msgid "archive" +msgstr "" + +#: src/shar.c:1335 +msgid "part" +msgstr "" + +#: src/shar.c:1337 src/shar.c:1443 +msgid "File" +msgstr "" + +#: src/shar.c:1338 +msgid "is continued in part" +msgstr "" + +#: src/shar.c:1398 +msgid "Please unpack part 1 first!" +msgstr "" + +#: src/shar.c:1415 +msgid "STILL SKIPPING" +msgstr "" + +#: src/shar.c:1422 +msgid "continuing file" +msgstr "" + +#: src/shar.c:1443 +msgid "is complete" +msgstr "" + +#: src/shar.c:1452 +msgid "uudecoding file" +msgstr "" + +#: src/shar.c:1466 +msgid "uncompressing file" +msgstr "" + +#: src/shar.c:1477 +msgid "gunzipping file" +msgstr "" + +#: src/shar.c:1539 +msgid "MD5 check failed" +msgstr "" + +#: src/shar.c:1580 +msgid "original size" +msgstr "" + +#: src/shar.c:1581 +msgid "current size" +msgstr "" + +#: src/shar.c:1630 +msgid "Opening `%s'" +msgstr "Open `%s'" + +#: src/shar.c:1641 +msgid "Closing `%s'" +msgstr "Sluit `%s'" + +#: src/shar.c:1653 src/unshar.c:302 src/uudecode.c:370 src/uuencode.c:211 +msgid "Try `%s --help' for more information.\n" +msgstr "Probeer `%s --help' voor meer informatie.\n" + +#: src/shar.c:1657 src/unshar.c:306 +msgid "Usage: %s [OPTION]... [FILE]...\n" +msgstr "Aanroep: %s [OPTIE]... [BESTAND]...\n" + +#: src/shar.c:1658 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Verplichte argumenten voor opties in de lange vorm zijn ook nodig\n" +"voor de corresponderende korte opties.\n" + +#: src/shar.c:1661 +msgid "" +"\n" +"Giving feedback:\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +" -q, --quiet, --silent do not output verbose messages locally\n" +"\n" +"Selecting files:\n" +" -p, --intermix-type allow -[BTzZ] in file lists to change mode\n" +" -S, --stdin-file-list read file list from standard input\n" +"\n" +"Splitting output:\n" +" -o, --output-prefix=PREFIX output to file PREFIX.01 through PREFIX.NN\n" +" -l, --whole-size-limit=SIZE split archive, not files, to SIZE kilobytes\n" +" -L, --split-size-limit=SIZE split archive, or files, to SIZE kilobytes\n" +msgstr "" +"\n" +"Programma informatie:\n" +" --help vertoon alleen deze hulptekst\n" +" --version vertoon alleen de programmaversie\n" +" -q, --quiet, --silent praat hier niet te veel\n" +"\n" +"Bestandskeuze:\n" +" -p, --intermix-type sta -[BTzZ] toe in de bestandslijst om halverwege\n" +" van mode te veranderen\n" +" -S, --stdin-file-list lees de bestandslijst van standaard invoer\n" +"\n" +"Uitvoerverdeling:\n" +" -o, --output-prefix=PREFIX maak uitvoerbestanden PREFIX.01 t/m PREFIX.NN\n" +" -l, --whole-size-limit=GROOTTE verdeel het archief in stukken van hooguit\n" +" GROOTTE KB (maar splits de bestanden niet)\n" +" -L, --split-size-limit=GROOTTE verdeel archief of bestanden in stukken van\n" +" hooguit GROOTTE KB\n" + +#: src/shar.c:1677 +msgid "" +"\n" +"Controlling the shar headers:\n" +" -n, --archive-name=NAME use NAME to document the archive\n" +" -s, --submitter=ADDRESS override the submitter name\n" +" -a, --net-headers output Submitted-by: & Archive-name: headers\n" +" -c, --cut-mark start the shar with a cut line\n" +"\n" +"Selecting how files are stocked:\n" +" -M, --mixed-uuencode dynamically decide uuencoding (default)\n" +" -T, --text-files treat all files as text\n" +" -B, --uuencode treat all files as binary, use uuencode\n" +" -z, --gzip gzip and uuencode all files\n" +" -g, --level-for-gzip=LEVEL pass -LEVEL (default 9) to gzip\n" +" -Z, --compress compress and uuencode all files\n" +" -b, --bits-per-code=BITS pass -bBITS (default 12) to compress\n" +msgstr "" +"\n" +"Inhoud van de shar-kop:\n" +" -n, --archive-name=NAAM geef het archief de (informatieve) naam NAAM\n" +" -s, --submitter=ADRES vervang de naam van de archivaris door ADRES\n" +" -a, --net-headers voeg kopregels Submitted-by: en Archive-name: toe\n" +" -c, --cut-mark begin de shar met een `cut' regel\n" +"\n" +"Hoe bestanden behandeld worden:\n" +" -M, --mixed-uuencode laat shar beslissen of uuencode nodig is\n" +" (dit is de standaard)\n" +" -T, --text-files alle bestanden zijn tekstbestanden\n" +" -B, --uuencode alle bestanden zijn binair, gebruik uuencode\n" +" -z, --gzip pas gzip en uuencode toe op alle bestanden\n" +" -g, --level-for-gzip=NIVEAU gebruik gzip mit optie -NIVEAU (standaard -9)\n" +" -Z, --compress pas compress en uuencode toe op alle bestanden\n" +" -b, --bits-per-code=BITS gebruik compress met -BITS (standaard -12)\n" + +#: src/shar.c:1694 +msgid "" +"\n" +"Protecting against transmission:\n" +" -w, --no-character-count do not use `wc -c' to check size\n" +" -D, --no-md5-digest do not use `md5sum' digest to verify\n" +" -F, --force-prefix force the prefix character on every line\n" +" -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n" +"\n" +"Producing different kinds of shars:\n" +" -V, --vanilla-operation produce very simple and undemanding shars\n" +" -P, --no-piping exclusively use temporary files at unshar time\n" +" -x, --no-check-existing blindly overwrite existing files\n" +" -X, --query-user ask user before overwriting files (not for Net)\n" +" -m, --no-timestamp do not restore file modification dates & times\n" +" -Q, --quiet-unshar avoid verbose messages at unshar time\n" +" -f, --basename restore in one directory, despite hierarchy\n" +" --no-i18n do not produce internationalized shell script\n" +msgstr "" + +#: src/shar.c:1712 +msgid "" +"\n" +"Option -o is required with -l or -L, option -n is required with -a.\n" +"Option -g implies -z, option -b implies -Z.\n" +msgstr "" +"\n" +"Optie -o is nodig bij -l of -L, optie -n is nodig bij -a.\n" +"Optie -g impliceert -z, optie -b impliceert -Z.\n" + +#: src/shar.c:1798 +msgid "DEBUG was not selected at compile time" +msgstr "DEBUG niet meevertaald" + +#: src/shar.c:1819 +msgid "Hard limit %dk\n" +msgstr "Harde limiet %dk\n" + +#: src/shar.c:1886 +msgid "Soft limit %dk\n" +msgstr "Zachte grens %dk\n" + +#: src/shar.c:1987 +msgid "WARNING: No user interaction in vanilla mode" +msgstr "LET OP: De `vanilla' mode is niet interactief" + +#: src/shar.c:1998 +msgid "WARNING: Non-text storage options overridden" +msgstr "LET OP: de opties voor opslag van niet-tekst worden genegeerd" + +#: src/shar.c:2054 +msgid "No input files" +msgstr "Geen invoer bestanden" + +#: src/shar.c:2060 +msgid "Cannot use -a option without -n" +msgstr "Optie -a kan niet zonder -n gebruikt worden" + +#: src/shar.c:2066 +msgid "Cannot use -l or -L option without -o" +msgstr "De opties -l and -L kunnen niet zonder -n gebruikt worden" + +#: src/shar.c:2078 +msgid "PLEASE avoid -X shars on Usenet or public networks" +msgstr "Vermijd a.u.b. -X shars op Usenet en op openbare netwerken" + +#: src/shar.c:2119 +msgid "You have unpacked the last part" +msgstr "" + +#: src/shar.c:2121 +msgid "Created %d files\n" +msgstr "%d bestand(en) aangemaakt" + +#: src/unshar.c:158 +msgid "Found no shell commands in %s" +msgstr "Vond geen shell opdrachten in %s" + +#: src/unshar.c:174 +msgid "%s looks like raw C code, not a shell archive" +msgstr "%s ziet eruit als een C programma, niet als een shell-archief" + +#: src/unshar.c:210 +msgid "Found no shell commands after `cut' in %s" +msgstr "Vond geen shell opdrachten na `cut' in %s" + +#: src/unshar.c:231 +msgid "%s is probably not a shell archive" +msgstr "%s is waarschijnlijk geen shell-archief" + +#: src/unshar.c:232 +msgid "The `cut' line was followed by: %s" +msgstr "De `cut' regel werd gevolgd door: %s" + +#: src/unshar.c:258 +msgid "Starting `sh' process" +msgstr "Start een `sh' proces" + +#: src/unshar.c:307 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +"\n" +" -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n" +" -c, --overwrite pass -c to shar script for overwriting files\n" +" -e, --exit-0 same as `--split-at=\"exit 0\"'\n" +" -E, --split-at=STRING split concatenated shars after STRING\n" +" -f, --force same as `-c'\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +"\n" +"If no FILE, standard input is read.\n" +msgstr "" + +#: src/unshar.c:384 +msgid "Cannot chdir to `%s'" +msgstr "`chdir %s' faalt" + +#: src/unshar.c:441 +msgid "standard input" +msgstr "standaard invoer" + +#: src/uudecode.c:98 src/uudecode.c:196 +msgid "%s: Short file" +msgstr "%s: Bestand te kort" + +#: src/uudecode.c:141 +msgid "%s: No `end' line" +msgstr "%s: Geen `end' regel" + +#: src/uudecode.c:205 +msgid "%s: data following `=' padding character" +msgstr "" + +#: src/uudecode.c:229 src/uudecode.c:237 src/uudecode.c:251 +msgid "%s: illegal line" +msgstr "" + +#: src/uudecode.c:289 +msgid "%s: No `begin' line" +msgstr "%s: Geen `begin' regel" + +#: src/uudecode.c:321 +msgid "%s: Illegal ~user" +msgstr "%s: Illegale ~gebruiker" + +#: src/uudecode.c:328 +msgid "%s: No user `%s'" +msgstr "%s: Er bestaat geen gebruiker `%s'" + +#: src/uudecode.c:374 +msgid "Usage: %s [FILE]...\n" +msgstr "Aanroep: %s [BESTAND]...\n" + +#: src/uudecode.c:375 +msgid "" +"Mandatory arguments to long options are mandatory to short options too.\n" +" -h, --help display this help and exit\n" +" -v, --version output version information and exit\n" +" -o, --output-file=FILE direct output to FILE\n" +msgstr "" + +#: src/uuencode.c:198 +msgid "Read error" +msgstr "Leesfout" + +#: src/uuencode.c:215 +msgid "Usage: %s [INFILE] REMOTEFILE\n" +msgstr "Aanroep: %s [LOKAAL_BESTAND] NIETLOKAAL_BESTAND\n" + +#: src/uuencode.c:216 +msgid "" +"\n" +" -h, --help display this help and exit\n" +" -m, --base64 use base64 encoding as of RFC1521\n" +" -v, --version output version information and exit\n" +msgstr "" + +#: src/uuencode.c:297 +msgid "Write error" +msgstr "Schrijffout" +# msgid "" +# "\n" +# "Protecting against transmission:\n" +# " -w, --no-character-count do not use `wc -c' to check size\n" +# " -F, --force-prefix force the prefix character on every line\n" +# " -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n" +# "\n" +# "Producing different kinds of shars:\n" +# " -V, --vanilla-operation produce very simple and undemanding shars\n" +# " -P, --no-piping exclusively use temporary files at unshar time\n" +# " -x, --no-check-existing blindly overwrite existing files\n" +# " -X, --query-user ask user before overwriting files (not for Net)\n" +# " -m, --no-timestamp do not restore file modification dates & times\n" +# " -Q, --quiet-unshar avoid verbose messages at unshar time\n" +# " -f, --basename restore in one directory, despite hierarchy\n" +# msgstr "" +# "\n" +# "Bescherming bij transmissie:\n" +# " -w, --no-character-count gebruik geen `wc -c' ter controle\n" +# " -F, --force-prefix voeg een symbool als prefix voor elke regel in\n" +# " -d, --here-delimiter=STRING gebruik STRING als scheider tussen bestanden\n" +# "\n" +# "Productie van verschillende soorten shar-archieven:\n" +# " -V, --vanilla-operation maak heel eenvoudige en weinigeisende shar-archieven\n" +# " -P, --no-piping gebruik tijdelijke hulpbestanden bij het uitpakken\n" +# " -x, --no-check-existing overschrijf bestaande bestanden zonder waarschuwing\n" +# " -X, --query-user vraag de gebruiker bevestiging alvorens een bestand\n" +# " te overschrijven (niet voor gebruik over het net)\n" +# " -m, --no-timestamp herstel de modificatie datum en tijd niet\n" +# " -Q, --quiet-unshar geen gepraat bij het uitpakken\n" +# " -f, --basename pak in één directory uit, niet in onderdirectories\n" +# +# msgid "" +# "\n" +# " -h, --help display this help and exit\n" +# " -v, --version output version information and exit\n" +# msgstr "" +# "\n" +# " -h, --help laat alleen deze hulptekst zien\n" +# " -v, --version laat alleen programmaversie zien\n" +# +# msgid "" +# "Mandatory arguments to long options are mandatory for short options too.\n" +# "\n" +# " -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n" +# " -c, --overwrite pass -c flag to shar for overwriting files\n" +# " -e, --exit-0 same as `--split-at=\"exit 0\"'\n" +# " -E, --split-at=STRING split concatenated shars after STRING\n" +# " --help display this help and exit\n" +# " --version output version information and exit\n" +# "\n" +# "If no FILE, standard input is read.\n" +# msgstr "" +# "Verplichte argumenten voor opties in de lange vorm zijn ook nodig\n" +# "\"\n" +# diff --git a/src/apps/bin/sharutils-4.2.1/po/pt.gmo b/src/apps/bin/sharutils-4.2.1/po/pt.gmo new file mode 100644 index 0000000000..ffed57355c Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/po/pt.gmo differ diff --git a/src/apps/bin/sharutils-4.2.1/po/pt.po b/src/apps/bin/sharutils-4.2.1/po/pt.po new file mode 100644 index 0000000000..e223b29f5a --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/pt.po @@ -0,0 +1,626 @@ +msgid "" +msgstr "" +"Date: 1995-08-02 02:00:57+0200\n" +"From: Ulrich Drepper \n" +"Xgettext-Options: --default-domain=sharutils --output-dir=. --add-comments --keyword=_\n" +"Files: ../../po/../lib/error.c ../../po/../lib/getopt.c\n" +" ../../po/../lib/xmalloc.c ../../po/../src/shar.c\n" +" ../../po/../src/unshar.c ../../po/../src/uudecode.c\n" +" ../../po/../src/uuencode.c\n" + +#: lib/error.c:73 +msgid "Unknown system error" +msgstr "" + +#: lib/getopt.c:516 +msgid "%s: option `%s' is ambiguous\n" +msgstr "" + +#: lib/getopt.c:540 +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "" + +#. +option or -option +#: lib/getopt.c:545 +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "" + +#: lib/getopt.c:559 +msgid "%s: option `%s' requires an argument\n" +msgstr "" + +#. --option +#: lib/getopt.c:587 +msgid "%s: unrecognized option `--%s'\n" +msgstr "" + +#: lib/getopt.c:591 +msgid "%s: unrecognized option `%c%s'\n" +msgstr "" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:616 +msgid "%s: illegal option -- %c\n" +msgstr "" + +#: lib/getopt.c:618 +msgid "%s: invalid option -- %c\n" +msgstr "" + +#: lib/getopt.c:652 +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: lib/xmalloc.c:67 +msgid "memory exhausted" +msgstr "" + +#: src/shar.c:569 +msgid "WARNING: not restoring timestamps. Consider getting and" +msgstr "" + +#: src/shar.c:571 +msgid "installing GNU \\`touch', distributed in GNU File Utilities..." +msgstr "" + +#: src/shar.c:586 +msgid "creating lock directory" +msgstr "" + +#: src/shar.c:587 +msgid "failed to create lock directory" +msgstr "" + +#: src/shar.c:617 +msgid "Too many directories for mkdir generation" +msgstr "Demasiados nomes de directorias para poder criar uma directoria" + +#: src/shar.c:626 +msgid "creating directory" +msgstr "" + +#: src/shar.c:675 src/shar.c:902 +msgid "Cannot access %s" +msgstr "Não é possível aceder a %s" + +#: src/shar.c:728 src/shar.c:1858 +msgid "-C is being deprecated, use -Z instead" +msgstr "-C está a cair em desuso, utilize antes -Z" + +#: src/shar.c:781 src/unshar.c:366 +msgid "Cannot get current directory name" +msgstr "Não se consegue obter o nome da directoria corrente" + +#: src/shar.c:867 +msgid "Must unpack archives in sequence!" +msgstr "" + +#: src/shar.c:868 src/shar.c:1401 +msgid "Please unpack part" +msgstr "" + +#: src/shar.c:868 src/shar.c:1402 +msgid "next!" +msgstr "" + +#: src/shar.c:897 +msgid "%s: Not a regular file" +msgstr "%s: Não é um ficheiro ordinário" + +#: src/shar.c:912 +msgid "In shar: remaining size %ld\n" +msgstr "Em shar: o espaço ainda disponível é %ld\n" + +#. Change to another file. +#: src/shar.c:923 src/shar.c:1307 +msgid "Newfile, remaining %ld, " +msgstr "Ficheiro novo, espaço ainda disponível %ld," + +#: src/shar.c:924 src/shar.c:1308 +msgid "Limit still %d\n" +msgstr "O limite dura %d\n" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "restore of" +msgstr "" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "failed" +msgstr "" + +#: src/shar.c:941 src/shar.c:1327 +msgid "End of part" +msgstr "" + +#: src/shar.c:942 src/shar.c:1328 +msgid "continue with part" +msgstr "" + +#: src/shar.c:955 src/shar.c:1418 +msgid "Starting file %s\n" +msgstr "Arrancando o ficheiro %s\n" + +#: src/shar.c:990 +msgid "empty" +msgstr "vazio" + +#: src/shar.c:991 +msgid "(empty)" +msgstr "" + +#: src/shar.c:1015 +msgid "Cannot open file %s" +msgstr "Não é possível abrir o ficheiro %s" + +#: src/shar.c:1052 +msgid "compressed" +msgstr "via `compress'" + +#: src/shar.c:1053 +msgid "gzipped" +msgstr "via `gzip'" + +#: src/shar.c:1053 +msgid "binary" +msgstr "binário" + +#: src/shar.c:1054 +msgid "(compressed)" +msgstr "" + +#: src/shar.c:1055 +msgid "(gzipped)" +msgstr "" + +#: src/shar.c:1056 +msgid "(binary)" +msgstr "" + +#: src/shar.c:1069 +msgid "Could not fork" +msgstr "Não é possível fazer um `fork'" + +#: src/shar.c:1074 src/shar.c:1126 +msgid "File %s (%s)" +msgstr "Ficheiro %s (%s)" + +#: src/shar.c:1120 +msgid "text" +msgstr "texto" + +#: src/shar.c:1121 +msgid "(text)" +msgstr "" + +#: src/shar.c:1167 +msgid "overwriting" +msgstr "" + +#: src/shar.c:1168 +msgid "overwrite" +msgstr "" + +#: src/shar.c:1169 +msgid "[no, yes, all, quit] (no)?" +msgstr "" + +#: src/shar.c:1170 +msgid "extraction aborted" +msgstr "" + +#: src/shar.c:1171 src/shar.c:1176 +msgid "SKIPPING" +msgstr "" + +#: src/shar.c:1176 +msgid "(file already exists)" +msgstr "" + +#: src/shar.c:1194 +msgid "Saving %s (%s)" +msgstr "Gravando %s (%s)" + +#: src/shar.c:1199 +msgid "extracting" +msgstr "" + +#: src/shar.c:1333 +msgid "End of" +msgstr "" + +#: src/shar.c:1334 +msgid "archive" +msgstr "" + +#: src/shar.c:1335 +msgid "part" +msgstr "" + +#: src/shar.c:1337 src/shar.c:1443 +msgid "File" +msgstr "" + +#: src/shar.c:1338 +msgid "is continued in part" +msgstr "" + +#: src/shar.c:1398 +msgid "Please unpack part 1 first!" +msgstr "" + +#: src/shar.c:1415 +msgid "STILL SKIPPING" +msgstr "" + +#: src/shar.c:1422 +msgid "continuing file" +msgstr "" + +#: src/shar.c:1443 +msgid "is complete" +msgstr "" + +#: src/shar.c:1452 +msgid "uudecoding file" +msgstr "" + +#: src/shar.c:1466 +msgid "uncompressing file" +msgstr "" + +#: src/shar.c:1477 +msgid "gunzipping file" +msgstr "" + +#: src/shar.c:1539 +msgid "MD5 check failed" +msgstr "" + +#: src/shar.c:1580 +msgid "original size" +msgstr "" + +#: src/shar.c:1581 +msgid "current size" +msgstr "" + +#: src/shar.c:1630 +msgid "Opening `%s'" +msgstr "Abrindo `%s'" + +#: src/shar.c:1641 +msgid "Closing `%s'" +msgstr "Fechando `%s'" + +#: src/shar.c:1653 src/unshar.c:302 src/uudecode.c:370 src/uuencode.c:211 +msgid "Try `%s --help' for more information.\n" +msgstr "Para mais informação, tente `%s --help'.\n" + +#: src/shar.c:1657 src/unshar.c:306 +msgid "Usage: %s [OPTION]... [FILE]...\n" +msgstr "Utilização: %s [OPÇÃO]... [FICHEIRO]...\n" + +#: src/shar.c:1658 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Os argumentos obrigatórios para as opções na forma longa são também\n" +"obrigatórios para a forma curta que lhe corresponde.\n" + +#: src/shar.c:1661 +msgid "" +"\n" +"Giving feedback:\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +" -q, --quiet, --silent do not output verbose messages locally\n" +"\n" +"Selecting files:\n" +" -p, --intermix-type allow -[BTzZ] in file lists to change mode\n" +" -S, --stdin-file-list read file list from standard input\n" +"\n" +"Splitting output:\n" +" -o, --output-prefix=PREFIX output to file PREFIX.01 through PREFIX.NN\n" +" -l, --whole-size-limit=SIZE split archive, not files, to SIZE kilobytes\n" +" -L, --split-size-limit=SIZE split archive, or files, to SIZE kilobytes\n" +msgstr "" +"\n" +"Mensagens informativas:\n" +" --help apresenta esta mensagem de apoio e termina\n" +" --version identifica o programa e termina\n" +" -q, --quiet, --silent não apresenta mensagens pormenorizadas localmente\n" +"\n" +"Escolha dos ficheiros:\n" +" -p, --intermix-type permite -[BTzZ] na lista de ficheiros para\n" +" mudar de modo\n" +" -S, --stdin-file-list ler a lista de ficheiros da entrada standard\n" +"\n" +"Delimitar os resultados:\n" +" -o, --output-prefix=PREFIXO gera os ficheiros PREFIXO.01 a PREFIXO.NN\n" +" -l, --whole-size-limit=TAMANHO limita os arquivos, não os ficheiros,\n" +" a TAMANHO kbytes\n" +" -L, --split-size-limit=TAMANHO limita os arquivos, ou os ficheiros,\n" +" a TAMANHO kbytes\n" + +#: src/shar.c:1677 +msgid "" +"\n" +"Controlling the shar headers:\n" +" -n, --archive-name=NAME use NAME to document the archive\n" +" -s, --submitter=ADDRESS override the submitter name\n" +" -a, --net-headers output Submitted-by: & Archive-name: headers\n" +" -c, --cut-mark start the shar with a cut line\n" +"\n" +"Selecting how files are stocked:\n" +" -M, --mixed-uuencode dynamically decide uuencoding (default)\n" +" -T, --text-files treat all files as text\n" +" -B, --uuencode treat all files as binary, use uuencode\n" +" -z, --gzip gzip and uuencode all files\n" +" -g, --level-for-gzip=LEVEL pass -LEVEL (default 9) to gzip\n" +" -Z, --compress compress and uuencode all files\n" +" -b, --bits-per-code=BITS pass -bBITS (default 12) to compress\n" +msgstr "" +"\n" +"Controlo dos cabeçalhos de `shar':\n" +" -n, --archive-name=NOME atribui ao arquivo o nome NOME\n" +" -s, --submitter=ENDERECO altera o nome original\n" +" -a, --net-headers produz os cabeçalhos Submitted-by: e Archive-name:\n" +" -c, --cut-mark coloca uma linha de demarcação no início de `shar'\n" +"\n" +"Metodos de armazenamento:\n" +" -M, --mixed-uuencode faz `uuencode' dinamicamente (por defeito)\n" +" -T, --text-files considera todos os ficheiros de texto\n" +" -B, --uuencode considera todos os ficheiros binários,\n" +" usa `uuencode'\n" +" -z, --gzip aplica `gzip' e `uuencode' a todos os ficheiros\n" +" -g, --level-for-gzip=NIVEL fornece -NIVEL (valor defeito 9) a `gzip'\n" +" -Z, --compress aplica `compress' e `uuencode' a todos os\n" +" ficheiros\n" +" -b, --bits-per-code=BITS fornece -bBITS (valor defeito 12) a `compress'\n" + +#: src/shar.c:1694 +msgid "" +"\n" +"Protecting against transmission:\n" +" -w, --no-character-count do not use `wc -c' to check size\n" +" -D, --no-md5-digest do not use `md5sum' digest to verify\n" +" -F, --force-prefix force the prefix character on every line\n" +" -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n" +"\n" +"Producing different kinds of shars:\n" +" -V, --vanilla-operation produce very simple and undemanding shars\n" +" -P, --no-piping exclusively use temporary files at unshar time\n" +" -x, --no-check-existing blindly overwrite existing files\n" +" -X, --query-user ask user before overwriting files (not for Net)\n" +" -m, --no-timestamp do not restore file modification dates & times\n" +" -Q, --quiet-unshar avoid verbose messages at unshar time\n" +" -f, --basename restore in one directory, despite hierarchy\n" +" --no-i18n do not produce internationalized shell script\n" +msgstr "" + +#: src/shar.c:1712 +msgid "" +"\n" +"Option -o is required with -l or -L, option -n is required with -a.\n" +"Option -g implies -z, option -b implies -Z.\n" +msgstr "" +"\n" +"Exige-se a opção -o com -l ou -L, exige-se a opção -n com -a.\n" +"A opção -g implica -z, a opção -b implica -Z.\n" + +#: src/shar.c:1798 +msgid "DEBUG was not selected at compile time" +msgstr "Não se escolheu DEBUG durante a compilação" + +#: src/shar.c:1819 +msgid "Hard limit %dk\n" +msgstr "Limite tipo `hard' de %dk" + +#: src/shar.c:1886 +msgid "Soft limit %dk\n" +msgstr "Limite tipo `soft' de %dk" + +#: src/shar.c:1987 +msgid "WARNING: No user interaction in vanilla mode" +msgstr "ATENÇÃO: Não há intervenção do utilizador no modo `vanilla'" + +#: src/shar.c:1998 +msgid "WARNING: Non-text storage options overridden" +msgstr "ATENÇÃO: As opções para armazenamento não-textual foram anuladas" + +#: src/shar.c:2054 +msgid "No input files" +msgstr "Nenhum ficheiro de entrada" + +#: src/shar.c:2060 +msgid "Cannot use -a option without -n" +msgstr "Não se pode usar a opção -a sem a opção -n" + +#: src/shar.c:2066 +msgid "Cannot use -l or -L option without -o" +msgstr "Não se pode usar a opção -l ou -L sem a opção -o" + +#: src/shar.c:2078 +msgid "PLEASE avoid -X shars on Usenet or public networks" +msgstr "Por favor, evite -X em arquivos de shell com grande difusão (redes públicas)" + +#: src/shar.c:2119 +msgid "You have unpacked the last part" +msgstr "" + +#: src/shar.c:2121 +msgid "Created %d files\n" +msgstr "Foram criados %d ficheiros\n" + +#: src/unshar.c:158 +msgid "Found no shell commands in %s" +msgstr "Não foi encontrado nenhum comando de shell, em %s" + +#: src/unshar.c:174 +msgid "%s looks like raw C code, not a shell archive" +msgstr "%s parece ser código C em bruto, não um arquivo de shell" + +#: src/unshar.c:210 +msgid "Found no shell commands after `cut' in %s" +msgstr "Não foi encontrado nenhum comando de shell após o `cut', em %s" + +#: src/unshar.c:231 +msgid "%s is probably not a shell archive" +msgstr "%s provavelmente nao é um arquivo de shell" + +#: src/unshar.c:232 +msgid "The `cut' line was followed by: %s" +msgstr "À linha de demarcação seguiu-se: %s" + +#: src/unshar.c:258 +msgid "Starting `sh' process" +msgstr "Arrancando o processo `sh'" + +#: src/unshar.c:307 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +"\n" +" -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n" +" -c, --overwrite pass -c to shar script for overwriting files\n" +" -e, --exit-0 same as `--split-at=\"exit 0\"'\n" +" -E, --split-at=STRING split concatenated shars after STRING\n" +" -f, --force same as `-c'\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +"\n" +"If no FILE, standard input is read.\n" +msgstr "" + +#: src/unshar.c:384 +msgid "Cannot chdir to `%s'" +msgstr "Não é possível mudar para a directoria `%s'" + +#: src/unshar.c:441 +msgid "standard input" +msgstr "entrada standard" + +#: src/uudecode.c:98 src/uudecode.c:196 +msgid "%s: Short file" +msgstr "%s: Ficheiro de dimensão reduzida" + +#: src/uudecode.c:141 +msgid "%s: No `end' line" +msgstr "%s: Falta a linha `end'" + +#: src/uudecode.c:205 +msgid "%s: data following `=' padding character" +msgstr "" + +#: src/uudecode.c:229 src/uudecode.c:237 src/uudecode.c:251 +msgid "%s: illegal line" +msgstr "" + +#: src/uudecode.c:289 +msgid "%s: No `begin' line" +msgstr "%s: Falta a linha `begin'" + +#: src/uudecode.c:321 +msgid "%s: Illegal ~user" +msgstr "%s: ~utilizador não permitido" + +#: src/uudecode.c:328 +msgid "%s: No user `%s'" +msgstr "%s: Não existe o utilizador `%s'" + +#: src/uudecode.c:374 +msgid "Usage: %s [FILE]...\n" +msgstr "Utilização: %s [FICHEIRO]...\n" + +#: src/uudecode.c:375 +msgid "" +"Mandatory arguments to long options are mandatory to short options too.\n" +" -h, --help display this help and exit\n" +" -v, --version output version information and exit\n" +" -o, --output-file=FILE direct output to FILE\n" +msgstr "" + +#: src/uuencode.c:198 +msgid "Read error" +msgstr "Erro durante a leitura" + +#: src/uuencode.c:215 +msgid "Usage: %s [INFILE] REMOTEFILE\n" +msgstr "Utilização: %s [FICHEIRO_DE_ENTRADA] FICHEIRO_REMOTO\n" + +#: src/uuencode.c:216 +msgid "" +"\n" +" -h, --help display this help and exit\n" +" -m, --base64 use base64 encoding as of RFC1521\n" +" -v, --version output version information and exit\n" +msgstr "" + +#: src/uuencode.c:297 +msgid "Write error" +msgstr "Erro durante a escrita" +# msgid "" +# "\n" +# "Protecting against transmission:\n" +# " -w, --no-character-count do not use `wc -c' to check size\n" +# " -F, --force-prefix force the prefix character on every line\n" +# " -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n" +# "\n" +# "Producing different kinds of shars:\n" +# " -V, --vanilla-operation produce very simple and undemanding shars\n" +# " -P, --no-piping exclusively use temporary files at unshar time\n" +# " -x, --no-check-existing blindly overwrite existing files\n" +# " -X, --query-user ask user before overwriting files (not for Net)\n" +# " -m, --no-timestamp do not restore file modification dates & times\n" +# " -Q, --quiet-unshar avoid verbose messages at unshar time\n" +# " -f, --basename restore in one directory, despite hierarchy\n" +# msgstr "" +# "\n" +# "Protecções a utilizar na transmissão:\n" +# " -w, --no-character-count não se verifica o tamanho com `wc -c'\n" +# " -F, --force-prefix coloca o caractere de prefixo em cada linha\n" +# " -d, --here-delimiter=STRING delimita cada ficheiro do arquivo com STRING\n" +# "\n" +# "Tipos de arquivos:\n" +# " -V, --vanilla-operation produz arquivos de shell simples e não exigentes\n" +# " -P, --no-piping usar só ficheiros temporarios durante a extracção\n" +# " -x, --no-check-existing reescreve, sem testar, os ficheiros existentes\n" +# " -X, --query-user pergunta antes de reescrever (NÃO se usa em Rede)\n" +# " -m, --no-timestamp não actualiza as datas e os tempos de modificação\n" +# " dos ficheiros\n" +# " -Q, --quiet-unshar não apresenta mensagens pormenorizadas ao extrair\n" +# " os arquivos\n" +# " -f, --basename extrai todos os arquivos para a mesma directoria,\n" +# " apesar da hierarquia\n" +# +# msgid "" +# "\n" +# " -h, --help display this help and exit\n" +# " -v, --version output version information and exit\n" +# msgstr "" +# "\n" +# " -h, --help apresenta esta mensagem de apoio e termina\n" +# " -v, --version identifica o programa e termina\n" +# +# msgid "" +# "Mandatory arguments to long options are mandatory for short options too.\n" +# "\n" +# " -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n" +# " -c, --overwrite pass -c flag to shar for overwriting files\n" +# " -e, --exit-0 same as `--split-at=\"exit 0\"'\n" +# " -E, --split-at=STRING split concatenated shars after STRING\n" +# " --help display this help and exit\n" +# " --version output version information and exit\n" +# "\n" +# "If no FILE, standard input is read.\n" +# msgstr "" +# "Os argumentos obrigatórios para as opções na forma longa são também\n" +# "obrigatórios para a forma curta que lhe corresponde.\n" +# "\n" +# " -d, --directory=DIRECTORIA muda para DIRECTORIA antes de desempacotar\n" +# " -c, --overwrite fornece -c a `shar' para reescrever os ficheiros\n" +# " -e, --exit-0 o mesmo que `--split-at=\"exit 0\"'\n" +# " -E, --split-at=STRING separa os arquivos concatenados após STRING\n" +# " --help apresenta esta mensagem de apoio e termina\n" +# " --version identifica o programa e termina\n" +# "\n" +# "Na ausência de qualquer FICHEIRO, o programa lê a entrada standard.\n" +# diff --git a/src/apps/bin/sharutils-4.2.1/po/sharutils.pot b/src/apps/bin/sharutils-4.2.1/po/sharutils.pot new file mode 100644 index 0000000000..2c15a761c2 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/sharutils.pot @@ -0,0 +1,518 @@ +msgid "" +msgstr "" +"Date: 1995-12-04 16:59:43+0100\n" +"From: Ulrich Drepper \n" +"Content-Type: text/plain; charset=\n" +"Xgettext-Options: --default-domain=sharutils --directory=../.. --add-comments --keyword=_ --keyword=N_ --files-from=../../po/POTFILES.in\n" +"Files: lib/error.c lib/getopt.c lib/xmalloc.c src/shar.c src/unshar.c src/uudecode.c src/uuencode.c\n" + +#: lib/error.c:73 +msgid "Unknown system error" +msgstr "" + +#: lib/getopt.c:516 +msgid "%s: option `%s' is ambiguous\n" +msgstr "" + +#: lib/getopt.c:540 +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "" + +#. +option or -option +#: lib/getopt.c:545 +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "" + +#: lib/getopt.c:559 +msgid "%s: option `%s' requires an argument\n" +msgstr "" + +#. --option +#: lib/getopt.c:587 +msgid "%s: unrecognized option `--%s'\n" +msgstr "" + +#: lib/getopt.c:591 +msgid "%s: unrecognized option `%c%s'\n" +msgstr "" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:616 +msgid "%s: illegal option -- %c\n" +msgstr "" + +#: lib/getopt.c:618 +msgid "%s: invalid option -- %c\n" +msgstr "" + +#: lib/getopt.c:652 +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: lib/xmalloc.c:67 +msgid "memory exhausted" +msgstr "" + +#: src/shar.c:569 +msgid "WARNING: not restoring timestamps. Consider getting and" +msgstr "" + +#: src/shar.c:571 +msgid "installing GNU \\`touch', distributed in GNU File Utilities..." +msgstr "" + +#: src/shar.c:586 +msgid "creating lock directory" +msgstr "" + +#: src/shar.c:587 +msgid "failed to create lock directory" +msgstr "" + +#: src/shar.c:617 +msgid "Too many directories for mkdir generation" +msgstr "" + +#: src/shar.c:626 +msgid "creating directory" +msgstr "" + +#: src/shar.c:675 src/shar.c:902 +msgid "Cannot access %s" +msgstr "" + +#: src/shar.c:728 src/shar.c:1858 +msgid "-C is being deprecated, use -Z instead" +msgstr "" + +#: src/shar.c:781 src/unshar.c:366 +msgid "Cannot get current directory name" +msgstr "" + +#: src/shar.c:867 +msgid "Must unpack archives in sequence!" +msgstr "" + +#: src/shar.c:868 src/shar.c:1401 +msgid "Please unpack part" +msgstr "" + +#: src/shar.c:868 src/shar.c:1402 +msgid "next!" +msgstr "" + +#: src/shar.c:897 +msgid "%s: Not a regular file" +msgstr "" + +#: src/shar.c:912 +msgid "In shar: remaining size %ld\n" +msgstr "" + +#. Change to another file. +#: src/shar.c:923 src/shar.c:1307 +msgid "Newfile, remaining %ld, " +msgstr "" + +#: src/shar.c:924 src/shar.c:1308 +msgid "Limit still %d\n" +msgstr "" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "restore of" +msgstr "" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "failed" +msgstr "" + +#: src/shar.c:941 src/shar.c:1327 +msgid "End of part" +msgstr "" + +#: src/shar.c:942 src/shar.c:1328 +msgid "continue with part" +msgstr "" + +#: src/shar.c:955 src/shar.c:1418 +msgid "Starting file %s\n" +msgstr "" + +#: src/shar.c:990 +msgid "empty" +msgstr "" + +#: src/shar.c:991 +msgid "(empty)" +msgstr "" + +#: src/shar.c:1015 +msgid "Cannot open file %s" +msgstr "" + +#: src/shar.c:1052 +msgid "compressed" +msgstr "" + +#: src/shar.c:1053 +msgid "gzipped" +msgstr "" + +#: src/shar.c:1053 +msgid "binary" +msgstr "" + +#: src/shar.c:1054 +msgid "(compressed)" +msgstr "" + +#: src/shar.c:1055 +msgid "(gzipped)" +msgstr "" + +#: src/shar.c:1056 +msgid "(binary)" +msgstr "" + +#: src/shar.c:1069 +msgid "Could not fork" +msgstr "" + +#: src/shar.c:1074 src/shar.c:1126 +msgid "File %s (%s)" +msgstr "" + +#: src/shar.c:1120 +msgid "text" +msgstr "" + +#: src/shar.c:1121 +msgid "(text)" +msgstr "" + +#: src/shar.c:1167 +msgid "overwriting" +msgstr "" + +#: src/shar.c:1168 +msgid "overwrite" +msgstr "" + +#: src/shar.c:1169 +msgid "[no, yes, all, quit] (no)?" +msgstr "" + +#: src/shar.c:1170 +msgid "extraction aborted" +msgstr "" + +#: src/shar.c:1171 src/shar.c:1176 +msgid "SKIPPING" +msgstr "" + +#: src/shar.c:1176 +msgid "(file already exists)" +msgstr "" + +#: src/shar.c:1194 +msgid "Saving %s (%s)" +msgstr "" + +#: src/shar.c:1199 +msgid "extracting" +msgstr "" + +#: src/shar.c:1333 +msgid "End of" +msgstr "" + +#: src/shar.c:1334 +msgid "archive" +msgstr "" + +#: src/shar.c:1335 +msgid "part" +msgstr "" + +#: src/shar.c:1337 src/shar.c:1443 +msgid "File" +msgstr "" + +#: src/shar.c:1338 +msgid "is continued in part" +msgstr "" + +#: src/shar.c:1398 +msgid "Please unpack part 1 first!" +msgstr "" + +#: src/shar.c:1415 +msgid "STILL SKIPPING" +msgstr "" + +#: src/shar.c:1422 +msgid "continuing file" +msgstr "" + +#: src/shar.c:1443 +msgid "is complete" +msgstr "" + +#: src/shar.c:1452 +msgid "uudecoding file" +msgstr "" + +#: src/shar.c:1466 +msgid "uncompressing file" +msgstr "" + +#: src/shar.c:1477 +msgid "gunzipping file" +msgstr "" + +#: src/shar.c:1539 +msgid "MD5 check failed" +msgstr "" + +#: src/shar.c:1580 +msgid "original size" +msgstr "" + +#: src/shar.c:1581 +msgid "current size" +msgstr "" + +#: src/shar.c:1630 +msgid "Opening `%s'" +msgstr "" + +#: src/shar.c:1641 +msgid "Closing `%s'" +msgstr "" + +#: src/shar.c:1653 src/unshar.c:302 src/uudecode.c:370 src/uuencode.c:211 +msgid "Try `%s --help' for more information.\n" +msgstr "" + +#: src/shar.c:1657 src/unshar.c:306 +msgid "Usage: %s [OPTION]... [FILE]...\n" +msgstr "" + +#: src/shar.c:1658 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" + +#: src/shar.c:1661 +msgid "" +"\n" +"Giving feedback:\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +" -q, --quiet, --silent do not output verbose messages locally\n" +"\n" +"Selecting files:\n" +" -p, --intermix-type allow -[BTzZ] in file lists to change mode\n" +" -S, --stdin-file-list read file list from standard input\n" +"\n" +"Splitting output:\n" +" -o, --output-prefix=PREFIX output to file PREFIX.01 through PREFIX.NN\n" +" -l, --whole-size-limit=SIZE split archive, not files, to SIZE kilobytes\n" +" -L, --split-size-limit=SIZE split archive, or files, to SIZE kilobytes\n" +msgstr "" + +#: src/shar.c:1677 +msgid "" +"\n" +"Controlling the shar headers:\n" +" -n, --archive-name=NAME use NAME to document the archive\n" +" -s, --submitter=ADDRESS override the submitter name\n" +" -a, --net-headers output Submitted-by: & Archive-name: headers\n" +" -c, --cut-mark start the shar with a cut line\n" +"\n" +"Selecting how files are stocked:\n" +" -M, --mixed-uuencode dynamically decide uuencoding (default)\n" +" -T, --text-files treat all files as text\n" +" -B, --uuencode treat all files as binary, use uuencode\n" +" -z, --gzip gzip and uuencode all files\n" +" -g, --level-for-gzip=LEVEL pass -LEVEL (default 9) to gzip\n" +" -Z, --compress compress and uuencode all files\n" +" -b, --bits-per-code=BITS pass -bBITS (default 12) to compress\n" +msgstr "" + +#: src/shar.c:1694 +msgid "" +"\n" +"Protecting against transmission:\n" +" -w, --no-character-count do not use `wc -c' to check size\n" +" -D, --no-md5-digest do not use `md5sum' digest to verify\n" +" -F, --force-prefix force the prefix character on every line\n" +" -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n" +"\n" +"Producing different kinds of shars:\n" +" -V, --vanilla-operation produce very simple and undemanding shars\n" +" -P, --no-piping exclusively use temporary files at unshar time\n" +" -x, --no-check-existing blindly overwrite existing files\n" +" -X, --query-user ask user before overwriting files (not for Net)\n" +" -m, --no-timestamp do not restore file modification dates & times\n" +" -Q, --quiet-unshar avoid verbose messages at unshar time\n" +" -f, --basename restore in one directory, despite hierarchy\n" +" --no-i18n do not produce internationalized shell script\n" +msgstr "" + +#: src/shar.c:1712 +msgid "" +"\n" +"Option -o is required with -l or -L, option -n is required with -a.\n" +"Option -g implies -z, option -b implies -Z.\n" +msgstr "" + +#: src/shar.c:1798 +msgid "DEBUG was not selected at compile time" +msgstr "" + +#: src/shar.c:1819 +msgid "Hard limit %dk\n" +msgstr "" + +#: src/shar.c:1886 +msgid "Soft limit %dk\n" +msgstr "" + +#: src/shar.c:1987 +msgid "WARNING: No user interaction in vanilla mode" +msgstr "" + +#: src/shar.c:1998 +msgid "WARNING: Non-text storage options overridden" +msgstr "" + +#: src/shar.c:2054 +msgid "No input files" +msgstr "" + +#: src/shar.c:2060 +msgid "Cannot use -a option without -n" +msgstr "" + +#: src/shar.c:2066 +msgid "Cannot use -l or -L option without -o" +msgstr "" + +#: src/shar.c:2078 +msgid "PLEASE avoid -X shars on Usenet or public networks" +msgstr "" + +#: src/shar.c:2119 +msgid "You have unpacked the last part" +msgstr "" + +#: src/shar.c:2121 +msgid "Created %d files\n" +msgstr "" + +#: src/unshar.c:158 +msgid "Found no shell commands in %s" +msgstr "" + +#: src/unshar.c:174 +msgid "%s looks like raw C code, not a shell archive" +msgstr "" + +#: src/unshar.c:210 +msgid "Found no shell commands after `cut' in %s" +msgstr "" + +#: src/unshar.c:231 +msgid "%s is probably not a shell archive" +msgstr "" + +#: src/unshar.c:232 +msgid "The `cut' line was followed by: %s" +msgstr "" + +#: src/unshar.c:258 +msgid "Starting `sh' process" +msgstr "" + +#: src/unshar.c:307 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +"\n" +" -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n" +" -c, --overwrite pass -c to shar script for overwriting files\n" +" -e, --exit-0 same as `--split-at=\"exit 0\"'\n" +" -E, --split-at=STRING split concatenated shars after STRING\n" +" -f, --force same as `-c'\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +"\n" +"If no FILE, standard input is read.\n" +msgstr "" + +#: src/unshar.c:384 +msgid "Cannot chdir to `%s'" +msgstr "" + +#: src/unshar.c:441 +msgid "standard input" +msgstr "" + +#: src/uudecode.c:98 src/uudecode.c:196 +msgid "%s: Short file" +msgstr "" + +#: src/uudecode.c:141 +msgid "%s: No `end' line" +msgstr "" + +#: src/uudecode.c:205 +msgid "%s: data following `=' padding character" +msgstr "" + +#: src/uudecode.c:229 src/uudecode.c:237 src/uudecode.c:251 +msgid "%s: illegal line" +msgstr "" + +#: src/uudecode.c:289 +msgid "%s: No `begin' line" +msgstr "" + +#: src/uudecode.c:321 +msgid "%s: Illegal ~user" +msgstr "" + +#: src/uudecode.c:328 +msgid "%s: No user `%s'" +msgstr "" + +#: src/uudecode.c:374 +msgid "Usage: %s [FILE]...\n" +msgstr "" + +#: src/uudecode.c:375 +msgid "" +"Mandatory arguments to long options are mandatory to short options too.\n" +" -h, --help display this help and exit\n" +" -v, --version output version information and exit\n" +" -o, --output-file=FILE direct output to FILE\n" +msgstr "" + +#: src/uuencode.c:198 +msgid "Read error" +msgstr "" + +#: src/uuencode.c:215 +msgid "Usage: %s [INFILE] REMOTEFILE\n" +msgstr "" + +#: src/uuencode.c:216 +msgid "" +"\n" +" -h, --help display this help and exit\n" +" -m, --base64 use base64 encoding as of RFC1521\n" +" -v, --version output version information and exit\n" +msgstr "" + +#: src/uuencode.c:297 +msgid "Write error" +msgstr "" diff --git a/src/apps/bin/sharutils-4.2.1/po/stamp-cat-id b/src/apps/bin/sharutils-4.2.1/po/stamp-cat-id new file mode 100644 index 0000000000..9788f70238 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/stamp-cat-id @@ -0,0 +1 @@ +timestamp diff --git a/src/apps/bin/sharutils-4.2.1/po/sv.gmo b/src/apps/bin/sharutils-4.2.1/po/sv.gmo new file mode 100644 index 0000000000..f2e979868b Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/po/sv.gmo differ diff --git a/src/apps/bin/sharutils-4.2.1/po/sv.po b/src/apps/bin/sharutils-4.2.1/po/sv.po new file mode 100644 index 0000000000..004e2b8bce --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/po/sv.po @@ -0,0 +1,594 @@ +msgid "" +msgstr "" +"Date: 1995-09-24 20:59:57+0200\n" +"From: Jan Djarv \n" +"Xgettext-Options: --default-domain=sharutils --output-dir=. --add-comments --keyword=_\n" +"Files: ../../po/../lib/error.c ../../po/../lib/getopt.c\n" +" ../../po/../lib/xmalloc.c ../../po/../src/shar.c\n" +" ../../po/../src/unshar.c ../../po/../src/uudecode.c\n" +" ../../po/../src/uuencode.c\n" + +#: lib/error.c:73 +msgid "Unknown system error" +msgstr "Okänt systemfel" + +#: lib/getopt.c:516 +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: flaggan `%s' är inte entydig\n" + +#: lib/getopt.c:540 +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: flagga `--%s' tillåter inget argument\n" + +#. +option or -option +#: lib/getopt.c:545 +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: flaggan `%c%s' tar inget argument\n" + +#: lib/getopt.c:559 +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: flaggan `%s' kräver ett argument\n" + +#. --option +#: lib/getopt.c:587 +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: okänd flagga `--%s'\n" + +#: lib/getopt.c:591 +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: okänd flagga `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:616 +msgid "%s: illegal option -- %c\n" +msgstr "%s: otillåten flagga -- %c\n" + +#: lib/getopt.c:618 +msgid "%s: invalid option -- %c\n" +msgstr "%s: okänd flagga -- %c\n" + +#: lib/getopt.c:652 +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flaggan kräver ett argument -- %c\n" + +#: lib/xmalloc.c:67 +msgid "memory exhausted" +msgstr "minnet är slut" + +#: src/shar.c:569 +msgid "WARNING: not restoring timestamps. Consider getting and" +msgstr "VARNING: Tidsinformation för filer återskapas inte. Du borde skaffa och " + +#: src/shar.c:571 +msgid "installing GNU \\`touch', distributed in GNU File Utilities..." +msgstr "installera GNUs `touch' som medföljer GNU File Utilities..." + +#: src/shar.c:586 +msgid "creating lock directory" +msgstr "skapar filkatalog för låsning" + +#: src/shar.c:587 +msgid "failed to create lock directory" +msgstr "misslyckades med att skapa filkatalog för låsning" + +#: src/shar.c:617 +msgid "Too many directories for mkdir generation" +msgstr "För många filkataloger för mkdir skapande" + +#: src/shar.c:626 +msgid "creating directory" +msgstr "skapar filkatalog" + +#: src/shar.c:675 src/shar.c:902 +msgid "Cannot access %s" +msgstr "Kan inte komma åt %s" + +#: src/shar.c:728 src/shar.c:1858 +msgid "-C is being deprecated, use -Z instead" +msgstr "-C kommer att tas bort, använd -Z i stället" + +#: src/shar.c:781 src/unshar.c:366 +msgid "Cannot get current directory name" +msgstr "Kan inte komma åt namnet på nuvarande filkatalog" + +#: src/shar.c:867 +msgid "Must unpack archives in sequence!" +msgstr "Arkivdelar måste packas upp i rätt ordning!" + +#: src/shar.c:868 src/shar.c:1401 +msgid "Please unpack part" +msgstr "Var vänlig packa upp arkivdel" + +#: src/shar.c:868 src/shar.c:1402 +msgid "next!" +msgstr "härnäst!" + +#: src/shar.c:897 +msgid "%s: Not a regular file" +msgstr "%s: Inte en normal fil" + +#: src/shar.c:912 +msgid "In shar: remaining size %ld\n" +msgstr "I shar: kvarvarande storlek %ld\n" + +#. Change to another file. +#: src/shar.c:923 src/shar.c:1307 +msgid "Newfile, remaining %ld, " +msgstr "Ny fil, återstår %ld," + +#: src/shar.c:924 src/shar.c:1308 +msgid "Limit still %d\n" +msgstr "Begränsningen är fortfarande %d\n" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "restore of" +msgstr "återskapning av" + +#: src/shar.c:940 src/shar.c:1317 src/shar.c:1506 src/shar.c:1524 +msgid "failed" +msgstr "misslyckades" + +#: src/shar.c:941 src/shar.c:1327 +msgid "End of part" +msgstr "Slut på arkivdel" + +#: src/shar.c:942 src/shar.c:1328 +msgid "continue with part" +msgstr "fortsätt med arkivdel" + +#: src/shar.c:955 src/shar.c:1418 +msgid "Starting file %s\n" +msgstr "Påbörjar filen %s\n" + +#: src/shar.c:990 +msgid "empty" +msgstr "tom" + +#: src/shar.c:991 +msgid "(empty)" +msgstr "(tom)" + +#: src/shar.c:1015 +msgid "Cannot open file %s" +msgstr "Filen %s kunde inte öppnas" + +#: src/shar.c:1052 +msgid "compressed" +msgstr "komprimerad" + +#: src/shar.c:1053 +msgid "gzipped" +msgstr "skapad av gzip" + +#: src/shar.c:1053 +msgid "binary" +msgstr "binär" + +#: src/shar.c:1054 +msgid "(compressed)" +msgstr "(komprimerad)" + +#: src/shar.c:1055 +msgid "(gzipped)" +msgstr "(skapad av gzip)" + +#: src/shar.c:1056 +msgid "(binary)" +msgstr "(binär)" + +#: src/shar.c:1069 +msgid "Could not fork" +msgstr "Kunde inte skapa ny process" + +#: src/shar.c:1074 src/shar.c:1126 +msgid "File %s (%s)" +msgstr "Fil %s (%s)" + +#: src/shar.c:1120 +msgid "text" +msgstr "text" + +#: src/shar.c:1121 +msgid "(text)" +msgstr "(text)" + +#: src/shar.c:1167 +msgid "overwriting" +msgstr "skriver över" + +#: src/shar.c:1168 +msgid "overwrite" +msgstr "skriva över" + +#: src/shar.c:1169 +msgid "[no, yes, all, quit] (no)?" +msgstr "[nej (n), ja (y), alla (a), avsluta (q)] (nej)?" + +#: src/shar.c:1170 +msgid "extraction aborted" +msgstr "återskapandet avbryts" + +#: src/shar.c:1171 src/shar.c:1176 +msgid "SKIPPING" +msgstr "HOPPAR ÖVER" + +#: src/shar.c:1176 +msgid "(file already exists)" +msgstr "(filen existerar)" + +#: src/shar.c:1194 +msgid "Saving %s (%s)" +msgstr "Sparar %s (%s)" + +#: src/shar.c:1199 +msgid "extracting" +msgstr "extraherar" + +#: src/shar.c:1333 +msgid "End of" +msgstr "Slut på" + +#: src/shar.c:1334 +msgid "archive" +msgstr "arkiv" + +#: src/shar.c:1335 +msgid "part" +msgstr "del" + +#: src/shar.c:1337 src/shar.c:1443 +msgid "File" +msgstr "Fil" + +#: src/shar.c:1338 +msgid "is continued in part" +msgstr "fortsätter i arkivdel" + +#: src/shar.c:1398 +msgid "Please unpack part 1 first!" +msgstr "Var vänlig packa upp arkivdel 1 först!" + +#: src/shar.c:1415 +msgid "STILL SKIPPING" +msgstr "FORTSÄTTER ATT HOPPA ÖVER" + +#: src/shar.c:1422 +msgid "continuing file" +msgstr "fortsätter med fil" + +#: src/shar.c:1443 +msgid "is complete" +msgstr "är komplett" + +#: src/shar.c:1452 +msgid "uudecoding file" +msgstr "uudecodar fil" + +#: src/shar.c:1466 +msgid "uncompressing file" +msgstr "dekomprimerar fil" + +#: src/shar.c:1477 +msgid "gunzipping file" +msgstr "gunzippar fil" + +#: src/shar.c:1539 +msgid "MD5 check failed" +msgstr "MD5 kontrollen misslyckades" + +#: src/shar.c:1580 +msgid "original size" +msgstr "ursprunglig storlek" + +#: src/shar.c:1581 +msgid "current size" +msgstr "aktuell storlek" + +#: src/shar.c:1630 +msgid "Opening `%s'" +msgstr "Öppnar `%s'" + +#: src/shar.c:1641 +msgid "Closing `%s'" +msgstr "Stänger `%s'" + +#: src/shar.c:1653 src/unshar.c:302 src/uudecode.c:370 src/uuencode.c:211 +msgid "Try `%s --help' for more information.\n" +msgstr "Gör `%s --help' för ytterligare information.\n" + +#: src/shar.c:1657 src/unshar.c:306 +msgid "Usage: %s [OPTION]... [FILE]...\n" +msgstr "Användning: %s [FLAGGA]... [FIL]...\n" + +#: src/shar.c:1658 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Obligatoriska argument för långa flaggor är obligatoriska även för korta.\n" + +#: src/shar.c:1661 +msgid "" +"\n" +"Giving feedback:\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +" -q, --quiet, --silent do not output verbose messages locally\n" +"\n" +"Selecting files:\n" +" -p, --intermix-type allow -[BTzZ] in file lists to change mode\n" +" -S, --stdin-file-list read file list from standard input\n" +"\n" +"Splitting output:\n" +" -o, --output-prefix=PREFIX output to file PREFIX.01 through PREFIX.NN\n" +" -l, --whole-size-limit=SIZE split archive, not files, to SIZE kilobytes\n" +" -L, --split-size-limit=SIZE split archive, or files, to SIZE kilobytes\n" +msgstr "" +"\n" +"Välja information:\n" +" --help visa denna hjälp text och terminera\n" +" --version visa version på programmet och terminera\n" +" -q, --quiet, --silent använd inte pratglada meddelanden lokalt\n" +"\n" +"Välja filer:\n" +" -p, --intermix-type tillåt -[BTzZ] i fillistor för att ändra lagring\n" +" -S, --stdin-file-list läs fillista från standard in\n" +"\n" +"Dela arkivet:\n" +" -o, --output-prefix=PREFIX gör filerna PREFIX.01 till PREFIX.NN\n" +" -l, --whole-size-limit=STORLEK dela arkivet i STORLEK kbytes bitar,\n" +" individuella filer delas inte\n" +" -L, --split-size-limit=STORLEK som ovan, individuella filer delas\n" + +#: src/shar.c:1677 +msgid "" +"\n" +"Controlling the shar headers:\n" +" -n, --archive-name=NAME use NAME to document the archive\n" +" -s, --submitter=ADDRESS override the submitter name\n" +" -a, --net-headers output Submitted-by: & Archive-name: headers\n" +" -c, --cut-mark start the shar with a cut line\n" +"\n" +"Selecting how files are stocked:\n" +" -M, --mixed-uuencode dynamically decide uuencoding (default)\n" +" -T, --text-files treat all files as text\n" +" -B, --uuencode treat all files as binary, use uuencode\n" +" -z, --gzip gzip and uuencode all files\n" +" -g, --level-for-gzip=LEVEL pass -LEVEL (default 9) to gzip\n" +" -Z, --compress compress and uuencode all files\n" +" -b, --bits-per-code=BITS pass -bBITS (default 12) to compress\n" +msgstr "" +"\n" +"Kontroll av fält i arkivhuvudet:\n" +" -n, --archive-name=NAMN använd NAMN för att dokumentera arkivet\n" +" -s, --submitter=ADRESS ange explicit adress för arkiv inlämnaren\n" +" -a, --net-headers lägg in Submitted-by: och Archive-name:\n" +" -c, --cut-mark börja arkivet med en `cut' rad\n" +"\n" +"Kontroll av hur filer lagras:\n" +" -M, --mixed-uuencode avgör dynamiskt om uuencode behövs\n" +" (standard värde: på)\n" +" -T, --text-files behandla alla filer som text\n" +" -B, --uuencode behandla alla filer som binär data,\n" +" använd uuencode\n" +" -z, --gzip kör gzip och uuencode på alla filer\n" +" -g, --level-for-gzip=NIVÅ ge flaggan -NIVÅ till gzip\n" +" (standard värde: 9)\n" +" -Z, --compress kör compress och uuencode på alla filer\n" +" -b, --bits-per-code=BITAR ge flaggan -bBITAR till compress\n" +" (standard värde: 12)\n" + +#: src/shar.c:1694 +msgid "" +"\n" +"Protecting against transmission:\n" +" -w, --no-character-count do not use `wc -c' to check size\n" +" -D, --no-md5-digest do not use `md5sum' digest to verify\n" +" -F, --force-prefix force the prefix character on every line\n" +" -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n" +"\n" +"Producing different kinds of shars:\n" +" -V, --vanilla-operation produce very simple and undemanding shars\n" +" -P, --no-piping exclusively use temporary files at unshar time\n" +" -x, --no-check-existing blindly overwrite existing files\n" +" -X, --query-user ask user before overwriting files (not for Net)\n" +" -m, --no-timestamp do not restore file modification dates & times\n" +" -Q, --quiet-unshar avoid verbose messages at unshar time\n" +" -f, --basename restore in one directory, despite hierarchy\n" +" --no-i18n do not produce internationalized shell script\n" +msgstr "" +"\n" +"Skydd mot överföringsfel:\n" +" -w, --no-character-count använd inte `wc -c' för att kolla storleken\n" +" -D, --no-md5-digest använd inte `md5sum' för kontroll\n" +" -F, --force-prefix skriv prefixtecknet på alla rader\n" +" -d, --here-delimiter=STRÄNG skilj filer åt i arkivet med STRÄNG\n" +"\n" +"Olika typer av hell arkiv:\n" +" -V, --vanilla-operation gör enkla arkiv som använder få kommandon\n" +" -P, --no-piping använd alltid temorärfiler vid uppackning\n" +" -x, --no-check-existing skriv över existerande filer vid uppackning\n" +" -X, --query-user fråga uppackaren om filer ska skrivas över\n" +" (inte för arkiv till nätet)\n" +" -m, --no-timestamp återskapa inte filers modifieringstid\n" +" -Q, --quiet-unshar undvik pratglada meddelanden vid uppackning\n" +" -f, --basename packa upp filer i en filkatalog, oavsett hierarki\n" +" --no-i18n skapa inte internationaliserade shell arkiv\n" + +#: src/shar.c:1712 +msgid "" +"\n" +"Option -o is required with -l or -L, option -n is required with -a.\n" +"Option -g implies -z, option -b implies -Z.\n" +msgstr "" +"\n" +"Flaggan -o krävs tillsammans med -l eller -L,\n" +"flaggan -n krävs tillsammans med -a.\n" +"Flaggan -g medför -z, flaggan -b medför -Z.\n" + +#: src/shar.c:1798 +msgid "DEBUG was not selected at compile time" +msgstr "DEBUG valdes inte när programmet kompilerades" + +#: src/shar.c:1819 +msgid "Hard limit %dk\n" +msgstr "Hård begränsning på %dk\n" + +#: src/shar.c:1886 +msgid "Soft limit %dk\n" +msgstr "Mjuk begränsning på %dk\n" + +#: src/shar.c:1987 +msgid "WARNING: No user interaction in vanilla mode" +msgstr "VARNING: Ingen användar interaktion i `vanilla' läge" + +#: src/shar.c:1998 +msgid "WARNING: Non-text storage options overridden" +msgstr "VARNING: Lagrings flaggor för icke text åsidosatta" + +#: src/shar.c:2054 +msgid "No input files" +msgstr "Inga in filer" + +#: src/shar.c:2060 +msgid "Cannot use -a option without -n" +msgstr "Flaggan -a kan inte användas utan -n" + +#: src/shar.c:2066 +msgid "Cannot use -l or -L option without -o" +msgstr "Flaggan -l eller -L kan inte användas utan -o" + +#: src/shar.c:2078 +msgid "PLEASE avoid -X shars on Usenet or public networks" +msgstr "Vänligen undvik -X för shell arkiv som ska till Usenet eller offentliga nätverk" + +#: src/shar.c:2119 +msgid "You have unpacked the last part" +msgstr "Du har packat upp den sista arkivdelen" + +#: src/shar.c:2121 +msgid "Created %d files\n" +msgstr "Skapade %d filer\n" + +#: src/unshar.c:158 +msgid "Found no shell commands in %s" +msgstr "Hittade inga shell kommandon i %s" + +#: src/unshar.c:174 +msgid "%s looks like raw C code, not a shell archive" +msgstr "%s ser ut som C kod, inte som ett shell arkiv" + +#: src/unshar.c:210 +msgid "Found no shell commands after `cut' in %s" +msgstr "Hittade inga shell kommandon efter `cut' i %s" + +#: src/unshar.c:231 +msgid "%s is probably not a shell archive" +msgstr "%s är förmodligen inte ett shell arkiv" + +#: src/unshar.c:232 +msgid "The `cut' line was followed by: %s" +msgstr "`cut' raden följdes av: %s" + +#: src/unshar.c:258 +msgid "Starting `sh' process" +msgstr "Startar en `sh' process" + +#: src/unshar.c:307 +msgid "" +"Mandatory arguments to long options are mandatory for short options too.\n" +"\n" +" -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n" +" -c, --overwrite pass -c to shar script for overwriting files\n" +" -e, --exit-0 same as `--split-at=\"exit 0\"'\n" +" -E, --split-at=STRING split concatenated shars after STRING\n" +" -f, --force same as `-c'\n" +" --help display this help and exit\n" +" --version output version information and exit\n" +"\n" +"If no FILE, standard input is read.\n" +msgstr "" +"Obligatoriska argument för långa flaggor är obligatoriska även för korta.\n" +"\n" +" -d, --directory=FILKATALOG gå till FILKATALOG före uppackning\n" +" -c, --overwrite ge -c flaggan till arkivet för överskrivning\n" +" -e, --exit-0 samma sak som `--split-at=\"exit 0\"'\n" +" -E, --split-at=STRÄNG dela upp ihoplagda arkiv vid STRÄNG\n" +" -f, --force samma sak som `-c'\n" +" --help visa denna hjälp text och terminera\n" +" --version visa version på programmet och terminera\n" +"\n" +"Om ingen FIL ges så läses standard in.\n" + +#: src/unshar.c:384 +msgid "Cannot chdir to `%s'" +msgstr "Kan inte byta till filkatalog `%s'" + +#: src/unshar.c:441 +msgid "standard input" +msgstr "standard in" + +#: src/uudecode.c:98 src/uudecode.c:196 +msgid "%s: Short file" +msgstr "%s: Trunkerad fil" + +#: src/uudecode.c:141 +msgid "%s: No `end' line" +msgstr "%s: `end' rad saknas" + +#: src/uudecode.c:205 +msgid "%s: data following `=' padding character" +msgstr "%s: det finns data efter utfyllnadstecknet `=' " + +#: src/uudecode.c:229 src/uudecode.c:237 src/uudecode.c:251 +msgid "%s: illegal line" +msgstr "%s: felaktig rad" + +#: src/uudecode.c:289 +msgid "%s: No `begin' line" +msgstr "%s: `begin' rad saknas" + +#: src/uudecode.c:321 +msgid "%s: Illegal ~user" +msgstr "%s: Otillåten ~user" + +#: src/uudecode.c:328 +msgid "%s: No user `%s'" +msgstr "%s: Det finns ingen användare `%s'" + +#: src/uudecode.c:374 +msgid "Usage: %s [FILE]...\n" +msgstr "Användning: %s [FILER]...\n" + +#: src/uudecode.c:375 +msgid "" +"Mandatory arguments to long options are mandatory to short options too.\n" +" -h, --help display this help and exit\n" +" -v, --version output version information and exit\n" +" -o, --output-file=FILE direct output to FILE\n" +msgstr "" +"Obligatoriska argument för långa flaggor är obligatoriska även för korta.\n" +" -h, --help visa denna hjälp text och terminera\n" +" -v, --version visa version på programmet och terminera\n" +" -o, --output-file=FIL skriv resultatet till FIL\n" + +#: src/uuencode.c:198 +msgid "Read error" +msgstr "Fel vid läsning" + +#: src/uuencode.c:215 +msgid "Usage: %s [INFILE] REMOTEFILE\n" +msgstr "Användning: %s [LOKAL_FIL] ICKE_LOKAL_FIL\n" + +#: src/uuencode.c:216 +msgid "" +"\n" +" -h, --help display this help and exit\n" +" -m, --base64 use base64 encoding as of RFC1521\n" +" -v, --version output version information and exit\n" +msgstr "" +"\n" +" -h, --help visa denna hjälp text och terminera\n" +" -m, --base64 använd base64 kodning enligt RFC1521\n" +" -v, --version visa version på programmet och terminera\n" + +#: src/uuencode.c:297 +msgid "Write error" +msgstr "Skriv fel" diff --git a/src/apps/bin/sharutils-4.2.1/src/ChangeLog b/src/apps/bin/sharutils-4.2.1/src/ChangeLog new file mode 100644 index 0000000000..48ad42ba2f --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/ChangeLog @@ -0,0 +1,248 @@ +Sun Dec 3 01:21:14 1995 Ulrich Drepper + + * shar.c (shar): Be consistent in use of || at end of beginning of + line. + +Thu Nov 30 03:04:03 1995 Ulrich Drepper + + * uudecode.c (read_base64) [b64_tab]: Initialize with \177 instead + of 177. Reported by Nelson Beebe. + +Mon Nov 27 19:01:03 1995 Jim Meyering + + * uudecode.c: + Remove unused variable and correctly use `unsigned char'. + +Sun Nov 26 11:45:53 1995 Bill Aten + + * shar.c (shar): Add missing line continuation. + +Sun Nov 26 00:16:08 1995 Ulrich Drepper + + * remsync.in: Correctly implement --help and --version. + + * mail-files.in: Implement --help and --version. + Prevent mail from handling non-existing files. + +Sat Nov 25 23:43:11 1995 Ulrich Drepper + + * mailshar.in: Remove temp files even when mail-files fails. + + * mailshar.in: Introduce prefix variable. + + * mailshar.in: Only try to remove intermediate files when previous + command succeeded. Correctly exit with status 1 if error occured. + + * mailshar.in (bindir, transform): Quote arguments. + + * Makefile.in (all): Add SCRIPTS. + (mailshar, mail-files, remsync): Add rules for rebuilding if source + or ../config.status changed. + + * mailshar.in: + We know where shar and mail-files are found. Call using $bindir. + + * mailshar.in: Only run mail-files if shar successfully ended. + + * mailshar.in: + Implement --help and --version option. Reported by Tom Tromey. + + * Makefile.in (install-exec): Remove trailing ;. + + * Makefile.in (clean): + Don't remove mailshar, mail-files, adn remsync. Do it in + distclean instead. + +Tue Nov 21 16:28:02 1995 Ulrich Drepper + + * encode.c, uudecode.c, uuencode.c, unshar.c, shar.c: + DeANSIfy function definitions. + +Sat Nov 18 16:55:14 1995 Ulrich Drepper + + * shar.c (walkdown): Don't use malloc. Alloc is better here. + +Thu Nov 16 21:14:12 1995 Ulrich Drepper + + * shar.c (shar): + Make produced shar catch faulty md5sum program in textutils-1.12. + +Tue Nov 7 13:51:28 1995 Ulrich Drepper + + * Makefile.in (mostlyclean): + Don't try to remove ansi2knr generated files anymore. + We have none. + + * Makefile.in (clean): Remove remsync, mailshar, and mail-files. + +Sun Nov 5 23:59:58 1995 Ulrich Drepper + + * Makefile.in (INSTALL_PROGRAM): Do not specify mode. + +Sun Nov 5 20:24:52 1995 Ulrich Drepper + + * shar.c: Rename _N to N_. + + * Makefile.in: + (INSTALL_SCRIPT) New variable. Names command used to install scripts. + +Sun Nov 5 13:40:32 1995 Ulrich Drepper + + * Makefile.in (dist): Suppress error message when ln failed. + + * shar.c: Use _N instead of _C due to last change in GNU gettext. + +Fri Nov 3 00:39:23 1995 Ulrich Drepper + + * shar.c: Replace __GTM by _C according to change in gettext-0.9.7. + +Tue Oct 31 01:19:18 1995 Ulrich Drepper + + * Makefile.in: + Remove ansi2knr stuff. The source now compile without this. + + * shar.c (shar): + While detecting md5sum do not use -h option. md5sum in + textutils-1.13 does not have this option anymore. Use --help instead. + Though this option is not present in the Plumb/Lankester version this + program still gives you the complate usage message and so it still + works. + +Sun Oct 29 12:05:22 1995 Ulrich Drepper + + * Makefile.in (SCRIPTS): + New variable containing of scripts to be installed. + (install-exec): Also install scripts. + +Sat Oct 28 01:36:45 1995 Ulrich Drepper + + * shar.c (shar): Correct output for MD5 if/then/else. + (main): Call get_submitter with NULL argument. + Remove fixed limit for number of file names read from stdin. + +Fri Oct 27 02:19:27 1995 Ulrich Drepper + + * shar.c (shar): Better redirection code in shar file. Patch by + Christian von Roques. + + * unshar.c: Make -f/--force synonym for -c option. This is more + intuitive and more conformant to the GNU coding standard. + Suggested by Karl Berry. + + * shar.c: Make -c option to shar script really force creation of + file. Reported by Karl Berry. + +Tue Sep 26 00:29:26 1995 Ulrich Drepper + + * Makefile.in (LIBS): + Undid last change. On some systems libintl.a is not + completely self-contained. alloca() is missing e.g. on HP-UX. + +Mon Sep 25 21:27:30 1995 Ulrich Drepper + + * shar.c (main): + When not using GNU gettext don't provide --print-text-dom-dir option. + +Sun Sep 24 00:08:14 1995 Ulrich Drepper + + * unshar.c (unarchive_shar_file): + Replace byte processing loop by fread/fwrite loop. + +Sat Sep 23 20:53:25 1995 Ulrich Drepper + + * unshar.c (starting_with): Oops. Fatal bug :-). Forgot the == 0. + +Sat Sep 23 14:08:14 1995 Ulrich Drepper + + * shar.c: + Implement MD5 check. If the md5sum program is available at *unpack* + time this now provides a much better security. + + * Makefile.in (LIBS): + After change to latest libintl.a we don't need to link with libshar.a + twice. + +Fri Sep 22 23:06:24 1995 Ulrich Drepper + + * unshar.c: Fix typo in comment. + + * unshar.c (starting_with): + Remove function definition. A simple call to memcmp is + necessary. + + * unshar.c (main): Make version string more regular. + + * unshar.c (main): Replace strcat cascades with stpcpy. + + * uudecode.c: + Implement base64 decoding and `-o' option from POSIX.2b/Draft 11. + + * uuencode.c (main): Program version output written in canonical form. + +Thu Sep 21 22:07:13 1995 Ulrich Drepper + + * uuencode.c: Implement base64 encoding. + + * shar.c (main): + When NLS is disabled --print-text-dom-dir option must not refernce + _NL_DEFAULT_DIRNAME variable from dcgettext.c. + Reported by Gordon Joly . + + * shar.c (CHARACTER_COUNT_COMMAND): Internationalized wc commands + might count multi-byte characters when a appropriate locale is + set. Reset all locales explicitly. Report by Kaz Sasayama + . + +Wed Sep 20 23:54:02 1995 Ulrich Drepper + + * shar.c (generate_full_header): + Mention mkdir program as always necessary. + (main): If vanilla shar is selected don't use internationalization. + Reported by Jan Djarv. + +Fri Aug 18 12:06:16 1995 Ulrich Drepper + + * shar.c (generate_configure): + Use -s unstead of --shell-script as argument to + gettext. + + * shar.c (usage): Fix typo: internationlaized -> internationalized. + Reported by Franc,ois Pinard. + +Thu Aug 17 23:54:36 1995 Ulrich Drepper + + * shar.c: + Don't use `getpid' all the time. This leads to problems with fork'ed + processes. Instead determine the number once at the beginning. + (sharpid): New variable. + + * shar.c (shar): + Add a ! character after $shar_count string in error message because + this string may be empty if some error occured. + +Tue Aug 15 16:49:05 1995 Ulrich Drepper + + * Makefile.in (dist): Remove `copying instead' message. + +Sun Aug 13 23:29:27 1995 Ulrich Drepper + + * shar.c: Change shar script to use lock directory. + + * shar.c: Now produces internationalized shar archives. + +Wed Aug 9 21:54:56 1995 Ulrich Drepper + + * Makefile.in (ID, TAGS): Don't use $^. + + * shar.c: Add --no-i18n option. + +Tue Aug 8 01:44:11 1995 Ulrich Drepper + + * shar.c: + Implement --print-text-domain-dir option. This is required by the + internationalized shell scripts. + +Thu Aug 3 00:13:10 1995 Ulrich Drepper + + * Makefile.in: Initial revision. + diff --git a/src/apps/bin/sharutils-4.2.1/src/Jamfile b/src/apps/bin/sharutils-4.2.1/src/Jamfile new file mode 100644 index 0000000000..8fc0ed1f17 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/Jamfile @@ -0,0 +1,15 @@ +SubDir OBOS_TOP src apps bin sharutils-4.2.1 src ; + +SubDirCcFlags += -I ../lib -DHAVE_CONFIG_H -DLOCALEDIR=\'\"/share/locale\"\' ; + +BinCommand shar : + shar.c encode.c : root libsharutils.a ; + +BinCommand unshar : + unshar.c : root libsharutils.a ; + +BinCommand uuencode : + uuencode.c : root libsharutils.a ; + +BinCommand uudecode : + uudecode.c : root libsharutils.a ; diff --git a/src/apps/bin/sharutils-4.2.1/src/Makefile b/src/apps/bin/sharutils-4.2.1/src/Makefile new file mode 100644 index 0000000000..3401b85d85 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/Makefile @@ -0,0 +1,155 @@ +# Generated automatically from Makefile.in by configure. +# Makefile for program source directory in GNU Shar utilities package. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = sharutils +VERSION = 4.2.1 +PROGRAMS = shar unshar uudecode uuencode +SCRIPTS = mailshar mail-files remsync + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} +transform = s,x,x, +bindir = $(exec_prefix)/bin +datadir = $(prefix)/share +localedir = $(datadir)/locale +subdir = src + +AR = ar +CC = gcc +INSTALL = /bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} -m 755 +RANLIB = ranlib + +DEFS = -DLOCALEDIR=\"$(localedir)\" -DHAVE_CONFIG_H +LIBS = ../lib/libshar.a ../intl/libintl.a ../lib/libshar.a +CFLAGS = -g -O +CPPFLAGS = +LDFLAGS = + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) +LINK = $(CC) $(LDFLAGS) -o $@ + +SOURCES = shar.c unshar.c uudecode.c uuencode.c +OBJECTS = shar.o unshar.o uudecode.o uuencode.o +COMSRCS = encode.c +COMOBJS = encode.o +DISTFILES = ChangeLog Makefile.in mail-files.in mailshar.in remsync.in \ +$(SOURCES) $(COMSRCS) + +.SUFFIXES: +.SUFFIXES: .c .o +.c.o: + $(COMPILE) $< + +INCLUDES = -I$(srcdir) -I.. -I$(top_srcdir)/lib -I../intl -I$(top_srcdir)/intl + +all: $(PROGRAMS) $(SCRIPTS) + + +shar: shar.o + $(LINK) shar.o $(COMOBJS) $(LIBS) + +unshar: unshar.o + $(LINK) unshar.o $(LIBS) + +uudecode: uudecode.o + $(LINK) uudecode.o $(LIBS) + +uuencode: uuencode.o + $(LINK) uuencode.o $(LIBS) + + +$(PROGRAMS): ../lib/libshar.a ../intl/libintl.a +shar: $(COMOBJS) + +$(OBJECTS) $(COMOBJS): ../config.h ../lib/system.h + +install: install-exec install-data +install-exec: all + $(top_srcdir)/mkinstalldirs $(bindir) + for name in $(PROGRAMS); do \ + $(INSTALL_PROGRAM) $$name \ + $(bindir)/`echo $$name | sed '$(transform)'`; \ + done; + for name in $(SCRIPTS); do \ + $(INSTALL_SCRIPT) $$name \ + $(bindir)/`echo $$name | sed '$(transform)'`; \ + done +install-data: + +uninstall: + for name in $(PROGRAMS); do \ + rm -f $(bindir)/`echo $$name | sed '$(transform)'`; \ + done + +check: all + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(COMSRCS) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS \ + $(HEADERS) $(SOURCES) $(COMSRCS) + +id: ID + +ID: $(HEADERS) $(SOURCES) $(COMSRCS) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID \ + $(HEADERS) $(SOURCES) $(COMSRCS) + +mostlyclean: + rm -f *.o core core.* + +clean: mostlyclean + rm -f shar unshar uudecode uuencode + +distclean: clean + rm -f Makefile ID TAGS + rm -f mailshar mail-files remsync + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +mailshar: $(srcdir)/mailshar.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +mail-files: $(srcdir)/mail-files.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +remsync: $(srcdir)/remsync.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/src/Makefile.in b/src/apps/bin/sharutils-4.2.1/src/Makefile.in new file mode 100644 index 0000000000..f1229bcee5 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/Makefile.in @@ -0,0 +1,155 @@ +# Makefile for program source directory in GNU Shar utilities package. +# Copyright (C) 1995 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +PROGRAMS = @PROGRAMS@ +SCRIPTS = mailshar mail-files remsync + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +transform = @program_transform_name@ +bindir = $(exec_prefix)/bin +datadir = $(prefix)/@DATADIRNAME@ +localedir = $(datadir)/locale +subdir = src + +AR = ar +CC = @CC@ +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +RANLIB = @RANLIB@ + +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ +LIBS = ../lib/libshar.a @INTLLIBS@ ../lib/libshar.a @LIBS@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) +LINK = $(CC) $(LDFLAGS) -o $@ + +SOURCES = shar.c unshar.c uudecode.c uuencode.c +OBJECTS = shar.o unshar.o uudecode.o uuencode.o +COMSRCS = encode.c +COMOBJS = encode.o +DISTFILES = ChangeLog Makefile.in mail-files.in mailshar.in remsync.in \ +$(SOURCES) $(COMSRCS) + +.SUFFIXES: +.SUFFIXES: .c .o +.c.o: + $(COMPILE) $< + +INCLUDES = -I$(srcdir) -I.. -I$(top_srcdir)/lib -I../intl -I$(top_srcdir)/intl + +all: $(PROGRAMS) $(SCRIPTS) + + +shar: shar.o + $(LINK) shar.o $(COMOBJS) $(LIBS) + +unshar: unshar.o + $(LINK) unshar.o $(LIBS) + +uudecode: uudecode.o + $(LINK) uudecode.o $(LIBS) + +uuencode: uuencode.o + $(LINK) uuencode.o $(LIBS) + + +$(PROGRAMS): ../lib/libshar.a @INTLDEPS@ +shar: $(COMOBJS) + +$(OBJECTS) $(COMOBJS): ../config.h ../lib/system.h + +install: install-exec install-data +install-exec: all + $(top_srcdir)/mkinstalldirs $(bindir) + for name in $(PROGRAMS); do \ + $(INSTALL_PROGRAM) $$name \ + $(bindir)/`echo $$name | sed '$(transform)'`; \ + done; + for name in $(SCRIPTS); do \ + $(INSTALL_SCRIPT) $$name \ + $(bindir)/`echo $$name | sed '$(transform)'`; \ + done +install-data: + +uninstall: + for name in $(PROGRAMS); do \ + rm -f $(bindir)/`echo $$name | sed '$(transform)'`; \ + done + +check: all + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(COMSRCS) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS \ + $(HEADERS) $(SOURCES) $(COMSRCS) + +id: ID + +ID: $(HEADERS) $(SOURCES) $(COMSRCS) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID \ + $(HEADERS) $(SOURCES) $(COMSRCS) + +mostlyclean: + rm -f *.o core core.* + +clean: mostlyclean + rm -f shar unshar uudecode uuencode + +distclean: clean + rm -f Makefile ID TAGS + rm -f mailshar mail-files remsync + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +Makefile: Makefile.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +mailshar: $(srcdir)/mailshar.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +mail-files: $(srcdir)/mail-files.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +remsync: $(srcdir)/remsync.in ../config.status + cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + +# 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: diff --git a/src/apps/bin/sharutils-4.2.1/src/config.h b/src/apps/bin/sharutils-4.2.1/src/config.h new file mode 100644 index 0000000000..87548e008a --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/config.h @@ -0,0 +1,220 @@ +/* config.h. Generated automatically by configure. */ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define 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 + +/* Define if using alloca.c. */ +/* #undef C_ALLOCA */ + +/* Define if type char is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +/* #undef __CHAR_UNSIGNED__ */ +#endif + +/* Define if the closedir function returns void instead of int. */ +/* #undef CLOSEDIR_VOID */ + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* 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 if you have alloca, as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define if you have and it should be used (not on Ultrix). */ +#define HAVE_ALLOCA_H 1 + +/* Define if you don't have vprintf but do have _doprnt. */ +/* #undef HAVE_DOPRNT */ + +/* Define if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define if you have the strftime function. */ +#define HAVE_STRFTIME 1 + +/* Define if your struct tm has tm_zone. */ +#define HAVE_TM_ZONE 1 + +/* Define if you don't have tm_zone but do have the external array + tzname. */ +/* #undef HAVE_TZNAME */ + +/* Define if you have the vprintf function. */ +#define HAVE_VPRINTF 1 + +/* Define as __inline if that's what the C compiler calls it. */ +/* #undef inline */ + +/* Define if on MINIX. */ +/* #undef _MINIX */ + +/* Define to `long' if doesn't define. */ +/* #undef off_t */ + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define if you need to in order for stat and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ + +/* 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 run-time. + 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 if the `S_IS*' macros in do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if your declares struct tm. */ +/* #undef TM_IN_SYS_TIME */ + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define if the current hostname may be found in /etc/systemid. */ +/* #undef HAVE_ETC_SYSTEMID */ + +/* Define to the name of the distribution. */ +#define PACKAGE "sharutils" + +/* Define to 1 if ANSI function prototypes are usable. */ +#define PROTOTYPES 1 + +/* Define to the version of the distribution. */ +#define VERSION "4.2.1" + +/* Define to 1 for better use of the debugging malloc library. See + site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz. */ +/* #undef WITH_DMALLOC */ + +/* Define if your locale.h file contains LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if NLS is requested. */ +//#define ENABLE_NLS 1 + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +/* #undef HAVE_CATGETS */ + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +/* #undef HAVE_GETTEXT */ + +/* Define as 1 if you have the stpcpy function. */ +#define HAVE_STPCPY 1 + +/* Define if you have the basename function. */ +/* #undef HAVE_BASENAME */ + +/* Define if you have the dcgettext function. */ +/* #undef HAVE_DCGETTEXT */ + +/* Define if you have the fchmod function. */ +/* #undef HAVE_FCHMOD */ + +/* Define if you have the getcwd function. */ +#define HAVE_GETCWD 1 + +/* Define if you have the getpagesize function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define if you have the isascii function. */ +#define HAVE_ISASCII 1 + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY 1 + +/* Define if you have the munmap function. */ +/* #undef HAVE_MUNMAP */ + +/* Define if you have the putenv function. */ +#define HAVE_PUTENV 1 + +/* Define if you have the setenv function. */ +/* #undef HAVE_SETENV */ + +/* Define if you have the setlocale function. */ +#define HAVE_SETLOCALE 1 + +/* Define if you have the stpcpy function. */ +#define HAVE_STPCPY 1 + +/* Define if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* Define if you have the strchr function. */ +#define HAVE_STRCHR 1 + +/* Define if you have the strerror function. */ +#define HAVE_STRERROR 1 + +/* Define if you have the uname function. */ +#define HAVE_UNAME 1 + +/* Define if you have the valloc function. */ +#define HAVE_VALLOC 1 + +/* Define if you have the header file. */ +#define HAVE_DIRENT_H 1 + +/* Define if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_NDIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_NL_TYPES_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_VALUES_H */ + +/* Define if you have the i library (-li). */ +/* #undef HAVE_LIBI */ + +/* Define if you have the intl library (-lintl). */ +/* #undef HAVE_LIBINTL */ diff --git a/src/apps/bin/sharutils-4.2.1/src/encode.c b/src/apps/bin/sharutils-4.2.1/src/encode.c new file mode 100644 index 0000000000..7a84c23414 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/encode.c @@ -0,0 +1,97 @@ +/* Handle so called `shell archives'. + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "system.h" + +/* Basic one-character encoding function to make a char printing. */ +#define ENCODE_BYTE(Byte) ((((Byte) + 63) & 63) + ' ' + 1) + +/* Buffer size for one line of output. */ +#define LINE_BUFFER_SIZE 45 + +/*------------------------------------------. +| Output one GROUP of three bytes on FILE. | +`------------------------------------------*/ + +static void +write_encoded_bytes (group, file) + char *group; + FILE *file; +{ + int c1, c2, c3, c4; + + c1 = group[0] >> 2; + c2 = ((group[0] << 4) & (3 << 4)) | ((group[1] >> 4) & 15); + c3 = ((group[1] << 2) & (15 << 2)) | ((group[2] >> 6) & 3); + c4 = group[2] & 63; + putc (ENCODE_BYTE (c1), file); + putc (ENCODE_BYTE (c2), file); + putc (ENCODE_BYTE (c3), file); + putc (ENCODE_BYTE (c4), file); +} + +/*--------------------------------------------------------------------. +| From FILE, refill BUFFER up to BUFFER_SIZE raw bytes, returning the | +| number of bytes read. | +`--------------------------------------------------------------------*/ + +static int +read_raw_bytes (file, buffer, buffer_size) + FILE *file; + char *buffer; + int buffer_size; +{ + int character; + int counter; + + for (counter = 0; counter < buffer_size; counter++) + { + character = getc (file); + if (character == EOF) + return counter; + buffer[counter] = character; + } + return buffer_size; +} + +/*----------------------------------------------------. +| Copy INPUT file to OUTPUT file, while encoding it. | +`----------------------------------------------------*/ + +void +copy_file_encoded (input, output) + FILE *input; + FILE *output; +{ + char buffer[LINE_BUFFER_SIZE]; + int counter; + int number_of_bytes; + + while (1) + { + number_of_bytes = read_raw_bytes (input, buffer, LINE_BUFFER_SIZE); + putc (ENCODE_BYTE (number_of_bytes), output); + + for (counter = 0; counter < number_of_bytes; counter += 3) + write_encoded_bytes (&buffer[counter], output); + putc ('\n', output); + + if (number_of_bytes == 0) + break; + } +} diff --git a/src/apps/bin/sharutils-4.2.1/src/mail-files b/src/apps/bin/sharutils-4.2.1/src/mail-files new file mode 100644 index 0000000000..6af9bdb56b --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/mail-files @@ -0,0 +1,88 @@ +#! /bin/sh +# Mail a list of files, as they are. +# Copyright (C) 1990, 1995 Free Software Foundation, Inc. +# François Pinard , 1991. + +package="sharutils" +version="4.2.1" + +progname=`echo $0 | sed -e 's,.*/,,'` + +usage="\ +Usage: $progname [OPTION] DESTIN TYPE SUBJECT FILE ... + +with OPTION in: + --help display this help and exit + --version output version information and exit + + -x trace script" + +trytext="Try \`$progname --help' for more information." + +SLEEP=2 + +### Decode the options. + +while test $# -gt 0; do + case $1 in + -x) trace=-x; set -x; shift ;; + --v* ) echo "$progname - $package $version"; exit 0 ;; + --h* ) echo "$usage"; exit 0 ;; + -) break ;; + -*) echo "$trytext"; exit 1 ;; + *) break + esac +done + +if [ $# -lt 4 ]; then + echo "Too few arguments." + echo $trytext + exit 1 +fi + +destin="$1"; shift +type="$1"; shift +subject="$1"; shift + +maxcount=$# +files="$*" + +### Mail all files, making a proper subject for each message. + +( if [ -f $destin ]; then + cat $destin + else + echo $destin + fi +) | +( total=0 + while read destin; do + count=0 + for file in $files; do + if [ ! -f $file ]; then + echo "$file not found" + continue + fi + count=`expr $count + 1` + if [ $maxcount = 1 ]; then + string="$type" + else + string="$type ($count/$maxcount)" + fi + echo "Mailing $string to $destin" + [ $total -ne 0 ] && sleep $SLEEP + /bin/mail -s "$string: $subject" $destin < $file + total=`expr $total + 1` + [ $count -lt $maxcount ] && sleep $SLEEP + done + done + if [ $total -eq 0 ]; then + echo 'No message queued' + elif [ $total -eq 1 ]; then + echo 'Message queued' + else + echo "$count messages queued" + fi +) + +exit 0 diff --git a/src/apps/bin/sharutils-4.2.1/src/mail-files.in b/src/apps/bin/sharutils-4.2.1/src/mail-files.in new file mode 100755 index 0000000000..5b9a7a24a8 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/mail-files.in @@ -0,0 +1,88 @@ +#! @SH@ +# Mail a list of files, as they are. +# Copyright (C) 1990, 1995 Free Software Foundation, Inc. +# François Pinard , 1991. + +package="@PACKAGE@" +version="@VERSION@" + +progname=`echo $0 | sed -e 's,.*/,,'` + +usage="\ +Usage: $progname [OPTION] DESTIN TYPE SUBJECT FILE ... + +with OPTION in: + --help display this help and exit + --version output version information and exit + + -x trace script" + +trytext="Try \`$progname --help' for more information." + +SLEEP=2 + +### Decode the options. + +while test $# -gt 0; do + case $1 in + -x) trace=-x; set -x; shift ;; + --v* ) echo "$progname - $package $version"; exit 0 ;; + --h* ) echo "$usage"; exit 0 ;; + -) break ;; + -*) echo "$trytext"; exit 1 ;; + *) break + esac +done + +if [ $# -lt 4 ]; then + echo "Too few arguments." + echo $trytext + exit 1 +fi + +destin="$1"; shift +type="$1"; shift +subject="$1"; shift + +maxcount=$# +files="$*" + +### Mail all files, making a proper subject for each message. + +( if [ -f $destin ]; then + cat $destin + else + echo $destin + fi +) | +( total=0 + while read destin; do + count=0 + for file in $files; do + if [ ! -f $file ]; then + echo "$file not found" + continue + fi + count=`expr $count + 1` + if [ $maxcount = 1 ]; then + string="$type" + else + string="$type ($count/$maxcount)" + fi + echo "Mailing $string to $destin" + [ $total -ne 0 ] && sleep $SLEEP + @MAILER@ -s "$string: $subject" $destin < $file + total=`expr $total + 1` + [ $count -lt $maxcount ] && sleep $SLEEP + done + done + if [ $total -eq 0 ]; then + echo 'No message queued' + elif [ $total -eq 1 ]; then + echo 'Message queued' + else + echo "$count messages queued" + fi +) + +exit 0 diff --git a/src/apps/bin/sharutils-4.2.1/src/mailshar b/src/apps/bin/sharutils-4.2.1/src/mailshar new file mode 100644 index 0000000000..43fd20b9f2 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/mailshar @@ -0,0 +1,87 @@ +#! /bin/sh +# Mail a multi-part shar from a list of files. +# Copyright (C) 1990, 1994, 1995 Free Software Foundation, Inc. +# François Pinard , 1991. + +package="sharutils" +version="4.2.1" + +prefix='/usr/local' +bindir="${prefix}/bin" +transform='s,x,x,' + +shar=$bindir/`echo shar | sed "$transform"` +mail_files=$bindir/`echo mail-files | sed "$transform"` + +progname=`echo $0 | sed -e 's,.*/,,'` + +usage="\ +Usage: $progname [OPTION...] DEST FILE ... + +with OPTION in: + --help display this help and exit + --version output version information and exit + + -s SIZE decide size of each part in Kb, default 60 + -M decide how to send each file separately + -T avoid calling compress, gzip nor uuencode + -B force calling uuencode + -z force calling gzip and uuencode + -Z force calling compress and uuencode + -x trace script + +If none of -MTBzZ are given, -z is automatically selected if *none* +of the FILEs have an .arc, .exz, .gif, .z, .gz, .Z, .zip or .zoo suffix." + +temp=/usr/tmp/$$.shar + +### Decode the options. + +size=60 + +while test $# -gt 0; do + case $1 in + -s) if test $# -gt 1; then size=$2; shift 2; + else echo "$usage"; exit 1; fi ;; + -[MTBzZ]) mode=$1; shift ;; + -x) trace=-x; set -x; shift ;; + --v* ) echo "$progname - $package $version"; exit 0 ;; + --h* ) echo "$usage"; exit 0 ;; + -) break ;; + -*) echo "Try \`$progname --help' for more information."; exit 1 ;; + *) break + esac +done + +if test $# -lt 2; then + echo "$usage" + exit 1 +fi + +dest="$1" +shift +subject="$*" + +### Check if we should gzip. + +if test -z "$mode"; then + mode=-z + find $* -type f -print 2> /dev/null > $temp + while read file; do + case "`echo $file | sed -n 's|.*/||;/\./s|.*\.||p' \ + | tr '[A-Z]' '[a-z]'`" in + arc|exz|gif|gz|z|zip|zoo) mode=; break ;; + esac + done < $temp + rm $temp +fi + +### Construct the multi-part shar files and mail them. + +$shar $mode -P -L$size -o$temp -c -F $* \ + && $mail_files $trace $dest shar "$subject" $temp* \ + && rm ${temp}* \ + && exit 0 + +rm -f ${temp}* +exit 1 diff --git a/src/apps/bin/sharutils-4.2.1/src/mailshar.in b/src/apps/bin/sharutils-4.2.1/src/mailshar.in new file mode 100755 index 0000000000..1dd1f0b9b7 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/mailshar.in @@ -0,0 +1,87 @@ +#! @SH@ +# Mail a multi-part shar from a list of files. +# Copyright (C) 1990, 1994, 1995 Free Software Foundation, Inc. +# François Pinard , 1991. + +package="@PACKAGE@" +version="@VERSION@" + +prefix='@prefix@' +bindir="@exec_prefix@/bin" +transform='@program_transform_name@' + +shar=$bindir/`echo shar | sed "$transform"` +mail_files=$bindir/`echo mail-files | sed "$transform"` + +progname=`echo $0 | sed -e 's,.*/,,'` + +usage="\ +Usage: $progname [OPTION...] DEST FILE ... + +with OPTION in: + --help display this help and exit + --version output version information and exit + + -s SIZE decide size of each part in Kb, default 60 + -M decide how to send each file separately + -T avoid calling compress, gzip nor uuencode + -B force calling uuencode + -z force calling gzip and uuencode + -Z force calling compress and uuencode + -x trace script + +If none of -MTBzZ are given, -z is automatically selected if *none* +of the FILEs have an .arc, .exz, .gif, .z, .gz, .Z, .zip or .zoo suffix." + +temp=/usr/tmp/$$.shar + +### Decode the options. + +size=60 + +while test $# -gt 0; do + case $1 in + -s) if test $# -gt 1; then size=$2; shift 2; + else echo "$usage"; exit 1; fi ;; + -[MTBzZ]) mode=$1; shift ;; + -x) trace=-x; set -x; shift ;; + --v* ) echo "$progname - $package $version"; exit 0 ;; + --h* ) echo "$usage"; exit 0 ;; + -) break ;; + -*) echo "Try \`$progname --help' for more information."; exit 1 ;; + *) break + esac +done + +if test $# -lt 2; then + echo "$usage" + exit 1 +fi + +dest="$1" +shift +subject="$*" + +### Check if we should gzip. + +if test -z "$mode"; then + mode=-z + find $* -type f -print 2> /dev/null > $temp + while read file; do + case "`echo $file | sed -n 's|.*/||;/\./s|.*\.||p' \ + | tr '[A-Z]' '[a-z]'`" in + arc|exz|gif|gz|z|zip|zoo) mode=; break ;; + esac + done < $temp + rm $temp +fi + +### Construct the multi-part shar files and mail them. + +$shar $mode -P -L$size -o$temp -c -F $* \ + && $mail_files $trace $dest shar "$subject" $temp* \ + && rm ${temp}* \ + && exit 0 + +rm -f ${temp}* +exit 1 diff --git a/src/apps/bin/sharutils-4.2.1/src/remsync b/src/apps/bin/sharutils-4.2.1/src/remsync new file mode 100644 index 0000000000..fd85b46ec1 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/remsync @@ -0,0 +1,2178 @@ +#! /boot/home/config/bin/perl +# Generated automatically from remsync.in by configure. +eval "exec /boot/home/config/bin/perl -S $0 $*" + if $running_under_some_shell; + +# Synchronization tool for remote directories. +# Copyright (C) 1994 Free Software Foundation, Inc. +# François Pinard , 1994. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Parameters, but not meant to be changed. + +$PACKAGE = "sharutils"; # name of package for this program +$VERSION = "4.2.1"; # version number for the whole package +$PROGRAM = "remsync"; # name of this particular program +$FORMAT = "1.3"; # version of format for files + +$CONFIG = ".remsync"; # file containing synchronization information +$ARCHIVE = ".remsync.tar.gz"; # default file name of packed synchro. package +$WORKDIR = ".remsync-work"; # directory name of unpacked synchro. package +$ORDERS = "orders"; # file name containaing synchro. directives + +$DIFF = "/bin/diff"; # GNU diff path +$TAR = "/bin/tar"; # GNU tar path +$SH = "/bin/sh"; # Bash or sh path + +# Special constants. + +$NEWLY_CREATED_SCAN = 2; # Instead of 1, when by remote request + +# Help strings. + +$INITIAL_HELP = "$PROGRAM (format $FORMAT) - GNU $PACKAGE $VERSION + Remote synchronization of files and directories. + +The following commands are available at *any* \`$PROGRAM\' prompt: + + ? reminder for available commands + ! [COMMAND] shell escape for processing COMMAND + abort get out of the current command right away +"; + +$NORMAL_HELP = "Usage: $PROGRAM [COMMANDS...] + + ! [COMMAND] shell escape for processing COMMAND (defaults to shell) + abort get out of the current command right away + quit get out of program, saving file \`$CONFIG\' if modified + +Synchronizing commands: + chdir [DIRECTORY] change current directory to DIRECTORY + mode [MODE] init (do not send contents) or noop (send nothing) + broadcast [SET] export a synchronization package to each site of SET + process [FILE] import a FILE (defaults to \`$ARCHIVE\') + process [DIRECTORY] or use an already exploded DIRECTORY (\`$WORKDIR\') + +Maintenance commands: + list list title, here, remotes, scans and ignores + files list all files and their known signatures + title [DESCRIPTION] use DESCRIPTION as project title (or list it) + here [ADDRESS [DIRECTORY]] declare our ADDRESS, modify visited DIRECTORY + remote [ADDRESS [DIRECTORY]] declare remote ADDRESS, modify its DIRECTORY + scan [PATTERN] scan directory with \`find\' for shell PATTERN + ignore [REGEXP] ignore scanned files if name matched by REGEXP + delete TYPE DATA delete the remote, scan or ignore having DATA + +To obtain partial lists, use appropriate commands without their parameters. +Commands and keyword arguments may be abbreviated to one letter. +"; + +## Programming notes around probable Perl 4.X bugs: +## * local($_) is avoided, so beware $_ may be destroyed by any routine. +## * @_ is always saved on each routine entry, where sub-routines are used. + +while (@ARGV) +{ + if ($ARGV[0] eq "--v" || $ARGV[0] eq "--ve" || $ARGV[0] eq "--ver" + || $ARGV[0] eq "--vers" || $ARGV[0] eq "--versi" + || $ARGV[0] eq "--versio" || $ARGV[0] eq "--version") + { + print "$PROGRAM (format $FORMAT) - GNU $PACKAGE $VERSION\n"; + exit 0; + } + elsif ($ARGV[0] eq "--h" || $ARGV[0] eq "--he" || $ARGV[0] eq "--hel" + || $ARGV[0] eq "--help") + { + print $NORMAL_HELP; + exit 0; + } + else + { + last; + } +} + +if (@ARGV) +{ + $commands_ahead = join (";", @ARGV); + @ARGV = (); +} +else +{ + print STDERR $INITIAL_HELP; +} + +$fetch_config = 1; + +&command_loop; + +&maybe_save_config; + +exit 0; + +# Interactive command decoding. + +## Read user commands and dispatch them. + +sub command_loop +{ + $command_loop = 1; + + COMMAND_LOOP: + while (1) + { + if ($commands_ahead) + { + if ($commands_ahead =~ /^([^;]*);(.*)/) + { + $_ = $1; + $commands_ahead = $2; + } + else + { + $_ = $commands_ahead; + $commands_ahead = "quit"; + } + } + else + { + if ($noop_mode) + { + &query ("\nnoop>>"); + } + elsif ($init_mode) + { + &query ("\ninit>>"); + } + else + { + &query ("\n>>"); + } + } + s/^ +//; + s/ +$//; + + next if /^$/; + next if /^#/; + last if /^q(uit)?$/; + + if (/^c(hdir)?$/ || /^pwd$/) + { + &command_list_cwd; + } + elsif (/^c(hdir|d)? +(.+)/) + { + &command_set_cwd ($2); + } + elsif (/^m(ode)?$/) + { + &command_list_mode; + } + elsif (/^m(ode)? +([^ ]+)$/) + { + &command_set_mode ($2); + } + elsif (/^b(roadcast)?$/) + { + &command_broadcast (""); + } + elsif (/^b(roadcast)? +(.+)$/) + { + &command_broadcast ($2); + } + elsif (/^p(rocess)?$/) + { + &command_process (""); + } + elsif (/^p(rocess)? +([^ ]+)$/) + { + &command_process ($2); + } + elsif (/^l(ist)?$/) + { + &command_list_almost_all; + } + elsif (/^f(iles)?$/) + { + &command_list_files; + } + elsif (/^t(itle)?$/) + { + &command_list_title; + } + elsif (/^t(itle)? +(.+)$/) + { + &command_set_title ($2); + } + elsif (/^h(ere)?$/) + { + &command_list_here; + } + elsif (/^h(ere)? +([^ ]+) *([^ ]*)$/) + { + &command_set_here ($2, $3); + } + elsif (/^r(emote)?$/) + { + &command_list_remote; + } + elsif (/^r(emote)? +([^ ]+) *([^ ]*)$/) + { + &command_set_remote ($2, $3); + } + elsif (/^s(can)?$/) + { + &command_list_scan; + } + elsif (/^s(can)? +([^ ]+)$/) + { + &command_set_scan ($2); + } + elsif (/^i(gnore)?$/) + { + &command_list_ignore; + } + elsif (/^i(gnore)? +([^ ]+)$/) + { + &command_set_ignore ($2); + } + elsif (/^d(elete)? *r(emote)? +([^ ]+)$/) + { + &command_delete_remote ($3); + } + elsif (/^d(elete)? *s(can)? +([^ ]+)$/) + { + &command_delete_scan ($3); + } + elsif (/^d(elete)? *i(gnore)? +([^ ]+)$/) + { + &command_delete_ignore ($3); + } + else + { + &diagnose ("Unrecognized command \`$_\', try \`?\' for help"); + } + } + + $command_loop = 0; +} + +## List current working directory. +## Synopses: `chdir' or `pwd'. + +sub command_list_cwd +{ + print `pwd`; +} + +## Change current working directory. +## Synopses: `chdir DIRECTORY' or `cd DIRECTORY'. + +sub command_set_cwd +{ + local ($directory) = @_; + + $directory = &expand_filename ($directory); + + if (-d $directory) + { + &maybe_save_config; + + if (chdir ($directory)) + { + $fetch_config = 1; + } + else + { + &diagnose ("Unable to change to directory \`$directory\'"); + } + } + else + { + &diagnose ("Non-existing directory \`$directory\'"); + } +} + +## List all modes. +## Synopsis: `mode'. + +sub command_list_mode +{ + print STDERR "\n"; + printf STDERR + "Init mode %-5s Send file signatures, but no file contents\n", + ($init_mode ? "(on)" : "(off)"); + printf STDERR + "Noop mode %-5s Avoid sending email, do not update \`$CONFIG\'", + ($noop_mode ? "(on)" : "(off)"); + print STDERR "\n"; +} + +## Set one of modes. +## Synopsis: `mode MODE'. + +sub command_set_mode +{ + local ($mode) = @_; + + if ($mode eq "i" || $mode eq "init") + { + $init_mode = 1; + } + elsif ($mode eq "n" || $mode eq "noop") + { + $noop_mode = 1; + } + else + { + &diagnose ("Unrecognized mode \`$mode\'"); + } +} + +## List title, here information, all remotes, all scans and all ignores. +## Synopsis: `list'. + +sub command_list_almost_all +{ + &maybe_fetch_config; + + print "\n$project_title\n\n"; + + print "HERE:\n"; + &command_list_here; + + print "REMOTE:\n" if @remote; + &command_list_remote; + + print "SCAN:\n" if %scan; + &command_list_scan; + + print "IGNORE:\n" if %ignore; + &command_list_ignore; +} + +## List information for all files. +## Synopsis: `files'. + +sub command_list_files +{ + local ($format, $field); + + &maybe_fetch_config; + &maybe_study_files; + + $format = " %-5s %-${maximum_name_width}s "; + foreach (sort keys %signature) + { + printf $format, $here_signature{$_}, $_; + foreach $field (split (/ /, $signature{$_})) + { + $field = " ..." if $field eq $here_signature{$_}; + printf "%-7s", $field; + } + print "\n"; + } +} + +## List the title of the project. +## Synopsis: `title'. + +sub command_list_title +{ + &maybe_fetch_config; + + print "$project_title\n"; +} + +## Set the title of the project. +## Synopsis: `title DESCRIPTION'. + +sub command_set_title +{ + local ($description) = @_; + + &maybe_fetch_config; + + if ($description ne $project_title) + { + $project_title = $description; + $save_config = 1; + } +} + +## List local information. +## Synopsis: `here'. + +sub command_list_here +{ + &maybe_fetch_config; + + print " [0]\t$here_email $here_home\n"; +} + +## Modify our local information to ADDRESS and DIRECTORY. +## Synopsis: `here ADDRESS DIRECTORY'. + +sub command_set_here +{ + local ($email, $directory) = @_; + + &maybe_fetch_config; + + $email =~ tr/A-Z/a-z/; + if ($email ne "-" && $email ne $here_email) + { + $here_email = $email; + $save_config = 1; + } + + if ($directory && $directory ne $here_home) + { + $here_home = &normalize_directory ($directory); + $config_filename = &expand_filename ("$here_home/$CONFIG"); + $save_config = 1; + } +} + +## List information for all remotes. +## Synopsis: `remote'. + +sub command_list_remote +{ + local ($index, $email); + + &maybe_fetch_config; + + $index = 0; + foreach (@remote) + { + $index++; + print " [$index]\t$_ $remote{$_}\n"; + } +} + +## Create a new remote given its REMOTE address, modify its DIRECTORY. +## Synopsis: `remote REMOTE DIRECTORY'. + +sub command_set_remote +{ + local ($remote, $directory) = @_; + local ($index); + + &maybe_fetch_config; + + $remote =~ tr/A-Z/a-z/; + $remote = @remote[$remote - 1] if ($remote > 0 && $remote <= @remote); + + if (defined $remote{$remote}) + { + if ($directory && $remote{$remote} ne $directory) + { + $remote{$remote} = $directory; + $save_config = 1; + } + elsif ($remote{$remote} ne "-") + { + &diagnose ("Remote directory is known to be \`$remote{$remote}\'"); + &query ("Do you want me to keep this knowledge (y/n)? [y]"); + if (! /(y|yes)/i) + { + $remote{$remote} = "-"; + $save_config = 1; + } + } + } + else + { + if ($directory) + { + &create_remote ($remote, $directory); + } + else + { + &create_remote ($remote, "-"); + $index = @remote; + &warn ("You may also use \`remote $index DIRECTORY\'" + . " if you know the remote directory"); + } + } +} + +## Delete an existing remote given its ADDRESS address. +## Synopsis: `delete remote ADDRESS'. + +sub command_delete_remote +{ + local ($remote) = @_; + + &maybe_fetch_config; + + $remote = @remote[$remote - 1] if ($remote > 0 && $remote <= @remote); + &delete_remote ($remote); +} + +## List information for all scans. +## Synopsis: `scan'. + +sub command_list_scan +{ + local ($index); + + &maybe_fetch_config; + + $index = 0; + @scan = (); + foreach (sort keys %scan) + { + $index++; + push (@scan, $_); + print " [$index]\t$_\n"; + } +} + +## Create a new SCAN. +## Synopsis: `scan SCAN'. + +sub command_set_scan +{ + local ($scan) = @_; + + &maybe_fetch_config; + + if (defined $scan{$scan}) + { + &diagnose ("Redundant creation of scan \`$scan\'"); + } + else + { + $scan{$scan} = 1; + $save_config = 1; + $study_files = 1; + } +} + +## Delete an existing SCAN. +## Synopsis: `delete scan SCAN'. + +sub command_delete_scan +{ + local ($scan) = @_; + + &maybe_fetch_config; + + $scan = @scan[$scan - 1] if ($scan > 0 && $scan <= @scan); + if (defined $scan{$scan}) + { + delete $scan{$scan}; + $save_config = 1; + $study_files = 1; + } + else + { + &diagnose ("Cannot delete inexisting scan \`$scan\'"); + } +} + +## List information for all ignores. +## Synopsis: `ignore'. + +sub command_list_ignore +{ + local ($index); + + &maybe_fetch_config; + + $index = 0; + @ignore = (); + foreach (sort keys %ignore) + { + $index++; + push (@ignore, $_); + print " [$index]\t$_\n"; + } +} + +## Create a new IGNORE. +## Synopsis: `ignore IGNORE'. + +sub command_set_ignore +{ + local ($ignore) = @_; + + &maybe_fetch_config; + + if (defined $ignore{$ignore}) + { + &diagnose ("Redundant creation of ignore \`$ignore\'"); + } + else + { + $ignore{$ignore} = 1; + $save_config = 1; + $study_files = 1; + } +} + +## Delete an existing IGNORE. +## Synopsis: `delete ignore IGNORE'. + +sub command_delete_ignore +{ + local ($ignore) = @_; + local ($index); + + &maybe_fetch_config; + + $ignore = @ignore[$ignore - 1] if ($ignore > 0 && $ignore <= @ignore); + if (defined $ignore{$ignore}) + { + delete $ignore{$ignore}; + $save_config = 1; + $study_files = 1; + } + else + { + &diagnose ("Cannot delete inexisting ignore \`$ignore\'"); + } +} + +# Broadcasting away synchronization packages. + +## Export a synchronization package to each site of SET. +## Synopsis: `broadcast SET'. + +sub command_broadcast +{ + local ($set) = @_; + local ($site, $index, $ordinal, $file, @signature); + + &maybe_fetch_config; + + &decode_site_set ($set); + foreach $site (@site_set) + { + &warn (""); + &warn ("Broadcasting to address \`$remote[$site]\'"); + + if (-f $ARCHIVE && ! $noop_mode) + { + &diagnose ("The archive \`$ARCHIVE\' already exists!"); + &query ("Should I delete it for you (y/n)? [n]"); + &interrupt ("Command aborted!") if ! /^(y|yes)/i; + unlink $ARCHIVE + || &interrupt ("Cannot delete file \`$ARCHIVE\'"); + } + if (-d $WORKDIR && ! $noop_mode) + { + &diagnose ("The work directory \`$WORKDIR\' already exists!"); + &query ("Should I remove all of it first (y/n)? [y]"); + &interrupt ("Command aborted!") if ! /^(y|yes)/i; + system "rm -rf $WORKDIR" + || &interrupt ("Cannot remove directory \`$WORKDIR\'"); + } + + &maybe_study_files; + &update_file_registry; + + # Initialize the invoice. + + if (! $noop_mode) + { + mkdir ($WORKDIR, 0700) + || &interrupt ("Unable to make directory \`$WORKDIR\'"); + open (OUTPUT, ">$WORKDIR/$ORDERS") + || &interrupt ("Cannot create file \`$WORKDIR/$ORDERS\'"); + + print OUTPUT "format\t$PROGRAM $FORMAT\n"; + print OUTPUT "title\t$project_title\n"; + print OUTPUT "here\t$here_email $here_home\n"; + foreach (@remote) + { + print OUTPUT "remote\t$_ $remote{$_}\n"; + } + foreach (sort keys %scan) + { + print OUTPUT "scan\t$_\n"; + } + foreach (sort keys %ignore) + { + print OUTPUT "ignore\t$_\n"; + } + + print OUTPUT "visit\t$site\n"; + print OUTPUT "copy\t", join (" ", @site_set), "\n"; + } + + # Transmit all file signatures and replacement orders. + + $ordinal = 0; + foreach $file (sort keys %signature) + { + if (! $noop_mode) + { + print OUTPUT "check\t$file $here_signature{$file}"; + @signature = split (/ /, $signature{$file}); + foreach (@site_set) + { + print OUTPUT " ", $signature[$_]; + } + print OUTPUT "\n"; + } + + next if $init_mode; + next if $signature[$site] eq $here_signature{$file}; + + &warn ("Packaging file \`$file\'"); + if (! $noop_mode) + { + $ordinal++; + symlink ("../$file", "$WORKDIR/$ordinal"); + print OUTPUT "update\t$file $signature[$site] $ordinal\n"; + } + $signature[$site] = $here_signature{$file}; + $signature{$file} = join (" ", @signature); + $save_config = 1; + } + + # Complete the invoice. + + if (! $noop_mode) + { + close OUTPUT; + system "$TAR cfzh $ARCHIVE $WORKDIR" + || &interrupt ("Cannot construct archive \`$ARCHIVE\'" + . " from directory \`$WORKDIR\'"); + system "rm -rf $WORKDIR" + || &interrupt ("Cannot remove directory \`$WORKDIR\'"); + system "mailshar $remote[$site] $ARCHIVE" + || &interrupt ("Cannot send file \`$ARCHIVE\'" + . " to address \`$remote[$site]\'"); + unlink $ARCHIVE + || &interrupt ("Cannot delete file \`$ARCHIVE\'"); + } + } + &warn ("Command \`broadcast\' done"); +} + +# Processing received synchronization packages. + +## Import a FILE or use an already exploded DIRECTORY. +## Synopses: `process [FILE]' or `process [DIRECTORY]'. + +sub command_process +{ + local ($argument) = @_; + local ($archive, $prior, $file, @signature); + + $work_directory = &expand_filename ($WORKDIR); + + if ($argument) + { + $archive = &expand_filename ($argument); + } + elsif (-f $ARCHIVE) + { + $archive = &expand_filename ($ARCHIVE); + $archive_to_unlink = $archive if ! $noop_mode; + } + elsif (-d $WORKDIR) + { + $archive = $work_directory; + } + else + { + &interrupt ("No argument, no archive \`$ARCHIVE\'" + . " and no directory \`$WORKDIR\'"); + } + + if (-f $archive) + { + &warn ("Exploding archive \`$archive\'"); + + if (-d $WORKDIR) + { + &diagnose ("The work directory \`$WORKDIR\' already exists!"); + &query ("Should I remove all of it first (y/n)? [y]"); + &interrupt ("Command aborted!") if ! /^(y|yes)/i; + system "rm -rf $WORKDIR" + || &interrupt ("Cannot remove directory \`$WORKDIR\'"); + } + + system "$TAR xfoz $archive" + || &interrupt ("Failure while untarring file \`$archive\'"); + $workdir_to_unlink = $work_directory; + } + + chop ($prior = `pwd`); + open (PACKAGE, "$work_directory/$ORDERS") + || &interrupt ("Cannot read file \`$work_directory/$ORDERS\'"); + + &process_loop; + + close PACKAGE; + chdir $prior; + + if ($workdir_to_unlink) + { + unlink "$workdir_to_unlink/$ORDERS" + || &diagnose ("Cannot delete file \`$workdir_to_unlink/$ORDERS\'"); + rmdir $workdir_to_unlink + || &diagnose ("Cannot remove directory \`$workdir_to_unlink\'"); + $workdir_to_unlink = ""; + } + + if ($archive_to_unlink) + { + unlink $archive_to_unlink + || &diagnose ("Cannot delete file \`$archive_to_unlink\'"); + $archive_to_unlink = ""; + } + &warn ("Command \`process\' done"); +} + +## Decode each received package orders, in turn. Most validation +## is delayed until the \`visit\' order. + +sub process_loop +{ + $process_loop = 1; + + PROCESS_LOOP: + while () + { + chop; + + # Handle commands not requiring the analysis of file $CONFIG. + + if (/^(format|version)\t$PROGRAM ([^ ]+)$/o) + { + &interrupt + ("Need $PROGRAM (format $FORMAT) to process this package!") + if $2 ne $FORMAT; + } + elsif (/^title\t(.*)/) + { + $project_title_received = $1; + } + elsif (/^(here|local)\t([^ ]+) ([^ ]+)$/) + { + ($here_email_received, $here_home_received) = ($2, $3); + $here_email_received =~ tr/A-Z/a-z/; + } + elsif (/^remote\t([^ ]+) ([^ ]+)$/) + { + push (@remote_received, $1); + $remote_received{$1} = $2; + $remote_received =~ tr/A-Z/a-z/; + } + elsif (/^scan\t([^ ]+)$/) + { + $scan_received{$1} = 1; + } + elsif (/^ignore\t([^ ]+)$/) + { + $ignore_received{&convert_ignore ($1)} = 1; + } + elsif (/^visit\t([^ ]+)$/) + { + &process_visit ($1); + } + elsif (/^copy\t(.+)/) + { + &process_copy ($1); + } + elsif (/^check\t([^ ]+) ([^ ]+) (.+)/) + { + &process_check ($1, $2, $3); + } + elsif (/^update\t([^ ]+) ([^ ]+) ([^ ]+)$/) + { + &process_update ($1, $2, $3); + } + else + { + &interrupt ("Unrecognized command \`$_\' in process input"); + } + } + + $process_loop = 0; + &update_file_registry; + + if (%signature_received) + { + foreach $file (sort keys %signature) + { + if (! defined $signature_received{$file}) + { + &diagnose ("File \`$file\' is not registered remotely"); + + @signature = split (/ /, $signature{$file}); + if ($signature[$from_email] ne "-") + { + $signature[$from_email] = "-"; + $save_config = 1; + $signature{$file} = join (" ", @signature); + } + + &query ("Should I delete this file, here too (y/n)? [n]"); + if (/^(y|yes)$/i) + { + if (! $noop_mode) + { + unlink $file + || &diagnose ("Cannot delete file \`$file\'"); + } + delete $signature{$file}; + } + } + } + } +} + +## Prepare to visit a directory, conciliating all received information. +## Synopsis: `visit VISITED', where VISITED is an index in remotes. + +sub process_visit +{ + local ($visited) = @_; + local ($email, $home, $string, $scan, $ignore); + + &maybe_save_config; + + &warn (""); + &warn ("Package being received:"); + &warn (" from address \`$here_email_received\'"); + &warn (" for project \`$project_title_received\'"); + + # Check the recipient address. + + $email = &guess_here_email; + $string = $remote_received[$visited]; + + if (! &equivalent_email ($email, $string)) + { + &diagnose ("This package was sent to address \`$string\'"); + &warn ("but your address is known to be \`$email\'"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Correct your full email address to \`$string\'"); + &warn (" 2. Use your current email address \`$email\'"); + &warn (" 3. Specify another full email address (beware!)"); + &warn (" 4. Abandon the processing of this package"); + $_ = ""; + &query ("Which action do you choose (1-4)? [1]") + while ! /^[1-4]$/; + if ($_ eq "1") + { + $email = $string; + } + elsif ($_ eq "3") + { + $_ = &guess_here_email; + &query ("What is your full email address, here? [$_]"); + $email = $_; + } + elsif ($_ eq "4") + { + &interrupt ("Command aborted!"); + } + } + + # Check the recipient directory. + + $string = $remote_received{$string}; + $_ = &expand_filename ($string); + if (-d $_) + { + $home = $string; + } + else + { + chop ($_ = `pwd`); + $home = &normalize_directory ($_); + + &diagnose ("This package was aimed for directory \`$string\'"); + &warn ("but this directory does not exist here"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Attempt creating the \`$string\' directory"); + &warn (" 2. Use the current directory \`$home\' (are you sure?)"); + &warn (" 3. Specify another synchronized directory (beware!)"); + &warn (" 4. Abandon the processing of this package"); + $_ = ""; + &query ("Which action do you choose (1-4)? [1]") + while ! /^[1-4]$/; + if ($_ eq "1") + { + $home = $string; + } + elsif ($_ eq "3") + { + &query ("Which directory should be used? [$home]"); + $home = &normalize_directory ($_); + } + elsif ($_ eq "4") + { + &interrupt ("Command aborted!"); + } + } + + # Force our way to the wanted directory. + + &warn ("Visiting directory \`$home'," + . " remote was \`$here_home_received\'"); + + $home = &expand_filename ($home); + &prepare_filename ("$home/$CONFIG"); + chdir $home || &interrupt ("Cannot change directory to \`$home\'"); + + # Swallow or simulate the $CONFIG file. + + if (-f "$home/$CONFIG") + { + $fetch_config = 1; + &maybe_fetch_config; + + # Reconciliate $project_title. + + if ($project_title ne $project_title_received) + { + &diagnose ("The package title is \`$project_title_received\'"); + &warn ("but \`$CONFIG\' says it should be \`$project_title\'"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Use \`$project_title_received\' as title"); + &warn (" 2. Keep \`$project_title' as title\'"); + &warn (" 3. Specify another project title"); + $_ = ""; + &query ("Which action do you choose (1-3)? [1]") + while ! /^[1-3]$/; + if ($_ eq "1") + { + $project_title = $project_title_received; + } + elsif ($_ eq "3") + { + &query ("What will be the new project title?"); + $project_title = $_; + } + } + + # Reconciliate $here_email. + + if (! &equivalent_email ($email, $here_email)) + { + &diagnose ("This package is sent to address \`$here_email\'"); + &warn ("but \`$CONFIG\' says it should have been \`$email\'"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Use your current full email address \`$email\'"); + &warn (" 2. Correct your full email address to \`$here_email\'"); + &warn (" 3. Specify another full email address"); + $_ = ""; + &query ("Which action do you choose (1-3)? [1]") + while ! /^[1-3]$/; + if ($_ eq "1") + { + $here_email = $email; + } + elsif ($_ eq "3") + { + $_ = &guess_here_email; + &query ("What is your full email address, here? [$_]"); + $here_email = $_; + } + } + + # Reconciliate $here_home. + + $home = &normalize_directory ($home); + if ($home ne $here_home) + { + &diagnose ("This package is aimed for directory \`$here_home\'"); + &warn ("but \`$CONFIG\' says it should have been \`$home\'"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Record the \`$home\' directory in the configuration"); + &warn (" 2. Correct the directory to \`$here_home\'"); + &warn (" 3. Record another name for this directory (beware!)"); + $_ = ""; + &query ("Which action do you choose (1-3)? [1]") + while ! /^[1-3]$/; + if ($_ eq "1") + { + $here_home = $home; + $config_filename = &expand_filename ("$here_home/$CONFIG"); + } + elsif ($_ eq "3") + { + &query ("Which directory should be used? [$home]"); + $here_home = &normalize_directory ($_); + $config_filename = &expand_filename ("$here_home/$CONFIG"); + } + } + + # Reconciliate remote information. + + foreach $remote (sort keys %remote) + { + if (defined $remote_received{$remote}) + { + if ($remote{$remote} ne $remote_received{$remote}) + { + &diagnose ("Conflicting directories for \`$remote\'"); + &warn ("registered as \`$remote{$remote}\' here and"); + &warn ("as \`$remote_received{$remote}\' remotely"); + } + delete $remote_received{$remote}; + } + elsif ($remote ne $here_email_received) + { + &diagnose ("Remote \`$remote\' is not registered remotely"); + &query ("Should I unregister it here (y/n)? [n]"); + delete $remote{$remote} if /(y|yes)/i; + } + } + foreach $remote (sort keys %remote_received) + { + if ($remote ne $here_email) + { + &diagnose ("Remote \`$remote\' is registered remotely" + . " and not locally"); + &query ("Should I register it here (y/n)? [y]"); + &create_remote ($remote, $remote_received{$remote}) + if (/(y|yes)/i); + } + delete $remote_received{$remote}; + } + + # Reconciliate scan information. + + foreach $scan (sort keys %scan) + { + if (defined $scan_received{$scan}) + { + delete $scan_received{$scan}; + } + else + { + &diagnose ("Scan \`$scan\' is not registered remotely"); + &query ("Should I unregister it here (y/n)? [n]"); + delete $scan{$scan} if /(y|yes)/i; + } + } + foreach $scan (sort keys %scan_received) + { + &diagnose + ("Scan \`$scan\' is registered remotely and not locally"); + &query ("Should I register it here (y/n)? [y]"); + $scan{$scan} = $NEWLY_CREATED_SCAN if /(y|yes)/i; + delete $scan_received{$scan}; + } + + # Reconciliate ignore information. + + foreach $ignore (sort keys %ignore) + { + if (defined $ignore_received{$ignore}) + { + delete $ignore_received{$ignore}; + } + else + { + &diagnose ("Ignore \`$ignore\' is not registered remotely"); + &query ("Should I unregister it here (y/n)? [n]"); + delete $ignore{$ignore} if /(y|yes)/i; + } + } + foreach $ignore (sort keys %ignore_received) + { + &diagnose + ("Ignore \`$ignore\' is registered remotely and not locally"); + &query ("Should I register it here (y/n)? [y]"); + $ignore{$ignore} = 1 if /(y|yes)/i; + delete $ignore_received{$ignore}; + } + } + else + { + + # Use remote information for initializing the local one. + + &warn ("Initializing file \`$CONFIG\' from received information"); + + $project_title = $project_title_received; + $here_email = $remote_received[$visited]; + $here_home = $remote_received{$here_email}; + $config_filename = &expand_filename ("$here_home/$CONFIG"); + + if ($here_email ne $here_email_received) + { + $remote_received[$visited] = $here_email_received; + $remote_received{$here_email_received} = $here_home_received; + delete $remote_received{$here_email}; + } + + @remote = @remote_received; + + %remote = %remote_received; + %remote_received = (); + %scan = %scan_received; + %scan_received = (); + %ignore = %ignore_received; + %ignore_received = (); + + $new_config = 1; + $save_config = 1; + $fetch_config = 0; + $study_files = 1; + } +} + +## Package was sent to each address in SET. +## Synopsis: `copy SET'. + +sub process_copy +{ + local ($set) = @_; + local ($index); + + &maybe_fetch_config; + + @copy_list = (); + $counter = 0; + foreach (split (" ", $set)) + { + $_ = $remote_received[$_]; + + $copy_list[$counter++] + = $_ eq $here_email ? -1 : &validated_remote_index ($_); + } +} + +## Set FILE signatures to SIGNATURE, given a SET of previous values. +## Synopsis: `check FILE SIGNATURE SET'. + +sub process_check +{ + local ($file, $signature, $set) = @_; + local (@signature, @check, $counter, $new_signature); + + @check = split (" ", $set); + &interrupt ("Unmatching number of signatures for file \`$file\'") + if @check != @copy_list; + +# &maybe_fetch_config; + &maybe_study_files; + + if (defined $signature{$file}) + { + @signature = split (/ /, $signature{$file}); + } + else + { + @signature = ("-") x @remote; + } + if ($signature ne $signature[$from_email]) + { + $signature[$from_email] = $signature; + $save_config = 1; + } + for ($counter = 0; $counter < @check; $counter++) + { + if ($copy_list[$counter] >= 0 && $check[$counter] ne "-") + { + if ($signature[$copy_list[$counter]] eq "-" + || $signature[$copy_list[$counter]] eq $check[$counter]) + { + $new_signature = $signature; + } + else + { + + # If we do have an idea of a remote file\'s signature, and + # if this idea is contradicted by a synchronization + # package, rather say we know nothing besides that the + # file merely exists. Give it a signature from hell. + + $new_signature = "666"; + } + if ($new_signature ne $signature[$copy_list[$counter]]) + { + $signature[$copy_list[$counter]] = $new_signature; + $save_config = 1; + } + } + } + + $signature{$file} = join (" ", @signature); + $signature_received{$file} = 1; +} + +## If FILE checks to SIGNATURE, replace it by PACKAGED. +## Synopsis: `update FILE SIGNATURE PACKAGED'. + +sub process_update +{ + local ($file, $old_signature, $packaged) = @_; + local ($action, $cautious, $packaged_signature); + + $packaged = "$work_directory/$packaged"; + +# &maybe_fetch_config; +# &maybe_study_files; + + if (&ignorable_file ($file)) + { + &diagnose ("File \`$file\' is the subject of some \`ignore\'"); + &query ("Should I accept it nevertheless (y/n)? [n]"); + $action = "UNLINK" if ! /^(y|yes)$/i; + } + + if (! $action && -f $file && ! defined $here_signature{$file}) + { + &diagnose ("File \`$file\' was not locally scanned"); + $here_signature{$file} = &single_signature ($file); + $cautious = 1; + } + + if (! $action && -f $file && $old_signature eq $here_signature{$file}) + { + if ($cautious) + { + &query ("Show diffs before updating it (y/n)? [y]"); + $action = /^(y|yes)$/i ? "DIFF" : "MOVE"; + } + else + { + &warn ("Updating file \`$file\'"); + $action = "MOVE"; + } + } + + if (! $action && -f $file) + { + $packaged_signature = &single_signature ($packaged); + if ($old_signature eq "-") + { + if ($packaged_signature eq $here_signature{$file}) + { + &diagnose ("Redundant creation of file \`$file\'"); + $action = "UNLINK"; + } + else + { + &diagnose ("Unexpected preexisting file \`$file'"); + $action = "DIFF"; + } + } + else + { + if ($packaged_signature eq $here_signature{$file}) + { + &diagnose ("Redundant updating of file \`$file\'"); + $action = "UNLINK"; + } + else + { + &diagnose ("Local changes occurred to file \`$file\'"); + $action = "DIFF"; + } + } + } + + if (! $action) # $file does not exist locally + { + if ($old_signature eq "-") + { + &warn ("Creating new file \`$file\'"); + $action = "MOVE"; + } + else + { + &diagnose ("File \`$file\' has locally disappeared"); + &query ("Should I recreate it from remote copy (y/n)? [y]"); + $action = /^(y|yes)$/i ? "MOVE" : "UNLINK"; + } + } + + if ($action eq "DIFF") + { + &warn (""); + &warn ("$DIFF -u $file $packaged"); + system "$DIFF -u $file $packaged"; + &warn (""); + &warn ("Before replying to next question, please reconciliate:"); + &warn (" -) \`$file\'"); + &warn (" +) \`$packaged\'"); + &warn (""); + &query ("Now, which of these files should be kept (-/+)? [-]"); + $action = /^\+$/ ? "MOVE" : "UNLINK"; + } + + if ($action eq "UNLINK" && ! $noop_mode) + { + unlink $packaged || &diagnose ("Cannot delete file \`$packaged\'"); + } + + if ($action eq "MOVE" && ! $noop_mode) + { + if (-f $file) + { + unlink $file || &diagnose ("Cannot delete file \`$file\'"); + } + &prepare_filename ($file); + system "mv $packaged $file" + || &interrupt ("Cannot move packaged file into \`$file\'"); + $here_signature{$file} = &single_signature ($file); + } +} + +# $CONFIG file maintainance. + +## Digest in file \`$CONFIG\' if not done already. + +sub maybe_fetch_config +{ + local (@signature, $index, $string); + + return if ! $fetch_config; + + %remote = (); + %scan = (); + %ignore = (); + %signature = (); + + if (open (CONFIG, $CONFIG)) + { + while (chop ($_ = )) + { + next if /^$/; + next if /^#/; + + if (/^(format|version)\t$PROGRAM ([^ ]+)$/o + ||/^($PROGRAM|version)\t([^ ]+)$/o) + { + &interrupt ("$CONFIG:$.: Unmatching format for $CONFIG") + if $2 ne $FORMAT; + } + elsif (/^title\t(.*)$/) + { + $project_title = $1; + &warn ("Reading configuration for project \`$project_title\'"); + } + elsif (/^(here|local)\t([^ ]+) ([^ ]+)$/) + { + ($here_email, $here_home) = ($2, $3); + $here_email =~ tr/A-Z/a-z/; + $config_filename = &expand_filename ("$here_home/$CONFIG"); + } + elsif (/^remote\t([^ ]+) ([^ ]+)$/) + { + $string = $1; + $string =~ tr/A-Z/a-z/; + $saved_save_config = $save_config; + &create_remote ($1, $2); + $save_config = $saved_save_config; + } + elsif (/^scan\t([^ ]+)$/) + { + $scan{$1} = 1; + } + elsif (/^ignore\t([^ ]+)$/) + { + $ignore{&convert_ignore ($1)} = 1; + } + elsif (/^\t([^ ]+) (.*)/) + { + + # Temporary code, the time everything is getting updated. + # Was: $signature{$1} = $2; + + @signature = split (/ /, $2); + for ($index = 0; $index < @remote; $index++) + { + if (! $signature[$index]) + { + &diagnose ("Empty signature for file \`$1\' [$index]"); + $signature[$index] = "-"; + $save_config = 1; + } + } + $signature{$1} = join (" ", @signature); + } + else + { + &interrupt ("** $CONFIG:$.: Illegal format for $CONFIG"); + } + } + close CONFIG; + + if (! $project_title) + { + &diagnose ("There is no title for this project."); + &query ("Please enter a short project description:"); + $project_title = $_; + } + } + else + { + chop ($_ = `pwd`); + $_ = &normalize_directory ($_); + &diagnose ("Directory \`$_\' is not ready for synchronization"); + &query ("Should I prepare it for its first time (y/n)? [y]"); + &interrupt ("Command aborted!") if ! /^(y|yes)$/i; + $new_config = 1; + + &query ("Please enter a short project description:"); + $project_title = $_; + + $_ = &guess_here_email; + &query ("What is your full email address, here? [$_]"); + $here_email = $_; + + chop ($_ = `pwd`); + $here_home = &normalize_directory ($_); + $config_filename = &expand_filename ("$here_home/$CONFIG"); + + foreach (("(.*/)?core(\\..*)?", + ".*,v", + ".*/RCS/.*", + ".*\\.(bak|BAK)", + ".*\\.[oa]", + ".*~", + "\\$CONFIG.*", + "\\\#.*")) + { + $ignore{$_} = 1; + } + } + + $fetch_config = 0; + $save_config = 1; + $study_files = 1; +} + +## Write back file \`$CONFIG\' if it has been modified. + +sub maybe_save_config +{ + local ($index); + + return if ! $save_config; + $save_config = 0; + return if $noop_mode; + + if (! $new_config) + { + unlink "$config_filename.bak"; + rename ("$config_filename", "$config_filename.bak") + || &interrupt ("Cannot backup file \`$config_filename'"); + } + + open (CONFIG, ">$config_filename") + || &interrupt ("Cannot create file \`$config_filename\'"); + print CONFIG + "# This file is maintained automatically by program \`$PROGRAM\'.", + " DO NOT EDIT!\n"; + print CONFIG "\n"; + print CONFIG "format\t$PROGRAM $FORMAT\n"; + print CONFIG "title\t$project_title\n"; + &diagnose ("There is no project title, yet") if ! $project_title; + print CONFIG "here\t$here_email $here_home\n"; + &diagnose ("There are no declared remote connections, yet") + if ! @remote; + foreach (@remote) + { + print CONFIG "remote\t$_ $remote{$_}\n"; + } + print CONFIG "\n"; + foreach (sort keys %scan) + { + print CONFIG "scan\t$_\n"; + } + foreach (sort keys %ignore) + { + print CONFIG "ignore\t$_\n"; + } + foreach (sort keys %signature) + { + print CONFIG "\t", $_, " ", $signature{$_}, "\n"; + } + close CONFIG; +} + +## Scan for files with \`find\' and \`sum\', unless this is done already. + +sub maybe_study_files +{ + local ($list, $signature, $file); + + # Do not execute this lengthy process without reason. + + return if ! $study_files; + &warn ("Studying local files for their signature"); + + # Find the proper "sum" command. + + if (! $sum_command) + { + foreach (("sum", "sum -r")) + { + if (`echo x | $_` =~ /^00070 /) + { + $sum_command = $_; + last; + } + } + &interrupt ("Cannot find BSD program \`sum\' around") + if ! $sum_command; + } + + # Trigger execution of find with all the %scan parameters. + + if (%scan == 0) + { + $list = " ."; + } + else + { + $list = ""; + foreach (sort keys %scan) + { + $list .= " '$_'"; + } + } + + open (SCAN, ("find$list -type f -print 2> /tmp/$$.find" + . " | xargs $sum_command |")) + || &interrupt ("Cannot launch program \`find\'"); + + # Process each existing file in turn. + + %here_signature = (); + $maximum_name_width = 0; + + while () + { + if (/^([0-9]+) +[0-9]+ +(\.\/)?(.*)/) + { + ($signature, $file) = ($1, $3); + } + else + { + chop; + &diagnose ("Unrecognized output from program \`sum\': \`$_\'"); + next; + } + + next if &ignorable_file ($file); + + $here_signature{$file} = $signature; + $maximum_name_width = length $file + if length $file > $maximum_name_width; + } + close SCAN; + + # Clean out scanning for inexisting files. + + open (SCAN, "/tmp/$$.find"); + while () + { + chop; + if (/^find: (.*): No such file or directory$/) + { + $file = $1; + &diagnose ("No files found while scanning for \`$file\'"); + if (! defined $scan{$file}) + { + &diagnose ("And this is not even a valid scan. Bizarre..."); + } + elsif ($scan{$file} != $NEWLY_CREATED_SCAN) + { + &query ("Should I delete this scan (y/n)? [y]"); + if (/^(y|yes)$/i) + { + &delete_scan ($file); + } + else + { + &diagnose ("Please ensure some local file exists for it!"); + } + } + } + else + { + &diagnose ("Scan error: $_"); + } + } + close SCAN; + unlink "/tmp/$$.find"; + + $study_files = 0; +} + +## Compute \`sum\' over a single file. + +sub single_signature +{ + (split (" ", `$sum_command $_[0]`))[0]; +} + +## Update file and signature matrix according to what exists here. + +sub update_file_registry +{ + local ($cautious); + + foreach (sort keys %signature) + { + if (! defined $here_signature{$_}) + { + &warn ("Unregistering file \`$_\'"); + delete $signature{$_}; + $save_config = 1; + } + } + + foreach (sort keys %here_signature) + { + if (! defined $signature{$_}) + { + &warn ("Registering file \`$_\'"); + $signature{$_} = join (" ", ("-") x @remote); + $save_config = 1; + $cautious = 1; + } + } + + if ($cautious && !$process_loop) + { + &diagnose ("There were new registrations, please check them"); + &query ("Should I resume the current command (y/n)? [y]"); + &interrupt ("Command aborted!") if ! /^(y|yes)$/i; + } +} + +# Identification and filename services. + +## Return a sensible suggestion for our probable email address. + +sub guess_here_email +{ + return $here_email if $here_email; + + chop ($_ = `hostname`); + if (/\./) + { + $_ = "$ENV{'LOGNAME'}@$_"; + } + else + { + $_ .= "!$ENV{'LOGNAME'}"; + } + tr/A-Z/a-z/; + return $_; +} + +## Use forgiving rules to test for equivalence between EMAIL_LEFT +## and EMAIL_RIGHT. + +sub equivalent_email +{ + local ($email_left, $email_right) = @_; + local ($user_left, $user_right, $domain_left, $domain_right); + + if ($email_left =~ /(.+)@(.+)/) + { + ($user_left, $domain_left) = ($1, $2); + } + elsif ($email_left =~ /(.+)!([^!]+)/) + { + ($user_left, $domain_left) = ($2, $1); + } + else + { + ($user_left, $domain_left) = ($email_left, ""); + } + + if ($email_right =~ /(.+)@(.+)/) + { + ($user_right, $domain_right) = ($1, $2); + } + elsif ($email_right =~ /(.+)!([^!]+)/) + { + ($user_right, $domain_right) = ($2, $1); + } + else + { + ($user_right, $domain_right) = ($email_right, ""); + } + + $domain_left =~ s/\.uucp$//; + $domain_right =~ s/\.uucp$//; + + return 0 if ($user_left !~ /^$user_right(-batch)?$/ + && $user_right !~ /^$user_left(-batch)?$/); + + return 0 if ($domain_left !~ /$domain_right$/ + && $domain_right !~ /$domain_left$/); + 1; +} + +## Return the given filename expanded so the system will recognize it. + +sub expand_filename +{ + local ($pwd); + + $_ = @_[0]; + if (/^~/) + { + return $ENV{"HOME"} if /^~$/; + s|^~/|$ENV{"HOME"}/|; + } + return $_ if /^\//; + + chop ($pwd = `pwd`); + "$pwd/$_"; +} + +## Return the given directory normalized so the user will like +## it more. However, still avoid relative notations. + +sub normalize_directory +{ + return "~" if $_[0] eq $ENV{"HOME"}; + + $_ = $_[0]; + s|^$ENV{"HOME"}/|~/|; + chop ($_ = `cd $_; pwd`) if ! /^[~\/]/; + $_; +} + +## Ensure intermediate directories exist by creating them as needed, +## and that the appropriate permissions are set for the FILE to be +## created or replaced. + +sub prepare_filename +{ + local ($filename) = @_; + local (@filename, $counter); + + if (-e $filename) + { + &interrupt ("Cannot modify read-only file \`$filename\'") + if ! -w $filename; + return; + } + + @filename = split (/\//, $filename); + pop @filename; + + for ($counter = $filename[0] ? 0 : 1; $counter < @filename; $counter++) + { + $filename = join ("/", @filename[0 .. $counter]); + next if -d $filename; + &warn (" Creating new directory \`$filename\'"); + if (! mkdir ($filename, 0755)) + { + &interrupt ("Cannot create directory \`$filename\'"); + return; + } + } +} + +# Various services. + +## Convert IGNORE from previous "local" format to current "here" format. +## This routine is meant to disappear soon after everything stabilized. + +sub convert_ignore +{ + $_ = $_[0]; + + if (/^[\^\/](.*)/ || /(.*)[\$\/]$/) + { + if (/^\^(.*)/) + { + $_ = $1; + } + else + { + $_ = ".*$_"; + } + + if (/(.*)\$$/) + { + $_ = $1; + } + else + { + $_ = "$_.*"; + } + $save_config = 1; + } + + return $_; +} + +## Says whether if FILE should be ignored. + +sub ignorable_file +{ + local ($file) = @_; + + foreach (keys %ignore) + { + if (/^!(.*)/) + { + return 1 if $file !~ /^$1$/; + } + else + { + return 1 if $file =~ /^$_$/; + } + } + 0; +} + +## Initialize @site_set according to the given SET. + +sub decode_site_set +{ + local ($set) = @_; + local ($index, $counter); + + if ($set eq "") + { + @site_set = 0 .. @remote - 1; + } + elsif ($set eq "!") + { + @site_set = (); + } + elsif ($set =~ /!(.*)/) + { + @site_set = 0 .. @remote - 1; + foreach (split (" ", $1)) + { + $site_set[&validated_remote_index ($_)] = ""; + } + @site_set = grep (/./, @site_set); + } + else + { + @site_set = (); + @copy_list = (); # used to parallel "from" and "check" lines + $counter = 0; + foreach (split (" ", $set)) + { + $index = &validated_remote_index ($_); + $copy_list[$counter++] = $index; + $site_set[$index] = $index; + } + @site_set = grep (/./, @site_set); + } +} + +## Create a new REMOTE address with its related DIRECTORY. + +sub create_remote +{ + local ($remote, $directory) = @_; + + push (@remote, $remote); + $remote{$remote} = $directory; + foreach (keys %signature) + { + $signature{$_} .= " -"; + } + $save_config = 1; +} + +## Alter a REMOTE address to a NEW_REMOTE address, known to be equivalent. + +sub change_remote +{ + local ($remote, $new_remote) = @_; + + return if $remote eq $new_remote; + $remote[&validated_remote_index ($remote)] = $new_remote; + $remote{$new_remote} = $remote{$remote}; + delete $remote{$remote}; + $save_config = 1; +} + +## Destroy information related to a REMOTE address. + +sub delete_remote +{ + local ($remote) = @_; + local ($index); + + $index = &validated_remote_index ($remote); + @remote = @remote[0 .. $index - 1, $index + 1 .. @remote - 1]; + delete $remote{$remote}; + + foreach (keys %signature) + { + @signature = split (/ /, $signature{$_}); + $signature{$_} = join (" ", @signature[0 .. $index - 1, + $index + 1 .. @signature - 1]); + } + $save_config = 1; +} + +## Return the index of a given REMOTE, interrupting the command if not found. + +sub validated_remote_index +{ + local ($remote) = @_; + local ($index); + + $index = &remote_index ($remote); + return $index if $index >= 0; + &interrupt ("Specification \`$remote\' invalid for remote address"); +} + +## Return the index of a given REMOTE, or a negative value if not found. + +sub remote_index +{ + local ($remote) = @_; + local ($index); + + $remote = @remote[$remote - 1] if ($remote > 0 && $remote <= @remote); + $index = 0; + foreach (@remote) + { + return $index if $remote eq $_; + $index++; + } + -1; +} + +# Interactive dialog and error processing. + +## Query the user interactively with QUESTION, return the reply +## in $_. An empty reply means the default signature from the QUESTION +## if any, written as "...? [DEFAULT]". Echo the input if used +## in process. + +sub query +{ + local ($query) = @_; + + while (1) + { + print STDERR "\a$query "; + $_ = <>; + if ($_) + { + print STDERR if ! -t; + chop; + if (/^\?$/) + { + print STDERR $NORMAL_HELP; + next; + } + if (/^! *(.*)$/) + { + if ($1) + { + system $1; + } + elsif (defined $ENV{$SHELL}) + { + system $ENV{$SHELL}; + } + else + { + system $SH; + } + next; + } + if (/^abort$/) + { + if ($save_config) + { + &diagnose + ("Modifications to file \`$CONFIG\' are unsaved"); + &query ("Should I stop without saving them (y/n)? [n]"); + if (/^(y|yes)$/i) + { + $command_loop = 0; + $process_loop = 0; + &interrupt ("Program aborted!"); + } + } + &interrupt ("Command aborted!"); + } + $_ = $1 if (! $_ && $query =~ /\? \[(.+)\]$/); + return; + } + else + { + print STDERR "quit\n"; + $_ = "quit"; + return; + } + } +} + +## Issue a message for the (possibly interactive) user. + +sub warn +{ + warn " $_[0]\n"; +} + +## Issue an error message for the (possibly interactive) user. + +sub diagnose +{ + warn "* $_[0]\n"; +} + +## Issue an error message for the (possibly interactive) user, while +## interrupting the command being currently executed. Abort if none. + +sub interrupt +{ + if ($process_loop) + { + $workdir_to_unlink = ""; + $archive_to_unlink = ""; + %signature_received = (); + + warn "* $_[0]\n"; + last PROCESS_LOOP; + } + elsif ($command_loop) + { + warn "* $_[0]\n"; + next COMMAND_LOOP; + } + else + { + die "** $_[0]\n"; + } +} + +# Local Variables: +# mode: perl +# End: diff --git a/src/apps/bin/sharutils-4.2.1/src/remsync.in b/src/apps/bin/sharutils-4.2.1/src/remsync.in new file mode 100644 index 0000000000..457832f121 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/remsync.in @@ -0,0 +1,2178 @@ +#! @PERL@ +# @configure_input@ +eval "exec @PERL@ -S $0 $*" + if $running_under_some_shell; + +# Synchronization tool for remote directories. +# Copyright (C) 1994 Free Software Foundation, Inc. +# François Pinard , 1994. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Parameters, but not meant to be changed. + +$PACKAGE = "@PACKAGE@"; # name of package for this program +$VERSION = "@VERSION@"; # version number for the whole package +$PROGRAM = "remsync"; # name of this particular program +$FORMAT = "1.3"; # version of format for files + +$CONFIG = ".remsync"; # file containing synchronization information +$ARCHIVE = ".remsync.tar.gz"; # default file name of packed synchro. package +$WORKDIR = ".remsync-work"; # directory name of unpacked synchro. package +$ORDERS = "orders"; # file name containaing synchro. directives + +$DIFF = "@DIFF@"; # GNU diff path +$TAR = "@TAR@"; # GNU tar path +$SH = "@SH@"; # Bash or sh path + +# Special constants. + +$NEWLY_CREATED_SCAN = 2; # Instead of 1, when by remote request + +# Help strings. + +$INITIAL_HELP = "$PROGRAM (format $FORMAT) - GNU $PACKAGE $VERSION + Remote synchronization of files and directories. + +The following commands are available at *any* \`$PROGRAM\' prompt: + + ? reminder for available commands + ! [COMMAND] shell escape for processing COMMAND + abort get out of the current command right away +"; + +$NORMAL_HELP = "Usage: $PROGRAM [COMMANDS...] + + ! [COMMAND] shell escape for processing COMMAND (defaults to shell) + abort get out of the current command right away + quit get out of program, saving file \`$CONFIG\' if modified + +Synchronizing commands: + chdir [DIRECTORY] change current directory to DIRECTORY + mode [MODE] init (do not send contents) or noop (send nothing) + broadcast [SET] export a synchronization package to each site of SET + process [FILE] import a FILE (defaults to \`$ARCHIVE\') + process [DIRECTORY] or use an already exploded DIRECTORY (\`$WORKDIR\') + +Maintenance commands: + list list title, here, remotes, scans and ignores + files list all files and their known signatures + title [DESCRIPTION] use DESCRIPTION as project title (or list it) + here [ADDRESS [DIRECTORY]] declare our ADDRESS, modify visited DIRECTORY + remote [ADDRESS [DIRECTORY]] declare remote ADDRESS, modify its DIRECTORY + scan [PATTERN] scan directory with \`find\' for shell PATTERN + ignore [REGEXP] ignore scanned files if name matched by REGEXP + delete TYPE DATA delete the remote, scan or ignore having DATA + +To obtain partial lists, use appropriate commands without their parameters. +Commands and keyword arguments may be abbreviated to one letter. +"; + +## Programming notes around probable Perl 4.X bugs: +## * local($_) is avoided, so beware $_ may be destroyed by any routine. +## * @_ is always saved on each routine entry, where sub-routines are used. + +while (@ARGV) +{ + if ($ARGV[0] eq "--v" || $ARGV[0] eq "--ve" || $ARGV[0] eq "--ver" + || $ARGV[0] eq "--vers" || $ARGV[0] eq "--versi" + || $ARGV[0] eq "--versio" || $ARGV[0] eq "--version") + { + print "$PROGRAM (format $FORMAT) - GNU $PACKAGE $VERSION\n"; + exit 0; + } + elsif ($ARGV[0] eq "--h" || $ARGV[0] eq "--he" || $ARGV[0] eq "--hel" + || $ARGV[0] eq "--help") + { + print $NORMAL_HELP; + exit 0; + } + else + { + last; + } +} + +if (@ARGV) +{ + $commands_ahead = join (";", @ARGV); + @ARGV = (); +} +else +{ + print STDERR $INITIAL_HELP; +} + +$fetch_config = 1; + +&command_loop; + +&maybe_save_config; + +exit 0; + +# Interactive command decoding. + +## Read user commands and dispatch them. + +sub command_loop +{ + $command_loop = 1; + + COMMAND_LOOP: + while (1) + { + if ($commands_ahead) + { + if ($commands_ahead =~ /^([^;]*);(.*)/) + { + $_ = $1; + $commands_ahead = $2; + } + else + { + $_ = $commands_ahead; + $commands_ahead = "quit"; + } + } + else + { + if ($noop_mode) + { + &query ("\nnoop>>"); + } + elsif ($init_mode) + { + &query ("\ninit>>"); + } + else + { + &query ("\n>>"); + } + } + s/^ +//; + s/ +$//; + + next if /^$/; + next if /^#/; + last if /^q(uit)?$/; + + if (/^c(hdir)?$/ || /^pwd$/) + { + &command_list_cwd; + } + elsif (/^c(hdir|d)? +(.+)/) + { + &command_set_cwd ($2); + } + elsif (/^m(ode)?$/) + { + &command_list_mode; + } + elsif (/^m(ode)? +([^ ]+)$/) + { + &command_set_mode ($2); + } + elsif (/^b(roadcast)?$/) + { + &command_broadcast (""); + } + elsif (/^b(roadcast)? +(.+)$/) + { + &command_broadcast ($2); + } + elsif (/^p(rocess)?$/) + { + &command_process (""); + } + elsif (/^p(rocess)? +([^ ]+)$/) + { + &command_process ($2); + } + elsif (/^l(ist)?$/) + { + &command_list_almost_all; + } + elsif (/^f(iles)?$/) + { + &command_list_files; + } + elsif (/^t(itle)?$/) + { + &command_list_title; + } + elsif (/^t(itle)? +(.+)$/) + { + &command_set_title ($2); + } + elsif (/^h(ere)?$/) + { + &command_list_here; + } + elsif (/^h(ere)? +([^ ]+) *([^ ]*)$/) + { + &command_set_here ($2, $3); + } + elsif (/^r(emote)?$/) + { + &command_list_remote; + } + elsif (/^r(emote)? +([^ ]+) *([^ ]*)$/) + { + &command_set_remote ($2, $3); + } + elsif (/^s(can)?$/) + { + &command_list_scan; + } + elsif (/^s(can)? +([^ ]+)$/) + { + &command_set_scan ($2); + } + elsif (/^i(gnore)?$/) + { + &command_list_ignore; + } + elsif (/^i(gnore)? +([^ ]+)$/) + { + &command_set_ignore ($2); + } + elsif (/^d(elete)? *r(emote)? +([^ ]+)$/) + { + &command_delete_remote ($3); + } + elsif (/^d(elete)? *s(can)? +([^ ]+)$/) + { + &command_delete_scan ($3); + } + elsif (/^d(elete)? *i(gnore)? +([^ ]+)$/) + { + &command_delete_ignore ($3); + } + else + { + &diagnose ("Unrecognized command \`$_\', try \`?\' for help"); + } + } + + $command_loop = 0; +} + +## List current working directory. +## Synopses: `chdir' or `pwd'. + +sub command_list_cwd +{ + print `pwd`; +} + +## Change current working directory. +## Synopses: `chdir DIRECTORY' or `cd DIRECTORY'. + +sub command_set_cwd +{ + local ($directory) = @_; + + $directory = &expand_filename ($directory); + + if (-d $directory) + { + &maybe_save_config; + + if (chdir ($directory)) + { + $fetch_config = 1; + } + else + { + &diagnose ("Unable to change to directory \`$directory\'"); + } + } + else + { + &diagnose ("Non-existing directory \`$directory\'"); + } +} + +## List all modes. +## Synopsis: `mode'. + +sub command_list_mode +{ + print STDERR "\n"; + printf STDERR + "Init mode %-5s Send file signatures, but no file contents\n", + ($init_mode ? "(on)" : "(off)"); + printf STDERR + "Noop mode %-5s Avoid sending email, do not update \`$CONFIG\'", + ($noop_mode ? "(on)" : "(off)"); + print STDERR "\n"; +} + +## Set one of modes. +## Synopsis: `mode MODE'. + +sub command_set_mode +{ + local ($mode) = @_; + + if ($mode eq "i" || $mode eq "init") + { + $init_mode = 1; + } + elsif ($mode eq "n" || $mode eq "noop") + { + $noop_mode = 1; + } + else + { + &diagnose ("Unrecognized mode \`$mode\'"); + } +} + +## List title, here information, all remotes, all scans and all ignores. +## Synopsis: `list'. + +sub command_list_almost_all +{ + &maybe_fetch_config; + + print "\n$project_title\n\n"; + + print "HERE:\n"; + &command_list_here; + + print "REMOTE:\n" if @remote; + &command_list_remote; + + print "SCAN:\n" if %scan; + &command_list_scan; + + print "IGNORE:\n" if %ignore; + &command_list_ignore; +} + +## List information for all files. +## Synopsis: `files'. + +sub command_list_files +{ + local ($format, $field); + + &maybe_fetch_config; + &maybe_study_files; + + $format = " %-5s %-${maximum_name_width}s "; + foreach (sort keys %signature) + { + printf $format, $here_signature{$_}, $_; + foreach $field (split (/ /, $signature{$_})) + { + $field = " ..." if $field eq $here_signature{$_}; + printf "%-7s", $field; + } + print "\n"; + } +} + +## List the title of the project. +## Synopsis: `title'. + +sub command_list_title +{ + &maybe_fetch_config; + + print "$project_title\n"; +} + +## Set the title of the project. +## Synopsis: `title DESCRIPTION'. + +sub command_set_title +{ + local ($description) = @_; + + &maybe_fetch_config; + + if ($description ne $project_title) + { + $project_title = $description; + $save_config = 1; + } +} + +## List local information. +## Synopsis: `here'. + +sub command_list_here +{ + &maybe_fetch_config; + + print " [0]\t$here_email $here_home\n"; +} + +## Modify our local information to ADDRESS and DIRECTORY. +## Synopsis: `here ADDRESS DIRECTORY'. + +sub command_set_here +{ + local ($email, $directory) = @_; + + &maybe_fetch_config; + + $email =~ tr/A-Z/a-z/; + if ($email ne "-" && $email ne $here_email) + { + $here_email = $email; + $save_config = 1; + } + + if ($directory && $directory ne $here_home) + { + $here_home = &normalize_directory ($directory); + $config_filename = &expand_filename ("$here_home/$CONFIG"); + $save_config = 1; + } +} + +## List information for all remotes. +## Synopsis: `remote'. + +sub command_list_remote +{ + local ($index, $email); + + &maybe_fetch_config; + + $index = 0; + foreach (@remote) + { + $index++; + print " [$index]\t$_ $remote{$_}\n"; + } +} + +## Create a new remote given its REMOTE address, modify its DIRECTORY. +## Synopsis: `remote REMOTE DIRECTORY'. + +sub command_set_remote +{ + local ($remote, $directory) = @_; + local ($index); + + &maybe_fetch_config; + + $remote =~ tr/A-Z/a-z/; + $remote = @remote[$remote - 1] if ($remote > 0 && $remote <= @remote); + + if (defined $remote{$remote}) + { + if ($directory && $remote{$remote} ne $directory) + { + $remote{$remote} = $directory; + $save_config = 1; + } + elsif ($remote{$remote} ne "-") + { + &diagnose ("Remote directory is known to be \`$remote{$remote}\'"); + &query ("Do you want me to keep this knowledge (y/n)? [y]"); + if (! /(y|yes)/i) + { + $remote{$remote} = "-"; + $save_config = 1; + } + } + } + else + { + if ($directory) + { + &create_remote ($remote, $directory); + } + else + { + &create_remote ($remote, "-"); + $index = @remote; + &warn ("You may also use \`remote $index DIRECTORY\'" + . " if you know the remote directory"); + } + } +} + +## Delete an existing remote given its ADDRESS address. +## Synopsis: `delete remote ADDRESS'. + +sub command_delete_remote +{ + local ($remote) = @_; + + &maybe_fetch_config; + + $remote = @remote[$remote - 1] if ($remote > 0 && $remote <= @remote); + &delete_remote ($remote); +} + +## List information for all scans. +## Synopsis: `scan'. + +sub command_list_scan +{ + local ($index); + + &maybe_fetch_config; + + $index = 0; + @scan = (); + foreach (sort keys %scan) + { + $index++; + push (@scan, $_); + print " [$index]\t$_\n"; + } +} + +## Create a new SCAN. +## Synopsis: `scan SCAN'. + +sub command_set_scan +{ + local ($scan) = @_; + + &maybe_fetch_config; + + if (defined $scan{$scan}) + { + &diagnose ("Redundant creation of scan \`$scan\'"); + } + else + { + $scan{$scan} = 1; + $save_config = 1; + $study_files = 1; + } +} + +## Delete an existing SCAN. +## Synopsis: `delete scan SCAN'. + +sub command_delete_scan +{ + local ($scan) = @_; + + &maybe_fetch_config; + + $scan = @scan[$scan - 1] if ($scan > 0 && $scan <= @scan); + if (defined $scan{$scan}) + { + delete $scan{$scan}; + $save_config = 1; + $study_files = 1; + } + else + { + &diagnose ("Cannot delete inexisting scan \`$scan\'"); + } +} + +## List information for all ignores. +## Synopsis: `ignore'. + +sub command_list_ignore +{ + local ($index); + + &maybe_fetch_config; + + $index = 0; + @ignore = (); + foreach (sort keys %ignore) + { + $index++; + push (@ignore, $_); + print " [$index]\t$_\n"; + } +} + +## Create a new IGNORE. +## Synopsis: `ignore IGNORE'. + +sub command_set_ignore +{ + local ($ignore) = @_; + + &maybe_fetch_config; + + if (defined $ignore{$ignore}) + { + &diagnose ("Redundant creation of ignore \`$ignore\'"); + } + else + { + $ignore{$ignore} = 1; + $save_config = 1; + $study_files = 1; + } +} + +## Delete an existing IGNORE. +## Synopsis: `delete ignore IGNORE'. + +sub command_delete_ignore +{ + local ($ignore) = @_; + local ($index); + + &maybe_fetch_config; + + $ignore = @ignore[$ignore - 1] if ($ignore > 0 && $ignore <= @ignore); + if (defined $ignore{$ignore}) + { + delete $ignore{$ignore}; + $save_config = 1; + $study_files = 1; + } + else + { + &diagnose ("Cannot delete inexisting ignore \`$ignore\'"); + } +} + +# Broadcasting away synchronization packages. + +## Export a synchronization package to each site of SET. +## Synopsis: `broadcast SET'. + +sub command_broadcast +{ + local ($set) = @_; + local ($site, $index, $ordinal, $file, @signature); + + &maybe_fetch_config; + + &decode_site_set ($set); + foreach $site (@site_set) + { + &warn (""); + &warn ("Broadcasting to address \`$remote[$site]\'"); + + if (-f $ARCHIVE && ! $noop_mode) + { + &diagnose ("The archive \`$ARCHIVE\' already exists!"); + &query ("Should I delete it for you (y/n)? [n]"); + &interrupt ("Command aborted!") if ! /^(y|yes)/i; + unlink $ARCHIVE + || &interrupt ("Cannot delete file \`$ARCHIVE\'"); + } + if (-d $WORKDIR && ! $noop_mode) + { + &diagnose ("The work directory \`$WORKDIR\' already exists!"); + &query ("Should I remove all of it first (y/n)? [y]"); + &interrupt ("Command aborted!") if ! /^(y|yes)/i; + system "rm -rf $WORKDIR" + || &interrupt ("Cannot remove directory \`$WORKDIR\'"); + } + + &maybe_study_files; + &update_file_registry; + + # Initialize the invoice. + + if (! $noop_mode) + { + mkdir ($WORKDIR, 0700) + || &interrupt ("Unable to make directory \`$WORKDIR\'"); + open (OUTPUT, ">$WORKDIR/$ORDERS") + || &interrupt ("Cannot create file \`$WORKDIR/$ORDERS\'"); + + print OUTPUT "format\t$PROGRAM $FORMAT\n"; + print OUTPUT "title\t$project_title\n"; + print OUTPUT "here\t$here_email $here_home\n"; + foreach (@remote) + { + print OUTPUT "remote\t$_ $remote{$_}\n"; + } + foreach (sort keys %scan) + { + print OUTPUT "scan\t$_\n"; + } + foreach (sort keys %ignore) + { + print OUTPUT "ignore\t$_\n"; + } + + print OUTPUT "visit\t$site\n"; + print OUTPUT "copy\t", join (" ", @site_set), "\n"; + } + + # Transmit all file signatures and replacement orders. + + $ordinal = 0; + foreach $file (sort keys %signature) + { + if (! $noop_mode) + { + print OUTPUT "check\t$file $here_signature{$file}"; + @signature = split (/ /, $signature{$file}); + foreach (@site_set) + { + print OUTPUT " ", $signature[$_]; + } + print OUTPUT "\n"; + } + + next if $init_mode; + next if $signature[$site] eq $here_signature{$file}; + + &warn ("Packaging file \`$file\'"); + if (! $noop_mode) + { + $ordinal++; + symlink ("../$file", "$WORKDIR/$ordinal"); + print OUTPUT "update\t$file $signature[$site] $ordinal\n"; + } + $signature[$site] = $here_signature{$file}; + $signature{$file} = join (" ", @signature); + $save_config = 1; + } + + # Complete the invoice. + + if (! $noop_mode) + { + close OUTPUT; + system "$TAR cfzh $ARCHIVE $WORKDIR" + || &interrupt ("Cannot construct archive \`$ARCHIVE\'" + . " from directory \`$WORKDIR\'"); + system "rm -rf $WORKDIR" + || &interrupt ("Cannot remove directory \`$WORKDIR\'"); + system "mailshar $remote[$site] $ARCHIVE" + || &interrupt ("Cannot send file \`$ARCHIVE\'" + . " to address \`$remote[$site]\'"); + unlink $ARCHIVE + || &interrupt ("Cannot delete file \`$ARCHIVE\'"); + } + } + &warn ("Command \`broadcast\' done"); +} + +# Processing received synchronization packages. + +## Import a FILE or use an already exploded DIRECTORY. +## Synopses: `process [FILE]' or `process [DIRECTORY]'. + +sub command_process +{ + local ($argument) = @_; + local ($archive, $prior, $file, @signature); + + $work_directory = &expand_filename ($WORKDIR); + + if ($argument) + { + $archive = &expand_filename ($argument); + } + elsif (-f $ARCHIVE) + { + $archive = &expand_filename ($ARCHIVE); + $archive_to_unlink = $archive if ! $noop_mode; + } + elsif (-d $WORKDIR) + { + $archive = $work_directory; + } + else + { + &interrupt ("No argument, no archive \`$ARCHIVE\'" + . " and no directory \`$WORKDIR\'"); + } + + if (-f $archive) + { + &warn ("Exploding archive \`$archive\'"); + + if (-d $WORKDIR) + { + &diagnose ("The work directory \`$WORKDIR\' already exists!"); + &query ("Should I remove all of it first (y/n)? [y]"); + &interrupt ("Command aborted!") if ! /^(y|yes)/i; + system "rm -rf $WORKDIR" + || &interrupt ("Cannot remove directory \`$WORKDIR\'"); + } + + system "$TAR xfoz $archive" + || &interrupt ("Failure while untarring file \`$archive\'"); + $workdir_to_unlink = $work_directory; + } + + chop ($prior = `pwd`); + open (PACKAGE, "$work_directory/$ORDERS") + || &interrupt ("Cannot read file \`$work_directory/$ORDERS\'"); + + &process_loop; + + close PACKAGE; + chdir $prior; + + if ($workdir_to_unlink) + { + unlink "$workdir_to_unlink/$ORDERS" + || &diagnose ("Cannot delete file \`$workdir_to_unlink/$ORDERS\'"); + rmdir $workdir_to_unlink + || &diagnose ("Cannot remove directory \`$workdir_to_unlink\'"); + $workdir_to_unlink = ""; + } + + if ($archive_to_unlink) + { + unlink $archive_to_unlink + || &diagnose ("Cannot delete file \`$archive_to_unlink\'"); + $archive_to_unlink = ""; + } + &warn ("Command \`process\' done"); +} + +## Decode each received package orders, in turn. Most validation +## is delayed until the \`visit\' order. + +sub process_loop +{ + $process_loop = 1; + + PROCESS_LOOP: + while () + { + chop; + + # Handle commands not requiring the analysis of file $CONFIG. + + if (/^(format|version)\t$PROGRAM ([^ ]+)$/o) + { + &interrupt + ("Need $PROGRAM (format $FORMAT) to process this package!") + if $2 ne $FORMAT; + } + elsif (/^title\t(.*)/) + { + $project_title_received = $1; + } + elsif (/^(here|local)\t([^ ]+) ([^ ]+)$/) + { + ($here_email_received, $here_home_received) = ($2, $3); + $here_email_received =~ tr/A-Z/a-z/; + } + elsif (/^remote\t([^ ]+) ([^ ]+)$/) + { + push (@remote_received, $1); + $remote_received{$1} = $2; + $remote_received =~ tr/A-Z/a-z/; + } + elsif (/^scan\t([^ ]+)$/) + { + $scan_received{$1} = 1; + } + elsif (/^ignore\t([^ ]+)$/) + { + $ignore_received{&convert_ignore ($1)} = 1; + } + elsif (/^visit\t([^ ]+)$/) + { + &process_visit ($1); + } + elsif (/^copy\t(.+)/) + { + &process_copy ($1); + } + elsif (/^check\t([^ ]+) ([^ ]+) (.+)/) + { + &process_check ($1, $2, $3); + } + elsif (/^update\t([^ ]+) ([^ ]+) ([^ ]+)$/) + { + &process_update ($1, $2, $3); + } + else + { + &interrupt ("Unrecognized command \`$_\' in process input"); + } + } + + $process_loop = 0; + &update_file_registry; + + if (%signature_received) + { + foreach $file (sort keys %signature) + { + if (! defined $signature_received{$file}) + { + &diagnose ("File \`$file\' is not registered remotely"); + + @signature = split (/ /, $signature{$file}); + if ($signature[$from_email] ne "-") + { + $signature[$from_email] = "-"; + $save_config = 1; + $signature{$file} = join (" ", @signature); + } + + &query ("Should I delete this file, here too (y/n)? [n]"); + if (/^(y|yes)$/i) + { + if (! $noop_mode) + { + unlink $file + || &diagnose ("Cannot delete file \`$file\'"); + } + delete $signature{$file}; + } + } + } + } +} + +## Prepare to visit a directory, conciliating all received information. +## Synopsis: `visit VISITED', where VISITED is an index in remotes. + +sub process_visit +{ + local ($visited) = @_; + local ($email, $home, $string, $scan, $ignore); + + &maybe_save_config; + + &warn (""); + &warn ("Package being received:"); + &warn (" from address \`$here_email_received\'"); + &warn (" for project \`$project_title_received\'"); + + # Check the recipient address. + + $email = &guess_here_email; + $string = $remote_received[$visited]; + + if (! &equivalent_email ($email, $string)) + { + &diagnose ("This package was sent to address \`$string\'"); + &warn ("but your address is known to be \`$email\'"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Correct your full email address to \`$string\'"); + &warn (" 2. Use your current email address \`$email\'"); + &warn (" 3. Specify another full email address (beware!)"); + &warn (" 4. Abandon the processing of this package"); + $_ = ""; + &query ("Which action do you choose (1-4)? [1]") + while ! /^[1-4]$/; + if ($_ eq "1") + { + $email = $string; + } + elsif ($_ eq "3") + { + $_ = &guess_here_email; + &query ("What is your full email address, here? [$_]"); + $email = $_; + } + elsif ($_ eq "4") + { + &interrupt ("Command aborted!"); + } + } + + # Check the recipient directory. + + $string = $remote_received{$string}; + $_ = &expand_filename ($string); + if (-d $_) + { + $home = $string; + } + else + { + chop ($_ = `pwd`); + $home = &normalize_directory ($_); + + &diagnose ("This package was aimed for directory \`$string\'"); + &warn ("but this directory does not exist here"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Attempt creating the \`$string\' directory"); + &warn (" 2. Use the current directory \`$home\' (are you sure?)"); + &warn (" 3. Specify another synchronized directory (beware!)"); + &warn (" 4. Abandon the processing of this package"); + $_ = ""; + &query ("Which action do you choose (1-4)? [1]") + while ! /^[1-4]$/; + if ($_ eq "1") + { + $home = $string; + } + elsif ($_ eq "3") + { + &query ("Which directory should be used? [$home]"); + $home = &normalize_directory ($_); + } + elsif ($_ eq "4") + { + &interrupt ("Command aborted!"); + } + } + + # Force our way to the wanted directory. + + &warn ("Visiting directory \`$home'," + . " remote was \`$here_home_received\'"); + + $home = &expand_filename ($home); + &prepare_filename ("$home/$CONFIG"); + chdir $home || &interrupt ("Cannot change directory to \`$home\'"); + + # Swallow or simulate the $CONFIG file. + + if (-f "$home/$CONFIG") + { + $fetch_config = 1; + &maybe_fetch_config; + + # Reconciliate $project_title. + + if ($project_title ne $project_title_received) + { + &diagnose ("The package title is \`$project_title_received\'"); + &warn ("but \`$CONFIG\' says it should be \`$project_title\'"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Use \`$project_title_received\' as title"); + &warn (" 2. Keep \`$project_title' as title\'"); + &warn (" 3. Specify another project title"); + $_ = ""; + &query ("Which action do you choose (1-3)? [1]") + while ! /^[1-3]$/; + if ($_ eq "1") + { + $project_title = $project_title_received; + } + elsif ($_ eq "3") + { + &query ("What will be the new project title?"); + $project_title = $_; + } + } + + # Reconciliate $here_email. + + if (! &equivalent_email ($email, $here_email)) + { + &diagnose ("This package is sent to address \`$here_email\'"); + &warn ("but \`$CONFIG\' says it should have been \`$email\'"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Use your current full email address \`$email\'"); + &warn (" 2. Correct your full email address to \`$here_email\'"); + &warn (" 3. Specify another full email address"); + $_ = ""; + &query ("Which action do you choose (1-3)? [1]") + while ! /^[1-3]$/; + if ($_ eq "1") + { + $here_email = $email; + } + elsif ($_ eq "3") + { + $_ = &guess_here_email; + &query ("What is your full email address, here? [$_]"); + $here_email = $_; + } + } + + # Reconciliate $here_home. + + $home = &normalize_directory ($home); + if ($home ne $here_home) + { + &diagnose ("This package is aimed for directory \`$here_home\'"); + &warn ("but \`$CONFIG\' says it should have been \`$home\'"); + &warn (""); + &warn ("The possibilities at this point are:"); + &warn (" 1. Record the \`$home\' directory in the configuration"); + &warn (" 2. Correct the directory to \`$here_home\'"); + &warn (" 3. Record another name for this directory (beware!)"); + $_ = ""; + &query ("Which action do you choose (1-3)? [1]") + while ! /^[1-3]$/; + if ($_ eq "1") + { + $here_home = $home; + $config_filename = &expand_filename ("$here_home/$CONFIG"); + } + elsif ($_ eq "3") + { + &query ("Which directory should be used? [$home]"); + $here_home = &normalize_directory ($_); + $config_filename = &expand_filename ("$here_home/$CONFIG"); + } + } + + # Reconciliate remote information. + + foreach $remote (sort keys %remote) + { + if (defined $remote_received{$remote}) + { + if ($remote{$remote} ne $remote_received{$remote}) + { + &diagnose ("Conflicting directories for \`$remote\'"); + &warn ("registered as \`$remote{$remote}\' here and"); + &warn ("as \`$remote_received{$remote}\' remotely"); + } + delete $remote_received{$remote}; + } + elsif ($remote ne $here_email_received) + { + &diagnose ("Remote \`$remote\' is not registered remotely"); + &query ("Should I unregister it here (y/n)? [n]"); + delete $remote{$remote} if /(y|yes)/i; + } + } + foreach $remote (sort keys %remote_received) + { + if ($remote ne $here_email) + { + &diagnose ("Remote \`$remote\' is registered remotely" + . " and not locally"); + &query ("Should I register it here (y/n)? [y]"); + &create_remote ($remote, $remote_received{$remote}) + if (/(y|yes)/i); + } + delete $remote_received{$remote}; + } + + # Reconciliate scan information. + + foreach $scan (sort keys %scan) + { + if (defined $scan_received{$scan}) + { + delete $scan_received{$scan}; + } + else + { + &diagnose ("Scan \`$scan\' is not registered remotely"); + &query ("Should I unregister it here (y/n)? [n]"); + delete $scan{$scan} if /(y|yes)/i; + } + } + foreach $scan (sort keys %scan_received) + { + &diagnose + ("Scan \`$scan\' is registered remotely and not locally"); + &query ("Should I register it here (y/n)? [y]"); + $scan{$scan} = $NEWLY_CREATED_SCAN if /(y|yes)/i; + delete $scan_received{$scan}; + } + + # Reconciliate ignore information. + + foreach $ignore (sort keys %ignore) + { + if (defined $ignore_received{$ignore}) + { + delete $ignore_received{$ignore}; + } + else + { + &diagnose ("Ignore \`$ignore\' is not registered remotely"); + &query ("Should I unregister it here (y/n)? [n]"); + delete $ignore{$ignore} if /(y|yes)/i; + } + } + foreach $ignore (sort keys %ignore_received) + { + &diagnose + ("Ignore \`$ignore\' is registered remotely and not locally"); + &query ("Should I register it here (y/n)? [y]"); + $ignore{$ignore} = 1 if /(y|yes)/i; + delete $ignore_received{$ignore}; + } + } + else + { + + # Use remote information for initializing the local one. + + &warn ("Initializing file \`$CONFIG\' from received information"); + + $project_title = $project_title_received; + $here_email = $remote_received[$visited]; + $here_home = $remote_received{$here_email}; + $config_filename = &expand_filename ("$here_home/$CONFIG"); + + if ($here_email ne $here_email_received) + { + $remote_received[$visited] = $here_email_received; + $remote_received{$here_email_received} = $here_home_received; + delete $remote_received{$here_email}; + } + + @remote = @remote_received; + + %remote = %remote_received; + %remote_received = (); + %scan = %scan_received; + %scan_received = (); + %ignore = %ignore_received; + %ignore_received = (); + + $new_config = 1; + $save_config = 1; + $fetch_config = 0; + $study_files = 1; + } +} + +## Package was sent to each address in SET. +## Synopsis: `copy SET'. + +sub process_copy +{ + local ($set) = @_; + local ($index); + + &maybe_fetch_config; + + @copy_list = (); + $counter = 0; + foreach (split (" ", $set)) + { + $_ = $remote_received[$_]; + + $copy_list[$counter++] + = $_ eq $here_email ? -1 : &validated_remote_index ($_); + } +} + +## Set FILE signatures to SIGNATURE, given a SET of previous values. +## Synopsis: `check FILE SIGNATURE SET'. + +sub process_check +{ + local ($file, $signature, $set) = @_; + local (@signature, @check, $counter, $new_signature); + + @check = split (" ", $set); + &interrupt ("Unmatching number of signatures for file \`$file\'") + if @check != @copy_list; + +# &maybe_fetch_config; + &maybe_study_files; + + if (defined $signature{$file}) + { + @signature = split (/ /, $signature{$file}); + } + else + { + @signature = ("-") x @remote; + } + if ($signature ne $signature[$from_email]) + { + $signature[$from_email] = $signature; + $save_config = 1; + } + for ($counter = 0; $counter < @check; $counter++) + { + if ($copy_list[$counter] >= 0 && $check[$counter] ne "-") + { + if ($signature[$copy_list[$counter]] eq "-" + || $signature[$copy_list[$counter]] eq $check[$counter]) + { + $new_signature = $signature; + } + else + { + + # If we do have an idea of a remote file\'s signature, and + # if this idea is contradicted by a synchronization + # package, rather say we know nothing besides that the + # file merely exists. Give it a signature from hell. + + $new_signature = "666"; + } + if ($new_signature ne $signature[$copy_list[$counter]]) + { + $signature[$copy_list[$counter]] = $new_signature; + $save_config = 1; + } + } + } + + $signature{$file} = join (" ", @signature); + $signature_received{$file} = 1; +} + +## If FILE checks to SIGNATURE, replace it by PACKAGED. +## Synopsis: `update FILE SIGNATURE PACKAGED'. + +sub process_update +{ + local ($file, $old_signature, $packaged) = @_; + local ($action, $cautious, $packaged_signature); + + $packaged = "$work_directory/$packaged"; + +# &maybe_fetch_config; +# &maybe_study_files; + + if (&ignorable_file ($file)) + { + &diagnose ("File \`$file\' is the subject of some \`ignore\'"); + &query ("Should I accept it nevertheless (y/n)? [n]"); + $action = "UNLINK" if ! /^(y|yes)$/i; + } + + if (! $action && -f $file && ! defined $here_signature{$file}) + { + &diagnose ("File \`$file\' was not locally scanned"); + $here_signature{$file} = &single_signature ($file); + $cautious = 1; + } + + if (! $action && -f $file && $old_signature eq $here_signature{$file}) + { + if ($cautious) + { + &query ("Show diffs before updating it (y/n)? [y]"); + $action = /^(y|yes)$/i ? "DIFF" : "MOVE"; + } + else + { + &warn ("Updating file \`$file\'"); + $action = "MOVE"; + } + } + + if (! $action && -f $file) + { + $packaged_signature = &single_signature ($packaged); + if ($old_signature eq "-") + { + if ($packaged_signature eq $here_signature{$file}) + { + &diagnose ("Redundant creation of file \`$file\'"); + $action = "UNLINK"; + } + else + { + &diagnose ("Unexpected preexisting file \`$file'"); + $action = "DIFF"; + } + } + else + { + if ($packaged_signature eq $here_signature{$file}) + { + &diagnose ("Redundant updating of file \`$file\'"); + $action = "UNLINK"; + } + else + { + &diagnose ("Local changes occurred to file \`$file\'"); + $action = "DIFF"; + } + } + } + + if (! $action) # $file does not exist locally + { + if ($old_signature eq "-") + { + &warn ("Creating new file \`$file\'"); + $action = "MOVE"; + } + else + { + &diagnose ("File \`$file\' has locally disappeared"); + &query ("Should I recreate it from remote copy (y/n)? [y]"); + $action = /^(y|yes)$/i ? "MOVE" : "UNLINK"; + } + } + + if ($action eq "DIFF") + { + &warn (""); + &warn ("$DIFF -u $file $packaged"); + system "$DIFF -u $file $packaged"; + &warn (""); + &warn ("Before replying to next question, please reconciliate:"); + &warn (" -) \`$file\'"); + &warn (" +) \`$packaged\'"); + &warn (""); + &query ("Now, which of these files should be kept (-/+)? [-]"); + $action = /^\+$/ ? "MOVE" : "UNLINK"; + } + + if ($action eq "UNLINK" && ! $noop_mode) + { + unlink $packaged || &diagnose ("Cannot delete file \`$packaged\'"); + } + + if ($action eq "MOVE" && ! $noop_mode) + { + if (-f $file) + { + unlink $file || &diagnose ("Cannot delete file \`$file\'"); + } + &prepare_filename ($file); + system "mv $packaged $file" + || &interrupt ("Cannot move packaged file into \`$file\'"); + $here_signature{$file} = &single_signature ($file); + } +} + +# $CONFIG file maintainance. + +## Digest in file \`$CONFIG\' if not done already. + +sub maybe_fetch_config +{ + local (@signature, $index, $string); + + return if ! $fetch_config; + + %remote = (); + %scan = (); + %ignore = (); + %signature = (); + + if (open (CONFIG, $CONFIG)) + { + while (chop ($_ = )) + { + next if /^$/; + next if /^#/; + + if (/^(format|version)\t$PROGRAM ([^ ]+)$/o + ||/^($PROGRAM|version)\t([^ ]+)$/o) + { + &interrupt ("$CONFIG:$.: Unmatching format for $CONFIG") + if $2 ne $FORMAT; + } + elsif (/^title\t(.*)$/) + { + $project_title = $1; + &warn ("Reading configuration for project \`$project_title\'"); + } + elsif (/^(here|local)\t([^ ]+) ([^ ]+)$/) + { + ($here_email, $here_home) = ($2, $3); + $here_email =~ tr/A-Z/a-z/; + $config_filename = &expand_filename ("$here_home/$CONFIG"); + } + elsif (/^remote\t([^ ]+) ([^ ]+)$/) + { + $string = $1; + $string =~ tr/A-Z/a-z/; + $saved_save_config = $save_config; + &create_remote ($1, $2); + $save_config = $saved_save_config; + } + elsif (/^scan\t([^ ]+)$/) + { + $scan{$1} = 1; + } + elsif (/^ignore\t([^ ]+)$/) + { + $ignore{&convert_ignore ($1)} = 1; + } + elsif (/^\t([^ ]+) (.*)/) + { + + # Temporary code, the time everything is getting updated. + # Was: $signature{$1} = $2; + + @signature = split (/ /, $2); + for ($index = 0; $index < @remote; $index++) + { + if (! $signature[$index]) + { + &diagnose ("Empty signature for file \`$1\' [$index]"); + $signature[$index] = "-"; + $save_config = 1; + } + } + $signature{$1} = join (" ", @signature); + } + else + { + &interrupt ("** $CONFIG:$.: Illegal format for $CONFIG"); + } + } + close CONFIG; + + if (! $project_title) + { + &diagnose ("There is no title for this project."); + &query ("Please enter a short project description:"); + $project_title = $_; + } + } + else + { + chop ($_ = `pwd`); + $_ = &normalize_directory ($_); + &diagnose ("Directory \`$_\' is not ready for synchronization"); + &query ("Should I prepare it for its first time (y/n)? [y]"); + &interrupt ("Command aborted!") if ! /^(y|yes)$/i; + $new_config = 1; + + &query ("Please enter a short project description:"); + $project_title = $_; + + $_ = &guess_here_email; + &query ("What is your full email address, here? [$_]"); + $here_email = $_; + + chop ($_ = `pwd`); + $here_home = &normalize_directory ($_); + $config_filename = &expand_filename ("$here_home/$CONFIG"); + + foreach (("(.*/)?core(\\..*)?", + ".*,v", + ".*/RCS/.*", + ".*\\.(bak|BAK)", + ".*\\.[oa]", + ".*~", + "\\$CONFIG.*", + "\\\#.*")) + { + $ignore{$_} = 1; + } + } + + $fetch_config = 0; + $save_config = 1; + $study_files = 1; +} + +## Write back file \`$CONFIG\' if it has been modified. + +sub maybe_save_config +{ + local ($index); + + return if ! $save_config; + $save_config = 0; + return if $noop_mode; + + if (! $new_config) + { + unlink "$config_filename.bak"; + rename ("$config_filename", "$config_filename.bak") + || &interrupt ("Cannot backup file \`$config_filename'"); + } + + open (CONFIG, ">$config_filename") + || &interrupt ("Cannot create file \`$config_filename\'"); + print CONFIG + "# This file is maintained automatically by program \`$PROGRAM\'.", + " DO NOT EDIT!\n"; + print CONFIG "\n"; + print CONFIG "format\t$PROGRAM $FORMAT\n"; + print CONFIG "title\t$project_title\n"; + &diagnose ("There is no project title, yet") if ! $project_title; + print CONFIG "here\t$here_email $here_home\n"; + &diagnose ("There are no declared remote connections, yet") + if ! @remote; + foreach (@remote) + { + print CONFIG "remote\t$_ $remote{$_}\n"; + } + print CONFIG "\n"; + foreach (sort keys %scan) + { + print CONFIG "scan\t$_\n"; + } + foreach (sort keys %ignore) + { + print CONFIG "ignore\t$_\n"; + } + foreach (sort keys %signature) + { + print CONFIG "\t", $_, " ", $signature{$_}, "\n"; + } + close CONFIG; +} + +## Scan for files with \`find\' and \`sum\', unless this is done already. + +sub maybe_study_files +{ + local ($list, $signature, $file); + + # Do not execute this lengthy process without reason. + + return if ! $study_files; + &warn ("Studying local files for their signature"); + + # Find the proper "sum" command. + + if (! $sum_command) + { + foreach (("sum", "sum -r")) + { + if (`echo x | $_` =~ /^00070 /) + { + $sum_command = $_; + last; + } + } + &interrupt ("Cannot find BSD program \`sum\' around") + if ! $sum_command; + } + + # Trigger execution of find with all the %scan parameters. + + if (%scan == 0) + { + $list = " ."; + } + else + { + $list = ""; + foreach (sort keys %scan) + { + $list .= " '$_'"; + } + } + + open (SCAN, ("find$list -type f -print 2> /tmp/$$.find" + . " | xargs $sum_command |")) + || &interrupt ("Cannot launch program \`find\'"); + + # Process each existing file in turn. + + %here_signature = (); + $maximum_name_width = 0; + + while () + { + if (/^([0-9]+) +[0-9]+ +(\.\/)?(.*)/) + { + ($signature, $file) = ($1, $3); + } + else + { + chop; + &diagnose ("Unrecognized output from program \`sum\': \`$_\'"); + next; + } + + next if &ignorable_file ($file); + + $here_signature{$file} = $signature; + $maximum_name_width = length $file + if length $file > $maximum_name_width; + } + close SCAN; + + # Clean out scanning for inexisting files. + + open (SCAN, "/tmp/$$.find"); + while () + { + chop; + if (/^find: (.*): No such file or directory$/) + { + $file = $1; + &diagnose ("No files found while scanning for \`$file\'"); + if (! defined $scan{$file}) + { + &diagnose ("And this is not even a valid scan. Bizarre..."); + } + elsif ($scan{$file} != $NEWLY_CREATED_SCAN) + { + &query ("Should I delete this scan (y/n)? [y]"); + if (/^(y|yes)$/i) + { + &delete_scan ($file); + } + else + { + &diagnose ("Please ensure some local file exists for it!"); + } + } + } + else + { + &diagnose ("Scan error: $_"); + } + } + close SCAN; + unlink "/tmp/$$.find"; + + $study_files = 0; +} + +## Compute \`sum\' over a single file. + +sub single_signature +{ + (split (" ", `$sum_command $_[0]`))[0]; +} + +## Update file and signature matrix according to what exists here. + +sub update_file_registry +{ + local ($cautious); + + foreach (sort keys %signature) + { + if (! defined $here_signature{$_}) + { + &warn ("Unregistering file \`$_\'"); + delete $signature{$_}; + $save_config = 1; + } + } + + foreach (sort keys %here_signature) + { + if (! defined $signature{$_}) + { + &warn ("Registering file \`$_\'"); + $signature{$_} = join (" ", ("-") x @remote); + $save_config = 1; + $cautious = 1; + } + } + + if ($cautious && !$process_loop) + { + &diagnose ("There were new registrations, please check them"); + &query ("Should I resume the current command (y/n)? [y]"); + &interrupt ("Command aborted!") if ! /^(y|yes)$/i; + } +} + +# Identification and filename services. + +## Return a sensible suggestion for our probable email address. + +sub guess_here_email +{ + return $here_email if $here_email; + + chop ($_ = `hostname`); + if (/\./) + { + $_ = "$ENV{'LOGNAME'}@$_"; + } + else + { + $_ .= "!$ENV{'LOGNAME'}"; + } + tr/A-Z/a-z/; + return $_; +} + +## Use forgiving rules to test for equivalence between EMAIL_LEFT +## and EMAIL_RIGHT. + +sub equivalent_email +{ + local ($email_left, $email_right) = @_; + local ($user_left, $user_right, $domain_left, $domain_right); + + if ($email_left =~ /(.+)@(.+)/) + { + ($user_left, $domain_left) = ($1, $2); + } + elsif ($email_left =~ /(.+)!([^!]+)/) + { + ($user_left, $domain_left) = ($2, $1); + } + else + { + ($user_left, $domain_left) = ($email_left, ""); + } + + if ($email_right =~ /(.+)@(.+)/) + { + ($user_right, $domain_right) = ($1, $2); + } + elsif ($email_right =~ /(.+)!([^!]+)/) + { + ($user_right, $domain_right) = ($2, $1); + } + else + { + ($user_right, $domain_right) = ($email_right, ""); + } + + $domain_left =~ s/\.uucp$//; + $domain_right =~ s/\.uucp$//; + + return 0 if ($user_left !~ /^$user_right(-batch)?$/ + && $user_right !~ /^$user_left(-batch)?$/); + + return 0 if ($domain_left !~ /$domain_right$/ + && $domain_right !~ /$domain_left$/); + 1; +} + +## Return the given filename expanded so the system will recognize it. + +sub expand_filename +{ + local ($pwd); + + $_ = @_[0]; + if (/^~/) + { + return $ENV{"HOME"} if /^~$/; + s|^~/|$ENV{"HOME"}/|; + } + return $_ if /^\//; + + chop ($pwd = `pwd`); + "$pwd/$_"; +} + +## Return the given directory normalized so the user will like +## it more. However, still avoid relative notations. + +sub normalize_directory +{ + return "~" if $_[0] eq $ENV{"HOME"}; + + $_ = $_[0]; + s|^$ENV{"HOME"}/|~/|; + chop ($_ = `cd $_; pwd`) if ! /^[~\/]/; + $_; +} + +## Ensure intermediate directories exist by creating them as needed, +## and that the appropriate permissions are set for the FILE to be +## created or replaced. + +sub prepare_filename +{ + local ($filename) = @_; + local (@filename, $counter); + + if (-e $filename) + { + &interrupt ("Cannot modify read-only file \`$filename\'") + if ! -w $filename; + return; + } + + @filename = split (/\//, $filename); + pop @filename; + + for ($counter = $filename[0] ? 0 : 1; $counter < @filename; $counter++) + { + $filename = join ("/", @filename[0 .. $counter]); + next if -d $filename; + &warn (" Creating new directory \`$filename\'"); + if (! mkdir ($filename, 0755)) + { + &interrupt ("Cannot create directory \`$filename\'"); + return; + } + } +} + +# Various services. + +## Convert IGNORE from previous "local" format to current "here" format. +## This routine is meant to disappear soon after everything stabilized. + +sub convert_ignore +{ + $_ = $_[0]; + + if (/^[\^\/](.*)/ || /(.*)[\$\/]$/) + { + if (/^\^(.*)/) + { + $_ = $1; + } + else + { + $_ = ".*$_"; + } + + if (/(.*)\$$/) + { + $_ = $1; + } + else + { + $_ = "$_.*"; + } + $save_config = 1; + } + + return $_; +} + +## Says whether if FILE should be ignored. + +sub ignorable_file +{ + local ($file) = @_; + + foreach (keys %ignore) + { + if (/^!(.*)/) + { + return 1 if $file !~ /^$1$/; + } + else + { + return 1 if $file =~ /^$_$/; + } + } + 0; +} + +## Initialize @site_set according to the given SET. + +sub decode_site_set +{ + local ($set) = @_; + local ($index, $counter); + + if ($set eq "") + { + @site_set = 0 .. @remote - 1; + } + elsif ($set eq "!") + { + @site_set = (); + } + elsif ($set =~ /!(.*)/) + { + @site_set = 0 .. @remote - 1; + foreach (split (" ", $1)) + { + $site_set[&validated_remote_index ($_)] = ""; + } + @site_set = grep (/./, @site_set); + } + else + { + @site_set = (); + @copy_list = (); # used to parallel "from" and "check" lines + $counter = 0; + foreach (split (" ", $set)) + { + $index = &validated_remote_index ($_); + $copy_list[$counter++] = $index; + $site_set[$index] = $index; + } + @site_set = grep (/./, @site_set); + } +} + +## Create a new REMOTE address with its related DIRECTORY. + +sub create_remote +{ + local ($remote, $directory) = @_; + + push (@remote, $remote); + $remote{$remote} = $directory; + foreach (keys %signature) + { + $signature{$_} .= " -"; + } + $save_config = 1; +} + +## Alter a REMOTE address to a NEW_REMOTE address, known to be equivalent. + +sub change_remote +{ + local ($remote, $new_remote) = @_; + + return if $remote eq $new_remote; + $remote[&validated_remote_index ($remote)] = $new_remote; + $remote{$new_remote} = $remote{$remote}; + delete $remote{$remote}; + $save_config = 1; +} + +## Destroy information related to a REMOTE address. + +sub delete_remote +{ + local ($remote) = @_; + local ($index); + + $index = &validated_remote_index ($remote); + @remote = @remote[0 .. $index - 1, $index + 1 .. @remote - 1]; + delete $remote{$remote}; + + foreach (keys %signature) + { + @signature = split (/ /, $signature{$_}); + $signature{$_} = join (" ", @signature[0 .. $index - 1, + $index + 1 .. @signature - 1]); + } + $save_config = 1; +} + +## Return the index of a given REMOTE, interrupting the command if not found. + +sub validated_remote_index +{ + local ($remote) = @_; + local ($index); + + $index = &remote_index ($remote); + return $index if $index >= 0; + &interrupt ("Specification \`$remote\' invalid for remote address"); +} + +## Return the index of a given REMOTE, or a negative value if not found. + +sub remote_index +{ + local ($remote) = @_; + local ($index); + + $remote = @remote[$remote - 1] if ($remote > 0 && $remote <= @remote); + $index = 0; + foreach (@remote) + { + return $index if $remote eq $_; + $index++; + } + -1; +} + +# Interactive dialog and error processing. + +## Query the user interactively with QUESTION, return the reply +## in $_. An empty reply means the default signature from the QUESTION +## if any, written as "...? [DEFAULT]". Echo the input if used +## in process. + +sub query +{ + local ($query) = @_; + + while (1) + { + print STDERR "\a$query "; + $_ = <>; + if ($_) + { + print STDERR if ! -t; + chop; + if (/^\?$/) + { + print STDERR $NORMAL_HELP; + next; + } + if (/^! *(.*)$/) + { + if ($1) + { + system $1; + } + elsif (defined $ENV{$SHELL}) + { + system $ENV{$SHELL}; + } + else + { + system $SH; + } + next; + } + if (/^abort$/) + { + if ($save_config) + { + &diagnose + ("Modifications to file \`$CONFIG\' are unsaved"); + &query ("Should I stop without saving them (y/n)? [n]"); + if (/^(y|yes)$/i) + { + $command_loop = 0; + $process_loop = 0; + &interrupt ("Program aborted!"); + } + } + &interrupt ("Command aborted!"); + } + $_ = $1 if (! $_ && $query =~ /\? \[(.+)\]$/); + return; + } + else + { + print STDERR "quit\n"; + $_ = "quit"; + return; + } + } +} + +## Issue a message for the (possibly interactive) user. + +sub warn +{ + warn " $_[0]\n"; +} + +## Issue an error message for the (possibly interactive) user. + +sub diagnose +{ + warn "* $_[0]\n"; +} + +## Issue an error message for the (possibly interactive) user, while +## interrupting the command being currently executed. Abort if none. + +sub interrupt +{ + if ($process_loop) + { + $workdir_to_unlink = ""; + $archive_to_unlink = ""; + %signature_received = (); + + warn "* $_[0]\n"; + last PROCESS_LOOP; + } + elsif ($command_loop) + { + warn "* $_[0]\n"; + next COMMAND_LOOP; + } + else + { + die "** $_[0]\n"; + } +} + +# Local Variables: +# mode: perl +# End: diff --git a/src/apps/bin/sharutils-4.2.1/src/shar b/src/apps/bin/sharutils-4.2.1/src/shar new file mode 100755 index 0000000000..3c54f188a5 Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/src/shar differ diff --git a/src/apps/bin/sharutils-4.2.1/src/shar.c b/src/apps/bin/sharutils-4.2.1/src/shar.c new file mode 100644 index 0000000000..d055caf50d --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/shar.c @@ -0,0 +1,2140 @@ +/* Handle so called `shell archives'. + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "system.h" + +static const char *cut_mark_line + = "---- Cut Here and feed the following to sh ----\n"; + +/* Delimiter to put after each file. */ +#define DEFAULT_HERE_DELIMITER "SHAR_EOF" + +/* Character which goes in front of each line. */ +#define DEFAULT_LINE_PREFIX_1 'X' + +/* Character which goes in front of each line if here_delimiter[0] == + DEFAULT_LINE_PREFIX_1. */ +#define DEFAULT_LINE_PREFIX_2 'Y' + +/* Shell command able to count characters from its standard input. We + have to take care for the locale setting because wc in multi-byte + character environments get different results. */ +#define CHARACTER_COUNT_COMMAND "LC_ALL= LC_CTYPE= LANG= wc -c <" + +/* Command computing MD5 sumof specified file. Because there is not + official standard for this we have to restrict ourself to a few + versions: GNU md5sum from GNU fileutils and the version by + Plumb/Lankester. */ +#define MD5SUM_COMMAND "md5sum" + +/* Maximum length for a text line before it is considered binary. */ +#define MAXIMUM_NON_BINARY_LINE 200 + +/* System related declarations. */ + +#include + +#if STDC_HEADERS +# define ISASCII(Char) 1 +#else +# ifdef isascii +# define ISASCII(Char) isascii (Char) +# else +# if HAVE_ISASCII +# define ISASCII(Char) isascii (Char) +# else +# define ISASCII(Char) ((Char) & 0x7f == (unsigned char) (Char)) +# endif +# endif +#endif + +#include + +struct tm *localtime (); + +#if !NO_WALKTREE + +/* Declare directory reading routines and structures. */ + +#ifdef __MSDOS__ +# include "msd_dir.h" +# define NAMLEN(dirent) ((dirent)->d_namlen) +#else +# if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) (strlen((dirent)->d_name)) +# else +# define dirent direct +# define NAMLEN(dirent) ((dirent)->d_namlen) +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +# endif +#endif + +DIR *opendir (); +struct dirent *readdir (); + +#endif /* !NO_WALKTREE */ + +/* Option variables. */ + +#include "getopt.h" +#include "md5.h" + +/* No Brown-Shirt mode. */ +static int vanilla_operation_mode = 0; + +/* Mixed text and binary files. */ +static int mixed_uuencoded_file_mode = -1; + +/* Flag for binary files. */ +static int uuencoded_file_mode = -1; + +/* Run input files through gzip (requires uuencoded_file_mode). */ +static int gzipped_file_mode = -1; + +/* -N option to gzip. */ +static int gzip_compression_level = 9; + +/* Run input files through compress (requires uuencoded_file_mode). */ +static int compressed_file_mode = -1; + +/* -bN option to compress */ +static int bits_per_compressed_byte = 12; + +/* Generate $shar_touch commands. */ +static int timestamp_mode = 1; + +/* Option to provide wc checking. */ +static int character_count_mode = 1; + +/* Option to provide MD5 sum checking. */ +static int md5_count_mode = 1; + +/* Use temp file instead of pipe to feed uudecode. This gives better + error detection, at expense of disk space. This is also necessary for + those versions of uudecode unwilling to read their standard input. */ +static int inhibit_piping_mode = 0; + +/* --no-i18n option to prevent internationalized shell archives. */ +static int no_i18n; + +/* Character to get at the beginning of each line. */ +static int line_prefix; + +/* Option to generate "Archive-name:" headers. */ +static int net_headers_mode = 0; + +/* Documentation name for archive. */ +static char *archive_name = NULL; + +/* Option to provide append feedback at shar time. */ +static int quiet_mode = 0; + +/* Option to provide extract feedback at unshar time. */ +static int quiet_unshar_mode = 0; + +/* Pointer to delimiter string. */ +static const char *here_delimiter = DEFAULT_HERE_DELIMITER; + +/* Value of strlen (here_delimiter). */ +static size_t here_delimiter_length; + +/* Use line_prefix even when first char does not force it. */ +static int mandatory_prefix_mode = 0; + +/* Option to provide cut mark. */ +static int cut_mark_mode = 0; + +/* Check if file exists. */ +static int check_existing_mode = 1; + +/* Interactive overwrite. */ +static int query_user_mode = 0; + +/* Allow positional parameters. */ +static int intermixed_parameter_mode = 0; + +/* Strip directories from filenames. */ +static int basename_mode; + +/* Switch for debugging on. */ +#if DEBUG +static int debugging_mode = 0; +#endif + +/* Split files in the middle. */ +static int split_file_mode = 0; + +/* File size limit in kilobytes. */ +static unsigned file_size_limit = 0; + +/* Other global variables. */ + +/* The name this program was run with. */ +const char *program_name; + +/* If non-zero, display usage information and exit. */ +static int show_help = 0; + +/* If non-zero, print the version on standard output and exit. */ +static int show_version = 0; + +/* File onto which the shar script is being written. */ +static FILE *output = NULL; + +/* Position for archive type message. */ +static off_t archive_type_position; + +/* Position for first file in the shar file. */ +static long first_file_position; + +/* Base for output filename. FIXME: No fix limit in GNU... */ +static char output_base_name[50]; + +/* Actual output filename. FIXME: No fix limit in GNU... */ +static char output_filename[50]; + +static char *submitter_address = NULL; + +/* Output file ordinal. FIXME: also flag for -o. */ +static int part_number = 0; + +/* Table saying whether each character is binary or not. */ +static unsigned char byte_is_binary[256]; + +/* For checking file type and access modes. */ +static struct stat struct_stat; + +/* Nonzero if special NLS option (--print-text-domain-dir) is selected. */ +static int print_text_dom_dir; + +/* The number used to make the intermediate files unique. */ +static int sharpid; + +#if DEBUG +# define DEBUG_PRINT(Format, Value) \ + if (debugging_mode) printf(Format, Value) +#else +# define DEBUG_PRINT(Format, Value) +#endif + +static void open_output __P ((void)); +static void close_output __P ((void)); +static void usage __P ((int)); + +/* Walking tree routines. */ + +/* Define a type just for easing ansi2knr's life. */ +typedef int (*walker_t) __P ((const char *, const char *)); + +#if !NO_WALKTREE + +/*--------------------------------------------------------------------------. +| Recursively call ROUTINE on each entry, down the directory tree. NAME | +| is the path to explore. RESTORE_NAME is the name that will be later | +| relative to the unsharing directory. ROUTINE may also assume | +| struct_stat is set, it accepts updated values for NAME and RESTORE_NAME. | +`--------------------------------------------------------------------------*/ + +static int +walkdown (routine, local_name, restore_name) + walker_t routine; + const char *local_name; + const char *restore_name; +{ + DIR *directory; /* directory being scanned */ + struct dirent *entry; /* current entry in directory */ + int status; /* status to return */ + + char *local_name_copy; /* writeable copy of local_name */ + size_t local_name_length; /* number of characters in local_name_copy */ + size_t sizeof_local_name; /* allocated size of local_name_copy */ + + char *restore_name_copy; /* writeable copy of restore_name */ + size_t restore_name_length; /* number of characters in restore_name_copy */ + size_t sizeof_restore_name; /* allocated size of restore_name_copy */ + + if (stat (local_name, &struct_stat)) + { + error (0, errno, local_name); + return 1; + } + + if (!S_ISDIR (struct_stat.st_mode & S_IFMT)) + return (*routine) (local_name, restore_name); + + if (directory = opendir (local_name), !directory) + { + error (0, errno, local_name); + return 1; + } + + status = 0; + + local_name_copy = xstrdup (local_name); + local_name_length = strlen (local_name_copy); + sizeof_local_name = local_name_length + 1; + + restore_name_copy = xstrdup (restore_name); + restore_name_length = strlen (restore_name_copy); + sizeof_restore_name = restore_name_length + 1; + + while (!status && (entry = readdir (directory), entry)) + if (strcmp (entry->d_name, ".") && strcmp (entry->d_name, "..")) + { + int added_size = 1 + NAMLEN (entry); + + /* Update file names, reallocating them as required. */ + + if (local_name_length + added_size + 1 > sizeof_local_name) + { + sizeof_local_name = local_name_length + added_size + 1; + local_name_copy = (char *) + xrealloc (local_name_copy, sizeof_local_name); + } + sprintf (local_name_copy + local_name_length, "/%s", entry->d_name); + + if (restore_name_length + added_size + 1 > sizeof_restore_name) + { + sizeof_restore_name = restore_name_length + added_size + 1; + restore_name_copy = (char *) + xrealloc (restore_name_copy, sizeof_restore_name); + } + sprintf (restore_name_copy + restore_name_length, "/%s", + entry->d_name); + + /* Avoid restoring `./xxx' when shar'ing `.'. */ + + if (!strncmp (restore_name, "./", 2)) + { + strcpy (restore_name_copy, restore_name_copy + 2); + restore_name_length -= 2; + } + + status = walkdown (routine, local_name_copy, restore_name_copy); + } + + /* Clean up. */ + + if (sizeof_local_name > 0) + free (local_name_copy); + if (sizeof_restore_name > 0) + free (restore_name_copy); + +#if CLOSEDIR_VOID + closedir (directory); +#else + if (closedir (directory)) + { + error (0, errno, local_name); + return 1; + } +#endif + + return status; +} + +#endif /* !NO_WALKTREE */ + +/*------------------------------------------------------------------. +| Walk through the directory tree, calling ROUTINE for each entry. | +| ROUTINE may also assume struct_stat is set. | +`------------------------------------------------------------------*/ + +static int +walktree (routine, local_name) + walker_t routine; + const char *local_name; +{ + const char *restore_name; + char *local_name_copy; + char *cursor; + int status; + int len; + + /* Remove crumb at end. */ + + len = strlen (local_name); + local_name_copy = (char *) alloca (len + 1); + memcpy (local_name_copy, local_name, len + 1); + cursor = local_name_copy + len - 1; + while (*cursor == '/' && cursor > local_name_copy) + *cursor-- = '\0'; + + /* Remove crumb at beginning. */ + + if (basename_mode) + restore_name = basename (local_name_copy); + else if (!strncmp (local_name_copy, "./", 2)) + restore_name = local_name_copy + 2; + else + restore_name = local_name_copy; + +#if NO_WALKTREE + + /* Just act on current entry. */ + + status = stat (local_name_copy, &struct_stat); + if (status != 0) + error (0, errno, local_name_copy); + else + status = (*routine) (local_name_copy, restore_name); + +#else + + /* Walk recursively. */ + + status = walkdown (routine, local_name_copy, restore_name); + +#endif + + return status; +} + +/* Generating parts of shar file. */ + +/*---------------------------------------------------------------------. +| Build a `drwxrwxrwx' string corresponding to MODE into MODE_STRING. | +`---------------------------------------------------------------------*/ + +static char * +mode_string (mode) + unsigned mode; +{ + static char result[12]; + + strcpy (result, "----------"); + + if (mode & 00400) + result[1] = 'r'; + if (mode & 00200) + result[2] = 'w'; + if (mode & 00100) + result[3] = 'x'; + if (mode & 04000) + result[3] = 's'; + if (mode & 00040) + result[4] = 'r'; + if (mode & 00020) + result[5] = 'w'; + if (mode & 00010) + result[6] = 'x'; + if (mode & 02000) + result[6] = 's'; + if (mode & 00004) + result[7] = 'r'; + if (mode & 00002) + result[8] = 'w'; + if (mode & 00001) + result[9] = 'x'; + + return result; +} + +/*-----------------------------------------------------------------------. +| Generate shell code which, at *unshar* time, will study the properties | +| of the unpacking system and set some variables accordingly. | +`-----------------------------------------------------------------------*/ + +static void +generate_configure () +{ + if (no_i18n) + fputs ("echo=echo\n", output); + else + { + fprintf (output, "\ +save_IFS=\"${IFS}\"\n\ +IFS=\"${IFS}:\"\n\ +gettext_dir=FAILED\n\ +locale_dir=FAILED\n\ +first_param=\"$1\"\n\ +for dir in $PATH\n\ +do\n\ + if test \"$gettext_dir\" = FAILED && test -f $dir/gettext \\\n\ + && ($dir/gettext --version >/dev/null 2>&1)\n\ + then\n\ + set `$dir/gettext --version 2>&1`\n\ + if test \"$3\" = GNU\n\ + then\n\ + gettext_dir=$dir\n\ + fi\n\ + fi\n\ + if test \"$locale_dir\" = FAILED && test -f $dir/%s \\\n\ + && ($dir/%s --print-text-domain-dir >/dev/null 2>&1)\n\ + then\n\ + locale_dir=`$dir/%s --print-text-domain-dir`\n\ + fi\n\ +done\n\ +IFS=\"$save_IFS\"\n\ +if test \"$locale_dir\" = FAILED || test \"$gettext_dir\" = FAILED\n\ +then\n\ + echo=echo\n\ +else\n\ + TEXTDOMAINDIR=$locale_dir\n\ + export TEXTDOMAINDIR\n\ + TEXTDOMAIN=sharutils\n\ + export TEXTDOMAIN\n\ + echo=\"$gettext_dir/gettext -s\"\n\ +fi\n", + "shar", "shar", "shar"); + /* Above the name of the program of the package which supports the + --print-text-domain-dir option has to be given. */ + } + + if (query_user_mode) + if (vanilla_operation_mode) + fputs ("\ +shar_tty= shar_n= shar_c='\n\ +'\n", + output); + else + { + + /* Check if /dev/tty exists. If yes, define shar_tty to + `/dev/tty', else, leave it empty. */ + + fputs ("\ +if test -n \"`ls /dev/tty 2>/dev/null`\"; then\n\ + shar_tty=/dev/tty\n\ +else\n\ + shar_tty=\n\ +fi\n", + output); + + /* Try to find a way to echo a message without newline. Set + shar_n to `-n' or nothing for an echo option, and shar_c to + `\c' or nothing for a string terminator. */ + + fputs ("\ +if (echo \"testing\\c\"; echo 1,2,3) | grep c >/dev/null; then\n\ + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then\n\ + shar_n= shar_c='\n\ +'\n\ + else\n\ + shar_n=-n shar_c=\n\ + fi\n\ +else\n\ + shar_n= shar_c='\\c'\n\ +fi\n", + output); + } + + if (timestamp_mode) + { + const char *file = "$$.touch"; + const char *stamp1 = "200112312359.59"; + const char *stamp2 = "123123592001.59"; + const char *stamp2tr = "123123592001.5"; /* old SysV 14-char limit */ + const char *stamp3 = "1231235901"; + + /* Set the shell variable shar_touch to an appropriate invocation + of `touch' if the touch program is proven able to restore dates. + Otherwise, set shar_touch to `:' and issue a warning. */ + + fprintf (output, "\ +if touch -am -t %s %s >/dev/null 2>&1 && test ! -f %s -a -f %s; then\n\ + shar_touch='touch -am -t $1$2$3$4$5$6.$7 \"$8\"'\n\ +elif touch -am %s %s >/dev/null 2>&1 && test ! -f %s -a ! -f %s -a -f %s; then\n\ + shar_touch='touch -am $3$4$5$6$1$2.$7 \"$8\"'\n\ +elif touch -am %s %s >/dev/null 2>&1 && test ! -f %s -a -f %s; then\n\ + shar_touch='touch -am $3$4$5$6$2 \"$8\"'\n\ +else\n\ + shar_touch=:\n\ + echo\n\ + $echo '%s'\n\ + $echo \"%s\"\n\ + echo\n\ +fi\n\ +rm -f %s %s %s %s %s\n\ +#\n", + stamp1, file, stamp1, file, + stamp2, file, stamp2, stamp2tr, file, + stamp3, file, stamp3, file, + N_("\ +WARNING: not restoring timestamps. Consider getting and"), + N_("\ +installing GNU \\`touch', distributed in GNU File Utilities..."), + stamp1, stamp2, stamp2tr, stamp3, file); + } + + if (!split_file_mode || part_number == 1) + { + /* Create locking directory. */ + fprintf (output, "\ +if mkdir _sh%05d; then\n\ + $echo 'x -' '%s'\n\ +else\n\ + $echo '%s'\n\ + exit 1\n\ +fi\n", + sharpid, N_("creating lock directory"), + N_("failed to create lock directory")); + } +} + +/*---. +| ? | +`---*/ + +/* Ridiculously enough. FIXME: No fix limit in GNU... */ +#define MAX_MKDIR_ALREADY 128 + +char *mkdir_already[MAX_MKDIR_ALREADY]; +int mkdir_already_count = 0; + +static void +generate_mkdir (path) + const char *path; +{ + int counter; + char *cursor; + + /* If already generated code for this dir creation, don't do again. */ + + for (counter = 0; counter < mkdir_already_count; counter++) + if (!strcmp (path, mkdir_already[counter])) + return; + + /* Haven't done this one. */ + + if (mkdir_already_count == MAX_MKDIR_ALREADY) + error (EXIT_FAILURE, 0, _("Too many directories for mkdir generation")); + cursor = mkdir_already[mkdir_already_count++] = xmalloc (strlen (path) + 1); + strcpy (cursor, path); + + /* Generate the text. */ + + fprintf (output, "if test ! -d '%s'; then\n", path); + if (!quiet_unshar_mode) + fprintf (output, " $echo 'x -' '%s' '%s'\n", + N_("creating directory"), path); + fprintf (output, " mkdir '%s'\n", path); + fputs ("fi\n", output); +} + +/*---. +| ? | +`---*/ + +static void +generate_mkdir_script (path) + const char *path; +{ + char *cursor; + + for (cursor = strchr (path, '/'); cursor; cursor = strchr (cursor + 1, '/')) + { + + /* Avoid empty string if leading or double '/'. */ + + if (cursor == path || *(cursor - 1) == '/') + continue; + + /* Omit '.'. */ + + if (cursor[-1] == '.' && (cursor == path + 1 || cursor[-2] == '/')) + continue; + + /* Temporarily terminate string. FIXME! */ + + *cursor = 0; + generate_mkdir (path); + *cursor = '/'; + } +} + +/* Walking routines. */ + +/*---. +| ? | +`---*/ + +static int +check_accessibility (local_name, restore_name) + const char *local_name; + const char *restore_name; +{ + if (access (local_name, 4)) + { + error (0, 0, _("Cannot access %s"), local_name); + return 1; + } + + return 0; +} + +/*---. +| ? | +`---*/ + +static int +generate_one_header_line (local_name, restore_name) + const char *local_name; + const char *restore_name; +{ + fprintf (output, "# %6ld %s %s\n", struct_stat.st_size, + mode_string (struct_stat.st_mode), restore_name); + return 0; +} + +/*---. +| ? | +`---*/ + +static void +generate_full_header (argc, argv) + int argc; + char *const *argv; +{ + char *current_directory; + time_t now; + struct tm *local_time; + char buffer[80]; /* FIXME: No fix limit in GNU... */ + int warned_once; + int counter; + + warned_once = 0; + for (counter = 0; counter < argc; counter++) + { + + /* Skip positional parameters. */ + + if (intermixed_parameter_mode && + (strcmp (argv[counter], "-B") == 0 || + strcmp (argv[counter], "-T") == 0 || + strcmp (argv[counter], "-M") == 0 || + strcmp (argv[counter], "-z") == 0 || + strcmp (argv[counter], "-Z") == 0 || + strcmp (argv[counter], "-C") == 0)) + { + if (!warned_once && strcmp (argv[counter], "-C") == 0) + { + error (0, 0, _("-C is being deprecated, use -Z instead")); + warned_once = 1; + } + continue; + } + + if (walktree (check_accessibility, argv[counter])) + exit (EXIT_FAILURE); + } + + if (net_headers_mode) + { + fprintf (output, "Submitted-by: %s\n", submitter_address); + fprintf (output, "Archive-name: %s%s%02d\n\n", + archive_name, (strchr (archive_name, '/')) ? "" : "/part", + part_number ? part_number : 1); + } + + if (cut_mark_mode) + fputs (cut_mark_line, output); + fputs ("\ +#!/bin/sh\n", + output); + if (archive_name) + fprintf (output, "\ +# This is %s, a shell archive (produced by GNU %s %s)\n", + archive_name, PACKAGE, VERSION); + else + fprintf (output, "\ +# This is a shell archive (produced by GNU %s %s).\n", + PACKAGE, VERSION); + fputs ("\ +# To extract the files from this archive, save it to some FILE, remove\n\ +# everything before the `!/bin/sh' line above, then type `sh FILE'.\n\ +#\n", + output); + + time (&now); + local_time = localtime (&now); + strftime (buffer, 79, "%Y-%m-%d %H:%M %Z", local_time); + fprintf (output, "\ +# Made on %s by <%s>.\n", + buffer, submitter_address); + + current_directory = xgetcwd (); + if (current_directory) + { + fprintf (output, "\ +# Source directory was `%s'.\n", + current_directory); + free (current_directory); + } + else + error (0, errno, _("Cannot get current directory name")); + + if (check_existing_mode) + fputs ("\ +#\n\ +# Existing files will *not* be overwritten unless `-c' is specified.\n", + output); + else if (query_user_mode) + fputs ("\ +#\n\ +# existing files MAY be overwritten\n", + output); + else + fputs ("\ +#\n\ +# existing files WILL be overwritten\n", + output); + + if (query_user_mode) + fputs ("\ +# The unsharer will be INTERACTIVELY queried.\n", + output); + + if (vanilla_operation_mode) + { + fputs ("\ +# This format requires very little intelligence at unshar time.\n\ +# ", + output); + if (check_existing_mode || split_file_mode) + fputs ("\"if test\", ", output); + if (split_file_mode) + fputs ("\"cat\", \"rm\", ", output); + fputs ("\"echo\", \"mkdir\", and \"sed\" may be needed.\n", output); + } + + if (split_file_mode) + { + + /* May be split, explain. */ + + fputs ("#\n", output); + archive_type_position = ftell (output); + fprintf (output, "%-75s\n%-75s\n", "#", "#"); + } + + fputs ("\ +#\n\ +# This shar contains:\n\ +# length mode name\n\ +# ------ ---------- ------------------------------------------\n", + output); + + for (counter = 0; counter < argc; counter++) + { + + /* Output names of files but not parameters. */ + + if (intermixed_parameter_mode && + (strcmp (argv[counter], "-B") == 0 || + strcmp (argv[counter], "-T") == 0 || + strcmp (argv[counter], "-M") == 0 || + strcmp (argv[counter], "-z") == 0 || + strcmp (argv[counter], "-Z") == 0 || + strcmp (argv[counter], "-C") == 0)) + continue; + + if (walktree (generate_one_header_line, argv[counter])) + exit (EXIT_FAILURE); + } + fputs ("#\n", output); + + generate_configure (); + + if (split_file_mode) + { + + /* Now check the sequence. */ + + fprintf (output, "\ +if test -r _sh%05d/seq; then\n\ + $echo '%s'\n\ + $echo '%s' '`cat _sh%05d/seq`' '%s'\n\ + exit 1\n\ +fi\n", + sharpid, + N_("Must unpack archives in sequence!"), + N_("Please unpack part"), sharpid, N_("next!") +); + } +} + +/* Prepare a shar script. */ + +/*---. +| ? | +`---*/ + +static int +shar (local_name, restore_name) + const char *local_name; + const char *restore_name; +{ + char buffer[BUFSIZ]; + FILE *input; + long current_size; + long remaining_size; + int split_flag = 0; /* file split flag */ + const char *file_type; /* text of binary */ + const char *file_type_remote; /* text or binary, avoiding locale */ + struct tm *restore_time; + + /* Check to see that this is still a regular file and readable. */ + + if (!S_ISREG (struct_stat.st_mode & S_IFMT)) + { + error (0, 0, _("%s: Not a regular file"), local_name); + return 1; + } + if (access (local_name, 4)) + { + error (0, 0, _("Cannot access %s"), local_name); + return 1; + } + + /* If file_size_limit set, get the current output length. */ + + if (file_size_limit) + { + current_size = ftell (output); + remaining_size = (file_size_limit * 1024L) - current_size; + DEBUG_PRINT (_("In shar: remaining size %ld\n"), remaining_size); + + if (!split_file_mode && current_size > first_file_position + && ((uuencoded_file_mode + ? struct_stat.st_size + struct_stat.st_size / 3 + : struct_stat.st_size) + > remaining_size)) + { + + /* Change to another file. */ + + DEBUG_PRINT (_("Newfile, remaining %ld, "), remaining_size); + DEBUG_PRINT (_("Limit still %d\n"), file_size_limit); + + /* Close the "&&" and report an error if any of the above + failed. */ + + /* The following code is somewhat unreadable because marking + the strings is necessary. The complete string is (nice + formatted: +: || $echo 'restore of %s failed'\n\ +echo 'End of part %d, continue with part %d'\n\ +exit 0\n", + */ + fprintf (output, "\ +: || $echo '%s' '%s' '%s'\n\ +$echo '%s' '%d,' '%s' '%d'\n\ +exit 0\n", + N_("restore of"), restore_name, N_("failed"), + N_("End of part"), part_number, + N_("continue with part"), part_number + 1); + + close_output (); + + /* Clear mkdir_already in case the user unshars out of order. */ + + while (mkdir_already_count > 0) + free (mkdir_already[--mkdir_already_count]); + + /* Form the next filename. */ + + open_output (); + if (!quiet_mode) + fprintf (stderr, _("Starting file %s\n"), output_filename); + + if (net_headers_mode) + { + fprintf (output, "Submitted-by: %s\n", submitter_address); + fprintf (output, "Archive-name: %s%s%02d\n\n", archive_name, + strchr (archive_name, '/') ? "" : "/part", + part_number ? part_number : 1); + } + + if (cut_mark_mode) + fputs (cut_mark_line, output); + + fprintf (output, "\ +#!/bin/sh\n\ +# This is part %02d of %s.\n", + part_number, + archive_name ? archive_name : "a multipart archive"); + + generate_configure (); + + first_file_position = ftell (output); + } + } + else + remaining_size = 0; /* give some value to the variable */ + + fprintf (output, "\ +# ============= %s ==============\n", + restore_name); + + generate_mkdir_script (restore_name); + + if (struct_stat.st_size == 0) + { + file_type = _("empty"); + file_type_remote = N_("(empty)"); + input = NULL; /* give some value to the variable */ + } + else + { + + /* If mixed, determine the file type. */ + + if (mixed_uuencoded_file_mode) + { + + /* Uuencoded was once decided through calling the `file' + program and studying its output: the method was slow and + error prone. There is only one way of doing it correctly, + and this is to read the input file, seeking for one binary + character. Considering the average file size, even reading + the whole file (if it is text) would be usually faster than + calling `file'. */ + + int character; + int line_length; + + if (input = fopen (local_name, "rb"), input == NULL) + { + error (0, errno, _("Cannot open file %s"), local_name); + return 1; + } + + /* Assume initially that the input file is text. Then try to prove + it is binary by looking for binary characters or long lines. */ + + uuencoded_file_mode = 0; + line_length = 0; + while (character = getc (input), character != EOF) + if (character == '\n') + line_length = 0; + else if ( +#ifdef __CHAR_UNSIGNED__ + byte_is_binary[character] +#else + byte_is_binary[character & 0xFF] +#endif + || line_length == MAXIMUM_NON_BINARY_LINE) + { + uuencoded_file_mode = 1; + break; + } + else + line_length++; + fclose (input); + + /* Text files should terminate by an end of line. */ + + if (line_length > 0) + uuencoded_file_mode = 1; + } + + if (uuencoded_file_mode) + { + static int pid, pipex[2]; + + file_type = (compressed_file_mode ? _("compressed") + : gzipped_file_mode ? _("gzipped") : _("binary")); + file_type_remote = (compressed_file_mode ? N_("(compressed)") + : gzipped_file_mode ? N_("(gzipped)") + : N_("(binary)")); + + /* Fork a uuencode process. */ + + pipe (pipex); + fflush (output); + + if (pid = fork (), pid != 0) + { + + /* Parent, create a file to read. */ + + if (pid < 0) + error (EXIT_FAILURE, errno, _("Could not fork")); + close (pipex[1]); + input = fdopen (pipex[0], "r"); + if (!input) + { + error (0, errno, _("File %s (%s)"), local_name, file_type); + return 1; + } + } + else + { + + /* Start writing the pipe with encodes. */ + + FILE *outptr; + + if (compressed_file_mode) + { + sprintf (buffer, "compress -b%d < '%s'", + bits_per_compressed_byte, local_name); + input = popen (buffer, "r"); + } + else if (gzipped_file_mode) + { + sprintf (buffer, "gzip -%d < '%s'", + gzip_compression_level, local_name); + input = popen (buffer, "r"); + } + else + input = fopen (local_name, "rb"); + + outptr = fdopen (pipex[1], "w"); + fputs ("begin 600 ", outptr); + if (compressed_file_mode) + fprintf (outptr, "_sh%05d/cmp\n", sharpid); + else if (gzipped_file_mode) + fprintf (outptr, "_sh%05d/gzi\n", sharpid); + else + fprintf (outptr, "%s\n", restore_name); + copy_file_encoded (input, outptr); + fprintf (outptr, "end\n"); + if (compressed_file_mode || gzipped_file_mode) + pclose (input); + else + fclose (input); + + exit (EXIT_SUCCESS); + } + } + else + { + file_type = _("text"); + file_type_remote = N_("(text)"); + + input = fopen (local_name, "r"); + if (!input) + { + error (0, errno, _("File %s (%s)"), local_name, file_type); + return 1; + } + } + } + + /* Protect existing files. */ + + if (check_existing_mode) + { + fprintf (output, "\ +if test -f '%s' && test \"$first_param\" != -c; then\n", + restore_name); + + if (query_user_mode) + { + fprintf (output, "\ + case $shar_wish in\n\ + A*|a*)\n\ + $echo 'x -' %s '%s' ;;\n\ + *)\n\ + $echo $shar_n '? -' %s '%s' '%s' $shar_c\n\ + if test -n \"$shar_tty\"; then\n\ + read shar_wish < $shar_tty\n\ + else\n\ + read shar_wish\n\ + fi ;;\n\ + esac\n\ + case $shar_wish in\n\ + Q*|q*)\n\ + $echo '%s'; exit 1 ;;\n\ + A*|a*|Y*|y*)\n\ + shar_skip=no ;;\n\ + *)\n\ + shar_skip=yes ;;\n\ + esac\n\ +else\n\ + shar_skip=no\n\ +fi\n\ +if test $shar_skip = yes; then\n\ + $echo 'x -' %s '%s'\n", + N_("overwriting"), restore_name, + N_("overwrite"), restore_name, + N_("[no, yes, all, quit] (no)?"), + N_("extraction aborted"), + N_("SKIPPING"), restore_name); + } + else + fprintf (output, "\ + $echo 'x -' %s '%s' '%s'\n", + N_("SKIPPING"), restore_name, N_("(file already exists)")); + + if (split_file_mode) + fprintf (output, "\ + rm -f _sh%05d/new\n", + sharpid); + + fputs ("\ +else\n", + output); + + if (split_file_mode) + fprintf (output, "\ + > _sh%05d/new\n", + sharpid); + } + + if (!quiet_mode) + error (0, 0, _("Saving %s (%s)"), local_name, file_type); + + if (!quiet_unshar_mode) + fprintf (output, "\ + $echo 'x -' %s '%s' '%s'\n", + N_("extracting"), restore_name, file_type_remote); + + if (struct_stat.st_size == 0) + { + + /* Just touch the file, or empty it if it exists. */ + + fprintf (output, "\ + > '%s' &&\n", + restore_name); + } + else + { + + /* Run sed for non-empty files. */ + + if (uuencoded_file_mode) + { + + /* Run sed through uudecode (via temp file if might get split). */ + + fprintf (output, "\ + sed 's/^%c//' << '%s' ", + line_prefix, here_delimiter); + if (inhibit_piping_mode) + fprintf (output, "> _sh%05d/uue &&\n", sharpid); + else + fputs ("| uudecode &&\n", output); + } + else + { + + /* Just run it into the file. */ + + fprintf (output, "\ + sed 's/^%c//' << '%s' > '%s' &&\n", + line_prefix, here_delimiter, restore_name); + } + + while (fgets (buffer, BUFSIZ, input)) + { + + /* Output a line and test the length. */ + + if (!mandatory_prefix_mode + && ISASCII (buffer[0]) +#ifdef isgraph + && isgraph (buffer[0]) +#else + && isprint (buffer[0]) && !isspace (buffer[0]) +#endif + /* Protect lines already starting with the prefix. */ + && buffer[0] != line_prefix + + /* Old mail programs interpret ~ directives. */ + && buffer[0] != '~' + + /* Avoid mailing lines which are just `.'. */ + && buffer[0] != '.' + +#if STRNCMP_IS_FAST + && strncmp (buffer, here_delimiter, here_delimiter_length) + + /* unshar -e: avoid `exit 0'. */ + && strncmp (buffer, "exit 0", 6) + + /* Don't let mail prepend a `>'. */ + && strncmp (buffer, "From", 4) +#else + && (buffer[0] != here_delimiter[0] + || strncmp (buffer, here_delimiter, here_delimiter_length)) + + /* unshar -e: avoid `exit 0'. */ + && (buffer[0] != 'e' || strncmp (buffer, "exit 0", 6)) + + /* Don't let mail prepend a `>'. */ + && (buffer[0] != 'F' || strncmp (buffer, "From", 4)) +#endif + ) + fputs (buffer, output); + else + { + fprintf (output, "%c%s", line_prefix, buffer); + remaining_size--; + } + + /* Try completing an incomplete line, but not if the incomplete + line contains no character. This might occur with -T for + incomplete files, or sometimes when switching to a new file. */ + + if (*buffer && buffer[strlen (buffer) - 1] != '\n') + { + putc ('\n', output); + remaining_size--; + } + + if (split_file_mode +#if MSDOS + /* 1 extra for CR. */ + && (remaining_size -= (int) strlen (buffer) + 1) < 0 +#else + && (remaining_size -= (int) strlen (buffer)) < 0 +#endif + ) + { + + /* Change to another file. */ + + DEBUG_PRINT (_("Newfile, remaining %ld, "), remaining_size); + DEBUG_PRINT (_("Limit still %d\n"), file_size_limit); + + fprintf (output, "%s\n", here_delimiter); + + /* Close the "&&" and report an error if any of the above + failed. */ + + fprintf (output, "\ + : || $echo '%s' '%s' '%s'\n", + N_("restore of"), restore_name, N_("failed")); + + if (check_existing_mode) + fputs ("\ +fi\n", + output); + + if (quiet_unshar_mode) + fprintf (output, "\ +$echo '%s' '%d,' '%s' '%d'\n", + N_("End of part"), part_number, + N_("continue with part"), part_number + 1); + else + fprintf (output, "\ +$echo '%s' '%s' '%s' '%d'\n\ +$echo '%s' '%s' '%s' '%d'\n", + N_("End of"), + archive_name ? archive_name : N_("archive"), + N_("part"), + part_number, + N_("File"), restore_name, + N_("is continued in part"), part_number + 1); + + fprintf (output, "\ +echo %d > _sh%05d/seq\n\ +exit 0\n", + part_number + 1, sharpid); + + if (part_number == 1) + { + + /* Rewrite the info lines on the first header. */ + + fseek (output, archive_type_position, 0); + fprintf (output, "%-75s\n%-75s\n", + "\ +# This is part 1 of a multipart archive.", + "\ +# Do not concatenate these parts, unpack them in order with `/bin/sh'."); + } + close_output (); + + /* Next! */ + + open_output (); + + if (net_headers_mode) + { + fprintf (output, "Submitted-by: %s\n", submitter_address); + fprintf (output, "Archive-name: %s%s%02d\n\n", + archive_name, + strchr (archive_name, '/') ? "" : "/part", + part_number ? part_number : 1); + } + + if (cut_mark_mode) + fputs (cut_mark_line, output); + + fprintf (output, "\ +#!/bin/sh\n\ +# This is `%s' (part %d of %s).\n\ +# Do not concatenate these parts, unpack them in order with `/bin/sh'.\n\ +# File `%s' is being continued...\n\ +#\n", + basename (output_filename), part_number, + archive_name ? archive_name : "a multipart archive", + restore_name); + + generate_configure (); + + fprintf (output, "\ +if test ! -r _sh%05d/seq; then\n\ + $echo '%s'\n\ + exit 1\n\ +fi\n\ +shar_sequence=`cat _sh%05d/seq`\n\ +if test \"$shar_sequence\" != %d; then\n\ + $echo '%s' \"$shar_sequence\" '%s'\n\ + exit 1\n\ +fi\n", + sharpid, + N_("Please unpack part 1 first!"), + sharpid, + part_number, + N_("Please unpack part"), + N_("next!")); + + if (check_existing_mode) + if (quiet_unshar_mode) + fprintf (output, "\ +if test -f _sh%05d/new; then\n", + sharpid); + else + fprintf (output, "\ +if test ! -f _sh%05d/new; then\n\ + $echo 'x -' '%s' '%s'\n\ +else\n", + sharpid, + N_("STILL SKIPPING"), restore_name); + + if (!quiet_mode) + fprintf (stderr, _("Starting file %s\n"), output_filename); + if (!quiet_unshar_mode) + fprintf (output, "\ + $echo 'x -' '%s' '%s'\n", + N_("continuing file"), restore_name); + fprintf (output, "\ + sed 's/^%c//' << '%s' >> ", + line_prefix, here_delimiter); + if (uuencoded_file_mode) + fprintf (output, "_sh%05d/uue &&\n", sharpid); + else + fprintf (output, "%s &&\n", restore_name); + remaining_size = file_size_limit * 1024L; + split_flag = 1; + } + } + + fclose (input); + while (wait (NULL) >= 0) + ; + + fprintf (output, "%s\n", here_delimiter); + if (split_flag && !quiet_unshar_mode) + fprintf (output, "\ + $echo '%s' '%s' '%s' &&\n", + N_("File"), restore_name, N_("is complete")); + + /* If this file was uuencoded w/Split, decode it and drop the temp. */ + + if (uuencoded_file_mode && inhibit_piping_mode) + { + if (!quiet_unshar_mode) + fprintf (output, "\ + $echo '%s' '%s' &&\n", + N_("uudecoding file"), restore_name); + + fprintf (output, "\ + uudecode _sh%05d/uue < _sh%05d/uue &&\n", + sharpid, sharpid); + } + + /* If this file was compressed, uncompress it and drop the temp. */ + + if (compressed_file_mode) + { + if (!quiet_unshar_mode) + fprintf (output, "\ + $echo '%s' '%s' &&\n", + N_("uncompressing file"), restore_name); + + fprintf (output, "\ + compress -d < _sh%05d/cmp > '%s' &&\n", + sharpid, restore_name); + } + else if (gzipped_file_mode) + { + if (!quiet_unshar_mode) + fprintf (output, "\ + $echo '%s' '%s' &&\n", + N_("gunzipping file"), restore_name); + + fprintf (output, "\ + gzip -d < _sh%05d/gzi > '%s' &&\n", + sharpid, restore_name); + } + } + + if (timestamp_mode) + { + + /* Set the dates as they were. */ + + restore_time = localtime (&struct_stat.st_mtime); + fprintf (output, "\ + (set %02d %02d %02d %02d %02d %02d %02d '%s'; eval \"$shar_touch\") &&\n", + (restore_time->tm_year + 1900) / 100, + (restore_time->tm_year + 1900) % 100, + restore_time->tm_mon + 1, restore_time->tm_mday, + restore_time->tm_hour, restore_time->tm_min, + restore_time->tm_sec, restore_name); + } + + if (vanilla_operation_mode) + { + + /* Close the "&&" and report an error if any of the above + failed. */ + + fprintf (output, "\ + : || $echo '%s' '%s' '%s'\n", + N_("restore of"), restore_name, N_("failed")); + } + else + { + unsigned char md5buffer[16]; + FILE *fp = NULL; + int did_md5 = 0; + + /* Set the permissions as they were. */ + + fprintf (output, "\ + chmod %04o '%s' ||\n", + (unsigned) (struct_stat.st_mode & 0777), restore_name); + + /* Report an error if any of the above failed. */ + + fprintf (output, "\ + $echo '%s' '%s' '%s'\n", + N_("restore of"), restore_name, N_("failed")); + + if (md5_count_mode && (fp = fopen (local_name, "r")) != NULL + && md5_stream (fp, md5buffer) == 0) + { + /* Validate the transferred file using `md5sum' command. */ + size_t cnt; + did_md5 = 1; + + fprintf (output, "\ + if ( %s --help 2>&1 | grep 'sage: md5sum \\[' ) >/dev/null 2>&1 \\\n\ + && ( %s --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then\n\ + %s -c << %s >/dev/null 2>&1 \\\n\ + || $echo '%s:' '%s'\n", + MD5SUM_COMMAND, MD5SUM_COMMAND, MD5SUM_COMMAND, + DEFAULT_HERE_DELIMITER, local_name, N_("MD5 check failed")); + + for (cnt = 0; cnt < 16; ++cnt) + fprintf (output, "%02x", md5buffer[cnt]); + + fprintf (output, " %c%s\n\ +%s\n", + ' ', local_name, DEFAULT_HERE_DELIMITER); + /* This ^^^ space is not necessarily a parameter now. But it + is a flag for binary/text mode and will perhaps be used later. */ + } + + if (fp != NULL) + fclose (fp); + + if (character_count_mode) + { + /* Validate the transferred file using simple `wc' command. */ + + FILE *pfp; + char command[BUFSIZ]; + + sprintf (command, "%s '%s'", CHARACTER_COUNT_COMMAND, local_name); + if (pfp = popen (command, "r"), pfp) + { + char wc[BUFSIZ]; + const char *prefix = ""; + + if (did_md5) + { + fputs (" else\n", output); + prefix = " "; + } + + fscanf (pfp, "%s", wc); + fprintf (output, "\ +%s shar_count=\"`%s '%s'`\"\n\ +%s test %s -eq \"$shar_count\" ||\n\ +%s $echo '%s:' '%s' '%s,' '%s' \"$shar_count!\"\n", + prefix, CHARACTER_COUNT_COMMAND, restore_name, + prefix, wc, + prefix, restore_name, N_("original size"), wc, + N_("current size")); + pclose (pfp); + } + } + if (did_md5) + fputs (" fi\n", output); + } + + /* If the exists option is in place close the if. */ + + if (check_existing_mode) + fputs ("\ +fi\n", + output); + + return 0; +} + +/* Main control. */ + +/*-----------------------------------------------------------------------. +| Set file mode, accepting a parameter 'M' for mixed uuencoded mode, 'B' | +| for uuencoded mode, 'z' for gzipped mode or 'Z' for compressed mode. | +| Any other value yields text mode. | +`-----------------------------------------------------------------------*/ + +static void +set_file_mode (mode) + int mode; +{ + mixed_uuencoded_file_mode = mode == 'M'; + uuencoded_file_mode = mode == 'B'; + gzipped_file_mode = mode == 'z'; + compressed_file_mode = mode == 'Z'; + + if (gzipped_file_mode || compressed_file_mode) + uuencoded_file_mode = 1; +} + +/*-------------------------------------------. +| Open the next output file, or die trying. | +`-------------------------------------------*/ + +static void +open_output () +{ + sprintf (output_filename, output_base_name, ++part_number); + output = fopen (output_filename, "w"); + if (!output) + error (EXIT_FAILURE, errno, _("Opening `%s'"), output_filename); +} + +/*-----------------------------------------------. +| Close the current output file, or die trying. | +`-----------------------------------------------*/ + +static void +close_output () +{ + if (fclose (output) != 0) + error (EXIT_FAILURE, errno, _("Closing `%s'"), output_filename); +} + +/*----------------------------------. +| Output a command format message. | +`----------------------------------*/ + +static void +usage (status) + int status; +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name); + fputs (_("\ +Mandatory arguments to long options are mandatory for short options too.\n"), + stdout); + fputs (_("\ +\n\ +Giving feedback:\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ + -q, --quiet, --silent do not output verbose messages locally\n\ +\n\ +Selecting files:\n\ + -p, --intermix-type allow -[BTzZ] in file lists to change mode\n\ + -S, --stdin-file-list read file list from standard input\n\ +\n\ +Splitting output:\n\ + -o, --output-prefix=PREFIX output to file PREFIX.01 through PREFIX.NN\n\ + -l, --whole-size-limit=SIZE split archive, not files, to SIZE kilobytes\n\ + -L, --split-size-limit=SIZE split archive, or files, to SIZE kilobytes\n"), + stdout); + fputs (_("\ +\n\ +Controlling the shar headers:\n\ + -n, --archive-name=NAME use NAME to document the archive\n\ + -s, --submitter=ADDRESS override the submitter name\n\ + -a, --net-headers output Submitted-by: & Archive-name: headers\n\ + -c, --cut-mark start the shar with a cut line\n\ +\n\ +Selecting how files are stocked:\n\ + -M, --mixed-uuencode dynamically decide uuencoding (default)\n\ + -T, --text-files treat all files as text\n\ + -B, --uuencode treat all files as binary, use uuencode\n\ + -z, --gzip gzip and uuencode all files\n\ + -g, --level-for-gzip=LEVEL pass -LEVEL (default 9) to gzip\n\ + -Z, --compress compress and uuencode all files\n\ + -b, --bits-per-code=BITS pass -bBITS (default 12) to compress\n"), + stdout); + fputs (_("\ +\n\ +Protecting against transmission:\n\ + -w, --no-character-count do not use `wc -c' to check size\n\ + -D, --no-md5-digest do not use `md5sum' digest to verify\n\ + -F, --force-prefix force the prefix character on every line\n\ + -d, --here-delimiter=STRING use STRING to delimit the files in the shar\n\ +\n\ +Producing different kinds of shars:\n\ + -V, --vanilla-operation produce very simple and undemanding shars\n\ + -P, --no-piping exclusively use temporary files at unshar time\n\ + -x, --no-check-existing blindly overwrite existing files\n\ + -X, --query-user ask user before overwriting files (not for Net)\n\ + -m, --no-timestamp do not restore file modification dates & times\n\ + -Q, --quiet-unshar avoid verbose messages at unshar time\n\ + -f, --basename restore in one directory, despite hierarchy\n\ + --no-i18n do not produce internationalized shell script\n"), + stdout); + fputs (_("\ +\n\ +Option -o is required with -l or -L, option -n is required with -a.\n\ +Option -g implies -z, option -b implies -Z.\n"), + stdout); + } + exit (status); +} + +/*--------------------------------------. +| Decode options and launch execution. | +`--------------------------------------*/ + +static const struct option long_options[] = +{ + {"archive-name", required_argument, NULL, 'n'}, + {"basename", no_argument, NULL, 'f'}, + {"bits-per-code", required_argument, NULL, 'b'}, + {"compress", no_argument, NULL, 'Z'}, + {"cut-mark", no_argument, NULL, 'c'}, + {"force-prefix", no_argument, NULL, 'F'}, + {"gzip", no_argument, NULL, 'z'}, + {"here-delimiter", required_argument, NULL, 'd'}, + {"intermix-type", no_argument, NULL, 'p'}, + {"level-for-gzip", required_argument, NULL, 'g'}, + {"mixed-uuencode", no_argument, NULL, 'M'}, + {"net-headers", no_argument, NULL, 'a'}, + {"no-character-count", no_argument, &character_count_mode, 0}, + {"no-check-existing", no_argument, NULL, 'x'}, + {"no-i18n", no_argument, &no_i18n, 1}, + {"no-md5-digest", no_argument, &md5_count_mode, 0}, + {"no-piping", no_argument, NULL, 'P'}, + {"no-timestamp", no_argument, NULL, 'm'}, + {"output-prefix", required_argument, NULL, 'o'}, + {"print-text-domain-dir", no_argument, &print_text_dom_dir, 1}, + {"query-user", no_argument, NULL, 'X'}, + {"quiet", no_argument, NULL, 'q'}, + {"quiet-unshar", no_argument, NULL, 'Q'}, + {"split-size-limit", required_argument, NULL, 'L'}, + {"stdin-file-list", no_argument, NULL, 'S'}, + {"submitter", required_argument, NULL, 's'}, + {"text-files", no_argument, NULL, 'T'}, + {"uuencode", no_argument, NULL, 'B'}, + {"vanilla-operation", no_argument, NULL, 'V'}, + {"whole-size-limit", required_argument, NULL, 'l'}, + + {"help", no_argument, &show_help, 1}, + {"version", no_argument, &show_version, 1}, + + { NULL, 0, NULL, 0 }, +}; + +/*---. +| ? | +`---*/ + +int +main (argc, argv) + int argc; + char *const *argv; +{ + int status = EXIT_SUCCESS; + int stdin_file_list = 0; + int optchar; + + program_name = argv[0]; + sharpid = (int) getpid (); + setlocale (LC_ALL, ""); + + /* Set the text message domain. */ + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + while (optchar = getopt_long (argc, argv, + "+$BCDFL:MPQSTVXZab:cd:fg:hl:mn:o:pqs:wxz", + long_options, NULL), + optchar != EOF) + switch (optchar) + { + case '\0': + break; + + case '$': +#if DEBUG + debugging_mode = 1; +#else + error (0, 0, _("DEBUG was not selected at compile time")); +#endif + break; + + case 'B': + set_file_mode ('B'); + break; + + case 'D': + md5_count_mode = 0; + break; + + case 'F': + mandatory_prefix_mode = 1; + break; + + case 'L': + if (file_size_limit = atoi (optarg), file_size_limit > 1) + file_size_limit--; + split_file_mode = file_size_limit != 0; + inhibit_piping_mode = 1; + DEBUG_PRINT (_("Hard limit %dk\n"), file_size_limit); + break; + + case 'M': + set_file_mode ('M'); + break; + + case 'P': + inhibit_piping_mode = 1; + break; + + case 'Q': + quiet_unshar_mode = 1; + break; + + case 'S': + stdin_file_list = 1; + break; + + case 'V': + vanilla_operation_mode = 1; + break; + + case 'T': + set_file_mode ('T'); + break; + + case 'X': + query_user_mode = 1; + check_existing_mode = 1; + break; + + case 'b': + bits_per_compressed_byte = atoi (optarg); + /* Fall through. */ + + case 'C': + case 'Z': + if (optchar == 'C') + error (0, 0, _("-C is being deprecated, use -Z instead")); + set_file_mode ('Z'); + break; + + case 'a': + net_headers_mode = 1; + break; + + case 'c': + cut_mark_mode = 1; + break; + + case 'd': + here_delimiter = optarg; + break; + + case 'f': + basename_mode = 1; + break; + + case 'h': + usage (EXIT_SUCCESS); + break; + + case 'l': + if (file_size_limit = atoi (optarg), file_size_limit > 1) + file_size_limit--; + split_file_mode = 0; + DEBUG_PRINT (_("Soft limit %dk\n"), file_size_limit); + break; + + case 'm': + timestamp_mode = 0; + break; + + case 'n': + archive_name = optarg; + break; + + case 'o': + strcpy (output_base_name, optarg); + if (!strchr (output_base_name, '%')) + strcat (output_base_name, ".%02d"); + part_number = 0; + open_output (); + break; + + case 'p': + intermixed_parameter_mode = 1; + break; + + case 'q': + quiet_mode = 1; + break; + + case 's': + submitter_address = optarg; + break; + + case 'w': + character_count_mode = 0; + break; + + case 'x': + check_existing_mode = 0; + break; + + case 'g': + gzip_compression_level = atoi (optarg); + /* Fall through. */ + + case 'z': + set_file_mode ('z'); + break; + + default: + usage (EXIT_FAILURE); + } + + /* Internationalized shell scripts are not vanilla. */ + if (vanilla_operation_mode) + no_i18n = 1; + + if (show_version) + { + printf ("%s - GNU %s %s\n", program_name, PACKAGE, VERSION); + exit (EXIT_SUCCESS); + } + + if (show_help) + usage (EXIT_SUCCESS); + + if (print_text_dom_dir != 0) + { + /* Support for internationalized shell scripts is only usable with + GNU gettext. If we don't use it simply mark it as not available. */ +#if !defined ENABLE_NLS || defined HAVE_CATGETS \ + || (defined HAVE_GETTEXT && !defined __USE_GNU_GETTEXT) + exit (EXIT_FAILURE); +#else + extern const char _nl_default_dirname[]; /* Defined in dcgettext.c */ + puts (_nl_default_dirname); + exit (EXIT_SUCCESS); +#endif + } + + line_prefix = (here_delimiter[0] == DEFAULT_LINE_PREFIX_1 + ? DEFAULT_LINE_PREFIX_2 + : DEFAULT_LINE_PREFIX_1); + + here_delimiter_length = strlen (here_delimiter); + + if (vanilla_operation_mode) + { + if (mixed_uuencoded_file_mode < 0) + set_file_mode ('T'); + + /* Implies -m, -w, -D, -F and -P. */ + + timestamp_mode = 0; + character_count_mode = 0; + md5_count_mode = 0; + mandatory_prefix_mode = 1; + inhibit_piping_mode = 1; + + /* Forbids -X. */ + + if (query_user_mode) + { + error (0, 0, _("WARNING: No user interaction in vanilla mode")); + query_user_mode = 0; + } + + /* Diagnose if not in -T state. */ + + if (mixed_uuencoded_file_mode + || uuencoded_file_mode + || gzipped_file_mode + || compressed_file_mode + || intermixed_parameter_mode) + error (0, 0, _("WARNING: Non-text storage options overridden")); + } + + /* Set defaults for unset options. */ + + if (mixed_uuencoded_file_mode < 0) + set_file_mode ('M'); + + if (!submitter_address) + submitter_address = get_submitter (NULL); + + if (!output) + output = stdout; + + /* Maybe prepare to decide dynamically about file type. */ + + if (mixed_uuencoded_file_mode || intermixed_parameter_mode) + { + memset ((char *) byte_is_binary, 1, 256); + byte_is_binary['\b'] = 0; + byte_is_binary['\t'] = 0; + byte_is_binary['\f'] = 0; + memset ((char *) byte_is_binary + 32, 0, 127 - 32); + } + + /* Maybe read file list from standard input. */ + + if (stdin_file_list) + { + char stdin_buf[258]; /* FIXME: No fix limit in GNU... */ + char **list; + int max_argc; + + argc = 0; + max_argc = 32; + list = (char **) xmalloc (max_argc * sizeof (char *)); + stdin_buf[0] = 0; + while (fgets (stdin_buf, sizeof (stdin_buf), stdin)) + { + if (argc == max_argc) + list = (char **) xrealloc (list, + (max_argc *= 2) * sizeof (char *)); + if (stdin_buf[0] != '\0') + stdin_buf[strlen (stdin_buf) - 1] = 0; + list[argc] = xstrdup (stdin_buf); + ++argc; + stdin_buf[0] = 0; + } + argv = list; + optind = 0; + } + + /* Diagnose various usage errors. */ + + if (optind >= argc) + { + error (0, 0, _("No input files")); + usage (EXIT_FAILURE); + } + + if (net_headers_mode && !archive_name) + { + error (0, 0, _("Cannot use -a option without -n")); + usage (EXIT_FAILURE); + } + + if (file_size_limit && !part_number) + { + error (0, 0, _("Cannot use -l or -L option without -o")); + usage (EXIT_FAILURE); + } + + /* Start making the archive file. */ + + generate_full_header (argc - optind, &argv[optind]); + + if (query_user_mode) + { + quiet_unshar_mode = 0; + if (net_headers_mode) + error (0, 0, _("PLEASE avoid -X shars on Usenet or public networks")); + + fputs ("\ +shar_wish=\n", + output); + } + + first_file_position = ftell (output); + + /* Process positional parameters and files. */ + + for (; optind < argc; optind++) + if (intermixed_parameter_mode) + if (strcmp (argv[optind], "-B") == 0) + set_file_mode ('B'); + else if (strcmp (argv[optind], "-T") == 0) + set_file_mode ('T'); + else if (strcmp (argv[optind], "-M") == 0) + set_file_mode ('M'); + else if (strcmp (argv[optind], "-z") == 0) + set_file_mode ('z'); + else if (strcmp (argv[optind], "-Z") == 0 + || strcmp (argv[optind], "-C") == 0) + set_file_mode ('Z'); + else + { + if (walktree (shar, argv[optind])) + status = EXIT_FAILURE; + } + else + { + if (walktree (shar, argv[optind])) + status = EXIT_FAILURE; + } + + /* Delete the sequence file, if any. */ + + if (split_file_mode && part_number > 1) + { + fprintf (output, "\ +$echo '%s'\n", + N_("You have unpacked the last part")); + if (quiet_mode) + fprintf (stderr, _("Created %d files\n"), part_number); + } + + fprintf (output, "\ +rm -fr _sh%05d\n\ +exit 0\n", + sharpid); + + exit (status); +} diff --git a/src/apps/bin/sharutils-4.2.1/src/unshar b/src/apps/bin/sharutils-4.2.1/src/unshar new file mode 100755 index 0000000000..bb41a5331b Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/src/unshar differ diff --git a/src/apps/bin/sharutils-4.2.1/src/unshar.c b/src/apps/bin/sharutils-4.2.1/src/unshar.c new file mode 100644 index 0000000000..214ade2ab4 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/unshar.c @@ -0,0 +1,450 @@ +/* Handle so called `shell archives'. + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* Unpackage one or more shell archive files. The `unshar' program is a + filter which removes the front part of a file and passes the rest to + the `sh' command. It understands phrases like "cut here", and also + knows about shell comment characters and the Unix commands `echo', + `cat', and `sed'. */ + +#include "system.h" +#include "getopt.h" + +/* Buffer size for holding a file name. FIXME: No fix limit in GNU... */ +#define NAME_BUFFER_SIZE 1024 + +/* Buffer size for shell process input. */ +#define SHELL_BUFFER_SIZE 8196 + +#define EOL '\n' + +/* The name this program was run with. */ +const char *program_name; + +/* If non-zero, display usage information and exit. */ +static int show_help = 0; + +/* If non-zero, print the version on standard output and exit. */ +static int show_version = 0; + +static int pass_c_flag = 0; +static int continue_reading = 0; +static const char *exit_string = "exit 0"; +static size_t exit_string_length; +static char *current_directory; + +/*-------------------------------------------------------------------. +| Match the leftmost part of a string. Returns 1 if initial | +| characters of DATA match PATTERN exactly; else 0. This was | +| formerly a function. But because we always have a constant string | +| as the seconf argument and the length of the second argument is a | +| lot of shorter than the buffer the first argument is pointing at, | +| we simply use `memcmp'. And one more point: even if the `memcmp' | +| function does not work correct for 8 bit characters it does not | +| matter here. We are only interested in equal or not equal | +| information. | +`-------------------------------------------------------------------*/ + +#define starting_with(data, pattern) \ + (memcmp (data, pattern, sizeof (pattern) - 1) == 0) + + +/*-------------------------------------------------------------------------. +| For a DATA string and a PATTERN containing one or more embedded | +| asterisks (matching any number of characters), return non-zero if the | +| match succeeds, and set RESULT_ARRAY[I] to the characters matched by the | +| I'th *. | +`-------------------------------------------------------------------------*/ + +static int +matched_by (data, pattern, result_array) + const char *data; + const char *pattern; + char **result_array; +{ + const char *pattern_cursor = NULL; + const char *data_cursor = NULL; + char *result_cursor = NULL; + int number_of_results = 0; + + while (1) + if (*pattern == '*') + { + pattern_cursor = ++pattern; + data_cursor = data; + result_cursor = result_array[number_of_results++]; + *result_cursor = '\0'; + } + else if (*data == *pattern) + { + if (*pattern == '\0') + /* The pattern matches. */ + return 1; + + pattern++; + data++; + } + else + { + if (*data == '\0') + /* The pattern fails: no more data. */ + return 0; + + if (pattern_cursor == NULL) + /* The pattern fails: no star to adjust. */ + return 0; + + /* Restart pattern after star. */ + + pattern = pattern_cursor; + *result_cursor++ = *data_cursor; + *result_cursor = '\0'; + + /* Rescan after copied char. */ + + data = ++data_cursor; + } +} + +/*------------------------------------------------------------------------. +| Associated with a given file NAME, position FILE at the start of the | +| shell command portion of a shell archive file. Scan file from position | +| START. | +`------------------------------------------------------------------------*/ + +static int +find_archive (name, file, start) + const char *name; + FILE *file; + off_t start; +{ + char buffer[BUFSIZ]; + off_t position; + + /* Results from star matcher. */ + + static char res1[BUFSIZ], res2[BUFSIZ], res3[BUFSIZ], res4[BUFSIZ]; + static char *result[] = {res1, res2, res3, res4}; + + fseek (file, start, 0); + + while (1) + { + + /* Record position of the start of this line. */ + + position = ftell (file); + + /* Read next line, fail if no more and no previous process. */ + + if (!fgets (buffer, BUFSIZ, file)) + { + if (!start) + error (0, 0, _("Found no shell commands in %s"), name); + return 0; + } + + /* Bail out if we see C preprocessor commands or C comments. */ + + if (starting_with (buffer, "#include") + || starting_with (buffer, "# include") + || starting_with (buffer, "#define") + || starting_with (buffer, "# define") + || starting_with (buffer, "#ifdef") + || starting_with (buffer, "# ifdef") + || starting_with (buffer, "#ifndef") + || starting_with (buffer, "# ifndef") + || starting_with (buffer, "/*")) + { + error (0, 0, _("%s looks like raw C code, not a shell archive"), + name); + return 0; + } + + /* Does this line start with a shell command or comment. */ + + if (starting_with (buffer, "#") + || starting_with (buffer, ":") + || starting_with (buffer, "echo ") + || starting_with (buffer, "sed ") + || starting_with (buffer, "cat ") + || starting_with (buffer, "if ")) + { + fseek (file, position, 0); + return 1; + } + + /* Does this line say "Cut here". */ + + if (matched_by (buffer, "*CUT*HERE*", result) || + matched_by (buffer, "*cut*here*", result) || + matched_by (buffer, "*TEAR*HERE*", result) || + matched_by (buffer, "*tear*here*", result) || + matched_by (buffer, "*CUT*CUT*", result) || + matched_by (buffer, "*cut*cut*", result)) + { + + /* Read next line after "cut here", skipping blank lines. */ + + while (1) + { + position = ftell (file); + + if (!fgets (buffer, BUFSIZ, file)) + { + error (0, 0, _("Found no shell commands after `cut' in %s"), + name); + return 0; + } + + if (*buffer != '\n') + break; + } + + /* Win if line starts with a comment character of lower case + letter. */ + + if (*buffer == '#' || *buffer == ':' + || (('a' <= *buffer) && ('z' >= *buffer))) + { + fseek (file, position, 0); + return 1; + } + + /* Cut here message lied to us. */ + + error (0, 0, _("%s is probably not a shell archive"), name); + error (0, 0, _("The `cut' line was followed by: %s"), buffer); + return 0; + } + } +} + +/*-----------------------------------------------------------------. +| Unarchive a shar file provided on file NAME. The file itself is | +| provided on the already opened FILE. | +`-----------------------------------------------------------------*/ + +static void +unarchive_shar_file (name, file) + const char *name; + FILE *file; +{ + char buffer[SHELL_BUFFER_SIZE]; + FILE *shell_process; + off_t current_position = 0; + char *more_to_read; + + while (find_archive (name, file, current_position)) + { + printf ("%s:\n", name); + shell_process = popen (pass_c_flag ? "sh -s - -c" : "sh", "w"); + if (!shell_process) + error (EXIT_FAILURE, errno, _("Starting `sh' process")); + + if (!continue_reading) + { + size_t len; + + while ((len = fread (buffer, 1, SHELL_BUFFER_SIZE, file)) != 0) + fwrite (buffer, 1, len, shell_process); +#if 0 + /* Don't know whether a test is appropriate here. */ + if (ferror (shell_process) != 0) + fwrite (buffer, length, 1, shell_process); +#endif + pclose (shell_process); + break; + } + else + { + while (more_to_read = fgets (buffer, SHELL_BUFFER_SIZE, file), + more_to_read != NULL) + { + fputs (buffer, shell_process); + if (!strncmp (exit_string, buffer, exit_string_length)) + break; + } + pclose (shell_process); + + if (more_to_read) + current_position = ftell (file); + else + break; + } + } +} + +/*-----------------------------. +| Explain how to use program. | +`-----------------------------*/ + +static void +usage (status) + int status; +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name); + fputs (_("\ +Mandatory arguments to long options are mandatory for short options too.\n\ +\n\ + -d, --directory=DIRECTORY change to DIRECTORY before unpacking\n\ + -c, --overwrite pass -c to shar script for overwriting files\n\ + -e, --exit-0 same as `--split-at=\"exit 0\"'\n\ + -E, --split-at=STRING split concatenated shars after STRING\n\ + -f, --force same as `-c'\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ +\n\ +If no FILE, standard input is read.\n"), + stdout); + } + exit (status); +} + +/*--------------------------------------. +| Decode options and launch execution. | +`--------------------------------------*/ + +static const struct option long_options[] = +{ + {"directory", required_argument, NULL, 'd'}, + {"exit-0", no_argument, NULL, 'e'}, + {"force", no_argument, NULL, 'f'}, + {"overwrite", no_argument, NULL, 'c'}, + {"split-at", required_argument, NULL, 'E'}, + + {"help", no_argument, &show_help, 1}, + {"version", no_argument, &show_version, 1}, + + { NULL, 0, NULL, 0 }, +}; + +int +main (argc, argv) + int argc; + char *const *argv; +{ + size_t size_read; + FILE *file; + char name_buffer[NAME_BUFFER_SIZE]; + char copy_buffer[NAME_BUFFER_SIZE]; + int optchar; + + program_name = argv[0]; + setlocale (LC_ALL, ""); + + /* Set the text message domain. */ + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + +#ifdef __MSDOS__ + setbuf (stdout, NULL); + setbuf (stderr, NULL); +#endif + + if (current_directory = xgetcwd (), !current_directory) + error (EXIT_FAILURE, errno, _("Cannot get current directory name")); + + /* Process options. */ + + while (optchar = getopt_long (argc, argv, "E:cd:ef", long_options, NULL), + optchar != EOF) + switch (optchar) + { + case '\0': + break; + + case 'c': + case 'f': + pass_c_flag = 1; + break; + + case 'd': + if (chdir (optarg) == -1) + error (2, 0, _("Cannot chdir to `%s'"), optarg); + break; + + case 'E': + exit_string = optarg; + /* Fall through. */ + + case 'e': + continue_reading = 1; + exit_string_length = strlen (exit_string); + break; + + default: + usage (EXIT_FAILURE); + } + + if (show_version) + { + printf ("%s - GNU %s %s\n", program_name, PACKAGE, VERSION); + exit (EXIT_SUCCESS); + } + + if (show_help) + usage (EXIT_SUCCESS); + + if (optind < argc) + for (; optind < argc; optind++) + { + if (argv[optind][0] == '/') + stpcpy (name_buffer, argv[optind]); + else + { + char *cp = stpcpy (name_buffer, current_directory); + *cp++ = '/'; + stpcpy (cp, argv[optind]); + } + if (file = fopen (name_buffer, "r"), !file) + error (EXIT_FAILURE, errno, name_buffer); + unarchive_shar_file (name_buffer, file); + fclose (file); + } + else + { + sprintf (name_buffer, "/tmp/unsh.%05d", (int) getpid ()); + unlink (name_buffer); + + if (file = fopen (name_buffer, "w+"), !file) + error (EXIT_FAILURE, errno, name_buffer); +#ifndef __MSDOS__ + unlink (name_buffer); /* will be deleted on fclose */ +#endif + + while (size_read = fread (copy_buffer, 1, sizeof (copy_buffer), stdin), + size_read != 0) + fwrite (copy_buffer, size_read, 1, file); + rewind (file); + + unarchive_shar_file (_("standard input"), file); + + fclose (file); +#ifdef __MSDOS__ + unlink (name_buffer); +#endif + } + + exit (EXIT_SUCCESS); +} diff --git a/src/apps/bin/sharutils-4.2.1/src/uudecode b/src/apps/bin/sharutils-4.2.1/src/uudecode new file mode 100755 index 0000000000..9184c77a0a Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/src/uudecode differ diff --git a/src/apps/bin/sharutils-4.2.1/src/uudecode.c b/src/apps/bin/sharutils-4.2.1/src/uudecode.c new file mode 100644 index 0000000000..50e1dc00fd --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/uudecode.c @@ -0,0 +1,448 @@ +/* uudecode utility. + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + + This product 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 product 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 product; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* Copyright (c) 1983 Regents of the University of California. + 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. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the University of + California, Berkeley and its contributors. + 4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. */ + +/* Reworked to GNU style by Ian Lance Taylor, ian@airs.com, August 93. */ + +#include "system.h" + +/*=====================================================================\ +| uudecode [FILE ...] | +| | +| Create the specified FILE, decoding as you go. Used with uuencode. | +\=====================================================================*/ + +#include +#include "getopt.h" + +struct passwd *getpwnam (); + +static struct option longopts[] = +{ + { "version", no_argument, NULL, 'v' }, + { "help", no_argument, NULL, 'h' }, + { "output-file", required_argument, NULL, 'o' }, + { NULL, 0, NULL, 0 } +}; + +static int read_stduu __P ((const char *inname)); +static int read_base64 __P ((const char *inname)); +static int decode __P ((const char *, const char *)); +static void usage __P ((int)); + +/* The name this program was run with. */ +const char *program_name; + +/* Single character decode. */ +#define DEC(Char) (((Char) - ' ') & 077) + + +static int +read_stduu (inname) + const char *inname; +{ + char buf[2 * BUFSIZ]; + + while (1) + { + int n; + char *p; + + if (fgets (buf, sizeof(buf), stdin) == NULL) + { + error (0, 0, _("%s: Short file"), inname); + return 1; + } + p = buf; + + /* N is used to avoid writing out all the characters at the end of + the file. */ + + n = DEC (*p); + if (n <= 0) + break; + for (++p; n > 0; p += 4, n -= 3) + { + char ch; + + if (n >= 3) + { + ch = DEC (p[0]) << 2 | DEC (p[1]) >> 4; + putchar (ch); + ch = DEC (p[1]) << 4 | DEC (p[2]) >> 2; + putchar (ch); + ch = DEC (p[2]) << 6 | DEC (p[3]); + putchar (ch); + } + else + { + if (n >= 1) + { + ch = DEC (p[0]) << 2 | DEC (p[1]) >> 4; + putchar (ch); + } + if (n >= 2) + { + ch = DEC (p[1]) << 4 | DEC (p[2]) >> 2; + putchar (ch); + } + } + } + } + + if (fgets (buf, sizeof(buf), stdin) == NULL + || strcmp (buf, "end\n")) + { + error (0, 0, _("%s: No `end' line"), inname); + return 1; + } + + return 0; +} + +static int +read_base64 (inname) + const char *inname; +{ + static const char b64_tab[256] = + { + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*000-007*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*010-017*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*020-027*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*030-037*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*040-047*/ + '\177', '\177', '\177', '\76', '\177', '\177', '\177', '\77', /*050-057*/ + '\64', '\65', '\66', '\67', '\70', '\71', '\72', '\73', /*060-067*/ + '\74', '\75', '\177', '\177', '\177', '\100', '\177', '\177', /*070-077*/ + '\177', '\0', '\1', '\2', '\3', '\4', '\5', '\6', /*100-107*/ + '\7', '\10', '\11', '\12', '\13', '\14', '\15', '\16', /*110-117*/ + '\17', '\20', '\21', '\22', '\23', '\24', '\25', '\26', /*120-127*/ + '\27', '\30', '\31', '\177', '\177', '\177', '\177', '\177', /*130-137*/ + '\177', '\32', '\33', '\34', '\35', '\36', '\37', '\40', /*140-147*/ + '\41', '\42', '\43', '\44', '\45', '\46', '\47', '\50', /*150-157*/ + '\51', '\52', '\53', '\54', '\55', '\56', '\57', '\60', /*160-167*/ + '\61', '\62', '\63', '\177', '\177', '\177', '\177', '\177', /*170-177*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*200-207*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*210-217*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*220-227*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*230-237*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*240-247*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*250-257*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*260-267*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*270-277*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*300-307*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*310-317*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*320-327*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*330-337*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*340-347*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*350-357*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*360-367*/ + '\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*370-377*/ + }; + unsigned char buf[2 * BUFSIZ]; + + while (1) + { + int last_data = 0; + unsigned char *p; + + if (fgets (buf, sizeof(buf), stdin) == NULL) + { + error (0, 0, _("%s: Short file"), inname); + return 1; + } + p = buf; + + if (memcmp (buf, "====", 4) == 0) + break; + if (last_data != 0) + { + error (0, 0, _("%s: data following `=' padding character"), inname); + return 1; + } + + /* The following implementation of the base64 decoding might look + a bit clumsy but I only try to follow the POSIX standard: + ``All line breaks or other characters not found in the table + [with base64 characters] shall be ignored by decoding + software.'' */ + while (*p != '\n') + { + char c1, c2, c3; + + while ((b64_tab[*p] & '\100') != 0) + if (*p == '\n' || *p++ == '=') + break; + if (*p == '\n') + /* This leaves the loop. */ + continue; + c1 = b64_tab[*p++]; + + while ((b64_tab[*p] & '\100') != 0) + if (*p == '\n' || *p++ == '=') + { + error (0, 0, _("%s: illegal line"), inname); + return 1; + } + c2 = b64_tab[*p++]; + + while (b64_tab[*p] == '\177') + if (*p++ == '\n') + { + error (0, 0, _("%s: illegal line"), inname); + return 1; + } + if (*p == '=') + { + putchar (c1 << 2 | c2 >> 4); + last_data = 1; + break; + } + c3 = b64_tab[*p++]; + + while (b64_tab[*p] == '\177') + if (*p++ == '\n') + { + error (0, 0, _("%s: illegal line"), inname); + return 1; + } + putchar (c1 << 2 | c2 >> 4); + putchar (c2 << 4 | c3 >> 2); + if (*p == '=') + { + last_data = 1; + break; + } + else + putchar (c3 << 6 | b64_tab[*p++]); + } + } + + return 0; +} + + +static int +decode (inname, forced_outname) + const char *inname; + const char *forced_outname; +{ + struct passwd *pw; + register int n; + register char *p; + int mode, n1; + char buf[2 * BUFSIZ]; + char *outname; + int do_base64 = 0; + + /* Search for header line. */ + + while (1) + { + if (fgets (buf, sizeof (buf), stdin) == NULL) + { + error (0, 0, _("%s: No `begin' line"), inname); + return 1; + } + + if (strncmp (buf, "begin", 5) == 0) + { + if (sscanf (buf, "begin-base64 %o %s", &mode, buf) == 2) + { + do_base64 = 1; + break; + } + else if (sscanf (buf, "begin %o %s", &mode, buf) == 2) + break; + } + } + + /* If the output file name is given on the command line this rules. */ + if (forced_outname != NULL) + outname = (char *) forced_outname; + else + { + /* Handle ~user/file format. */ + + if (buf[0] != '~') + outname = buf; + else + { + p = buf + 1; + while (*p != '/') + ++p; + if (*p == '\0') + { + error (0, 0, _("%s: Illegal ~user"), inname); + return 1; + } + *p++ = '\0'; + pw = getpwnam (buf + 1); + if (pw == NULL) + { + error (0, 0, _("%s: No user `%s'"), inname, buf + 1); + return 1; + } + n = strlen (pw->pw_dir); + n1 = strlen (p); + outname = (char *) alloca ((size_t) (n + n1 + 2)); + memcpy (outname + n + 1, p, (size_t) (n1 + 1)); + memcpy (outname, pw->pw_dir, (size_t) n); + outname[n] = '/'; + } + } + + /* Create output file and set mode. */ + + if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0 + && (freopen (outname, "w", stdout) == NULL +#if HAVE_FCHMOD + || fchmod (fileno (stdout), mode & (S_IRWXU | S_IRWXG | S_IRWXO)) +#else + || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO)) +#endif + )) + { + error (0, errno, "%s: %s", outname, inname); + return 1; + } + + /* We differenciate decoding standard UU encoding and base64. A + common function would only slow down the program. */ + + /* For each input line: */ + if (do_base64) + return read_base64 (inname); + else + return read_stduu (inname); +} + +static void +usage (status) + int status; +{ + if (status != 0) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("Usage: %s [FILE]...\n"), program_name); + printf (_("\ +Mandatory arguments to long options are mandatory to short options too.\n\ + -h, --help display this help and exit\n\ + -v, --version output version information and exit\n\ + -o, --output-file=FILE direct output to FILE\n")); + } + exit (status); +} + +int +main (argc, argv) + int argc; + char *const *argv; +{ + int opt; + int exit_status; + const char *outname; + + program_name = argv[0]; + outname = NULL; + setlocale (LC_ALL, ""); + + /* Set the text message domain. */ + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + while (opt = getopt_long (argc, argv, "ho:v", longopts, (int *) NULL), + opt != EOF) + { + switch (opt) + { + case 'h': + usage (EXIT_SUCCESS); + + case 'o': + outname = optarg; + break; + + case 'v': + printf ("%s - GNU %s %s\n", program_name, PACKAGE, VERSION); + exit (EXIT_SUCCESS); + + case 0: + break; + + default: + usage (EXIT_FAILURE); + } + } + + if (optind == argc) + exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE; + else + { + exit_status = EXIT_SUCCESS; + do + { + if (freopen (argv[optind], "r", stdin) != NULL) + { + if (decode (argv[optind], outname) != 0) + exit_status = EXIT_FAILURE; + } + else + { + error (0, errno, "%s", argv[optind]); + exit_status = EXIT_FAILURE; + } + optind++; + } + while (optind < argc); + } + + exit (exit_status); +} diff --git a/src/apps/bin/sharutils-4.2.1/src/uuencode b/src/apps/bin/sharutils-4.2.1/src/uuencode new file mode 100755 index 0000000000..8baa689789 Binary files /dev/null and b/src/apps/bin/sharutils-4.2.1/src/uuencode differ diff --git a/src/apps/bin/sharutils-4.2.1/src/uuencode.c b/src/apps/bin/sharutils-4.2.1/src/uuencode.c new file mode 100644 index 0000000000..349d7bdb45 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/src/uuencode.c @@ -0,0 +1,299 @@ +/* uuencode utility. + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + + This product 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 product 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 product; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* Copyright (c) 1983 Regents of the University of California. + 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. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the University of + California, Berkeley and its contributors. + 4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. */ + +/* Reworked to GNU style by Ian Lance Taylor, ian@airs.com, August 93. */ + +#include "system.h" + +/*=======================================================\ +| uuencode [INPUT] OUTPUT | +| | +| Encode a file so it can be mailed to a remote system. | +\=======================================================*/ + +#include "getopt.h" + +#define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) + +static struct option longopts[] = +{ + { "base64", 0, 0, 'm' }, + { "version", 0, 0, 'v' }, + { "help", 0, 0, 'h' }, + { NULL, 0, 0, 0 } +}; + +static void encode __P ((void)); +static void usage __P ((int)); + +/* The name this program was run with. */ +const char *program_name; + +/* Pointer to the translation table we currently use. */ +const char *trans_ptr; + +/* The two currently defined translation tables. The first is the + standard uuencoding, the second is base64 encoding. */ +const char uu_std[64] = +{ + '`', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_' +}; + +const char uu_base64[64] = +{ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', + 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', + 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', + 'w', 'x', 'y', 'z', '0', '1', '2', '3', + '4', '5', '6', '7', '8', '9', '+', '/' +}; + +/* ENC is the basic 1 character encoding function to make a char printing. */ +#define ENC(Char) (trans_ptr[(Char) & 077]) + +/*------------------------------------------------. +| Copy from IN to OUT, encoding as you go along. | +`------------------------------------------------*/ + +static void +encode () +{ + register int ch, n; + register char *p; + char buf[80]; + + while (1) + { + n = 0; + do + { + register int m = fread (buf, 1, 45 - n, stdin); + if (m == 0) + break; + n += m; + } + while (n < 45); + + if (n == 0) + break; + + if (trans_ptr == uu_std) + if (putchar (ENC (n)) == EOF) + break; + for (p = buf; n > 2; n -= 3, p += 3) + { + ch = *p >> 2; + ch = ENC (ch); + if (putchar (ch) == EOF) + break; + ch = ((*p << 4) & 060) | ((p[1] >> 4) & 017); + ch = ENC (ch); + if (putchar (ch) == EOF) + break; + ch = ((p[1] << 2) & 074) | ((p[2] >> 6) & 03); + ch = ENC (ch); + if (putchar (ch) == EOF) + break; + ch = p[2] & 077; + ch = ENC (ch); + if (putchar (ch) == EOF) + break; + } + + if (n != 0) + break; + + if (putchar ('\n') == EOF) + break; + } + + while (n != 0) + { + char c1 = *p; + char c2 = n == 1 ? 0 : p[1]; + + ch = c1 >> 2; + ch = ENC (ch); + if (putchar (ch) == EOF) + break; + + ch = ((c1 << 4) & 060) | ((c2 >> 4) & 017); + ch = ENC (ch); + if (putchar (ch) == EOF) + break; + + if (n == 1) + ch = trans_ptr == uu_std ? ENC ('\0') : '='; + else + { + ch = (c2 << 2) & 074; + ch = ENC (ch); + } + if (putchar (ch) == EOF) + break; + ch = trans_ptr == uu_std ? ENC ('\0') : '='; + if (putchar (ch) == EOF) + break; + putchar ('\n'); + break; + } + + if (ferror (stdin)) + error (EXIT_FAILURE, 0, _("Read error")); + if (trans_ptr == uu_std) + { + putchar (ENC ('\0')); + putchar ('\n'); + } +} + +static void +usage (status) + int status; +{ + if (status != 0) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("Usage: %s [INFILE] REMOTEFILE\n"), program_name); + printf (_("\n\ + -h, --help display this help and exit\n\ + -m, --base64 use base64 encoding as of RFC1521\n\ + -v, --version output version information and exit\n")); + } + exit (status); +} + +int +main (argc, argv) + int argc; + char *const *argv; +{ + int opt; + struct stat sb; + int mode; + + /* Set global variables. */ + trans_ptr = uu_std; /* Standard encoding is old uu format. */ + + program_name = argv[0]; + setlocale (LC_ALL, ""); + + /* Set the text message domain. */ + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + while (opt = getopt_long (argc, argv, "hmv", longopts, (int *) NULL), + opt != EOF) + { + switch (opt) + { + case 'h': + usage (EXIT_SUCCESS); + + case 'm': + trans_ptr = uu_base64; + break; + + case 'v': + printf ("%s - GNU %s %s\n", program_name, PACKAGE, VERSION); + exit (EXIT_SUCCESS); + + case 0: + break; + + default: + usage (EXIT_FAILURE); + } + } + + switch (argc - optind) + { + case 2: + + /* Optional first argument is input file. */ + + if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) + error (EXIT_FAILURE, errno, "%s", argv[optind]); + mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + optind++; + break; + + case 1: + mode = RW & ~umask (RW); + break; + + case 0: + default: + usage (EXIT_FAILURE); + } + +#if S_IRWXU != 0700 +choke me - Must translate mode argument +#endif + + printf ("begin%s %o %s\n", trans_ptr == uu_std ? "" : "-base64", + mode, argv[optind]); + encode (); + printf (trans_ptr == uu_std ? "end\n" : "====\n"); + if (ferror (stdout)) + error (EXIT_FAILURE, 0, _("Write error")); + exit (EXIT_SUCCESS); +} diff --git a/src/apps/bin/sharutils-4.2.1/stamp-h b/src/apps/bin/sharutils-4.2.1/stamp-h new file mode 100644 index 0000000000..9788f70238 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/stamp-h @@ -0,0 +1 @@ +timestamp diff --git a/src/apps/bin/sharutils-4.2.1/stamp-h.in b/src/apps/bin/sharutils-4.2.1/stamp-h.in new file mode 100644 index 0000000000..9788f70238 --- /dev/null +++ b/src/apps/bin/sharutils-4.2.1/stamp-h.in @@ -0,0 +1 @@ +timestamp