sitecopy-0.16.6/0000775000076400007640000000000011037462410011567 5ustar joejoesitecopy-0.16.6/sitecopy.spec.in0000664000076400007640000000450310277422411014713 0ustar joejoe# Emacs, please be in spec-file-mode: -*- rpm-spec -*- Summary: Tool for easily maintaining remote web sites Name: sitecopy Version: @VERSION@ Release: 1 License: GPL Group: Applications/Internet Source0: http://www.lyra.org/sitecopy/sitecopy-%{version}.tar.gz URL: http://www.lyra.org/sitecopy/ BuildRoot: /var/tmp/sitecopy-%{version}-root BuildRequires: expat-devel %description sitecopy allows you to easily maintain remote Web sites. The program will upload files to the server which have changed locally, and delete files from the server which have been removed locally, to keep the remote site synchronized with the local site, with a single command. sitecopy will also optionally try to spot files you move locally, and move them remotely. FTP and WebDAV servers are supported. %prep %setup -q %build %configure --enable-debug --with-expat make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make install docdir=%{_datadir}/doc/sitecopy-%{version} DESTDIR=$RPM_BUILD_ROOT %find_lang %{name} %clean rm -rf $RPM_BUILD_ROOT %files -n sitecopy -f %{name}.lang %defattr(-, root, root) %{_bindir}/sitecopy %{_mandir}/man1/* %{_mandir}/*/man1/* %{_datadir}/sitecopy %doc COPYING ChangeLog INSTALL NEWS README* THANKS TODO %changelog * Sat Aug 13 2005 Joe Orton - remove xsitecopy subpackage - use find_lang - use %%configure - general clean up * Sun Jan 13 2002 Joe Orton - Use DESTDIR in make install. * Sun Jan 6 2002 Joe Orton - Add -q argument to %setup, better %description, minor cleanups. * Sun Oct 29 2000 Joe Orton - Fix man page location (Nobuyuki Tsuchimura). * Tue Jun 27 2000 Nobuyuki Tsuchimura - Include 'LC_MESSAGES/sitecopy.mo'. - Don't install in %build section. - Add more documents and '/usr/share/sitecopy/*'. - Correct URL. * Sat Apr 22 2000 Lee Mallabone - Bring up to date for latest xsitecopy stuff * Mon Jul 26 1999 Joe Orton - Enabled debugging for sitecopy and xsitecopy. * Fri May 28 1999 Dobrica Pavlinusic - integrated into GNU configure to automaticly pick up version number * Sat Apr 3 1999 Lee Mallabone - After a few tweaks, it now actually works. :) * Thu Apr 1 1999 Lee Mallabone - first attempt. sitecopy-0.16.6/.update-po.sh0000775000076400007640000000206311037415426014110 0ustar joejoe#!/bin/sh -ex # Script to run update-po and update-gmo before generating # a release tarball. Run from .release.sh, *before* # autogen.sh. inmk=Makefile.in.in tmpmk=`mktemp /tmp/sitecopy.XXXXXX` pot=`mktemp /tmp/sitecopy.XXXXXX` trap 'rm -f $tmpmk $pot' TERM INT 0 cd po lngs=`cat LINGUAS` for l in $lngs; do CATALOGS="$CATALOGS $l.gmo" POFILES="$POFILES $l.po" done GMOFILES="$CATALOGS" sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, ../& \\\\," \ -e "\$s/\(.*\) \\\\/\1/" < POTFILES.in > $pot sed -e " /POTFILES =/r $pot; s/@SET_MAKE@//g; s/@PACKAGE@/sitecopy/g; s/@VERSION@/$1/g; /^.*VPATH.*$/d; 1i\ DOMAIN = sitecopy s/@srcdir@/./g; s/@top_srcdir@/../g; s/@CATALOGS@/$CATALOGS/g; s/@POFILES@/$POFILES/g; s/@UPDATEPOFILES@/$POFILES/g; s/@GMOFILES@/$GMOFILES/g; s/@GMSGFMT@/msgfmt/g; s/@MSGFMT@/msgfmt/g; s/@XGETTEXT@/xgettext/g; s/@MSGMERGE@/msgmerge/g; s/@XGETTEXT_EXTRA_OPTIONS@/--msgid-bugs-address sitecopy@lists.manyfish.co.uk/g; s/: Makefile.*/:/g; s/\$(MAKE) update-gmo/echo Done/g;" $inmk > $tmpmk make -f $tmpmk sitecopy.pot-update ${GMOFILES} sitecopy-0.16.6/mkinstalldirs0000775000076400007640000000123710165765223014411 0ustar joejoe#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id$ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here sitecopy-0.16.6/COPYING0000664000076400007640000004307610165765223012645 0ustar joejoe 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. sitecopy-0.16.6/.release.sh0000775000076400007640000000060710201502275013623 0ustar joejoe#!/bin/bash -ex # Release script run before generating a release tarball. # Usage: ./.release.sh VERSION echo $1 > .version # Generate docs for Xsitecopy pushd gnome/doc db2html -o `pwd` xsitecopy.sgml # Remove generated images dir rm xsitecopy/stylesheet-images/*.gif rmdir -p xsitecopy/stylesheet-images popd sed s/@VERSION@/$1/ < sitecopy.spec.in > sitecopy.spec exec ./.update-po.sh sitecopy-0.16.6/config.sub0000755000076400007640000007772611037462410013573 0ustar joejoe#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-04-29' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sitecopy-0.16.6/INSTALL0000664000076400007640000001722710165765223012642 0ustar joejoeBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. sitecopy-0.16.6/config.rpath0000775000076400007640000003343410165765223014117 0ustar joejoe#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2002 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shlibext= host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix3* | aix4* | aix5*) wl='-Wl,' ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6*) wl='-Wl,' ;; linux*) echo '__INTEL_COMPILER' > conftest.$ac_ext if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null then : else # Intel icc wl='-Qoption,ld,' fi ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) if test "x$host_vendor" = xsni; then wl='-LD' else wl='-Wl,' fi ;; esac fi hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken ld_shlibs=no ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac fi if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=yes ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9* | hpux10* | hpux11*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. ;; irix5* | irix6*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) if test "x$host_vendor" = xsno; then hardcode_direct=yes # is this really true??? else hardcode_direct=no # Motorola manual says yes, but my tests say they lie fi ;; sysv4.3*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5uw7* | unixware7*) ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics libname_spec='lib$name' sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case "$host_os" in aix3*) shlibext=so ;; aix4* | aix5*) shlibext=so ;; amigaos*) shlibext=ixlibrary ;; beos*) shlibext=so ;; bsdi4*) shlibext=so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" ;; cygwin* | mingw* | pw32*) case $GCC,$host_os in yes,cygwin*) shlibext=dll.a ;; yes,mingw*) shlibext=dll sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) shlibext=dll ;; *) shlibext=dll ;; esac ;; darwin* | rhapsody*) shlibext=dylib ;; freebsd1*) ;; freebsd*) shlibext=so ;; gnu*) shlibext=so ;; hpux9* | hpux10* | hpux11*) shlibext=sl ;; irix5* | irix6*) shlibext=so case "$host_os" in irix5*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 ") libsuff= shlibsuff= ;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) ;; linux-gnu*) shlibext=so ;; netbsd*) shlibext=so ;; newsos6) shlibext=so ;; openbsd*) shlibext=so ;; os2*) libname_spec='$name' shlibext=dll ;; osf3* | osf4* | osf5*) shlibext=so sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) shlibext=so ;; solaris*) shlibext=so ;; sunos4*) shlibext=so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) shlibext=so case "$host_vendor" in motorola) sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) shlibext=so ;; dgux*) shlibext=so ;; sysv4*MP*) if test -d /usr/nec; then shlibext=so fi ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < sitecopy.html man2thml.cmd is a copy of the standard perlscript man2hml. You only have to replace the first line #!/usr/local/bin/perl with extproc perl -S The ported sitecopy was successfully tested on eComStation / OS/2 with FTP-sites. I have no idea whether WebDAV works or not. The compiled version of 0.16.3 is available at: http://www.fbakan.de/sitecopy-os2.htm Franz Bakan 5. April 2006 mail: fbakan@gmx.net web: www.fbakan.de sitecopy-0.16.6/sitecopy.lsm.in0000664000076400007640000000124310165765223014561 0ustar joejoeBegin3 Title: sitecopy Version: @VERSION@ Entered-date: @DATE@ Description: sitecopy is for easily maintaining remote web sites. With a single command, the program will upload files to the server which have been changed locally, and delete files from the server which have been removed locally, to keep the remote site synchronized with the local site. FTP and WebDAV servers are supported. Keywords: www, web, site, management, remote, upload, FTP, WebDAV Author: joe@orton.demon.co.uk (Joe Orton) Primary-site: sunsite.unc.edu /pub/Linux/apps/www/misc/ @SIZE@ sitecopy-@VERSION@.tar.gz Platforms: Many Unixes, OS/2 using EMX, cygwin. Copying-policy: GPL End sitecopy-0.16.6/configure0000775000076400007640000301223211037462410013501 0ustar joejoe#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for sitecopy 0.16.6. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='sitecopy' PACKAGE_TARNAME='sitecopy' PACKAGE_VERSION='0.16.6' PACKAGE_STRING='sitecopy 0.16.6' PACKAGE_BUGREPORT='sitecopy@lyra.org' ac_unique_file="src/sites.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gt_needs= ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP GREP EGREP LIBOBJS NEON_CONFIG NE_FLAG_SSL NE_FLAG_ZLIB NE_FLAG_IPV6 NE_FLAG_LFS NE_FLAG_SOCKS NE_FLAG_TS_SSL PKG_CONFIG GNUTLS_CONFIG NEON_SUPPORTS_SSL KRB5_CONFIG NEON_CFLAGS NEON_LIBS NEON_LTLIBS NEON_BUILD_BUNDLED XML2_CONFIG AR RANLIB NE_FLAG_DAV NEON_TARGET NEON_OBJEXT NEONOBJS NEON_EXTRAOBJS NEON_LINK_FLAGS LIBGLADE_CONFIG LIBGLADE_CFLAGS LIBGLADE_LIBS mkdir_p USE_NLS GETTEXT_MACRO_VERSION MSGFMT GMSGFMT MSGFMT_015 GMSGFMT_015 XGETTEXT XGETTEXT_015 MSGMERGE XGETTEXT_EXTRA_OPTIONS build build_cpu build_vendor build_os host host_cpu host_vendor host_os GLIBC2 CFLAG_VISIBILITY HAVE_VISIBILITY ALLOCA PRI_MACROS_BROKEN LIBPTH LTLIBPTH LIBPTH_PREFIX LIBTHREAD LTLIBTHREAD LIBMULTITHREAD LTLIBMULTITHREAD LIBICONV LTLIBICONV INTLBISON GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF WOE32DLL WOE32 WINDRES LTLIBC BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB GNOME_SC_HELPDIR XSC_HELP SHORTCUT_LOCATION EXTRAOBJS TARGET LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures sitecopy 0.16.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/sitecopy] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of sitecopy 0.16.6:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-ftp disable FTP support --disable-webdav disable WebDAV support --disable-rsh disable rsh/rcp support --enable-gnomefe enable GNOME front end --disable-sftp disable sftp/ssh support --disable-debug disable runtime debugging messages --enable-threadsafe-ssl=posix enable SSL library thread-safety using POSIX threads: suitable CC/CFLAGS/LIBS must be used to make the POSIX library interfaces available --disable-nls do not use Native Language Support --enable-threads={posix|solaris|pth|win32} specify multithreading API --disable-threads build without multithread safety --disable-rpath do not hardcode runtime library paths --enable-warnings enable compiler warnings Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-libs=DIR[:DIR2...] look for support libraries in DIR/{bin,lib,include} --with-included-neon force use of included neon library --with-neon[=DIR] specify location of neon library --with-ssl=openssl|gnutls enable SSL support (default OpenSSL) --with-egd[=PATH] enable EGD support [using EGD socket at PATH] --without-pakchois disable support for PKCS#11 using pakchois --with-ca-bundle specify filename of an SSL CA root bundle --with-socks use SOCKSv5 library --without-gssapi disable GSSAPI support --with-libxml2 force use of libxml 2.x --with-expat force use of expat --with-included-expat use bundled expat sources --with-libglade-config=LIBGLADE_CONFIG Location of libglade-config --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libpth-prefix[=DIR] search for libpth in DIR/include and DIR/lib --without-libpth-prefix don't search for libpth in includedir and libdir --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-included-gettext use the GNU gettext library included here --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF sitecopy configure 0.16.6 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by sitecopy $as_me 0.16.6, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" EXTRAOBJS="" proto_msg="" top_builddir=`pwd` cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF # Check whether --with-libs was given. if test "${with_libs+set}" = set; then withval=$with_libs; case $with_libs in yes|no) { { echo "$as_me:$LINENO: error: --with-libs must be passed a directory argument" >&5 echo "$as_me: error: --with-libs must be passed a directory argument" >&2;} { (exit 1); exit 1; }; } ;; *) ne_save_IFS=$IFS; IFS=: for dir in $with_libs; do ne_add_CPPFLAGS="$ne_add_CPPFLAGS -I${dir}/include" ne_add_LDFLAGS="$ne_add_LDFLAGS -L${dir}/lib" ne_add_PATH="${ne_add_PATH}${dir}/bin:" PKG_CONFIG_PATH=${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}${dir}/lib/pkgconfig done IFS=$ne_save_IFS CPPFLAGS="${ne_add_CPPFLAGS} $CPPFLAGS" LDFLAGS="${ne_add_LDFLAGS} $LDFLAGS" PATH=${ne_add_PATH}$PATH export PKG_CONFIG_PATH ;; esac fi # Check whether --enable-ftp was given. if test "${enable_ftp+set}" = set; then enableval=$enable_ftp; else enable_ftp=yes fi # Check whether --enable-webdav was given. if test "${enable_webdav+set}" = set; then enableval=$enable_webdav; else enable_webdav=yes fi # Check whether --enable-rsh was given. if test "${enable_rsh+set}" = set; then enableval=$enable_rsh; else enable_rsh=yes fi # Check whether --enable-gnomefe was given. if test "${enable_gnomefe+set}" = set; then enableval=$enable_gnomefe; fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi { echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" 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 elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi if test "$enable_ftp" = "yes"; then EXTRAOBJS="$EXTRAOBJS src/ftp.o src/ftpdriver.o" proto_msg="FTP" cat >>confdefs.h <<\_ACEOF #define USE_FTP 1 _ACEOF fi if test "$enable_webdav" = "yes"; then # Add the required DAV objects to NEONOBJS proto_msg="WebDAV ${proto_msg}" EXTRAOBJS="$EXTRAOBJS src/davdriver.o" cat >>confdefs.h <<\_ACEOF #define USE_DAV 1 _ACEOF fi # XML parser support is always required NEON_NEED_XML_PARSER=yes if test "$enable_rsh" = "yes"; then EXTRAOBJS="$EXTRAOBJS src/rshdriver.o" proto_msg="rsh/rcp ${proto_msg}" cat >>confdefs.h <<\_ACEOF #define USE_RSH 1 _ACEOF fi # Check whether --enable-sftp was given. if test "${enable_sftp+set}" = set; then enableval=$enable_sftp; else enable_sftp=no for ac_func in socketpair pipe do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF enable_sftp=yes; break fi done fi if test "$enable_sftp" = "yes"; then EXTRAOBJS="$EXTRAOBJS src/sftpdriver.o" proto_msg="sftp/ssh ${proto_msg}" cat >>confdefs.h <<\_ACEOF #define USE_SFTP 1 _ACEOF fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; fi # default is to enable debugging case $enable_debug in no) { echo "$as_me:$LINENO: debugging is disabled" >&5 echo "$as_me: debugging is disabled" >&6;} LDFLAGS="-s $LDFLAGS" ;; *) { echo "$as_me:$LINENO: debugging is enabled" >&5 echo "$as_me: debugging is enabled" >&6;} cat >>confdefs.h <<\_ACEOF #define NE_DEBUGGING 1 _ACEOF ;; esac { echo "$as_me:$LINENO: checking for GNU fnmatch" >&5 echo $ECHO_N "checking for GNU fnmatch... $ECHO_C" >&6; } if test "${sc_cv_gnu_fnmatch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int flags = FNM_LEADING_DIR; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then sc_cv_gnu_fnmatch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 sc_cv_gnu_fnmatch=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $sc_cv_gnu_fnmatch" >&5 echo "${ECHO_T}$sc_cv_gnu_fnmatch" >&6; } if test "$sc_cv_gnu_fnmatch" = "no"; then case " $LIBOBJS " in *" lib/fnmatch.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/fnmatch.$ac_objext" ;; esac fi # Support neon 0.24 through 0.28 # Turn off ACL support neon_no_acl=yes # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi # Check for Darwin, which needs extra cpp and linker flags. { echo "$as_me:$LINENO: checking for uname" >&5 echo $ECHO_N "checking for uname... $ECHO_C" >&6; } if test "${ne_cv_os_uname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ne_cv_os_uname=`uname -s 2>/dev/null` fi { echo "$as_me:$LINENO: result: $ne_cv_os_uname" >&5 echo "${ECHO_T}$ne_cv_os_uname" >&6; } if test "$ne_cv_os_uname" = "Darwin"; then CPPFLAGS="$CPPFLAGS -no-cpp-precomp" LDFLAGS="$LDFLAGS -flat_namespace" # poll has various issues in various Darwin releases if test x${ac_cv_func_poll+set} != xset; then ac_cv_func_poll=no fi fi { echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF { echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long long" >&5 echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF if test "$GCC" = "yes"; then { echo "$as_me:$LINENO: checking for gcc -Wformat -Werror sanity" >&5 echo $ECHO_N "checking for gcc -Wformat -Werror sanity... $ECHO_C" >&6; } if test "${ne_cv_cc_werror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See whether a simple test program will compile without errors. ne_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -Wformat -Werror" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { int i = 42; printf("%d", i); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ne_cv_cc_werror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_cv_cc_werror=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$ne_save_CPPFLAGS fi { echo "$as_me:$LINENO: result: $ne_cv_cc_werror" >&5 echo "${ECHO_T}$ne_cv_cc_werror" >&6; } ne_fmt_trycompile=$ne_cv_cc_werror else ne_fmt_trycompile=no fi # These checks are done whether or not the bundled neon build # is used. for ac_header in errno.h stdarg.h string.h stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of size_t" >&5 echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_size_t=$ac_lo;; '') if test "$ac_cv_type_size_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_size_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_size_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_size_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_size_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF { echo "$as_me:$LINENO: checking how to print size_t" >&5 echo $ECHO_N "checking how to print size_t... $ECHO_C" >&6; } if test "${ne_cv_fmt_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ne_cv_fmt_size_t=none if test $ne_fmt_trycompile = yes; then oflags="$CPPFLAGS" # Consider format string mismatches as errors CPPFLAGS="$CPPFLAGS -Wformat -Werror" for str in u lu llu; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { size_t i = 1; printf("%$str", i); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ne_cv_fmt_size_t=$str; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done CPPFLAGS=$oflags else # Best guess. Don't have to be too precise since we probably won't # get a warning message anyway. case $ac_cv_sizeof_size_t in $ac_cv_sizeof_int) ne_cv_fmt_size_t="u" ;; $ac_cv_sizeof_long) ne_cv_fmt_size_t="lu" ;; $ac_cv_sizeof_long_long) ne_cv_fmt_size_t="llu" ;; esac fi fi { echo "$as_me:$LINENO: result: $ne_cv_fmt_size_t" >&5 echo "${ECHO_T}$ne_cv_fmt_size_t" >&6; } if test "x$ne_cv_fmt_size_t" = "xnone"; then { { echo "$as_me:$LINENO: error: format string for size_t not found" >&5 echo "$as_me: error: format string for size_t not found" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define NE_FMT_SIZE_T "$ne_cv_fmt_size_t" _ACEOF { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of off_t" >&5 echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_off_t=$ac_lo;; '') if test "$ac_cv_type_off_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_off_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF { echo "$as_me:$LINENO: checking how to print off_t" >&5 echo $ECHO_N "checking how to print off_t... $ECHO_C" >&6; } if test "${ne_cv_fmt_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ne_cv_fmt_off_t=none if test $ne_fmt_trycompile = yes; then oflags="$CPPFLAGS" # Consider format string mismatches as errors CPPFLAGS="$CPPFLAGS -Wformat -Werror" for str in d ld lld; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { off_t i = 1; printf("%$str", i); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ne_cv_fmt_off_t=$str; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done CPPFLAGS=$oflags else # Best guess. Don't have to be too precise since we probably won't # get a warning message anyway. case $ac_cv_sizeof_off_t in $ac_cv_sizeof_int) ne_cv_fmt_off_t="d" ;; $ac_cv_sizeof_long) ne_cv_fmt_off_t="ld" ;; $ac_cv_sizeof_long_long) ne_cv_fmt_off_t="lld" ;; esac fi fi { echo "$as_me:$LINENO: result: $ne_cv_fmt_off_t" >&5 echo "${ECHO_T}$ne_cv_fmt_off_t" >&6; } if test "x$ne_cv_fmt_off_t" = "xnone"; then { { echo "$as_me:$LINENO: error: format string for off_t not found" >&5 echo "$as_me: error: format string for off_t not found" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define NE_FMT_OFF_T "$ne_cv_fmt_off_t" _ACEOF { echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ssize_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ssize_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of ssize_t" >&5 echo $ECHO_N "checking size of ssize_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ssize_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ssize_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ssize_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ssize_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ssize_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_ssize_t=$ac_lo;; '') if test "$ac_cv_type_ssize_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (ssize_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_ssize_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ssize_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_ssize_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_ssize_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (ssize_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_ssize_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_ssize_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t _ACEOF { echo "$as_me:$LINENO: checking how to print ssize_t" >&5 echo $ECHO_N "checking how to print ssize_t... $ECHO_C" >&6; } if test "${ne_cv_fmt_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ne_cv_fmt_ssize_t=none if test $ne_fmt_trycompile = yes; then oflags="$CPPFLAGS" # Consider format string mismatches as errors CPPFLAGS="$CPPFLAGS -Wformat -Werror" for str in d ld lld; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { ssize_t i = 1; printf("%$str", i); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ne_cv_fmt_ssize_t=$str; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done CPPFLAGS=$oflags else # Best guess. Don't have to be too precise since we probably won't # get a warning message anyway. case $ac_cv_sizeof_ssize_t in $ac_cv_sizeof_int) ne_cv_fmt_ssize_t="d" ;; $ac_cv_sizeof_long) ne_cv_fmt_ssize_t="ld" ;; $ac_cv_sizeof_long_long) ne_cv_fmt_ssize_t="lld" ;; esac fi fi { echo "$as_me:$LINENO: result: $ne_cv_fmt_ssize_t" >&5 echo "${ECHO_T}$ne_cv_fmt_ssize_t" >&6; } if test "x$ne_cv_fmt_ssize_t" = "xnone"; then { { echo "$as_me:$LINENO: error: format string for ssize_t not found" >&5 echo "$as_me: error: format string for ssize_t not found" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define NE_FMT_SSIZE_T "$ne_cv_fmt_ssize_t" _ACEOF { echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac { echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strerror_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strerror_r (void) strerror_r; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_strerror_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strerror_r=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6; } if test $ac_cv_have_decl_strerror_r = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 0 _ACEOF fi for ac_func in strerror_r do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6; } if test "${ac_cv_func_strerror_r_char_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); return !p || x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); return ! isalpha (x); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then cat >>confdefs.h <<\_ACEOF #define STRERROR_R_CHAR_P 1 _ACEOF fi for ac_func in snprintf vsnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ne_save_LIBS=$LIBS LIBS="$LIBS -lm" # Always need -lm { echo "$as_me:$LINENO: checking for trio_vsnprintf in -ltrio" >&5 echo $ECHO_N "checking for trio_vsnprintf in -ltrio... $ECHO_C" >&6; } if test "${ac_cv_lib_trio_trio_vsnprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltrio $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char trio_vsnprintf (); int main () { return trio_vsnprintf (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_trio_trio_vsnprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_trio_trio_vsnprintf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_trio_trio_vsnprintf" >&5 echo "${ECHO_T}$ac_cv_lib_trio_trio_vsnprintf" >&6; } if test $ac_cv_lib_trio_trio_vsnprintf = yes; then for ac_header in trio.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: trio installation problem? libtrio found but not trio.h" >&5 echo "$as_me: error: trio installation problem? libtrio found but not trio.h" >&2;} { (exit 1); exit 1; }; } fi done { echo "$as_me:$LINENO: using trio printf replacement library" >&5 echo "$as_me: using trio printf replacement library" >&6;} NEON_LIBS="$NEON_LIBS -ltrio -lm" cat >>confdefs.h <<\_ACEOF #define HAVE_TRIO 1 _ACEOF else { echo "$as_me:$LINENO: no vsnprintf/snprintf detected in C library" >&5 echo "$as_me: no vsnprintf/snprintf detected in C library" >&6;} { { echo "$as_me:$LINENO: error: Install the trio library from http://daniel.haxx.se/projects/trio/" >&5 echo "$as_me: error: Install the trio library from http://daniel.haxx.se/projects/trio/" >&2;} { (exit 1); exit 1; }; } fi LIBS=$ne_save_LIBS break fi done # Search in /usr/ccs/bin for Solaris ne_PATH=$PATH:/usr/ccs/bin if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ne_PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi AR=$ac_cv_path_AR if test -n "$AR"; then { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_path_AR"; then ac_pt_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_AR in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_AR="$ac_pt_AR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ne_PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_AR="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_AR=$ac_cv_path_ac_pt_AR if test -n "$ac_pt_AR"; then { echo "$as_me:$LINENO: result: $ac_pt_AR" >&5 echo "${ECHO_T}$ac_pt_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_pt_AR" = x; then AR="notfound" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_pt_AR fi else AR="$ac_cv_path_AR" fi if test "x$AR" = "xnotfound"; then { { echo "$as_me:$LINENO: error: could not find ar tool" >&5 echo "$as_me: error: could not find ar tool" >&2;} { (exit 1); exit 1; }; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RANLIB in [\\/]* | ?:[\\/]*) ac_cv_path_RANLIB="$RANLIB" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ne_PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RANLIB="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi RANLIB=$ac_cv_path_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_path_RANLIB"; then ac_pt_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_RANLIB in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_RANLIB="$ac_pt_RANLIB" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ne_PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_RANLIB="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_RANLIB=$ac_cv_path_ac_pt_RANLIB if test -n "$ac_pt_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_pt_RANLIB" >&5 echo "${ECHO_T}$ac_pt_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_pt_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_pt_RANLIB fi else RANLIB="$ac_cv_path_RANLIB" fi neon_bundled_srcdir="\$(top_srcdir)/lib/neon" neon_bundled_builddir="\$(top_builddir)/lib/neon" # Check whether --with-included-neon was given. if test "${with_included_neon+set}" = set; then withval=$with_included_neon; neon_force_included="$withval" else neon_force_included="no" fi # Check whether --with-neon was given. if test "${with_neon+set}" = set; then withval=$with_neon; case $withval in yes|no) neon_force_external=$withval; neon_ext_path= ;; *) neon_force_external=yes; neon_ext_path=$withval ;; esac; else neon_force_external=no neon_ext_path= fi if test "$neon_force_included" = "no"; then # There is no included neon source directory, or --with-included-neon # wasn't given (so we're not forced to use it). # Default to no external neon. neon_got_library=no if test "x$neon_ext_path" = "x"; then # Extract the first word of "neon-config", so it can be a program name with args. set dummy neon-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_NEON_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $NEON_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_NEON_CONFIG="$NEON_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_NEON_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_NEON_CONFIG" && ac_cv_path_NEON_CONFIG="none" ;; esac fi NEON_CONFIG=$ac_cv_path_NEON_CONFIG if test -n "$NEON_CONFIG"; then { echo "$as_me:$LINENO: result: $NEON_CONFIG" >&5 echo "${ECHO_T}$NEON_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x${NEON_CONFIG}" = "xnone"; then { echo "$as_me:$LINENO: no external neon library found" >&5 echo "$as_me: no external neon library found" >&6;} elif test -x "${NEON_CONFIG}"; then # Configure to use an external neon, given a neon-config script # found at $NEON_CONFIG. neon_prefix=`$NEON_CONFIG --prefix` # Check whether the library is of required version ne_save_LIBS="$LIBS" ne_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`" LIBS="$LIBS `$NEON_CONFIG --libs`" ne_libver=`$NEON_CONFIG --version | sed -e "s/neon //g"` # Check whether it's possible to link against neon { echo "$as_me:$LINENO: checking linking against neon" >&5 echo $ECHO_N "checking linking against neon... $ECHO_C" >&6; } if test "${ne_cv_lib_neon+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { ne_version_match(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_lib_neon=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_cv_lib_neon=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_lib_neon" >&5 echo "${ECHO_T}$ne_cv_lib_neon" >&6; } if test "$ne_cv_lib_neon" = "yes"; then ne_cv_lib_neonver=no for v in 24 25 26 27 28; do case $ne_libver in 0.$v.*) ne_cv_lib_neonver=yes ;; esac done fi ne_goodver=$ne_cv_lib_neonver LIBS=$ne_save_LIBS CFLAGS=$ne_save_CFLAGS if test "$ne_goodver" = "yes"; then { echo "$as_me:$LINENO: using neon library $ne_libver" >&5 echo "$as_me: using neon library $ne_libver" >&6;} # Pick up CFLAGS and LIBS needed CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`" NEON_LIBS="$NEON_LIBS `$NEON_CONFIG --libs`" # Pick up library version set dummy `$NEON_CONFIG --version | sed 's/\./ /g'` NE_VERSION_MAJOR=$3; NE_VERSION_MINOR=$4; NE_VERSION_PATCH=$5 NEON_VERSION="${NE_VERSION_MAJOR}.${NE_VERSION_MINOR}.${NE_VERSION_PATCH}${NE_VERSION_TAG}" cat >>confdefs.h <<_ACEOF #define NEON_VERSION "${NEON_VERSION}" _ACEOF cat >>confdefs.h <<_ACEOF #define NE_VERSION_MAJOR (${NE_VERSION_MAJOR}) _ACEOF cat >>confdefs.h <<_ACEOF #define NE_VERSION_MINOR (${NE_VERSION_MINOR}) _ACEOF cat >>confdefs.h <<_ACEOF #define NE_VERSION_PATCH (${NE_VERSION_PATCH}) _ACEOF neon_library_message="library in ${neon_prefix} (${NEON_VERSION})" neon_xml_parser_message="using whatever neon uses" if $NEON_CONFIG --support ssl >/dev/null; then NE_FLAG_SSL=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_SSL 1 _ACEOF ne_SSL_message="SSL is supported by neon" { echo "$as_me:$LINENO: SSL is supported by neon" >&5 echo "$as_me: SSL is supported by neon" >&6;} else NE_FLAG_SSL=no ne_SSL_message="SSL is not supported by neon" { echo "$as_me:$LINENO: SSL is not supported by neon" >&5 echo "$as_me: SSL is not supported by neon" >&6;} fi if $NEON_CONFIG --support zlib >/dev/null; then NE_FLAG_ZLIB=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_ZLIB 1 _ACEOF ne_ZLIB_message="zlib is supported by neon" { echo "$as_me:$LINENO: zlib is supported by neon" >&5 echo "$as_me: zlib is supported by neon" >&6;} else NE_FLAG_ZLIB=no ne_ZLIB_message="zlib is not supported by neon" { echo "$as_me:$LINENO: zlib is not supported by neon" >&5 echo "$as_me: zlib is not supported by neon" >&6;} fi if $NEON_CONFIG --support ipv6 >/dev/null; then NE_FLAG_IPV6=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_IPV6 1 _ACEOF ne_IPV6_message="IPv6 is supported by neon" { echo "$as_me:$LINENO: IPv6 is supported by neon" >&5 echo "$as_me: IPv6 is supported by neon" >&6;} else NE_FLAG_IPV6=no ne_IPV6_message="IPv6 is not supported by neon" { echo "$as_me:$LINENO: IPv6 is not supported by neon" >&5 echo "$as_me: IPv6 is not supported by neon" >&6;} fi if $NEON_CONFIG --support lfs >/dev/null; then NE_FLAG_LFS=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_LFS 1 _ACEOF ne_LFS_message="LFS is supported by neon" { echo "$as_me:$LINENO: LFS is supported by neon" >&5 echo "$as_me: LFS is supported by neon" >&6;} else NE_FLAG_LFS=no ne_LFS_message="LFS is not supported by neon" { echo "$as_me:$LINENO: LFS is not supported by neon" >&5 echo "$as_me: LFS is not supported by neon" >&6;} fi if $NEON_CONFIG --support socks >/dev/null; then NE_FLAG_SOCKS=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_SOCKS 1 _ACEOF ne_SOCKS_message="SOCKSv5 is supported by neon" { echo "$as_me:$LINENO: SOCKSv5 is supported by neon" >&5 echo "$as_me: SOCKSv5 is supported by neon" >&6;} else NE_FLAG_SOCKS=no ne_SOCKS_message="SOCKSv5 is not supported by neon" { echo "$as_me:$LINENO: SOCKSv5 is not supported by neon" >&5 echo "$as_me: SOCKSv5 is not supported by neon" >&6;} fi if $NEON_CONFIG --support ts_ssl >/dev/null; then NE_FLAG_TS_SSL=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_TS_SSL 1 _ACEOF ne_TS_SSL_message="thread-safe SSL is supported by neon" { echo "$as_me:$LINENO: thread-safe SSL is supported by neon" >&5 echo "$as_me: thread-safe SSL is supported by neon" >&6;} else NE_FLAG_TS_SSL=no ne_TS_SSL_message="thread-safe SSL is not supported by neon" { echo "$as_me:$LINENO: thread-safe SSL is not supported by neon" >&5 echo "$as_me: thread-safe SSL is not supported by neon" >&6;} fi neon_got_library=yes if test $NE_FLAG_LFS = yes; then { echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6; } if test "${ac_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off64_t" >&5 echo "${ECHO_T}$ac_cv_type_off64_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of off64_t" >&5 echo $ECHO_N "checking size of off64_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_off64_t=$ac_lo;; '') if test "$ac_cv_type_off64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off64_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off64_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_off64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off64_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_off64_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_off64_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t _ACEOF { echo "$as_me:$LINENO: checking how to print off64_t" >&5 echo $ECHO_N "checking how to print off64_t... $ECHO_C" >&6; } if test "${ne_cv_fmt_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ne_cv_fmt_off64_t=none if test $ne_fmt_trycompile = yes; then oflags="$CPPFLAGS" # Consider format string mismatches as errors CPPFLAGS="$CPPFLAGS -Wformat -Werror" for str in d ld lld; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { off64_t i = 1; printf("%$str", i); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ne_cv_fmt_off64_t=$str; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done CPPFLAGS=$oflags else # Best guess. Don't have to be too precise since we probably won't # get a warning message anyway. case $ac_cv_sizeof_off64_t in $ac_cv_sizeof_int) ne_cv_fmt_off64_t="d" ;; $ac_cv_sizeof_long) ne_cv_fmt_off64_t="ld" ;; $ac_cv_sizeof_long_long) ne_cv_fmt_off64_t="lld" ;; esac fi fi { echo "$as_me:$LINENO: result: $ne_cv_fmt_off64_t" >&5 echo "${ECHO_T}$ne_cv_fmt_off64_t" >&6; } if test "x$ne_cv_fmt_off64_t" = "xnone"; then { { echo "$as_me:$LINENO: error: format string for off64_t not found" >&5 echo "$as_me: error: format string for off64_t not found" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define NE_FMT_OFF64_T "$ne_cv_fmt_off64_t" _ACEOF cat >>confdefs.h <<_ACEOF #define NE_FMT_NE_OFF_T NE_FMT_OFF64_T _ACEOF else cat >>confdefs.h <<_ACEOF #define NE_FMT_NE_OFF_T NE_FMT_OFF_T _ACEOF fi else { echo "$as_me:$LINENO: incompatible neon library version $ne_libver: wanted 0.24 25 26 27 28" >&5 echo "$as_me: incompatible neon library version $ne_libver: wanted 0.24 25 26 27 28" >&6;} neon_got_library=no fi else { echo "$as_me:$LINENO: ignoring non-executable ${NEON_CONFIG}" >&5 echo "$as_me: ignoring non-executable ${NEON_CONFIG}" >&6;} fi else { echo "$as_me:$LINENO: checking for neon library in $neon_ext_path" >&5 echo $ECHO_N "checking for neon library in $neon_ext_path... $ECHO_C" >&6; } NEON_CONFIG="$neon_ext_path/bin/neon-config" if test -x ${NEON_CONFIG}; then { echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6; } # Configure to use an external neon, given a neon-config script # found at $NEON_CONFIG. neon_prefix=`$NEON_CONFIG --prefix` # Check whether the library is of required version ne_save_LIBS="$LIBS" ne_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`" LIBS="$LIBS `$NEON_CONFIG --libs`" ne_libver=`$NEON_CONFIG --version | sed -e "s/neon //g"` # Check whether it's possible to link against neon { echo "$as_me:$LINENO: checking linking against neon" >&5 echo $ECHO_N "checking linking against neon... $ECHO_C" >&6; } if test "${ne_cv_lib_neon+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { ne_version_match(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_lib_neon=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_cv_lib_neon=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_lib_neon" >&5 echo "${ECHO_T}$ne_cv_lib_neon" >&6; } if test "$ne_cv_lib_neon" = "yes"; then ne_cv_lib_neonver=no for v in 24 25 26 27 28; do case $ne_libver in 0.$v.*) ne_cv_lib_neonver=yes ;; esac done fi ne_goodver=$ne_cv_lib_neonver LIBS=$ne_save_LIBS CFLAGS=$ne_save_CFLAGS if test "$ne_goodver" = "yes"; then { echo "$as_me:$LINENO: using neon library $ne_libver" >&5 echo "$as_me: using neon library $ne_libver" >&6;} # Pick up CFLAGS and LIBS needed CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`" NEON_LIBS="$NEON_LIBS `$NEON_CONFIG --libs`" # Pick up library version set dummy `$NEON_CONFIG --version | sed 's/\./ /g'` NE_VERSION_MAJOR=$3; NE_VERSION_MINOR=$4; NE_VERSION_PATCH=$5 NEON_VERSION="${NE_VERSION_MAJOR}.${NE_VERSION_MINOR}.${NE_VERSION_PATCH}${NE_VERSION_TAG}" cat >>confdefs.h <<_ACEOF #define NEON_VERSION "${NEON_VERSION}" _ACEOF cat >>confdefs.h <<_ACEOF #define NE_VERSION_MAJOR (${NE_VERSION_MAJOR}) _ACEOF cat >>confdefs.h <<_ACEOF #define NE_VERSION_MINOR (${NE_VERSION_MINOR}) _ACEOF cat >>confdefs.h <<_ACEOF #define NE_VERSION_PATCH (${NE_VERSION_PATCH}) _ACEOF neon_library_message="library in ${neon_prefix} (${NEON_VERSION})" neon_xml_parser_message="using whatever neon uses" if $NEON_CONFIG --support ssl >/dev/null; then NE_FLAG_SSL=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_SSL 1 _ACEOF ne_SSL_message="SSL is supported by neon" { echo "$as_me:$LINENO: SSL is supported by neon" >&5 echo "$as_me: SSL is supported by neon" >&6;} else NE_FLAG_SSL=no ne_SSL_message="SSL is not supported by neon" { echo "$as_me:$LINENO: SSL is not supported by neon" >&5 echo "$as_me: SSL is not supported by neon" >&6;} fi if $NEON_CONFIG --support zlib >/dev/null; then NE_FLAG_ZLIB=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_ZLIB 1 _ACEOF ne_ZLIB_message="zlib is supported by neon" { echo "$as_me:$LINENO: zlib is supported by neon" >&5 echo "$as_me: zlib is supported by neon" >&6;} else NE_FLAG_ZLIB=no ne_ZLIB_message="zlib is not supported by neon" { echo "$as_me:$LINENO: zlib is not supported by neon" >&5 echo "$as_me: zlib is not supported by neon" >&6;} fi if $NEON_CONFIG --support ipv6 >/dev/null; then NE_FLAG_IPV6=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_IPV6 1 _ACEOF ne_IPV6_message="IPv6 is supported by neon" { echo "$as_me:$LINENO: IPv6 is supported by neon" >&5 echo "$as_me: IPv6 is supported by neon" >&6;} else NE_FLAG_IPV6=no ne_IPV6_message="IPv6 is not supported by neon" { echo "$as_me:$LINENO: IPv6 is not supported by neon" >&5 echo "$as_me: IPv6 is not supported by neon" >&6;} fi if $NEON_CONFIG --support lfs >/dev/null; then NE_FLAG_LFS=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_LFS 1 _ACEOF ne_LFS_message="LFS is supported by neon" { echo "$as_me:$LINENO: LFS is supported by neon" >&5 echo "$as_me: LFS is supported by neon" >&6;} else NE_FLAG_LFS=no ne_LFS_message="LFS is not supported by neon" { echo "$as_me:$LINENO: LFS is not supported by neon" >&5 echo "$as_me: LFS is not supported by neon" >&6;} fi if $NEON_CONFIG --support socks >/dev/null; then NE_FLAG_SOCKS=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_SOCKS 1 _ACEOF ne_SOCKS_message="SOCKSv5 is supported by neon" { echo "$as_me:$LINENO: SOCKSv5 is supported by neon" >&5 echo "$as_me: SOCKSv5 is supported by neon" >&6;} else NE_FLAG_SOCKS=no ne_SOCKS_message="SOCKSv5 is not supported by neon" { echo "$as_me:$LINENO: SOCKSv5 is not supported by neon" >&5 echo "$as_me: SOCKSv5 is not supported by neon" >&6;} fi if $NEON_CONFIG --support ts_ssl >/dev/null; then NE_FLAG_TS_SSL=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_TS_SSL 1 _ACEOF ne_TS_SSL_message="thread-safe SSL is supported by neon" { echo "$as_me:$LINENO: thread-safe SSL is supported by neon" >&5 echo "$as_me: thread-safe SSL is supported by neon" >&6;} else NE_FLAG_TS_SSL=no ne_TS_SSL_message="thread-safe SSL is not supported by neon" { echo "$as_me:$LINENO: thread-safe SSL is not supported by neon" >&5 echo "$as_me: thread-safe SSL is not supported by neon" >&6;} fi neon_got_library=yes if test $NE_FLAG_LFS = yes; then { echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6; } if test "${ac_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off64_t" >&5 echo "${ECHO_T}$ac_cv_type_off64_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of off64_t" >&5 echo $ECHO_N "checking size of off64_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_off64_t=$ac_lo;; '') if test "$ac_cv_type_off64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off64_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off64_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_off64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off64_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_off64_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_off64_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t _ACEOF { echo "$as_me:$LINENO: checking how to print off64_t" >&5 echo $ECHO_N "checking how to print off64_t... $ECHO_C" >&6; } if test "${ne_cv_fmt_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ne_cv_fmt_off64_t=none if test $ne_fmt_trycompile = yes; then oflags="$CPPFLAGS" # Consider format string mismatches as errors CPPFLAGS="$CPPFLAGS -Wformat -Werror" for str in d ld lld; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { off64_t i = 1; printf("%$str", i); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ne_cv_fmt_off64_t=$str; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done CPPFLAGS=$oflags else # Best guess. Don't have to be too precise since we probably won't # get a warning message anyway. case $ac_cv_sizeof_off64_t in $ac_cv_sizeof_int) ne_cv_fmt_off64_t="d" ;; $ac_cv_sizeof_long) ne_cv_fmt_off64_t="ld" ;; $ac_cv_sizeof_long_long) ne_cv_fmt_off64_t="lld" ;; esac fi fi { echo "$as_me:$LINENO: result: $ne_cv_fmt_off64_t" >&5 echo "${ECHO_T}$ne_cv_fmt_off64_t" >&6; } if test "x$ne_cv_fmt_off64_t" = "xnone"; then { { echo "$as_me:$LINENO: error: format string for off64_t not found" >&5 echo "$as_me: error: format string for off64_t not found" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define NE_FMT_OFF64_T "$ne_cv_fmt_off64_t" _ACEOF cat >>confdefs.h <<_ACEOF #define NE_FMT_NE_OFF_T NE_FMT_OFF64_T _ACEOF else cat >>confdefs.h <<_ACEOF #define NE_FMT_NE_OFF_T NE_FMT_OFF_T _ACEOF fi else { echo "$as_me:$LINENO: incompatible neon library version $ne_libver: wanted 0.24 25 26 27 28" >&5 echo "$as_me: incompatible neon library version $ne_libver: wanted 0.24 25 26 27 28" >&6;} neon_got_library=no fi else { echo "$as_me:$LINENO: result: not found" >&5 echo "${ECHO_T}not found" >&6; } # ...will fail since force_external=yes fi fi if test "$neon_got_library" = "no"; then if test $neon_force_external = yes; then { { echo "$as_me:$LINENO: error: could not use external neon library" >&5 echo "$as_me: error: could not use external neon library" >&2;} { (exit 1); exit 1; }; } elif test -n "$neon_bundled_srcdir"; then # Couldn't find external neon, forced to use bundled sources neon_force_included="yes" else # Couldn't find neon, and don't have bundled sources { { echo "$as_me:$LINENO: error: could not find neon" >&5 echo "$as_me: error: could not find neon" >&2;} { (exit 1); exit 1; }; } fi fi fi if test "$neon_force_included" = "yes"; then # Define the current versions. NE_VERSION_MAJOR=0 NE_VERSION_MINOR=28 NE_VERSION_PATCH=2 NE_VERSION_TAG= # 0.28.x is backwards-compatible with 0.27.x, so AGE=1 NE_LIBTOOL_VERSINFO="28:${NE_VERSION_PATCH}:1" NEON_VERSION="${NE_VERSION_MAJOR}.${NE_VERSION_MINOR}.${NE_VERSION_PATCH}${NE_VERSION_TAG}" cat >>confdefs.h <<_ACEOF #define NEON_VERSION "${NEON_VERSION}" _ACEOF cat >>confdefs.h <<_ACEOF #define NE_VERSION_MAJOR (${NE_VERSION_MAJOR}) _ACEOF cat >>confdefs.h <<_ACEOF #define NE_VERSION_MINOR (${NE_VERSION_MINOR}) _ACEOF cat >>confdefs.h <<_ACEOF #define NE_VERSION_PATCH (${NE_VERSION_PATCH}) _ACEOF { echo "$as_me:$LINENO: using bundled neon ($NEON_VERSION)" >&5 echo "$as_me: using bundled neon ($NEON_VERSION)" >&6;} NEON_BUILD_BUNDLED="yes" for ac_header in sys/time.h limits.h sys/select.h arpa/inet.h libintl.h \ signal.h sys/socket.h netinet/in.h netinet/tcp.h netdb.h sys/poll.h \ sys/limits.h fcntl.h iconv.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* netinet/tcp.h requires netinet/in.h on some platforms. */ #ifdef HAVE_NETINET_IN_H #include #endif #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for timezone global" >&5 echo $ECHO_N "checking for timezone global... $ECHO_C" >&6; } if test "${ne_cv_cc_timezone+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { time_t t = 0 - timezone; timezone = 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_cc_timezone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_cv_cc_timezone=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_cc_timezone" >&5 echo "${ECHO_T}$ne_cv_cc_timezone" >&6; } if test "$ne_cv_cc_timezone" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_TIMEZONE 1 _ACEOF fi if test -z "$ac_cv_sizeof_off_t"; then NE_FLAG_LFS=no ne_LFS_message="LFS support omitted: off_t size unknown!" { echo "$as_me:$LINENO: LFS support omitted: off_t size unknown!" >&5 echo "$as_me: LFS support omitted: off_t size unknown!" >&6;} elif test $ac_cv_sizeof_off_t != 4; then NE_FLAG_LFS=no ne_LFS_message="LFS support unnecessary, off_t is not 32-bit" { echo "$as_me:$LINENO: LFS support unnecessary, off_t is not 32-bit" >&5 echo "$as_me: LFS support unnecessary, off_t is not 32-bit" >&6;} for ac_func in strtoll strtoq do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done elif test -z "$ac_cv_sizeof_long_long"; then NE_FLAG_LFS=no ne_LFS_message="LFS support omitted: long long size unknown" { echo "$as_me:$LINENO: LFS support omitted: long long size unknown" >&5 echo "$as_me: LFS support omitted: long long size unknown" >&6;} elif test $ac_cv_sizeof_long_long != 8; then NE_FLAG_LFS=no ne_LFS_message="LFS support omitted: long long not 64-bit" { echo "$as_me:$LINENO: LFS support omitted: long long not 64-bit" >&5 echo "$as_me: LFS support omitted: long long not 64-bit" >&6;} else ne_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" { echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6; } if test "${ac_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off64_t" >&5 echo "${ECHO_T}$ac_cv_type_off64_t" >&6; } if test $ac_cv_type_off64_t = yes; then { echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6; } if test "${ac_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off64_t" >&5 echo "${ECHO_T}$ac_cv_type_off64_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of off64_t" >&5 echo $ECHO_N "checking size of off64_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_off64_t=$ac_lo;; '') if test "$ac_cv_type_off64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off64_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off64_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off64_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_off64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off64_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_off64_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_off64_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t _ACEOF { echo "$as_me:$LINENO: checking how to print off64_t" >&5 echo $ECHO_N "checking how to print off64_t... $ECHO_C" >&6; } if test "${ne_cv_fmt_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ne_cv_fmt_off64_t=none if test $ne_fmt_trycompile = yes; then oflags="$CPPFLAGS" # Consider format string mismatches as errors CPPFLAGS="$CPPFLAGS -Wformat -Werror" for str in d ld lld; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { off64_t i = 1; printf("%$str", i); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ne_cv_fmt_off64_t=$str; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done CPPFLAGS=$oflags else # Best guess. Don't have to be too precise since we probably won't # get a warning message anyway. case $ac_cv_sizeof_off64_t in $ac_cv_sizeof_int) ne_cv_fmt_off64_t="d" ;; $ac_cv_sizeof_long) ne_cv_fmt_off64_t="ld" ;; $ac_cv_sizeof_long_long) ne_cv_fmt_off64_t="lld" ;; esac fi fi { echo "$as_me:$LINENO: result: $ne_cv_fmt_off64_t" >&5 echo "${ECHO_T}$ne_cv_fmt_off64_t" >&6; } if test "x$ne_cv_fmt_off64_t" = "xnone"; then { { echo "$as_me:$LINENO: error: format string for off64_t not found" >&5 echo "$as_me: error: format string for off64_t not found" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define NE_FMT_OFF64_T "$ne_cv_fmt_off64_t" _ACEOF ne_lfsok=no for ac_func in strtoll strtoq do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ne_lfsok=yes; break fi done for ac_func in lseek64 fstat64 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ne_lfsok=no; break fi done if test x$ne_lfsok = xyes; then NE_FLAG_LFS=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_LFS 1 _ACEOF ne_LFS_message="LFS (large file) support enabled" { echo "$as_me:$LINENO: LFS (large file) support enabled" >&5 echo "$as_me: LFS (large file) support enabled" >&6;} NEON_CFLAGS="$NEON_CFLAGS -D_LARGEFILE64_SOURCE -DNE_LFS" ne_save_CPPFLAGS="$CPPFLAGS -DNE_LFS" else NE_FLAG_LFS=no ne_LFS_message="LFS support omitted: 64-bit support functions not found" { echo "$as_me:$LINENO: LFS support omitted: 64-bit support functions not found" >&5 echo "$as_me: LFS support omitted: 64-bit support functions not found" >&6;} fi else NE_FLAG_LFS=no ne_LFS_message="LFS support omitted: off64_t type not found" { echo "$as_me:$LINENO: LFS support omitted: off64_t type not found" >&5 echo "$as_me: LFS support omitted: off64_t type not found" >&6;} fi CPPFLAGS=$ne_save_CPPFLAGS fi if test "$NE_FLAG_LFS" = "yes"; then cat >>confdefs.h <<_ACEOF #define NE_FMT_NE_OFF_T NE_FMT_OFF64_T _ACEOF : Disabled for 0.28 to retain 0.27 ABI else cat >>confdefs.h <<_ACEOF #define NE_FMT_NE_OFF_T NE_FMT_OFF_T _ACEOF fi for ac_func in strcasecmp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done for ac_func in signal setvbuf setsockopt stpcpy poll fcntl getsockopt do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x${ac_cv_func_poll}${ac_cv_header_sys_poll_h}y" = "xyesyesy"; then cat >>confdefs.h <<\_ACEOF #define NE_USE_POLL 1 _ACEOF fi if test "$ac_cv_func_stpcpy" = "yes"; then { echo "$as_me:$LINENO: checking whether stpcpy is declared" >&5 echo $ECHO_N "checking whether stpcpy is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_stpcpy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef stpcpy (void) stpcpy; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_stpcpy=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_stpcpy=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_stpcpy" >&5 echo "${ECHO_T}$ac_cv_have_decl_stpcpy" >&6; } if test $ac_cv_have_decl_stpcpy = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STPCPY 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STPCPY 0 _ACEOF fi fi # Modern AIXes with the "Linux-like" libc have an undeclared stpcpy # Unixware 7 can only link gethostbyname with -lnsl -lsocket # Pick up -lsocket first, then the gethostbyname check will work. { echo "$as_me:$LINENO: checking for library containing socket" >&5 echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; } if test "${ne_cv_libsfor_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { socket(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_socket="none needed" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_sl_save_LIBS=$LIBS ne_cv_libsfor_socket="not found" for lib in socket inet ws2_32; do # The w32api libraries link using the stdcall calling convention. case ${lib}-${ne_cv_os_uname} in ws2_32-MINGW*) ne__code="__stdcall socket();" ;; *) ne__code="socket();" ;; esac LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_socket="-l$lib"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done LIBS=$ne_sl_save_LIBS fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_libsfor_socket" >&5 echo "${ECHO_T}$ne_cv_libsfor_socket" >&6; } if test "$ne_cv_libsfor_socket" = "not found"; then { { echo "$as_me:$LINENO: error: could not find library containing socket" >&5 echo "$as_me: error: could not find library containing socket" >&2;} { (exit 1); exit 1; }; } elif test "$ne_cv_libsfor_socket" = "none needed"; then : else NEON_LIBS="$ne_cv_libsfor_socket $NEON_LIBS" fi # Enable getaddrinfo support if it, gai_strerror and inet_ntop are # all available. { echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6; } if test "${ne_cv_libsfor_getaddrinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { getaddrinfo(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_getaddrinfo="none needed" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_sl_save_LIBS=$LIBS ne_cv_libsfor_getaddrinfo="not found" for lib in nsl; do # The w32api libraries link using the stdcall calling convention. case ${lib}-${ne_cv_os_uname} in ws2_32-MINGW*) ne__code="__stdcall getaddrinfo();" ;; *) ne__code="getaddrinfo();" ;; esac LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_getaddrinfo="-l$lib"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done LIBS=$ne_sl_save_LIBS fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_libsfor_getaddrinfo" >&5 echo "${ECHO_T}$ne_cv_libsfor_getaddrinfo" >&6; } if test "$ne_cv_libsfor_getaddrinfo" = "not found"; then ne_enable_gai=no elif test "$ne_cv_libsfor_getaddrinfo" = "none needed"; then # HP-UX boxes commonly get into a state where getaddrinfo is present # but borked: http://marc.theaimsgroup.com/?l=apr-dev&m=107730955207120&w=2 case x`uname -sr 2>/dev/null`y in xHP-UX*11.[01]*y) { echo "$as_me:$LINENO: getaddrinfo support disabled on HP-UX 11.0x/11.1x" >&5 echo "$as_me: getaddrinfo support disabled on HP-UX 11.0x/11.1x" >&6;} ;; *) ne_enable_gai=yes ne_cf_save_LIBS=$LIBS LIBS="$LIBS $NEON_LIBS" for ac_func in gai_strerror getnameinfo inet_ntop do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ne_enable_gai=no; break fi done LIBS=$ne_cf_save_LIBS ;; esac else NEON_LIBS="$ne_cv_libsfor_getaddrinfo $NEON_LIBS" # HP-UX boxes commonly get into a state where getaddrinfo is present # but borked: http://marc.theaimsgroup.com/?l=apr-dev&m=107730955207120&w=2 case x`uname -sr 2>/dev/null`y in xHP-UX*11.[01]*y) { echo "$as_me:$LINENO: getaddrinfo support disabled on HP-UX 11.0x/11.1x" >&5 echo "$as_me: getaddrinfo support disabled on HP-UX 11.0x/11.1x" >&6;} ;; *) ne_enable_gai=yes ne_cf_save_LIBS=$LIBS LIBS="$LIBS $NEON_LIBS" for ac_func in gai_strerror getnameinfo inet_ntop do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ne_enable_gai=no; break fi done LIBS=$ne_cf_save_LIBS ;; esac fi if test $ne_enable_gai = yes; then NE_FLAG_IPV6=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_IPV6 1 _ACEOF ne_IPV6_message="IPv6 support is enabled" { echo "$as_me:$LINENO: IPv6 support is enabled" >&5 echo "$as_me: IPv6 support is enabled" >&6;} cat >>confdefs.h <<\_ACEOF #define USE_GETADDRINFO 1 _ACEOF { echo "$as_me:$LINENO: checking for working AI_ADDRCONFIG" >&5 echo $ECHO_N "checking for working AI_ADDRCONFIG... $ECHO_C" >&6; } if test "${ne_cv_gai_addrconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ne_cv_gai_addrconfig=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct addrinfo hints = {0}, *result; hints.ai_flags = AI_ADDRCONFIG; if (getaddrinfo("localhost", NULL, &hints, &result) != 0) return 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ne_cv_gai_addrconfig=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ne_cv_gai_addrconfig=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ne_cv_gai_addrconfig" >&5 echo "${ECHO_T}$ne_cv_gai_addrconfig" >&6; } if test $ne_cv_gai_addrconfig = yes; then cat >>confdefs.h <<\_ACEOF #define USE_GAI_ADDRCONFIG 1 _ACEOF fi else # Checks for non-getaddrinfo() based resolver interfaces. # QNX has gethostbyname in -lsocket. BeOS only has it in -lbind. # CygWin/Winsock2 has it in -lws2_32, allegedly. { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } if test "${ne_cv_libsfor_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { gethostbyname(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_gethostbyname="none needed" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_sl_save_LIBS=$LIBS ne_cv_libsfor_gethostbyname="not found" for lib in socket nsl bind ws2_32; do # The w32api libraries link using the stdcall calling convention. case ${lib}-${ne_cv_os_uname} in ws2_32-MINGW*) ne__code="__stdcall gethostbyname();" ;; *) ne__code="gethostbyname();" ;; esac LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_gethostbyname="-l$lib"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done LIBS=$ne_sl_save_LIBS fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_libsfor_gethostbyname" >&5 echo "${ECHO_T}$ne_cv_libsfor_gethostbyname" >&6; } if test "$ne_cv_libsfor_gethostbyname" = "not found"; then { { echo "$as_me:$LINENO: error: could not find library containing gethostbyname" >&5 echo "$as_me: error: could not find library containing gethostbyname" >&2;} { (exit 1); exit 1; }; } elif test "$ne_cv_libsfor_gethostbyname" = "none needed"; then : else NEON_LIBS="$ne_cv_libsfor_gethostbyname $NEON_LIBS" fi { echo "$as_me:$LINENO: checking for library containing hstrerror" >&5 echo $ECHO_N "checking for library containing hstrerror... $ECHO_C" >&6; } if test "${ne_cv_libsfor_hstrerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { hstrerror(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_hstrerror="none needed" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_sl_save_LIBS=$LIBS ne_cv_libsfor_hstrerror="not found" for lib in resolv; do # The w32api libraries link using the stdcall calling convention. case ${lib}-${ne_cv_os_uname} in ws2_32-MINGW*) ne__code="__stdcall hstrerror();" ;; *) ne__code="hstrerror();" ;; esac LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_hstrerror="-l$lib"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done LIBS=$ne_sl_save_LIBS fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_libsfor_hstrerror" >&5 echo "${ECHO_T}$ne_cv_libsfor_hstrerror" >&6; } if test "$ne_cv_libsfor_hstrerror" = "not found"; then : elif test "$ne_cv_libsfor_hstrerror" = "none needed"; then : else NEON_LIBS="$ne_cv_libsfor_hstrerror $NEON_LIBS" fi ne_cf_save_LIBS=$LIBS LIBS="$LIBS $NEON_LIBS" for ac_func in hstrerror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS=$ne_cf_save_LIBS # Older Unixes don't declare h_errno. { echo "$as_me:$LINENO: checking whether h_errno is declared" >&5 echo $ECHO_N "checking whether h_errno is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_h_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef h_errno (void) h_errno; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_h_errno=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_h_errno=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_h_errno" >&5 echo "${ECHO_T}$ac_cv_have_decl_h_errno" >&6; } if test $ac_cv_have_decl_h_errno = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_H_ERRNO 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_H_ERRNO 0 _ACEOF fi { echo "$as_me:$LINENO: checking for in_addr_t" >&5 echo $ECHO_N "checking for in_addr_t... $ECHO_C" >&6; } if test "${ac_cv_type_in_addr_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif typedef in_addr_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_in_addr_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_in_addr_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_in_addr_t" >&5 echo "${ECHO_T}$ac_cv_type_in_addr_t" >&6; } if test $ac_cv_type_in_addr_t = yes; then : else cat >>confdefs.h <<\_ACEOF #define in_addr_t unsigned int _ACEOF fi fi { echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif typedef socklen_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } if test $ac_cv_type_socklen_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 _ACEOF else # Linux accept(2) says this should be size_t for SunOS 5... gah. cat >>confdefs.h <<\_ACEOF #define socklen_t int _ACEOF fi { echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5 echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6; } if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (sizeof ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_gmtoff=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_gmtoff" >&6; } if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_GMTOFF 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct tm.__tm_gmtoff" >&5 echo $ECHO_N "checking for struct tm.__tm_gmtoff... $ECHO_C" >&6; } if test "${ac_cv_member_struct_tm___tm_gmtoff+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (ac_aggr.__tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm___tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (sizeof ac_aggr.__tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm___tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm___tm_gmtoff=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm___tm_gmtoff" >&5 echo "${ECHO_T}$ac_cv_member_struct_tm___tm_gmtoff" >&6; } if test $ac_cv_member_struct_tm___tm_gmtoff = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM___TM_GMTOFF 1 _ACEOF fi if test ${ac_cv_member_struct_tm_tm_gmtoff}${ac_cv_member_struct_tm___tm_gmtoff}${ne_cv_cc_timezone} = nonono; then { echo "$as_me:$LINENO: WARNING: no timezone handling in date parsing on this platform" >&5 echo "$as_me: WARNING: no timezone handling in date parsing on this platform" >&2;} fi NE_FLAG_ZLIB=no ne_ZLIB_message="zlib not supported" { echo "$as_me:$LINENO: zlib not supported" >&5 echo "$as_me: zlib not supported" >&6;} # Conditionally enable ACL support { echo "$as_me:$LINENO: checking whether to enable ACL support in neon" >&5 echo $ECHO_N "checking whether to enable ACL support in neon... $ECHO_C" >&6; } if test "x$neon_no_acl" = "xyes"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } else { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_acl" fi # Check whether --with-ssl was given. if test "${with_ssl+set}" = set; then withval=$with_ssl; fi # Check whether --with-egd was given. if test "${with_egd+set}" = set; then withval=$with_egd; fi # Check whether --with-pakchois was given. if test "${with_pakchois+set}" = set; then withval=$with_pakchois; fi case $with_ssl in /*) { echo "$as_me:$LINENO: to use SSL libraries in non-standard locations, try --with-ssl --with-libs=$with_ssl" >&5 echo "$as_me: to use SSL libraries in non-standard locations, try --with-ssl --with-libs=$with_ssl" >&6;} { { echo "$as_me:$LINENO: error: --with-ssl does not take a path argument" >&5 echo "$as_me: error: --with-ssl does not take a path argument" >&2;} { (exit 1); exit 1; }; } ;; yes|openssl) # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$PKG_CONFIG" = "no"; then : Not using pkg-config # Either OpenSSL library may require -ldl if built with dynamic engine support { echo "$as_me:$LINENO: checking for library containing RSA_new" >&5 echo $ECHO_N "checking for library containing RSA_new... $ECHO_C" >&6; } if test "${ne_cv_libsfor_RSA_new+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { RSA_new(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_RSA_new="none needed" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_sl_save_LIBS=$LIBS ne_cv_libsfor_RSA_new="not found" for lib in crypto; do # The w32api libraries link using the stdcall calling convention. case ${lib}-${ne_cv_os_uname} in ws2_32-MINGW*) ne__code="__stdcall RSA_new();" ;; *) ne__code="RSA_new();" ;; esac LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_RSA_new="-l$lib"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ne_sl_save_LIBS -l$lib -ldl $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_RSA_new="-l$lib -ldl"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done LIBS=$ne_sl_save_LIBS fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_libsfor_RSA_new" >&5 echo "${ECHO_T}$ne_cv_libsfor_RSA_new" >&6; } if test "$ne_cv_libsfor_RSA_new" = "not found"; then { { echo "$as_me:$LINENO: error: could not find library containing RSA_new" >&5 echo "$as_me: error: could not find library containing RSA_new" >&2;} { (exit 1); exit 1; }; } elif test "$ne_cv_libsfor_RSA_new" = "none needed"; then : else NEON_LIBS="$ne_cv_libsfor_RSA_new $NEON_LIBS" fi { echo "$as_me:$LINENO: checking for library containing SSL_library_init" >&5 echo $ECHO_N "checking for library containing SSL_library_init... $ECHO_C" >&6; } if test "${ne_cv_libsfor_SSL_library_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { SSL_library_init(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_SSL_library_init="none needed" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_sl_save_LIBS=$LIBS ne_cv_libsfor_SSL_library_init="not found" for lib in ssl; do # The w32api libraries link using the stdcall calling convention. case ${lib}-${ne_cv_os_uname} in ws2_32-MINGW*) ne__code="__stdcall SSL_library_init();" ;; *) ne__code="SSL_library_init();" ;; esac LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_SSL_library_init="-l$lib"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ne_sl_save_LIBS -l$lib -ldl $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_SSL_library_init="-l$lib -ldl"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done LIBS=$ne_sl_save_LIBS fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_libsfor_SSL_library_init" >&5 echo "${ECHO_T}$ne_cv_libsfor_SSL_library_init" >&6; } if test "$ne_cv_libsfor_SSL_library_init" = "not found"; then { { echo "$as_me:$LINENO: error: could not find library containing SSL_library_init" >&5 echo "$as_me: error: could not find library containing SSL_library_init" >&2;} { (exit 1); exit 1; }; } elif test "$ne_cv_libsfor_SSL_library_init" = "none needed"; then : else NEON_LIBS="$ne_cv_libsfor_SSL_library_init $NEON_LIBS" fi else { echo "$as_me:$LINENO: checking for openssl pkg-config data" >&5 echo $ECHO_N "checking for openssl pkg-config data... $ECHO_C" >&6; } if test "${ne_cv_pkg_openssl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if $PKG_CONFIG openssl; then ne_cv_pkg_openssl=yes else ne_cv_pkg_openssl=no fi fi { echo "$as_me:$LINENO: result: $ne_cv_pkg_openssl" >&5 echo "${ECHO_T}$ne_cv_pkg_openssl" >&6; } if test "$ne_cv_pkg_openssl" = "yes"; then NE_SSL_CFLAGS=`$PKG_CONFIG --cflags openssl` NE_SSL_LIBS=`$PKG_CONFIG --libs openssl` : Using provided pkg-config data { echo "$as_me:$LINENO: using SSL library configuration from pkg-config" >&5 echo "$as_me: using SSL library configuration from pkg-config" >&6;} CPPFLAGS="$CPPFLAGS ${NE_SSL_CFLAGS}" NEON_LIBS="$NEON_LIBS ${NE_SSL_LIBS}" else : No pkg-config for openssl provided # Either OpenSSL library may require -ldl if built with dynamic engine support { echo "$as_me:$LINENO: checking for library containing RSA_new" >&5 echo $ECHO_N "checking for library containing RSA_new... $ECHO_C" >&6; } if test "${ne_cv_libsfor_RSA_new+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { RSA_new(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_RSA_new="none needed" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_sl_save_LIBS=$LIBS ne_cv_libsfor_RSA_new="not found" for lib in crypto; do # The w32api libraries link using the stdcall calling convention. case ${lib}-${ne_cv_os_uname} in ws2_32-MINGW*) ne__code="__stdcall RSA_new();" ;; *) ne__code="RSA_new();" ;; esac LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_RSA_new="-l$lib"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ne_sl_save_LIBS -l$lib -ldl $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_RSA_new="-l$lib -ldl"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done LIBS=$ne_sl_save_LIBS fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_libsfor_RSA_new" >&5 echo "${ECHO_T}$ne_cv_libsfor_RSA_new" >&6; } if test "$ne_cv_libsfor_RSA_new" = "not found"; then { { echo "$as_me:$LINENO: error: could not find library containing RSA_new" >&5 echo "$as_me: error: could not find library containing RSA_new" >&2;} { (exit 1); exit 1; }; } elif test "$ne_cv_libsfor_RSA_new" = "none needed"; then : else NEON_LIBS="$ne_cv_libsfor_RSA_new $NEON_LIBS" fi { echo "$as_me:$LINENO: checking for library containing SSL_library_init" >&5 echo $ECHO_N "checking for library containing SSL_library_init... $ECHO_C" >&6; } if test "${ne_cv_libsfor_SSL_library_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { SSL_library_init(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_SSL_library_init="none needed" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ne_sl_save_LIBS=$LIBS ne_cv_libsfor_SSL_library_init="not found" for lib in ssl; do # The w32api libraries link using the stdcall calling convention. case ${lib}-${ne_cv_os_uname} in ws2_32-MINGW*) ne__code="__stdcall SSL_library_init();" ;; *) ne__code="SSL_library_init();" ;; esac LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_SSL_library_init="-l$lib"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ne_sl_save_LIBS -l$lib -ldl $NEON_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { $ne__code ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ne_cv_libsfor_SSL_library_init="-l$lib -ldl"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done LIBS=$ne_sl_save_LIBS fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ne_cv_libsfor_SSL_library_init" >&5 echo "${ECHO_T}$ne_cv_libsfor_SSL_library_init" >&6; } if test "$ne_cv_libsfor_SSL_library_init" = "not found"; then { { echo "$as_me:$LINENO: error: could not find library containing SSL_library_init" >&5 echo "$as_me: error: could not find library containing SSL_library_init" >&2;} { (exit 1); exit 1; }; } elif test "$ne_cv_libsfor_SSL_library_init" = "none needed"; then : else NEON_LIBS="$ne_cv_libsfor_SSL_library_init $NEON_LIBS" fi fi fi for ac_header in openssl/ssl.h openssl/opensslv.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: OpenSSL headers not found, cannot enable SSL support" >&5 echo "$as_me: error: OpenSSL headers not found, cannot enable SSL support" >&2;} { (exit 1); exit 1; }; } fi done # Enable EGD support if using 0.9.7 or newer { echo "$as_me:$LINENO: checking OpenSSL version is >= 0.9.7" >&5 echo $ECHO_N "checking OpenSSL version is >= 0.9.7... $ECHO_C" >&6; } if test "${ne_cv_lib_ssl097+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if OPENSSL_VERSION_NUMBER >= 0x00907000L good #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "good" >/dev/null 2>&1; then ne_cv_lib_ssl097=yes else ne_cv_lib_ssl097=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ne_cv_lib_ssl097" >&5 echo "${ECHO_T}$ne_cv_lib_ssl097" >&6; } if test "$ne_cv_lib_ssl097" = "yes"; then { echo "$as_me:$LINENO: OpenSSL >= 0.9.7; EGD support not needed in neon" >&5 echo "$as_me: OpenSSL >= 0.9.7; EGD support not needed in neon" >&6;} NE_FLAG_SSL=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_SSL 1 _ACEOF ne_SSL_message="SSL support enabled, using OpenSSL (0.9.7 or later)" { echo "$as_me:$LINENO: SSL support enabled, using OpenSSL (0.9.7 or later)" >&5 echo "$as_me: SSL support enabled, using OpenSSL (0.9.7 or later)" >&6;} ne_cf_save_LIBS=$LIBS LIBS="$LIBS $NEON_LIBS" for ac_func in CRYPTO_set_idptr_callback do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS=$ne_cf_save_LIBS else # Fail if OpenSSL is older than 0.9.6 { echo "$as_me:$LINENO: checking OpenSSL version is >= 0.9.6" >&5 echo $ECHO_N "checking OpenSSL version is >= 0.9.6... $ECHO_C" >&6; } if test "${ne_cv_lib_ssl096+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if OPENSSL_VERSION_NUMBER >= 0x00906000L good #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "good" >/dev/null 2>&1; then ne_cv_lib_ssl096=yes else ne_cv_lib_ssl096=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ne_cv_lib_ssl096" >&5 echo "${ECHO_T}$ne_cv_lib_ssl096" >&6; } if test "$ne_cv_lib_ssl096" != "yes"; then { { echo "$as_me:$LINENO: error: OpenSSL 0.9.6 or later is required" >&5 echo "$as_me: error: OpenSSL 0.9.6 or later is required" >&2;} { (exit 1); exit 1; }; } fi NE_FLAG_SSL=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_SSL 1 _ACEOF ne_SSL_message="SSL support enabled, using OpenSSL (0.9.6 or later)" { echo "$as_me:$LINENO: SSL support enabled, using OpenSSL (0.9.6 or later)" >&5 echo "$as_me: SSL support enabled, using OpenSSL (0.9.6 or later)" >&6;} case "$with_egd" in yes|no) ne_cv_lib_sslegd=$with_egd ;; /*) ne_cv_lib_sslegd=yes cat >>confdefs.h <<_ACEOF #define EGD_PATH "$with_egd" _ACEOF ;; *) # Guess whether EGD support is needed { echo "$as_me:$LINENO: checking whether to enable EGD support" >&5 echo $ECHO_N "checking whether to enable EGD support... $ECHO_C" >&6; } if test "${ne_cv_lib_sslegd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -r /dev/random || test -r /dev/urandom; then ne_cv_lib_sslegd=no else ne_cv_lib_sslegd=yes fi fi { echo "$as_me:$LINENO: result: $ne_cv_lib_sslegd" >&5 echo "${ECHO_T}$ne_cv_lib_sslegd" >&6; } ;; esac if test "$ne_cv_lib_sslegd" = "yes"; then { echo "$as_me:$LINENO: EGD support enabled for seeding OpenSSL PRNG" >&5 echo "$as_me: EGD support enabled for seeding OpenSSL PRNG" >&6;} cat >>confdefs.h <<\_ACEOF #define ENABLE_EGD 1 _ACEOF fi fi cat >>confdefs.h <<\_ACEOF #define HAVE_OPENSSL 1 _ACEOF NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_openssl" ;; gnutls) # Extract the first word of "libgnutls-config", so it can be a program name with args. set dummy libgnutls-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GNUTLS_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GNUTLS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GNUTLS_CONFIG="$GNUTLS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GNUTLS_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GNUTLS_CONFIG" && ac_cv_path_GNUTLS_CONFIG="no" ;; esac fi GNUTLS_CONFIG=$ac_cv_path_GNUTLS_CONFIG if test -n "$GNUTLS_CONFIG"; then { echo "$as_me:$LINENO: result: $GNUTLS_CONFIG" >&5 echo "${ECHO_T}$GNUTLS_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$GNUTLS_CONFIG" = "no"; then { { echo "$as_me:$LINENO: error: could not find libgnutls-config in \$PATH" >&5 echo "$as_me: error: could not find libgnutls-config in \$PATH" >&2;} { (exit 1); exit 1; }; } fi ne_gnutls_ver=`$GNUTLS_CONFIG --version` case $ne_gnutls_ver in 1.0.?|1.0.1?|1.0.20|1.0.21) { { echo "$as_me:$LINENO: error: GNU TLS version $ne_gnutls_ver is too old -- 1.0.22 or later required" >&5 echo "$as_me: error: GNU TLS version $ne_gnutls_ver is too old -- 1.0.22 or later required" >&2;} { (exit 1); exit 1; }; } ;; esac CPPFLAGS="$CPPFLAGS `$GNUTLS_CONFIG --cflags`" if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then { echo "$as_me:$LINENO: checking for gnutls/gnutls.h" >&5 echo $ECHO_N "checking for gnutls/gnutls.h... $ECHO_C" >&6; } if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_gnutls_gnutls_h" >&5 echo "${ECHO_T}$ac_cv_header_gnutls_gnutls_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking gnutls/gnutls.h usability" >&5 echo $ECHO_N "checking gnutls/gnutls.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking gnutls/gnutls.h presence" >&5 echo $ECHO_N "checking gnutls/gnutls.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: gnutls/gnutls.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: gnutls/gnutls.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: gnutls/gnutls.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: gnutls/gnutls.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: gnutls/gnutls.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: gnutls/gnutls.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: gnutls/gnutls.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: gnutls/gnutls.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for gnutls/gnutls.h" >&5 echo $ECHO_N "checking for gnutls/gnutls.h... $ECHO_C" >&6; } if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gnutls_gnutls_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_gnutls_gnutls_h" >&5 echo "${ECHO_T}$ac_cv_header_gnutls_gnutls_h" >&6; } fi if test $ac_cv_header_gnutls_gnutls_h = yes; then : else { { echo "$as_me:$LINENO: error: could not find gnutls/gnutls.h in include path" >&5 echo "$as_me: error: could not find gnutls/gnutls.h in include path" >&2;} { (exit 1); exit 1; }; } fi NE_FLAG_SSL=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_SSL 1 _ACEOF ne_SSL_message="SSL support enabled, using GnuTLS $ne_gnutls_ver" { echo "$as_me:$LINENO: SSL support enabled, using GnuTLS $ne_gnutls_ver" >&5 echo "$as_me: SSL support enabled, using GnuTLS $ne_gnutls_ver" >&6;} NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_gnutls" NEON_LIBS="$NEON_LIBS `$GNUTLS_CONFIG --libs`" cat >>confdefs.h <<\_ACEOF #define HAVE_GNUTLS 1 _ACEOF # Check for functions in later releases ne_cf_save_LIBS=$LIBS LIBS="$LIBS $NEON_LIBS" for ac_func in gnutls_session_get_data2 gnutls_x509_dn_get_rdn_ava \ gnutls_sign_callback_set do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS=$ne_cf_save_LIBS # Check for iconv support if using the new RDN access functions: if test ${ac_cv_func_gnutls_x509_dn_get_rdn_ava}X${ac_cv_header_iconv_h} = yesXyes; then for ac_func in iconv do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi if test x${ac_cv_func_gnutls_sign_callback_set} = xyes; then if test "$with_pakchois" != "no"; then # PKCS#11... ho! # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$PKG_CONFIG" = "no"; then : Not using pkg-config { echo "$as_me:$LINENO: pakchois library not found; no PKCS11 support" >&5 echo "$as_me: pakchois library not found; no PKCS11 support" >&6;} else { echo "$as_me:$LINENO: checking for pakchois pkg-config data" >&5 echo $ECHO_N "checking for pakchois pkg-config data... $ECHO_C" >&6; } if test "${ne_cv_pkg_pakchois+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if $PKG_CONFIG pakchois; then ne_cv_pkg_pakchois=yes else ne_cv_pkg_pakchois=no fi fi { echo "$as_me:$LINENO: result: $ne_cv_pkg_pakchois" >&5 echo "${ECHO_T}$ne_cv_pkg_pakchois" >&6; } if test "$ne_cv_pkg_pakchois" = "yes"; then NE_PK11_CFLAGS=`$PKG_CONFIG --cflags pakchois` NE_PK11_LIBS=`$PKG_CONFIG --libs pakchois` : Using provided pkg-config data { echo "$as_me:$LINENO: using pakchois for PKCS11 support" >&5 echo "$as_me: using pakchois for PKCS11 support" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_PAKCHOIS 1 _ACEOF CPPFLAGS="$CPPFLAGS ${NE_PK11_CFLAGS}" NEON_LIBS="${NEON_LIBS} ${NE_PK11_LIBS}" else : No pkg-config for pakchois provided { echo "$as_me:$LINENO: pakchois library not found; no PKCS11 support" >&5 echo "$as_me: pakchois library not found; no PKCS11 support" >&6;} fi fi fi fi ;; *) # Default to off; only create crypto-enabled binaries if requested. NE_FLAG_SSL=no ne_SSL_message="SSL support is not enabled" { echo "$as_me:$LINENO: SSL support is not enabled" >&5 echo "$as_me: SSL support is not enabled" >&6;} NE_FLAG_TS_SSL=no ne_TS_SSL_message="Thread-safe SSL support is not enabled" { echo "$as_me:$LINENO: Thread-safe SSL support is not enabled" >&5 echo "$as_me: Thread-safe SSL support is not enabled" >&6;} NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_stubssl" ;; esac # Check whether --with-ca-bundle was given. if test "${with_ca_bundle+set}" = set; then withval=$with_ca_bundle; else with_ca_bundle=no fi case ${NE_FLAG_SSL}-${with_ca_bundle} in *-no) ;; yes-*) cat >>confdefs.h <<_ACEOF #define NE_SSL_CA_BUNDLE "${with_ca_bundle}" _ACEOF { echo "$as_me:$LINENO: Using ${with_ca_bundle} as default SSL CA bundle" >&5 echo "$as_me: Using ${with_ca_bundle} as default SSL CA bundle" >&6;} ;; esac # Check whether --enable-threadsafe-ssl was given. if test "${enable_threadsafe_ssl+set}" = set; then enableval=$enable_threadsafe_ssl; else enable_threadsafe_ssl=no fi case $enable_threadsafe_ssl in posix|yes) ne_pthr_ok=yes for ac_func in pthread_mutex_init pthread_mutex_lock do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ne_pthr_ok=no fi done if test "${ne_pthr_ok}" = "no"; then { { echo "$as_me:$LINENO: error: could not find POSIX mutex interfaces; (try CC=\"${CC} -pthread\"?)" >&5 echo "$as_me: error: could not find POSIX mutex interfaces; (try CC=\"${CC} -pthread\"?)" >&2;} { (exit 1); exit 1; }; } fi NE_FLAG_TS_SSL=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_TS_SSL 1 _ACEOF ne_TS_SSL_message="Thread-safe SSL supported using POSIX threads" { echo "$as_me:$LINENO: Thread-safe SSL supported using POSIX threads" >&5 echo "$as_me: Thread-safe SSL supported using POSIX threads" >&6;} ;; *) NE_FLAG_TS_SSL=no ne_TS_SSL_message="Thread-safe SSL not supported" { echo "$as_me:$LINENO: Thread-safe SSL not supported" >&5 echo "$as_me: Thread-safe SSL not supported" >&6;} ;; esac # Check whether --with-socks was given. if test "${with_socks+set}" = set; then withval=$with_socks; fi if test "$with_socks" = "yes"; then ne_save_LIBS=$LIBS for ac_header in socks.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF { echo "$as_me:$LINENO: checking for connect in -lsocks5" >&5 echo $ECHO_N "checking for connect in -lsocks5... $ECHO_C" >&6; } if test "${ac_cv_lib_socks5_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocks5 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socks5_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socks5_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socks5_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socks5_connect" >&6; } if test $ac_cv_lib_socks5_connect = yes; then : else { { echo "$as_me:$LINENO: error: could not find libsocks5 for SOCKS support" >&5 echo "$as_me: error: could not find libsocks5 for SOCKS support" >&2;} { (exit 1); exit 1; }; } fi else { { echo "$as_me:$LINENO: error: could not find socks.h for SOCKS support" >&5 echo "$as_me: error: could not find socks.h for SOCKS support" >&2;} { (exit 1); exit 1; }; } fi done NE_FLAG_SOCKS=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_SOCKS 1 _ACEOF ne_SOCKS_message="SOCKSv5 support is enabled" { echo "$as_me:$LINENO: SOCKSv5 support is enabled" >&5 echo "$as_me: SOCKSv5 support is enabled" >&6;} NEON_LIBS="$NEON_LIBS -lsocks5" LIBS=$ne_save_LIBS else NE_FLAG_SOCKS=no ne_SOCKS_message="SOCKSv5 support is not enabled" { echo "$as_me:$LINENO: SOCKSv5 support is not enabled" >&5 echo "$as_me: SOCKSv5 support is not enabled" >&6;} fi # Check whether --with-gssapi was given. if test "${with_gssapi+set}" = set; then withval=$with_gssapi; fi if test "$with_gssapi" != "no"; then # Extract the first word of "krb5-config", so it can be a program name with args. set dummy krb5-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_KRB5_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $KRB5_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_KRB5_CONFIG="$KRB5_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/kerberos/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_KRB5_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_KRB5_CONFIG" && ac_cv_path_KRB5_CONFIG="none" ;; esac fi KRB5_CONFIG=$ac_cv_path_KRB5_CONFIG if test -n "$KRB5_CONFIG"; then { echo "$as_me:$LINENO: result: $KRB5_CONFIG" >&5 echo "${ECHO_T}$KRB5_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else KRB5_CONFIG=none fi if test "x$KRB5_CONFIG" != "xnone"; then ne_save_CPPFLAGS=$CPPFLAGS ne_save_LIBS=$NEON_LIBS NEON_LIBS="$NEON_LIBS `${KRB5_CONFIG} --libs gssapi`" CPPFLAGS="$CPPFLAGS `${KRB5_CONFIG} --cflags gssapi`" # MIT and Heimdal put gssapi.h in different places for ac_header in gssapi/gssapi.h gssapi.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF ne_cf_save_LIBS=$LIBS LIBS="$LIBS $NEON_LIBS" for ac_func in gss_init_sec_context do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ne_save_CPPFLAGS=$CPPFLAGS ne_save_LIBS=$NEON_LIBS { echo "$as_me:$LINENO: GSSAPI authentication support enabled" >&5 echo "$as_me: GSSAPI authentication support enabled" >&6;} cat >>confdefs.h <<\_ACEOF #define HAVE_GSSAPI 1 _ACEOF for ac_header in gssapi/gssapi_generic.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Older versions of MIT Kerberos lack GSS_C_NT_HOSTBASED_SERVICE { echo "$as_me:$LINENO: checking whether GSS_C_NT_HOSTBASED_SERVICE is declared" >&5 echo $ECHO_N "checking whether GSS_C_NT_HOSTBASED_SERVICE is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_GSSAPI_GSSAPI_H #include #else #include #endif int main () { #ifndef GSS_C_NT_HOSTBASED_SERVICE (void) GSS_C_NT_HOSTBASED_SERVICE; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE" >&5 echo "${ECHO_T}$ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE" >&6; } if test $ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE = yes; then : else cat >>confdefs.h <<\_ACEOF #define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name _ACEOF fi fi done LIBS=$ne_cf_save_LIBS break fi done CPPFLAGS=$ne_save_CPPFLAGS NEON_LIBS=$ne_save_LIBS fi CFLAGS="$CFLAGS -I$neon_bundled_srcdir" NEON_LIBS="-L$neon_bundled_builddir -lneon $NEON_LIBS" NEON_NEED_XML_PARSER=yes neon_library_message="included libneon (${NEON_VERSION})" else # Don't need to configure an XML parser NEON_NEED_XML_PARSER=no NEON_BUILD_BUNDLED=no fi # The colons are here so there is something to evaluate # in case the argument was not passed. if test "$neon_force_included" = "yes"; then : # Check whether --with-libxml2 was given. if test "${with_libxml2+set}" = set; then withval=$with_libxml2; fi # Check whether --with-expat was given. if test "${with_expat+set}" = set; then withval=$with_expat; fi # Check whether --with-included-expat was given. if test "${with_included_expat+set}" = set; then withval=$with_included_expat; else with_included_expat=no fi if test "$NEON_NEED_XML_PARSER" = "yes"; then # Find an XML parser neon_xml_parser=none # Forced choice of expat: case $with_expat in yes) if test "${ac_cv_header_expat_h+set}" = set; then { echo "$as_me:$LINENO: checking for expat.h" >&5 echo $ECHO_N "checking for expat.h... $ECHO_C" >&6; } if test "${ac_cv_header_expat_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 echo "${ECHO_T}$ac_cv_header_expat_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking expat.h usability" >&5 echo $ECHO_N "checking expat.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking expat.h presence" >&5 echo $ECHO_N "checking expat.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: expat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: expat.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: expat.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: expat.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: expat.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: expat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for expat.h" >&5 echo $ECHO_N "checking for expat.h... $ECHO_C" >&6; } if test "${ac_cv_header_expat_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_expat_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 echo "${ECHO_T}$ac_cv_header_expat_h" >&6; } fi if test $ac_cv_header_expat_h = yes; then { echo "$as_me:$LINENO: checking for XML_SetXmlDeclHandler in -lexpat" >&5 echo $ECHO_N "checking for XML_SetXmlDeclHandler in -lexpat... $ECHO_C" >&6; } if test "${ac_cv_lib_expat_XML_SetXmlDeclHandler+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XML_SetXmlDeclHandler (); int main () { return XML_SetXmlDeclHandler (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_expat_XML_SetXmlDeclHandler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_expat_XML_SetXmlDeclHandler=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_SetXmlDeclHandler" >&5 echo "${ECHO_T}$ac_cv_lib_expat_XML_SetXmlDeclHandler" >&6; } if test $ac_cv_lib_expat_XML_SetXmlDeclHandler = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_EXPAT 1 _ACEOF neon_xml_parser_message="expat" NEON_LIBS="$NEON_LIBS -lexpat" neon_xml_parser=expat { echo "$as_me:$LINENO: checking for XML_Size" >&5 echo $ECHO_N "checking for XML_Size... $ECHO_C" >&6; } if test "${ac_cv_type_XML_Size+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include typedef XML_Size ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_XML_Size=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_XML_Size=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_XML_Size" >&5 echo "${ECHO_T}$ac_cv_type_XML_Size" >&6; } if test $ac_cv_type_XML_Size = yes; then { echo "$as_me:$LINENO: checking for XML_Size" >&5 echo $ECHO_N "checking for XML_Size... $ECHO_C" >&6; } if test "${ac_cv_type_XML_Size+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_XML_Size=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_XML_Size=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_XML_Size" >&5 echo "${ECHO_T}$ac_cv_type_XML_Size" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of XML_Size" >&5 echo $ECHO_N "checking size of XML_Size... $ECHO_C" >&6; } if test "${ac_cv_sizeof_XML_Size+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_XML_Size=$ac_lo;; '') if test "$ac_cv_type_XML_Size" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (XML_Size) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (XML_Size) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_XML_Size=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_XML_Size=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_XML_Size" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (XML_Size) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (XML_Size) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_XML_Size=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_XML_Size" >&5 echo "${ECHO_T}$ac_cv_sizeof_XML_Size" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_XML_SIZE $ac_cv_sizeof_XML_Size _ACEOF { echo "$as_me:$LINENO: checking how to print XML_Size" >&5 echo $ECHO_N "checking how to print XML_Size... $ECHO_C" >&6; } if test "${ne_cv_fmt_XML_Size+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ne_cv_fmt_XML_Size=none if test $ne_fmt_trycompile = yes; then oflags="$CPPFLAGS" # Consider format string mismatches as errors CPPFLAGS="$CPPFLAGS -Wformat -Werror" for str in d ld lld; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { XML_Size i = 1; printf("%$str", i); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ne_cv_fmt_XML_Size=$str; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done CPPFLAGS=$oflags else # Best guess. Don't have to be too precise since we probably won't # get a warning message anyway. case $ac_cv_sizeof_XML_Size in $ac_cv_sizeof_int) ne_cv_fmt_XML_Size="d" ;; $ac_cv_sizeof_long) ne_cv_fmt_XML_Size="ld" ;; $ac_cv_sizeof_long_long) ne_cv_fmt_XML_Size="lld" ;; esac fi fi { echo "$as_me:$LINENO: result: $ne_cv_fmt_XML_Size" >&5 echo "${ECHO_T}$ne_cv_fmt_XML_Size" >&6; } if test "x$ne_cv_fmt_XML_Size" = "xnone"; then { { echo "$as_me:$LINENO: error: format string for XML_Size not found" >&5 echo "$as_me: error: format string for XML_Size not found" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define NE_FMT_XML_SIZE "$ne_cv_fmt_XML_Size" _ACEOF else cat >>confdefs.h <<_ACEOF #define NE_FMT_XML_SIZE "d" _ACEOF fi else { { echo "$as_me:$LINENO: error: expat library not found, cannot proceed" >&5 echo "$as_me: error: expat library not found, cannot proceed" >&2;} { (exit 1); exit 1; }; } fi else { { echo "$as_me:$LINENO: error: expat library not found, cannot proceed" >&5 echo "$as_me: error: expat library not found, cannot proceed" >&2;} { (exit 1); exit 1; }; } fi ;; no) ;; */libexpat.la) # Special case for Subversion ne_expdir=`echo $with_expat | sed 's:/libexpat.la$::'` cat >>confdefs.h <<\_ACEOF #define HAVE_EXPAT 1 _ACEOF cat >>confdefs.h <<_ACEOF #define NE_FMT_XML_SIZE "d" _ACEOF CPPFLAGS="$CPPFLAGS -I$ne_expdir" if test "x${NEON_TARGET}" = "xlibneon.la"; then NEON_LTLIBS=$with_expat else # no dependency on libexpat => crippled libneon, so do partial install ALLOW_INSTALL=lib fi neon_xml_parser=expat neon_xml_parser_message="expat in $ne_expdir" ;; /*) { { echo "$as_me:$LINENO: error: --with-expat does not take a directory argument" >&5 echo "$as_me: error: --with-expat does not take a directory argument" >&2;} { (exit 1); exit 1; }; } ;; esac # If expat wasn't specifically enabled and libxml was: if test "${neon_xml_parser}-${with_libxml2}-${with_included_expat}" = "none-yes-no"; then # Extract the first word of "xml2-config", so it can be a program name with args. set dummy xml2-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_XML2_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$XML2_CONFIG"; then ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XML2_CONFIG="xml2-config" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XML2_CONFIG=$ac_cv_prog_XML2_CONFIG if test -n "$XML2_CONFIG"; then { echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5 echo "${ECHO_T}$XML2_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -n "$XML2_CONFIG"; then neon_xml_parser_message="libxml `$XML2_CONFIG --version`" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBXML 1 _ACEOF # xml2-config in some versions erroneously includes -I/include # in the --cflags output. CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags | sed 's| -I/include||g'`" NEON_LIBS="$NEON_LIBS `$XML2_CONFIG --libs | sed 's|-L/usr/lib ||g'`" for ac_header in libxml/xmlversion.h libxml/parser.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: could not find parser.h, libxml installation problem?" >&5 echo "$as_me: error: could not find parser.h, libxml installation problem?" >&2;} { (exit 1); exit 1; }; } fi done neon_xml_parser=libxml2 else { { echo "$as_me:$LINENO: error: libxml2.x library not found, cannot proceed" >&5 echo "$as_me: error: libxml2.x library not found, cannot proceed" >&2;} { (exit 1); exit 1; }; } fi fi # Otherwise, by default search for expat then libxml2: if test "${neon_xml_parser}-${with_included_expat}" = "none-no"; then if test "${ac_cv_header_expat_h+set}" = set; then { echo "$as_me:$LINENO: checking for expat.h" >&5 echo $ECHO_N "checking for expat.h... $ECHO_C" >&6; } if test "${ac_cv_header_expat_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 echo "${ECHO_T}$ac_cv_header_expat_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking expat.h usability" >&5 echo $ECHO_N "checking expat.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking expat.h presence" >&5 echo $ECHO_N "checking expat.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: expat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: expat.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: expat.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: expat.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: expat.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: expat.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: expat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for expat.h" >&5 echo $ECHO_N "checking for expat.h... $ECHO_C" >&6; } if test "${ac_cv_header_expat_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_expat_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 echo "${ECHO_T}$ac_cv_header_expat_h" >&6; } fi if test $ac_cv_header_expat_h = yes; then { echo "$as_me:$LINENO: checking for XML_SetXmlDeclHandler in -lexpat" >&5 echo $ECHO_N "checking for XML_SetXmlDeclHandler in -lexpat... $ECHO_C" >&6; } if test "${ac_cv_lib_expat_XML_SetXmlDeclHandler+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XML_SetXmlDeclHandler (); int main () { return XML_SetXmlDeclHandler (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_expat_XML_SetXmlDeclHandler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_expat_XML_SetXmlDeclHandler=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_SetXmlDeclHandler" >&5 echo "${ECHO_T}$ac_cv_lib_expat_XML_SetXmlDeclHandler" >&6; } if test $ac_cv_lib_expat_XML_SetXmlDeclHandler = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_EXPAT 1 _ACEOF neon_xml_parser_message="expat" NEON_LIBS="$NEON_LIBS -lexpat" neon_xml_parser=expat { echo "$as_me:$LINENO: checking for XML_Size" >&5 echo $ECHO_N "checking for XML_Size... $ECHO_C" >&6; } if test "${ac_cv_type_XML_Size+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include typedef XML_Size ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_XML_Size=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_XML_Size=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_XML_Size" >&5 echo "${ECHO_T}$ac_cv_type_XML_Size" >&6; } if test $ac_cv_type_XML_Size = yes; then { echo "$as_me:$LINENO: checking for XML_Size" >&5 echo $ECHO_N "checking for XML_Size... $ECHO_C" >&6; } if test "${ac_cv_type_XML_Size+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_XML_Size=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_XML_Size=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_XML_Size" >&5 echo "${ECHO_T}$ac_cv_type_XML_Size" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of XML_Size" >&5 echo $ECHO_N "checking size of XML_Size... $ECHO_C" >&6; } if test "${ac_cv_sizeof_XML_Size+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_XML_Size=$ac_lo;; '') if test "$ac_cv_type_XML_Size" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (XML_Size) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (XML_Size) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_XML_Size=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include typedef XML_Size ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_XML_Size=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_XML_Size" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (XML_Size) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (XML_Size) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_XML_Size=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_XML_Size" >&5 echo "${ECHO_T}$ac_cv_sizeof_XML_Size" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_XML_SIZE $ac_cv_sizeof_XML_Size _ACEOF { echo "$as_me:$LINENO: checking how to print XML_Size" >&5 echo $ECHO_N "checking how to print XML_Size... $ECHO_C" >&6; } if test "${ne_cv_fmt_XML_Size+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ne_cv_fmt_XML_Size=none if test $ne_fmt_trycompile = yes; then oflags="$CPPFLAGS" # Consider format string mismatches as errors CPPFLAGS="$CPPFLAGS -Wformat -Werror" for str in d ld lld; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { XML_Size i = 1; printf("%$str", i); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ne_cv_fmt_XML_Size=$str; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done CPPFLAGS=$oflags else # Best guess. Don't have to be too precise since we probably won't # get a warning message anyway. case $ac_cv_sizeof_XML_Size in $ac_cv_sizeof_int) ne_cv_fmt_XML_Size="d" ;; $ac_cv_sizeof_long) ne_cv_fmt_XML_Size="ld" ;; $ac_cv_sizeof_long_long) ne_cv_fmt_XML_Size="lld" ;; esac fi fi { echo "$as_me:$LINENO: result: $ne_cv_fmt_XML_Size" >&5 echo "${ECHO_T}$ne_cv_fmt_XML_Size" >&6; } if test "x$ne_cv_fmt_XML_Size" = "xnone"; then { { echo "$as_me:$LINENO: error: format string for XML_Size not found" >&5 echo "$as_me: error: format string for XML_Size not found" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define NE_FMT_XML_SIZE "$ne_cv_fmt_XML_Size" _ACEOF else cat >>confdefs.h <<_ACEOF #define NE_FMT_XML_SIZE "d" _ACEOF fi else # Extract the first word of "xml2-config", so it can be a program name with args. set dummy xml2-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_XML2_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$XML2_CONFIG"; then ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XML2_CONFIG="xml2-config" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XML2_CONFIG=$ac_cv_prog_XML2_CONFIG if test -n "$XML2_CONFIG"; then { echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5 echo "${ECHO_T}$XML2_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -n "$XML2_CONFIG"; then neon_xml_parser_message="libxml `$XML2_CONFIG --version`" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBXML 1 _ACEOF # xml2-config in some versions erroneously includes -I/include # in the --cflags output. CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags | sed 's| -I/include||g'`" NEON_LIBS="$NEON_LIBS `$XML2_CONFIG --libs | sed 's|-L/usr/lib ||g'`" for ac_header in libxml/xmlversion.h libxml/parser.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: could not find parser.h, libxml installation problem?" >&5 echo "$as_me: error: could not find parser.h, libxml installation problem?" >&2;} { (exit 1); exit 1; }; } fi done neon_xml_parser=libxml2 else : fi fi else # Extract the first word of "xml2-config", so it can be a program name with args. set dummy xml2-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_XML2_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$XML2_CONFIG"; then ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XML2_CONFIG="xml2-config" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XML2_CONFIG=$ac_cv_prog_XML2_CONFIG if test -n "$XML2_CONFIG"; then { echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5 echo "${ECHO_T}$XML2_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -n "$XML2_CONFIG"; then neon_xml_parser_message="libxml `$XML2_CONFIG --version`" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBXML 1 _ACEOF # xml2-config in some versions erroneously includes -I/include # in the --cflags output. CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags | sed 's| -I/include||g'`" NEON_LIBS="$NEON_LIBS `$XML2_CONFIG --libs | sed 's|-L/usr/lib ||g'`" for ac_header in libxml/xmlversion.h libxml/parser.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: could not find parser.h, libxml installation problem?" >&5 echo "$as_me: error: could not find parser.h, libxml installation problem?" >&2;} { (exit 1); exit 1; }; } fi done neon_xml_parser=libxml2 else : fi fi fi # If an XML parser still has not been found, fail or use the bundled expat if test "$neon_xml_parser" = "none"; then # Configure the bundled copy of expat # Define XML_BYTE_ORDER for expat sources. if test $ac_cv_c_bigendian = "yes"; then ne_xml_border=21 else ne_xml_border=12 fi # mini-expat doesn't pick up config.h CPPFLAGS="$CPPFLAGS -DXML_BYTE_ORDER=$ne_xml_border -DXML_DTD -I\$(top_srcdir)/lib/expat/xmlparse -I\$(top_srcdir)/lib/expat/xmltok" cat >>confdefs.h <<_ACEOF #define NE_FMT_XML_SIZE "d" _ACEOF # Use the bundled expat sources case " $LIBOBJS " in *" \$(top_builddir)/lib/expat/xmltok/xmltok.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS \$(top_builddir)/lib/expat/xmltok/xmltok.$ac_objext" ;; esac case " $LIBOBJS " in *" \$(top_builddir)/lib/expat/xmltok/xmlrole.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS \$(top_builddir)/lib/expat/xmltok/xmlrole.$ac_objext" ;; esac case " $LIBOBJS " in *" \$(top_builddir)/lib/expat/xmlparse/xmlparse.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS \$(top_builddir)/lib/expat/xmlparse/xmlparse.$ac_objext" ;; esac case " $LIBOBJS " in *" \$(top_builddir)/lib/expat/xmlparse/hashtable.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS \$(top_builddir)/lib/expat/xmlparse/hashtable.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define HAVE_EXPAT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_XMLPARSE_H 1 _ACEOF neon_xml_parser_message="bundled expat in \$(top_srcdir)/lib/expat" fi { echo "$as_me:$LINENO: XML parser used: $neon_xml_parser_message" >&5 echo "$as_me: XML parser used: $neon_xml_parser_message" >&6;} fi NEON_TARGET=libneon.a NEON_OBJEXT=o # Using the default set of object files to build. # Add the extension to EXTRAOBJS ne="$NEON_EXTRAOBJS" NEON_EXTRAOBJS= for o in $ne; do NEON_EXTRAOBJS="$NEON_EXTRAOBJS $o.$NEON_OBJEXT" done # Was DAV support explicitly turned off? if test "x$neon_no_webdav" = "xyes"; then # No WebDAV support NEONOBJS="$NEONOBJS \$(NEON_BASEOBJS)" NE_FLAG_DAV=no ne_DAV_message="WebDAV support is not enabled" { echo "$as_me:$LINENO: WebDAV support is not enabled" >&5 echo "$as_me: WebDAV support is not enabled" >&6;} : Disabled for 0.28 to retain 0.27 ABI else # WebDAV support NEONOBJS="$NEONOBJS \$(NEON_DAVOBJS)" NE_FLAG_DAV=yes cat >>confdefs.h <<\_ACEOF #define NE_HAVE_DAV 1 _ACEOF ne_DAV_message="WebDAV support is enabled" { echo "$as_me:$LINENO: WebDAV support is enabled" >&5 echo "$as_me: WebDAV support is enabled" >&6;} fi else : fi { echo "$as_me:$LINENO: checking for getopt_long" >&5 echo $ECHO_N "checking for getopt_long... $ECHO_C" >&6; } if test "${ac_cv_func_getopt_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define getopt_long to an innocuous variant, in case declares getopt_long. For example, HP-UX 11i declares gettimeofday. */ #define getopt_long innocuous_getopt_long /* System header to define __stub macros and hopefully few prototypes, which can conflict with char getopt_long (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef getopt_long /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getopt_long (); /* 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_getopt_long || defined __stub___getopt_long choke me #endif int main () { return getopt_long (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_getopt_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_getopt_long=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_getopt_long" >&5 echo "${ECHO_T}$ac_cv_func_getopt_long" >&6; } if test $ac_cv_func_getopt_long = yes; then : else case " $LIBOBJS " in *" lib/getopt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/getopt.$ac_objext" ;; esac case " $LIBOBJS " in *" lib/getopt1.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/getopt1.$ac_objext" ;; esac fi { echo "$as_me:$LINENO: checking for strcasecmp" >&5 echo $ECHO_N "checking for strcasecmp... $ECHO_C" >&6; } if test "${ac_cv_func_strcasecmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define strcasecmp to an innocuous variant, in case declares strcasecmp. For example, HP-UX 11i declares gettimeofday. */ #define strcasecmp innocuous_strcasecmp /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strcasecmp (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef strcasecmp /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strcasecmp (); /* 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_strcasecmp || defined __stub___strcasecmp choke me #endif int main () { return strcasecmp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_strcasecmp=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_strcasecmp=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_strcasecmp" >&5 echo "${ECHO_T}$ac_cv_func_strcasecmp" >&6; } if test $ac_cv_func_strcasecmp = yes; then : else case " $LIBOBJS " in *" lib/strcasecmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/strcasecmp.$ac_objext" ;; esac fi for ac_func in strdup strsignal strerror memcpy setlocale nl_langinfo do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_header in stdarg.h string.h strings.h sys/time.h regex.h \ locale.h langinfo.h stdlib.h unistd.h limits.h sys/select.h fcntl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for the third argument of getsockname" >&5 echo $ECHO_N "checking for the third argument of getsockname... $ECHO_C" >&6; } if test "${ac_cv_ksize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { socklen_t a=0; getsockname(0,(struct sockaddr*)0, &a); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_ksize_t=socklen_t else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_ksize_t= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test -z "$ac_cv_ksize_t"; then ac_safe_cflags="$CFLAGS" if test "$GCC" = "yes"; then CFLAGS="-Werror $CFLAGS" fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { int a=0; getsockname(0,(struct sockaddr*)0, &a); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_ksize_t=int else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_ksize_t=size_t fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ac_safe_cflags" fi fi if test -z "$ac_cv_ksize_t"; then ac_cv_ksize_t=int fi { echo "$as_me:$LINENO: result: $ac_cv_ksize_t" >&5 echo "${ECHO_T}$ac_cv_ksize_t" >&6; } cat >>confdefs.h <<_ACEOF #define ksize_t $ac_cv_ksize_t _ACEOF if test "$enable_gnomefe" = "yes"; then { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } if test $ac_cv_lib_pthread_pthread_create = yes; then gnome_is_ok=yes else gnome_is_ok=no fi # Check whether --with-libglade-config was given. if test "${with_libglade_config+set}" = set; then withval=$with_libglade_config; LIBGLADE_CONFIG="$withval" fi module_args= for module in . gnome; do case "$module" in gnome) module_args="$module_args gnome" ;; bonobo) module_args="$module_args bonobo" ;; gnomedb) module_args="$module_args gnomedb" ;; esac done # Extract the first word of "libglade-config", so it can be a program name with args. set dummy libglade-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_LIBGLADE_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LIBGLADE_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBGLADE_CONFIG="$LIBGLADE_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LIBGLADE_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBGLADE_CONFIG" && ac_cv_path_LIBGLADE_CONFIG="no" ;; esac fi LIBGLADE_CONFIG=$ac_cv_path_LIBGLADE_CONFIG if test -n "$LIBGLADE_CONFIG"; then { echo "$as_me:$LINENO: result: $LIBGLADE_CONFIG" >&5 echo "${ECHO_T}$LIBGLADE_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi { echo "$as_me:$LINENO: checking for libglade" >&5 echo $ECHO_N "checking for libglade... $ECHO_C" >&6; } if test "$LIBGLADE_CONFIG" = "no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } : else if $LIBGLADE_CONFIG --check $module_args; then LIBGLADE_CFLAGS=`$LIBGLADE_CONFIG --cflags $module_args` LIBGLADE_LIBS=`$LIBGLADE_CONFIG --libs $module_args` { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : else echo "*** libglade was not compiled with support for $module_args" 1>&2 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } : fi fi fi ALL_LINGUAS="ru fr cs ja de tr nn it" { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.17 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 echo "${ECHO_T}$MSGMERGE" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2 or newer" >&5 echo $ECHO_N "checking whether we are using the GNU C Library 2 or newer... $ECHO_C" >&6; } if test "${ac_cv_gnu_library_2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then ac_cv_gnu_library_2=yes else ac_cv_gnu_library_2=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2" >&5 echo "${ECHO_T}$ac_cv_gnu_library_2" >&6; } GLIBC2="$ac_cv_gnu_library_2" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi CFLAG_VISIBILITY= HAVE_VISIBILITY=0 if test -n "$GCC"; then { echo "$as_me:$LINENO: checking for simple visibility declarations" >&5 echo $ECHO_N "checking for simple visibility declarations... $ECHO_C" >&6; } if test "${gl_cv_cc_visibility+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gl_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) int hiddenvar; extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void); int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_cc_visibility=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_cc_visibility=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$gl_save_CFLAGS" fi { echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5 echo "${ECHO_T}$gl_cv_cc_visibility" >&6; } if test $gl_cv_cc_visibility = yes; then CFLAG_VISIBILITY="-fvisibility=hidden" HAVE_VISIBILITY=1 fi fi cat >>confdefs.h <<_ACEOF #define HAVE_VISIBILITY $HAVE_VISIBILITY _ACEOF { echo "$as_me:$LINENO: checking for stdint.h" >&5 echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } if test "${gl_cv_header_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; return !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_header_stdint_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_stdint_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 echo "${ECHO_T}$gl_cv_header_stdint_h" >&6; } if test $gl_cv_header_stdint_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H_WITH_UINTMAX 1 _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF { echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 1; if (write (fd, data, pagesize) != pagesize) return 1; close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 1; data2 = (char *) malloc (2 * pagesize); if (!data2) return 1; data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 1; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 1; if (read (fd, data3, pagesize) != pagesize) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 1; close (fd); return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap { echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5 echo $ECHO_N "checking whether integer division by zero raises SIGFPE... $ECHO_C" >&6; } if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_cv_int_divbyzero_sigfpe= case "$host_os" in macos* | darwin[6-9]* | darwin[1-9][0-9]*) # On MacOS X 10.2 or newer, just assume the same as when cross- # compiling. If we were to perform the real test, 1 Crash Report # dialog window would pop up. case "$host_cpu" in i[34567]86 | x86_64) gt_cv_int_divbyzero_sigfpe="guessing yes" ;; esac ;; esac if test -z "$gt_cv_int_divbyzero_sigfpe"; then if test "$cross_compiling" = yes; then # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | x86_64 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include static void sigfpe_handler (int sig) { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_int_divbyzero_sigfpe=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gt_cv_int_divbyzero_sigfpe=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5 echo "${ECHO_T}$gt_cv_int_divbyzero_sigfpe" >&6; } case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac cat >>confdefs.h <<_ACEOF #define INTDIV0_RAISES_SIGFPE $value _ACEOF { echo "$as_me:$LINENO: checking for inttypes.h" >&5 echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } if test "${gl_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; return !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_inttypes_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6; } if test $gl_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H_WITH_UINTMAX 1 _ACEOF fi { echo "$as_me:$LINENO: checking for unsigned long long int" >&5 echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Test preprocessor. */ #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) error in preprocessor; #endif #if ! (18446744073709551615ULL <= -1ull) error in preprocessor; #endif /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_type_unsigned_long_long_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_LONG_LONG_INT 1 _ACEOF fi if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then test $ac_cv_type_unsigned_long_long_int = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' cat >>confdefs.h <<_ACEOF #define uintmax_t $ac_type _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_UINTMAX_T 1 _ACEOF fi for ac_header in inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_inttypes_h = yes; then { echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6; } if test "${gt_cv_inttypes_pri_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef PRId32 char *p = PRId32; #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_inttypes_pri_broken=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_inttypes_pri_broken=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6; } fi if test "$gt_cv_inttypes_pri_broken" = yes; then cat >>confdefs.h <<_ACEOF #define PRI_MACROS_BROKEN 1 _ACEOF PRI_MACROS_BROKEN=1 else PRI_MACROS_BROKEN=0 fi cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF { echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f conftest* if test "${ac_cv_header_minix_config_h+set}" = set; then { echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking minix/config.h usability" >&5 echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking minix/config.h presence" >&5 echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } fi if test $ac_cv_header_minix_config_h = yes; then MINIX=yes else MINIX= fi if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6; } if test "${ac_cv_safe_to_define___extensions__+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_safe_to_define___extensions__=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _TANDEM_SOURCE 1 _ACEOF # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then enableval=$enable_threads; gl_use_threads=$enableval else case "$host_os" in osf*) gl_use_threads=no ;; *) gl_use_threads=yes ;; esac fi if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # For using : case "$host_os" in osf*) # On OSF/1, the compiler needs the flag -D_REENTRANT so that it # groks . cc also understands the flag -pthread, but # we don't use it because 1. gcc-2.95 doesn't understand -pthread, # 2. putting a flag into CPPFLAGS that has an effect on the linker # causes the AC_TRY_LINK test below to succeed unexpectedly, # leading to wrong values of LIBTHREAD and LTLIBTHREAD. CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of 'errno' in . case "$host_os" in aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac fi if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then { echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 echo "${ECHO_T}$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi gl_threads_api=none LIBTHREAD= LTLIBTHREAD= LIBMULTITHREAD= LTLIBMULTITHREAD= if test "$gl_use_threads" != no; then { echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5 echo $ECHO_N "checking whether imported symbols can be declared weak... $ECHO_C" >&6; } gl_have_weak=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern void xyzzy (); #pragma weak xyzzy int main () { xyzzy(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gl_have_weak=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext { echo "$as_me:$LINENO: result: $gl_have_weak" >&5 echo "${ECHO_T}$gl_have_weak" >&6; } if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that # it groks . It's added above, in gl_LOCK_EARLY_BODY. if test "${ac_cv_header_pthread_h+set}" = set; then { echo "$as_me:$LINENO: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking pthread.h usability" >&5 echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking pthread.h presence" >&5 echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_pthread_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } fi if test $ac_cv_header_pthread_h = yes; then gl_have_pthread_h=yes else gl_have_pthread_h=no fi if test "$gl_have_pthread_h" = yes; then # Other possible tests: # -lpthreads (FSU threads, PCthreads) # -lgthreads gl_have_pthread= # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist # in libc. IRIX 6.5 has the first one in both libc and libpthread, but # the second one only in libpthread, and lock.c needs it. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { pthread_mutex_lock((pthread_mutex_t*)0); pthread_mutexattr_init((pthread_mutexattr_t*)0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gl_have_pthread=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) if test -n "$gl_have_pthread"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. { echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_kill (); int main () { return pthread_kill (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_kill=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_kill=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; } if test $ac_cv_lib_pthread_pthread_kill = yes; then LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. # Therefore pthread_in_use() needs to actually try to create a # thread: pthread_create from libc will fail, whereas # pthread_create will actually create a thread. case "$host_os" in solaris* | hpux*) cat >>confdefs.h <<\_ACEOF #define PTHREAD_IN_USE_DETECTION_HARD 1 _ACEOF esac fi else # Some library is needed. Try libpthread and libc_r. { echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_kill (); int main () { return pthread_kill (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_kill=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_kill=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; } if test $ac_cv_lib_pthread_pthread_kill = yes; then gl_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread fi if test -z "$gl_have_pthread"; then # For FreeBSD 4. { echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5 echo $ECHO_N "checking for pthread_kill in -lc_r... $ECHO_C" >&6; } if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_kill (); int main () { return pthread_kill (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_r_pthread_kill=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_kill=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_kill" >&6; } if test $ac_cv_lib_c_r_pthread_kill = yes; then gl_have_pthread=yes LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r fi fi fi if test -n "$gl_have_pthread"; then gl_threads_api=posix cat >>confdefs.h <<\_ACEOF #define USE_POSIX_THREADS 1 _ACEOF if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then cat >>confdefs.h <<\_ACEOF #define USE_POSIX_THREADS_WEAK 1 _ACEOF LIBTHREAD= LTLIBTHREAD= fi fi # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. { echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5 echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6; } if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include typedef pthread_rwlock_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pthread_rwlock_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pthread_rwlock_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5 echo "${ECHO_T}$ac_cv_type_pthread_rwlock_t" >&6; } if test $ac_cv_type_pthread_rwlock_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PTHREAD_RWLOCK 1 _ACEOF fi # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #if __FreeBSD__ == 4 error "No, in FreeBSD 4.0 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >>confdefs.h <<\_ACEOF #define HAVE_PTHREAD_MUTEX_RECURSIVE 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then gl_have_solaristhread= gl_save_LIBS="$LIBS" LIBS="$LIBS -lthread" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { thr_self(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gl_have_solaristhread=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then gl_threads_api=solaris LIBTHREAD=-lthread LTLIBTHREAD=-lthread LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" cat >>confdefs.h <<\_ACEOF #define USE_SOLARIS_THREADS 1 _ACEOF if test $gl_have_weak = yes; then cat >>confdefs.h <<\_ACEOF #define USE_SOLARIS_THREADS_WEAK 1 _ACEOF LIBTHREAD= LTLIBTHREAD= fi fi fi fi if test "$gl_use_threads" = pth; then gl_save_CPPFLAGS="$CPPFLAGS" { echo "$as_me:$LINENO: checking how to link with libpth" >&5 echo $ECHO_N "checking how to link with libpth... $ECHO_C" >&6; } if test "${ac_cv_libpth_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libpth-prefix was given. if test "${with_libpth_prefix+set}" = set; then withval=$with_libpth_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBPTH= LTLIBPTH= INCPTH= LIBPTH_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='pth ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBPTH="${LIBPTH}${LIBPTH:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" else LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_a" else LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` LIBPTH_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCPTH="${INCPTH}${INCPTH:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBPTH="${LIBPTH}${LIBPTH:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBPTH; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBPTH="${LIBPTH}${LIBPTH:+ }$dep" LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$dep" ;; esac done fi else LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-R$found_dir" done fi ac_cv_libpth_libs="$LIBPTH" ac_cv_libpth_ltlibs="$LTLIBPTH" ac_cv_libpth_cppflags="$INCPTH" ac_cv_libpth_prefix="$LIBPTH_PREFIX" fi { echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5 echo "${ECHO_T}$ac_cv_libpth_libs" >&6; } LIBPTH="$ac_cv_libpth_libs" LTLIBPTH="$ac_cv_libpth_ltlibs" INCPTH="$ac_cv_libpth_cppflags" LIBPTH_PREFIX="$ac_cv_libpth_prefix" for element in $INCPTH; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done HAVE_LIBPTH=yes gl_have_pth= gl_save_LIBS="$LIBS" LIBS="$LIBS -lpth" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { pth_self(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gl_have_pth=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then gl_threads_api=pth LIBTHREAD="$LIBPTH" LTLIBTHREAD="$LTLIBPTH" LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" cat >>confdefs.h <<\_ACEOF #define USE_PTH_THREADS 1 _ACEOF if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then cat >>confdefs.h <<\_ACEOF #define USE_PTH_THREADS_WEAK 1 _ACEOF LIBTHREAD= LTLIBTHREAD= fi fi else CPPFLAGS="$gl_save_CPPFLAGS" fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then if { case "$host_os" in mingw*) true;; *) false;; esac }; then gl_threads_api=win32 cat >>confdefs.h <<\_ACEOF #define USE_WIN32_THREADS 1 _ACEOF fi fi fi fi { echo "$as_me:$LINENO: checking for multithread API to use" >&5 echo $ECHO_N "checking for multithread API to use... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $gl_threads_api" >&5 echo "${ECHO_T}$gl_threads_api" >&6; } use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` LIBICONV_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; } int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then cat >>confdefs.h <<\_ACEOF #define HAVE_BUILTIN_EXPECT 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext for ac_header in argz.h inttypes.h limits.h unistd.h sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getcwd getegid geteuid getgid getuid mempcpy munmap \ stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \ argz_next __fsetlocking do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef feof_unlocked char *p = (char *) feof_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_feof_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_feof_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6; } if test $ac_cv_have_decl_feof_unlocked = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FEOF_UNLOCKED $gt_value _ACEOF { echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef fgets_unlocked char *p = (char *) fgets_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_fgets_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_fgets_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6; } if test $ac_cv_have_decl_fgets_unlocked = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FGETS_UNLOCKED $gt_value _ACEOF am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { echo "$as_me:$LINENO: checking for working iconv" >&5 echo $ECHO_N "checking for working iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { echo "$as_me:$LINENO: result: $am_cv_func_iconv_works" >&5 echo "${ECHO_T}$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBICONV" >&5 echo "${ECHO_T}$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { echo "$as_me:$LINENO: checking for iconv declaration" >&5 echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6; } if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi { echo "$as_me:$LINENO: checking for NL_LOCALE_NAME macro" >&5 echo $ECHO_N "checking for NL_LOCALE_NAME macro... $ECHO_C" >&6; } if test "${gt_cv_nl_locale_name+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES)); return !cs; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_nl_locale_name=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_nl_locale_name=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_nl_locale_name" >&5 echo "${ECHO_T}$gt_cv_nl_locale_name" >&6; } if test $gt_cv_nl_locale_name = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NL_LOCALE_NAME 1 _ACEOF fi for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_INTLBISON+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$INTLBISON"; then ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_INTLBISON="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi INTLBISON=$ac_cv_prog_INTLBISON if test -n "$INTLBISON"; then { echo "$as_me:$LINENO: result: $INTLBISON" >&5 echo "${ECHO_T}$INTLBISON" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$INTLBISON" && break done if test -z "$INTLBISON"; then ac_verc_fail=yes else { echo "$as_me:$LINENO: checking version of bison" >&5 echo $ECHO_N "checking version of bison... $ECHO_C" >&6; } ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac { echo "$as_me:$LINENO: result: $ac_prog_version" >&5 echo "${ECHO_T}$ac_prog_version" >&6; } fi if test $ac_verc_fail = yes; then INTLBISON=: fi { echo "$as_me:$LINENO: checking for long long int" >&5 echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } if test "${ac_cv_type_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Test preprocessor. */ #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) error in preprocessor; #endif #if ! (18446744073709551615ULL <= -1ull) error in preprocessor; #endif /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then if test "$cross_compiling" = yes; then ac_cv_type_long_long_int=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef LLONG_MAX # define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif int main () { long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long_long_int=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_type_long_long_int=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; } if test $ac_cv_type_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_LONG_INT 1 _ACEOF fi { echo "$as_me:$LINENO: checking for wchar_t" >&5 echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } if test "${gt_cv_c_wchar_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include wchar_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_wchar_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wchar_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 echo "${ECHO_T}$gt_cv_c_wchar_t" >&6; } if test $gt_cv_c_wchar_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WCHAR_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking for wint_t" >&5 echo $ECHO_N "checking for wint_t... $ECHO_C" >&6; } if test "${gt_cv_c_wint_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include wint_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_wint_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wint_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 echo "${ECHO_T}$gt_cv_c_wint_t" >&6; } if test $gt_cv_c_wint_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WINT_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking for intmax_t" >&5 echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } if test "${gt_cv_c_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif int main () { intmax_t x = -1; return !x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_intmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_intmax_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 echo "${ECHO_T}$gt_cv_c_intmax_t" >&6; } if test $gt_cv_c_intmax_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INTMAX_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether printf() supports POSIX/XSI format strings" >&5 echo $ECHO_N "checking whether printf() supports POSIX/XSI format strings... $ECHO_C" >&6; } if test "${gt_cv_func_printf_posix+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "notposix" >/dev/null 2>&1; then gt_cv_func_printf_posix="guessing no" else gt_cv_func_printf_posix="guessing yes" fi rm -f conftest* else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_printf_posix=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gt_cv_func_printf_posix=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $gt_cv_func_printf_posix" >&5 echo "${ECHO_T}$gt_cv_func_printf_posix" >&6; } case $gt_cv_func_printf_posix in *yes) cat >>confdefs.h <<\_ACEOF #define HAVE_POSIX_PRINTF 1 _ACEOF ;; esac { echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6; } if test "${ac_cv_gnu_library_2_1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then ac_cv_gnu_library_2_1=yes else ac_cv_gnu_library_2_1=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6; } GLIBC21="$ac_cv_gnu_library_2_1" for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6; } if test "${gl_cv_size_max+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gl_cv_size_max= cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Found it" >/dev/null 2>&1; then gl_cv_size_max=yes fi rm -f conftest* if test -z "$gl_cv_size_max"; then if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) size_t_bits_minus_1=$ac_lo;; '') size_t_bits_minus_1= ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include static long int longval () { return sizeof (size_t) * CHAR_BIT - 1; } static unsigned long int ulongval () { return sizeof (size_t) * CHAR_BIT - 1; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((sizeof (size_t) * CHAR_BIT - 1) < 0) { long int i = longval (); if (i != (sizeof (size_t) * CHAR_BIT - 1)) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != (sizeof (size_t) * CHAR_BIT - 1)) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then size_t_bits_minus_1=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) size_t_bits_minus_1= fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) fits_in_uint=$ac_lo;; '') fits_in_uint= ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static long int longval () { return sizeof (size_t) <= sizeof (unsigned int); } static unsigned long int ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) { long int i = longval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fits_in_uint=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) fits_in_uint= fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern size_t foo; extern unsigned long foo; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then fits_in_uint=0 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $fits_in_uint = 1; then gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else gl_cv_size_max='((size_t)~(size_t)0)' fi fi fi { echo "$as_me:$LINENO: result: $gl_cv_size_max" >&5 echo "${ECHO_T}$gl_cv_size_max" >&6; } if test "$gl_cv_size_max" != yes; then cat >>confdefs.h <<_ACEOF #define SIZE_MAX $gl_cv_size_max _ACEOF fi for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6; } if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_CFPreferencesCopyAppValue=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFPREFERENCESCOPYAPPVALUE 1 _ACEOF fi { echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6; } if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_CFLocaleCopyCurrent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFLOCALECOPYCURRENT 1 _ACEOF fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi { echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6; } if test "${ac_cv_type_ptrdiff_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ptrdiff_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_ptrdiff_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ptrdiff_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6; } if test $ac_cv_type_ptrdiff_t = yes; then : else cat >>confdefs.h <<\_ACEOF #define ptrdiff_t long _ACEOF fi for ac_header in stddef.h stdlib.h string.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to sitecopy@lyra.org ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in asprintf fwprintf putenv setenv setlocale snprintf wcslen do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl__snprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _snprintf char *p = (char *) _snprintf; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl__snprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl__snprintf=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6; } if test $ac_cv_have_decl__snprintf = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL__SNPRINTF $gt_value _ACEOF { echo "$as_me:$LINENO: checking whether _snwprintf is declared" >&5 echo $ECHO_N "checking whether _snwprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl__snwprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _snwprintf char *p = (char *) _snwprintf; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl__snwprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl__snwprintf=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl__snwprintf" >&5 echo "${ECHO_T}$ac_cv_have_decl__snwprintf" >&6; } if test $ac_cv_have_decl__snwprintf = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL__SNWPRINTF $gt_value _ACEOF { echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef getc_unlocked char *p = (char *) getc_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_getc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getc_unlocked=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6; } if test $ac_cv_have_decl_getc_unlocked = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETC_UNLOCKED $gt_value _ACEOF case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi { echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; } if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char* cs = nl_langinfo(CODESET); return !cs; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_langinfo_codeset=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6; } if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LANGINFO_CODESET 1 _ACEOF fi { echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6; } if test "${gt_cv_val_LC_MESSAGES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_val_LC_MESSAGES=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_val_LC_MESSAGES=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_val_LC_MESSAGES" >&5 echo "${ECHO_T}$gt_cv_val_LC_MESSAGES" >&6; } if test $gt_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 _ACEOF fi if test "$enable_shared" = yes; then case "$host_os" in mingw* | cygwin*) is_woe32dll=yes ;; *) is_woe32dll=no ;; esac else is_woe32dll=no fi WOE32DLL=$is_woe32dll case "$host_os" in mingw* | cygwin*) is_woe32=yes ;; *) is_woe32=no ;; esac WOE32=$is_woe32 if test $WOE32 = yes; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_WINDRES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$WINDRES"; then ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_WINDRES="${ac_tool_prefix}windres" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi WINDRES=$ac_cv_prog_WINDRES if test -n "$WINDRES"; then { echo "$as_me:$LINENO: result: $WINDRES" >&5 echo "${ECHO_T}$WINDRES" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_WINDRES"; then ac_ct_WINDRES=$WINDRES # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_WINDRES"; then ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_WINDRES="windres" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES if test -n "$ac_ct_WINDRES"; then { echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5 echo "${ECHO_T}$ac_ct_WINDRES" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_WINDRES" = x; then WINDRES="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac WINDRES=$ac_ct_WINDRES fi else WINDRES="$ac_cv_prog_WINDRES" fi fi case "$host_os" in hpux*) LTLIBC="" ;; *) LTLIBC="-lc" ;; esac { echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6; } if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_CFPreferencesCopyAppValue=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFPREFERENCESCOPYAPPVALUE 1 _ACEOF fi { echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6; } if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_CFLocaleCopyCurrent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFLOCALECOPYCURRENT 1 _ACEOF fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no { echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6; } # Check whether --with-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval=$with_included_gettext; nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no fi { echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6; } nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } if { as_var=$gt_func_gnugettext_libc; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$gt_func_gnugettext_libc=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$gt_func_gnugettext_libc'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` LIBINTL_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } if { as_var=$gt_func_gnugettext_libintl; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$gt_func_gnugettext_libintl=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi ac_res=`eval echo '${'$gt_func_gnugettext_libintl'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test "$gt_use_preinstalled_gnugettext" != "yes"; then nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV $LIBTHREAD" LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then CATOBJEXT=.gmo fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF else USE_NLS=no fi fi { echo "$as_me:$LINENO: checking whether to use NLS" >&5 echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { echo "$as_me:$LINENO: result: $gt_source" >&5 echo "${ECHO_T}$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { echo "$as_me:$LINENO: checking how to link with libintl" >&5 echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBINTL" >&5 echo "${ECHO_T}$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi POSUB=po fi if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi nls_cv_header_intl= nls_cv_header_libgt= DATADIRNAME=share INSTOBJEXT=.mo GENCAT=gencat INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi INTL_LIBTOOL_SUFFIX_PREFIX= INTLLIBS="$LIBINTL" if test "$USE_NLS" = "yes"; then if test "$USE_INCLUDED_LIBINTL" = "yes"; then nls_msg="Built using included libintl" CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl" else nls_msg="Built using native support" fi else nls_msg="Not built" fi # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then enableval=$enable_warnings; fi if test "$enable_warnings" = "yes"; then case $GCC:`uname` in yes:*) CFLAGS="$CFLAGS -Wall -Wmissing-declarations -Wshadow -Wreturn-type -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wformat-security" if test -z "$with_ssl" -o "$with_ssl" = "no"; then # OpenSSL headers fail strict prototypes checks CFLAGS="$CFLAGS -Wstrict-prototypes" fi ;; no:OSF1) CFLAGS="$CFLAGS -check -msg_disable returnchecks -msg_disable alignment -msg_disable overflow" ;; no:IRIX) CFLAGS="$CFLAGS -fullwarn" ;; no:UnixWare) CFLAGS="$CFLAGS -v" ;; *) { echo "$as_me:$LINENO: WARNING: warning flags unknown for compiler on this platform" >&5 echo "$as_me: WARNING: warning flags unknown for compiler on this platform" >&2;} ;; esac fi if test "$enable_gnomefe" = "yes"; then if test "$gnome_is_ok" = "yes"; then EXTRAOBJS="$EXTRAOBJS \$(GNOMEOBJS)" LIBS="$LIBS $GNOME_LIBS $GTK_LIBS $GNOME_LIBDIR $GNOMEUI_LIBS $LIBGLADE_LIBS" CPPFLAGS="$CPPFLAGS $GNOME_INCLUDEDIR $LIBGLADE_CFLAGS" GNOME_SC_HELPDIR="`gnome-config --datadir`/gnome/help/xsitecopy" SHORTCUT_LOCATION="`gnome-config --datadir`/gnome/apps/Internet" TARGET="xsitecopy" fe_msg="GNOME" else { { echo "$as_me:$LINENO: error: could not find the required GNOME libraries" >&5 echo "$as_me: error: could not find the required GNOME libraries" >&2;} { (exit 1); exit 1; }; } fi else # Console front end EXTRAOBJS="$EXTRAOBJS src/console_fe.o" case " $LIBOBJS " in *" lib/rpmatch.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/rpmatch.$ac_objext" ;; esac case " $LIBOBJS " in *" lib/yesno.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/yesno.$ac_objext" ;; esac fe_msg="Console" TARGET="sitecopy" fi # This goes in CPPFLAGS so libneon/Makefile can pick up config.h CPPFLAGS="$CPPFLAGS -I\$(top_builddir)" ac_config_files="$ac_config_files Makefile lib/neon/Makefile po/Makefile.in intl/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by sitecopy $as_me 0.16.6, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ sitecopy config.status 0.16.6 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/neon/Makefile") CONFIG_FILES="$CONFIG_FILES lib/neon/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "intl/Makefile") CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim SET_MAKE!$SET_MAKE$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LIBOBJS!$LIBOBJS$ac_delim NEON_CONFIG!$NEON_CONFIG$ac_delim NE_FLAG_SSL!$NE_FLAG_SSL$ac_delim NE_FLAG_ZLIB!$NE_FLAG_ZLIB$ac_delim NE_FLAG_IPV6!$NE_FLAG_IPV6$ac_delim NE_FLAG_LFS!$NE_FLAG_LFS$ac_delim NE_FLAG_SOCKS!$NE_FLAG_SOCKS$ac_delim NE_FLAG_TS_SSL!$NE_FLAG_TS_SSL$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim GNUTLS_CONFIG!$GNUTLS_CONFIG$ac_delim NEON_SUPPORTS_SSL!$NEON_SUPPORTS_SSL$ac_delim KRB5_CONFIG!$KRB5_CONFIG$ac_delim NEON_CFLAGS!$NEON_CFLAGS$ac_delim NEON_LIBS!$NEON_LIBS$ac_delim NEON_LTLIBS!$NEON_LTLIBS$ac_delim NEON_BUILD_BUNDLED!$NEON_BUILD_BUNDLED$ac_delim XML2_CONFIG!$XML2_CONFIG$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim NE_FLAG_DAV!$NE_FLAG_DAV$ac_delim NEON_TARGET!$NEON_TARGET$ac_delim NEON_OBJEXT!$NEON_OBJEXT$ac_delim NEONOBJS!$NEONOBJS$ac_delim NEON_EXTRAOBJS!$NEON_EXTRAOBJS$ac_delim NEON_LINK_FLAGS!$NEON_LINK_FLAGS$ac_delim LIBGLADE_CONFIG!$LIBGLADE_CONFIG$ac_delim LIBGLADE_CFLAGS!$LIBGLADE_CFLAGS$ac_delim LIBGLADE_LIBS!$LIBGLADE_LIBS$ac_delim mkdir_p!$mkdir_p$ac_delim USE_NLS!$USE_NLS$ac_delim GETTEXT_MACRO_VERSION!$GETTEXT_MACRO_VERSION$ac_delim MSGFMT!$MSGFMT$ac_delim GMSGFMT!$GMSGFMT$ac_delim MSGFMT_015!$MSGFMT_015$ac_delim GMSGFMT_015!$GMSGFMT_015$ac_delim XGETTEXT!$XGETTEXT$ac_delim XGETTEXT_015!$XGETTEXT_015$ac_delim MSGMERGE!$MSGMERGE$ac_delim XGETTEXT_EXTRA_OPTIONS!$XGETTEXT_EXTRA_OPTIONS$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF host_os!$host_os$ac_delim GLIBC2!$GLIBC2$ac_delim CFLAG_VISIBILITY!$CFLAG_VISIBILITY$ac_delim HAVE_VISIBILITY!$HAVE_VISIBILITY$ac_delim ALLOCA!$ALLOCA$ac_delim PRI_MACROS_BROKEN!$PRI_MACROS_BROKEN$ac_delim LIBPTH!$LIBPTH$ac_delim LTLIBPTH!$LTLIBPTH$ac_delim LIBPTH_PREFIX!$LIBPTH_PREFIX$ac_delim LIBTHREAD!$LIBTHREAD$ac_delim LTLIBTHREAD!$LTLIBTHREAD$ac_delim LIBMULTITHREAD!$LIBMULTITHREAD$ac_delim LTLIBMULTITHREAD!$LTLIBMULTITHREAD$ac_delim LIBICONV!$LIBICONV$ac_delim LTLIBICONV!$LTLIBICONV$ac_delim INTLBISON!$INTLBISON$ac_delim GLIBC21!$GLIBC21$ac_delim INTL_MACOSX_LIBS!$INTL_MACOSX_LIBS$ac_delim HAVE_POSIX_PRINTF!$HAVE_POSIX_PRINTF$ac_delim HAVE_ASPRINTF!$HAVE_ASPRINTF$ac_delim HAVE_SNPRINTF!$HAVE_SNPRINTF$ac_delim HAVE_WPRINTF!$HAVE_WPRINTF$ac_delim WOE32DLL!$WOE32DLL$ac_delim WOE32!$WOE32$ac_delim WINDRES!$WINDRES$ac_delim LTLIBC!$LTLIBC$ac_delim BUILD_INCLUDED_LIBINTL!$BUILD_INCLUDED_LIBINTL$ac_delim USE_INCLUDED_LIBINTL!$USE_INCLUDED_LIBINTL$ac_delim CATOBJEXT!$CATOBJEXT$ac_delim DATADIRNAME!$DATADIRNAME$ac_delim INSTOBJEXT!$INSTOBJEXT$ac_delim GENCAT!$GENCAT$ac_delim INTLOBJS!$INTLOBJS$ac_delim INTL_LIBTOOL_SUFFIX_PREFIX!$INTL_LIBTOOL_SUFFIX_PREFIX$ac_delim INTLLIBS!$INTLLIBS$ac_delim LIBINTL!$LIBINTL$ac_delim LTLIBINTL!$LTLIBINTL$ac_delim POSUB!$POSUB$ac_delim GNOME_SC_HELPDIR!$GNOME_SC_HELPDIR$ac_delim XSC_HELP!$XSC_HELP$ac_delim SHORTCUT_LOCATION!$SHORTCUT_LOCATION$ac_delim EXTRAOBJS!$EXTRAOBJS$ac_delim TARGET!$TARGET$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 44; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi { echo "$as_me:$LINENO: Configured sitecopy $PACKAGE_VERSION: Install prefix: ${prefix} Compiler: ${CC} Frontend: ${fe_msg} (executable named '${TARGET}') Supported protocols: ${proto_msg} neon library: ${neon_library_message} XML Parser: ${neon_xml_parser_message} SSL library: ${ne_SSL_message} Internationalization: ${nls_msg} " >&5 echo "$as_me: Configured sitecopy $PACKAGE_VERSION: Install prefix: ${prefix} Compiler: ${CC} Frontend: ${fe_msg} (executable named '${TARGET}') Supported protocols: ${proto_msg} neon library: ${neon_library_message} XML Parser: ${neon_xml_parser_message} SSL library: ${ne_SSL_message} Internationalization: ${nls_msg} " >&6;} if test "$enable_gnomefe" = "yes"; then { echo "$as_me:$LINENO: The GNOME frontend is currently unmaintained." >&5 echo "$as_me: The GNOME frontend is currently unmaintained." >&6;} fi # Create all the necessary directories for VPATH builds. for i in gnome src intl lib/expat lib/expat/xmltok lib/expat/gennmtab \ lib/expat/xmlparse; do test -d $i || mkdir $i done sitecopy-0.16.6/.version0000664000076400007640000000000711037462352013257 0ustar joejoe0.16.6 sitecopy-0.16.6/ChangeLog0000664000076400007640000007655011037462352013363 0ustar joejoe------------------------------------------------------------------------ r1493 | joe | 2008-07-16 22:30:06 +0100 (Wed, 16 Jul 2008) | 1 line Tag release 0.16.6. ------------------------------------------------------------------------ r1492 | joe | 2008-07-16 22:28:20 +0100 (Wed, 16 Jul 2008) | 1 line * NEWS: New news. ------------------------------------------------------------------------ r1491 | joe | 2008-07-16 22:28:00 +0100 (Wed, 16 Jul 2008) | 1 line * BUGS: Note a bug. ------------------------------------------------------------------------ r1490 | joe | 2008-07-16 22:23:48 +0100 (Wed, 16 Jul 2008) | 2 lines * src/davdriver.c (DISABLE_PROGRESS): Fix for neon >= 0.27. ------------------------------------------------------------------------ r1488 | joe | 2008-07-16 17:06:18 +0100 (Wed, 16 Jul 2008) | 1 line * NEWS: Update version. ------------------------------------------------------------------------ r1487 | joe | 2008-07-16 17:02:31 +0100 (Wed, 16 Jul 2008) | 1 line * po/LINGUAS: New file. ------------------------------------------------------------------------ r1486 | joe | 2008-07-16 17:00:22 +0100 (Wed, 16 Jul 2008) | 2 lines * .update-po.sh: Update for new mailing list. ------------------------------------------------------------------------ r1485 | joe | 2008-07-16 16:59:53 +0100 (Wed, 16 Jul 2008) | 2 lines * .update-po.sh: Fix for current gettext. ------------------------------------------------------------------------ r1483 | joe | 2008-07-16 16:49:20 +0100 (Wed, 16 Jul 2008) | 2 lines * NEWS: Update. ------------------------------------------------------------------------ r1482 | joe | 2008-07-16 16:49:04 +0100 (Wed, 16 Jul 2008) | 2 lines Update to neon 0.28.x branches. ------------------------------------------------------------------------ r1481 | joe | 2008-07-16 16:47:08 +0100 (Wed, 16 Jul 2008) | 1 line * po/: make update-po. ------------------------------------------------------------------------ r1469 | joe | 2008-07-09 20:26:01 +0100 (Wed, 09 Jul 2008) | 9 lines Adjust for neon 0.27.x API: * src/sites.c, src/protocol.h (site_sock_progress_cb): Take ne_off_t arguments. * src/console_fe.c, src/frontend.h (fe_transfer_progress): Likewise. * src/common.h: Define ne_off_t where necessary. ------------------------------------------------------------------------ r1468 | joe | 2008-07-09 20:15:06 +0100 (Wed, 09 Jul 2008) | 3 lines * src/console_fe.c (fe_fetch_found, fe_can_update): Use temp buffers to print file sizes to avoid untranslateable messages. ------------------------------------------------------------------------ r1467 | joe | 2008-07-09 20:11:18 +0100 (Wed, 09 Jul 2008) | 2 lines * po/: Update from latest gettext. ------------------------------------------------------------------------ r1464 | joe | 2008-07-07 21:55:49 +0100 (Mon, 07 Jul 2008) | 1 line * src/davdriver.c: Fix typo. ------------------------------------------------------------------------ r1463 | joe | 2008-07-07 21:55:29 +0100 (Mon, 07 Jul 2008) | 2 lines * Makefile.in: Set datarootdir to quieten autoconf warning. ------------------------------------------------------------------------ r1438 | joe | 2008-04-02 12:59:30 +0100 (Wed, 02 Apr 2008) | 2 lines * configure.in: Support 0.28.. ------------------------------------------------------------------------ r1301 | joe | 2008-01-30 09:58:10 +0000 (Wed, 30 Jan 2008) | 2 lines Switch to neon 0.27.x branches for externals. ------------------------------------------------------------------------ r1300 | joe | 2008-01-30 09:56:14 +0000 (Wed, 30 Jan 2008) | 5 lines * src/davdriver.c (notify_status, init): Support neon 0.27.x notification API. * configure.in: Add neon 0.27 to supported version list. ------------------------------------------------------------------------ r1074 | joe | 2006-09-25 20:14:15 +0100 (Mon, 25 Sep 2006) | 2 lines * doc/sitecopy.1: Note default permissions handling. ------------------------------------------------------------------------ r1061 | joe | 2006-08-01 11:09:03 +0100 (Tue, 01 Aug 2006) | 3 lines * src/sites.c (DIRSTACKSIZE): Bump maximum directory search depth to 1024. ------------------------------------------------------------------------ r1060 | joe | 2006-07-28 11:38:59 +0100 (Fri, 28 Jul 2006) | 2 lines Note bug from Heiko Schlittermann. ------------------------------------------------------------------------ r1031 | joe | 2006-04-12 21:34:57 +0100 (Wed, 12 Apr 2006) | 6 lines * src/sites.h (struct site): Add server_cert field. * src/davdriver.c (verify_certificate): New function; replace verify_trusted, verify_untrusted. (init): Store cached cert in site->server_cert. ------------------------------------------------------------------------ r1025 | joe | 2006-04-07 09:17:08 +0100 (Fri, 07 Apr 2006) | 2 lines Replacement OS/2 README from Franz Bakan. ------------------------------------------------------------------------ r1013 | joe | 2006-03-12 16:08:22 +0000 (Sun, 12 Mar 2006) | 2 lines * po/it.po: Italian translation update from Cristian Rigamonti. ------------------------------------------------------------------------ r1010 | joe | 2006-03-12 10:07:42 +0000 (Sun, 12 Mar 2006) | 2 lines * po/: make update-po. ------------------------------------------------------------------------ r1008 | joe | 2006-03-12 10:04:06 +0000 (Sun, 12 Mar 2006) | 2 lines * NEWS: Update. ------------------------------------------------------------------------ r1007 | joe | 2006-03-12 09:57:51 +0000 (Sun, 12 Mar 2006) | 2 lines Switch to using neon 0.26.x for externals. ------------------------------------------------------------------------ r977 | joe | 2006-03-01 19:38:21 +0000 (Wed, 01 Mar 2006) | 7 lines * configure.in: Support neon 0.26.x. * src/davdriver.c (init, pfind_results): Adapt for neon 0.26.x API. (destroy_private): New function. * src/sites.c (fetch_checksum_file): Adapt for neon 0.26.x MD5 API. ------------------------------------------------------------------------ r865 | joe | 2006-02-04 12:36:49 +0000 (Sat, 04 Feb 2006) | 2 lines * src/console_fe.c (fe_login): Respect the password buffer size. ------------------------------------------------------------------------ r864 | joe | 2006-02-04 12:16:36 +0000 (Sat, 04 Feb 2006) | 13 lines Add client certificate support for DAV driver: * src/sites.h (struct site): Add client_cert member. * src/rcfile.c (rcfile_read): Parse client-cert option. (rcfile_verify): Resolve $HOME-relative client-cert. * src/davdriver.c (init): Decrypt and configure client-cert. * src/frontend.h (fe_decrypt_clicert): New function. * src/console_fe.c (fe_decrypt_clicert): Implement. ------------------------------------------------------------------------ r863 | joe | 2006-02-04 10:18:08 +0000 (Sat, 04 Feb 2006) | 3 lines * src/sitestore.c (site_write_stored_state): Use \n rather than EOL macro. ------------------------------------------------------------------------ r862 | joe | 2006-02-04 10:15:52 +0000 (Sat, 04 Feb 2006) | 4 lines * src/sitestore.c (INVALID_MODE): New macro. (start_element): Initialize stored.mode to INVALID_MODE. (site_write_stored_state): Only write stored.mode if valid. ------------------------------------------------------------------------ r861 | joe | 2006-02-04 10:11:28 +0000 (Sat, 04 Feb 2006) | 4 lines * src/sitestore.c (start_element): Clear truth value. (end_element): Fail if no boolean was given. Set error messages for integer overflow in size/modtime parsing. ------------------------------------------------------------------------ r860 | joe | 2006-02-04 10:06:02 +0000 (Sat, 04 Feb 2006) | 3 lines * Makefile.in: Update for removal of fileset.c (missed in previous commit). ------------------------------------------------------------------------ r826 | joe | 2006-01-03 20:25:23 +0000 (Tue, 03 Jan 2006) | 4 lines * src/sitefiles.c (file_insert, file_set, file_set_stored, file_set_local): Move here... * src/rcfile.c: ...from here; file removed. ------------------------------------------------------------------------ r793 | joe | 2005-12-30 16:25:48 +0000 (Fri, 30 Dec 2005) | 13 lines Remove borked abort-safety handling: * src/console_fe.c (abort_now, abort_handler, init_signals, fe_disable_abort, fe_enable_abort, quit_handler): Remove functions. * src/frontend.h (fe_disable_abort, fe_enable_abort): Remove prototypes. * src/sitesi.h (site_enter, site_leave): Remove macros. * src/console_fe.c, src/sitefiles.c, src/sites.c, src/fileset.c: All callers removed. ------------------------------------------------------------------------ r792 | joe | 2005-12-30 16:13:23 +0000 (Fri, 30 Dec 2005) | 2 lines * Makefile.in (HEADERS): Update dependencies. ------------------------------------------------------------------------ r791 | joe | 2005-12-30 16:12:36 +0000 (Fri, 30 Dec 2005) | 3 lines * src/sites.h (struct file_state, struct site_file, struct site): Stop using bitfields throughout. ------------------------------------------------------------------------ r790 | joe | 2005-12-30 16:11:47 +0000 (Fri, 30 Dec 2005) | 6 lines * src/fileset.c (file_set): Move here from fileset.h's macro-based implementation; adjust to take structure offset arguments. (file_set_local, file_set_stored): Implement using file_set. * src/fileset.h: Remove file. ------------------------------------------------------------------------ r789 | joe | 2005-12-30 16:11:37 +0000 (Fri, 30 Dec 2005) | 6 lines * src/fileset.c (file_set): Move here from fileset.h's macro-based implementation; adjust to take structure offset arguments. (file_set_local, file_set_stored): Implement using file_set. * src/fileset.h: Remove file. ------------------------------------------------------------------------ r788 | joe | 2005-12-30 13:32:39 +0000 (Fri, 30 Dec 2005) | 2 lines * po/: make update-po. ------------------------------------------------------------------------ r786 | joe | 2005-12-30 13:19:50 +0000 (Fri, 30 Dec 2005) | 1 line News for 0.16.2. ------------------------------------------------------------------------ r785 | joe | 2005-12-30 13:19:29 +0000 (Fri, 30 Dec 2005) | 2 lines * Makefile.in, configure.in: Remove stale references to NLSINSTALL. ------------------------------------------------------------------------ r784 | joe | 2005-12-30 13:18:29 +0000 (Fri, 30 Dec 2005) | 3 lines * src/ftp.c (ftp_put): Retry the STOR command twice if there is a timeout reading the response on the PI connection. ------------------------------------------------------------------------ r783 | joe | 2005-12-30 13:13:23 +0000 (Fri, 30 Dec 2005) | 3 lines * src/fileset.h (file_set_local/remote): Don't consider a file as a "move" or "rename" candidate if its diff is "unchanged". ------------------------------------------------------------------------ r779 | joe | 2005-12-12 21:21:53 +0000 (Mon, 12 Dec 2005) | 2 lines Random updates. ------------------------------------------------------------------------ r778 | joe | 2005-12-12 21:19:06 +0000 (Mon, 12 Dec 2005) | 2 lines * src/protocol.h (struct proto_file): Remove now-unused depth field. ------------------------------------------------------------------------ r777 | joe | 2005-12-12 21:17:10 +0000 (Mon, 12 Dec 2005) | 2 lines * doc/sitecopy.1: Clarify interaction of "permissions dir". ------------------------------------------------------------------------ r776 | joe | 2005-12-12 21:13:07 +0000 (Mon, 12 Dec 2005) | 8 lines Fix (and simplify) DAV fetch mode files list ordering: * src/davdriver.c (struct fetch_context): Add tail field. (get_depth): Remove function. (insert_file): Just append new files to the tail of the list. (pfind_results): Remove depth handling. (fetch_list): Initialize tail field. ------------------------------------------------------------------------ r742 | joe | 2005-10-24 14:09:55 +0100 (Mon, 24 Oct 2005) | 2 lines * src/lsparser.c (ls_pflist_add): Fix memory leak. ------------------------------------------------------------------------ r741 | joe | 2005-10-24 14:09:28 +0100 (Mon, 24 Oct 2005) | 3 lines * src/lsparser.c (ls_parse): Reset after_blank flag after parsing a non-blank line. ------------------------------------------------------------------------ r724 | joe | 2005-09-24 20:01:40 +0100 (Sat, 24 Sep 2005) | 2 lines * po/: make update-po. ------------------------------------------------------------------------ r723 | joe | 2005-09-24 20:00:05 +0100 (Sat, 24 Sep 2005) | 2 lines Update for 0.16.1. ------------------------------------------------------------------------ r720 | joe | 2005-09-22 01:53:36 +0100 (Thu, 22 Sep 2005) | 4 lines * src/ftp.c (parse_reply): Unset sess->pisock after closure on 421 response. (ftp_open): If authenticate() fails, only close the PI connection if it was not already closed. ------------------------------------------------------------------------ r694 | joe | 2005-09-10 10:23:45 +0100 (Sat, 10 Sep 2005) | 4 lines * src/lsparser.c (parse_file): Improve error messages. * src/ftp.c (ftp_fetch): Use error message from ls parser API. ------------------------------------------------------------------------ r670 | joe | 2005-08-13 17:51:21 +0100 (Sat, 13 Aug 2005) | 6 lines Spec file cleanup: - remove xsitecopy subpackage - use find_lang - use %%configure - general clean up ------------------------------------------------------------------------ r669 | joe | 2005-08-07 21:48:43 +0100 (Sun, 07 Aug 2005) | 2 lines Note missing docs. ------------------------------------------------------------------------ r667 | joe | 2005-08-07 21:36:06 +0100 (Sun, 07 Aug 2005) | 2 lines * configure.in: Use AC_MSG_NOTICE. ------------------------------------------------------------------------ r666 | joe | 2005-08-07 21:35:40 +0100 (Sun, 07 Aug 2005) | 2 lines make update-po ------------------------------------------------------------------------ r665 | joe | 2005-08-07 21:26:11 +0100 (Sun, 07 Aug 2005) | 2 lines Reorder. ------------------------------------------------------------------------ r664 | joe | 2005-08-07 21:25:50 +0100 (Sun, 07 Aug 2005) | 2 lines Update for 0.16.0. ------------------------------------------------------------------------ r663 | joe | 2005-08-07 21:25:16 +0100 (Sun, 07 Aug 2005) | 3 lines * doc/sitecopy.1: Document that exclude applies to --fetch operations now too. ------------------------------------------------------------------------ r662 | joe | 2005-08-07 21:24:29 +0100 (Sun, 07 Aug 2005) | 3 lines * src/sites.c (site_update): Delete files before creating directories so that the "replace a file with a directory" case works. ------------------------------------------------------------------------ r661 | joe | 2005-07-26 22:20:21 +0100 (Tue, 26 Jul 2005) | 3 lines * src/sites.c (site_flatlist): Use remote_is_different flag not local_is_different. ------------------------------------------------------------------------ r652 | joe | 2005-07-01 23:45:51 +0100 (Fri, 01 Jul 2005) | 2 lines * po/de.po: Update from Jens Seidel via Reed. ------------------------------------------------------------------------ r649 | joe | 2005-06-29 10:44:47 +0100 (Wed, 29 Jun 2005) | 3 lines * src/sftpdriver.c (sftp_disconnect): Fix build on platforms without socketpair() and missing definition of SHUT_RDWR. ------------------------------------------------------------------------ r647 | joe | 2005-06-28 08:24:30 +0100 (Tue, 28 Jun 2005) | 15 lines * src/sites.c (fetch_add_file): New function, factored out from site_fetch_walk. (fetch_checksum_file): New function, factored out from site_fetch_checksum. (site_fetch): Rewrite to recursively fetch remote site state, rather than relying on the protocol providing a recursive listing. * src/davdriver.c (fetch_list): Use a depth-one PROPFIND. * src/ftp.c (ftp_fetch): Don't request a recursive LIST. * src/rshdriver.c (run_rcmd): Don't request a recursive ls. * src/sftpdriver.c (fetch_list): Don't request a recursive ls. ------------------------------------------------------------------------ r646 | joe | 2005-06-28 08:12:20 +0100 (Tue, 28 Jun 2005) | 3 lines * src/ftp.c (dtp_open_active): Add a missing return-on-error; fail if getsockname did not return a port number for the bound data socket. ------------------------------------------------------------------------ r645 | joe | 2005-06-28 08:10:04 +0100 (Tue, 28 Jun 2005) | 3 lines * src/sitesi.h, src/sitefiles.c (file_isascii): Constify filename argument. ------------------------------------------------------------------------ r644 | joe | 2005-06-28 08:09:21 +0100 (Tue, 28 Jun 2005) | 2 lines * configure.in: Move AC_WARN for gnomefe later. ------------------------------------------------------------------------ r643 | joe | 2005-06-28 07:46:59 +0100 (Tue, 28 Jun 2005) | 2 lines * src/lsparser.h: Improve documentation. ------------------------------------------------------------------------ r617 | joe | 2005-05-18 21:30:09 +0100 (Wed, 18 May 2005) | 4 lines * src/ftp.c (parse_reply): Return FTP_BROKEN for a 421 response, and close the PI connection. Fixes issues with transient "idle timeout" logic in some FTP servers. ------------------------------------------------------------------------ r610 | joe | 2005-05-08 18:49:28 +0100 (Sun, 08 May 2005) | 6 lines From Chris White: * gnome/misc.c (quit_please): Fix. * gnome/minilist.c (remove_minilist_item): Fix. ------------------------------------------------------------------------ r609 | joe | 2005-05-08 18:46:42 +0100 (Sun, 08 May 2005) | 2 lines * debian/: Remove per advice from Reed Snellenberger. ------------------------------------------------------------------------ r603 | joe | 2005-04-24 19:41:55 +0100 (Sun, 24 Apr 2005) | 2 lines * po/: make update-po. ------------------------------------------------------------------------ r602 | joe | 2005-04-24 19:39:37 +0100 (Sun, 24 Apr 2005) | 2 lines Mention Reed's man page tweak. ------------------------------------------------------------------------ r601 | joe | 2005-04-24 19:37:10 +0100 (Sun, 24 Apr 2005) | 1 line Prepare for 0.15.1. ------------------------------------------------------------------------ r598 | joe | 2005-04-24 19:31:37 +0100 (Sun, 24 Apr 2005) | 3 lines * src/davdriver.c, src/sites.c, src/ftp.c, src/common.h: Use new NE_VERSION_* macros. ------------------------------------------------------------------------ r597 | joe | 2005-04-24 17:19:28 +0100 (Sun, 24 Apr 2005) | 2 lines * configure.in: Quieten output. ------------------------------------------------------------------------ r596 | joe | 2005-04-24 17:18:55 +0100 (Sun, 24 Apr 2005) | 3 lines * src/ftp.c (send_file_ascii): Fix newline munging to better handle partial lines. ------------------------------------------------------------------------ r595 | joe | 2005-04-24 17:17:35 +0100 (Sun, 24 Apr 2005) | 2 lines * gnome/: Update Lee's e-mail address. ------------------------------------------------------------------------ r594 | joe | 2005-04-24 17:10:48 +0100 (Sun, 24 Apr 2005) | 3 lines * doc/sitecopy.1: Comment on "http secure" (Reed Snellenberger). ------------------------------------------------------------------------ r543 | joe | 2005-04-04 18:36:38 +0100 (Mon, 04 Apr 2005) | 4 lines * src/davdriver.c (get_server_port): Don't use ne_service_lookup. * src/ftpdriver.c (get_server_port): Likewise. ------------------------------------------------------------------------ r528 | joe | 2005-03-19 20:43:21 +0000 (Sat, 19 Mar 2005) | 2 lines * po/it.po: Update from Cristian Rigamonti. ------------------------------------------------------------------------ r523 | joe | 2005-03-05 09:38:17 +0000 (Sat, 05 Mar 2005) | 1 line make update-po ------------------------------------------------------------------------ r522 | joe | 2005-03-05 09:36:11 +0000 (Sat, 05 Mar 2005) | 2 lines * configure.in: Quoting fixes. ------------------------------------------------------------------------ r521 | joe | 2005-03-05 09:32:33 +0000 (Sat, 05 Mar 2005) | 1 line Ignore ChangeLog ------------------------------------------------------------------------ r520 | joe | 2005-03-05 09:31:06 +0000 (Sat, 05 Mar 2005) | 2 lines Prepare for 0.15.0. ------------------------------------------------------------------------ r519 | joe | 2005-03-05 09:30:07 +0000 (Sat, 05 Mar 2005) | 3 lines * src/rshdriver.c (file_delete, file_chmod, dir_create, dir_remove): More quoting half-fixes from Nobuyuki. ------------------------------------------------------------------------ r513 | joe | 2005-03-01 09:53:14 +0000 (Tue, 01 Mar 2005) | 2 lines * src/davdriver.c (init): Path-escape the remote root. ------------------------------------------------------------------------ r491 | joe | 2005-02-26 12:44:53 +0000 (Sat, 26 Feb 2005) | 2 lines * doc/sitecopy.1: Document tempupload change. ------------------------------------------------------------------------ r490 | joe | 2005-02-26 12:43:17 +0000 (Sat, 26 Feb 2005) | 3 lines * src/sites.c (update_files): Apply tempupload mode to new as well as changed files. ------------------------------------------------------------------------ r489 | joe | 2005-02-26 12:40:12 +0000 (Sat, 26 Feb 2005) | 3 lines * src/ftp.c (run_command): Hide the password in debug output by default for a PASS command. ------------------------------------------------------------------------ r474 | joe | 2005-02-06 21:10:24 +0000 (Sun, 06 Feb 2005) | 1 line make update-po ------------------------------------------------------------------------ r473 | joe | 2005-02-06 21:07:09 +0000 (Sun, 06 Feb 2005) | 2 lines Add sftpdriver.c, ne_sspi.c. ------------------------------------------------------------------------ r472 | joe | 2005-02-06 21:05:51 +0000 (Sun, 06 Feb 2005) | 1 line Remove ne_cookies.c. ------------------------------------------------------------------------ r471 | joe | 2005-02-06 21:04:35 +0000 (Sun, 06 Feb 2005) | 3 lines * src/sites.c (site_flatlist_items): Add "|ignored" after items marked as ignored. ------------------------------------------------------------------------ r470 | joe | 2005-02-06 21:01:51 +0000 (Sun, 06 Feb 2005) | 2 lines * src/sitefiles.c (fnlist_match): Use const bname. ------------------------------------------------------------------------ r469 | joe | 2005-02-06 20:57:33 +0000 (Sun, 06 Feb 2005) | 4 lines * .update-po.sh: Do clean up temp files. * .release.sh: Generate sitecopy.spec. ------------------------------------------------------------------------ r468 | joe | 2005-02-06 20:55:06 +0000 (Sun, 06 Feb 2005) | 2 lines * Makefile.in (clean): Run "clean" in po subdirectory. ------------------------------------------------------------------------ r447 | joe | 2005-01-24 21:52:53 +0000 (Mon, 24 Jan 2005) | 16 lines Add new sftp driver from Nobuyuki Tsuchimura: * configure.in: Add --enable-sftp; enable by default if socketpair() or pipe() is available. * src/rcfile.c (rcfile_read): Allow "protocol sftp". (rcfile_verify): Enable sftp driver. * src/console_fe.c (usage, version): Advertise sftp support. * src/common.c: Add sftp debug channel. * src/sftpdriver.c: New file. * src/sites.h: Define new siteproto_sftp. ------------------------------------------------------------------------ r423 | joe | 2005-01-08 13:28:31 +0000 (Sat, 08 Jan 2005) | 1 line Current news. ------------------------------------------------------------------------ r422 | joe | 2005-01-08 13:27:48 +0000 (Sat, 08 Jan 2005) | 2 lines * Makefile.in (ChangeLog): New target. ------------------------------------------------------------------------ r421 | joe | 2005-01-08 13:22:17 +0000 (Sat, 08 Jan 2005) | 5 lines * Makefile.in (MANLANGS): Define. (install-sitecopy): Install translated man pages too. * doc/sitecopy.fr.1: New file, contributed by Nicolas Girard. ------------------------------------------------------------------------ r420 | joe | 2005-01-08 13:20:37 +0000 (Sat, 08 Jan 2005) | 5 lines * Makefile.in (MANLANGS): Define. (install-sitecopy): Install translated man pages too. * doc/sitecopy.fr.1: New file, contributed by Nicolas Girard. ------------------------------------------------------------------------ r419 | joe | 2005-01-08 12:57:33 +0000 (Sat, 08 Jan 2005) | 2 lines * doc/sitecopy.1: Document actual default for symlink handling. ------------------------------------------------------------------------ r418 | joe | 2005-01-08 12:43:46 +0000 (Sat, 08 Jan 2005) | 2 lines Note some more bugs and strip email addresses. ------------------------------------------------------------------------ r417 | joe | 2005-01-08 12:35:16 +0000 (Sat, 08 Jan 2005) | 2 lines * src/ftp.c (dtp_close): Add discard flag; all callers updated. ------------------------------------------------------------------------ r412 | joe | 2005-01-06 23:24:33 +0000 (Thu, 06 Jan 2005) | 3 lines * src/lsparser.c (parse_file): Ignore the line earlier if it is not a file or dirctory; don't fail on relative symlinks. ------------------------------------------------------------------------ r411 | joe | 2005-01-06 23:11:02 +0000 (Thu, 06 Jan 2005) | 4 lines * src/ftp.c (read_reply): Don't set session error string to reply line here. (run_command, dtp_close, ftp_open): Do it here instead, but only in failure cases.b ------------------------------------------------------------------------ r410 | joe | 2005-01-06 23:09:30 +0000 (Thu, 06 Jan 2005) | 5 lines * src/lsparser.c (struct ls_context): Add error field. (fail): New function. (ls_parse): Use it to store error context. (ls_geterror): New function. ------------------------------------------------------------------------ r409 | joe | 2005-01-06 22:59:29 +0000 (Thu, 06 Jan 2005) | 4 lines * src/ftp.c (ftp_fetch): Simplify and tidy up error handling; set session error string on ls_parse errors, (set_sockerr): Print a debug message. ------------------------------------------------------------------------ r406 | joe | 2005-01-03 11:47:55 +0000 (Mon, 03 Jan 2005) | 2 lines * doc/sitecopy.1: Document "permissions dir". ------------------------------------------------------------------------ r405 | joe | 2005-01-03 11:43:59 +0000 (Mon, 03 Jan 2005) | 2 lines Update copyright notices. ------------------------------------------------------------------------ r404 | joe | 2005-01-03 11:41:14 +0000 (Mon, 03 Jan 2005) | 1 line Fix typo. ------------------------------------------------------------------------ r403 | joe | 2005-01-03 11:38:50 +0000 (Mon, 03 Jan 2005) | 1 line Changes since 0.14.2. ------------------------------------------------------------------------ r402 | joe | 2005-01-03 11:37:54 +0000 (Mon, 03 Jan 2005) | 3 lines * src/lsparser.c (parse_directory): Avoid a strlen call. (parse_file): Reject relative filenames. ------------------------------------------------------------------------ r401 | joe | 2005-01-03 11:18:24 +0000 (Mon, 03 Jan 2005) | 2 lines * src/rshdriver.c (run_rcmd): Use ne_vsnprintf. ------------------------------------------------------------------------ r400 | joe | 2005-01-03 10:52:43 +0000 (Mon, 03 Jan 2005) | 2 lines This is sh not make. ------------------------------------------------------------------------ r399 | joe | 2005-01-03 10:51:26 +0000 (Mon, 03 Jan 2005) | 2 lines * .update-po.sh: Avoid recursive make invocations. ------------------------------------------------------------------------ r398 | joe | 2005-01-03 10:45:53 +0000 (Mon, 03 Jan 2005) | 2 lines * .update-po.sh: Define DOMAIN in the Makefile. ------------------------------------------------------------------------ r397 | joe | 2005-01-03 10:41:15 +0000 (Mon, 03 Jan 2005) | 1 line Fix typo. ------------------------------------------------------------------------ r396 | joe | 2005-01-03 10:39:49 +0000 (Mon, 03 Jan 2005) | 2 lines * .update-po.sh: Another attempt at working po/Makefile.in.in-munging. ------------------------------------------------------------------------ r395 | joe | 2005-01-03 10:33:28 +0000 (Mon, 03 Jan 2005) | 2 lines * .release.sh: Really run .update-po.sh. ------------------------------------------------------------------------ r394 | joe | 2005-01-03 10:31:50 +0000 (Mon, 03 Jan 2005) | 4 lines * .release.sh: Update to run .update-po.sh. * .update-po.sh: Update for current gettext Makefile.in.in. ------------------------------------------------------------------------ r393 | joe | 2005-01-03 10:27:39 +0000 (Mon, 03 Jan 2005) | 1 line * po/: make update-po ------------------------------------------------------------------------ r392 | joe | 2005-01-03 10:16:14 +0000 (Mon, 03 Jan 2005) | 3 lines * src/frontend.h (fe_status): Remove trailing comma from enum, fix Tru64 cc warning. ------------------------------------------------------------------------ r391 | joe | 2005-01-03 10:14:49 +0000 (Mon, 03 Jan 2005) | 2 lines * src/ftp.c: Misc style and comment tweaks; no functional change. ------------------------------------------------------------------------ r390 | joe | 2005-01-03 10:13:26 +0000 (Mon, 03 Jan 2005) | 2 lines * src/rshdriver.c (run_rcmd): Use ne_attribute. ------------------------------------------------------------------------ r388 | joe | 2005-01-02 19:12:02 +0000 (Sun, 02 Jan 2005) | 2 lines Remove two fixed bugs. ------------------------------------------------------------------------ r387 | joe | 2005-01-02 19:00:26 +0000 (Sun, 02 Jan 2005) | 2 lines * Makefile.in: Update dependencies. ------------------------------------------------------------------------ r386 | joe | 2005-01-02 15:00:39 +0000 (Sun, 02 Jan 2005) | 1 line Rename ChangeLog to ChangeLog.CVS. ------------------------------------------------------------------------ r385 | joe | 2005-01-02 15:00:33 +0000 (Sun, 02 Jan 2005) | 1 line Rename ChangeLog to ChangeLog.CVS. ------------------------------------------------------------------------ r384 | joe | 2005-01-02 13:25:17 +0000 (Sun, 02 Jan 2005) | 4 lines * po/POTFILES.in: Update to current list of sources. * po/: Run update-po. ------------------------------------------------------------------------ r383 | joe | 2005-01-02 13:19:27 +0000 (Sun, 02 Jan 2005) | 3 lines * configure.in: Pass two arguments to NEON_XML_PARSER to support VPATH expat builds correctly. Create lib/expat/* directories likewise. ------------------------------------------------------------------------ r381 | joe | 2005-01-02 13:17:20 +0000 (Sun, 02 Jan 2005) | 2 lines * Makefile.in: Fix lack of trailing slashes after $(EXPATDIR). ------------------------------------------------------------------------ r380 | joe | 2005-01-02 13:01:23 +0000 (Sun, 02 Jan 2005) | 2 lines Bring in lib/expat from cadaver/trunk/lib/expat. ------------------------------------------------------------------------ r379 | joe | 2005-01-02 13:00:34 +0000 (Sun, 02 Jan 2005) | 2 lines Update copyright to 2005. ------------------------------------------------------------------------ r378 | joe | 2005-01-02 13:00:04 +0000 (Sun, 02 Jan 2005) | 3 lines * src/sites.c (site_fetch_csum_read): Use correct return type for both neon 0.24 and 0.25. ------------------------------------------------------------------------ r377 | joe | 2005-01-02 12:59:15 +0000 (Sun, 02 Jan 2005) | 8 lines * Makefile.in: Adjust to use lib/neon for bundled neon, $(EXPATDIR) for bundled expat * configure.in: Update for new expat and neon locations. Use AC_MSG_NOTICE. * autogen.sh: Look for neon macros in m4/neon. ------------------------------------------------------------------------ r376 | joe | 2005-01-02 12:39:38 +0000 (Sun, 02 Jan 2005) | 3 lines Set svn:externals to pull in neon/src, neon/macros. Set svn:ignore from .cvsignores. ------------------------------------------------------------------------ r375 | joe | 2005-01-02 12:35:31 +0000 (Sun, 02 Jan 2005) | 1 line Import sitecopy CVS HEAD. ------------------------------------------------------------------------ r374 | joe | 2005-01-02 12:31:43 +0000 (Sun, 02 Jan 2005) | 1 line Create sitecopy tree. ------------------------------------------------------------------------ sitecopy-0.16.6/NEWS0000664000076400007640000006670711037463764012323 0ustar joejoeChanges in release 0.16.6: * DAV: Fix crash with progress bar enabled with neon 0.27/0.28. Changes in release 0.16.5: * DAV: Fix SSL cert caching to avoid repeated prompts. * Update to neon 0.28.3 and support neon 0.24.x through 0.28.x. Changes in release 0.16.3: * DAV: Add PKCS#12 client cert support; "client-cert /path/to/cert.p12" * Update to neon 0.26.0 (0.24.x and 0.25.x still supported). Changes in release 0.16.2: * Fix over-eager move/rename algorithm when handling a delete of one of a set of identical files. * DAV: Fix ordering issues with --fetch. * FTP: Retry after response timeouts for STOR commands. * Update to neon 0.25.4. Changes in release 0.16.1: * FTP: Fix crash in FTP timeout handling. * Improve error messages from LIST parser failure. Changes in release 0.16.0: * Fetch mode now fetches a single directory at a time: - works with DAV servers which reject "Depth: infinity" PROPFIND - works with FTP servers which reject the -R flag to LIST - "exclude" and "ignore" patterns are now matched as expected against remote files. * In updates, delete files remotely before creating directories, to allow the "replace a file with a directory" case to work. * sftpdriver.c compile fix for older Unixes. * Fix for German translation (Jens Seidel) Changes in release 0.15.1: * Updated Italian translation (Cristian Rigamonti). * FTP: fix newline handling issues for ASCII file transfers. * sitecopy.1: explain use of "http secure" (Reed Snellenberger) * Update to neon 0.25.0: - fix regressions in WebDAV path-escaping Changes in release 0.15.0: * Add SFTP support from Nobuyuki Tsuchimura using "protocol sftp". * FTP: Ignore symlinks in fetch mode; fix some fetch mode error handling. * DAV: fix use of remote root path which needed path-escaping. * rsh/ssh: Filename quoting fixes (Nobuyuki Tsuchimura). * Apply tempupload option to new files as well as changed files. * In "sitecopy --flatlist" output, mark ignored items with "|ignored". * Correct sitecopy.1 documentation: symlinks in the local site are followed not ignored, by default. * Add French translation of man page, by Nicolas Girard. Changes in release 0.14.3: * FTP: Fix fetch mode issues with some servers. Changes in release 0.14.2: * FTP: Add IPv6 support (passive mode only). * Fix "make install" with NLS enabled. * Updated Italian translation (Cristian Rigamonti). Changes in release 0.14.1: * Fix state file parse error when upgrading from <0.14.0. * Fix build problems with older versions of GCC. Changes in release 0.14.0: * Rewrite of rshdriver by Nobuyuki Tsuchimura, adding support for fetch mode. * Add 'permissions dir' flag which maintains directory permissions over FTP. * Add --dry-run flag for update mode which displays update output but doesn't actually carry out the operation. * Allow 'protocol ssh'; equivalent to 'protocol rsh' with 'rsh ssh, rsp scp' * Updated version of neon including various security fixes. Changes in release 0.13.4: * Fix ~/.sitecopy directory permissions check on some platforms. * Fix included getopt build on some platforms. * Updated Italian translation (Cristian Rigamonti). * neon updates: - add support for Kerberos authentication over HTTP ("GSS-Negotiate"). - fix compatibility with OpenSSL 0.9.6. Changes in release 0.13.3: * 'ls' parsing tweaks in FTP fetch mode. * Better error handling for corrupt site storage files. * Update to neon 0.24. Changes in release 0.13.2: * Fixes for FTP synch mode (Paul J. Mantyla, David Madore and others). Changes in release 0.13.1: * Fixes for FTP fetch mode: - corruption of downloaded files - handling of empty lines in responses * Drop support for non-XML storage files produced by sitecopy-0.7.0 and earlier. * Fixes for SSL certificate caching. * Fix build using included libintl. * Fix fn_escape() build with some compilers. Changes in release 0.13.0: * Really fix use of non-ASCII filenames: - drop 'charset' config option - this should no longer be used - filenames should be preserved exactly regardless of character set * Support WebDAV over SSL again: user is prompted to verify the server certificate on first access. * Enable use of bundled expat. * Add Italian translation from Cristian Rigamonti . * Fix segfault if SSL is requested but not supported. * Fix build on AIX (Takeshi NISHIMATSU), FreeBSD. Changes in release 0.12.1: * Fix corruption of uploaded files in FTP mode (Jonathan Paisley) * Fix build when included libintl is used (Nathan Hand). * Fix bogus "XML parser received non-8-bit data" error. * Fix make install (Juergen Daubert). * Disable use of bundled expat pending build fix. Changes in release 0.12.0: * Changes to WebDAV support: - fix synch mode to overwrite rather than append to existing local files. - fix create/remove directory operations for Apache 2.0/mod_dav * Changes to FTP support: - new 'ftp usecwd' directive, for compatibility with some ProFTPd servers, ensures that the working directory is changed before uploading files. Volker Kuhlmann - fix infinite loops if connection is terminated during login. * Fix support for non-ASCII characters in filenames: - character set used for filenames is determined where possible from $LC_CTYPE, otherwise defaults to ISO-8859-1. Use e.g. 'charset UTF-8' to override selection in config file. * Updated translations: - Czech (cs.po) from Petr Prazak - Norwegian Nynorsk (nn.po) from Karl Ove Hufthammer * Upgrade to neon 0.24-dev: - regain support for SOCKSv5 (--with-socks), thanks to Torsten Kalix. - fix build error for newer versions of libxml2. Changes in release 0.11.4: * Updated German translation (de.po) from Thomas Schultz. * Fix DAV fetch mode with SSL enabled against some servers e.g. IIS5? * Fix build on Mac OS X 10.1? * More Makefile work from Peter Moulder: - support DESTDIR in install targets - 'uninstall' removes message catalogs too when i18n enabled. - clean up use of CFLAGS/CPPFLAGS/INCLUDES * Fix compiler warnings in GNOME frontend (Peter Moulder) Changes in release 0.11.3: * Makefile fixes (Peter Moulder). * GNOME frontend: - fix includes (Olaf Hering) - fix build problems, clean up generated docs. - fix memory leaks (Peter Moulder). * RPM spec file cleanups. * Merge Debian packages changes (Peter Moulder). Changes in release 0.11.2: * Fix 'make install' for non-GNU make. * Fix --silent option to really be silent. * WebDAV: fix for when 'tempupload' option is used. Changes in release 0.11.1: * Fixes for included gettext build. * Build fixes. Changes in release 0.11.0 * Fix for segfault in rsh/rcp mode (Nobuyuki Tsuchimura). * Fixes for compilation using gcc 3 (Olaf Hering ). * Fixes for format string problem on Mac OS X. * Fix for fetch-then-sync setting modtime of deleted files to 1970-01-01. * Fix for setting permissions of local file in synch mode. * Improvement for PASV mode port parsing (Rob Funk ). * Added basic --verify mode, to check whether the remote copy of a site using safe mode has been modified outside sitecopy's control. * Added Norwegian Nynorsk translation, nn.po (Karl Ove Hufthammer ) * Added 'http tolerant' option, to skip OPTIONS check in WebDAV mode. * Upgrade to neon 0.18: - SOCKSv5 support, --with-socks (untested): please report success/failure. - libxml2/expat 1.95 support - a multitude of fixes, e.g. crashes during XML parsing, HTTP proxy authentication, portability fixes, ... * Upgrade to gettext 0.10.40, autoconf 2.52. * Integrated changes from Debian package (Masayuki Hatta ) - added setlocale() call to console frontend - added skeleton man page for xsitecopy. * FE API changes: - fe_connection takes an 'fe_status' argument again. Changes in release 0.10.15 * Updated Japanese translation (ja) (Nobuyuki Tsuchimura). * Correctly store modtimes in both '--fetch over existing site' *and* '--fetch of a new site' cases (thanks to Nobuyuki Tsuchimura). * FTP: Fix error reporting for connect failures (broken since 0.10.8) * Fix maintaining file permissions in nooverwrite mode. Changes in release 0.10.14 * Fix build against libxml. Changes in release 0.10.13 * Use separate build dirs in spec file (Nobuyuki Tsuchimura). * GNOME update from Lee Mallabone: - Fix crashes when a site is not selected. - Make sure the local directory is read when adding a new site. * The Makefile should now work with a non-GNU 'make', please send in bug reports if it doesn't. * Fix for 'no: command not found' error during build. Changes in release 0.10.12 * For FTP, when uploading files in ASCII mode, display one progress dot for each 4Kb uploaded rather than one per line. * WebDAV: possible fix for problem with responses terminated by EOF. * GNOME docs fix (Peter Moulder). * Final fixes for building when srcdir != builddir (Peter Moulder). * Updated German translation (de.po) (Thomas Schultz). Changes in release 0.10.11 * Added Turkish (tr) translation from A. Sinan Unur . * Fix build using bundled expat. * Fixes for building when srcdir != builddir from Peter Moulder . * Warning fixes (Peter Moulder). * Spec file fix (Nobuyuki Tsuchimura). Changes in release 0.10.10 * GNOME frontend: bug fixes (Lee Mallabone). * FTP: Add '253' as DELE success code (Hans Meine ). * FTP fetch: recognise a ".:" line (Phil Davis ). * FTP: possible fix for uploads failing with "250 Transfer Complete" error. * Fix synch mode updating local file modification times * neon updated to 0.9.1 (shouldn't affect anyone, except the build is more portable now). Changes in release 0.10.9 * Allow --fetch again even if stored state file doesn't exist. * Fix synch mode. Changes in release 0.10.8 * Fix badly broken fetch mode in sites which use checksum and FTP. * Fix potential core dumps in FTP error handling routines. * Console: Display the error if fetch mode fails before the fetch began (e.g. using 'protocol webdav' with a server which does not claim WebDAV compliance). * Console: Tidy up the display of some error messages. * Internal: Clean up the site_update/fetch/synch return code semantics. Changes in release 0.10.7 * FTP fixes: - Removed more file descriptor leaks. - Fix some 'Error .... : Success' messages. * neon updates: - WebDAV: HTTP digest authentication fixes against IIS5 (David Sloat) - SSL improvements - Increase read timeout to 120 seconds. * Fix RPM spec file for Red Hat Linux 7 (Nobuyuki Tsuchimura). * Fix --disable-webdav build (Ross Nicoll ) * FTP fetch mode changes: - Improvements to recognising top-level directory name. - Will FAIL if an 'ls' line could not be parsed. Previously, parse errors were silently ignored, which could result in an empty files list being stored. Changes in release 0.10.6 * Fix for search for socket() in -lsocket or -linet which 0.10.5 broke. Changes in release 0.10.5 * Fix for core dump on fail to connect FTP, patch by Fabrice Noilhan . * Fix for file descriptor leak ("Too many open files" problem). * Fix for enabling expect-100 support by default (WebDAV driver). Changes in release 0.10.4 * GNOME frontend update from Lee Mallabone: - Threading now implemented correctly - no more frozen-up interfaces when uploading over a slow connection. Abort/cancelling updates should now work correctly too, (Thanks to David Knight for various comments & code snippets). - Various bug fixes (thanks to Joe Pfeiffer, Harry Slaughter & others for reports). - Now use libglade for certain dialogs. More glade-ified dialogs coming soon for a better user experience. - Fetch mode disabled - it wasn't designed for checksum-fetch, so has been disabled for this release. * Updated Czech translation (cs.po) from Petr Prazak. Changes in release 0.10.3 * Updated German translation (de.po) from Thomas Schultz. * Updated neon to 0.7.0. * Don't delete directories in --update mode if 'nodelete' is specified. Changes in release 0.10.2 * rsh driver: pass "-l username" to rsh if a username is specified, and username@host for rcp: patch by David Knight * Fix for maintaining file permissions with 'tempupload' mode. * Fix for "will not overwrite changes" message in safe mode under FTP. * Disabled the GNOME frontend which doesn't seem to be working. * In synch mode under FTP, download the entire file regardless of what the stored size is. Changes in release 0.10.1 * Quick fixes so GNOME fe compiles and links again due to interface changes. Changes in release 0.10.0 * Build fix for cygwin, which lacks regex.h. * Synch mode will just set permissions of local files if the file contents have not changed. * Console: synch mode will refuse to just remove all files in the local site, since new users sometimes confuse --update with --synch, with disastrous consequences. Use 'rm' if you need this functionality. * Console: The --debug/-d option now takes comma-separated strings rather numbers, e.g. 'sitecopy --debug=http,socket --fetch mysite' * Added German translation (de.po) from Thomas Schultz . * WebDAV fetch mode re-implemented. * Fix for downloading files in DAV driver. * neon updates to 0.4.x: - Basic SSL support added to DAV driver (requires OpenSSL)... use 'configure --with-ssl', then put 'http secure' in the rcfile entry for the site. IMPORTANT NOTE: server certificates are NOT presented for user verification (yet). * Protocol name for WebDAV driver in rcfile is now 'webdav' or 'dav', e.g. 'protocol dav' The old value, 'http' is recognized but deprecated. * WebDAV driver will refuse to operate against a server which does not identify itself as a class 1 WebDAV server in an OPTIONS response. * FTP fetch mode will skip Windows drive specifications in directory names. * Console: more signals handled by saving update state. Changes in release 0.10.0-beta * HACK: New protocol driver: uses rcp and rsh in combination. Use 'protocol rsh'. Requires a WORKING rsh/rcp setup to the server. * Option to disable FTP support added to configure: --disable-ftp * Support interactive prompting for username/password: can omit these from rcfile. * HTTP proxy authentication support: "proxy-username" and "proxy-password" rcfile keywords (or omit these and use interactive prompting). * Switch to using 'neon' WebDAV client library (http://www.webdav.org/neon/): - Support for libxml as XML parser (version 1.8.3 or later required). - Proper error messages for 207 error responses. - RFC2616 and RFC2518 compliance fixes. - Temporarily dropped support for authoring via non-WebDAV extended HTTP (WebRFM, Netscape Enterprise, AOLserver etc)... will return later. * WebDAV: Can maintain file execute permissions against mod_dav 0.9.17 or later: 'permissions exec' is allowed for DAV sites. * Synch mode will only connect to the server if necessary. * Sensible abort handling (CTRL-C to abort). * Fix builds on Solaris 7 etc which have a libintl. * Console: --view mode will only display named sites if any sites are named. * Console: Storage file is opened before update begins to help prevent loss of update results. Changes in release 0.9.9 * Added --logfile option to redirect debugging messages. * Bugfix for GNOME frontend (Lee Mallabone). Changes in release 0.9.8 * Fix for transfer progress reporting (should fix GNOME progress bars). * GNOME frontend update from Lee Mallabone: - Changing a site's local directory on-the-fly is implemented. - Fix death-on-startup bug when local directories no longer existed. - Only allow directories to be selected in the site creation druid. - Other minor bug fixes Changes in release 0.9.7 * GNOME frontend update from Lee Mallabone: - Site creation druid now fully functional. Changes in release 0.9.6 * Display number of items which need updating in --list mode. * New Japanese translation (ja.po) (Nobuyuki Tsuchimura). * Don't checksum excluded files (Nobuyuki Tsuchimura). * Spelling fix for console frontend (Nobuyuki Tsuchimura). * Minor Makefile fix. Changes in release 0.9.5 * Mark more strings for i18n (Petr Prazak). * New Czech translation (cs.po) (Petr Prazak). * Move strings out of macros for i18n. * Exclude files within excluded subdirectory for fetch. Changes in release 0.9.4 * Correctly handle 8-bit characters in filenames from stored state. * New French translation (fr.po) (Sylvain 'Murdock' Glaize). Changes in release 0.9.3 * Parse absolute directory names in FTP fetch response (Nobuyuki Tsuchimura). * Check for expat's xmlparse.h in an 'xmlparse' subdirectory. Changes in release 0.9.2 * Fix the case where a move is preferred to a change. * Use timeout-based read_line again (as per 0.7.6 and earlier). Changes in release 0.9.1 * Move files remotely before uploading new files. * Niall Smart fixed --flatlist output. Changes in release 0.9.0 *** The info files (~/.sitecopy/*) written by this version are NOT *** backward compatible - versions 0.8.x and before will NOT read *** them. You are advised to take a backup copy of your ~/.sitecopy/ *** directory before installing this version. *** 0.9.0 will read the info files written by previous versions. *** If you use 'permissions all', then after upgrading, all existing *** files will be appear 'changed'. Run sitecopy --catchup with the *** new version to mark them as updated. The same applies for those *** who use 'permissions exec'. * Major redesign. This brings: - Improved handling of file permissions - changes in just permissions are detected and handled by update mode. Fetch mode can retrieve the permissions of remote files, and synch mode will set them locally. - Better handling of ASCII files - if you change whether a file is ASCII or not, files will be marked as changed accordingly. - Detect file content changes by MD5 checksumming, rather than by modification time / size - use the `state checksum' option. - Handling of moved files improved: the overhead previously incurred by checking for moved files should be greatly reduced. New option to check for renamed files too - `checkmoved renames' (only valid in conjuction with the `state checksum' option. * Site storage files (~/.sitecopy/*) are now XML, allowing for easy future extension. * 'ignore' option added, syntax as per 'exclude', which means that changes to local files which match any of the 'ignore' patterns are not mirrored to the remote site by update mode. Files which match 'ignore' patterns will still be created, deleted and moved as normal. * The 'ascii' keyword now has syntax as per 'exclude', and is not limited to 20 entries. * New option 'lowercase', which forces all filenames to be converted to lowercase for use on the remote site. * "Safe mode" added, using the 'safe' option. See the man page for details of this option. Thanks to Shaun Steinhorst for the idea. * Synch mode will download deleted files even when 'nodelete' is used. * Number of directories that can be scanned in local sites is limited only by virtual memory size. * Console frontend: update mode signal handling changed. SIGINT (e.g. CTRL-C) will now safely terminate the update, saving the update progress. Other termination signals cause an immediate quit, without saving the update progress: use SIGQUIT (e.g. CTRL-\) if you want this. * Console frontend: new --show-progress option to display progress of data transfer in update mode. * Internationalization: Russian translation from Michael Sobolev. * 'tempupload' option to upload changed files to a temporary file, '.in.filename' then rename to 'filename' when the upload is complete. * Added 'Expect: 100-continue' option again, in the form of an *enabling* option 'http expect'. Users of Apache 1.3.9 and above are advised to use this option, since it will save time and bandwidth. * Added 'ftp showquit' option to display QUIT message from FTP server. * GNOME frontend update from Lee Mallabone: unfinished code, use with care. Backup your rcfile! The site info writing code has not been tested very much at all, so whatever you do, make sure your rcfile is safe somewhere else before trying this release. - The site/file tree received a complete rewrite and now appears lovely and stable, and represents files/directories as it should do. - Fetch mode. Not perfect, but it's built the best way it can be given the API, and does seem to work reliably. - Update; I've added a "stop" button to the update dialog that appears when an update is in progress. It has issues at the moment, I believe; unfortunately I haven't had much time to test it, so your mileage may vary. Updates themselves should still work just fine though. - Site creation; as you'll see from clicking 'new site', this part of the app has also been totally rewritten. *sigh* it's another unfinished feature though. The druid looks very nice, imho. But I've not yet added the code to actually create sites. - Site editing; the GUI is totally rewritten from 0.8.x, but parts of it are not yet hooked up, so you may experience some "race conditions". Changes in release 0.8.3 * Minor Makefile fix. Changes in release 0.8.2 * GNOME frontend: Fixed a reported bug with using "always keep going" to update remote sites (Lee Mallabone). Changes in release 0.8.1 * Minor cosmetic change to console frontend: display remote root in banner lines too. * Slight speed optimisation. * GNOME file reorganisation (Lee Mallabone). Changes in release 0.8.0 * Updated EMX build to include WebDAV code (Steffen Siebert). * Fix for non-WebDAV builds (Steffen Siebert). * GNOME: New upload dialog (Lee Mallabone). Changes in release 0.8.0pre2 * WebDAV: Disabled '100-expect' completely, always, for safety. This feature will be brought back later as an option which defaults to "off". * configure fix to find 'xmlparse.h' in /usr/include/xmltok/ as per Debian's libxmltok1-dev package. Changes in release 0.8.0pre * Fixed bug which caused hostname lookup, connection and authentication errors to be ignored. * Fix for finding expat in 'xmltok' and 'xmlparse' libraries. * GNOME update from Lee Mallabone: - Redesigned quit dialog. No more dialogs popping up over each other. - Improved error handling. - WebDAV options added to interface. Changes in release 0.7.10 * Disallow using permissions support for WebDAV sites (prevents segfault mid-update). * Rename of send_file, hopefully improves AIX 4.3 build. Changes in release 0.7.9 * Added check for expat in -lxmltok and -lxmlparse as per Debian's libxmltok1 package. * console: Null-terminate long options array. * Added implicit rule for object file compilation, should fix build with non-GNU make. * Possible fix for cygwin WebDAV upload problems. Changes in release 0.7.8 * Added errno.h include in src/socket.c. Changes in release 0.7.7 * Added 'http limit' option to try only one request per connection. * read_line reverted to use recv() directly. * Bug fix where uploads will continue till end-of-file rather than a fixed number of bytes. Changes in release 0.7.6 * WebDAV: auth memory allocation tidyup, proxy support fixed, succeed on delete directory for any non-207 2xx class response. * Remove segfault on finding named pipes etc, in local directories with debugging turned on. * FTP transfer type set when appropriate after broken connection - patch by Tim Ricketts . * Extra debugging messages in FTP, WebDAV and socket code. * Minor man page update. Changes in release 0.7.5 * HTTP Basic auth fix, and response body with set Content-Length download fix. Changes in release 0.7.4 * console: Change to "sitecopy: Site `foo'..." line, now displays mode name, site name, and remote server host only. * Experimental support for HTTP proxying - use, e.g.: proxy-server proxy.myserver.com proxy-port 8080 in rcfile to enable. * Fall back on hardcoded port numbers if service name isn't known. * Complete rewrite of HTTP Authentication code, to the new RFC 2617 standard. The new code has support for: - MD5-session algorithm - Digest code supports 'qop=auth-int' message integrity (untested) - understands multiple challenges in 401 response, uses Digest in preference to Basic - interprets the 'Authentication-Info' header, and authenticates server response accordingly Tested against Apache 1.3.6 with the new mod_digest (still works against old RFC 2069-style server implementations, too). * Cleanups to HTTP code. * FTP Passwords and the HTTP 'Authorization:' header value are now hidden in debugging output. Changes in release 0.7.3 * New 'http noexpect' option to workaround problems with WebDAV servers which do not correctly handle the HTTP/1.1 'Expect: 100-continue' header (e.g. Apache <= 1.3.6). Changes in release 0.7.2 * GNOME error handling bugfix (Lee Mallabone) * Compile fix for cygwin environment, thanks to Andy Cowling. Changes in release 0.7.1 * Fixed lib/snprintf.c compilation (Andy Cowling) Changes in release 0.7.0 *** Name mapping has been removed - the 'rename' key is no longer *** valid in the rcfile * Enhanced exclude syntax, allows specific directories to be ignored, e.g. 'exclude /foo/bar' to exclude foo/bar, or 'exclude /foo/bar/*.bak' similarly. * Socket reads will timeout, so the program will not hang indefinitely on a severe protocol error. * Console: Added --keep-going option to force an update to continue past errors. Faster startup (probably). * WebDAV: Filenames with non-alphanumeric characters in work now. Fetch mode memory consumption drastically improved. Better RFC2068 compliance. * FTP: Fetch and synch modes will work when 'ftp nopasv' is specified too - fixed by Paul Crowley . File permissions are maintained in nooverwrite mode - fixed by Olivier Calle . * GNOME changes from Lee Mallabone : - All new site creation wizard. Seems stable, but it is new code so please test & report any shortcomings. - Massive memory plugs. Memory usage reduction by nearly an order of magnitude. (yea, i bloopered the first time round:) - Misc bug fixes. (see gnome/Changelog.xsitecopy for more details). * Ported to Digital Unix 4.0 by Dobrica Pavlinusic . Ported to SunOS 4.1 (thanks to Andrew Haylett and fetchmail). Ported to the cygwin environment by Andy Cowling . Generally, quite a lot of portability improvements. * Added support for SOCKS firewall - thanks to Andrew Haylett. * Bug fixes: some memory leaks. Changes in release 0.6.0 * Major restructuring of all the WebDAV code, including the addition of fetch and synch mode handlers. Fetch mode requires expat for XML parsing - see the INSTALL file for details (you can still compile without expat, just you can't use fetch mode) * WebDAV code fixed to work with IIS 5 beta - thanks to Jim Whitehead for making a server available. * Yarom Last extended the HTTP code to work with non-WebDAV HTTP-based authoring servers, i.e. - AOLserver and Netscape Enterprise Server which implement the 'MKDIR' etc methods - Any HTTP server which can transparently create remote dirs with PUT requests * GNOME frontend changes from Lee Mallabone : - New 'backup' menu for storage and restoration of the rcfile and individual site infofiles. - Save sites As, option added. - More online help. - Numerous bug fixes, including a major one - if you've had trouble with XSitecopy before, I encourage you to try this version. * FTP: Only execute TYPE when actually needed. Report login failure properly. * Misc bug fixes and tidying sitecopy-0.16.6/src/0000775000076400007640000000000011037462323012361 5ustar joejoesitecopy-0.16.6/src/vfsdriver.c0000664000076400007640000003070610165765223014553 0ustar joejoe/* sitecopy gnome-vfs driver module Copyright (C) 2004, David A Knight the ftp driver module was used as a skeleton for implementation 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. */ #include #include #include #include #include #include #include #include "protocol.h" typedef struct { struct site *site; const gchar *error; } vfs_session; extern void fe_transfer_progress(off_t progress, off_t total); static gboolean vfs_mkdir( const gchar *path, GnomeVFSFilePermissions perms); static int init(void **session, struct site *site) { vfs_session *sess = ne_calloc(sizeof *sess); int ret = SITE_OK; *session = sess; sess->site = site; if (! vfs_mkdir(site->remote_root_user, GNOME_VFS_PERM_USER_ALL | GNOME_VFS_PERM_GROUP_READ | GNOME_VFS_PERM_GROUP_EXEC | GNOME_VFS_PERM_OTHER_READ | GNOME_VFS_PERM_OTHER_EXEC)) { ret = SITE_FAILED; } return ret; } static void finish(void *session) { vfs_session *sess = session; free(sess); } static int file_upload(void *session, const char *local, const char *remote, int ascii) { GnomeVFSURI *src; GnomeVFSURI *dest; GnomeVFSHandle *shandle; GnomeVFSHandle *dhandle; GnomeVFSOpenMode mode; GnomeVFSResult result; GnomeVFSFileSize fsize; GnomeVFSFileSize rsize; GnomeVFSFileInfo *info; GnomeVFSFileInfoOptions options; gchar buffer[BUFSIZ]; int ret = SITE_OK; vfs_session *sess = (vfs_session*)session; src = gnome_vfs_uri_new(local); dest = gnome_vfs_uri_new(remote); /* get perms etc */ options = GNOME_VFS_FILE_INFO_FOLLOW_LINKS; info = gnome_vfs_file_info_new(); result = gnome_vfs_get_file_info_uri(src, info, options); if (result == GNOME_VFS_OK) { mode = GNOME_VFS_OPEN_READ; result = gnome_vfs_open_uri(&shandle, src, mode); } if (result == GNOME_VFS_OK) { mode = GNOME_VFS_OPEN_WRITE; dhandle = NULL; fsize = 0; result = gnome_vfs_open_uri(&dhandle, dest, mode); if (result == GNOME_VFS_ERROR_NOT_FOUND || /* sftp: hack */ result == GNOME_VFS_ERROR_EOF) { result = gnome_vfs_create_uri(&dhandle, dest, mode, TRUE, info->permissions); } if (result != GNOME_VFS_OK) { result = GNOME_VFS_ERROR_GENERIC; } while(result == GNOME_VFS_OK) { result = gnome_vfs_read(shandle, buffer, BUFSIZ, &rsize); buffer[ rsize ] = '\0'; if (result == GNOME_VFS_OK) { result = gnome_vfs_write(dhandle, buffer, rsize, &rsize); fsize += rsize; fe_transfer_progress(fsize, info->size); } } if (result == GNOME_VFS_ERROR_EOF) { result = GNOME_VFS_OK; } if (result == GNOME_VFS_OK) { gnome_vfs_truncate_handle(dhandle, fsize); } if (shandle) { gnome_vfs_close(shandle); } if (dhandle) { gnome_vfs_close(dhandle); } } else { ret = SITE_FAILED; } gnome_vfs_file_info_unref(info); if (result != GNOME_VFS_OK) { ret = SITE_FAILED; } gnome_vfs_uri_unref(src); gnome_vfs_uri_unref(dest); sess->error = gnome_vfs_result_to_string(result); return ret; } static int file_get_modtime(void *session, const char *remote, time_t *modtime) { GnomeVFSURI *src; GnomeVFSFileInfo *info; GnomeVFSFileInfoOptions options; GnomeVFSResult result; int ret = SITE_OK; vfs_session *sess = (vfs_session*)session; src = gnome_vfs_uri_new(remote); options = GNOME_VFS_FILE_INFO_FOLLOW_LINKS; info = gnome_vfs_file_info_new(); result = gnome_vfs_get_file_info_uri(src, info, options); if (result == GNOME_VFS_OK) { *modtime = info->mtime; } else { ret = SITE_FAILED; } gnome_vfs_uri_unref(src); gnome_vfs_file_info_unref(info); sess->error = gnome_vfs_result_to_string(result); return ret; } static int file_upload_cond(void *session, const char *local, const char *remote, int ascii, time_t time) { /* get modtime */ time_t mtime; int ret; ret = file_get_modtime(session, remote, &mtime); if (ret != SITE_OK) { ret = SITE_FAILED; } else if (mtime != time) { ret = SITE_FAILED; } else { ret = file_upload(session, local, remote, ascii); } return ret; } static int file_download(void *session, const char *local, const char *remote, int ascii) { /* reverse local/remote and call file_upload */ return file_upload(session, remote, local, ascii); } static int file_read(void *session, const char *remote, ne_block_reader reader, void *userdata) { GnomeVFSURI *src; GnomeVFSHandle *shandle; GnomeVFSOpenMode mode; GnomeVFSResult result; GnomeVFSFileSize fsize; GnomeVFSFileSize rsize; GnomeVFSFileInfo *info; GnomeVFSFileInfoOptions options; gchar buffer[BUFSIZ]; int ret = SITE_OK; vfs_session *sess = (vfs_session*)session; src = gnome_vfs_uri_new(remote); /* get perms etc */ options = GNOME_VFS_FILE_INFO_FOLLOW_LINKS; info = gnome_vfs_file_info_new(); result = gnome_vfs_get_file_info_uri(src, info, options); if (result == GNOME_VFS_OK) { mode = GNOME_VFS_OPEN_READ; result = gnome_vfs_open_uri(&shandle, src, mode); } fsize = 0; while(result == GNOME_VFS_OK) { result = gnome_vfs_read(shandle, buffer, BUFSIZ, &rsize); buffer[ rsize ] = '\0'; if (result == GNOME_VFS_OK) { fsize += rsize; fe_transfer_progress(fsize, info->size); (*reader)(userdata, buffer, ret); } } if (result == GNOME_VFS_ERROR_EOF) { result = GNOME_VFS_OK; } gnome_vfs_close(shandle); gnome_vfs_file_info_unref(info); if (result != GNOME_VFS_OK) { ret = SITE_FAILED; } gnome_vfs_uri_unref(src); sess->error = gnome_vfs_result_to_string(result); return ret; } static int file_delete(void *session, const char *filename) { vfs_session *sess = (vfs_session*)session; int ret = SITE_OK; if (gnome_vfs_unlink(filename) != GNOME_VFS_OK) { ret = SITE_FAILED; } return ret; } static int file_move(void *session, const char *from, const char *to) { int ret; /* move the file: copy then remove */ ret = file_upload(session, from, to, 0); if (ret == SITE_OK) { ret = file_delete(session, from); } return ret; } static int file_chmod(void *session, const char *filename, mode_t mode) { vfs_session *sess = (vfs_session*)session; GnomeVFSFileInfo *info; GnomeVFSSetFileInfoMask mask; GnomeVFSResult result; int ret; ret = SITE_OK; info = gnome_vfs_file_info_new(); result = gnome_vfs_get_file_info(filename, info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); mask = GNOME_VFS_SET_FILE_INFO_PERMISSIONS; if (result == GNOME_VFS_OK) { info->permissions = mode; result = gnome_vfs_set_file_info(filename, info, mask); } if (result != GNOME_VFS_OK) { ret = SITE_FAILED; } gnome_vfs_file_info_unref(info); sess->error = gnome_vfs_result_to_string(result); return ret; } /* recusivley makes directories (if needed), starting at current path, * this is a copy of mkdir_recursive from fileops.c in screem, * copied into here so the driver doesn't depend on being run * from screem itself */ static gboolean vfs_mkdir(const gchar *path, GnomeVFSFilePermissions perms) { GnomeVFSURI *uri; gboolean ret = FALSE; gboolean exists; uri = gnome_vfs_uri_new(path); if (uri) { ret = TRUE; exists = gnome_vfs_uri_exists(uri); if ((! exists) && gnome_vfs_uri_has_parent(uri)) { GnomeVFSURI *parent; gchar *parentname; parent = gnome_vfs_uri_get_parent(uri); parentname = gnome_vfs_uri_to_string(parent, GNOME_VFS_URI_HIDE_NONE); gnome_vfs_uri_unref(parent); ret = vfs_mkdir(parentname, perms); g_free(parentname); } if (ret && ! exists) { GnomeVFSResult result; result = gnome_vfs_make_directory_for_uri(uri, perms); if (result == GNOME_VFS_ERROR_FILE_EXISTS) { /* ensure it is a directory */ GnomeVFSFileInfo *info; GnomeVFSFileInfoOptions options; info = gnome_vfs_file_info_new(); options = GNOME_VFS_FILE_INFO_DEFAULT; gnome_vfs_get_file_info_uri(uri, info, options); if (info->type ==GNOME_VFS_FILE_TYPE_DIRECTORY){ result = GNOME_VFS_OK; } gnome_vfs_file_info_unref(info); } ret = (result == GNOME_VFS_OK); } gnome_vfs_uri_unref(uri); } return ret; } static int dir_create(void *session, const char *dirname) { vfs_session *sess = (vfs_session*)session; int ret; ret = SITE_OK; if (! vfs_mkdir(dirname, 0x1e4)) { ret = SITE_FAILED; } return ret; } static int dir_remove(void *session, const char *dirname) { vfs_session *sess = (vfs_session*)session; int ret = SITE_OK; if (gnome_vfs_remove_directory(dirname) != GNOME_VFS_OK) { ret = SITE_FAILED; } return ret; } static int fetch_list(void *session, const char *dirname, int need_modtimes, struct proto_file **files) { /* I'm to lazy to do this at the moment, well either that or something to do with the following: Sun Jan 28 03:07:39 GMT 2001 :-) */ return SITE_UNSUPPORTED; } static int create_link(void *session, const char *l, const char *target) { int ret = SITE_OK; GnomeVFSURI *uri; uri = gnome_vfs_uri_new(l); if (gnome_vfs_create_symbolic_link(uri, target) != GNOME_VFS_OK) { ret = SITE_FAILED; } gnome_vfs_uri_unref(uri); return ret; } static int delete_link(void *session, const char *l) { int ret = SITE_OK; if (gnome_vfs_unlink(l) != GNOME_VFS_OK) { ret = SITE_FAILED; } return ret; } static int change_link(void *session, const char *l, const char *target) { int ret; ret = delete_link(session, l); if (ret == SITE_OK) { ret = create_link(session, l, target); } return ret; } static const char *error(void *session) { return ((vfs_session*)session)->error; } static int get_dummy_port(struct site *site) { return 0; } /* The protocol drivers */ const struct proto_driver vfs_driver = { init, finish, file_move, file_upload, file_upload_cond, file_get_modtime, file_download, file_read, file_delete, file_chmod, dir_create, dir_remove, create_link, /* create link */ change_link, /* change link target */ delete_link, /* delete link */ fetch_list, error, get_dummy_port, get_dummy_port, "vfs" }; sitecopy-0.16.6/src/frontend.h0000664000076400007640000001306011035210311014333 0ustar joejoe/* sitecopy, manage remote web sites. Copyright (C) 1998-2008, Joe Orton . 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. */ /* You MUST implement all of the below functions in the front end. * After a site_update call, for each file which is being updated * the following calls are made: * if (fe_can_update(file)) { * fe_updating(file); * fe_updated(file, true, NULL) if the update was successful, or * fe_updated(file, false, "error message") otherwise. * } * Similarly for site_synch calls. * If fe_can_updated(file) returns false, the update of that file * will not continue. * * During a file transfer, whenever a block is written to the remote * site, fe_transfer_progress(bytes_transferred, bytes_total) is * called. In other words, for a 10k file, the calls might be: * fe_t_p(1024, 10240), fe_t_p(2048, 10240), * fe_t_p(3072, 10240) ... fe_t_p(10240, 10240) * File transfers occur in site_update and site_synch, when uploading * and downloading files, respectively. */ #ifndef FRONTEND_H #define FRONTEND_H #include #include #include "common.h" #include "sites.h" typedef enum { fe_namelookup, fe_connecting, fe_connected } fe_status; /* Connection Status API. * * fe_connection() is called to indicate what state the connection is * in. Note, the status may bounce between fe_connected and * fe_connecting many times during an operation - especially if * connected to a WebDAV server which doesn't implement HTTP/1.1 * persistent connections. * info will indicate the hostname being looked up for fe_namelookup, * and will be NULL otherwise. */ void fe_connection(fe_status status, const char *info); /* The user is required to authenticate themselves for given context, * in the given realm on the given hostname. * (The Netscape UI for this is: "Enter username for REALM at HOSTNAME:") * realm will be NULL for non-HTTP protocols, so the UI might be better as: * "Enter username for HOSTNAME:" or whatever... * Must return: * 0: Success: * *username must be non-NULL and *password must be non-NULL, * malloc()-allocated memory. The FE MUST NOT free them ever. * non-zero: User cancelled operation. *username and *password ignored, * and never free()'d if non-NULL. */ typedef enum { fe_login_server, fe_login_proxy } fe_login_context; #define FE_LBUFSIZ NE_ABUFSIZ /* Enter username/password; username and password are fixed-size * buffers of size FE_LBUFSIZ. The username field may be pre-filled * by the username from the rcfile; otherwise username[0] == '\0'. * Contents of password are undefined. */ int fe_login(fe_login_context ctx, const char *realm, const char *hostname, char *username, char *password); /* Return zero if the given server certificate 'cert', which had a * failures mask of 'failures' (NE_SSL_*), should be accepted. */ int fe_accept_cert(const ne_ssl_certificate *cert, int failures); /* Enter password needed to decrypt given client certificate. Returns * zero on success, non-zero on failure. 'password' is of size * FE_LBUFSIZ. */ int fe_decrypt_clicert(const ne_ssl_client_cert *cert, char *password); int fe_can_update(const struct site_file *file); void fe_updating(const struct site_file *file); void fe_updated(const struct site_file *file, int success, const char *error); /* Also called during updates: */ void fe_setting_perms(const struct site_file *file); void fe_set_perms(const struct site_file *file, int success, const char *error); /* For synch mode */ void fe_synching(const struct site_file *file); void fe_synched(const struct site_file *file, int success, const char *error); /* For synch and update modes... */ void fe_transfer_progress(ne_off_t progress, ne_off_t total); /* Called while checksumming remote files, in fetch mode. * Note, these are just filenames not site_file *'s, because at the * checksumming state, we haven't yet modified the files list. */ void fe_checksumming(const char *filename); void fe_checksummed(const char *filename, int success, const char *error); /* For fetch mode - called for each file found remotely */ void fe_fetch_found(const struct site_file *file); /* To display a non-fatal warning message to the user. * description is the user-friendly description of the warning, * subject is typically the filename * reason is the low-level error message. * description may contain newlines (\n), but will not have a trailing * new-line. * subject and reason will not contain newlines. * reason and/or reason may be NULL. */ void fe_warning(const char *description, const char *subject, const char *error); /* Verified - whether the remote file matches or not... match will be one of file_new, file_deleted, file_changed, file_unchanged. (NOT file_moved yet) */ void fe_verified(const char *fname, enum file_diff match); #endif /* FRONTEND_H */ sitecopy-0.16.6/src/common.h0000664000076400007640000000471011035210311014006 0ustar joejoe/* sitecopy, manage remote web sites. Copyright (C) 1998-2005, 2008, Joe Orton . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef COMMON_H #define COMMON_H #include #include #include #include /* our own DEBUG_ channels */ #define DEBUG_FILES (1<<10) #define DEBUG_RCFILE (1<<11) #define DEBUG_FTP (1<<12) #define DEBUG_GNOME (1<<13) #define DEBUG_FILESEXTRA (1<<13) #define DEBUG_RSH (1<<14) #define DEBUG_SFTP (1<<15) /* A signal hander */ typedef void (*sig_handler)(int); #ifdef __EMX__ /* siebert: strcasecmp is stricmp */ #define strcasecmp stricmp #endif /* boolean */ #define true 1 #define false 0 #if defined (__EMX__) || defined(__CYGWIN__) #define FOPEN_BINARY_FLAGS "b" #define OPEN_BINARY_FLAGS O_BINARY #else #define FOPEN_BINARY_FLAGS "" #define OPEN_BINARY_FLAGS 0 #endif #if !HAVE_STRERROR && !defined(strerror) char *strerror (int errnum); #endif extern const char *default_charset; void init_charset(void); /* Map debug options onto a debug mask. Returns non-zero on error, * zero on success. err must be at least 20 bytes. * On non-zero return, err will contain the token which was not * recognized. * example use: char errbuf[20]; int mask; if (map_debug_options(argv[n], &mask, errbuf)) { printf("did not understand channel %s\n", errbuf); exit(-1); } */ int map_debug_options(const char *opts, int *mask, char *err); /* neon 0.24 compatibility */ #if NE_VERSION_MAJOR == 0 && NE_VERSION_MINOR < 25 #define ne_xml_failed(p) (!ne_xml_valid(p)) #define NE_FEATURE_SSL 1 #define ne_has_support(x) ne_supports_ssl() #endif #if NE_VERSION_MAJOR == 0 && NE_VERSION_MINOR < 27 typedef off_t ne_off_t; #endif #endif /* COMMON_H */ sitecopy-0.16.6/src/protocol.h0000664000076400007640000001055411035210311014362 0ustar joejoe/* sitecopy, for managing remote web sites. Copyright (C) 1998-2008, Joe Orton 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. */ /* Protocol driver interface, second attempt. * The actual driver handles the interface to the remote site. */ #ifndef PROTO_H #define PROTO_H #include #include #include "sites.h" #include "common.h" enum proto_filetype { proto_file, proto_link, proto_dir }; struct proto_file { char *filename; enum proto_filetype type; off_t size; time_t modtime; mode_t mode; unsigned char checksum[16]; struct proto_file *next; }; struct site; struct proto_driver { /* Protocol driver initialization. * Returns SITE_* return code. * If you don't return SITE_OK, ->error will be called * to retrieve the error string. So be sure to initialize * *session to something meaningful in that case too. * finish() will still be called in this case too, to allow * you to clean up properly. */ int (*init)(void **session, struct site *site); /* Called when the driver has been finished with */ void (*finish)(void *session); /* Perform the file operations - these should return one of * the PROTO_ codes */ int (*file_move)(void *session, const char *from, const char *to); int (*file_upload)(void *session, const char *local, const char *remote, int ascii); /* Conditional file upload: upload given file under the * condition that the remote file has the given time and size * Returns: * PROTO_OK if upload was okay * PROTO_ERROR if upload failed * PROTO_FAILED if condition is not met. */ int (*file_upload_cond)(void *session, const char *local, const char *remote, int ascii, time_t t); /* Retrieve the remote file modification time and file size */ int (*file_get_modtime)(void *sess, const char *remote, time_t *modtime); int (*file_download)(void *sess, const char *local, const char *remote, int ascii); int (*file_read)(void *sess, const char *remote, ne_block_reader reader, void *userdata); int (*file_delete)(void *sess, const char *filename); int (*file_chmod)(void *sess, const char *filename, mode_t mode); /* Perform the directory operations */ int (*dir_create)(void *sess, const char *dirname); int (*dir_remove)(void *sess, const char *dirname); /* Creates a link with given target */ int (*link_create)(void *session, const char *fn, const char *target); /* Changes a link to point to a different target */ int (*link_change)(void *session, const char *fn, const char *target); /* Deletes a link */ int (*link_delete)(void *session, const char *fn); /* Fetches the list of files. * Returns: * PROTO_OK if the fetch was successful * PROTO_ERROR if the fetch failed * The files list must be returned in dynamically allocated * memory, which will be freed by the caller. */ int (*fetch_list)(void *sess, const char *dirname, int need_modtimes, struct proto_file **files); /* Returns the last error string used. */ const char *(*error)(void *sess); /* Return the default port to use for the server on the given site */ int (*get_server_port)(struct site *site); /* Return the default port to use for the proxy on the given site */ int (*get_proxy_port)(struct site *site); const char *protocol_name; /* The user-visible name for this protocol */ }; /* Callback of type 'sock_progress'. */ void site_sock_progress_cb(void *userdata, ne_off_t progress, ne_off_t total); #endif /* PROTO_H */ sitecopy-0.16.6/src/sitefiles.c0000664000076400007640000004106210356556663014535 0ustar joejoe/* sitecopy, for managing remote web sites. File handling. Copyright (C) 1998-2006, Joe Orton 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. */ #include #include /* Needed for S_IXUSR */ #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include "basename.h" #include #include #include /* We pick up FNM_LEADING_DIR fnmatch() extension, since we define * _GNU_SOURCE in config.h. */ #include #include "frontend.h" #include "sitesi.h" /* fnmatch the filename against list */ inline int fnlist_match(const char *filename, const struct fnlist *list); /* Deletes the given file from the given site */ void file_delete(struct site *site, struct site_file *item) { site_stats_decrease(item, site); site_stats_update(site); if (item->prev) { /* Not first in list */ item->prev->next = item->next; } else { /* Not last in list */ site->files = item->next; } if (item->next) { /* Not last in list */ item->next->prev = item->prev; } else { /* Last in list */ site->files_tail = item->prev; } /* Now really destroy the file */ file_state_destroy(&item->local); file_state_destroy(&item->stored); file_state_destroy(&item->server); free(item); } /* Inserts a file into the files list, position chosen by type. Must * be in critical section on calling. file_set_* ensure this. */ static struct site_file *file_insert(enum file_type type, struct site *site) { struct site_file *file; file = ne_calloc(sizeof(struct site_file)); if (site->files == NULL) { /* Empty list */ site->files = file; site->files_tail = file; } else if (type == file_dir) { /* Append file */ site->files_tail->next = file; file->prev = site->files_tail; site->files_tail = file; } else { /* Prepend file */ site->files->prev = file; file->next = site->files; site->files = file; } return file; } #define FS_ALPHA(f) ((struct file_state *) (((char *)(f)) + alpha_off)) #define FS_BETA(f) ((struct file_state *) (((char *)(f)) + beta_off)) /* file_set implementation, used to update the files list. * * file_set takes a file type 'type', a file state 'state', the site, * two structure offsets, alpha_off and beta_off, and a default diff * type, 'default_diff'. alpha_off represents the offset into a * site_file structure for the state which 'state' represents; * beta_off represents the offset into the structure for the state * against which this state should be compared. */ static struct site_file *file_set(enum file_type type, struct file_state *state, struct site *site, size_t alpha_off, size_t beta_off, enum file_diff default_diff) { struct site_file *file, *direct = NULL, *moved = NULL, *frename = NULL; enum file_diff dir_diff; char *bname = NULL; /* init to shut up gcc */ if (site->checkmoved && type == file_file) { bname = base_name(state->filename); } for (file = site->files; file; file = file->next) { struct file_state *beta = FS_BETA(file); if (beta->exists && direct == NULL && file->type == type && strcmp(beta->filename, state->filename) == 0) { /* Direct match found! */ NE_DEBUG(DEBUG_FILES, "Direct match found.\n"); direct = file; } /* If this is not a direct match, check for a move/rename candidate, * unless the file already has a complete state and diff is unchanged. */ else if (site->checkmoved && type == file_file && file->type == file_file && file->diff != file_unchanged && file_compare(file_file, state, beta, site) == file_moved) { /* TODO: There is a slight fuzz here - if checkrenames is true, * we'll always match the first 'direct move' candidate as a * 'rename move'. This shouldn't matter, since we prefer * the move to the rename in the single candidate case, * and in the multiple candidate case. */ if (!moved && strcmp(bname, base_name(beta->filename)) == 0) { NE_DEBUG(DEBUG_FILES, "Move candidate: %s\n", beta->filename); moved = file; } else if (site->checkrenames && frename == NULL) { NE_DEBUG(DEBUG_FILES, "Rename move candidate: %s\n", beta->filename); frename = file; } } /* If all candidates are found, stop looking. */ if (direct && moved && frename) { break; } } NE_DEBUG(DEBUG_FILES, "Found: %s-%s-%s\n", direct?"direct":"", moved?"moved":"", frename?"rename":""); /* We prefer a direct move to a rename */ if (moved == NULL) moved = frename; if (direct != NULL) { dir_diff = file_compare(type, state, FS_BETA(direct), site); NE_DEBUG(DEBUG_FILES, "Direct compare: %s\n", DEBUG_GIVE_DIFF(dir_diff)); } else { dir_diff = default_diff; } /* We prefer a move to a CHANGED direct match. */ if ((direct == NULL && moved == NULL) || (direct != NULL && direct->diff == file_moved && moved == NULL && dir_diff != file_unchanged)) { NE_DEBUG(DEBUG_FILES, "Creating new file.\n"); file = file_insert(type, site); file->type = type; file->diff = default_diff; if (type == file_file) { file->ignore = file_isignored(state->filename, site); } } else { /* Overwrite file case... * Again, we still prefer a move to a direct match */ if (moved != NULL && dir_diff != file_unchanged) { NE_DEBUG(DEBUG_FILES, "Using moved file.\n"); file = moved; site_stats_decrease(file, site); file->diff = file_moved; } else { NE_DEBUG(DEBUG_FILES, "Using direct match.\n"); file = direct; site_stats_decrease(file, site); file->diff = dir_diff; } if (FS_ALPHA(file)->exists) { /* SHOVE! */ struct site_file *other; NE_DEBUG(DEBUG_FILES, "Shoving file:\n"); other = file_insert(file->type, site); other->type = file->type; other->diff = default_diff; other->ignore = file->ignore; /* Copy over the stored state for the moved file. */ memcpy(FS_ALPHA(other), FS_ALPHA(file), sizeof(struct file_state)); DEBUG_DUMP_FILE_PROPS(DEBUG_FILES, file, site); site_stats_increase(other, site); } } /* Finish up - write over the new state */ memcpy(FS_ALPHA(file), state, sizeof(struct file_state)); /* And update the stats */ site_stats_increase(file, site); site_stats_update(site); return file; } #ifndef offsetof #define offsetof(t, m) ((size_t) (((char *)&(((t *)NULL)->m)) - (char *)NULL)) #endif struct site_file *file_set_local(enum file_type type, struct file_state *state, struct site *site) { return file_set(type, state, site, offsetof(struct site_file, local), offsetof(struct site_file, stored), file_new); } struct site_file *file_set_stored(enum file_type type, struct file_state *state, struct site *site) { return file_set(type, state, site, offsetof(struct site_file, stored), offsetof(struct site_file, local), file_deleted); } /* Prepends an item to the fnlist. Returns the item. */ struct fnlist *fnlist_prepend(struct fnlist **list) { struct fnlist *item = ne_malloc(sizeof(struct fnlist)); item->next = *list; item->prev = NULL; if (*list != NULL) { (*list)->prev = item; } *list = item; return item; } /* Returns a deep copy of the given fnlist */ struct fnlist *fnlist_deep_copy(const struct fnlist *src) { const struct fnlist *iter; struct fnlist *dest = NULL, *prev = NULL, *item = NULL; for (iter = src; iter != NULL; iter = iter->next) { item = ne_malloc(sizeof(struct fnlist)); item->pattern = ne_strdup(iter->pattern); item->haspath = iter->haspath; if (prev != NULL) { prev->next = item; } else { /* First item in list */ dest = item; } item->prev = prev; item->next = NULL; prev = item; } return dest; } /* Performs fnmatch() of all the strings in the given string list again * the given filename. Returns true if a pattern matches, else false. */ inline int fnlist_match(const char *filename, const struct fnlist *list) { const struct fnlist *item; const char *bname = base_name(filename); for (item=list; item != NULL; item=item->next) { NE_DEBUG(DEBUG_FILES, "%s ", item->pattern); if (item->haspath) { if (fnmatch(item->pattern, filename, FNM_PATHNAME | FNM_LEADING_DIR) == 0) break; } else { if (fnmatch(item->pattern, bname, 0) == 0) break; } } #ifdef DEBUGGING if (item) { NE_DEBUG(DEBUG_FILES, "- matched.\n"); } else if (list) { NE_DEBUG(DEBUG_FILES, "\n"); } else { NE_DEBUG(DEBUG_FILES, "(none)\n"); } #endif /* DEBUGGING */ return (item!=NULL); } /* Returns whether the given filename is excluded from the * given site */ int file_isexcluded(const char *filename, struct site *site) { NE_DEBUG(DEBUG_FILES, "Matching excludes for %s:\n", filename); return fnlist_match(filename, site->excludes); } int file_isignored(const char *filename, struct site *site) { NE_DEBUG(DEBUG_FILES, "Matching ignores for %s:\n", filename); return fnlist_match(filename, site->ignores); } int file_isascii(const char *filename, struct site *site) { NE_DEBUG(DEBUG_FILES, "Matching asciis for %s:\n", filename); return fnlist_match(filename, site->asciis); } void site_stats_update(struct site *site) { NE_DEBUG(DEBUG_FILES, "Stats: moved=%d new=%d %sdeleted=%d%s changed=%d" " ignored=%d unchanged=%d\n", site->nummoved, site->numnew, site->nodelete?"[":"", site->numdeleted, site->nodelete?"]":"", site->numchanged, site->numignored, site->numunchanged); site->remote_is_different = (site->nummoved + site->numnew + (site->nodelete?0:site->numdeleted) + site->numchanged) > 0; site->local_is_different = (site->nummoved + site->numnew + site->numdeleted + site->numchanged + site->numignored) > 0; NE_DEBUG(DEBUG_FILES, "Remote: %s Local: %s\n", site->remote_is_different?"yes":"no", site->local_is_different?"yes":"no"); } void file_set_diff(struct site_file *file, struct site *site) { site_stats_decrease(file, site); file->diff = file_compare(file->type, &file->local, &file->stored, site); site_stats_increase(file, site); site_stats_update(site); } void file_state_copy(struct file_state *dest, const struct file_state *src, struct site *site) { file_state_destroy(dest); memcpy(dest, src, sizeof(struct file_state)); if (src->linktarget != NULL) { dest->linktarget = ne_strdup(src->linktarget); } if (src->filename != NULL) { dest->filename = ne_strdup(src->filename); } } void file_state_destroy(struct file_state *state) { if (state->linktarget != NULL) { free(state->linktarget); state->linktarget = NULL; } if (state->filename != NULL) { free(state->filename); state->filename = NULL; } } /* Checksum the file. * We pass the site atm, since it's likely we will add different * methods of checksumming later on, with better-faster-happier * algorithms. * Returns: * 0 on success * non-zero on error (e.g., couldn't open file) */ int file_checksum(const char *fname, struct file_state *state, struct site *s) { int ret; FILE *f; f = fopen(fname, "r" FOPEN_BINARY_FLAGS); if (f == NULL) { return -1; } ret = ne_md5_stream(f, state->checksum); fclose(f); /* worth checking return value? */ #ifdef DEBUGGING { char tmp[33] = {0}; ne_md5_to_ascii(state->checksum, tmp); NE_DEBUG(DEBUG_FILES, "Checksum: %s = [%32s]\n", fname, tmp); } #endif /* DEBUGGING */ return ret; } char *file_full_remote(struct file_state *state, struct site *site) { char *ret; ret = ne_malloc(strlen(site->remote_root) + strlen(state->filename) + 1); strcpy(ret, site->remote_root); if (site->lowercase) { int n, off, len; /* Write the remote filename in lower case */ off = strlen(site->remote_root); len = strlen(state->filename) + 1; /* +1 for \0 */ for (n = 0; n < len; n++) { ret[off+n] = tolower(state->filename[n]); } } else { strcat(ret, state->filename); } return ret; } char *file_full_local(struct file_state *state, struct site *site) { return ne_concat(site->local_root, state->filename, NULL); } char *file_name(const struct site_file *file) { if (file->diff == file_deleted) { return file->stored.filename; } else { return file->local.filename; } } /* Returns whether the file "contents" have changed or not. * TODO: better name needed. */ int file_contents_changed(struct site_file *file, struct site *site) { int ret = false; if (site->state_method == state_checksum) { if (memcmp(file->stored.checksum, file->local.checksum, 16)) ret = true; } else { if (file->stored.size != file->local.size || file->stored.time != file->local.time) ret = true; } if (file->stored.ascii != file->local.ascii) ret = true; return ret; } /* Return true if the permission of the given file need changing. */ int file_perms_changed(struct site_file *file, struct site *site) { /* Slightly obscure boolean here... * If ('permissions all' OR ('permissions exec' and file is chmod u+x) * AND * EITHER (in tempupload mode or nooverwrite mode) * OR the stored file perms are different from the local ones * OR the file doesn't exist locally or remotely, * * Note that in tempupload and nooverwrite mode, we are * creating a new file, so the permissions on the new file * will always be "wrong". */ if (((site->perms == sitep_all) || (((file->local.mode | file->stored.mode) & S_IXUSR) && (site->perms == sitep_exec))) && (site->tempupload || site->nooverwrite || file->local.mode != file->stored.mode || file->local.exists != file->stored.exists)) { return true; } else { return false; } } void file_uploaded(struct site_file *file, struct site *site) { file->stored.size = file->local.size; if (site->state_method == state_checksum) { memcpy(file->stored.checksum, file->local.checksum, 16); } else { file->stored.time = file->local.time; } /* Now the filename */ if (file->stored.filename) free(file->stored.filename); file->stored.filename = ne_strdup(file->local.filename); file->stored.ascii = file->local.ascii; file->stored.exists = file->local.exists; file->stored.mode = file->local.mode; /* Update the diff */ file_set_diff(file, site); } void file_downloaded(struct site_file *file, struct site *site) { file->local.size = file->stored.size; if (site->state_method == state_checksum) { memcpy(file->local.checksum, file->stored.checksum, 16); } else { file->local.time = file->stored.time; } /* Now the filename */ if (file->local.filename) free(file->local.filename); file->local.filename = ne_strdup(file->stored.filename); file->local.ascii = file->stored.ascii; file->local.exists = file->stored.exists; file->local.mode = file->stored.mode; file_set_diff(file, site); } sitecopy-0.16.6/src/ftpdriver.c0000664000076400007640000001052710224275446014544 0ustar joejoe/* sitecopy FTP protocol driver module Copyright (C) 2000-2005, Joe Orton 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. */ #include #include "protocol.h" #include "ftp.h" static int f2s(int errcode) { switch (errcode) { case FTP_OK: return SITE_OK; case FTP_LOOKUP: return SITE_LOOKUP; case FTP_CONNECT: return SITE_CONNECT; case FTP_FAILED: return SITE_FAILED; case FTP_LOGIN: return SITE_AUTH; default: return SITE_ERRORS; } } static int get_server_port(struct site *site) { return 21; } static int init(void **session, struct site *site) { int ret; ftp_session *sess = ftp_init(); ret = ftp_set_server(sess, &site->server); if (ret == FTP_OK) { if (site->ftp_pasv_mode) { ftp_set_passive(sess, 1); } if (site->ftp_use_cwd) { ftp_set_usecwd(sess, 1); } ret = ftp_open(sess); } *session = sess; /* map it to a SITE_* code. */ ret = f2s(ret); if (ret == SITE_ERRORS) ret = SITE_FAILED; return ret; } static void finish(void *session) { ftp_session *sess = session; ftp_finish(sess); } static int file_move(void *session, const char *from, const char *to) { ftp_session *sess = session; return f2s(ftp_move(sess, from, to)); } static int file_upload(void *session, const char *local, const char *remote, int ascii) { ftp_session *sess = session; return f2s(ftp_put(sess, local, remote, ascii)); } static int file_upload_cond(void *session, const char *local, const char *remote, int ascii, time_t t) { ftp_session *sess = session; return f2s(ftp_put_cond(sess, local, remote, ascii, t)); } static int file_get_modtime(void *session, const char *remote, time_t *modtime) { ftp_session *sess = session; return f2s(ftp_get_modtime(sess, remote, modtime)); } static int file_download(void *session, const char *local, const char *remote, int ascii) { ftp_session *sess = session; return f2s(ftp_get(sess, local, remote, ascii)); } static int file_read(void *session, const char *remote, ne_block_reader reader, void *userdata) { ftp_session *sess = session; return f2s(ftp_read_file(sess, remote, reader, userdata)); } static int file_delete(void *session, const char *filename) { ftp_session *sess = session; return f2s(ftp_delete(sess, filename)); } static int file_chmod(void *session, const char *filename, mode_t mode) { ftp_session *sess = session; return f2s(ftp_chmod(sess, filename, mode)); } static int dir_create(void *session, const char *dirname) { ftp_session *sess = session; return f2s(ftp_mkdir(sess, dirname)); } static int dir_remove(void *session, const char *dirname) { ftp_session *sess = session; return f2s(ftp_rmdir(sess, dirname)); } static int fetch_list(void *session, const char *dirname, int need_modtimes, struct proto_file **files) { ftp_session *sess = session; int ret; ret = ftp_fetch(sess, dirname, files); if (ret == FTP_OK && need_modtimes) { ret = ftp_fetch_modtimes(sess, dirname, *files); } return f2s(ret); } static const char *error(void *session) { ftp_session *sess = session; return ftp_get_error(sess); } /* The protocol drivers */ const struct proto_driver ftp_driver = { init, finish, file_move, file_upload, file_upload_cond, file_get_modtime, file_download, file_read, file_delete, file_chmod, dir_create, dir_remove, NULL, /* create link */ NULL, /* change link target */ NULL, /* delete link */ fetch_list, error, get_server_port, get_server_port, "FTP" }; sitecopy-0.16.6/src/lsparser.h0000664000076400007640000000424210260171143014361 0ustar joejoe/* 'ls' output parser, for rsh and ftp drivers Copyright (C) 1998-2005, Joe Orton This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef LS_PARSER_H #define LS_PARSER_H 1 #include "config.h" #include #include "ne_defs.h" /* for off_t */ #include "protocol.h" struct ls_file { mode_t mode; off_t size; char *name; }; typedef struct ls_context ls_context_t; /* Initialize LS parser context. */ ls_context_t *ls_init(const char *dirname); /* The result of parsing one line of LS output: */ enum ls_result { ls_directory, /* a subdirectory */ ls_file, /* a file */ ls_nothing, /* nothing interesting on this line */ ls_error /* a parse error */ }; /* Parse LINE of ls output. Modifies LINE. Returns one of the * ls_result values; fills in file->mode, file->size, file->name for * ls_file; file->mode and file->name for ls_directory. file->name is * ne_malloc-allocated. */ enum ls_result ls_parse(ls_context_t *ctx, char *line, struct ls_file *file); /* Return the error string from the context, if ls_error was * previously called. */ const char *ls_geterror(ls_context_t *ctx); /* Destroy an LS parser context. */ void ls_destroy(ls_context_t *ctx); /* Adds a parsed file or directory entry to a proto_file list. */ void ls_pflist_add(struct proto_file **list, struct proto_file **tail, const struct ls_file *lsf, enum ls_result result); #endif /* LSPARSER_H */ sitecopy-0.16.6/src/nulldriver.c0000664000076400007640000000550710166227532014725 0ustar joejoe/* sitecopy noop protocol driver module Copyright (C) 2004, Joe Orton 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. */ #include #include #include "protocol.h" #include "frontend.h" #include "i18n.h" static int init(void **session, struct site *site) { return SITE_OK; } static void finish(void *session) { } static int null_move(void *session, const char *from, const char *to) { return SITE_OK; } static int null_upload_cond(void *session, const char *local, const char *remote, int ascii, time_t t) { return SITE_OK; } static int null_get_modtime(void *session, const char *remote, time_t *modtime) { time(modtime); return SITE_OK; } static int null_updownload(void *session, const char *local, const char *remote, int ascii) { return SITE_OK; } static int null_onearg(void *session, const char *dirname) { return SITE_OK; } static int null_read(void *session, const char *remote, ne_block_reader reader, void *userdata) { return SITE_OK; } static int null_chmod(void *session, const char *remote, mode_t mode) { return SITE_OK; } static int fetch_list(void *session, const char *dirname, int need_modtimes, struct proto_file **files) { return SITE_OK; } static int unimp_link2(void *session, const char *l, const char *target) { return SITE_UNSUPPORTED; } static int unimp_link1(void *session, const char *l) { return SITE_UNSUPPORTED; } static int null_get_port(struct site *site) { return 0; } static const char *null_error(void *session) { return "No error occurred"; } /* The noop protocol driver */ const struct proto_driver null_driver = { init, finish, null_move, null_updownload, null_upload_cond, null_get_modtime, null_updownload, null_read, null_onearg, null_chmod, null_onearg, null_onearg, unimp_link2, /* create link */ unimp_link2, /* change link target */ unimp_link1, /* delete link */ fetch_list, null_error, null_get_port, null_get_port, "NULL" }; sitecopy-0.16.6/src/ftp.h0000664000076400007640000000624410165765223013337 0ustar joejoe/* FTP client implementation Copyright (C) 1998-2002, Joe Orton This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef FTP_H #define FTP_H #include #include "protocol.h" /* Reply codes - these are returned by internal functions, * ftp_exec and ftp_open mainly. */ #define FTP_OK 0 #define FTP_NEEDPASSWORD 1 #define FTP_PASSIVE 2 #define FTP_READY 3 #define FTP_FILEMORE 4 #define FTP_MODTIME 5 #define FTP_SENT 6 #define FTP_CLOSED 101 #define FTP_FILEBAD 102 #define FTP_FAILED 103 #define FTP_LOOKUP 991 #define FTP_CONNECT 992 #define FTP_HELLO 993 #define FTP_LOGIN 994 #define FTP_BROKEN 995 #define FTP_DENIED 996 #define FTP_UNSUPPORTED 997 #define FTP_NOPASSIVE 998 #define FTP_ERROR 999 /* This module contains an FTP client implementation. * All commands return FTP_OK on success. */ typedef struct ftp_session_s ftp_session; /* Connection functions */ ftp_session *ftp_init(void); /* Opens the control connection if necessary. * Returns: * FTP_OK on success * FTP_CONNECT on failed socket connect * FTP_HELLO if the greeting message couldn't be read * FTP_LOGIN on failed login */ int ftp_open(ftp_session *sess); /* Performs the login procedure */ int ftp_set_server(ftp_session *sess, struct site_host *server); void ftp_set_passive(ftp_session *sess, int use_passive); void ftp_set_usecwd(ftp_session *sess, int use_cwd); const char *ftp_get_error(ftp_session *sess); int ftp_finish(ftp_session *sess); /* The commands available */ int ftp_put(ftp_session *sess, const char *localfile, const char *remotefile, int ascii); int ftp_put_cond(ftp_session *sess, const char *local, const char *remote, int ascii, const time_t t); int ftp_get(ftp_session *sess, const char *localfile, const char *remotefile, int ascii); int ftp_delete(ftp_session *sess, const char *filename); int ftp_rmdir(ftp_session *sess, const char *dir); int ftp_mkdir(ftp_session *sess, const char *dir); int ftp_chmod(ftp_session *sess, const char *filename, const mode_t mode); int ftp_move(ftp_session *sess, const char *from, const char *to); int ftp_fetch(ftp_session *sess, const char *startdir, struct proto_file **files); int ftp_fetch_modtimes(ftp_session *sess, const char *rotodir, struct proto_file *files); int ftp_get_modtime(ftp_session *sess, const char *filename, time_t *modtime); int ftp_read_file(ftp_session *sess, const char *remotefile, ne_block_reader reader, void *userdata); #endif /* FTP_H */ sitecopy-0.16.6/src/sitestore.c0000664000076400007640000003271410371077540014560 0ustar joejoe/* sitecopy, for managing remote web sites. Stored state handling routines. Copyright (C) 1999-2006, Joe Orton 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. */ #include "config.h" #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #include #include #include #include #include #include #include #include "i18n.h" #include "common.h" #include "sitesi.h" /* Use a version in the site state file: * Bump the major number if a backwardly-incompatible change is made. */ #define SITE_STATE_FILE_VERSION "1.0" /* Used in stored.mode to indicate no mode known. */ #define INVALID_MODE ((mode_t)-1) /* Opens the storage file for writing */ FILE *site_open_storage_file(struct site *site) { if (site->storage_file == NULL) { site->storage_file = fopen(site->infofile, "w" FOPEN_BINARY_FLAGS); } return site->storage_file; } int site_close_storage_file(struct site *site) { int ret = fclose(site->storage_file); site->storage_file = NULL; return ret; } /* Return escaped form of 'filename'; any XML-unsafe characters are * escaped. */ static char *fn_escape(const char *filename) { const unsigned char *pnt = (const unsigned char *)filename; char *ret = ne_malloc(strlen(filename) * 3 + 1), *p = ret; do { if (!(isalnum(*pnt) || *pnt == '/' || *pnt == '.' || *pnt == '-') || *pnt > 0x7f) { sprintf(p, "%%%02x", *pnt); p += 3; } else { *p++ = *(char *)pnt; } } while (*++pnt != '\0'); *p = '\0'; return ret; } /* Return unescaped filename; reverse of fn_escape. */ static char *fn_unescape(const char *filename) { const unsigned char *pnt = (const unsigned char *)filename; char *ret = ne_malloc(strlen(filename) + 1), *p = ret; do { if (*pnt == '%') { *p = (NE_ASC2HEX(pnt[1]) << 4) & 0xf0; *p++ |= (NE_ASC2HEX(pnt[2]) & 0x0f); pnt += 2; } else { *p++ = *pnt; } } while (*++pnt != '\0'); *p = '\0'; return ret; } /* Write out the stored state for the site. * Returns 0 on success, non-zero on error. */ int site_write_stored_state(struct site *site) { struct site_file *current; FILE *fp = site_open_storage_file(site); if (fp == NULL) { return -1; } fprintf(fp, "\n"); fprintf(fp, "\n"); fprintf(fp, "\n"); fprintf(fp, " \n"); if (site->state_method == state_checksum) { /* For forwards-compatibility */ fprintf(fp, " \n"); } fprintf(fp, " \n", (site->state_method==state_checksum)?"checksum":"timesize"); if (site->safemode) { fprintf(fp, " \n"); } fprintf(fp, " \n"); fprintf(fp, "\n"); fprintf(fp, "\n"); /* Now write out the items */ for (current = site->files; current!=NULL; current = current->next) { char *fname; if (!current->stored.exists) continue; fprintf(fp, ""); fprintf(fp, "", (current->type==file_file)?"file":( (current->type==file_dir)?"directory":"link")); /* escape filenames correctly for XML. */ fname = fn_escape(current->stored.filename); fprintf(fp, "%s\n", fname); ne_free(fname); if (current->stored.mode != INVALID_MODE) { fprintf(fp, "%03o", current->stored.mode); /* three-digit octal */ } switch (current->type) { case file_link: fprintf(fp, "%s", current->stored.linktarget); break; case file_file: fprintf(fp, "%" NE_FMT_OFF_T "", current->stored.size); switch (site->state_method) { case state_checksum: { char csum[33]; ne_md5_to_ascii(current->stored.checksum, csum); fprintf(fp, "%s", csum); } break; case state_timesize: fprintf(fp, "%ld", current->stored.time); break; } fprintf(fp, "%s", current->stored.ascii?"":""); if (current->server.exists) { fprintf(fp, "%ld", current->server.time); } break; case file_dir: /* nothing to do */ break; } fprintf(fp, "\n"); } fprintf(fp, "\n"); fprintf(fp, "\n"); site->stored_state_method = site->state_method; return site_close_storage_file(site); } /* neon ne_xml-based XML parsing */ #define ELM_BASE 500 #define SITE_ELM_sitestate (ELM_BASE + 1) #define SITE_ELM_options (ELM_BASE + 2) #define SITE_ELM_opt_saved_by (ELM_BASE + 3) #define SITE_ELM_opt_checksum (ELM_BASE + 4) #define SITE_ELM_opt_checksum_md5 (ELM_BASE + 5) #define SITE_ELM_opt_state_method (ELM_BASE + 6) #define SITE_ELM_opt_state_method_timesize (ELM_BASE + 7) #define SITE_ELM_opt_state_method_checksum (ELM_BASE + 8) #define SITE_ELM_items (ELM_BASE + 9) #define SITE_ELM_item (ELM_BASE + 10) #define SITE_ELM_type (ELM_BASE + 11) #define SITE_ELM_type_file (ELM_BASE + 12) #define SITE_ELM_type_directory (ELM_BASE + 13) #define SITE_ELM_type_link (ELM_BASE + 14) #define SITE_ELM_filename (ELM_BASE + 15) #define SITE_ELM_size (ELM_BASE + 16) #define SITE_ELM_modtime (ELM_BASE + 17) #define SITE_ELM_ascii (ELM_BASE + 18) #define SITE_ELM_linktarget (ELM_BASE + 19) #define SITE_ELM_checksum (ELM_BASE + 20) #define SITE_ELM_protection (ELM_BASE + 21) #define SITE_ELM_server_modtime (ELM_BASE + 22) #define SITE_ELM_true (ELM_BASE + 23) #define SITE_ELM_false (ELM_BASE + 24) static const struct ne_xml_idmap elmmap[] = { { "", "sitestate", SITE_ELM_sitestate }, { "", "options", SITE_ELM_options }, { "", "saved-by", SITE_ELM_opt_saved_by }, { "", "checksum-algorithm", SITE_ELM_opt_checksum }, { "", "checksum-MD5", SITE_ELM_opt_checksum_md5 }, { "", "state-method", SITE_ELM_opt_state_method }, { "", "state-timesize", SITE_ELM_opt_state_method_timesize }, { "", "state-checksum", SITE_ELM_opt_state_method_checksum }, { "", "items", SITE_ELM_items }, { "", "item", SITE_ELM_item }, { "", "type", SITE_ELM_type }, { "", "type-file", SITE_ELM_type_file }, { "", "type-directory", SITE_ELM_type_directory }, { "", "type-link", SITE_ELM_type_link }, { "", "filename", SITE_ELM_filename }, { "", "size", SITE_ELM_size }, { "", "modtime", SITE_ELM_modtime }, { "", "ascii", SITE_ELM_ascii }, { "", "linktarget", SITE_ELM_linktarget }, { "", "checksum", SITE_ELM_checksum }, { "", "protection", SITE_ELM_protection }, { "", "server-modtime", SITE_ELM_server_modtime }, { "", "true", SITE_ELM_true }, { "", "false", SITE_ELM_false } }; struct site_xmldoc { ne_xml_parser *parser; struct site *site; /* What we've collected so far */ enum file_type type; struct file_state stored; struct file_state server; ne_buffer *cdata; unsigned int truth:2; /* 0: invalid, 1: true, 2: false */ }; static int start_element(void *userdata, int parent, const char *nspace, const char *name, const char **atts) { int state = ne_xml_mapid(elmmap, NE_XML_MAPLEN(elmmap), nspace, name); struct site_xmldoc *doc = userdata; if (state) ne_buffer_clear(doc->cdata); if (state == SITE_ELM_item) { /* Clear current stored state */ memset(&doc->stored, 0, sizeof doc->stored); /* Initialize perms bits to invalid state */ doc->stored.mode = INVALID_MODE; } if (state == SITE_ELM_ascii) { doc->truth = 0; } return state; } static int char_data(void *userdata, int state, const char *cdata, size_t len) { struct site_xmldoc *doc = userdata; ne_buffer_append(doc->cdata, cdata, len); return 0; } static int end_element(void *userdata, int state, const char *nspace, const char *name) { struct site_xmldoc *doc = userdata; const char *cdata = doc->cdata->data; char err[512]; /* Dispatch Ajax */ switch (state) { case SITE_ELM_opt_state_method_timesize: doc->site->stored_state_method = state_timesize; break; case SITE_ELM_opt_state_method_checksum: doc->site->stored_state_method = state_checksum; break; case SITE_ELM_type_file: doc->type = file_file; break; case SITE_ELM_type_directory: doc->type = file_dir; break; case SITE_ELM_type_link: doc->type = file_link; break; case SITE_ELM_filename: doc->stored.filename = fn_unescape(cdata); break; case SITE_ELM_checksum: if (strlen(cdata) > 32) { ne_snprintf(err, sizeof err, _("Invalid checksum at line %d"), ne_xml_currentline(doc->parser)); ne_xml_set_error(doc->parser, err); return -1; } else { /* FIXME: validate */ ne_ascii_to_md5(cdata, doc->stored.checksum); #ifdef DEBUGGING { char tmp[33]; ne_md5_to_ascii(doc->stored.checksum, tmp); NE_DEBUG(DEBUG_FILES, "Checksum recoded: [%32s]\n", tmp); } #endif /* DEBUGGING */ } break; case SITE_ELM_size: doc->stored.size = strtol(cdata, NULL, 10); if (doc->stored.size == LONG_MAX) { } break; case SITE_ELM_protection: doc->stored.mode = strtoul(cdata, NULL, 8); break; case SITE_ELM_server_modtime: doc->server.time = strtol(cdata, NULL, 10); if (doc->server.time == LONG_MIN || doc->server.time == LONG_MAX) goto overflow_err; doc->server.exists = true; break; case SITE_ELM_modtime: doc->stored.time = strtol(cdata, NULL, 10); if (doc->stored.time == LONG_MIN || doc->stored.time == LONG_MAX) goto overflow_err; break; case SITE_ELM_true: doc->truth = 1; break; case SITE_ELM_false: doc->truth = 2; break; case SITE_ELM_ascii: if (doc->truth) { doc->stored.ascii = doc->truth == 1; } else { ne_snprintf(err, sizeof err, _("Boolean missing in 'ascii' " "at line %d"), ne_xml_currentline(doc->parser)); ne_xml_set_error(doc->parser, err); return -1; } break; case SITE_ELM_linktarget: doc->stored.linktarget = ne_strdup(cdata); break; case SITE_ELM_item: { struct site_file *file; doc->stored.exists = true; file = file_set_stored(doc->type, &doc->stored, doc->site); if (doc->server.exists) { file_state_copy(&file->server, &doc->server, doc->site); } DEBUG_DUMP_FILE_PROPS(DEBUG_FILES, file, doc->site); } break; default: break; } return 0; overflow_err: ne_snprintf(err, sizeof err, _("Size overflow (%s) in '%s' at line %d"), cdata, name, ne_xml_currentline(doc->parser)); ne_xml_set_error(doc->parser, err); return -1; } /* Read a new XML-format state storage file */ static int parse_storage_file(struct site *site, FILE *fp) { ne_xml_parser *p; struct site_xmldoc doc = {0}; int ret; doc.site = site; doc.cdata = ne_buffer_create(); doc.parser = p = ne_xml_create(); ne_xml_push_handler(p, start_element, char_data, end_element, &doc); ret = 0; do { char buffer[BUFSIZ]; int len; len = fread(buffer, 1, BUFSIZ, fp); if (len < BUFSIZ) { if (feof(fp)) { ret = 1; } else if (ferror(fp)) { ret = -1; /* And don't parse anything else... */ break; } } ne_xml_parse(p, buffer, len); } while (ret == 0 && !ne_xml_failed(p)); if (!ne_xml_failed(p)) ne_xml_parse(p, "", 0); if (ne_xml_failed(p)) { site->last_error = ne_strdup(ne_xml_get_error(p)); ret = SITE_ERRORS; } else if (ret < 0) { site->last_error = ne_strdup(strerror(errno)); ret = SITE_ERRORS; } ne_xml_destroy(p); return ret; } int site_read_stored_state(struct site *site) { FILE *fp; int ret; NE_DEBUG(DEBUG_FILES, "Reading info file: %s\n", site->infofile); fp = fopen(site->infofile, "r"); if (fp == NULL) { struct stat st; site->last_error = ne_strdup(strerror(errno)); ret = stat(site->infofile, &st); if ((ret == 0) || (errno != ENOENT)) { /* The file exists but could not be opened for reading... * this is an error condition. */ NE_DEBUG(DEBUG_FILES, "Stat failed %s\n", strerror(errno)); return SITE_ERRORS; } else { NE_DEBUG(DEBUG_FILES, "Info file doesn't exist.\n"); return SITE_FAILED; } } ret = parse_storage_file(site, fp); fclose(fp); return ret; } sitecopy-0.16.6/src/console_fe.c0000664000076400007640000011327011035210311014627 0ustar joejoe/* sitecopy, for managing remote web sites. Copyright (C) 1998-2008, Joe Orton 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. */ /* This is the console front end for sitecopy. * TODO: Some of the configuration stuff should be moved out of here. */ #include #include #include #include #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #include #include #include #include #include /* for ne_shave */ #include /* for ne_debug_* */ #include #include "basename.h" #include "i18n.h" #include "frontend.h" #include "sites.h" #include "rcfile.h" #include "common.h" /* From lib/yesno.c */ int yesno(void); /* The maximum number of sites which can be specified on the command * line */ #define MAXSITES 20 static enum action { action_list, action_synch, action_fetch, action_update, action_verify, action_catchup, action_init, action_view, action_none } action; #define A_LOCAL (1 << 2) #define A_STORED (1 << 3) #define A_COND_STORED (A_STORED | (1 << 4)) /* TODO: extend this even further, so it includes the site_whatever * handler, whether we need to do a post-operation write_stored_state, * any preconditions, ... * Changes needed for that are that each site_mode() function have * consistent parms and return code usage. * Does this structure actually make localization harder or easier? * .. Unfortunately harder. :-( */ static struct action_info { /* The stem verb: used to form phrases like: "Update the site". * Should be capitalized, since it will be used at the beginning of * sentences. */ const char *verb; /* The present participle of the verb (I think?), used to form a * phrase like: "I am the site." */ const char *doing; /* What the action operates on, used to form a phrase like: * "I am the site." */ const char *subject; /* Flags; * A_LOCAL -> must read local state before operation. * A_STORED -> must read stored state before operation. * A_COND_STORED -> read stored state if there is any, otherwise ignore it. */ unsigned int flags; } actions[] = { { N_("Show changes to"), N_("showing changes to"), N_("local"), A_LOCAL | A_STORED }, { N_("Synchronize"), N_("synchronizing"), N_("local"), A_LOCAL | A_STORED }, /* TODO: fetch really only needs local state if we're using * state_timesize, to fudge the modtimes. * And we only need A_STORED if we're using state_timesize AND * safe mode. */ { N_("Fetch"), N_("fetching"), N_("remote"), A_LOCAL | A_COND_STORED }, { N_("Update"), N_("updating"), N_("remote"), A_LOCAL | A_STORED }, { N_("Verify"), N_("verifying"), N_("remote"), A_STORED }, { N_("Catch up"), N_("catching up"), N_("stored"), A_LOCAL }, { N_("Initialize"), N_("initializing"), N_("stored"), 0 }, { NULL, NULL, NULL, 0 } }; static const char *contact_mntr = N_("You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n"); /* The short program name, basename(argv[0]) */ static const char *progname; /* the sites specified on the command line */ static const char *sitenames[MAXSITES]; static int numsites; /* the number of sites specified */ static struct site *current_site; /* this is used to save the state if we * get signalled mid-update */ static int upload_total, upload_sofar, in_transfer; /* User-specified options */ static int quiet; /* How quiet do they want us to be? */ static int allsites, /* Do they want all sites to be operated on? */ listflat, /* Do they want the 'flat' list style */ show_progress, /* Do they want the %-complete messages */ prompting, /* Did they say --prompting? */ keepgoing, /* Did they say --keep-going? */ dry_run; /* Did they say --dry-run? */ /* Functions prototypes */ static void init(int, char **); static void parse_cmdline(int, char **); static int act_on_site(struct site *site, enum action act); static int verify_sites(struct site *sites, enum action act); int main(int, char **); static void usage(void); static void version(void); static void list_site_changes(struct site *); static int list_site_definitions(struct site *); static void init_sites(void); int main(int argc, char *argv[]) { int ret = 0, numgoodsites; struct site *current; #ifdef HAVE_SETLOCALE setlocale(LC_ALL, ""); #endif #ifdef ENABLE_NLS bindtextdomain(PACKAGE_NAME, LOCALEDIR); textdomain(PACKAGE_NAME); #endif /* ENABLE_NLS */ fe_initialize(); init(argc, argv); if (numsites == 0 && action == action_view) allsites = 1; if (!allsites) { /* Mark all the sites we are interested in */ int num; for (num=0; num < numsites; num++) { current = site_find(sitenames[num]); if (current == NULL) { printf( _("%s: Error: No site called `%s' found - skipping.\n"), progname, sitenames[num]); } else { current->use_this = true; } } } /* Count the number of sites that are okay. */ numgoodsites = verify_sites(all_sites, action); /* Handle the dump sites request */ if (action == action_view) { return list_site_definitions(all_sites); } if (numgoodsites==0) { if (numsites > 0) { printf(_("%s: No valid sites specified.\n"), progname); } else { printf(_("%s: No sites specified.\n"), progname); } printf(_("Try `%s --help' for more information.\n"), progname); exit(-1); } for (current=all_sites; current!=NULL; current=current->next) { if (current->use_this || allsites) { if (!listflat && quiet == 0) { /* Display the banner line */ const char *str_action = _(actions[action].doing); printf(_("%s: %c%s site `%s' (on %s in %s)\n"), progname, toupper(*str_action), str_action+1, current->name, current->server.hostname, current->remote_root_user); } ret = act_on_site(current, action); } } return ret; } /* Produce the normal listing output for the given site. */ static void list_site_changes(struct site *the_site) { struct site_file *current; int count; if (the_site->numnew > 0) { printf(_("* These items have been added since the last update:\n")); count = 0; for (current = the_site->files; current!=NULL; current=current->next) { if (current->diff == file_new) { if (count++) printf(", "); if (current->type == file_dir) printf(_("dir:")); printf("%s", file_name(current)); } } putchar('\n'); } if ((the_site->numchanged > 0) || (the_site->numignored > 0)) { printf(_("* These items have been changed since the last update:\n")); if (the_site->numignored > 0) { printf(_(" Changes to items in [brackets] are ignored during updates.\n")); } count = 0; for (current = the_site->files; current!=NULL; current=current->next) { if (current->diff == file_changed) { if (count++) printf(", "); printf("%s%s%s", current->ignore?"[":"", file_name(current), current->ignore?"]":""); } } putchar('\n'); } if (the_site->numdeleted > 0) { if (the_site->nodelete) { printf(_("* These items have been deleted, but will be left on the server:\n")); } else { printf(_("* These items have been deleted since the last update:\n")); } count = 0; for (current = the_site->files; current!=NULL; current=current->next) { if (current->diff == file_deleted) { if (count++) printf(", "); if (current->type == file_dir) printf(_("dir:")); printf("%s", file_name(current)); } } putchar('\n'); } if (the_site->nummoved > 0) { printf(_("* These items have been moved since the last update:\n")); count = 0; for (current = the_site->files; current!=NULL; current=current->next) { if (current->diff == file_moved) { /* TODO: move to directory */ if (count++) printf(", "); printf("%s->%s", current->stored.filename, current->local.filename); } } putchar('\n'); } } static const char *get_perms_mode(struct site *site) { switch (site->perms) { case sitep_ignore: return _("Ignored"); case sitep_exec: return _("Maintained for executables"); default: return _("Always maintained"); } } static const char *get_symlinks_mode(struct site *site) { switch (site->symlinks) { case sitesym_ignore: return _("Ignored"); case sitesym_maintain: return _("Maintained"); default: return _("Followed"); } } static int list_site_definitions(struct site *sites) { struct site *current; for (current=sites; current!=NULL; current=current->next) { /* FIXME: Possibly, make sure we have the actual port number first * so we don't have to mess around printing out the port */ if (!current->use_this && !allsites) continue; printf(_("Site: %s\n\tServer: %s"), current->name, current->server.hostname); printf(_(" Port: ")); if (current->server.port == 0) { printf(_("(default)\n")); } else { printf(_("%d\n"), current->server.port); } printf(_("\tProtocol: %s Username: %s\n"), site_get_protoname(current), current->server.username?current->server.username: _("(unspecified)")); if (! current->ftp_pasv_mode) printf(_("\tPassive mode FTP will not be used.\n")); printf(_("\tRemote directory: %s\n\tLocal directory: %s\n"), current->remote_root_user, current->local_root_user); printf(_("\tPermissions: %s Symlinks: %s\n"), get_perms_mode(current), get_symlinks_mode(current)); if (current->nodelete) printf(_("\tRemote files will not be deleted.\n")); if (current->checkmoved) printf(_("\tFiles will be moved remotely if moved locally.\n")); } return 0; } /* Called to ensure only one action is specified at once */ static void set_action(enum action newact) { if (action != action_none) { printf(_("%s: Error: Only specify ONE operation mode at a time.\n"), progname); printf(_("Try `%s --help' for more information.\n"), progname); exit(-1); } else { action = newact; } } static void parse_cmdline(int argc, char *argv[]) { int optc; int firstlist = false; extern char *optarg; extern int optind; const static char *shortopts = #ifdef NE_DEBUGGING "d:g:" #endif "acefhiklonp:qr:suvVyZ"; /* available: bgjmntwx */ const static struct option longopts[] = { /* Operation modes */ { "update", no_argument, NULL, 'u' }, { "verify", no_argument, NULL, 'e' }, { "initialize", no_argument, NULL, 'i' }, { "fetch", no_argument, NULL, 'f' }, { "synchronize", no_argument, NULL, 's' }, { "list", no_argument, NULL, 'l' }, { "flatlist", no_argument, NULL, 'Z' }, { "keep-going", no_argument, NULL, 'k' }, { "dry-run", no_argument, NULL, 'n' }, { "show-progress", no_argument, NULL, 'o' }, /* { "force-overwrite", no_argument, NULL, 't' }, */ { "help", no_argument, NULL, 'h' }, { "catchup", no_argument, NULL, 'c' }, { "view", no_argument, NULL, 'v' }, /* Options */ { "quiet", no_argument, &quiet, 1 }, { "silent", no_argument, &quiet, 2 }, { "rcfile", required_argument, NULL, 'r' }, { "storepath", required_argument, NULL, 'p' }, #ifdef NE_DEBUGGING { "debug", required_argument, NULL, 'd' }, { "logfile", required_argument, NULL, 'g' }, #endif { "prompting", no_argument, NULL, 'y' }, { "allsites", no_argument, NULL, 'a' }, { "version", no_argument, NULL, 'V' }, { 0, 0, 0, 0 } }; #ifdef NE_DEBUGGING /* Debugging defaults to off and stderr */ int use_debug_mask = 0; FILE *use_debug_stream = stderr; #endif /* Defaults */ allsites = prompting = false; show_progress = false; action = action_none; progname = base_name(argv[0]); /* Read the cmdline args */ while ((optc = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch (optc) { case 0: /* Make the action list mode if they gave --flatlist */ if (listflat == true) action = action_list; break; case 'Z': listflat = true; set_action(action_list); break; case 'l': if (firstlist == false) { set_action(action_list); firstlist = true; } else { listflat = true; } break; case 's': set_action(action_synch); break; case 'e': set_action(action_verify); break; case 'f': set_action(action_fetch); break; case 'i': set_action(action_init); break; case 'c': set_action(action_catchup); break; case 'u': set_action(action_update); break; case 'v': set_action(action_view); break; case 'q': quiet++; break; case 'r': if (strlen(optarg) != 0) { rcfile = ne_strdup(optarg); } else { usage(); exit(-1); } break; case 'p': if (strlen(optarg) != 0) { if (optarg[strlen(optarg)] != '/') { copypath = ne_malloc(strlen(optarg) + 2); strcpy(copypath, optarg); strcat(copypath, "/"); } else { copypath = ne_strdup(optarg); } } else { usage(); exit(-1); } break; #ifdef NE_DEBUGGING case 'd': { char errbuf[20]; /* set debugging level */ if (map_debug_options(optarg, &use_debug_mask, errbuf)) { printf(_("%s: Error: Debug channel %s not known.\n"), progname, errbuf ); exit(-1); } } break; case 'g': { FILE *f = fopen(optarg, "a+"); if (f == NULL) { printf(_("%s: Warning: Could not open `%s' to use as logfile.\n"), progname, optarg); f = stderr; } else { use_debug_stream = f; /* TODO: Close this stream when we exit?... welll... * we *could* do. */ } } break; #endif case 'y': prompting = true; break; case 'k': keepgoing = true; break; case 'a': allsites = true; break; case 'n': dry_run = true; break; case 'o': show_progress = true; break; case 'V': version(); puts(ne_version_string()); exit(-1); case 'h': usage(); exit(-1); case '?': default: printf(_("Try `%s --help' for more information.\n"), progname); exit(1); } } /* Set the default action mode */ if (action == action_none) action = action_list; /* Dry-run mode is only currently supported for --update */ if (dry_run && action != action_update) { printf(_("%s: Error: Dry run mode is currently only supported " "for updates.\n"), progname); exit(1); } #ifdef NE_DEBUGGING ne_debug_init(use_debug_stream, use_debug_mask); #else ne_debug_init(stderr, 0); #endif /* Get those site names off the end of the cmdline */ for (numsites = 0 ; optind < argc; optind++) { sitenames[numsites++] = argv[optind]; if (numsites == MAXSITES) { printf(_("%s: Warning: Only %d sites can be specified on the command line!\nExtra entries are being skipped.\n"), progname, MAXSITES); break; } } } static int get_username(const char *prompt, char *buffer) { printf("%s", prompt); if (fgets(buffer, FE_LBUFSIZ, stdin)) { ne_shave(buffer, "\r\n "); return 0; } else { return -1; } } int fe_accept_cert(const ne_ssl_certificate *cert, int failures) { const char *id = ne_ssl_cert_identity(cert); char *dn, fprint[61]; ne_ssl_cert_digest(cert, fprint); puts(_("WARNING: Server certificate is not trusted.")); if (id) printf(_("Certificate was issued for server `%s'.\n"), id); else puts(_("WARNING: Certificate does not specify a server")); printf(_("Fingerprint: %s\n"), fprint); dn = ne_ssl_readable_dname(ne_ssl_cert_subject(cert)); printf(_("Issued to: %s\n"), dn); free(dn); dn = ne_ssl_readable_dname(ne_ssl_cert_issuer(cert)); printf(_("Issued by: %s\n"), dn); free(dn); printf(_("Do you wish to accept this certificate? (y/n) ")); return !yesno(); } int fe_login(fe_login_context ctx, const char *realm, const char *hostname, char *username, char *password) { const char *server = (ctx==fe_login_server)?N_("server"):N_("proxy server"); char *tmp; if (in_transfer) { printf("]"); } if (realm) { printf(_("Authentication required for %s on %s `%s':\n"), realm, server, hostname); } else { printf(_("Authentication required on %s `%s':\n"), server, hostname); } if (username[0] == '\0') { if (get_username(_("Username: "), username)) { printf("\nAuthentication aborted!\n"); return -1; } } else { printf(_("Username: %s\n"), username); } tmp = getpass(_("Password: ")); if (tmp == NULL) { /* joe: my Linux getpass doesn't say it will ever return NULL, * but, just to be sure... */ return -1; } ne_strnzcpy(password, tmp, FE_LBUFSIZ); if (in_transfer) { printf(_("Retrying: [")); upload_sofar = 0; } return 0; } int fe_decrypt_clicert(const ne_ssl_client_cert *cert, char *password) { const char *name = ne_ssl_clicert_name(cert); char *tmp; printf(_("%s: Encrypted client certificate configured%s%s.\n"), progname, name ? ": " : "", name ? name : ""); tmp = getpass(_("Password: ")); if (tmp == NULL) { return -1; } ne_strnzcpy(password, tmp, FE_LBUFSIZ); return 0; } void fe_warning(const char *descr, const char *reason, const char *err) { printf("%s: Warning", progname); if (reason != NULL) { printf(" on `%s':\n", reason); } else { printf(":\n"); } printf("%s", descr); if (err != NULL) printf(" - %s\n", err); else printf("\n"); } int fe_can_update(const struct site_file *file) { char tmp[256]; if (!prompting) return true; switch (file->type) { case file_dir: if (file->diff == file_new) { printf(_("Create %s/"), file_name(file)); } else { printf(_("Delete %s/"), file_name(file)); } break; case file_file: switch (file->diff) { case file_changed: case file_new: ne_snprintf(tmp, sizeof tmp, "%" NE_FMT_OFF_T, file->local.size); printf(_("Upload %s (%s bytes)"), file_name(file), tmp); break; case file_deleted: printf(_("Delete %s"), file_name(file)); break; case file_moved: printf(_("Move %s->%s"), file->stored.filename, file_name(file)); break; default: /* Shouldn't happen */ printf(_("%s: in fe_can_update/file_file\n%s"), progname, contact_mntr); break; } break; case file_link: switch (file->diff) { case file_changed: printf(_("Change %s"), file_name(file)); break; case file_new: printf(_("Create %s"), file_name(file)); break; case file_deleted: printf(_("Remove %s"), file_name(file)); break; default: /* Shouldn't happen */ printf(_("%s: in fe_can_update/file_link\n%s"), progname, contact_mntr); break; } break; } printf(_("? (y/n) ")); return yesno(); } void fe_checksumming(const char *filename) { switch (quiet) { case 0: in_transfer = 0; printf(_("Checksumming %s: ["), filename); fflush(stdout); break; case 1: printf("%s\n", filename); default: break; } } void fe_checksummed(const char *file, int success, const char *err) { switch (quiet) { case 0: if (success) { printf(_("] done.\n")); } else { printf(_("] failed:\n%s\n"), err); } default: break; } } void fe_setting_perms(const struct site_file *file) { if (quiet == 0) { printf(_("Setting permissions on %s%s: "), file_name(file), file->type == file_dir ? "/" : ""); fflush(stdout); } } void fe_set_perms(const struct site_file *file, int success, const char *error) { if (quiet == 0) { if (success) { printf(_("done.\n")); } else { printf(_("failed:\n%s\n"), error); } } } /* Called when the given files is about to be updated */ void fe_updating(const struct site_file *file) { if (quiet) { if (quiet == 1) { printf("%s\n", file_name(file)); } return; } in_transfer = 0; switch (file->type) { case file_dir: if (file->diff == file_new) { printf(_("Creating %s/: "), file_name(file)); } else { printf(_("Deleting %s/: "), file_name(file)); } break; case file_file: switch (file->diff) { case file_changed: case file_new: printf(_("Uploading %s: ["), file_name(file)); break; case file_deleted: printf(_("Deleting %s: "), file_name(file)); break; case file_moved: printf(_("Moving %s->%s: "), file->stored.filename, file->local.filename); break; default: printf(_("%s: in fe_updating/file_file\n%s"), progname, contact_mntr); break; } break; case file_link: switch (file->diff) { case file_changed: printf(_("Changing %s: "), file_name(file)); break; case file_new: printf(_("Creating %s: "), file_name(file)); break; case file_deleted: printf(_("Deleting %s: "), file_name(file)); break; default: printf(_("%s: in fe_updating/file_link\n%s"), progname, contact_mntr); } break; } fflush(stdout); } void fe_updated(const struct site_file *file, int success, const char *error) { char wrap = error && strlen(error) < 30 ? ' ' : '\n'; upload_sofar += file->local.size; if (quiet > 0) { if (! success) { printf(_("Failed to update %s:%c%s\n"), file_name(file), wrap, error); } return; } if ((file->type == file_dir) || (file->diff!=file_changed && file->diff!=file_new)) { if (success) { printf(_("done.\n")); } else { printf(_("failed:%c%s\n"), wrap, error); } } else { if (success) { if (show_progress) { float prog = (100 * (float)upload_sofar) / (float)upload_total; if (upload_total == 0) prog = 0; printf(("] done. (%.0f%% finished)\n"), prog); } else { printf(_("] done.\n")); } } else { printf(_("] failed:%c%s\n"), wrap, error); } } } void fe_synching(const struct site_file *file) { if (quiet) { printf("%s\n", file_name(file)); return; } in_transfer = 0; switch (file->type) { case file_dir: if (file->diff != file_new) { printf(_("Creating %s/: "), file_name(file)); } else { printf(_("Deleting %s/: "), file_name(file)); } break; case file_file: switch (file->diff) { case file_changed: case file_deleted: printf(_("Downloading %s: ["), file_name(file)); break; case file_new: printf(_("Deleting %s: "), file_name(file)); break; case file_moved: printf(_("Moving %s->%s: "), file->local.filename, file->stored.filename); break; default: break; } case file_link: /* TODO-ng */ break; } fflush(stdout); } void fe_synched(const struct site_file *file, int success, const char *error) { if (quiet) return; if ((file->type == file_dir) || (file->diff!=file_changed && file->diff!=file_deleted)) { if (success) { printf(_("done.\n")); } else { printf(_("failed:\n%s\n"), error); } } else { if (success) { printf(_("] done.\n")); } else { printf(_("] failed:\n%s\n"), error); } } } void fe_verified(const char *name, enum file_diff match) { const char *state = "huh?"; switch (match) { case file_changed: state = _("Changed on server"); break; case file_new: state = _("Added on server"); break; case file_unchanged: case file_deleted: case file_moved: return; break; } printf(_("%s: %s\n"), state, name); } void fe_transfer_progress(ne_off_t num, ne_off_t total) { if (quiet == 0) { putchar('.'); fflush(stdout); in_transfer = 1; } } void fe_connection(fe_status status, const char *info) {} void fe_fetch_found(const struct site_file *file) { char tmp[80]; switch (file->type) { case file_dir: printf(_("Directory: %s/\n"), file->stored.filename); break; case file_file: /* TODO: could put checksum or modtime in here as appropriate */ ne_snprintf(tmp, sizeof tmp, "%" NE_FMT_OFF_T, file->stored.size); printf(_("File: %s - size %s%s\n"), file->stored.filename, tmp, file->stored.ascii?_(" (ASCII)"):""); break; case file_link: printf(_("Link: %s - target %s\n"), file->stored.filename, file->stored.linktarget); break; } } static void init_sites(void) { int ret; /* Read the rcfile */ ret = rcfile_read(&all_sites); if (ret == RC_OPENFILE) { printf(_("%s: Error: Could not open rcfile: %s.\n"), progname, rcfile); exit(-1); } else if (ret == RC_CORRUPT) { printf(_("%s: rcfile corrupt at line %d:\n%s\n"), progname, rcfile_linenum, rcfile_err); exit(-1); } } /* Verify sites list. */ static int verify_sites(struct site *sites, enum action act) { int count = 0, ret; struct site *current; int isokay; for (current = sites; current!=NULL; current=current->next) { if (!current->use_this && !allsites) continue; /* Check the site rcfile entry is okay */ ret = rcfile_verify(current); switch (ret) { case SITE_ACCESSLOCALDIR: printf(_("%s: Could not read directory for `%s':\n\t%s\n"), progname, current->name, current->local_root); break; case SITE_NOSERVER: printf(_("%s: Server not specified in site `%s'.\n"), progname, current->name); break; case SITE_NOREMOTEDIR: printf(_("%s: Remote directory not specified in site `%s'.\n"), progname, current->name); break; case SITE_NOLOCALDIR: printf(_("%s: Local directory not specified in site `%s'.\n"), progname, current->name); break; case SITE_INVALIDPORT: printf(_("%s: Invalid port used in site `%s'.\n"), progname, current->name); break; case SITE_NOMAINTAIN: printf(_("%s: %s cannot maintain symbolic links (site `%s').\n"), progname, site_get_protoname(current), current->name); break; case SITE_NOREMOTEREL: printf(_("%s: Cannot use a relative remote directory in %s (site `%s').\n"), progname, site_get_protoname(current), current->name); break; case SITE_NOPERMS: printf(_("%s: File permissions are not supported in %s (site `%s').\n"), progname, site_get_protoname(current), current->name); break; case SITE_NOSAFEOVER: printf(_("%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n"), progname, current->name); break; case SITE_NOSAFETEMPUP: printf(_("%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n"), progname, current->name); break; case SITE_NORENAMES: printf(_("%s: Can only check for renamed files when checksumming (site `%s').\n"), progname, current->name); break; case SITE_UNSUPPORTED: printf(_("%s: The protocol `%s' is unsupported (site `%s').\n"), progname, current->proto_string, current->name); break; case 0: /* Success */ break; default: printf(_("%s: Unhandled error %d in site `%s' - please contact the maintainer.\n"), progname, ret, current->name); break; } if (ret != 0) { isokay = false; } else { isokay = true; } if (isokay && (actions[act].flags & A_LOCAL)) { site_read_local_state(current); } if (isokay && (actions[act].flags & A_STORED)) { ret = site_read_stored_state(current); switch (ret) { case SITE_ERRORS: printf(_("%s: Error: Corrupt site storage file for `%s':\n%s: %s\n"), progname, current->name, progname, current->last_error); isokay = false; break; case SITE_FAILED: if ((actions[act].flags & A_COND_STORED) == A_COND_STORED) { break; } else { printf(_( "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n"), progname, current->name, progname); } isokay = false; default: break; } } if (isokay) { count++; } else { printf(_("%s: Skipping site `%s'.\n"), progname, current->name); current->use_this = false; } } return count; } static int issue_error(struct site *site, enum action actno, int error) { struct action_info *act = &actions[actno]; int ret; switch (error) { case SITE_OK: if (quiet == 0) { printf(_("%s: %s completed successfully.\n"), progname, _(act->verb)); } ret = 0; break; case SITE_UNSUPPORTED: printf(_("%s: %s unsupported for %s.\n"), progname, _(act->verb), site_get_protoname(site)); ret = 4; break; case SITE_ERRORS: printf(_("%s: Errors occurred while %s the %s site.\n"), progname, _(act->doing), _(act->subject)); ret = 1; break; case SITE_LOOKUP: printf(_("%s: Error: Could not resolve remote hostname (%s).\n"), progname, site->server.hostname); ret = 2; break; case SITE_PROXYLOOKUP: printf( _("%s: Error: Could not resolve hostname of proxy server (%s).\n"), progname, site->proxy.hostname); ret = 2; break; case SITE_CONNECT: if (site->proxy.hostname) { printf(_("%s: Error: Could not connect to proxy server (%s port %d).\n"), progname, site->proxy.hostname, site->proxy.port); } else { printf(_("%s: Error: Could not connect to server (%s port %d).\n"), progname, site->server.hostname, site->server.port); } ret = 2; break; case SITE_AUTH: printf(_("%s: Error: Could not authorise user on server.\n"), progname); ret = 2; break; case SITE_FAILED: printf(_("%s: Error: %s\n"), progname, site->last_error); ret = 2; break; case SITE_PROXYAUTH: printf(_("%s: Error: Could not authorise user on proxy server (%s).\n"), progname, site->proxy.hostname); ret = 2; break; default: printf(_("%s: in issue_error\n%s"), progname, contact_mntr); ret = 5; break; } return ret; } static void init(int argc, char **argv) { int ret; parse_cmdline(argc, argv); if (init_env() == 1) { printf(_("%s: Error: Environment variable HOME not set.\n"), progname); exit(-1); } ret = init_paths(); switch (ret) { case RC_OPENFILE: printf(_("%s: Error: Could not open rcfile: %s\n"), progname, rcfile); break; case RC_PERMS: printf(_("%s: Error: rcfile permissions allow other users to read your rcfile.\n"), progname); printf(_("%s: Set the permissions to 0600.\n"), progname); break; case RC_DIROPEN: printf(_("%s: Error: Could not open storage directory: %s\n"), progname, copypath); printf(_("%s: You need to create this directory and set the permissions to 0700.\n"), progname); break; case RC_DIRPERMS: printf(_("%s: Error: storage directory permissions incorrect.\n"), progname); printf(_("%s: Set the permissions to 0700.\n"), progname); break; case RC_NETRCPERMS: printf(_("%s: Error: ~/.netrc permissions incorrect.\n"), progname); printf(_("%s: Set the permissions to 0600.\n"), progname); break; case 0: break; default: printf(_("%s: init_paths gave %d\n%s"), progname, ret, contact_mntr); break; } if (ret != 0) exit(-1); if (init_netrc() == 1) { printf(_("%s: Error: Could not parse ~/.netrc.\n"), progname); exit(-1); } init_sites(); } static int act_on_site(struct site *site, enum action act) { int ret = 0, verify_removed; /* Set the options */ site->keep_going = keepgoing; switch (act) { case action_update: if (!site->remote_is_different) { if (quiet == 0) { printf(_("%s: Nothing to do - no changes found.\n"), progname); } } else if (dry_run) { extern const struct proto_driver null_driver; site->driver = &null_driver; ret = issue_error(site, act, site_update(site)); } else { if (site_open_storage_file(site) == NULL) { printf(_("%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n"), progname, site->infofile, progname, strerror(errno), progname, site->name); ret = -1; } else { current_site = site; upload_total = site->totalchanged + site->totalnew; upload_sofar = 0; ret = issue_error(site, act, site_update(site)); /* hope we don't get signalled here */ current_site = NULL; site_write_stored_state(site); } } break; case action_list: if (listflat) { site_flatlist(stdout, site); } else { list_site_changes(site); if (site->state_method != site->stored_state_method) { printf(_("%s: Warning: Current state method differs from stored in site `%s'.\n%s: All existing files will appear changed (use catchup?).\n"), progname, site->name, progname); } if (site->remote_is_different) { int count = site->numchanged + site->numdeleted + site->nummoved + site->numnew; if (count > 1) { printf(_("%s: The remote site needs updating (%d items to update).\n"), progname, count); } else { printf(_("%s: The remote site needs updating (1 item to update).\n"), progname); } } else { printf(_("%s: The remote site does not need updating.\n"), progname); } } ret = site->remote_is_different?1:0; break; case action_init: site_initialize(site); site_write_stored_state(site); printf(_("%s: All the files and directories are marked as NOT updated remotely.\n"), progname); break; case action_catchup: site_catchup(site); site_write_stored_state(site); printf(_("%s: All the files and and directories are marked as updated remotely.\n"), progname); break; case action_fetch: ret = site_fetch(site); if (ret == SITE_OK) { site_write_stored_state(site); } switch (ret) { case SITE_FAILED: printf(_("%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n"), progname, site->name, progname, site->last_error); ret = -1; break; default: ret = issue_error(site, act, ret); break; } break; case action_verify: ret = site_verify(site, &verify_removed); switch (ret) { case SITE_FAILED: printf(_("%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n"), progname, site->name, progname, site->last_error); ret = -1; break; case SITE_ERRORS: if (verify_removed > 0) { printf(_("%s: Verify found %d files missing from server.\n"), progname, verify_removed); } printf(_("%s: Remote site not synchronized with stored state.\n"), progname); break; default: ret = issue_error(site, act, ret); break; } break; case action_synch: if (!site->local_is_different) { printf(_("%s: Nothing to do - no changes found.\n"), progname); } else if (site->numunchanged == 0 && site->numdeleted == 0 && site->nummoved == 0 && site->numchanged == 0 && site->numignored == 0) { printf(_("%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n"), progname, progname); } else { ret = issue_error(site, act, site_synch(site)); } break; default: printf(_("%s: in act_on_site\n%s"), progname, contact_mntr); ret = -1; break; } return ret; } static void usage(void) { version(); printf(_("Usage: %s [OPTIONS] [MODE] [sitename]...\n"), progname); printf(_("Options: \n")); #ifdef NE_DEBUGGING printf(_( " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" )); #endif printf(_( " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites (default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n")); } /* Two-liner version information. */ static void version(void) { printf(PACKAGE_NAME " " PACKAGE_VERSION ":"); #ifdef USE_FTP printf(" FTP"); #endif /* FTP */ #ifdef USE_DAV printf(" WebDAV"); #endif /* USE_DAV */ #ifdef USE_RSH printf(" rsh/rcp"); #endif /* USE_RSH */ #ifdef USE_SFTP printf(" sftp/ssh"); #endif /* USE_SFTP */ #ifdef NE_DEBUGGING printf(", debugging"); #endif #ifdef __EMX__ printf(", EMX/RSX"); #else #ifdef __CYGWIN__ printf(", cygwin"); #else printf(", Unix"); #endif /* __CYGWIN__ */ #endif /* __EMX__ */ printf(" platform.\n"); } sitecopy-0.16.6/src/sitesi.h0000664000076400007640000001656510355257614014056 0ustar joejoe/* sitecopy, for managing remote web sites. Copyright (C) 1999-2005, Joe Orton This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef SITESI_H #define SITESI_H #include #include "common.h" #include "sites.h" #include "frontend.h" /* for fe_*_abort */ #include "ne_md5.h" /* for ne_md5_* */ /* Internal sites code handling */ void file_uploaded(struct site_file *file, struct site *site); void file_downloaded(struct site_file *file, struct site *site); int file_contents_changed(struct site_file *file, struct site *site); int file_perms_changed(struct site_file *file, struct site *site); #define DEBUG_GIVE_DIFF(diff) \ diff==file_new?"new":( \ diff==file_changed?"changed":( \ diff==file_unchanged?"unchanged":( \ diff==file_deleted?"deleted":"moved"))) /* Macro, used mainly internally to the sites code to dump a file. */ #define DEBUG_DUMP_FILE(ch, file) \ NE_DEBUG(ch, "%s: local=%s stored=%s, %s%s\n", \ (file->type==file_file)?"File":( \ file->type==file_dir?"Dir":"Link"), \ file->local.filename?file->local.filename:".", \ file->stored.filename?file->stored.filename:".", \ DEBUG_GIVE_DIFF(file->diff), \ file->ignore?" (ignored)":"") #define DEBUG_DUMP_FILE_PROPS(ch, file, site) \ DEBUG_DUMP_FILE(ch, file); \ if (site->state_method == state_timesize) { \ NE_DEBUG(ch, "Time: %ld/%ld Size: %" NE_FMT_OFF_T "/%" NE_FMT_OFF_T, \ file->local.time, file->stored.time, \ file->local.size, file->stored.size); \ } else { \ char l[33], s[33]; \ ne_md5_to_ascii(file->local.checksum, l); \ ne_md5_to_ascii(file->stored.checksum, s); \ NE_DEBUG(ch, "Checksum: %32s/%32s\n", l, s); \ } \ NE_DEBUG(ch, "ASCII:%c/%c Perms:%03o/%03o\n", \ file->local.ascii?'y':'n', file->stored.ascii?'y':'n', \ file->local.mode, file->stored.mode ); \ if (file->server.exists) { \ NE_DEBUG(ch, "Server: %ld\n", file->server.time); \ } /* Use to iterate over a files list. */ #define for_each_file(file, site) \ for (file = site->files; file != NULL; file = file->next) /* Remove a file from the files list */ void file_delete(struct site *site, struct site_file *item); /* Destroys a file state */ void file_state_destroy(struct file_state *state); /* Copies a file state from src to dest */ void file_state_copy(struct file_state *dest, const struct file_state *src, struct site *site); /* This *MUST* be called after you change the local or stored state * of a file. It sets the ->diff appropriately, and updates the * site's num* and total* fields. */ void file_set_diff(struct site_file *file, struct site *site); struct site_file * file_find(struct site *site, const char *fname, enum file_type type); struct site_file * file_set_stored(enum file_type type, struct file_state *state, struct site *site); struct site_file * file_set_local(enum file_type type, struct file_state *state, struct site *site); static inline void site_stats_increase(const struct site_file *file, struct site *site); static inline void site_stats_decrease(const struct site_file *file, struct site *site); void site_stats_update(struct site *site); static inline void site_stats_increase(const struct site_file *file, struct site *site) { switch (file->diff) { case file_unchanged: site->numunchanged++; break; case file_changed: if (file->ignore) { site->numignored++; } else { site->numchanged++; site->totalchanged += file->local.size; } break; case file_new: site->numnew++; site->totalnew += file->local.size; break; case file_moved: site->nummoved++; break; case file_deleted: site->numdeleted++; break; default: /* Do nothing */ break; } } static inline void site_stats_decrease(const struct site_file *file, struct site *site) { switch (file->diff) { case file_unchanged: site->numunchanged--; break; case file_changed: if (file->ignore) { site->numignored--; } else { site->numchanged--; site->totalchanged -= file->local.size; } break; case file_new: site->numnew--; site->totalnew -= file->local.size; break; case file_moved: site->nummoved--; break; case file_deleted: site->numdeleted--; break; default: /* Do nothing */ break; } } /* Returns the difference between the local and stored state of the * given file in the given state. * Returns: * file_changed if changed * file_unchanged otherwise */ enum file_diff inline static file_compare(const enum file_type type, const struct file_state *first, const struct file_state *second, const struct site *site) { /* Handle the special cases */ if (!first->exists) return file_deleted; if (!second->exists) return file_new; /* They're both there... compare them properly */ switch (type) { case file_dir: if (site->dirperms) { return (first->mode != second->mode ? file_changed : file_unchanged); } break; case file_link: if (strcmp(first->linktarget, second->linktarget) != 0) { return file_changed; } break; case file_file: switch (site->state_method) { case state_timesize: if ((first->time != second->time) || (first->size!=second->size)) { return file_changed; } break; case state_checksum: if (memcmp(first->checksum, second->checksum, 16) != 0) { return file_changed; } break; } /* Check permissions and ASCIIness. * There's a twist for permissions: if EITHER local or * remote file has an EXEC bit set, then in 'perms exec' mode, * perms are compared. */ if (first->ascii != second->ascii) { return file_changed; } else if (((site->perms == sitep_all) || (((first->mode & S_IXUSR) || (second->mode & S_IXUSR)) && (site->perms == sitep_exec))) && (first->mode != second->mode)) { return file_changed; } if (site->checkmoved && strcmp(first->filename, second->filename)) { return file_moved; } break; } return file_unchanged; } /* Places the checksum of the given filename in the given file state. * The checksum algorithm may in the future be determined from the * site. Returns 0 on success or -1 on error. */ int file_checksum(const char *fname, struct file_state *state, struct site *s); /* Returns whether a file of given name is exclude from the given site */ int file_isexcluded(const char *filename, struct site *site); /* Returns whether a file is ASCII text or binary */ int file_isascii(const char *filename, struct site *site); /* Returns whether a file is ignored or not */ int file_isignored(const char *filename, struct site *site); #endif /* SITESI_H */ sitecopy-0.16.6/src/ftp.c0000664000076400007640000010200110355231645013313 0ustar joejoe/* sitecopy, for managing remote web sites. Generic(ish) FTP routines. Copyright (C) 1998-2005, Joe Orton 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. */ /* This contains an FTP client implementation. * It performs transparent connection management - it it dies, * it will be reconnected automagically. */ #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIMITS_H #include /* for PATH_MAX */ #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include "common.h" #include "frontend.h" #include "ftp.h" #include "protocol.h" #include "i18n.h" #include "lsparser.h" struct ftp_session_s { /* User options */ unsigned int use_passive; unsigned int echo_quit; unsigned int use_cwd; /* CWD before STOR */ int connected; /* true when open */ /* Userdata passed to fe_authenticate call */ void *feauth_userdata; const char *hostname; /* server hostname for fe_login */ /* DTP connection: */ ne_socket *dtpsock; unsigned short dtp_port; ne_inet_addr *dtp_addr; /* PI connection: */ ne_sock_addr *pi_addr; unsigned short pi_port; ne_socket *pisock; const ne_inet_addr *pi_curaddr; /* currently used iaddr */ /* Current file transfor mode. */ enum tran_mode { tran_unknown, /* whatever the server picked */ tran_binary, tran_ascii } mode; enum rfc2428_mode { rfc2428_unknown = 0, /* RFC24248 support unknown */ rfc2428_ok, /* RFC2428 is supported */ rfc2428_bad /* RFC2428 is not supported */ } rfc2428; #ifndef PATH_MAX #define PATH_MAX 2048 #endif /* Stores the current working dir on the remote server */ char cwd[PATH_MAX]; /* time from MDTM response... bit crap having this here. */ time_t get_modtime; /* remember these... we may have to log in more than once. */ char username[FE_LBUFSIZ], password[FE_LBUFSIZ]; unsigned int echo_response:1; /* Reply buffer */ char rbuf[BUFSIZ]; /* Error string */ char error[BUFSIZ]; }; #define FTP_ERR(x) do { \ int _ftp_err = (x); if (_ftp_err != FTP_OK) return _ftp_err; } while (0) /* Sets error string */ static void ftp_seterror(ftp_session *sess, const char *error); /* Opens the data connection */ static int ftp_data_open(ftp_session *sess, const char *command, ...) ne_attribute((format (printf, 2, 3))); static int get_modtime(ftp_session *sess, const char *root, const char *filename); /* Sets session error to system errno value 'errnum'. */ static void set_syserr(ftp_session *sess, const char *error, int errnum) { ne_snprintf(sess->error, sizeof sess->error, "%s: %s", error, strerror(errnum)); NE_DEBUG(DEBUG_FTP, "FTP Error set: %s\n", sess->error); } /* Sets the error string using the error from the given socket. */ static void set_sockerr(ftp_session *sess, const ne_socket *sock, const char *doing, ssize_t errnum) { switch (errnum) { case NE_SOCK_CLOSED: ne_snprintf(sess->error, BUFSIZ, _("%s: connection was closed by server."), doing); break; case NE_SOCK_TIMEOUT: ne_snprintf(sess->error, BUFSIZ, _("%s: connection timed out."), doing); break; default: ne_snprintf(sess->error, BUFSIZ, "%s: %s", doing, ne_sock_error(sock)); break; } NE_DEBUG(DEBUG_FTP, "ftp: Set socket error (%" NE_FMT_SSIZE_T "): %s\n", errnum, sess->error); } /* set_pisockerr must be called to handle any PI socket error to * ensure that the connection can be correctly re-opened later. Pass * DOING as the operation which failed, ERRNUM as the error from the * ne_sock_* layer. */ static void set_pisockerr(ftp_session *sess, const char *doing, ssize_t errnum) { set_sockerr(sess, sess->pisock, doing, errnum); NE_DEBUG(DEBUG_FTP, "PI socket closed: %s\n", sess->error); ne_sock_close(sess->pisock); sess->pisock = NULL; sess->connected = 0; } #define FTP_PI_BROKEN(r) \ ((r) == NE_SOCK_RESET || (r) == NE_SOCK_CLOSED || (r) == NE_SOCK_TIMEOUT) /* Read the reply to an FTP command on the PI connection using given * buffer. Returns FTP_BROKEN if the PI connection has been broken * since the last command was executed. (due to a timeout etc) */ static int read_reply(ftp_session *sess, int *code, char *buf, size_t bufsiz) { int multiline = 0; *code = 0; do { ssize_t ret = ne_sock_readline(sess->pisock, buf, bufsiz-1); if (ret < 0) { set_pisockerr(sess, _("Could not read response line"), ret); return FTP_PI_BROKEN(ret) ? FTP_BROKEN : FTP_ERROR; } buf[ret] = '\0'; NE_DEBUG(DEBUG_FTP, "< %s", buf); if (ret > 4 && isdigit(buf[0]) && isdigit(buf[1]) && isdigit(buf[2])) { *code = atoi(buf); if (multiline == 0 && buf[3] == '-') { /* Begin multiline response. */ multiline = *code; } else if (multiline == *code && buf[3] == ' ') { /* End multiline response. */ multiline = 0; } } } while (multiline); return FTP_OK; } /* Parses the 213 response to a MDTM command... on success, returns * FTP_MODTIME and sets modtime to the time in the response. On * failute, returns FTP_ERROR. */ static int parse_modtime(ftp_session *sess, char *response, time_t *modtime) { struct tm t = {0}; ne_shave(response, "\r\n"); NE_DEBUG(DEBUG_FTP, "Parsing modtime: %s\n", response); if (strlen(response) != 18) { ftp_seterror(sess, _("Cannot parse MDTM response; wrong length.")); return FTP_ERROR; } if (sscanf(response, "213 %4d%2d%2d" "%2d%2d%2d", &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec) < 6) { ftp_seterror(sess, _("Cannot parse MDTM response.")); return FTP_ERROR; } t.tm_year -= 1900; /* years since 1900 */ t.tm_mon -= 1; /* zero-based */ t.tm_isdst = -1; *modtime = mktime(&t); NE_DEBUG(DEBUG_FTP, "Converted to: %s", ctime(modtime)); return FTP_MODTIME; } /* Parses the response to a PASV command. Sets DTP port and address * in session structure. Returns FTP_ERROR on failure. */ static int parse_pasv_reply(ftp_session *sess, char *reply) { unsigned int h1, h2, h3, h4, p1, p2; unsigned char addr[4]; char *start; start = strchr(reply, ' '); if (start == NULL) { ftp_seterror(sess, _("Could not find address in PASV response")); return FTP_ERROR; } while (! isdigit(*start) && (*start != '\0')) start++; /* get the host + port */ if (sscanf(start, "%u,%u,%u,%u,%u,%u", &h1, &h2, &h3, &h4, &p1, &p2) < 6) { ftp_seterror(sess, _("Could not parse PASV response")); return FTP_ERROR; } addr[0] = h1 & 0xff; addr[1] = h2 & 0xff; addr[2] = h3 & 0xff; addr[3] = h4 & 0xff; /* Record this for future reference */ sess->dtp_port = (p1<<8) | p2; sess->dtp_addr = ne_iaddr_make(ne_iaddr_ipv4, addr); if (sess->dtp_addr == NULL) { ftp_seterror(sess, _("Invalid IP address in PASV response")); return FTP_ERROR; } NE_DEBUG(DEBUG_FTP, "ftp: Parsed PASV response, using port %d\n", sess->dtp_port); return FTP_PASSIVE; } /* parse an EPSV reply */ static int parse_epasv_reply(ftp_session *sess, char *reply) { char *ptr = strchr(reply, '('), *eptr; long port; /* reply syntax: "229 fFOO (|||port|)" where | can be any character * in ASCII from 33-126, obscurely. */ if (ptr == NULL || ptr[1] != ptr[2] || ptr[1] != ptr[3] || (eptr = strchr(ptr + 4, ')')) == NULL || eptr == ptr + 4 || eptr[-1] != ptr[1]) { ftp_seterror(sess,_("Malformed EPSV response")); return FTP_ERROR; } eptr[-1] = '\0'; port = strtol(ptr + 4, &eptr, 10); if (*eptr != '\0') { ftp_seterror(sess, _("Malformed port in EPSV response")); return FTP_ERROR; } sess->dtp_addr = (ne_inet_addr *)sess->pi_curaddr; sess->dtp_port = (unsigned short)port; NE_DEBUG(DEBUG_FTP, "ftp: Parsed EPSV response, using port %ld\n", port); return FTP_PASSIVE; } /* Parse a reply of given 'code' (which is pre-parsed). */ static int parse_reply(ftp_session *sess, int code, char *reply) { /* Special case reply parsing: */ switch (code) { case 200: /* misc OK codes */ case 220: case 230: case 250: /* completed file action */ case 253: /* delete successful */ case 257: /* mkdir success */ return FTP_OK; case 226: /* received file okay */ return FTP_SENT; case 150: /* file transfer... ready for data */ case 125: return FTP_READY; case 550: /* couldn't complete file action */ return FTP_FILEBAD; case 331: /* got username, want password */ return FTP_NEEDPASSWORD; case 350: /* file action pending further info - RNFR */ return FTP_FILEMORE; case 221: /* succesful QUIT reseponse. */ return FTP_CLOSED; case 421: /* service denied; PI connection closure */ ne_sock_close(sess->pisock); sess->pisock = NULL; sess->connected = 0; return FTP_BROKEN; case 553: /* couldn't create directory */ return FTP_ERROR; case 213: /* MDTM response, hopefully */ return parse_modtime(sess, reply, &sess->get_modtime); case 227: /* PASV response, hopefully */ return parse_pasv_reply(sess, reply); case 229: /* EPSV response */ return parse_epasv_reply(sess, reply); default: return FTP_ERROR; } } /* Runs FTP command 'cmd', and reads the response. Returns FTP_BROKEN * if the PI connection broke due to timeout etc. execute() should be * used instead of this function for normal FTP commands. */ static int run_command(ftp_session *sess, const char *cmd) { char *line = ne_concat(cmd, "\r\n", NULL); int code, ret; #ifdef NE_DEBUGGING if (strncmp(cmd, "PASS ", 4) == 0 && (ne_debug_mask & NE_DBG_HTTPPLAIN) == 0) { NE_DEBUG(DEBUG_FTP, "> PASS ...\n"); } else { NE_DEBUG(DEBUG_FTP, "> %s\n", cmd); } #endif /* Send the command. */ ret = ne_sock_fullwrite(sess->pisock, line, strlen(line)); free(line); if (ret < 0) { set_pisockerr(sess, "Could not send command", ret); return FTP_PI_BROKEN(ret) ? FTP_BROKEN : FTP_ERROR; } /* Read the response. */ ret = read_reply(sess, &code, sess->rbuf, sizeof sess->rbuf); if (ret != FTP_OK) return ret; /* Set reply as default error string. */ ftp_seterror(sess, sess->rbuf); /* Parse the reply. */ return parse_reply(sess, code, sess->rbuf); } /* Wrapper for run_command: runs an FTP command using printf template * and arguments, handling PI connection timeouts as necessary. */ static int execute(ftp_session *sess, const char *template, ...) { va_list params; int tries = 0, ret; char buf[1024]; va_start(params, template); ne_vsnprintf(buf, sizeof buf, template, params); va_end(params); do { ret = ftp_open(sess); if (ret != FTP_OK) return ret; ret = run_command(sess, buf); } while (ret == FTP_BROKEN && ++tries < 3); /* Don't let FTP_BROKEN get out */ if (ret == FTP_BROKEN) ret = FTP_ERROR; return ret; } /* Dump the given filename down the DTP socket, performing ASCII line * ending translation. Returns zero on success or non-zero on error * (in which case, session error string is set). */ static int send_file_ascii(ftp_session *sess, FILE *f, off_t fsize) { char buffer[BUFSIZ]; off_t total = 0, lasttotal = 0; while (fgets(buffer, BUFSIZ - 1, f) != NULL) { size_t buflen; char *pnt; int ret; pnt = strchr(buffer, '\r'); if (pnt == NULL) pnt = strchr(buffer, '\n'); if (pnt) { *pnt++ = '\r'; *pnt++ = '\n'; buflen = pnt - buffer; } else { /* line with no CRLF. */ buflen = strlen(buffer); } ret = ne_sock_fullwrite(sess->dtpsock, buffer, buflen); if (ret) { set_sockerr(sess, sess->dtpsock, _("Error sending file"), ret); return -1; } total += (pnt - buffer) + 2; /* Only call progress every 4K otherwise it is way too * chatty. */ if (total > lasttotal + 4096) { lasttotal = total; fe_transfer_progress(total, fsize); } } if (ferror(f)) { int errnum = errno; set_syserr(sess, _("Error reading file"), errnum); return -1; } return 0; } /* Send file 'f' (of size 'size') down DTP socket. */ static int send_file_binary(ftp_session *sess, FILE *f, off_t size) { char buffer[BUFSIZ]; size_t ret; off_t total = 0; while ((ret = fread(buffer, 1, sizeof buffer, f)) > 0) { int rv = ne_sock_fullwrite(sess->dtpsock, buffer, ret); if (rv) { set_sockerr(sess, sess->dtpsock, _("Could not send file"), rv); return -1; } total += ret; fe_transfer_progress(total, size); } if (ferror(f)) { int errnum = errno; set_syserr(sess, _("Error reading file"), errnum); return -1; } return 0; } /* Dump from given socket into given file. Returns number of bytes * written on success, or -1 on error (session error string is * set). */ static int receive_file(ftp_session *sess, FILE *f) { ssize_t bytes; off_t count = 0; char buffer[BUFSIZ]; while ((bytes = ne_sock_read(sess->dtpsock, buffer, BUFSIZ)) > 0) { count += bytes; fe_transfer_progress(count, -1); if (fwrite(buffer, 1, bytes, f) < (size_t)bytes) { int errnum = errno; set_syserr(sess, _("Error writing to file"), errnum); return -1; } } if (bytes < 0 && bytes != NE_SOCK_CLOSED) { set_sockerr(sess, sess->dtpsock, _("Receiving file"), bytes); return -1; } return 0; } /* Passively (client-connects) open the DTP socket ; return non-zero * on success. */ static int dtp_open_passive(ftp_session *sess) { int ret; sess->dtpsock = ne_sock_create(); ret = ne_sock_connect(sess->dtpsock, sess->dtp_addr, sess->dtp_port); if (ret) { set_sockerr(sess, sess->dtpsock, _("Could not connect passive data socket"), ret); ne_sock_close(sess->dtpsock); return 0; } else { return 1; } } /* Initializes the driver + connection. * Returns FTP_OK on success, or FTP_LOOKUP if the hostname * could not be resolved. */ ftp_session *ftp_init(void) { ftp_session *sess = ne_calloc(sizeof(ftp_session)); sess->connected = 0; sess->mode = tran_unknown; return sess; } void ftp_set_passive(ftp_session *sess, int use_passive) { sess->use_passive = use_passive; } void ftp_set_usecwd(ftp_session *sess, int use_cwd) { sess->use_cwd = use_cwd; } int ftp_set_server(ftp_session *sess, struct site_host *server) { if (server->username) { strcpy(sess->username, server->username); } if (server->password) { strcpy(sess->password, server->password); } sess->hostname = server->hostname; sess->pi_port = server->port; fe_connection(fe_namelookup, server->hostname); sess->pi_addr = ne_addr_resolve(server->hostname, 0); if (ne_addr_result(sess->pi_addr)) { char buf[256]; ne_snprintf(sess->error, sizeof sess->error, "Could not resolve server `%s': %s", server->hostname, ne_addr_error(sess->pi_addr, buf, sizeof buf)); return FTP_LOOKUP; } return FTP_OK; } /* Cleans up and closes the control connection. * Returns FTP_OK if the connection is closed, else FTP_ERROR; */ int ftp_finish(ftp_session *sess) { int ret = FTP_OK; int old_er = sess->echo_response; if (sess->connected) { sess->echo_response = sess->echo_quit; if (run_command(sess, "QUIT") != FTP_CLOSED) { ret = FTP_ERROR; } if (sess->pisock) ne_sock_close(sess->pisock); sess->connected = 0; sess->echo_response = old_er; } return ret; } /* Creates the given directory * FTP state response */ int ftp_mkdir(ftp_session *sess, const char *dir) { return execute(sess, "MKD %s", dir); } /* Renames or moves a file */ int ftp_move(ftp_session *sess, const char *from, const char *to) { if (execute(sess, "RNFR %s", from) == FTP_FILEMORE) { return execute(sess, "RNTO %s", to); } return FTP_ERROR; } int ftp_delete(ftp_session *sess, const char *filename) { return execute(sess, "DELE %s", filename); } int ftp_rmdir(ftp_session *sess, const char *filename) { return execute(sess, "RMD %s", filename); } /* Actively open the data connection, running command COMMAND; the * client then listens for and accepts the connection from the server. * On successful return, the DTP connection is open. */ static int dtp_open_active(ftp_session *sess, const char *command) { char *a, *p; int ret; int listener; ksize_t alen; struct sockaddr_in addr; ret = ftp_open(sess); if (ret != FTP_OK) return ret; alen = sizeof(addr); if (getsockname(ne_sock_fd(sess->pisock), (struct sockaddr *)&addr, &alen) < 0) { int errnum = errno; set_syserr(sess, _("Active open failed: could not determine " "address of control socket"), errnum); return FTP_ERROR; } /* Let the kernel choose a port */ addr.sin_port = 0; /* Create a local socket to accept the connection on */ listener = socket(AF_INET, SOCK_STREAM, 0); if (listener < 0) { int errnum = errno; set_syserr(sess, _("Active open failed: could not create socket"), errnum); return FTP_ERROR; } /* Bind it to an address. */ if (bind(listener, (struct sockaddr *)&addr, sizeof(addr)) < 0) { int errnum = errno; set_syserr(sess, _("Active open failed: could not bind to address"), errnum); (void) close(listener); return FTP_ERROR; } /* Retrieve the address again; determine which port was chosen. */ alen = sizeof(addr); if (getsockname(listener, (struct sockaddr *)&addr, &alen) < 0) { int errnum = errno; set_syserr(sess, _("Active open failed: could not determine address " "of data socket"), errnum); (void) close(listener); return FTP_ERROR; } if (addr.sin_port == 0) { ftp_seterror(sess, _("Could not determine bound port number for " "data socket")); close(listener); return FTP_ERROR; } if (listen(listener, 1) < 0) { int errnum = errno; set_syserr(sess, ("Active open failed: could not listen for " "connection"), errnum); (void) close(listener); return FTP_ERROR; } #define UC(b) (((int)b)&0xff) a = (char *)&addr.sin_addr.s_addr; p = (char *)&addr.sin_port; /* Execute the PORT command */ ret = execute(sess, "PORT %d,%d,%d,%d,%d,%d", UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]), UC(p[0]), UC(p[1])); if (ret != FTP_OK) { /* Failed to execute the PORT command - close the socket */ NE_DEBUG(DEBUG_FTP, "PORT command failed.\n"); close(listener); return ret; } /* Send the command. This will make the remote end * initiate the connection. */ ret = execute(sess, "%s", command); /* Do they want it? */ if (ret != FTP_READY) { NE_DEBUG(DEBUG_FTP, "Command failed.\n"); } else { /* Now wait for a connection from the remote end. */ sess->dtpsock = ne_sock_create(); if (ne_sock_accept(sess->dtpsock, listener)) { int errnum = errno; set_syserr(sess, _("Active open failed: could not accept connection"), errnum); ne_sock_close(sess->dtpsock); ret = FTP_ERROR; } } (void) close(listener); return ret; } int ftp_chmod(ftp_session *sess, const char *filename, const mode_t mode) { return execute(sess, "SITE CHMOD %03o %s", mode & 0777, filename); } /* default to always trying EPSV if using neon 0.24, which shouldn't * hurt too much since it falls back on PASV on failure anyway. */ #if NE_VERSION_MINOR == 24 #define ne_iaddr_typeof(ia) (ne_iaddr_ipv6) #endif /* Open the DATA connection using whichever means appropriate, running * FTP command COMMAND with printf-style arguments. */ static int ftp_data_open(ftp_session *sess, const char *command, ...) { int ret; va_list params; char buf[BUFSIZ]; va_start(params, command); ne_vsnprintf(buf, BUFSIZ, command, params); va_end(params); if (sess->use_passive) { ret = FTP_ERROR; if (sess->rfc2428 != rfc2428_bad && ne_iaddr_typeof(sess->pi_curaddr) == ne_iaddr_ipv6) { ret = execute(sess, "EPSV"); if (ret == FTP_PASSIVE) sess->rfc2428 = rfc2428_ok; } if ((sess->rfc2428 == rfc2428_unknown && ret != FTP_PASSIVE) || sess->rfc2428 == rfc2428_bad) { ret = execute(sess, "PASV"); } if (ret == FTP_PASSIVE) { if (dtp_open_passive(sess)) { return execute(sess, "%s", buf); } else { return FTP_ERROR; } } else { return FTP_NOPASSIVE; } } else { /* we are not using passive mode. */ return dtp_open_active(sess, buf); } } /* Closes the data connection. If 'discard' is non-zero any error * string is discarded; otherwise the session error is set. */ static int dtp_close(ftp_session *sess, int discard) { /* Read the response line */ int ret; NE_DEBUG(DEBUG_FTP, "Closing DTP connection...\n"); ret = ne_sock_close(sess->dtpsock); if (ret < 0) { int errnum = errno; if (!discard) set_syserr(sess, _("Error closing data socket"), errnum); return FTP_ERROR; } else { int code; ret = read_reply(sess, &code, sess->rbuf, sizeof sess->rbuf); if (ret != FTP_OK) return ret; ret = parse_reply(sess, code, sess->rbuf); if (ret == FTP_OK || ret == FTP_SENT) return FTP_SENT; else { if (!discard) ftp_seterror(sess, sess->rbuf); return FTP_ERROR; } } } /* Set the transfer type appropriately. * Only set it if it *needs* setting, though. * Returns FTP_OK on success, or something else otherwise. */ static int set_mode(ftp_session *sess, enum tran_mode mode) { int ret; if (sess->mode == mode) return FTP_OK; ret = execute(sess, mode==tran_ascii?"TYPE A":"TYPE I"); if (ret == FTP_OK) sess->mode = mode; else sess->mode = tran_unknown; return ret; } /* Change dir before uploading if necessary; some servers (notably * some version of ProFTPD) will reject a STOR if it is not in the * CWD. *remotefile is updated to be the filename relative to the * working directory. * * 5, 7 Apr 2002, Volker Kuhlmann */ static int maybe_chdir(ftp_session *sess, const char **remotefile) { int ret; const char *slash, *fn = *remotefile; char dir[PATH_MAX]; if (!sess->use_cwd || fn[0] != '/' || strlen(fn) > PATH_MAX) return FTP_OK; slash = strrchr(fn, '/'); /* can't be NULL since fn[0] == '/'. */ *remotefile = slash + 1; ne_strnzcpy(dir, fn, 1 + slash - fn); if (strcmp(dir, sess->cwd)) { ret = execute(sess, "CWD %s", dir); if (ret == FTP_OK) { NE_DEBUG(DEBUG_FTP, "Stored new CWD as %s\n", dir); strcpy(sess->cwd, dir); } } else { NE_DEBUG(DEBUG_FTP, "CWD not needed.\n"); ret = FTP_OK; } return ret; } /* upload the given file */ int ftp_put(ftp_session *sess, const char *localfile, const char *remotefile, int ascii) { int ret; struct stat st; FILE *f; int tries = 0, dret; /* Set the transfer type correctly */ if (set_mode(sess, ascii?tran_ascii:tran_binary)) return FTP_ERROR; f = fopen(localfile, "r" FOPEN_BINARY_FLAGS); if (f == NULL) { int errnum = errno; set_syserr(sess, _("Could not open file"), errnum); return FTP_ERROR; } if (fstat(fileno(f), &st) < 0) { int errnum = errno; set_syserr(sess, _("Could not determine length of file"), errnum); fclose(f); return FTP_ERROR; } do { /* Rewind the file pointer for attempts other than the * first: */ if (tries && fseek(f, 0, SEEK_SET) < 0) { int errnum = errno; set_syserr(sess, _("Could not rewind to beginning of file"), errnum); break; } ret = maybe_chdir(sess, &remotefile); if (ret != FTP_OK) { fclose(f); return ret; } ret = ftp_data_open(sess, "STOR %s", remotefile); if (ret == FTP_READY) { if (ascii) ret = send_file_ascii(sess, f, st.st_size); else ret = send_file_binary(sess, f, st.st_size); /* Now close the DTP connection and read the response. */ dret = dtp_close(sess, 0); if (dret == FTP_SENT && ret == 0) { fclose(f); return FTP_OK; } } else { /* ftp_data_open() will already have retried as necessary * so don't retry it again here if that was all that * failed. */ dret = FTP_ERROR; } } while (dret == FTP_BROKEN && ++tries < 3); fclose(f); return FTP_ERROR; } /* Conditionally upload the given file */ int ftp_put_cond(ftp_session *sess, const char *localfile, const char *remotefile, int ascii, const time_t mtime) { int ret; ret = get_modtime(sess, remotefile, ""); if (ret != FTP_OK) { return ret; } /* Is the retrieved time different from the given time? */ if (sess->get_modtime != mtime) { return FTP_FAILED; } /* Do a normal upload */ return ftp_put(sess, localfile, remotefile, ascii); } /* Slightly dodgy ftp_get in that you need to know the remote file * size. Works, but not very generic. */ int ftp_get(ftp_session *sess, const char *localfile, const char *remotefile, int ascii) { int ret; FILE *f = fopen(localfile, "wb"); if (f == NULL) { int errnum = errno; set_syserr(sess, _("Could not open file"), errnum); return FTP_ERROR; } if (set_mode(sess, ascii?tran_ascii:tran_binary)) return FTP_ERROR; if (ftp_data_open(sess, "RETR %s", remotefile) == FTP_READY) { int clo, errnum = 0; /* Receive the file */ ret = receive_file(sess, f); clo = fclose(f); if (clo) errnum = errno; if (dtp_close(sess, 0) == FTP_SENT && ret == 0 && clo == 0) { /* Success! */ return FTP_OK; } else if (clo) { set_syserr(sess, _("Error writing to file"), errnum); } } return FTP_ERROR; } int ftp_read_file(ftp_session *sess, const char *remotefile, ne_block_reader reader, void *userdata) { ssize_t ret; /* Always use binary mode */ if (set_mode(sess, tran_binary)) return FTP_ERROR; if (ftp_data_open(sess, "RETR %s", remotefile) == FTP_READY) { char buffer[BUFSIZ]; while ((ret = ne_sock_read(sess->dtpsock, buffer, sizeof buffer)) > 0) reader(userdata, buffer, ret); if ((dtp_close(sess, 0) == FTP_SENT) && (ret == NE_SOCK_CLOSED)) { return FTP_OK; } } return FTP_ERROR; } /* Log in to the server. This routine *cannot* use execute() to * prevent recursion; if the connection times out during * authentication then that is a fatal error. */ static int authenticate(ftp_session *sess) { int ret; char buf[1024]; /* Fetch creds from user if necessary. */ if (strlen(sess->username) == 0 || strlen(sess->password) == 0) { if (fe_login(fe_login_server, NULL, sess->hostname, sess->username, sess->password)) return FTP_ERROR; } NE_DEBUG(DEBUG_FTP, "FTP: Sending 'USER %s':\n", sess->username); ne_snprintf(buf, sizeof buf, "USER %s", sess->username); ret = run_command(sess, buf); if (ret == FTP_NEEDPASSWORD) { NE_DEBUG(DEBUG_FTP, "FTP: Sending PASS command...\n"); ne_snprintf(buf, sizeof buf, "PASS %s", sess->password); ret = run_command(sess, buf); } return ret; } int ftp_open(ftp_session *sess) { int ret, code, success; const ne_inet_addr *ia; if (sess->connected) return FTP_OK; NE_DEBUG(DEBUG_FTP, "Opening socket to port %d\n", sess->pi_port); /* Invalidate cwd, so a CWD is always used if needed (valid cwds * must begin with a slash. */ strcpy(sess->cwd, "x"); /* Open TCP connection */ fe_connection(fe_connecting, NULL); sess->pisock = ne_sock_create(); for (ia = ne_addr_first(sess->pi_addr), success = 0; !success && ia != NULL; ia = ne_addr_next(sess->pi_addr)) { success = ne_sock_connect(sess->pisock, ia, sess->pi_port) == 0; sess->pi_curaddr = ia; } if (!success) { ne_sock_close(sess->pisock); return FTP_CONNECT; } fe_connection(fe_connected, NULL); /* Read the hello message */ ret = read_reply(sess, &code, sess->rbuf, sizeof sess->rbuf); if (ret != FTP_OK) return FTP_HELLO; ret = parse_reply(sess, code, sess->rbuf); if (ret != FTP_OK) { ftp_seterror(sess, sess->rbuf); return FTP_HELLO; } if (authenticate(sess) != FTP_OK) { if (sess->connected) { ne_sock_close(sess->pisock); sess->pisock = NULL; } return FTP_LOGIN; } /* PI connection OK. */ sess->connected = 1; /* Restore previous transfer mode; set mode to unknown for the * duration to avoid infinite recusion (since set_mode calls * execute_command calls ftp_open) . */ if (sess->mode != tran_unknown) { enum tran_mode mode = sess->mode; sess->mode = tran_unknown; return set_mode(sess, mode); } return FTP_OK; } void ftp_seterror(ftp_session *sess, const char *error) { memset(sess->error, 0, BUFSIZ); strncpy(sess->error, error, BUFSIZ); } const char *ftp_get_error(ftp_session *sess) { return sess->error; } int ftp_fetch(ftp_session *sess, const char *startdir, struct proto_file **list) { struct proto_file *tail = NULL; struct ls_context *lsctx; int ret; if ((ret = ftp_data_open(sess, "LIST -la %s", startdir)) != FTP_READY) { return FTP_ERROR; } lsctx = ls_init(startdir); ret = FTP_OK; do { enum ls_result lsrv; struct ls_file lfile; ssize_t len; len = ne_sock_readline(sess->dtpsock, sess->rbuf, BUFSIZ); if (len == NE_SOCK_CLOSED) { NE_DEBUG(DEBUG_FTP, "ftp: EOF from DTP connection.\n"); break; } if (len < 0) { set_sockerr(sess, sess->dtpsock, _("Could not read 'LIST' response."), len); ret = FTP_ERROR; break; } lsrv = ls_parse(lsctx, sess->rbuf, &lfile); if (lsrv == ls_error) { char err[512]; ne_snprintf(err, sizeof err, _("Parse error in LIST response: %s"), ls_geterror(lsctx)); NE_DEBUG(DEBUG_FTP, "ftp: ls_parse error, aborting.\n"); ftp_seterror(sess, err); ret = FTP_ERROR; } else { ls_pflist_add(list, &tail, &lfile, lsrv); } } while (ret == FTP_OK); ls_destroy(lsctx); NE_DEBUG(DEBUG_FTP, "ftp: Fetch finished with %d.\n", ret); if (ret == FTP_OK) { return dtp_close(sess, 0) == FTP_SENT ? FTP_OK : FTP_ERROR; } else { dtp_close(sess, 1); /* ignore retval */ return ret; } } static int get_modtime(ftp_session *sess, const char *root, const char *filename) { NE_DEBUG(DEBUG_FTP, "Getting modtime.\n"); if (execute(sess, "MDTM %s%s", root, filename) == FTP_MODTIME) { NE_DEBUG(DEBUG_FTP, "Got modtime.\n"); return FTP_OK; } else { return FTP_ERROR; } } int ftp_get_modtime(ftp_session *sess, const char *filename, time_t *modtime) { if (get_modtime(sess, filename, "") == FTP_OK) { *modtime = sess->get_modtime; return FTP_OK; } else { *modtime = -1; return FTP_ERROR; } } /* Sorts out the modtimes for all the files in the list. * Returns FTP_OK on success, else FTP_ERROR. */ int ftp_fetch_modtimes(ftp_session *sess, const char *rootdir, struct proto_file *files) { struct proto_file *this_file; for (this_file=files; this_file!=NULL; this_file=this_file->next) { if (this_file->type != proto_file) { continue; } NE_DEBUG(DEBUG_FTP, "File: %s%s\n", rootdir, this_file->filename); if (get_modtime(sess, rootdir, this_file->filename) == FTP_OK) { this_file->modtime = sess->get_modtime; } else { NE_DEBUG(DEBUG_FTP, "Didn't get modtime.\n"); return FTP_ERROR; } } NE_DEBUG(DEBUG_FTP, "Walk finished ok.\n"); return FTP_OK; } sitecopy-0.16.6/src/davdriver.c0000664000076400007640000005043411037463344014525 0ustar joejoe/* sitecopy WebDAV protocol driver module Copyright (C) 2000-2008, Joe Orton 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. */ #include "config.h" #include #include /* For S_IXUSR */ #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include "common.h" /* for strerror */ #include #include #include #include #include #include #include #include #include #include "protocol.h" #include "frontend.h" #include "i18n.h" #include "common.h" struct fetch_context { struct proto_file **files; struct proto_file *tail; const char *root; }; #define ENABLE_PROGRESS do { ne_set_progress(sess, site_sock_progress_cb, NULL); } while (0) #if NE_VERSION_MAJOR == 0 && NE_VERSION_MINOR > 26 #define DISABLE_PROGRESS do { ne_set_notifier(sess, NULL, NULL); } while (0) #else #define DISABLE_PROGRESS do { ne_set_progress(sess, NULL, NULL); } while (0) #endif /* TODO: * not really sure whether we should be using an enum here... what * should the client do with resourcetypes it doesn't understand? * ignore them, or presume they have the same semantics as "normal" * resources. I really don't know. */ struct private { int iscollection; }; #define ELM_resourcetype (NE_PROPS_STATE_TOP + 1) #define ELM_collection (NE_PROPS_STATE_TOP + 2) /* The element definitions for the complex prop handler. */ static const struct ne_xml_idmap fetch_elms[] = { { "DAV:", "resourcetype", ELM_resourcetype }, { "DAV:", "collection", ELM_collection }, }; static const ne_propname props[] = { { "DAV:", "getcontentlength" }, { "DAV:", "getlastmodified" }, { "http://apache.org/dav/props/", "executable" }, { "DAV:", "resourcetype" }, { NULL } }; /* Set session error string to 'msg: strerror(errnum)'. */ static void syserr(ne_session *sess, const char *msg, int errnum) { char err[256]; ne_set_error(sess, "%s: %s", msg, ne_strerror(errnum, err, sizeof err)); } static int get_server_port(struct site *site) { return site->http_secure ? 443 : 80; } static int get_proxy_port(struct site *site) { return 8080; } static int auth_common(void *userdata, fe_login_context ctx, const char *realm, int attempt, char *username, char *password) { struct site_host *host = userdata; if (host->username && host->password) { strcpy(username, host->username); strcpy(password, host->password); return attempt; } else { return fe_login(ctx, realm, host->hostname, username, password); } } static int server_auth_cb(void *userdata, const char *realm, int attempt, char *username, char *password) { return auth_common(userdata, fe_login_server, realm, attempt, username, password); } static int proxy_auth_cb(void *userdata, const char *realm, int attempt, char *username, char *password) { return auth_common(userdata, fe_login_proxy, realm, attempt, username, password); } #if NE_VERSION_MINOR < 27 static void notify_cb(void *userdata, ne_conn_status status, const char *info) { #define MAP(a) case ne_conn_##a: fe_connection(fe_##a, info); break switch (status) { MAP(namelookup); MAP(connecting); MAP(connected); default: break; } #undef MAP } #else static void notify_status(void *userdata, ne_session_status status, const ne_session_status_info *info) { switch (status) { case ne_status_lookup: fe_connection(fe_namelookup, info->lu.hostname); break; case ne_status_connecting: fe_connection(fe_connecting, NULL); break; case ne_status_connected: fe_connection(fe_connected, NULL); break; default: break; } } #endif static int h2s(ne_session *sess, int errcode) { switch (errcode) { case NE_OK: return SITE_OK; case NE_AUTH: return SITE_AUTH; case NE_PROXYAUTH: return SITE_PROXYAUTH; case NE_FAILED: return SITE_FAILED; case NE_CONNECT: return SITE_CONNECT; case NE_LOOKUP: return SITE_LOOKUP; case NE_TIMEOUT: ne_set_error(sess, _("The connection timed out.")); return SITE_ERRORS; case NE_ERROR: default: return SITE_ERRORS; } } /* Callback invoked when SSL server cert verification fails. */ static int verify_certificate(void *userdata, int failures, const ne_ssl_certificate *cert) { struct site *site = userdata; /* If the server cert has not changed since the user accepted it, * trust the cert, unless it has expired, in which case the user * should get a warning. */ if (site->server_cert && ne_ssl_cert_cmp(cert, site->server_cert) == 0 && (failures & NE_SSL_EXPIRED) == 0) { return 0; } if (fe_accept_cert(cert, failures)) { /* Not accepted by user => fail verification. */ return -1; } if (ne_ssl_cert_write(cert, site->certfile)) { fe_warning(_("Could not write SSL certificate"), NULL, site->certfile); } return 0; } static int init(void **session, struct site *site) { ne_session *sess; ne_server_capabilities caps = {0}; int ret; char *root; sess = ne_session_create(site->http_secure?"https":"http", site->server.hostname, site->server.port); *session = sess; if (site->http_secure && !ne_has_support(NE_FEATURE_SSL)) { ne_set_error(sess, _("SSL support has not be compiled in.")); return SITE_FAILED; } if (site->http_secure) { if (access(site->certfile, R_OK) == 0) { site->server_cert = ne_ssl_cert_read(site->certfile); if (site->server_cert == NULL) { ne_set_error(sess, _("Could not load certificate `%s'."), site->certfile); return SITE_FAILED; } } ne_ssl_set_verify(sess, verify_certificate, site); } #if NE_VERSION_MINOR < 27 ne_set_status(sess, notify_cb, NULL); #else ne_set_notifier(sess, notify_status, NULL); #endif if (site->http_limit) { #if NE_VERSION_MINOR > 25 ne_set_session_flag(sess, NE_SESSFLAG_PERSIST, 0); #else ne_set_persist(sess, 0); #endif } /* Note, this won't differentiate between xsitecopy and * sitecopy... maybe we should put a comment in as well. */ ne_set_useragent(sess, PACKAGE_NAME "/" PACKAGE_VERSION); if (site->proxy.hostname) { ne_set_proxy_auth(sess, proxy_auth_cb, &site->proxy); ne_session_proxy(sess, site->proxy.hostname, site->proxy.port); } ne_set_server_auth(sess, server_auth_cb, &site->server); if (site->http_secure && site->client_cert) { ne_ssl_client_cert *cc; cc = ne_ssl_clicert_read(site->client_cert); if (!cc) { ne_set_error(sess, _("Could not read SSL client certificate '%s'."), site->client_cert); return SITE_FAILED; } if (ne_ssl_clicert_encrypted(cc)) { char password[FE_LBUFSIZ]; if (fe_decrypt_clicert(cc, password)) { return SITE_FAILED; } if (ne_ssl_clicert_decrypt(cc, password) != 0) { ne_set_error(sess, _("Could not decrypt SSL client " "certificate '%s'."), site->client_cert); return SITE_FAILED; } } ne_ssl_set_clicert(sess, cc); ne_ssl_clicert_free(cc); } if (site->http_tolerant) { /* Skip the OPTIONS, since we ignore failure anyway. */ return SITE_OK; } root = ne_path_escape(site->remote_root); ret = ne_options(sess, root, &caps); ne_free(root); if (ret == NE_OK) { if (!caps.dav_class1) { ne_set_error(sess, _("The server does not appear to be a WebDAV server.")); return SITE_FAILED; } else if (site->perms != sitep_ignore && !caps.dav_executable) { /* Need to set permissions, but the server can't do that */ ne_set_error(sess, _("The server does not support the executable live property.")); return SITE_FAILED; } } else { ret = h2s(sess, ret); if (ret == SITE_ERRORS) ret = SITE_FAILED; return ret; } return SITE_OK; } static void finish(void *session) { ne_session *sess = session; ne_session_destroy(sess); } static int file_move(void *session, const char *from, const char *to) { ne_session *sess = session; char *efrom, *eto; int ret; efrom = ne_path_escape(from); eto = ne_path_escape(to); /* Always overwrite destination. */ ret = ne_move(sess, 1, efrom, eto); free(efrom); free(eto); return h2s(sess, ret); } static int file_upload(void *session, const char *local, const char *remote, int ascii) { int ret, fd = open(local, O_RDONLY | OPEN_BINARY_FLAGS); ne_session *sess = session; char *eremote; if (fd < 0) { syserr(sess, _("Could not open file"), errno); return SITE_ERRORS; } eremote = ne_path_escape(remote); ENABLE_PROGRESS; ret = ne_put(sess, eremote, fd); DISABLE_PROGRESS; free(eremote); (void) close(fd); return h2s(sess, ret); } /* conditional PUT using If-Unmodified-Since. */ static int put_if_unmodified(ne_session *sess, const char *uri, int fd, time_t since) { ne_request *req = ne_request_create(sess, "PUT", uri); char *date = ne_rfc1123_date(since); int ret; /* Add in the conditional header */ ne_add_request_header(req, "If-Unmodified-Since", date); ne_free(date); #if NE_VERSION_MINOR == 24 ne_set_request_body_fd(req, fd); #else { struct stat st; if (fstat(fd, &st) < 0) { int errnum = errno; ne_set_error(sess, _("Could not stat file: %s"), strerror(errnum)); return NE_ERROR; } ne_set_request_body_fd(req, fd, 0, st.st_size); } #endif ret = ne_request_dispatch(req); if (ret == NE_OK) { if (ne_get_status(req)->code == 412) { ret = NE_FAILED; } else if (ne_get_status(req)->klass != 2) { ret = NE_ERROR; } } ne_request_destroy(req); return ret; } static int file_upload_cond(void *session, const char *local, const char *remote, int ascii, time_t t) { ne_session *sess = session; int ret, fd = open(local, O_RDONLY | OPEN_BINARY_FLAGS); char *eremote; if (fd < 0) { syserr(sess, _("Could not open file"), errno); return SITE_ERRORS; } eremote = ne_path_escape(remote); ENABLE_PROGRESS; ret = h2s(sess, put_if_unmodified(sess, eremote, fd, t)); DISABLE_PROGRESS; free(eremote); (void) close(fd); return ret; } static int file_get_modtime(void *session, const char *remote, time_t *modtime) { ne_session *sess = session; int ret; char *eremote; eremote = ne_path_escape(remote); ret = ne_getmodtime(sess,eremote,modtime); free(eremote); return h2s(sess, ret); } static int file_download(void *session, const char *local, const char *remote, int ascii) { ne_session *sess = session; int ret, fd = open(local, O_TRUNC | O_CREAT | O_WRONLY | OPEN_BINARY_FLAGS, 0644); char *eremote; if (fd < 0) { syserr(sess, _("Could not open file"), errno); return SITE_ERRORS; } eremote = ne_path_escape(remote); ENABLE_PROGRESS; ret = h2s(sess, ne_get(sess, eremote, fd)); DISABLE_PROGRESS; free(eremote); if (close(fd)) { ret = SITE_ERRORS; } return ret; } static int file_read(void *session, const char *remote, ne_block_reader reader, void *userdata) { ne_session *sess = session; int ret; char *eremote; ssize_t bytes; ne_request *req; eremote = ne_path_escape(remote); req = ne_request_create(sess, "GET", eremote); ENABLE_PROGRESS; do { char buf[BUFSIZ]; ret = ne_begin_request(req); if (ret != NE_OK) break; while ((bytes = ne_read_response_block(req, buf, sizeof buf)) > 0) reader(userdata, buf, bytes); if (bytes < 0) ret = NE_ERROR; else ret = ne_end_request(req); } while (ret == NE_RETRY); DISABLE_PROGRESS; free(eremote); return h2s(sess, ret); } static int file_delete(void *session, const char *remote) { ne_session *sess = session; char *eremote = ne_path_escape(remote); int ret = ne_delete(sess, eremote); free(eremote); return h2s(sess, ret); } static int file_chmod(void *session, const char *remote, mode_t mode) { ne_session *sess = session; static const ne_propname execprop = { "http://apache.org/dav/props/", "executable" }; /* Use a single operation; set the executable property to... */ ne_proppatch_operation ops[] = { { &execprop, ne_propset, NULL }, { NULL } }; char *eremote = ne_path_escape(remote); int ret; /* True or false, depending... */ if (mode & S_IXUSR) { ops[0].value = "T"; } else { ops[0].value = "F"; } ret = ne_proppatch(sess, eremote, ops); free(eremote); return h2s(sess, ret); } /* Returns escaped path string for a directory. */ static char *coll_escape(const char *dirname) { char *ret = ne_path_escape(dirname); if (!ne_path_has_trailing_slash(ret)) { ret = ne_realloc(ret, strlen(ret) + 2); strcat(ret, "/"); } return ret; } static int dir_create(void *session, const char *dirname) { ne_session *sess = session; char *edirname = coll_escape(dirname); int ret = ne_mkcol(sess, edirname); free(edirname); return h2s(sess, ret); } /* TODO: check whether it is empty first */ static int dir_remove(void *session, const char *dirname) { ne_session *sess = session; char *edirname = coll_escape(dirname); int ret = ne_delete(sess, edirname); free(edirname); return h2s(sess, ret); } /* Insert the file in the list in the appropriate position (keeping it * sorted). */ static void insert_file(struct fetch_context *ctx, struct proto_file *file) { if (ctx->tail) { ctx->tail->next = file; } else { (*ctx->files) = file; } ctx->tail = file; file->next = NULL; } #if NE_VERSION_MINOR > 25 static void pfind_results(void *userdata, const ne_uri *uri, const ne_prop_result_set *set) #else static void pfind_results(void *userdata, const char *href, const ne_prop_result_set *set) #endif { struct fetch_context *ctx = userdata; struct private *private = ne_propset_private(set); const char *clength = NULL, *modtime = NULL, *isexec = NULL; struct proto_file *file; int iscoll; char *uhref; iscoll = private->iscollection; #if NE_VERSION_MINOR < 26 /* For >= 0.26, this is handled by the destroy_private * callback. */ ne_free(private); #endif #if NE_VERSION_MINOR < 26 /* Strip down to the abspath segment */ if (strncmp(href, "http://", 7) == 0) href = strchr(href+7, '/'); if (strncmp(href, "https://", 8) == 0) href = strchr(href+8, '/'); if (href == NULL) { NE_DEBUG(NE_DBG_HTTP, "invalid!\n"); return; } uhref = ne_path_unescape(href); #else uhref = ne_path_unescape(uri->path); #endif NE_DEBUG(NE_DBG_HTTP, "URI: [%s]: ", uhref); if (!ne_path_childof(ctx->root, uhref)) { /* URI not a child of the root collection... ignore this * resource */ NE_DEBUG(NE_DBG_HTTP, "not child of root collection!\n"); return; } NE_DEBUG(NE_DBG_HTTP, "okay.\n"); if (!iscoll) { const ne_status *status = NULL; clength = ne_propset_value(set, &props[0]); modtime = ne_propset_value(set, &props[1]); isexec = ne_propset_value(set, &props[2]); if (clength == NULL) status = ne_propset_status(set, &props[0]); if (modtime == NULL) status = ne_propset_status(set, &props[1]); if (clength == NULL || modtime == NULL) { fe_warning(_("Could not access resource"), uhref, status?status->reason_phrase:NULL); return; } } file = ne_calloc(sizeof(struct proto_file)); file->filename = ne_strdup(uhref+strlen(ctx->root)); if (iscoll) { file->type = proto_dir; /* Strip the trailing slash if it has one. */ if (ne_path_has_trailing_slash(file->filename)) { file->filename[strlen(file->filename) - 1] = '\0'; } } else { file->type = proto_file; file->size = atoi(clength); file->modtime = modtime?ne_httpdate_parse(modtime):0; if (isexec && strcasecmp(isexec, "T") == 0) { file->mode = 0755; } else { file->mode = 0644; } } /* Insert the file into the files list. */ insert_file(ctx, file); } static int start_element(void *userdata, int parent, const char *nspace, const char *name, const char **atts) { ne_propfind_handler *handler = userdata; struct private *priv = ne_propfind_current_private(handler); int state; state = ne_xml_mapid(fetch_elms, NE_XML_MAPLEN(fetch_elms), nspace, name); if (parent == NE_207_STATE_PROP && state == ELM_resourcetype) return ELM_resourcetype; if (parent == ELM_resourcetype && state == ELM_collection) priv->iscollection = 1; return NE_XML_DECLINE; } /* Creates the private structure. */ #if NE_VERSION_MINOR > 25 static void *create_private(void *userdata, const ne_uri *uri) #else static void *create_private(void *userdata, const char *uri) #endif { return ne_calloc(sizeof(struct private)); } #if NE_VERSION_MINOR > 25 static void destroy_private(void *userdata, void *private) { struct private *priv = private; ne_free(priv); } #endif /* TODO: optimize: only ask for lastmod + executable when we really * need them: it does waste bandwidth and time to ask for executable * when we don't want it, since it forces a 404 propstat for each * non-collection resource if it is not defined. */ static int fetch_list(void *session, const char *dirname, int need_modtimes, struct proto_file **files) { ne_session *sess = session; int ret; struct fetch_context ctx; ne_propfind_handler *ph; char *edirname = ne_path_escape(dirname); ctx.root = dirname; ctx.files = files; ctx.tail = NULL; ph = ne_propfind_create(sess, edirname, NE_DEPTH_ONE); /* The complex props. */ ne_propfind_set_private(ph, create_private, #if NE_VERSION_MINOR > 25 destroy_private, #endif NULL); /* Register the handler for the complex props. */ ne_xml_push_handler(ne_propfind_get_parser(ph), start_element, NULL, NULL, ph); ret = ne_propfind_named(ph, props, pfind_results, &ctx); free(edirname); return h2s(sess,ret); } static int unimp_link2(void *session, const char *l, const char *target) { ne_session *sess = session; ne_set_error(sess, "Operation not supported"); return SITE_UNSUPPORTED; } static int unimp_link1(void *session, const char *l) { ne_session *sess = session; ne_set_error(sess, "Operation not supported"); return SITE_UNSUPPORTED; } static const char *error(void *session) { ne_session *sess = session; return ne_get_error(sess); } /* The WebDAV protocol driver */ const struct proto_driver dav_driver = { init, finish, file_move, file_upload, file_upload_cond, file_get_modtime, file_download, file_read, file_delete, file_chmod, dir_create, dir_remove, unimp_link2, /* create link */ unimp_link2, /* change link target */ unimp_link1, /* delete link */ fetch_list, error, get_server_port, get_proxy_port, "WebDAV" }; sitecopy-0.16.6/src/sftpdriver.c0000664000076400007640000002512410260466617014730 0ustar joejoe/* sitecopy sftp/ssh protocol driver module (forked from rshdriver.c) Copyright (C) 2000-2005, Joe Orton Copyright (C) 2004, Nobuyuki Tsuchimura 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. */ /* TODO: * - handle ssh directly instead of handling sftp....(?) */ #include #include #include #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDARG_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include "protocol.h" #include "lsparser.h" #ifndef HAVE_SOCKETPAIR #define USE_PIPES #endif typedef struct { struct site *site; const char *sftp_cmd, *ssh_cmd; char buf[BUFSIZ]; int connected, fd_in, fd_out, sftp_pid; FILE *fp; /* popen for sftp client */ } sftp_session; static int run_sftp(sftp_session *sess, const char *template, ...) ne_attribute((format (printf, 2, 3))); static int read_sftp(sftp_session *sess) { size_t pos = 0; do { ssize_t ret = read(sess->fd_in, sess->buf+pos, BUFSIZ-pos); if (ret < 0) return SITE_FAILED; if (ret == 0) break; pos += ret; sess->buf[pos] = '\0'; } while (strchr(sess->buf, '>') == NULL && pos < BUFSIZ); NE_DEBUG(DEBUG_SFTP, "(%s)", sess->buf); return SITE_OK; } static void exec_sftp(sftp_session *sess) { size_t len; char *username; username = sess->site->server.username; len = ne_snprintf(sess->buf, BUFSIZ, "%s%s%s", (username != NULL ? username : ""), (username != NULL ? "@" : ""), sess->site->server.hostname); if (len + 1 >= BUFSIZ) { NE_DEBUG(DEBUG_SFTP, "sftp: user/host name too long.\n"); return; } execlp(sess->sftp_cmd, sess->sftp_cmd, sess->buf, NULL); NE_DEBUG(DEBUG_SFTP, "sftp exec: %s %s: %s\n", sess->sftp_cmd, sess->buf, strerror(errno)); } static int sftp_connect(sftp_session *sess) { int c_in, c_out; #ifdef USE_PIPES int pin[2], pout[2]; if ((pipe(pin) == -1) || (pipe(pout) == -1)) { NE_DEBUG(DEBUG_SFTP, "sftp pipe: %s", strerror(errno)); return SITE_FAILED; } sess->fd_in = pin[0]; sess->fd_out = pout[1]; c_in = pout[0]; c_out = pin[1]; #else /* !USE_PIPES */ int inout[2]; if (socketpair(AF_UNIX, SOCK_STREAM, 0, inout) == -1) { NE_DEBUG(DEBUG_SFTP, "sftp socketpair: %s", strerror(errno)); return SITE_FAILED; } sess->fd_in = sess->fd_out = inout[0]; c_in = c_out = inout[1]; #endif /* USE_PIPES */ sess->connected = true; sess->sftp_pid = fork(); switch (sess->sftp_pid) { case -1: NE_DEBUG(DEBUG_SFTP, "sftp: fork: %s", strerror(errno)); return SITE_FAILED; case 0: if ((dup2(c_in, STDIN_FILENO) == -1) || (dup2(c_out, STDOUT_FILENO) == -1)) { NE_DEBUG(DEBUG_SFTP, "sftp: dup2: %s\n", strerror(errno)); return SITE_FAILED; } close(sess->fd_in); close(sess->fd_out); close(c_in); close(c_out); exec_sftp(sess); return SITE_FAILED; } close(c_in); close(c_out); read_sftp(sess); /* wait for prompt */ return SITE_OK; } static int sftp_disconnect(sftp_session *sess) { #ifndef USE_PIPES #ifndef SHUT_RDWR #define SHUT_RDWR 2 #endif shutdown(sess->fd_in, SHUT_RDWR); shutdown(sess->fd_out, SHUT_RDWR); #endif /* USE_PIPES */ close(sess->fd_in); close(sess->fd_out); if (waitpid(sess->sftp_pid, NULL, 0) == -1) { NE_DEBUG(DEBUG_SFTP, "sftp: Couldn't wait for sftp process: %s", strerror(errno)); return SITE_FAILED; } return SITE_OK; } static int run_sftp(sftp_session *sess, const char *template, ...) { va_list params; if (!sess->connected) sftp_connect(sess); va_start(params, template); ne_vsnprintf(sess->buf, BUFSIZ, template, params); va_end(params); if (strlen(sess->buf) + 2 >= BUFSIZ) { /* will be added '\n' */ NE_DEBUG(DEBUG_SFTP, "sftp: sftp: too long command '%s'.\n", sess->buf); return SITE_FAILED; /* buff over flow */ } NE_DEBUG(DEBUG_SFTP, "SFTP: '%s'\n", sess->buf); strcat(sess->buf, "\n"); if (write(sess->fd_out, sess->buf, strlen(sess->buf)) == -1) { return SITE_FAILED; } read_sftp(sess); /* wait for prompt */ return SITE_OK; } static int run_ssh(sftp_session *sess, const char *template, ...) ne_attribute((format (printf, 2, 3))); static int run_ssh(sftp_session *sess, const char *template, ...) { va_list params; char *buf = sess->buf; size_t len; char *username = sess->site->server.username; len = ne_snprintf(buf, BUFSIZ, "%s%s%s %s \\\\", sess->ssh_cmd, (username != NULL ? " -l " : ""), (username != NULL ? username : ""), sess->site->server.hostname); va_start(params, template); len += ne_vsnprintf(buf + len, BUFSIZ - len, template, params); va_end(params); len += ne_snprintf(buf + len, BUFSIZ - len, " 2> /dev/null" ); if (len + 1 >= BUFSIZ) return SITE_FAILED; /* buff over flow */ NE_DEBUG(DEBUG_SFTP, "rcmd: %s\n", buf); sess->fp = popen(buf, "r"); if (sess->fp != NULL) { return SITE_OK; } else { return SITE_FAILED; } /* why not free(cmd)? */ } static int ssh_finish(sftp_session *sess) { if (pclose(sess->fp) == 0) { sess->fp = NULL; return SITE_OK; } else { return SITE_FAILED; } } static int init(void **session, struct site *site) { sftp_session *sess = ne_calloc(sizeof *sess); *session = sess; if (site->rcp_cmd != NULL) { sess->sftp_cmd = site->rcp_cmd; } else { sess->sftp_cmd = "sftp"; } if (site->rsh_cmd != NULL) { sess->ssh_cmd = site->rsh_cmd; } else { sess->ssh_cmd = "ssh"; } sess->site = site; sess->connected = false; return SITE_OK; } static void finish(void *session) { sftp_session *sess = session; if (sess->connected) sftp_disconnect(sess); if (sess->fp != NULL) ssh_finish(sess); free(sess); } static int file_move(void *session, const char *from, const char *to) { sftp_session *sess = session; return run_sftp(sess, "rename %s %s", from, to); } static int file_upload(void *session, const char *local, const char *remote, int ascii) { sftp_session *sess = session; return run_sftp(sess, "put %s %s", local, remote); } static int file_upload_cond(void *session, const char *local, const char *remote, int ascii, time_t t) { return SITE_UNSUPPORTED; } static int file_get_modtime(void *sess, const char *remote, time_t *modtime) { return SITE_UNSUPPORTED; } static int file_download(void *session, const char *local, const char *remote, int ascii) { sftp_session *sess = session; return run_sftp(sess, "get %s %s", remote, local); } static int file_read(void *session, const char *remote, ne_block_reader reader, void *userdata) { sftp_session *sess = session; size_t len; if (run_ssh(sess, "cat '%s'", remote) != SITE_OK) return SITE_FAILED; while ((len = fread(sess->buf, 1, BUFSIZ, sess->fp)) > 0) { reader(userdata, sess->buf, len); } return ssh_finish(sess); } static int file_delete(void *session, const char *filename) { sftp_session *sess = session; return run_sftp(sess, "rm %s", filename); } static int file_chmod(void *session, const char *fname, const mode_t mode) { sftp_session *sess = session; return run_sftp(sess, "chmod %03o %s", mode, fname); } static int dir_create(void *session, const char *dirname) { sftp_session *sess = session; return run_sftp(sess, "mkdir %s", dirname); } static int dir_remove(void *session, const char *dirname) { sftp_session *sess = session; return run_sftp(sess, "rmdir %s", dirname); } static const char *error(void *session) { return "An error occurred."; } static int get_dummy_port(struct site *site) { return 0; } static int ssh_fetch(sftp_session *sess, const char *startdir, struct proto_file **list) { struct proto_file *tail = NULL; int success = SITE_OK; ls_context_t *lsctx = ls_init(startdir); memset(sess->buf, 0, BUFSIZ); while (fgets(sess->buf, BUFSIZ, sess->fp) != NULL) { enum ls_result res; struct ls_file lfile; res = ls_parse(lsctx, sess->buf, &lfile); switch (res) { case ls_error: NE_DEBUG(DEBUG_SFTP, "Could not parse line.\n"); success = SITE_ERRORS; break; default: ls_pflist_add(list, &tail, &lfile, res); break; } } ls_destroy(lsctx); NE_DEBUG(DEBUG_SFTP, "Fetch finished successfully.\n"); return success; } static int fetch_list(void *session, const char *dirname, int need_modtimes, struct proto_file **files) { sftp_session *sess = session; int ret; ret = run_ssh(sess, "ls -la '%s'", dirname); if (ret == SITE_OK) { ssh_fetch(sess, dirname, files); ret = ssh_finish(sess); } /* if (ret == SITE_OK && need_modtimes) { ret = sftp_fetch_modtimes(sess, dirname, *files); } */ return ret; } /* The protocol driver */ const struct proto_driver sftp_driver = { init, finish, file_move, file_upload, file_upload_cond, file_get_modtime, file_download, file_read, file_delete, file_chmod, dir_create, dir_remove, NULL, /* create link */ NULL, /* change link target */ NULL, /* delete link */ fetch_list, /* fetch list. */ error, get_dummy_port, get_dummy_port, "sftp/ssh" }; sitecopy-0.16.6/src/common.c0000664000076400007640000000526610175267065014036 0ustar joejoe/* sitecopy, manage remote web sites. Copyright (C) 1998-2004, Joe Orton . 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. */ #include "config.h" #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #include #ifdef HAVE_STDLIB_H #include #endif /* HAVE_STDLIB_H */ #ifdef HAVE_LANGINFO_H #include #endif #include #include #include #include "i18n.h" #include "common.h" #ifdef NE_DEBUGGING static const struct { const char *name; int val; } debug_map[] = { { "socket", NE_DBG_SOCKET }, { "files", DEBUG_FILES }, { "rcfile", DEBUG_RCFILE }, { "ftp", DEBUG_FTP }, { "xml", NE_DBG_XML }, { "xmlparse", NE_DBG_XMLPARSE }, { "http", NE_DBG_HTTP }, { "httpauth", NE_DBG_HTTPAUTH }, { "httpbody", NE_DBG_HTTPBODY }, { "cleartext", NE_DBG_HTTPPLAIN }, { "ssl", NE_DBG_SSL }, { "rsh", DEBUG_RSH }, { "sftp", DEBUG_SFTP }, { NULL, 0 } }; int map_debug_options(const char *opts, int *mask, char *errbuf) { char *token, *ptr, *orig; int n, ret = 0, mapped; ptr = orig = ne_strdup(opts); do { token = ne_token(&ptr, ','); token = ne_shave(token, " "); mapped = 0; for (n = 0; debug_map[n].name != NULL; n++) { if (strcasecmp(token, debug_map[n].name) == 0) { ret |= debug_map[n].val; mapped = 1; break; } } if (!mapped) { memset(errbuf, 0, 20); strncpy(errbuf, token, 19); ne_free(orig); return -1; } } while (ptr); *mask = ret; ne_free(orig); return 0; } #endif /* DEBUGGING */ /* Snagged from fetchmail */ # if !HAVE_STRERROR && !defined(strerror) char *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"); } # endif /* HAVE_STRERROR */ sitecopy-0.16.6/src/sites.c0000664000076400007640000010757411035210311013654 0ustar joejoe/* sitecopy, for managing remote web sites. Copyright (C) 1998-2008, Joe Orton 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. */ /* This is the core functionality of sitecopy, performing updates * and checking files etc. */ #include #include #include #include #include #include #include #include #ifdef HAVE_STDLIB_H #include #endif /* HAVE_STDLIB_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #include #include /* neon */ #include #include #include #include #ifdef HAVE_SNPRINTF_H #include "snprintf.h" #endif /* !HAVE_SNPRINTF_H */ #include "basename.h" #include "i18n.h" #include "common.h" #include "frontend.h" #include "protocol.h" #include "sitesi.h" /* Shorthand for protocol driver methods */ #define CALL(a) (*site->driver->a) #define DRIVER_ERR ((*site->driver->error)(session)) /* This holds ALL the sites defined in the rcfile */ struct site *all_sites; static int proto_init(struct site *site, void **session); static void proto_finish(struct site *site, void *session); static void proto_seterror(struct site *site, void *session); struct site *site_find(const char *sitename) { struct site *current; for (current = all_sites; current!=NULL; current=current->next) { if (strcmp(current->name, sitename) == 0) { /* We found it */ return current; } } return NULL; } static int synch_create_directories(struct site *site) { struct site_file *current; char *full_local; int ret; ret = 0; for_each_file(current, site) { if ((current->type==file_dir) && (current->diff==file_deleted)) { full_local = file_full_local(¤t->stored, site); fe_synching(current); if (mkdir(full_local, 0755) == 0) { fe_synched(current, true, NULL); } else { ret = 1; fe_synched(current, false, strerror(errno)); file_downloaded(current, site); } free(full_local); } } return ret; } static int synch_files(struct site *site, void *session) { struct site_file *current; int ret; ret = 0; for_each_file(current, site) { char *full_local, *full_remote; if (current->type != file_file) continue; switch (current->diff) { case file_changed: if (!file_contents_changed(current, site)) { /* Just chmod it */ full_local = file_full_local(¤t->stored, site); fe_setting_perms(current); if (chmod(full_local, current->stored.mode) < 0) { fe_set_perms(current, false, strerror(errno)); } else { fe_set_perms(current, true, NULL); } free(full_local); break; } /*** fall-through */ case file_deleted: full_local = file_full_local(¤t->stored, site); full_remote = file_full_remote(¤t->stored, site); fe_synching(current); if (CALL(file_download)(session, full_local, full_remote, current->stored.ascii) != SITE_OK) { fe_synched(current, false, DRIVER_ERR); ret = 1; } else { /* Successfull download */ fe_synched(current, true, NULL); if (site->state_method == state_timesize) { struct utimbuf times; /* Change the modtime of the local file so it doesn't look * like it's changed already */ times.actime = current->stored.time; times.modtime = current->stored.time; if (utime(full_local, ×) < 0) { fe_warning(_("Could not set modification time of local file."), full_local, strerror(errno)); } } if (file_perms_changed(current, site)) { fe_setting_perms(current); if (chmod(full_local, current->stored.mode) < 0) { fe_set_perms(current, false, strerror(errno)); } else { fe_set_perms(current, true, NULL); } } /* TODO: not strictly true if the chmod failed. */ file_downloaded(current, site); } free(full_local); free(full_remote); break; case file_new: full_local = file_full_local(¤t->local, site); fe_synching(current); if (unlink(full_local) != 0) { fe_synched(current, false, strerror(errno)); ret = 1; } else { fe_synched(current, true, NULL); } free(full_local); break; case file_moved: { char *old_full_local = file_full_local(¤t->stored, site); full_local = file_full_local(¤t->local, site); fe_synching(current); if (rename(full_local, old_full_local) == 0) { fe_synched(current, true, NULL); } else { fe_synched(current, false, strerror(errno)); ret = 1; } free(old_full_local); free(full_local); } default: break; } } return ret; } static int synch_delete_directories(struct site *site) { struct site_file *current, *prev; int ret; ret = 0; for (current=site->files_tail; current!=NULL; current=prev) { prev = current->prev; if ((current->type==file_dir) && (current->diff==file_new)) { char *full_local = file_full_local(¤t->local, site); fe_synching(current); if (rmdir(full_local) == -1) { fe_synched(current, false, strerror(errno)); ret = 3; } else { fe_synched(current, true, NULL); file_delete(site, current); } free(full_local); } } return ret; } /* Resyncs the LOCAL site with the REMOTE site. * This is site_update backwards, and is essentially the same in structure, * except with the logic reversed. */ int site_synch(struct site *site) { int ret, need_conn; void *session; /* Do we need to connect to the server: note that ignored files * are treated as changed files in synch mode. */ need_conn = (site->numchanged + site->numdeleted + site->numignored > 0); if (need_conn) { ret = proto_init(site, &session); if (ret != SITE_OK) { proto_finish(site, session); return ret; } } ret = synch_create_directories(site); if (ret == 0 || site->keep_going) { ret = synch_files(site, session); if (ret == 0 || site->keep_going) { ret = synch_delete_directories(site); } } if (need_conn) { proto_finish(site, session); } if (ret == 0) { ret = SITE_OK; } else { ret = SITE_ERRORS; } return ret; } static int file_chmod(struct site_file *file, struct site *site, void *session) { int ret = 0; /* chmod it if necessary */ if (file_perms_changed(file, site)) { char *full_remote = file_full_remote(&file->local, site); fe_setting_perms(file); if (CALL(file_chmod)(session, full_remote, file->local.mode) != SITE_OK) { fe_set_perms(file, false, DRIVER_ERR); ret = 1; } else { file->stored.mode = file->local.mode; fe_set_perms(file, true, NULL); file_set_diff(file, site); } free(full_remote); } return ret; } static void file_retrieve_server(struct site_file *file, struct site *site, void *session) { time_t rtime; char *full_remote = file_full_remote(&file->local, site); if (CALL(file_get_modtime)(session, full_remote, &rtime) == SITE_OK) { file->server.time = rtime; file->server.exists = true; } else { file->server.exists = false; fe_warning(_("Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode."), full_remote, DRIVER_ERR); } free(full_remote); } /* Create new directories and change permissions on existing directories. */ static int update_create_directories(struct site *site, void *session) { struct site_file *current; int ret = 0; for_each_file(current, site) { if ((current->type == file_dir) && (current->diff == file_new || current->diff == file_changed)) { /* New or changed directory! */ char *full_remote; int oret; if (!fe_can_update(current)) continue; full_remote = file_full_remote(¤t->local, site); if (current->diff == file_new) { fe_updating(current); oret = CALL(dir_create)(session, full_remote); if (oret != SITE_OK) { fe_updated(current, false, DRIVER_ERR); } else { fe_updated(current, true, NULL); } } else { oret = SITE_OK; } if (site->dirperms && oret == SITE_OK) { fe_setting_perms(current); oret = CALL(file_chmod)(session, full_remote, current->local.mode); if (oret == SITE_OK) { fe_set_perms(current, true, NULL); } else { fe_set_perms(current, false, DRIVER_ERR); } } if (oret != SITE_OK) { ret = 1; } else { file_uploaded(current, site); } free(full_remote); } } return ret; } /* Returns the filename to use for tempupload mode, ne_malloc-allocated. * (pass the site since we may have different tempupload modes in the * future.) * FIXME: implement it efficiently */ static char *temp_upload_filename(const char *filename, struct site *site) { char *pnt, *ret; /* Insert a '.in.' prefix into the filename, AFTER * any directories */ ret = ne_malloc(strlen(filename) + 4 + 1); strcpy(ret, filename); pnt = strrchr(ret, '/'); if (pnt == NULL) { pnt = ret; } else { pnt++; } /* Shove the name segment along four bytes so we can insert * the '.in.' */ memmove(pnt+4, pnt, strlen(pnt) + 1); memcpy(pnt, ".in.", 4); return ret; } static int update_delete_files(struct site *site, void *session) { struct site_file *current, *next; int ret = 0; for (current=site->files; current!=NULL; current=next) { next = current->next; /* Skip directories and links, and only do deleted files on * this pass */ if (current->diff == file_deleted && current->type == file_file) { char *full_remote; if (!fe_can_update(current)) continue; full_remote = file_full_remote(¤t->stored, site); fe_updating(current); if (CALL(file_delete)(session, full_remote) != SITE_OK) { fe_updated(current, false, DRIVER_ERR); ret = 1; } else { /* Successful update - file was deleted */ fe_updated(current, true, NULL); file_delete(site, current); } free(full_remote); } } return ret; } static int update_move_files(struct site *site, void *session) { int ret = 0; struct site_file *current; char *old_full_remote, *full_remote; for_each_file(current, site) { if (current->diff != file_moved) continue; full_remote = file_full_remote(¤t->local, site); /* The file has been moved */ if (!fe_can_update(current)) continue; fe_updating(current); old_full_remote = file_full_remote(¤t->stored, site); if (CALL(file_move)(session, old_full_remote, full_remote) != SITE_OK) { ret = 1; fe_updated(current, false, DRIVER_ERR); } else { /* Successful update - file was moved */ fe_updated(current, true, NULL); file_uploaded(current, site); } free(old_full_remote); free(full_remote); } return ret; } /* Does everything but file deletes */ static int update_files(struct site *site, void *session) { struct site_file *current; char *full_local, *full_remote; int ret = 0; for_each_file(current, site) { /* This loop only handles changed and new files, so * skip everything else. */ if (current->type != file_file || current->diff == file_deleted || current->diff == file_moved || current->diff == file_unchanged) continue; full_local = file_full_local(¤t->local, site); full_remote = file_full_remote(¤t->local, site); switch (current->diff) { case file_changed: /* File has changed, upload it */ if (current->ignore) break; if (!file_contents_changed(current, site)) { /* If the file contents haven't changed, then we can * just chmod it */ if (file_chmod(current, site, session)) ret = 1; break; } /*** fall-through ***/ case file_new: /* File is new, upload it */ if (!fe_can_update(current)) continue; if ((current->diff == file_changed) && site->nooverwrite) { /* Must delete remote file before uploading new copy. * FIXME: Icky hack to convince the FE we are about to * delete the file */ current->diff = file_deleted; fe_updating(current); if (CALL(file_delete)(session, full_remote) != SITE_OK) { fe_updated(current, false, DRIVER_ERR); ret = 1; current->diff = file_changed; /* Don't upload it! */ break; } else { fe_updated(current, true, NULL); current->diff = file_changed; } } fe_updating(current); /* Now, upload it */ if (site->safemode && current->server.exists) { /* Only do this for files we do know the remote modtime for */ int cret; cret = CALL(file_upload_cond)(session, full_local, full_remote, current->local.ascii, current->server.time); switch (cret) { case SITE_ERRORS: fe_updated(current, false, DRIVER_ERR); ret = 1; break; case SITE_FAILED: fe_updated(current, false, _("Remote file has been modified - not overwriting with local changes")); ret = 1; break; default: /* Success case */ fe_updated(current, true, NULL); file_retrieve_server(current, site, session); if (file_chmod(current, site, session)) ret = 1; file_uploaded(current, site); break; } } else if (site->tempupload) { /* Do temp file upload followed by a move */ char *temp_remote = temp_upload_filename(full_remote, site); if (CALL(file_upload)(session, full_local, temp_remote, current->local.ascii != SITE_OK)) { fe_updated(current, false, DRIVER_ERR); ret = 1; } else { /* Successful upload... now move it */ if (CALL(file_move)(session, temp_remote, full_remote) != SITE_OK) { fe_updated(current, false, DRIVER_ERR); /* Originally coded to delete the temporary file * here, but, on second thoughts... if something * is broken, let's not try to be too clever, else * we might make it worse. */ ret = 1; } else { /* Successful move */ fe_updated(current, true, NULL); if (site->safemode) { file_retrieve_server(current, site, session); } if (file_chmod(current, site, session)) ret = 1; file_uploaded(current, site); } } free(temp_remote); } else { /* Normal unconditional upload */ if (CALL(file_upload)(session, full_local, full_remote, current->local.ascii) != SITE_OK) { fe_updated(current, false, DRIVER_ERR); ret = 1; } else { /* Successful upload. */ fe_updated(current, true, NULL); if (site->safemode) { file_retrieve_server(current, site, session); } if (file_chmod(current, site, session)) ret = 1; file_uploaded(current, site); } } break; default: /* Ignore everything else */ break; } free(full_remote); free(full_local); } return ret; } static int update_delete_directories(struct site *site, void *session) { struct site_file *current, *prev; int ret = 0; /* This one must iterate through the list BACKWARDS, so * directories are deleted bottom up */ for (current=site->files_tail; current!=NULL; current=prev) { prev = current->prev; if ((current->type==file_dir) && (current->diff == file_deleted)) { char *full_remote; if (!fe_can_update(current)) continue; full_remote = file_full_remote(¤t->stored, site); fe_updating(current); if (CALL(dir_remove)(session, full_remote) != SITE_OK) { ret = 1; fe_updated(current, false, DRIVER_ERR); } else { /* Successful delete */ fe_updated(current, true, NULL); file_delete(site, current); } free(full_remote); } } return ret; } static int update_links(struct site *site, void *session) { struct site_file *current, *next; int ret = 0; for (current=site->files; current!=NULL; current=next) { char *full_remote; next = current->next; if (current->type != file_link) continue; full_remote = file_full_remote(¤t->local, site); switch (current->diff) { case file_new: fe_updating(current); if (CALL(link_create)(session, full_remote, current->local.linktarget) != SITE_OK) { fe_updated(current, false, DRIVER_ERR); ret = 1; } else { fe_updated(current, true, NULL); current->diff = file_unchanged; } break; case file_changed: fe_updating(current); if (CALL(link_change)(session, full_remote, current->local.linktarget) != SITE_OK) { fe_updated(current, false, DRIVER_ERR); ret = 1; } else { fe_updated(current, true, NULL); current->diff = file_unchanged; } break; case file_deleted: fe_updating(current); if (CALL(link_delete)(session, full_remote) != SITE_OK) { fe_updated(current, false, DRIVER_ERR); ret = 1; } else { fe_updated(current, true, NULL); file_delete(site, current); } default: break; } free(full_remote); } return ret; } static void proto_finish(struct site *site, void *session) { proto_seterror(site, session); CALL(finish)(session); } static void proto_seterror(struct site *site, void *session) { site->last_error = ne_strdup(DRIVER_ERR); } const char *site_get_protoname(struct site *site) { if (site->driver) return site->driver->protocol_name; else return site->proto_string; } static int proto_init(struct site *site, void **session) { int ret; if (site->last_error) { free(site->last_error); site->last_error = NULL; } ret = CALL(init)(session, site); if (ret != SITE_OK) { proto_seterror(site, *session); return ret; } return SITE_OK; } /* Updates the remote site. * * Executes each of the site_update_* functions in turn (if their * guard evaluates to true). */ int site_update(struct site *site) { int ret = 0, num; const struct handler { int (*func)(struct site *, void *session); int guard; } handlers[] = { { update_delete_files, !site->nodelete }, { update_create_directories, 1 }, { update_move_files, site->checkmoved }, { update_files, 1 }, { update_links, site->symlinks == sitesym_maintain }, { update_delete_directories, !site->nodelete }, { NULL, 1 } }; void *session; ret = proto_init(site, &session); if (ret != SITE_OK) { proto_finish(site, session); return ret; } for (num = 0; handlers[num].func != NULL && (ret == 0 || site->keep_going); num++) { if (handlers[num].guard) { int newret; newret = (*handlers[num].func)(site, session); if (newret != 0) { ret = newret; } } } if (ret == 0) { /* Site updated successfully. */ ret = SITE_OK; } else { /* Update not totally successfull */ ret = SITE_ERRORS; } proto_finish(site, session); return ret; } /* This reads off the remote files and the local files. */ int site_readfiles(struct site *site) { int ret; site_destroy(site); ret = site_read_stored_state(site); if (ret == SITE_OK) { site_read_local_state(site); } return ret; } /* Read the local site files... * A stack is used for directories within the site - this is not recursive. * Each item on the stack is a FULL PATH to the directory, i.e., including * the local site root. */ /* Initial size of directory stack, and amount it grows * each time we fill it. */ #define DIRSTACKSIZE (1024) void site_read_local_state(struct site *site) { char **dirstack, *this, *full = NULL; int dirtop = 0, /* points to item above top stack item */ dirmax = DIRSTACKSIZE; /* size of stack */ dirstack = ne_malloc(sizeof(char *) * DIRSTACKSIZE); /* Push the root directory on to the stack */ dirstack[dirtop++] = ne_strdup(site->local_root); /* Now, for all items in the stack, process all the files, and * add the dirs to the stack. Everything we put on the stack is * temporary and gets freed eventually. */ while (dirtop > 0) { DIR *curdir; struct dirent *ent; /* Pop the stack */ this = dirstack[--dirtop]; NE_DEBUG(DEBUG_FILES, "Scanning: %s\n", this); curdir = opendir(this); if (curdir == NULL) { fe_warning("Could not read directory", this, strerror(errno)); free(this); continue; } /* Now read all the directory entries */ while ((ent = readdir(curdir)) != NULL) { char *fname; struct stat item; struct site_file *current; struct file_state local = {0}; enum file_type type; size_t dnlen = strlen(ent->d_name); /* Exclude the special directory entries. This test comes * high since it kills two stat calls per directory. */ if (ent->d_name[0] == '.' && (dnlen == 1 || (ent->d_name[1] == '.' && dnlen==2))) { continue; } if (full != NULL) free(full); full = ne_concat(this, ent->d_name, NULL); #ifdef __EMX__ /* There are no symlinks under OS/2, use stat() instead */ #define USE_STAT stat #else #define USE_STAT lstat #endif if (USE_STAT(full, &item) == -1) { fe_warning(_("Could not examine file."), full, strerror(errno)); continue; } #undef USE_STAT #ifndef __EMX__ /* Is this a symlink? */ if (S_ISLNK(item.st_mode)) { NE_DEBUG(DEBUG_FILES, "symlink - "); if (site->symlinks == sitesym_ignore) { /* Just skip it */ NE_DEBUG(DEBUG_FILES, "ignoring.\n"); continue; } else if (site->symlinks == sitesym_follow) { NE_DEBUG(DEBUG_FILES, "followed - "); /* Else, carry on as normal, stat the real file */ if (stat(full, &item) == -1) { /* It's probably a broken link */ NE_DEBUG(DEBUG_FILES, "broken.\n"); continue; } } else { NE_DEBUG(DEBUG_FILES, "maintained:\n"); } } #endif /* __EMX__ */ /* Now process it */ /* This is the filename of this file - i.e., everything * apart from the local root */ fname = (char *)full+strlen(site->local_root); /* Check for excludes */ if (file_isexcluded(fname, site)) continue; if (S_ISREG(item.st_mode)) { switch (site->state_method) { case state_timesize: local.time = item.st_mtime; break; case state_checksum: if (file_checksum(full, &local, site) != 0) { fe_warning(_("Could not checksum file"), full, strerror(errno)); continue; } break; } local.size = item.st_size; local.ascii = file_isascii(fname, site); type = file_file; } #ifndef __EMX__ else if (S_ISLNK(item.st_mode)) { char tmp[BUFSIZ] = {0}; type = file_link; NE_DEBUG(DEBUG_FILES, "symlink being maintained.\n"); if (readlink(full, tmp, BUFSIZ) == -1) { fe_warning(_("The target of the symlink could not be read."), full, strerror(errno)); continue; } local.linktarget = ne_strdup(tmp); } #endif /* __EMX__ */ else if (S_ISDIR(item.st_mode)) { type = file_dir; if (dirtop == dirmax) { /* Grow the stack */ dirmax += DIRSTACKSIZE; dirstack = realloc(dirstack, sizeof(char *) * dirmax); } /* Add it to the search stack */ dirstack[dirtop] = ne_concat(full, "/", NULL); dirtop++; } else { NE_DEBUG(DEBUG_FILES, "something else.\n"); continue; } /* Set up rest of the local state */ local.mode = item.st_mode & 0777; local.exists = true; local.filename = ne_strdup(fname); current = file_set_local(type, &local, site); DEBUG_DUMP_FILE_PROPS(DEBUG_FILES, current, site); } /* Close the open directory */ closedir(curdir); /* And we're finished with this */ free(this); } free(dirstack); } /* Pretend the remote site is the same as the local site. */ void site_catchup(struct site *site) { struct site_file *current, *next; for (current=site->files; current!=NULL; current=next) { next = current->next; switch (current->diff) { case file_deleted: file_delete(site, current); break; case file_changed: case file_new: case file_moved: file_state_copy(¤t->stored, ¤t->local, site); file_set_diff(current, site); break; case file_unchanged: /* noop */ break; } } } /* Reinitializes the site - clears any remote files * from the list, and marks all other files as 'new locally'. */ void site_initialize(struct site *site) { /* So simple. Be sure we have our abstraction layers at least * half-decent when things fall out this simple. */ site_destroy_stored(site); } /* Munge modtimes of 'file' accordingly; when modtime of file on * server is 'remote_mtime'. */ static void munge_modtime(struct site_file *file, time_t remote_mtime, struct site *site) { /* If this is a file, and we are using timesize mode, and we have * a local copy of this file already, we have to cope with the * modtimes problem. The problem is that the modtime locally will * ALWAYS be different from the modtime on the SERVER. */ if (file->type == file_file && site->state_method == state_timesize) { if (file->local.exists) { /* If we are in safe mode, we can actually check whether * the remote file has changed or not when we are using * timesize mode, by comparing what we thought the server * modtime was with what the actual (fetched) server * modtime is. Got that? */ NE_DEBUG(DEBUG_FILES, "Fetch: %ld vs %ld\n", file->server.time, remote_mtime); if (site->safemode && file->server.exists && file->server.time != remote_mtime) { NE_DEBUG(DEBUG_FILES, "Fetch: Marking changed file changed.\n"); file->stored.time = file->local.time + 1; } else { NE_DEBUG(DEBUG_FILES, "Fetch: Marking unchanged files same.\n"); file->stored.time = file->local.time; } } else { /* If the local file doesn't exist, pretend the file was * last uploaded "now" (an arbitrary time is adequate, but * "now" is the least confusing). */ file->stored.time = time(NULL); } /* update the diff. */ file_set_diff(file, site); } } /* Return a site_file structure given a proto_file structure fetched * by the protocol driver. */ static struct site_file *fetch_add_file(struct site *site, const struct proto_file *pf) { enum file_type type = file_file; /* init to shut up gcc */ struct site_file *file; struct file_state state = {0}; switch (pf->type) { case proto_file: type = file_file; break; case proto_dir: type = file_dir; break; case proto_link: type = file_link; break; } state.size = pf->size; state.time = pf->modtime; state.exists = true; state.filename = pf->filename; state.mode = pf->mode; state.ascii = file_isascii(pf->filename, site); memcpy(state.checksum, pf->checksum, 16); file = file_set_stored(type, &state, site); munge_modtime(file, pf->modtime, site); if (site->safemode) { /* Store the server modtime. */ file->server.time = pf->modtime; file->server.exists = true; } return file; } static #if NE_VERSION_MINOR == 24 void #else int #endif site_fetch_csum_read(void *userdata, const char *s, size_t len) { struct ne_md5_ctx *md5 = userdata; ne_md5_process_bytes(s, len, md5); #if NE_VERSION_MINOR != 24 return 0; #endif } /* Retrieve the remote checksum for all files */ static int fetch_checksum_file(struct proto_file *file, struct site *site, void *session) { #if NE_VERSION_MINOR > 25 struct ne_md5_ctx *md5; #define MD5_PTR md5 #else struct ne_md5_ctx md5; #define MD5_PTR &md5 #endif char *full_remote = ne_concat(site->remote_root, file->filename, NULL); int ret = 0; #if NE_VERSION_MINOR > 25 md5 = ne_md5_create_ctx(); #else ne_md5_init_ctx(&md5); #endif fe_checksumming(file->filename); if (CALL(file_read)(session, full_remote, site_fetch_csum_read, MD5_PTR) != SITE_OK) { ret = 1; fe_checksummed(full_remote, false, DRIVER_ERR); } else { ne_md5_finish_ctx(MD5_PTR, file->checksum); fe_checksummed(full_remote, true, NULL); } free(full_remote); #if NE_VERSION_MINOR > 25 ne_md5_destroy_ctx(md5); #endif return ret; } /* Updates the remote file list... site_fetch_callback is called for * every remote file found. */ int site_fetch(struct site *site) { int ret, need_modtimes; void *session; const char *dirstack[DIRSTACKSIZE]; size_t dirtop; struct proto_file *files = NULL; ret = proto_init(site, &session); if (ret != SITE_OK) { proto_finish(site, session); return ret; } if (CALL(fetch_list) == NULL) { proto_finish(site, session); return SITE_UNSUPPORTED; } /* The remote modtimes are needed if timesize is used or in safe * mode: */ need_modtimes = site->safemode || site->state_method == state_timesize; dirtop = 1; dirstack[0] = ""; do { struct proto_file *newfiles = NULL, *f, *lastf = NULL; const char *reldir = dirstack[--dirtop]; const char *slash = reldir[0] == '\0' ? "" : "/"; char *curdir; curdir = ne_concat(site->remote_root, reldir, slash, NULL); ret = CALL(fetch_list)(session, curdir, need_modtimes, &newfiles); if (ret != SITE_OK) break; for (f = newfiles; f; f = f->next) { char *relfn; relfn = ne_concat(reldir, slash, f->filename, NULL); ne_free(f->filename); f->filename = relfn; if (!file_isexcluded(relfn, site)) { if (f->type == proto_dir && dirtop < DIRSTACKSIZE) { dirstack[dirtop++] = relfn; } else if (f->type == proto_file && site->state_method == state_checksum) { fetch_checksum_file(f, site, session); } } lastf = f; } if (lastf) { lastf->next = files; files = newfiles; } ne_free(curdir); } while (dirtop > 0); if (ret == SITE_OK) { struct proto_file *f, *nextf; /* Remove existing stored state for the site. */ site_destroy_stored(site); /* And replace it with the fetched state. */ for (f = files; f; f = nextf) { if (!file_isexcluded(f->filename, site)) { struct site_file *sf = fetch_add_file(site, f); fe_fetch_found(sf); } nextf = f->next; ne_free(f); } } else { ret = SITE_FAILED; } proto_finish(site, session); return ret; } /* Compares files list with files. * Returns SITE_OK on match, SITE_ERRORS on no match. */ /* Ahhhh, this is crap too. * If we had a generic file_set this would be easy and clean and spot * moved files too. We need a generic file_set. */ static int site_verify_compare(struct site *site, const struct proto_file *files, int *numremoved) { struct site_file *file; const struct proto_file *lfile; int numremote = 0; /* Clear live state */ for_each_file(file, site) { if (file->stored.exists) { numremote++; } } for (lfile = files; lfile != NULL; lfile = lfile->next) { enum file_diff diff = file_new; numremote--; for_each_file(file, site) { if (file->stored.exists && (strcmp(file->stored.filename, lfile->filename) == 0)) { /* Do a mini file_compare job */ diff = file_unchanged; if (site->state_method == state_checksum) { if (memcmp(file->stored.checksum, lfile->checksum, 16)) diff = file_changed; } else { if ((file->stored.size != lfile->size) || (site->safemode && (file->server.time != lfile->modtime))) { diff = file_changed; } } break; } } /* If new files were added, adjust the count */ if (diff == file_new) numremote++; fe_verified(lfile->filename, diff); } *numremoved = numremote; if (numremote != 0) { return SITE_ERRORS; } else { return SITE_OK; } } /* Compares what's on the server with what we THINK is on the server. * Returns SITE_OK if match, SITE_ERRORS if doesn't match. */ int site_verify(struct site *site, int *numremoved) { struct proto_file *files = NULL; void *session; int ret; ret = proto_init(site, &session); if (ret != SITE_OK) return ret; if (CALL(fetch_list) == NULL) { return SITE_UNSUPPORTED; } ret = CALL(fetch_list)(session, site->remote_root, 1, &files); #if 0 if (site->state_method == state_checksum) { site_fetch_checksum(files, site, session); } #endif proto_finish(site, session); if (ret == SITE_OK) { /* Return whether they matched or not */ return site_verify_compare(site, files, numremoved); } else { return SITE_FAILED; } } /* Destroys the stored state of files in the files list for the given * site. Removes any files which do not exist locally from the list. */ void site_destroy_stored(struct site *site) { struct site_file *current, *next; current = site->files; while (current != NULL) { next = current->next; if (!current->local.exists) { /* It doesn't exist locally... nuke it */ file_delete(site, current); } else { /* Just nuke the stored state... * TODO-ngm: verify this. */ file_state_destroy(¤t->stored); /* Could just do .exists = false */ memset(¤t->stored, 0, sizeof(struct file_state)); /* And set the diff */ file_set_diff(current, site); } current = next; } } /* Called to delete all the files associated with the site */ void site_destroy(struct site *site) { struct site_file *current, *next; current = site->files; while (current != NULL) { next = current->next; file_delete(site, current); current = next; } } /* Produces a section of the flat listing output, of all the items * with the given diff type in the given site, using the given section * name. */ static void site_flatlist_items(FILE *f, struct site *site, enum file_diff diff, const char *name) { struct site_file *current; fprintf(f, "sectstart|%s", name); putc('\n', f); for_each_file(current, site) { if (current->diff == diff) { fprintf(f, "item|%s%s", file_name(current), (current->type==file_dir)?"/":""); if (current->diff == file_moved) { fprintf(f, "|%s", current->stored.filename); } if (current->ignore) fputs("|ignored", f); putc('\n', f); } } fprintf(f, "sectend|%s\n", name); } /* Produce the flat listing output for the given site */ void site_flatlist(FILE *f, struct site *site) { fprintf(f, "sitestart|%s", site->name); if (site->url) fprintf(f, "|%s", site->url); putc('\n', f); if (site->numnew > 0) site_flatlist_items(f, site, file_new, "added"); if (site->numchanged > 0) site_flatlist_items(f, site, file_changed, "changed"); if (site->numdeleted > 0) site_flatlist_items(f, site, file_deleted, "deleted"); if (site->nummoved > 0) site_flatlist_items(f, site, file_moved, "moved"); fprintf(f, "siteend|%s\n", site->remote_is_different?"changed":"unchanged"); } void site_sock_progress_cb(void *userdata, ne_off_t progress, ne_off_t total) { fe_transfer_progress(progress, total); } void fe_initialize(void) { ne_sock_init(); } sitecopy-0.16.6/src/rcfile.c0000664000076400007640000006077310371115444014005 0ustar joejoe/* sitecopy, for managing remote web sites. Copyright (C) 1998-2006, Joe Orton 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. */ #include #include #include #include #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDLIB_H #include #endif /* HAVE_STDLIB_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #include #include #include "common.h" #include "netrc.h" #include "rcfile.h" #include "sites.h" /** Global variables **/ char *copypath; char *rcfile; char *netrcfile; char *home; int havenetrc; /* These are used for reporting errors back to the calling procedures. */ int rcfile_linenum; char *rcfile_err; /** Not quite so global variables **/ /* These are appended to $HOME */ #define RCNAME "/.sitecopyrc" #define COPYNAME "/.sitecopy/" #define NETRCNAME "/.netrc" /* Stores the list of entries in the ~/.netrc */ netrc_entry *netrc_list; const char *rc_get_netrc_password(const char *server, const char *username); /* The driver definitions */ #ifdef USE_FTP extern const struct proto_driver ftp_driver; #endif /* USE_FTP */ #ifdef USE_DAV extern const struct proto_driver dav_driver; #endif /* USE_DAV */ #ifdef USE_RSH extern const struct proto_driver rsh_driver; #endif /* USE_RSH */ #ifdef USE_SFTP extern const struct proto_driver sftp_driver; #endif /* USE_SFTP */ /* rcfile_read will read the rcfile and fill given sites list. * This returns 0 on success, RC_OPENFILE if the rcfile could not * be read, or RC_CORRUPT if the rcfile was corrupt. * If it is corrupt, rcfile_linenum and rcfile_line are set to the * the corrupt line. */ #define LINESIZE 128 int rcfile_read(struct site **sites) { FILE *fp; int state, last_state=8, ret=0; int alpha, hash; char buf[LINESIZE]; char *ch; char *ptr, key[LINESIZE], val[LINESIZE], val2[LINESIZE]; /* Holders for the site info, and default site settings */ struct site *this_site, *last_site, default_site = {0}; if ((fp = fopen(rcfile, "r")) == NULL) { rcfile_err = strerror(errno); return RC_OPENFILE; } default_site.perms = sitep_ignore; default_site.symlinks = sitesym_follow; default_site.protocol = siteproto_ftp; default_site.proto_string = ne_strdup("ftp"); default_site.ftp_pasv_mode = true; default_site.ftp_use_cwd = false; last_site = this_site = NULL; rcfile_linenum = 0; rcfile_err = NULL; while ((ret==0) && (fgets(buf, sizeof(buf), fp) != NULL)) { rcfile_linenum++; /* Put the line without the LF into the error buffer */ if (rcfile_err != NULL) free(rcfile_err); rcfile_err = ne_strdup(buf); ptr = strchr(rcfile_err, '\n'); if (ptr != NULL) *ptr = '\0'; state = 0; ptr = key; memset(key, 0, LINESIZE); memset(val, 0, LINESIZE); memset(val2, 0, LINESIZE); for (ch=buf; *ch!='\0'; ch++) { alpha = !isspace((unsigned)*ch); /* well, alphaish */ hash = (*ch == '#'); switch (state) { case 0: /* whitespace at beginning of line */ if (hash) { state = 8; } else if (alpha) { *(ptr++) = *ch; state = 1; } break; case 1: /* key */ if (hash) { state = 8; } else if (!alpha) { ptr = val; state = 2; } else { *(ptr++) = *ch; } break; case 2: /* whitespace after key */ if (hash) { state = 8; } else if (*ch == '"') { state = 4; /* begin quoted value */ } else if (alpha) { *(ptr++) = *ch; state = 3; } break; case 3: /* unquoted value 1 */ if (hash) { state = 8; } else if (!alpha) { ptr = val2; state = 5; } else { *(ptr++) = *ch; } break; case 4: /* quoted value 1 */ if (*ch == '"') { ptr = val2; state = 5; } else if (*ch == '\\') { last_state = 4; state = 9; } else { *(ptr++) = *ch; } break; case 5: /* whitespace after value 1 */ if (hash) { state = 8; } else if (*ch == '"') { state = 6; /* begin quoted value 2 */ } else if (alpha) { *(ptr++) = *ch; state = 7; /* begin unquoted value 2 */ } break; case 6: /* quoted value 2 */ if (*ch == '"') { state = 8; } else if (*ch == '\\') { last_state = 4; state = 9; } else { *(ptr++) = *ch; } break; case 7: /* unquoted value 2 */ if (hash) { state = 8; } else if (!alpha) { state = 8; } else { *(ptr++) = *ch; } break; case 8: /* ignore till end of line */ break; case 9: /* a literal (\-slashed) in a value */ *(ptr++) = *ch; state = last_state; break; } } NE_DEBUG(DEBUG_RCFILE, "Key [%s] Value: [%s] Value2: [%s]\n", key, val, val2); if (strlen(key) == 0) { continue; } if (strlen(val) == 0) { /* A key with no value. */ if (this_site == NULL) { if (strcmp(key, "default") == 0) { /* Setting up the default site */ NE_DEBUG(DEBUG_RCFILE, "Default site entry:\n"); this_site = &default_site; } else { /* Need to be in a site! */ ret = RC_CORRUPT; } } else if (strcmp(key, "nodelete") == 0) { this_site->nodelete = true; } else if (strcmp(key, "checkmoved") == 0) { this_site->checkmoved = true; } else if (strcmp(key, "nooverwrite") == 0) { this_site->nooverwrite = true; } else if (strcmp(key, "lowercase") == 0) { this_site->lowercase = true; } else if (strcmp(key, "safe") == 0) { this_site->safemode = true; } else if (strcmp(key, "tempupload") == 0) { this_site->tempupload = true; } else { ret = RC_CORRUPT; } } else if (strlen(val2) == 0) { /* A key with a single value. */ if (strcmp(key, "site") == 0) { /* Beginning of a new Site */ if (this_site != &default_site) last_site = this_site; /* Allocate new item */ this_site = ne_malloc(sizeof(struct site)); /* Copy over the defaults */ memcpy(this_site, &default_site, sizeof(struct site)); /* Deep-copy the string lists */ this_site->excludes = fnlist_deep_copy(default_site.excludes); this_site->ignores = fnlist_deep_copy(default_site.ignores); this_site->asciis = fnlist_deep_copy(default_site.asciis); this_site->prev = last_site; if (last_site != NULL) { /* next site */ last_site->next = this_site; } else { /* First site */ *sites = this_site; } this_site->name = ne_strdup(val); this_site->files = NULL; this_site->proto_string = ne_strdup(default_site.proto_string); /* Now work out the info filename */ this_site->infofile = ne_concat(copypath, val, NULL); this_site->certfile = ne_concat(copypath, val, ".crt", NULL); } else if (this_site == NULL) { ret = RC_CORRUPT; } else if (strcmp(key, "username") == 0) { /* username */ this_site->server.username = ne_strdup(val); } else if (strcmp(key, "server") == 0) { this_site->server.hostname = ne_strdup(val); } else if (strcmp(key, "port") == 0) { this_site->server.port = atoi(val); } else if (strcmp(key, "proxy-server") == 0) { this_site->proxy.hostname = ne_strdup(val); } else if (strcmp(key, "proxy-port") == 0) { this_site->proxy.port = atoi(val); } else if (strcmp(key, "proxy-password") == 0) { this_site->proxy.password = ne_strdup(val); } else if (strcmp(key, "proxy-username") == 0) { this_site->proxy.username = ne_strdup(val); } else if (strcmp(key, "password") == 0) { this_site->server.password = ne_strdup(val); } else if (strcmp(key, "url") == 0) { this_site->url = ne_strdup(val); } else if (strcmp(key, "remote") == 0) { /* Relative filenames must start with "~/" */ if (val[0] == '~') { if (val[1] == '/') { this_site->remote_isrel = true; } else { ret = RC_CORRUPT; } } else { /* Dirname doesn't begin with "~/" */ this_site->remote_isrel = false; } if (val[strlen(val)-1] != '/') strcat(val, "/"); this_site->remote_root_user = ne_strdup(val); } else if (strcmp(key, "local") == 0) { /* Relative filenames must start with "~/" */ if (val[0] == '~') { if (val[1] == '/') { this_site->local_isrel = true; } else { ret = RC_CORRUPT; } } else { /* Dirname doesn't begin with a "~/" */ this_site->local_isrel = false; } if (val[strlen(val)-1] != '/') strcat(val, "/"); this_site->local_root_user = ne_strdup(val); } else if (strcmp(key, "permissions") == 0) { if (strcmp(val, "ignore") == 0) { this_site->perms = sitep_ignore; this_site->dirperms = 0; } else if (strcmp(val, "exec") == 0) { this_site->perms = sitep_exec; } else if (strcmp(val, "all") == 0) { this_site->perms = sitep_all; } else if (strcmp(val, "dir") == 0) { this_site->dirperms = 1; } else { ret = RC_CORRUPT; } } else if (strcmp(key, "symlinks") == 0) { if (strcmp(val, "follow") == 0) { this_site->symlinks = sitesym_follow; } else if (strcmp(val, "maintain") == 0) { this_site->symlinks = sitesym_maintain; } else if (strcmp(val, "ignore") == 0) { this_site->symlinks = sitesym_ignore; } else { ret = RC_CORRUPT; } } else if (strcmp(key, "exclude") == 0) { struct fnlist *f = fnlist_prepend(&this_site->excludes); if (val[0] == '/') { f->pattern = ne_strdup(val+1); f->haspath = true; } else { f->pattern = ne_strdup(val); f->haspath = false; } } else if (strcmp(key, "ignore") == 0) { struct fnlist *f = fnlist_prepend(&this_site->ignores); if (val[0] == '/') { f->pattern = ne_strdup(val+1); f->haspath = true; } else { f->pattern = ne_strdup(val); f->haspath = false; } } else if (strcmp(key, "ascii") == 0) { struct fnlist *f = fnlist_prepend(&this_site->asciis); if (val[0] == '/') { f->pattern = ne_strdup(val+1); f->haspath = true; } else { f->pattern = ne_strdup(val); f->haspath = false; } } else if (strcmp(key, "protocol") == 0) { if (strcasecmp(val, "ftp") == 0) { this_site->protocol = siteproto_ftp; } else if (strcasecmp(val, "http") == 0 || strcasecmp(val, "dav") == 0 || strcasecmp(val, "webdav") == 0) { this_site->protocol = siteproto_dav; } else if (strcasecmp(val, "rsh") == 0) { this_site->protocol = siteproto_rsh; } else if (strcasecmp(val, "ssh") == 0) { this_site->protocol = siteproto_rsh; if (this_site->rsh_cmd == NULL) this_site->rsh_cmd = ne_strdup("ssh"); if (this_site->rcp_cmd == NULL) this_site->rcp_cmd = ne_strdup("scp"); } else if (strcasecmp(val, "sftp") == 0) { this_site->protocol = siteproto_sftp; } else { this_site->protocol = siteproto_unknown; } free(this_site->proto_string); this_site->proto_string = ne_strdup(val); } else if (strcmp(key, "ftp") == 0) { if (strcmp(val, "nopasv") == 0) { this_site->ftp_pasv_mode = false; } else if (strcmp(val, "showquit") == 0) { this_site->ftp_echo_quit = true; } else if (strcmp(val, "usecwd") == 0) { this_site->ftp_use_cwd = true; } else if (strcmp(val, "nousecwd") == 0) { this_site->ftp_use_cwd = false; } else { ret = RC_CORRUPT; } } else if (strcmp(key, "http") == 0) { if (strcmp(val, "expect") == 0) { this_site->http_use_expect = true; } else if (strcmp(val, "limit") == 0) { this_site->http_limit = true; } else if (strcmp(val, "secure") == 0) { this_site->http_secure = true; } else if (strcmp(val, "tolerant") == 0) { this_site->http_tolerant = true; } else { ret = RC_CORRUPT; } } else if (strcmp(key, "client-cert") == 0) { this_site->client_cert = ne_strdup(val); } else if (strcmp(key, "rsh") == 0) { this_site->rsh_cmd = ne_strdup(val); } else if (strcmp(key, "rcp") == 0) { this_site->rcp_cmd = ne_strdup(val); } else if (strcmp(key, "state") == 0) { if (strcmp(val, "checksum") == 0) { this_site->state_method = state_checksum; } else if (strcmp(val, "timesize") == 0) { this_site->state_method = state_timesize; } else { ret = RC_CORRUPT; } } else if (strcmp(key, "checkmoved") == 0) { if (strcmp(val, "renames") == 0) { this_site->checkrenames = true; this_site->checkmoved = true; } else { ret = RC_CORRUPT; } } else if (strcmp(key, "charset") == 0) { NE_DEBUG(DEBUG_RCFILE, "Ignored key %s\n", key); } else { /* Unknown key! */ ret = RC_CORRUPT; } } else { { ret = RC_CORRUPT; } } } fclose(fp); return ret; } #undef LINESIZE const char *rc_get_netrc_password(const char *server, const char *username) { netrc_entry *found; found = search_netrc(netrc_list, server); if (found == NULL) { return NULL; } if (strcmp(found->account, username) == 0) { return found->password; } else { return NULL; } } /* Returns zero if site is properly defined, else non-zero */ int rcfile_verify(struct site *any_site) { struct stat localst; char *temp; int ret; /* Protocol-specific checks first, since if a new protocol driver is used, * any of the other checks may be irrelevant. */ switch (any_site->protocol) { case siteproto_ftp: #ifdef USE_FTP any_site->driver = &ftp_driver; /* FTP checks */ if (any_site->symlinks == sitesym_maintain) { return SITE_NOMAINTAIN; } break; #else /* !USE_FTP */ return SITE_UNSUPPORTED; #endif /* USE_FTP */ case siteproto_dav: #ifdef USE_DAV any_site->driver = &dav_driver; /* HTTP checks */ if (any_site->remote_isrel) { return SITE_NOREMOTEREL; } if (any_site->perms == sitep_all || any_site->dirperms) { return SITE_NOPERMS; } if (any_site->symlinks == sitesym_maintain) { return SITE_NOMAINTAIN; } break; #else /* !USE_DAV */ return SITE_UNSUPPORTED; #endif /* USE_DAV */ case siteproto_rsh: #ifdef USE_RSH any_site->driver = &rsh_driver; /* FIXME: rsh checks? */ break; #else /* !USE_RSH */ return SITE_UNSUPPORTED; #endif /* USE_RSH */ case siteproto_sftp: #ifdef USE_SFTP any_site->driver = &sftp_driver; /* FIXME: sftp checks? */ break; #else /* !USE_SFTP */ return SITE_UNSUPPORTED; #endif /* USE_SFTP */ case siteproto_unknown: return SITE_UNSUPPORTED; } /* Valid options check */ if (any_site->checkrenames && (any_site->state_method != state_checksum)) { return SITE_NORENAMES; } /* Check they specified everything in the rcfile */ if (any_site->server.hostname == NULL) { return SITE_NOSERVER; } if (any_site->server.username != NULL && any_site->server.password == NULL) { if (havenetrc) { const char *pass; NE_DEBUG(DEBUG_RCFILE, "Checking netrc for password for %s@%s...", any_site->server.username, any_site->server.hostname); pass = rc_get_netrc_password(any_site->server.hostname, any_site->server.username); if (pass != NULL) { NE_DEBUG(DEBUG_RCFILE, "found!\n"); any_site->server.password = (char *) pass; } else { NE_DEBUG(DEBUG_RCFILE, "none found.\n"); } } } /* TODO: lookup proxy username/password in netrc too */ if (any_site->remote_root_user == NULL) { return SITE_NOREMOTEDIR; } else if (any_site->local_root_user == NULL) { return SITE_NOLOCALDIR; } /* Need a home directory if we're using relative local root */ if (home == NULL && any_site->local_root) return SITE_NOLOCALREL; /* Can't use safe mode and nooverwrite mode */ if (any_site->safemode && any_site->nooverwrite) return SITE_NOSAFEOVER; if (any_site->safemode && any_site->tempupload) return SITE_NOSAFETEMPUP; if (any_site->remote_isrel) { any_site->remote_root = ne_strdup(any_site->remote_root_user + 2); } else { any_site->remote_root = ne_strdup(any_site->remote_root_user); } if (any_site->local_isrel) { /* We skip the first char ('~') of l_r_u */ any_site->local_root = ne_concat(home, any_site->local_root_user + 1, NULL); } else { any_site->local_root = any_site->local_root_user; } /* Now check the local directory actually exists. * To do this, stat `/the/local/root/.', which will fail if the * can't read the directory or if it's a file not a directory */ temp = ne_concat(any_site->local_root, ".", NULL); ret = stat(temp, &localst); free(temp); if (ret != 0) { return SITE_ACCESSLOCALDIR; } if (any_site->client_cert && strncmp(any_site->client_cert, "~/", 2) == 0) { temp = ne_concat(home, any_site->client_cert + 1, NULL); ne_free(any_site->client_cert); any_site->client_cert = temp; } /* Assign default ports if they didn't bother to */ if (any_site->server.port == 0) { NE_DEBUG(DEBUG_RCFILE, "Lookup up default port:\n"); any_site->server.port = (*any_site->driver->get_server_port)(any_site); NE_DEBUG(DEBUG_RCFILE, "Using port: %d\n", any_site->server.port); } if (any_site->proxy.port == 0) { NE_DEBUG(DEBUG_RCFILE, "Lookup default proxy port...\n"); any_site->proxy.port = (*any_site->driver->get_proxy_port)(any_site); NE_DEBUG(DEBUG_RCFILE, "Using port %d\n", any_site->proxy.port); } /* TODO: ditto for proxy server */ return 0; } int init_netrc() { if (!havenetrc) return 0; netrc_list = parse_netrc(netrcfile); if (netrc_list == NULL) { /* Couldn't parse it */ return 1; } else { /* Could parse it */ return 0; } } /* Checks the perms of the rcfile and site storage directory. */ int init_paths() { struct stat st; if (stat(rcfile, &st) < 0) { NE_DEBUG(DEBUG_RCFILE, "stat failed on %s: %s\n", rcfile, strerror(errno)); return RC_OPENFILE; } #if !defined (__EMX__) && !defined(__CYGWIN__) if (!S_ISREG(st.st_mode)) { return RC_OPENFILE; } if ((st.st_mode & ~(S_IFREG | S_IREAD | S_IWRITE)) > 0) { return RC_PERMS; } #endif if ((netrcfile == 0) || (stat(netrcfile, &st) < 0)) { havenetrc = false; #if !defined (__EMX__) && !defined(__CYGWIN__) } else if ((st.st_mode & ~(S_IFREG | S_IREAD | S_IWRITE)) > 0) { return RC_NETRCPERMS; #endif } else { havenetrc = true; } if (stat(copypath, &st) < 0) { NE_DEBUG(DEBUG_RCFILE, "stat failed on %s: %s\n", copypath, strerror(errno)); return RC_DIROPEN; } #if !defined (__EMX__) && !defined(__CYGWIN__) if (st.st_mode & (S_IRWXG | S_IRWXO)) { return RC_DIRPERMS; } #endif return 0; } int init_env() { /* Assign default filenames if they didn't give us any */ home = getenv("HOME"); if (home == NULL) { if ((rcfile == NULL) || (copypath == NULL)) { /* We need a $HOME or both rcfile and info dir path */ return 1; } else { /* No $HOME, but we've got the rcfile and info dir path */ return 0; } } if (rcfile == NULL) { rcfile = ne_concat(home, RCNAME, NULL); } if (copypath == NULL) { copypath = ne_concat(home, COPYNAME, NULL); } netrcfile = ne_concat(home, NETRCNAME, NULL); return 0; } /* rcfile_write() by Lee Mallabone, cleaned by JO. * Write the contents of list_of_sites to the specified 'filename' * in the standard sitecopy rc format. * * Any data already in 'filename' is over-written. */ int rcfile_write (char *filename, struct site *list_of_sites) { struct site *current; struct fnlist *item; FILE *fp; fp = fopen (filename, "w"); if (fp == NULL) { printf ("There was a problem writing to the sitecopy configuration file.\n\nCheck permissions on %s.", filename); return RC_OPENFILE; } /* Set rcfile permissions properly */ #if !defined (__EMX__) && !defined(__CYGWIN__) if (fchmod (fileno(fp), 00600) == -1) { return RC_PERMS; } #endif for (current=list_of_sites; current!=NULL; current=current->next) { /* Okay so this maybe isn't the most intuitive thing to look at. * With any luck though, the rcfile's it produces will be. :) */ if (fprintf (fp, "site %s\n", current->name) == -1) { return RC_CORRUPT; } if (fprintf (fp, " server %s\n", current->server.hostname) == -1) { return RC_CORRUPT; } if ((current->server.username != NULL) && (strlen(current->server.username) > 0)) if (fprintf(fp, " username %s\n", current->server.username) == -1) { return RC_CORRUPT; } if ((current->server.password != NULL) && (strlen(current->server.password) > 0)) if (fprintf(fp, " password %s\n", current->server.password) == -1) { return RC_CORRUPT; } if (fprintf(fp, " remote %s\n local %s\n", current->remote_root_user, current->local_root_user) == -1) { return RC_CORRUPT; } if (fprintf (fp, " protocol %s\n", current->proto_string) == -1) { return RC_CORRUPT; } /* Makes sense to have protocol (ish) options after we specify * the protocol. Warning, if the http declarations in site_t * are ever surrounded by an ifdef USE_DAV, then this will need * to be changed. */ /* Write out the boolean fields */ #define RCWRITEBOOL(field,name) \ if ((field) && (fprintf(fp, " %s\n", name) == -1)) return RC_CORRUPT; RCWRITEBOOL(current->nodelete, "nodelete"); if (current->checkmoved) { if (current->checkrenames) { if (fprintf(fp, " checkmoved renames\n") == -1) return RC_CORRUPT; } else { if (fprintf(fp, " checkmoved\n") == -1) return RC_CORRUPT; } } RCWRITEBOOL(current->nooverwrite, "nooverwrite"); RCWRITEBOOL(current->safemode, "safe"); RCWRITEBOOL(current->lowercase, "lowercase"); RCWRITEBOOL(current->tempupload, "tempupload"); RCWRITEBOOL(!current->ftp_pasv_mode, "ftp nopasv"); RCWRITEBOOL(current->ftp_echo_quit, "ftp showquit"); RCWRITEBOOL(current->ftp_use_cwd, "ftp usecwd"); RCWRITEBOOL(current->http_limit, "http limit"); RCWRITEBOOL(current->http_use_expect, "http expect"); #undef RCWRITEBOOL if (current->server.port > 0) { /* Sanity check */ if (fprintf (fp, " port %d\n", current->server.port) == -1) { return RC_CORRUPT; } } /* Add the site's URL if one has been supplied. */ if (current->url) { if (fprintf (fp, " url %s\n", current->url) == -1) { return RC_CORRUPT; } } /* State method */ switch (current->state_method) { case (state_timesize): if (fprintf (fp, " state timesize\n") == -1) { return RC_CORRUPT; } break; case (state_checksum): if (fprintf (fp, " state checksum\n") == -1) { return RC_CORRUPT; } break; } /* Permissions now */ switch (current->perms) { case (sitep_ignore): if (fprintf (fp, " permissions ignore\n") == -1) { return RC_CORRUPT; } break; case (sitep_exec): if (fprintf (fp, " permissions exec\n") == -1) { return RC_CORRUPT; } break; case (sitep_all): if (fprintf (fp, " permissions all\n") == -1) { return RC_CORRUPT; } break; } if (current->dirperms) { if (fprintf(fp, " permissions dir\n") == -1) { return RC_CORRUPT; } } /* Sym link mode */ switch (current->symlinks) { case (sitesym_ignore): if (fprintf (fp, " symlinks ignore\n") == -1) { return RC_CORRUPT; } break; case (sitesym_follow): if (fprintf (fp, " symlinks follow\n") == -1) { return RC_CORRUPT; } break; case (sitesym_maintain): if (fprintf (fp, " symlinks maintain\n") == -1) { return RC_CORRUPT; } break; } #define DUMP_FNLIST(list, name) \ do {\ for (item = list; item != NULL; item = item->next) \ if (fprintf(fp, " " name " \"%s%s\"\n", item->haspath?"/":"", \ item->pattern) == -1) \ return RC_CORRUPT; \ } while(0) DUMP_FNLIST(current->excludes, "exclude"); DUMP_FNLIST(current->asciis, "ascii"); DUMP_FNLIST(current->ignores, "ignore"); #undef DUMP_FNLIST } if (fclose (fp) != 0) return RC_CORRUPT; return 0; } sitecopy-0.16.6/src/rcfile.h0000664000076400007640000001106310165765223014005 0ustar joejoe/* sitecopy, remote web site copy manager. Copyright (C) 1998-2002, Joe Orton This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef RCFILE_H #define RCFILE_H #include "sites.h" /* You MUST call the initialization functions in this order: * * init_env() - sets up rcfile, copypath etc global vars. * init_paths() - checks the rcfile permissions etc * init_netrc() - read the netrc if there is one * rcfile_read() - read the rcfile */ /* Filename of rcfile stored here */ extern char *rcfile; /* Filename of directory used to store info files */ extern char *copypath; /* rcfile_read: * Read the rcfile, filling the list pointed to by sites. * Returns 0 on success, or: * RC_OPENFILE if the rcfile could not be opened * RC_CORRUPT if the rcfile is not of valid syntax * When RC_CORRUPT is returned, then * rcfile_linenum is set to the line at which parsing stopped. * rcfile_err is set to the contents of that line. * When RC_OPENFILE is returned, * rcfile_err is set to the strerror(errno) */ extern int rcfile_linenum; extern char *rcfile_err; int rcfile_read(struct site **sites); /* Check the permission of the rcfile and storage directory. * Returns 0 on success, or: * RC_OPENFILE if the rcfile could not be stat'ed * RC_DIROPEN if the direcory could not be stat'ed * RC_PERMS if the rcfile had invalid permissions * RC_DIRPERMS if the directory had invalid permissions * RC_NETRCPERMS if the netrcfile had invalid permissions */ int init_paths(void); /* Initialize the rcfile, copypath, netrcfile variables from the * environment. * Returns 0 on success or 1 if the copypath */ int init_env(void); /* Read in the netrc file. * Return 0 on success or 1 if the .netrc could not be parsed. */ int init_netrc(void); /* Verify that the given site entry is correct, and fill in * missing bits as necessary (e.g. password from netrc, default * Returns 0 on success, or: * SITE_UNSUPPORTED if the protocol is not supported * SITE_NOSERVER if no server name has been specified * SITE_NOREMOTEDIR if no remote directory has been specified * SITE_NOLOCALDIR if no local directory has been specified * SITE_ACCESSLOCALDIR if the local directory is not readable * SITE_INVALIDPORT if an invalid port name has been specified * SITE_NOMAINTAIN if the proto driver doesn't support symlink maintain mode * SITE_NOREMOTEREL if the proto driver doesn't allow relative remote dirs * SITE_NOPERMS if the proto driver doesn't support permissions * SITE_NOLOCALREL if a local relative dir could not be used * SITE_NOSAFEOVER if they used nooverwrite mode and safe mode * SITE_NOSAFETEMPUP if they used tempupload and safe mode * SITE_NORENAMES if they want renames + not using state checksum */ int rcfile_verify(struct site *any_site); /* Writes the given sites list into the given rcfile. * This overwrites any previous contents of filename. * Returns 0 on success, or: * RC_OPENFILE if the file could not be opened for writing * RC_PERMS if the file permissions could not be set * RC_CORRUPT if there were errors while writing to the file */ int rcfile_write (char *filename, struct site *list_of_sites); /* Constants */ #define RC_OPENFILE 900 #define RC_CORRUPT 901 #define RC_PERMS 902 #define RC_DIRPERMS 903 #define RC_DIROPEN 904 #define RC_NETRCOPEN 905 #define RC_NETRCPERMS 906 #define SITE_NOSITE 901 #define SITE_NONAME 920 #define SITE_NOSERVER 921 #define SITE_NOREMOTEDIR 924 #define SITE_NOLOCALDIR 925 #define SITE_ACCESSLOCALDIR 926 #define SITE_INVALIDPORT 927 #define SITE_NOMAINTAIN 928 #define SITE_NOREMOTEREL 929 #define SITE_NOLOCALREL 930 #define SITE_NOPERMS 931 #define SITE_NOSAFEOVER 932 #define SITE_NORENAMES 933 #define SITE_NOSAFETEMPUP 934 #define SITE_NOSERVERCERT 935 #endif /* RCFILE_H */ sitecopy-0.16.6/src/lsparser.c0000664000076400007640000001560310327156443014371 0ustar joejoe/* 'ls' output parser, for rsh and ftp drivers Copyright (C) 1998-2005, Joe Orton 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. */ #include "config.h" #include #include #include #include #include #include #include "common.h" #include "lsparser.h" struct ls_context { int after_blank; char *topdir; char *curdir; const char *error; }; ls_context_t *ls_init(const char *dir) { ls_context_t *ctx = ne_malloc(sizeof *ctx); char *ptr; ctx->after_blank = 0; ctx->curdir = ne_strdup(""); ctx->topdir = ne_strdup(dir); ptr = ctx->topdir + strlen(ctx->topdir) - 1; if (*ptr == '/') *ptr = '\0'; NE_DEBUG(DEBUG_FTP, "ls: init, topdir: [%s]\n", ctx->topdir); return ctx; } void ls_destroy(ls_context_t *ctx) { ne_free(ctx->curdir); ne_free(ctx->topdir); ne_free(ctx); } /* Parse LINE of length LEN as a directory line. */ static enum ls_result parse_directory(ls_context_t *ctx, char *line, size_t len) { /* A new directory name indicator, which goes: * `directory/name/here:' * We want directory names as: * `directory/name/here/' * Hence a bit of messing about. */ ne_free(ctx->curdir); /* Skip a leading Windows drive specification */ if (len > 3 && isalpha(line[0]) && line[1] == ':' && line[2] == '/') { line += 2; } if (strncmp(line, ctx->topdir, strlen(ctx->topdir)) == 0) { line += strlen(ctx->topdir); } /* Skip a single . if .: */ if (strcmp(line,".:") == 0) { line++; } /* Skip a leading "./" */ if (strncmp(line, "./", 2) == 0) { line += 2; } /* Skip repeated '/' characters */ while (*line == '/') line++; line = ne_strdup(line); len = strlen(line); if (len > 1) { line[len-1] = '/'; /* change ':' to '/' */ } else { /* this is just the top-level directory... */ line[0] = '\0'; } ctx->curdir = line; NE_DEBUG(DEBUG_FTP, "ls: Now in directory: [%s]\n", ctx->curdir); return ls_nothing; } static inline char *skip_field(char *line) { while (*line != '\0' && *line != ' ') line++; while (*line != '\0' && *line == ' ') line++; return line; } /* Return mode bits for permissions string PERMS */ static mode_t parse_permissions(const char *perms) { mode_t ret = 0; const char *p = perms; while (*p) { ret <<= 1; if (*p != '-') { ret |= 1; } p++; } return ret & 0777; } static enum ls_result fail(ls_context_t *ctx, const char *errstr) { ctx->error = errstr; return ls_error; } /* Parse LINE of length LEN as a "file" line, placing result in *FILE */ static enum ls_result parse_file(ls_context_t *ctx, char *line, size_t len, struct ls_file *file) { char *perms, *size; perms = ne_token(&line, ' '); if (!line) return fail(ctx, "Missing token at beginning of line"); while (*line++ == ' ') /* nullop */; /* skip inode, user and group fields */ line = skip_field(skip_field(skip_field(line))); if (*line == '\0') { return fail(ctx, "Missing token in inode/user/group fields"); } size = ne_token(&line, ' '); if (!line) { return fail(ctx, "Missing token after inode/user/group fields"); } while (*line++ == ' ') /* nullop */; /* skip Month, day, time fields */ line = skip_field(skip_field(skip_field(line))); if (*line == '\0') { return fail(ctx, "Missing token after timestamp field"); } /* Bail out if this isn't a file or directory. */ if (perms[0] != '-' && perms[0] != 'd') { NE_DEBUG(DEBUG_FTP, "ls: ignored line\n"); return ls_nothing; } /* line now points at the last field, the filename. Reject any * relative filenames. */ if (strchr(line, '/') != NULL) { return fail(ctx, "Relative filename disallowed"); } if (perms[0] == '-') { /* Normal file */ file->mode = parse_permissions(perms); file->name = ne_concat(ctx->curdir, line, NULL); file->size = strtol(size, NULL, 10); NE_DEBUG(DEBUG_FTP, "ls: file (%03o, %" NE_FMT_OFF_T "): [%s]\n", file->mode, file->size, file->name); return ls_file; } else /* perms[0] == 'd' */ { if (strcmp(line, ".") == 0 || strcmp(line, "..") == 0) { return ls_nothing; } file->mode = parse_permissions(perms); file->name = ne_concat(ctx->curdir, line, NULL); NE_DEBUG(DEBUG_FTP, "ls: directory (%03o): %s\n", file->mode, file->name); return ls_directory; } } enum ls_result ls_parse(ls_context_t *ctx, char *line, struct ls_file *file) { size_t len; line = ne_shave(line, "\r\n\t "); len = strlen(line); NE_DEBUG(DEBUG_FTP, "ls: [%s]\n", line); if (len == 0) { ctx->after_blank = 1; return ls_nothing; } ctx->after_blank = 0; if (strncmp(line, "total ", 6) == 0) { /* ignore the line */ return ls_nothing; } if (line[len-1] == ':' && (ctx->after_blank || strchr(line, ' ') == NULL)) { return parse_directory(ctx, line, len); } else { return parse_file(ctx, line, len, file); } } const char *ls_geterror(ls_context_t *ctx) { return ctx->error; } void ls_pflist_add(struct proto_file **list, struct proto_file **tail, const struct ls_file *lsf, enum ls_result result) { struct proto_file *pf = ne_calloc(sizeof *pf); switch (result) { case ls_file: pf->filename = lsf->name; pf->mode = lsf->mode; pf->type = proto_file; pf->size = lsf->size; pf->next = *list; *list = pf; if (*tail == NULL) *tail = pf; break; case ls_directory: pf->filename = lsf->name; pf->mode = lsf->mode; pf->type = proto_dir; if (*tail == NULL) { *list = pf; } else { (*tail)->next = pf; } *tail = pf; break; default: ne_free(pf); break; } } sitecopy-0.16.6/src/i18n.h0000664000076400007640000000022510165765223013316 0ustar joejoe#undef _ #ifdef ENABLE_NLS #include #define _(str) gettext(str) #else #define _(str) (str) #endif /* ENABLE_NLS */ #define N_(str) (str) sitecopy-0.16.6/src/sites.h0000664000076400007640000005020110417262161013656 0ustar joejoe/* sitecopy, for managing remote web sites. Copyright (C) 1999-2006, Joe Orton This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef SITES_H #define SITES_H #include "config.h" /* Need this for off_t, mode_t etc */ #include #include #include /* for FILE * for the storage_file... unfortuntely */ #include "ne_ssl.h" /* for ne_ssl_certificate. */ #include "common.h" #include "protocol.h" /* Description of the sitecopy "Data Model" ---------------------------------------- SITES are made up of lists of FILES. A file can be a directory, a link, or an actual file, but, we call it a FILE, whichever of these it actually is. The "type" member of site_file indicates the file type. Several STATES are associated with each file. A state records all the relevant properties of a file *at a given point in time*: its filename, size, last modification time, checksum, file permissions, etc etc. Note that some properties are redundant for some files; e.g., a directory has no checksum, or link target. It is important to realize that a "filename" is a part of a file STATE, note merely another property of the file. This is because of the "at a given point in time" note... when a file is moved, its filename will change, but it is conceptually the same "file". The first state is the LOCAL STATE. This state is a direct mapping from the file on disk, to the file in memory. The second is the STORED STATE. This state is a copy of the local state of the file - as at the last update. By comparing the stored and local states of a file, we tell whether it needs to be updated or not. The third state is the SERVER STATE, which is only used for sites in 'safe mode'. This is a copy of the the state of the file *on the server*, as at the last update. It might help to think of the stored state as a snapshot of the file taken at the time of the last update. The server state IS different from the stored state, since, e.g. the last-modification time of an uploaded file on the server is different to that locally. Try it with an FTP client. pre-0.9.0, we used to call the 'stored state' remotetime and remotesize. But they were misnomers, because they were nothing to do with the real remote modtime and the real remote size. A slightly confusing flag is "file->ignored". EXCLUDED files (which match a regex in site->excludes) are never added to the files list. IGNORED files *are* added to the list, hence this flag. In update mode, a changed file which is "ignored" is NOT uploaded to the remote site. This is the ONLY effect of the ignored flag. */ /* We don't currently use the 'server state' to its full potential... only storing the server modification time. It would be possible to do more clever things with this, such as use HTTP Etags, or the HTTP Content-MD5 etc. There is a fourth state: The 'live state', or 'remote state', which is the actual state of the file as held on the server (the complement of the local state, as the server state is the complement of the stored state). This can be used to do a 'verify' mode for sites with safety turned on: -> run across the entire remote site, grabbing the file state into 'live state', like fetch mode except fetch mode writes it into 'stored state'. -> if serverstate and livestate differ, scream blue murder. */ /* Within a given site, the site roots are the same for all files locally and remotely. The site roots may be 0-length, eg. for FTP sites where the home (login) directory is the site root directory. The root directories are stored as three members of site. ->foo_root, ->foo_root_user, ->foo_root_isrel. (where foo is remote or local) ->foo_root_user is what the user enters as the root in the rcfile. This may have a ~/ prefix to indicate the root is to be taken relative to the login directory. This is translated into a usable version, in ->foo_root. foo_roo_isrel is true if this is a relative directory (i.e., ->foo_root_user has a ~/ prefix). Example: ->local_root_user = "~/html/mysite/" ->local_root = "/home/ego/html/mysite/" ->local_root_isrel = true; ->remote_root_user = "/mydir/" ->remote_root = "/mydir/" ->remote_root_isrel = false; */ /* The different methods of defining the state of a file at a given moment in time are: - modification time and size - checksum of contents - link target The method chosen dictates when we need to update the remote copy of the site. For a given file, exactly ONE method is used to define state. The same method is used for all files of the same type in any given site. For link files, the linktarget is always used. For normal files, the user chooses between using modification time and file size, or checksumming - on a per-site basis. For 'link' files, the 'link target' determines the state - only when the link target changes, does the remote site need updating. Checksumming allows you to do random things to the modification time, which is what RCS users want. But, it's a muuuch slower than time/size. Also, moved files can be spotted more accurately using checksums. */ /* Filename handling ----------------- The filename of a state is relative to the site root. It has no leading slash, and directories do not have a trailing slash. If a state "does not exist" (i.e. state.exists == false), then the filename is undefined. If it does exist (i.e. exists == true), then the filename is guaranteed to be defined. This makes filename handling in the frontend slightly awkward, since for any given file, determining its filename entails checking it's diff. Consequently, the "file_name" function is provided, which, given a file, returns the stored filename of a deleted file (since file->local.filename is undefined), and otherwise the local filename. To operate on the local filesystem and on the remote site via the protocol driver, the file_full_remote and file_full_local functions are used. Given a file state, these functions return the filename that should be used to manipulate that file remotely and locally. These functions must only be used for states which exist (i.e., have a filename); otherwise they will dereference NULL pointers. For this reason, the use of these functions in the frontend is not encouraged. */ /* Return codes for site_update/fetch/synch */ /* updated okay */ #define SITE_OK 0 /* could not resolve hostname */ #define SITE_LOOKUP -1 /* Could not resolve hostname of proxy server */ #define SITE_PROXYLOOKUP -2 /* could not connect to remote host */ #define SITE_CONNECT -3 /* there were some errors when updating */ #define SITE_ERRORS -4 /* Could not authenticate user on server */ #define SITE_AUTH -5 /* Could not authenticate user on proxy server */ #define SITE_PROXYAUTH -6 /* Operation failed */ #define SITE_FAILED -7 /* Unsupported operation / protocol */ #define SITE_UNSUPPORTED -9 /* For use by the frontend ONLY - never returned by site_* */ #define SITE_ABORTED -101 struct site_file; struct site; /* Which state method is in use over the site */ enum state_method { state_timesize, state_checksum }; enum file_diff { file_unchanged, /* Remote file is same as local file */ file_changed, /* File has changed locally, and should be uploaded */ file_new, /* File is new locally, and should be uploaded */ file_deleted, /* File deleted locally, and should be deleted remotely */ file_moved /* File has been moved locally, should be moved remotely */ }; enum file_type { file_file, file_dir, file_link }; struct file_state { char *filename; /* the file name */ time_t time; /* the last-modification time of the file */ off_t size; /* the size of the file */ unsigned char checksum[16]; /* the MD5 checksum of the file */ char *linktarget; /* the target of the link */ unsigned int exists; /* whether the file exists in this state or not */ unsigned int ascii; /* whether the file is 'ASCII' or not */ mode_t mode; /* the protection modes & 0777 of the file */ }; /* To Consider: * * - The directory is identical among many files - make a site_dir * structure, sharing the char *. This could include a depth, which * could enable 'forcecd' mode for relative remote directories more * easily. This could also pave the way for checking whether a whole * directory has moved. * */ /* File representation */ struct site_file { /* The diff between the local and stored states. */ enum file_diff diff; /* The diff between the server and live states. */ enum file_diff live_diff; enum file_type type; unsigned int ignore; /* whether to ignore any changes to this file */ /* Probably want to make the states into an array, so they can be * indexed and used more generically than this. e.g.: * struct file_state states[4]; * struct file_state *local, *stored, *server, *live; * In file_create, set ->local = ->states[0], * ->stored = ->states[1] etc etc. * This allows file_set_local and file_set_stored to be * abstracted out. Should also allow the abstract file_set to be * used for site_verify. */ struct file_state local, stored, server, live; /* Linked list nodes */ struct site_file *next; struct site_file *prev; }; /* Valid file permissions mirroring values */ enum site_perm_modes { sitep_ignore, /* Ignore file permissions */ sitep_exec, /* Maintain execute permissions */ sitep_all /* Maintain all permissions */ }; /* Valid symlink handling modes */ enum site_symlink_modes { sitesym_ignore, sitesym_follow, sitesym_maintain }; /* Protocol modes */ enum site_protocol_modes { siteproto_ftp, siteproto_dav, siteproto_rsh, siteproto_sftp, siteproto_unknown }; /* fnlist - lists of fnmatch() patterns ------------------------------------ There are two types of pattern - patterns with paths, and patterns without paths. The rcfile entry exclude "/backup/back*" excludes files matching back* in the asda/ directory of the site. Whereas, the entry exclude *~ excludes ALL files matching *~ throughout the site. Internally, the leading slash of with-path patterns must be stripped, since they are used match against filenames, which don't have a leading slash. If the pattern *did* have a leading slash, then the 'haspath' field must be set to 'true'. e.g. exclude *.txt exclude /asda/back* -> fnlist list: { "*.txt", false, ... } , { "asda/back*", true, ... } */ struct fnlist { char *pattern; unsigned int haspath; struct fnlist *next; struct fnlist *prev; }; struct site_host { char *hostname; int port; char *username; char *password; }; /* This represents a site */ struct site { char *name; /* symbolic name for site */ char *url; /* URL for site - used by flatlist mode */ struct site_host server; struct site_host proxy; enum site_protocol_modes protocol; char *proto_string; /* protocol name used in rcfile. */ const struct proto_driver *driver; /* the protocol driver routines */ char *remote_root; /* root directory of site on server */ char *remote_root_user; /* what the user gave/sees as the remote root */ unsigned int remote_isrel; /* is the remote root dir relative to login dir? (~/) */ char *local_root; /* root directory of site locally */ char *local_root_user; /* what the user gave/sees as the remote root */ unsigned int local_isrel; /* is the local root directory relative to home dir */ char *infofile; /* local storage file in ~/.sitecopy/ */ char *certfile; /* file in which cached SSL certificate is stored. */ FILE *storage_file; /* The file opened for the storage file */ char *client_cert; /* client certificate */ ne_ssl_certificate *server_cert; /* pre-cached server cert */ /* Options for the site */ enum site_perm_modes perms; /* permissions maintenance mode */ int dirperms; /* directory permissions maintenance mode */ enum site_symlink_modes symlinks; /* symlink handline mode */ /* Protocol-driver specific options here */ unsigned int ftp_pasv_mode; unsigned int ftp_echo_quit; unsigned int ftp_forcecd; unsigned int ftp_use_cwd; unsigned int http_use_expect; unsigned int http_limit; unsigned int http_secure; unsigned int http_tolerant; char *rsh_cmd; char *rcp_cmd; unsigned int nodelete; /* whether to delete any files remotely */ unsigned int checkmoved; /* whether to check for moved files */ unsigned int checkrenames; /* whether to check for renamed files */ unsigned int nooverwrite; /* whether to delete changed files before overwriting */ unsigned int safemode; /* whether we are in safe mode or not */ unsigned int lowercase; /* whether to use all-lowercase filenames remotely */ unsigned int tempupload; /* whether to use temporary files when uploading */ /* These are parameters to site_update really. */ unsigned int keep_going; /* if true, keep going past errors in updates */ unsigned int use_this; /* whether the site is being operated on - handy * for the console FE */ /* We have two 'is_different' fields. This is unintuitive, since * if the local site is different from the remote site, the * reverse must also be true, right? Wrong, because of 'ignores' * and 'nodelete': using these, a change can be made to the local * site which will NOT be mirrored by update mode, but WILL be * affected by synch mode. */ unsigned int local_is_different; /* use this if you want to know whether * site_synch will do anything */ unsigned int remote_is_different; /* use this if you want to know whether * site_update will do anything */ enum state_method state_method; /* as dictated by rcfile */ enum state_method stored_state_method; /* as used in info file */ /* Files which are excluded */ struct fnlist *excludes; /* Files which are ignored */ struct fnlist *ignores; /* Files which are ASCII */ struct fnlist *asciis; struct site_file *files; /* list of files */ struct site_file *files_tail; /* end of the list */ /* Some useful counts for the files */ int numnew; /* number of new files */ int numchanged; /* number of changed files */ int numignored; /* number of changed files which are being ignored */ int numdeleted; /* number of deleted files */ int nummoved; /* number of moved files */ int numunchanged; /* number of unchanged files */ off_t totalnew; /* total file size of new files */ off_t totalchanged; /* total file size of changed files */ char *last_error; /* "Critical section" handling: do NOT modify */ int critical; struct site *next; struct site *prev; }; /* The list of all sites as read from the rcfile */ extern struct site *all_sites; /* Open the storage file for writing, pre-update. * Returns site->storage_file or NULL on error. */ FILE *site_open_storage_file(struct site *site); int site_close_storage_file(struct site *site); void fe_initialize(void); /* This reads the files information for the given site - both the * local and remote ones. Returns: * SITE_OK on success * SITE_ERRORS on corrupt info file * SITE_FAILED on non-existent info file */ int site_readfiles(struct site *); /* This makes out like we've just done a successful site_update. */ /* This writes the stored files list back to disk. * Returns 0 on success or -1 on failure. */ int site_write_stored_state(struct site *); /* This merges the stored files list in the storage file with the * in-memory files list of the site. Returns: * SITE_OK on success * SITE_ERRORS on corrupt info file * SITE_FAILED on non-existent info file */ int site_read_stored_state(struct site *site); /* This merges the local files on disk with the in-memory files list * of the site. */ void site_read_local_state(struct site *site); /* Initialize the site - pretend there are NO files held remotely */ void site_initialize(struct site *); /* Catch up the site - mark all files as updated remotely */ void site_catchup(struct site *site); /* Verify that that the stored state of the remote site matches the * actual make up of the remote site. Returns: * SITE_OK if states match up * SITE_ERRORS if states do not match * SITE_FAILED if the comparison could not begin (e.g. auth failure). * * If SITE_ERRORS is returned, then *numremoved is set to the number * of files missing from the server, and fe_verified() will have been * called for any changed or added to the remote site. */ int site_verify(struct site *site, int *numremoved); /* Update the remote site. * fe_updating, fe_updated, fe_setting_perms, fe_set_perms may be * called during the update. fe_can_update may be called during the * update if site->prompting is set. * * Returns: * SITE_ERRORS if an error occurred which was reported using * the fe_update_* functions. site->last_error is undefined. * SITE_FAILED if the update never began, and you should * look at site->last_error for the error message. * SITE_* for other errors. site->last_error is undefined. */ int site_update(struct site *site); /* Finds a site with the given name, and returns a pointer to it. * If no site of given name is found, returns NULL */ struct site *site_find(const char *sitename); /* Syncronizes the local site with the remote copy. * fe_synch_* will be called during the synchronize. * * Returns: * SITE_ERRORS if an error occurred which was reported using * the fe_* functions. * SITE_FAILED if the update never began, and you should * look at site->last_error for the error message. * SITE_* for other errors. * */ int site_synch(struct site *site); /* Updates the files listing from the remote site. * * fe_fetch_found() will be called for each file that is found * in the fetch. If the site is using checksumming, after the fe_fetch_found * calls are made, fe_checksumming/fe_checksummed call pairs will be made * for each file on the remote site. * Returns: * SITE_ERRORS if an error occurred which was reported using * the fe_* functions. * SITE_FAILED if the update never began, and you should * look at site->last_error for the error message. * SITE_* for other errors. */ int site_fetch(struct site *site); /* Destroys all the files... use before doing a second * site_readfiles on a site. */ void site_destroy(struct site *the_site); /* Destroys the stored state of the site. Use before calling * site_fetch, or site_read_stored_state. */ void site_destroy_stored(struct site *site); /* Outputs the flat listing style output for the given site * to the given stream */ void site_flatlist(FILE *f, struct site *the_site); /* Returns a pseudo-URL for the given site, in a statically allocated * memory location which will be overwritten by subsequent calls to * the function. (-> NOT thread-safe) */ const char *site_pseudourl(struct site *the_site); char *file_full_remote(struct file_state *state, struct site *site); char *file_full_local(struct file_state *state, struct site *site); char *file_name(const struct site_file *file); struct fnlist *fnlist_prepend(struct fnlist **list); struct fnlist *fnlist_deep_copy(const struct fnlist *src); const char *site_get_protoname(struct site *site); #endif /* SITES_H */ sitecopy-0.16.6/src/rshdriver.c0000664000076400007640000001610710260175456014547 0ustar joejoe/* sitecopy rsh/rcp protocol driver module Copyright (C) 2000-2005, Joe Orton Copyright (C) 2003, Nobuyuki Tsuchimura 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. */ /* TODO: * - At least fork/exec to save a sh process * - Do something with stdout * - Lee M says ssh will prompt for passwords on stdout, so we'd have to * parse the output and frig appropriately. * - Dave K: actually it prompts on stderr */ #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDARG_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #include "protocol.h" #include "lsparser.h" typedef struct { struct site *site; const char *rsh_cmd, *rcp_cmd; char buf[BUFSIZ]; char err[BUFSIZ]; FILE *fp; } rsh_session; enum rcommand { RCP, RSH, RSH_PIPE_READ, RSH_PIPE_WRITE }; static int run_rcmd(enum rcommand rcmd, rsh_session *sess, const char *template, ...) ne_attribute((format (printf, 3, 4))); static int run_rcmd(enum rcommand rcmd, rsh_session *sess, const char *template, ...) { va_list params; char *cmd; size_t len; char *username = sess->site->server.username; va_start(params, template); len = ne_vsnprintf(sess->buf, BUFSIZ, template, params); va_end(params); if (rcmd == RCP) { cmd = ne_concat(sess->rcp_cmd, " 2>/dev/null ", sess->buf, NULL); } else if (username) { cmd = ne_concat(sess->rsh_cmd, " -l ", username, " 2>/dev/null ", sess->site->server.hostname, " ", sess->buf, NULL); } else { cmd = ne_concat(sess->rsh_cmd, " 2>/dev/null ", sess->site->server.hostname, " ", sess->buf, NULL); } NE_DEBUG(DEBUG_RSH, "rcmd: %s\n", cmd); if (rcmd == RSH_PIPE_READ || rcmd == RSH_PIPE_WRITE) { sess->fp = popen(cmd, rcmd == RSH_PIPE_READ ? "r" : "w"); return sess->fp != NULL ? SITE_OK : SITE_FAILED; } else { return system(cmd) == 0 ? SITE_OK : SITE_FAILED; } } static int run_finish(rsh_session *sess) { return pclose(sess->fp) == 0 ? SITE_OK : SITE_FAILED; } static int init(void **session, struct site *site) { rsh_session *sess = ne_calloc(sizeof *sess); *session = sess; if (site->rsh_cmd) { sess->rsh_cmd = site->rsh_cmd; } else { sess->rsh_cmd = "rsh"; } if (site->rcp_cmd) { sess->rcp_cmd = site->rcp_cmd; } else { sess->rcp_cmd = "rcp"; } sess->site = site; return SITE_OK; } static void finish(void *session) { rsh_session *sess = session; free(sess); } static int file_move(void *session, const char *from, const char *to) { rsh_session *sess = session; return run_rcmd(RSH, sess, "mv '%s' '%s'", from, to); } static int file_upload(void *session, const char *local, const char *remote, int ascii) { rsh_session *sess = session; if (sess->site->server.username) { return run_rcmd(RCP, sess, "'%s' '%s@%s:%s'", local, sess->site->server.username, sess->site->server.hostname, remote); } else { return run_rcmd(RCP, sess, "'%s' '%s:%s'", local, sess->site->server.hostname, remote); } } static int file_upload_cond(void *session, const char *local, const char *remote, int ascii, time_t t) { return SITE_UNSUPPORTED; } static int file_get_modtime(void *sess, const char *remote, time_t *modtime) { return SITE_UNSUPPORTED; } static int file_download(void *sess, const char *local, const char *remote, int ascii) { return SITE_UNSUPPORTED; } static int file_read(void *session, const char *remote, ne_block_reader reader, void *userdata) { rsh_session *sess = session; size_t len; if (run_rcmd(RSH_PIPE_READ, sess, "cat '%s'", remote) != SITE_OK) return SITE_FAILED; while ((len = fread(sess->buf, 1, BUFSIZ, sess->fp)) > 0) { reader(userdata, sess->buf, len); } return run_finish(sess); } static int file_delete(void *session, const char *filename) { rsh_session *sess = session; return run_rcmd(RSH, sess, "rm '%s'", filename); } static int file_chmod(void *session, const char *fname, const mode_t mode) { rsh_session *sess = session; return run_rcmd(RSH, sess, "chmod %03o '%s'", mode, fname); } static int dir_create(void *session, const char *dirname) { rsh_session *sess = session; return run_rcmd(RSH, sess, "mkdir '%s'", dirname); } static int dir_remove(void *session, const char *dirname) { rsh_session *sess = session; return run_rcmd(RSH, sess, "rmdir '%s'", dirname); } static const char *error(void *session) { return "An error occurred."; } static int get_dummy_port(struct site *site) { return 0; } static int rsh_fetch(rsh_session *sess, const char *startdir, struct proto_file **list) { struct proto_file *tail = NULL; int success = SITE_OK; ls_context_t *lsctx = ls_init(startdir); memset(sess->buf, 0, BUFSIZ); while (fgets(sess->buf, BUFSIZ, sess->fp) != NULL) { enum ls_result res; struct ls_file lfile; res = ls_parse(lsctx, sess->buf, &lfile); switch (res) { case ls_error: NE_DEBUG(DEBUG_RSH, "Could not parse line.\n"); success = SITE_ERRORS; break; default: ls_pflist_add(list, &tail, &lfile, res); break; } } ls_destroy(lsctx); NE_DEBUG(DEBUG_RSH, "Fetch finished successfully.\n"); return run_finish(sess); } static int fetch_list(void *session, const char *dirname, int need_modtimes, struct proto_file **files) { rsh_session *sess = session; int ret; ret = run_rcmd(RSH_PIPE_READ, sess, "ls -la '%s'", dirname); if (ret == SITE_OK) { ret = rsh_fetch(sess, dirname, files); } return ret; } /* The protocol drivers */ const struct proto_driver rsh_driver = { init, finish, file_move, file_upload, file_upload_cond, file_get_modtime, file_download, file_read, file_delete, file_chmod, dir_create, dir_remove, NULL, /* create link */ NULL, /* change link target */ NULL, /* delete link */ fetch_list, /* fetch list. */ error, get_dummy_port, get_dummy_port, "rsh/rcp" }; sitecopy-0.16.6/m4/0000775000076400007640000000000011037462341012112 5ustar joejoesitecopy-0.16.6/m4/neon/0000775000076400007640000000000011037462342013052 5ustar joejoesitecopy-0.16.6/m4/neon/neon.m40000664000076400007640000011002010766307013014246 0ustar joejoe# Copyright (C) 1998-2008 Joe Orton -*- autoconf -*- # Copyright (C) 2004 Aleix Conchillo Flaque # # This file is free software; you may copy and/or distribute it with # or without modifications, as long as this notice is preserved. # This software is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. # The above license applies to THIS FILE ONLY, the neon library code # itself may be copied and distributed under the terms of the GNU # LGPL, see COPYING.LIB for more details # This file is part of the neon HTTP/WebDAV client library. # See http://www.webdav.org/neon/ for the latest version. # Please send any feedback to # # Usage: # # NEON_LIBRARY # or NEON_BUNDLED(srcdir, [ACTIONS-IF-BUNDLED], [ACTIONS-IF-NOT_BUNDLED]) # or NEON_VPATH_BUNDLED(srcdir, builddir, # [ACTIONS-IF-BUNDLED], [ACTIONS-IF-NOT-BUNDLED]) # # where srcdir is the location of bundled neon 'src' directory. # If using a VPATH-enabled build, builddir is the location of the # build directory corresponding to srcdir. # # If a bundled build *is* being used, ACTIONS-IF-BUNDLED will be # evaluated. These actions should ensure that 'make' is run # in srcdir, and that one of NEON_NORMAL_BUILD or NEON_LIBTOOL_BUILD # is called. # # After calling one of the above macros, if the NEON_NEED_XML_PARSER # variable is set to "yes", then you must configure an XML parser # too. You can do this your own way, or do it easily using the # NEON_XML_PARSER() macro. Example usage for where we have bundled the # neon sources in a directory called libneon, and bundled expat # sources in a directory called 'expat'. # # NEON_BUNDLED(libneon, [ # NEON_XML_PARSER(expat) # NEON_NORMAL_BUILD # ]) # # Alternatively, for a simple standalone app with neon as a # dependancy, use just: # # NEON_LIBRARY # # and rely on the user installing neon correctly. # # You are free to configure an XML parser any other way you like, # but the end result must be, either expat or libxml will get linked # in, and HAVE_EXPAT or HAVE_LIBXML is defined appropriately. # # To set up the bundled build environment, call # # NEON_NORMAL_BUILD # or # NEON_LIBTOOL_BUILD # # depending on whether you are using libtool to build, or not. # Both these macros take an optional argument specifying the set # of object files you wish to build: if the argument is not given, # all of neon will be built. AC_DEFUN([NEON_BUNDLED],[ neon_bundled_srcdir=$1 neon_bundled_builddir=$1 NEON_COMMON_BUNDLED([$2], [$3]) ]) AC_DEFUN([NEON_VPATH_BUNDLED],[ neon_bundled_srcdir=$1 neon_bundled_builddir=$2 NEON_COMMON_BUNDLED([$3], [$4]) ]) AC_DEFUN([NEON_COMMON_BUNDLED],[ AC_PREREQ(2.50) AC_ARG_WITH(included-neon, AS_HELP_STRING([--with-included-neon], [force use of included neon library]), [neon_force_included="$withval"], [neon_force_included="no"]) NEON_COMMON # The colons are here so there is something to evaluate # in case the argument was not passed. if test "$neon_force_included" = "yes"; then : $1 else : $2 fi ]) dnl Not got any bundled sources: AC_DEFUN([NEON_LIBRARY],[ AC_PREREQ(2.50) neon_force_included=no neon_bundled_srcdir= neon_bundled_builddir= NEON_COMMON ]) AC_DEFUN([NE_DEFINE_VERSIONS], [ NEON_VERSION="${NE_VERSION_MAJOR}.${NE_VERSION_MINOR}.${NE_VERSION_PATCH}${NE_VERSION_TAG}" AC_DEFINE_UNQUOTED([NEON_VERSION], ["${NEON_VERSION}"], [Define to be the neon version string]) AC_DEFINE_UNQUOTED([NE_VERSION_MAJOR], [(${NE_VERSION_MAJOR})], [Define to be neon library major version]) AC_DEFINE_UNQUOTED([NE_VERSION_MINOR], [(${NE_VERSION_MINOR})], [Define to be neon library minor version]) AC_DEFINE_UNQUOTED([NE_VERSION_PATCH], [(${NE_VERSION_PATCH})], [Define to be neon library patch version]) ]) AC_DEFUN([NE_VERSIONS_BUNDLED], [ # Define the current versions. NE_VERSION_MAJOR=0 NE_VERSION_MINOR=28 NE_VERSION_PATCH=2 NE_VERSION_TAG= # 0.28.x is backwards-compatible with 0.27.x, so AGE=1 NE_LIBTOOL_VERSINFO="28:${NE_VERSION_PATCH}:1" NE_DEFINE_VERSIONS ]) dnl Adds an ABI variation tag which will be added to the SONAME of dnl a shared library. e.g. NE_ADD_ABITAG(FOO) AC_DEFUN([NE_ADD_ABITAG], [ : Disabled for 0.28 to retain 0.27 ABI ]) dnl Define the minimum required versions, usage: dnl NE_REQUIRE_VERSIONS([major-version], [minor-versions]) dnl e.g. dnl NE_REQUIRE_VERSIONS([0], [24 25]) dnl to require neon 0.24.x or neon 0.25.x. AC_DEFUN([NE_REQUIRE_VERSIONS], [ m4_define([ne_require_major], [$1]) m4_define([ne_require_minor], [$2]) ]) dnl Check that the external library found in a given location dnl matches the min. required version (if any). Requires that dnl NEON_CONFIG be set the the full path of a valid neon-config dnl script dnl dnl Usage: dnl NEON_CHECK_VERSION(ACTIONS-IF-OKAY, ACTIONS-IF-FAILURE) dnl AC_DEFUN([NEON_CHECK_VERSION], [ m4_ifdef([ne_require_major], [ # Check whether the library is of required version ne_save_LIBS="$LIBS" ne_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`" LIBS="$LIBS `$NEON_CONFIG --libs`" ne_libver=`$NEON_CONFIG --version | sed -e "s/neon //g"` # Check whether it's possible to link against neon AC_CACHE_CHECK([linking against neon], [ne_cv_lib_neon], [AC_LINK_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[ne_version_match(0, 0);]])], [ne_cv_lib_neon=yes], [ne_cv_lib_neon=no])]) if test "$ne_cv_lib_neon" = "yes"; then ne_cv_lib_neonver=no for v in ne_require_minor; do case $ne_libver in ne_require_major.$v.*) ne_cv_lib_neonver=yes ;; esac done fi ne_goodver=$ne_cv_lib_neonver LIBS=$ne_save_LIBS CFLAGS=$ne_save_CFLAGS ], [ # NE_REQUIRE_VERSIONS not used; presume all versions OK! ne_goodver=yes ne_libver="(version unknown)" ]) if test "$ne_goodver" = "yes"; then AC_MSG_NOTICE([using neon library $ne_libver]) $1 else AC_MSG_NOTICE([incompatible neon library version $ne_libver: wanted ne_require_major.ne_require_minor]) $2 fi]) dnl NEON_CHECK_SUPPORT(feature, var, name) AC_DEFUN([NEON_CHECK_SUPPORT], [ if $NEON_CONFIG --support $1 >/dev/null; then NE_ENABLE_SUPPORT($2, [$3 is supported by neon]) else NE_DISABLE_SUPPORT($2, [$3 is not supported by neon]) fi ]) dnl enable support for feature $1 with define NE_HAVE_$1, message $2 AC_DEFUN([NE_ENABLE_SUPPORT], [ NE_FLAG_$1=yes AC_SUBST(NE_FLAG_$1) AC_DEFINE([NE_HAVE_]$1, 1, [Defined if $1 is supported]) m4_if([$2], [], [ne_$1_message="support enabled" AC_MSG_NOTICE([$1 support is enabled])], [ne_$1_message="$2" AC_MSG_NOTICE([$2])]) ]) dnl Disable support for feature $1, giving message $2 AC_DEFUN([NE_DISABLE_SUPPORT], [ NE_FLAG_$1=no AC_SUBST(NE_FLAG_$1) m4_if([$2], [], [ne_$1_message="not supported" AC_MSG_NOTICE([$1 support is not enabled])], [ne_$1_message="$2" AC_MSG_NOTICE([$2])]) ]) AC_DEFUN([NEON_USE_EXTERNAL], [ # Configure to use an external neon, given a neon-config script # found at $NEON_CONFIG. neon_prefix=`$NEON_CONFIG --prefix` NEON_CHECK_VERSION([ # Pick up CFLAGS and LIBS needed CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`" NEON_LIBS="$NEON_LIBS `$NEON_CONFIG --libs`" # Pick up library version set dummy `$NEON_CONFIG --version | sed 's/\./ /g'` NE_VERSION_MAJOR=[$]3; NE_VERSION_MINOR=[$]4; NE_VERSION_PATCH=[$]5 NE_DEFINE_VERSIONS neon_library_message="library in ${neon_prefix} (${NEON_VERSION})" neon_xml_parser_message="using whatever neon uses" NEON_CHECK_SUPPORT([ssl], [SSL], [SSL]) NEON_CHECK_SUPPORT([zlib], [ZLIB], [zlib]) NEON_CHECK_SUPPORT([ipv6], [IPV6], [IPv6]) NEON_CHECK_SUPPORT([lfs], [LFS], [LFS]) NEON_CHECK_SUPPORT([socks], [SOCKS], [SOCKSv5]) NEON_CHECK_SUPPORT([ts_ssl], [TS_SSL], [thread-safe SSL]) neon_got_library=yes if test $NE_FLAG_LFS = yes; then NEON_FORMAT(off64_t) AC_DEFINE_UNQUOTED([NE_FMT_NE_OFF_T], [NE_FMT_OFF64_T], [Define to be printf format string for ne_off_t]) else AC_DEFINE_UNQUOTED([NE_FMT_NE_OFF_T], [NE_FMT_OFF_T]) fi ], [neon_got_library=no]) ]) AC_DEFUN([NEON_COMMON],[ AC_REQUIRE([NEON_COMMON_CHECKS]) AC_ARG_WITH(neon, [ --with-neon[[=DIR]] specify location of neon library], [case $withval in yes|no) neon_force_external=$withval; neon_ext_path= ;; *) neon_force_external=yes; neon_ext_path=$withval ;; esac;], [ neon_force_external=no neon_ext_path= ]) if test "$neon_force_included" = "no"; then # There is no included neon source directory, or --with-included-neon # wasn't given (so we're not forced to use it). # Default to no external neon. neon_got_library=no if test "x$neon_ext_path" = "x"; then AC_PATH_PROG([NEON_CONFIG], neon-config, none) if test "x${NEON_CONFIG}" = "xnone"; then AC_MSG_NOTICE([no external neon library found]) elif test -x "${NEON_CONFIG}"; then NEON_USE_EXTERNAL else AC_MSG_NOTICE([ignoring non-executable ${NEON_CONFIG}]) fi else AC_MSG_CHECKING([for neon library in $neon_ext_path]) NEON_CONFIG="$neon_ext_path/bin/neon-config" if test -x ${NEON_CONFIG}; then AC_MSG_RESULT([found]) NEON_USE_EXTERNAL else AC_MSG_RESULT([not found]) # ...will fail since force_external=yes fi fi if test "$neon_got_library" = "no"; then if test $neon_force_external = yes; then AC_MSG_ERROR([could not use external neon library]) elif test -n "$neon_bundled_srcdir"; then # Couldn't find external neon, forced to use bundled sources neon_force_included="yes" else # Couldn't find neon, and don't have bundled sources AC_MSG_ERROR(could not find neon) fi fi fi if test "$neon_force_included" = "yes"; then NE_VERSIONS_BUNDLED AC_MSG_NOTICE([using bundled neon ($NEON_VERSION)]) NEON_BUILD_BUNDLED="yes" LIBNEON_SOURCE_CHECKS CFLAGS="$CFLAGS -I$neon_bundled_srcdir" NEON_LIBS="-L$neon_bundled_builddir -lneon $NEON_LIBS" NEON_NEED_XML_PARSER=yes neon_library_message="included libneon (${NEON_VERSION})" else # Don't need to configure an XML parser NEON_NEED_XML_PARSER=no NEON_BUILD_BUNDLED=no fi AC_SUBST(NEON_BUILD_BUNDLED) ]) dnl AC_SEARCH_LIBS done differently. Usage: dnl NE_SEARCH_LIBS(function, libnames, [extralibs], [actions-if-not-found], dnl [actions-if-found]) dnl Tries to find 'function' by linking againt `-lLIB $NEON_LIBS' for each dnl LIB in libnames. If link fails and 'extralibs' is given, will also dnl try linking against `-lLIB extralibs $NEON_LIBS`. dnl Once link succeeds, `-lLIB [extralibs]` is prepended to $NEON_LIBS, and dnl `actions-if-found' are executed, if given. dnl If link never succeeds, run `actions-if-not-found', if given, else dnl give an error and fail configure. AC_DEFUN([NE_SEARCH_LIBS], [ AC_REQUIRE([NE_CHECK_OS]) AC_CACHE_CHECK([for library containing $1], [ne_cv_libsfor_$1], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM([], [[$1();]])], [ne_cv_libsfor_$1="none needed"], [ ne_sl_save_LIBS=$LIBS ne_cv_libsfor_$1="not found" for lib in $2; do # The w32api libraries link using the stdcall calling convention. case ${lib}-${ne_cv_os_uname} in ws2_32-MINGW*) ne__code="__stdcall $1();" ;; *) ne__code="$1();" ;; esac LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([], [$ne__code])], [ne_cv_libsfor_$1="-l$lib"; break]) m4_if($3, [], [], dnl If $3 is specified, then... [LIBS="$ne_sl_save_LIBS -l$lib $3 $NEON_LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([], [$ne__code])], [ne_cv_libsfor_$1="-l$lib $3"; break])]) done LIBS=$ne_sl_save_LIBS])]) if test "$ne_cv_libsfor_$1" = "not found"; then m4_if([$4], [], [AC_MSG_ERROR([could not find library containing $1])], [$4]) elif test "$ne_cv_libsfor_$1" = "none needed"; then m4_if([$5], [], [:], [$5]) else NEON_LIBS="$ne_cv_libsfor_$1 $NEON_LIBS" $5 fi]) dnl Check for presence and suitability of zlib library AC_DEFUN([NEON_ZLIB], [ AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib], [disable zlib support]), ne_use_zlib=$withval, ne_use_zlib=yes) if test "$ne_use_zlib" = "yes"; then AC_CHECK_HEADER(zlib.h, [ AC_CHECK_LIB(z, inflate, [ NEON_LIBS="$NEON_LIBS -lz" NE_ENABLE_SUPPORT(ZLIB, [zlib support enabled, using -lz]) ], [NE_DISABLE_SUPPORT(ZLIB, [zlib library not found])]) ], [NE_DISABLE_SUPPORT(ZLIB, [zlib header not found])]) else NE_DISABLE_SUPPORT(ZLIB, [zlib not enabled]) fi ]) AC_DEFUN([NE_CHECK_OS], [ # Check for Darwin, which needs extra cpp and linker flags. AC_CACHE_CHECK([for uname], ne_cv_os_uname, [ ne_cv_os_uname=`uname -s 2>/dev/null` ]) if test "$ne_cv_os_uname" = "Darwin"; then CPPFLAGS="$CPPFLAGS -no-cpp-precomp" LDFLAGS="$LDFLAGS -flat_namespace" # poll has various issues in various Darwin releases if test x${ac_cv_func_poll+set} != xset; then ac_cv_func_poll=no fi fi ]) AC_DEFUN([NEON_COMMON_CHECKS], [ # These checks are done whether or not the bundled neon build # is used. AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_ISC_POSIX]) AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_C_CONST]) AC_REQUIRE([AC_TYPE_SIZE_T]) AC_REQUIRE([AC_TYPE_OFF_T]) AC_REQUIRE([NE_CHECK_OS]) AC_REQUIRE([AC_PROG_MAKE_SET]) AC_REQUIRE([AC_HEADER_STDC]) AC_CHECK_HEADERS([errno.h stdarg.h string.h stdlib.h]) NEON_FORMAT(size_t,,u) dnl size_t is unsigned; use %u formats NEON_FORMAT(off_t) NEON_FORMAT(ssize_t) ]) AC_DEFUN([NEON_FORMAT_PREP], [ AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) if test "$GCC" = "yes"; then AC_CACHE_CHECK([for gcc -Wformat -Werror sanity], ne_cv_cc_werror, [ # See whether a simple test program will compile without errors. ne_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -Wformat -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[int i = 42; printf("%d", i);]])], [ne_cv_cc_werror=yes], [ne_cv_cc_werror=no]) CPPFLAGS=$ne_save_CPPFLAGS]) ne_fmt_trycompile=$ne_cv_cc_werror else ne_fmt_trycompile=no fi ]) dnl Check for LFS support AC_DEFUN([NE_LARGEFILE], [ dnl Need the size of off_t AC_REQUIRE([NEON_COMMON_CHECKS]) if test -z "$ac_cv_sizeof_off_t"; then NE_DISABLE_SUPPORT(LFS, [LFS support omitted: off_t size unknown!]) elif test $ac_cv_sizeof_off_t != 4; then NE_DISABLE_SUPPORT(LFS, [LFS support unnecessary, off_t is not 32-bit]) AC_CHECK_FUNCS([strtoll strtoq], [break]) elif test -z "$ac_cv_sizeof_long_long"; then NE_DISABLE_SUPPORT(LFS, [LFS support omitted: long long size unknown]) elif test $ac_cv_sizeof_long_long != 8; then NE_DISABLE_SUPPORT(LFS, [LFS support omitted: long long not 64-bit]) else ne_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" AC_CHECK_TYPE(off64_t, [ NEON_FORMAT(off64_t) ne_lfsok=no AC_CHECK_FUNCS([strtoll strtoq], [ne_lfsok=yes; break]) AC_CHECK_FUNCS([lseek64 fstat64], [], [ne_lfsok=no; break]) if test x$ne_lfsok = xyes; then NE_ENABLE_SUPPORT(LFS, [LFS (large file) support enabled]) NEON_CFLAGS="$NEON_CFLAGS -D_LARGEFILE64_SOURCE -DNE_LFS" ne_save_CPPFLAGS="$CPPFLAGS -DNE_LFS" else NE_DISABLE_SUPPORT(LFS, [LFS support omitted: 64-bit support functions not found]) fi], [NE_DISABLE_SUPPORT(LFS, [LFS support omitted: off64_t type not found])]) CPPFLAGS=$ne_save_CPPFLAGS fi if test "$NE_FLAG_LFS" = "yes"; then AC_DEFINE_UNQUOTED([NE_FMT_NE_OFF_T], [NE_FMT_OFF64_T], [Define to be printf format string for ne_off_t]) NE_ADD_ABITAG(LFS) else AC_DEFINE_UNQUOTED([NE_FMT_NE_OFF_T], [NE_FMT_OFF_T]) fi ]) dnl NEON_FORMAT(TYPE[, HEADERS[, [SPECIFIER]]) dnl dnl This macro finds out which modifier is needed to create a dnl printf format string suitable for printing integer type TYPE (which dnl may be an int, long, or long long). dnl The default specifier is 'd', if SPECIFIER is not given. dnl TYPE may be defined in HEADERS; sys/types.h is always used first. AC_DEFUN([NEON_FORMAT], [ AC_REQUIRE([NEON_FORMAT_PREP]) AC_CHECK_SIZEOF($1,, [AC_INCLUDES_DEFAULT $2]) dnl Work out which specifier character to use m4_ifdef([ne_spec], [m4_undefine([ne_spec])]) m4_if($#, 3, [m4_define(ne_spec,$3)], [m4_define(ne_spec,d)]) m4_ifdef([ne_cvar], [m4_undefine([ne_cvar])])dnl m4_define([ne_cvar], m4_translit(ne_cv_fmt_[$1], [ ], [_]))dnl AC_CACHE_CHECK([how to print $1], [ne_cvar], [ ne_cvar=none if test $ne_fmt_trycompile = yes; then oflags="$CPPFLAGS" # Consider format string mismatches as errors CPPFLAGS="$CPPFLAGS -Wformat -Werror" dnl obscured for m4 quoting: "for str in d ld lld; do" for str in ne_spec l]ne_spec[ ll]ne_spec[; do AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include $2 #include ]], [[$1 i = 1; printf("%$str", i);]])], [ne_cvar=$str; break]) done CPPFLAGS=$oflags else # Best guess. Don't have to be too precise since we probably won't # get a warning message anyway. case $ac_cv_sizeof_]m4_translit($1, [ ], [_])[ in $ac_cv_sizeof_int) ne_cvar="ne_spec" ;; $ac_cv_sizeof_long) ne_cvar="l]ne_spec[" ;; $ac_cv_sizeof_long_long) ne_cvar="ll]ne_spec[" ;; esac fi ]) if test "x$ne_cvar" = "xnone"; then AC_MSG_ERROR([format string for $1 not found]) fi AC_DEFINE_UNQUOTED([NE_FMT_]m4_translit($1, [a-z ], [A-Z_]), "$ne_cvar", [Define to be printf format string for $1]) ]) dnl Wrapper for AC_CHECK_FUNCS; uses libraries from $NEON_LIBS. AC_DEFUN([NE_CHECK_FUNCS], [ ne_cf_save_LIBS=$LIBS LIBS="$LIBS $NEON_LIBS" AC_CHECK_FUNCS($@) LIBS=$ne_cf_save_LIBS]) dnl Checks needed when compiling the neon source. AC_DEFUN([LIBNEON_SOURCE_CHECKS], [ dnl Run all the normal C language/compiler tests AC_REQUIRE([NEON_COMMON_CHECKS]) dnl Needed for building the MD5 code. AC_REQUIRE([AC_C_BIGENDIAN]) dnl Is strerror_r present; if so, which variant AC_REQUIRE([AC_FUNC_STRERROR_R]) AC_CHECK_HEADERS([sys/time.h limits.h sys/select.h arpa/inet.h libintl.h \ signal.h sys/socket.h netinet/in.h netinet/tcp.h netdb.h sys/poll.h \ sys/limits.h fcntl.h iconv.h],,, [AC_INCLUDES_DEFAULT /* netinet/tcp.h requires netinet/in.h on some platforms. */ #ifdef HAVE_NETINET_IN_H #include #endif]) AC_REQUIRE([NE_SNPRINTF]) AC_CACHE_CHECK([for timezone global], ne_cv_cc_timezone, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[time_t t = 0 - timezone; timezone = 1;]])], ne_cv_cc_timezone=yes, ne_cv_cc_timezone=no)]) if test "$ne_cv_cc_timezone" = "yes"; then AC_DEFINE([HAVE_TIMEZONE], 1, [Define if the timezone global is available]) fi dnl Check for large file support NE_LARGEFILE AC_REPLACE_FUNCS(strcasecmp) AC_CHECK_FUNCS(signal setvbuf setsockopt stpcpy poll fcntl getsockopt) if test "x${ac_cv_func_poll}${ac_cv_header_sys_poll_h}y" = "xyesyesy"; then AC_DEFINE([NE_USE_POLL], 1, [Define if poll() should be used]) fi if test "$ac_cv_func_stpcpy" = "yes"; then AC_CHECK_DECLS(stpcpy) fi # Modern AIXes with the "Linux-like" libc have an undeclared stpcpy AH_BOTTOM([#if defined(HAVE_STPCPY) && defined(HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY && !defined(stpcpy) char *stpcpy(char *, const char *); #endif]) # Unixware 7 can only link gethostbyname with -lnsl -lsocket # Pick up -lsocket first, then the gethostbyname check will work. NE_SEARCH_LIBS(socket, socket inet ws2_32) # Enable getaddrinfo support if it, gai_strerror and inet_ntop are # all available. NE_SEARCH_LIBS(getaddrinfo, nsl,, [ne_enable_gai=no], [# HP-UX boxes commonly get into a state where getaddrinfo is present # but borked: http://marc.theaimsgroup.com/?l=apr-dev&m=107730955207120&w=2 case x`uname -sr 2>/dev/null`y in xHP-UX*11.[[01]]*y) AC_MSG_NOTICE([getaddrinfo support disabled on HP-UX 11.0x/11.1x]) ;; *) ne_enable_gai=yes NE_CHECK_FUNCS(gai_strerror getnameinfo inet_ntop,,[ne_enable_gai=no; break]) ;; esac ]) if test $ne_enable_gai = yes; then NE_ENABLE_SUPPORT(IPV6, [IPv6 support is enabled]) AC_DEFINE(USE_GETADDRINFO, 1, [Define if getaddrinfo() should be used]) AC_CACHE_CHECK([for working AI_ADDRCONFIG], [ne_cv_gai_addrconfig], [ AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ], [struct addrinfo hints = {0}, *result; hints.ai_flags = AI_ADDRCONFIG; if (getaddrinfo("localhost", NULL, &hints, &result) != 0) return 1;])], ne_cv_gai_addrconfig=yes, ne_cv_gai_addrconfig=no, ne_cv_gai_addrconfig=no)]) if test $ne_cv_gai_addrconfig = yes; then AC_DEFINE(USE_GAI_ADDRCONFIG, 1, [Define if getaddrinfo supports AI_ADDRCONFIG]) fi else # Checks for non-getaddrinfo() based resolver interfaces. # QNX has gethostbyname in -lsocket. BeOS only has it in -lbind. # CygWin/Winsock2 has it in -lws2_32, allegedly. NE_SEARCH_LIBS(gethostbyname, socket nsl bind ws2_32) NE_SEARCH_LIBS(hstrerror, resolv,,[:]) NE_CHECK_FUNCS(hstrerror) # Older Unixes don't declare h_errno. AC_CHECK_DECLS(h_errno,,,[#include ]) AC_CHECK_TYPE(in_addr_t,,[ AC_DEFINE([in_addr_t], [unsigned int], [Define if in_addr_t is not available])], [ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif ]) fi AC_CHECK_TYPES(socklen_t,, # Linux accept(2) says this should be size_t for SunOS 5... gah. [AC_DEFINE([socklen_t], [int], [Define if socklen_t is not available])],[ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif ]) AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,, [#include ]) if test ${ac_cv_member_struct_tm_tm_gmtoff}${ac_cv_member_struct_tm___tm_gmtoff}${ne_cv_cc_timezone} = nonono; then AC_MSG_WARN([no timezone handling in date parsing on this platform]) fi ifdef([neon_no_zlib], [NE_DISABLE_SUPPORT(ZLIB, [zlib not supported])], [NEON_ZLIB()]) # Conditionally enable ACL support AC_MSG_CHECKING([whether to enable ACL support in neon]) if test "x$neon_no_acl" = "xyes"; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_acl" fi NEON_SSL() NEON_SOCKS() NEON_GSSAPI() AC_SUBST(NEON_CFLAGS) AC_SUBST(NEON_LIBS) AC_SUBST(NEON_LTLIBS) ]) dnl Call to put lib/snprintf.o in LIBOBJS and define HAVE_SNPRINTF_H dnl if snprintf isn't in libc. AC_DEFUN([NEON_REPLACE_SNPRINTF], [ # Check for snprintf AC_CHECK_FUNC(snprintf,,[ AC_DEFINE(HAVE_SNPRINTF_H, 1, [Define if need to include snprintf.h]) AC_LIBOBJ(lib/snprintf)]) ]) dnl turn off webdav, boo hoo. AC_DEFUN([NEON_WITHOUT_WEBDAV], [ neon_no_webdav=yes neon_no_acl=yes NEON_NEED_XML_PARSER=no neon_xml_parser_message="none needed" ]) dnl Turn off zlib support AC_DEFUN([NEON_WITHOUT_ZLIB], [ define(neon_no_zlib, yes) ]) AC_DEFUN([NEON_WITHOUT_ACL], [ # Turn off ACL support neon_no_acl=yes ]) dnl Common macro to NEON_LIBTOOL_BUILD and NEON_NORMAL_BUILD dnl Sets NEONOBJS appropriately if it has not already been set. dnl dnl NOT FOR EXTERNAL USE: use LIBTOOL_BUILD or NORMAL_BUILD. dnl AC_DEFUN([NEON_COMMON_BUILD], [ # Using the default set of object files to build. # Add the extension to EXTRAOBJS ne="$NEON_EXTRAOBJS" NEON_EXTRAOBJS= for o in $ne; do NEON_EXTRAOBJS="$NEON_EXTRAOBJS $o.$NEON_OBJEXT" done # Was DAV support explicitly turned off? if test "x$neon_no_webdav" = "xyes"; then # No WebDAV support NEONOBJS="$NEONOBJS \$(NEON_BASEOBJS)" NE_DISABLE_SUPPORT(DAV, [WebDAV support is not enabled]) NE_ADD_ABITAG(NODAV) else # WebDAV support NEONOBJS="$NEONOBJS \$(NEON_DAVOBJS)" NE_ENABLE_SUPPORT(DAV, [WebDAV support is enabled]) fi AC_SUBST(NEON_TARGET) AC_SUBST(NEON_OBJEXT) AC_SUBST(NEONOBJS) AC_SUBST(NEON_EXTRAOBJS) AC_SUBST(NEON_LINK_FLAGS) ]) # The libtoolized build case: AC_DEFUN([NEON_LIBTOOL_BUILD], [ NEON_TARGET=libneon.la NEON_OBJEXT=lo NEON_COMMON_BUILD($#, $*) ]) dnl Find 'ar' and 'ranlib', fail if ar isn't found. AC_DEFUN([NE_FIND_AR], [ # Search in /usr/ccs/bin for Solaris ne_PATH=$PATH:/usr/ccs/bin AC_PATH_TOOL(AR, ar, notfound, $ne_PATH) if test "x$AR" = "xnotfound"; then AC_MSG_ERROR([could not find ar tool]) fi AC_PATH_TOOL(RANLIB, ranlib, :, $ne_PATH) ]) # The non-libtool build case: AC_DEFUN([NEON_NORMAL_BUILD], [ NEON_TARGET=libneon.a NEON_OBJEXT=o AC_REQUIRE([NE_FIND_AR]) NEON_COMMON_BUILD($#, $*) ]) AC_DEFUN([NE_SNPRINTF], [ AC_CHECK_FUNCS(snprintf vsnprintf,,[ ne_save_LIBS=$LIBS LIBS="$LIBS -lm" # Always need -lm AC_CHECK_LIB(trio, trio_vsnprintf, [AC_CHECK_HEADERS(trio.h,, AC_MSG_ERROR([trio installation problem? libtrio found but not trio.h])) AC_MSG_NOTICE(using trio printf replacement library) NEON_LIBS="$NEON_LIBS -ltrio -lm" AC_DEFINE(HAVE_TRIO, 1, [Use trio printf replacement library])], [AC_MSG_NOTICE([no vsnprintf/snprintf detected in C library]) AC_MSG_ERROR([Install the trio library from http://daniel.haxx.se/projects/trio/])]) LIBS=$ne_save_LIBS break ])]) dnl Usage: NE_CHECK_OPENSSLVER(variable, version-string, version-hex) dnl Define 'variable' to 'yes' if OpenSSL version is >= version-hex AC_DEFUN([NE_CHECK_OPENSSLVER], [ AC_CACHE_CHECK([OpenSSL version is >= $2], $1, [ AC_EGREP_CPP(good, [#include #if OPENSSL_VERSION_NUMBER >= $3 good #endif], [$1=yes], [$1=no])])]) dnl Less noisy replacement for PKG_CHECK_MODULES AC_DEFUN([NE_PKG_CONFIG], [ AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test "$PKG_CONFIG" = "no"; then : Not using pkg-config $4 else AC_CACHE_CHECK([for $2 pkg-config data], ne_cv_pkg_$2, [if $PKG_CONFIG $2; then ne_cv_pkg_$2=yes else ne_cv_pkg_$2=no fi]) if test "$ne_cv_pkg_$2" = "yes"; then $1_CFLAGS=`$PKG_CONFIG --cflags $2` $1_LIBS=`$PKG_CONFIG --libs $2` : Using provided pkg-config data $3 else : No pkg-config for $2 provided $4 fi fi]) dnl Check for an SSL library (GNU TLS or OpenSSL) AC_DEFUN([NEON_SSL], [ AC_ARG_WITH(ssl, AS_HELP_STRING([--with-ssl=openssl|gnutls], [enable SSL support (default OpenSSL)])) AC_ARG_WITH(egd, [[ --with-egd[=PATH] enable EGD support [using EGD socket at PATH]]]) AC_ARG_WITH(pakchois, AS_HELP_STRING([--without-pakchois], [disable support for PKCS#11 using pakchois])) case $with_ssl in /*) AC_MSG_NOTICE([to use SSL libraries in non-standard locations, try --with-ssl --with-libs=$with_ssl]) AC_MSG_ERROR([--with-ssl does not take a path argument]) ;; yes|openssl) NE_PKG_CONFIG(NE_SSL, openssl, [AC_MSG_NOTICE(using SSL library configuration from pkg-config) CPPFLAGS="$CPPFLAGS ${NE_SSL_CFLAGS}" NEON_LIBS="$NEON_LIBS ${NE_SSL_LIBS}"], [# Either OpenSSL library may require -ldl if built with dynamic engine support NE_SEARCH_LIBS(RSA_new, crypto, -ldl) NE_SEARCH_LIBS(SSL_library_init, ssl, -ldl)]) AC_CHECK_HEADERS(openssl/ssl.h openssl/opensslv.h,, [AC_MSG_ERROR([OpenSSL headers not found, cannot enable SSL support])]) # Enable EGD support if using 0.9.7 or newer NE_CHECK_OPENSSLVER(ne_cv_lib_ssl097, 0.9.7, 0x00907000L) if test "$ne_cv_lib_ssl097" = "yes"; then AC_MSG_NOTICE([OpenSSL >= 0.9.7; EGD support not needed in neon]) NE_ENABLE_SUPPORT(SSL, [SSL support enabled, using OpenSSL (0.9.7 or later)]) NE_CHECK_FUNCS(CRYPTO_set_idptr_callback) else # Fail if OpenSSL is older than 0.9.6 NE_CHECK_OPENSSLVER(ne_cv_lib_ssl096, 0.9.6, 0x00906000L) if test "$ne_cv_lib_ssl096" != "yes"; then AC_MSG_ERROR([OpenSSL 0.9.6 or later is required]) fi NE_ENABLE_SUPPORT(SSL, [SSL support enabled, using OpenSSL (0.9.6 or later)]) case "$with_egd" in yes|no) ne_cv_lib_sslegd=$with_egd ;; /*) ne_cv_lib_sslegd=yes AC_DEFINE_UNQUOTED([EGD_PATH], "$with_egd", [Define to specific EGD socket path]) ;; *) # Guess whether EGD support is needed AC_CACHE_CHECK([whether to enable EGD support], [ne_cv_lib_sslegd], [if test -r /dev/random || test -r /dev/urandom; then ne_cv_lib_sslegd=no else ne_cv_lib_sslegd=yes fi]) ;; esac if test "$ne_cv_lib_sslegd" = "yes"; then AC_MSG_NOTICE([EGD support enabled for seeding OpenSSL PRNG]) AC_DEFINE([ENABLE_EGD], 1, [Define if EGD should be supported]) fi fi AC_DEFINE([HAVE_OPENSSL], 1, [Define if OpenSSL support is enabled]) NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_openssl" ;; gnutls) AC_PATH_PROG(GNUTLS_CONFIG, libgnutls-config, no) if test "$GNUTLS_CONFIG" = "no"; then AC_MSG_ERROR([could not find libgnutls-config in \$PATH]) fi ne_gnutls_ver=`$GNUTLS_CONFIG --version` case $ne_gnutls_ver in 1.0.?|1.0.1?|1.0.20|1.0.21) AC_MSG_ERROR([GNU TLS version $ne_gnutls_ver is too old -- 1.0.22 or later required]) ;; esac CPPFLAGS="$CPPFLAGS `$GNUTLS_CONFIG --cflags`" AC_CHECK_HEADER([gnutls/gnutls.h],, [AC_MSG_ERROR([could not find gnutls/gnutls.h in include path])]) NE_ENABLE_SUPPORT(SSL, [SSL support enabled, using GnuTLS $ne_gnutls_ver]) NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_gnutls" NEON_LIBS="$NEON_LIBS `$GNUTLS_CONFIG --libs`" AC_DEFINE([HAVE_GNUTLS], 1, [Define if GnuTLS support is enabled]) # Check for functions in later releases NE_CHECK_FUNCS(gnutls_session_get_data2 gnutls_x509_dn_get_rdn_ava \ gnutls_sign_callback_set) # Check for iconv support if using the new RDN access functions: if test ${ac_cv_func_gnutls_x509_dn_get_rdn_ava}X${ac_cv_header_iconv_h} = yesXyes; then AC_CHECK_FUNCS(iconv) fi if test x${ac_cv_func_gnutls_sign_callback_set} = xyes; then if test "$with_pakchois" != "no"; then # PKCS#11... ho! NE_PKG_CONFIG(NE_PK11, pakchois, [AC_MSG_NOTICE(using pakchois for PKCS11 support) AC_DEFINE(HAVE_PAKCHOIS, 1, [Define if pakchois library supported]) CPPFLAGS="$CPPFLAGS ${NE_PK11_CFLAGS}" NEON_LIBS="${NEON_LIBS} ${NE_PK11_LIBS}"], [AC_MSG_NOTICE(pakchois library not found; no PKCS11 support)]) fi fi ;; *) # Default to off; only create crypto-enabled binaries if requested. NE_DISABLE_SUPPORT(SSL, [SSL support is not enabled]) NE_DISABLE_SUPPORT(TS_SSL, [Thread-safe SSL support is not enabled]) NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_stubssl" ;; esac AC_SUBST(NEON_SUPPORTS_SSL) AC_ARG_WITH(ca-bundle, AS_HELP_STRING(--with-ca-bundle, specify filename of an SSL CA root bundle),, with_ca_bundle=no) case ${NE_FLAG_SSL}-${with_ca_bundle} in *-no) ;; yes-*) AC_DEFINE_UNQUOTED([NE_SSL_CA_BUNDLE], ["${with_ca_bundle}"], [Define to be filename of an SSL CA root bundle]) AC_MSG_NOTICE([Using ${with_ca_bundle} as default SSL CA bundle]) ;; esac AC_ARG_ENABLE(threadsafe-ssl, AS_HELP_STRING(--enable-threadsafe-ssl=posix, [enable SSL library thread-safety using POSIX threads: suitable CC/CFLAGS/LIBS must be used to make the POSIX library interfaces available]),, enable_threadsafe_ssl=no) case $enable_threadsafe_ssl in posix|yes) ne_pthr_ok=yes AC_CHECK_FUNCS([pthread_mutex_init pthread_mutex_lock],,[ne_pthr_ok=no]) if test "${ne_pthr_ok}" = "no"; then AC_MSG_ERROR([could not find POSIX mutex interfaces; (try CC="${CC} -pthread"?)]) fi NE_ENABLE_SUPPORT(TS_SSL, [Thread-safe SSL supported using POSIX threads]) ;; *) NE_DISABLE_SUPPORT(TS_SSL, [Thread-safe SSL not supported]) ;; esac ]) dnl Check for Kerberos installation AC_DEFUN([NEON_GSSAPI], [ AC_ARG_WITH(gssapi, AS_HELP_STRING(--without-gssapi, disable GSSAPI support)) if test "$with_gssapi" != "no"; then AC_PATH_PROG([KRB5_CONFIG], krb5-config, none, $PATH:/usr/kerberos/bin) else KRB5_CONFIG=none fi if test "x$KRB5_CONFIG" != "xnone"; then ne_save_CPPFLAGS=$CPPFLAGS ne_save_LIBS=$NEON_LIBS NEON_LIBS="$NEON_LIBS `${KRB5_CONFIG} --libs gssapi`" CPPFLAGS="$CPPFLAGS `${KRB5_CONFIG} --cflags gssapi`" # MIT and Heimdal put gssapi.h in different places AC_CHECK_HEADERS(gssapi/gssapi.h gssapi.h, [ NE_CHECK_FUNCS(gss_init_sec_context, [ ne_save_CPPFLAGS=$CPPFLAGS ne_save_LIBS=$NEON_LIBS AC_MSG_NOTICE([GSSAPI authentication support enabled]) AC_DEFINE(HAVE_GSSAPI, 1, [Define if GSSAPI support is enabled]) AC_CHECK_HEADERS(gssapi/gssapi_generic.h) # Older versions of MIT Kerberos lack GSS_C_NT_HOSTBASED_SERVICE AC_CHECK_DECL([GSS_C_NT_HOSTBASED_SERVICE],, [AC_DEFINE([GSS_C_NT_HOSTBASED_SERVICE], gss_nt_service_name, [Define if GSS_C_NT_HOSTBASED_SERVICE is not defined otherwise])], [#ifdef HAVE_GSSAPI_GSSAPI_H #include #else #include #endif])]) break ]) CPPFLAGS=$ne_save_CPPFLAGS NEON_LIBS=$ne_save_LIBS fi]) dnl Adds an --enable-warnings argument to configure to allow enabling dnl compiler warnings AC_DEFUN([NEON_WARNINGS],[ AC_REQUIRE([AC_PROG_CC]) dnl so that $GCC is set AC_ARG_ENABLE(warnings, AS_HELP_STRING(--enable-warnings, [enable compiler warnings])) if test "$enable_warnings" = "yes"; then case $GCC:`uname` in yes:*) CFLAGS="$CFLAGS -Wall -Wmissing-declarations -Wshadow -Wreturn-type -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wformat-security" if test -z "$with_ssl" -o "$with_ssl" = "no"; then # OpenSSL headers fail strict prototypes checks CFLAGS="$CFLAGS -Wstrict-prototypes" fi ;; no:OSF1) CFLAGS="$CFLAGS -check -msg_disable returnchecks -msg_disable alignment -msg_disable overflow" ;; no:IRIX) CFLAGS="$CFLAGS -fullwarn" ;; no:UnixWare) CFLAGS="$CFLAGS -v" ;; *) AC_MSG_WARN([warning flags unknown for compiler on this platform]) ;; esac fi ]) dnl Adds an --disable-debug argument to configure to allow disabling dnl debugging messages. dnl Usage: dnl NEON_WARNINGS([actions-if-debug-enabled], [actions-if-debug-disabled]) dnl AC_DEFUN([NEON_DEBUG], [ AC_ARG_ENABLE(debug, AS_HELP_STRING(--disable-debug,[disable runtime debugging messages])) # default is to enable debugging case $enable_debug in no) AC_MSG_NOTICE([debugging is disabled]) $2 ;; *) AC_MSG_NOTICE([debugging is enabled]) AC_DEFINE(NE_DEBUGGING, 1, [Define to enable debugging]) $1 ;; esac]) dnl Macro to optionally enable socks support AC_DEFUN([NEON_SOCKS], [ AC_ARG_WITH([socks], AS_HELP_STRING([--with-socks],[use SOCKSv5 library])) if test "$with_socks" = "yes"; then ne_save_LIBS=$LIBS AC_CHECK_HEADERS(socks.h, [AC_CHECK_LIB(socks5, connect, [:], [AC_MSG_ERROR([could not find libsocks5 for SOCKS support])])], [AC_MSG_ERROR([could not find socks.h for SOCKS support])]) NE_ENABLE_SUPPORT(SOCKS, [SOCKSv5 support is enabled]) NEON_LIBS="$NEON_LIBS -lsocks5" LIBS=$ne_save_LIBS else NE_DISABLE_SUPPORT(SOCKS, [SOCKSv5 support is not enabled]) fi]) AC_DEFUN([NEON_WITH_LIBS], [ AC_ARG_WITH([libs], [[ --with-libs=DIR[:DIR2...] look for support libraries in DIR/{bin,lib,include}]], [case $with_libs in yes|no) AC_MSG_ERROR([--with-libs must be passed a directory argument]) ;; *) ne_save_IFS=$IFS; IFS=: for dir in $with_libs; do ne_add_CPPFLAGS="$ne_add_CPPFLAGS -I${dir}/include" ne_add_LDFLAGS="$ne_add_LDFLAGS -L${dir}/lib" ne_add_PATH="${ne_add_PATH}${dir}/bin:" PKG_CONFIG_PATH=${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}${dir}/lib/pkgconfig done IFS=$ne_save_IFS CPPFLAGS="${ne_add_CPPFLAGS} $CPPFLAGS" LDFLAGS="${ne_add_LDFLAGS} $LDFLAGS" PATH=${ne_add_PATH}$PATH export PKG_CONFIG_PATH ;; esac])]) AC_DEFUN([NEON_I18N], [ dnl Check for NLS iff libintl.h was detected. AC_ARG_ENABLE(nls, AS_HELP_STRING(--disable-nls, [disable internationalization support]),, [enable_nls=${ac_cv_header_libintl_h}]) if test x${enable_nls} = xyes; then # presume that dgettext() is available if bindtextdomain() is... # checking for dgettext() itself is awkward because gcc has a # builtin of that function, which confuses AC_CHECK_FUNCS et al. NE_SEARCH_LIBS(bindtextdomain, intl,,[enable_nls=no]) NE_CHECK_FUNCS(bind_textdomain_codeset) fi if test "$enable_nls" = "no"; then NE_DISABLE_SUPPORT(I18N, [Internationalization support not enabled]) else NE_ENABLE_SUPPORT(I18N, [Internationalization support enabled]) eval localedir="${datadir}/locale" AC_DEFINE_UNQUOTED([LOCALEDIR], "$localedir", [Define to be location of localedir]) fi ]) sitecopy-0.16.6/m4/neon/ChangeLog0000664000076400007640000010234210127601723014623 0ustar joejoeSun Sep 12 18:38:13 2004 Joe Orton * neon.m4 (NEON_USE_EXTERNAL): Check for IDNA, LFS, SOCKS support. (NEON_SOCKS): Use common feature code for SOCKSv5 support. Fri Sep 10 20:52:54 2004 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Safer autoheader template for declaring stpcpy as necessary for bundled neon builds. (NEON_WARNINGS): Drop -Winline. Wed Aug 25 19:44:26 2004 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for poll. Sat Jul 3 11:39:01 2004 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Pick up gethostbyname in -lsocket for QNX. Fri Apr 16 11:43:10 2004 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): If built using libtool, and --with-expat specifies a libexpat.la file, add the libexpat.la to NEON_LTLIBS. * neon.m4 (NEON_COMMON_CHECKS): Substitute NEON_LTLIBS. Tue Apr 13 20:51:59 2004 Joe Orton * neon.m4 (NEON_GSSAPI): Check for presence of gssapi/gssapi_generic.h. Wed Apr 7 13:16:33 2004 Joe Orton * neon.m4 (NE_LARGEFILE): Check for strtoq. Mon Mar 15 19:59:36 2004 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Be safer around getaddrinfo blacklist for HP-UX and reference why it's needed. Sun Mar 7 11:15:44 2004 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Use NE_LARGEFILE in-place rather than AC_REQUIRE'ing it. (NE_LARGEFILE): Add NE_LFS to CPPFLAGS for use in bundled builds. Mon Feb 23 23:02:54 2004 Joe Orton * neon.m4 (NE_SNPRINTF): Define HAVE_TRIO if trio is used. Mon Feb 23 00:22:39 2004 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Give INCLUDES argument to AC_CHECK_HEADERS; prevent warning from cpp test for netinet/in.h on some platforms. Sun Feb 22 17:52:42 2004 Joe Orton * neon.m4 (NE_SEARCH_LIBS): Fix to run actions-if-found if function is found without needing additional libraries. (LIBNEON_SOURCE_CHECKS): Only check for gethostbyname if getaddrinfo is not found. Disable getaddrinfo on HP-UX 11.[01]* here rather than ne_socket.c. Sat Jan 24 17:49:50 2004 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Also check for __tm_gmtoff in struct tm. Sat Jan 24 17:16:48 2004 Joe Orton * neon.m4: Remove -ansi-pedantic and -Wimplicit-prototypes for gcc 3.4 compatibility (thanks to Olaf Hering). Sat Jan 3 14:11:14 2004 Joe Orton * neon-test.m4: Check for stdint.h. Sat Jan 3 13:17:21 2004 Joe Orton * neon.m4 (NE_LARGEFILE): Add NE_LFS to neon-config --cflags output. Thu Jan 1 18:42:56 2004 Joe Orton * neon.m4 (NEON_FORMAT): Use C99 'll' rather than non-standard 'q' length modifier. Thu Jan 1 17:36:39 2004 Joe Orton * neon.m4 (NE_LARGEFILE): New macro. (LIBNEON_SOURCE_CHECKS): Call it. Sat Nov 15 09:25:43 2003 Joe Orton * neon.m4, neon-xml-parser.m4: Update for latest autoconf best-practice: s/AC_HELP_STRING/AS_HELP_STRING, replace AC_TRY_RUN with AC_RUN_IFELSE, AC_TRY_LINK_FUNC with AC_LINK_IFELSE, AC_TRY_COMPILE with AC_COMPILE_IFELSE, remove AC_LANG_C and AC_PROG_CC_STDC, Fri Nov 14 13:12:10 2003 Joe Orton * neon.m4 (NEON_LIBIDN): New macro. (LIBNEON_SOURCE_CHECKS): Use NEON_LIBIDN. Fri Nov 14 11:28:58 2003 Joe Orton * neon.m4 (NE_ENABLE_SUPPORT, NE_DISABLE_SUPPORT): New macros. Use throughout to flag support or lack of support for optional features. Thu Nov 13 20:25:28 2003 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for gethostbyname in -lbind too. Tue Oct 7 21:20:16 2003 Joe Orton * neon-test.m4 (NEON_TEST): Check for shutdown. Mon Sep 22 21:20:37 2003 Joe Orton * neon.m4 (NE_CHECK_FUNCS, NE_SEARCH_LIBS): Avoid clobbering ne_save_{LIBS,CPPFLAGS}. Sun Sep 14 10:51:34 2003 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for working AI_ADDRCONFIG flag for getaddrinfo(). Wed Sep 10 21:45:10 2003 Joe Orton * neon.m4 (NEON_GSSAPI): Restore CPPFLAGS and NEON_LIBS if GSSAPI detection fails. Thu Sep 4 21:29:06 2003 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for netinet/tcp.h. Wed Jul 23 21:17:40 2003 Joe Orton * neon.m4 (NEON_GSSAPI): New macro. Mon Apr 21 18:24:12 2003 Joe Orton * neon-xml-parser.m4 (HAVE_EXPAT): Fail if --with-expat is given but expat.h is not found. Wed Mar 26 20:29:11 2003 Joe Orton * neon.m4 (NEON_SSL): And add ne_stubssl to NEON_EXTRAOBJS for non-SSL build. Tue Mar 25 20:43:01 2003 Joe Orton * neon.m4 (NEON_SSL): Add ne_openssl to NEON_EXTRAOBJS. Mon Mar 17 20:34:55 2003 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for netdb.h. Sun Mar 16 14:22:02 2003 Joe Orton * neon-xml-parser.m4 (NE_XML_BUNDLED_EXPAT): Define HAVE_XMLPARSE_H. Sun Mar 16 11:47:35 2003 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Also fix non-included-expat build for when included expat is not an option. Sun Mar 16 11:20:23 2003 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Fix non-included-expat build broken in previous commit. Sun Mar 16 09:06:41 2003 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Fix --with-included-expat support. Sun Mar 9 10:08:57 2003 Joe Orton * neon.m4 (NEON_SSL): Fail if --with-ssl is given an argument. Sun Mar 9 08:55:04 2003 Joe Orton * neon.m4 (NE_SEARCH_LIBS): Bug fix to always compare against `extras' if given. Add support for optional `actions-if-found' argument. * neon-xml-parser.m4: Largely rewritten. Drop support for libxml 1.x; require expat 1.95.x. Sun Mar 9 08:50:22 2003 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for stpcpy. Mon Mar 3 22:15:56 2003 Joe Orton * neon.m4 (NE_CHECK_FUNCS): Check whether h_errno is declared. Wed Feb 19 21:35:20 2003 Joe Orton * neon.m4 (NEON_FORMAT): Revert use of 'z' modifier; breaks on CygWin. Tue Jan 14 17:06:07 2003 Joe Orton * neon.m4 (NEON_FORMAT): Prefer the C99 'z' modifier to printf size_t/ssize_t values where available. Fri Jan 3 23:12:20 2003 Joe Orton * neon.m4 (NE_PKG_CONFIG): New macro. (NEON_SSL): Use NE_PKG_CONFIG rather than PKG_CHECK_MODULES. Mon Dec 16 20:02:45 2002 Joe Orton * neon.m4 (NEON_SSL): Only check for OpenSSL <=0.9.6 if version is known to be <=0.9.7. Mon Dec 16 19:01:57 2002 Joe Orton * neon.m4: Use pkg-config data to determine location OpenSSL libraries/headers, if available. Tue Nov 19 11:21:31 2002 Joe Orton * neon-test.m4 (NEON_TEST): Suggest this macro is run before NEON_XML_PARSER. Mon Oct 7 22:22:12 2002 Joe Orton * neon.m4 (NE_CHECK_SSLVER): New macro. (NEON_SSL): Use NE_CHECK_SSLVER. Add --with-egd argument; conditionally enable EGD, optionally using only a specific EGD socket path, and only if using OpenSSL before 0.9.7. Tue Sep 24 21:36:01 2002 Joe Orton * neon.m4 (NE_ZLIB_VERSION): Removed macro. (NEON_ZLIB): Removed --with-force-zlib flag; don't check zlib version. (NEON_SSL): Removed --with-force-ssl flag, only require OpenSSL 0.9.6 or later. Sat Aug 31 17:28:15 2002 Joe Orton * neon.m4 (NEON_FORMAT_PREP): Add check for gcc -Wformat -Werror sanity. (NEON_FORMAT): Only use gcc -Wformat -Werror if sanity is assured. Fri Aug 30 22:07:59 2002 Joe Orton * neon.m4: Set NEON_INTERFACE_VERSION according to NEON_VERSION_MINOR, NEON_VERSION_RELEASE, for the duration of neon 0.x releases. Sun Aug 25 23:52:38 2002 Joe Orton * neon.m4 (NE_CHECK_FUNCS): New macro. (LIBNEON_SOURCE_CHECKS): Use NE_CHECK_FUNCS rather than AC_CHECK_FUNCS, so $NEON_LIBS are searched. Sun Aug 25 11:53:20 2002 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Require inet_ntop as well for USE_GETADDRINFO test. Sun Aug 18 22:50:09 2002 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Remove redundant check for SIGPIPE definition. Sun Aug 18 22:41:15 2002 Joe Orton * neon.m4 (NE_SEARCH_LIBS): Take optional fourth argument. (LIBNEON_SOURCE_CHECKS): Define USE_GETADDRINFO if getaddrinfo and gai_strerror are present. Otherwise, check for hstrerror, possibly in -lresolv. * neon-test.m4: Don't check for hstrerror(). Sun Aug 18 22:31:13 2002 Joe Orton * neon-xml-parser.m4 (NEON_FIND_PARSER_H, NEON_XML_LIBXML2): Re-order checks to skip redundant tests, speeding up common case. Fri Aug 9 19:47:14 2002 Joe Orton * neon.m4 (NEON_SSL): Require OpenSSL 0.9.6f or later. Wed Jul 31 23:01:17 2002 Joe Orton * strftime.m4, readline.m4: Removed from neon/macros CVS module. Tue Jul 30 19:09:20 2002 Joe Orton * neon.m4 (NEON_COMMON_CHECKS): Require AC_TYPE_SIZE_T, AC_TYPE_OFF_T. * neon-test.m4 (NEON_TEST): Require AC_TYPE_PID_T. Tue Jul 30 19:06:48 2002 Joe Orton * neon.m4 (NEON_SSL): Require OpenSSL 0.9.6e or later for security fixes; add --with-force-ssl to override version check. Fri Jul 26 00:01:07 2002 Joe Orton * neon.m4 (NE_MACOSX): Just check for any Darwin system. Sat Jul 20 10:40:29 2002 Joe Orton * neon.m4 (NEON_WITH_LIBS): Allow a colon-separated list of directories for --with-libs argument. Thu Jul 18 20:07:43 2002 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Require AC_FUNC_STRERROR_R. Wed Jul 17 23:26:51 2002 Joe Orton * neon.m4 (NEON_CHECK_VERSION): Rewrite to cache results, simplify, and use new ne_version_match. (NE_ZLIB_VERSION): Cache result. Fri Jul 5 12:57:56 2002 Joe Orton * neon.m4 (NEON_SSL): Fail if openssl/opensslv.h header is not found, or if OpenSSL version is earlier than 0.9.6. Sun Jun 16 14:04:18 2002 Joe Orton * neon.m4 (NEON_FORMAT): Take optional third argument giving format string specifier to use. (NEON_COMMON_CHECKS): Get format string for ssize_t; fix to use 'u' specifier for size_t format string. Thu Jun 13 20:34:35 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Undocument use of =DIR parameter to --with-expat, as it gives false expectations. Wed Jun 12 23:26:40 2002 Joe Orton * neon.m4 (NEON_WITH_LIBS): New macro. Mon Jun 10 22:31:50 2002 Joe Orton * neon.m4 (NEON_WARNINGS): Replace -ansi-pedantic with -pedantic. Sun May 26 19:08:12 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_LIBXML2): Check for libxml/xmlversion.h header too. Wed May 22 09:54:42 2002 Joe Orton * neon.m4 (NE_MACOSX): Cache result. (NE_COMMON_CHECKS): Simplify tm_gmtoff check further: use AC_CHECK_MEMBERS. Mon May 20 21:18:06 2002 Joe Orton * neon.m4 (NE_SEARCH_LIBS): Cache results. Mon May 20 20:55:04 2002 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Use AC_CACHE_CHECK to check for SIGPIPE in signal.h; don't invade the ac_ namespace with cache variables. Cache results of tm_gmtoff test too. Mon May 20 20:35:22 2002 Joe Orton * neon.m4 (NE_SNPRINTF): Simplify logic. Sun May 19 20:23:55 2002 Joe Orton * neon.m4 (NEON_WARNINGS): Remove with_warnings variable; simplify. Wed May 19 08:36:44 2004 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Declare stpcpy on modern "Linux-like" AIXes. Sun May 19 09:35:08 2002 Joe Orton * neon.m4 (NE_FIND_AR): Fix $PATH handling on some Linux platforms. Sun May 19 09:05:22 2002 Joe Orton * neon.m4 (NE_FIND_AR): New macro. (NEON_NORMAL_BUILD): Require NE_FIND_AR. * neon-test.m4: Require NE_FIND_AR. Check for hstrerror(). Fri May 17 23:37:19 2002 Joe Orton * neon.m4 (NEON_SSL): Allow --without-ssl again. Wed May 15 21:00:15 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_LIBXML2): sed '-L/usr/lib ' out of xml2-config --libs output. Sat May 11 15:30:38 2002 Joe Orton * neon.m4 (NEON_SOCKS): Moved and simplified from neon-socks.m4. Drop support for specifying directory argument; fail if --with-socks is given and socks.h is not found. * neon-socks.m4: Removed file. Sat May 11 15:22:36 2002 Joe Orton * neon.m4 (NEON_DEBUG): Moved and simplified from neon-debug.m4. * neon-debug.m4: Removed file. Sat May 11 13:40:29 2002 Joe Orton * neon.m4 (NEON_WARNINGS): Moved and simplified from neon-warnings.m4. * neon-warnings.m4: Removed file. Sat May 11 13:26:00 2002 Joe Orton * neon.m4 (NEON_SSL): Simplified version of NEON_SSL from neon-ssl.m4. Check for ssl.h; detect OpenSSL ENGINE correctly when -lcrypto requries -ldl. * neon-ssl.m4: Removed file. Sat May 11 13:16:27 2002 Joe Orton * neon.m4 (NE_SEARCH_LIBS): Allow passing 'extralibs' to include in library list when link against a specified library fails. Prepend found library/libraries to $NEON_LIBS. Sat May 11 12:40:24 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER), * neon.m4 (NEON_REPLACE_SNPRINTF): Use AC_LIBOBJ rather than modify LIBOBJS directly, to appease autoconf 2.53. Wed May 1 22:32:10 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_LIBXML1): Fix syntax error in libxml 1.x detection causing spurious or missing warning message. Thu Apr 25 07:38:33 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_EXTERNAL_EXPAT): Check for expat.h too, to support expat 1.95.x (Branko ibej). Tue Apr 23 21:09:55 2002 Joe Orton * neon-xml-parser.m4 (NEON_FIND_PARSER_H): New macro, factored out from NEON_XML_LIBXML2. (NEON_XML_LIBXML2, NEON_XML_LIBXML1): Use it. Tue Apr 23 20:54:30 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_LIBXML2): Check for parser.h or libxml/parser.h, or fail. Sat Apr 13 22:35:01 2002 Joe Orton * neon.m4 (NE_SNPRINTF): Define NEON_TRIO in NEON_CFLAGS, export it from 'neon-config --cflags' output. Fri Apr 5 23:40:00 2002 Joe Orton * neon.m4 (NEON_ZLIB, NE_ZLIB_VERSION): Add --with-force-zlib, to skip zlib version check. Simplify neon_zlib_message handling a little. Tue Mar 12 00:18:00 2002 Joe Orton * neon.m4 (NE_ZLIB_VERSION): New macro. (NEON_ZLIB): Use it to require zlib 1.1.4. Sun Mar 10 22:05:26 2002 Joe Orton * neon.m4 (NEON_ZLIB): Don't add ne_compress to NEON_EXTRAOBJS. Mon Mar 4 21:04:28 2002 Joe Orton * neon-ssl.m4 (NEON_SSL): Avoid adding -I/usr/include to CFLAGS during build as well as not exporting it via neon-config. Tue Feb 19 21:30:50 2002 Joe Orton * neon-socks.m4 (NEON_SOCKS): Fix configure argument name, export -L argument in NEON_LIBS, check for socks.h not sock.h, define NEON_SOCKS. Sun Jan 13 20:07:51 2002 Joe Orton * neon.m4 (NE_MACOSX): New macro. (NEON_COMMON_CHECKS): Call it. Sun Jan 6 21:35:08 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Add XML_BYTE_ORDER to CPPFLAGS; mini-expat doesn't pick up config.h. Tue Jan 1 23:30:03 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Set XML_BYTE_ORDER appropriately. Tue Jan 1 22:50:15 2002 Joe Orton * neon.m4 (NEON_CHECK_VERSION): Don't add libs for external neon to NEON_LIBS here. Tue Jan 1 22:44:05 2002 Joe Orton * neon-xml-parser.m4 (NEON_XML_LIBXML2, NEON_XML_LIBXML1): Alter CPPFLAGS only, not CFLAGS. Tue Jan 1 21:49:16 2002 Joe Orton * neon.m4 (NEON_USE_EXTERNAL): Factored out from NEON_COMMON. (NEON_COMMON): Use NEON_USE_EXTERNAL; simplify, improve reporting. * neon.m4 (NEON_COMMON_CHECKS): Move check for common headers here... (LIBNEON_SOURCE_CHECKS): from here. Tue Jan 1 21:44:33 2002 Joe Orton * neon-test.m4 (NEON_TEST): Check for AR and RANLIB. Fri Dec 14 22:39:57 2001 Joe Orton * neon-test.m4 (NEON_TEST): Pick up time_t definition from sys/time.h if present (fix for Solaris 2.6 and probably elsewhere). Fri Dec 14 22:39:32 2001 Joe Orton * neon.m4 (NEON_FORMAT): Allow passing in headers where type may be defined. Mon Dec 10 07:36:26 2001 Joe Orton * neon.m4 (NEON_COMMON): Fix --with-neon=PATH again. Sun Dec 9 21:40:47 2001 Joe Orton * neon-test.m4 (NEON_TEST): Determine how to print time_t. Sun Dec 9 11:50:03 2001 Joe Orton * neon.m4 (NEON_WITHOUT_ACL): New macro. (LIBNEON_SOURCE_CHECKS): Conditionally build ACL support. Sun Dec 9 01:06:32 2001 Joe Orton * neon.m4 (NEON_CHECK_VERSION): Use NEON_CONFIG as config script, drop first argument. Better error message if the link failed. (NEON_COMMON): Cleanup. Check for neon-config in PATH. Stop if --with-neon was given, and the external neon wasn't good enough. Sun Dec 9 00:17:19 2001 Joe Orton * neon-test.m4 (NEON_TEST): Requires NEON_COMMON_CHECKS. * neon-warnings.m4 (NEON_WARNINGS): Requires AC_PROG_CC. Sun Dec 9 00:13:47 2001 Joe Orton * neon.m4 (NEON_COMMON_CHECKS): New macro; runs common C language/compiler checks, which may be useful to neon applications regardless of whether a bundled or external neon is being used. Use AC_REQUIRE to prevent macros being expanded more than once. (LIBNEON_SOURCE_CHECKS, NEON_COMMON): Require NEON_COMMON_CHECKS to have been expanded. Sat Dec 8 00:56:34 2001 Joe Orton * neon.m4 (NEON_FORMAT): Rewrite to use cache results (should fix for cross-compiling), and for GCC, actually test for warnings - fix for Linux. Sat Dec 8 00:15:44 2001 Joe Orton * neon.m4 (NEON_CHECK_SUPPORT): Send --support output to /dev/null, in case it is from pre-0.18 and prints the usage message. Sat Dec 8 00:13:55 2001 Joe Orton * neon.m4 (NEON_COMMON): Prepend -lneon to NEON_LIBS rather than overwriting it when using bundled build. Mon Dec 3 19:49:28 2001 Joe Orton * neon.m4 (NEON_FORMAT_PREP, NEON_FORMAT): New macros. (LIBNEON_SOURCE_CHECKS): Call them. Mon Dec 3 19:43:11 2001 Joe Orton Fix gethostbyname() detection on Unixware 7: * neon.m4 (NEON_COMMON): Add -lneon to NEON_LIBS after performing source checks. (NE_SEARCH_LIBS): Test using libraries from NEON_LIBS too. Sat Nov 24 20:33:11 2001 Joe Orton * neon.m4 (NEON_CHECK_SUPPORT): New macro. (NEON_COMMON): Define NEON_SUPPORTS_{SSL,ZLIB} when using an external neon. Sat Nov 24 20:25:15 2001 Joe Orton * neon.m4 (NEON_WITHOUT_ZLIB): New function. (LIBNEON_SOURCE_CHECKS): Conditionally enable zlib support. Sun Nov 18 12:29:08 2001 Joe Orton * neon-ssl.m4 (NEON_SSL): Don't add -I/usr/include to NEON_CFLAGS. Sat Oct 27 12:20:08 2001 Joe Orton * neon.m4, neon-ssl.m4: Substitute NEON_SUPPORTS_ZLIB, NEON_SUPPORTS_DAV, NEON_SUPPORTS_SSL as "yes" or "no" appropriately. Thu Oct 25 14:29:53 2001 Mo DeJong * neon.m4 (NEON_NORMAL_BUILD): Use AC_CHECK_TOOL instead of AC_PATH_PROG so that cross compilation works properly. Sat Oct 6 13:36:58 2001 Joe Orton * neon.m4 (NEON_ZLIB): New macro. (LIBNEON_SOURCE_CHECKS): print warning if struct tm lacks tm_gmtoff. Sat Oct 6 12:39:09 2001 Joe Orton * neon.m4: Require autoconf 2.50. Use AC_HELP_STRING where possible, and AC_MSG_NOTICE instead of 'echo'. * neon-ssl.m4, neon-xml-parser.m4, neon-socks.m4: Quoting fixes for help strings. Tue Oct 2 21:13:24 2001 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for tm_gmtoff in struct tm. Sun Sep 30 23:35:03 2001 Joe Orton * neon.m4 (NE_SEARCH_LIBS): AC_SEARCH_LIBS replacement, adds found libraries to NEON_LIBS instead. Sun Sep 30 11:11:19 2001 Joe Orton * neon-test.m4: New file. Sun Sep 30 11:09:58 2001 Joe Orton * neon.m4, neon-xml-parser.m4: Always add libs to $LIBS rather than $NEONLIBS. * neon.m4: Export NEON_CFLAGS. Sat Sep 29 14:12:53 2001 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for zlib (zlib.h, inflate in -lz). Add ne_compress to NEON_EXTRAOBJS. Tue Sep 25 07:31:53 2001 Mo DeJong * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for instead of . Define HAVE_SIGPIPE if SIGPIPE is defined in . Mon Sep 24 20:16:47 2001 Joe Orton * neon-xml-parser.m4 (NEON_XML_EXTERNAL_EXPAT): Fix broken AC_DEFINE (Mo DeJong). Mon Sep 24 17:24:42 2001 Joe Orton * ac_c_bigendian_cross.m4: New file. * neon.m4: Use AC_C_BIGENDIAN_CROSS rather than AC_C_BIGENDIAN. Mon Sep 17 23:29:11 2001 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for setvbuf(). Sun Sep 16 20:39:05 2001 Joe Orton * neon-ssl.m4 (NEON_SSL): Put SSL libs in LIBS rather than NEONLIBS (and lib paths). Sun Sep 16 20:36:53 2001 Joe Orton * neon.m4 (NEON_COMMON): Add library paths to NEONLIBS rather than LDFLAGS. Sat Jun 9 22:06:25 2001 Joe Orton * neon-debug.m4: New file. Thu May 31 00:04:51 2001 Joe Orton * neon.m4 (NEON_COMMON_BUILD): Update filenames. (NEON_CHECK_VERSION): Do simple AC_TRY_LINK and warn appropriately before checking version. Thu May 31 00:03:40 2001 Joe Orton * neon-warnings.m4: Add -Wbad-function-cast. Wed May 30 23:37:48 2001 Joe Orton * neon-xml-parser.m4: Added --with-libxml1 and --with-libxml2 arguments. Tue Apr 17 23:06:25 2001 Joe Orton * neon-ssl.m4: Define neon_ssl_message for configure output. Wed Apr 11 23:14:33 2001 Joe Orton * neon.m4 (NEON_COMMON_BUILD): Fix specifying a list of object files. Fri Apr 6 23:09:58 2001 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Call NEON_SOCKS. Fri Apr 6 23:08:39 2001 Joe Orton * neon-socks.m4: Add basic SOCKSv5 support (untested). Mon Apr 2 21:42:40 2001 Joe Orton * neon.m4: Version is 0.13.0, interface version 13:0:0. Mon Apr 2 00:27:37 2001 Joe Orton * neon.m4: Move check for 'ar' program to NEON_NORMAL_BUILD, it's not necessary for libtool build. Mon Apr 2 00:17:58 2001 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Check for xmlversion.h header from libxml2. Sun Apr 1 21:23:26 2001 Joe Orton * neon-xml-parser.m4: Add expat2 support (Sam TH ). Wed Mar 21 10:56:03 2001 Joe Orton * neon-xml-parser.m4: Add libxml2 support. Sun Mar 4 15:45:21 2001 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Use an m4 ifelse rather than a shell test to code the conditional on whether an argument was passed to the macro or not. Sun Mar 4 15:23:47 2001 Joe Orton * neon.m4: Add "actions if not bundled" argument to *_BUNDLED macros. Mon Feb 26 22:52:24 2001 Joe Orton * neon.m4: Version is 0.12.0. Mon Feb 26 22:06:13 2001 Joe Orton * neon.m4: Versionn is 0.12.0-dev. Sun Feb 25 17:12:49 2001 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Add checks for endianness (for md5 code), inline, and const. Sun Feb 25 17:00:07 2001 Joe Orton * neon.m4 (NEON_COMMON): Rename NEON_IS_BUNDLED to NEON_BUILD_BUNDLED. Sun Feb 25 16:52:19 2001 Joe Orton * neon.m4 (NEON_COMMON): Define NEON_IS_BUNDLED to "yes" or "no" appropriately. Sat Feb 24 00:06:09 2001 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Don't set NEON_NEED_XML_PARSER here. (NEON_COMMON): ... set it here instead. (NEON_WITHOUT_WEBDAV): New macro to disable WebDAV support. (NEON_COMMON_BUILD): Select default set of object files to build depending on whether DAV is enabled or not. Fri Feb 23 23:28:09 2001 Joe Orton * neon.m4 (NEON_COMMON_BUILD): Use an m4 'ifelse' for the number of args test. * neon.m4 (NEON_LIBTOOL_BUILD, NEON_NORMAL_BUILD, NEON_COMMON_BUILD): Set NEON_OBJEXT correctly (fixes dependancies). Sun Feb 4 14:55:10 2001 Joe Orton * neon.m4: Version is 0.11.0, interface version is 11:0:0. Sun Jan 28 17:16:27 2001 Joe Orton * neon.m4 (NEON_CHECK_VERSION): Run actions-if-okay if NEON_REQUIRE has not been called. Sun Jan 28 14:53:57 2001 Joe Orton * neon.m4 (NEON_REQUIRE, NEON_CHECK_VERSION): New macros. (NEON_COMMON): If a required version is defined, check that an external neon library matches it. Sun Jan 28 10:39:31 2001 Joe Orton * neon.m4: Define NEON_VERSION, NEON_VERSION_{MAJOR,MINOR} in config.h rather than substituting into neon_config.h. Sat Jan 27 22:55:42 2001 Joe Orton * neon.m4: Include version string in library message. Tue Jan 23 23:14:33 2001 Joe Orton * neon.m4 (NEON_VERSIONS): New macro. (NEON_COMMON): Call it from here. Mon Jan 15 22:26:54 2001 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Append rather than overwrite CFLAGS. Thu Jan 11 20:49:12 2001 Joe Orton * neon-ssl.m4: Check for OpenSSL in /usr too. Thu Jan 11 20:05:34 2001 Joe Orton * neon.m4 (NEON_VPATH_BUNDLED): New macro. (NEON_BUNDLED): Call NEON_COMMON_BUNDLED. (NEON_COMMON_BUNDLED): Abstracted from NEON_BUNDLED. Wed Jan 10 22:44:37 2001 Joe Orton * neon.m4 (NEON_LIBTOOL_BUILD, NEON_NORMAL_BUILD): Pass optional set of objects to build to these macros. Else, all objects go in NEONOBJS. (NEON_COMMON_BUILD): Implement that. Also substitute NEON_LINK_FLAGS. Mon Jan 8 22:23:51 2001 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Put XML parser libs in $NEONLIBS rather than $LIBS. Mon Jan 8 22:20:51 2001 Joe Orton * neon-ssl.m4 (NEON_SSL): Put OpenSSL libs in $NEONLIBS rather than LIBS. Sun Jan 7 17:30:54 2001 Joe Orton * neon.m4 (NEON_BUNDLED): Add optional second argument to specify builddir of bundled sources (Peter Moulder ). Wed Jan 3 21:33:05 2001 Joe Orton * neon.m4: Place libraries needed to use neon in NEONLIBS. Adding them to LIBS breaks bundled builds since libneon doesn't exist at configure-time, and configure uses $LIBS. Wed Jan 3 21:17:00 2001 Joe Orton * neon.m4 (NEON_COMMON_BUILD): Don't set top_builddir using 'pwd'. Wed Jan 3 21:15:04 2001 Joe Orton * neon.m4 (NEON_COMMON): If using bundled neon, add -L to LDFLAGS, and -lneon to LIBS. Fri Dec 22 23:13:39 2000 Joe Orton * neon.m4 (NEON_NORMAL_BUILD, NEON_COMMON_BUILD): New macros. Tue Dec 19 22:13:18 2000 Joe Orton * neon.m4 (NEON_LIBTOOL_BUILD): New macro. Wed Dec 13 22:07:07 2000 Joe Orton * neon.m4: Add a decent interface: NEON_LIBRARY for non-bundled case, NEON_BUNDLED for the bundled case. (LIBNEON_SOURCE_CHECKS): Always set NEON_NEED_XML_PARSER. * neon-xml-parser.m4 (NEON_XML_PARSER): Only execute if "$NEON_NEED_XML_PARSER" = "yes". Sun Nov 19 22:52:56 2000 Joe Orton * neon.m4, neon-ssl.m4, neon-warnings.m4, neon-xml-parser.m4: Clarify that the more liberal license applies to the m4 files only, not neon in general. Sun Nov 19 22:40:01 2000 Joe Orton * neon.m4 (NEON_LIBRARY): Don't call NEON_XML_PARSER, set NEON_NEED_XML_PARSER to "yes" if it needs to be called. Sun Nov 19 22:31:26 2000 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Switch to useing NEON_INCLUDED_EXPAT m4 macro rather than passing arguments. Sun Nov 19 22:20:36 2000 Joe Orton * neon.m4 (NEON_LIBRARY): Switch to using NEON_INCLUDED_SOURCE m4 macro rather than passing arguments to the NEON_LIBRARY macro. Sun Nov 5 23:26:18 2000 Joe Orton * neon-xml-parser.m4: Never set LIBS if using a libtool-built libexpat.la (Greg Stein). 2000-10-10 Joe Orton * neon-xml-parser.m4: If libexpat.la is included in the --with-expat parameter, then use a libtool-friendly LIBS. (Greg Stein) Sat Oct 7 19:16:08 2000 Joe Orton * neon-xml-parser.m4: Link against a libexpat.la if found in --with-expat location. (Greg Stein). Mon Sep 11 15:05:58 2000 Joe Orton * neon.m4: Use AC_SEARCH_LIBS for finding gethostbyname() and socket(). Mon Sep 11 15:03:45 2000 Joe Orton * neon.m4 (NEON_REPLACE_SNPRINTF): New macro. Fri Sep 8 14:30:37 2000 Joe Orton * neon.m4: Check for socket() in -lsocket, -linet. Thu Sep 7 00:11:51 2000 Joe Orton * neon-xml-parser.m4: Added --with-expat flag (patch by Greg Stein). Sun Aug 13 11:12:41 2000 Joe Orton * strftime.m4: New file, from fileutils-4.0i. Thu Jul 27 19:59:18 2000 Joe Orton * neon-ssl.m4: Append the SSL libs on the end of $LIBS rather than redefining it completely. Thu Jul 27 19:43:38 2000 Joe Orton * neon.m4: Define variable neon_library_message to describe what neon library is being used. Mon Jul 24 16:56:34 2000 Joe Orton * neon-ssl.m4: Put -lssl before -lcrypto in LIBS. Thu Jul 20 15:12:14 2000 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Pass directory name containing bundled expat sources as $1. * neon.m4 (NEON_LIBRARY): Pass directory name containing bundled neon sources as $1, and $2 is passed to NEON_XML_PARSER for similar use. Thu Jul 20 15:04:49 2000 Joe Orton * neon-ssl.m4: Rewritten from scratch. Support OpenSSL only. Thu Jul 20 12:41:23 2000 Joe Orton * neon.m4, neon-xml-parser.m4, neon_warnings.m4: Added licensing information. Wed Jul 19 19:30:24 2000 Joe Orton * neon-warnings.m4: New file. (NEON_WARNINGS): Macro for doing --enable-warnings. Sun Jun 18 12:12:23 2000 Joe Orton * neon.m4: Only add --with-included-neon flag if neon is bundled. Sun Jun 18 12:08:23 2000 Joe Orton * gnome-x-checks.m4: Imported from GNOME CVS macros module, adding: descriptive args to AC_DEFINE HAVE_LIBSM call, requiring Gtk 1.2.8 and the Gtk 'gthread' module. Mon May 29 15:10:24 2000 Joe Orton * neon.m4 (LIBNEON_SOURCE_CHECKS): Call NEON_SSL. Tue May 23 19:11:29 2000 Joe Orton * neon.m4: Renamed from neon-checks.m4. Sun May 21 23:52:27 2000 Joe Orton * neon-ssl.m4: New file. Sat May 13 21:08:54 2000 Joe Orton * acconfig.h: Added HAVE_LC_MESSAGE (my lcmessage.m4 is missing the appropriate description arguments). Sat May 13 21:08:40 2000 Joe Orton * acconfig.h: Added PACKAGE and VERSION. Sat May 13 21:02:29 2000 Joe Orton * socklen-arg-type.m4: Added file, modified from a KDE configure.in. Sat May 13 20:44:56 2000 Joe Orton * gnome-x-checks.m4: Added description arguments to AC_DEFINE(HAVE_LIBSM). Wed May 10 19:18:14 2000 Joe Orton * neon-xml-parser.m4: Error if no XML parser is found. Wed May 10 14:33:21 2000 Joe Orton * neon-checks.m4: New file. Wed May 10 14:26:57 2000 Joe Orton * neon-xml-parser.m4 (NEON_XML_PARSER): Use "neon_" prefix for variables. Wed May 10 13:47:04 2000 Joe Orton * acconfig.h: New file. Wed May 10 13:42:16 2000 Joe Orton * neon-xml-parser.m4: New file. Sun May 7 21:57:32 2000 Joe Orton * gnome-x-checks.m4 (GNOME_X_CHECKS): Check for Gtk 1.2.7 or later, passing "gthread" module argument. sitecopy-0.16.6/m4/neon/neon-test.m40000664000076400007640000000261510544776370015247 0ustar joejoe# Copyright (C) 2001-2006 Joe Orton -*- autoconf -*- # # This file is free software; you may copy and/or distribute it with # or without modifications, as long as this notice is preserved. # This software is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. # The above license applies to THIS FILE ONLY, the neon library code # itself may be copied and distributed under the terms of the GNU # LGPL, see COPYING.LIB for more details # This file is part of the neon HTTP/WebDAV client library. # See http://www.webdav.org/neon/ for the latest version. # Please send any feedback to # Tests needed for the neon-test common test code. AC_DEFUN([NE_FORMAT_TIMET], [ NEON_FORMAT(time_t, [ #ifdef HAVE_SYS_TIME_H #include #endif]) ]) AC_DEFUN([NEON_TEST], [ AC_REQUIRE([NEON_COMMON_CHECKS]) AC_REQUIRE([NE_FORMAT_TIMET]) AC_REQUIRE([AC_TYPE_PID_T]) AC_REQUIRE([AC_HEADER_TIME]) dnl NEON_XML_PARSER may add things (e.g. -I/usr/local/include) to dnl CPPFLAGS which make "gcc -Werror" fail in NEON_FORMAT; suggest dnl this macro is used first. AC_BEFORE([$0], [NEON_XML_PARSER]) AC_CHECK_HEADERS(sys/time.h stdint.h locale.h) AC_CHECK_FUNCS(pipe isatty usleep shutdown setlocale) AC_REQUIRE([NE_FIND_AR]) ]) sitecopy-0.16.6/m4/neon/neon-xml-parser.m40000664000076400007640000001214410762776741016364 0ustar joejoe# Copyright (C) 1998-2005, 2007 Joe Orton -*- autoconf -*- # # This file is free software; you may copy and/or distribute it with # or without modifications, as long as this notice is preserved. # This software is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. # The above license applies to THIS FILE ONLY, the neon library code # itself may be copied and distributed under the terms of the GNU # LGPL, see COPYING.LIB for more details # This file is part of the neon HTTP/WebDAV client library. # See http://www.webdav.org/neon/ for the latest version. # Please send any feedback to # Check for XML parser, supporting libxml 2.x and expat 1.95.x, # or a bundled copy of expat. # * Bundled expat if a directory name argument is passed # -> expat dir must contain minimal expat sources, i.e. # xmltok, xmlparse sub-directories. See sitecopy/cadaver for # examples of how to do this. # # Usage: # NEON_XML_PARSER() # or # NEON_XML_PARSER([expat-srcdir], [expat-builddir]) dnl Find expat: run $1 if found, else $2 AC_DEFUN([NE_XML_EXPAT], [ AC_CHECK_HEADER(expat.h, [AC_CHECK_LIB(expat, XML_SetXmlDeclHandler, [ AC_DEFINE(HAVE_EXPAT, 1, [Define if you have expat]) neon_xml_parser_message="expat" NEON_LIBS="$NEON_LIBS -lexpat" neon_xml_parser=expat AC_CHECK_TYPE(XML_Size, [NEON_FORMAT(XML_Size, [#include ])], [AC_DEFINE_UNQUOTED([NE_FMT_XML_SIZE], ["d"])], [#include ]) ], [$1])], [$1]) ]) dnl Find libxml2: run $1 if found, else $2 AC_DEFUN([NE_XML_LIBXML2], [ AC_CHECK_PROG(XML2_CONFIG, xml2-config, xml2-config) if test -n "$XML2_CONFIG"; then neon_xml_parser_message="libxml `$XML2_CONFIG --version`" AC_DEFINE(HAVE_LIBXML, 1, [Define if you have libxml]) # xml2-config in some versions erroneously includes -I/include # in the --cflags output. CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags | sed 's| -I/include||g'`" NEON_LIBS="$NEON_LIBS `$XML2_CONFIG --libs | sed 's|-L/usr/lib ||g'`" AC_CHECK_HEADERS(libxml/xmlversion.h libxml/parser.h,,[ AC_MSG_ERROR([could not find parser.h, libxml installation problem?])]) neon_xml_parser=libxml2 else $1 fi ]) dnl Configure for a bundled expat build. AC_DEFUN([NE_XML_BUNDLED_EXPAT], [ AC_REQUIRE([AC_C_BIGENDIAN]) # Define XML_BYTE_ORDER for expat sources. if test $ac_cv_c_bigendian = "yes"; then ne_xml_border=21 else ne_xml_border=12 fi # mini-expat doesn't pick up config.h CPPFLAGS="$CPPFLAGS -DXML_BYTE_ORDER=$ne_xml_border -DXML_DTD -I$1/xmlparse -I$1/xmltok" AC_DEFINE_UNQUOTED([NE_FMT_XML_SIZE], ["d"]) # Use the bundled expat sources AC_LIBOBJ($2/xmltok/xmltok) AC_LIBOBJ($2/xmltok/xmlrole) AC_LIBOBJ($2/xmlparse/xmlparse) AC_LIBOBJ($2/xmlparse/hashtable) AC_DEFINE(HAVE_EXPAT) AC_DEFINE(HAVE_XMLPARSE_H, 1, [Define if using expat which includes xmlparse.h]) ]) AC_DEFUN([NEON_XML_PARSER], [ dnl Switches to force choice of library AC_ARG_WITH([libxml2], AS_HELP_STRING([--with-libxml2], [force use of libxml 2.x])) AC_ARG_WITH([expat], AS_HELP_STRING([--with-expat], [force use of expat])) dnl Flag to force choice of included expat, if available. ifelse($#, 2, [ AC_ARG_WITH([included-expat], AS_HELP_STRING([--with-included-expat], [use bundled expat sources]),, with_included_expat=no)], with_included_expat=no) if test "$NEON_NEED_XML_PARSER" = "yes"; then # Find an XML parser neon_xml_parser=none # Forced choice of expat: case $with_expat in yes) NE_XML_EXPAT([AC_MSG_ERROR([expat library not found, cannot proceed])]) ;; no) ;; */libexpat.la) # Special case for Subversion ne_expdir=`echo $with_expat | sed 's:/libexpat.la$::'` AC_DEFINE(HAVE_EXPAT) AC_DEFINE_UNQUOTED([NE_FMT_XML_SIZE], ["d"]) CPPFLAGS="$CPPFLAGS -I$ne_expdir" if test "x${NEON_TARGET}" = "xlibneon.la"; then NEON_LTLIBS=$with_expat else # no dependency on libexpat => crippled libneon, so do partial install ALLOW_INSTALL=lib fi neon_xml_parser=expat neon_xml_parser_message="expat in $ne_expdir" ;; /*) AC_MSG_ERROR([--with-expat does not take a directory argument]) ;; esac # If expat wasn't specifically enabled and libxml was: if test "${neon_xml_parser}-${with_libxml2}-${with_included_expat}" = "none-yes-no"; then NE_XML_LIBXML2( [AC_MSG_ERROR([libxml2.x library not found, cannot proceed])]) fi # Otherwise, by default search for expat then libxml2: if test "${neon_xml_parser}-${with_included_expat}" = "none-no"; then NE_XML_EXPAT([NE_XML_LIBXML2([:])]) fi # If an XML parser still has not been found, fail or use the bundled expat if test "$neon_xml_parser" = "none"; then m4_if($1, [], [AC_MSG_ERROR([no XML parser was found: expat or libxml 2.x required])], [# Configure the bundled copy of expat NE_XML_BUNDLED_EXPAT($@) neon_xml_parser_message="bundled expat in $1"]) fi AC_MSG_NOTICE([XML parser used: $neon_xml_parser_message]) fi ]) sitecopy-0.16.6/m4/neon/socklen-arg-type.m40000664000076400007640000000170310127573646016512 0ustar joejoednl This function is (C) 1997,98,99 Stephan Kulow (coolo@kde.org) dnl Modifications (C) Joe Orton 1999,2000 AC_DEFUN([SOCKLEN_ARG_TYPE],[ dnl Check for the type of the third argument of getsockname AC_MSG_CHECKING(for the third argument of getsockname) AC_CACHE_VAL(ac_cv_ksize_t, [AC_TRY_COMPILE([ #include #include ],[ socklen_t a=0; getsockname(0,(struct sockaddr*)0, &a); ], ac_cv_ksize_t=socklen_t, ac_cv_ksize_t=) if test -z "$ac_cv_ksize_t"; then ac_safe_cflags="$CFLAGS" if test "$GCC" = "yes"; then CFLAGS="-Werror $CFLAGS" fi AC_TRY_COMPILE([ #include #include ],[ int a=0; getsockname(0,(struct sockaddr*)0, &a); ], ac_cv_ksize_t=int, ac_cv_ksize_t=size_t) CFLAGS="$ac_safe_cflags" fi ]) if test -z "$ac_cv_ksize_t"; then ac_cv_ksize_t=int fi AC_MSG_RESULT($ac_cv_ksize_t) AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t, [Define to be the type of the third argument to getsockname]) ])sitecopy-0.16.6/README.gnome0000664000076400007640000001262410165765223013571 0ustar joejoe####################################################################### # XSitecopy - a frontend for sitecopy under X11. Written using GNOME. # # # # (C) 2000. Lee Mallabone. # # Distributed under the GNU General public license. See the file # # COPYING for more information. # ####################################################################### Description =========== XSitecopy is a GNOME-based tool for maintaining remote websites. It detects additions, changes, deletion, movement and renames on the local site. It does this without requiring a connection to the remote site. The application can then commit all updates to an FTP or WebDAV server in one session. Sitecopy is a command-line tool that carries out the above - Xsitecopy is the graphical version that provides some extra features as well, such as easy creation of site definitions, at-a-glance tree view of file/directory statuses, and on-the-fly editing of site definitions. Requirements ============ * Gnome-libs >= 1.0.14. * Gtk+ >= 1.2.7. * Gnome-xml. The version numbers are important; there is a bug with gtk+ versions earlier than 1.2.7 that affects multi-threaded apps. The GnomeDruid was only introduced in version 1.0.14 of the gnome libraries. Installation ============ ./configure --enable-gnomefe make make install Usage ===== To run, either type 'xsitecopy' in an xterm, or choose xsitecopy from the GNOME panel menu, under Internet. NB:- See the release notes if you've never used (x)sitecopy before. If you're not sure whether you should be using this program or not, or what the core of it actually does, check the README file that comes with the distribution - it should answer most of your questions as to whether you should be using (x)sitecopy or not. A quick-start guide to XSitecopy ================================ The main window is divided up as follows: At the top is the menu. At the moment, all you can do from the menu is exactly the same as from the toolbar. You can use the buttons in this bar to perform operations on your website(s). It can also be used to create & delete sites, as well as get further help. The main area below the toolbar is split into 2. On the left is a tree view. This shows the title of each site as an entry in the tree. If you expand these items, the files that are related to the selected site will be shown. Clicking on a file brings up information about that file in the right side of the window. If you click on a site, the details and attributes of that site will be displayed in the right hand area. See the docs from the help menu for more information. Hacking on Xsitecopy ==================== First things first... The code to Xsitecopy is not amazingly elegant. It was (is) the first big C program I actually wrote. Quite a lot of it has been rewritten since its original incarnation, but there are still far too many global variables and bits of cruft hanging around. If you're looking for more elegant code, try gnocvs.sourceforge.net which is a work-in-progress CVS front end. It's been designed from the ground-up to be asynchronous and run many many cvs operations at once. I like the code in that significantly more than my xsitecopy code. :) If you do manage to decipher the Xsitecopy source code (some people have!;) then please do feel free to send patches, either to the sitecopy mailing list, (sitecopy@lyra.org) or to me personally (lee0@callnetuk.com). A brief guide to the source in the gnome/ directory is given below. changes.c - Handles events for editing site details. changes.h - Header file_widgets.c - Displays file information when a file is clicked. file_widgets.h - Header gcommon.c - Implements common functions found in src/frontend.h gcommon.h - Header init.c - Creates the main user interface & about box. Will parse preferences some time soon, too. init.h - Header main.c - Creates the threads & semaphores, initialises gnome. minilist.c - Creates the widgets, and handles events for, site excludes, ASCII files, and `ignores'. minilist.h - Header misc.c - Backs up info files and/or the rcfile. Loads and saves the rcfile. Also has error dialog functions - creates the opening ``your rcfile is screwed'' dialog, as well as the dialog for errors with an upload. Creates an animation for use in the various transfer dialogs. misc.h - Header new_site.c - Code to create and handle events for the site creation druid. new_site.h - Header operations.c - thread code for uploading files. Contains wrappers for catching up and initialising a site as well as deleting sites. operations.h - Header resynch.c - Thread code for fetching a file list. resynch.h - Header site_widgets.c - Creates the user interface for editing sites. site_widgets.h - Header tree.c - Builds the main GtkCTree based on the site & file info of all_sites. tree.h - Header XSitecopy is *in development*. I am by no means claiming it as crash-proof. If it does crash while you are using it then, please please please email me (address above), describing as much of what led to the crash as possible, and if you can include a backtrace or patch, that's even better. sitecopy-0.16.6/lib/0000775000076400007640000000000011037462345012344 5ustar joejoesitecopy-0.16.6/lib/fnmatch.h0000664000076400007640000000460410165765223014143 0ustar joejoe/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _FNMATCH_H #define _FNMATCH_H 1 #ifdef __cplusplus extern "C" { #endif #if defined (__cplusplus) || (defined (__STDC__) && __STDC__) #undef __P #define __P(protos) protos #else /* Not C++ or ANSI C. */ #undef __P #define __P(protos) () /* We can get away without defining `const' here only because in this file it is used only inside the prototype for `fnmatch', which is elided in non-ANSI C where `const' is problematical. */ #endif /* C++ or ANSI C. */ /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ #undef FNM_PATHNAME #undef FNM_NOESCAPE #undef FNM_PERIOD /* Bits set in the FLAGS argument to `fnmatch'. */ #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ #endif /* Value returned by `fnmatch' if STRING does not match PATTERN. */ #define FNM_NOMATCH 1 /* Match STRING against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ extern int fnmatch __P ((const char *__pattern, const char *__string, int __flags)); #ifdef __cplusplus } #endif #endif /* fnmatch.h */ sitecopy-0.16.6/lib/neon/0000775000076400007640000000000011037462336013303 5ustar joejoesitecopy-0.16.6/lib/neon/ne_auth.h0000664000076400007640000001172310725552136015104 0ustar joejoe/* HTTP authentication routines Copyright (C) 1999-2007, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_AUTH_H #define NE_AUTH_H #include "ne_session.h" /* for ne_session */ NE_BEGIN_DECLS /* Size of username/password buffers passed to ne_auth_creds * callback. */ #define NE_ABUFSIZ (256) /* The callback used to request the username and password in the given * realm. The username and password must be copied into the buffers * which are both of size NE_ABUFSIZ. The 'attempt' parameter is zero * on the first call to the callback, and increases by one each time * an attempt to authenticate fails. * * The callback must return zero to indicate that authentication * should be attempted with the username/password, or non-zero to * cancel the request. (if non-zero, username and password are * ignored.) * * IMPORTANT NOTE: The callback will be invoked repeatedly until * either it returns non-zero, or authentication is successful. * * Hint: if you just wish to attempt authentication just once (even if * the user gets the username/password wrong), have the callback * function use 'attempt' value as the function return value. */ typedef int (*ne_auth_creds)(void *userdata, const char *realm, int attempt, char *username, char *password); /* Set callbacks to provide credentials for server and proxy * authentication, using the default set of authentication protocols. * userdata is passed as the first argument to the callback. */ void ne_set_server_auth(ne_session *sess, ne_auth_creds creds, void *userdata); void ne_set_proxy_auth(ne_session *sess, ne_auth_creds creds, void *userdata); /* As an alternative to using ne_set_server_auth and * ne_set_proxy_auth, the following interfaces may be used; these * allow control over which authentication protocol is used. */ /* NE_AUTH_BASIC: Basic authentication transmits the username and * password unprotected over the channel; this allows a passive attack * to steal the credentials if using an unsecured channel * (i.e. non-SSL). */ #define NE_AUTH_BASIC (0x0001) /* NE_AUTH_DIGEST: Digest authentication uses a hash of the username, * password, and certain aspects of the request, so prevents passive * attackers from obtaining the credentials; active attackers can * still modify most of the request/response if using an unsecured * channel. */ #define NE_AUTH_DIGEST (0x0002) /* NE_AUTH_NEGOTIATE: Negotiate uses GSSAPI/SSPI to authenticate the * user; an active attacker can modify any of the request/response at * will, so this must not be used over an unsecured channel. */ #define NE_AUTH_NEGOTIATE (0x0004) /* The default set of supported protocols, as deemed appropriate for * the given session scheme. */ #define NE_AUTH_DEFAULT (0x1000) /* All protocols supported by the library. */ #define NE_AUTH_ALL (0x2000) /* Add a callback to provide credentials for server and proxy * authentication using a particular auth protocol or set of * protocols. The protocol is supplied as a bitmask of NE_AUTH_* * values. For NE_AUTH_NEGOTIATE, the creds and userdata arguments * are ignored and may be NULL. * * These functions may be called multiple times per session to * register callbacks for different protocols. If the server presents * more than one protocol in an auth challenge, the following * algorithm will be used to determine which callback is used: * * - iterate over the registered callbacks in the order registered * - for each each callback, iterate over the known set of protocols * in order of algorithm strength (strongest first). * - if the protocol mask for that callback matches the protocol, * attempt authentication using this protocol. * * Therefore, if multiple calls to ne_add_server_auth or * ne_add_proxy_auth are used for a given session, the caller must * ensure that the order in which those calls are made reflects the * precedence of protocols to be used. */ void ne_add_server_auth(ne_session *sess, unsigned protocol, ne_auth_creds creds, void *userdata); void ne_add_proxy_auth(ne_session *sess, unsigned protocol, ne_auth_creds creds, void *userdata); /* Clear any cached authentication credentials for the given * session. */ void ne_forget_auth(ne_session *sess); NE_END_DECLS #endif /* NE_AUTH_H */ sitecopy-0.16.6/lib/neon/ne_stubssl.c0000664000076400007640000000644310752313011015623 0ustar joejoe/* Stubs for SSL support when no SSL library has been configured Copyright (C) 2002-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include /* for NULL */ #include "ne_ssl.h" #include "ne_session.h" char *ne_ssl_readable_dname(const ne_ssl_dname *dn) { return NULL; } ne_ssl_certificate *ne_ssl_cert_read(const char *filename) { return NULL; } int ne_ssl_cert_cmp(const ne_ssl_certificate *c1, const ne_ssl_certificate *c2) { return 1; } const ne_ssl_certificate *ne_ssl_cert_signedby(const ne_ssl_certificate *cert) { return NULL; } const ne_ssl_dname *ne_ssl_cert_issuer(const ne_ssl_certificate *cert) { return NULL; } const ne_ssl_dname *ne_ssl_cert_subject(const ne_ssl_certificate *cert) { return NULL; } void ne_ssl_cert_free(ne_ssl_certificate *cert) {} ne_ssl_client_cert *ne_ssl_clicert_read(const char *filename) { return NULL; } const ne_ssl_certificate *ne_ssl_clicert_owner(const ne_ssl_client_cert *ccert) { return NULL; } int ne_ssl_clicert_encrypted(const ne_ssl_client_cert *ccert) { return -1; } int ne_ssl_clicert_decrypt(ne_ssl_client_cert *ccert, const char *password) { return -1; } void ne_ssl_clicert_free(ne_ssl_client_cert *ccert) {} void ne_ssl_trust_default_ca(ne_session *sess) {} ne_ssl_context *ne_ssl_context_create(int mode) { return NULL; } void ne_ssl_context_trustcert(ne_ssl_context *ctx, const ne_ssl_certificate *cert) {} int ne_ssl_context_set_verify(ne_ssl_context *ctx, int required, const char *ca_names, const char *verify_cas) { return -1; } void ne_ssl_context_set_flag(ne_ssl_context *ctx, int flag, int value) {} void ne_ssl_context_destroy(ne_ssl_context *ctx) {} int ne_ssl_cert_digest(const ne_ssl_certificate *cert, char digest[60]) { return -1; } void ne_ssl_cert_validity_time(const ne_ssl_certificate *cert, time_t *from, time_t *until) {} const char *ne_ssl_cert_identity(const ne_ssl_certificate *cert) { return NULL; } const char *ne_ssl_clicert_name(const ne_ssl_client_cert *ccert) { return NULL; } int ne_ssl_dname_cmp(const ne_ssl_dname *dn1, const ne_ssl_dname *dn2) { return -1; } int ne_ssl_cert_write(const ne_ssl_certificate *cert, const char *filename) { return -1; } char *ne_ssl_cert_export(const ne_ssl_certificate *cert) { return NULL; } ne_ssl_certificate *ne_ssl_cert_import(const char *data) { return NULL; } void ne_ssl_set_clicert(ne_session *sess, const ne_ssl_client_cert *cc) {} sitecopy-0.16.6/lib/neon/ne_207.c0000664000076400007640000002472110356210727014445 0ustar joejoe/* WebDAV 207 multi-status response handling Copyright (C) 1999-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* Generic handling for WebDAV 207 Multi-Status responses. */ #include "config.h" #ifdef HAVE_STDLIB_H #include #endif #include "ne_alloc.h" #include "ne_utils.h" #include "ne_xml.h" #include "ne_207.h" #include "ne_uri.h" #include "ne_basic.h" #include "ne_internal.h" struct ne_207_parser_s { ne_207_start_response *start_response; ne_207_end_response *end_response; ne_207_start_propstat *start_propstat; ne_207_end_propstat *end_propstat; ne_xml_parser *parser; void *userdata; ne_uri base; ne_buffer *cdata; /* remember whether we are in a response: the validation * doesn't encapsulate this since we only count as being * "in a response" when we've seen the href element. */ int in_response; /* current position */ void *response, *propstat; /* caching */ ne_status status; char *description, *href; }; #define ELM_multistatus 1 #define ELM_response 2 #define ELM_responsedescription 3 #define ELM_href 4 #define ELM_prop (NE_207_STATE_PROP) #define ELM_status 6 #define ELM_propstat 7 static const struct ne_xml_idmap map207[] = { { "DAV:", "multistatus", ELM_multistatus }, { "DAV:", "response", ELM_response }, { "DAV:", "responsedescription", ELM_responsedescription }, { "DAV:", "href", ELM_href }, { "DAV:", "propstat", ELM_propstat }, { "DAV:", "prop", ELM_prop }, { "DAV:", "status", ELM_status } }; /* Set the callbacks for the parser */ void ne_207_set_response_handlers(ne_207_parser *p, ne_207_start_response *start, ne_207_end_response *end) { p->start_response = start; p->end_response = end; } void ne_207_set_propstat_handlers(ne_207_parser *p, ne_207_start_propstat *start, ne_207_end_propstat *end) { p->start_propstat = start; p->end_propstat = end; } void *ne_207_get_current_response(ne_207_parser *p) { return p->response; } void *ne_207_get_current_propstat(ne_207_parser *p) { return p->propstat; } /* return non-zero if (child, parent) is an interesting element */ static int can_handle(int parent, int child) { return (parent == 0 && child == ELM_multistatus) || (parent == ELM_multistatus && child == ELM_response) || (parent == ELM_response && (child == ELM_href || child == ELM_status || child == ELM_propstat || child == ELM_responsedescription)) || (parent == ELM_propstat && (child == ELM_prop || child == ELM_status || child == ELM_responsedescription)); } static int cdata_207(void *userdata, int state, const char *buf, size_t len) { ne_207_parser *p = userdata; if ((state == ELM_href || state == ELM_responsedescription || state == ELM_status) && p->cdata->used + len < 2048) ne_buffer_append(p->cdata, buf, len); return 0; } static int start_element(void *userdata, int parent, const char *nspace, const char *name, const char **atts) { ne_207_parser *p = userdata; int state = ne_xml_mapid(map207, NE_XML_MAPLEN(map207), nspace, name); if (!can_handle(parent, state)) return NE_XML_DECLINE; /* if not in a response, ignore everything. */ if (!p->in_response && state != ELM_response && state != ELM_multistatus && state != ELM_href) return NE_XML_DECLINE; if (state == ELM_propstat && p->start_propstat) { p->propstat = p->start_propstat(p->userdata, p->response); if (p->propstat == NULL) { return NE_XML_ABORT; } } ne_buffer_clear(p->cdata); return state; } #define GIVE_STATUS(p) ((p)->status.reason_phrase?&(p)->status:NULL) #define HAVE_CDATA(p) ((p)->cdata->used > 1) static int end_element(void *userdata, int state, const char *nspace, const char *name) { ne_207_parser *p = userdata; const char *cdata = ne_shave(p->cdata->data, "\r\n\t "); switch (state) { case ELM_responsedescription: if (HAVE_CDATA(p)) { if (p->description) ne_free(p->description); p->description = ne_strdup(cdata); } break; case ELM_href: /* Now we have the href, begin the response */ if (p->start_response && HAVE_CDATA(p)) { ne_uri ref, resolved; if (ne_uri_parse(cdata, &ref) == 0) { ne_uri_resolve(&p->base, &ref, &resolved); p->response = p->start_response(p->userdata, &resolved); p->in_response = 1; ne_uri_free(&resolved); } ne_uri_free(&ref); } break; case ELM_status: if (HAVE_CDATA(p)) { if (p->status.reason_phrase) ne_free(p->status.reason_phrase); if (ne_parse_statusline(cdata, &p->status)) { char buf[500]; NE_DEBUG(NE_DBG_HTTP, "Status line: %s\n", cdata); ne_snprintf(buf, 500, _("Invalid HTTP status line in status element " "at line %d of response:\nStatus line was: %s"), ne_xml_currentline(p->parser), cdata); ne_xml_set_error(p->parser, buf); return -1; } else { NE_DEBUG(NE_DBG_XML, "Decoded status line: %s\n", cdata); } } break; case ELM_propstat: if (p->end_propstat) p->end_propstat(p->userdata, p->propstat, GIVE_STATUS(p), p->description); p->propstat = NULL; if (p->description) ne_free(p->description); if (p->status.reason_phrase) ne_free(p->status.reason_phrase); p->description = p->status.reason_phrase = NULL; break; case ELM_response: if (!p->in_response) break; if (p->end_response) p->end_response(p->userdata, p->response, GIVE_STATUS(p), p->description); p->response = NULL; p->in_response = 0; if (p->description) ne_free(p->description); if (p->status.reason_phrase) ne_free(p->status.reason_phrase); p->description = p->status.reason_phrase = NULL; break; } return 0; } ne_207_parser *ne_207_create(ne_xml_parser *parser, const ne_uri *base, void *userdata) { ne_207_parser *p = ne_calloc(sizeof *p); p->parser = parser; p->userdata = userdata; p->cdata = ne_buffer_create(); ne_uri_copy(&p->base, base); /* Add handler for the standard 207 elements */ ne_xml_push_handler(parser, start_element, cdata_207, end_element, p); return p; } void ne_207_destroy(ne_207_parser *p) { if (p->status.reason_phrase) ne_free(p->status.reason_phrase); ne_buffer_destroy(p->cdata); ne_uri_free(&p->base); ne_free(p); } int ne_accept_207(void *userdata, ne_request *req, const ne_status *status) { return (status->code == 207); } /* Handling of 207 errors: we keep a string buffer, and append * messages to it as they come down. * * Note, 424 means it would have worked but something else went wrong. * We will have had the error for "something else", so we display * that, and skip 424 errors. */ /* This is passed as userdata to the 207 code. */ struct context { char *href; ne_buffer *buf; unsigned int is_error; }; static void *start_response(void *userdata, const ne_uri *uri) { struct context *ctx = userdata; if (ctx->href) ne_free(ctx->href); ctx->href = ne_uri_unparse(uri); return NULL; } static void handle_error(struct context *ctx, const ne_status *status, const char *description) { if (status && status->klass != 2 && status->code != 424) { char buf[50]; ctx->is_error = 1; sprintf(buf, "%d", status->code); ne_buffer_concat(ctx->buf, ctx->href, ": ", buf, " ", status->reason_phrase, "\n", NULL); if (description != NULL) { /* TODO: these can be multi-line. Would be good to * word-wrap this at col 80. */ ne_buffer_concat(ctx->buf, " -> ", description, "\n", NULL); } } } static void end_response(void *userdata, void *response, const ne_status *status, const char *description) { struct context *ctx = userdata; handle_error(ctx, status, description); } static void end_propstat(void *userdata, void *propstat, const ne_status *status, const char *description) { struct context *ctx = userdata; handle_error(ctx, status, description); } /* Dispatch a DAV request and handle a 207 error response appropriately */ /* TODO: hook up Content-Type parsing; passing charset to XML parser */ int ne_simple_request(ne_session *sess, ne_request *req) { int ret; struct context ctx = {0}; ne_207_parser *p207; ne_xml_parser *p = ne_xml_create(); ne_uri base = {0}; /* Mock up a base URI; it should really be retrieved from the * request object. */ ne_fill_server_uri(sess, &base); base.path = ne_strdup("/"); p207 = ne_207_create(p, &base, &ctx); ne_uri_free(&base); /* The error string is progressively written into the * ne_buffer by the element callbacks */ ctx.buf = ne_buffer_create(); ne_207_set_response_handlers(p207, start_response, end_response); ne_207_set_propstat_handlers(p207, NULL, end_propstat); ne_add_response_body_reader(req, ne_accept_207, ne_xml_parse_v, p); ret = ne_request_dispatch(req); if (ret == NE_OK) { if (ne_get_status(req)->code == 207) { if (ne_xml_failed(p)) { /* The parse was invalid */ ne_set_error(sess, "%s", ne_xml_get_error(p)); ret = NE_ERROR; } else if (ctx.is_error) { /* If we've actually got any error information * from the 207, then set that as the error */ ne_set_error(sess, "%s", ctx.buf->data); ret = NE_ERROR; } } else if (ne_get_status(req)->klass != 2) { ret = NE_ERROR; } } ne_207_destroy(p207); ne_xml_destroy(p); ne_buffer_destroy(ctx.buf); if (ctx.href) ne_free(ctx.href); ne_request_destroy(req); return ret; } sitecopy-0.16.6/lib/neon/ne_i18n.c0000664000076400007640000000300110304633721014674 0ustar joejoe/* Internationalization of neon Copyright (C) 1999-2005, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include "ne_i18n.h" #ifdef HAVE_LIBINTL_H #include #endif void ne_i18n_init(const char *encoding) { #if defined(NE_HAVE_I18N) && defined(NEON_IS_LIBRARY) /* The bindtextdomain call is only enabled if neon is built as a * library rather than as a bundled source; it would be possible * in the future to allow it for bundled builds too, if the neon * message catalogs could be installed alongside the app's own * message catalogs. */ bindtextdomain("neon", LOCALEDIR); #ifdef HAVE_BIND_TEXTDOMAIN_CODESET if (encoding) { bind_textdomain_codeset("neon", encoding); } #endif /* HAVE_BIND_TEXTDOMAIN_CODESET */ #endif } sitecopy-0.16.6/lib/neon/ne_compress.h0000664000076400007640000000332210646613101015762 0ustar joejoe/* Compressed HTTP response handling Copyright (C) 2001-2004, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_COMPRESS_H #define NE_COMPRESS_H #include "ne_request.h" NE_BEGIN_DECLS typedef struct ne_decompress_s ne_decompress; /* Call this to register a 'reader' callback which will be passed * blocks of response body (if the 'acceptance' callback is * successful). If the response body is returned compressed by the * server, this reader will receive UNCOMPRESSED blocks. * * Returns pointer to context object which must be passed to * ne_decompress_destroy after the request has been dispatched, to * free any internal state. If an error occurs during decompression, * the request will be aborted and session error string set. */ ne_decompress *ne_decompress_reader(ne_request *req, ne_accept_response accpt, ne_block_reader rdr, void *userdata); /* Destroys decompression state. */ void ne_decompress_destroy(ne_decompress *ctx); NE_END_DECLS #endif /* NE_COMPRESS_H */ sitecopy-0.16.6/lib/neon/ne_socket.c0000664000076400007640000013021011033122731015402 0ustar joejoe/* Socket handling routines Copyright (C) 1998-2008, Joe Orton Copyright (C) 1999-2000 Tommi Komulainen Copyright (C) 2004 Aleix Conchillo Flaque This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* portions were originally under GPL in Mutt, http://www.mutt.org/ Relicensed under LGPL for neon, http://www.webdav.org/neon/ */ #include "config.h" #include #ifdef HAVE_SYS_TIME_H #include #endif #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef NE_USE_POLL #include #elif defined(HAVE_SYS_SELECT_H) #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETINET_TCP_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef WIN32 #include #include #ifdef USE_GETADDRINFO #include #endif #endif #if defined(HAVE_OPENSSL) && defined(HAVE_LIMITS_H) #include /* for INT_MAX */ #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_SOCKS_H #include #endif #ifdef HAVE_OPENSSL #include #include #include /* for PKCS12_PBE_add */ #include #include /* for OPENSSL_VERSION_NUMBER */ #endif #ifdef HAVE_GNUTLS #include #endif #define NE_INET_ADDR_DEFINED /* A slightly ugly hack: change the ne_inet_addr definition to be the * real address type used. The API only exposes ne_inet_addr as a * pointer to an opaque object, so this should be well-defined * behaviour. It avoids the hassle of a real wrapper ne_inet_addr * structure, or losing type-safety by using void *. */ #ifdef USE_GETADDRINFO typedef struct addrinfo ne_inet_addr; #else typedef struct in_addr ne_inet_addr; #endif #ifdef NE_HAVE_SSL #include "ne_privssl.h" /* MUST come after ne_inet_addr is defined */ #endif /* To avoid doing AAAA queries unless absolutely necessary, either use * AI_ADDRCONFIG where available, or a run-time check for working IPv6 * support; the latter is only known to work on Linux. */ #if defined(USE_GETADDRINFO) && !defined(USE_GAI_ADDRCONFIG) && defined(__linux__) #define USE_CHECK_IPV6 #endif /* "Be Conservative In What You Build". */ #if defined(HAVE_FCNTL) && defined(O_NONBLOCK) && defined(F_SETFL) \ && defined(HAVE_GETSOCKOPT) && defined(SO_ERROR) \ && defined(HAVE_SOCKLEN_T) && defined(SOL_SOCKET) \ && defined(EINPROGRESS) #define USE_NONBLOCKING_CONNECT #endif #include "ne_internal.h" #include "ne_utils.h" #include "ne_string.h" #include "ne_socket.h" #include "ne_alloc.h" #include "ne_sspi.h" #if defined(__BEOS__) && !defined(BONE_VERSION) /* pre-BONE */ #define ne_close(s) closesocket(s) #define ne_errno errno #elif defined(WIN32) #define ne_close(s) closesocket(s) #define ne_errno WSAGetLastError() #else /* really Unix! */ #define ne_close(s) close(s) #define ne_errno errno #endif #ifdef WIN32 #define NE_ISRESET(e) ((e) == WSAECONNABORTED || (e) == WSAETIMEDOUT || \ (e) == WSAECONNRESET || (e) == WSAENETRESET) #define NE_ISCLOSED(e) ((e) == WSAESHUTDOWN || (e) == WSAENOTCONN) #define NE_ISINTR(e) (0) #define NE_ISINPROGRESS(e) ((e) == WSAEWOULDBLOCK) /* says MSDN */ #else /* Unix */ /* Also treat ECONNABORTED and ENOTCONN as "connection reset" errors; * both can be returned by Winsock-based sockets layers e.g. CygWin */ #ifndef ECONNABORTED #define ECONNABORTED ECONNRESET #endif #ifndef ENOTCONN #define ENOTCONN ECONNRESET #endif #define NE_ISRESET(e) ((e) == ECONNRESET || (e) == ECONNABORTED || (e) == ENOTCONN) #define NE_ISCLOSED(e) ((e) == EPIPE) #define NE_ISINTR(e) ((e) == EINTR) #define NE_ISINPROGRESS(e) ((e) == EINPROGRESS) #endif /* Socket read timeout */ #define SOCKET_READ_TIMEOUT 120 /* Critical I/O functions on a socket: useful abstraction for easily * handling SSL I/O alongside raw socket I/O. */ struct iofns { /* Read up to 'len' bytes into 'buf' from socket. Return <0 on * error or EOF, or >0; number of bytes read. */ ssize_t (*sread)(ne_socket *s, char *buf, size_t len); /* Write up to 'len' bytes from 'buf' to socket. Return number of * bytes written on success, or <0 on error. */ ssize_t (*swrite)(ne_socket *s, const char *buf, size_t len); /* Wait up to 'n' seconds for socket to become readable. Returns * 0 when readable, otherwise NE_SOCK_TIMEOUT or NE_SOCK_ERROR. */ int (*readable)(ne_socket *s, int n); }; static const ne_inet_addr dummy_laddr; struct ne_socket_s { int fd; unsigned int lport; const ne_inet_addr *laddr; void *progress_ud; int rdtimeout, cotimeout; /* timeouts */ const struct iofns *ops; #ifdef NE_HAVE_SSL ne_ssl_socket ssl; #endif /* The read buffer: ->buffer stores byte which have been read; as * these are consumed and passed back to the caller, bufpos * advances through ->buffer. ->bufavail gives the number of * bytes which remain to be consumed in ->buffer (from ->bufpos), * and is hence always <= RDBUFSIZ. */ char *bufpos; size_t bufavail; #define RDBUFSIZ 4096 char buffer[RDBUFSIZ]; /* Error string. */ char error[192]; }; /* ne_sock_addr represents an Internet address. */ struct ne_sock_addr_s { #ifdef USE_GETADDRINFO struct addrinfo *result, *cursor; #else struct in_addr *addrs; size_t cursor, count; #endif int errnum; }; /* set_error: set socket error string to 'str'. */ #define set_error(s, str) ne_strnzcpy((s)->error, (str), sizeof (s)->error) /* set_strerror: set socket error to system error string for 'errnum' */ #ifdef WIN32 /* Print system error message to given buffer. */ static void print_error(int errnum, char *buffer, size_t buflen) { if (FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD) errnum, 0, buffer, buflen, NULL) == 0) ne_snprintf(buffer, buflen, "Socket error %d", errnum); } #define set_strerror(s, e) print_error((e), (s)->error, sizeof (s)->error) #else /* not WIN32 */ #define set_strerror(s, e) ne_strerror((e), (s)->error, sizeof (s)->error) #endif #ifdef HAVE_OPENSSL /* Seed the SSL PRNG, if necessary; returns non-zero on failure. */ static int seed_ssl_prng(void) { /* Check whether the PRNG has already been seeded. */ if (RAND_status() == 1) return 0; #if defined(EGD_PATH) NE_DEBUG(NE_DBG_SOCKET, "Seeding PRNG from " EGD_PATH "...\n"); if (RAND_egd(EGD_PATH) != -1) return 0; #elif defined(ENABLE_EGD) { static const char *paths[] = { "/var/run/egd-pool", "/dev/egd-pool", "/etc/egd-pool", "/etc/entropy" }; size_t n; for (n = 0; n < sizeof(paths) / sizeof(char *); n++) { NE_DEBUG(NE_DBG_SOCKET, "Seeding PRNG from %s...\n", paths[n]); if (RAND_egd(paths[n]) != -1) return 0; } } #endif /* EGD_PATH */ NE_DEBUG(NE_DBG_SOCKET, "No entropy source found; could not seed PRNG.\n"); return -1; } #endif /* HAVE_OPENSSL */ #ifdef USE_CHECK_IPV6 static int ipv6_disabled = 0; /* On Linux kernels, IPv6 is typically built as a loadable module, and * socket(AF_INET6, ...) will fail if this module is not loaded, so * the slow AAAA lookups can be avoided for this common case. */ static void init_ipv6(void) { int fd = socket(AF_INET6, SOCK_STREAM, 0); if (fd < 0) ipv6_disabled = 1; else close(fd); } #elif defined(AF_INET6) #define ipv6_disabled (0) #else #define ipv6_disabled (1) #endif /* If init_state is N where > 0, ne_sock_init has been called N times; * if == 0, library is not initialized; if < 0, library initialization * has failed. */ static int init_state = 0; int ne_sock_init(void) { #ifdef WIN32 WORD wVersionRequested; WSADATA wsaData; int err; #endif if (init_state > 0) { init_state++; return 0; } else if (init_state < 0) { return -1; } #ifdef WIN32 wVersionRequested = MAKEWORD(2, 2); err = WSAStartup(wVersionRequested, &wsaData); if (err != 0) { return init_state = -1; } #ifdef HAVE_SSPI if (ne_sspi_init() < 0) { return init_state = -1; } #endif #endif #ifdef NE_HAVE_SOCKS SOCKSinit("neon"); #endif #if defined(HAVE_SIGNAL) && defined(SIGPIPE) (void) signal(SIGPIPE, SIG_IGN); #endif #ifdef USE_CHECK_IPV6 init_ipv6(); #endif #ifdef NE_HAVE_SSL if (ne__ssl_init()) { return init_state = -1; } #endif init_state = 1; return 0; } void ne_sock_exit(void) { if (init_state > 0 && --init_state == 0) { #ifdef WIN32 WSACleanup(); #endif #ifdef NE_HAVE_SSL ne__ssl_exit(); #endif #ifdef HAVE_SSPI ne_sspi_deinit(); #endif } } /* Await readability (rdwr = 0) or writability (rdwr != 0) for socket * fd for secs seconds. Returns <0 on error, zero on timeout, >0 if * data is available. */ static int raw_poll(int fdno, int rdwr, int secs) { int ret; #ifdef NE_USE_POLL struct pollfd fds; int timeout = secs > 0 ? secs * 1000 : -1; fds.fd = fdno; fds.events = rdwr == 0 ? POLLIN : POLLOUT; fds.revents = 0; do { ret = poll(&fds, 1, timeout); } while (ret < 0 && NE_ISINTR(ne_errno)); #else fd_set rdfds, wrfds; struct timeval timeout, *tvp = (secs >= 0 ? &timeout : NULL); /* Init the fd set */ FD_ZERO(&rdfds); FD_ZERO(&wrfds); /* Note that (amazingly) the FD_SET macro does not expand * correctly on Netware if not inside a compound statement * block. */ if (rdwr == 0) { FD_SET(fdno, &rdfds); } else { FD_SET(fdno, &wrfds); } if (tvp) { tvp->tv_sec = secs; tvp->tv_usec = 0; } do { ret = select(fdno + 1, &rdfds, &wrfds, NULL, tvp); } while (ret < 0 && NE_ISINTR(ne_errno)); #endif return ret; } int ne_sock_block(ne_socket *sock, int n) { if (sock->bufavail) return 0; return sock->ops->readable(sock, n); } /* Cast address object AD to type 'sockaddr_TY' */ #define SACAST(ty, ad) ((struct sockaddr_##ty *)(ad)) ssize_t ne_sock_read(ne_socket *sock, char *buffer, size_t buflen) { ssize_t bytes; #if 0 NE_DEBUG(NE_DBG_SOCKET, "buf: at %d, %d avail [%s]\n", sock->bufpos - sock->buffer, sock->bufavail, sock->bufpos); #endif if (sock->bufavail > 0) { /* Deliver buffered data. */ if (buflen > sock->bufavail) buflen = sock->bufavail; memcpy(buffer, sock->bufpos, buflen); sock->bufpos += buflen; sock->bufavail -= buflen; return buflen; } else if (buflen >= sizeof sock->buffer) { /* No need for read buffer. */ return sock->ops->sread(sock, buffer, buflen); } else { /* Fill read buffer. */ bytes = sock->ops->sread(sock, sock->buffer, sizeof sock->buffer); if (bytes <= 0) return bytes; if (buflen > (size_t)bytes) buflen = bytes; memcpy(buffer, sock->buffer, buflen); sock->bufpos = sock->buffer + buflen; sock->bufavail = bytes - buflen; return buflen; } } ssize_t ne_sock_peek(ne_socket *sock, char *buffer, size_t buflen) { ssize_t bytes; if (sock->bufavail) { /* just return buffered data. */ bytes = sock->bufavail; } else { /* fill the buffer. */ bytes = sock->ops->sread(sock, sock->buffer, sizeof sock->buffer); if (bytes <= 0) return bytes; sock->bufpos = sock->buffer; sock->bufavail = bytes; } if (buflen > (size_t)bytes) buflen = bytes; memcpy(buffer, sock->bufpos, buflen); return buflen; } /* Await data on raw fd in socket. */ static int readable_raw(ne_socket *sock, int secs) { int ret = raw_poll(sock->fd, 0, secs); if (ret < 0) { set_strerror(sock, ne_errno); return NE_SOCK_ERROR; } return (ret == 0) ? NE_SOCK_TIMEOUT : 0; } static ssize_t read_raw(ne_socket *sock, char *buffer, size_t len) { ssize_t ret; ret = readable_raw(sock, sock->rdtimeout); if (ret) return ret; do { ret = recv(sock->fd, buffer, len, 0); } while (ret == -1 && NE_ISINTR(ne_errno)); if (ret == 0) { set_error(sock, _("Connection closed")); ret = NE_SOCK_CLOSED; } else if (ret < 0) { int errnum = ne_errno; ret = NE_ISRESET(errnum) ? NE_SOCK_RESET : NE_SOCK_ERROR; set_strerror(sock, errnum); } return ret; } #define MAP_ERR(e) (NE_ISCLOSED(e) ? NE_SOCK_CLOSED : \ (NE_ISRESET(e) ? NE_SOCK_RESET : NE_SOCK_ERROR)) static ssize_t write_raw(ne_socket *sock, const char *data, size_t length) { ssize_t ret; #ifdef __QNX__ /* Test failures seen on QNX over loopback, if passing large * buffer lengths to send(). */ if (length > 8192) length = 8192; #endif do { ret = send(sock->fd, data, length, 0); } while (ret == -1 && NE_ISINTR(ne_errno)); if (ret < 0) { int errnum = ne_errno; set_strerror(sock, errnum); return MAP_ERR(errnum); } return ret; } static const struct iofns iofns_raw = { read_raw, write_raw, readable_raw }; #ifdef HAVE_OPENSSL /* OpenSSL I/O function implementations. */ static int readable_ossl(ne_socket *sock, int secs) { if (SSL_pending(sock->ssl)) return 0; return readable_raw(sock, secs); } /* SSL error handling, according to SSL_get_error(3). */ static int error_ossl(ne_socket *sock, int sret) { int errnum = SSL_get_error(sock->ssl, sret); unsigned long err; if (errnum == SSL_ERROR_ZERO_RETURN) { set_error(sock, _("Connection closed")); return NE_SOCK_CLOSED; } /* for all other errors, look at the OpenSSL error stack */ err = ERR_get_error(); if (err == 0) { /* Empty error stack, presume this is a system call error: */ if (sret == 0) { /* EOF without close_notify, possible truncation */ set_error(sock, _("Secure connection truncated")); return NE_SOCK_TRUNC; } else { /* Other socket error. */ errnum = ne_errno; set_strerror(sock, errnum); return MAP_ERR(errnum); } } if (ERR_reason_error_string(err)) { ne_snprintf(sock->error, sizeof sock->error, _("SSL error: %s"), ERR_reason_error_string(err)); } else { ne_snprintf(sock->error, sizeof sock->error, _("SSL error code %d/%d/%lu"), sret, errnum, err); } /* make sure the error stack is now empty. */ ERR_clear_error(); return NE_SOCK_ERROR; } /* Work around OpenSSL's use of 'int' rather than 'size_t', to prevent * accidentally passing a negative number, etc. */ #define CAST2INT(n) (((n) > INT_MAX) ? INT_MAX : (n)) static ssize_t read_ossl(ne_socket *sock, char *buffer, size_t len) { int ret; ret = readable_ossl(sock, sock->rdtimeout); if (ret) return ret; ret = SSL_read(sock->ssl, buffer, CAST2INT(len)); if (ret <= 0) ret = error_ossl(sock, ret); return ret; } static ssize_t write_ossl(ne_socket *sock, const char *data, size_t len) { int ret, ilen = CAST2INT(len); ret = SSL_write(sock->ssl, data, ilen); /* ssl.h says SSL_MODE_ENABLE_PARTIAL_WRITE must be enabled to * have SSL_write return < length... so, SSL_write should never * return < length. */ if (ret != ilen) return error_ossl(sock, ret); return ret; } static const struct iofns iofns_ssl = { read_ossl, write_ossl, readable_ossl }; #elif defined(HAVE_GNUTLS) /* Return zero if an alert value can be ignored. */ static int check_alert(ne_socket *sock, ssize_t ret) { const char *alert; if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED) { alert = gnutls_alert_get_name(gnutls_alert_get(sock->ssl)); NE_DEBUG(NE_DBG_SOCKET, "TLS warning alert: %s\n", alert); return 0; } else if (ret == GNUTLS_E_FATAL_ALERT_RECEIVED) { alert = gnutls_alert_get_name(gnutls_alert_get(sock->ssl)); NE_DEBUG(NE_DBG_SOCKET, "TLS fatal alert: %s\n", alert); return -1; } return ret; } static int readable_gnutls(ne_socket *sock, int secs) { if (gnutls_record_check_pending(sock->ssl)) { return 0; } return readable_raw(sock, secs); } static ssize_t error_gnutls(ne_socket *sock, ssize_t sret) { ssize_t ret; switch (sret) { case 0: ret = NE_SOCK_CLOSED; set_error(sock, _("Connection closed")); break; case GNUTLS_E_FATAL_ALERT_RECEIVED: ret = NE_SOCK_ERROR; ne_snprintf(sock->error, sizeof sock->error, _("SSL alert received: %s"), gnutls_alert_get_name(gnutls_alert_get(sock->ssl))); break; case GNUTLS_E_UNEXPECTED_PACKET_LENGTH: /* It's not exactly an API guarantee but this error will * always mean a premature EOF. */ ret = NE_SOCK_TRUNC; set_error(sock, _("Secure connection truncated")); break; case GNUTLS_E_PUSH_ERROR: ret = NE_SOCK_RESET; set_error(sock, ("SSL socket write failed")); break; case GNUTLS_E_PULL_ERROR: ret = NE_SOCK_RESET; set_error(sock, _("SSL socket read failed")); break; default: ret = NE_SOCK_ERROR; ne_snprintf(sock->error, sizeof sock->error, _("SSL error: %s"), gnutls_strerror(sret)); } return ret; } #define RETRY_GNUTLS(sock, ret) ((ret < 0) \ && (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN \ || check_alert(sock, ret) == 0)) static ssize_t read_gnutls(ne_socket *sock, char *buffer, size_t len) { ssize_t ret; ret = readable_gnutls(sock, sock->rdtimeout); if (ret) return ret; do { ret = gnutls_record_recv(sock->ssl, buffer, len); } while (RETRY_GNUTLS(sock, ret)); if (ret <= 0) ret = error_gnutls(sock, ret); return ret; } static ssize_t write_gnutls(ne_socket *sock, const char *data, size_t len) { ssize_t ret; do { ret = gnutls_record_send(sock->ssl, data, len); } while (RETRY_GNUTLS(sock, ret)); if (ret < 0) return error_gnutls(sock, ret); return ret; } static const struct iofns iofns_ssl = { read_gnutls, write_gnutls, readable_gnutls }; #endif int ne_sock_fullwrite(ne_socket *sock, const char *data, size_t len) { ssize_t ret; do { ret = sock->ops->swrite(sock, data, len); if (ret > 0) { data += ret; len -= ret; } } while (ret > 0 && len > 0); return ret < 0 ? ret : 0; } ssize_t ne_sock_readline(ne_socket *sock, char *buf, size_t buflen) { char *lf; size_t len; if ((lf = memchr(sock->bufpos, '\n', sock->bufavail)) == NULL && sock->bufavail < RDBUFSIZ) { /* The buffered data does not contain a complete line: move it * to the beginning of the buffer. */ if (sock->bufavail) memmove(sock->buffer, sock->bufpos, sock->bufavail); sock->bufpos = sock->buffer; /* Loop filling the buffer whilst no newline is found in the data * buffered so far, and there is still buffer space available */ do { /* Read more data onto end of buffer. */ ssize_t ret = sock->ops->sread(sock, sock->buffer + sock->bufavail, RDBUFSIZ - sock->bufavail); if (ret < 0) return ret; sock->bufavail += ret; } while ((lf = memchr(sock->buffer, '\n', sock->bufavail)) == NULL && sock->bufavail < RDBUFSIZ); } if (lf) len = lf - sock->bufpos + 1; else len = buflen; /* fall into "line too long" error... */ if ((len + 1) > buflen) { set_error(sock, _("Line too long")); return NE_SOCK_ERROR; } memcpy(buf, sock->bufpos, len); buf[len] = '\0'; /* consume the line from buffer: */ sock->bufavail -= len; sock->bufpos += len; return len; } ssize_t ne_sock_fullread(ne_socket *sock, char *buffer, size_t buflen) { ssize_t len; while (buflen > 0) { len = ne_sock_read(sock, buffer, buflen); if (len < 0) return len; buflen -= len; buffer += len; } return 0; } #ifndef INADDR_NONE #define INADDR_NONE ((in_addr_t) -1) #endif #if !defined(USE_GETADDRINFO) && !defined(WIN32) && !HAVE_DECL_H_ERRNO /* Ancient versions of netdb.h don't export h_errno. */ extern int h_errno; #endif /* This implemementation does not attempt to support IPv6 using * gethostbyname2 et al. */ ne_sock_addr *ne_addr_resolve(const char *hostname, int flags) { ne_sock_addr *addr = ne_calloc(sizeof *addr); #ifdef USE_GETADDRINFO struct addrinfo hints = {0}; char *pnt; hints.ai_socktype = SOCK_STREAM; #ifdef AF_INET6 if (hostname[0] == '[' && ((pnt = strchr(hostname, ']')) != NULL)) { char *hn = ne_strdup(hostname + 1); hn[pnt - hostname - 1] = '\0'; #ifdef AI_NUMERICHOST /* added in the RFC2553 API */ hints.ai_flags = AI_NUMERICHOST; #endif hints.ai_family = AF_INET6; addr->errnum = getaddrinfo(hn, NULL, &hints, &addr->result); ne_free(hn); } else #endif /* AF_INET6 */ { #ifdef USE_GAI_ADDRCONFIG /* added in the RFC3493 API */ hints.ai_flags = AI_ADDRCONFIG; hints.ai_family = AF_UNSPEC; addr->errnum = getaddrinfo(hostname, NULL, &hints, &addr->result); #else hints.ai_family = ipv6_disabled ? AF_INET : AF_UNSPEC; addr->errnum = getaddrinfo(hostname, NULL, &hints, &addr->result); #endif } #else /* Use gethostbyname() */ in_addr_t laddr; struct hostent *hp; laddr = inet_addr(hostname); if (laddr == INADDR_NONE) { hp = gethostbyname(hostname); if (hp == NULL) { #ifdef WIN32 addr->errnum = WSAGetLastError(); #else addr->errnum = h_errno; #endif } else if (hp->h_length != sizeof(struct in_addr)) { /* fail gracefully if somebody set RES_USE_INET6 */ addr->errnum = NO_RECOVERY; } else { size_t n; /* count addresses */ for (n = 0; hp->h_addr_list[n] != NULL; n++) /* noop */; addr->count = n; addr->addrs = ne_malloc(n * sizeof *addr->addrs); for (n = 0; n < addr->count; n++) memcpy(&addr->addrs[n], hp->h_addr_list[n], hp->h_length); } } else { addr->addrs = ne_malloc(sizeof *addr->addrs); addr->count = 1; memcpy(addr->addrs, &laddr, sizeof *addr->addrs); } #endif return addr; } int ne_addr_result(const ne_sock_addr *addr) { return addr->errnum; } const ne_inet_addr *ne_addr_first(ne_sock_addr *addr) { #ifdef USE_GETADDRINFO addr->cursor = addr->result->ai_next; return addr->result; #else addr->cursor = 0; return &addr->addrs[0]; #endif } const ne_inet_addr *ne_addr_next(ne_sock_addr *addr) { #ifdef USE_GETADDRINFO struct addrinfo *ret = addr->cursor; if (addr->cursor) addr->cursor = addr->cursor->ai_next; #else struct in_addr *ret; if (++addr->cursor < addr->count) ret = &addr->addrs[addr->cursor]; else ret = NULL; #endif return ret; } char *ne_addr_error(const ne_sock_addr *addr, char *buf, size_t bufsiz) { #ifdef WIN32 print_error(addr->errnum, buf, bufsiz); #else const char *err; #ifdef USE_GETADDRINFO /* override horrible generic "Name or service not known" error. */ if (addr->errnum == EAI_NONAME) err = _("Host not found"); else err = gai_strerror(addr->errnum); #elif defined(HAVE_HSTRERROR) err = hstrerror(addr->errnum); #else err = _("Host not found"); #endif ne_strnzcpy(buf, err, bufsiz); #endif /* WIN32 */ return buf; } char *ne_iaddr_print(const ne_inet_addr *ia, char *buf, size_t bufsiz) { #if defined(USE_GETADDRINFO) && defined(HAVE_INET_NTOP) const char *ret; #ifdef AF_INET6 if (ia->ai_family == AF_INET6) { struct sockaddr_in6 *in6 = SACAST(in6, ia->ai_addr); ret = inet_ntop(AF_INET6, &in6->sin6_addr, buf, bufsiz); } else #endif if (ia->ai_family == AF_INET) { struct sockaddr_in *in = SACAST(in, ia->ai_addr); ret = inet_ntop(AF_INET, &in->sin_addr, buf, bufsiz); } else ret = NULL; if (ret == NULL) ne_strnzcpy(buf, "[IP address]", bufsiz); #elif defined(USE_GETADDRINFO) && defined(NI_NUMERICHOST) /* use getnameinfo instead for Win32, which lacks inet_ntop: */ if (getnameinfo(ia->ai_addr, ia->ai_addrlen, buf, bufsiz, NULL, 0, NI_NUMERICHOST)) ne_strnzcpy(buf, "[IP address]", bufsiz); #else /* USE_GETADDRINFO */ ne_strnzcpy(buf, inet_ntoa(*ia), bufsiz); #endif return buf; } int ne_iaddr_reverse(const ne_inet_addr *ia, char *buf, size_t bufsiz) { #ifdef USE_GETADDRINFO return getnameinfo(ia->ai_addr, ia->ai_addrlen, buf, bufsiz, NULL, 0, 0); #else struct hostent *hp; hp = gethostbyaddr(ia, sizeof *ia, AF_INET); if (hp && hp->h_name) { ne_strnzcpy(buf, hp->h_name, bufsiz); return 0; } return -1; #endif } void ne_addr_destroy(ne_sock_addr *addr) { #ifdef USE_GETADDRINFO if (addr->result) freeaddrinfo(addr->result); #else if (addr->addrs) ne_free(addr->addrs); #endif ne_free(addr); } /* Perform a connect() for fd to address sa of length salen, with a * timeout if supported on this platform. Returns zero on success or * NE_SOCK_* on failure, with sock->error set appropriately. */ static int timed_connect(ne_socket *sock, int fd, const struct sockaddr *sa, size_t salen) { int ret; #ifdef USE_NONBLOCKING_CONNECT if (sock->cotimeout) { int errnum, flags; /* Get flags and then set O_NONBLOCK. */ flags = fcntl(fd, F_GETFL); if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) { set_strerror(sock, errno); return NE_SOCK_ERROR; } ret = connect(fd, sa, salen); if (ret == -1) { errnum = ne_errno; if (NE_ISINPROGRESS(errnum)) { ret = raw_poll(fd, 1, sock->cotimeout); if (ret > 0) { /* poll got data */ socklen_t len = sizeof(errnum); /* Check whether there is a pending error for the * socket. Per Stevens UNPv1§15.4, Solaris will * return a pending error via errno by failing the * getsockopt() call. */ errnum = 0; if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &errnum, &len)) errnum = errno; if (errnum == 0) { ret = 0; } else { set_strerror(sock, errnum); ret = NE_SOCK_ERROR; } } else if (ret == 0) { /* poll timed out */ set_error(sock, _("Connection timed out")); ret = NE_SOCK_TIMEOUT; } else /* poll failed */ { set_strerror(sock, errno); ret = NE_SOCK_ERROR; } } else /* non-EINPROGRESS error from connect() */ { set_strerror(sock, errnum); ret = NE_SOCK_ERROR; } } /* Reset to old flags: */ if (fcntl(fd, F_SETFL, flags) == -1) { set_strerror(sock, errno); ret = NE_SOCK_ERROR; } } else #endif /* USE_NONBLOCKING_CONNECT */ { ret = connect(fd, sa, salen); if (ret < 0) { set_strerror(sock, errno); ret = NE_SOCK_ERROR; } } return ret; } /* Connect socket to address 'addr' on given 'port'. Returns zero on * success or NE_SOCK_* on failure with sock->error set * appropriately. */ static int connect_socket(ne_socket *sock, int fd, const ne_inet_addr *addr, unsigned int port) { #ifdef USE_GETADDRINFO #ifdef AF_INET6 /* fill in the _family field for AIX 4.3, which forgets to do so. */ if (addr->ai_family == AF_INET6) { struct sockaddr_in6 in6; memcpy(&in6, addr->ai_addr, sizeof in6); in6.sin6_port = port; in6.sin6_family = AF_INET6; return timed_connect(sock, fd, (struct sockaddr *)&in6, sizeof in6); } else #endif if (addr->ai_family == AF_INET) { struct sockaddr_in in; memcpy(&in, addr->ai_addr, sizeof in); in.sin_port = port; in.sin_family = AF_INET; return timed_connect(sock, fd, (struct sockaddr *)&in, sizeof in); } else { set_strerror(sock, EINVAL); return NE_SOCK_ERROR; } #else struct sockaddr_in sa = {0}; sa.sin_family = AF_INET; sa.sin_port = port; sa.sin_addr = *addr; return timed_connect(sock, fd, (struct sockaddr *)&sa, sizeof sa); #endif } ne_socket *ne_sock_create(void) { ne_socket *sock = ne_calloc(sizeof *sock); sock->rdtimeout = SOCKET_READ_TIMEOUT; sock->cotimeout = 0; sock->bufpos = sock->buffer; sock->ops = &iofns_raw; sock->fd = -1; return sock; } #ifdef USE_GETADDRINFO #define ia_family(a) ((a)->ai_family) #define ia_proto(a) ((a)->ai_protocol) #else #define ia_family(a) AF_INET #define ia_proto(a) 0 #endif void ne_sock_prebind(ne_socket *sock, const ne_inet_addr *addr, unsigned int port) { sock->lport = port; sock->laddr = addr ? addr : &dummy_laddr; } /* Bind socket 'fd' to address/port 'addr' and 'port', for subsequent * connect() to address of family 'peer_family'. */ static int do_bind(int fd, int peer_family, const ne_inet_addr *addr, unsigned int port) { #if defined(HAVE_SETSOCKOPT) && defined(SO_REUSEADDR) && defined(SOL_SOCKET) { int flag = 1; (void) setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof flag); /* An error here is not fatal, so ignore it. */ } #endif #if defined(USE_GETADDRINFO) && defined(AF_INET6) /* Use a sockaddr_in6 if an AF_INET6 local address is specifed, or * if no address is specified and the peer address is AF_INET6: */ if ((addr != &dummy_laddr && addr->ai_family == AF_INET6) || (addr == &dummy_laddr && peer_family == AF_INET6)) { struct sockaddr_in6 in6; if (addr == &dummy_laddr) memset(&in6, 0, sizeof in6); else memcpy(&in6, addr->ai_addr, sizeof in6); in6.sin6_port = htons(port); /* fill in the _family field for AIX 4.3, which forgets to do so. */ in6.sin6_family = AF_INET6; return bind(fd, (struct sockaddr *)&in6, sizeof in6); } else #endif { struct sockaddr_in in; if (addr == &dummy_laddr) memset(&in, 0, sizeof in); else { #ifdef USE_GETADDRINFO memcpy(&in, addr->ai_addr, sizeof in); #else in.sin_addr = *addr; #endif } in.sin_port = htons(port); in.sin_family = AF_INET; return bind(fd, (struct sockaddr *)&in, sizeof in); } } int ne_sock_connect(ne_socket *sock, const ne_inet_addr *addr, unsigned int port) { int fd, ret; /* use SOCK_STREAM rather than ai_socktype: some getaddrinfo * implementations do not set ai_socktype, e.g. RHL6.2. */ fd = socket(ia_family(addr), SOCK_STREAM, ia_proto(addr)); if (fd < 0) { set_strerror(sock, ne_errno); return -1; } #if !defined(NE_USE_POLL) && !defined(WIN32) if (fd > FD_SETSIZE) { ne_close(fd); set_error(sock, _("Socket descriptor number exceeds FD_SETSIZE")); return NE_SOCK_ERROR; } #endif #if defined(HAVE_FCNTL) && defined(F_GETFD) && defined(F_SETFD) \ && defined(FD_CLOEXEC) /* Set the FD_CLOEXEC bit for the new fd. */ if ((ret = fcntl(fd, F_GETFD)) >= 0) { fcntl(fd, F_SETFD, ret | FD_CLOEXEC); /* ignore failure; not a critical error. */ } #endif if (sock->laddr && (sock->laddr == &dummy_laddr || ia_family(sock->laddr) == ia_family(addr))) { ret = do_bind(fd, ia_family(addr), sock->laddr, sock->lport); if (ret < 0) { int errnum = errno; ne_close(fd); set_strerror(sock, errnum); return NE_SOCK_ERROR; } } #if defined(HAVE_SETSOCKOPT) && (defined(TCP_NODELAY) || defined(WIN32)) { /* Disable the Nagle algorithm. */ int flag = 1; setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof flag); } #endif ret = connect_socket(sock, fd, addr, htons(port)); if (ret == 0) sock->fd = fd; else ne_close(fd); return ret; } ne_inet_addr *ne_sock_peer(ne_socket *sock, unsigned int *port) { union saun { struct sockaddr_in sin; #if defined(USE_GETADDRINFO) && defined(AF_INET6) struct sockaddr_in6 sin6; #endif } saun; socklen_t len = sizeof saun; ne_inet_addr *ia; struct sockaddr *sad = (struct sockaddr *)&saun; if (getpeername(sock->fd, sad, &len) != 0) { set_strerror(sock, errno); return NULL; } #if !defined(USE_GETADDRINFO) || !defined(AF_INET6) if (sad->sa_family != AF_INET) { set_error(sock, _("Socket family not supported")); return NULL; } #endif ia = ne_calloc(sizeof *ia); #ifdef USE_GETADDRINFO ia->ai_addr = ne_malloc(sizeof *ia); ia->ai_addrlen = len; memcpy(ia->ai_addr, sad, len); ia->ai_family = sad->sa_family; #else memcpy(ia, &saun.sin.sin_addr.s_addr, sizeof *ia); #endif #if defined(USE_GETADDRINFO) && defined(AF_INET6) *port = ntohs(sad->sa_family == AF_INET ? saun.sin.sin_port : saun.sin6.sin6_port); #else *port = ntohs(saun.sin.sin_port); #endif return ia; } ne_inet_addr *ne_iaddr_make(ne_iaddr_type type, const unsigned char *raw) { ne_inet_addr *ia; #if !defined(AF_INET6) || !defined(USE_GETADDRINFO) /* fail if IPv6 address is given if IPv6 is not supported. */ if (type == ne_iaddr_ipv6) return NULL; #endif ia = ne_calloc(sizeof *ia); #ifdef USE_GETADDRINFO /* ai_protocol and ai_socktype aren't used by connect_socket() so * ignore them here. (for now) */ if (type == ne_iaddr_ipv4) { struct sockaddr_in *in4 = ne_calloc(sizeof *in4); ia->ai_family = AF_INET; ia->ai_addr = (struct sockaddr *)in4; ia->ai_addrlen = sizeof *in4; in4->sin_family = AF_INET; memcpy(&in4->sin_addr.s_addr, raw, sizeof in4->sin_addr.s_addr); } #ifdef AF_INET6 else { struct sockaddr_in6 *in6 = ne_calloc(sizeof *in6); ia->ai_family = AF_INET6; ia->ai_addr = (struct sockaddr *)in6; ia->ai_addrlen = sizeof *in6; in6->sin6_family = AF_INET6; memcpy(&in6->sin6_addr, raw, sizeof in6->sin6_addr.s6_addr); } #endif #else /* !USE_GETADDRINFO */ memcpy(&ia->s_addr, raw, sizeof ia->s_addr); #endif return ia; } ne_iaddr_type ne_iaddr_typeof(const ne_inet_addr *ia) { #if defined(USE_GETADDRINFO) && defined(AF_INET6) return ia->ai_family == AF_INET6 ? ne_iaddr_ipv6 : ne_iaddr_ipv4; #else return ne_iaddr_ipv4; #endif } int ne_iaddr_cmp(const ne_inet_addr *i1, const ne_inet_addr *i2) { #ifdef USE_GETADDRINFO if (i1->ai_family != i2->ai_family) return i2->ai_family - i1->ai_family; if (i1->ai_family == AF_INET) { struct sockaddr_in *in1 = SACAST(in, i1->ai_addr), *in2 = SACAST(in, i2->ai_addr); return memcmp(&in1->sin_addr.s_addr, &in2->sin_addr.s_addr, sizeof in1->sin_addr.s_addr); } #ifdef AF_INET6 else if (i1->ai_family == AF_INET6) { struct sockaddr_in6 *in1 = SACAST(in6, i1->ai_addr), *in2 = SACAST(in6, i2->ai_addr); return memcmp(in1->sin6_addr.s6_addr, in2->sin6_addr.s6_addr, sizeof in1->sin6_addr.s6_addr); } #endif /* AF_INET6 */ else return -1; #else return memcmp(&i1->s_addr, &i2->s_addr, sizeof i1->s_addr); #endif /* USE_GETADDRINFO */ } void ne_iaddr_free(ne_inet_addr *addr) { #ifdef USE_GETADDRINFO ne_free(addr->ai_addr); #endif ne_free(addr); } int ne_sock_accept(ne_socket *sock, int listener) { int fd = accept(listener, NULL, NULL); if (fd < 0) return -1; sock->fd = fd; return 0; } int ne_sock_fd(const ne_socket *sock) { return sock->fd; } void ne_sock_read_timeout(ne_socket *sock, int timeout) { sock->rdtimeout = timeout; } void ne_sock_connect_timeout(ne_socket *sock, int timeout) { sock->cotimeout = timeout; } #ifdef NE_HAVE_SSL #ifdef HAVE_GNUTLS /* Dumb server session cache implementation for GNUTLS; holds a single * session. */ /* Copy datum 'src' to 'dest'. */ static void copy_datum(gnutls_datum *dest, gnutls_datum *src) { dest->size = src->size; dest->data = memcpy(gnutls_malloc(src->size), src->data, src->size); } /* Callback to store a session 'data' with id 'key'. */ static int store_sess(void *userdata, gnutls_datum key, gnutls_datum data) { ne_ssl_context *ctx = userdata; if (ctx->cache.server.key.data) { gnutls_free(ctx->cache.server.key.data); gnutls_free(ctx->cache.server.data.data); } copy_datum(&ctx->cache.server.key, &key); copy_datum(&ctx->cache.server.data, &data); return 0; } /* Returns non-zero if d1 and d2 are the same datum. */ static int match_datum(gnutls_datum *d1, gnutls_datum *d2) { return d1->size == d2->size && memcmp(d1->data, d2->data, d1->size) == 0; } /* Callback to retrieve a session of id 'key'. */ static gnutls_datum retrieve_sess(void *userdata, gnutls_datum key) { ne_ssl_context *ctx = userdata; gnutls_datum ret = { NULL, 0 }; if (match_datum(&ctx->cache.server.key, &key)) { copy_datum(&ret, &ctx->cache.server.data); } return ret; } /* Callback to remove a session of id 'key'; stub needed but * implementation seems unnecessary. */ static int remove_sess(void *userdata, gnutls_datum key) { return -1; } #endif int ne_sock_accept_ssl(ne_socket *sock, ne_ssl_context *ctx) { int ret; ne_ssl_socket ssl; #if defined(HAVE_OPENSSL) ssl = SSL_new(ctx->ctx); SSL_set_fd(ssl, sock->fd); sock->ssl = ssl; ret = SSL_accept(ssl); if (ret != 1) { return error_ossl(sock, ret); } #elif defined(HAVE_GNUTLS) gnutls_init(&ssl, GNUTLS_SERVER); gnutls_credentials_set(ssl, GNUTLS_CRD_CERTIFICATE, ctx->cred); gnutls_set_default_priority(ssl); /* Set up dummy session cache. */ gnutls_db_set_store_function(ssl, store_sess); gnutls_db_set_retrieve_function(ssl, retrieve_sess); gnutls_db_set_remove_function(ssl, remove_sess); gnutls_db_set_ptr(ssl, ctx); if (ctx->verify) gnutls_certificate_server_set_request(ssl, GNUTLS_CERT_REQUEST); sock->ssl = ssl; gnutls_transport_set_ptr(sock->ssl, (gnutls_transport_ptr)(long)sock->fd); ret = gnutls_handshake(ssl); if (ret < 0) { return error_gnutls(sock, ret); } if (ctx->verify && gnutls_certificate_verify_peers(ssl)) { set_error(sock, _("Client certificate verification failed")); return NE_SOCK_ERROR; } #endif sock->ops = &iofns_ssl; return 0; } int ne_sock_connect_ssl(ne_socket *sock, ne_ssl_context *ctx, void *userdata) { int ret; #if defined(HAVE_OPENSSL) SSL *ssl; if (seed_ssl_prng()) { set_error(sock, _("SSL disabled due to lack of entropy")); return NE_SOCK_ERROR; } /* If runtime library version differs from compile-time version * number in major/minor/fix level, abort soon. */ if ((SSLeay() ^ OPENSSL_VERSION_NUMBER) & 0xFFFFF000) { set_error(sock, _("SSL disabled due to library version mismatch")); return NE_SOCK_ERROR; } sock->ssl = ssl = SSL_new(ctx->ctx); if (!ssl) { set_error(sock, _("Could not create SSL structure")); return NE_SOCK_ERROR; } SSL_set_app_data(ssl, userdata); SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); SSL_set_fd(ssl, sock->fd); sock->ops = &iofns_ssl; #ifdef SSL_set_tlsext_host_name if (ctx->hostname) { /* Try to enable SNI, but ignore failure (should only fail for * >255 char hostnames, which are probably not legal * anyway). */ if (SSL_set_tlsext_host_name(ssl, ctx->hostname) != 1) { ERR_clear_error(); } } #endif if (ctx->sess) SSL_set_session(ssl, ctx->sess); ret = SSL_connect(ssl); if (ret != 1) { error_ossl(sock, ret); SSL_free(ssl); sock->ssl = NULL; return NE_SOCK_ERROR; } #elif defined(HAVE_GNUTLS) /* DH and RSA params are set in ne_ssl_context_create */ gnutls_init(&sock->ssl, GNUTLS_CLIENT); gnutls_set_default_priority(sock->ssl); gnutls_session_set_ptr(sock->ssl, userdata); gnutls_credentials_set(sock->ssl, GNUTLS_CRD_CERTIFICATE, ctx->cred); #ifdef HAVE_GNUTLS_SIGN_CALLBACK_SET if (ctx->sign_func) gnutls_sign_callback_set(sock->ssl, ctx->sign_func, ctx->sign_data); #endif if (ctx->hostname) { gnutls_server_name_set(sock->ssl, GNUTLS_NAME_DNS, ctx->hostname, strlen(ctx->hostname)); } gnutls_transport_set_ptr(sock->ssl, (gnutls_transport_ptr)(long)sock->fd); if (ctx->cache.client.data) { #if defined(HAVE_GNUTLS_SESSION_GET_DATA2) gnutls_session_set_data(sock->ssl, ctx->cache.client.data, ctx->cache.client.size); #else gnutls_session_set_data(sock->ssl, ctx->cache.client.data, ctx->cache.client.len); #endif } sock->ops = &iofns_ssl; ret = gnutls_handshake(sock->ssl); if (ret < 0) { error_gnutls(sock, ret); return NE_SOCK_ERROR; } if (!gnutls_session_is_resumed(sock->ssl)) { /* New session. The old method of using the _get_data * function seems to be broken with 1.3.0 and later*/ #if defined(HAVE_GNUTLS_SESSION_GET_DATA2) gnutls_session_get_data2(sock->ssl, &ctx->cache.client); #else ctx->cache.client.len = 0; if (gnutls_session_get_data(sock->ssl, NULL, &ctx->cache.client.len) == 0) { ctx->cache.client.data = ne_malloc(ctx->cache.client.len); gnutls_session_get_data(sock->ssl, ctx->cache.client.data, &ctx->cache.client.len); } #endif } #endif return 0; } ne_ssl_socket ne__sock_sslsock(ne_socket *sock) { return sock->ssl; } #endif int ne_sock_sessid(ne_socket *sock, unsigned char *buf, size_t *buflen) { #ifdef NE_HAVE_SSL #ifdef HAVE_GNUTLS if (sock->ssl) { return gnutls_session_get_id(sock->ssl, buf, buflen); } else { return -1; } #else SSL_SESSION *sess; if (!sock->ssl) { return -1; } sess = SSL_get0_session(sock->ssl); if (!buf) { *buflen = sess->session_id_length; return 0; } if (*buflen < sess->session_id_length) { return -1; } *buflen = sess->session_id_length; memcpy(buf, sess->session_id, *buflen); return 0; #endif #else return -1; #endif } char *ne_sock_cipher(ne_socket *sock) { #ifdef NE_HAVE_SSL if (sock->ssl) { #ifdef HAVE_OPENSSL const char *name = SSL_get_cipher(sock->ssl); return ne_strdup(name); #elif defined(HAVE_GNUTLS) const char *name = gnutls_cipher_get_name(gnutls_cipher_get(sock->ssl)); return ne_strdup(name); #endif } else #endif /* NE_HAVE_SSL */ { return NULL; } } const char *ne_sock_error(const ne_socket *sock) { return sock->error; } /* Closes given ne_socket */ int ne_sock_close(ne_socket *sock) { int ret; #if defined(HAVE_OPENSSL) if (sock->ssl) { SSL_shutdown(sock->ssl); SSL_free(sock->ssl); } #elif defined(HAVE_GNUTLS) if (sock->ssl) { do { ret = gnutls_bye(sock->ssl, GNUTLS_SHUT_RDWR); } while (ret < 0 && (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN)); } #endif if (sock->fd < 0) ret = 0; else ret = ne_close(sock->fd); ne_free(sock); return ret; } sitecopy-0.16.6/lib/neon/ne_socket.h0000664000076400007640000002245710761754347015451 0ustar joejoe/* socket handling interface Copyright (C) 1999-2007, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_SOCKET_H #define NE_SOCKET_H #include #ifdef WIN32 #include /* for size_t */ #endif #include "ne_defs.h" #include "ne_ssl.h" /* for ne_ssl_context */ NE_BEGIN_DECLS #define NE_SOCK_ERROR (-1) /* Read/Write timed out */ #define NE_SOCK_TIMEOUT (-2) /* Socket was closed */ #define NE_SOCK_CLOSED (-3) /* Connection was reset (e.g. server crashed) */ #define NE_SOCK_RESET (-4) /* Secure connection was closed without proper SSL shutdown. */ #define NE_SOCK_TRUNC (-5) /* ne_socket represents a TCP socket. */ typedef struct ne_socket_s ne_socket; /* ne_sock_addr represents an address object. */ typedef struct ne_sock_addr_s ne_sock_addr; #ifndef NE_INET_ADDR_DEFINED typedef struct ne_inet_addr_s ne_inet_addr; #endif /* Perform process-global initialization of any libraries in use. * Returns non-zero on error. */ int ne_sock_init(void); /* Perform process-global shutdown of any libraries in use. This * function only has effect when it has been called an equal number of * times to ne_sock_init() for the process. */ void ne_sock_exit(void); /* Resolve the given hostname. 'flags' must be zero. Hex * string IPv6 addresses (e.g. `::1') may be enclosed in brackets * (e.g. `[::1]'). */ ne_sock_addr *ne_addr_resolve(const char *hostname, int flags); /* Returns zero if name resolution was successful, non-zero on * error. */ int ne_addr_result(const ne_sock_addr *addr); /* Returns the first network address associated with the 'addr' * object. Undefined behaviour if ne_addr_result returns non-zero for * 'addr'; otherwise, never returns NULL. */ const ne_inet_addr *ne_addr_first(ne_sock_addr *addr); /* Returns the next network address associated with the 'addr' object, * or NULL if there are no more. */ const ne_inet_addr *ne_addr_next(ne_sock_addr *addr); /* NB: the pointers returned by ne_addr_first and ne_addr_next are * valid until ne_addr_destroy is called for the corresponding * ne_sock_addr object. They must not be passed to ne_iaddr_free. */ /* If name resolution fails, copies the error string into 'buffer', * which is of size 'bufsiz'. 'buffer' is returned. */ char *ne_addr_error(const ne_sock_addr *addr, char *buffer, size_t bufsiz); /* Destroys an address object created by ne_addr_resolve. */ void ne_addr_destroy(ne_sock_addr *addr); /* Network address type; IPv4 or IPv6 */ typedef enum { ne_iaddr_ipv4 = 0, ne_iaddr_ipv6 } ne_iaddr_type; /* Create a network address object from raw byte representation (in * network byte order) of given type. 'raw' must be four bytes for an * IPv4 address, 16 bytes for an IPv6 address. May return NULL if * address type is not supported. */ ne_inet_addr *ne_iaddr_make(ne_iaddr_type type, const unsigned char *raw); /* Compare two network address objects i1 and i2; returns zero if they * are equivalent or non-zero otherwise. */ int ne_iaddr_cmp(const ne_inet_addr *i1, const ne_inet_addr *i2); /* Return the type of the given network address object. */ ne_iaddr_type ne_iaddr_typeof(const ne_inet_addr *ia); /* Print the string representation of network address 'ia' into the * buffer 'buffer', which is of length 'bufsiz'. Returns 'buffer'. */ char *ne_iaddr_print(const ne_inet_addr *ia, char *buffer, size_t bufsiz); /* Perform the reverse name lookup on network address 'ia', placing * the returned name in the 'buf' buffer (of length 'bufsiz') if * successful. Returns zero on success, or non-zero on error. */ int ne_iaddr_reverse(const ne_inet_addr *ia, char *buf, size_t bufsiz); /* Destroy a network address object created using ne_iaddr_make. */ void ne_iaddr_free(ne_inet_addr *addr); /* Create a socket object; returns NULL on error. */ ne_socket *ne_sock_create(void); /* Specify an address to which the local end of the socket will be * bound during a subsequent ne_sock_connect() call. If the address * passed to ne_sock_connect() is of a different type (family) to * 'addr', 'addr' is ignored. Either 'addr' may be NULL, to use the * given port with unspecified address, or 'port' may be 0, to use the * given address with an unspecified port. * * (Note: This function is not equivalent to a BSD socket bind(), it * only takes effect during the _connect() call). */ void ne_sock_prebind(ne_socket *sock, const ne_inet_addr *addr, unsigned int port); /* Connect the socket to server at address 'addr' on port 'port'. * Returns zero on success, NE_SOCK_TIMEOUT if a timeout occurs when a * non-zero connect timeout is configured (and is supported), or * NE_SOCK_ERROR on failure. */ int ne_sock_connect(ne_socket *sock, const ne_inet_addr *addr, unsigned int port); /* Read up to 'count' bytes from socket into 'buffer'. Returns: * NE_SOCK_* on error, * >0 length of data read into buffer (may be less than 'count') */ ssize_t ne_sock_read(ne_socket *sock, char *buffer, size_t count); /* Read up to 'count' bytes into 'buffer', leaving the data available * in the socket buffer to be returned by a subsequent call to * ne_sock_read or ne_sock_peek. Returns: * NE_SOCK_* on error, * >0 length of data read into buffer. */ ssize_t ne_sock_peek(ne_socket *sock, char *buffer, size_t count); /* Block for up to 'n' seconds until data becomes available for reading * from the socket. Returns: * NE_SOCK_* on error, * NE_SOCK_TIMEOUT if no data arrives in 'n' seconds, * 0 if data arrived on the socket. */ int ne_sock_block(ne_socket *sock, int n); /* Write 'count' bytes of 'data' to the socket. Guarantees to either * write all the bytes or to fail. Returns 0 on success, or NE_SOCK_* * on error. */ int ne_sock_fullwrite(ne_socket *sock, const char *data, size_t count); /* Read an LF-terminated line into 'buffer', and NUL-terminate it. * At most 'len' bytes are read (including the NUL terminator). * Returns: * NE_SOCK_* on error, * >0 number of bytes read (including NUL terminator) */ ssize_t ne_sock_readline(ne_socket *sock, char *buffer, size_t len); /* Read exactly 'len' bytes into buffer, or fail; returns 0 on * success, NE_SOCK_* on error. */ ssize_t ne_sock_fullread(ne_socket *sock, char *buffer, size_t len); /* Accepts a connection from listening socket 'fd' and places the * socket in 'sock'. Returns zero on success or -1 on failure. */ int ne_sock_accept(ne_socket *sock, int fd); /* Returns the file descriptor used for socket 'sock'. */ int ne_sock_fd(const ne_socket *sock); /* Return address of peer, or NULL on error. The returned address * must be destroyed by caller using ne_iaddr_free. */ ne_inet_addr *ne_sock_peer(ne_socket *sock, unsigned int *port); /* Close the socket and destroy the socket object. Returns zero on * success, or an errno value if close() failed. */ int ne_sock_close(ne_socket *sock); /* Return current error string for socket. */ const char *ne_sock_error(const ne_socket *sock); /* Set read timeout for socket, in seconds; must be a non-zero * positive integer. */ void ne_sock_read_timeout(ne_socket *sock, int timeout); /* Set connect timeout for socket, in seconds; must be a positive * integer. If a timeout of 'zero' is used then then no explicit * timeout handling will be used for ne_sock_connect(), and the * connect call will only timeout as dictated by the TCP stack. */ void ne_sock_connect_timeout(ne_socket *sock, int timeout); /* Negotiate an SSL connection on socket as an SSL server, using given * SSL context. */ int ne_sock_accept_ssl(ne_socket *sock, ne_ssl_context *ctx); /* Negotiate an SSL connection on socket as an SSL client, using given * SSL context. The 'userdata' parameter is associated with the * underlying SSL library's socket structure for use in callbacks. * Returns zero on success, or non-zero on error. */ int ne_sock_connect_ssl(ne_socket *sock, ne_ssl_context *ctx, void *userdata); /* Retrieve the session ID of the current SSL session. If 'buf' is * non-NULL, on success, copies at most *buflen bytes to 'buf' and * sets *buflen to the exact number of bytes copied. If 'buf' is * NULL, on success, sets *buflen to the length of the session ID. * Returns zero on success, non-zero on error. */ int ne_sock_sessid(ne_socket *sock, unsigned char *buf, size_t *buflen); /* Return human-readable name of SSL/TLS cipher used for connection, * or NULL if none. The format of this string is not intended to be * fixed or parseable, but is informational only. Return value is * NUL-terminated malloc-allocated string if not NULL, which must be * freed by the caller. */ char *ne_sock_cipher(ne_socket *sock); NE_END_DECLS #endif /* NE_SOCKET_H */ sitecopy-0.16.6/lib/neon/ne_internal.h0000664000076400007640000000431310517466031015751 0ustar joejoe/* Global interfaces private to neon. Copyright (C) 2005-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* NOTE WELL: The interfaces defined in this file are internal to neon * and MUST NOT be used by neon-based applications. */ #ifndef NE_INTERNAL_H #define NE_INTERNAL_H 1 #include "config.h" #ifdef HAVE_SYS_LIMITS_H #include #endif #ifdef HAVE_LIMITS_H #include /* for UINT_MAX etc */ #endif #include "ne_defs.h" #undef _ #ifdef NE_HAVE_I18N #include #define _(str) dgettext(PACKAGE_NAME, str) #else #define _(str) (str) #endif /* NE_ENABLE_NLS */ #define N_(str) (str) #if !defined(LONG_LONG_MAX) && defined(LLONG_MAX) #define LONG_LONG_MAX LLONG_MAX #elif !defined(LONG_LONG_MAX) && defined(LONGLONG_MAX) #define LONG_LONG_MAX LONGLONG_MAX #endif #if defined(NE_LFS) #define ne_lseek lseek64 #define FMT_NE_OFF_T NE_FMT_OFF64_T #define NE_OFFT_MAX LONG_LONG_MAX #ifdef HAVE_STRTOLL #define ne_strtoff strtoll #else #define ne_strtoff strtoq #endif #else /* !NE_LFS */ #define ne_lseek lseek #define FMT_NE_OFF_T NE_FMT_OFF_T #if defined(SIZEOF_LONG_LONG) && defined(LONG_LONG_MAX) \ && SIZEOF_OFF_T == SIZEOF_LONG_LONG #define NE_OFFT_MAX LONG_LONG_MAX #else #define NE_OFFT_MAX LONG_MAX #endif #if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_STRTOLL) #define ne_strtoff strtoll #elif SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_STRTOQ) #define ne_strtoff strtoq #else #define ne_strtoff strtol #endif #endif /* NE_LFS */ #endif /* NE_INTERNAL_H */ sitecopy-0.16.6/lib/neon/ne_alloc.c0000664000076400007640000001060010230236130015201 0ustar joejoe/* Replacement memory allocation handling etc. Copyright (C) 1999-2005, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include #include "ne_alloc.h" static ne_oom_callback_fn oom; void ne_oom_callback(ne_oom_callback_fn callback) { oom = callback; } #ifndef NEON_MEMLEAK #define DO_MALLOC(ptr, len) do { \ ptr = malloc((len)); \ if (!ptr) { \ if (oom != NULL) \ oom(); \ abort(); \ } \ } while(0); void *ne_malloc(size_t len) { void *ptr; DO_MALLOC(ptr, len); return ptr; } void *ne_calloc(size_t len) { void *ptr; DO_MALLOC(ptr, len); return memset(ptr, 0, len); } void *ne_realloc(void *ptr, size_t len) { void *ret = realloc(ptr, len); if (!ret) { if (oom) oom(); abort(); } return ret; } char *ne_strdup(const char *s) { char *ret; DO_MALLOC(ret, strlen(s) + 1); return strcpy(ret, s); } char *ne_strndup(const char *s, size_t n) { char *new; DO_MALLOC(new, n+1); new[n] = '\0'; memcpy(new, s, n); return new; } #else /* NEON_MEMLEAK */ #include /* Memory-leak detection implementation: ne_malloc and friends are * #defined to ne_malloc_ml etc by memleak.h, which is conditionally * included by config.h. */ /* memory allocated be ne_*alloc, but not freed. */ size_t ne_alloc_used = 0; static struct block { void *ptr; size_t len; const char *file; int line; struct block *next; } *blocks = NULL; void ne_alloc_dump(FILE *f) { struct block *b; for (b = blocks; b != NULL; b = b->next) fprintf(f, "%" NE_FMT_SIZE_T "b@%s:%d%s", b->len, b->file, b->line, b->next?", ":""); } static void *tracking_malloc(size_t len, const char *file, int line) { void *ptr = malloc((len)); struct block *block; if (!ptr) { if (oom) oom(); abort(); } block = malloc(sizeof *block); if (block != NULL) { block->ptr = ptr; block->len = len; block->file = file; block->line = line; block->next = blocks; blocks = block; ne_alloc_used += len; } return ptr; } void *ne_malloc_ml(size_t size, const char *file, int line) { return tracking_malloc(size, file, line); } void *ne_calloc_ml(size_t size, const char *file, int line) { return memset(tracking_malloc(size, file, line), 0, size); } void *ne_realloc_ml(void *ptr, size_t s, const char *file, int line) { void *ret; struct block *b; if (ptr == NULL) return tracking_malloc(s, file, line); ret = realloc(ptr, s); if (!ret) { if (oom) oom(); abort(); } for (b = blocks; b != NULL; b = b->next) { if (b->ptr == ptr) { ne_alloc_used += s - b->len; b->ptr = ret; b->len = s; break; } } assert(b != NULL); return ret; } char *ne_strdup_ml(const char *s, const char *file, int line) { return strcpy(tracking_malloc(strlen(s) + 1, file, line), s); } char *ne_strndup_ml(const char *s, size_t n, const char *file, int line) { char *ret = tracking_malloc(n + 1, file, line); ret[n] = '\0'; return memcpy(ret, s, n); } void ne_free_ml(void *ptr) { struct block *b, *last = NULL; for (b = blocks; b != NULL; last = b, b = b->next) { if (b->ptr == ptr) { ne_alloc_used -= b->len; if (last) last->next = b->next; else blocks = b->next; free(b); break; } } free(ptr); } #endif /* NEON_MEMLEAK */ sitecopy-0.16.6/lib/neon/ne_md5.c0000664000076400007640000003321510725347163014625 0ustar joejoe/* 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, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU 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. */ /* Written by Ulrich Drepper , 1995. */ #include "config.h" #include #include #include #ifdef HAVE_LIMITS_H # include #endif #include "ne_md5.h" #include "ne_string.h" /* for NE_ASC2HEX */ #define md5_process_block ne_md5_process_block #define md5_process_bytes ne_md5_process_bytes #define md5_finish_ctx ne_md5_finish_ctx #define md5_read_ctx ne_md5_read_ctx #define md5_stream ne_md5_stream #define md5_ctx ne_md5_ctx #ifdef WORDS_BIGENDIAN # define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #else # define SWAP(n) (n) #endif #if SIZEOF_INT == 4 typedef unsigned int md5_uint32; #elif SIZEOF_LONG == 4 typedef unsigned long md5_uint32; #else # error "Cannot determine unsigned 32-bit data type." #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; md5_uint32 total[2]; md5_uint32 buflen; char buffer[128]; }; /* 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) */ static void md5_init_ctx (struct md5_ctx *ctx) { ctx->A = 0x67452301; ctx->B = 0xefcdab89; ctx->C = 0x98badcfe; ctx->D = 0x10325476; ctx->total[0] = ctx->total[1] = 0; ctx->buflen = 0; } struct ne_md5_ctx * ne_md5_create_ctx(void) { struct md5_ctx *ctx = ne_malloc(sizeof *ctx); md5_init_ctx(ctx); return ctx; } extern void ne_md5_reset_ctx(struct ne_md5_ctx *ctx) { md5_init_ctx(ctx); } struct ne_md5_ctx * ne_md5_dup_ctx(struct ne_md5_ctx *ctx) { return memcpy(ne_malloc(sizeof *ctx), ctx, sizeof *ctx); } void ne_md5_destroy_ctx(struct ne_md5_ctx *ctx) { ne_free(ctx); } /* Put result from CTX in first 16 bytes following RESBUF. The result must be in little endian byte order. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_read_ctx (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; } /* Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) { /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; size_t pad; /* Now count remaining bytes. */ ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); /* Process last bytes. */ md5_process_block (ctx->buffer, bytes + pad + 8, ctx); return md5_read_ctx (ctx, 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 (FILE *stream, void *resblock) { /* Important: BLOCKSIZE must be a multiple of 64. */ #define BLOCKSIZE 4096 struct md5_ctx ctx; char buffer[BLOCKSIZE + 72]; size_t sum; /* Initialize the computation context. */ md5_init_ctx (&ctx); /* 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 + sum, 1, BLOCKSIZE - sum, stream); sum += n; } while (sum < BLOCKSIZE && n != 0); if (n == 0 && ferror (stream)) return 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); } /* Add the last bytes if necessary. */ if (sum > 0) md5_process_bytes (buffer, sum, &ctx); /* Construct result in desired memory. */ md5_finish_ctx (&ctx, resblock); return 0; } void md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) { /* When we already have some bits in our internal buffer concatenate both inputs first. */ if (ctx->buflen != 0) { size_t left_over = ctx->buflen; size_t add = 128 - left_over > len ? len : 128 - left_over; memcpy (&ctx->buffer[left_over], buffer, add); ctx->buflen += add; if (left_over + add > 64) { md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx); /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], (left_over + add) & 63); ctx->buflen = (left_over + add) & 63; } buffer = (const char *) buffer + add; len -= add; } /* Process available complete blocks. */ if (len > 64) { md5_process_block (buffer, len & ~63, ctx); buffer = (const char *) buffer + (len & ~63); len &= 63; } /* Move remaining bytes in internal buffer. */ if (len > 0) { memcpy (ctx->buffer, buffer, len); ctx->buflen = len; } } /* 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 (const void *buffer, size_t len, struct md5_ctx *ctx) { md5_uint32 correct_words[16]; const unsigned char *words = buffer; const unsigned char *endp = words + len; md5_uint32 A = ctx->A; md5_uint32 B = ctx->B; md5_uint32 C = ctx->C; md5_uint32 D = ctx->D; /* First increment the byte count. 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. */ ctx->total[0] += len; if (ctx->total[0] < len) ++ctx->total[1]; /* 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 \ { \ md5_uint32 WORD_ = (md5_uint32)words[0] | ((md5_uint32)words[1] << 8) \ | ((md5_uint32)words[2] << 16) | ((md5_uint32)words[3] << 24); \ a += FF (b, c, d) + (*cwp++ = WORD_) + T; \ words += 4; \ 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; } /* Writes the ASCII representation of the MD5 digest into the * given buffer, which must be at least 33 characters long. */ void ne_md5_to_ascii(const unsigned char md5_buf[16], char *buffer) { int count; for (count = 0; count<16; count++) { buffer[count*2] = NE_HEX2ASC(md5_buf[count] >> 4); buffer[count*2+1] = NE_HEX2ASC(md5_buf[count] & 0x0f); } buffer[32] = '\0'; } /* Reads the ASCII representation of an MD5 digest. The buffer must * be at least 32 characters long. */ void ne_ascii_to_md5(const char *buffer, unsigned char md5_buf[16]) { int count; for (count = 0; count<16; count++) { md5_buf[count] = ((NE_ASC2HEX(buffer[count*2])) << 4) | NE_ASC2HEX(buffer[count*2+1]); } } char *ne_md5_finish_ascii(struct ne_md5_ctx *ctx, char buffer[33]) { md5_uint32 result[4]; ne_md5_finish_ctx(ctx, (void *)result); ne_md5_to_ascii((void *)result, buffer); return buffer; } sitecopy-0.16.6/lib/neon/ne_alloc.h0000664000076400007640000000344510752422147015235 0ustar joejoe/* Replacement memory allocation handling etc. Copyright (C) 1999-2005, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_ALLOC_H #define NE_ALLOC_H #include #ifndef WIN32 #include #endif #include "ne_defs.h" NE_BEGIN_DECLS typedef void (*ne_oom_callback_fn)(void); /* Set callback which is called if malloc() returns NULL. */ void ne_oom_callback(ne_oom_callback_fn callback); #ifndef NEON_MEMLEAK /* Replacements for standard C library memory allocation functions, * which never return NULL. If the C library malloc() returns NULL, * neon will abort(); calling an OOM callback beforehand if one is * registered. The C library will only ever return NULL if the * operating system does not use optimistic memory allocation. */ void *ne_malloc(size_t size) ne_attribute_malloc; void *ne_calloc(size_t size) ne_attribute_malloc; void *ne_realloc(void *ptr, size_t s); char *ne_strdup(const char *s) ne_attribute_malloc; char *ne_strndup(const char *s, size_t n) ne_attribute_malloc; #define ne_free free #endif NE_END_DECLS #endif /* NE_ALLOC_H */ sitecopy-0.16.6/lib/neon/ne_xml.h0000664000076400007640000001522610646621220014736 0ustar joejoe/* neon XML parser interface Copyright (C) 1999-2007, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_XML_H #define NE_XML_H #include /* for size_t */ #include "ne_defs.h" NE_BEGIN_DECLS /* The neon XML interface filters a streamed XML tree through a stack * of SAX "handlers". A handler is made up of three callbacks * (start-element, char-data, end-element). Each start-element event * is passed to each handler in the stack in turn until one until one * accepts the element. This handler then receives subsequent * char-data and end-element events for the element. * * For each new start-element event, the search up the handler stack * begins with the handler for the parent element (for the root * element, at the base of the stack). * * For each accepted element, a "state" integer is stored, which is * passed to the corresponding char-data and end-element callbacks for * the element. This integer is also passed to the start-element * callback of child elements so they can determine context. * * If no handler in the stack accepts a particular element, it (and * its children, if any) is ignored. */ #define NE_XML_DECLINE (0) #define NE_XML_ABORT (-1) /* A start-element callback for element with given namespace/name. * The callback may return: * <0 => abort the parse (NE_XML_ABORT) * 0 => decline this element (NE_XML_DECLINE) * >0 => accept this element; value is state for this element. * * The 'parent' integer is the state returned by the handler of the * parent element. The attributes array gives name/value pairs * in atts[n] and atts[n+1] from n=0 up to atts[n]==NULL. */ typedef int ne_xml_startelm_cb(void *userdata, int parent, const char *nspace, const char *name, const char **atts); /* state for the root element */ #define NE_XML_STATEROOT (0) /* Character data callback; may return non-zero to abort the parse. */ typedef int ne_xml_cdata_cb(void *userdata, int state, const char *cdata, size_t len); /* End element callback; may return non-zero to abort the parse. */ typedef int ne_xml_endelm_cb(void *userdata, int state, const char *nspace, const char *name); typedef struct ne_xml_parser_s ne_xml_parser; /* Create an XML parser. */ ne_xml_parser *ne_xml_create(void); /* Push a new handler on the stack of parser 'p'. 'cdata' and/or * 'endelm' may be NULL; startelm must be non-NULL. */ void ne_xml_push_handler(ne_xml_parser *p, ne_xml_startelm_cb *startelm, ne_xml_cdata_cb *cdata, ne_xml_endelm_cb *endelm, void *userdata); /* ne_xml_failed returns non-zero if there was an error during * parsing, or zero if the parse completed successfully. The return * value is equal to that of the last ne_xml_parse() call for this * parser object. */ int ne_xml_failed(ne_xml_parser *p); /* Set error string for parser. (The string may be truncated * internally). */ void ne_xml_set_error(ne_xml_parser *p, const char *msg); /* Return the error string (and never NULL). After ne_xml_failed * returns >0, this will describe the parse error. Otherwise it will * be a default error string. */ const char *ne_xml_get_error(ne_xml_parser *p); /* Parse the given block of input of length len. Parser must be * called with len=0 to signify the end of the document (for that * case, the block argument is ignored). Returns zero on success, or * non-zero on error: for an XML syntax error, a positive number is * returned; if parsing is aborted by a caller-supplied callback, that * callback's return value is returned. */ int ne_xml_parse(ne_xml_parser *p, const char *block, size_t len); /* As ne_xml_parse, casting (ne_xml_parser *)userdata internally. * (This function can be passed to ne_add_response_body_reader) */ int ne_xml_parse_v(void *userdata, const char *block, size_t len); /* Return current line of document during parsing or after parsing is * complete. */ int ne_xml_currentline(ne_xml_parser *p); /* From a start_element callback which was passed 'attrs' using given * parser, return attribute of given name and namespace. If nspace is * NULL, no namespace resolution is performed. Note that this call is * context-specific; if called outside a start_element callback, * behaviour is undefined. */ const char *ne_xml_get_attr(ne_xml_parser *parser, const char **attrs, const char *nspace, const char *name); /* From a start_element callback, resolve a given XML Namespace * prefix, if defined. Given a non-NULL prefix, returns the namespace * URI which corresponds to the prefix 'prefix' (of length 'length'), * or NULL if no such namespace prefix is defined. Given a NULL * prefix, returns the default namespace URI or the empty string if * none is defined. Note that this call is context-specific; if * called outside a start_element callback, behaviour is undefined. */ const char *ne_xml_resolve_nspace(ne_xml_parser *parser, const char *prefix, size_t length); /* Return the encoding of the document being parsed. May return NULL * if no encoding is defined or if the XML declaration has not yet * been parsed. */ const char *ne_xml_doc_encoding(const ne_xml_parser *p); /* Destroy the parser object. */ void ne_xml_destroy(ne_xml_parser *p); /* A utility interface for mapping {nspace, name} onto an integer. */ struct ne_xml_idmap { const char *nspace, *name; int id; }; /* Return the size of an idmap array */ #define NE_XML_MAPLEN(map) (sizeof(map) / sizeof(struct ne_xml_idmap)) /* Return the 'id' corresponding to {nspace, name}, or zero. */ int ne_xml_mapid(const struct ne_xml_idmap map[], size_t maplen, const char *nspace, const char *name); /* media type, appropriate for adding to a Content-Type header */ #define NE_XML_MEDIA_TYPE "application/xml" NE_END_DECLS #endif /* NE_XML_H */ sitecopy-0.16.6/lib/neon/ne_acl.h0000664000076400007640000000254310753026464014703 0ustar joejoe/* Access control Copyright (C) 2001-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_ACL_H #define NE_ACL_H #include "ne_session.h" NE_BEGIN_DECLS typedef struct { enum { ne_acl_href, ne_acl_property, ne_acl_all } apply; enum { ne_acl_grant, ne_acl_deny } type; char *principal; int read; int read_acl; int write; int write_acl; int read_cuprivset; } ne_acl_entry; /* Set the ACL for the given resource to the list of ACL entries. */ int ne_acl_set(ne_session *sess, const char *uri, const ne_acl_entry entries[], int numentries); NE_END_DECLS #endif /* NE_ACL_H */ sitecopy-0.16.6/lib/neon/ne_locks.h0000664000076400007640000001426510356210727015257 0ustar joejoe/* WebDAV Class 2 locking operations Copyright (C) 1999-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_LOCKS_H #define NE_LOCKS_H #include "ne_request.h" /* for ne_session + ne_request */ #include "ne_uri.h" /* for ne_uri */ NE_BEGIN_DECLS /* The scope of a lock */ enum ne_lock_scope { ne_lockscope_exclusive, ne_lockscope_shared }; /* Lock type. Only write locks are defined in RFC2518. */ enum ne_lock_type { ne_locktype_write }; /* A lock object. */ struct ne_lock { ne_uri uri; int depth; /* the depth of the lock (NE_DEPTH_*). */ enum ne_lock_type type; enum ne_lock_scope scope; char *token; /* the lock token: uniquely identifies this lock. */ char *owner; /* string describing the owner of the lock. */ long timeout; /* timeout in seconds. (or NE_TIMEOUT_*) */ }; /* NB: struct ne_lock Would be typedef'ed to ne_lock except lock is * a verb and a noun, so we already have ne_lock the function. Damn * the English language. */ #define NE_TIMEOUT_INFINITE -1 #define NE_TIMEOUT_INVALID -2 /* Create a depth zero, exclusive write lock, with default timeout * (allowing a server to pick a default). token, owner and uri are * unset. */ struct ne_lock *ne_lock_create(void); /* HINT: to initialize uri host/port/scheme for the lock's URI, use * ne_fill_server_uri from ne_session.h. */ /* Deep-copy a lock structure: strdup's any of path, token, owner, * hostport which are set. */ struct ne_lock *ne_lock_copy(const struct ne_lock *lock); /* Free a lock structure; free's any of any of the URI, token and * owner which are set, but not the lock object itself. */ void ne_lock_free(struct ne_lock *lock); /* Like ne_lock_free; but free's the lock object itself too. */ void ne_lock_destroy(struct ne_lock *lock); /* ne_lock_store: an opaque type which is used to store a set of lock * objects. */ typedef struct ne_lock_store_s ne_lock_store; /* Create a lock store. */ ne_lock_store *ne_lockstore_create(void); /* Register the lock store 'store' with the HTTP session 'sess': any * operations made using 'sess' which operate on a locked resource, * can use the locks from 'store' if needed. */ void ne_lockstore_register(ne_lock_store *store, ne_session *sess); /* Destroy a lock store, free'ing any locks remaining inside. */ void ne_lockstore_destroy(ne_lock_store *store); /* Add a lock to the store: the store then "owns" the lock object, and * you must not free it. The lock MUST have all of: * - a completed URI structure: scheme, host, port, and path all set * - a valid lock token * - a valid depth */ void ne_lockstore_add(ne_lock_store *store, struct ne_lock *lock); /* Remove given lock object from store: 'lock' MUST point to a lock * object which is known to be in the store. */ void ne_lockstore_remove(ne_lock_store *store, struct ne_lock *lock); /* Returns the first lock in the lock store, or NULL if the store is * empty. */ struct ne_lock *ne_lockstore_first(ne_lock_store *store); /* After ne_lockstore_first has been called; returns the next lock in * the lock store, or NULL if there are no more locks stored. * Behaviour is undefined if ne_lockstore_first has not been called on * 'store' since the store was created, or the last time this function * returned NULL for the store.. */ struct ne_lock *ne_lockstore_next(ne_lock_store *store); /* Find a lock in the store for the given server, and with the given * path. */ struct ne_lock *ne_lockstore_findbyuri(ne_lock_store *store, const ne_uri *uri); /* Issue a LOCK request for the given lock. Requires that the uri, * depth, type, scope, and timeout members of 'lock' are filled in. * owner and token must be malloc-allocated if not NULL; and may be * free()d by this function. On successful return, lock->token will * contain the lock token. */ int ne_lock(ne_session *sess, struct ne_lock *lock); /* Issue an UNLOCK request for the given lock */ int ne_unlock(ne_session *sess, const struct ne_lock *lock); /* Refresh a lock. Updates lock->timeout appropriately. */ int ne_lock_refresh(ne_session *sess, struct ne_lock *lock); /* Callback for lock discovery. If 'lock' is NULL, something went * wrong performing lockdiscovery for the resource, look at 'status' * for the details. * * If lock is non-NULL, at least lock->uri and lock->token will be * filled in; and status will be NULL. */ typedef void (*ne_lock_result)(void *userdata, const struct ne_lock *lock, const ne_uri *uri, const ne_status *status); /* Perform lock discovery on the given path. 'result' is called with * the results (possibly >1 times). */ int ne_lock_discover(ne_session *sess, const char *path, ne_lock_result result, void *userdata); /* The ne_lock_using_* functions should be used before dispatching a * request which modify resources. If a lock store has been * registered with the session associated with the request, and locks * are present in the lock store which cover the resources which are * being modified by the request, then the appropriate lock tokens are * submitted in the request headers. */ /* Indicate that request 'req' will modify the resource at 'path', and * is an operation of given 'depth'. */ void ne_lock_using_resource(ne_request *req, const char *path, int depth); /* Indicate that request 'req' will modify the parent collection of * the resource found at 'path' (for instance when removing the * resource from the collection). */ void ne_lock_using_parent(ne_request *req, const char *path); NE_END_DECLS #endif /* NE_LOCKS_H */ sitecopy-0.16.6/lib/neon/ne_ssl.h0000664000076400007640000001704410752313011014731 0ustar joejoe/* SSL/TLS abstraction layer for neon Copyright (C) 2003-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* ne_ssl.h defines an interface for loading and accessing the * properties of SSL certificates. */ #ifndef NE_SSL_H #define NE_SSL_H 1 #include #include "ne_defs.h" NE_BEGIN_DECLS /* A "distinguished name"; a unique name for some entity. */ typedef struct ne_ssl_dname_s ne_ssl_dname; /* Returns a single-line string representation of a distinguished * name, intended to be human-readable (e.g. "Acme Ltd., Norfolk, * GB"). Return value is a UTF-8-encoded malloc-allocated string and * must be free'd by the caller. */ char *ne_ssl_readable_dname(const ne_ssl_dname *dn); /* Returns zero if 'dn1' and 'dn2' refer to same name, or non-zero if * they are different. */ int ne_ssl_dname_cmp(const ne_ssl_dname *dn1, const ne_ssl_dname *dn2); /* An SSL certificate. */ typedef struct ne_ssl_certificate_s ne_ssl_certificate; /* Read a certificate from a file in PEM format; returns NULL if the * certificate could not be parsed. */ ne_ssl_certificate *ne_ssl_cert_read(const char *filename); /* Write a certificate to a file in PEM format; returns non-zero if * the certificate could not be written. */ int ne_ssl_cert_write(const ne_ssl_certificate *cert, const char *filename); /* Export a certificate to a base64-encoded, NUL-terminated string. * The returned string is malloc-allocated and must be free()d by the * caller. */ char *ne_ssl_cert_export(const ne_ssl_certificate *cert); /* Import a certificate from a base64-encoded string as returned by * ne_ssl_cert_export(). Returns a certificate object or NULL if * 'data' was not valid. */ ne_ssl_certificate *ne_ssl_cert_import(const char *data); /* Returns the identity of the certificate, or NULL if none is given. * For a server certificate this will be the hostname of the server to * which the cert was issued. A NUL-terminated UTF-8-encoded string * is returned, which is valid for the lifetime of the certificate * object. */ const char *ne_ssl_cert_identity(const ne_ssl_certificate *cert); /* Return the certificate of the entity which signed certificate * 'cert'. Returns NULL if 'cert' is self-signed or the issuer * certificate is not available; if non-NULL, the pointer is valid for * the lifetime of the certificate object. */ const ne_ssl_certificate *ne_ssl_cert_signedby(const ne_ssl_certificate *cert); /* Returns the distinguished name of the certificate issuer. */ const ne_ssl_dname *ne_ssl_cert_issuer(const ne_ssl_certificate *cert); /* Returns the distinguished name of the certificate subject. */ const ne_ssl_dname *ne_ssl_cert_subject(const ne_ssl_certificate *cert); #define NE_SSL_DIGESTLEN (60) /* Calculate the certificate digest ("fingerprint") and format it as a * NUL-terminated hex string in 'digest', of the form "aa:bb:...:ff". * Returns zero on success or non-zero if there was an internal error * whilst calculating the digest. 'digest' must be at least * NE_SSL_DIGESTLEN bytes in length. */ int ne_ssl_cert_digest(const ne_ssl_certificate *cert, char *digest); /* Copy the validity times for the certificate 'cert' into 'from' and * 'until' (either may be NULL). If the time cannot be represented by * a time_t value, then (time_t)-1 will be written. */ void ne_ssl_cert_validity_time(const ne_ssl_certificate *cert, time_t *from, time_t *until); #define NE_SSL_VDATELEN (30) /* Copy the validity times into buffers 'from' and 'until' as * NUL-terminated human-readable strings, using RFC 1123-style date * formatting (and not localized, so always using English month/week * names). The buffers must be at least NE_SSL_VDATELEN bytes in * length, and either may be NULL. */ void ne_ssl_cert_validity(const ne_ssl_certificate *cert, char *from, char *until); /* Returns zero if 'c1' and 'c2' refer to the same certificate, or * non-zero otherwise. */ int ne_ssl_cert_cmp(const ne_ssl_certificate *c1, const ne_ssl_certificate *c2); /* Deallocate memory associated with certificate. */ void ne_ssl_cert_free(ne_ssl_certificate *cert); /* A client certificate (and private key). */ typedef struct ne_ssl_client_cert_s ne_ssl_client_cert; /* Read a client certificate and private key from a PKCS12 file; * returns NULL if the file could not be parsed, or otherwise * returning a client certificate object. */ ne_ssl_client_cert *ne_ssl_clicert_read(const char *filename); /* Returns the "friendly name" given for the client cert, or NULL if * none given. This can be called before or after the client cert has * been decrypted. Returns a NUL-terminated, UTF-8-encoded string. */ const char *ne_ssl_clicert_name(const ne_ssl_client_cert *ccert); /* Returns non-zero if client cert is encrypted. */ int ne_ssl_clicert_encrypted(const ne_ssl_client_cert *ccert); /* Decrypt the encrypted client cert using given password. Returns * non-zero on failure, in which case, the function can be called * again with a different password. For a ccert on which _encrypted() * returns 0, calling _decrypt results in undefined behaviour. */ int ne_ssl_clicert_decrypt(ne_ssl_client_cert *ccert, const char *password); /* Return the actual certificate part of the client certificate (never * returns NULL). */ const ne_ssl_certificate *ne_ssl_clicert_owner(const ne_ssl_client_cert *ccert); /* Destroy a client certificate object. */ void ne_ssl_clicert_free(ne_ssl_client_cert *ccert); /* SSL context object. The interfaces to manipulate an SSL context * are only needed when interfacing directly with ne_socket.h. */ typedef struct ne_ssl_context_s ne_ssl_context; /* Context creation modes: */ #define NE_SSL_CTX_CLIENT (0) /* client context */ #define NE_SSL_CTX_SERVER (1) /* default server context */ #define NE_SSL_CTX_SERVERv2 (2) /* SSLv2-specific server context */ /* Create an SSL context. */ ne_ssl_context *ne_ssl_context_create(int mode); /* Client mode: trust the given certificate 'cert' in context 'ctx'. */ void ne_ssl_context_trustcert(ne_ssl_context *ctx, const ne_ssl_certificate *cert); /* Server mode: use given cert and key (filenames to PEM certificates). */ int ne_ssl_context_keypair(ne_ssl_context *ctx, const char *cert, const char *key); /* Server mode: set client cert verification options: required is non-zero if * a client cert is required, if ca_names is non-NULL it is a filename containing * a set of PEM certs from which CA names are sent in the ccert request. */ int ne_ssl_context_set_verify(ne_ssl_context *ctx, int required, const char *ca_names, const char *verify_cas); #define NE_SSL_CTX_SSLv2 (0) /* Set a flag for the SSL context. */ void ne_ssl_context_set_flag(ne_ssl_context *ctx, int flag, int value); /* Destroy an SSL context. */ void ne_ssl_context_destroy(ne_ssl_context *ctx); NE_END_DECLS #endif sitecopy-0.16.6/lib/neon/ne_gnutls.c0000664000076400007640000010131010775140753015445 0ustar joejoe/* neon SSL/TLS support using GNU TLS Copyright (C) 2002-2008, Joe Orton Copyright (C) 2004, Aleix Conchillo Flaque This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include #ifdef HAVE_STRING_H #include #endif #include #include #include #include #include #include #ifdef NE_HAVE_TS_SSL #include #include #include GCRY_THREAD_OPTION_PTHREAD_IMPL; #else #include #endif #ifdef HAVE_ICONV #include #endif #include "ne_ssl.h" #include "ne_string.h" #include "ne_session.h" #include "ne_internal.h" #include "ne_private.h" #include "ne_privssl.h" struct ne_ssl_dname_s { int subject; /* non-zero if this is the subject DN object */ gnutls_x509_crt cert; }; struct ne_ssl_certificate_s { ne_ssl_dname subj_dn, issuer_dn; gnutls_x509_crt subject; ne_ssl_certificate *issuer; char *identity; }; struct ne_ssl_client_cert_s { gnutls_pkcs12 p12; int decrypted; /* non-zero if successfully decrypted. */ int keyless; ne_ssl_certificate cert; gnutls_x509_privkey pkey; char *friendly_name; }; /* Returns the highest used index in subject (or issuer) DN of * certificate CERT for OID, or -1 if no RDNs are present in the DN * using that OID. */ static int oid_find_highest_index(gnutls_x509_crt cert, int subject, const char *oid) { int ret, idx = -1; do { size_t len = 0; if (subject) ret = gnutls_x509_crt_get_dn_by_oid(cert, oid, ++idx, 0, NULL, &len); else ret = gnutls_x509_crt_get_issuer_dn_by_oid(cert, oid, ++idx, 0, NULL, &len); } while (ret == GNUTLS_E_SHORT_MEMORY_BUFFER); return idx - 1; } #ifdef HAVE_GNUTLS_X509_DN_GET_RDN_AVA /* New-style RDN handling introduced in GnuTLS 1.7.x. */ #ifdef HAVE_ICONV static void convert_dirstring(ne_buffer *buf, const char *charset, gnutls_datum *data) { iconv_t id = iconv_open("UTF-8", charset); size_t inlen = data->size, outlen = buf->length - buf->used; char *inbuf = (char *)data->data; char *outbuf = buf->data + buf->used - 1; if (id == (iconv_t)-1) { char err[128], err2[128]; ne_snprintf(err, sizeof err, "[unprintable in %s: %s]", charset, ne_strerror(errno, err2, sizeof err2)); ne_buffer_zappend(buf, err); return; } ne_buffer_grow(buf, buf->used + 64); while (inlen && outlen && iconv(id, &inbuf, &inlen, &outbuf, &outlen) == 0) ; iconv_close(id); buf->used += buf->length - buf->used - outlen; buf->data[buf->used - 1] = '\0'; } #endif /* From section 11.13 of the Dubuisson ASN.1 bible: */ #define TAG_UTF8 (12) #define TAG_PRINTABLE (19) #define TAG_T61 (20) #define TAG_IA5 (22) #define TAG_VISIBLE (26) #define TAG_UNIVERSAL (28) #define TAG_BMP (30) static void append_dirstring(ne_buffer *buf, gnutls_datum *data, unsigned long tag) { switch (tag) { case TAG_UTF8: case TAG_IA5: case TAG_PRINTABLE: case TAG_VISIBLE: ne_buffer_append(buf, (char *)data->data, data->size); break; #ifdef HAVE_ICONV case TAG_T61: convert_dirstring(buf, "ISO-8859-1", data); break; case TAG_BMP: convert_dirstring(buf, "UCS-2BE", data); break; #endif default: { char tmp[128]; ne_snprintf(tmp, sizeof tmp, _("[unprintable:#%lu]"), tag); ne_buffer_zappend(buf, tmp); } break; } } /* OIDs to not include in readable DNs by default: */ #define OID_emailAddress "1.2.840.113549.1.9.1" #define OID_commonName "2.5.4.3" #define CMPOID(a,o) ((a)->oid.size == sizeof(o) \ && memcmp((a)->oid.data, o, strlen(o)) == 0) char *ne_ssl_readable_dname(const ne_ssl_dname *name) { gnutls_x509_dn_t dn; int ret, rdn = 0, flag = 0; ne_buffer *buf; gnutls_x509_ava_st val; if (name->subject) ret = gnutls_x509_crt_get_subject(name->cert, &dn); else ret = gnutls_x509_crt_get_issuer(name->cert, &dn); if (ret) return ne_strdup(_("[unprintable]")); buf = ne_buffer_create(); /* Find the highest rdn... */ while (gnutls_x509_dn_get_rdn_ava(dn, rdn++, 0, &val) == 0) ; /* ..then iterate back to the first: */ while (--rdn >= 0) { int ava = 0; /* Iterate through all AVAs for multivalued AVAs; better than * ne_openssl can do! */ do { ret = gnutls_x509_dn_get_rdn_ava(dn, rdn, ava, &val); /* If the *only* attribute to append is the common name or * email address, use it; otherwise skip those * attributes. */ if (ret == 0 && val.value.size > 0 && ((!CMPOID(&val, OID_emailAddress) && !CMPOID(&val, OID_commonName)) || (buf->used == 1 && rdn == 0))) { flag = 1; if (buf->used > 1) ne_buffer_append(buf, ", ", 2); append_dirstring(buf, &val.value, val.value_tag); } ava++; } while (ret == 0); } return ne_buffer_finish(buf); } #else /* !HAVE_GNUTLS_X509_DN_GET_RDN_AVA */ /* Appends the value of RDN with given oid from certitifcate x5 * subject (if subject is non-zero), or issuer DN to buffer 'buf': */ static void append_rdn(ne_buffer *buf, gnutls_x509_crt x5, int subject, const char *oid) { int idx, top, ret; char rdn[50]; top = oid_find_highest_index(x5, subject, oid); for (idx = top; idx >= 0; idx--) { size_t rdnlen = sizeof rdn; if (subject) ret = gnutls_x509_crt_get_dn_by_oid(x5, oid, idx, 0, rdn, &rdnlen); else ret = gnutls_x509_crt_get_issuer_dn_by_oid(x5, oid, idx, 0, rdn, &rdnlen); if (ret < 0) return; if (buf->used > 1) { ne_buffer_append(buf, ", ", 2); } ne_buffer_append(buf, rdn, rdnlen); } } char *ne_ssl_readable_dname(const ne_ssl_dname *name) { ne_buffer *buf = ne_buffer_create(); int ret, idx = 0; do { char oid[32] = {0}; size_t oidlen = sizeof oid; ret = name->subject ? gnutls_x509_crt_get_dn_oid(name->cert, idx, oid, &oidlen) : gnutls_x509_crt_get_issuer_dn_oid(name->cert, idx, oid, &oidlen); if (ret == 0) { append_rdn(buf, name->cert, name->subject, oid); idx++; } } while (ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE); return ne_buffer_finish(buf); } #endif /* HAVE_GNUTLS_X509_DN_GET_RDN_AVA */ int ne_ssl_dname_cmp(const ne_ssl_dname *dn1, const ne_ssl_dname *dn2) { char c1[1024], c2[1024]; size_t s1 = sizeof c1, s2 = sizeof c2; int ret; if (dn1->subject) ret = gnutls_x509_crt_get_dn(dn1->cert, c1, &s1); else ret = gnutls_x509_crt_get_issuer_dn(dn1->cert, c1, &s1); if (ret) return 1; if (dn2->subject) ret = gnutls_x509_crt_get_dn(dn2->cert, c2, &s2); else ret = gnutls_x509_crt_get_issuer_dn(dn2->cert, c2, &s2); if (ret) return -1; if (s1 != s2) return s2 - s1; return memcmp(c1, c2, s1); } void ne_ssl_clicert_free(ne_ssl_client_cert *cc) { if (cc->p12) gnutls_pkcs12_deinit(cc->p12); if (cc->decrypted) { if (cc->cert.identity) ne_free(cc->cert.identity); if (cc->pkey) gnutls_x509_privkey_deinit(cc->pkey); if (cc->cert.subject) gnutls_x509_crt_deinit(cc->cert.subject); } if (cc->friendly_name) ne_free(cc->friendly_name); ne_free(cc); } void ne_ssl_cert_validity_time(const ne_ssl_certificate *cert, time_t *from, time_t *until) { if (from) { *from = gnutls_x509_crt_get_activation_time(cert->subject); } if (until) { *until = gnutls_x509_crt_get_expiration_time(cert->subject); } } /* Return non-zero if hostname from certificate (cn) matches hostname * used for session (hostname). (Wildcard matching is no longer * mandated by RFC3280, but certs are deployed which use wildcards) */ static int match_hostname(char *cn, const char *hostname) { const char *dot; dot = strchr(hostname, '.'); if (dot == NULL) { char *pnt = strchr(cn, '.'); /* hostname is not fully-qualified; unqualify the cn. */ if (pnt != NULL) { *pnt = '\0'; } } else if (strncmp(cn, "*.", 2) == 0) { hostname = dot + 1; cn += 2; } return !ne_strcasecmp(cn, hostname); } /* Check certificate identity. Returns zero if identity matches; 1 if * identity does not match, or <0 if the certificate had no identity. * If 'identity' is non-NULL, store the malloc-allocated identity in * *identity. If 'server' is non-NULL, it must be the network address * of the server in use, and identity must be NULL. */ static int check_identity(const ne_uri *server, gnutls_x509_crt cert, char **identity) { char name[255]; unsigned int critical; int ret, seq = 0; int match = 0, found = 0; size_t len; const char *hostname; hostname = server ? server->host : ""; do { len = sizeof name - 1; ret = gnutls_x509_crt_get_subject_alt_name(cert, seq, name, &len, &critical); switch (ret) { case GNUTLS_SAN_DNSNAME: name[len] = '\0'; if (identity && !found) *identity = ne_strdup(name); match = match_hostname(name, hostname); found = 1; break; case GNUTLS_SAN_IPADDRESS: { ne_inet_addr *ia; if (len == 4) ia = ne_iaddr_make(ne_iaddr_ipv4, (unsigned char *)name); else if (len == 16) ia = ne_iaddr_make(ne_iaddr_ipv6, (unsigned char *)name); else ia = NULL; if (ia) { char buf[128]; match = strcmp(hostname, ne_iaddr_print(ia, buf, sizeof buf)) == 0; if (identity) *identity = ne_strdup(buf); found = 1; ne_iaddr_free(ia); } else { NE_DEBUG(NE_DBG_SSL, "iPAddress name with unsupported " "address type (length %" NE_FMT_SIZE_T "), skipped.\n", len); } } break; case GNUTLS_SAN_URI: { ne_uri uri; name[len] = '\0'; if (ne_uri_parse(name, &uri) == 0 && uri.host && uri.scheme) { ne_uri tmp; if (identity && !found) *identity = ne_strdup(name); found = 1; if (server) { /* For comparison purposes, all that matters is * host, scheme and port; ignore the rest. */ memset(&tmp, 0, sizeof tmp); tmp.host = uri.host; tmp.scheme = uri.scheme; tmp.port = uri.port; match = ne_uri_cmp(server, &tmp) == 0; } } ne_uri_free(&uri); } break; default: break; } seq++; } while (!match && ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE); /* Check against the commonName if no DNS alt. names were found, * as per RFC3280. */ if (!found) { seq = oid_find_highest_index(cert, 1, GNUTLS_OID_X520_COMMON_NAME); if (seq >= 0) { len = sizeof name; name[0] = '\0'; ret = gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_X520_COMMON_NAME, seq, 0, name, &len); if (ret == 0) { if (identity) *identity = ne_strdup(name); match = match_hostname(name, hostname); } } else { return -1; } } if (*hostname) NE_DEBUG(NE_DBG_SSL, "ssl: Identity match for '%s': %s\n", hostname, match ? "good" : "bad"); return match ? 0 : 1; } /* Populate an ne_ssl_certificate structure from an X509 object. */ static ne_ssl_certificate *populate_cert(ne_ssl_certificate *cert, gnutls_x509_crt x5) { cert->subj_dn.cert = x5; cert->subj_dn.subject = 1; cert->issuer_dn.cert = x5; cert->issuer_dn.subject = 0; cert->issuer = NULL; cert->subject = x5; cert->identity = NULL; check_identity(NULL, x5, &cert->identity); return cert; } /* Returns a copy certificate of certificate SRC. */ static gnutls_x509_crt x509_crt_copy(gnutls_x509_crt src) { int ret; size_t size; gnutls_datum tmp; gnutls_x509_crt dest; if (gnutls_x509_crt_init(&dest) != 0) { return NULL; } if (gnutls_x509_crt_export(src, GNUTLS_X509_FMT_DER, NULL, &size) != GNUTLS_E_SHORT_MEMORY_BUFFER) { gnutls_x509_crt_deinit(dest); return NULL; } tmp.data = ne_malloc(size); ret = gnutls_x509_crt_export(src, GNUTLS_X509_FMT_DER, tmp.data, &size); if (ret == 0) { tmp.size = size; ret = gnutls_x509_crt_import(dest, &tmp, GNUTLS_X509_FMT_DER); } if (ret) { gnutls_x509_crt_deinit(dest); dest = NULL; } ne_free(tmp.data); return dest; } /* Duplicate a client certificate, which must be in the decrypted state. */ static ne_ssl_client_cert *dup_client_cert(const ne_ssl_client_cert *cc) { int ret; ne_ssl_client_cert *newcc = ne_calloc(sizeof *newcc); newcc->decrypted = 1; if (cc->keyless) { newcc->keyless = 1; } else { ret = gnutls_x509_privkey_init(&newcc->pkey); if (ret != 0) goto dup_error; ret = gnutls_x509_privkey_cpy(newcc->pkey, cc->pkey); if (ret != 0) goto dup_error; } newcc->cert.subject = x509_crt_copy(cc->cert.subject); if (!newcc->cert.subject) goto dup_error; if (cc->friendly_name) newcc->friendly_name = ne_strdup(cc->friendly_name); populate_cert(&newcc->cert, newcc->cert.subject); return newcc; dup_error: if (newcc->pkey) gnutls_x509_privkey_deinit(newcc->pkey); if (newcc->cert.subject) gnutls_x509_crt_deinit(newcc->cert.subject); ne_free(newcc); return NULL; } /* Callback invoked when the SSL server requests a client certificate. */ static int provide_client_cert(gnutls_session session, const gnutls_datum *req_ca_rdn, int nreqs, const gnutls_pk_algorithm *sign_algos, int sign_algos_length, gnutls_retr_st *st) { ne_session *sess = gnutls_session_get_ptr(session); if (!sess) { return GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER; } if (!sess->client_cert && sess->ssl_provide_fn) { /* The dname array cannot be converted without better dname * support from GNUTLS. */ sess->ssl_provide_fn(sess->ssl_provide_ud, sess, NULL, 0); } NE_DEBUG(NE_DBG_SSL, "In client cert provider callback.\n"); if (sess->client_cert) { gnutls_certificate_type type = gnutls_certificate_type_get(session); if (type == GNUTLS_CRT_X509) { NE_DEBUG(NE_DBG_SSL, "Supplying client certificate.\n"); st->type = type; st->ncerts = 1; st->cert.x509 = &sess->client_cert->cert.subject; st->key.x509 = sess->client_cert->pkey; /* tell GNU TLS not to deallocate the certs. */ st->deinit_all = 0; } else { return GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE; } } else { NE_DEBUG(NE_DBG_SSL, "No client certificate supplied.\n"); return GNUTLS_E_NO_CERTIFICATE_FOUND; } return 0; } void ne_ssl_set_clicert(ne_session *sess, const ne_ssl_client_cert *cc) { sess->client_cert = dup_client_cert(cc); } ne_ssl_context *ne_ssl_context_create(int flags) { ne_ssl_context *ctx = ne_calloc(sizeof *ctx); gnutls_certificate_allocate_credentials(&ctx->cred); if (flags == NE_SSL_CTX_CLIENT) { gnutls_certificate_client_set_retrieve_function(ctx->cred, provide_client_cert); } return ctx; } int ne_ssl_context_keypair(ne_ssl_context *ctx, const char *cert, const char *key) { gnutls_certificate_set_x509_key_file(ctx->cred, cert, key, GNUTLS_X509_FMT_PEM); return 0; } int ne_ssl_context_set_verify(ne_ssl_context *ctx, int required, const char *ca_names, const char *verify_cas) { ctx->verify = required; if (verify_cas) { gnutls_certificate_set_x509_trust_file(ctx->cred, verify_cas, GNUTLS_X509_FMT_PEM); } /* gnutls_certificate_send_x509_rdn_sequence in gnutls >= 1.2 can * be used to *suppress* sending the CA names, but not control it, * it seems. */ return 0; } void ne_ssl_context_set_flag(ne_ssl_context *ctx, int flag, int value) { /* SSLv2 not supported. */ } void ne_ssl_context_destroy(ne_ssl_context *ctx) { gnutls_certificate_free_credentials(ctx->cred); if (ctx->cache.client.data) { ne_free(ctx->cache.client.data); } else if (ctx->cache.server.key.data) { gnutls_free(ctx->cache.server.key.data); gnutls_free(ctx->cache.server.data.data); } ne_free(ctx); } /* Return the certificate chain sent by the peer, or NULL on error. */ static ne_ssl_certificate *make_peers_chain(gnutls_session sock) { ne_ssl_certificate *current = NULL, *top = NULL; const gnutls_datum *certs; unsigned int n, count; certs = gnutls_certificate_get_peers(sock, &count); if (!certs) { return NULL; } for (n = 0; n < count; n++) { ne_ssl_certificate *cert; gnutls_x509_crt x5; if (gnutls_x509_crt_init(&x5) || gnutls_x509_crt_import(x5, &certs[n], GNUTLS_X509_FMT_DER)) { ne_ssl_cert_free(top); return NULL; } cert = populate_cert(ne_malloc(sizeof *cert), x5); if (top == NULL) { current = top = cert; } else { current->issuer = cert; current = cert; } } return top; } /* Verifies an SSL server certificate. */ static int check_certificate(ne_session *sess, gnutls_session sock, ne_ssl_certificate *chain) { time_t before, after, now = time(NULL); int ret, failures = 0; ne_uri server; before = gnutls_x509_crt_get_activation_time(chain->subject); after = gnutls_x509_crt_get_expiration_time(chain->subject); if (now < before) failures |= NE_SSL_NOTYETVALID; else if (now > after) failures |= NE_SSL_EXPIRED; memset(&server, 0, sizeof server); ne_fill_server_uri(sess, &server); ret = check_identity(&server, chain->subject, NULL); ne_uri_free(&server); if (ret < 0) { ne_set_error(sess, _("Server certificate was missing commonName " "attribute in subject name")); return NE_ERROR; } else if (ret > 0) { failures |= NE_SSL_IDMISMATCH; } if (gnutls_certificate_verify_peers(sock)) { failures |= NE_SSL_UNTRUSTED; } NE_DEBUG(NE_DBG_SSL, "Failures = %d\n", failures); if (failures == 0) { ret = NE_OK; } else { ne__ssl_set_verify_err(sess, failures); ret = NE_ERROR; if (sess->ssl_verify_fn && sess->ssl_verify_fn(sess->ssl_verify_ud, failures, chain) == 0) ret = NE_OK; } return ret; } /* Negotiate an SSL connection. */ int ne__negotiate_ssl(ne_session *sess) { ne_ssl_context *const ctx = sess->ssl_context; ne_ssl_certificate *chain; gnutls_session sock; NE_DEBUG(NE_DBG_SSL, "Negotiating SSL connection.\n"); /* Pass through the hostname if SNI is enabled. */ ctx->hostname = sess->flags[NE_SESSFLAG_TLS_SNI] ? sess->server.hostname : NULL; if (ne_sock_connect_ssl(sess->socket, ctx, sess)) { ne_set_error(sess, _("SSL negotiation failed: %s"), ne_sock_error(sess->socket)); return NE_ERROR; } sock = ne__sock_sslsock(sess->socket); chain = make_peers_chain(sock); if (chain == NULL) { ne_set_error(sess, _("Server did not send certificate chain")); return NE_ERROR; } if (sess->server_cert && ne_ssl_cert_cmp(sess->server_cert, chain) == 0) { /* Same cert as last time; presume OK. This is not optimal as * make_peers_chain() has already gone through and done the * expensive DER parsing stuff for the whole chain by now. */ ne_ssl_cert_free(chain); return NE_OK; } if (check_certificate(sess, sock, chain)) { ne_ssl_cert_free(chain); return NE_ERROR; } sess->server_cert = chain; return NE_OK; } const ne_ssl_dname *ne_ssl_cert_issuer(const ne_ssl_certificate *cert) { return &cert->issuer_dn; } const ne_ssl_dname *ne_ssl_cert_subject(const ne_ssl_certificate *cert) { return &cert->subj_dn; } const ne_ssl_certificate *ne_ssl_cert_signedby(const ne_ssl_certificate *cert) { return cert->issuer; } const char *ne_ssl_cert_identity(const ne_ssl_certificate *cert) { return cert->identity; } void ne_ssl_context_trustcert(ne_ssl_context *ctx, const ne_ssl_certificate *cert) { gnutls_x509_crt certs = cert->subject; gnutls_certificate_set_x509_trust(ctx->cred, &certs, 1); } void ne_ssl_trust_default_ca(ne_session *sess) { #ifdef NE_SSL_CA_BUNDLE gnutls_certificate_set_x509_trust_file(sess->ssl_context->cred, NE_SSL_CA_BUNDLE, GNUTLS_X509_FMT_PEM); #endif } /* Read the contents of file FILENAME into *DATUM. */ static int read_to_datum(const char *filename, gnutls_datum *datum) { FILE *f = fopen(filename, "r"); ne_buffer *buf; char tmp[4192]; size_t len; if (!f) { return -1; } buf = ne_buffer_ncreate(8192); while ((len = fread(tmp, 1, sizeof tmp, f)) > 0) { ne_buffer_append(buf, tmp, len); } if (!feof(f)) { fclose(f); ne_buffer_destroy(buf); return -1; } fclose(f); datum->size = ne_buffer_size(buf); datum->data = (unsigned char *)ne_buffer_finish(buf); return 0; } /* Parses a PKCS#12 structure and loads the certificate, private key * and friendly name if possible. Returns zero on success, non-zero * on error. */ static int pkcs12_parse(gnutls_pkcs12 p12, gnutls_x509_privkey *pkey, gnutls_x509_crt *x5, char **friendly_name, const char *password) { gnutls_pkcs12_bag bag = NULL; int i, j, ret = 0; for (i = 0; ret == 0; ++i) { if (bag) gnutls_pkcs12_bag_deinit(bag); ret = gnutls_pkcs12_bag_init(&bag); if (ret < 0) continue; ret = gnutls_pkcs12_get_bag(p12, i, bag); if (ret < 0) continue; gnutls_pkcs12_bag_decrypt(bag, password); for (j = 0; ret == 0 && j < gnutls_pkcs12_bag_get_count(bag); ++j) { gnutls_pkcs12_bag_type type; gnutls_datum data; if (friendly_name && *friendly_name == NULL) { char *name = NULL; gnutls_pkcs12_bag_get_friendly_name(bag, j, &name); if (name) { if (name[0] == '.') name++; /* weird GnuTLS bug? */ *friendly_name = ne_strdup(name); } } type = gnutls_pkcs12_bag_get_type(bag, j); switch (type) { case GNUTLS_BAG_PKCS8_KEY: case GNUTLS_BAG_PKCS8_ENCRYPTED_KEY: gnutls_x509_privkey_init(pkey); ret = gnutls_pkcs12_bag_get_data(bag, j, &data); if (ret < 0) continue; ret = gnutls_x509_privkey_import_pkcs8(*pkey, &data, GNUTLS_X509_FMT_DER, password, 0); if (ret < 0) continue; break; case GNUTLS_BAG_CERTIFICATE: gnutls_x509_crt_init(x5); ret = gnutls_pkcs12_bag_get_data(bag, j, &data); if (ret < 0) continue; ret = gnutls_x509_crt_import(*x5, &data, GNUTLS_X509_FMT_DER); if (ret < 0) continue; break; default: break; } } } /* Make sure last bag is freed */ if (bag) gnutls_pkcs12_bag_deinit(bag); /* Free in case of error */ if (ret < 0 && ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { if (*x5) gnutls_x509_crt_deinit(*x5); if (*pkey) gnutls_x509_privkey_deinit(*pkey); if (friendly_name && *friendly_name) ne_free(*friendly_name); } if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) ret = 0; return ret; } ne_ssl_client_cert *ne_ssl_clicert_read(const char *filename) { int ret; gnutls_datum data; gnutls_pkcs12 p12; ne_ssl_client_cert *cc; char *friendly_name = NULL; gnutls_x509_crt cert = NULL; gnutls_x509_privkey pkey = NULL; if (read_to_datum(filename, &data)) return NULL; if (gnutls_pkcs12_init(&p12) != 0) { return NULL; } ret = gnutls_pkcs12_import(p12, &data, GNUTLS_X509_FMT_DER, 0); ne_free(data.data); if (ret < 0) { gnutls_pkcs12_deinit(p12); return NULL; } if (gnutls_pkcs12_verify_mac(p12, "") == 0) { if (pkcs12_parse(p12, &pkey, &cert, &friendly_name, "") != 0 || !cert || !pkey) { gnutls_pkcs12_deinit(p12); return NULL; } cc = ne_calloc(sizeof *cc); cc->pkey = pkey; cc->decrypted = 1; cc->friendly_name = friendly_name; populate_cert(&cc->cert, cert); gnutls_pkcs12_deinit(p12); cc->p12 = NULL; return cc; } else { /* TODO: calling pkcs12_parse() here to find the friendly_name * seems to break horribly. */ cc = ne_calloc(sizeof *cc); cc->p12 = p12; return cc; } } ne_ssl_client_cert *ne__ssl_clicert_exkey_import(const unsigned char *der, size_t der_len) { ne_ssl_client_cert *cc; gnutls_x509_crt x5; gnutls_datum datum; datum.data = (unsigned char *)der; datum.size = der_len; if (gnutls_x509_crt_init(&x5) || gnutls_x509_crt_import(x5, &datum, GNUTLS_X509_FMT_DER)) { NE_DEBUG(NE_DBG_SSL, "ssl: crt_import failed.\n"); return NULL; } cc = ne_calloc(sizeof *cc); cc->keyless = 1; cc->decrypted = 1; populate_cert(&cc->cert, x5); return cc; } int ne_ssl_clicert_encrypted(const ne_ssl_client_cert *cc) { return !cc->decrypted; } int ne_ssl_clicert_decrypt(ne_ssl_client_cert *cc, const char *password) { int ret; gnutls_x509_crt cert = NULL; gnutls_x509_privkey pkey = NULL; if (gnutls_pkcs12_verify_mac(cc->p12, password) != 0) { return -1; } ret = pkcs12_parse(cc->p12, &pkey, &cert, NULL, password); if (ret < 0) return ret; if (!cert || (!pkey && !cc->keyless)) { if (cert) gnutls_x509_crt_deinit(cert); if (pkey) gnutls_x509_privkey_deinit(pkey); return -1; } gnutls_pkcs12_deinit(cc->p12); populate_cert(&cc->cert, cert); cc->pkey = pkey; cc->decrypted = 1; cc->p12 = NULL; return 0; } const ne_ssl_certificate *ne_ssl_clicert_owner(const ne_ssl_client_cert *cc) { return &cc->cert; } const char *ne_ssl_clicert_name(const ne_ssl_client_cert *ccert) { return ccert->friendly_name; } ne_ssl_certificate *ne_ssl_cert_read(const char *filename) { int ret; gnutls_datum data; gnutls_x509_crt x5; if (read_to_datum(filename, &data)) return NULL; if (gnutls_x509_crt_init(&x5) != 0) return NULL; ret = gnutls_x509_crt_import(x5, &data, GNUTLS_X509_FMT_PEM); ne_free(data.data); if (ret < 0) { gnutls_x509_crt_deinit(x5); return NULL; } return populate_cert(ne_calloc(sizeof(struct ne_ssl_certificate_s)), x5); } int ne_ssl_cert_write(const ne_ssl_certificate *cert, const char *filename) { unsigned char buffer[10*1024]; size_t len = sizeof buffer; FILE *fp = fopen(filename, "w"); if (fp == NULL) return -1; if (gnutls_x509_crt_export(cert->subject, GNUTLS_X509_FMT_PEM, buffer, &len) < 0) { fclose(fp); return -1; } if (fwrite(buffer, len, 1, fp) != 1) { fclose(fp); return -1; } if (fclose(fp) != 0) return -1; return 0; } void ne_ssl_cert_free(ne_ssl_certificate *cert) { gnutls_x509_crt_deinit(cert->subject); if (cert->identity) ne_free(cert->identity); if (cert->issuer) ne_ssl_cert_free(cert->issuer); ne_free(cert); } int ne_ssl_cert_cmp(const ne_ssl_certificate *c1, const ne_ssl_certificate *c2) { char digest1[NE_SSL_DIGESTLEN], digest2[NE_SSL_DIGESTLEN]; if (ne_ssl_cert_digest(c1, digest1) || ne_ssl_cert_digest(c2, digest2)) { return -1; } return strcmp(digest1, digest2); } /* The certificate import/export format is the base64 encoding of the * raw DER; PEM without the newlines and wrapping. */ ne_ssl_certificate *ne_ssl_cert_import(const char *data) { int ret; size_t len; unsigned char *der; gnutls_datum buffer = { NULL, 0 }; gnutls_x509_crt x5; if (gnutls_x509_crt_init(&x5) != 0) return NULL; /* decode the base64 to get the raw DER representation */ len = ne_unbase64(data, &der); if (len == 0) return NULL; buffer.data = der; buffer.size = len; ret = gnutls_x509_crt_import(x5, &buffer, GNUTLS_X509_FMT_DER); ne_free(der); if (ret < 0) { gnutls_x509_crt_deinit(x5); return NULL; } return populate_cert(ne_calloc(sizeof(struct ne_ssl_certificate_s)), x5); } char *ne_ssl_cert_export(const ne_ssl_certificate *cert) { unsigned char *der; size_t len = 0; char *ret; /* find the length of the DER encoding. */ if (gnutls_x509_crt_export(cert->subject, GNUTLS_X509_FMT_DER, NULL, &len) != GNUTLS_E_SHORT_MEMORY_BUFFER) { return NULL; } der = ne_malloc(len); if (gnutls_x509_crt_export(cert->subject, GNUTLS_X509_FMT_DER, der, &len)) { ne_free(der); return NULL; } ret = ne_base64(der, len); ne_free(der); return ret; } int ne_ssl_cert_digest(const ne_ssl_certificate *cert, char *digest) { char sha1[20], *p; int j; size_t len = sizeof sha1; if (gnutls_x509_crt_get_fingerprint(cert->subject, GNUTLS_DIG_SHA, sha1, &len) < 0) return -1; for (j = 0, p = digest; j < 20; j++) { *p++ = NE_HEX2ASC((sha1[j] >> 4) & 0x0f); *p++ = NE_HEX2ASC(sha1[j] & 0x0f); *p++ = ':'; } *--p = '\0'; return 0; } int ne__ssl_init(void) { #ifdef NE_HAVE_TS_SSL gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); #endif gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0); return gnutls_global_init(); } void ne__ssl_exit(void) { /* No way to unregister the thread callbacks. Doomed. */ #if LIBGNUTLS_VERSION_MAJOR > 1 || LIBGNUTLS_VERSION_MINOR > 3 \ || (LIBGNUTLS_VERSION_MINOR == 3 && LIBGNUTLS_VERSION_PATCH >= 3) /* It's safe to call gnutls_global_deinit() here only with * gnutls >= 1.3., since older versions don't refcount and * doing so would prevent any other use of gnutls within * the process. */ gnutls_global_deinit(); #endif } sitecopy-0.16.6/lib/neon/ne_acl.c0000664000076400007640000000676210753026464014705 0ustar joejoe/* Access control Copyright (C) 2001-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* Contributed by Arun Garg */ #include "config.h" #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include "ne_request.h" #include "ne_locks.h" #include "ne_alloc.h" #include "ne_string.h" #include "ne_acl.h" #include "ne_uri.h" #include "ne_xml.h" /* for NE_XML_MEDIA_TYPE */ #define EOL "\r\n" static ne_buffer *acl_body(const ne_acl_entry *right, int count) { ne_buffer *body = ne_buffer_create(); int m; ne_buffer_zappend(body, "" EOL "" EOL); for (m = 0; m < count; m++) { const char *type; type = (right[m].type == ne_acl_grant ? "grant" : "deny"); ne_buffer_concat(body, "" EOL "", NULL); switch (right[m].apply) { case ne_acl_all: ne_buffer_zappend(body, "" EOL); break; case ne_acl_property: ne_buffer_concat(body, "<", right[m].principal, "/>" EOL, NULL); break; case ne_acl_href: ne_buffer_concat(body, "", right[m].principal, "" EOL, NULL); break; } ne_buffer_concat(body, "" EOL "<", type, ">" EOL, NULL); if (right[m].read == 0) ne_buffer_concat(body, "" "" "" EOL, NULL); if (right[m].read_acl == 0) ne_buffer_concat(body, "" "" "" EOL, NULL); if (right[m].write == 0) ne_buffer_concat(body, "" "" "" EOL, NULL); if (right[m].write_acl == 0) ne_buffer_concat(body, "" "" "" EOL, NULL); if (right[m].read_cuprivset == 0) ne_buffer_concat(body, "" "" "" EOL, NULL); ne_buffer_concat(body, "" EOL, NULL); ne_buffer_zappend(body, "" EOL); } ne_buffer_zappend(body, "" EOL); return body; } int ne_acl_set(ne_session *sess, const char *uri, const ne_acl_entry *entries, int numentries) { int ret; ne_request *req = ne_request_create(sess, "ACL", uri); ne_buffer *body = acl_body(entries, numentries); #ifdef NE_HAVE_DAV ne_lock_using_resource(req, uri, 0); #endif ne_set_request_body_buffer(req, body->data, ne_buffer_size(body)); ne_add_request_header(req, "Content-Type", NE_XML_MEDIA_TYPE); ret = ne_request_dispatch(req); ne_buffer_destroy(body); if (ret == NE_OK && ne_get_status(req)->code == 207) { ret = NE_ERROR; } ne_request_destroy(req); return ret; } sitecopy-0.16.6/lib/neon/ne_auth.c0000664000076400007640000013737610762031424015105 0ustar joejoe/* HTTP Authentication routines Copyright (C) 1999-2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_UNISTD_H #include /* for getpid() */ #endif #ifdef WIN32 #include /* for GetCurrentThreadId() etc */ #endif #ifdef HAVE_OPENSSL #include #elif defined(HAVE_GNUTLS) #include #endif #include #include #include "ne_md5.h" #include "ne_dates.h" #include "ne_request.h" #include "ne_auth.h" #include "ne_string.h" #include "ne_utils.h" #include "ne_alloc.h" #include "ne_uri.h" #include "ne_internal.h" #ifdef HAVE_GSSAPI #ifdef HAVE_GSSAPI_GSSAPI_H #include #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H #include #endif #else #include #endif #endif #ifdef HAVE_SSPI #include "ne_sspi.h" #endif #define HOOK_SERVER_ID "http://webdav.org/neon/hooks/server-auth" #define HOOK_PROXY_ID "http://webdav.org/neon/hooks/proxy-auth" typedef enum { auth_alg_md5, auth_alg_md5_sess, auth_alg_unknown } auth_algorithm; /* Selected method of qop which the client is using */ typedef enum { auth_qop_none, auth_qop_auth } auth_qop; /* A callback/userdata pair registered by the application for * a particular set of protocols. */ struct auth_handler { unsigned protomask; ne_auth_creds creds; void *userdata; int attempt; /* number of invocations of this callback for * current request. */ struct auth_handler *next; }; /* A challenge */ struct auth_challenge { const struct auth_protocol *protocol; struct auth_handler *handler; const char *realm, *nonce, *opaque, *domain; unsigned int stale; /* if stale=true */ unsigned int got_qop; /* we were given a qop directive */ unsigned int qop_auth; /* "auth" token in qop attrib */ auth_algorithm alg; struct auth_challenge *next; }; static const struct auth_class { const char *id, *req_hdr, *resp_hdr, *resp_info_hdr; int status_code; /* Response status-code to trap. */ int fail_code; /* NE_* request to fail with. */ const char *error_noauth; /* Error message template use when * giving up authentication attempts. */ } ah_server_class = { HOOK_SERVER_ID, "Authorization", "WWW-Authenticate", "Authentication-Info", 401, NE_AUTH, N_("Could not authenticate to server: %s") }, ah_proxy_class = { HOOK_PROXY_ID, "Proxy-Authorization", "Proxy-Authenticate", "Proxy-Authentication-Info", 407, NE_PROXYAUTH, N_("Could not authenticate to proxy server: %s") }; /* Authentication session state. */ typedef struct { ne_session *sess; /* Which context will auth challenges be accepted? */ enum { AUTH_ANY, /* ignore nothing. */ AUTH_CONNECT, /* only in response to a CONNECT request. */ AUTH_NOTCONNECT /* only in non-CONNECT responsees */ } context; /* Protocol type for server/proxy auth. */ const struct auth_class *spec; /* The protocol used for this authentication session */ const struct auth_protocol *protocol; struct auth_handler *handlers; /*** Session details ***/ /* The username and password we are using to authenticate with */ char username[NE_ABUFSIZ]; /* This used for Basic auth */ char *basic; #ifdef HAVE_GSSAPI /* for the GSSAPI/Negotiate scheme: */ char *gssapi_token; gss_ctx_id_t gssctx; gss_name_t gssname; gss_OID gssmech; #endif #ifdef HAVE_SSPI /* This is used for SSPI (Negotiate/NTLM) auth */ char *sspi_token; void *sspi_context; #endif /* These all used for Digest auth */ char *realm; char *nonce; char *cnonce; char *opaque; char **domains; /* list of paths given as domain. */ size_t ndomains; /* size of domains array */ auth_qop qop; auth_algorithm alg; unsigned int nonce_count; /* The ASCII representation of the session's H(A1) value */ char h_a1[33]; /* Temporary store for half of the Request-Digest * (an optimisation - used in the response-digest calculation) */ struct ne_md5_ctx *stored_rdig; } auth_session; struct auth_request { /*** Per-request details. ***/ ne_request *request; /* the request object. */ /* The method and URI we are using for the current request */ const char *uri; const char *method; int attempt; /* number of times this request has been retries due * to auth challenges. */ }; /* Used if this protocol takes an unquoted non-name/value-pair * parameter in the challenge. */ #define AUTH_FLAG_OPAQUE_PARAM (0x0001) /* Used if this Authentication-Info may be sent for non-40[17] * response for this protocol. */ #define AUTH_FLAG_VERIFY_NON40x (0x0002) /* Used for broken the connection-based auth schemes. */ #define AUTH_FLAG_CONN_AUTH (0x0004) struct auth_protocol { unsigned id; /* public NE_AUTH_* id. */ int strength; /* protocol strength for sort order. */ const char *name; /* protocol name. */ /* Parse the authentication challenge; returns zero on success, or * non-zero if this challenge be handled. 'attempt' is the number * of times the request has been resent due to auth challenges. * On failure, challenge_error() should be used to append an error * message to the error buffer 'errmsg'. */ int (*challenge)(auth_session *sess, int attempt, struct auth_challenge *chall, ne_buffer **errmsg); /* Return the string to send in the -Authenticate request header: * (ne_malloc-allocated, NUL-terminated string) */ char *(*response)(auth_session *sess, struct auth_request *req); /* Parse a Authentication-Info response; returns NE_* error code * on failure; on failure, the session error string must be * set. */ int (*verify)(struct auth_request *req, auth_session *sess, const char *value); int flags; /* AUTH_FLAG_* flags */ }; /* Helper function to append an error to the buffer during challenge * handling. Pass printf-style string. *errmsg may be NULL and is * allocated if necessary. errmsg must be non-NULL. */ static void challenge_error(ne_buffer **errmsg, const char *fmt, ...) ne_attribute((format(printf, 2, 3))); /* Free the domains array, precondition sess->ndomains > 0. */ static void free_domains(auth_session *sess) { do { ne_free(sess->domains[sess->ndomains - 1]); } while (--sess->ndomains); ne_free(sess->domains); sess->domains = NULL; } static void clean_session(auth_session *sess) { if (sess->basic) ne_free(sess->basic); if (sess->nonce) ne_free(sess->nonce); if (sess->cnonce) ne_free(sess->cnonce); if (sess->opaque) ne_free(sess->opaque); if (sess->realm) ne_free(sess->realm); sess->realm = sess->basic = sess->cnonce = sess->nonce = sess->opaque = NULL; if (sess->stored_rdig) { ne_md5_destroy_ctx(sess->stored_rdig); sess->stored_rdig = NULL; } if (sess->ndomains) free_domains(sess); #ifdef HAVE_GSSAPI { unsigned int major; if (sess->gssctx != GSS_C_NO_CONTEXT) gss_delete_sec_context(&major, &sess->gssctx, GSS_C_NO_BUFFER); } if (sess->gssapi_token) ne_free(sess->gssapi_token); sess->gssapi_token = NULL; #endif #ifdef HAVE_SSPI if (sess->sspi_token) ne_free(sess->sspi_token); sess->sspi_token = NULL; ne_sspi_destroy_context(sess->sspi_context); sess->sspi_context = NULL; #endif } /* Returns client nonce string. */ static char *get_cnonce(void) { char ret[33]; unsigned char data[256]; struct ne_md5_ctx *hash; hash = ne_md5_create_ctx(); #ifdef HAVE_GNUTLS if (1) { gcry_create_nonce(data, sizeof data); ne_md5_process_bytes(data, sizeof data, hash); } else #elif defined(HAVE_OPENSSL) if (RAND_status() == 1 && RAND_pseudo_bytes(data, sizeof data) >= 0) { ne_md5_process_bytes(data, sizeof data, hash); } else #endif /* HAVE_OPENSSL */ { /* Fallback sources of random data: all bad, but no good sources * are available. */ /* Uninitialized stack data; yes, happy valgrinders, this is * supposed to be here. */ ne_md5_process_bytes(data, sizeof data, hash); { #ifdef HAVE_GETTIMEOFDAY struct timeval tv; if (gettimeofday(&tv, NULL) == 0) ne_md5_process_bytes(&tv, sizeof tv, hash); #else /* HAVE_GETTIMEOFDAY */ time_t t = time(NULL); ne_md5_process_bytes(&t, sizeof t, hash); #endif } { #ifdef WIN32 DWORD pid = GetCurrentThreadId(); #else pid_t pid = getpid(); #endif ne_md5_process_bytes(&pid, sizeof pid, hash); } } ne_md5_finish_ascii(hash, ret); ne_md5_destroy_ctx(hash); return ne_strdup(ret); } /* Callback to retrieve user credentials for given session on given * attempt (pre request) for given challenge. Password is written to * pwbuf (of size NE_ABUFSIZ. On error, challenge_error() is used * with errmsg. */ static int get_credentials(auth_session *sess, ne_buffer **errmsg, int attempt, struct auth_challenge *chall, char *pwbuf) { if (chall->handler->creds(chall->handler->userdata, sess->realm, chall->handler->attempt++, sess->username, pwbuf) == 0) { return 0; } else { challenge_error(errmsg, _("rejected %s challenge"), chall->protocol->name); return -1; } } /* Examine a Basic auth challenge. * Returns 0 if an valid challenge, else non-zero. */ static int basic_challenge(auth_session *sess, int attempt, struct auth_challenge *parms, ne_buffer **errmsg) { char *tmp, password[NE_ABUFSIZ]; /* Verify challenge... must have a realm */ if (parms->realm == NULL) { challenge_error(errmsg, _("missing realm in Basic challenge")); return -1; } clean_session(sess); sess->realm = ne_strdup(parms->realm); if (get_credentials(sess, errmsg, attempt, parms, password)) { /* Failed to get credentials */ return -1; } tmp = ne_concat(sess->username, ":", password, NULL); sess->basic = ne_base64((unsigned char *)tmp, strlen(tmp)); ne_free(tmp); /* Paranoia. */ memset(password, 0, sizeof password); return 0; } /* Add Basic authentication credentials to a request */ static char *request_basic(auth_session *sess, struct auth_request *req) { return ne_concat("Basic ", sess->basic, "\r\n", NULL); } #ifdef HAVE_GSSAPI /* Add GSSAPI authentication credentials to a request */ static char *request_negotiate(auth_session *sess, struct auth_request *req) { if (sess->gssapi_token) return ne_concat("Negotiate ", sess->gssapi_token, "\r\n", NULL); else return NULL; } /* Create an GSSAPI name for server HOSTNAME; returns non-zero on * error. */ static void get_gss_name(gss_name_t *server, const char *hostname) { unsigned int major, minor; gss_buffer_desc token; token.value = ne_concat("HTTP@", hostname, NULL); token.length = strlen(token.value); major = gss_import_name(&minor, &token, GSS_C_NT_HOSTBASED_SERVICE, server); ne_free(token.value); if (GSS_ERROR(major)) { NE_DEBUG(NE_DBG_HTTPAUTH, "gssapi: gss_import_name failed.\n"); *server = GSS_C_NO_NAME; } } /* Append GSSAPI error(s) for STATUS of type TYPE to BUF; prepending * ": " to each error if *FLAG is non-zero, setting *FLAG after an * error has been appended. */ static void make_gss_error(ne_buffer *buf, int *flag, unsigned int status, int type) { unsigned int major, minor; unsigned int context = 0; do { gss_buffer_desc msg; major = gss_display_status(&minor, status, type, GSS_C_NO_OID, &context, &msg); if (major == GSS_S_COMPLETE && msg.length) { if ((*flag)++) ne_buffer_append(buf, ": ", 2); ne_buffer_append(buf, msg.value, msg.length); } if (msg.length) gss_release_buffer(&minor, &msg); } while (context); } /* Continue a GSS-API Negotiate exchange, using input TOKEN if * non-NULL. Returns non-zero on error, in which case *errmsg is * guaranteed to be non-NULL (i.e. an error message is set). */ static int continue_negotiate(auth_session *sess, const char *token, ne_buffer **errmsg) { unsigned int major, minor; gss_buffer_desc input = GSS_C_EMPTY_BUFFER; gss_buffer_desc output = GSS_C_EMPTY_BUFFER; unsigned char *bintoken = NULL; int ret; if (token) { input.length = ne_unbase64(token, &bintoken); if (input.length == 0) { challenge_error(errmsg, _("invalid Negotiate token")); return -1; } input.value = bintoken; NE_DEBUG(NE_DBG_HTTPAUTH, "gssapi: Continuation token [%s]\n", token); } else if (sess->gssctx != GSS_C_NO_CONTEXT) { NE_DEBUG(NE_DBG_HTTPAUTH, "gssapi: Reset incomplete context.\n"); gss_delete_sec_context(&minor, &sess->gssctx, GSS_C_NO_BUFFER); } major = gss_init_sec_context(&minor, GSS_C_NO_CREDENTIAL, &sess->gssctx, sess->gssname, sess->gssmech, GSS_C_MUTUAL_FLAG, GSS_C_INDEFINITE, GSS_C_NO_CHANNEL_BINDINGS, &input, &sess->gssmech, &output, NULL, NULL); /* done with the input token. */ if (bintoken) ne_free(bintoken); if (GSS_ERROR(major)) { int flag = 0; challenge_error(errmsg, _("GSSAPI authentication error: ")); make_gss_error(*errmsg, &flag, major, GSS_C_GSS_CODE); make_gss_error(*errmsg, &flag, minor, GSS_C_MECH_CODE); return -1; } if (major == GSS_S_CONTINUE_NEEDED || major == GSS_S_COMPLETE) { NE_DEBUG(NE_DBG_HTTPAUTH, "gssapi: init_sec_context OK. (major=%d)\n", major); ret = 0; } else { challenge_error(errmsg, _("GSSAPI failure (code %u)"), major); ret = -1; } if (major != GSS_S_CONTINUE_NEEDED) { /* context no longer needed: destroy it */ gss_delete_sec_context(&minor, &sess->gssctx, GSS_C_NO_BUFFER); } if (output.length) { sess->gssapi_token = ne_base64(output.value, output.length); NE_DEBUG(NE_DBG_HTTPAUTH, "gssapi: Output token: [%s]\n", sess->gssapi_token); gss_release_buffer(&minor, &output); } else { NE_DEBUG(NE_DBG_HTTPAUTH, "gssapi: No output token.\n"); } return ret; } /* Process a Negotiate challange CHALL in session SESS; returns zero * if challenge is accepted. */ static int negotiate_challenge(auth_session *sess, int attempt, struct auth_challenge *chall, ne_buffer **errmsg) { const char *token = chall->opaque; /* Respect an initial challenge - which must have no input token, * or a continuation - which must have an input token. */ if (attempt == 0 || token) { return continue_negotiate(sess, token, errmsg); } else { challenge_error(errmsg, _("ignoring empty Negotiate continuation")); return -1; } } /* Verify the header HDR in a Negotiate response. */ static int verify_negotiate_response(struct auth_request *req, auth_session *sess, const char *hdr) { char *duphdr = ne_strdup(hdr); char *sep, *ptr = strchr(duphdr, ' '); int ret; ne_buffer *errmsg = NULL; if (strncmp(hdr, "Negotiate", ptr - duphdr) != 0) { ne_set_error(sess->sess, _("Negotiate response verification failed: " "invalid response header token")); ne_free(duphdr); return NE_ERROR; } ptr++; if (strlen(ptr) == 0) { NE_DEBUG(NE_DBG_HTTPAUTH, "gssapi: No token in Negotiate response!\n"); ne_free(duphdr); return NE_OK; } if ((sep = strchr(ptr, ',')) != NULL) *sep = '\0'; if ((sep = strchr(ptr, ' ')) != NULL) *sep = '\0'; NE_DEBUG(NE_DBG_HTTPAUTH, "gssapi: Negotiate response token [%s]\n", ptr); ret = continue_negotiate(sess, ptr, &errmsg); if (ret) { ne_set_error(sess->sess, _("Negotiate response verification failure: %s"), errmsg->data); } if (errmsg) ne_buffer_destroy(errmsg); ne_free(duphdr); return ret ? NE_ERROR : NE_OK; } #endif #ifdef HAVE_SSPI static char *request_sspi(auth_session *sess, struct auth_request *request) { return ne_concat(sess->protocol->name, " ", sess->sspi_token, "\r\n", NULL); } static int sspi_challenge(auth_session *sess, int attempt, struct auth_challenge *parms, ne_buffer **errmsg) { int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0; int status; char *response = NULL; NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n"); if (!sess->sspi_context) { ne_uri uri = {0}; ne_fill_server_uri(sess->sess, &uri); status = ne_sspi_create_context(&sess->sspi_context, uri.host, ntlm); ne_uri_free(&uri); if (status) { return status; } } status = ne_sspi_authenticate(sess->sspi_context, parms->opaque, &response); if (status) { return status; } sess->sspi_token = response; NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge [%s]\n", sess->sspi_token); return 0; } #endif /* Parse the "domain" challenge parameter and set the domains array up * in the session appropriately. */ static int parse_domain(auth_session *sess, const char *domain) { char *cp = ne_strdup(domain), *p = cp; ne_uri base; int invalid = 0; memset(&base, 0, sizeof base); ne_fill_server_uri(sess->sess, &base); do { char *token = ne_token(&p, ' '); ne_uri rel, absolute; if (ne_uri_parse(token, &rel) == 0) { /* Resolve relative to the Request-URI. */ ne_uri_resolve(&base, &rel, &absolute); base.path = absolute.path; /* Ignore URIs not on this server. */ if (absolute.path && ne_uri_cmp(&absolute, &base) == 0) { sess->domains = ne_realloc(sess->domains, ++sess->ndomains * sizeof(*sess->domains)); sess->domains[sess->ndomains - 1] = absolute.path; NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Using domain %s from %s\n", absolute.path, token); absolute.path = NULL; } else { NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Ignoring domain %s\n", token); } ne_uri_free(&absolute); } else { invalid = 1; } ne_uri_free(&rel); } while (p && !invalid); if (invalid && sess->ndomains) { free_domains(sess); } ne_free(cp); base.path = NULL; ne_uri_free(&base); return invalid; } /* Examine a digest challenge: return 0 if it is a valid Digest challenge, * else non-zero. */ static int digest_challenge(auth_session *sess, int attempt, struct auth_challenge *parms, ne_buffer **errmsg) { char password[NE_ABUFSIZ]; if (parms->alg == auth_alg_unknown) { challenge_error(errmsg, _("unknown algorithm in Digest challenge")); return -1; } else if (parms->alg == auth_alg_md5_sess && !parms->qop_auth) { challenge_error(errmsg, _("incompatible algorithm in Digest challenge")); return -1; } else if (parms->realm == NULL || parms->nonce == NULL) { challenge_error(errmsg, _("missing parameter in Digest challenge")); return -1; } else if (parms->stale && sess->nonce_count == 0) { challenge_error(errmsg, _("initial Digest challenge was stale")); return -1; } else if (parms->stale && (sess->alg != parms->alg || strcmp(sess->realm, parms->realm))) { /* With stale=true the realm and algorithm cannot change since these * require re-hashing H(A1) which defeats the point. */ challenge_error(errmsg, _("stale Digest challenge with new algorithm or realm")); return -1; } if (!parms->stale) { /* Non-stale challenge: clear session and request credentials. */ clean_session(sess); /* The domain paramater must be parsed after the session is * cleaned; ignore domain for proxy auth. */ if (parms->domain && sess->spec == &ah_server_class && parse_domain(sess, parms->domain)) { challenge_error(errmsg, _("could not parse domain in Digest challenge")); return -1; } sess->realm = ne_strdup(parms->realm); sess->alg = parms->alg; sess->cnonce = get_cnonce(); if (get_credentials(sess, errmsg, attempt, parms, password)) { /* Failed to get credentials */ return -1; } } else { /* Stale challenge: accept a new nonce or opaque. */ if (sess->nonce) ne_free(sess->nonce); if (sess->opaque && parms->opaque) ne_free(sess->opaque); } sess->nonce = ne_strdup(parms->nonce); if (parms->opaque) { sess->opaque = ne_strdup(parms->opaque); } if (parms->got_qop) { /* What type of qop are we to apply to the message? */ NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Got qop, using 2617-style.\n"); sess->nonce_count = 0; sess->qop = auth_qop_auth; } else { /* No qop at all/ */ sess->qop = auth_qop_none; } if (!parms->stale) { struct ne_md5_ctx *tmp; /* Calculate H(A1). * tmp = H(unq(username-value) ":" unq(realm-value) ":" passwd) */ tmp = ne_md5_create_ctx(); ne_md5_process_bytes(sess->username, strlen(sess->username), tmp); ne_md5_process_bytes(":", 1, tmp); ne_md5_process_bytes(sess->realm, strlen(sess->realm), tmp); ne_md5_process_bytes(":", 1, tmp); ne_md5_process_bytes(password, strlen(password), tmp); memset(password, 0, sizeof password); /* done with that. */ if (sess->alg == auth_alg_md5_sess) { struct ne_md5_ctx *a1; char tmp_md5_ascii[33]; /* Now we calculate the SESSION H(A1) * A1 = H(...above...) ":" unq(nonce-value) ":" unq(cnonce-value) */ ne_md5_finish_ascii(tmp, tmp_md5_ascii); a1 = ne_md5_create_ctx(); ne_md5_process_bytes(tmp_md5_ascii, 32, a1); ne_md5_process_bytes(":", 1, a1); ne_md5_process_bytes(sess->nonce, strlen(sess->nonce), a1); ne_md5_process_bytes(":", 1, a1); ne_md5_process_bytes(sess->cnonce, strlen(sess->cnonce), a1); ne_md5_finish_ascii(a1, sess->h_a1); ne_md5_destroy_ctx(a1); NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Session H(A1) is [%s]\n", sess->h_a1); } else { ne_md5_finish_ascii(tmp, sess->h_a1); NE_DEBUG(NE_DBG_HTTPAUTH, "auth: H(A1) is [%s]\n", sess->h_a1); } ne_md5_destroy_ctx(tmp); } NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Accepting digest challenge.\n"); return 0; } /* Returns non-zero if given Request-URI is inside the authentication * domain defined for the session. */ static int inside_domain(auth_session *sess, const char *req_uri) { int inside = 0; size_t n; ne_uri uri; /* Parse the Request-URI; it will be an absoluteURI if using a * proxy, and possibly '*'. */ if (strcmp(req_uri, "*") == 0 || ne_uri_parse(req_uri, &uri) != 0) { /* Presume outside the authentication domain. */ return 0; } for (n = 0; n < sess->ndomains && !inside; n++) { const char *d = sess->domains[n]; inside = strncmp(uri.path, d, strlen(d)) == 0; } NE_DEBUG(NE_DBG_HTTPAUTH, "auth: '%s' is inside auth domain: %d.\n", uri.path, inside); ne_uri_free(&uri); return inside; } /* Return Digest authentication credentials header value for the given * session. */ static char *request_digest(auth_session *sess, struct auth_request *req) { struct ne_md5_ctx *a2, *rdig; char a2_md5_ascii[33], rdig_md5_ascii[33]; char nc_value[9] = {0}; const char *qop_value = "auth"; /* qop-value */ ne_buffer *ret; /* Do not submit credentials if an auth domain is defined and this * request-uri fails outside it. */ if (sess->ndomains && !inside_domain(sess, req->uri)) { return NULL; } /* Increase the nonce-count */ if (sess->qop != auth_qop_none) { sess->nonce_count++; ne_snprintf(nc_value, 9, "%08x", sess->nonce_count); } /* Calculate H(A2). */ a2 = ne_md5_create_ctx(); ne_md5_process_bytes(req->method, strlen(req->method), a2); ne_md5_process_bytes(":", 1, a2); ne_md5_process_bytes(req->uri, strlen(req->uri), a2); ne_md5_finish_ascii(a2, a2_md5_ascii); ne_md5_destroy_ctx(a2); NE_DEBUG(NE_DBG_HTTPAUTH, "auth: H(A2): %s\n", a2_md5_ascii); /* Now, calculation of the Request-Digest. * The first section is the regardless of qop value * H(A1) ":" unq(nonce-value) ":" */ rdig = ne_md5_create_ctx(); /* Use the calculated H(A1) */ ne_md5_process_bytes(sess->h_a1, 32, rdig); ne_md5_process_bytes(":", 1, rdig); ne_md5_process_bytes(sess->nonce, strlen(sess->nonce), rdig); ne_md5_process_bytes(":", 1, rdig); if (sess->qop != auth_qop_none) { /* Add on: * nc-value ":" unq(cnonce-value) ":" unq(qop-value) ":" */ ne_md5_process_bytes(nc_value, 8, rdig); ne_md5_process_bytes(":", 1, rdig); ne_md5_process_bytes(sess->cnonce, strlen(sess->cnonce), rdig); ne_md5_process_bytes(":", 1, rdig); /* Store a copy of this structure (see note below) */ if (sess->stored_rdig) ne_md5_destroy_ctx(sess->stored_rdig); sess->stored_rdig = ne_md5_dup_ctx(rdig); ne_md5_process_bytes(qop_value, strlen(qop_value), rdig); ne_md5_process_bytes(":", 1, rdig); } /* And finally, H(A2) */ ne_md5_process_bytes(a2_md5_ascii, 32, rdig); ne_md5_finish_ascii(rdig, rdig_md5_ascii); ne_md5_destroy_ctx(rdig); ret = ne_buffer_create(); ne_buffer_concat(ret, "Digest username=\"", sess->username, "\", " "realm=\"", sess->realm, "\", " "nonce=\"", sess->nonce, "\", " "uri=\"", req->uri, "\", " "response=\"", rdig_md5_ascii, "\", " "algorithm=\"", sess->alg == auth_alg_md5 ? "MD5" : "MD5-sess", "\"", NULL); if (sess->opaque != NULL) { ne_buffer_concat(ret, ", opaque=\"", sess->opaque, "\"", NULL); } if (sess->qop != auth_qop_none) { /* Add in cnonce and nc-value fields */ ne_buffer_concat(ret, ", cnonce=\"", sess->cnonce, "\", " "nc=", nc_value, ", " "qop=\"", qop_value, "\"", NULL); } ne_buffer_zappend(ret, "\r\n"); return ne_buffer_finish(ret); } /* Parse line of comma-separated key-value pairs. If 'ischall' == 1, * then also return a leading space-separated token, as *value == * NULL. Otherwise, if return value is 0, *key and *value will be * non-NULL. If return value is non-zero, parsing has ended. If * 'sep' is non-NULL and ischall is 1, the separator character is * written to *sep when a challenge is parsed. */ static int tokenize(char **hdr, char **key, char **value, char *sep, int ischall) { char *pnt = *hdr; enum { BEFORE_EQ, AFTER_EQ, AFTER_EQ_QUOTED } state = BEFORE_EQ; if (**hdr == '\0') return 1; *key = NULL; do { switch (state) { case BEFORE_EQ: if (*pnt == '=') { if (*key == NULL) return -1; *pnt = '\0'; *value = pnt + 1; state = AFTER_EQ; } else if ((*pnt == ' ' || *pnt == ',') && ischall && *key != NULL) { *value = NULL; if (sep) *sep = *pnt; *pnt = '\0'; *hdr = pnt + 1; return 0; } else if (*key == NULL && strchr(" \r\n\t", *pnt) == NULL) { *key = pnt; } break; case AFTER_EQ: if (*pnt == ',') { *pnt = '\0'; *hdr = pnt + 1; return 0; } else if (*pnt == '\"') { state = AFTER_EQ_QUOTED; } break; case AFTER_EQ_QUOTED: if (*pnt == '\"') { state = AFTER_EQ; } break; } } while (*++pnt != '\0'); if (state == BEFORE_EQ && ischall && *key != NULL) { *value = NULL; if (sep) *sep = '\0'; } *hdr = pnt; /* End of string: */ return 0; } /* Pass this the value of the 'Authentication-Info:' header field, if * one is received. * Returns: * 0 if it gives a valid authentication for the server * non-zero otherwise (don't believe the response in this case!). */ static int verify_digest_response(struct auth_request *req, auth_session *sess, const char *value) { char *hdr, *pnt, *key, *val; auth_qop qop = auth_qop_none; char *nextnonce, *rspauth, *cnonce, *nc, *qop_value; unsigned int nonce_count; int ret = NE_OK; nextnonce = rspauth = cnonce = nc = qop_value = NULL; pnt = hdr = ne_strdup(value); NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Got Auth-Info header: %s\n", value); while (tokenize(&pnt, &key, &val, NULL, 0) == 0) { val = ne_shave(val, "\""); if (ne_strcasecmp(key, "qop") == 0) { qop_value = val; if (ne_strcasecmp(val, "auth") == 0) { qop = auth_qop_auth; } else { qop = auth_qop_none; } } else if (ne_strcasecmp(key, "nextnonce") == 0) { nextnonce = val; } else if (ne_strcasecmp(key, "rspauth") == 0) { rspauth = val; } else if (ne_strcasecmp(key, "cnonce") == 0) { cnonce = val; } else if (ne_strcasecmp(key, "nc") == 0) { nc = val; } } if (qop == auth_qop_none) { /* The 2069-style A-I header only has the entity and nextnonce * parameters. */ NE_DEBUG(NE_DBG_HTTPAUTH, "auth: 2069-style A-I header.\n"); } else if (!rspauth || !cnonce || !nc) { ret = NE_ERROR; ne_set_error(sess->sess, _("Digest mutual authentication failure: " "missing parameters")); } else if (strcmp(cnonce, sess->cnonce) != 0) { ret = NE_ERROR; ne_set_error(sess->sess, _("Digest mutual authentication failure: " "client nonce mismatch")); } else if (nc) { char *ptr; errno = 0; nonce_count = strtoul(nc, &ptr, 16); if (*ptr != '\0' || errno) { ret = NE_ERROR; ne_set_error(sess->sess, _("Digest mutual authentication failure: " "could not parse nonce count")); } else if (nonce_count != sess->nonce_count) { ret = NE_ERROR; ne_set_error(sess->sess, _("Digest mutual authentication failure: " "nonce count mismatch (%u not %u)"), nonce_count, sess->nonce_count); } } /* Finally, for qop=auth cases, if everything else is OK, verify * the response-digest field. */ if (qop == auth_qop_auth && ret == NE_OK) { struct ne_md5_ctx *a2; char a2_md5_ascii[33], rdig_md5_ascii[33]; /* Modified H(A2): */ a2 = ne_md5_create_ctx(); ne_md5_process_bytes(":", 1, a2); ne_md5_process_bytes(req->uri, strlen(req->uri), a2); ne_md5_finish_ascii(a2, a2_md5_ascii); ne_md5_destroy_ctx(a2); /* sess->stored_rdig contains digest-so-far of: * H(A1) ":" unq(nonce-value) */ /* Add in qop-value */ ne_md5_process_bytes(qop_value, strlen(qop_value), sess->stored_rdig); ne_md5_process_bytes(":", 1, sess->stored_rdig); /* Digest ":" H(A2) */ ne_md5_process_bytes(a2_md5_ascii, 32, sess->stored_rdig); /* All done */ ne_md5_finish_ascii(sess->stored_rdig, rdig_md5_ascii); ne_md5_destroy_ctx(sess->stored_rdig); sess->stored_rdig = NULL; /* And... do they match? */ ret = ne_strcasecmp(rdig_md5_ascii, rspauth) == 0 ? NE_OK : NE_ERROR; NE_DEBUG(NE_DBG_HTTPAUTH, "auth: response-digest match: %s " "(expected [%s] vs actual [%s])\n", ret == NE_OK ? "yes" : "no", rdig_md5_ascii, rspauth); if (ret) { ne_set_error(sess->sess, _("Digest mutual authentication failure: " "request-digest mismatch")); } } /* Check for a nextnonce */ if (nextnonce != NULL) { NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Found nextnonce of [%s].\n", nextnonce); ne_free(sess->nonce); sess->nonce = ne_strdup(nextnonce); sess->nonce_count = 0; } ne_free(hdr); return ret; } static const struct auth_protocol protocols[] = { { NE_AUTH_BASIC, 10, "Basic", basic_challenge, request_basic, NULL, 0 }, { NE_AUTH_DIGEST, 20, "Digest", digest_challenge, request_digest, verify_digest_response, 0 }, #ifdef HAVE_GSSAPI { NE_AUTH_NEGOTIATE, 30, "Negotiate", negotiate_challenge, request_negotiate, verify_negotiate_response, AUTH_FLAG_OPAQUE_PARAM|AUTH_FLAG_VERIFY_NON40x|AUTH_FLAG_CONN_AUTH }, #endif #ifdef HAVE_SSPI { NE_AUTH_NEGOTIATE, 30, "NTLM", sspi_challenge, request_sspi, NULL, AUTH_FLAG_OPAQUE_PARAM|AUTH_FLAG_VERIFY_NON40x|AUTH_FLAG_CONN_AUTH }, { NE_AUTH_NEGOTIATE, 30, "Negotiate", sspi_challenge, request_sspi, NULL, AUTH_FLAG_OPAQUE_PARAM|AUTH_FLAG_VERIFY_NON40x|AUTH_FLAG_CONN_AUTH }, #endif { 0 } }; /* Insert a new auth challenge for protocol 'proto' in list of * challenges 'list'. The challenge list is kept in sorted order of * strength, with highest strength first. */ static struct auth_challenge *insert_challenge(struct auth_challenge **list, const struct auth_protocol *proto) { struct auth_challenge *ret = ne_calloc(sizeof *ret); struct auth_challenge *chall, *prev; for (chall = *list, prev = NULL; chall != NULL; prev = chall, chall = chall->next) { if (proto->strength > chall->protocol->strength) { break; } } if (prev) { ret->next = prev->next; prev->next = ret; } else { ret->next = *list; *list = ret; } ret->protocol = proto; return ret; } static void challenge_error(ne_buffer **errbuf, const char *fmt, ...) { char err[128]; va_list ap; size_t len; va_start(ap, fmt); len = ne_vsnprintf(err, sizeof err, fmt, ap); va_end(ap); if (*errbuf == NULL) { *errbuf = ne_buffer_create(); ne_buffer_append(*errbuf, err, len); } else { ne_buffer_concat(*errbuf, ", ", err, NULL); } } /* Passed the value of a "(Proxy,WWW)-Authenticate: " header field. * Returns 0 if valid challenge was accepted; non-zero if no valid * challenge was found. */ static int auth_challenge(auth_session *sess, int attempt, const char *value) { char *pnt, *key, *val, *hdr, sep; struct auth_challenge *chall = NULL, *challenges = NULL; ne_buffer *errmsg = NULL; pnt = hdr = ne_strdup(value); /* The header value may be made up of one or more challenges. We * split it down into attribute-value pairs, then search for * schemes in the pair keys. */ while (!tokenize(&pnt, &key, &val, &sep, 1)) { if (val == NULL) { const struct auth_protocol *proto = NULL; struct auth_handler *hdl; size_t n; for (hdl = sess->handlers; hdl; hdl = hdl->next) { for (n = 0; protocols[n].id; n++) { if (protocols[n].id & hdl->protomask && ne_strcasecmp(key, protocols[n].name) == 0) { proto = &protocols[n]; break; } } if (proto) break; } if (proto == NULL) { /* Ignore this challenge. */ chall = NULL; challenge_error(&errmsg, _("ignored %s challenge"), key); continue; } NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Got '%s' challenge.\n", proto->name); chall = insert_challenge(&challenges, proto); chall->handler = hdl; if ((proto->flags & AUTH_FLAG_OPAQUE_PARAM) && sep == ' ') { /* Cope with the fact that the unquoted base64 * paramater token doesn't match the 2617 auth-param * grammar: */ chall->opaque = ne_shave(ne_token(&pnt, ','), " \t"); NE_DEBUG(NE_DBG_HTTPAUTH, "auth: %s opaque parameter '%s'\n", proto->name, chall->opaque); if (!pnt) break; /* stop parsing at end-of-string. */ } continue; } else if (chall == NULL) { /* Ignore pairs for an unknown challenge. */ NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Ignored parameter: %s = %s\n", key, val); continue; } /* Strip quotes off value. */ val = ne_shave(val, "\"'"); if (ne_strcasecmp(key, "realm") == 0) { chall->realm = val; } else if (ne_strcasecmp(key, "nonce") == 0) { chall->nonce = val; } else if (ne_strcasecmp(key, "opaque") == 0) { chall->opaque = val; } else if (ne_strcasecmp(key, "stale") == 0) { /* Truth value */ chall->stale = (ne_strcasecmp(val, "true") == 0); } else if (ne_strcasecmp(key, "algorithm") == 0) { if (ne_strcasecmp(val, "md5") == 0) { chall->alg = auth_alg_md5; } else if (ne_strcasecmp(val, "md5-sess") == 0) { chall->alg = auth_alg_md5_sess; } else { chall->alg = auth_alg_unknown; } } else if (ne_strcasecmp(key, "qop") == 0) { /* iterate over each token in the value */ do { const char *tok = ne_shave(ne_token(&val, ','), " \t"); if (ne_strcasecmp(tok, "auth") == 0) { chall->qop_auth = 1; } } while (val); chall->got_qop = chall->qop_auth; } else if (ne_strcasecmp(key, "domain") == 0) { chall->domain = val; } } sess->protocol = NULL; /* Iterate through the challenge list (which is sorted from * strongest to weakest) attempting to accept each one. */ for (chall = challenges; chall != NULL; chall = chall->next) { NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Trying %s challenge...\n", chall->protocol->name); if (chall->protocol->challenge(sess, attempt, chall, &errmsg) == 0) { NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Accepted %s challenge.\n", chall->protocol->name); sess->protocol = chall->protocol; break; } } if (!sess->protocol) { NE_DEBUG(NE_DBG_HTTPAUTH, "auth: No challenges accepted.\n"); ne_set_error(sess->sess, _(sess->spec->error_noauth), errmsg ? errmsg->data : _("could not parse challenge")); } while (challenges != NULL) { chall = challenges->next; ne_free(challenges); challenges = chall; } ne_free(hdr); if (errmsg) ne_buffer_destroy(errmsg); return !(sess->protocol != NULL); } static void ah_create(ne_request *req, void *session, const char *method, const char *uri) { auth_session *sess = session; int is_connect = strcmp(method, "CONNECT") == 0; if (sess->context == AUTH_ANY || (is_connect && sess->context == AUTH_CONNECT) || (!is_connect && sess->context == AUTH_NOTCONNECT)) { struct auth_request *areq = ne_calloc(sizeof *areq); struct auth_handler *hdl; NE_DEBUG(NE_DBG_HTTPAUTH, "ah_create, for %s\n", sess->spec->resp_hdr); areq->method = method; areq->uri = uri; areq->request = req; ne_set_request_private(req, sess->spec->id, areq); /* For each new request, reset the attempt counter in every * registered handler. */ for (hdl = sess->handlers; hdl; hdl = hdl->next) { hdl->attempt = 0; } } } static void ah_pre_send(ne_request *r, void *cookie, ne_buffer *request) { auth_session *sess = cookie; struct auth_request *req = ne_get_request_private(r, sess->spec->id); if (sess->protocol && req) { char *value; NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Sending '%s' response.\n", sess->protocol->name); value = sess->protocol->response(sess, req); if (value != NULL) { ne_buffer_concat(request, sess->spec->req_hdr, ": ", value, NULL); ne_free(value); } } } static int ah_post_send(ne_request *req, void *cookie, const ne_status *status) { auth_session *sess = cookie; struct auth_request *areq = ne_get_request_private(req, sess->spec->id); const char *auth_hdr, *auth_info_hdr; int ret = NE_OK; if (!areq) return NE_OK; auth_hdr = ne_get_response_header(req, sess->spec->resp_hdr); auth_info_hdr = ne_get_response_header(req, sess->spec->resp_info_hdr); if (sess->context == AUTH_CONNECT && status->code == 401 && !auth_hdr) { /* Some broken proxies issue a 401 as a proxy auth challenge * to a CONNECT request; handle this here. */ auth_hdr = ne_get_response_header(req, "WWW-Authenticate"); auth_info_hdr = NULL; } #ifdef HAVE_GSSAPI /* whatever happens: forget the GSSAPI token cached thus far */ if (sess->gssapi_token) { ne_free(sess->gssapi_token); sess->gssapi_token = NULL; } #endif NE_DEBUG(NE_DBG_HTTPAUTH, "ah_post_send (#%d), code is %d (want %d), %s is %s\n", areq->attempt, status->code, sess->spec->status_code, sess->spec->resp_hdr, auth_hdr ? auth_hdr : "(none)"); if (auth_info_hdr && sess->protocol && sess->protocol->verify && (sess->protocol->flags & AUTH_FLAG_VERIFY_NON40x) == 0) { ret = sess->protocol->verify(areq, sess, auth_info_hdr); } else if (sess->protocol && sess->protocol->verify && (sess->protocol->flags & AUTH_FLAG_VERIFY_NON40x) && (status->klass == 2 || status->klass == 3) && auth_hdr) { ret = sess->protocol->verify(areq, sess, auth_hdr); } else if ((status->code == sess->spec->status_code || (status->code == 401 && sess->context == AUTH_CONNECT)) && auth_hdr) { /* note above: allow a 401 in response to a CONNECT request * from a proxy since some buggy proxies send that. */ NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Got challenge (code %d).\n", status->code); if (!auth_challenge(sess, areq->attempt++, auth_hdr)) { ret = NE_RETRY; } else { clean_session(sess); ret = sess->spec->fail_code; } /* Set or clear the conn-auth flag according to whether this * was an accepted challenge for a borked protocol. */ ne_set_session_flag(sess->sess, NE_SESSFLAG_CONNAUTH, sess->protocol && (sess->protocol->flags & AUTH_FLAG_CONN_AUTH)); } #ifdef HAVE_SSPI else if (sess->sspi_context) { ne_sspi_clear_context(sess->sspi_context); } #endif return ret; } static void ah_destroy(ne_request *req, void *session) { auth_session *sess = session; struct auth_request *areq = ne_get_request_private(req, sess->spec->id); if (areq) { ne_free(areq); } } static void free_auth(void *cookie) { auth_session *sess = cookie; struct auth_handler *hdl, *next; #ifdef HAVE_GSSAPI if (sess->gssname != GSS_C_NO_NAME) { unsigned int major; gss_release_name(&major, &sess->gssname); } #endif for (hdl = sess->handlers; hdl; hdl = next) { next = hdl->next; ne_free(hdl); } clean_session(sess); ne_free(sess); } static void auth_register(ne_session *sess, int isproxy, unsigned protomask, const struct auth_class *ahc, const char *id, ne_auth_creds creds, void *userdata) { auth_session *ahs; struct auth_handler **hdl; /* Handle the _ALL and _DEFAULT protocol masks: */ if (protomask == NE_AUTH_ALL) { protomask |= NE_AUTH_BASIC | NE_AUTH_DIGEST | NE_AUTH_NEGOTIATE; } else if (protomask == NE_AUTH_DEFAULT) { protomask |= NE_AUTH_BASIC | NE_AUTH_DIGEST; if (strcmp(ne_get_scheme(sess), "https") == 0 || isproxy) { protomask |= NE_AUTH_NEGOTIATE; } } ahs = ne_get_session_private(sess, id); if (ahs == NULL) { ahs = ne_calloc(sizeof *ahs); ahs->sess = sess; ahs->spec = ahc; if (strcmp(ne_get_scheme(sess), "https") == 0) { ahs->context = isproxy ? AUTH_CONNECT : AUTH_NOTCONNECT; } else { ahs->context = AUTH_ANY; } /* Register hooks */ ne_hook_create_request(sess, ah_create, ahs); ne_hook_pre_send(sess, ah_pre_send, ahs); ne_hook_post_send(sess, ah_post_send, ahs); ne_hook_destroy_request(sess, ah_destroy, ahs); ne_hook_destroy_session(sess, free_auth, ahs); ne_set_session_private(sess, id, ahs); } #ifdef HAVE_GSSAPI if (protomask & NE_AUTH_NEGOTIATE && ahs->gssname == GSS_C_NO_NAME) { ne_uri uri = {0}; if (isproxy) ne_fill_proxy_uri(sess, &uri); else ne_fill_server_uri(sess, &uri); get_gss_name(&ahs->gssname, uri.host); ne_uri_free(&uri); } #endif /* Find the end of the handler list, and add a new one. */ hdl = &ahs->handlers; while (*hdl) hdl = &(*hdl)->next; *hdl = ne_malloc(sizeof **hdl); (*hdl)->protomask = protomask; (*hdl)->creds = creds; (*hdl)->userdata = userdata; (*hdl)->next = NULL; (*hdl)->attempt = 0; } void ne_set_server_auth(ne_session *sess, ne_auth_creds creds, void *userdata) { auth_register(sess, 0, NE_AUTH_DEFAULT, &ah_server_class, HOOK_SERVER_ID, creds, userdata); } void ne_set_proxy_auth(ne_session *sess, ne_auth_creds creds, void *userdata) { auth_register(sess, 1, NE_AUTH_DEFAULT, &ah_proxy_class, HOOK_PROXY_ID, creds, userdata); } void ne_add_server_auth(ne_session *sess, unsigned protocol, ne_auth_creds creds, void *userdata) { auth_register(sess, 0, protocol, &ah_server_class, HOOK_SERVER_ID, creds, userdata); } void ne_add_proxy_auth(ne_session *sess, unsigned protocol, ne_auth_creds creds, void *userdata) { auth_register(sess, 1, protocol, &ah_proxy_class, HOOK_PROXY_ID, creds, userdata); } void ne_forget_auth(ne_session *sess) { auth_session *as; if ((as = ne_get_session_private(sess, HOOK_SERVER_ID)) != NULL) clean_session(as); if ((as = ne_get_session_private(sess, HOOK_PROXY_ID)) != NULL) clean_session(as); } sitecopy-0.16.6/lib/neon/ne_redirect.h0000664000076400007640000000275310646611303015741 0ustar joejoe/* HTTP-redirect support Copyright (C) 1999-2002, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_REDIRECT_H #define NE_REDIRECT_H #include "ne_request.h" NE_BEGIN_DECLS /* Register redirect handling for the session: if a valid redirect * (30x) response is given for any request in this session, the * request will fail with the NE_REDIRECT code, and the destination of * the redirect can be retrieved using ne_redirect_location(). */ void ne_redirect_register(ne_session *sess); /* Returns location of last redirect for the session. Returns NULL if * no redirect has been encountered for given session, or the last * redirect encountered could not be parsed. */ const ne_uri *ne_redirect_location(ne_session *sess); NE_END_DECLS #endif /* NE_REDIRECT_H */ sitecopy-0.16.6/lib/neon/README0000664000076400007640000000070610127573646014174 0ustar joejoe This is the source directory of the 'neon' HTTP/WebDAV client library, which can be bundled inside other packages. For the complete neon package, see: http://www.webdav.org/neon/ This source directory may be distributed and/or modified under the terms of the GNU Library General Public License, as given in COPYING.LIB. Please send questions, bug reports, feature requests, etc, regarding the neon library, to the mailing list at: neon@webdav.org sitecopy-0.16.6/lib/neon/ne_request.h0000664000076400007640000003411310753065706015634 0ustar joejoe/* HTTP Request Handling Copyright (C) 1999-2006, 2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_REQUEST_H #define NE_REQUEST_H #include "ne_utils.h" /* For ne_status */ #include "ne_string.h" /* For ne_buffer */ #include "ne_session.h" NE_BEGIN_DECLS #define NE_OK (0) /* Success */ #define NE_ERROR (1) /* Generic error; use ne_get_error(session) for message */ #define NE_LOOKUP (2) /* Server or proxy hostname lookup failed */ #define NE_AUTH (3) /* User authentication failed on server */ #define NE_PROXYAUTH (4) /* User authentication failed on proxy */ #define NE_CONNECT (5) /* Could not connect to server */ #define NE_TIMEOUT (6) /* Connection timed out */ #define NE_FAILED (7) /* The precondition failed */ #define NE_RETRY (8) /* Retry request (ne_end_request ONLY) */ #define NE_REDIRECT (9) /* See ne_redirect.h */ /* Opaque object representing a single HTTP request. */ typedef struct ne_request_s ne_request; /***** Request Handling *****/ /* Create a request in session 'sess', with given method and path. * 'path' must conform to the 'abs_path' grammar in RFC2396, with an * optional "? query" part, and MUST be URI-escaped by the caller. */ ne_request *ne_request_create(ne_session *sess, const char *method, const char *path); /* The request body will be taken from 'size' bytes of 'buffer'. */ void ne_set_request_body_buffer(ne_request *req, const char *buffer, size_t size); /* The request body will be taken from 'length' bytes read from the * file descriptor 'fd', starting from file offset 'offset'. */ void ne_set_request_body_fd(ne_request *req, int fd, ne_off_t offset, ne_off_t length); /* "Pull"-based request body provider: a callback which is invoked to * provide blocks of request body on demand. * * Before each time the body is provided, the callback will be called * once with buflen == 0. The body may have to be provided >1 time * per request (for authentication retries etc.). * * For a call with buflen == 0, the callback must return zero on success * or non-zero on error; the session error string must be set on error. * For a call with buflen > 0, the callback must return: * <0 : error, abort request; session error string must be set. * 0 : ignore 'buffer' contents, end of body. * 0 < x <= buflen : buffer contains x bytes of body data. */ typedef ssize_t (*ne_provide_body)(void *userdata, char *buffer, size_t buflen); /* Install a callback which is invoked as needed to provide the * request body, a block at a time. The total size of the request * body is 'length'; the callback must ensure that it returns no more * than 'length' bytes in total. */ void ne_set_request_body_provider(ne_request *req, ne_off_t length, ne_provide_body provider, void *userdata); /* Handling response bodies; two callbacks must be provided: * * 1) 'acceptance' callback: determines whether you want to handle the * response body given the response-status information, e.g., if you * only want 2xx responses, say so here. * * 2) 'reader' callback: passed blocks of the response-body as they * arrive, if the acceptance callback returned non-zero. */ /* 'acceptance' callback type. Return non-zero to accept the response, * else zero to ignore it. */ typedef int (*ne_accept_response)(void *userdata, ne_request *req, const ne_status *st); /* An 'acceptance' callback which only accepts 2xx-class responses. * Ignores userdata. */ int ne_accept_2xx(void *userdata, ne_request *req, const ne_status *st); /* An acceptance callback which accepts all responses. Ignores * userdata. */ int ne_accept_always(void *userdata, ne_request *req, const ne_status *st); /* Callback for reading a block of data. Returns zero on success, or * non-zero on error. If returning an error, the response will be * aborted and the callback will not be invoked again. The request * dispatch (or ne_read_response_block call) will fail with NE_ERROR; * the session error string should have been set by the callback. */ typedef int (*ne_block_reader)(void *userdata, const char *buf, size_t len); /* Add a response reader for the given request, with the given * acceptance function. userdata is passed as the first argument to * the acceptance + reader callbacks. * * The acceptance callback is called once each time the request is * sent: it may be sent >1 time because of authentication retries etc. * For each time the acceptance callback is called, if it returns * non-zero, blocks of the response body will be passed to the reader * callback as the response is read. After all the response body has * been read, the callback will be called with a 'len' argument of * zero. */ void ne_add_response_body_reader(ne_request *req, ne_accept_response accpt, ne_block_reader reader, void *userdata); /* Retrieve the value of the response header field with given name; * returns NULL if no response header with given name was found. The * return value is valid only until the next call to either * ne_request_destroy or ne_begin_request for this request. */ const char *ne_get_response_header(ne_request *req, const char *name); /* Iterator interface for response headers: if passed a NULL cursor, * returns the first header; if passed a non-NULL cursor pointer, * returns the next header. The return value is a cursor pointer: if * it is non-NULL, *name and *value are set to the name and value of * the header field. If the return value is NULL, no more headers are * found, *name and *value are undefined. * * The order in which response headers is returned is undefined. Both * the cursor and name/value pointers are valid only until the next * call to either ne_request_destroy or ne_begin_request for this * request. */ void *ne_response_header_iterate(ne_request *req, void *cursor, const char **name, const char **value); /* Adds a header to the request with given name and value. */ void ne_add_request_header(ne_request *req, const char *name, const char *value); /* Adds a header to the request with given name, using printf-like * format arguments for the value. */ void ne_print_request_header(ne_request *req, const char *name, const char *format, ...) ne_attribute((format(printf, 3, 4))); /* ne_request_dispatch: Sends the given request, and reads the * response. Returns: * - NE_OK if the request was sent and response read successfully * - NE_AUTH, NE_PROXYAUTH for a server or proxy server authentication error * - NE_CONNECT if connection could not be established * - NE_TIMEOUT if an timeout occurred sending or reading from the server * - NE_ERROR for other fatal dispatch errors * On any error, the session error string is set. On success or * authentication error, the actual response-status can be retrieved using * ne_get_status(). */ int ne_request_dispatch(ne_request *req); /* Returns a pointer to the response status information for the given * request; pointer is valid until request object is destroyed. */ const ne_status *ne_get_status(const ne_request *req) ne_attribute((const)); /* Returns pointer to session associated with request. */ ne_session *ne_get_session(const ne_request *req) ne_attribute((const)); /* Destroy memory associated with request pointer */ void ne_request_destroy(ne_request *req); /* "Caller-pulls" request interface. This is an ALTERNATIVE interface * to ne_request_dispatch: either use that, or do all this yourself: * * caller must call: * 1. ne_begin_request (fail if returns non-NE_OK) * 2. while(ne_read_response_block(...) > 0) ... loop ...; * (fail if ne_read_response_block returns <0) * 3. ne_end_request * * ne_end_request and ne_begin_request both return an NE_* code; if * ne_end_request returns NE_RETRY, you must restart the loop from (1) * above. */ int ne_begin_request(ne_request *req); int ne_end_request(ne_request *req); /* Read a block of the response into the passed buffer of size 'buflen'. * * Returns: * <0 - error, stop reading. * 0 - end of response * >0 - number of bytes read into buffer. */ ssize_t ne_read_response_block(ne_request *req, char *buffer, size_t buflen); /* Read response blocks until end of response; exactly equivalent to * calling ne_read_response_block() until it returns 0. Returns * non-zero on error. */ int ne_discard_response(ne_request *req); /* Read response blocks until end of response, writing content to the * given file descriptor. Returns NE_ERROR on error. */ int ne_read_response_to_fd(ne_request *req, int fd); /* Defined request flags: */ typedef enum ne_request_flag_e { NE_REQFLAG_EXPECT100 = 0, /* enable this flag to enable use of the * "Expect: 100-continue" for the * request. */ NE_REQFLAG_IDEMPOTENT, /* disable this flag if the request uses a * non-idempotent method such as POST. */ NE_REQFLAG_LAST /* enum sentinel value */ } ne_request_flag; /* Set a new value for a particular request flag. */ void ne_set_request_flag(ne_request *req, ne_request_flag flag, int value); /* Return 0 if the given flag is not set, >0 it is set, or -1 if the * flag is not supported. */ int ne_get_request_flag(ne_request *req, ne_request_flag flag); /**** Request hooks handling *****/ typedef void (*ne_free_hooks)(void *cookie); /* Hook called when a request is created; passed the request method, * and the string used as the Request-URI (note that this may be a * absolute URI if a proxy is in use, an absolute path, a "*", etc). * A create_request hook is called exactly once per request. */ typedef void (*ne_create_request_fn)(ne_request *req, void *userdata, const char *method, const char *requri); void ne_hook_create_request(ne_session *sess, ne_create_request_fn fn, void *userdata); /* Hook called before the request is sent. 'header' is the raw HTTP * header before the trailing CRLF is added; more headers can be added * here. A pre_send hook may be called >1 time per request if the * request is retried due to a post_send hook returning NE_RETRY. */ typedef void (*ne_pre_send_fn)(ne_request *req, void *userdata, ne_buffer *header); void ne_hook_pre_send(ne_session *sess, ne_pre_send_fn fn, void *userdata); /* Hook called directly after the response headers have been read, but * before the resposnse body has been read. 'status' is the response * status-code. A post_header hook may be called >1 time per request * if the request is retried due to a post_send hook returning * NE_RETRY. */ typedef void (*ne_post_headers_fn)(ne_request *req, void *userdata, const ne_status *status); void ne_hook_post_headers(ne_session *sess, ne_post_headers_fn fn, void *userdata); /* Hook called after the request is dispatched (request sent, and * the entire response read). If an error occurred reading the response, * this hook will not run. May return: * NE_OK everything is okay * NE_RETRY try sending the request again. * anything else signifies an error, and the request is failed. The return * code is passed back the _dispatch caller, so the session error must * also be set appropriately (ne_set_error). */ typedef int (*ne_post_send_fn)(ne_request *req, void *userdata, const ne_status *status); void ne_hook_post_send(ne_session *sess, ne_post_send_fn fn, void *userdata); /* Hook called when the function is destroyed. */ typedef void (*ne_destroy_req_fn)(ne_request *req, void *userdata); void ne_hook_destroy_request(ne_session *sess, ne_destroy_req_fn fn, void *userdata); typedef void (*ne_destroy_sess_fn)(void *userdata); /* Hook called when the session is about to be destroyed. */ void ne_hook_destroy_session(ne_session *sess, ne_destroy_sess_fn fn, void *userdata); typedef void (*ne_close_conn_fn)(void *userdata); /* Hook called when the connection is closed; note that this hook * may be called *AFTER* the destroy_session hook. */ void ne_hook_close_conn(ne_session *sess, ne_close_conn_fn fn, void *userdata); /* The ne_unhook_* functions remove a hook registered with the given * session. If a hook is found which was registered with a given * function 'fn', and userdata pointer 'userdata', then it will be * removed from the hooks list. * * It is unsafe to use any of these functions from a hook function to * unregister itself, except for ne_unhook_destroy_request. */ void ne_unhook_create_request(ne_session *sess, ne_create_request_fn fn, void *userdata); void ne_unhook_pre_send(ne_session *sess, ne_pre_send_fn fn, void *userdata); void ne_unhook_post_headers(ne_session *sess, ne_post_headers_fn fn, void *userdata); void ne_unhook_post_send(ne_session *sess, ne_post_send_fn fn, void *userdata); void ne_unhook_destroy_request(ne_session *sess, ne_destroy_req_fn fn, void *userdata); void ne_unhook_destroy_session(ne_session *sess, ne_destroy_sess_fn fn, void *userdata); void ne_unhook_close_conn(ne_session *sess, ne_close_conn_fn fn, void *userdata); /* Store an opaque context for the request, 'priv' is returned by a * call to ne_request_get_private with the same ID. */ void ne_set_request_private(ne_request *req, const char *id, void *priv); void *ne_get_request_private(ne_request *req, const char *id); NE_END_DECLS #endif /* NE_REQUEST_H */ sitecopy-0.16.6/lib/neon/ne_string.c0000664000076400007640000003370010763234340015437 0ustar joejoe/* String utility functions Copyright (C) 1999-2007, Joe Orton strcasecmp/strncasecmp implementations are: Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include "ne_alloc.h" #include "ne_string.h" char *ne_token(char **str, char separator) { char *ret = *str, *pnt = strchr(*str, separator); if (pnt) { *pnt = '\0'; *str = pnt + 1; } else { /* no separator found: return end of string. */ *str = NULL; } return ret; } char *ne_qtoken(char **str, char separator, const char *quotes) { char *pnt, *ret = NULL; for (pnt = *str; *pnt != '\0'; pnt++) { char *quot = strchr(quotes, *pnt); if (quot) { char *qclose = strchr(pnt+1, *quot); if (!qclose) { /* no closing quote: invalid string. */ return NULL; } pnt = qclose; } else if (*pnt == separator) { /* found end of token. */ *pnt = '\0'; ret = *str; *str = pnt + 1; return ret; } } /* no separator found: return end of string. */ ret = *str; *str = NULL; return ret; } char *ne_shave(char *str, const char *whitespace) { char *pnt, *ret = str; while (*ret != '\0' && strchr(whitespace, *ret) != NULL) { ret++; } /* pnt points at the NUL terminator. */ pnt = &ret[strlen(ret)]; while (pnt > ret && strchr(whitespace, *(pnt-1)) != NULL) { pnt--; } *pnt = '\0'; return ret; } void ne_buffer_clear(ne_buffer *buf) { memset(buf->data, 0, buf->length); buf->used = 1; } /* Grows for given size, returns 0 on success, -1 on error. */ void ne_buffer_grow(ne_buffer *buf, size_t newsize) { #define NE_BUFFER_GROWTH 512 if (newsize > buf->length) { /* If it's not big enough already... */ buf->length = ((newsize / NE_BUFFER_GROWTH) + 1) * NE_BUFFER_GROWTH; /* Reallocate bigger buffer */ buf->data = ne_realloc(buf->data, buf->length); } } static size_t count_concat(va_list *ap) { size_t total = 0; char *next; while ((next = va_arg(*ap, char *)) != NULL) total += strlen(next); return total; } static void do_concat(char *str, va_list *ap) { char *next; while ((next = va_arg(*ap, char *)) != NULL) { #ifdef HAVE_STPCPY str = stpcpy(str, next); #else size_t len = strlen(next); memcpy(str, next, len); str += len; #endif } } void ne_buffer_concat(ne_buffer *buf, ...) { va_list ap; ssize_t total; va_start(ap, buf); total = buf->used + count_concat(&ap); va_end(ap); /* Grow the buffer */ ne_buffer_grow(buf, total); va_start(ap, buf); do_concat(buf->data + buf->used - 1, &ap); va_end(ap); buf->used = total; buf->data[total - 1] = '\0'; } char *ne_concat(const char *str, ...) { va_list ap; size_t total, slen = strlen(str); char *ret; va_start(ap, str); total = slen + count_concat(&ap); va_end(ap); ret = memcpy(ne_malloc(total + 1), str, slen); va_start(ap, str); do_concat(ret + slen, &ap); va_end(ap); ret[total] = '\0'; return ret; } /* Append zero-terminated string... returns 0 on success or -1 on * realloc failure. */ void ne_buffer_zappend(ne_buffer *buf, const char *str) { ne_buffer_append(buf, str, strlen(str)); } void ne_buffer_append(ne_buffer *buf, const char *data, size_t len) { ne_buffer_grow(buf, buf->used + len); memcpy(buf->data + buf->used - 1, data, len); buf->used += len; buf->data[buf->used - 1] = '\0'; } size_t ne_buffer_snprintf(ne_buffer *buf, size_t max, const char *fmt, ...) { va_list ap; size_t ret; ne_buffer_grow(buf, buf->used + max); va_start(ap, fmt); ret = ne_vsnprintf(buf->data + buf->used - 1, max, fmt, ap); va_end(ap); buf->used += ret; return ret; } ne_buffer *ne_buffer_create(void) { return ne_buffer_ncreate(512); } ne_buffer *ne_buffer_ncreate(size_t s) { ne_buffer *buf = ne_malloc(sizeof(*buf)); buf->data = ne_malloc(s); buf->data[0] = '\0'; buf->length = s; buf->used = 1; return buf; } void ne_buffer_destroy(ne_buffer *buf) { ne_free(buf->data); ne_free(buf); } char *ne_buffer_finish(ne_buffer *buf) { char *ret = buf->data; ne_free(buf); return ret; } void ne_buffer_altered(ne_buffer *buf) { buf->used = strlen(buf->data) + 1; } static const char b64_alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/="; char *ne_base64(const unsigned char *text, size_t inlen) { /* The tricky thing about this is doing the padding at the end, * doing the bit manipulation requires a bit of concentration only */ char *buffer, *point; size_t outlen; /* Use 'buffer' to store the output. Work out how big it should be... * This must be a multiple of 4 bytes */ outlen = (inlen*4)/3; if ((inlen % 3) > 0) /* got to pad */ outlen += 4 - (inlen % 3); buffer = ne_malloc(outlen + 1); /* +1 for the \0 */ /* now do the main stage of conversion, 3 bytes at a time, * leave the trailing bytes (if there are any) for later */ for (point=buffer; inlen>=3; inlen-=3, text+=3) { *(point++) = b64_alphabet[ (*text)>>2 ]; *(point++) = b64_alphabet[ ((*text)<<4 & 0x30) | (*(text+1))>>4 ]; *(point++) = b64_alphabet[ ((*(text+1))<<2 & 0x3c) | (*(text+2))>>6 ]; *(point++) = b64_alphabet[ (*(text+2)) & 0x3f ]; } /* Now deal with the trailing bytes */ if (inlen > 0) { /* We always have one trailing byte */ *(point++) = b64_alphabet[ (*text)>>2 ]; *(point++) = b64_alphabet[ (((*text)<<4 & 0x30) | (inlen==2?(*(text+1))>>4:0)) ]; *(point++) = (inlen==1?'=':b64_alphabet[ (*(text+1))<<2 & 0x3c ]); *(point++) = '='; } /* Null-terminate */ *point = '\0'; return buffer; } /* VALID_B64: fail if 'ch' is not a valid base64 character */ #define VALID_B64(ch) (((ch) >= 'A' && (ch) <= 'Z') || \ ((ch) >= 'a' && (ch) <= 'z') || \ ((ch) >= '0' && (ch) <= '9') || \ (ch) == '/' || (ch) == '+' || (ch) == '=') /* DECODE_B64: decodes a valid base64 character. */ #define DECODE_B64(ch) ((ch) >= 'a' ? ((ch) + 26 - 'a') : \ ((ch) >= 'A' ? ((ch) - 'A') : \ ((ch) >= '0' ? ((ch) + 52 - '0') : \ ((ch) == '+' ? 62 : 63)))) size_t ne_unbase64(const char *data, unsigned char **out) { size_t inlen = strlen(data); unsigned char *outp; const unsigned char *in; if (inlen == 0 || (inlen % 4) != 0) return 0; outp = *out = ne_malloc(inlen * 3 / 4); for (in = (const unsigned char *)data; *in; in += 4) { unsigned int tmp; if (!VALID_B64(in[0]) || !VALID_B64(in[1]) || !VALID_B64(in[2]) || !VALID_B64(in[3]) || in[0] == '=' || in[1] == '=' || (in[2] == '=' && in[3] != '=')) { ne_free(*out); return 0; } tmp = (DECODE_B64(in[0]) & 0x3f) << 18 | (DECODE_B64(in[1]) & 0x3f) << 12; *outp++ = (tmp >> 16) & 0xff; if (in[2] != '=') { tmp |= (DECODE_B64(in[2]) & 0x3f) << 6; *outp++ = (tmp >> 8) & 0xff; if (in[3] != '=') { tmp |= DECODE_B64(in[3]) & 0x3f; *outp++ = tmp & 0xff; } } } return outp - *out; } /* Character map array; array[n] = isprint(n) ? 0x20 : n. Used by * ne_strclean as a locale-independent isprint(). */ static const unsigned char ascii_printable[256] = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }; char *ne_strclean(char *str) { unsigned char *pnt; for (pnt = (unsigned char *)str; *pnt; pnt++) *pnt = (char)ascii_printable[*pnt]; return str; } char *ne_strerror(int errnum, char *buf, size_t buflen) { #ifdef HAVE_STRERROR_R #ifdef STRERROR_R_CHAR_P /* glibc-style strerror_r which may-or-may-not use provided buffer. */ char *ret = strerror_r(errnum, buf, buflen); if (ret != buf) ne_strnzcpy(buf, ret, buflen); #else /* POSIX-style strerror_r: */ char tmp[256]; if (strerror_r(errnum, tmp, sizeof tmp) == 0) ne_strnzcpy(buf, tmp, buflen); else ne_snprintf(buf, buflen, "Unknown error %d", errnum); #endif #else /* no strerror_r: */ ne_strnzcpy(buf, strerror(errnum), buflen); #endif return buf; } /* Wrapper for ne_snprintf. */ size_t ne_snprintf(char *str, size_t size, const char *fmt, ...) { va_list ap; va_start(ap, fmt); #ifdef HAVE_TRIO trio_vsnprintf(str, size, fmt, ap); #else vsnprintf(str, size, fmt, ap); #endif va_end(ap); str[size-1] = '\0'; return strlen(str); } /* Wrapper for ne_vsnprintf. */ size_t ne_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) { #ifdef HAVE_TRIO trio_vsnprintf(str, size, fmt, ap); #else vsnprintf(str, size, fmt, ap); #endif str[size-1] = '\0'; return strlen(str); } /* Locale-independent strcasecmp implementations. */ static const unsigned char ascii_tolower[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; #define TOLOWER(ch) ascii_tolower[ch] const unsigned char *ne_tolower_array(void) { return ascii_tolower; } int ne_strcasecmp(const char *s1, const char *s2) { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; if (p1 == p2) return 0; do { c1 = TOLOWER(*p1++); c2 = TOLOWER(*p2++); if (c1 == '\0') break; } while (c1 == c2); return c1 - c2; } int ne_strncasecmp(const char *s1, const char *s2, size_t n) { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; if (p1 == p2 || n == 0) return 0; do { c1 = TOLOWER(*p1++); c2 = TOLOWER(*p2++); if (c1 == '\0' || c1 != c2) return c1 - c2; } while (--n > 0); return c1 - c2; } sitecopy-0.16.6/lib/neon/ne_uri.h0000664000076400007640000000722710360733130014734 0ustar joejoe/* URI manipulation routines. Copyright (C) 1999-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_URI_H #define NE_URI_H #include "ne_defs.h" NE_BEGIN_DECLS /* Return a copy of a path string with anything other than * "unreserved" and the forward-slash character percent-encoded * according to the URI encoding rules. Returns a malloc-allocated * string and never NULL. */ char *ne_path_escape(const char *path); /* Return a decoded copy of a percent-encoded path string. Returns * malloc-allocated path on success, or NULL if the string contained * any syntactically invalid percent-encoding sequences. */ char *ne_path_unescape(const char *epath); /* Returns malloc-allocated parent of path, or NULL if path has no * parent (such as "/"). */ char *ne_path_parent(const char *path); /* Returns strcmp-like value giving comparison between p1 and p2, * ignoring trailing-slashes. */ int ne_path_compare(const char *p1, const char *p2); /* Returns non-zero if child is a child of parent */ int ne_path_childof(const char *parent, const char *child); /* Returns non-zero if path has a trailing slash character */ int ne_path_has_trailing_slash(const char *path); /* Return the default port for the given scheme, or 0 if none is * known. */ unsigned int ne_uri_defaultport(const char *scheme); typedef struct { char *scheme; char *host, *userinfo; unsigned int port; char *path, *query, *fragment; } ne_uri; /* Parse a URI-reference 'uri' and place parsed components in *parsed. * Returns zero on success, non-zero on parse error. On successful or * error return, all the 'char *' fields of *parsed are either set to * NULL, or point to malloc-allocated NUL-terminated strings. * ne_uri_free can be used to free the structure after use. */ int ne_uri_parse(const char *uri, ne_uri *parsed); /* Turns a URI structure back into a string. The returned string is * malloc-allocated, and must be freed by the caller. */ char *ne_uri_unparse(const ne_uri *uri); /* Resolve a relative URI 'relative', with respect to base URI 'base', * placing the resultant URI in '*result'. On return, all the 'char * *' fields of *result are either set to NULL or point to * malloc-allocated NUL-terminated strings. ne_uri_free can be used * to free the structure after use. Returns 'result'. */ ne_uri *ne_uri_resolve(const ne_uri *base, const ne_uri *relative, ne_uri *result); /* Compares URIs u1 and u2, returns non-zero if they are found to be * non-equal. The sign of the return value is <0 if 'u1' is less than * 'u2', or >0 if 'u2' is greater than 'u1'. */ int ne_uri_cmp(const ne_uri *u1, const ne_uri *u2); /* Copy components of URI 'src' to destination 'dest'. Returns * 'dest'. */ ne_uri *ne_uri_copy(ne_uri *dest, const ne_uri *src); /* Frees any non-NULL fields of parsed URI structure *parsed. All * fields are then zero-initialized. */ void ne_uri_free(ne_uri *parsed); NE_END_DECLS #endif /* NE_URI_H */ sitecopy-0.16.6/lib/neon/ne_props.h0000664000076400007640000002342510400633302015271 0ustar joejoe/* WebDAV Properties manipulation Copyright (C) 1999-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_PROPS_H #define NE_PROPS_H #include "ne_request.h" #include "ne_207.h" NE_BEGIN_DECLS /* There are two interfaces for fetching properties. The first is * 'ne_simple_propfind', which is relatively simple, and easy to use, * but only lets you fetch FLAT properties, i.e. properties which are * just a string of bytes. The complex interface is 'ne_propfind_*', * which is complicated, and hard to use, but lets you parse * structured properties, i.e. properties which have XML content. */ /* The 'ne_simple_propfind' interface. *** * * ne_simple_propfind allows you to fetch a set of properties for a * single resource, or a tree of resources. You set the operation * going by passing these arguments: * * - the session which should be used. * - the URI and the depth of the operation (0, 1, infinite) * - the names of the properties which you want to fetch * - a results callback, and the userdata for the callback. * * For each resource found, the results callback is called, passing * you two things along with the userdata you passed in originally: * * - the URI of the resource (const ne_uri *uri) * - the properties results set (const ne_prop_result_set *results) * */ /* The name of a WebDAV property. 'nspace' may be NULL. */ typedef struct { const char *nspace, *name; } ne_propname; typedef struct ne_prop_result_set_s ne_prop_result_set; /* Get the value of a given property. Will return NULL if there was an * error fetching this property on this resource. Call * ne_propset_result to get the response-status if so. */ const char *ne_propset_value(const ne_prop_result_set *set, const ne_propname *propname); /* Returns the status structure for fetching the given property on * this resource. This function will return NULL if the server did not * return the property (which is a server error). */ const ne_status *ne_propset_status(const ne_prop_result_set *set, const ne_propname *propname); /* Returns the private pointer for the given propset. */ void *ne_propset_private(const ne_prop_result_set *set); /* Return language string of property (may be NULL). */ const char *ne_propset_lang(const ne_prop_result_set *set, const ne_propname *pname); /* ne_propset_iterate iterates over a properties result set, * calling the callback for each property in the set. userdata is * passed as the first argument to the callback. value may be NULL, * indicating an error occurred fetching this property: look at * status for the error in that case. * * If the iterator returns non-zero, ne_propset_iterate will return * immediately with that value. */ typedef int (*ne_propset_iterator)(void *userdata, const ne_propname *pname, const char *value, const ne_status *status); /* Iterate over all the properties in 'set', calling 'iterator' * for each, passing 'userdata' as the first argument to callback. * * Returns: * whatever value iterator returns. */ int ne_propset_iterate(const ne_prop_result_set *set, ne_propset_iterator iterator, void *userdata); /* Callback for handling the results of fetching properties for a * single resource (identified by URI 'uri'). The results are stored * in the result set 'results': use ne_propset_* to examine this * object. */ typedef void (*ne_props_result)(void *userdata, const ne_uri *uri, const ne_prop_result_set *results); /* Fetch properties for a resource (if depth == NE_DEPTH_ZERO), * or a tree of resources (if depth == NE_DEPTH_ONE or _INFINITE). * * Names of the properties required must be given in 'props', * or if props is NULL, *all* properties are fetched. * * 'results' is called for each resource in the response, userdata is * passed as the first argument to the callback. It is important to * note that the callback is called as the response is read off the * socket, so don't do anything silly in it (e.g. sleep(100), or call * any functions which use this session). * * Note that if 'depth' is NE_DEPTH_INFINITY, some servers may refuse * the request. * * Returns NE_*. */ int ne_simple_propfind(ne_session *sess, const char *path, int depth, const ne_propname *props, ne_props_result results, void *userdata); /* The properties of a resource can be manipulated using ne_proppatch. * A single proppatch request may include any number of individual * "set" and "remove" operations, and is defined to have * "all-or-nothing" semantics, so either all the operations succeed, * or none do. */ /* A proppatch operation may either set a property to have a new * value, in which case 'type' must be ne_propset, and 'value' must be * non-NULL; or it can remove a property; in which case 'type' must be * ne_propremove, and 'value' is ignored. In both cases, 'name' must * be set to the name of the property to alter. */ enum ne_proppatch_optype { ne_propset, ne_propremove }; typedef struct { const ne_propname *name; enum ne_proppatch_optype type; const char *value; } ne_proppatch_operation; /* Execute a set of property operations 'ops' on 'path'. 'ops' is an * array terminated by an operation with a NULL 'name' field. Returns * NE_*. */ int ne_proppatch(ne_session *sess, const char *path, const ne_proppatch_operation *ops); /* Retrieve property names for the resources at 'path'. 'results' * callback is called for each resource. Use 'ne_propset_iterate' on * the passed results object to retrieve the list of property names. * */ int ne_propnames(ne_session *sess, const char *path, int depth, ne_props_result results, void *userdata); /* The complex, you-do-all-the-work, property fetch interface: */ struct ne_propfind_handler_s; typedef struct ne_propfind_handler_s ne_propfind_handler; /* Retrieve the 'private' pointer for the current propset for the * given handler, as returned by the ne_props_create_complex callback * installed using 'ne_propfind_set_private'. If this callback was * not registered, this function will return NULL. */ void *ne_propfind_current_private(ne_propfind_handler *handler); /* Create a PROPFIND handler, for the given resource or set of * resources. * * Depth must be one of NE_DEPTH_*. */ ne_propfind_handler * ne_propfind_create(ne_session *sess, const char *path, int depth); /* Return the XML parser for the given handler (only need if you want * to handle complex properties). */ ne_xml_parser *ne_propfind_get_parser(ne_propfind_handler *handler); /* This interface reserves the state integer range 'x' where 0 < x * and x < NE_PROPS_STATE_TOP. */ #define NE_PROPS_STATE_TOP (NE_207_STATE_TOP + 100) /* Return the request object for the given handler. You MUST NOT use * ne_set_request_body_* on this request object. (this call is only * needed if for instance, you want to add extra headers to the * PROPFIND request). The result of using the request pointer after * ne_propfind_destroy(handler) has been called is undefined. */ ne_request *ne_propfind_get_request(ne_propfind_handler *handler); /* A "complex property" has a value which is structured XML. To handle * complex properties, you must set up and register an XML handler * which will understand the elements which make up such properties. * The handler must be registered with the parser returned by * 'ne_propfind_get_parser'. * * To store the parsed value of the property, a 'private' structure is * allocated in each propset (i.e. one per resource). When parsing the * property value elements, for each new resource encountered in the * response, the 'creator' callback is called to retrieve a 'private' * structure for this resource. When the private structure is no longer * needed, the 'destructor' callback is called to deallocate any * memory, if necessary. * * Whilst in XML element callbacks you will have registered to handle * complex properties, you can use the 'ne_propfind_current_private' * call to retrieve the pointer to this private structure. * * To retrieve this 'private' structure from the propset in the * results callback, simply call 'ne_propset_private'. * */ typedef void *(*ne_props_create_complex)(void *userdata, const ne_uri *uri); typedef void (*ne_props_destroy_complex)(void *userdata, void *complex); void ne_propfind_set_private(ne_propfind_handler *handler, ne_props_create_complex creator, ne_props_destroy_complex destructor, void *userdata); /* Fetch all properties. * * Returns NE_*. */ int ne_propfind_allprop(ne_propfind_handler *handler, ne_props_result result, void *userdata); /* Fetch all properties with names listed in array 'names', which is * terminated by a property with a NULL name field. For each resource * encountered, the result callback will be invoked, passing in * 'userdata' as the first argument. * * Returns NE_*. */ int ne_propfind_named(ne_propfind_handler *handler, const ne_propname *names, ne_props_result result, void *userdata); /* Destroy a propfind handler after use. */ void ne_propfind_destroy(ne_propfind_handler *handler); NE_END_DECLS #endif /* NE_PROPS_H */ sitecopy-0.16.6/lib/neon/ne_openssl.c0000664000076400007640000010020010752314652015605 0ustar joejoe/* neon SSL/TLS support using OpenSSL Copyright (C) 2002-2007, Joe Orton Portions are: Copyright (C) 1999-2000 Tommi Komulainen This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include #ifdef HAVE_STRING_H #include #endif #include #include #include #include #include #include #ifdef NE_HAVE_TS_SSL #include /* for abort() */ #include #endif #include "ne_ssl.h" #include "ne_string.h" #include "ne_session.h" #include "ne_internal.h" #include "ne_private.h" #include "ne_privssl.h" /* OpenSSL 0.9.6 compatibility */ #if OPENSSL_VERSION_NUMBER < 0x0090700fL #define PKCS12_unpack_authsafes M_PKCS12_unpack_authsafes #define PKCS12_unpack_p7data M_PKCS12_unpack_p7data /* cast away lack of const-ness */ #define OBJ_cmp(a,b) OBJ_cmp((ASN1_OBJECT *)(a), (ASN1_OBJECT *)(b)) #endif /* Second argument for d2i_X509() changed type in 0.9.8. */ #if OPENSSL_VERSION_NUMBER < 0x0090800fL typedef unsigned char ne_d2i_uchar; #else typedef const unsigned char ne_d2i_uchar; #endif struct ne_ssl_dname_s { X509_NAME *dn; }; struct ne_ssl_certificate_s { ne_ssl_dname subj_dn, issuer_dn; X509 *subject; ne_ssl_certificate *issuer; char *identity; }; struct ne_ssl_client_cert_s { PKCS12 *p12; int decrypted; /* non-zero if successfully decrypted. */ ne_ssl_certificate cert; EVP_PKEY *pkey; char *friendly_name; }; /* Append an ASN.1 DirectoryString STR to buffer BUF as UTF-8. * Returns zero on success or non-zero on error. */ static int append_dirstring(ne_buffer *buf, ASN1_STRING *str) { unsigned char *tmp = (unsigned char *)""; /* initialize to workaround 0.9.6 bug */ int len; switch (str->type) { case V_ASN1_UTF8STRING: case V_ASN1_IA5STRING: /* definitely ASCII */ case V_ASN1_VISIBLESTRING: /* probably ASCII */ case V_ASN1_PRINTABLESTRING: /* subset of ASCII */ ne_buffer_append(buf, (char *)str->data, str->length); break; case V_ASN1_UNIVERSALSTRING: case V_ASN1_T61STRING: /* let OpenSSL convert it as ISO-8859-1 */ case V_ASN1_BMPSTRING: len = ASN1_STRING_to_UTF8(&tmp, str); if (len > 0) { ne_buffer_append(buf, (char *)tmp, len); OPENSSL_free(tmp); break; } else { ERR_clear_error(); return -1; } break; default: NE_DEBUG(NE_DBG_SSL, "Could not convert DirectoryString type %d\n", str->type); return -1; } return 0; } /* Returns a malloc-allocate version of IA5 string AS. Really only * here to prevent char * vs unsigned char * type mismatches without * losing all hope at type-safety. */ static char *dup_ia5string(const ASN1_IA5STRING *as) { unsigned char *data = as->data; return ne_strndup((char *)data, as->length); } char *ne_ssl_readable_dname(const ne_ssl_dname *name) { int n, flag = 0; ne_buffer *dump = ne_buffer_create(); const ASN1_OBJECT * const cname = OBJ_nid2obj(NID_commonName), * const email = OBJ_nid2obj(NID_pkcs9_emailAddress); for (n = X509_NAME_entry_count(name->dn); n > 0; n--) { X509_NAME_ENTRY *ent = X509_NAME_get_entry(name->dn, n-1); /* Skip commonName or emailAddress except if there is no other * attribute in dname. */ if ((OBJ_cmp(ent->object, cname) && OBJ_cmp(ent->object, email)) || (!flag && n == 1)) { if (flag++) ne_buffer_append(dump, ", ", 2); if (append_dirstring(dump, ent->value)) ne_buffer_czappend(dump, "???"); } } return ne_buffer_finish(dump); } int ne_ssl_dname_cmp(const ne_ssl_dname *dn1, const ne_ssl_dname *dn2) { return X509_NAME_cmp(dn1->dn, dn2->dn); } void ne_ssl_clicert_free(ne_ssl_client_cert *cc) { if (cc->p12) PKCS12_free(cc->p12); if (cc->decrypted) { if (cc->cert.identity) ne_free(cc->cert.identity); EVP_PKEY_free(cc->pkey); X509_free(cc->cert.subject); } if (cc->friendly_name) ne_free(cc->friendly_name); ne_free(cc); } /* Format an ASN1 time to a string. 'buf' must be at least of size * 'NE_SSL_VDATELEN'. */ static time_t asn1time_to_timet(const ASN1_TIME *atm) { struct tm tm = {0}; int i = atm->length; if (i < 10) return (time_t )-1; tm.tm_year = (atm->data[0]-'0') * 10 + (atm->data[1]-'0'); /* Deal with Year 2000 */ if (tm.tm_year < 70) tm.tm_year += 100; tm.tm_mon = (atm->data[2]-'0') * 10 + (atm->data[3]-'0') - 1; tm.tm_mday = (atm->data[4]-'0') * 10 + (atm->data[5]-'0'); tm.tm_hour = (atm->data[6]-'0') * 10 + (atm->data[7]-'0'); tm.tm_min = (atm->data[8]-'0') * 10 + (atm->data[9]-'0'); tm.tm_sec = (atm->data[10]-'0') * 10 + (atm->data[11]-'0'); #ifdef HAVE_TIMEZONE /* ANSI C time handling is... interesting. */ return mktime(&tm) - timezone; #else return mktime(&tm); #endif } void ne_ssl_cert_validity_time(const ne_ssl_certificate *cert, time_t *from, time_t *until) { if (from) { *from = asn1time_to_timet(X509_get_notBefore(cert->subject)); } if (until) { *until = asn1time_to_timet(X509_get_notAfter(cert->subject)); } } /* Return non-zero if hostname from certificate (cn) matches hostname * used for session (hostname). Doesn't implement complete RFC 2818 * logic; omits "f*.example.com" support for simplicity. */ static int match_hostname(char *cn, const char *hostname) { const char *dot; dot = strchr(hostname, '.'); if (dot == NULL) { char *pnt = strchr(cn, '.'); /* hostname is not fully-qualified; unqualify the cn. */ if (pnt != NULL) { *pnt = '\0'; } } else if (strncmp(cn, "*.", 2) == 0) { hostname = dot + 1; cn += 2; } return !ne_strcasecmp(cn, hostname); } /* Check certificate identity. Returns zero if identity matches; 1 if * identity does not match, or <0 if the certificate had no identity. * If 'identity' is non-NULL, store the malloc-allocated identity in * *identity. Logic specified by RFC 2818 and RFC 3280. */ static int check_identity(const ne_uri *server, X509 *cert, char **identity) { STACK_OF(GENERAL_NAME) *names; int match = 0, found = 0; const char *hostname; hostname = server ? server->host : ""; names = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL); if (names) { int n; /* subjectAltName contains a sequence of GeneralNames */ for (n = 0; n < sk_GENERAL_NAME_num(names) && !match; n++) { GENERAL_NAME *nm = sk_GENERAL_NAME_value(names, n); /* handle dNSName and iPAddress name extensions only. */ if (nm->type == GEN_DNS) { char *name = dup_ia5string(nm->d.ia5); if (identity && !found) *identity = ne_strdup(name); match = match_hostname(name, hostname); ne_free(name); found = 1; } else if (nm->type == GEN_IPADD) { /* compare IP address with server IP address. */ ne_inet_addr *ia; if (nm->d.ip->length == 4) ia = ne_iaddr_make(ne_iaddr_ipv4, nm->d.ip->data); else if (nm->d.ip->length == 16) ia = ne_iaddr_make(ne_iaddr_ipv6, nm->d.ip->data); else ia = NULL; /* ne_iaddr_make returns NULL if address type is unsupported */ if (ia != NULL) { /* address type was supported. */ char buf[128]; match = strcmp(hostname, ne_iaddr_print(ia, buf, sizeof buf)) == 0; found = 1; ne_iaddr_free(ia); } else { NE_DEBUG(NE_DBG_SSL, "iPAddress name with unsupported " "address type (length %d), skipped.\n", nm->d.ip->length); } } else if (nm->type == GEN_URI) { char *name = dup_ia5string(nm->d.ia5); ne_uri uri; if (ne_uri_parse(name, &uri) == 0 && uri.host && uri.scheme) { ne_uri tmp; if (identity && !found) *identity = ne_strdup(name); found = 1; if (server) { /* For comparison purposes, all that matters is * host, scheme and port; ignore the rest. */ memset(&tmp, 0, sizeof tmp); tmp.host = uri.host; tmp.scheme = uri.scheme; tmp.port = uri.port; match = ne_uri_cmp(server, &tmp) == 0; } } ne_uri_free(&uri); ne_free(name); } } /* free the whole stack. */ sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); } /* Check against the commonName if no DNS alt. names were found, * as per RFC3280. */ if (!found) { X509_NAME *subj = X509_get_subject_name(cert); X509_NAME_ENTRY *entry; ne_buffer *cname = ne_buffer_ncreate(30); int idx = -1, lastidx; /* find the most specific commonName attribute. */ do { lastidx = idx; idx = X509_NAME_get_index_by_NID(subj, NID_commonName, lastidx); } while (idx >= 0); if (lastidx < 0) { /* no commonName attributes at all. */ ne_buffer_destroy(cname); return -1; } /* extract the string from the entry */ entry = X509_NAME_get_entry(subj, lastidx); if (append_dirstring(cname, X509_NAME_ENTRY_get_data(entry))) { ne_buffer_destroy(cname); return -1; } if (identity) *identity = ne_strdup(cname->data); match = match_hostname(cname->data, hostname); ne_buffer_destroy(cname); } NE_DEBUG(NE_DBG_SSL, "Identity match for '%s': %s\n", hostname, match ? "good" : "bad"); return match ? 0 : 1; } /* Populate an ne_ssl_certificate structure from an X509 object. */ static ne_ssl_certificate *populate_cert(ne_ssl_certificate *cert, X509 *x5) { cert->subj_dn.dn = X509_get_subject_name(x5); cert->issuer_dn.dn = X509_get_issuer_name(x5); cert->issuer = NULL; cert->subject = x5; /* Retrieve the cert identity; pass a dummy hostname to match. */ cert->identity = NULL; check_identity(NULL, x5, &cert->identity); return cert; } /* Return a linked list of certificate objects from an OpenSSL chain. */ static ne_ssl_certificate *make_chain(STACK_OF(X509) *chain) { int n, count = sk_X509_num(chain); ne_ssl_certificate *top = NULL, *current = NULL; NE_DEBUG(NE_DBG_SSL, "Chain depth: %d\n", count); for (n = 0; n < count; n++) { ne_ssl_certificate *cert = ne_malloc(sizeof *cert); populate_cert(cert, X509_dup(sk_X509_value(chain, n))); #ifdef NE_DEBUGGING if (ne_debug_mask & NE_DBG_SSL) { fprintf(ne_debug_stream, "Cert #%d:\n", n); X509_print_fp(ne_debug_stream, cert->subject); } #endif if (top == NULL) { current = top = cert; } else { current->issuer = cert; current = cert; } } return top; } /* Verifies an SSL server certificate. */ static int check_certificate(ne_session *sess, SSL *ssl, ne_ssl_certificate *chain) { X509 *cert = chain->subject; ASN1_TIME *notBefore = X509_get_notBefore(cert); ASN1_TIME *notAfter = X509_get_notAfter(cert); int ret, failures = 0; long result; ne_uri server; /* check expiry dates */ if (X509_cmp_current_time(notBefore) >= 0) failures |= NE_SSL_NOTYETVALID; else if (X509_cmp_current_time(notAfter) <= 0) failures |= NE_SSL_EXPIRED; /* Check certificate was issued to this server; pass URI of * server. */ memset(&server, 0, sizeof server); ne_fill_server_uri(sess, &server); ret = check_identity(&server, cert, NULL); ne_uri_free(&server); if (ret < 0) { ne_set_error(sess, _("Server certificate was missing commonName " "attribute in subject name")); return NE_ERROR; } else if (ret > 0) failures |= NE_SSL_IDMISMATCH; /* get the result of the cert verification out of OpenSSL */ result = SSL_get_verify_result(ssl); NE_DEBUG(NE_DBG_SSL, "Verify result: %ld = %s\n", result, X509_verify_cert_error_string(result)); switch (result) { case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: /* TODO: and probably more result codes here... */ failures |= NE_SSL_UNTRUSTED; break; /* ignore these, since we've already noticed them: */ case X509_V_ERR_CERT_NOT_YET_VALID: case X509_V_ERR_CERT_HAS_EXPIRED: /* cert was trusted: */ case X509_V_OK: break; default: /* TODO: tricky to handle the 30-odd failure cases OpenSSL * presents here (see x509_vfy.h), and present a useful API to * the application so it in turn can then present a meaningful * UI to the user. The only thing to do really would be to * pass back the error string, but that's not localisable. So * just fail the verification here - better safe than * sorry. */ ne_set_error(sess, _("Certificate verification error: %s"), X509_verify_cert_error_string(result)); return NE_ERROR; } if (failures == 0) { /* verified OK! */ ret = NE_OK; } else { /* Set up the error string. */ ne__ssl_set_verify_err(sess, failures); ret = NE_ERROR; /* Allow manual override */ if (sess->ssl_verify_fn && sess->ssl_verify_fn(sess->ssl_verify_ud, failures, chain) == 0) ret = NE_OK; } return ret; } /* Duplicate a client certificate, which must be in the decrypted state. */ static ne_ssl_client_cert *dup_client_cert(const ne_ssl_client_cert *cc) { ne_ssl_client_cert *newcc = ne_calloc(sizeof *newcc); newcc->decrypted = 1; newcc->pkey = cc->pkey; if (cc->friendly_name) newcc->friendly_name = ne_strdup(cc->friendly_name); populate_cert(&newcc->cert, cc->cert.subject); cc->cert.subject->references++; cc->pkey->references++; return newcc; } /* Callback invoked when the SSL server requests a client certificate. */ static int provide_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey) { ne_session *const sess = SSL_get_app_data(ssl); if (!sess->client_cert && sess->ssl_provide_fn) { ne_ssl_dname **dnames = NULL; int n, count = 0; STACK_OF(X509_NAME) *ca_list = SSL_get_client_CA_list(ssl); count = ca_list ? sk_X509_NAME_num(ca_list) : 0; if (count > 0) { dnames = ne_malloc(count * sizeof(ne_ssl_dname *)); for (n = 0; n < count; n++) { dnames[n] = ne_malloc(sizeof(ne_ssl_dname)); dnames[n]->dn = sk_X509_NAME_value(ca_list, n); } } NE_DEBUG(NE_DBG_SSL, "Calling client certificate provider...\n"); sess->ssl_provide_fn(sess->ssl_provide_ud, sess, (const ne_ssl_dname *const *)dnames, count); if (count) { for (n = 0; n < count; n++) ne_free(dnames[n]); ne_free(dnames); } } if (sess->client_cert) { ne_ssl_client_cert *const cc = sess->client_cert; NE_DEBUG(NE_DBG_SSL, "Supplying client certificate.\n"); cc->pkey->references++; cc->cert.subject->references++; *cert = cc->cert.subject; *pkey = cc->pkey; return 1; } else { NE_DEBUG(NE_DBG_SSL, "No client certificate supplied.\n"); return 0; } } void ne_ssl_set_clicert(ne_session *sess, const ne_ssl_client_cert *cc) { sess->client_cert = dup_client_cert(cc); } ne_ssl_context *ne_ssl_context_create(int mode) { ne_ssl_context *ctx = ne_calloc(sizeof *ctx); if (mode == NE_SSL_CTX_CLIENT) { ctx->ctx = SSL_CTX_new(SSLv23_client_method()); ctx->sess = NULL; /* set client cert callback. */ SSL_CTX_set_client_cert_cb(ctx->ctx, provide_client_cert); /* enable workarounds for buggy SSL server implementations */ SSL_CTX_set_options(ctx->ctx, SSL_OP_ALL); } else if (mode == NE_SSL_CTX_SERVER) { ctx->ctx = SSL_CTX_new(SSLv23_server_method()); SSL_CTX_set_session_cache_mode(ctx->ctx, SSL_SESS_CACHE_CLIENT); } else { ctx->ctx = SSL_CTX_new(SSLv2_server_method()); SSL_CTX_set_session_cache_mode(ctx->ctx, SSL_SESS_CACHE_CLIENT); } return ctx; } void ne_ssl_context_set_flag(ne_ssl_context *ctx, int flag, int value) { long opts = SSL_CTX_get_options(ctx->ctx); switch (flag) { case NE_SSL_CTX_SSLv2: if (value) { /* Enable SSLv2 support; clear the "no SSLv2" flag. */ opts &= ~SSL_OP_NO_SSLv2; } else { /* Disable it: set the flag. */ opts |= SSL_OP_NO_SSLv2; } break; } SSL_CTX_set_options(ctx->ctx, opts); } int ne_ssl_context_keypair(ne_ssl_context *ctx, const char *cert, const char *key) { int ret; ret = SSL_CTX_use_PrivateKey_file(ctx->ctx, key, SSL_FILETYPE_PEM); if (ret == 1) { ret = SSL_CTX_use_certificate_file(ctx->ctx, cert, SSL_FILETYPE_PEM); } return ret == 1 ? 0 : -1; } int ne_ssl_context_set_verify(ne_ssl_context *ctx, int required, const char *ca_names, const char *verify_cas) { if (required) { SSL_CTX_set_verify(ctx->ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL); } if (ca_names) { SSL_CTX_set_client_CA_list(ctx->ctx, SSL_load_client_CA_file(ca_names)); } if (verify_cas) { SSL_CTX_load_verify_locations(ctx->ctx, verify_cas, NULL); } return 0; } void ne_ssl_context_destroy(ne_ssl_context *ctx) { SSL_CTX_free(ctx->ctx); if (ctx->sess) SSL_SESSION_free(ctx->sess); ne_free(ctx); } /* For internal use only. */ int ne__negotiate_ssl(ne_session *sess) { ne_ssl_context *ctx = sess->ssl_context; SSL *ssl; STACK_OF(X509) *chain; int freechain = 0; /* non-zero if chain should be free'd. */ NE_DEBUG(NE_DBG_SSL, "Doing SSL negotiation.\n"); /* Pass through the hostname if SNI is enabled. */ ctx->hostname = sess->flags[NE_SESSFLAG_TLS_SNI] ? sess->server.hostname : NULL; if (ne_sock_connect_ssl(sess->socket, ctx, sess)) { if (ctx->sess) { /* remove cached session. */ SSL_SESSION_free(ctx->sess); ctx->sess = NULL; } ne_set_error(sess, _("SSL negotiation failed: %s"), ne_sock_error(sess->socket)); return NE_ERROR; } ssl = ne__sock_sslsock(sess->socket); chain = SSL_get_peer_cert_chain(ssl); /* For an SSLv2 connection, the cert chain will always be NULL. */ if (chain == NULL) { X509 *cert = SSL_get_peer_certificate(ssl); if (cert) { chain = sk_X509_new_null(); sk_X509_push(chain, cert); freechain = 1; } } if (chain == NULL || sk_X509_num(chain) == 0) { ne_set_error(sess, _("SSL server did not present certificate")); return NE_ERROR; } if (sess->server_cert) { int diff = X509_cmp(sk_X509_value(chain, 0), sess->server_cert->subject); if (freechain) sk_X509_free(chain); /* no longer need the chain */ if (diff) { /* This could be a MITM attack: fail the request. */ ne_set_error(sess, _("Server certificate changed: " "connection intercepted?")); return NE_ERROR; } /* certificate has already passed verification: no need to * verify it again. */ } else { /* new connection: create the chain. */ ne_ssl_certificate *cert = make_chain(chain); if (freechain) sk_X509_free(chain); /* no longer need the chain */ if (check_certificate(sess, ssl, cert)) { NE_DEBUG(NE_DBG_SSL, "SSL certificate checks failed: %s\n", sess->error); ne_ssl_cert_free(cert); return NE_ERROR; } /* remember the chain. */ sess->server_cert = cert; } if (ctx->sess) { SSL_SESSION *newsess = SSL_get0_session(ssl); /* Replace the session if it has changed. */ if (newsess != ctx->sess || SSL_SESSION_cmp(ctx->sess, newsess)) { SSL_SESSION_free(ctx->sess); ctx->sess = SSL_get1_session(ssl); /* bumping the refcount */ } } else { /* Store the session. */ ctx->sess = SSL_get1_session(ssl); } return NE_OK; } const ne_ssl_dname *ne_ssl_cert_issuer(const ne_ssl_certificate *cert) { return &cert->issuer_dn; } const ne_ssl_dname *ne_ssl_cert_subject(const ne_ssl_certificate *cert) { return &cert->subj_dn; } const ne_ssl_certificate *ne_ssl_cert_signedby(const ne_ssl_certificate *cert) { return cert->issuer; } const char *ne_ssl_cert_identity(const ne_ssl_certificate *cert) { return cert->identity; } void ne_ssl_context_trustcert(ne_ssl_context *ctx, const ne_ssl_certificate *cert) { X509_STORE *store = SSL_CTX_get_cert_store(ctx->ctx); X509_STORE_add_cert(store, cert->subject); } void ne_ssl_trust_default_ca(ne_session *sess) { X509_STORE *store = SSL_CTX_get_cert_store(sess->ssl_context->ctx); #ifdef NE_SSL_CA_BUNDLE X509_STORE_load_locations(store, NE_SSL_CA_BUNDLE, NULL); #else X509_STORE_set_default_paths(store); #endif } /* Find a friendly name in a PKCS12 structure the hard way, without * decrypting the parts which are encrypted.. */ static char *find_friendly_name(PKCS12 *p12) { STACK_OF(PKCS7) *safes = PKCS12_unpack_authsafes(p12); int n, m; char *name = NULL; if (safes == NULL) return NULL; /* Iterate over the unpacked authsafes: */ for (n = 0; n < sk_PKCS7_num(safes) && !name; n++) { PKCS7 *safe = sk_PKCS7_value(safes, n); STACK_OF(PKCS12_SAFEBAG) *bags; /* Only looking for unencrypted authsafes. */ if (OBJ_obj2nid(safe->type) != NID_pkcs7_data) continue; bags = PKCS12_unpack_p7data(safe); if (!bags) continue; /* Iterate through the bags, picking out a friendly name */ for (m = 0; m < sk_PKCS12_SAFEBAG_num(bags) && !name; m++) { PKCS12_SAFEBAG *bag = sk_PKCS12_SAFEBAG_value(bags, m); name = PKCS12_get_friendlyname(bag); } sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free); } sk_PKCS7_pop_free(safes, PKCS7_free); return name; } ne_ssl_client_cert *ne_ssl_clicert_read(const char *filename) { PKCS12 *p12; FILE *fp; X509 *cert; EVP_PKEY *pkey; ne_ssl_client_cert *cc; fp = fopen(filename, "rb"); if (fp == NULL) return NULL; p12 = d2i_PKCS12_fp(fp, NULL); fclose(fp); if (p12 == NULL) { ERR_clear_error(); return NULL; } /* Try parsing with no password. */ if (PKCS12_parse(p12, NULL, &pkey, &cert, NULL) == 1) { /* Success - no password needed for decryption. */ int len = 0; unsigned char *name; if (!cert || !pkey) { PKCS12_free(p12); return NULL; } name = X509_alias_get0(cert, &len); cc = ne_calloc(sizeof *cc); cc->pkey = pkey; cc->decrypted = 1; if (name && len > 0) cc->friendly_name = ne_strndup((char *)name, len); populate_cert(&cc->cert, cert); PKCS12_free(p12); return cc; } else { /* Failed to parse the file */ int err = ERR_get_error(); ERR_clear_error(); if (ERR_GET_LIB(err) == ERR_LIB_PKCS12 && ERR_GET_REASON(err) == PKCS12_R_MAC_VERIFY_FAILURE) { /* Decryption error due to bad password. */ cc = ne_calloc(sizeof *cc); cc->friendly_name = find_friendly_name(p12); cc->p12 = p12; return cc; } else { /* Some parse error, give up. */ PKCS12_free(p12); return NULL; } } } int ne_ssl_clicert_encrypted(const ne_ssl_client_cert *cc) { return !cc->decrypted; } int ne_ssl_clicert_decrypt(ne_ssl_client_cert *cc, const char *password) { X509 *cert; EVP_PKEY *pkey; if (PKCS12_parse(cc->p12, password, &pkey, &cert, NULL) != 1) { ERR_clear_error(); return -1; } if (X509_check_private_key(cert, pkey) != 1) { ERR_clear_error(); X509_free(cert); EVP_PKEY_free(pkey); NE_DEBUG(NE_DBG_SSL, "Decrypted private key/cert are not matched."); return -1; } PKCS12_free(cc->p12); populate_cert(&cc->cert, cert); cc->pkey = pkey; cc->decrypted = 1; cc->p12 = NULL; return 0; } const ne_ssl_certificate *ne_ssl_clicert_owner(const ne_ssl_client_cert *cc) { return &cc->cert; } const char *ne_ssl_clicert_name(const ne_ssl_client_cert *ccert) { return ccert->friendly_name; } ne_ssl_certificate *ne_ssl_cert_read(const char *filename) { FILE *fp = fopen(filename, "r"); X509 *cert; if (fp == NULL) return NULL; cert = PEM_read_X509(fp, NULL, NULL, NULL); fclose(fp); if (cert == NULL) { NE_DEBUG(NE_DBG_SSL, "d2i_X509_fp failed: %s\n", ERR_reason_error_string(ERR_get_error())); ERR_clear_error(); return NULL; } return populate_cert(ne_calloc(sizeof(struct ne_ssl_certificate_s)), cert); } int ne_ssl_cert_write(const ne_ssl_certificate *cert, const char *filename) { FILE *fp = fopen(filename, "w"); if (fp == NULL) return -1; if (PEM_write_X509(fp, cert->subject) != 1) { ERR_clear_error(); fclose(fp); return -1; } if (fclose(fp) != 0) return -1; return 0; } void ne_ssl_cert_free(ne_ssl_certificate *cert) { X509_free(cert->subject); if (cert->issuer) ne_ssl_cert_free(cert->issuer); if (cert->identity) ne_free(cert->identity); ne_free(cert); } int ne_ssl_cert_cmp(const ne_ssl_certificate *c1, const ne_ssl_certificate *c2) { return X509_cmp(c1->subject, c2->subject); } /* The certificate import/export format is the base64 encoding of the * raw DER; PEM without the newlines and wrapping. */ ne_ssl_certificate *ne_ssl_cert_import(const char *data) { unsigned char *der; ne_d2i_uchar *p; size_t len; X509 *x5; /* decode the base64 to get the raw DER representation */ len = ne_unbase64(data, &der); if (len == 0) return NULL; p = der; x5 = d2i_X509(NULL, &p, len); /* p is incremented */ ne_free(der); if (x5 == NULL) { ERR_clear_error(); return NULL; } return populate_cert(ne_calloc(sizeof(struct ne_ssl_certificate_s)), x5); } char *ne_ssl_cert_export(const ne_ssl_certificate *cert) { int len; unsigned char *der, *p; char *ret; /* find the length of the DER encoding. */ len = i2d_X509(cert->subject, NULL); p = der = ne_malloc(len); i2d_X509(cert->subject, &p); /* p is incremented */ ret = ne_base64(der, len); ne_free(der); return ret; } #if SHA_DIGEST_LENGTH != 20 # error SHA digest length is not 20 bytes #endif int ne_ssl_cert_digest(const ne_ssl_certificate *cert, char *digest) { unsigned char sha1[EVP_MAX_MD_SIZE]; unsigned int len, j; char *p; if (!X509_digest(cert->subject, EVP_sha1(), sha1, &len) || len != 20) { ERR_clear_error(); return -1; } for (j = 0, p = digest; j < 20; j++) { *p++ = NE_HEX2ASC((sha1[j] >> 4) & 0x0f); *p++ = NE_HEX2ASC(sha1[j] & 0x0f); *p++ = ':'; } p[-1] = '\0'; return 0; } #ifdef NE_HAVE_TS_SSL /* Implementation of locking callbacks to make OpenSSL thread-safe. * If the OpenSSL API was better designed, this wouldn't be necessary. * In OpenSSL releases without CRYPTO_set_idptr_callback, it's not * possible to implement the locking in a POSIX-compliant way, since * it's necessary to cast from a pthread_t to an unsigned long at some * point. */ static pthread_mutex_t *locks; static size_t num_locks; #ifndef HAVE_CRYPTO_SET_IDPTR_CALLBACK /* Named to be obvious when it shows up in a backtrace. */ static unsigned long thread_id_neon(void) { /* This will break if pthread_t is a structure; upgrading OpenSSL * >= 0.9.9 (which does not require this callback) is the only * solution. */ return (unsigned long) pthread_self(); } #endif /* Another great API design win for OpenSSL: no return value! So if * the lock/unlock fails, all that can be done is to abort. */ static void thread_lock_neon(int mode, int n, const char *file, int line) { if (mode & CRYPTO_LOCK) { if (pthread_mutex_lock(&locks[n])) { abort(); } } else { if (pthread_mutex_unlock(&locks[n])) { abort(); } } } #endif /* ID_CALLBACK_IS_{NEON,OTHER} evaluate as true if the currently * registered OpenSSL ID callback is the neon function (_NEON), or has * been overwritten by some other app (_OTHER). */ #ifdef HAVE_CRYPTO_SET_IDPTR_CALLBACK #define ID_CALLBACK_IS_OTHER (0) #define ID_CALLBACK_IS_NEON (1) #else #define ID_CALLBACK_IS_OTHER (CRYPTO_get_id_callback() != NULL) #define ID_CALLBACK_IS_NEON (CRYPTO_get_id_callback() == thread_id_neon) #endif int ne__ssl_init(void) { CRYPTO_malloc_init(); SSL_load_error_strings(); SSL_library_init(); OpenSSL_add_all_algorithms(); #ifdef NE_HAVE_TS_SSL /* If some other library has already come along and set up the * thread-safety callbacks, then it must be presumed that the * other library will have a longer lifetime in the process than * neon. If the library which has installed the callbacks is * unloaded, then all bets are off. */ if (ID_CALLBACK_IS_OTHER || CRYPTO_get_locking_callback() != NULL) { NE_DEBUG(NE_DBG_SOCKET, "ssl: OpenSSL thread-safety callbacks already installed.\n"); NE_DEBUG(NE_DBG_SOCKET, "ssl: neon will not replace existing callbacks.\n"); } else { size_t n; num_locks = CRYPTO_num_locks(); /* For releases where CRYPTO_set_idptr_callback is present, * the default ID callback should be sufficient. */ #ifndef HAVE_CRYPTO_SET_IDPTR_CALLBACK CRYPTO_set_id_callback(thread_id_neon); #endif CRYPTO_set_locking_callback(thread_lock_neon); locks = malloc(num_locks * sizeof *locks); for (n = 0; n < num_locks; n++) { if (pthread_mutex_init(&locks[n], NULL)) { NE_DEBUG(NE_DBG_SOCKET, "ssl: Failed to initialize pthread mutex.\n"); return -1; } } NE_DEBUG(NE_DBG_SOCKET, "ssl: Initialized OpenSSL thread-safety callbacks " "for %" NE_FMT_SIZE_T " locks.\n", num_locks); } #endif return 0; } void ne__ssl_exit(void) { /* Cannot call ERR_free_strings() etc here in case any other code * in the process using OpenSSL. */ #ifdef NE_HAVE_TS_SSL /* Only unregister the callbacks if some *other* library has not * come along in the mean-time and trampled over the callbacks * installed by neon. */ if (CRYPTO_get_locking_callback() == thread_lock_neon && ID_CALLBACK_IS_NEON) { size_t n; #ifndef HAVE_CRYPTO_SET_IDPTR_CALLBACK CRYPTO_set_id_callback(NULL); #endif CRYPTO_set_locking_callback(NULL); for (n = 0; n < num_locks; n++) { pthread_mutex_destroy(&locks[n]); } free(locks); } #endif } sitecopy-0.16.6/lib/neon/ne_xmlreq.h0000664000076400007640000000366510506172162015453 0ustar joejoe/* XML/HTTP response handling Copyright (C) 2004-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_XMLREQ_H #define NE_XMLREQ_H #include "ne_request.h" #include "ne_xml.h" NE_BEGIN_DECLS /* Read the HTTP response body using calls to ne_read_response_block * (so must be enclosed by ne_begin_request/ne_end_request calls), and * parse it as an XML document, using the given parser. Returns NE_* * error codes. If an XML parse error occurs, the session error * string is set to the XML parser's error string, and NE_ERROR is * returned. */ int ne_xml_parse_response(ne_request *req, ne_xml_parser *parser); /* Dispatch the HTTP request, parsing the response body as an XML * document using the given parser, if the response status class is * 2xx and an XML media type is specified for the response entity. If * a non-2xx response code is given, or a non-XML media type is * specified, then the response body will be silently discarded. * * Returns NE_* error codes. If an XML parse error occurs, the * session error string is set to the XML parser's error string, and * NE_ERROR is returned. */ int ne_xml_dispatch_request(ne_request *req, ne_xml_parser *parser); NE_END_DECLS #endif /* NE_XMLREQ_H */ sitecopy-0.16.6/lib/neon/ne_private.h0000664000076400007640000000725310753065706015623 0ustar joejoe/* HTTP Request Handling Copyright (C) 1999-2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* THIS IS NOT A PUBLIC INTERFACE. You CANNOT include this header file * from an application. */ #ifndef NE_PRIVATE_H #define NE_PRIVATE_H #include "ne_request.h" #include "ne_socket.h" #include "ne_ssl.h" struct host_info { char *hostname; unsigned int port; ne_sock_addr *address; /* if non-NULL, result of resolving 'hostname'. */ /* current network address obtained from 'address' being used. */ const ne_inet_addr *current; char *hostport; /* URI hostport segment */ }; /* Store every registered callback in a generic container, and cast * the function pointer when calling it. */ struct hook { void (*fn)(void); void *userdata; const char *id; /* non-NULL for accessors. */ struct hook *next; }; #define HAVE_HOOK(st,func) (st->hook->hooks->func != NULL) #define HOOK_FUNC(st, func) (*st->hook->hooks->func) /* Session support. */ struct ne_session_s { /* Connection information */ ne_socket *socket; /* non-zero if connection has been established. */ int connected; /* non-zero if connection has persisted beyond one request. */ int persisted; int is_http11; /* >0 if connected server is known to be * HTTP/1.1 compliant. */ char *scheme; struct host_info server, proxy; /* application-provided address list */ const ne_inet_addr **addrlist; size_t numaddrs, curaddr; /* Local address to which sockets should be bound. */ const ne_inet_addr *local_addr; /* Settings */ int use_proxy; /* do we have a proxy server? */ int use_ssl; /* whether a secure connection is required */ int in_connect; /* doing a proxy CONNECT */ int flags[NE_SESSFLAG_LAST]; ne_progress progress_cb; void *progress_ud; ne_notify_status notify_cb; void *notify_ud; int rdtimeout, cotimeout; /* read, connect timeouts. */ struct hook *create_req_hooks, *pre_send_hooks, *post_send_hooks, *post_headers_hooks, *destroy_req_hooks, *destroy_sess_hooks, *close_conn_hooks, *private; char *user_agent; /* full User-Agent: header field */ #ifdef NE_HAVE_SSL ne_ssl_client_cert *client_cert; ne_ssl_certificate *server_cert; ne_ssl_context *ssl_context; #endif /* Server cert verification callback: */ ne_ssl_verify_fn ssl_verify_fn; void *ssl_verify_ud; /* Client cert provider callback: */ ne_ssl_provide_fn ssl_provide_fn; void *ssl_provide_ud; ne_session_status_info status; /* Error string */ char error[512]; }; /* Pushes block of 'count' bytes at 'buf'. Returns non-zero on * error. */ typedef int (*ne_push_fn)(void *userdata, const char *buf, size_t count); /* Do the SSL negotiation. */ int ne__negotiate_ssl(ne_session *sess); /* Set the session error appropriate for SSL verification failures. */ void ne__ssl_set_verify_err(ne_session *sess, int failures); #endif /* HTTP_PRIVATE_H */ sitecopy-0.16.6/lib/neon/ne_dates.h0000664000076400007640000000315610342676201015237 0ustar joejoe/* Date manipulation routines Copyright (C) 1999-2002, 2005, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_DATES_H #define NE_DATES_H #include #include "ne_defs.h" NE_BEGIN_DECLS /* Date manipulation routines as per RFC1123 and RFC1036 */ /* Return current date/time in RFC1123 format */ char *ne_rfc1123_date(time_t anytime); /* Returns time from date/time using the subset of the ISO8601 format * referenced in RFC2518 (e.g as used in the creationdate property in * the DAV: namespace). */ time_t ne_iso8601_parse(const char *date); /* Returns time from date/time in RFC1123 format */ time_t ne_rfc1123_parse(const char *date); time_t ne_rfc1036_parse(const char *date); /* Parses asctime date string */ time_t ne_asctime_parse(const char *date); /* Parse an HTTP-date as per RFC2616 */ time_t ne_httpdate_parse(const char *date); NE_END_DECLS #endif /* NE_DATES_H */ sitecopy-0.16.6/lib/neon/ne_pkcs11.h0000664000076400007640000001131410752606553015244 0ustar joejoe/* PKCS#11 support for neon Copyright (C) 2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_PKCS11_H #define NE_PKCS11_H 1 #include "ne_defs.h" #include "ne_session.h" NE_BEGIN_DECLS typedef struct ne_ssl_pkcs11_provider_s ne_ssl_pkcs11_provider; #define NE_PK11_OK (0) #define NE_PK11_NOTIMPL (-1) #define NE_PK11_FAILED (-2) /* Initialize a PKCS#11 provider of given name. Returns NE_OK on * success, NE_PK11_FAILED if the provider could not be * loaded/initialized, and NE_PK11_NOTIMPL if PKCS#11 is not * supported. On success, *provider is set to non-NULL. */ int ne_ssl_pkcs11_provider_init(ne_ssl_pkcs11_provider **provider, const char *name); /* Initialize a NSS softoken pseudo-PKCS#11 provider of given name * (e.g. "softokn3") to supply a client certificate if requested, * using database in given directory name; the other parameters may be * NULL. Returns NE_OK on success, NE_PK11_FAILED if the provider * could not be loaded/initialized, and NE_PK11_NOTIMPL if PKCS#11 is * not supported. On success, *provider is set to non-NULL. */ int ne_ssl_pkcs11_nss_provider_init(ne_ssl_pkcs11_provider **provider, const char *name, const char *directory, const char *cert_prefix, const char *key_prefix, const char *secmod_db); /* Destroy a PKCS#11 provider object. */ void ne_ssl_pkcs11_provider_destroy(ne_ssl_pkcs11_provider *provider); /* Flags passed to PIN entry callback: */ #define NE_SSL_P11PIN_COUNT_LOW (0x01) /* an incorrect PIN has been * entered. */ #define NE_SSL_P11PIN_FINAL_TRY (0x02) /* token will become locked if * entered PIN is incorrect */ /* Size of buffer passed to PIN entry callback: */ #define NE_SSL_P11PINLEN (256) /* Callback for PKCS#11 PIN entry. The callback provides the PIN code * to unlock the token with label 'token_label' in the slot described * by 'slot_descr'. * * The PIN code, as a NUL-terminated ASCII string, should be copied * into the 'pin' buffer (of fixed length NE_SSL_P11PINLEN), and * return 0 to indicate success. Alternatively, the callback may * return -1 to indicate failure and cancel PIN entry (in which case, * the contents of the 'pin' parameter are ignored). * * When a PIN is required, the callback will be invoked repeatedly * (and indefinitely) until either the returned PIN code is correct, * the callback returns failure, or the token refuses login (e.g. when * the token is locked due to too many incorrect PINs!). For the * first such invocation, the 'attempt' counter will have value zero; * it will increase by one for each subsequent attempt. * * The NE_SSL_P11PIN_COUNT_LOW and/or NE_SSL_P11PIN_FINAL_TRY hints * may be set in the 'flags' argument, if these hints are made * available by the token; not all tokens expose these hints. */ typedef int (*ne_ssl_pkcs11_pin_fn)(void *userdata, int attempt, const char *slot_descr, const char *token_label, unsigned int flags, char *pin); /* Set the PIN entry callback for the given provider. This is * necessary for some (but not all) types of token. For tokens which * implement an out-of-band ("protected") authentication path, the PIN * entry callback will not be invoked. */ void ne_ssl_pkcs11_provider_pin(ne_ssl_pkcs11_provider *provider, ne_ssl_pkcs11_pin_fn fn, void *userdata); /* Set up a given PKCS#11 provider to supply an appropriate client * certificate if requested by the server. A provider may be * configured for use in multiple sessions. */ void ne_ssl_set_pkcs11_provider(ne_session *sess, ne_ssl_pkcs11_provider *provider); NE_END_DECLS #endif /* NE_PKCS11_H */ sitecopy-0.16.6/lib/neon/COPYING.LIB0000664000076400007640000006130310127573646014754 0ustar joejoe GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Library 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! sitecopy-0.16.6/lib/neon/ne_md5.h0000664000076400007640000000752010646613101014620 0ustar joejoe/* Declaration of functions and data types used for MD5 sum computing library functions. Copyright (C) 2006, Joe Orton Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU 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. */ #ifndef NE_MD5_H #define NE_MD5_H 1 #include #include "ne_defs.h" NE_BEGIN_DECLS /* * The following three functions are build up the low level used in * the functions `md5_stream' and `md5_buffer'. */ struct ne_md5_ctx; /* Create structure containing state of computation. */ extern struct ne_md5_ctx *ne_md5_create_ctx(void); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is necessary that LEN is a multiple of 64!!! */ extern void ne_md5_process_block(const void *buffer, size_t len, struct ne_md5_ctx *ctx); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 64. */ extern void ne_md5_process_bytes(const void *buffer, size_t len, struct ne_md5_ctx *ctx); /* Process the remaining bytes in the buffer and 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. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *ne_md5_finish_ctx(struct ne_md5_ctx *ctx, void *resbuf); /* 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. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *ne_md5_read_ctx(const struct ne_md5_ctx *ctx, void *resbuf); /* Take a copy of the state structure. */ extern struct ne_md5_ctx *ne_md5_dup_ctx(struct ne_md5_ctx *ctx); /* Re-initialize the context structure. */ extern void ne_md5_reset_ctx(struct ne_md5_ctx *ctx); /* Destroy the context structure. */ extern void ne_md5_destroy_ctx(struct ne_md5_ctx *ctx); /* Compute MD5 message digest for bytes read from STREAM. The resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ extern int ne_md5_stream(FILE *stream, void *resblock); /* Process the remaining bytes in the buffer and put ASCII representation of the resulting message digest from CTX in the first 33 bytes of BUFFER, including a trailing NUL terminator byte. Returns pointer to buffer. */ char *ne_md5_finish_ascii(struct ne_md5_ctx *ctx, char buffer[33]); /* MD5 ascii->binary conversion */ void ne_md5_to_ascii(const unsigned char md5_buf[16], char *buffer); void ne_ascii_to_md5(const char *buffer, unsigned char md5_buf[16]); NE_END_DECLS #endif /* NE_MD5_H */ sitecopy-0.16.6/lib/neon/ne_utils.h0000664000076400007640000001000610646613101015264 0ustar joejoe/* HTTP utility functions Copyright (C) 1999-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_UTILS_H #define NE_UTILS_H #include #include #include #include "ne_defs.h" #ifdef NEON_TRIO #include #endif NE_BEGIN_DECLS /* Returns a human-readable library version string describing the * version and build information; for example: * "neon 0.2.0: Library build, OpenSSL support" */ const char *ne_version_string(void); /* Returns non-zero if library version is not of major version * 'major', or if minor version is not greater than or equal to * 'minor'. For neon versions with major == 0, all minor versions are * presumed to be incompatible. */ int ne_version_match(int major, int minor); /* Feature codes: */ #define NE_FEATURE_SSL (1) /* SSL/TLS support */ #define NE_FEATURE_ZLIB (2) /* zlib compression in compress interface */ #define NE_FEATURE_IPV6 (3) /* IPv6 is supported in resolver */ #define NE_FEATURE_LFS (4) /* large file support */ #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */ #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */ #define NE_FEATURE_I18N (7) /* i18n error message support */ /* Returns non-zero if library is built with support for the given * NE_FEATURE_* feature code 'code'. */ int ne_has_support(int feature); /* Debugging macro to allow code to be optimized out if debugging is * disabled at build time. */ #ifndef NE_DEBUGGING #define NE_DEBUG if (0) ne_debug #else /* DEBUGGING */ #define NE_DEBUG ne_debug #endif /* DEBUGGING */ /* Debugging masks. */ #define NE_DBG_SOCKET (1<<0) /* raw socket */ #define NE_DBG_HTTP (1<<1) /* HTTP request/response handling */ #define NE_DBG_XML (1<<2) /* XML parser */ #define NE_DBG_HTTPAUTH (1<<3) /* HTTP authentication (hiding credentials) */ #define NE_DBG_HTTPPLAIN (1<<4) /* plaintext HTTP authentication */ #define NE_DBG_LOCKS (1<<5) /* WebDAV locking */ #define NE_DBG_XMLPARSE (1<<6) /* low-level XML parser */ #define NE_DBG_HTTPBODY (1<<7) /* HTTP response body blocks */ #define NE_DBG_SSL (1<<8) /* SSL/TLS */ #define NE_DBG_FLUSH (1<<30) /* always flush debugging */ /* Send debugging output to 'stream', for all of the given debug * channels. To disable debugging, pass 'stream' as NULL and 'mask' * as 0. */ void ne_debug_init(FILE *stream, int mask); /* The current debug mask and stream set by the last call to * ne_debug_init. */ extern int ne_debug_mask; extern FILE *ne_debug_stream; /* Produce debug output if any of channels 'ch' is enabled for * debugging. */ void ne_debug(int ch, const char *, ...) ne_attribute((format(printf, 2, 3))); /* Storing an HTTP status result */ typedef struct { int major_version; int minor_version; int code; /* Status-Code value */ int klass; /* Class of Status-Code (1-5) */ char *reason_phrase; } ne_status; /* NB: couldn't use 'class' in ne_status because it would clash with * the C++ reserved word. */ /* Parse 'status_line' using the the RFC2616 Status-Line grammar. * s->reason_phrase is malloc-allocated if non-NULL, and must be * free'd by the caller. Returns 0 on success, in which case all * fields of '*s' will be set; or -1 on parse error, in which case * '*s' is unmodified. */ int ne_parse_statusline(const char *status_line, ne_status *s); NE_END_DECLS #endif /* NE_UTILS_H */ sitecopy-0.16.6/lib/neon/ne_uri.c0000664000076400007640000004221510725502717014735 0ustar joejoe/* URI manipulation routines. Copyright (C) 1999-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include #include #include "ne_string.h" /* for ne_buffer */ #include "ne_alloc.h" #include "ne_uri.h" /* URI ABNF from RFC 3986: */ #define PS (0x0001) /* "+" */ #define PC (0x0002) /* "%" */ #define DS (0x0004) /* "-" */ #define DT (0x0008) /* "." */ #define US (0x0010) /* "_" */ #define TD (0x0020) /* "~" */ #define FS (0x0040) /* "/" */ #define CL (0x0080) /* ":" */ #define AT (0x0100) /* "@" */ #define QU (0x0200) /* "?" */ #define DG (0x0400) /* DIGIT */ #define AL (0x0800) /* ALPHA */ #define GD (0x1000) /* gen-delims = "#" / "[" / "]" * ... except ":", "/", "@", and "?" */ #define SD (0x2000) /* sub-delims = "!" / "$" / "&" / "'" / "(" / ")" * / "*" / "+" / "," / ";" / "=" * ... except "+" which is PS */ #define OT (0x4000) /* others */ #define URI_ALPHA (AL) #define URI_DIGIT (DG) /* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" */ #define URI_UNRESERVED (AL | DG | DS | DT | US | TD) /* scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) */ #define URI_SCHEME (AL | DG | PS | DS | DT) /* real sub-delims definition, including "+" */ #define URI_SUBDELIM (PS | SD) /* real gen-delims definition, including ":", "/", "@" and "?" */ #define URI_GENDELIM (GD | CL | FS | AT | QU) /* userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) */ #define URI_USERINFO (URI_UNRESERVED | PC | URI_SUBDELIM | CL) /* pchar = unreserved / pct-encoded / sub-delims / ":" / "@" */ #define URI_PCHAR (URI_UNRESERVED | PC | URI_SUBDELIM | CL | AT) /* invented: segchar = pchar / "/" */ #define URI_SEGCHAR (URI_PCHAR | FS) /* query = *( pchar / "/" / "?" ) */ #define URI_QUERY (URI_PCHAR | FS | QU) /* fragment == query */ #define URI_FRAGMENT URI_QUERY /* any characters which should be path-escaped: */ #define URI_ESCAPE ((URI_GENDELIM & ~(FS)) | URI_SUBDELIM | OT | PC) static const unsigned int uri_chars[256] = { /* 0xXX x0 x2 x4 x6 x8 xA xC xE */ /* 0x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, /* 1x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, /* 2x */ OT, SD, OT, GD, SD, PC, SD, SD, SD, SD, SD, PS, SD, DS, DT, FS, /* 3x */ DG, DG, DG, DG, DG, DG, DG, DG, DG, DG, CL, SD, OT, SD, OT, QU, /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US, /* 6x */ OT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, /* 7x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, OT, OT, OT, TD, OT, /* 8x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, /* 9x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, /* Ax */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, /* Bx */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, /* Cx */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, /* Dx */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, /* Ex */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, /* Fx */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT }; #define uri_lookup(ch) (uri_chars[(unsigned char)ch]) char *ne_path_parent(const char *uri) { size_t len = strlen(uri); const char *pnt = uri + len - 1; /* skip trailing slash (parent of "/foo/" is "/") */ if (pnt >= uri && *pnt == '/') pnt--; /* find previous slash */ while (pnt > uri && *pnt != '/') pnt--; if (pnt < uri || (pnt == uri && *pnt != '/')) return NULL; return ne_strndup(uri, pnt - uri + 1); } int ne_path_has_trailing_slash(const char *uri) { size_t len = strlen(uri); return ((len > 0) && (uri[len-1] == '/')); } unsigned int ne_uri_defaultport(const char *scheme) { /* RFC2616/3.2.3 says use case-insensitive comparisons here. */ if (ne_strcasecmp(scheme, "http") == 0) return 80; else if (ne_strcasecmp(scheme, "https") == 0) return 443; else return 0; } int ne_uri_parse(const char *uri, ne_uri *parsed) { const char *p, *s; memset(parsed, 0, sizeof *parsed); p = s = uri; /* => s = p = URI-reference */ if (uri_lookup(*p) & URI_ALPHA) { while (uri_lookup(*p) & URI_SCHEME) p++; if (*p == ':') { parsed->scheme = ne_strndup(uri, p - s); s = p + 1; } } /* => s = heir-part, or s = relative-part */ if (s[0] == '/' && s[1] == '/') { const char *pa; /* => s = "//" authority path-abempty (from expansion of * either heir-part of relative-part) */ /* authority = [ userinfo "@" ] host [ ":" port ] */ s = pa = s + 2; /* => s = authority */ while (*pa != '/' && *pa != '\0') pa++; /* => pa = path-abempty */ p = s; while (p < pa && uri_lookup(*p) & URI_USERINFO) p++; if (*p == '@') { parsed->userinfo = ne_strndup(s, p - s); s = p + 1; } /* => s = host */ if (s[0] == '[') { p = s + 1; while (*p != ']' && p < pa) p++; if (p == pa || (p + 1 != pa && p[1] != ':')) { /* Ill-formed IP-literal. */ return -1; } p++; /* => p = colon */ } else { /* Find the colon. */ p = pa; while (*p != ':' && p > s) p--; } if (p == s) { p = pa; /* No colon; => p = path-abempty */ } else if (p + 1 != pa) { /* => p = colon */ parsed->port = atoi(p + 1); } parsed->host = ne_strndup(s, p - s); s = pa; if (*s == '\0') { s = "/"; /* FIXME: scheme-specific. */ } } /* => s = path-abempty / path-absolute / path-rootless * / path-empty / path-noscheme */ p = s; while (uri_lookup(*p) & URI_SEGCHAR) p++; /* => p = [ "?" query ] [ "#" fragment ] */ parsed->path = ne_strndup(s, p - s); if (*p != '\0') { s = p++; while (uri_lookup(*p) & URI_QUERY) p++; /* => p = [ "#" fragment ] */ /* => s = [ "?" query ] [ "#" fragment ] */ if (*s == '?') { parsed->query = ne_strndup(s + 1, p - s - 1); if (*p != '\0') { s = p++; while (uri_lookup(*p) & URI_FRAGMENT) p++; } } /* => p now points to the next character after the * URI-reference; which should be the NUL byte. */ if (*s == '#') { parsed->fragment = ne_strndup(s + 1, p - s - 1); } else if (*p || *s != '?') { return -1; } } return 0; } /* This function directly implements the "Merge Paths" algorithm * described in RFC 3986 section 5.2.3. */ static char *merge_paths(const ne_uri *base, const char *path) { const char *p; if (base->host && base->path[0] == '\0') { return ne_concat("/", path, NULL); } p = strrchr(base->path, '/'); if (p == NULL) { return ne_strdup(path); } else { size_t len = p - base->path + 1; char *ret = ne_malloc(strlen(path) + len + 1); memcpy(ret, base->path, len); memcpy(ret + len, path, strlen(path) + 1); return ret; } } /* This function directly implements the "Remove Dot Segments" * algorithm described in RFC 3986 section 5.2.4. */ static char *remove_dot_segments(const char *path) { char *in, *inc, *out; inc = in = ne_strdup(path); out = ne_malloc(strlen(path) + 1); out[0] = '\0'; while (in[0]) { /* case 2.A: */ if (strncmp(in, "./", 2) == 0) { in += 2; } else if (strncmp(in, "../", 3) == 0) { in += 3; } /* case 2.B: */ else if (strncmp(in, "/./", 3) == 0) { in += 2; } else if (strcmp(in, "/.") == 0) { in[1] = '\0'; } /* case 2.C: */ else if (strncmp(in, "/../", 4) == 0 || strcmp(in, "/..") == 0) { char *p; /* Make the next character in the input buffer a "/": */ if (in[3] == '\0') { /* terminating "/.." case */ in += 2; in[0] = '/'; } else { /* "/../" prefix case */ in += 3; } /* Trim the last component from the output buffer, or * empty it. */ p = strrchr(out, '/'); if (p) { *p = '\0'; } else { out[0] = '\0'; } } /* case 2.D: */ else if (strcmp(in, ".") == 0 || strcmp(in, "..") == 0) { in[0] = '\0'; } /* case 2.E */ else { char *p; /* Search for the *second* "/" if the leading character is * already "/": */ p = strchr(in + (in[0] == '/'), '/'); /* Otherwise, copy the whole string */ if (p == NULL) p = strchr(in, '\0'); strncat(out, in, p - in); in = p; } } ne_free(inc); return out; } /* Copy authority components from 'src' to 'dest' if defined. */ static void copy_authority(ne_uri *dest, const ne_uri *src) { if (src->host) dest->host = ne_strdup(src->host); dest->port = src->port; if (src->userinfo) dest->userinfo = ne_strdup(src->userinfo); } /* This function directly implements the "Transform References" * algorithm described in RFC 3986 section 5.2.2. */ ne_uri *ne_uri_resolve(const ne_uri *base, const ne_uri *relative, ne_uri *target) { memset(target, 0, sizeof *target); if (relative->scheme) { target->scheme = ne_strdup(relative->scheme); copy_authority(target, relative); target->path = remove_dot_segments(relative->path); if (relative->query) target->query = ne_strdup(relative->query); } else { if (relative->host) { copy_authority(target, relative); target->path = remove_dot_segments(relative->path); if (relative->query) target->query = ne_strdup(relative->query); } else { if (relative->path[0] == '\0') { target->path = ne_strdup(base->path); if (relative->query) { target->query = ne_strdup(relative->query); } else if (base->query) { target->query = ne_strdup(base->query); } } else { if (relative->path[0] == '/') { target->path = remove_dot_segments(relative->path); } else { char *merged = merge_paths(base, relative->path); target->path = remove_dot_segments(merged); ne_free(merged); } if (relative->query) target->query = ne_strdup(relative->query); } copy_authority(target, base); } if (base->scheme) target->scheme = ne_strdup(base->scheme); } if (relative->fragment) target->fragment = ne_strdup(relative->fragment); return target; } ne_uri *ne_uri_copy(ne_uri *dest, const ne_uri *src) { memset(dest, 0, sizeof *dest); if (src->scheme) dest->scheme = ne_strdup(src->scheme); copy_authority(dest, src); if (src->path) dest->path = ne_strdup(src->path); if (src->query) dest->query = ne_strdup(src->query); if (src->fragment) dest->fragment = ne_strdup(src->fragment); return dest; } void ne_uri_free(ne_uri *u) { if (u->host) ne_free(u->host); if (u->path) ne_free(u->path); if (u->scheme) ne_free(u->scheme); if (u->userinfo) ne_free(u->userinfo); if (u->fragment) ne_free(u->fragment); if (u->query) ne_free(u->query); memset(u, 0, sizeof *u); } char *ne_path_unescape(const char *uri) { const char *pnt; char *ret, *retpos, buf[5] = { "0x00" }; retpos = ret = ne_malloc(strlen(uri) + 1); for (pnt = uri; *pnt != '\0'; pnt++) { if (*pnt == '%') { if (!isxdigit((unsigned char) pnt[1]) || !isxdigit((unsigned char) pnt[2])) { /* Invalid URI */ ne_free(ret); return NULL; } buf[2] = *++pnt; buf[3] = *++pnt; /* bit faster than memcpy */ *retpos++ = (char)strtol(buf, NULL, 16); } else { *retpos++ = *pnt; } } *retpos = '\0'; return ret; } /* CH must be an unsigned char; evaluates to 1 if CH should be * percent-encoded. */ #define path_escape_ch(ch) (uri_lookup(ch) & URI_ESCAPE) char *ne_path_escape(const char *path) { const unsigned char *pnt; char *ret, *p; size_t count = 0; for (pnt = (const unsigned char *)path; *pnt != '\0'; pnt++) { count += path_escape_ch(*pnt); } if (count == 0) { return ne_strdup(path); } p = ret = ne_malloc(strlen(path) + 2 * count + 1); for (pnt = (const unsigned char *)path; *pnt != '\0'; pnt++) { if (path_escape_ch(*pnt)) { /* Escape it - % */ sprintf(p, "%%%02x", (unsigned char) *pnt); p += 3; } else { *p++ = *pnt; } } *p = '\0'; return ret; } #undef path_escape_ch #define CMPWITH(field, func) \ do { \ if (u1->field) { \ if (!u2->field) return -1; \ n = func(u1->field, u2->field); \ if (n) return n; \ } else if (u2->field) { \ return 1; \ } \ } while (0) #define CMP(field) CMPWITH(field, strcmp) #define CASECMP(field) CMPWITH(field, ne_strcasecmp) /* As specified by RFC 2616, section 3.2.3. */ int ne_uri_cmp(const ne_uri *u1, const ne_uri *u2) { int n; CMP(path); CASECMP(host); CASECMP(scheme); CMP(query); CMP(fragment); CMP(userinfo); return u2->port - u1->port; } #undef CMP #undef CASECMP #undef CMPWITH /* TODO: implement properly */ int ne_path_compare(const char *a, const char *b) { int ret = ne_strcasecmp(a, b); if (ret) { /* This logic says: "If the lengths of the two URIs differ by * exactly one, and the LONGER of the two URIs has a trailing * slash and the SHORTER one DOESN'T, then..." */ int traila = ne_path_has_trailing_slash(a), trailb = ne_path_has_trailing_slash(b), lena = strlen(a), lenb = strlen(b); if (traila != trailb && abs(lena - lenb) == 1 && ((traila && lena > lenb) || (trailb && lenb > lena))) { /* Compare them, ignoring the trailing slash on the longer * URI */ if (strncasecmp(a, b, lena < lenb ? lena : lenb) == 0) ret = 0; } } return ret; } char *ne_uri_unparse(const ne_uri *uri) { ne_buffer *buf = ne_buffer_create(); if (uri->scheme) { ne_buffer_concat(buf, uri->scheme, ":", NULL); } if (uri->host) { ne_buffer_czappend(buf, "//"); if (uri->userinfo) { ne_buffer_concat(buf, uri->userinfo, "@", NULL); } ne_buffer_zappend(buf, uri->host); if (uri->port > 0 && (!uri->scheme || ne_uri_defaultport(uri->scheme) != uri->port)) { char str[20]; ne_snprintf(str, 20, ":%d", uri->port); ne_buffer_zappend(buf, str); } } ne_buffer_zappend(buf, uri->path); if (uri->query) { ne_buffer_concat(buf, "?", uri->query, NULL); } if (uri->fragment) { ne_buffer_concat(buf, "#", uri->fragment, NULL); } return ne_buffer_finish(buf); } /* Give it a path segment, it returns non-zero if child is * a child of parent. */ int ne_path_childof(const char *parent, const char *child) { char *root = ne_strdup(child); int ret; if (strlen(parent) >= strlen(child)) { ret = 0; } else { /* root is the first of child, equal to length of parent */ root[strlen(parent)] = '\0'; ret = (ne_path_compare(parent, root) == 0); } ne_free(root); return ret; } sitecopy-0.16.6/lib/neon/ne_sspi.c0000664000076400007640000004225110657101620015104 0ustar joejoe/* Microsoft SSPI based authentication routines Copyright (C) 2004-2005, Vladimir Berezniker @ http://public.xdi.org/=vmpn Copyright (C) 2007, Yves Martin This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include "ne_utils.h" #include "ne_string.h" #include "ne_socket.h" #include "ne_sspi.h" #ifdef HAVE_SSPI #define SEC_SUCCESS(Status) ((Status) >= 0) #ifndef SECURITY_ENTRYPOINT /* Missing in MingW 3.7 */ #define SECURITY_ENTRYPOINT "InitSecurityInterfaceA" #endif struct SSPIContextStruct { CtxtHandle context; char *serverName; CredHandle credentials; int continueNeeded; int authfinished; char *mechanism; int ntlm; ULONG maxTokenSize; }; typedef struct SSPIContextStruct SSPIContext; static ULONG negotiateMaxTokenSize = 0; static ULONG ntlmMaxTokenSize = 0; static HINSTANCE hSecDll = NULL; static PSecurityFunctionTable pSFT = NULL; static int initialized = 0; /* * Query specified package for it's maximum token size. */ static int getMaxTokenSize(char *package, ULONG * maxTokenSize) { SECURITY_STATUS status; SecPkgInfo *packageSecurityInfo = NULL; status = pSFT->QuerySecurityPackageInfo(package, &packageSecurityInfo); if (status == SEC_E_OK) { *maxTokenSize = packageSecurityInfo->cbMaxToken; if (pSFT->FreeContextBuffer(packageSecurityInfo) != SEC_E_OK) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Unable to free security package info."); } } else { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: QuerySecurityPackageInfo [failed] [%x].", status); return -1; } return 0; } /* * Initialize all the SSPI data */ static void initDll(HINSTANCE hSecDll) { INIT_SECURITY_INTERFACE initSecurityInterface = NULL; initSecurityInterface = (INIT_SECURITY_INTERFACE) GetProcAddress(hSecDll, SECURITY_ENTRYPOINT); if (initSecurityInterface == NULL) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Obtaining security interface [fail].\n"); initialized = -1; return; } else { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Obtaining security interface [ok].\n"); } pSFT = (initSecurityInterface) (); if (pSFT == NULL) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Security Function Table [fail].\n"); initialized = -2; return; } else { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Security Function Table [ok].\n"); } if (getMaxTokenSize("Negotiate", &negotiateMaxTokenSize)) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Unable to get negotiate maximum packet size"); initialized = -3; } if (getMaxTokenSize("NTLM", &ntlmMaxTokenSize)) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Unable to get negotiate maximum packet size"); initialized = -3; } } /* * This function needs to be called at least once before using any other. */ int ne_sspi_init(void) { if (initialized) { return 0; } NE_DEBUG(NE_DBG_SOCKET, "sspiInit\n"); NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Loading security dll.\n"); hSecDll = LoadLibrary("security.dll"); if (hSecDll == NULL) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Loading of security dll [fail].\n"); } else { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Loading of security dll [ok].\n"); initDll(hSecDll); if (initialized == 0) { initialized = 1; } } NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: sspiInit [%d].\n", initialized); if (initialized < 0) { return initialized; } else { return 0; } } /* * This function can be called to free resources used by SSPI. */ int ne_sspi_deinit(void) { NE_DEBUG(NE_DBG_SOCKET, "sspi: DeInit\n"); if (initialized <= 0) { return initialized; } pSFT = NULL; if (hSecDll != NULL) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Unloading security dll.\n"); if (FreeLibrary(hSecDll)) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Unloading of security dll [ok].\n"); } else { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Unloading of security dll [fail].\n"); return -1; } hSecDll = NULL; } initialized = 0; return 0; } /* * Simplification wrapper arround AcquireCredentialsHandle as most of * the parameters do not change. */ static int acquireCredentialsHandle(CredHandle * credentials, char *package) { SECURITY_STATUS status; TimeStamp timestamp; status = pSFT->AcquireCredentialsHandle(NULL, package, SECPKG_CRED_OUTBOUND, NULL, NULL, NULL, NULL, credentials, ×tamp); if (status != SEC_E_OK) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: AcquireCredentialsHandle [fail] [%x].\n", status); return -1; } return 0; } /* * Wrapper arround initializeSecurityContext. Supplies several * default parameters as well as logging in case of errors. */ static SECURITY_STATUS initializeSecurityContext(CredHandle * credentials, CtxtHandle * context, char *spn, ULONG contextReq, SecBufferDesc * inBuffer, CtxtHandle * newContext, SecBufferDesc * outBuffer) { ULONG contextAttributes; SECURITY_STATUS status; status = pSFT->InitializeSecurityContext(credentials, context, spn, contextReq, 0, SECURITY_NETWORK_DREP, inBuffer, 0, newContext, outBuffer, &contextAttributes, NULL); if (!SEC_SUCCESS(status)) { if (status == SEC_E_INVALID_TOKEN) { NE_DEBUG(NE_DBG_HTTPAUTH, "InitializeSecurityContext [fail] SEC_E_INVALID_TOKEN.\n"); } else if (status == SEC_E_UNSUPPORTED_FUNCTION) { NE_DEBUG(NE_DBG_HTTPAUTH, "InitializeSecurityContext [fail] SEC_E_UNSUPPORTED_FUNCTION.\n"); } else { NE_DEBUG(NE_DBG_HTTPAUTH, "InitializeSecurityContext [fail] [%x].\n", status); } } return status; } /* * Validates that the pointer is not NULL and converts it to its real type. */ static int getContext(void *context, SSPIContext **sspiContext) { if (!context) { return -1; } *sspiContext = context; return 0; } /* * Verifies that the buffer descriptor point only to one buffer and * returns the pointer to it. */ static int getSingleBufferDescriptor(SecBufferDesc *secBufferDesc, SecBuffer **secBuffer) { if (secBufferDesc->cBuffers != 1) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: fillBufferDescriptor " "[fail] numbers of descriptor buffers. 1 != [%d].\n", secBufferDesc->cBuffers); return -1; } *secBuffer = secBufferDesc->pBuffers; return 0; } /* * Decodes BASE64 string into SSPI SecBuffer */ static int base64ToBuffer(const char *token, SecBufferDesc * secBufferDesc) { SecBuffer *buffer; if (getSingleBufferDescriptor(secBufferDesc, &buffer)) { return -1; } buffer->BufferType = SECBUFFER_TOKEN; buffer->cbBuffer = ne_unbase64(token, (unsigned char **) &buffer->pvBuffer); if (buffer->cbBuffer == 0) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Unable to decode BASE64 SSPI token.\n"); return -1; } return 0; } /* * Creates a SecBuffer of a specified size. */ static int makeBuffer(SecBufferDesc * secBufferDesc, ULONG size) { SecBuffer *buffer; if (getSingleBufferDescriptor(secBufferDesc, &buffer)) { return -1; } buffer->BufferType = SECBUFFER_TOKEN; buffer->cbBuffer = size; buffer->pvBuffer = ne_calloc(size); return 0; } /* * Frees data allocated in the buffer. */ static int freeBuffer(SecBufferDesc * secBufferDesc) { SecBuffer *buffer; if (getSingleBufferDescriptor(secBufferDesc, &buffer)) { return -1; } if (buffer->cbBuffer > 0 && buffer->pvBuffer) { ne_free(buffer->pvBuffer); buffer->cbBuffer = 0; buffer->pvBuffer = NULL; } return 0; } /* * Canonicalize a server host name if possible. * The returned pointer must be freed after usage. */ static char *canonical_hostname(const char *serverName) { char *hostname; ne_sock_addr *addresses; /* DNS resolution. It would be useful to be able to use the * AI_CANONNAME flag where getaddrinfo() is available, but the * reverse-lookup is sufficient and simpler. */ addresses = ne_addr_resolve(serverName, 0); if (ne_addr_result(addresses)) { /* Lookup failed */ char buf[256]; NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Could not resolve IP address for `%s': %s\n", serverName, ne_addr_error(addresses, buf, sizeof buf)); hostname = ne_strdup(serverName); } else { char hostbuffer[256]; const ne_inet_addr *address = ne_addr_first(addresses); if (ne_iaddr_reverse(address, hostbuffer, sizeof hostbuffer) == 0) { hostname = ne_strdup(hostbuffer); } else { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Could not resolve host name" "from IP address for `%s'\n", serverName); hostname = ne_strdup(serverName); } } ne_addr_destroy(addresses); return hostname; } /* * Create a context to authenticate to specified server, using either * ntlm or negotiate. */ int ne_sspi_create_context(void **context, char *serverName, int ntlm) { SSPIContext *sspiContext; char *canonicalName; if (initialized <= 0) { return -1; } sspiContext = ne_calloc(sizeof(SSPIContext)); sspiContext->continueNeeded = 0; if (ntlm) { sspiContext->mechanism = "NTLM"; sspiContext->serverName = ne_strdup(serverName); sspiContext->maxTokenSize = ntlmMaxTokenSize; } else { sspiContext->mechanism = "Negotiate"; /* Canonicalize to conform to GSSAPI behavior */ canonicalName = canonical_hostname(serverName); sspiContext->serverName = ne_concat("HTTP/", canonicalName, NULL); ne_free(canonicalName); NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Created context with SPN '%s'\n", sspiContext->serverName); sspiContext->maxTokenSize = negotiateMaxTokenSize; } sspiContext->ntlm = ntlm; sspiContext->authfinished = 0; *context = sspiContext; return 0; } /* * Resets the context */ static void resetContext(SSPIContext * sspiContext) { pSFT->DeleteSecurityContext(&(sspiContext->context)); #if defined(_MSC_VER) && _MSC_VER <= 1200 pSFT->FreeCredentialHandle(&(sspiContext->credentials)); #else pSFT->FreeCredentialsHandle(&(sspiContext->credentials)); #endif sspiContext->continueNeeded = 0; } /* * Initializes supplied SecBufferDesc to point to supplied SecBuffer * that is also initialized; */ static void initSingleEmptyBuffer(SecBufferDesc * bufferDesc, SecBuffer * buffer) { buffer->BufferType = SECBUFFER_EMPTY; buffer->cbBuffer = 0; buffer->pvBuffer = NULL; bufferDesc->cBuffers = 1; bufferDesc->ulVersion = SECBUFFER_VERSION; bufferDesc->pBuffers = buffer; } /* * Destroyes the supplied context. */ int ne_sspi_destroy_context(void *context) { int status; SSPIContext *sspiContext; if (initialized <= 0) { return -1; } status = getContext(context, &sspiContext); if (status) { return status; } resetContext(sspiContext); if (sspiContext->serverName) { ne_free(sspiContext->serverName); sspiContext->serverName = NULL; } ne_free(sspiContext); return 0; } int ne_sspi_clear_context(void *context) { int status; SSPIContext *sspiContext; if (initialized <= 0) { return -1; } status = getContext(context, &sspiContext); if (status) { return status; } sspiContext->authfinished = 0; return 0; } /* * Processes received authentication tokens as well as supplies the * response token. */ int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken) { SecBufferDesc outBufferDesc; SecBuffer outBuffer; int status; SECURITY_STATUS securityStatus; ULONG contextFlags; SSPIContext *sspiContext; if (initialized <= 0) { return -1; } status = getContext(context, &sspiContext); if (status) { return status; } /* TODO: Not sure what flags should be set. joe: this needs to be * driven by the ne_auth interface; the GSSAPI code needs similar * flags. */ contextFlags = ISC_REQ_CONFIDENTIALITY | ISC_REQ_MUTUAL_AUTH; initSingleEmptyBuffer(&outBufferDesc, &outBuffer); status = makeBuffer(&outBufferDesc, sspiContext->maxTokenSize); if (status) { return status; } if (base64Token) { SecBufferDesc inBufferDesc; SecBuffer inBuffer; if (!sspiContext->continueNeeded) { freeBuffer(&outBufferDesc); NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Got an unexpected token.\n"); return -1; } initSingleEmptyBuffer(&inBufferDesc, &inBuffer); status = base64ToBuffer(base64Token, &inBufferDesc); if (status) { freeBuffer(&outBufferDesc); return status; } securityStatus = initializeSecurityContext(&sspiContext->credentials, &(sspiContext->context), sspiContext->serverName, contextFlags, &inBufferDesc, &(sspiContext->context), &outBufferDesc); if (securityStatus == SEC_E_OK) { sspiContext->authfinished = 1; } freeBuffer(&inBufferDesc); } else { if (sspiContext->continueNeeded) { freeBuffer(&outBufferDesc); NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: Expected a token from server.\n"); return -1; } if (sspiContext->authfinished && (sspiContext->credentials.dwLower || sspiContext->credentials.dwUpper)) { if (sspiContext->authfinished) { freeBuffer(&outBufferDesc); sspiContext->authfinished = 0; NE_DEBUG(NE_DBG_HTTPAUTH,"sspi: failing because starting over from failed try.\n"); return -1; } sspiContext->authfinished = 0; } /* Reset any existing context since we are starting over */ resetContext(sspiContext); if (acquireCredentialsHandle (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) { freeBuffer(&outBufferDesc); NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandle failed.\n"); return -1; } securityStatus = initializeSecurityContext(&sspiContext->credentials, NULL, sspiContext->serverName, contextFlags, NULL, &(sspiContext->context), &outBufferDesc); } if (securityStatus == SEC_I_COMPLETE_AND_CONTINUE || securityStatus == SEC_I_COMPLETE_NEEDED) { SECURITY_STATUS compleStatus = pSFT->CompleteAuthToken(&(sspiContext->context), &outBufferDesc); if (compleStatus != SEC_E_OK) { freeBuffer(&outBufferDesc); NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: CompleteAuthToken failed.\n"); return -1; } } if (securityStatus == SEC_I_COMPLETE_AND_CONTINUE || securityStatus == SEC_I_CONTINUE_NEEDED) { sspiContext->continueNeeded = 1; } else { sspiContext->continueNeeded = 0; } if (!(securityStatus == SEC_I_COMPLETE_AND_CONTINUE || securityStatus == SEC_I_COMPLETE_NEEDED || securityStatus == SEC_I_CONTINUE_NEEDED || securityStatus == SEC_E_OK)) { NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: initializeSecurityContext [failed] [%x].\n", securityStatus); freeBuffer(&outBufferDesc); return -1; } *responseToken = ne_base64(outBufferDesc.pBuffers->pvBuffer, outBufferDesc.pBuffers->cbBuffer); freeBuffer(&outBufferDesc); return 0; } #endif /* HAVE_SSPI */ sitecopy-0.16.6/lib/neon/ne_request.c0000664000076400007640000013364410766306765015647 0ustar joejoe/* HTTP request/response handling Copyright (C) 1999-2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* This is the HTTP client request/response implementation. * The goal of this code is to be modular and simple. */ #include "config.h" #include #include #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include "ne_internal.h" #include "ne_alloc.h" #include "ne_request.h" #include "ne_string.h" /* for ne_buffer */ #include "ne_utils.h" #include "ne_socket.h" #include "ne_uri.h" #include "ne_private.h" #define SOCK_ERR(req, op, msg) do { ssize_t sret = (op); \ if (sret < 0) return aborted(req, msg, sret); } while (0) #define EOL "\r\n" struct body_reader { ne_block_reader handler; ne_accept_response accept_response; unsigned int use; void *userdata; struct body_reader *next; }; struct field { char *name, *value; size_t vlen; struct field *next; }; /* Maximum number of header fields per response: */ #define MAX_HEADER_FIELDS (100) /* Size of hash table; 43 is the smallest prime for which the common * header names hash uniquely using the *33 hash function. */ #define HH_HASHSIZE (43) /* Hash iteration step: *33 known to be a good hash for ASCII, see RSE. */ #define HH_ITERATE(hash, ch) (((hash)*33 + (unsigned char)(ch)) % HH_HASHSIZE) /* pre-calculated hash values for given header names: */ #define HH_HV_CONNECTION (0x14) #define HH_HV_PROXY_CONNECTION (0x1A) #define HH_HV_CONTENT_LENGTH (0x13) #define HH_HV_TRANSFER_ENCODING (0x07) struct ne_request_s { char *method, *uri; /* method and Request-URI */ ne_buffer *headers; /* request headers */ /* Request body. */ ne_provide_body body_cb; void *body_ud; /* Request body source: file or buffer (if not callback). */ union { struct { int fd; ne_off_t offset, length; ne_off_t remain; /* remaining bytes to send. */ } file; struct { /* length bytes @ buffer = whole body. * remain bytes @ pnt = remaining bytes to send */ const char *buffer, *pnt; size_t length, remain; } buf; } body; ne_off_t body_length; /* length of request body */ /* temporary store for response lines. */ char respbuf[NE_BUFSIZ]; /**** Response ***/ /* The transfer encoding types */ struct ne_response { enum { R_TILLEOF = 0, /* read till eof */ R_NO_BODY, /* implicitly no body (HEAD, 204, 304) */ R_CHUNKED, /* using chunked transfer-encoding */ R_CLENGTH /* using given content-length */ } mode; union { /* clen: used if mode == R_CLENGTH; total and bytes * remaining to be read of response body. */ struct { ne_off_t total, remain; } clen; /* chunk: used if mode == R_CHUNKED; total and bytes * remaining to be read of current chunk */ struct { size_t total, remain; } chunk; } body; ne_off_t progress; /* number of bytes read of response */ } resp; struct hook *private; /* response header fields */ struct field *response_headers[HH_HASHSIZE]; unsigned int current_index; /* response_headers cursor for iterator */ /* List of callbacks which are passed response body blocks */ struct body_reader *body_readers; /*** Miscellaneous ***/ unsigned int method_is_head; unsigned int can_persist; int flags[NE_REQFLAG_LAST]; ne_session *session; ne_status status; }; static int open_connection(ne_session *sess); /* Returns hash value for header 'name', converting it to lower-case * in-place. */ static inline unsigned int hash_and_lower(char *name) { char *pnt; unsigned int hash = 0; for (pnt = name; *pnt != '\0'; pnt++) { *pnt = ne_tolower(*pnt); hash = HH_ITERATE(hash,*pnt); } return hash; } /* Abort a request due to an non-recoverable HTTP protocol error, * whilst doing 'doing'. 'code', if non-zero, is the socket error * code, NE_SOCK_*, or if zero, is ignored. */ static int aborted(ne_request *req, const char *doing, ssize_t code) { ne_session *sess = req->session; int ret = NE_ERROR; NE_DEBUG(NE_DBG_HTTP, "Aborted request (%" NE_FMT_SSIZE_T "): %s\n", code, doing); switch(code) { case NE_SOCK_CLOSED: if (sess->use_proxy) { ne_set_error(sess, _("%s: connection was closed by proxy server"), doing); } else { ne_set_error(sess, _("%s: connection was closed by server"), doing); } break; case NE_SOCK_TIMEOUT: ne_set_error(sess, _("%s: connection timed out"), doing); ret = NE_TIMEOUT; break; case NE_SOCK_ERROR: case NE_SOCK_RESET: case NE_SOCK_TRUNC: ne_set_error(sess, "%s: %s", doing, ne_sock_error(sess->socket)); break; case 0: ne_set_error(sess, "%s", doing); break; } ne_close_connection(sess); return ret; } static void notify_status(ne_session *sess, ne_session_status status) { if (sess->notify_cb) { sess->notify_cb(sess->notify_ud, status, &sess->status); } } static void *get_private(const struct hook *hk, const char *id) { for (; hk != NULL; hk = hk->next) if (strcmp(hk->id, id) == 0) return hk->userdata; return NULL; } void *ne_get_request_private(ne_request *req, const char *id) { return get_private(req->private, id); } void *ne_get_session_private(ne_session *sess, const char *id) { return get_private(sess->private, id); } void ne_set_request_private(ne_request *req, const char *id, void *userdata) { struct hook *hk = ne_malloc(sizeof (struct hook)), *pos; if (req->private != NULL) { for (pos = req->private; pos->next != NULL; pos = pos->next) /* nullop */; pos->next = hk; } else { req->private = hk; } hk->id = id; hk->fn = NULL; hk->userdata = userdata; hk->next = NULL; } static ssize_t body_string_send(void *userdata, char *buffer, size_t count) { ne_request *req = userdata; if (count == 0) { req->body.buf.remain = req->body.buf.length; req->body.buf.pnt = req->body.buf.buffer; } else { /* if body_left == 0 we fall through and return 0. */ if (req->body.buf.remain < count) count = req->body.buf.remain; memcpy(buffer, req->body.buf.pnt, count); req->body.buf.pnt += count; req->body.buf.remain -= count; } return count; } static ssize_t body_fd_send(void *userdata, char *buffer, size_t count) { ne_request *req = userdata; if (count) { if (req->body.file.remain == 0) return 0; if ((off_t)count > req->body.file.remain) count = req->body.file.remain; return read(req->body.file.fd, buffer, count); } else { ne_off_t newoff; /* rewind for next send. */ newoff = ne_lseek(req->body.file.fd, req->body.file.offset, SEEK_SET); if (newoff == req->body.file.offset) { req->body.file.remain = req->body.file.length; return 0; } else { char err[200], offstr[20]; if (newoff == -1) { /* errno was set */ ne_strerror(errno, err, sizeof err); } else { strcpy(err, _("offset invalid")); } ne_snprintf(offstr, sizeof offstr, "%" FMT_NE_OFF_T, req->body.file.offset); ne_set_error(req->session, _("Could not seek to offset %s" " of request body file: %s"), offstr, err); return -1; } } } /* For accurate persistent connection handling, for any write() or * read() operation for a new request on an already-open connection, * an EOF or RST error MUST be treated as a persistent connection * timeout, and the request retried on a new connection. Once a * read() operation has succeeded, any subsequent error MUST be * treated as fatal. A 'retry' flag is used; retry=1 represents the * first case, retry=0 the latter. */ /* RETRY_RET() crafts a function return value given the 'retry' flag, * the socket error 'code', and the return value 'acode' from the * aborted() function. */ #define RETRY_RET(retry, code, acode) \ ((((code) == NE_SOCK_CLOSED || (code) == NE_SOCK_RESET || \ (code) == NE_SOCK_TRUNC) && retry) ? NE_RETRY : (acode)) /* Sends the request body; returns 0 on success or an NE_* error code. * If retry is non-zero; will return NE_RETRY on persistent connection * timeout. On error, the session error string is set and the * connection is closed. */ static int send_request_body(ne_request *req, int retry) { ne_session *const sess = req->session; char buffer[NE_BUFSIZ]; ssize_t bytes; NE_DEBUG(NE_DBG_HTTP, "Sending request body:\n"); req->session->status.sr.progress = 0; req->session->status.sr.total = req->body_length; notify_status(sess, ne_status_sending); /* tell the source to start again from the beginning. */ if (req->body_cb(req->body_ud, NULL, 0) != 0) { ne_close_connection(sess); return NE_ERROR; } while ((bytes = req->body_cb(req->body_ud, buffer, sizeof buffer)) > 0) { int ret = ne_sock_fullwrite(sess->socket, buffer, bytes); if (ret < 0) { int aret = aborted(req, _("Could not send request body"), ret); return RETRY_RET(retry, ret, aret); } NE_DEBUG(NE_DBG_HTTPBODY, "Body block (%" NE_FMT_SSIZE_T " bytes):\n[%.*s]\n", bytes, (int)bytes, buffer); /* invoke progress callback */ req->session->status.sr.progress += bytes; notify_status(sess, ne_status_sending); } if (bytes == 0) { return NE_OK; } else { NE_DEBUG(NE_DBG_HTTP, "Request body provider failed with " "%" NE_FMT_SSIZE_T "\n", bytes); ne_close_connection(sess); return NE_ERROR; } } /* Lob the User-Agent, connection and host headers in to the request * headers */ static void add_fixed_headers(ne_request *req) { if (req->session->user_agent) { ne_buffer_zappend(req->headers, req->session->user_agent); } /* If persistent connections are disabled, just send Connection: * close; otherwise, send Connection: Keep-Alive to pre-1.1 origin * servers to try harder to get a persistent connection, except if * using a proxy as per 2068§19.7.1. Always add TE: trailers. */ if (!req->session->flags[NE_SESSFLAG_PERSIST]) { ne_buffer_czappend(req->headers, "Connection: TE, close" EOL "TE: trailers" EOL); } else if (!req->session->is_http11 && !req->session->use_proxy) { ne_buffer_czappend(req->headers, "Keep-Alive: " EOL "Connection: TE, Keep-Alive" EOL "TE: trailers" EOL); } else if (!req->session->is_http11 && req->session->use_proxy) { ne_buffer_czappend(req->headers, "Keep-Alive: " EOL "Proxy-Connection: Keep-Alive" EOL "Connection: TE" EOL "TE: trailers" EOL); } else { ne_buffer_czappend(req->headers, "Connection: TE" EOL "TE: trailers" EOL); } } int ne_accept_always(void *userdata, ne_request *req, const ne_status *st) { return 1; } int ne_accept_2xx(void *userdata, ne_request *req, const ne_status *st) { return (st->klass == 2); } ne_request *ne_request_create(ne_session *sess, const char *method, const char *path) { ne_request *req = ne_calloc(sizeof *req); req->session = sess; req->headers = ne_buffer_create(); /* Presume the method is idempotent by default. */ req->flags[NE_REQFLAG_IDEMPOTENT] = 1; /* Add in the fixed headers */ add_fixed_headers(req); /* Set the standard stuff */ req->method = ne_strdup(method); req->method_is_head = (strcmp(method, "HEAD") == 0); /* Only use an absoluteURI here when absolutely necessary: some * servers can't parse them. */ if (req->session->use_proxy && !req->session->use_ssl && path[0] == '/') req->uri = ne_concat(req->session->scheme, "://", req->session->server.hostport, path, NULL); else req->uri = ne_strdup(path); { struct hook *hk; for (hk = sess->create_req_hooks; hk != NULL; hk = hk->next) { ne_create_request_fn fn = (ne_create_request_fn)hk->fn; fn(req, hk->userdata, method, req->uri); } } return req; } /* Set the request body length to 'length' */ static void set_body_length(ne_request *req, ne_off_t length) { req->body_length = length; ne_print_request_header(req, "Content-Length", "%" FMT_NE_OFF_T, length); } void ne_set_request_body_buffer(ne_request *req, const char *buffer, size_t size) { req->body.buf.buffer = buffer; req->body.buf.length = size; req->body_cb = body_string_send; req->body_ud = req; set_body_length(req, size); } void ne_set_request_body_provider(ne_request *req, ne_off_t bodysize, ne_provide_body provider, void *ud) { req->body_cb = provider; req->body_ud = ud; set_body_length(req, bodysize); } void ne_set_request_body_fd(ne_request *req, int fd, ne_off_t offset, ne_off_t length) { req->body.file.fd = fd; req->body.file.offset = offset; req->body.file.length = length; req->body_cb = body_fd_send; req->body_ud = req; set_body_length(req, length); } void ne_set_request_flag(ne_request *req, ne_request_flag flag, int value) { if (flag < NE_SESSFLAG_LAST) { req->flags[flag] = value; } } int ne_get_request_flag(ne_request *req, ne_request_flag flag) { if (flag < NE_REQFLAG_LAST) { return req->flags[flag]; } return -1; } void ne_add_request_header(ne_request *req, const char *name, const char *value) { ne_buffer_concat(req->headers, name, ": ", value, EOL, NULL); } void ne_print_request_header(ne_request *req, const char *name, const char *format, ...) { va_list params; char buf[NE_BUFSIZ]; va_start(params, format); ne_vsnprintf(buf, sizeof buf, format, params); va_end(params); ne_buffer_concat(req->headers, name, ": ", buf, EOL, NULL); } /* Returns the value of the response header 'name', for which the hash * value is 'h', or NULL if the header is not found. */ static inline char *get_response_header_hv(ne_request *req, unsigned int h, const char *name) { struct field *f; for (f = req->response_headers[h]; f; f = f->next) if (strcmp(f->name, name) == 0) return f->value; return NULL; } const char *ne_get_response_header(ne_request *req, const char *name) { char *lcname = ne_strdup(name); unsigned int hash = hash_and_lower(lcname); char *value = get_response_header_hv(req, hash, lcname); ne_free(lcname); return value; } /* The return value of the iterator function is a pointer to the * struct field of the previously returned header. */ void *ne_response_header_iterate(ne_request *req, void *iterator, const char **name, const char **value) { struct field *f = iterator; unsigned int n; if (f == NULL) { n = 0; } else if ((f = f->next) == NULL) { n = req->current_index + 1; } if (f == NULL) { while (n < HH_HASHSIZE && req->response_headers[n] == NULL) n++; if (n == HH_HASHSIZE) return NULL; /* no more headers */ f = req->response_headers[n]; req->current_index = n; } *name = f->name; *value = f->value; return f; } /* Removes the response header 'name', which has hash value 'hash'. */ static void remove_response_header(ne_request *req, const char *name, unsigned int hash) { struct field **ptr = req->response_headers + hash; while (*ptr) { struct field *const f = *ptr; if (strcmp(f->name, name) == 0) { *ptr = f->next; ne_free(f->name); ne_free(f->value); ne_free(f); return; } ptr = &f->next; } } /* Free all stored response headers. */ static void free_response_headers(ne_request *req) { int n; for (n = 0; n < HH_HASHSIZE; n++) { struct field **ptr = req->response_headers + n; while (*ptr) { struct field *const f = *ptr; *ptr = f->next; ne_free(f->name); ne_free(f->value); ne_free(f); } } } void ne_add_response_body_reader(ne_request *req, ne_accept_response acpt, ne_block_reader rdr, void *userdata) { struct body_reader *new = ne_malloc(sizeof *new); new->accept_response = acpt; new->handler = rdr; new->userdata = userdata; new->next = req->body_readers; req->body_readers = new; } void ne_request_destroy(ne_request *req) { struct body_reader *rdr, *next_rdr; struct hook *hk, *next_hk; ne_free(req->uri); ne_free(req->method); for (rdr = req->body_readers; rdr != NULL; rdr = next_rdr) { next_rdr = rdr->next; ne_free(rdr); } free_response_headers(req); ne_buffer_destroy(req->headers); NE_DEBUG(NE_DBG_HTTP, "Running destroy hooks.\n"); for (hk = req->session->destroy_req_hooks; hk; hk = next_hk) { ne_destroy_req_fn fn = (ne_destroy_req_fn)hk->fn; next_hk = hk->next; fn(req, hk->userdata); } for (hk = req->private; hk; hk = next_hk) { next_hk = hk->next; ne_free(hk); } if (req->status.reason_phrase) ne_free(req->status.reason_phrase); NE_DEBUG(NE_DBG_HTTP, "Request ends.\n"); ne_free(req); } /* Reads a block of the response into BUFFER, which is of size * *BUFLEN. Returns zero on success or non-zero on error. On * success, *BUFLEN is updated to be the number of bytes read into * BUFFER (which will be 0 to indicate the end of the repsonse). On * error, the connection is closed and the session error string is * set. */ static int read_response_block(ne_request *req, struct ne_response *resp, char *buffer, size_t *buflen) { ne_socket *const sock = req->session->socket; size_t willread; ssize_t readlen; switch (resp->mode) { case R_CHUNKED: /* Chunked transfer-encoding: chunk syntax is "SIZE CRLF CHUNK * CRLF SIZE CRLF CHUNK CRLF ..." followed by zero-length * chunk: "CHUNK CRLF 0 CRLF". resp.chunk.remain contains the * number of bytes left to read in the current chunk. */ if (resp->body.chunk.remain == 0) { unsigned long chunk_len; char *ptr; /* Read the chunk size line into a temporary buffer. */ SOCK_ERR(req, ne_sock_readline(sock, req->respbuf, sizeof req->respbuf), _("Could not read chunk size")); NE_DEBUG(NE_DBG_HTTP, "[chunk] < %s", req->respbuf); chunk_len = strtoul(req->respbuf, &ptr, 16); /* limit chunk size to <= UINT_MAX, so it will probably * fit in a size_t. */ if (ptr == req->respbuf || chunk_len == ULONG_MAX || chunk_len > UINT_MAX) { return aborted(req, _("Could not parse chunk size"), 0); } NE_DEBUG(NE_DBG_HTTP, "Got chunk size: %lu\n", chunk_len); resp->body.chunk.remain = chunk_len; } willread = resp->body.chunk.remain > *buflen ? *buflen : resp->body.chunk.remain; break; case R_CLENGTH: willread = resp->body.clen.remain > (off_t)*buflen ? *buflen : (size_t)resp->body.clen.remain; break; case R_TILLEOF: willread = *buflen; break; case R_NO_BODY: default: willread = 0; break; } if (willread == 0) { *buflen = 0; return 0; } NE_DEBUG(NE_DBG_HTTP, "Reading %" NE_FMT_SIZE_T " bytes of response body.\n", willread); readlen = ne_sock_read(sock, buffer, willread); /* EOF is only valid when response body is delimited by it. * Strictly, an SSL truncation should not be treated as an EOF in * any case, but SSL servers are just too buggy. */ if (resp->mode == R_TILLEOF && (readlen == NE_SOCK_CLOSED || readlen == NE_SOCK_TRUNC)) { NE_DEBUG(NE_DBG_HTTP, "Got EOF.\n"); req->can_persist = 0; readlen = 0; } else if (readlen < 0) { return aborted(req, _("Could not read response body"), readlen); } else { NE_DEBUG(NE_DBG_HTTP, "Got %" NE_FMT_SSIZE_T " bytes.\n", readlen); } /* safe to cast: readlen guaranteed to be >= 0 above */ *buflen = (size_t)readlen; NE_DEBUG(NE_DBG_HTTPBODY, "Read block (%" NE_FMT_SSIZE_T " bytes):\n[%.*s]\n", readlen, (int)readlen, buffer); if (resp->mode == R_CHUNKED) { resp->body.chunk.remain -= readlen; if (resp->body.chunk.remain == 0) { char crlfbuf[2]; /* If we've read a whole chunk, read a CRLF */ readlen = ne_sock_fullread(sock, crlfbuf, 2); if (readlen < 0) return aborted(req, _("Could not read chunk delimiter"), readlen); else if (crlfbuf[0] != '\r' || crlfbuf[1] != '\n') return aborted(req, _("Chunk delimiter was invalid"), 0); } } else if (resp->mode == R_CLENGTH) { resp->body.clen.remain -= readlen; } resp->progress += readlen; return NE_OK; } ssize_t ne_read_response_block(ne_request *req, char *buffer, size_t buflen) { struct body_reader *rdr; size_t readlen = buflen; struct ne_response *const resp = &req->resp; if (read_response_block(req, resp, buffer, &readlen)) return -1; if (readlen) { req->session->status.sr.progress += readlen; notify_status(req->session, ne_status_recving); } for (rdr = req->body_readers; rdr!=NULL; rdr=rdr->next) { if (rdr->use && rdr->handler(rdr->userdata, buffer, readlen) != 0) { ne_close_connection(req->session); return -1; } } return readlen; } /* Build the request string, returning the buffer. */ static ne_buffer *build_request(ne_request *req) { struct hook *hk; ne_buffer *buf = ne_buffer_create(); /* Add Request-Line and Host header: */ ne_buffer_concat(buf, req->method, " ", req->uri, " HTTP/1.1" EOL, "Host: ", req->session->server.hostport, EOL, NULL); /* Add custom headers: */ ne_buffer_append(buf, req->headers->data, ne_buffer_size(req->headers)); if (req->flags[NE_REQFLAG_EXPECT100]) { ne_buffer_czappend(buf, "Expect: 100-continue\r\n"); } NE_DEBUG(NE_DBG_HTTP, "Running pre_send hooks\n"); for (hk = req->session->pre_send_hooks; hk!=NULL; hk = hk->next) { ne_pre_send_fn fn = (ne_pre_send_fn)hk->fn; fn(req, hk->userdata, buf); } ne_buffer_czappend(buf, "\r\n"); return buf; } #ifdef NE_DEBUGGING #define DEBUG_DUMP_REQUEST(x) dump_request(x) static void dump_request(const char *request) { if (ne_debug_mask & NE_DBG_HTTPPLAIN) { /* Display everything mode */ NE_DEBUG(NE_DBG_HTTP, "Sending request headers:\n%s", request); } else if (ne_debug_mask & NE_DBG_HTTP) { /* Blank out the Authorization paramaters */ char *reqdebug = ne_strdup(request), *pnt = reqdebug; while ((pnt = strstr(pnt, "Authorization: ")) != NULL) { for (pnt += 15; *pnt != '\r' && *pnt != '\0'; pnt++) { *pnt = 'x'; } } NE_DEBUG(NE_DBG_HTTP, "Sending request headers:\n%s", reqdebug); ne_free(reqdebug); } } #else #define DEBUG_DUMP_REQUEST(x) #endif /* DEBUGGING */ /* remove trailing EOL from 'buf', where strlen(buf) == *len. *len is * adjusted in accordance with any changes made to the string to * remain equal to strlen(buf). */ static inline void strip_eol(char *buf, ssize_t *len) { char *pnt = buf + *len - 1; while (pnt >= buf && (*pnt == '\r' || *pnt == '\n')) { *pnt-- = '\0'; (*len)--; } } /* Read and parse response status-line into 'status'. 'retry' is non-zero * if an NE_RETRY should be returned if an EOF is received. */ static int read_status_line(ne_request *req, ne_status *status, int retry) { char *buffer = req->respbuf; ssize_t ret; ret = ne_sock_readline(req->session->socket, buffer, sizeof req->respbuf); if (ret <= 0) { int aret = aborted(req, _("Could not read status line"), ret); return RETRY_RET(retry, ret, aret); } NE_DEBUG(NE_DBG_HTTP, "[status-line] < %s", buffer); strip_eol(buffer, &ret); if (status->reason_phrase) ne_free(status->reason_phrase); memset(status, 0, sizeof *status); /* Hack to allow ShoutCast-style servers, if requested. */ if (req->session->flags[NE_SESSFLAG_ICYPROTO] && strncmp(buffer, "ICY ", 4) == 0 && strlen(buffer) > 8 && buffer[7] == ' ') { status->code = atoi(buffer + 4); status->major_version = 1; status->minor_version = 0; status->reason_phrase = ne_strclean(ne_strdup(buffer + 8)); status->klass = buffer[4] - '0'; NE_DEBUG(NE_DBG_HTTP, "[status-line] ICY protocol; code %d\n", status->code); } else if (ne_parse_statusline(buffer, status)) { return aborted(req, _("Could not parse response status line"), 0); } return 0; } /* Discard a set of message headers. */ static int discard_headers(ne_request *req) { do { SOCK_ERR(req, ne_sock_readline(req->session->socket, req->respbuf, sizeof req->respbuf), _("Could not read interim response headers")); NE_DEBUG(NE_DBG_HTTP, "[discard] < %s", req->respbuf); } while (strcmp(req->respbuf, EOL) != 0); return NE_OK; } /* Send the request, and read the response Status-Line. Returns: * NE_RETRY connection closed by server; persistent connection * timeout * NE_OK success * NE_* error * On NE_RETRY and NE_* responses, the connection will have been * closed already. */ static int send_request(ne_request *req, const ne_buffer *request) { ne_session *const sess = req->session; ne_status *const status = &req->status; int sentbody = 0; /* zero until body has been sent. */ int ret, retry; /* retry non-zero whilst the request should be retried */ ssize_t sret; /* Send the Request-Line and headers */ NE_DEBUG(NE_DBG_HTTP, "Sending request-line and headers:\n"); /* Open the connection if necessary */ ret = open_connection(sess); if (ret) return ret; /* Allow retry if a persistent connection has been used. */ retry = sess->persisted; sret = ne_sock_fullwrite(req->session->socket, request->data, ne_buffer_size(request)); if (sret < 0) { int aret = aborted(req, _("Could not send request"), sret); return RETRY_RET(retry, sret, aret); } if (!req->flags[NE_REQFLAG_EXPECT100] && req->body_length > 0) { /* Send request body, if not using 100-continue. */ ret = send_request_body(req, retry); if (ret) { return ret; } } NE_DEBUG(NE_DBG_HTTP, "Request sent; retry is %d.\n", retry); /* Loop eating interim 1xx responses (RFC2616 says these MAY be * sent by the server, even if 100-continue is not used). */ while ((ret = read_status_line(req, status, retry)) == NE_OK && status->klass == 1) { NE_DEBUG(NE_DBG_HTTP, "Interim %d response.\n", status->code); retry = 0; /* successful read() => never retry now. */ /* Discard headers with the interim response. */ if ((ret = discard_headers(req)) != NE_OK) break; if (req->flags[NE_REQFLAG_EXPECT100] && (status->code == 100) && req->body_length > 0 && !sentbody) { /* Send the body after receiving the first 100 Continue */ if ((ret = send_request_body(req, 0)) != NE_OK) break; sentbody = 1; } } return ret; } /* Read a message header from sock into buf, which has size 'buflen'. * * Returns: * NE_RETRY: Success, read a header into buf. * NE_OK: End of headers reached. * NE_ERROR: Error (session error is set, connection closed). */ static int read_message_header(ne_request *req, char *buf, size_t buflen) { ssize_t n; ne_socket *sock = req->session->socket; n = ne_sock_readline(sock, buf, buflen); if (n <= 0) return aborted(req, _("Error reading response headers"), n); NE_DEBUG(NE_DBG_HTTP, "[hdr] %s", buf); strip_eol(buf, &n); if (n == 0) { NE_DEBUG(NE_DBG_HTTP, "End of headers.\n"); return NE_OK; } buf += n; buflen -= n; while (buflen > 0) { char ch; /* Collect any extra lines into buffer */ SOCK_ERR(req, ne_sock_peek(sock, &ch, 1), _("Error reading response headers")); if (ch != ' ' && ch != '\t') { /* No continuation of this header: stop reading. */ return NE_RETRY; } /* Otherwise, read the next line onto the end of 'buf'. */ n = ne_sock_readline(sock, buf, buflen); if (n <= 0) { return aborted(req, _("Error reading response headers"), n); } NE_DEBUG(NE_DBG_HTTP, "[cont] %s", buf); strip_eol(buf, &n); /* assert(buf[0] == ch), which implies len(buf) > 0. * Otherwise the TCP stack is lying, but we'll be paranoid. * This might be a \t, so replace it with a space to be * friendly to applications (2616 says we MAY do this). */ if (n) buf[0] = ' '; /* ready for the next header. */ buf += n; buflen -= n; } ne_set_error(req->session, _("Response header too long")); return NE_ERROR; } #define MAX_HEADER_LEN (8192) /* Add a respnose header field for the given request, using * precalculated hash value. */ static void add_response_header(ne_request *req, unsigned int hash, char *name, char *value) { struct field **nextf = &req->response_headers[hash]; size_t vlen = strlen(value); while (*nextf) { struct field *const f = *nextf; if (strcmp(f->name, name) == 0) { if (vlen + f->vlen < MAX_HEADER_LEN) { /* merge the header field */ f->value = ne_realloc(f->value, f->vlen + vlen + 3); memcpy(f->value + f->vlen, ", ", 2); memcpy(f->value + f->vlen + 2, value, vlen + 1); f->vlen += vlen + 2; } return; } nextf = &f->next; } (*nextf) = ne_malloc(sizeof **nextf); (*nextf)->name = ne_strdup(name); (*nextf)->value = ne_strdup(value); (*nextf)->vlen = vlen; (*nextf)->next = NULL; } /* Read response headers. Returns NE_* code, sets session error and * closes connection on error. */ static int read_response_headers(ne_request *req) { char hdr[MAX_HEADER_LEN]; int ret, count = 0; while ((ret = read_message_header(req, hdr, sizeof hdr)) == NE_RETRY && ++count < MAX_HEADER_FIELDS) { char *pnt; unsigned int hash = 0; /* Strip any trailing whitespace */ pnt = hdr + strlen(hdr) - 1; while (pnt > hdr && (*pnt == ' ' || *pnt == '\t')) *pnt-- = '\0'; /* Convert the header name to lower case and hash it. */ for (pnt = hdr; (*pnt != '\0' && *pnt != ':' && *pnt != ' ' && *pnt != '\t'); pnt++) { *pnt = ne_tolower(*pnt); hash = HH_ITERATE(hash,*pnt); } /* Skip over any whitespace before the colon. */ while (*pnt == ' ' || *pnt == '\t') *pnt++ = '\0'; /* ignore header lines which lack a ':'. */ if (*pnt != ':') continue; /* NUL-terminate at the colon (when no whitespace before) */ *pnt++ = '\0'; /* Skip any whitespace after the colon... */ while (*pnt == ' ' || *pnt == '\t') pnt++; /* pnt now points to the header value. */ NE_DEBUG(NE_DBG_HTTP, "Header Name: [%s], Value: [%s]\n", hdr, pnt); add_response_header(req, hash, hdr, pnt); } if (count == MAX_HEADER_FIELDS) ret = aborted( req, _("Response exceeded maximum number of header fields"), 0); return ret; } /* Perform any necessary DNS lookup for the host given by *info; * return NE_ code. */ static int lookup_host(ne_session *sess, struct host_info *info) { if (sess->addrlist) return NE_OK; NE_DEBUG(NE_DBG_HTTP, "Doing DNS lookup on %s...\n", info->hostname); sess->status.lu.hostname = info->hostname; notify_status(sess, ne_status_lookup); info->address = ne_addr_resolve(info->hostname, 0); if (ne_addr_result(info->address)) { char buf[256]; ne_set_error(sess, _("Could not resolve hostname `%s': %s"), info->hostname, ne_addr_error(info->address, buf, sizeof buf)); ne_addr_destroy(info->address); info->address = NULL; return NE_LOOKUP; } else { return NE_OK; } } int ne_begin_request(ne_request *req) { struct body_reader *rdr; ne_buffer *data; const ne_status *const st = &req->status; const char *value; struct hook *hk; int ret, forced_closure = 0; /* If a non-idempotent request is sent on a persisted connection, * then it is impossible to distinguish between a server failure * and a connection timeout if an EOF/RST is received. So don't * do that. */ if (!req->flags[NE_REQFLAG_IDEMPOTENT] && req->session->persisted && !req->session->flags[NE_SESSFLAG_CONNAUTH]) { NE_DEBUG(NE_DBG_HTTP, "req: Closing connection for non-idempotent " "request.\n"); ne_close_connection(req->session); } /* Build the request string, and send it */ data = build_request(req); DEBUG_DUMP_REQUEST(data->data); ret = send_request(req, data); /* Retry this once after a persistent connection timeout. */ if (ret == NE_RETRY) { NE_DEBUG(NE_DBG_HTTP, "Persistent connection timed out, retrying.\n"); ret = send_request(req, data); } ne_buffer_destroy(data); if (ret != NE_OK) return ret == NE_RETRY ? NE_ERROR : ret; /* Determine whether server claims HTTP/1.1 compliance. */ req->session->is_http11 = (st->major_version == 1 && st->minor_version > 0) || st->major_version > 1; /* Persistent connections supported implicitly in HTTP/1.1 */ if (req->session->is_http11) req->can_persist = 1; ne_set_error(req->session, "%d %s", st->code, st->reason_phrase); /* Empty the response header hash, in case this request was * retried: */ free_response_headers(req); /* Read the headers */ ret = read_response_headers(req); if (ret) return ret; /* check the Connection header */ value = get_response_header_hv(req, HH_HV_CONNECTION, "connection"); if (value) { char *vcopy = ne_strdup(value), *ptr = vcopy; do { char *token = ne_shave(ne_token(&ptr, ','), " \t"); unsigned int hash = hash_and_lower(token); if (strcmp(token, "close") == 0) { req->can_persist = 0; forced_closure = 1; } else if (strcmp(token, "keep-alive") == 0) { req->can_persist = 1; } else if (!req->session->is_http11 && strcmp(token, "connection")) { /* Strip the header per 2616§14.10, last para. Avoid * danger from "Connection: connection". */ remove_response_header(req, token, hash); } } while (ptr); ne_free(vcopy); } /* Support "Proxy-Connection: keep-alive" for compatibility with * some HTTP/1.0 proxies; it is risky to do this, because an * intermediary proxy may not support this HTTP/1.0 extension, but * will not strip the header either. Persistent connection * support is enabled based on the presence of this header if: * a) it is *necessary* to do so due to the use of a connection-auth * scheme, and * b) connection closure was not forced via "Connection: close". */ if (req->session->use_proxy && !req->session->is_http11 && !forced_closure && req->session->flags[NE_SESSFLAG_CONNAUTH]) { value = get_response_header_hv(req, HH_HV_PROXY_CONNECTION, "proxy-connection"); if (value && ne_strcasecmp(value, "keep-alive") == 0) { NE_DEBUG(NE_DBG_HTTP, "req: Using persistent connection " "for HTTP/1.0 proxy requiring conn-auth hack.\n"); req->can_persist = 1; } } /* Decide which method determines the response message-length per * 2616§4.4 (multipart/byteranges is not supported): */ #ifdef NE_HAVE_SSL /* Special case for CONNECT handling: the response has no body, * and the connection can persist. */ if (req->session->in_connect && st->klass == 2) { req->resp.mode = R_NO_BODY; req->can_persist = 1; } else #endif /* HEAD requests and 204, 304 responses have no response body, * regardless of what headers are present. */ if (req->method_is_head || st->code == 204 || st->code == 304) { req->resp.mode = R_NO_BODY; } /* Broken intermediaries exist which use "transfer-encoding: identity" * to mean "no transfer-coding". So that case must be ignored. */ else if ((value = get_response_header_hv(req, HH_HV_TRANSFER_ENCODING, "transfer-encoding")) != NULL && ne_strcasecmp(value, "identity") != 0) { /* Otherwise, fail iff an unknown transfer-coding is used. */ if (ne_strcasecmp(value, "chunked") == 0) { req->resp.mode = R_CHUNKED; req->resp.body.chunk.remain = 0; } else { return aborted(req, _("Unknown transfer-coding in response"), 0); } } else if ((value = get_response_header_hv(req, HH_HV_CONTENT_LENGTH, "content-length")) != NULL) { ne_off_t len = ne_strtoff(value, NULL, 10); if (len != NE_OFFT_MAX && len >= 0) { req->resp.mode = R_CLENGTH; req->resp.body.clen.total = req->resp.body.clen.remain = len; } else { /* fail for an invalid content-length header. */ return aborted(req, _("Invalid Content-Length in response"), 0); } } else { req->resp.mode = R_TILLEOF; /* otherwise: read-till-eof mode */ } NE_DEBUG(NE_DBG_HTTP, "Running post_headers hooks\n"); for (hk = req->session->post_headers_hooks; hk != NULL; hk = hk->next) { ne_post_headers_fn fn = (ne_post_headers_fn)hk->fn; fn(req, hk->userdata, &req->status); } /* Prepare for reading the response entity-body. Call each of the * body readers and ask them whether they want to accept this * response or not. */ for (rdr = req->body_readers; rdr != NULL; rdr=rdr->next) { rdr->use = rdr->accept_response(rdr->userdata, req, st); } req->session->status.sr.progress = 0; req->session->status.sr.total = req->resp.mode == R_CLENGTH ? req->resp.body.clen.total : -1; notify_status(req->session, ne_status_recving); return NE_OK; } int ne_end_request(ne_request *req) { struct hook *hk; int ret; /* Read headers in chunked trailers */ if (req->resp.mode == R_CHUNKED) { ret = read_response_headers(req); if (ret) return ret; } else { ret = NE_OK; } NE_DEBUG(NE_DBG_HTTP, "Running post_send hooks\n"); for (hk = req->session->post_send_hooks; ret == NE_OK && hk != NULL; hk = hk->next) { ne_post_send_fn fn = (ne_post_send_fn)hk->fn; ret = fn(req, hk->userdata, &req->status); } /* Close the connection if persistent connections are disabled or * not supported by the server. */ if (!req->session->flags[NE_SESSFLAG_PERSIST] || !req->can_persist) ne_close_connection(req->session); else req->session->persisted = 1; return ret; } int ne_read_response_to_fd(ne_request *req, int fd) { ssize_t len; while ((len = ne_read_response_block(req, req->respbuf, sizeof req->respbuf)) > 0) { const char *block = req->respbuf; do { ssize_t ret = write(fd, block, len); if (ret == -1 && errno == EINTR) { continue; } else if (ret < 0) { char err[200]; ne_strerror(errno, err, sizeof err); ne_set_error(ne_get_session(req), _("Could not write to file: %s"), err); return NE_ERROR; } else { len -= ret; block += ret; } } while (len > 0); } return len == 0 ? NE_OK : NE_ERROR; } int ne_discard_response(ne_request *req) { ssize_t len; do { len = ne_read_response_block(req, req->respbuf, sizeof req->respbuf); } while (len > 0); return len == 0 ? NE_OK : NE_ERROR; } int ne_request_dispatch(ne_request *req) { int ret; do { ret = ne_begin_request(req); if (ret == NE_OK) ret = ne_discard_response(req); if (ret == NE_OK) ret = ne_end_request(req); } while (ret == NE_RETRY); NE_DEBUG(NE_DBG_HTTP | NE_DBG_FLUSH, "Request ends, status %d class %dxx, error line:\n%s\n", req->status.code, req->status.klass, req->session->error); return ret; } const ne_status *ne_get_status(const ne_request *req) { return &req->status; } ne_session *ne_get_session(const ne_request *req) { return req->session; } #ifdef NE_HAVE_SSL /* Create a CONNECT tunnel through the proxy server. * Returns HTTP_* */ static int proxy_tunnel(ne_session *sess) { /* Hack up an HTTP CONNECT request... */ ne_request *req; int ret = NE_OK; char ruri[200]; /* Can't use server.hostport here; Request-URI must include `:port' */ ne_snprintf(ruri, sizeof ruri, "%s:%u", sess->server.hostname, sess->server.port); req = ne_request_create(sess, "CONNECT", ruri); sess->in_connect = 1; ret = ne_request_dispatch(req); sess->in_connect = 0; sess->persisted = 0; /* don't treat this is a persistent connection. */ if (ret != NE_OK || !sess->connected || req->status.klass != 2) { char *err = ne_strdup(sess->error); ne_set_error(sess, _("Could not create SSL connection " "through proxy server: %s"), err); ne_free(err); if (ret == NE_OK) ret = NE_ERROR; } ne_request_destroy(req); return ret; } #endif /* Return the first resolved address for the given host. */ static const ne_inet_addr *resolve_first(ne_session *sess, struct host_info *host) { if (sess->addrlist) { sess->curaddr = 0; return sess->addrlist[0]; } else { return ne_addr_first(host->address); } } /* Return the next resolved address for the given host or NULL if * there are no more addresses. */ static const ne_inet_addr *resolve_next(ne_session *sess, struct host_info *host) { if (sess->addrlist) { if (sess->curaddr++ < sess->numaddrs) return sess->addrlist[sess->curaddr]; else return NULL; } else { return ne_addr_next(host->address); } } /* Make new TCP connection to server at 'host' of type 'name'. Note * that once a connection to a particular network address has * succeeded, that address will be used first for the next attempt to * connect. */ static int do_connect(ne_session *sess, struct host_info *host, const char *err) { int ret; if ((sess->socket = ne_sock_create()) == NULL) { ne_set_error(sess, _("Could not create socket")); return NE_ERROR; } if (sess->cotimeout) ne_sock_connect_timeout(sess->socket, sess->cotimeout); if (sess->local_addr) ne_sock_prebind(sess->socket, sess->local_addr, 0); if (host->current == NULL) host->current = resolve_first(sess, host); sess->status.ci.hostname = host->hostname; do { sess->status.ci.address = host->current; notify_status(sess, ne_status_connecting); #ifdef NE_DEBUGGING if (ne_debug_mask & NE_DBG_HTTP) { char buf[150]; NE_DEBUG(NE_DBG_HTTP, "Connecting to %s\n", ne_iaddr_print(host->current, buf, sizeof buf)); } #endif ret = ne_sock_connect(sess->socket, host->current, host->port); } while (ret && /* try the next address... */ (host->current = resolve_next(sess, host)) != NULL); if (ret) { ne_set_error(sess, "%s: %s", err, ne_sock_error(sess->socket)); ne_sock_close(sess->socket); return ret == NE_SOCK_TIMEOUT ? NE_TIMEOUT : NE_CONNECT; } notify_status(sess, ne_status_connected); if (sess->rdtimeout) ne_sock_read_timeout(sess->socket, sess->rdtimeout); sess->connected = 1; /* clear persistent connection flag. */ sess->persisted = 0; return NE_OK; } static int open_connection(ne_session *sess) { int ret; struct host_info *host; if (sess->connected) return NE_OK; /* Resolve hostname if necessary. */ host = sess->use_proxy ? &sess->proxy : &sess->server; if (host->address == NULL) { ret = lookup_host(sess, host); if (ret) return ret; } ret = do_connect(sess, host, sess->use_proxy ? _("Could not connect to proxy server") : _("Could not connect to server")); if (ret != NE_OK) return ret; #ifdef NE_HAVE_SSL /* Negotiate SSL layer if required. */ if (sess->use_ssl && !sess->in_connect) { /* CONNECT tunnel */ if (sess->use_proxy) ret = proxy_tunnel(sess); if (ret == NE_OK) { ret = ne__negotiate_ssl(sess); if (ret != NE_OK) ne_close_connection(sess); } } #endif return ret; } sitecopy-0.16.6/lib/neon/ne_props.c0000664000076400007640000004467210750123773015311 0ustar joejoe/* WebDAV property manipulation Copyright (C) 2000-2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include "ne_alloc.h" #include "ne_xml.h" #include "ne_props.h" #include "ne_basic.h" #include "ne_locks.h" #include "ne_internal.h" /* don't store flat props with a value > 10K */ #define MAX_FLATPROP_LEN (102400) struct ne_propfind_handler_s { ne_session *sess; ne_request *request; int has_props; /* whether we've already written some * props to the body. */ ne_buffer *body; ne_207_parser *parser207; ne_xml_parser *parser; /* Creator/destructor callbacks. */ ne_props_create_complex creator; ne_props_destroy_complex destructor; void *cd_userdata; /* Current propset, or NULL if none being processed. */ ne_prop_result_set *current; ne_buffer *value; /* current flat property value */ int depth; /* nesting depth within a flat property */ ne_props_result callback; void *userdata; }; #define ELM_flatprop (NE_207_STATE_TOP - 1) /* We build up the results of one 'response' element in memory. */ struct prop { char *name, *nspace, *value, *lang; /* Store a ne_propname here too, for convienience. pname.name = * name, pname.nspace = nspace, but they are const'ed in pname. */ ne_propname pname; }; #define NSPACE(x) ((x) ? (x) : "") struct propstat { struct prop *props; int numprops; ne_status status; }; /* Results set. */ struct ne_prop_result_set_s { struct propstat *pstats; int numpstats, counter; void *private; ne_uri uri; }; #define MAX_PROP_COUNTER (1024) static int startelm(void *userdata, int state, const char *name, const char *nspace, const char **atts); static int endelm(void *userdata, int state, const char *name, const char *nspace); /* Handle character data; flat property value. */ static int chardata(void *userdata, int state, const char *data, size_t len) { ne_propfind_handler *hdl = userdata; if (state == ELM_flatprop && hdl->value->length < MAX_FLATPROP_LEN) ne_buffer_append(hdl->value, data, len); return 0; } ne_xml_parser *ne_propfind_get_parser(ne_propfind_handler *handler) { return handler->parser; } ne_request *ne_propfind_get_request(ne_propfind_handler *handler) { return handler->request; } static int propfind(ne_propfind_handler *handler, ne_props_result results, void *userdata) { int ret; ne_request *req = handler->request; /* Register the flat property handler to catch any properties * which the user isn't handling as 'complex'. */ ne_xml_push_handler(handler->parser, startelm, chardata, endelm, handler); handler->callback = results; handler->userdata = userdata; ne_set_request_body_buffer(req, handler->body->data, ne_buffer_size(handler->body)); ne_add_request_header(req, "Content-Type", NE_XML_MEDIA_TYPE); ne_add_response_body_reader(req, ne_accept_207, ne_xml_parse_v, handler->parser); ret = ne_request_dispatch(req); if (ret == NE_OK && ne_get_status(req)->klass != 2) { ret = NE_ERROR; } else if (ne_xml_failed(handler->parser)) { ne_set_error(handler->sess, "%s", ne_xml_get_error(handler->parser)); ret = NE_ERROR; } return ret; } static void set_body(ne_propfind_handler *hdl, const ne_propname *names) { ne_buffer *body = hdl->body; int n; if (!hdl->has_props) { ne_buffer_czappend(body, "\n"); hdl->has_props = 1; } for (n = 0; names[n].name != NULL; n++) { ne_buffer_concat(body, "<", names[n].name, " xmlns=\"", NSPACE(names[n].nspace), "\"/>\n", NULL); } } int ne_propfind_allprop(ne_propfind_handler *handler, ne_props_result results, void *userdata) { ne_buffer_czappend(handler->body, "\n"); return propfind(handler, results, userdata); } int ne_propfind_named(ne_propfind_handler *handler, const ne_propname *props, ne_props_result results, void *userdata) { set_body(handler, props); ne_buffer_czappend(handler->body, "\n"); return propfind(handler, results, userdata); } /* The easy one... PROPPATCH */ int ne_proppatch(ne_session *sess, const char *uri, const ne_proppatch_operation *items) { ne_request *req = ne_request_create(sess, "PROPPATCH", uri); ne_buffer *body = ne_buffer_create(); int n, ret; /* Create the request body */ ne_buffer_czappend(body, "\n" ""); for (n = 0; items[n].name != NULL; n++) { const char *elm = (items[n].type == ne_propset) ? "set" : "remove"; /* value */ ne_buffer_concat(body, "" "<", items[n].name->name, NULL); if (items[n].name->nspace) { ne_buffer_concat(body, " xmlns=\"", items[n].name->nspace, "\"", NULL); } if (items[n].type == ne_propset) { ne_buffer_concat(body, ">", items[n].value, NULL); } else { ne_buffer_append(body, ">", 1); } ne_buffer_concat(body, "name, ">\n", NULL); } ne_buffer_czappend(body, "\n"); ne_set_request_body_buffer(req, body->data, ne_buffer_size(body)); ne_add_request_header(req, "Content-Type", NE_XML_MEDIA_TYPE); #ifdef NE_HAVE_DAV ne_lock_using_resource(req, uri, NE_DEPTH_ZERO); #endif ret = ne_simple_request(sess, req); ne_buffer_destroy(body); return ret; } /* Compare two property names. */ static int pnamecmp(const ne_propname *pn1, const ne_propname *pn2) { if (pn1->nspace == NULL && pn2->nspace != NULL) { return 1; } else if (pn1->nspace != NULL && pn2->nspace == NULL) { return -1; } else if (pn1->nspace == NULL) { return strcmp(pn1->name, pn2->name); } else { return (strcmp(pn1->nspace, pn2->nspace) || strcmp(pn1->name, pn2->name)); } } /* Find property in 'set' with name 'pname'. If found, set pstat_ret * to the containing propstat, likewise prop_ret, and returns zero. * If not found, returns non-zero. */ static int findprop(const ne_prop_result_set *set, const ne_propname *pname, struct propstat **pstat_ret, struct prop **prop_ret) { int ps, p; for (ps = 0; ps < set->numpstats; ps++) { for (p = 0; p < set->pstats[ps].numprops; p++) { struct prop *prop = &set->pstats[ps].props[p]; if (pnamecmp(&prop->pname, pname) == 0) { if (pstat_ret != NULL) *pstat_ret = &set->pstats[ps]; if (prop_ret != NULL) *prop_ret = prop; return 0; } } } return -1; } const char *ne_propset_value(const ne_prop_result_set *set, const ne_propname *pname) { struct prop *prop; if (findprop(set, pname, NULL, &prop)) { return NULL; } else { return prop->value; } } const char *ne_propset_lang(const ne_prop_result_set *set, const ne_propname *pname) { struct prop *prop; if (findprop(set, pname, NULL, &prop)) { return NULL; } else { return prop->lang; } } void *ne_propfind_current_private(ne_propfind_handler *handler) { return handler->current ? handler->current->private : NULL; } void *ne_propset_private(const ne_prop_result_set *set) { return set->private; } int ne_propset_iterate(const ne_prop_result_set *set, ne_propset_iterator iterator, void *userdata) { int ps, p; for (ps = 0; ps < set->numpstats; ps++) { for (p = 0; p < set->pstats[ps].numprops; p++) { struct prop *prop = &set->pstats[ps].props[p]; int ret = iterator(userdata, &prop->pname, prop->value, &set->pstats[ps].status); if (ret) return ret; } } return 0; } const ne_status *ne_propset_status(const ne_prop_result_set *set, const ne_propname *pname) { struct propstat *pstat; if (findprop(set, pname, &pstat, NULL)) { /* TODO: it is tempting to return a dummy status object here * rather than NULL, which says "Property result was not given * by server." but I'm not sure if this is best left to the * client. */ return NULL; } else { return &pstat->status; } } static void *start_response(void *userdata, const ne_uri *uri) { ne_prop_result_set *set = ne_calloc(sizeof(*set)); ne_propfind_handler *hdl = userdata; ne_uri_copy(&set->uri, uri); if (hdl->creator) { set->private = hdl->creator(hdl->cd_userdata, &set->uri); } hdl->current = set; return set; } static void *start_propstat(void *userdata, void *response) { ne_prop_result_set *set = response; ne_propfind_handler *hdl = userdata; struct propstat *pstat; int n; if (++hdl->current->counter == MAX_PROP_COUNTER) { ne_xml_set_error(hdl->parser, _("Response exceeds maximum property count")); return NULL; } n = set->numpstats; set->pstats = ne_realloc(set->pstats, sizeof(struct propstat) * (n+1)); set->numpstats = n+1; pstat = &set->pstats[n]; memset(pstat, 0, sizeof(*pstat)); /* And return this as the new pstat. */ return &set->pstats[n]; } static int startelm(void *userdata, int parent, const char *nspace, const char *name, const char **atts) { ne_propfind_handler *hdl = userdata; struct propstat *pstat = ne_207_get_current_propstat(hdl->parser207); struct prop *prop; int n; const char *lang; /* Just handle all children of propstat and their descendants. */ if ((parent != NE_207_STATE_PROP && parent != ELM_flatprop) || pstat == NULL) return NE_XML_DECLINE; if (parent == ELM_flatprop) { /* collecting the flatprop value. */ hdl->depth++; if (hdl->value->used < MAX_FLATPROP_LEN) { const char **a = atts; ne_buffer_concat(hdl->value, "<", nspace, name, NULL); while (a[0] && hdl->value->used < MAX_FLATPROP_LEN) { const char *nsep = strchr(a[0], ':'), *pfx; /* Resolve the attribute namespace prefix, if any. * Ignore a failure to resolve the namespace prefix. */ pfx = nsep ? ne_xml_resolve_nspace(hdl->parser, a[0], nsep - a[0]) : NULL; if (pfx) { ne_buffer_concat(hdl->value, " ", pfx, nsep + 1, "='", a[1], "'", NULL); } else { ne_buffer_concat(hdl->value, " ", a[0], "='", a[1], "'", NULL); } a += 2; } ne_buffer_czappend(hdl->value, ">"); } return ELM_flatprop; } /* Enforce maximum number of properties per resource to prevent a * memory exhaustion attack by a hostile server. */ if (++hdl->current->counter == MAX_PROP_COUNTER) { ne_xml_set_error(hdl->parser, _("Response exceeds maximum property count")); return NE_XML_ABORT; } /* Add a property to this propstat */ n = pstat->numprops; pstat->props = ne_realloc(pstat->props, sizeof(struct prop) * (n + 1)); pstat->numprops = n+1; /* Fill in the new property. */ prop = &pstat->props[n]; prop->pname.name = prop->name = ne_strdup(name); if (nspace[0] == '\0') { prop->pname.nspace = prop->nspace = NULL; } else { prop->pname.nspace = prop->nspace = ne_strdup(nspace); } prop->value = NULL; NE_DEBUG(NE_DBG_XML, "Got property #%d: {%s}%s.\n", n, NSPACE(prop->nspace), prop->name); /* This is under discussion at time of writing (April '01), and it * looks like we need to retrieve the xml:lang property from any * element here or above. * * Also, I think we might need attribute namespace handling here. */ lang = ne_xml_get_attr(hdl->parser, atts, NULL, "xml:lang"); if (lang != NULL) { prop->lang = ne_strdup(lang); NE_DEBUG(NE_DBG_XML, "Property language is %s\n", prop->lang); } else { prop->lang = NULL; } hdl->depth = 0; return ELM_flatprop; } static int endelm(void *userdata, int state, const char *nspace, const char *name) { ne_propfind_handler *hdl = userdata; struct propstat *pstat = ne_207_get_current_propstat(hdl->parser207); int n; if (hdl->depth > 0) { /* nested. */ if (hdl->value->used < MAX_FLATPROP_LEN) ne_buffer_concat(hdl->value, "", NULL); hdl->depth--; } else { /* end of the current property value */ n = pstat->numprops - 1; pstat->props[n].value = ne_buffer_finish(hdl->value); hdl->value = ne_buffer_create(); } return 0; } static void end_propstat(void *userdata, void *pstat_v, const ne_status *status, const char *description) { struct propstat *pstat = pstat_v; /* Nothing to do if no status was given. */ if (!status) return; /* If we get a non-2xx response back here, we wipe the value for * each of the properties in this propstat, so the caller knows to * look at the status instead. It's annoying, since for each prop * we will have done an unnecessary strdup("") above, but there is * no easy way round that given the fact that we don't know * whether we've got an error or not till after we get the * property element. * * Interestingly IIS breaks the 2518 DTD and puts the status * element first in the propstat. This is useful since then we * *do* know whether each subsequent empty prop element means, but * we can't rely on that here. */ if (status->klass != 2) { int n; for (n = 0; n < pstat->numprops; n++) { ne_free(pstat->props[n].value); pstat->props[n].value = NULL; } } /* copy the status structure, and dup the reason phrase. */ pstat->status = *status; pstat->status.reason_phrase = ne_strdup(status->reason_phrase); } /* Frees up a results set */ static void free_propset(ne_propfind_handler *handler, ne_prop_result_set *set) { int n; if (handler->destructor && set->private) { handler->destructor(handler->cd_userdata, set->private); } for (n = 0; n < set->numpstats; n++) { int m; struct propstat *p = &set->pstats[n]; for (m = 0; m < p->numprops; m++) { if (p->props[m].nspace) ne_free(p->props[m].nspace); ne_free(p->props[m].name); if (p->props[m].lang) ne_free(p->props[m].lang); if (p->props[m].value) ne_free(p->props[m].value); p->props[m].nspace = p->props[m].lang = p->props[m].value = NULL; } if (p->status.reason_phrase) ne_free(p->status.reason_phrase); if (p->props) ne_free(p->props); } if (set->pstats) ne_free(set->pstats); ne_uri_free(&set->uri); ne_free(set); } static void end_response(void *userdata, void *resource, const ne_status *status, const char *description) { ne_propfind_handler *handler = userdata; ne_prop_result_set *set = resource; /* Pass back the results for this resource. */ if (handler->callback && set->numpstats > 0) handler->callback(handler->userdata, &set->uri, set); /* Clean up the propset tree we've just built. */ free_propset(handler, set); handler->current = NULL; } ne_propfind_handler * ne_propfind_create(ne_session *sess, const char *uri, int depth) { ne_propfind_handler *ret = ne_calloc(sizeof(ne_propfind_handler)); ne_uri base = {0}; ne_fill_server_uri(sess, &base); base.path = ne_strdup(uri); ret->parser = ne_xml_create(); ret->parser207 = ne_207_create(ret->parser, &base, ret); ret->sess = sess; ret->body = ne_buffer_create(); ret->request = ne_request_create(sess, "PROPFIND", uri); ret->value = ne_buffer_create(); ne_add_depth_header(ret->request, depth); ne_207_set_response_handlers(ret->parser207, start_response, end_response); ne_207_set_propstat_handlers(ret->parser207, start_propstat, end_propstat); /* The start of the request body is fixed: */ ne_buffer_czappend(ret->body, "\n" ""); ne_uri_free(&base); return ret; } /* Destroy a propfind handler */ void ne_propfind_destroy(ne_propfind_handler *handler) { ne_buffer_destroy(handler->value); if (handler->current) free_propset(handler, handler->current); ne_207_destroy(handler->parser207); ne_xml_destroy(handler->parser); ne_buffer_destroy(handler->body); ne_request_destroy(handler->request); ne_free(handler); } int ne_simple_propfind(ne_session *sess, const char *href, int depth, const ne_propname *props, ne_props_result results, void *userdata) { ne_propfind_handler *hdl; int ret; hdl = ne_propfind_create(sess, href, depth); if (props != NULL) { ret = ne_propfind_named(hdl, props, results, userdata); } else { ret = ne_propfind_allprop(hdl, results, userdata); } ne_propfind_destroy(hdl); return ret; } int ne_propnames(ne_session *sess, const char *href, int depth, ne_props_result results, void *userdata) { ne_propfind_handler *hdl; int ret; hdl = ne_propfind_create(sess, href, depth); ne_buffer_czappend(hdl->body, ""); ret = propfind(hdl, results, userdata); ne_propfind_destroy(hdl); return ret; } void ne_propfind_set_private(ne_propfind_handler *hdl, ne_props_create_complex creator, ne_props_destroy_complex destructor, void *userdata) { hdl->creator = creator; hdl->destructor = destructor; hdl->cd_userdata = userdata; } sitecopy-0.16.6/lib/neon/ne_string.h0000664000076400007640000001545210646610645015456 0ustar joejoe/* String utility functions Copyright (C) 1999-2007, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_STRING_H #define NE_STRING_H #include "ne_defs.h" #include "ne_alloc.h" #include NE_BEGIN_DECLS /* ne_token and ne_qtoken return the next token in *str before either * the next separator character 'sep' or the NUL terminator. * ne_qtoken skips over any parts quoted using a pair of any one of * the characters given in 'quotes'. After returning, *str will point * to the next character after the separator, or NULL if no separator * character was found. * * ne_qtoken will return NULL if unterminated quotes are found. */ char *ne_token(char **str, char sep); char *ne_qtoken(char **str, char sep, const char *quotes); /* Return portion of 'str' with any characters in 'whitespace' shaved * off the beginning and end. Modifies str in-place. */ char *ne_shave(char *str, const char *whitespace); /* Cleanse 'str' of non-printable (e.g. control) characters. 'str' is * modified in-place, and returned. */ char *ne_strclean(char *str); /* Encode 'len' bytes of 'text' to base64. Returns malloc-allocated * NUL-terminated buffer which the caller must free(). */ char *ne_base64(const unsigned char *text, size_t len); /* Decode NUL-terminated base64-encoded string 'data', placing * malloc-allocated raw decoder output in '*out'. Returns length, or * zero on decode error (in which case the content of *out is * undefined). */ size_t ne_unbase64(const char *data, unsigned char **out); /* Dynamically-allocated string buffer. A string buffer which grows * dynamically . (Strings are zero-terminated still). A * string buffer ne_buffer which grows dynamically with the string. */ typedef struct { char *data; /* contents: NUL-terminated string */ size_t used; /* strlen(data) + 1 */ size_t length; /* number of bytes allocated */ } ne_buffer; /* Create a new string buffer object. */ ne_buffer *ne_buffer_create(void); /* Create a new string buffer object with at least 'size' bytes of * allocated space. */ ne_buffer *ne_buffer_ncreate(size_t size); /* Returns size of data in buffer, equiv to strlen(ne_buffer_data(buf)) */ #define ne_buffer_size(buf) ((buf)->used - 1) /* Concatenate all given strings onto the end of the buffer. The * strings must all be NUL-terminated, and MUST be followed by a NULL * argument marking the end of the list. */ void ne_buffer_concat(ne_buffer *buf, ...); /* Append a NUL-terminated string 'str' to buf. */ void ne_buffer_zappend(ne_buffer *buf, const char *str); /* Append 'len' bytes of 'data' to buf, where 'data' does not contain * a NUL terminator. (A NUL terminator is appended to buf) */ void ne_buffer_append(ne_buffer *buf, const char *data, size_t len); /* Print a string to the end of the buffer using printf-style format * string 'format' and subsqeuent arguments. At most 'max' characters * are appended; the number of characters appended (excluding the NUL * terminator) is returned. Behaviour is undefined if 'max' is passed * as zero. */ size_t ne_buffer_snprintf(ne_buffer *buf, size_t max, const char *format, ...) ne_attribute((format(printf, 3, 4))); /* Append a literal, NUL-terminated constant string 'str' to buffer * 'buf'. */ #define ne_buffer_czappend(buf, str) \ ne_buffer_append((buf), (str), sizeof((str)) - 1) /* Clear the string buffer 'buf', making it equivalent to the empty * string. */ void ne_buffer_clear(ne_buffer *buf); /* Grow the allocated size of string buffer 'buf' to at least 'size' * bytes. */ void ne_buffer_grow(ne_buffer *buf, size_t size); /* Re-establish the 'used' invariant if the string buffer data field is * altered directly. */ void ne_buffer_altered(ne_buffer *buf); /* Destroy the string buffer object 'buf' without deallocating the * data string. The data string must subsequently be freed using * ne_free(). */ char *ne_buffer_finish(ne_buffer *buf); /* Destroy a string buffer object. */ void ne_buffer_destroy(ne_buffer *buf); /* Thread-safe strerror() wrapper; place system error for errno value * 'errnum' in 'buffer', which is of length 'buflen'. Returns * 'buffer'. */ char *ne_strerror(int errnum, char *buffer, size_t buflen); /* ne_strnzcpy copies at most 'n'-1 bytes of 'src' to 'dest', and * ensures that 'dest' is subsequently NUL-terminated. */ #define ne_strnzcpy(dest, src, n) do { size_t ne__nm1 = (n) - 1; \ strncpy(dest, src, ne__nm1); dest[ne__nm1] = '\0'; } while (0) /* Return malloc-allocated concatenation of all NUL-terminated string * arguments, up to a terminating NULL pointer. */ char *ne_concat(const char *str, ...); /* Wrapper for snprintf: always NUL-terminates returned buffer, and * returns strlen(str). */ size_t ne_snprintf(char *str, size_t size, const char *fmt, ...) ne_attribute((format(printf, 3, 4))); /* Wrapper for vsnprintf. */ size_t ne_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) ne_attribute((format(printf, 3, 0))); /* Implementations of strcasecmp and strncasecmp which behave as * defined by the ANSI C strcasecmp() and strncasecmp() when in the * POSIX locale; i.e. ignoring the process locale. */ /* Compares 's1' and 's2', ignoring differences in case. */ int ne_strcasecmp(const char *s1, const char *s2); /* Compares up to 'n' characters of 's1' and 's2', ignoring * differences in case. */ int ne_strncasecmp(const char *s1, const char *s2, size_t n); /* Return lowercase 'c' as in POSIX locale; note difference from ANSI * C semantics as both the argument and return value are unsigned * char. */ #define ne_tolower(c) (ne_tolower_array()[(unsigned char)c]) const unsigned char *ne_tolower_array(void); /* Convert an ASCII hexadecimal character in the ranges '0'..'9' * 'a'..'f' 'A'..'F' to its numeric equivalent. */ #define NE_ASC2HEX(x) (((x) <= '9') ? ((x) - '0') : \ (ne_tolower((x)) + 10 - 'a')) /* Convert an integer in the range 0..15 to the equivalent (lowercase) * ASCII hexadecimal equivalent character, in the range '0..9,'a..f' */ #define NE_HEX2ASC(x) ((char) ((x) > 9 ? ((x) - 10 + 'a') : ((x) + '0'))) NE_END_DECLS #endif /* NE_STRING_H */ sitecopy-0.16.6/lib/neon/ne_redirect.c0000664000076400007640000000713510642222434015732 0ustar joejoe/* HTTP-redirect support Copyright (C) 1999-2007, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include "ne_session.h" #include "ne_request.h" #include "ne_alloc.h" #include "ne_uri.h" #include "ne_redirect.h" #include "ne_internal.h" #include "ne_string.h" #define REDIRECT_ID "http://www.webdav.org/neon/hooks/http-redirect" struct redirect { char *requri; int valid; /* non-zero if .uri contains a redirect */ ne_uri uri; ne_session *sess; }; static void create(ne_request *req, void *session, const char *method, const char *uri) { struct redirect *red = session; if (red->requri) ne_free(red->requri); red->requri = ne_strdup(uri); } #define REDIR(n) ((n) == 301 || (n) == 302 || (n) == 303 || \ (n) == 307) static int post_send(ne_request *req, void *private, const ne_status *status) { struct redirect *red = private; const char *location = ne_get_response_header(req, "Location"); ne_buffer *path = NULL; int ret; /* Don't do anything for non-redirect status or no Location header. */ if (!REDIR(status->code) || location == NULL) return NE_OK; if (strstr(location, "://") == NULL && location[0] != '/') { char *pnt; path = ne_buffer_create(); ne_buffer_zappend(path, red->requri); pnt = strrchr(path->data, '/'); if (pnt && pnt[1] != '\0') { /* Chop off last path segment. */ pnt[1] = '\0'; ne_buffer_altered(path); } ne_buffer_zappend(path, location); location = path->data; } /* free last uri. */ ne_uri_free(&red->uri); /* Parse the Location header */ if (ne_uri_parse(location, &red->uri) || red->uri.path == NULL) { red->valid = 0; ne_set_error(red->sess, _("Could not parse redirect destination URL")); ret = NE_ERROR; } else { /* got a valid redirect. */ red->valid = 1; ret = NE_REDIRECT; if (!red->uri.host) { /* Not an absoluteURI: breaks 2616 but everybody does it. */ ne_fill_server_uri(red->sess, &red->uri); } } if (path) ne_buffer_destroy(path); return ret; } static void free_redirect(void *cookie) { struct redirect *red = cookie; ne_uri_free(&red->uri); if (red->requri) ne_free(red->requri); ne_free(red); } void ne_redirect_register(ne_session *sess) { struct redirect *red = ne_calloc(sizeof *red); red->sess = sess; ne_hook_create_request(sess, create, red); ne_hook_post_send(sess, post_send, red); ne_hook_destroy_session(sess, free_redirect, red); ne_set_session_private(sess, REDIRECT_ID, red); } const ne_uri *ne_redirect_location(ne_session *sess) { struct redirect *red = ne_get_session_private(sess, REDIRECT_ID); if (red && red->valid) return &red->uri; else return NULL; } sitecopy-0.16.6/lib/neon/ne_locks.c0000664000076400007640000005344210561601127015246 0ustar joejoe/* WebDAV Class 2 locking operations Copyright (C) 1999-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #include /* for isdigit() */ #include "ne_alloc.h" #include "ne_request.h" #include "ne_xml.h" #include "ne_locks.h" #include "ne_uri.h" #include "ne_basic.h" #include "ne_props.h" #include "ne_207.h" #include "ne_internal.h" #include "ne_xmlreq.h" #define HOOK_ID "http://webdav.org/neon/hooks/webdav-locking" /* A list of lock objects. */ struct lock_list { struct ne_lock *lock; struct lock_list *next, *prev; }; struct ne_lock_store_s { struct lock_list *locks; struct lock_list *cursor; /* current position in 'locks' */ }; struct lh_req_cookie { const ne_lock_store *store; struct lock_list *submit; }; /* Context for PROPFIND/lockdiscovery callbacks */ struct discover_ctx { ne_propfind_handler *phandler; ne_lock_result results; void *userdata; ne_buffer *cdata; }; /* Context for handling LOCK response */ struct lock_ctx { struct ne_lock active; /* activelock */ ne_request *req; /* the request in question */ ne_xml_parser *parser; char *token; /* the token we're after. */ int found; ne_buffer *cdata; }; /* use the "application" state space. */ #define ELM_LOCK_FIRST (NE_PROPS_STATE_TOP + 66) #define ELM_lockdiscovery (ELM_LOCK_FIRST) #define ELM_activelock (ELM_LOCK_FIRST + 1) #define ELM_lockscope (ELM_LOCK_FIRST + 2) #define ELM_locktype (ELM_LOCK_FIRST + 3) #define ELM_depth (ELM_LOCK_FIRST + 4) #define ELM_owner (ELM_LOCK_FIRST + 5) #define ELM_timeout (ELM_LOCK_FIRST + 6) #define ELM_locktoken (ELM_LOCK_FIRST + 7) #define ELM_lockinfo (ELM_LOCK_FIRST + 8) #define ELM_write (ELM_LOCK_FIRST + 9) #define ELM_exclusive (ELM_LOCK_FIRST + 10) #define ELM_shared (ELM_LOCK_FIRST + 11) #define ELM_href (ELM_LOCK_FIRST + 12) #define ELM_prop (NE_207_STATE_PROP) static const struct ne_xml_idmap element_map[] = { #define ELM(x) { "DAV:", #x, ELM_ ## x } ELM(lockdiscovery), ELM(activelock), ELM(prop), ELM(lockscope), ELM(locktype), ELM(depth), ELM(owner), ELM(timeout), ELM(locktoken), ELM(lockinfo), ELM(lockscope), ELM(locktype), ELM(write), ELM(exclusive), ELM(shared), ELM(href) /* no "lockentry" */ #undef ELM }; static const ne_propname lock_props[] = { { "DAV:", "lockdiscovery" }, { NULL } }; /* this simply registers the accessor for the function. */ static void lk_create(ne_request *req, void *session, const char *method, const char *uri) { struct lh_req_cookie *lrc = ne_malloc(sizeof *lrc); lrc->store = session; lrc->submit = NULL; ne_set_request_private(req, HOOK_ID, lrc); } static void lk_pre_send(ne_request *r, void *userdata, ne_buffer *req) { struct lh_req_cookie *lrc = ne_get_request_private(r, HOOK_ID); if (lrc->submit != NULL) { struct lock_list *item; /* Add in the If header */ ne_buffer_czappend(req, "If:"); for (item = lrc->submit; item != NULL; item = item->next) { char *uri = ne_uri_unparse(&item->lock->uri); ne_buffer_concat(req, " <", uri, "> (<", item->lock->token, ">)", NULL); ne_free(uri); } ne_buffer_czappend(req, "\r\n"); } } /* Insert 'lock' into lock list *list. */ static void insert_lock(struct lock_list **list, struct ne_lock *lock) { struct lock_list *item = ne_malloc(sizeof *item); if (*list != NULL) { (*list)->prev = item; } item->prev = NULL; item->next = *list; item->lock = lock; *list = item; } static void free_list(struct lock_list *list, int destroy) { struct lock_list *next; while (list != NULL) { next = list->next; if (destroy) ne_lock_destroy(list->lock); ne_free(list); list = next; } } static void lk_destroy(ne_request *req, void *userdata) { struct lh_req_cookie *lrc = ne_get_request_private(req, HOOK_ID); free_list(lrc->submit, 0); ne_free(lrc); } void ne_lockstore_destroy(ne_lock_store *store) { free_list(store->locks, 1); ne_free(store); } ne_lock_store *ne_lockstore_create(void) { return ne_calloc(sizeof(ne_lock_store)); } #define CURSOR_RET(s) ((s)->cursor?(s)->cursor->lock:NULL) struct ne_lock *ne_lockstore_first(ne_lock_store *store) { store->cursor = store->locks; return CURSOR_RET(store); } struct ne_lock *ne_lockstore_next(ne_lock_store *store) { store->cursor = store->cursor->next; return CURSOR_RET(store); } void ne_lockstore_register(ne_lock_store *store, ne_session *sess) { /* Register the hooks */ ne_hook_create_request(sess, lk_create, store); ne_hook_pre_send(sess, lk_pre_send, store); ne_hook_destroy_request(sess, lk_destroy, store); } /* Submit the given lock for the given URI */ static void submit_lock(struct lh_req_cookie *lrc, struct ne_lock *lock) { struct lock_list *item; /* Check for dups */ for (item = lrc->submit; item != NULL; item = item->next) { if (ne_strcasecmp(item->lock->token, lock->token) == 0) return; } insert_lock(&lrc->submit, lock); } struct ne_lock *ne_lockstore_findbyuri(ne_lock_store *store, const ne_uri *uri) { struct lock_list *cur; for (cur = store->locks; cur != NULL; cur = cur->next) { if (ne_uri_cmp(&cur->lock->uri, uri) == 0) { return cur->lock; } } return NULL; } void ne_lock_using_parent(ne_request *req, const char *path) { struct lh_req_cookie *lrc = ne_get_request_private(req, HOOK_ID); ne_uri u = {0}; struct lock_list *item; char *parent; if (lrc == NULL) return; parent = ne_path_parent(path); if (parent == NULL) return; ne_fill_server_uri(ne_get_session(req), &u); for (item = lrc->store->locks; item != NULL; item = item->next) { /* Only care about locks which are on this server. */ u.path = item->lock->uri.path; if (ne_uri_cmp(&u, &item->lock->uri)) continue; /* This lock is needed if it is an infinite depth lock which * covers the parent, or a lock on the parent itself. */ if ((item->lock->depth == NE_DEPTH_INFINITE && ne_path_childof(item->lock->uri.path, parent)) || ne_path_compare(item->lock->uri.path, parent) == 0) { NE_DEBUG(NE_DBG_LOCKS, "Locked parent, %s on %s\n", item->lock->token, item->lock->uri.path); submit_lock(lrc, item->lock); } } u.path = parent; /* handy: makes u.path valid and ne_free(parent). */ ne_uri_free(&u); } void ne_lock_using_resource(ne_request *req, const char *uri, int depth) { struct lh_req_cookie *lrc = ne_get_request_private(req, HOOK_ID); struct lock_list *item; int match; if (lrc == NULL) return; /* Iterate over the list of stored locks to see if any of them * apply to this resource */ for (item = lrc->store->locks; item != NULL; item = item->next) { match = 0; if (depth == NE_DEPTH_INFINITE && ne_path_childof(uri, item->lock->uri.path)) { /* Case 1: this is a depth-infinity request which will * modify a lock somewhere inside the collection. */ NE_DEBUG(NE_DBG_LOCKS, "Has child: %s\n", item->lock->token); match = 1; } else if (ne_path_compare(uri, item->lock->uri.path) == 0) { /* Case 2: this request is directly on a locked resource */ NE_DEBUG(NE_DBG_LOCKS, "Has direct lock: %s\n", item->lock->token); match = 1; } else if (item->lock->depth == NE_DEPTH_INFINITE && ne_path_childof(item->lock->uri.path, uri)) { /* Case 3: there is a higher-up infinite-depth lock which * covers the resource that this request will modify. */ NE_DEBUG(NE_DBG_LOCKS, "Is child of: %s\n", item->lock->token); match = 1; } if (match) { submit_lock(lrc, item->lock); } } } void ne_lockstore_add(ne_lock_store *store, struct ne_lock *lock) { insert_lock(&store->locks, lock); } void ne_lockstore_remove(ne_lock_store *store, struct ne_lock *lock) { struct lock_list *item; /* Find the lock */ for (item = store->locks; item != NULL; item = item->next) if (item->lock == lock) break; if (item->prev != NULL) { item->prev->next = item->next; } else { store->locks = item->next; } if (item->next != NULL) { item->next->prev = item->prev; } ne_free(item); } struct ne_lock *ne_lock_copy(const struct ne_lock *lock) { struct ne_lock *ret = ne_calloc(sizeof *ret); ne_uri_copy(&ret->uri, &lock->uri); ret->token = ne_strdup(lock->token); ret->depth = lock->depth; ret->type = lock->type; ret->scope = lock->scope; if (lock->owner) ret->owner = ne_strdup(lock->owner); ret->timeout = lock->timeout; return ret; } struct ne_lock *ne_lock_create(void) { struct ne_lock *lock = ne_calloc(sizeof *lock); lock->depth = NE_DEPTH_ZERO; lock->type = ne_locktype_write; lock->scope = ne_lockscope_exclusive; lock->timeout = NE_TIMEOUT_INVALID; return lock; } void ne_lock_free(struct ne_lock *lock) { ne_uri_free(&lock->uri); if (lock->owner) { ne_free(lock->owner); lock->owner = NULL; } if (lock->token) { ne_free(lock->token); lock->token = NULL; } } void ne_lock_destroy(struct ne_lock *lock) { ne_lock_free(lock); ne_free(lock); } int ne_unlock(ne_session *sess, const struct ne_lock *lock) { ne_request *req = ne_request_create(sess, "UNLOCK", lock->uri.path); int ret; ne_print_request_header(req, "Lock-Token", "<%s>", lock->token); /* UNLOCK of a lock-null resource removes the resource from the * parent collection; so an UNLOCK may modify the parent * collection. (somewhat counter-intuitive, and not easily derived * from 2518.) */ ne_lock_using_parent(req, lock->uri.path); ret = ne_request_dispatch(req); if (ret == NE_OK && ne_get_status(req)->klass != 2) { ret = NE_ERROR; } ne_request_destroy(req); return ret; } static int parse_depth(const char *depth) { if (ne_strcasecmp(depth, "infinity") == 0) { return NE_DEPTH_INFINITE; } else if (isdigit(depth[0])) { return atoi(depth); } else { return -1; } } static long parse_timeout(const char *timeout) { if (ne_strcasecmp(timeout, "infinite") == 0) { return NE_TIMEOUT_INFINITE; } else if (strncasecmp(timeout, "Second-", 7) == 0) { long to = strtol(timeout+7, NULL, 10); if (to == LONG_MIN || to == LONG_MAX) return NE_TIMEOUT_INVALID; return to; } else { return NE_TIMEOUT_INVALID; } } static void discover_results(void *userdata, const ne_uri *uri, const ne_prop_result_set *set) { struct discover_ctx *ctx = userdata; struct ne_lock *lock = ne_propset_private(set); const ne_status *status = ne_propset_status(set, &lock_props[0]); /* Require at least that the lock has a token. */ if (lock->token) { if (status && status->klass != 2) { ctx->results(ctx->userdata, NULL, uri, status); } else { ctx->results(ctx->userdata, lock, uri, NULL); } } else if (status) { ctx->results(ctx->userdata, NULL, uri, status); } NE_DEBUG(NE_DBG_LOCKS, "End of response for %s\n", uri->path); } static int end_element_common(struct ne_lock *l, int state, const char *cdata) { switch (state) { case ELM_write: l->type = ne_locktype_write; break; case ELM_exclusive: l->scope = ne_lockscope_exclusive; break; case ELM_shared: l->scope = ne_lockscope_shared; break; case ELM_depth: NE_DEBUG(NE_DBG_LOCKS, "Got depth: %s\n", cdata); l->depth = parse_depth(cdata); if (l->depth == -1) { return -1; } break; case ELM_timeout: NE_DEBUG(NE_DBG_LOCKS, "Got timeout: %s\n", cdata); l->timeout = parse_timeout(cdata); if (l->timeout == NE_TIMEOUT_INVALID) { return -1; } break; case ELM_owner: l->owner = strdup(cdata); break; case ELM_href: l->token = strdup(cdata); break; } return 0; } /* End-element handler for lock discovery PROPFIND response */ static int end_element_ldisc(void *userdata, int state, const char *nspace, const char *name) { struct discover_ctx *ctx = userdata; struct ne_lock *lock = ne_propfind_current_private(ctx->phandler); return end_element_common(lock, state, ctx->cdata->data); } static inline int can_accept(int parent, int id) { return (parent == NE_XML_STATEROOT && id == ELM_prop) || (parent == ELM_prop && id == ELM_lockdiscovery) || (parent == ELM_lockdiscovery && id == ELM_activelock) || (parent == ELM_activelock && (id == ELM_lockscope || id == ELM_locktype || id == ELM_depth || id == ELM_owner || id == ELM_timeout || id == ELM_locktoken)) || (parent == ELM_lockscope && (id == ELM_exclusive || id == ELM_shared)) || (parent == ELM_locktype && id == ELM_write) || (parent == ELM_locktoken && id == ELM_href); } static int ld_startelm(void *userdata, int parent, const char *nspace, const char *name, const char **atts) { struct discover_ctx *ctx = userdata; int id = ne_xml_mapid(element_map, NE_XML_MAPLEN(element_map), nspace, name); ne_buffer_clear(ctx->cdata); if (can_accept(parent, id)) return id; else return NE_XML_DECLINE; } #define MAX_CDATA (256) static int lk_cdata(void *userdata, int state, const char *cdata, size_t len) { struct lock_ctx *ctx = userdata; if (ctx->cdata->used + len < MAX_CDATA) ne_buffer_append(ctx->cdata, cdata, len); return 0; } static int ld_cdata(void *userdata, int state, const char *cdata, size_t len) { struct discover_ctx *ctx = userdata; if (ctx->cdata->used + len < MAX_CDATA) ne_buffer_append(ctx->cdata, cdata, len); return 0; } static int lk_startelm(void *userdata, int parent, const char *nspace, const char *name, const char **atts) { struct lock_ctx *ctx = userdata; int id; id = ne_xml_mapid(element_map, NE_XML_MAPLEN(element_map), nspace, name); NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: %s => %d\n", name, id); if (id == 0) return NE_XML_DECLINE; if (parent == 0 && ctx->token == NULL) { const char *token = ne_get_response_header(ctx->req, "Lock-Token"); /* at the root element; retrieve the Lock-Token header, * and bail if it wasn't given. */ if (token == NULL) { ne_xml_set_error(ctx->parser, _("LOCK response missing Lock-Token header")); return NE_XML_ABORT; } if (token[0] == '<') token++; ctx->token = ne_strdup(token); ne_shave(ctx->token, ">"); NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n", ctx->token); } /* TODO: only accept 'prop' as root for LOCK response */ if (!can_accept(parent, id)) return NE_XML_DECLINE; if (id == ELM_activelock && !ctx->found) { /* a new activelock */ ne_lock_free(&ctx->active); memset(&ctx->active, 0, sizeof ctx->active); ctx->active.timeout = NE_TIMEOUT_INVALID; } ne_buffer_clear(ctx->cdata); return id; } /* End-element handler for LOCK response */ static int lk_endelm(void *userdata, int state, const char *nspace, const char *name) { struct lock_ctx *ctx = userdata; if (ctx->found) return 0; if (end_element_common(&ctx->active, state, ctx->cdata->data)) return -1; if (state == ELM_activelock) { if (ctx->active.token && strcmp(ctx->active.token, ctx->token) == 0) { ctx->found = 1; } } return 0; } /* Creator callback for private structure. */ static void *ld_create(void *userdata, const ne_uri *uri) { struct ne_lock *lk = ne_lock_create(); ne_uri_copy(&lk->uri, uri); return lk; } /* Destructor callback for private structure. */ static void ld_destroy(void *userdata, void *private) { struct ne_lock *lk = private; ne_lock_destroy(lk); } /* Discover all locks on URI */ int ne_lock_discover(ne_session *sess, const char *uri, ne_lock_result callback, void *userdata) { ne_propfind_handler *handler; struct discover_ctx ctx = {0}; int ret; ctx.results = callback; ctx.userdata = userdata; ctx.cdata = ne_buffer_create(); ctx.phandler = handler = ne_propfind_create(sess, uri, NE_DEPTH_ZERO); ne_propfind_set_private(handler, ld_create, ld_destroy, &ctx); ne_xml_push_handler(ne_propfind_get_parser(handler), ld_startelm, ld_cdata, end_element_ldisc, &ctx); ret = ne_propfind_named(handler, lock_props, discover_results, &ctx); ne_buffer_destroy(ctx.cdata); ne_propfind_destroy(handler); return ret; } static void add_timeout_header(ne_request *req, long timeout) { if (timeout == NE_TIMEOUT_INFINITE) { ne_add_request_header(req, "Timeout", "Infinite"); } else if (timeout != NE_TIMEOUT_INVALID && timeout > 0) { ne_print_request_header(req, "Timeout", "Second-%ld", timeout); } /* just ignore it if timeout == 0 or invalid. */ } int ne_lock(ne_session *sess, struct ne_lock *lock) { ne_request *req = ne_request_create(sess, "LOCK", lock->uri.path); ne_buffer *body = ne_buffer_create(); ne_xml_parser *parser = ne_xml_create(); int ret; struct lock_ctx ctx; memset(&ctx, 0, sizeof ctx); ctx.cdata = ne_buffer_create(); ctx.req = req; ctx.parser = parser; /* LOCK is not idempotent. */ ne_set_request_flag(req, NE_REQFLAG_IDEMPOTENT, 0); ne_xml_push_handler(parser, lk_startelm, lk_cdata, lk_endelm, &ctx); /* Create the body */ ne_buffer_concat(body, "\n" "\n" " ", lock->scope==ne_lockscope_exclusive? "":"", "\n" "", NULL); if (lock->owner) { ne_buffer_concat(body, "", lock->owner, "\n", NULL); } ne_buffer_czappend(body, "\n"); ne_set_request_body_buffer(req, body->data, ne_buffer_size(body)); ne_add_request_header(req, "Content-Type", NE_XML_MEDIA_TYPE); ne_add_depth_header(req, lock->depth); add_timeout_header(req, lock->timeout); /* TODO: * By 2518, we need this only if we are creating a lock-null resource. * Since we don't KNOW whether the lock we're given is a lock-null * or not, we cover our bases. */ ne_lock_using_parent(req, lock->uri.path); /* This one is clearer from 2518 sec 8.10.4. */ ne_lock_using_resource(req, lock->uri.path, lock->depth); ret = ne_xml_dispatch_request(req, parser); ne_buffer_destroy(body); ne_buffer_destroy(ctx.cdata); if (ret == NE_OK && ne_get_status(req)->klass == 2) { if (ne_get_status(req)->code == 207) { ret = NE_ERROR; /* TODO: set the error string appropriately */ } else if (ctx.found) { /* it worked: copy over real lock details if given. */ if (lock->token) ne_free(lock->token); lock->token = ctx.token; ctx.token = NULL; if (ctx.active.timeout != NE_TIMEOUT_INVALID) lock->timeout = ctx.active.timeout; lock->scope = ctx.active.scope; lock->type = ctx.active.type; if (ctx.active.depth >= 0) lock->depth = ctx.active.depth; if (ctx.active.owner) { if (lock->owner) ne_free(lock->owner); lock->owner = ctx.active.owner; ctx.active.owner = NULL; } } else { ret = NE_ERROR; ne_set_error(sess, _("Response missing activelock for %s"), ctx.token); } } else if (ret == NE_OK /* && status != 2xx */) { ret = NE_ERROR; } ne_lock_free(&ctx.active); if (ctx.token) ne_free(ctx.token); ne_request_destroy(req); ne_xml_destroy(parser); return ret; } int ne_lock_refresh(ne_session *sess, struct ne_lock *lock) { ne_request *req = ne_request_create(sess, "LOCK", lock->uri.path); ne_xml_parser *parser = ne_xml_create(); int ret; struct lock_ctx ctx; memset(&ctx, 0, sizeof ctx); ctx.cdata = ne_buffer_create(); ctx.req = req; ctx.token = lock->token; ctx.parser = parser; /* Handle the response and update *lock appropriately. */ ne_xml_push_handler(parser, lk_startelm, lk_cdata, lk_endelm, &ctx); /* For a lock refresh, submitting only this lock token must be * sufficient. */ ne_print_request_header(req, "If", "(<%s>)", lock->token); add_timeout_header(req, lock->timeout); ret = ne_xml_dispatch_request(req, parser); if (ret == NE_OK) { if (ne_get_status(req)->klass != 2) { ret = NE_ERROR; /* and use default session error */ } else if (!ctx.found) { ne_set_error(sess, _("No activelock for <%s> returned in " "LOCK refresh response"), lock->token); ret = NE_ERROR; } else /* success! */ { /* update timeout for passed-in lock structure. */ lock->timeout = ctx.active.timeout; } } ne_lock_free(&ctx.active); ne_buffer_destroy(ctx.cdata); ne_request_destroy(req); ne_xml_destroy(parser); return ret; } sitecopy-0.16.6/lib/neon/memleak.h0000664000076400007640000000410010127573646015070 0ustar joejoe/* Memory leak wrappers Copyright (C) 2003, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* WARNING: THIS IS AN INTERNAL NEON INTERFACE AND MUST NOT BE USED * from NEON APPLICATIONS. */ /* This file contains an alternate interface to the memory allocation * wrappers in ne_alloc.c, which perform simple leak detection. It * MUST NOT BE INSTALLED, or used from neon applications. */ #ifndef MEMLEAK_H #define MEMLEAK_H #include #define ne_malloc(s) ne_malloc_ml(s, __FILE__, __LINE__) #define ne_calloc(s) ne_calloc_ml(s, __FILE__, __LINE__) #define ne_realloc(p, s) ne_realloc_ml(p, s, __FILE__, __LINE__) #define ne_strdup(s) ne_strdup_ml(s, __FILE__, __LINE__) #define ne_strndup(s, n) ne_strndup_ml(s, n, __FILE__, __LINE__) #define ne_free ne_free_ml /* Prototypes of allocation functions: */ void *ne_malloc_ml(size_t size, const char *file, int line); void *ne_calloc_ml(size_t size, const char *file, int line); void *ne_realloc_ml(void *ptr, size_t s, const char *file, int line); char *ne_strdup_ml(const char *s, const char *file, int line); char *ne_strndup_ml(const char *s, size_t n, const char *file, int line); void ne_free_ml(void *ptr); /* Dump the list of currently allocated blocks to 'f'. */ void ne_alloc_dump(FILE *f); /* Current number of bytes in allocated but not free'd. */ extern size_t ne_alloc_used; #endif /* MEMLEAK_H */ sitecopy-0.16.6/lib/neon/ne_basic.c0000664000076400007640000003105710752702217015216 0ustar joejoe/* Basic HTTP and WebDAV methods Copyright (C) 1999-2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include #include /* for struct stat */ #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include #include "ne_request.h" #include "ne_alloc.h" #include "ne_utils.h" #include "ne_basic.h" #include "ne_207.h" #ifdef NE_HAVE_DAV #include "ne_uri.h" #include "ne_locks.h" #endif #include "ne_dates.h" #include "ne_internal.h" int ne_getmodtime(ne_session *sess, const char *uri, time_t *modtime) { ne_request *req = ne_request_create(sess, "HEAD", uri); const char *value; int ret; ret = ne_request_dispatch(req); value = ne_get_response_header(req, "Last-Modified"); if (ret == NE_OK && ne_get_status(req)->klass != 2) { *modtime = -1; ret = NE_ERROR; } else if (value) { *modtime = ne_httpdate_parse(value); } else { *modtime = -1; } ne_request_destroy(req); return ret; } #ifdef NE_LFS #define ne_fstat fstat64 typedef struct stat64 struct_stat; #else #define ne_fstat fstat typedef struct stat struct_stat; #endif /* PUT's from fd to URI */ int ne_put(ne_session *sess, const char *uri, int fd) { ne_request *req; struct_stat st; int ret; if (ne_fstat(fd, &st)) { int errnum = errno; char buf[200]; ne_set_error(sess, _("Could not determine file size: %s"), ne_strerror(errnum, buf, sizeof buf)); return NE_ERROR; } req = ne_request_create(sess, "PUT", uri); #ifdef NE_HAVE_DAV ne_lock_using_resource(req, uri, 0); ne_lock_using_parent(req, uri); #endif ne_set_request_body_fd(req, fd, 0, st.st_size); ret = ne_request_dispatch(req); if (ret == NE_OK && ne_get_status(req)->klass != 2) ret = NE_ERROR; ne_request_destroy(req); return ret; } /* Dispatch a GET request REQ, writing the response body to FD fd. If * RANGE is non-NULL, then it is the value of the Range request * header, e.g. "bytes=1-5". Returns an NE_* error code. */ static int dispatch_to_fd(ne_request *req, int fd, const char *range) { ne_session *const sess = ne_get_session(req); const ne_status *const st = ne_get_status(req); int ret; size_t rlen; /* length of bytespec after "bytes=" */ rlen = range ? strlen(range + 6) : 0; do { const char *value; ret = ne_begin_request(req); if (ret != NE_OK) break; value = ne_get_response_header(req, "Content-Range"); /* For a 206 response, check that a Content-Range header is * given which matches the Range request header. */ if (range && st->code == 206 && (value == NULL || strncmp(value, "bytes ", 6) != 0 || strncmp(range + 6, value + 6, rlen) || (range[5 + rlen] != '-' && value[6 + rlen] != '/'))) { ne_set_error(sess, _("Response did not include requested range")); return NE_ERROR; } if ((range && st->code == 206) || (!range && st->klass == 2)) { ret = ne_read_response_to_fd(req, fd); } else { ret = ne_discard_response(req); } if (ret == NE_OK) ret = ne_end_request(req); } while (ret == NE_RETRY); return ret; } static int get_range_common(ne_session *sess, const char *uri, const char *brange, int fd) { ne_request *req = ne_request_create(sess, "GET", uri); const ne_status *status; int ret; ne_add_request_header(req, "Range", brange); ne_add_request_header(req, "Accept-Ranges", "bytes"); ret = dispatch_to_fd(req, fd, brange); status = ne_get_status(req); if (ret == NE_OK && status->code == 416) { /* connection is terminated too early with Apache/1.3, so we check * this even if ret == NE_ERROR... */ ne_set_error(sess, _("Range is not satisfiable")); ret = NE_ERROR; } else if (ret == NE_OK) { if (status->klass == 2 && status->code != 206) { ne_set_error(sess, _("Resource does not support ranged GET requests")); ret = NE_ERROR; } else if (status->klass != 2) { ret = NE_ERROR; } } ne_request_destroy(req); return ret; } int ne_get_range(ne_session *sess, const char *uri, ne_content_range *range, int fd) { char brange[64]; if (range->end == -1) { ne_snprintf(brange, sizeof brange, "bytes=%" FMT_NE_OFF_T "-", range->start); } else { ne_snprintf(brange, sizeof brange, "bytes=%" FMT_NE_OFF_T "-%" FMT_NE_OFF_T, range->start, range->end); } return get_range_common(sess, uri, brange, fd); } /* Get to given fd */ int ne_get(ne_session *sess, const char *uri, int fd) { ne_request *req = ne_request_create(sess, "GET", uri); int ret; ret = dispatch_to_fd(req, fd, NULL); if (ret == NE_OK && ne_get_status(req)->klass != 2) { ret = NE_ERROR; } ne_request_destroy(req); return ret; } /* Get to given fd */ int ne_post(ne_session *sess, const char *uri, int fd, const char *buffer) { ne_request *req = ne_request_create(sess, "POST", uri); int ret; ne_set_request_flag(req, NE_REQFLAG_IDEMPOTENT, 0); ne_set_request_body_buffer(req, buffer, strlen(buffer)); ret = dispatch_to_fd(req, fd, NULL); if (ret == NE_OK && ne_get_status(req)->klass != 2) { ret = NE_ERROR; } ne_request_destroy(req); return ret; } int ne_get_content_type(ne_request *req, ne_content_type *ct) { const char *value; char *sep, *stype; value = ne_get_response_header(req, "Content-Type"); if (value == NULL || strchr(value, '/') == NULL) { return -1; } ct->value = ne_strdup(value); stype = strchr(ct->value, '/'); *stype++ = '\0'; ct->type = ct->value; ct->charset = NULL; sep = strchr(stype, ';'); if (sep) { char *tok; /* look for the charset parameter. TODO; probably better to * hand-carve a parser than use ne_token/strstr/shave here. */ *sep++ = '\0'; do { tok = ne_qtoken(&sep, ';', "\"\'"); if (tok) { tok = strstr(tok, "charset="); if (tok) ct->charset = ne_shave(tok+8, "\"\'"); } else { break; } } while (sep != NULL); } /* set subtype, losing any trailing whitespace */ ct->subtype = ne_shave(stype, " \t"); if (ct->charset == NULL && ne_strcasecmp(ct->type, "text") == 0) { /* 3280§3.1: text/xml without charset implies us-ascii. */ if (ne_strcasecmp(ct->subtype, "xml") == 0) ct->charset = "us-ascii"; /* 2616§3.7.1: subtypes of text/ default to charset ISO-8859-1. */ else ct->charset = "ISO-8859-1"; } return 0; } static const struct options_map { const char *name; unsigned int cap; } options_map[] = { { "1", NE_CAP_DAV_CLASS1 }, { "2", NE_CAP_DAV_CLASS2 }, { "3", NE_CAP_DAV_CLASS3 }, { "", NE_CAP_MODDAV_EXEC }, { "access-control", NE_CAP_DAV_ACL }, { "version-control", NE_CAP_VER_CONTROL }, { "checkout-in-place", NE_CAP_CO_IN_PLACE }, { "version-history", NE_CAP_VER_HISTORY }, { "workspace", NE_CAP_WORKSPACE }, { "update", NE_CAP_UPDATE }, { "label", NE_CAP_LABEL }, { "working-resource", NE_CAP_WORK_RESOURCE }, { "merge", NE_CAP_MERGE }, { "baseline", NE_CAP_BASELINE }, { "version-controlled-collection", NE_CAP_VC_COLLECTION } }; static void parse_dav_header(const char *value, unsigned int *caps) { char *tokens = ne_strdup(value), *pnt = tokens; *caps = 0; do { char *tok = ne_qtoken(&pnt, ',', "\"'"); unsigned n; if (!tok) break; tok = ne_shave(tok, " \r\t\n"); for (n = 0; n < sizeof(options_map)/sizeof(options_map[0]); n++) { if (strcmp(tok, options_map[n].name) == 0) { *caps |= options_map[n].cap; } } } while (pnt != NULL); ne_free(tokens); } int ne_options2(ne_session *sess, const char *uri, unsigned int *caps) { ne_request *req = ne_request_create(sess, "OPTIONS", uri); int ret = ne_request_dispatch(req); const char *header = ne_get_response_header(req, "DAV"); if (header) parse_dav_header(header, caps); if (ret == NE_OK && ne_get_status(req)->klass != 2) { ret = NE_ERROR; } ne_request_destroy(req); return ret; } int ne_options(ne_session *sess, const char *path, ne_server_capabilities *caps) { int ret; unsigned int capmask = 0; memset(caps, 0, sizeof *caps); ret = ne_options2(sess, path, &capmask); caps->dav_class1 = capmask & NE_CAP_DAV_CLASS1 ? 1 : 0; caps->dav_class2 = capmask & NE_CAP_DAV_CLASS2 ? 1 : 0; caps->dav_executable = capmask & NE_CAP_MODDAV_EXEC ? 1 : 0; return ret; } #ifdef NE_HAVE_DAV void ne_add_depth_header(ne_request *req, int depth) { const char *value; switch(depth) { case NE_DEPTH_ZERO: value = "0"; break; case NE_DEPTH_ONE: value = "1"; break; default: value = "infinity"; break; } ne_add_request_header(req, "Depth", value); } static int copy_or_move(ne_session *sess, int is_move, int overwrite, int depth, const char *src, const char *dest) { ne_request *req = ne_request_create( sess, is_move?"MOVE":"COPY", src ); /* 2518 S8.9.2 says only use Depth: infinity with MOVE. */ if (!is_move) { ne_add_depth_header(req, depth); } #ifdef NE_HAVE_DAV if (is_move) { ne_lock_using_resource(req, src, NE_DEPTH_INFINITE); } ne_lock_using_resource(req, dest, NE_DEPTH_INFINITE); /* And we need to be able to add members to the destination's parent */ ne_lock_using_parent(req, dest); #endif if (ne_get_session_flag(sess, NE_SESSFLAG_RFC4918)) { ne_add_request_header(req, "Destination", dest); } else { ne_print_request_header(req, "Destination", "%s://%s%s", ne_get_scheme(sess), ne_get_server_hostport(sess), dest); } ne_add_request_header(req, "Overwrite", overwrite?"T":"F"); return ne_simple_request(sess, req); } int ne_copy(ne_session *sess, int overwrite, int depth, const char *src, const char *dest) { return copy_or_move(sess, 0, overwrite, depth, src, dest); } int ne_move(ne_session *sess, int overwrite, const char *src, const char *dest) { return copy_or_move(sess, 1, overwrite, 0, src, dest); } /* Deletes the specified resource. (and in only two lines of code!) */ int ne_delete(ne_session *sess, const char *uri) { ne_request *req = ne_request_create(sess, "DELETE", uri); #ifdef NE_HAVE_DAV ne_lock_using_resource(req, uri, NE_DEPTH_INFINITE); ne_lock_using_parent(req, uri); #endif /* joe: I asked on the DAV WG list about whether we might get a * 207 error back from a DELETE... conclusion, you shouldn't if * you don't send the Depth header, since we might be an HTTP/1.1 * client and a 2xx response indicates success to them. But * it's all a bit unclear. In any case, DAV servers today do * return 207 to DELETE even if we don't send the Depth header. * So we handle 207 errors appropriately. */ return ne_simple_request(sess, req); } int ne_mkcol(ne_session *sess, const char *uri) { ne_request *req; char *real_uri; int ret; if (ne_path_has_trailing_slash(uri)) { real_uri = ne_strdup(uri); } else { real_uri = ne_concat(uri, "/", NULL); } req = ne_request_create(sess, "MKCOL", real_uri); #ifdef NE_HAVE_DAV ne_lock_using_resource(req, real_uri, 0); ne_lock_using_parent(req, real_uri); #endif ret = ne_simple_request(sess, req); ne_free(real_uri); return ret; } #endif /* NE_HAVE_DAV */ sitecopy-0.16.6/lib/neon/ne_basic.h0000664000076400007640000001356010752702217015222 0ustar joejoe/* HTTP/1.1 methods Copyright (C) 1999-2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_BASIC_H #define NE_BASIC_H #include /* for time_t */ #include "ne_request.h" NE_BEGIN_DECLS /* Perform a GET request on resource at 'path', writing the entity * body which is returned to 'fd'. */ int ne_get(ne_session *sess, const char *path, int fd); /* Perform a PUT request on resource at 'path', reading the entity * body to submit from 'fd'. */ int ne_put(ne_session *sess, const char *path, int fd); #define NE_DEPTH_ZERO (0) #define NE_DEPTH_ONE (1) #define NE_DEPTH_INFINITE (2) /* For ne_copy and ne_move: * * If a resource exists at "dest" and overwrite is zero, the operation * will fail; if overwrite is non-zero, any existing resource will * be over-written. */ /* Copy resource from 'src to 'dest' paths. If 'src' identifies a * collection resource, depth may be NE_DEPTH_ZERO to request that the * collection and its properties are to be copied, or * NE_DEPTH_INFINITE to request that the collection and its contents * are to be copied. */ int ne_copy(ne_session *sess, int overwrite, int depth, const char *src, const char *dest); /* Move resource from 'src' to dest 'path'. */ int ne_move(ne_session *sess, int overwrite, const char *src, const char *dest); /* Delete resource at 'path'. */ int ne_delete(ne_session *sess, const char *path); /* Create a collection at 'path', which MUST have a trailing slash. */ int ne_mkcol(ne_session *sess, const char *path); /* Adds a Depth: header to a request */ void ne_add_depth_header(ne_request *req, int depth); /* Retrieve modification time of resource at location 'path', using * the HEAD method, placing parsed time in *modtime. *modtime is set * to -1 if no Last-Modified response header was given, or the date * given could not be parsed. */ int ne_getmodtime(ne_session *sess, const char *path, time_t *modtime); typedef struct { const char *type, *subtype; const char *charset; char *value; } ne_content_type; /* Retrieve the content-type of the response; returns zero if response * had valid content-type, in which case all fields in *ctype are set * (and never NULL); the caller must free(ctype->value) after use. * Returns non-zero on error, in which case *ctype is not altered. */ int ne_get_content_type(ne_request *req, ne_content_type *ctype); /* DEPRECATED: Server capabilities. */ typedef struct { unsigned int dav_class1; /* True if Class 1 WebDAV server */ unsigned int dav_class2; /* True if Class 2 WebDAV server */ unsigned int dav_executable; /* True if supports the 'executable' * property a. la. mod_dav */ } ne_server_capabilities; /* DEPRECATED: Determines server capabilities (using OPTIONS). */ int ne_options(ne_session *sess, const char *path, ne_server_capabilities *caps); #define NE_CAP_DAV_CLASS1 (0x0001) /* Class 1 WebDAV (RFC 2518) */ #define NE_CAP_DAV_CLASS2 (0x0002) /* Class 2 WebDAV (RFC 2518) */ #define NE_CAP_DAV_CLASS3 (0x0004) /* Class 3 WebDAV (RFC 4918) */ #define NE_CAP_MODDAV_EXEC (0x0008) /* mod_dav "executable" property */ #define NE_CAP_DAV_ACL (0x0010) /* WebDAV ACL (RFC 3744) */ #define NE_CAP_VER_CONTROL (0x0020) /* DeltaV version-control */ #define NE_CAP_CO_IN_PLACE (0x0040) /* DeltaV checkout-in-place */ #define NE_CAP_VER_HISTORY (0x0080) /* DeltaV version-history */ #define NE_CAP_WORKSPACE (0x0100) /* DeltaV workspace */ #define NE_CAP_UPDATE (0x0200) /* DeltaV update */ #define NE_CAP_LABEL (0x0400) /* DeltaV label */ #define NE_CAP_WORK_RESOURCE (0x0800) /* DeltaV working-resouce */ #define NE_CAP_MERGE (0x1000) /* DeltaV merge */ #define NE_CAP_BASELINE (0x2000) /* DeltaV baseline */ #define NE_CAP_ACTIVITY (0x4000) /* DeltaV activity */ #define NE_CAP_VC_COLLECTION (0x8000) /* DeltaV version-controlled-collection */ /* Determines resource capailities, using an OPTIONS request. On * return, *caps is set to a bit-mask of the above NE_CAP_* constants * describing the advertised resource capabilities. */ int ne_options2(ne_session *sess, const char *path, unsigned int *caps); /* Defines a range of bytes, starting at 'start' and ending * at 'end'. 'total' is the number of bytes in the range. */ typedef struct { ne_off_t start, end, total; } ne_content_range; /* Partial GET. range->start must be >= 0. range->total is ignored. * * If range->end is -1, then the rest of the resource from start is * requested, and range->total and end are filled in on success. * * Otherwise, bytes from range->start to range->end are requested. * * This will write to the CURRENT position of f; so if you want * to do a resume download, use: * struct ne_content_range range; * range.start = resume_from; * range.end = range.start + 999; (= 1000 bytes) * fseek(myfile, resume_from, SEEK_SET); * ne_get_range(sess, path, &range, myfile); */ int ne_get_range(ne_session *sess, const char *path, ne_content_range *range, int fd); /* Post using buffer as request-body: stream response into f */ int ne_post(ne_session *sess, const char *path, int fd, const char *buffer); NE_END_DECLS #endif /* NE_BASIC_H */ sitecopy-0.16.6/lib/neon/ne_session.h0000664000076400007640000003005110750124156015614 0ustar joejoe/* HTTP session handling Copyright (C) 1999-2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_SESSION_H #define NE_SESSION_H 1 #include #include "ne_ssl.h" #include "ne_uri.h" /* for ne_uri */ #include "ne_defs.h" #include "ne_socket.h" NE_BEGIN_DECLS typedef struct ne_session_s ne_session; /* Create a session to the given server, using the given scheme. If * "https" is passed as the scheme, SSL will be used to connect to the * server. */ ne_session *ne_session_create(const char *scheme, const char *hostname, unsigned int port); /* Finish an HTTP session */ void ne_session_destroy(ne_session *sess); /* Prematurely force the connection to be closed for the given * session. */ void ne_close_connection(ne_session *sess); /* Set the proxy server to be used for the session. This function * must only be called before any requests are created for the * session. */ void ne_session_proxy(ne_session *sess, const char *hostname, unsigned int port); /* Defined session flags: */ typedef enum ne_session_flag_e { NE_SESSFLAG_PERSIST = 0, /* disable this flag to prevent use of * persistent connections. */ NE_SESSFLAG_ICYPROTO, /* enable this flag to enable support for * non-HTTP ShoutCast-style "ICY" responses. */ NE_SESSFLAG_SSLv2, /* disable this flag to disable support for * SSLv2, if supported by the SSL library. */ NE_SESSFLAG_RFC4918, /* enable this flag to enable support for * RFC4918-only WebDAV features; losing * backwards-compatibility with RFC2518 * servers. */ NE_SESSFLAG_CONNAUTH, /* enable this flag if an awful, broken, * RFC-violating, connection-based HTTP * authentication scheme is in use. */ NE_SESSFLAG_TLS_SNI, /* disable this flag to disable use of the * TLS Server Name Indication extension. */ NE_SESSFLAG_LAST /* enum sentinel value */ } ne_session_flag; /* Set a new value for a particular session flag. */ void ne_set_session_flag(ne_session *sess, ne_session_flag flag, int value); /* Return 0 if the given flag is not set, >0 it is set, or -1 if the * flag is not supported. */ int ne_get_session_flag(ne_session *sess, ne_session_flag flag); /* Bypass the normal name resolution; force the use of specific set of * addresses for this session, addrs[0]...addrs[n-1]. The addrs array * must remain valid until the session is destroyed. */ void ne_set_addrlist(ne_session *sess, const ne_inet_addr **addrs, size_t n); /* Bind connections to the specified local address. If the address * determined for the remote host has a different family (type) to * 'addr', 'addr' will be ignored. The 'addr' object must remain * valid until the session is destroyed. */ void ne_set_localaddr(ne_session *sess, const ne_inet_addr *addr); /* DEPRECATED: Progress callback. */ typedef void (*ne_progress)(void *userdata, ne_off_t progress, ne_off_t total); /* DEPRECATED API: Set a progress callback for the session; this is * deprecated in favour of ne_set_notifier(). The progress callback * is invoked for after each block of the request and response body to * indicate request and response progress (there is no way to * distinguish between the two using this interface alone). * * NOTE: Use of this interface is mutually exclusive with the use of * ne_set_notifier(). A call to ne_set_progress() removes the * notifier callback, and vice versa. */ void ne_set_progress(ne_session *sess, ne_progress progress, void *userdata); /* Store an opaque context for the session, 'priv' is returned by a * call to ne_session_get_private with the same ID. */ void ne_set_session_private(ne_session *sess, const char *id, void *priv); void *ne_get_session_private(ne_session *sess, const char *id); /* Status event type. NOTE: More event types may be added in * subsequent releases, so callers must ignore unknown status types * for forwards-compatibility. */ typedef enum { ne_status_lookup = 0, /* looking up hostname */ ne_status_connecting, /* connecting to host */ ne_status_connected, /* connected to host */ ne_status_sending, /* sending a request body */ ne_status_recving, /* receiving a response body */ ne_status_disconnected /* disconnected from host */ } ne_session_status; /* Status event information union; the relevant structure within * corresponds to the event type. WARNING: the size of this union is * not limited by ABI constraint; it may be extended with additional * members of different size, or existing members may be extended. */ typedef union ne_session_status_info_u { struct /* ne_status_lookup */ { /* The hostname which is being resolved: */ const char *hostname; } lu; struct /* ne_status_connecting */ { /* The hostname and network address to which a connection * attempt is being made: */ const char *hostname; const ne_inet_addr *address; } ci; struct /* ne_status_connected, ne_status_disconnected */ { /* The hostname to which a connection has just been * established or closed: */ const char *hostname; } cd; struct /* ne_status_sending and ne_status_recving */ { /* Request/response body transfer progress; if total == -1, the * total size is unknown; else 0 <= progress <= total: */ ne_off_t progress, total; } sr; } ne_session_status_info; /* Callback invoked to notify a new session status event, given by the * 'status' argument. On invocation, the contents of exactly one of * the structures in the info union will be valid, as indicated * above. */ typedef void (*ne_notify_status)(void *userdata, ne_session_status status, const ne_session_status_info *info); /* Set a status notification callback for the session, to report * session status events. Only one notification callback per session * can be registered; the most recent of successive calls to this * function takes effect. * * NOTE: Use of this interface is mutually exclusive with the use of * ne_set_progress(). A call to ne_set_notifier() removes the * progress callback, and vice versa. */ void ne_set_notifier(ne_session *sess, ne_notify_status status, void *userdata); /* Certificate verification failures. * The certificate is not yet valid: */ #define NE_SSL_NOTYETVALID (0x01) /* The certificate has expired: */ #define NE_SSL_EXPIRED (0x02) /* The hostname for which the certificate was issued does not * match the hostname of the server; this could mean that the * connection is being intercepted: */ #define NE_SSL_IDMISMATCH (0x04) /* The certificate authority which signed the server certificate is * not trusted: there is no indicatation the server is who they claim * to be: */ #define NE_SSL_UNTRUSTED (0x08) /* The bitmask of known failure bits: if (failures & ~NE_SSL_FAILMASK) * is non-zero, an unrecognized failure is given, and the verification * should be failed. */ #define NE_SSL_FAILMASK (0x0f) /* A callback which is used when server certificate verification is * needed. The reasons for verification failure are given in the * 'failures' parameter, which is a binary OR of one or more of the * above NE_SSL_* values. failures is guaranteed to be non-zero. The * callback must return zero to accept the certificate: a non-zero * return value will fail the SSL negotiation. */ typedef int (*ne_ssl_verify_fn)(void *userdata, int failures, const ne_ssl_certificate *cert); /* Install a callback to handle server certificate verification. This * is required when the CA certificate is not known for the server * certificate, or the server cert has other verification problems. */ void ne_ssl_set_verify(ne_session *sess, ne_ssl_verify_fn fn, void *userdata); /* Use the given client certificate for the session. The client cert * MUST be in the decrypted state, otherwise behaviour is undefined. * The 'clicert' object is duplicated internally so can be destroyed * by the caller. */ void ne_ssl_set_clicert(ne_session *sess, const ne_ssl_client_cert *clicert); /* Indicate that the certificate 'cert' is trusted; the 'cert' object * is duplicated internally so can be destroyed by the caller. This * function has no effect for non-SSL sessions. */ void ne_ssl_trust_cert(ne_session *sess, const ne_ssl_certificate *cert); /* If the SSL library provided a default set of CA certificates, trust * this set of CAs. */ void ne_ssl_trust_default_ca(ne_session *sess); /* Callback used to load a client certificate on demand. If dncount * is > 0, the 'dnames' array dnames[0] through dnames[dncount-1] * gives the list of CA names which the server indicated were * acceptable. The callback should load an appropriate client * certificate and then pass it to 'ne_ssl_set_clicert'. */ typedef void (*ne_ssl_provide_fn)(void *userdata, ne_session *sess, const ne_ssl_dname *const *dnames, int dncount); /* Register a function to be called when the server requests a client * certificate. */ void ne_ssl_provide_clicert(ne_session *sess, ne_ssl_provide_fn fn, void *userdata); /* Set the timeout (in seconds) used when reading from a socket. The * timeout value must be greater than zero. */ void ne_set_read_timeout(ne_session *sess, int timeout); /* Set the timeout (in seconds) used when making a connection. The * timeout value must be greater than zero. */ void ne_set_connect_timeout(ne_session *sess, int timeout); /* Sets the user-agent string. neon/VERSION will be appended, to make * the full header "User-Agent: product neon/VERSION". * If this function is not called, the User-Agent header is not sent. * The product string must follow the RFC2616 format, i.e. * product = token ["/" product-version] * product-version = token * where token is any alpha-numeric-y string [a-zA-Z0-9]* */ void ne_set_useragent(ne_session *sess, const char *product); /* Returns non-zero if next-hop server does not claim compliance to * HTTP/1.1 or later. */ int ne_version_pre_http11(ne_session *sess); /* Returns the 'hostport' URI segment for the end-server, e.g. * "my.server.com:8080". */ const char *ne_get_server_hostport(ne_session *sess); /* Returns the URL scheme being used for the current session, omitting * the trailing ':'; e.g. "http" or "https". */ const char *ne_get_scheme(ne_session *sess); /* Sets the host, scheme, and port fields of the given URI structure * to that of the configured server and scheme for the session; host * and scheme are malloc-allocated. No other fields in the URI * structure are changed. */ void ne_fill_server_uri(ne_session *sess, ne_uri *uri); /* If a proxy is configured, sets the host and port fields in the * given URI structure to that of the proxy. The hostname is * malloc-allocated. No other fields in the URI structure are * changed; if a proxy is not configured, no fields are changed. */ void ne_fill_proxy_uri(ne_session *sess, ne_uri *uri); /* Set the error string for the session; takes printf-like format * string. */ void ne_set_error(ne_session *sess, const char *format, ...) ne_attribute((format (printf, 2, 3))); /* Retrieve the error string for the session */ const char *ne_get_error(ne_session *sess); NE_END_DECLS #endif /* NE_SESSION_H */ sitecopy-0.16.6/lib/neon/ne_privssl.h0000664000076400007640000000473610752423462015652 0ustar joejoe/* SSL interface definitions internal to neon. Copyright (C) 2003-2005, 2008, Joe Orton Copyright (C) 2004, Aleix Conchillo Flaque This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* THIS IS NOT A PUBLIC INTERFACE. You CANNOT include this header file * from an application. */ #ifndef NE_PRIVSSL_H #define NE_PRIVSSL_H /* This is the private interface between ne_socket, ne_gnutls and * ne_openssl. */ #include "ne_ssl.h" #include "ne_socket.h" #ifdef HAVE_OPENSSL #include struct ne_ssl_context_s { SSL_CTX *ctx; SSL_SESSION *sess; const char *hostname; /* for SNI */ }; typedef SSL *ne_ssl_socket; #endif /* HAVE_OPENSSL */ #ifdef HAVE_GNUTLS #include struct ne_ssl_context_s { gnutls_certificate_credentials cred; int verify; /* non-zero if client cert verification required */ const char *hostname; /* for SNI */ /* Session cache. */ union ne_ssl_scache { struct { gnutls_datum key, data; } server; #if defined(HAVE_GNUTLS_SESSION_GET_DATA2) gnutls_datum client; #else struct { char *data; size_t len; } client; #endif } cache; #ifdef HAVE_GNUTLS_SIGN_CALLBACK_SET gnutls_sign_func sign_func; void *sign_data; #endif }; typedef gnutls_session ne_ssl_socket; ne_ssl_client_cert *ne__ssl_clicert_exkey_import(const unsigned char *der, size_t der_len); #endif /* HAVE_GNUTLS */ ne_ssl_socket ne__sock_sslsock(ne_socket *sock); /* Process-global initialization of the SSL library; returns non-zero * on error. */ int ne__ssl_init(void); /* Process-global de-initialization of the SSL library. */ void ne__ssl_exit(void); #endif /* NE_PRIVSSL_H */ sitecopy-0.16.6/lib/neon/ne_i18n.h0000664000076400007640000000373010357474464014731 0ustar joejoe/* Internationalization of neon Copyright (C) 2005-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_I18N_H #define NE_I18N_H #include "ne_defs.h" NE_BEGIN_DECLS /* Initialize translated error messages within neon. If 'encoding' is * non-NULL, it specifies the character encoding for the generated * translated strings. If it is NULL, the appropriate character * encoding for the locale will be used. * * This call is only strictly necessary if either: * * a) neon has been installed into a different prefix than the * gettext() implementation on which it depends for i18n purposes, or * * b) the caller requires that translated messages are in a particular * character encoding. * * If ne_i18n_init() is never called, the message catalogs will not be * found if case (a) applies (and so English error messages will be * used), and will use the default character encoding specified by the * process locale. The library will otherwise operate correctly. * * Note that the encoding used is a process-global setting and so * results may be unexpected if other users of neon within the process * call ne_i18n_init() with a different encoding parameter. */ void ne_i18n_init(const char *encoding); NE_END_DECLS #endif /* NE_I18N_H */ sitecopy-0.16.6/lib/neon/ne_pkcs11.c0000664000076400007640000003672310763234205015243 0ustar joejoe/* neon PKCS#11 support Copyright (C) 2008, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include "ne_pkcs11.h" #ifdef HAVE_PAKCHOIS #include #include #include "ne_internal.h" #include "ne_alloc.h" #include "ne_private.h" #include "ne_privssl.h" struct ne_ssl_pkcs11_provider_s { pakchois_module_t *module; ne_ssl_pkcs11_pin_fn pin_fn; void *pin_data; pakchois_session_t *session; ne_ssl_client_cert *clicert; ck_object_handle_t privkey; }; /* To do list for PKCS#11 support: - propagate error strings back to ne_session; use new pakchois_error() for pakchois API 0.2 - add API to specify a particular slot number to use for clicert - add API to specify a particular cert ID for clicert - find a certificate which has an issuer matching the CA dnames given by GnuTLS - make sure subject name matches betweeen pubkey and privkey - support DSA along with RSA - check error handling & fail gracefully if the token is ejected mid-session - add API to enumerate/search provided certs and allow direct choice? (or just punt) - the session<->provider interface requires that one clicert is used for all sessions. remove this limitation - add API to import all CA certs as trusted (CKA_CERTIFICATE_CATEGORY seems to be unused unfortunately; just add all X509 certs with CKA_TRUSTED set to true)) */ static int pk11_find_x509(ne_ssl_pkcs11_provider *prov, pakchois_session_t *pks, unsigned char *certid, unsigned long *cid_len) { struct ck_attribute a[3]; ck_object_class_t class; ck_certificate_type_t type; ck_rv_t rv; ck_object_handle_t obj; unsigned long count; int found = 0; /* Find objects with cert class and X.509 cert type. */ class = CKO_CERTIFICATE; type = CKC_X_509; a[0].type = CKA_CLASS; a[0].value = &class; a[0].value_len = sizeof class; a[1].type = CKA_CERTIFICATE_TYPE; a[1].value = &type; a[1].value_len = sizeof type; rv = pakchois_find_objects_init(pks, a, 2); if (rv != CKR_OK) { NE_DEBUG(NE_DBG_SSL, "pk11: FindObjectsInit failed.\n"); return 0; } while (pakchois_find_objects(pks, &obj, 1, &count) == CKR_OK && count == 1) { unsigned char value[8192], subject[8192]; a[0].type = CKA_VALUE; a[0].value = value; a[0].value_len = sizeof value; a[1].type = CKA_ID; a[1].value = certid; a[1].value_len = *cid_len; a[2].type = CKA_SUBJECT; a[2].value = subject; a[2].value_len = sizeof subject; if (pakchois_get_attribute_value(pks, obj, a, 3) == CKR_OK) { ne_ssl_client_cert *cc; cc = ne__ssl_clicert_exkey_import(value, a[0].value_len); if (cc) { NE_DEBUG(NE_DBG_SSL, "pk11: Imported X.509 cert.\n"); prov->clicert = cc; found = 1; *cid_len = a[1].value_len; break; } } else { NE_DEBUG(NE_DBG_SSL, "pk11: Skipped cert, missing attrs.\n"); } } pakchois_find_objects_final(pks); return found; } static int pk11_find_pkey(ne_ssl_pkcs11_provider *prov, pakchois_session_t *pks, unsigned char *certid, unsigned long cid_len) { struct ck_attribute a[3]; ck_object_class_t class; ck_key_type_t type; ck_rv_t rv; ck_object_handle_t obj; unsigned long count; int found = 0; class = CKO_PRIVATE_KEY; type = CKK_RSA; /* FIXME: check from the cert whether DSA or RSA */ /* Find an object with private key class and a certificate ID * which matches the certificate. */ /* FIXME: also match the cert subject. */ a[0].type = CKA_CLASS; a[0].value = &class; a[0].value_len = sizeof class; a[1].type = CKA_KEY_TYPE; a[1].value = &type; a[1].value_len = sizeof type; a[2].type = CKA_ID; a[2].value = certid; a[2].value_len = cid_len; rv = pakchois_find_objects_init(pks, a, 3); if (rv != CKR_OK) { NE_DEBUG(NE_DBG_SSL, "pk11: FindObjectsInit failed.\n"); /* TODO: error propagation */ return 0; } rv = pakchois_find_objects(pks, &obj, 1, &count); if (rv == CKR_OK && count == 1) { NE_DEBUG(NE_DBG_SSL, "pk11: Found private key.\n"); found = 1; prov->privkey = obj; } pakchois_find_objects_final(pks); return found; } static int find_client_cert(ne_ssl_pkcs11_provider *prov, pakchois_session_t *pks) { unsigned char certid[8192]; unsigned long cid_len = sizeof certid; /* TODO: match cert subject too. */ return pk11_find_x509(prov, pks, certid, &cid_len) && pk11_find_pkey(prov, pks, certid, cid_len); } /* Callback invoked by GnuTLS to provide the signature. The signature * operation is handled here by the PKCS#11 provider. */ static int pk11_sign_callback(gnutls_session_t session, void *userdata, gnutls_certificate_type_t cert_type, const gnutls_datum_t *cert, const gnutls_datum_t *hash, gnutls_datum_t *signature) { ne_ssl_pkcs11_provider *prov = userdata; ck_rv_t rv; struct ck_mechanism mech; unsigned long siglen; if (!prov->session || prov->privkey == CK_INVALID_HANDLE) { NE_DEBUG(NE_DBG_SSL, "pk11: Cannot sign, no session/key.\n"); return GNUTLS_E_NO_CERTIFICATE_FOUND; } /* FIXME: from the object determine whether this should be * CKM_DSA, or CKM_RSA_PKCS, or something unknown (&fail). */ mech.mechanism = CKM_RSA_PKCS; mech.parameter = NULL; mech.parameter_len = 0; /* Initialize signing operation; using the private key discovered * earlier. */ rv = pakchois_sign_init(prov->session, &mech, prov->privkey); if (rv != CKR_OK) { NE_DEBUG(NE_DBG_SSL, "pk11: SignInit failed: %lx.\n", rv); return GNUTLS_E_PK_SIGN_FAILED; } /* Work out how long the signature must be: */ rv = pakchois_sign(prov->session, hash->data, hash->size, NULL, &siglen); if (rv != CKR_OK) { NE_DEBUG(NE_DBG_SSL, "pk11: Sign1 failed.\n"); return GNUTLS_E_PK_SIGN_FAILED; } signature->data = gnutls_malloc(siglen); signature->size = siglen; rv = pakchois_sign(prov->session, hash->data, hash->size, signature->data, &siglen); if (rv != CKR_OK) { NE_DEBUG(NE_DBG_SSL, "pk11: Sign2 failed.\n"); return GNUTLS_E_PK_SIGN_FAILED; } NE_DEBUG(NE_DBG_SSL, "pk11: Signed successfully.\n"); return 0; } static void terminate_string(unsigned char *str, size_t len) { unsigned char *ptr = str + len - 1; while ((*ptr == ' ' || *ptr == '\t' || *ptr == '\0') && ptr >= str) ptr--; if (ptr == str - 1) str[0] = '\0'; else if (ptr == str + len - 1) str[len-1] = '\0'; else ptr[1] = '\0'; } static int pk11_login(ne_ssl_pkcs11_provider *prov, ck_slot_id_t slot_id, pakchois_session_t *pks, struct ck_slot_info *sinfo) { struct ck_token_info tinfo; int attempt = 0; ck_rv_t rv; if (pakchois_get_token_info(prov->module, slot_id, &tinfo) != CKR_OK) { NE_DEBUG(NE_DBG_SSL, "pk11: GetTokenInfo failed\n"); /* TODO: propagate error. */ return -1; } if ((tinfo.flags & CKF_LOGIN_REQUIRED) == 0) { NE_DEBUG(NE_DBG_SSL, "pk11: No login required.\n"); return 0; } /* For a token with a "protected" (out-of-band) authentication * path, calling login with a NULL username is all that is * required. */ if (tinfo.flags & CKF_PROTECTED_AUTHENTICATION_PATH) { if (pakchois_login(pks, CKU_USER, NULL, 0) == CKR_OK) { return 0; } else { NE_DEBUG(NE_DBG_SSL, "pk11: Protected login failed.\n"); /* TODO: error propagation. */ return -1; } } /* Otherwise, PIN entry is necessary for login, so fail if there's * no callback. */ if (!prov->pin_fn) { NE_DEBUG(NE_DBG_SSL, "pk11: No pin callback but login required.\n"); /* TODO: propagate error. */ return -1; } terminate_string(sinfo->slot_description, sizeof sinfo->slot_description); do { char pin[NE_SSL_P11PINLEN]; unsigned int flags = 0; /* If login has been attempted once already, check the token * status again, the flags might change. */ if (attempt) { if (pakchois_get_token_info(prov->module, slot_id, &tinfo) != CKR_OK) { NE_DEBUG(NE_DBG_SSL, "pk11: GetTokenInfo failed\n"); /* TODO: propagate error. */ return -1; } } if (tinfo.flags & CKF_USER_PIN_COUNT_LOW) flags |= NE_SSL_P11PIN_COUNT_LOW; if (tinfo.flags & CKF_USER_PIN_FINAL_TRY) flags |= NE_SSL_P11PIN_FINAL_TRY; terminate_string(tinfo.label, sizeof tinfo.label); if (prov->pin_fn(prov->pin_data, attempt++, (char *)sinfo->slot_description, (char *)tinfo.label, flags, pin)) { return -1; } rv = pakchois_login(pks, CKU_USER, (unsigned char *)pin, strlen(pin)); /* Try to scrub the pin off the stack. Clever compilers will * probably optimize this away, oh well. */ memset(pin, 0, sizeof pin); } while (rv == CKR_PIN_INCORRECT); NE_DEBUG(NE_DBG_SSL, "pk11: Login result = %lu\n", rv); return (rv == CKR_OK || rv == CKR_USER_ALREADY_LOGGED_IN) ? 0 : -1; } static void pk11_provide(void *userdata, ne_session *sess, const ne_ssl_dname *const *dnames, int dncount) { ne_ssl_pkcs11_provider *prov = userdata; ck_slot_id_t *slots; unsigned long scount, n; if (prov->clicert) { NE_DEBUG(NE_DBG_SSL, "pk11: Using existing clicert.\n"); ne_ssl_set_clicert(sess, prov->clicert); return; } if (pakchois_get_slot_list(prov->module, 1, NULL, &scount) != CKR_OK || scount == 0) { NE_DEBUG(NE_DBG_SSL, "pk11: No slots.\n"); /* TODO: propagate error. */ return; } slots = ne_malloc(scount * sizeof *slots); if (pakchois_get_slot_list(prov->module, 1, slots, &scount) != CKR_OK) { ne_free(slots); NE_DEBUG(NE_DBG_SSL, "pk11: Really, no slots?\n"); /* TODO: propagate error. */ return; } NE_DEBUG(NE_DBG_SSL, "pk11: Found %ld slots.\n", scount); for (n = 0; n < scount; n++) { pakchois_session_t *pks; ck_rv_t rv; struct ck_slot_info sinfo; if (pakchois_get_slot_info(prov->module, slots[n], &sinfo) != CKR_OK) { NE_DEBUG(NE_DBG_SSL, "pk11: GetSlotInfo failed\n"); continue; } if ((sinfo.flags & CKF_TOKEN_PRESENT) == 0) { NE_DEBUG(NE_DBG_SSL, "pk11: slot empty, ignoring\n"); continue; } rv = pakchois_open_session(prov->module, slots[n], CKF_SERIAL_SESSION, NULL, NULL, &pks); if (rv != CKR_OK) { NE_DEBUG(NE_DBG_SSL, "pk11: could not open slot, %ld (%ld: %ld)\n", rv, n, slots[n]); continue; } if (pk11_login(prov, slots[n], pks, &sinfo) == 0) { if (find_client_cert(prov, pks)) { NE_DEBUG(NE_DBG_SSL, "pk11: Setup complete.\n"); prov->session = pks; ne_ssl_set_clicert(sess, prov->clicert); return; } } pakchois_close_session(pks); } ne_free(slots); } static int pk11_init(ne_ssl_pkcs11_provider **provider, pakchois_module_t *module) { ne_ssl_pkcs11_provider *prov; prov = *provider = ne_calloc(sizeof *prov); prov->module = module; prov->privkey = CK_INVALID_HANDLE; return NE_PK11_OK; } int ne_ssl_pkcs11_provider_init(ne_ssl_pkcs11_provider **provider, const char *name) { pakchois_module_t *pm; if (pakchois_module_load(&pm, name) == CKR_OK) { return pk11_init(provider, pm); } else { return NE_PK11_FAILED; } } int ne_ssl_pkcs11_nss_provider_init(ne_ssl_pkcs11_provider **provider, const char *name, const char *directory, const char *cert_prefix, const char *key_prefix, const char *secmod_db) { pakchois_module_t *pm; if (pakchois_module_nssload(&pm, name, directory, cert_prefix, key_prefix, secmod_db) == CKR_OK) { return pk11_init(provider, pm); } else { return NE_PK11_FAILED; } } void ne_ssl_pkcs11_provider_pin(ne_ssl_pkcs11_provider *provider, ne_ssl_pkcs11_pin_fn fn, void *userdata) { provider->pin_fn = fn; provider->pin_data = userdata; } void ne_ssl_set_pkcs11_provider(ne_session *sess, ne_ssl_pkcs11_provider *provider) { sess->ssl_context->sign_func = pk11_sign_callback; sess->ssl_context->sign_data = provider; ne_ssl_provide_clicert(sess, pk11_provide, provider); } void ne_ssl_pkcs11_provider_destroy(ne_ssl_pkcs11_provider *prov) { if (prov->session) { pakchois_close_session(prov->session); } if (prov->clicert) { ne_ssl_clicert_free(prov->clicert); } pakchois_module_destroy(prov->module); ne_free(prov); } #else /* !HAVE_PAKCHOIS */ int ne_ssl_pkcs11_provider_init(ne_ssl_pkcs11_provider **provider, const char *name) { return NE_PK11_NOTIMPL; } int ne_ssl_pkcs11_nss_provider_init(ne_ssl_pkcs11_provider **provider, const char *name, const char *directory, const char *cert_prefix, const char *key_prefix, const char *secmod_db) { return NE_PK11_NOTIMPL; } void ne_ssl_pkcs11_provider_destroy(ne_ssl_pkcs11_provider *provider) { } void ne_ssl_pkcs11_provider_pin(ne_ssl_pkcs11_provider *provider, ne_ssl_pkcs11_pin_fn fn, void *userdata) { } void ne_ssl_set_pkcs11_provider(ne_session *sess, ne_ssl_pkcs11_provider *provider) { } #endif /* HAVE_PAKCHOIS */ sitecopy-0.16.6/lib/neon/ne_utils.c0000664000076400007640000001251510403252053015262 0ustar joejoe/* HTTP utility functions Copyright (C) 1999-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include #ifdef HAVE_STRING_H #include #endif #include #include /* isdigit() for ne_parse_statusline */ #ifdef NE_HAVE_ZLIB #include #endif #ifdef HAVE_OPENSSL #include #endif #ifdef HAVE_GNUTLS #include #endif /* libxml2: pick up the version string. */ #if defined(HAVE_LIBXML) #include #elif defined(HAVE_EXPAT) && !defined(HAVE_XMLPARSE_H) #include #endif #include "ne_utils.h" #include "ne_string.h" /* for ne_strdup */ #include "ne_dates.h" int ne_debug_mask = 0; FILE *ne_debug_stream = NULL; void ne_debug_init(FILE *stream, int mask) { ne_debug_stream = stream; ne_debug_mask = mask; #if defined(HAVE_SETVBUF) && defined(_IONBF) /* If possible, turn off buffering on the debug log. this is very * helpful if debugging segfaults. */ if (stream) setvbuf(stream, NULL, _IONBF, 0); #endif } void ne_debug(int ch, const char *template, ...) { va_list params; if ((ch & ne_debug_mask) == 0) return; fflush(stdout); va_start(params, template); vfprintf(ne_debug_stream, template, params); va_end(params); if ((ch & NE_DBG_FLUSH) == NE_DBG_FLUSH) fflush(ne_debug_stream); } #define NE_STRINGIFY(x) # x #define NE_EXPAT_VER(x,y,z) NE_STRINGIFY(x) "." NE_STRINGIFY(y) "." NE_STRINGIFY(z) static const char version_string[] = "neon " NEON_VERSION ": " #ifdef NEON_IS_LIBRARY "Library build" #else "Bundled build" #endif #ifdef NE_HAVE_IPV6 ", IPv6" #endif #ifdef HAVE_EXPAT ", Expat" /* expat >=1.95.2 exported the version */ #ifdef XML_MAJOR_VERSION " " NE_EXPAT_VER(XML_MAJOR_VERSION, XML_MINOR_VERSION, XML_MICRO_VERSION) #endif #else /* !HAVE_EXPAT */ #ifdef HAVE_LIBXML ", libxml " LIBXML_DOTTED_VERSION #endif /* HAVE_LIBXML */ #endif /* !HAVE_EXPAT */ #if defined(NE_HAVE_ZLIB) && defined(ZLIB_VERSION) ", zlib " ZLIB_VERSION #endif /* NE_HAVE_ZLIB && ... */ #ifdef NE_HAVE_SOCKS ", SOCKSv5" #endif #ifdef HAVE_OPENSSL #ifdef OPENSSL_VERSION_TEXT ", " OPENSSL_VERSION_TEXT #else "OpenSSL (unknown version)" #endif /* OPENSSL_VERSION_TEXT */ #endif /* HAVE_OPENSSL */ #ifdef HAVE_GNUTLS ", GNU TLS " LIBGNUTLS_VERSION #endif /* HAVE_GNUTLS */ "." ; const char *ne_version_string(void) { return version_string; } int ne_version_match(int major, int minor) { return NE_VERSION_MAJOR != major || NE_VERSION_MINOR < minor || (NE_VERSION_MAJOR == 0 && NE_VERSION_MINOR != minor); } int ne_has_support(int feature) { switch (feature) { #if defined(NE_HAVE_SSL) || defined(NE_HAVE_ZLIB) || defined(NE_HAVE_IPV6) \ || defined(NE_HAVE_SOCKS) || defined(NE_HAVE_LFS) \ || defined(NE_HAVE_TS_SSL) || defined(NE_HAVE_I18N) #ifdef NE_HAVE_SSL case NE_FEATURE_SSL: #endif #ifdef NE_HAVE_ZLIB case NE_FEATURE_ZLIB: #endif #ifdef NE_HAVE_IPV6 case NE_FEATURE_IPV6: #endif #ifdef NE_HAVE_SOCKS case NE_FEATURE_SOCKS: #endif #ifdef NE_HAVE_LFS case NE_FEATURE_LFS: #endif #ifdef NE_HAVE_TS_SSL case NE_FEATURE_TS_SSL: #endif #ifdef NE_HAVE_I18N case NE_FEATURE_I18N: #endif return 1; #endif /* NE_HAVE_* */ default: return 0; } } int ne_parse_statusline(const char *status_line, ne_status *st) { const char *part; int major, minor, status_code, klass; /* skip leading garbage if any. */ part = strstr(status_line, "HTTP/"); if (part == NULL) return -1; minor = major = 0; /* Parse version string, skipping leading zeroes. */ for (part += 5; *part != '\0' && isdigit(*part); part++) major = major*10 + (*part-'0'); if (*part++ != '.') return -1; for (;*part != '\0' && isdigit(*part); part++) minor = minor*10 + (*part-'0'); if (*part != ' ') return -1; /* Skip any spaces */ for (; *part == ' '; part++) /* noop */; /* Parse the Status-Code; part now points at the first Y in * "HTTP/x.x YYY". */ if (!isdigit(part[0]) || !isdigit(part[1]) || !isdigit(part[2]) || (part[3] != '\0' && part[3] != ' ')) return -1; status_code = 100*(part[0]-'0') + 10*(part[1]-'0') + (part[2]-'0'); klass = part[0]-'0'; /* Skip whitespace between status-code and reason-phrase */ for (part+=3; *part == ' ' || *part == '\t'; part++) /* noop */; /* part now may be pointing to \0 if reason phrase is blank */ /* Fill in the results */ st->major_version = major; st->minor_version = minor; st->reason_phrase = ne_strclean(ne_strdup(part)); st->code = status_code; st->klass = klass; return 0; } sitecopy-0.16.6/lib/neon/ne_defs.h0000664000076400007640000000317511033122731015051 0ustar joejoe/* Standard definitions for neon headers Copyright (C) 2003-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #undef NE_BEGIN_DECLS #undef NE_END_DECLS #ifdef __cplusplus # define NE_BEGIN_DECLS extern "C" { # define NE_END_DECLS } #else # define NE_BEGIN_DECLS /* empty */ # define NE_END_DECLS /* empty */ #endif #ifndef NE_DEFS_H #define NE_DEFS_H #include #ifdef NE_LFS typedef off64_t ne_off_t; #else typedef off_t ne_off_t; #endif /* define ssize_t for Win32 */ #if defined(WIN32) && !defined(ssize_t) #define ssize_t int #endif #ifdef __NETWARE__ #include /* for time_t */ #endif #ifdef __GNUC__ #if __GNUC__ >= 3 #define ne_attribute_malloc __attribute__((malloc)) #else #define ne_attribute_malloc #endif #define ne_attribute(x) __attribute__(x) #else #define ne_attribute(x) #define ne_attribute_malloc #endif #ifndef NE_BUFSIZ #define NE_BUFSIZ 8192 #endif #endif /* NE_DEFS_H */ sitecopy-0.16.6/lib/neon/Makefile.in0000664000076400007640000001444010752424226015352 0ustar joejoe# # neon source directory Makefile # # Use the NEON_NORMAL_BUILD or NEON_LIBTOOL_BUILD autoconf # macros to set up this Makefile correctly. # SHELL = @SHELL@ # Installation paths prefix = @prefix@ exec_prefix = @exec_prefix@ libdir = @libdir@ # Build paths VPATH = @srcdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Toolchain settings. CC = @CC@ AR = @AR@ RANLIB = @RANLIB@ LIBTOOL = @LIBTOOL@ # Flags CPPFLAGS = @DEFS@ @CPPFLAGS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ NEON_LINK_FLAGS = @NEON_LINK_FLAGS@ # Note: don't substitute @LIBS@ in here; during a bundled # build of this directory, @LIBS@ may include -lneon. LIBS = @NEON_LIBS@ @NEON_LTLIBS@ COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) LINK = $(LIBTOOL) --quiet --mode=link $(CC) -no-undefined $(LDFLAGS) NEON_BASEOBJS = ne_request.@NEON_OBJEXT@ ne_session.@NEON_OBJEXT@ \ ne_basic.@NEON_OBJEXT@ ne_string.@NEON_OBJEXT@ \ ne_uri.@NEON_OBJEXT@ ne_dates.@NEON_OBJEXT@ ne_alloc.@NEON_OBJEXT@ \ ne_md5.@NEON_OBJEXT@ ne_utils.@NEON_OBJEXT@ \ ne_socket.@NEON_OBJEXT@ ne_auth.@NEON_OBJEXT@ \ ne_redirect.@NEON_OBJEXT@ ne_compress.@NEON_OBJEXT@ \ ne_i18n.@NEON_OBJEXT@ ne_pkcs11.@NEON_OBJEXT@ NEON_DAVOBJS = $(NEON_BASEOBJS) \ ne_207.@NEON_OBJEXT@ ne_xml.@NEON_OBJEXT@ \ ne_props.@NEON_OBJEXT@ ne_locks.@NEON_OBJEXT@ \ ne_xmlreq.@NEON_OBJEXT@ OBJECTS = @NEONOBJS@ @NEON_EXTRAOBJS@ .SUFFIXES: .SUFFIXES: .c .lo .o NEON_TARGET = @NEON_TARGET@ # Thanks to gettext for this neat trick. all: all-@NEON_BUILD_BUNDLED@ all-yes: $(NEON_TARGET) all-no: @echo "Bundled neon build not being used." .c.lo: $(LIBTOOL) --quiet --mode=compile $(COMPILE) -c $< -o $@ .c.o: $(COMPILE) -c $< -o $@ libneon.la: $(OBJECTS) $(LINK) -rpath $(libdir) $(NEON_LINK_FLAGS) -o $@ $(OBJECTS) $(LIBS) libneon.a: $(OBJECTS) @rm -f $@ $(AR) cru $@ $(OBJECTS) $(RANLIB) $@ clean: rm -f $(NEON_TARGET) *.o *.lo *.bbg *.bb *.gc* rm -rf .libs c++.c: find . -name ne_\*.h -print | sed 's/.*/#include "&"/;/ne_priv/d' > $@ echo "int main(void) {}" >> $@ check-c++: c++.c c++ -I. c++.c check-incl: @for f in ne_*.h; do \ echo Checking $$f...; \ echo "#include \"$$f\"" > checkincl.c; \ $(COMPILE) -c checkincl.c -o checkincl.o || exit 1; done # Update generated dependencies below; requires cc -MM as in gcc. update-deps: for f in `echo $(OBJECTS) | sed 's/\\.@NEON_OBJEXT@/.c/g'`; do \ $(CC) $(CPPFLAGS) -MM -c $$f; \ done | sed 's, \.\./, $$(top_builddir)/,g;s, /[^ ]*.h,,g;/^ .$$/d;s/\.o: /.@NEON''_OBJEXT@: /' > new-deps sed '/[-]--CUT---/q' Makefile.in > Makefile.new cat Makefile.new new-deps > Makefile.in rm new-deps Makefile.new #### ---CUT--- DO NOT REMOVE THIS LINE. Generated dependencies follow. #### ne_request.@NEON_OBJEXT@: ne_request.c $(top_builddir)/config.h ne_internal.h ne_defs.h ne_alloc.h \ ne_request.h ne_utils.h ne_string.h ne_session.h ne_ssl.h ne_uri.h \ ne_socket.h ne_private.h ne_pkcs11.h ne_session.@NEON_OBJEXT@: ne_session.c $(top_builddir)/config.h ne_session.h ne_ssl.h ne_defs.h \ ne_uri.h ne_socket.h ne_alloc.h ne_utils.h ne_internal.h ne_string.h \ ne_dates.h ne_private.h ne_request.h ne_pkcs11.h ne_basic.@NEON_OBJEXT@: ne_basic.c $(top_builddir)/config.h ne_request.h ne_utils.h ne_defs.h \ ne_string.h ne_alloc.h ne_session.h ne_ssl.h ne_uri.h ne_socket.h \ ne_basic.h ne_207.h ne_xml.h ne_locks.h ne_dates.h ne_internal.h ne_string.@NEON_OBJEXT@: ne_string.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_string.h ne_uri.@NEON_OBJEXT@: ne_uri.c $(top_builddir)/config.h ne_string.h ne_defs.h ne_alloc.h ne_uri.h ne_dates.@NEON_OBJEXT@: ne_dates.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_dates.h \ ne_string.h ne_alloc.@NEON_OBJEXT@: ne_alloc.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_md5.@NEON_OBJEXT@: ne_md5.c $(top_builddir)/config.h ne_md5.h ne_defs.h ne_string.h ne_alloc.h ne_utils.@NEON_OBJEXT@: ne_utils.c $(top_builddir)/config.h ne_utils.h ne_defs.h ne_string.h \ ne_alloc.h ne_dates.h ne_socket.@NEON_OBJEXT@: ne_socket.c $(top_builddir)/config.h ne_privssl.h ne_ssl.h ne_defs.h \ ne_socket.h ne_internal.h ne_utils.h ne_string.h ne_alloc.h ne_sspi.h ne_auth.@NEON_OBJEXT@: ne_auth.c $(top_builddir)/config.h ne_md5.h ne_defs.h ne_dates.h \ ne_request.h ne_utils.h ne_string.h ne_alloc.h ne_session.h ne_ssl.h \ ne_uri.h ne_socket.h ne_auth.h ne_internal.h ne_redirect.@NEON_OBJEXT@: ne_redirect.c $(top_builddir)/config.h ne_session.h ne_ssl.h ne_defs.h \ ne_uri.h ne_socket.h ne_request.h ne_utils.h ne_string.h ne_alloc.h \ ne_redirect.h ne_internal.h ne_compress.@NEON_OBJEXT@: ne_compress.c $(top_builddir)/config.h ne_request.h ne_utils.h \ ne_defs.h ne_string.h ne_alloc.h ne_session.h ne_ssl.h ne_uri.h \ ne_socket.h ne_compress.h ne_internal.h ne_i18n.@NEON_OBJEXT@: ne_i18n.c $(top_builddir)/config.h ne_i18n.h ne_defs.h ne_pkcs11.@NEON_OBJEXT@: ne_pkcs11.c $(top_builddir)/config.h ne_pkcs11.h ne_defs.h ne_session.h \ ne_ssl.h ne_uri.h ne_socket.h ne_207.@NEON_OBJEXT@: ne_207.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_utils.h ne_xml.h \ ne_207.h ne_request.h ne_string.h ne_session.h ne_ssl.h ne_uri.h \ ne_socket.h ne_basic.h ne_internal.h ne_xml.@NEON_OBJEXT@: ne_xml.c $(top_builddir)/config.h ne_internal.h ne_defs.h ne_alloc.h \ ne_xml.h ne_utils.h ne_string.h ne_props.@NEON_OBJEXT@: ne_props.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_xml.h \ ne_props.h ne_request.h ne_utils.h ne_string.h ne_session.h ne_ssl.h \ ne_uri.h ne_socket.h ne_207.h ne_basic.h ne_locks.h ne_internal.h ne_locks.@NEON_OBJEXT@: ne_locks.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_request.h \ ne_utils.h ne_string.h ne_session.h ne_ssl.h ne_uri.h ne_socket.h \ ne_xml.h ne_locks.h ne_basic.h ne_props.h ne_207.h ne_internal.h \ ne_xmlreq.h ne_xmlreq.@NEON_OBJEXT@: ne_xmlreq.c $(top_builddir)/config.h ne_internal.h ne_defs.h ne_xmlreq.h \ ne_request.h ne_utils.h ne_string.h ne_alloc.h ne_session.h ne_ssl.h \ ne_uri.h ne_socket.h ne_xml.h ne_basic.h ne_acl.@NEON_OBJEXT@: ne_acl.c $(top_builddir)/config.h ne_request.h ne_utils.h ne_defs.h \ ne_string.h ne_alloc.h ne_session.h ne_ssl.h ne_uri.h ne_socket.h \ ne_locks.h ne_acl.h ne_xml.h ne_openssl.@NEON_OBJEXT@: ne_openssl.c $(top_builddir)/config.h ne_ssl.h ne_defs.h ne_string.h \ ne_alloc.h ne_session.h ne_uri.h ne_socket.h ne_internal.h ne_private.h \ ne_request.h ne_utils.h ne_pkcs11.h ne_privssl.h sitecopy-0.16.6/lib/neon/ne_xml.c0000664000076400007640000004565710656561174014760 0ustar joejoe/* Wrapper interface to XML parser Copyright (C) 1999-2007, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #include "ne_internal.h" #include "ne_alloc.h" #include "ne_xml.h" #include "ne_utils.h" #include "ne_string.h" #if defined(HAVE_EXPAT) /* expat support: */ #ifdef HAVE_XMLPARSE_H #include "xmlparse.h" #else #include #endif typedef XML_Char ne_xml_char; #if !defined(XML_MAJOR_VERSION) #define NEED_BOM_HANDLING #elif XML_MAJOR_VERSION < 2 && XML_MINOR_VERSION == 95 && XML_MICRO_VERSION < 2 #define NEED_BOM_HANDLING #endif #elif defined(HAVE_LIBXML) /* libxml2 support: */ #include #include typedef xmlChar ne_xml_char; #if LIBXML_VERSION < 20619 /* 2.6.19 and earlier have broken BOM handling */ #define NEED_BOM_HANDLING #endif #else /* not HAVE_LIBXML */ # error need an XML parser #endif /* not HAVE_EXPAT */ /* Approx. one screen of text: */ #define ERR_SIZE (2048) struct handler { ne_xml_startelm_cb *startelm_cb; /* start-element callback */ ne_xml_endelm_cb *endelm_cb; /* end-element callback */ ne_xml_cdata_cb *cdata_cb; /* character-data callback. */ void *userdata; /* userdata for the above. */ struct handler *next; /* next handler in stack. */ }; #ifdef HAVE_LIBXML static void sax_error(void *ctx, const char *msg, ...); #endif struct element { const ne_xml_char *nspace; ne_xml_char *name; int state; /* opaque state integer */ /* Namespaces declared in this element */ ne_xml_char *default_ns; /* A default namespace */ struct namespace *nspaces; /* List of other namespace scopes */ struct handler *handler; /* Handler for this element */ struct element *parent; /* parent element, or NULL */ }; /* We pass around a ne_xml_parser as the userdata in the parsing * library. This maintains the current state of the parse and various * other bits and bobs. Within the parse, we store the current branch * of the tree, i.e., the current element and all its parents, up to * the root, but nothing other than that. */ struct ne_xml_parser_s { struct element *root; /* the root of the document */ struct element *current; /* current element in the branch */ struct handler *top_handlers; /* always points at the * handler on top of the stack. */ int failure; /* zero whilst parse should continue */ int prune; /* if non-zero, depth within a dead branch */ #ifdef NEED_BOM_HANDLING int bom_pos; #endif #ifdef HAVE_EXPAT XML_Parser parser; char *encoding; #else xmlParserCtxtPtr parser; #endif char error[ERR_SIZE]; }; /* The callback handlers */ static void start_element(void *userdata, const ne_xml_char *name, const ne_xml_char **atts); static void end_element(void *userdata, const ne_xml_char *name); static void char_data(void *userdata, const ne_xml_char *cdata, int len); static const char *resolve_nspace(const struct element *elm, const char *prefix, size_t pfxlen); /* Linked list of namespace scopes */ struct namespace { ne_xml_char *name; ne_xml_char *uri; struct namespace *next; }; #ifdef HAVE_LIBXML /* Could be const as far as we care, but libxml doesn't want that */ static xmlSAXHandler sax_handler = { NULL, /* internalSubset */ NULL, /* isStandalone */ NULL, /* hasInternalSubset */ NULL, /* hasExternalSubset */ NULL, /* resolveEntity */ NULL, /* getEntity */ NULL, /* entityDecl */ NULL, /* notationDecl */ NULL, /* attributeDecl */ NULL, /* elementDecl */ NULL, /* unparsedEntityDecl */ NULL, /* setDocumentLocator */ NULL, /* startDocument */ NULL, /* endDocument */ start_element, /* startElement */ end_element, /* endElement */ NULL, /* reference */ char_data, /* characters */ NULL, /* ignorableWhitespace */ NULL, /* processingInstruction */ NULL, /* comment */ NULL, /* xmlParserWarning */ sax_error, /* xmlParserError */ sax_error, /* fatal error (never called by libxml2?) */ NULL, /* getParameterEntity */ char_data /* cdataBlock */ }; /* empty attributes array to mimic expat behaviour */ static const char *const empty_atts[] = {NULL, NULL}; /* macro for determining the attributes array to pass */ #define PASS_ATTS(atts) (atts ? (const char **)(atts) : empty_atts) #else #define PASS_ATTS(atts) ((const char **)(atts)) /* XML declaration callback for expat. */ static void decl_handler(void *userdata, const XML_Char *version, const XML_Char *encoding, int standalone) { ne_xml_parser *p = userdata; if (encoding) p->encoding = ne_strdup(encoding); } #endif /* HAVE_LIBXML */ int ne_xml_currentline(ne_xml_parser *p) { #ifdef HAVE_EXPAT return XML_GetCurrentLineNumber(p->parser); #else return p->parser->input->line; #endif } const char *ne_xml_doc_encoding(const ne_xml_parser *p) { #ifdef HAVE_LIBXML return p->parser->encoding; #else return p->encoding; #endif } /* The first character of the REC-xml-names "NCName" rule excludes * "Digit | '.' | '-' | '_' | CombiningChar | Extender"; the XML * parser will not enforce this rule in a namespace declaration since * it treats the entire attribute name as a REC-xml "Name" rule. It's * too hard to check for all of CombiningChar | Digit | Extender here, * but the valid_ncname_ch1 macro catches some of the rest. */ /* Return non-zero if 'ch' is an invalid start character for an NCName: */ #define invalid_ncname_ch1(ch) ((ch) == '\0' || strchr("-.0123456789", (ch)) != NULL) /* Subversion repositories have been deployed which use property names * marshalled as NCNames including a colon character; these should * also be rejected but will be allowed for the time being. */ #define invalid_ncname(xn) (invalid_ncname_ch1((xn)[0])) /* Extract the namespace prefix declarations from 'atts'. */ static int declare_nspaces(ne_xml_parser *p, struct element *elm, const ne_xml_char **atts) { int n; for (n = 0; atts && atts[n]; n += 2) { if (strcmp(atts[n], "xmlns") == 0) { /* New default namespace */ elm->default_ns = ne_strdup(atts[n+1]); } else if (strncmp(atts[n], "xmlns:", 6) == 0) { struct namespace *ns; /* Reject some invalid NCNames as namespace prefix, and an * empty URI as the namespace URI */ if (invalid_ncname(atts[n] + 6) || atts[n+1][0] == '\0') { ne_snprintf(p->error, ERR_SIZE, ("XML parse error at line %d: invalid namespace " "declaration"), ne_xml_currentline(p)); return -1; } /* New namespace scope */ ns = ne_calloc(sizeof(*ns)); ns->next = elm->nspaces; elm->nspaces = ns; ns->name = ne_strdup(atts[n]+6); /* skip the xmlns= */ ns->uri = ne_strdup(atts[n+1]); } } return 0; } /* Expand an XML qualified name, which may include a namespace prefix * as well as the local part. */ static int expand_qname(ne_xml_parser *p, struct element *elm, const ne_xml_char *qname) { const ne_xml_char *pfx; pfx = strchr(qname, ':'); if (pfx == NULL) { struct element *e = elm; /* Find default namespace; guaranteed to terminate as the root * element always has default_ns="". */ while (e->default_ns == NULL) e = e->parent; elm->name = ne_strdup(qname); elm->nspace = e->default_ns; } else if (invalid_ncname(pfx + 1) || qname == pfx) { ne_snprintf(p->error, ERR_SIZE, _("XML parse error at line %d: invalid element name"), ne_xml_currentline(p)); return -1; } else { const char *uri = resolve_nspace(elm, qname, pfx-qname); if (uri) { elm->name = ne_strdup(pfx+1); elm->nspace = uri; } else { ne_snprintf(p->error, ERR_SIZE, ("XML parse error at line %d: undeclared namespace prefix"), ne_xml_currentline(p)); return -1; } } return 0; } /* Called with the start of a new element. */ static void start_element(void *userdata, const ne_xml_char *name, const ne_xml_char **atts) { ne_xml_parser *p = userdata; struct element *elm; struct handler *hand; int state = NE_XML_DECLINE; if (p->failure) return; if (p->prune) { p->prune++; return; } /* Create a new element */ elm = ne_calloc(sizeof *elm); elm->parent = p->current; p->current = elm; if (declare_nspaces(p, elm, atts) || expand_qname(p, elm, name)) { p->failure = 1; return; } /* Find a handler which will accept this element (or abort the parse) */ for (hand = elm->parent->handler; hand && state == NE_XML_DECLINE; hand = hand->next) { elm->handler = hand; state = hand->startelm_cb(hand->userdata, elm->parent->state, elm->nspace, elm->name, PASS_ATTS(atts)); } NE_DEBUG(NE_DBG_XML, "XML: start-element (%d, {%s, %s}) => %d\n", elm->parent->state, elm->nspace, elm->name, state); if (state > 0) elm->state = state; else if (state == NE_XML_DECLINE) /* prune this branch. */ p->prune++; else /* state < 0 => abort parse */ p->failure = state; } /* Destroys an element structure. */ static void destroy_element(struct element *elm) { struct namespace *this_ns, *next_ns; ne_free(elm->name); /* Free the namespaces */ this_ns = elm->nspaces; while (this_ns != NULL) { next_ns = this_ns->next; ne_free(this_ns->name); ne_free(this_ns->uri); ne_free(this_ns); this_ns = next_ns; } if (elm->default_ns) ne_free(elm->default_ns); ne_free(elm); } /* cdata SAX callback */ static void char_data(void *userdata, const ne_xml_char *data, int len) { ne_xml_parser *p = userdata; struct element *elm = p->current; if (p->failure || p->prune) return; if (elm->handler->cdata_cb) { p->failure = elm->handler->cdata_cb(elm->handler->userdata, elm->state, data, len); NE_DEBUG(NE_DBG_XML, "XML: char-data (%d) returns %d\n", elm->state, p->failure); } } /* Called with the end of an element */ static void end_element(void *userdata, const ne_xml_char *name) { ne_xml_parser *p = userdata; struct element *elm = p->current; if (p->failure) return; if (p->prune) { if (p->prune-- > 1) return; } else if (elm->handler->endelm_cb) { p->failure = elm->handler->endelm_cb(elm->handler->userdata, elm->state, elm->nspace, elm->name); if (p->failure) { NE_DEBUG(NE_DBG_XML, "XML: end-element for %d failed with %d.\n", elm->state, p->failure); } } NE_DEBUG(NE_DBG_XML, "XML: end-element (%d, {%s, %s})\n", elm->state, elm->nspace, elm->name); /* move back up the tree */ p->current = elm->parent; p->prune = 0; destroy_element(elm); } /* Find a namespace definition for 'prefix' in given element, where * length of prefix is 'pfxlen'. Returns the URI or NULL. */ static const char *resolve_nspace(const struct element *elm, const char *prefix, size_t pfxlen) { const struct element *s; /* Search up the tree. */ for (s = elm; s != NULL; s = s->parent) { const struct namespace *ns; /* Iterate over defined spaces on this node. */ for (ns = s->nspaces; ns != NULL; ns = ns->next) { if (strlen(ns->name) == pfxlen && memcmp(ns->name, prefix, pfxlen) == 0) return ns->uri; } } return NULL; } const char *ne_xml_resolve_nspace(ne_xml_parser *parser, const char *prefix, size_t length) { if (prefix) { return resolve_nspace(parser->current, prefix, length); } else { struct element *e = parser->current; while (e->default_ns == NULL) e = e->parent; return e->default_ns; } } ne_xml_parser *ne_xml_create(void) { ne_xml_parser *p = ne_calloc(sizeof *p); /* Placeholder for the root element */ p->current = p->root = ne_calloc(sizeof *p->root); p->root->default_ns = ""; p->root->state = 0; strcpy(p->error, _("Unknown error")); #ifdef HAVE_EXPAT p->parser = XML_ParserCreate(NULL); if (p->parser == NULL) { abort(); } XML_SetElementHandler(p->parser, start_element, end_element); XML_SetCharacterDataHandler(p->parser, char_data); XML_SetUserData(p->parser, (void *) p); XML_SetXmlDeclHandler(p->parser, decl_handler); #else p->parser = xmlCreatePushParserCtxt(&sax_handler, (void *)p, NULL, 0, NULL); if (p->parser == NULL) { abort(); } p->parser->replaceEntities = 1; #endif return p; } void ne_xml_push_handler(ne_xml_parser *p, ne_xml_startelm_cb *startelm_cb, ne_xml_cdata_cb *cdata_cb, ne_xml_endelm_cb *endelm_cb, void *userdata) { struct handler *hand = ne_calloc(sizeof(struct handler)); hand->startelm_cb = startelm_cb; hand->cdata_cb = cdata_cb; hand->endelm_cb = endelm_cb; hand->userdata = userdata; /* If this is the first handler registered, update the * base pointer too. */ if (p->top_handlers == NULL) { p->root->handler = hand; p->top_handlers = hand; } else { p->top_handlers->next = hand; p->top_handlers = hand; } } int ne_xml_parse_v(void *userdata, const char *block, size_t len) { ne_xml_parser *p = userdata; return ne_xml_parse(p, (const ne_xml_char *)block, len); } #define BOM_UTF8 "\xEF\xBB\xBF" /* UTF-8 BOM */ int ne_xml_parse(ne_xml_parser *p, const char *block, size_t len) { int ret, flag; /* duck out if it's broken */ if (p->failure) { NE_DEBUG(NE_DBG_XMLPARSE, "XML: Failed; ignoring %" NE_FMT_SIZE_T " bytes.\n", len); return p->failure; } if (len == 0) { flag = -1; block = ""; NE_DEBUG(NE_DBG_XMLPARSE, "XML: End of document.\n"); } else { NE_DEBUG(NE_DBG_XMLPARSE, "XML: Parsing %" NE_FMT_SIZE_T " bytes.\n", len); flag = 0; } #ifdef NEED_BOM_HANDLING if (p->bom_pos < 3) { NE_DEBUG(NE_DBG_XMLPARSE, "Checking for UTF-8 BOM.\n"); while (len > 0 && p->bom_pos < 3 && block[0] == BOM_UTF8[p->bom_pos]) { block++; len--; p->bom_pos++; } if (len == 0) return 0; if (p->bom_pos == 0) { p->bom_pos = 3; /* no BOM */ } else if (p->bom_pos > 0 && p->bom_pos < 3) { strcpy(p->error, _("Invalid Byte Order Mark")); return p->failure = 1; } } #endif /* Note, don't write a parser error if p->failure, since an error * will already have been written in that case. */ #ifdef HAVE_EXPAT ret = XML_Parse(p->parser, block, len, flag); NE_DEBUG(NE_DBG_XMLPARSE, "XML: XML_Parse returned %d\n", ret); if (ret == 0 && p->failure == 0) { ne_snprintf(p->error, ERR_SIZE, "XML parse error at line %" NE_FMT_XML_SIZE ": %s", XML_GetCurrentLineNumber(p->parser), XML_ErrorString(XML_GetErrorCode(p->parser))); p->failure = 1; NE_DEBUG(NE_DBG_XMLPARSE, "XML: Parse error: %s\n", p->error); } #else ret = xmlParseChunk(p->parser, block, len, flag); NE_DEBUG(NE_DBG_XMLPARSE, "XML: xmlParseChunk returned %d\n", ret); /* Parse errors are normally caught by the sax_error() callback, * which clears p->valid. */ if (p->parser->errNo && p->failure == 0) { ne_snprintf(p->error, ERR_SIZE, "XML parse error at line %d", ne_xml_currentline(p)); p->failure = 1; NE_DEBUG(NE_DBG_XMLPARSE, "XML: Parse error: %s\n", p->error); } #endif return p->failure; } int ne_xml_failed(ne_xml_parser *p) { return p->failure; } void ne_xml_destroy(ne_xml_parser *p) { struct element *elm, *parent; struct handler *hand, *next; /* Free up the handlers on the stack: the root element has the * pointer to the base of the handler stack. */ for (hand = p->root->handler; hand!=NULL; hand=next) { next = hand->next; ne_free(hand); } /* Clean up remaining elements */ for (elm = p->current; elm != p->root; elm = parent) { parent = elm->parent; destroy_element(elm); } /* free root element */ ne_free(p->root); #ifdef HAVE_EXPAT XML_ParserFree(p->parser); if (p->encoding) ne_free(p->encoding); #else xmlFreeParserCtxt(p->parser); #endif ne_free(p); } void ne_xml_set_error(ne_xml_parser *p, const char *msg) { ne_snprintf(p->error, ERR_SIZE, "%s", msg); } #ifdef HAVE_LIBXML static void sax_error(void *ctx, const char *msg, ...) { ne_xml_parser *p = ctx; va_list ap; char buf[1024]; va_start(ap, msg); ne_vsnprintf(buf, 1024, msg, ap); va_end(ap); if (p->failure == 0) { ne_snprintf(p->error, ERR_SIZE, _("XML parse error at line %d: %s"), p->parser->input->line, buf); p->failure = 1; } } #endif const char *ne_xml_get_error(ne_xml_parser *p) { return p->error; } const char * ne_xml_get_attr(ne_xml_parser *p, const char **attrs, const char *nspace, const char *name) { int n; for (n = 0; attrs[n] != NULL; n += 2) { char *pnt = strchr(attrs[n], ':'); if (!nspace && !pnt && strcmp(attrs[n], name) == 0) { return attrs[n+1]; } else if (nspace && pnt) { /* If a namespace is given, and the local part matches, * then resolve the namespace and compare that too. */ if (strcmp(pnt + 1, name) == 0) { const char *uri = resolve_nspace(p->current, attrs[n], pnt - attrs[n]); if (uri && strcmp(uri, nspace) == 0) return attrs[n+1]; } } } return NULL; } int ne_xml_mapid(const struct ne_xml_idmap map[], size_t maplen, const char *nspace, const char *name) { size_t n; for (n = 0; n < maplen; n++) if (strcmp(name, map[n].name) == 0 && strcmp(nspace, map[n].nspace) == 0) return map[n].id; return 0; } sitecopy-0.16.6/lib/neon/ne_xmlreq.c0000664000076400007640000000616110506172162015440 0ustar joejoe/* XML/HTTP response handling Copyright (C) 2004-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include #include #include "ne_internal.h" #include "ne_xmlreq.h" #include "ne_basic.h" #include "ne_string.h" /* Handle an XML response parse error, setting session error string * and closing the connection. */ static int parse_error(ne_session *sess, ne_xml_parser *parser) { ne_set_error(sess, _("Could not parse response: %s"), ne_xml_get_error(parser)); ne_close_connection(sess); return NE_ERROR; } int ne_xml_parse_response(ne_request *req, ne_xml_parser *parser) { char buf[8000]; ssize_t bytes; int ret = 0; while ((bytes = ne_read_response_block(req, buf, sizeof buf)) > 0) { ret = ne_xml_parse(parser, buf, bytes); if (ret) return parse_error(ne_get_session(req), parser); } if (bytes == 0) { /* Tell the parser that end of document was reached: */ if (ne_xml_parse(parser, NULL, 0) == 0) return NE_OK; else return parse_error(ne_get_session(req), parser); } else { return NE_ERROR; } } /* Returns non-zero if given content-type is an XML media type, * following the RFC 3023 rules. */ static int media_type_is_xml(const ne_content_type *ctype) { size_t stlen; return (ne_strcasecmp(ctype->type, "text") == 0 && ne_strcasecmp(ctype->subtype, "xml") == 0) || (ne_strcasecmp(ctype->type, "application") == 0 && ne_strcasecmp(ctype->subtype, "xml") == 0) || ((stlen = strlen(ctype->subtype)) > 4 && ne_strcasecmp(ctype->subtype + stlen - 4, "+xml") == 0); } int ne_xml_dispatch_request(ne_request *req, ne_xml_parser *parser) { int ret; do { int parseit = 0; ret = ne_begin_request(req); if (ret) break; if (ne_get_status(req)->klass == 2) { ne_content_type ctype; if (ne_get_content_type(req, &ctype) == 0) { parseit = media_type_is_xml(&ctype); ne_free(ctype.value); } } if (parseit) ret = ne_xml_parse_response(req, parser); else ret = ne_discard_response(req); if (ret == NE_OK) ret = ne_end_request(req); } while (ret == NE_RETRY); return ret; } sitecopy-0.16.6/lib/neon/ne_sspi.h0000664000076400007640000000270310373622172015114 0ustar joejoe/* Microsoft SSPI based authentication routines Copyright (C) 2004-2005, Vladimir Berezniker @ http://public.xdi.org/=vmpn This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_SSPI_H #define NE_SSPI_H /* Win32 SSPI-based authentication interfaces. PRIVATE TO NEON -- NOT * PART OF THE EXTERNAL API. */ #ifdef HAVE_SSPI #include #define SECURITY_WIN32 #include int ne_sspi_init(void); int ne_sspi_deinit(void); int ne_sspi_create_context(void **context, char * serverName, int ntlm); int ne_sspi_destroy_context(void *context); int ne_sspi_clear_context(void *context); int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken); #endif /* HAVE_SSPI */ #endif /* NE_SSPI_H */ sitecopy-0.16.6/lib/neon/ne_compress.c0000664000076400007640000003245410722565672016003 0ustar joejoe/* Handling of compressed HTTP responses Copyright (C) 2001-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include "ne_request.h" #include "ne_compress.h" #include "ne_utils.h" #include "ne_internal.h" #ifdef NE_HAVE_ZLIB #include /* Adds support for the 'gzip' Content-Encoding in HTTP. gzip is a * file format which wraps the DEFLATE compression algorithm. zlib * implements DEFLATE: we have to unwrap the gzip format (specified in * RFC1952) as it comes off the wire, and hand off chunks of data to * be inflated. */ struct ne_decompress_s { ne_request *request; /* associated request. */ ne_session *session; /* associated session. */ /* temporary buffer for holding inflated data. */ char outbuf[NE_BUFSIZ]; z_stream zstr; int zstrinit; /* non-zero if zstr has been initialized */ /* pass blocks back to this. */ ne_block_reader reader; ne_accept_response acceptor; void *userdata; /* buffer for gzip header bytes. */ unsigned char header[10]; size_t hdrcount; /* bytes in header */ unsigned char footer[8]; size_t footcount; /* bytes in footer. */ /* CRC32 checksum: odd that zlib uses uLong for this since it is a * 64-bit integer on LP64 platforms. */ uLong checksum; /* current state. */ enum state { NE_Z_BEFORE_DATA, /* not received any response blocks yet. */ NE_Z_PASSTHROUGH, /* response not compressed: passing through. */ NE_Z_IN_HEADER, /* received a few bytes of response data, but not * got past the gzip header yet. */ NE_Z_POST_HEADER, /* waiting for the end of the NUL-terminated bits. */ NE_Z_INFLATING, /* inflating response bytes. */ NE_Z_AFTER_DATA, /* after data; reading CRC32 & ISIZE */ NE_Z_FINISHED /* stream is finished. */ } state; }; /* Convert 'buf' to unsigned int; 'buf' must be 'unsigned char *' */ #define BUF2UINT(buf) (((buf)[3]<<24) + ((buf)[2]<<16) + ((buf)[1]<<8) + (buf)[0]) #define ID1 0x1f #define ID2 0x8b #define HDR_DONE 0 #define HDR_EXTENDED 1 #define HDR_ERROR 2 #define HDR_ID1(ctx) ((ctx)->header[0]) #define HDR_ID2(ctx) ((ctx)->header[1]) #define HDR_CMETH(ctx) ((ctx)->header[2]) #define HDR_FLAGS(ctx) ((ctx)->header[3]) #define HDR_MTIME(ctx) (BUF2UINT(&(ctx)->header[4])) #define HDR_XFLAGS(ctx) ((ctx)->header[8]) #define HDR_OS(ctx) ((ctx)->header[9]) /* parse_header parses the gzip header, sets the next state and returns * HDR_DONE: all done, bytes following are raw DEFLATE data. * HDR_EXTENDED: all done, expect a NUL-termianted string * before the DEFLATE data * HDR_ERROR: invalid header, give up (session error is set). */ static int parse_header(ne_decompress *ctx) { NE_DEBUG(NE_DBG_HTTP, "ID1: %d ID2: %d, cmeth %d, flags %d\n", HDR_ID1(ctx), HDR_ID2(ctx), HDR_CMETH(ctx), HDR_FLAGS(ctx)); if (HDR_ID1(ctx) != ID1 || HDR_ID2(ctx) != ID2 || HDR_CMETH(ctx) != 8) { ne_set_error(ctx->session, "Compressed stream invalid"); return HDR_ERROR; } NE_DEBUG(NE_DBG_HTTP, "mtime: %d, xflags: %d, os: %d\n", HDR_MTIME(ctx), HDR_XFLAGS(ctx), HDR_OS(ctx)); /* TODO: we can only handle one NUL-terminated extensions field * currently. Really, we should count the number of bits set, and * skip as many fields as bits set (bailing if any reserved bits * are set. */ if (HDR_FLAGS(ctx) == 8) { ctx->state = NE_Z_POST_HEADER; return HDR_EXTENDED; } else if (HDR_FLAGS(ctx) != 0) { ne_set_error(ctx->session, "Compressed stream not supported"); return HDR_ERROR; } NE_DEBUG(NE_DBG_HTTP, "compress: Good stream.\n"); ctx->state = NE_Z_INFLATING; return HDR_DONE; } /* Process extra 'len' bytes of 'buf' which were received after the * DEFLATE data. */ static int process_footer(ne_decompress *ctx, const unsigned char *buf, size_t len) { if (len + ctx->footcount > 8) { ne_set_error(ctx->session, "Too many bytes (%" NE_FMT_SIZE_T ") in gzip footer", len); return -1; } else { memcpy(ctx->footer + ctx->footcount, buf, len); ctx->footcount += len; if (ctx->footcount == 8) { uLong crc = BUF2UINT(ctx->footer) & 0xFFFFFFFF; if (crc == ctx->checksum) { ctx->state = NE_Z_FINISHED; NE_DEBUG(NE_DBG_HTTP, "compress: End of response; checksum match.\n"); } else { NE_DEBUG(NE_DBG_HTTP, "compress: End of response; checksum mismatch: " "given %lu vs computed %lu\n", crc, ctx->checksum); ne_set_error(ctx->session, "Checksum invalid for compressed stream"); return -1; } } } return 0; } /* A zlib function failed with 'code'; set the session error string * appropriately. */ static void set_zlib_error(ne_decompress *ctx, const char *msg, int code) { if (ctx->zstr.msg) ne_set_error(ctx->session, "%s: %s", msg, ctx->zstr.msg); else { const char *err; switch (code) { case Z_STREAM_ERROR: err = "stream error"; break; case Z_DATA_ERROR: err = "data corrupt"; break; case Z_MEM_ERROR: err = "out of memory"; break; case Z_BUF_ERROR: err = "buffer error"; break; case Z_VERSION_ERROR: err = "library version mismatch"; break; default: err = "unknown error"; break; } ne_set_error(ctx->session, _("%s: %s (code %d)"), msg, err, code); } } /* Inflate response buffer 'buf' of length 'len'. */ static int do_inflate(ne_decompress *ctx, const char *buf, size_t len) { int ret; ctx->zstr.avail_in = len; ctx->zstr.next_in = (unsigned char *)buf; ctx->zstr.total_in = 0; do { ctx->zstr.avail_out = sizeof ctx->outbuf; ctx->zstr.next_out = (unsigned char *)ctx->outbuf; ctx->zstr.total_out = 0; ret = inflate(&ctx->zstr, Z_NO_FLUSH); NE_DEBUG(NE_DBG_HTTP, "compress: inflate %d, %ld bytes out, %d remaining\n", ret, ctx->zstr.total_out, ctx->zstr.avail_in); #if 0 NE_DEBUG(NE_DBG_HTTPBODY, "Inflated body block (%ld):\n[%.*s]\n", ctx->zstr.total_out, (int)ctx->zstr.total_out, ctx->outbuf); #endif /* update checksum. */ ctx->checksum = crc32(ctx->checksum, (unsigned char *)ctx->outbuf, ctx->zstr.total_out); /* pass on the inflated data, if any */ if (ctx->zstr.total_out > 0) { int rret = ctx->reader(ctx->userdata, ctx->outbuf, ctx->zstr.total_out); if (rret) return rret; } } while (ret == Z_OK && ctx->zstr.avail_in > 0); if (ret == Z_STREAM_END) { NE_DEBUG(NE_DBG_HTTP, "compress: end of data stream, %d bytes remain.\n", ctx->zstr.avail_in); /* process the footer. */ ctx->state = NE_Z_AFTER_DATA; return process_footer(ctx, ctx->zstr.next_in, ctx->zstr.avail_in); } else if (ret != Z_OK) { set_zlib_error(ctx, _("Could not inflate data"), ret); return NE_ERROR; } return 0; } /* Callback which is passed blocks of the response body. */ static int gz_reader(void *ud, const char *buf, size_t len) { ne_decompress *ctx = ud; const char *zbuf; size_t count; const char *hdr; if (len == 0) { /* End of response: */ switch (ctx->state) { case NE_Z_BEFORE_DATA: hdr = ne_get_response_header(ctx->request, "Content-Encoding"); if (hdr && ne_strcasecmp(hdr, "gzip") == 0) { /* response was truncated: return error. */ break; } /* else, fall through */ case NE_Z_FINISHED: /* complete gzip response */ case NE_Z_PASSTHROUGH: /* complete uncompressed response */ return ctx->reader(ctx->userdata, buf, 0); default: /* invalid state: truncated response. */ break; } /* else: truncated response, fail. */ ne_set_error(ctx->session, "Compressed response was truncated"); return NE_ERROR; } switch (ctx->state) { case NE_Z_PASSTHROUGH: /* move along there. */ return ctx->reader(ctx->userdata, buf, len); case NE_Z_FINISHED: /* Could argue for tolerance, and ignoring trailing content; * but it could mean something more serious. */ if (len > 0) { ne_set_error(ctx->session, "Unexpected content received after compressed stream"); return NE_ERROR; } break; case NE_Z_BEFORE_DATA: /* work out whether this is a compressed response or not. */ hdr = ne_get_response_header(ctx->request, "Content-Encoding"); if (hdr && ne_strcasecmp(hdr, "gzip") == 0) { int ret; NE_DEBUG(NE_DBG_HTTP, "compress: got gzipped stream.\n"); /* inflateInit2() works here where inflateInit() doesn't. */ ret = inflateInit2(&ctx->zstr, -MAX_WBITS); if (ret != Z_OK) { set_zlib_error(ctx, _("Could not initialize zlib"), ret); return -1; } ctx->zstrinit = 1; } else { /* No Content-Encoding header: pass it on. TODO: we could * hack it and register the real callback now. But that * would require add_resp_body_rdr to have defined * ordering semantics etc etc */ ctx->state = NE_Z_PASSTHROUGH; return ctx->reader(ctx->userdata, buf, len); } ctx->state = NE_Z_IN_HEADER; /* FALLTHROUGH */ case NE_Z_IN_HEADER: /* copy as many bytes as possible into the buffer. */ if (len + ctx->hdrcount > 10) { count = 10 - ctx->hdrcount; } else { count = len; } memcpy(ctx->header + ctx->hdrcount, buf, count); ctx->hdrcount += count; /* have we got the full header yet? */ if (ctx->hdrcount != 10) { return 0; } buf += count; len -= count; switch (parse_header(ctx)) { case HDR_EXTENDED: if (len == 0) return 0; break; case HDR_ERROR: return NE_ERROR; case HDR_DONE: if (len > 0) { return do_inflate(ctx, buf, len); } break; } /* FALLTHROUGH */ case NE_Z_POST_HEADER: /* eating the filename string. */ zbuf = memchr(buf, '\0', len); if (zbuf == NULL) { /* not found it yet. */ return 0; } NE_DEBUG(NE_DBG_HTTP, "compresss: skipped %" NE_FMT_SIZE_T " header bytes.\n", zbuf - buf); /* found end of string. */ len -= (1 + zbuf - buf); buf = zbuf + 1; ctx->state = NE_Z_INFLATING; if (len == 0) { /* end of string was at end of buffer. */ return 0; } /* FALLTHROUGH */ case NE_Z_INFLATING: return do_inflate(ctx, buf, len); case NE_Z_AFTER_DATA: return process_footer(ctx, (unsigned char *)buf, len); } return 0; } /* Prepare for a compressed response; may be called many times per * request, for auth retries etc. */ static void gz_pre_send(ne_request *r, void *ud, ne_buffer *req) { ne_decompress *ctx = ud; if (ctx->request == r) { NE_DEBUG(NE_DBG_HTTP, "compress: Initialization.\n"); /* (Re-)Initialize the context */ ctx->state = NE_Z_BEFORE_DATA; if (ctx->zstrinit) inflateEnd(&ctx->zstr); ctx->zstrinit = 0; ctx->hdrcount = ctx->footcount = 0; ctx->checksum = crc32(0L, Z_NULL, 0); } } /* Wrapper for user-passed acceptor function. */ static int gz_acceptor(void *userdata, ne_request *req, const ne_status *st) { ne_decompress *ctx = userdata; return ctx->acceptor(ctx->userdata, req, st); } /* A slightly ugly hack: the pre_send hook is scoped per-session, so * must check that the invoking request is this one, before doing * anything, and must be unregistered when the context is * destroyed. */ ne_decompress *ne_decompress_reader(ne_request *req, ne_accept_response acpt, ne_block_reader rdr, void *userdata) { ne_decompress *ctx = ne_calloc(sizeof *ctx); ne_add_request_header(req, "Accept-Encoding", "gzip"); ne_add_response_body_reader(req, gz_acceptor, gz_reader, ctx); ctx->reader = rdr; ctx->userdata = userdata; ctx->session = ne_get_session(req); ctx->request = req; ctx->acceptor = acpt; ne_hook_pre_send(ne_get_session(req), gz_pre_send, ctx); return ctx; } void ne_decompress_destroy(ne_decompress *ctx) { if (ctx->zstrinit) inflateEnd(&ctx->zstr); ne_unhook_pre_send(ctx->session, gz_pre_send, ctx); ne_free(ctx); } #else /* !NE_HAVE_ZLIB */ /* Pass-through interface present to provide ABI compatibility. */ ne_decompress *ne_decompress_reader(ne_request *req, ne_accept_response acpt, ne_block_reader rdr, void *userdata) { ne_add_response_body_reader(req, acpt, rdr, userdata); /* an arbitrary return value: don't confuse them by returning NULL. */ return (ne_decompress *)req; } void ne_decompress_destroy(ne_decompress *dc) { } #endif /* NE_HAVE_ZLIB */ sitecopy-0.16.6/lib/neon/ne_session.c0000664000076400007640000003255310753105121015612 0ustar joejoe/* HTTP session handling Copyright (C) 1999-2008, Joe Orton Portions are: Copyright (C) 1999-2000 Tommi Komulainen This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include "ne_session.h" #include "ne_alloc.h" #include "ne_utils.h" #include "ne_internal.h" #include "ne_string.h" #include "ne_dates.h" #include "ne_private.h" /* Destroy a a list of hooks. */ static void destroy_hooks(struct hook *hooks) { struct hook *nexthk; while (hooks) { nexthk = hooks->next; ne_free(hooks); hooks = nexthk; } } void ne_session_destroy(ne_session *sess) { struct hook *hk; NE_DEBUG(NE_DBG_HTTP, "sess: Destroying session.\n"); /* Run the destroy hooks. */ for (hk = sess->destroy_sess_hooks; hk != NULL; hk = hk->next) { ne_destroy_sess_fn fn = (ne_destroy_sess_fn)hk->fn; fn(hk->userdata); } /* Close the connection; note that the notifier callback could * still be invoked here. */ if (sess->connected) { ne_close_connection(sess); } destroy_hooks(sess->create_req_hooks); destroy_hooks(sess->pre_send_hooks); destroy_hooks(sess->post_headers_hooks); destroy_hooks(sess->post_send_hooks); destroy_hooks(sess->destroy_req_hooks); destroy_hooks(sess->destroy_sess_hooks); destroy_hooks(sess->close_conn_hooks); destroy_hooks(sess->private); ne_free(sess->scheme); ne_free(sess->server.hostname); ne_free(sess->server.hostport); if (sess->server.address) ne_addr_destroy(sess->server.address); if (sess->proxy.address) ne_addr_destroy(sess->proxy.address); if (sess->proxy.hostname) ne_free(sess->proxy.hostname); if (sess->user_agent) ne_free(sess->user_agent); #ifdef NE_HAVE_SSL if (sess->ssl_context) ne_ssl_context_destroy(sess->ssl_context); if (sess->server_cert) ne_ssl_cert_free(sess->server_cert); if (sess->client_cert) ne_ssl_clicert_free(sess->client_cert); #endif ne_free(sess); } int ne_version_pre_http11(ne_session *s) { return !s->is_http11; } /* Stores the "hostname[:port]" segment */ static void set_hostport(struct host_info *host, unsigned int defaultport) { size_t len = strlen(host->hostname); host->hostport = ne_malloc(len + 10); strcpy(host->hostport, host->hostname); if (host->port != defaultport) ne_snprintf(host->hostport + len, 9, ":%u", host->port); } /* Stores the hostname/port in *info, setting up the "hostport" * segment correctly. */ static void set_hostinfo(struct host_info *info, const char *hostname, unsigned int port) { info->hostname = ne_strdup(hostname); info->port = port; } ne_session *ne_session_create(const char *scheme, const char *hostname, unsigned int port) { ne_session *sess = ne_calloc(sizeof *sess); NE_DEBUG(NE_DBG_HTTP, "HTTP session to %s://%s:%d begins.\n", scheme, hostname, port); strcpy(sess->error, "Unknown error."); /* use SSL if scheme is https */ sess->use_ssl = !strcmp(scheme, "https"); /* set the hostname/port */ set_hostinfo(&sess->server, hostname, port); set_hostport(&sess->server, sess->use_ssl?443:80); #ifdef NE_HAVE_SSL if (sess->use_ssl) { sess->ssl_context = ne_ssl_context_create(0); sess->flags[NE_SESSFLAG_SSLv2] = 1; sess->flags[NE_SESSFLAG_TLS_SNI] = 1; } #endif sess->scheme = ne_strdup(scheme); /* Set flags which default to on: */ sess->flags[NE_SESSFLAG_PERSIST] = 1; return sess; } void ne_session_proxy(ne_session *sess, const char *hostname, unsigned int port) { sess->use_proxy = 1; if (sess->proxy.hostname) ne_free(sess->proxy.hostname); set_hostinfo(&sess->proxy, hostname, port); } void ne_set_addrlist(ne_session *sess, const ne_inet_addr **addrs, size_t n) { sess->addrlist = addrs; sess->numaddrs = n; } void ne_set_localaddr(ne_session *sess, const ne_inet_addr *addr) { sess->local_addr = addr; } void ne_set_error(ne_session *sess, const char *format, ...) { va_list params; va_start(params, format); ne_vsnprintf(sess->error, sizeof sess->error, format, params); va_end(params); } void ne_set_session_flag(ne_session *sess, ne_session_flag flag, int value) { if (flag < NE_SESSFLAG_LAST) { sess->flags[flag] = value; #ifdef NE_HAVE_SSL if (flag == NE_SESSFLAG_SSLv2 && sess->ssl_context) { ne_ssl_context_set_flag(sess->ssl_context, NE_SSL_CTX_SSLv2, value); } #endif } } int ne_get_session_flag(ne_session *sess, ne_session_flag flag) { if (flag < NE_SESSFLAG_LAST) { return sess->flags[flag]; } return -1; } static void progress_notifier(void *userdata, ne_session_status status, const ne_session_status_info *info) { ne_session *sess = userdata; if (status == ne_status_sending || status == ne_status_recving) { sess->progress_cb(sess->progress_ud, info->sr.progress, info->sr.total); } } void ne_set_progress(ne_session *sess, ne_progress progress, void *userdata) { sess->progress_cb = progress; sess->progress_ud = userdata; ne_set_notifier(sess, progress_notifier, sess); } void ne_set_notifier(ne_session *sess, ne_notify_status status, void *userdata) { sess->notify_cb = status; sess->notify_ud = userdata; } void ne_set_read_timeout(ne_session *sess, int timeout) { sess->rdtimeout = timeout; } void ne_set_connect_timeout(ne_session *sess, int timeout) { sess->cotimeout = timeout; } #define UAHDR "User-Agent: " #define AGENT " neon/" NEON_VERSION "\r\n" void ne_set_useragent(ne_session *sess, const char *token) { if (sess->user_agent) ne_free(sess->user_agent); sess->user_agent = ne_malloc(strlen(UAHDR) + strlen(AGENT) + strlen(token) + 1); #ifdef HAVE_STPCPY strcpy(stpcpy(stpcpy(sess->user_agent, UAHDR), token), AGENT); #else strcat(strcat(strcpy(sess->user_agent, UAHDR), token), AGENT); #endif } const char *ne_get_server_hostport(ne_session *sess) { return sess->server.hostport; } const char *ne_get_scheme(ne_session *sess) { return sess->scheme; } void ne_fill_server_uri(ne_session *sess, ne_uri *uri) { uri->host = ne_strdup(sess->server.hostname); uri->port = sess->server.port; uri->scheme = ne_strdup(sess->scheme); } void ne_fill_proxy_uri(ne_session *sess, ne_uri *uri) { if (sess->use_proxy) { uri->host = ne_strdup(sess->proxy.hostname); uri->port = sess->proxy.port; } } const char *ne_get_error(ne_session *sess) { return sess->error; } void ne_close_connection(ne_session *sess) { if (sess->connected) { struct hook *hk; NE_DEBUG(NE_DBG_SOCKET, "sess: Closing connection.\n"); if (sess->notify_cb) { sess->status.cd.hostname = sess->use_proxy ? sess->proxy.hostname : sess->server.hostname; sess->notify_cb(sess->notify_ud, ne_status_disconnected, &sess->status); } /* Run the close_conn hooks. */ for (hk = sess->close_conn_hooks; hk != NULL; hk = hk->next) { ne_close_conn_fn fn = (ne_close_conn_fn)hk->fn; fn(hk->userdata); } ne_sock_close(sess->socket); sess->socket = NULL; NE_DEBUG(NE_DBG_SOCKET, "sess: Connection closed.\n"); } else { NE_DEBUG(NE_DBG_SOCKET, "sess: Not closing closed connection.\n"); } sess->connected = 0; } void ne_ssl_set_verify(ne_session *sess, ne_ssl_verify_fn fn, void *userdata) { sess->ssl_verify_fn = fn; sess->ssl_verify_ud = userdata; } void ne_ssl_provide_clicert(ne_session *sess, ne_ssl_provide_fn fn, void *userdata) { sess->ssl_provide_fn = fn; sess->ssl_provide_ud = userdata; } void ne_ssl_trust_cert(ne_session *sess, const ne_ssl_certificate *cert) { #ifdef NE_HAVE_SSL if (sess->ssl_context) { ne_ssl_context_trustcert(sess->ssl_context, cert); } #endif } void ne_ssl_cert_validity(const ne_ssl_certificate *cert, char *from, char *until) { #ifdef NE_HAVE_SSL time_t tf, tu; char *date; ne_ssl_cert_validity_time(cert, &tf, &tu); if (from) { if (tf != (time_t) -1) { date = ne_rfc1123_date(tf); ne_strnzcpy(from, date, NE_SSL_VDATELEN); ne_free(date); } else { ne_strnzcpy(from, _("[invalid date]"), NE_SSL_VDATELEN); } } if (until) { if (tu != (time_t) -1) { date = ne_rfc1123_date(tu); ne_strnzcpy(until, date, NE_SSL_VDATELEN); ne_free(date); } else { ne_strnzcpy(until, _("[invalid date]"), NE_SSL_VDATELEN); } } #endif } #ifdef NE_HAVE_SSL void ne__ssl_set_verify_err(ne_session *sess, int failures) { static const struct { int bit; const char *str; } reasons[] = { { NE_SSL_NOTYETVALID, N_("certificate is not yet valid") }, { NE_SSL_EXPIRED, N_("certificate has expired") }, { NE_SSL_IDMISMATCH, N_("certificate issued for a different hostname") }, { NE_SSL_UNTRUSTED, N_("issuer is not trusted") }, { 0, NULL } }; int n, flag = 0; strcpy(sess->error, _("Server certificate verification failed: ")); for (n = 0; reasons[n].bit; n++) { if (failures & reasons[n].bit) { if (flag) strncat(sess->error, ", ", sizeof sess->error); strncat(sess->error, _(reasons[n].str), sizeof sess->error); flag = 1; } } } #endif typedef void (*void_fn)(void); #define ADD_HOOK(hooks, fn, ud) add_hook(&(hooks), NULL, (void_fn)(fn), (ud)) static void add_hook(struct hook **hooks, const char *id, void_fn fn, void *ud) { struct hook *hk = ne_malloc(sizeof (struct hook)), *pos; if (*hooks != NULL) { for (pos = *hooks; pos->next != NULL; pos = pos->next) /* nullop */; pos->next = hk; } else { *hooks = hk; } hk->id = id; hk->fn = fn; hk->userdata = ud; hk->next = NULL; } void ne_hook_create_request(ne_session *sess, ne_create_request_fn fn, void *userdata) { ADD_HOOK(sess->create_req_hooks, fn, userdata); } void ne_hook_pre_send(ne_session *sess, ne_pre_send_fn fn, void *userdata) { ADD_HOOK(sess->pre_send_hooks, fn, userdata); } void ne_hook_post_send(ne_session *sess, ne_post_send_fn fn, void *userdata) { ADD_HOOK(sess->post_send_hooks, fn, userdata); } void ne_hook_post_headers(ne_session *sess, ne_post_headers_fn fn, void *userdata) { ADD_HOOK(sess->post_headers_hooks, fn, userdata); } void ne_hook_destroy_request(ne_session *sess, ne_destroy_req_fn fn, void *userdata) { ADD_HOOK(sess->destroy_req_hooks, fn, userdata); } void ne_hook_destroy_session(ne_session *sess, ne_destroy_sess_fn fn, void *userdata) { ADD_HOOK(sess->destroy_sess_hooks, fn, userdata); } void ne_hook_close_conn(ne_session *sess, ne_close_conn_fn fn, void *userdata) { ADD_HOOK(sess->close_conn_hooks, fn, userdata); } void ne_set_session_private(ne_session *sess, const char *id, void *userdata) { add_hook(&sess->private, id, NULL, userdata); } static void remove_hook(struct hook **hooks, void_fn fn, void *ud) { struct hook **p = hooks; while (*p) { if ((*p)->fn == fn && (*p)->userdata == ud) { struct hook *next = (*p)->next; ne_free(*p); (*p) = next; break; } p = &(*p)->next; } } #define REMOVE_HOOK(hooks, fn, ud) remove_hook(&hooks, (void_fn)fn, ud) void ne_unhook_create_request(ne_session *sess, ne_create_request_fn fn, void *userdata) { REMOVE_HOOK(sess->create_req_hooks, fn, userdata); } void ne_unhook_pre_send(ne_session *sess, ne_pre_send_fn fn, void *userdata) { REMOVE_HOOK(sess->pre_send_hooks, fn, userdata); } void ne_unhook_post_headers(ne_session *sess, ne_post_headers_fn fn, void *userdata) { REMOVE_HOOK(sess->post_headers_hooks, fn, userdata); } void ne_unhook_post_send(ne_session *sess, ne_post_send_fn fn, void *userdata) { REMOVE_HOOK(sess->post_send_hooks, fn, userdata); } void ne_unhook_destroy_request(ne_session *sess, ne_destroy_req_fn fn, void *userdata) { REMOVE_HOOK(sess->destroy_req_hooks, fn, userdata); } void ne_unhook_destroy_session(ne_session *sess, ne_destroy_sess_fn fn, void *userdata) { REMOVE_HOOK(sess->destroy_sess_hooks, fn, userdata); } void ne_unhook_close_conn(ne_session *sess, ne_close_conn_fn fn, void *userdata) { REMOVE_HOOK(sess->close_conn_hooks, fn, userdata); } sitecopy-0.16.6/lib/neon/ne_dates.c0000664000076400007640000001616510750062474015242 0ustar joejoe/* Date manipulation routines Copyright (C) 1999-2006, Joe Orton Copyright (C) 2004 Jiang Lei This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "config.h" #include #include #ifdef HAVE_STDLIB_H #include #endif #include #ifdef HAVE_STRING_H #include #endif #ifdef WIN32 #include /* for TIME_ZONE_INFORMATION */ #endif #include "ne_alloc.h" #include "ne_dates.h" #include "ne_string.h" /* Generic date manipulation routines. */ /* ISO8601: 2001-01-01T12:30:00Z */ #define ISO8601_FORMAT_Z "%04d-%02d-%02dT%02d:%02d:%lfZ" #define ISO8601_FORMAT_M "%04d-%02d-%02dT%02d:%02d:%lf-%02d:%02d" #define ISO8601_FORMAT_P "%04d-%02d-%02dT%02d:%02d:%lf+%02d:%02d" /* RFC1123: Sun, 06 Nov 1994 08:49:37 GMT */ #define RFC1123_FORMAT "%3s, %02d %3s %4d %02d:%02d:%02d GMT" /* RFC850: Sunday, 06-Nov-94 08:49:37 GMT */ #define RFC1036_FORMAT "%10s %2d-%3s-%2d %2d:%2d:%2d GMT" /* asctime: Wed Jun 30 21:49:08 1993 */ #define ASCTIME_FORMAT "%3s %3s %2d %2d:%2d:%2d %4d" static const char rfc1123_weekdays[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static const char short_months[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; #if defined(HAVE_STRUCT_TM_TM_GMTOFF) #define GMTOFF(t) ((t).tm_gmtoff) #elif defined(HAVE_STRUCT_TM___TM_GMTOFF) #define GMTOFF(t) ((t).__tm_gmtoff) #elif defined(WIN32) #define GMTOFF(t) (gmt_to_local_win32()) #elif defined(HAVE_TIMEZONE) /* FIXME: the following assumes fixed dst offset of 1 hour */ #define GMTOFF(t) (-timezone + ((t).tm_isdst > 0 ? 3600 : 0)) #else /* FIXME: work out the offset anyway. */ #define GMTOFF(t) (0) #endif #ifdef WIN32 time_t gmt_to_local_win32(void) { TIME_ZONE_INFORMATION tzinfo; DWORD dwStandardDaylight; long bias; dwStandardDaylight = GetTimeZoneInformation(&tzinfo); bias = tzinfo.Bias; if (dwStandardDaylight == TIME_ZONE_ID_STANDARD) bias += tzinfo.StandardBias; if (dwStandardDaylight == TIME_ZONE_ID_DAYLIGHT) bias += tzinfo.DaylightBias; return (- bias * 60); } #endif /* Returns the time/date GMT, in RFC1123-type format: eg * Sun, 06 Nov 1994 08:49:37 GMT. */ char *ne_rfc1123_date(time_t anytime) { struct tm *gmt; char *ret; gmt = gmtime(&anytime); if (gmt == NULL) return NULL; ret = ne_malloc(29 + 1); /* dates are 29 chars long */ /* it goes: Sun, 06 Nov 1994 08:49:37 GMT */ ne_snprintf(ret, 30, RFC1123_FORMAT, rfc1123_weekdays[gmt->tm_wday], gmt->tm_mday, short_months[gmt->tm_mon], 1900 + gmt->tm_year, gmt->tm_hour, gmt->tm_min, gmt->tm_sec); return ret; } /* Takes an ISO-8601-formatted date string and returns the time_t. * Returns (time_t)-1 if the parse fails. */ time_t ne_iso8601_parse(const char *date) { struct tm gmt = {0}; int off_hour, off_min; double sec; off_t fix; int n; time_t result; /* it goes: ISO8601: 2001-01-01T12:30:00+03:30 */ if ((n = sscanf(date, ISO8601_FORMAT_P, &gmt.tm_year, &gmt.tm_mon, &gmt.tm_mday, &gmt.tm_hour, &gmt.tm_min, &sec, &off_hour, &off_min)) == 8) { gmt.tm_sec = (int)sec; fix = - off_hour * 3600 - off_min * 60; } /* it goes: ISO8601: 2001-01-01T12:30:00-03:30 */ else if ((n = sscanf(date, ISO8601_FORMAT_M, &gmt.tm_year, &gmt.tm_mon, &gmt.tm_mday, &gmt.tm_hour, &gmt.tm_min, &sec, &off_hour, &off_min)) == 8) { gmt.tm_sec = (int)sec; fix = off_hour * 3600 + off_min * 60; } /* it goes: ISO8601: 2001-01-01T12:30:00Z */ else if ((n = sscanf(date, ISO8601_FORMAT_Z, &gmt.tm_year, &gmt.tm_mon, &gmt.tm_mday, &gmt.tm_hour, &gmt.tm_min, &sec)) == 6) { gmt.tm_sec = (int)sec; fix = 0; } else { return (time_t)-1; } gmt.tm_year -= 1900; gmt.tm_isdst = -1; gmt.tm_mon--; result = mktime(&gmt) + fix; return result + GMTOFF(gmt); } /* Takes an RFC1123-formatted date string and returns the time_t. * Returns (time_t)-1 if the parse fails. */ time_t ne_rfc1123_parse(const char *date) { struct tm gmt = {0}; char wkday[4], mon[4]; int n; time_t result; /* it goes: Sun, 06 Nov 1994 08:49:37 GMT */ n = sscanf(date, RFC1123_FORMAT, wkday, &gmt.tm_mday, mon, &gmt.tm_year, &gmt.tm_hour, &gmt.tm_min, &gmt.tm_sec); /* Is it portable to check n==7 here? */ gmt.tm_year -= 1900; for (n=0; n<12; n++) if (strcmp(mon, short_months[n]) == 0) break; /* tm_mon comes out as 12 if the month is corrupt, which is desired, * since the mktime will then fail */ gmt.tm_mon = n; gmt.tm_isdst = -1; result = mktime(&gmt); return result + GMTOFF(gmt); } /* Takes a string containing a RFC1036-style date and returns the time_t */ time_t ne_rfc1036_parse(const char *date) { struct tm gmt = {0}; int n; char wkday[11], mon[4]; time_t result; /* RFC850/1036 style dates: Sunday, 06-Nov-94 08:49:37 GMT */ n = sscanf(date, RFC1036_FORMAT, wkday, &gmt.tm_mday, mon, &gmt.tm_year, &gmt.tm_hour, &gmt.tm_min, &gmt.tm_sec); if (n != 7) { return (time_t)-1; } /* portable to check n here? */ for (n=0; n<12; n++) if (strcmp(mon, short_months[n]) == 0) break; /* tm_mon comes out as 12 if the month is corrupt, which is desired, * since the mktime will then fail */ /* Defeat Y2K bug. */ if (gmt.tm_year < 50) gmt.tm_year += 100; gmt.tm_mon = n; gmt.tm_isdst = -1; result = mktime(&gmt); return result + GMTOFF(gmt); } /* (as)ctime dates are like: * Wed Jun 30 21:49:08 1993 */ time_t ne_asctime_parse(const char *date) { struct tm gmt = {0}; int n; char wkday[4], mon[4]; time_t result; n = sscanf(date, ASCTIME_FORMAT, wkday, mon, &gmt.tm_mday, &gmt.tm_hour, &gmt.tm_min, &gmt.tm_sec, &gmt.tm_year); /* portable to check n here? */ for (n=0; n<12; n++) if (strcmp(mon, short_months[n]) == 0) break; /* tm_mon comes out as 12 if the month is corrupt, which is desired, * since the mktime will then fail */ gmt.tm_mon = n; gmt.tm_isdst = -1; result = mktime(&gmt); return result + GMTOFF(gmt); } /* HTTP-date parser */ time_t ne_httpdate_parse(const char *date) { time_t tmp; tmp = ne_rfc1123_parse(date); if (tmp == -1) { tmp = ne_rfc1036_parse(date); if (tmp == -1) tmp = ne_asctime_parse(date); } return tmp; } sitecopy-0.16.6/lib/neon/ne_207.h0000664000076400007640000001050210356210727014442 0ustar joejoe/* WebDAV 207 multi-status response handling Copyright (C) 1999-2006, Joe Orton This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef NE_207_H #define NE_207_H #include "ne_xml.h" #include "ne_request.h" /* for ne_request */ #include "ne_uri.h" /* for ne_uri */ NE_BEGIN_DECLS /* The defined state integer for the '{DAV:}prop' element. */ #define NE_207_STATE_PROP (50) /* This interface reserves the state integers 'x' where 0 < x < 100 */ #define NE_207_STATE_TOP (100) /* Handling of 207 multistatus XML documents. A "multistatus" * document is made up of a set of responses, each concerned with a * particular resource. Each response may have an associated result * status and failure description. A response is made up of a set of * propstats, each of which again may have an associated result status * and failure description. */ /* Start and end response callbacks trigger at the start and end of * each "response" within the multistatus body. 'uri' gives the URI * of the resource which is subject of this response. The return * value of a 'start_response' callback is passed as the 'response' * parameter to the corresponding 'end_response' parameter. */ typedef void *ne_207_start_response(void *userdata, const ne_uri *uri); typedef void ne_207_end_response(void *userdata, void *response, const ne_status *status, const char *description); /* Similarly, start and end callbacks for each propstat within the * response. The return value of the 'start_response' callback for * the response in which this propstat is contains is passed as the * 'response' parameter. The return value of each 'start_propstat' is * passed as the 'propstat' parameter' to the corresponding * 'end_propstat' callback. If the start_propstat callback returns * NULL, parsing is aborted (the XML parser error must be set by the * callback). */ typedef void *ne_207_start_propstat(void *userdata, void *response); typedef void ne_207_end_propstat(void *userdata, void *propstat, const ne_status *status, const char *description); typedef struct ne_207_parser_s ne_207_parser; /* Create 207 parser an add the handlers the the given parser's * handler stack. URI references in the 207 response will be resolved * relative to the base URI 'base'. */ ne_207_parser *ne_207_create(ne_xml_parser *parser, const ne_uri *base, void *userdata); /* Register response handling callbacks. */ void ne_207_set_response_handlers(ne_207_parser *p, ne_207_start_response *start, ne_207_end_response *end); /* Register propstat handling callbacks. */ void ne_207_set_propstat_handlers(ne_207_parser *p, ne_207_start_propstat *start, ne_207_end_propstat *end); /* Destroy the parser */ void ne_207_destroy(ne_207_parser *p); /* An acceptance function which only accepts 207 responses */ int ne_accept_207(void *userdata, ne_request *req, const ne_status *status); void *ne_207_get_current_propstat(ne_207_parser *p); void *ne_207_get_current_response(ne_207_parser *p); /* Dispatch request 'req', returning: * NE_ERROR: for a dispatch error, or a non-2xx response, or a * 207 response which contained a non-2xx propstat * NE_OK: for a 2xx response or a 207 response which contained * only 2xx-class propstats. * The request object is destroyed in both cases. */ int ne_simple_request(ne_session *sess, ne_request *req); NE_END_DECLS #endif /* NE_207_H */ sitecopy-0.16.6/lib/netrc.c0000664000076400007640000002076210165765223013634 0ustar joejoe/* netrc.c -- parse the .netrc file to get hosts, accounts, and passwords Gordon Matzigkeit , 1996 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 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. For license terms, see the file COPYING in this directory. Compile with -DSTANDALONE to test this module. */ #include #include #include #include #include #include "netrc.h" #include #define POPBUFSIZE BUFSIZ /* Maybe add NEWENTRY to the account information list, LIST. NEWENTRY is set to a ready-to-use netrc_entry, in any event. */ static void maybe_add_to_list (netrc_entry **newentry, netrc_entry **list) { netrc_entry *a, *l; a = *newentry; l = *list; /* We need an account name in order to add the entry to the list. */ if (a && ! a->account) { /* Free any allocated space. */ if (a->host) free (a->host); if (a->password) free (a->password); } else { if (a) { /* Add the current machine into our list. */ a->next = l; l = a; } /* Allocate a new netrc_entry structure. */ a = (netrc_entry *) ne_malloc (sizeof (netrc_entry)); } /* Zero the structure, so that it is ready to use. */ memset (a, 0, sizeof(*a)); /* Return the new pointers. */ *newentry = a; *list = l; return; } /* Parse FILE as a .netrc file (as described in ftp(1)), and return a list of entries. NULL is returned if the file could not be parsed. */ netrc_entry * parse_netrc (file) char *file; { FILE *fp; char buf[POPBUFSIZE+1], *p, *tok; const char *premature_token; netrc_entry *current, *retval; int ln; /* The latest token we've seen in the file. */ enum { tok_nothing, tok_account, tok_login, tok_macdef, tok_machine, tok_password } last_token = tok_nothing; current = retval = NULL; fp = fopen (file, "r"); if (!fp) { /* Just return NULL if we can't open the file. */ return NULL; } /* Initialize the file data. */ ln = 0; premature_token = NULL; /* While there are lines in the file... */ while (fgets(buf, POPBUFSIZE, fp)) { ln++; /* Strip trailing CRLF */ for (p = buf + strlen(buf) - 1; (p >= buf) && isspace((unsigned)*p); p--) *p = '\0'; /* Parse the line. */ p = buf; /* If the line is empty... */ if (!*p) { if (last_token == tok_macdef) { /* end of macro */ last_token = tok_nothing; } else { continue; /* otherwise ignore it */ } } /* If we are defining macros, then skip parsing the line. */ while (*p && last_token != tok_macdef) { char quote_char = 0; char *pp; /* Skip any whitespace. */ while (*p && isspace ((unsigned)*p)) p++; /* Discard end-of-line comments. */ if (*p == '#') break; tok = pp = p; /* Find the end of the token. */ while (*p && (quote_char || !isspace ((unsigned)*p))) { if (quote_char) { if (quote_char == *p) { quote_char = 0; p ++; } else { *pp = *p; p ++; pp ++; } } else { if (*p == '"' || *p == '\'') quote_char = *p; else { *pp = *p; pp ++; } p ++; } } /* Null-terminate the token, if it isn't already. */ if (*p) *p ++ = '\0'; *pp = 0; switch (last_token) { case tok_login: if (current) current->account = (char *) ne_strdup (tok); else premature_token = "login"; break; case tok_machine: /* Start a new machine entry. */ maybe_add_to_list (¤t, &retval); current->host = (char *) ne_strdup (tok); break; case tok_password: if (current) current->password = (char *) ne_strdup (tok); else premature_token = "password"; break; /* We handle most of tok_macdef above. */ case tok_macdef: if (!current) premature_token = "macdef"; break; /* We don't handle the account keyword at all. */ case tok_account: if (!current) premature_token = "account"; break; /* We handle tok_nothing below this switch. */ case tok_nothing: break; } if (premature_token) { #ifdef HAVE_ERROR error_at_line (0, file, ln, "warning: found \"%s\" before any host names", premature_token); #else fprintf (stderr, "%s:%d: warning: found \"%s\" before any host names\n", file, ln, premature_token); #endif premature_token = NULL; } if (last_token != tok_nothing) /* We got a value, so reset the token state. */ last_token = tok_nothing; else { /* Fetch the next token. */ if (!strcmp (tok, "default")) { maybe_add_to_list (¤t, &retval); } else if (!strcmp (tok, "login")) last_token = tok_login; else if (!strcmp (tok, "user")) last_token = tok_login; else if (!strcmp (tok, "macdef")) last_token = tok_macdef; else if (!strcmp (tok, "machine")) last_token = tok_machine; else if (!strcmp (tok, "password")) last_token = tok_password; else if (!strcmp (tok, "passwd")) last_token = tok_password; else if (!strcmp (tok, "account")) last_token = tok_account; else { fprintf (stderr, "%s:%d: warning: unknown token \"%s\"\n", file, ln, tok); } } } } fclose (fp); /* Finalize the last machine entry we found. */ maybe_add_to_list (¤t, &retval); free (current); /* Reverse the order of the list so that it appears in file order. */ current = retval; retval = NULL; while (current) { netrc_entry *saved_reference; /* Change the direction of the pointers. */ saved_reference = current->next; current->next = retval; /* Advance to the next node. */ retval = current; current = saved_reference; } return retval; } /* Return the netrc entry from LIST corresponding to HOST. NULL is returned if no such entry exists. */ netrc_entry * search_netrc (list, host) netrc_entry *list; const char *host; { /* Look for the HOST in LIST. */ while (list) { if (!list->host) /* We hit the default entry. */ break; else if (!strcmp (list->host, host)) /* We found a matching entry. */ break; list = list->next; } /* Return the matching entry, or NULL. */ return list; } #ifdef STANDALONE #include #include extern int errno; int main (argc, argv) int argc; char **argv; { struct stat sb; char *program_name, *file, *target; netrc_entry *head, *a; if (argc < 2) { fprintf (stderr, "Usage: %s NETRC [HOSTNAME]...\n", argv[0]); exit (1); } program_name = argv[0]; file = argv[1]; target = argv[2]; if (stat (file, &sb)) { fprintf (stderr, "%s: cannot stat %s: %s\n", argv[0], file, strerror (errno)); exit (1); } head = parse_netrc (file); if (!head) { fprintf (stderr, "%s: no entries found in %s\n", argv[0], file); exit (1); } if (argc > 2) { int i, status; status = 0; for (i = 2; i < argc; i++) { /* Print out the host that we are checking for. */ fputs (argv[i], stdout); a = search_netrc (head, argv[i]); if (a) { /* Print out the account and password (if any). */ fputc (' ', stdout); fputs (a->account, stdout); if (a->password) { fputc (' ', stdout); fputs (a->password, stdout); } } else status = 1; fputc ('\n', stdout); } exit (status); } /* Print out the entire contents of the netrc. */ a = head; while (a) { /* Print the host name. */ if (a->host) fputs (a->host, stdout); else fputs ("DEFAULT", stdout); fputc (' ', stdout); /* Print the account name. */ fputs (a->account, stdout); if (a->password) { /* Print the password, if there is any. */ fputc (' ', stdout); fputs (a->password, stdout); } fputc ('\n', stdout); a = a->next; } exit (0); } #endif /* STANDALONE */ sitecopy-0.16.6/lib/basename.h0000664000076400007640000000004510165765223014271 0ustar joejoe char *base_name (char const *name); sitecopy-0.16.6/lib/getopt.h0000664000076400007640000001076710165765223014034 0ustar joejoe/* Declarations for getopt. Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 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 -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { #if defined (__STDC__) && __STDC__ 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 defined (__STDC__) && __STDC__ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ */ extern int getopt (); #endif /* __GNU_LIBRARY__ */ 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 /* __STDC__ */ #ifdef __cplusplus } #endif #endif /* getopt.h */ sitecopy-0.16.6/lib/strcasecmp.c0000664000076400007640000000254310165765223014662 0ustar joejoe/* Copyright (C) 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include /* Compare S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexiographically less than, equal to or greater than S2. */ int strcasecmp (s1, s2) const char *s1; const char *s2; { register const unsigned char *p1 = (const unsigned char *) s1; register const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; if (p1 == p2) return 0; do { c1 = tolower (*p1++); c2 = tolower (*p2++); if (c1 == '\0') break; } while (c1 == c2); return c1 - c2; } sitecopy-0.16.6/lib/getopt.c0000664000076400007640000007132310165765223014022 0ustar joejoe/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 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 !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ # ifndef const # define const # endif #endif #include #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include # include #endif /* GNU C library. */ #ifdef VMS # include # if HAVE_STRING_H - 0 # include # endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ # ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) # else # define _(msgid) (msgid) # endif #endif /* 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 -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized = 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 -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* 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 # if HAVE_STRING_H # include # else # include # endif /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif 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 (!defined __STDC__ || !__STDC__) && !defined strlen /* 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; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } # ifdef text_set_element text_set_element (__libc_subinit, store_args_and_env); # endif /* text_set_element */ # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined __STDC__ && __STDC__ static void exchange (char **); #endif 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. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = ne_malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined __STDC__ && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; 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; 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; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) ne_malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. 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 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; 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 && NONOPTION_P) 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 -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; 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 = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* 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++; optopt = 0; 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); optopt = pfound->val; 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); optopt = pfound->val; 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++; optopt = 0; 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 '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*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 = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (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 `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[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; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*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 /* Not ELIDE_CODE. */ #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 == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ sitecopy-0.16.6/lib/basename.c0000664000076400007640000000322110165765223014263 0ustar joejoe/* basename.c -- return the last element in a path Copyright (C) 1990, 1998, 1999 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. */ #if HAVE_CONFIG_H # include #endif #include #ifndef FILESYSTEM_PREFIX_LEN # define FILESYSTEM_PREFIX_LEN(Filename) 0 #endif #ifndef ISSLASH # define ISSLASH(C) ((C) == '/') #endif /* In general, we can't use the builtin `basename' function if available, since it has different meanings in different environments. In some environments the builtin `basename' modifies its argument. If NAME is all slashes, be sure to return `/'. */ char * base_name (char const *name) { char const *base = name += FILESYSTEM_PREFIX_LEN (name); int all_slashes = 1; char const *p; for (p = name; *p; p++) { if (ISSLASH (*p)) base = p + 1; else all_slashes = 0; } /* If NAME is all slashes, arrange to return `/'. */ if (*base == '\0' && ISSLASH (*name) && all_slashes) --base; return (char *) base; } sitecopy-0.16.6/lib/netrc.h0000664000076400007640000000407210165765223013635 0ustar joejoe/* netrc.h -- declarations for netrc.c Copyright (C) 1996, Free Software Foundation, Inc. Gordon Matzigkeit , 1996 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _NETRC_H_ #define _NETRC_H_ 1 # undef __BEGIN_DECLS # undef __END_DECLS #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # define __BEGIN_DECLS /* empty */ # define __END_DECLS /* empty */ #endif #undef __P #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus) # define __P(protos) protos #else # define __P(protos) () #endif /* The structure used to return account information from the .netrc. */ typedef struct _netrc_entry { /* The exact host name given in the .netrc, NULL if default. */ char *host; /* The name of the account. */ char *account; /* Password for the account (NULL, if none). */ char *password; /* Pointer to the next entry in the list. */ struct _netrc_entry *next; } netrc_entry; __BEGIN_DECLS /* Parse FILE as a .netrc file (as described in ftp(1)), and return a list of entries. NULL is returned if the file could not be parsed. */ netrc_entry *parse_netrc __P((char *file)); /* Return the netrc entry from LIST corresponding to HOST. NULL is returned if no such entry exists. */ netrc_entry *search_netrc __P((netrc_entry *list, const char *host)); __END_DECLS #endif /* _NETRC_H_ */ sitecopy-0.16.6/lib/dirname.h0000664000076400007640000000201710165765223014136 0ustar joejoe/* Copyright (C) 1998 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 DIRNAME_H_ # define DIRNAME_H_ 1 # ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args # else # define PARAMS(Args) () # endif # endif char * dir_name PARAMS ((const char *path)); #endif /* not DIRNAME_H_ */ sitecopy-0.16.6/lib/fnmatch.c0000664000076400007640000001202110165765223014126 0ustar joejoe/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if HAVE_CONFIG_H # include #endif #include #include #include #if defined (STDC_HEADERS) || !defined (isascii) # define ISASCII(c) 1 #else # define ISASCII(c) isascii(c) #endif #define ISUPPER(c) (ISASCII (c) && isupper (c)) /* 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__) # ifndef errno extern int errno; # endif /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ int fnmatch (pattern, string, flags) const char *pattern; const char *string; int flags; { register const char *p = pattern, *n = string; register char c; /* Note that this evalutes C many times. */ # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) while ((c = *p++) != '\0') { c = FOLD (c); switch (c) { case '?': if (*n == '\0') return FNM_NOMATCH; else if ((flags & FNM_FILE_NAME) && *n == '/') return FNM_NOMATCH; else if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; break; case '\\': if (!(flags & FNM_NOESCAPE)) { c = *p++; c = FOLD (c); } if (FOLD (*n) != c) return FNM_NOMATCH; break; case '*': if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; for (c = *p++; c == '?' || c == '*'; c = *p++, ++n) if (((flags & FNM_FILE_NAME) && *n == '/') || (c == '?' && *n == '\0')) return FNM_NOMATCH; if (c == '\0') return 0; { char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; c1 = FOLD (c1); for (--p; *n != '\0'; ++n) if ((c == '[' || FOLD (*n) == c1) && fnmatch (p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; } case '[': { /* Nonzero if the sense of the character class is inverted. */ register int not; if (*n == '\0') return FNM_NOMATCH; if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; not = (*p == '!' || *p == '^'); if (not) ++p; c = *p++; for (;;) { register char cstart = c, cend = c; if (!(flags & FNM_NOESCAPE) && c == '\\') cstart = cend = *p++; cstart = cend = FOLD (cstart); if (c == '\0') /* [ (unterminated) loses. */ return FNM_NOMATCH; c = *p++; c = FOLD (c); if ((flags & FNM_FILE_NAME) && c == '/') /* [/] can never match. */ return FNM_NOMATCH; if (c == '-' && *p != ']') { cend = *p++; if (!(flags & FNM_NOESCAPE) && cend == '\\') cend = *p++; if (cend == '\0') return FNM_NOMATCH; cend = FOLD (cend); c = *p++; } if (FOLD (*n) >= cstart && FOLD (*n) <= cend) goto matched; if (c == ']') break; } if (!not) return FNM_NOMATCH; break; matched:; /* Skip the rest of the [...] that already matched. */ while (c != ']') { if (c == '\0') /* [... (unterminated) loses. */ return FNM_NOMATCH; c = *p++; if (!(flags & FNM_NOESCAPE) && c == '\\') /* XXX 1003.2d11 is unclear if this is right. */ ++p; } if (not) return FNM_NOMATCH; } break; default: if (c != FOLD (*n)) return FNM_NOMATCH; } ++n; } if (*n == '\0') return 0; if ((flags & FNM_LEADING_DIR) && *n == '/') /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ return 0; return FNM_NOMATCH; # undef FOLD } #endif /* _LIBC or not __GNU_LIBRARY__. */ sitecopy-0.16.6/lib/getopt1.c0000664000076400007640000000737110165765223014105 0ustar joejoe/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include #endif #include "getopt.h" #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (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 /* Not ELIDE_CODE. */ #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 == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ sitecopy-0.16.6/lib/expat/0000775000076400007640000000000011037462346013466 5ustar joejoesitecopy-0.16.6/lib/expat/expat.html0000664000076400007640000000631710132700136015467 0ustar joejoe expat

expat - XML Parser Toolkit

Version 19990709

Copyright (c) 1998, 1999 James Clark. Expat is subject to the Mozilla Public License Version 1.1. Alternatively you may use expat under the GNU General Public License instead. Please contact me if you wish to negotiate an alternative license. This version elects to use the GPL

This is a test version of expat which adds support for parsing external DTDs and parameter entities. Compiling with -DXML_DTD enables this support. There's a new -p option for xmlwf which will cause it to process external DTDs and parameter entities; this implies the -x option. See the comment above XML_SetParamEntityParsing in xmlparse.h for the API addition that enables this.

Expat is an XML 1.0 parser written in C. It aims to be fully conforming. It is currently not a validating XML processor. The current production version of expat can be downloaded from ftp://ftp.jclark.com/pub/xml/expat.zip.

The directory xmltok contains a low-level library for tokenizing XML. The interface is documented in xmltok/xmltok.h.

The directory xmlparse contains an XML parser library which is built on top of the xmltok library. The interface is documented in xmlparse/xmlparse.h. The directory sample contains a simple example program using this interface; sample/build.bat is a batch file to build the example using Visual C++.

The directory xmlwf contains the xmlwf application, which uses the xmlparse library. The arguments to xmlwf are one or more files which are each to be checked for well-formedness. An option -d dir can be specified; for each well-formed input file the corresponding canonical XML will be written to dir/f, where f is the filename (without any path) of the input file. A -x option will cause references to external general entities to be processed. A -s option will make documents that are not standalone cause an error (a document is considered standalone if either it is intrinsically standalone because it has no external subset and no references to parameter entities in the internal subset or it is declared as standalone in the XML declaration).

The bin directory contains Win32 executables. The lib directory contains Win32 import libraries.

Answers to some frequently asked questions about expat can be found in the expat FAQ.

James Clark
sitecopy-0.16.6/lib/expat/ChangeLog0000664000076400007640000000123310132700136015222 0ustar joejoeMon Sep 6 13:59:42 1999 Joe Orton * Makefile: Removed file. Wed Aug 25 08:47:24 1999 Joe Orton * gennmtab/.cvsignore: Add gennmtab Tue Aug 24 18:53:54 1999 Joe Orton * xmltok/xmltok.h: Added void to XmlGetUtf8InternalEncodingNS, XmlGetUtf16InternalEncodingNS declarations to make them proper prototypes. Tue Aug 24 18:52:37 1999 Joe Orton * */*. Import of expat-19990709 sources. * sample/*, xmlwf/*: Removed unneeded code. * bin/*, lib/*, */*.dsp, expat.dsw: Removed Win32-specific files. * */*.[ch], expat.html: Elect to use GPL over MPL. sitecopy-0.16.6/lib/expat/xmltok/0000775000076400007640000000000011037462346015004 5ustar joejoesitecopy-0.16.6/lib/expat/xmltok/xmltok.c0000664000076400007640000011021210132320456016451 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "xmldef.h" #include "xmltok.h" #include "nametab.h" #ifdef XML_DTD #define IGNORE_SECTION_TOK_VTABLE , PREFIX(ignoreSectionTok) #else #define IGNORE_SECTION_TOK_VTABLE /* as nothing */ #endif #define VTABLE1 \ { PREFIX(prologTok), PREFIX(contentTok), \ PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE }, \ { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \ PREFIX(sameName), \ PREFIX(nameMatchesAscii), \ PREFIX(nameLength), \ PREFIX(skipS), \ PREFIX(getAtts), \ PREFIX(charRefNumber), \ PREFIX(predefinedEntityName), \ PREFIX(updatePosition), \ PREFIX(isPublicId) #define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16) #define UCS2_GET_NAMING(pages, hi, lo) \ (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1 << ((lo) & 0x1F))) /* A 2 byte UTF-8 representation splits the characters 11 bits between the bottom 5 and 6 bits of the bytes. We need 8 bits to index into pages, 3 bits to add to that index and 5 bits to generate the mask. */ #define UTF8_GET_NAMING2(pages, byte) \ (namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \ + ((((byte)[0]) & 3) << 1) \ + ((((byte)[1]) >> 5) & 1)] \ & (1 << (((byte)[1]) & 0x1F))) /* A 3 byte UTF-8 representation splits the characters 16 bits between the bottom 4, 6 and 6 bits of the bytes. We need 8 bits to index into pages, 3 bits to add to that index and 5 bits to generate the mask. */ #define UTF8_GET_NAMING3(pages, byte) \ (namingBitmap[((pages)[((((byte)[0]) & 0xF) << 4) \ + ((((byte)[1]) >> 2) & 0xF)] \ << 3) \ + ((((byte)[1]) & 3) << 1) \ + ((((byte)[2]) >> 5) & 1)] \ & (1 << (((byte)[2]) & 0x1F))) #define UTF8_GET_NAMING(pages, p, n) \ ((n) == 2 \ ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \ : ((n) == 3 \ ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \ : 0)) #define UTF8_INVALID3(p) \ ((*p) == 0xED \ ? (((p)[1] & 0x20) != 0) \ : ((*p) == 0xEF \ ? ((p)[1] == 0xBF && ((p)[2] == 0xBF || (p)[2] == 0xBE)) \ : 0)) #define UTF8_INVALID4(p) ((*p) == 0xF4 && ((p)[1] & 0x30) != 0) static int isNever(const ENCODING *enc, const char *p) { return 0; } static int utf8_isName2(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); } static int utf8_isName3(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); } #define utf8_isName4 isNever static int utf8_isNmstrt2(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); } static int utf8_isNmstrt3(const ENCODING *enc, const char *p) { return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); } #define utf8_isNmstrt4 isNever #define utf8_isInvalid2 isNever static int utf8_isInvalid3(const ENCODING *enc, const char *p) { return UTF8_INVALID3((const unsigned char *)p); } static int utf8_isInvalid4(const ENCODING *enc, const char *p) { return UTF8_INVALID4((const unsigned char *)p); } struct normal_encoding { ENCODING enc; unsigned char type[256]; #ifdef XML_MIN_SIZE int (*byteType)(const ENCODING *, const char *); int (*isNameMin)(const ENCODING *, const char *); int (*isNmstrtMin)(const ENCODING *, const char *); int (*byteToAscii)(const ENCODING *, const char *); int (*charMatches)(const ENCODING *, const char *, int); #endif /* XML_MIN_SIZE */ int (*isName2)(const ENCODING *, const char *); int (*isName3)(const ENCODING *, const char *); int (*isName4)(const ENCODING *, const char *); int (*isNmstrt2)(const ENCODING *, const char *); int (*isNmstrt3)(const ENCODING *, const char *); int (*isNmstrt4)(const ENCODING *, const char *); int (*isInvalid2)(const ENCODING *, const char *); int (*isInvalid3)(const ENCODING *, const char *); int (*isInvalid4)(const ENCODING *, const char *); }; #ifdef XML_MIN_SIZE #define STANDARD_VTABLE(E) \ E ## byteType, \ E ## isNameMin, \ E ## isNmstrtMin, \ E ## byteToAscii, \ E ## charMatches, #else #define STANDARD_VTABLE(E) /* as nothing */ #endif #define NORMAL_VTABLE(E) \ E ## isName2, \ E ## isName3, \ E ## isName4, \ E ## isNmstrt2, \ E ## isNmstrt3, \ E ## isNmstrt4, \ E ## isInvalid2, \ E ## isInvalid3, \ E ## isInvalid4 static int checkCharRefNumber(int); #include "xmltok_impl.h" #ifdef XML_MIN_SIZE #define sb_isNameMin isNever #define sb_isNmstrtMin isNever #endif #ifdef XML_MIN_SIZE #define MINBPC(enc) ((enc)->minBytesPerChar) #else /* minimum bytes per character */ #define MINBPC(enc) 1 #endif #define SB_BYTE_TYPE(enc, p) \ (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)]) #ifdef XML_MIN_SIZE static int sb_byteType(const ENCODING *enc, const char *p) { return SB_BYTE_TYPE(enc, p); } #define BYTE_TYPE(enc, p) \ (((const struct normal_encoding *)(enc))->byteType(enc, p)) #else #define BYTE_TYPE(enc, p) SB_BYTE_TYPE(enc, p) #endif #ifdef XML_MIN_SIZE #define BYTE_TO_ASCII(enc, p) \ (((const struct normal_encoding *)(enc))->byteToAscii(enc, p)) static int sb_byteToAscii(const ENCODING *enc, const char *p) { return *p; } #else #define BYTE_TO_ASCII(enc, p) (*p) #endif #define IS_NAME_CHAR(enc, p, n) \ (((const struct normal_encoding *)(enc))->isName ## n(enc, p)) #define IS_NMSTRT_CHAR(enc, p, n) \ (((const struct normal_encoding *)(enc))->isNmstrt ## n(enc, p)) #define IS_INVALID_CHAR(enc, p, n) \ (((const struct normal_encoding *)(enc))->isInvalid ## n(enc, p)) #ifdef XML_MIN_SIZE #define IS_NAME_CHAR_MINBPC(enc, p) \ (((const struct normal_encoding *)(enc))->isNameMin(enc, p)) #define IS_NMSTRT_CHAR_MINBPC(enc, p) \ (((const struct normal_encoding *)(enc))->isNmstrtMin(enc, p)) #else #define IS_NAME_CHAR_MINBPC(enc, p) (0) #define IS_NMSTRT_CHAR_MINBPC(enc, p) (0) #endif #ifdef XML_MIN_SIZE #define CHAR_MATCHES(enc, p, c) \ (((const struct normal_encoding *)(enc))->charMatches(enc, p, c)) static int sb_charMatches(const ENCODING *enc, const char *p, int c) { return *p == c; } #else /* c is an ASCII character */ #define CHAR_MATCHES(enc, p, c) (*(p) == c) #endif #define PREFIX(ident) normal_ ## ident #include "xmltok_impl.c" #undef MINBPC #undef BYTE_TYPE #undef BYTE_TO_ASCII #undef CHAR_MATCHES #undef IS_NAME_CHAR #undef IS_NAME_CHAR_MINBPC #undef IS_NMSTRT_CHAR #undef IS_NMSTRT_CHAR_MINBPC #undef IS_INVALID_CHAR enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */ UTF8_cval1 = 0x00, UTF8_cval2 = 0xc0, UTF8_cval3 = 0xe0, UTF8_cval4 = 0xf0 }; static void utf8_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) { char *to; const char *from; if (fromLim - *fromP > toLim - *toP) { /* Avoid copying partial characters. */ for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--) if (((unsigned char)fromLim[-1] & 0xc0) != 0x80) break; } for (to = *toP, from = *fromP; from != fromLim; from++, to++) *to = *from; *fromP = from; *toP = to; } static void utf8_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim) { unsigned short *to = *toP; const char *from = *fromP; while (from != fromLim && to != toLim) { switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) { case BT_LEAD2: *to++ = ((from[0] & 0x1f) << 6) | (from[1] & 0x3f); from += 2; break; case BT_LEAD3: *to++ = ((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f); from += 3; break; case BT_LEAD4: { unsigned long n; if (to + 1 == toLim) break; n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f); n -= 0x10000; to[0] = (unsigned short)((n >> 10) | 0xD800); to[1] = (unsigned short)((n & 0x3FF) | 0xDC00); to += 2; from += 4; } break; default: *to++ = *from++; break; } } *fromP = from; *toP = to; } #ifdef XML_NS static const struct normal_encoding utf8_encoding_ns = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #include "asciitab.h" #include "utf8tab.h" }, STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) }; #endif static const struct normal_encoding utf8_encoding = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON #include "utf8tab.h" }, STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) }; #ifdef XML_NS static const struct normal_encoding internal_utf8_encoding_ns = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #include "iasciitab.h" #include "utf8tab.h" }, STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) }; #endif static const struct normal_encoding internal_utf8_encoding = { { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, { #define BT_COLON BT_NMSTRT #include "iasciitab.h" #undef BT_COLON #include "utf8tab.h" }, STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) }; static void latin1_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) { for (;;) { unsigned char c; if (*fromP == fromLim) break; c = (unsigned char)**fromP; if (c & 0x80) { if (toLim - *toP < 2) break; *(*toP)++ = ((c >> 6) | UTF8_cval2); *(*toP)++ = ((c & 0x3f) | 0x80); (*fromP)++; } else { if (*toP == toLim) break; *(*toP)++ = *(*fromP)++; } } } static void latin1_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim) { while (*fromP != fromLim && *toP != toLim) *(*toP)++ = (unsigned char)*(*fromP)++; } #ifdef XML_NS static const struct normal_encoding latin1_encoding_ns = { { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, { #include "asciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(sb_) }; #endif static const struct normal_encoding latin1_encoding = { { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(sb_) }; static void ascii_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) { while (*fromP != fromLim && *toP != toLim) *(*toP)++ = *(*fromP)++; } #ifdef XML_NS static const struct normal_encoding ascii_encoding_ns = { { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, { #include "asciitab.h" /* BT_NONXML == 0 */ }, STANDARD_VTABLE(sb_) }; #endif static const struct normal_encoding ascii_encoding = { { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON /* BT_NONXML == 0 */ }, STANDARD_VTABLE(sb_) }; static int unicode_byte_type(char hi, char lo) { switch ((unsigned char)hi) { case 0xD8: case 0xD9: case 0xDA: case 0xDB: return BT_LEAD4; case 0xDC: case 0xDD: case 0xDE: case 0xDF: return BT_TRAIL; case 0xFF: switch ((unsigned char)lo) { case 0xFF: case 0xFE: return BT_NONXML; } break; } return BT_NONASCII; } #define DEFINE_UTF16_TO_UTF8(E) \ static \ void E ## toUtf8(const ENCODING *enc, \ const char **fromP, const char *fromLim, \ char **toP, const char *toLim) \ { \ const char *from; \ for (from = *fromP; from != fromLim; from += 2) { \ int plane; \ unsigned char lo2; \ unsigned char lo = GET_LO(from); \ unsigned char hi = GET_HI(from); \ switch (hi) { \ case 0: \ if (lo < 0x80) { \ if (*toP == toLim) { \ *fromP = from; \ return; \ } \ *(*toP)++ = lo; \ break; \ } \ /* fall through */ \ case 0x1: case 0x2: case 0x3: \ case 0x4: case 0x5: case 0x6: case 0x7: \ if (toLim - *toP < 2) { \ *fromP = from; \ return; \ } \ *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \ *(*toP)++ = ((lo & 0x3f) | 0x80); \ break; \ default: \ if (toLim - *toP < 3) { \ *fromP = from; \ return; \ } \ /* 16 bits divided 4, 6, 6 amongst 3 bytes */ \ *(*toP)++ = ((hi >> 4) | UTF8_cval3); \ *(*toP)++ = (((hi & 0xf) << 2) | (lo >> 6) | 0x80); \ *(*toP)++ = ((lo & 0x3f) | 0x80); \ break; \ case 0xD8: case 0xD9: case 0xDA: case 0xDB: \ if (toLim - *toP < 4) { \ *fromP = from; \ return; \ } \ plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \ *(*toP)++ = ((plane >> 2) | UTF8_cval4); \ *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \ from += 2; \ lo2 = GET_LO(from); \ *(*toP)++ = (((lo & 0x3) << 4) \ | ((GET_HI(from) & 0x3) << 2) \ | (lo2 >> 6) \ | 0x80); \ *(*toP)++ = ((lo2 & 0x3f) | 0x80); \ break; \ } \ } \ *fromP = from; \ } #define DEFINE_UTF16_TO_UTF16(E) \ static \ void E ## toUtf16(const ENCODING *enc, \ const char **fromP, const char *fromLim, \ unsigned short **toP, const unsigned short *toLim) \ { \ /* Avoid copying first half only of surrogate */ \ if (fromLim - *fromP > ((toLim - *toP) << 1) \ && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \ fromLim -= 2; \ for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \ *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \ } #define SET2(ptr, ch) \ (((ptr)[0] = ((ch) & 0xff)), ((ptr)[1] = ((ch) >> 8))) #define GET_LO(ptr) ((unsigned char)(ptr)[0]) #define GET_HI(ptr) ((unsigned char)(ptr)[1]) DEFINE_UTF16_TO_UTF8(little2_) DEFINE_UTF16_TO_UTF16(little2_) #undef SET2 #undef GET_LO #undef GET_HI #define SET2(ptr, ch) \ (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch) & 0xFF))) #define GET_LO(ptr) ((unsigned char)(ptr)[1]) #define GET_HI(ptr) ((unsigned char)(ptr)[0]) DEFINE_UTF16_TO_UTF8(big2_) DEFINE_UTF16_TO_UTF16(big2_) #undef SET2 #undef GET_LO #undef GET_HI #define LITTLE2_BYTE_TYPE(enc, p) \ ((p)[1] == 0 \ ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \ : unicode_byte_type((p)[1], (p)[0])) #define LITTLE2_BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1) #define LITTLE2_CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c) #define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) \ UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0]) #define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0]) #ifdef XML_MIN_SIZE static int little2_byteType(const ENCODING *enc, const char *p) { return LITTLE2_BYTE_TYPE(enc, p); } static int little2_byteToAscii(const ENCODING *enc, const char *p) { return LITTLE2_BYTE_TO_ASCII(enc, p); } static int little2_charMatches(const ENCODING *enc, const char *p, int c) { return LITTLE2_CHAR_MATCHES(enc, p, c); } static int little2_isNameMin(const ENCODING *enc, const char *p) { return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); } static int little2_isNmstrtMin(const ENCODING *enc, const char *p) { return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); } #undef VTABLE #define VTABLE VTABLE1, little2_toUtf8, little2_toUtf16 #else /* not XML_MIN_SIZE */ #undef PREFIX #define PREFIX(ident) little2_ ## ident #define MINBPC(enc) 2 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p) #define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c) #define IS_NAME_CHAR(enc, p, n) 0 #define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) #define IS_NMSTRT_CHAR(enc, p, n) (0) #define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) #include "xmltok_impl.c" #undef MINBPC #undef BYTE_TYPE #undef BYTE_TO_ASCII #undef CHAR_MATCHES #undef IS_NAME_CHAR #undef IS_NAME_CHAR_MINBPC #undef IS_NMSTRT_CHAR #undef IS_NMSTRT_CHAR_MINBPC #undef IS_INVALID_CHAR #endif /* not XML_MIN_SIZE */ #ifdef XML_NS static const struct normal_encoding little2_encoding_ns = { { VTABLE, 2, 0, #if XML_BYTE_ORDER == 12 1 #else 0 #endif }, { #include "asciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(little2_) }; #endif static const struct normal_encoding little2_encoding = { { VTABLE, 2, 0, #if XML_BYTE_ORDER == 12 1 #else 0 #endif }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(little2_) }; #if XML_BYTE_ORDER != 21 #ifdef XML_NS static const struct normal_encoding internal_little2_encoding_ns = { { VTABLE, 2, 0, 1 }, { #include "iasciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(little2_) }; #endif static const struct normal_encoding internal_little2_encoding = { { VTABLE, 2, 0, 1 }, { #define BT_COLON BT_NMSTRT #include "iasciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(little2_) }; #endif #define BIG2_BYTE_TYPE(enc, p) \ ((p)[0] == 0 \ ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \ : unicode_byte_type((p)[0], (p)[1])) #define BIG2_BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1) #define BIG2_CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c) #define BIG2_IS_NAME_CHAR_MINBPC(enc, p) \ UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1]) #define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1]) #ifdef XML_MIN_SIZE static int big2_byteType(const ENCODING *enc, const char *p) { return BIG2_BYTE_TYPE(enc, p); } static int big2_byteToAscii(const ENCODING *enc, const char *p) { return BIG2_BYTE_TO_ASCII(enc, p); } static int big2_charMatches(const ENCODING *enc, const char *p, int c) { return BIG2_CHAR_MATCHES(enc, p, c); } static int big2_isNameMin(const ENCODING *enc, const char *p) { return BIG2_IS_NAME_CHAR_MINBPC(enc, p); } static int big2_isNmstrtMin(const ENCODING *enc, const char *p) { return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p); } #undef VTABLE #define VTABLE VTABLE1, big2_toUtf8, big2_toUtf16 #else /* not XML_MIN_SIZE */ #undef PREFIX #define PREFIX(ident) big2_ ## ident #define MINBPC(enc) 2 /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p) #define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c) #define IS_NAME_CHAR(enc, p, n) 0 #define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p) #define IS_NMSTRT_CHAR(enc, p, n) (0) #define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) #include "xmltok_impl.c" #undef MINBPC #undef BYTE_TYPE #undef BYTE_TO_ASCII #undef CHAR_MATCHES #undef IS_NAME_CHAR #undef IS_NAME_CHAR_MINBPC #undef IS_NMSTRT_CHAR #undef IS_NMSTRT_CHAR_MINBPC #undef IS_INVALID_CHAR #endif /* not XML_MIN_SIZE */ #ifdef XML_NS static const struct normal_encoding big2_encoding_ns = { { VTABLE, 2, 0, #if XML_BYTE_ORDER == 21 1 #else 0 #endif }, { #include "asciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(big2_) }; #endif static const struct normal_encoding big2_encoding = { { VTABLE, 2, 0, #if XML_BYTE_ORDER == 21 1 #else 0 #endif }, { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(big2_) }; #if XML_BYTE_ORDER != 12 #ifdef XML_NS static const struct normal_encoding internal_big2_encoding_ns = { { VTABLE, 2, 0, 1 }, { #include "iasciitab.h" #include "latin1tab.h" }, STANDARD_VTABLE(big2_) }; #endif static const struct normal_encoding internal_big2_encoding = { { VTABLE, 2, 0, 1 }, { #define BT_COLON BT_NMSTRT #include "iasciitab.h" #undef BT_COLON #include "latin1tab.h" }, STANDARD_VTABLE(big2_) }; #endif #undef PREFIX static int streqci(const char *s1, const char *s2) { for (;;) { char c1 = *s1++; char c2 = *s2++; if ('a' <= c1 && c1 <= 'z') c1 += 'A' - 'a'; if ('a' <= c2 && c2 <= 'z') c2 += 'A' - 'a'; if (c1 != c2) return 0; if (!c1) break; } return 1; } static void initUpdatePosition(const ENCODING *enc, const char *ptr, const char *end, POSITION *pos) { normal_updatePosition(&utf8_encoding.enc, ptr, end, pos); } static int toAscii(const ENCODING *enc, const char *ptr, const char *end) { char buf[1]; char *p = buf; XmlUtf8Convert(enc, &ptr, end, &p, p + 1); if (p == buf) return -1; else return buf[0]; } static int isSpace(int c) { switch (c) { case 0x20: case 0xD: case 0xA: case 0x9: return 1; } return 0; } /* Return 1 if there's just optional white space or there's an S followed by name=val. */ static int parsePseudoAttribute(const ENCODING *enc, const char *ptr, const char *end, const char **namePtr, const char **nameEndPtr, const char **valPtr, const char **nextTokPtr) { int c; char open; if (ptr == end) { *namePtr = 0; return 1; } if (!isSpace(toAscii(enc, ptr, end))) { *nextTokPtr = ptr; return 0; } do { ptr += enc->minBytesPerChar; } while (isSpace(toAscii(enc, ptr, end))); if (ptr == end) { *namePtr = 0; return 1; } *namePtr = ptr; for (;;) { c = toAscii(enc, ptr, end); if (c == -1) { *nextTokPtr = ptr; return 0; } if (c == '=') { *nameEndPtr = ptr; break; } if (isSpace(c)) { *nameEndPtr = ptr; do { ptr += enc->minBytesPerChar; } while (isSpace(c = toAscii(enc, ptr, end))); if (c != '=') { *nextTokPtr = ptr; return 0; } break; } ptr += enc->minBytesPerChar; } if (ptr == *namePtr) { *nextTokPtr = ptr; return 0; } ptr += enc->minBytesPerChar; c = toAscii(enc, ptr, end); while (isSpace(c)) { ptr += enc->minBytesPerChar; c = toAscii(enc, ptr, end); } if (c != '"' && c != '\'') { *nextTokPtr = ptr; return 0; } open = c; ptr += enc->minBytesPerChar; *valPtr = ptr; for (;; ptr += enc->minBytesPerChar) { c = toAscii(enc, ptr, end); if (c == open) break; if (!('a' <= c && c <= 'z') && !('A' <= c && c <= 'Z') && !('0' <= c && c <= '9') && c != '.' && c != '-' && c != '_') { *nextTokPtr = ptr; return 0; } } *nextTokPtr = ptr + enc->minBytesPerChar; return 1; } static int doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *, const char *, const char *), int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **encodingName, const ENCODING **encoding, int *standalone) { const char *val = 0; const char *name = 0; const char *nameEnd = 0; ptr += 5 * enc->minBytesPerChar; end -= 2 * enc->minBytesPerChar; if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr) || !name) { *badPtr = ptr; return 0; } if (!XmlNameMatchesAscii(enc, name, nameEnd, "version")) { if (!isGeneralTextEntity) { *badPtr = name; return 0; } } else { if (versionPtr) *versionPtr = val; if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { *badPtr = ptr; return 0; } if (!name) { if (isGeneralTextEntity) { /* a TextDecl must have an EncodingDecl */ *badPtr = ptr; return 0; } return 1; } } if (XmlNameMatchesAscii(enc, name, nameEnd, "encoding")) { int c = toAscii(enc, val, end); if (!('a' <= c && c <= 'z') && !('A' <= c && c <= 'Z')) { *badPtr = val; return 0; } if (encodingName) *encodingName = val; if (encoding) *encoding = encodingFinder(enc, val, ptr - enc->minBytesPerChar); if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { *badPtr = ptr; return 0; } if (!name) return 1; } if (!XmlNameMatchesAscii(enc, name, nameEnd, "standalone") || isGeneralTextEntity) { *badPtr = name; return 0; } if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, "yes")) { if (standalone) *standalone = 1; } else if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, "no")) { if (standalone) *standalone = 0; } else { *badPtr = val; return 0; } while (isSpace(toAscii(enc, ptr, end))) ptr += enc->minBytesPerChar; if (ptr != end) { *badPtr = ptr; return 0; } return 1; } static int checkCharRefNumber(int result) { switch (result >> 8) { case 0xD8: case 0xD9: case 0xDA: case 0xDB: case 0xDC: case 0xDD: case 0xDE: case 0xDF: return -1; case 0: if (latin1_encoding.type[result] == BT_NONXML) return -1; break; case 0xFF: if (result == 0xFFFE || result == 0xFFFF) return -1; break; } return result; } int XmlUtf8Encode(int c, char *buf) { enum { /* minN is minimum legal resulting value for N byte sequence */ min2 = 0x80, min3 = 0x800, min4 = 0x10000 }; if (c < 0) return 0; if (c < min2) { buf[0] = (c | UTF8_cval1); return 1; } if (c < min3) { buf[0] = ((c >> 6) | UTF8_cval2); buf[1] = ((c & 0x3f) | 0x80); return 2; } if (c < min4) { buf[0] = ((c >> 12) | UTF8_cval3); buf[1] = (((c >> 6) & 0x3f) | 0x80); buf[2] = ((c & 0x3f) | 0x80); return 3; } if (c < 0x110000) { buf[0] = ((c >> 18) | UTF8_cval4); buf[1] = (((c >> 12) & 0x3f) | 0x80); buf[2] = (((c >> 6) & 0x3f) | 0x80); buf[3] = ((c & 0x3f) | 0x80); return 4; } return 0; } int XmlUtf16Encode(int charNum, unsigned short *buf) { if (charNum < 0) return 0; if (charNum < 0x10000) { buf[0] = charNum; return 1; } if (charNum < 0x110000) { charNum -= 0x10000; buf[0] = (charNum >> 10) + 0xD800; buf[1] = (charNum & 0x3FF) + 0xDC00; return 2; } return 0; } struct unknown_encoding { struct normal_encoding normal; int (*convert)(void *userData, const char *p); void *userData; unsigned short utf16[256]; char utf8[256][4]; }; int XmlSizeOfUnknownEncoding(void) { return sizeof(struct unknown_encoding); } static int unknown_isName(const ENCODING *enc, const char *p) { int c = ((const struct unknown_encoding *)enc) ->convert(((const struct unknown_encoding *)enc)->userData, p); if (c & ~0xFFFF) return 0; return UCS2_GET_NAMING(namePages, c >> 8, c & 0xFF); } static int unknown_isNmstrt(const ENCODING *enc, const char *p) { int c = ((const struct unknown_encoding *)enc) ->convert(((const struct unknown_encoding *)enc)->userData, p); if (c & ~0xFFFF) return 0; return UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xFF); } static int unknown_isInvalid(const ENCODING *enc, const char *p) { int c = ((const struct unknown_encoding *)enc) ->convert(((const struct unknown_encoding *)enc)->userData, p); return (c & ~0xFFFF) || checkCharRefNumber(c) < 0; } static void unknown_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim) { char buf[XML_UTF8_ENCODE_MAX]; for (;;) { const char *utf8; int n; if (*fromP == fromLim) break; utf8 = ((const struct unknown_encoding *)enc)->utf8[(unsigned char)**fromP]; n = *utf8++; if (n == 0) { int c = ((const struct unknown_encoding *)enc) ->convert(((const struct unknown_encoding *)enc)->userData, *fromP); n = XmlUtf8Encode(c, buf); if (n > toLim - *toP) break; utf8 = buf; *fromP += ((const struct normal_encoding *)enc)->type[(unsigned char)**fromP] - (BT_LEAD2 - 2); } else { if (n > toLim - *toP) break; (*fromP)++; } do { *(*toP)++ = *utf8++; } while (--n != 0); } } static void unknown_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim) { while (*fromP != fromLim && *toP != toLim) { unsigned short c = ((const struct unknown_encoding *)enc)->utf16[(unsigned char)**fromP]; if (c == 0) { c = (unsigned short)((const struct unknown_encoding *)enc) ->convert(((const struct unknown_encoding *)enc)->userData, *fromP); *fromP += ((const struct normal_encoding *)enc)->type[(unsigned char)**fromP] - (BT_LEAD2 - 2); } else (*fromP)++; *(*toP)++ = c; } } ENCODING * XmlInitUnknownEncoding(void *mem, int *table, int (*convert)(void *userData, const char *p), void *userData) { int i; struct unknown_encoding *e = mem; for (i = 0; i < sizeof(struct normal_encoding); i++) ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; for (i = 0; i < 128; i++) if (latin1_encoding.type[i] != BT_OTHER && latin1_encoding.type[i] != BT_NONXML && table[i] != i) return 0; for (i = 0; i < 256; i++) { int c = table[i]; if (c == -1) { e->normal.type[i] = BT_MALFORM; /* This shouldn't really get used. */ e->utf16[i] = 0xFFFF; e->utf8[i][0] = 1; e->utf8[i][1] = 0; } else if (c < 0) { if (c < -4) return 0; e->normal.type[i] = BT_LEAD2 - (c + 2); e->utf8[i][0] = 0; e->utf16[i] = 0; } else if (c < 0x80) { if (latin1_encoding.type[c] != BT_OTHER && latin1_encoding.type[c] != BT_NONXML && c != i) return 0; e->normal.type[i] = latin1_encoding.type[c]; e->utf8[i][0] = 1; e->utf8[i][1] = (char)c; e->utf16[i] = c == 0 ? 0xFFFF : c; } else if (checkCharRefNumber(c) < 0) { e->normal.type[i] = BT_NONXML; /* This shouldn't really get used. */ e->utf16[i] = 0xFFFF; e->utf8[i][0] = 1; e->utf8[i][1] = 0; } else { if (c > 0xFFFF) return 0; if (UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xff)) e->normal.type[i] = BT_NMSTRT; else if (UCS2_GET_NAMING(namePages, c >> 8, c & 0xff)) e->normal.type[i] = BT_NAME; else e->normal.type[i] = BT_OTHER; e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1); e->utf16[i] = c; } } e->userData = userData; e->convert = convert; if (convert) { e->normal.isName2 = unknown_isName; e->normal.isName3 = unknown_isName; e->normal.isName4 = unknown_isName; e->normal.isNmstrt2 = unknown_isNmstrt; e->normal.isNmstrt3 = unknown_isNmstrt; e->normal.isNmstrt4 = unknown_isNmstrt; e->normal.isInvalid2 = unknown_isInvalid; e->normal.isInvalid3 = unknown_isInvalid; e->normal.isInvalid4 = unknown_isInvalid; } e->normal.enc.utf8Convert = unknown_toUtf8; e->normal.enc.utf16Convert = unknown_toUtf16; return &(e->normal.enc); } /* If this enumeration is changed, getEncodingIndex and encodings must also be changed. */ enum { UNKNOWN_ENC = -1, ISO_8859_1_ENC = 0, US_ASCII_ENC, UTF_8_ENC, UTF_16_ENC, UTF_16BE_ENC, UTF_16LE_ENC, /* must match encodingNames up to here */ NO_ENC }; static int getEncodingIndex(const char *name) { static const char *encodingNames[] = { "ISO-8859-1", "US-ASCII", "UTF-8", "UTF-16", "UTF-16BE" "UTF-16LE", }; int i; if (name == 0) return NO_ENC; for (i = 0; i < sizeof(encodingNames)/sizeof(encodingNames[0]); i++) if (streqci(name, encodingNames[i])) return i; return UNKNOWN_ENC; } /* For binary compatibility, we store the index of the encoding specified at initialization in the isUtf16 member. */ #define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16) #define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i) /* This is what detects the encoding. encodingTable maps from encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of the external (protocol) specified encoding; state is XML_CONTENT_STATE if we're parsing an external text entity, and XML_PROLOG_STATE otherwise. */ static int initScan(const ENCODING **encodingTable, const INIT_ENCODING *enc, int state, const char *ptr, const char *end, const char **nextTokPtr) { const ENCODING **encPtr; if (ptr == end) return XML_TOK_NONE; encPtr = enc->encPtr; if (ptr + 1 == end) { /* only a single byte available for auto-detection */ #ifndef XML_DTD /* FIXME */ /* a well-formed document entity must have more than one byte */ if (state != XML_CONTENT_STATE) return XML_TOK_PARTIAL; #endif /* so we're parsing an external text entity... */ /* if UTF-16 was externally specified, then we need at least 2 bytes */ switch (INIT_ENC_INDEX(enc)) { case UTF_16_ENC: case UTF_16LE_ENC: case UTF_16BE_ENC: return XML_TOK_PARTIAL; } switch ((unsigned char)*ptr) { case 0xFE: case 0xFF: case 0xEF: /* possibly first byte of UTF-8 BOM */ if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC && state == XML_CONTENT_STATE) break; /* fall through */ case 0x00: case 0x3C: return XML_TOK_PARTIAL; } } else { switch (((unsigned char)ptr[0] << 8) | (unsigned char)ptr[1]) { case 0xFEFF: if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC && state == XML_CONTENT_STATE) break; *nextTokPtr = ptr + 2; *encPtr = encodingTable[UTF_16BE_ENC]; return XML_TOK_BOM; /* 00 3C is handled in the default case */ case 0x3C00: if ((INIT_ENC_INDEX(enc) == UTF_16BE_ENC || INIT_ENC_INDEX(enc) == UTF_16_ENC) && state == XML_CONTENT_STATE) break; *encPtr = encodingTable[UTF_16LE_ENC]; return XmlTok(*encPtr, state, ptr, end, nextTokPtr); case 0xFFFE: if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC && state == XML_CONTENT_STATE) break; *nextTokPtr = ptr + 2; *encPtr = encodingTable[UTF_16LE_ENC]; return XML_TOK_BOM; case 0xEFBB: /* Maybe a UTF-8 BOM (EF BB BF) */ /* If there's an explicitly specified (external) encoding of ISO-8859-1 or some flavour of UTF-16 and this is an external text entity, don't look for the BOM, because it might be a legal data. */ if (state == XML_CONTENT_STATE) { int e = INIT_ENC_INDEX(enc); if (e == ISO_8859_1_ENC || e == UTF_16BE_ENC || e == UTF_16LE_ENC || e == UTF_16_ENC) break; } if (ptr + 2 == end) return XML_TOK_PARTIAL; if ((unsigned char)ptr[2] == 0xBF) { *encPtr = encodingTable[UTF_8_ENC]; return XML_TOK_BOM; } break; default: if (ptr[0] == '\0') { /* 0 isn't a legal data character. Furthermore a document entity can only start with ASCII characters. So the only way this can fail to be big-endian UTF-16 if it it's an external parsed general entity that's labelled as UTF-16LE. */ if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC) break; *encPtr = encodingTable[UTF_16BE_ENC]; return XmlTok(*encPtr, state, ptr, end, nextTokPtr); } else if (ptr[1] == '\0') { /* We could recover here in the case: - parsing an external entity - second byte is 0 - no externally specified encoding - no encoding declaration by assuming UTF-16LE. But we don't, because this would mean when presented just with a single byte, we couldn't reliably determine whether we needed further bytes. */ if (state == XML_CONTENT_STATE) break; *encPtr = encodingTable[UTF_16LE_ENC]; return XmlTok(*encPtr, state, ptr, end, nextTokPtr); } break; } } *encPtr = encodingTable[INIT_ENC_INDEX(enc)]; return XmlTok(*encPtr, state, ptr, end, nextTokPtr); } #define NS(x) x #define ns(x) x #include "xmltok_ns.c" #undef NS #undef ns #ifdef XML_NS #define NS(x) x ## NS #define ns(x) x ## _ns #include "xmltok_ns.c" #undef NS #undef ns ENCODING * XmlInitUnknownEncodingNS(void *mem, int *table, int (*convert)(void *userData, const char *p), void *userData) { ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData); if (enc) ((struct normal_encoding *)enc)->type[':'] = BT_COLON; return enc; } #endif /* XML_NS */ sitecopy-0.16.6/lib/expat/xmltok/xmltok_impl.c0000664000076400007640000012007610132320456017503 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef IS_INVALID_CHAR #define IS_INVALID_CHAR(enc, ptr, n) (0) #endif #define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \ case BT_LEAD ## n: \ if (end - ptr < n) \ return XML_TOK_PARTIAL_CHAR; \ if (IS_INVALID_CHAR(enc, ptr, n)) { \ *(nextTokPtr) = (ptr); \ return XML_TOK_INVALID; \ } \ ptr += n; \ break; #define INVALID_CASES(ptr, nextTokPtr) \ INVALID_LEAD_CASE(2, ptr, nextTokPtr) \ INVALID_LEAD_CASE(3, ptr, nextTokPtr) \ INVALID_LEAD_CASE(4, ptr, nextTokPtr) \ case BT_NONXML: \ case BT_MALFORM: \ case BT_TRAIL: \ *(nextTokPtr) = (ptr); \ return XML_TOK_INVALID; #define CHECK_NAME_CASE(n, enc, ptr, end, nextTokPtr) \ case BT_LEAD ## n: \ if (end - ptr < n) \ return XML_TOK_PARTIAL_CHAR; \ if (!IS_NAME_CHAR(enc, ptr, n)) { \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; \ } \ ptr += n; \ break; #define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \ case BT_NONASCII: \ if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; \ } \ case BT_NMSTRT: \ case BT_HEX: \ case BT_DIGIT: \ case BT_NAME: \ case BT_MINUS: \ ptr += MINBPC(enc); \ break; \ CHECK_NAME_CASE(2, enc, ptr, end, nextTokPtr) \ CHECK_NAME_CASE(3, enc, ptr, end, nextTokPtr) \ CHECK_NAME_CASE(4, enc, ptr, end, nextTokPtr) #define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \ case BT_LEAD ## n: \ if (end - ptr < n) \ return XML_TOK_PARTIAL_CHAR; \ if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; \ } \ ptr += n; \ break; #define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \ case BT_NONASCII: \ if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; \ } \ case BT_NMSTRT: \ case BT_HEX: \ ptr += MINBPC(enc); \ break; \ CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \ CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \ CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr) #ifndef PREFIX #define PREFIX(ident) ident #endif /* ptr points to character following "')) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_COMMENT; } break; default: ptr += MINBPC(enc); break; } } } return XML_TOK_PARTIAL; } /* ptr points to character following " */ switch (BYTE_TYPE(enc, ptr + MINBPC(enc))) { case BT_S: case BT_CR: case BT_LF: case BT_PERCNT: *nextTokPtr = ptr; return XML_TOK_INVALID; } /* fall through */ case BT_S: case BT_CR: case BT_LF: *nextTokPtr = ptr; return XML_TOK_DECL_OPEN; case BT_NMSTRT: case BT_HEX: ptr += MINBPC(enc); break; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return XML_TOK_PARTIAL; } static int PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr) { int upper = 0; *tokPtr = XML_TOK_PI; if (end - ptr != MINBPC(enc)*3) return 1; switch (BYTE_TO_ASCII(enc, ptr)) { case 'x': break; case 'X': upper = 1; break; default: return 1; } ptr += MINBPC(enc); switch (BYTE_TO_ASCII(enc, ptr)) { case 'm': break; case 'M': upper = 1; break; default: return 1; } ptr += MINBPC(enc); switch (BYTE_TO_ASCII(enc, ptr)) { case 'l': break; case 'L': upper = 1; break; default: return 1; } if (upper) return 0; *tokPtr = XML_TOK_XML_DECL; return 1; } /* ptr points to character following "')) { *nextTokPtr = ptr + MINBPC(enc); return tok; } break; default: ptr += MINBPC(enc); break; } } return XML_TOK_PARTIAL; case BT_QUEST: if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) { *nextTokPtr = ptr; return XML_TOK_INVALID; } ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, '>')) { *nextTokPtr = ptr + MINBPC(enc); return tok; } /* fall through */ default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return XML_TOK_PARTIAL; } static int PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { int i; /* CDATA[ */ if (end - ptr < 6 * MINBPC(enc)) return XML_TOK_PARTIAL; for (i = 0; i < 6; i++, ptr += MINBPC(enc)) { if (!CHAR_MATCHES(enc, ptr, "CDATA["[i])) { *nextTokPtr = ptr; return XML_TOK_INVALID; } } *nextTokPtr = ptr; return XML_TOK_CDATA_SECT_OPEN; } static int PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { if (ptr == end) return XML_TOK_NONE; if (MINBPC(enc) > 1) { size_t n = end - ptr; if (n & (MINBPC(enc) - 1)) { n &= ~(MINBPC(enc) - 1); if (n == 0) return XML_TOK_PARTIAL; end = ptr + n; } } switch (BYTE_TYPE(enc, ptr)) { case BT_RSQB: ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; if (!CHAR_MATCHES(enc, ptr, ']')) break; ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; if (!CHAR_MATCHES(enc, ptr, '>')) { ptr -= MINBPC(enc); break; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_CDATA_SECT_CLOSE; case BT_CR: ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; if (BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); *nextTokPtr = ptr; return XML_TOK_DATA_NEWLINE; case BT_LF: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DATA_NEWLINE; INVALID_CASES(ptr, nextTokPtr) default: ptr += MINBPC(enc); break; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ *nextTokPtr = ptr; \ return XML_TOK_DATA_CHARS; \ } \ ptr += n; \ break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_NONXML: case BT_MALFORM: case BT_TRAIL: case BT_CR: case BT_LF: case BT_RSQB: *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; default: ptr += MINBPC(enc); break; } } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; } /* ptr points to character following "')) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_EMPTY_ELEMENT_WITH_ATTS; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } break; } break; } default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return XML_TOK_PARTIAL; } /* ptr points to character following "<" */ static int PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { #ifdef XML_NS int hadColon; #endif if (ptr == end) return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) case BT_EXCL: if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { case BT_MINUS: return PREFIX(scanComment)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_LSQB: return PREFIX(scanCdataSection)(enc, ptr + MINBPC(enc), end, nextTokPtr); } *nextTokPtr = ptr; return XML_TOK_INVALID; case BT_QUEST: return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_SOL: return PREFIX(scanEndTag)(enc, ptr + MINBPC(enc), end, nextTokPtr); default: *nextTokPtr = ptr; return XML_TOK_INVALID; } #ifdef XML_NS hadColon = 0; #endif /* we have a start-tag */ while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) #ifdef XML_NS case BT_COLON: if (hadColon) { *nextTokPtr = ptr; return XML_TOK_INVALID; } hadColon = 1; ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) default: *nextTokPtr = ptr; return XML_TOK_INVALID; } break; #endif case BT_S: case BT_CR: case BT_LF: { ptr += MINBPC(enc); while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) case BT_GT: goto gt; case BT_SOL: goto sol; case BT_S: case BT_CR: case BT_LF: ptr += MINBPC(enc); continue; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } return PREFIX(scanAtts)(enc, ptr, end, nextTokPtr); } return XML_TOK_PARTIAL; } case BT_GT: gt: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_START_TAG_NO_ATTS; case BT_SOL: sol: ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; if (!CHAR_MATCHES(enc, ptr, '>')) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_EMPTY_ELEMENT_NO_ATTS; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return XML_TOK_PARTIAL; } static int PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { if (ptr == end) return XML_TOK_NONE; if (MINBPC(enc) > 1) { size_t n = end - ptr; if (n & (MINBPC(enc) - 1)) { n &= ~(MINBPC(enc) - 1); if (n == 0) return XML_TOK_PARTIAL; end = ptr + n; } } switch (BYTE_TYPE(enc, ptr)) { case BT_LT: return PREFIX(scanLt)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_AMP: return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_CR: ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_CR; if (BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); *nextTokPtr = ptr; return XML_TOK_DATA_NEWLINE; case BT_LF: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DATA_NEWLINE; case BT_RSQB: ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_RSQB; if (!CHAR_MATCHES(enc, ptr, ']')) break; ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_RSQB; if (!CHAR_MATCHES(enc, ptr, '>')) { ptr -= MINBPC(enc); break; } *nextTokPtr = ptr; return XML_TOK_INVALID; INVALID_CASES(ptr, nextTokPtr) default: ptr += MINBPC(enc); break; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ *nextTokPtr = ptr; \ return XML_TOK_DATA_CHARS; \ } \ ptr += n; \ break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_RSQB: if (ptr + MINBPC(enc) != end) { if (!CHAR_MATCHES(enc, ptr + MINBPC(enc), ']')) { ptr += MINBPC(enc); break; } if (ptr + 2*MINBPC(enc) != end) { if (!CHAR_MATCHES(enc, ptr + 2*MINBPC(enc), '>')) { ptr += MINBPC(enc); break; } *nextTokPtr = ptr + 2*MINBPC(enc); return XML_TOK_INVALID; } } /* fall through */ case BT_AMP: case BT_LT: case BT_NONXML: case BT_MALFORM: case BT_TRAIL: case BT_CR: case BT_LF: *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; default: ptr += MINBPC(enc); break; } } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; } /* ptr points to character following "%" */ static int PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { if (ptr == end) return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: *nextTokPtr = ptr; return XML_TOK_PERCENT; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) case BT_SEMI: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_PARAM_ENTITY_REF; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return XML_TOK_PARTIAL; } static int PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { if (ptr == end) return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) default: *nextTokPtr = ptr; return XML_TOK_INVALID; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) case BT_CR: case BT_LF: case BT_S: case BT_RPAR: case BT_GT: case BT_PERCNT: case BT_VERBAR: *nextTokPtr = ptr; return XML_TOK_POUND_NAME; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return -XML_TOK_POUND_NAME; } static int PREFIX(scanLit)(int open, const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { while (ptr != end) { int t = BYTE_TYPE(enc, ptr); switch (t) { INVALID_CASES(ptr, nextTokPtr) case BT_QUOT: case BT_APOS: ptr += MINBPC(enc); if (t != open) break; if (ptr == end) return -XML_TOK_LITERAL; *nextTokPtr = ptr; switch (BYTE_TYPE(enc, ptr)) { case BT_S: case BT_CR: case BT_LF: case BT_GT: case BT_PERCNT: case BT_LSQB: return XML_TOK_LITERAL; default: return XML_TOK_INVALID; } default: ptr += MINBPC(enc); break; } } return XML_TOK_PARTIAL; } static int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { int tok; if (ptr == end) return XML_TOK_NONE; if (MINBPC(enc) > 1) { size_t n = end - ptr; if (n & (MINBPC(enc) - 1)) { n &= ~(MINBPC(enc) - 1); if (n == 0) return XML_TOK_PARTIAL; end = ptr + n; } } switch (BYTE_TYPE(enc, ptr)) { case BT_QUOT: return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_APOS: return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_LT: { ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { case BT_EXCL: return PREFIX(scanDecl)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_QUEST: return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_NMSTRT: case BT_HEX: case BT_NONASCII: case BT_LEAD2: case BT_LEAD3: case BT_LEAD4: *nextTokPtr = ptr - MINBPC(enc); return XML_TOK_INSTANCE_START; } *nextTokPtr = ptr; return XML_TOK_INVALID; } case BT_CR: if (ptr + MINBPC(enc) == end) return -XML_TOK_PROLOG_S; /* fall through */ case BT_S: case BT_LF: for (;;) { ptr += MINBPC(enc); if (ptr == end) break; switch (BYTE_TYPE(enc, ptr)) { case BT_S: case BT_LF: break; case BT_CR: /* don't split CR/LF pair */ if (ptr + MINBPC(enc) != end) break; /* fall through */ default: *nextTokPtr = ptr; return XML_TOK_PROLOG_S; } } *nextTokPtr = ptr; return XML_TOK_PROLOG_S; case BT_PERCNT: return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); case BT_COMMA: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_COMMA; case BT_LSQB: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_OPEN_BRACKET; case BT_RSQB: ptr += MINBPC(enc); if (ptr == end) return -XML_TOK_CLOSE_BRACKET; if (CHAR_MATCHES(enc, ptr, ']')) { if (ptr + MINBPC(enc) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr + MINBPC(enc), '>')) { *nextTokPtr = ptr + 2*MINBPC(enc); return XML_TOK_COND_SECT_CLOSE; } } *nextTokPtr = ptr; return XML_TOK_CLOSE_BRACKET; case BT_LPAR: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_OPEN_PAREN; case BT_RPAR: ptr += MINBPC(enc); if (ptr == end) return -XML_TOK_CLOSE_PAREN; switch (BYTE_TYPE(enc, ptr)) { case BT_AST: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_CLOSE_PAREN_ASTERISK; case BT_QUEST: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_CLOSE_PAREN_QUESTION; case BT_PLUS: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_CLOSE_PAREN_PLUS; case BT_CR: case BT_LF: case BT_S: case BT_GT: case BT_COMMA: case BT_VERBAR: case BT_RPAR: *nextTokPtr = ptr; return XML_TOK_CLOSE_PAREN; } *nextTokPtr = ptr; return XML_TOK_INVALID; case BT_VERBAR: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_OR; case BT_GT: *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DECL_CLOSE; case BT_NUM: return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr); #define LEAD_CASE(n) \ case BT_LEAD ## n: \ if (end - ptr < n) \ return XML_TOK_PARTIAL_CHAR; \ if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ ptr += n; \ tok = XML_TOK_NAME; \ break; \ } \ if (IS_NAME_CHAR(enc, ptr, n)) { \ ptr += n; \ tok = XML_TOK_NMTOKEN; \ break; \ } \ *nextTokPtr = ptr; \ return XML_TOK_INVALID; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_NMSTRT: case BT_HEX: tok = XML_TOK_NAME; ptr += MINBPC(enc); break; case BT_DIGIT: case BT_NAME: case BT_MINUS: #ifdef XML_NS case BT_COLON: #endif tok = XML_TOK_NMTOKEN; ptr += MINBPC(enc); break; case BT_NONASCII: if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { ptr += MINBPC(enc); tok = XML_TOK_NAME; break; } if (IS_NAME_CHAR_MINBPC(enc, ptr)) { ptr += MINBPC(enc); tok = XML_TOK_NMTOKEN; break; } /* fall through */ default: *nextTokPtr = ptr; return XML_TOK_INVALID; } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) case BT_GT: case BT_RPAR: case BT_COMMA: case BT_VERBAR: case BT_LSQB: case BT_PERCNT: case BT_S: case BT_CR: case BT_LF: *nextTokPtr = ptr; return tok; #ifdef XML_NS case BT_COLON: ptr += MINBPC(enc); switch (tok) { case XML_TOK_NAME: if (ptr == end) return XML_TOK_PARTIAL; tok = XML_TOK_PREFIXED_NAME; switch (BYTE_TYPE(enc, ptr)) { CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) default: tok = XML_TOK_NMTOKEN; break; } break; case XML_TOK_PREFIXED_NAME: tok = XML_TOK_NMTOKEN; break; } break; #endif case BT_PLUS: if (tok == XML_TOK_NMTOKEN) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_NAME_PLUS; case BT_AST: if (tok == XML_TOK_NMTOKEN) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_NAME_ASTERISK; case BT_QUEST: if (tok == XML_TOK_NMTOKEN) { *nextTokPtr = ptr; return XML_TOK_INVALID; } *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_NAME_QUESTION; default: *nextTokPtr = ptr; return XML_TOK_INVALID; } } return -tok; } static int PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { const char *start; if (ptr == end) return XML_TOK_NONE; start = ptr; while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: ptr += n; break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_AMP: if (ptr == start) return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_LT: /* this is for inside entity references */ *nextTokPtr = ptr; return XML_TOK_INVALID; case BT_LF: if (ptr == start) { *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DATA_NEWLINE; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_CR: if (ptr == start) { ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_CR; if (BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); *nextTokPtr = ptr; return XML_TOK_DATA_NEWLINE; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_S: if (ptr == start) { *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_ATTRIBUTE_VALUE_S; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; default: ptr += MINBPC(enc); break; } } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; } static int PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { const char *start; if (ptr == end) return XML_TOK_NONE; start = ptr; while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: ptr += n; break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_AMP: if (ptr == start) return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_PERCNT: if (ptr == start) return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_LF: if (ptr == start) { *nextTokPtr = ptr + MINBPC(enc); return XML_TOK_DATA_NEWLINE; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; case BT_CR: if (ptr == start) { ptr += MINBPC(enc); if (ptr == end) return XML_TOK_TRAILING_CR; if (BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); *nextTokPtr = ptr; return XML_TOK_DATA_NEWLINE; } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; default: ptr += MINBPC(enc); break; } } *nextTokPtr = ptr; return XML_TOK_DATA_CHARS; } #ifdef XML_DTD static int PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { int level = 0; if (MINBPC(enc) > 1) { size_t n = end - ptr; if (n & (MINBPC(enc) - 1)) { n &= ~(MINBPC(enc) - 1); end = ptr + n; } } while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { INVALID_CASES(ptr, nextTokPtr) case BT_LT: if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, '!')) { if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, '[')) { ++level; ptr += MINBPC(enc); } } break; case BT_RSQB: if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, ']')) { if ((ptr += MINBPC(enc)) == end) return XML_TOK_PARTIAL; if (CHAR_MATCHES(enc, ptr, '>')) { ptr += MINBPC(enc); if (level == 0) { *nextTokPtr = ptr; return XML_TOK_IGNORE_SECT; } --level; } } break; default: ptr += MINBPC(enc); break; } } return XML_TOK_PARTIAL; } #endif /* XML_DTD */ static int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, const char **badPtr) { ptr += MINBPC(enc); end -= MINBPC(enc); for (; ptr != end; ptr += MINBPC(enc)) { switch (BYTE_TYPE(enc, ptr)) { case BT_DIGIT: case BT_HEX: case BT_MINUS: case BT_APOS: case BT_LPAR: case BT_RPAR: case BT_PLUS: case BT_COMMA: case BT_SOL: case BT_EQUALS: case BT_QUEST: case BT_CR: case BT_LF: case BT_SEMI: case BT_EXCL: case BT_AST: case BT_PERCNT: case BT_NUM: #ifdef XML_NS case BT_COLON: #endif break; case BT_S: if (CHAR_MATCHES(enc, ptr, '\t')) { *badPtr = ptr; return 0; } break; case BT_NAME: case BT_NMSTRT: if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f)) break; default: switch (BYTE_TO_ASCII(enc, ptr)) { case 0x24: /* $ */ case 0x40: /* @ */ break; default: *badPtr = ptr; return 0; } break; } } return 1; } /* This must only be called for a well-formed start-tag or empty element tag. Returns the number of attributes. Pointers to the first attsMax attributes are stored in atts. */ static int PREFIX(getAtts)(const ENCODING *enc, const char *ptr, int attsMax, ATTRIBUTE *atts) { enum { other, inName, inValue } state = inName; int nAtts = 0; int open = 0; /* defined when state == inValue; initialization just to shut up compilers */ for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) { switch (BYTE_TYPE(enc, ptr)) { #define START_NAME \ if (state == other) { \ if (nAtts < attsMax) { \ atts[nAtts].name = ptr; \ atts[nAtts].normalized = 1; \ } \ state = inName; \ } #define LEAD_CASE(n) \ case BT_LEAD ## n: START_NAME ptr += (n - MINBPC(enc)); break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_NONASCII: case BT_NMSTRT: case BT_HEX: START_NAME break; #undef START_NAME case BT_QUOT: if (state != inValue) { if (nAtts < attsMax) atts[nAtts].valuePtr = ptr + MINBPC(enc); state = inValue; open = BT_QUOT; } else if (open == BT_QUOT) { state = other; if (nAtts < attsMax) atts[nAtts].valueEnd = ptr; nAtts++; } break; case BT_APOS: if (state != inValue) { if (nAtts < attsMax) atts[nAtts].valuePtr = ptr + MINBPC(enc); state = inValue; open = BT_APOS; } else if (open == BT_APOS) { state = other; if (nAtts < attsMax) atts[nAtts].valueEnd = ptr; nAtts++; } break; case BT_AMP: if (nAtts < attsMax) atts[nAtts].normalized = 0; break; case BT_S: if (state == inName) state = other; else if (state == inValue && nAtts < attsMax && atts[nAtts].normalized && (ptr == atts[nAtts].valuePtr || BYTE_TO_ASCII(enc, ptr) != ' ' || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ' ' || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open)) atts[nAtts].normalized = 0; break; case BT_CR: case BT_LF: /* This case ensures that the first attribute name is counted Apart from that we could just change state on the quote. */ if (state == inName) state = other; else if (state == inValue && nAtts < attsMax) atts[nAtts].normalized = 0; break; case BT_GT: case BT_SOL: if (state != inValue) return nAtts; break; default: break; } } /* not reached */ } static int PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) { int result = 0; /* skip &# */ ptr += 2*MINBPC(enc); if (CHAR_MATCHES(enc, ptr, 'x')) { for (ptr += MINBPC(enc); !CHAR_MATCHES(enc, ptr, ';'); ptr += MINBPC(enc)) { int c = BYTE_TO_ASCII(enc, ptr); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': result <<= 4; result |= (c - '0'); break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': result <<= 4; result += 10 + (c - 'A'); break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': result <<= 4; result += 10 + (c - 'a'); break; } if (result >= 0x110000) return -1; } } else { for (; !CHAR_MATCHES(enc, ptr, ';'); ptr += MINBPC(enc)) { int c = BYTE_TO_ASCII(enc, ptr); result *= 10; result += (c - '0'); if (result >= 0x110000) return -1; } } return checkCharRefNumber(result); } static int PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end) { switch ((end - ptr)/MINBPC(enc)) { case 2: if (CHAR_MATCHES(enc, ptr + MINBPC(enc), 't')) { switch (BYTE_TO_ASCII(enc, ptr)) { case 'l': return '<'; case 'g': return '>'; } } break; case 3: if (CHAR_MATCHES(enc, ptr, 'a')) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, 'm')) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, 'p')) return '&'; } } break; case 4: switch (BYTE_TO_ASCII(enc, ptr)) { case 'q': ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, 'u')) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, 'o')) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, 't')) return '"'; } } break; case 'a': ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, 'p')) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, 'o')) { ptr += MINBPC(enc); if (CHAR_MATCHES(enc, ptr, 's')) return '\''; } } break; } } return 0; } static int PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2) { for (;;) { switch (BYTE_TYPE(enc, ptr1)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ if (*ptr1++ != *ptr2++) \ return 0; LEAD_CASE(4) LEAD_CASE(3) LEAD_CASE(2) #undef LEAD_CASE /* fall through */ if (*ptr1++ != *ptr2++) return 0; break; case BT_NONASCII: case BT_NMSTRT: #ifdef XML_NS case BT_COLON: #endif case BT_HEX: case BT_DIGIT: case BT_NAME: case BT_MINUS: if (*ptr2++ != *ptr1++) return 0; if (MINBPC(enc) > 1) { if (*ptr2++ != *ptr1++) return 0; if (MINBPC(enc) > 2) { if (*ptr2++ != *ptr1++) return 0; if (MINBPC(enc) > 3) { if (*ptr2++ != *ptr1++) return 0; } } } break; default: if (MINBPC(enc) == 1 && *ptr1 == *ptr2) return 1; switch (BYTE_TYPE(enc, ptr2)) { case BT_LEAD2: case BT_LEAD3: case BT_LEAD4: case BT_NONASCII: case BT_NMSTRT: #ifdef XML_NS case BT_COLON: #endif case BT_HEX: case BT_DIGIT: case BT_NAME: case BT_MINUS: return 0; default: return 1; } } } /* not reached */ } static int PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1, const char *end1, const char *ptr2) { for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) { if (ptr1 == end1) return 0; if (!CHAR_MATCHES(enc, ptr1, *ptr2)) return 0; } return ptr1 == end1; } static int PREFIX(nameLength)(const ENCODING *enc, const char *ptr) { const char *start = ptr; for (;;) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: ptr += n; break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_NONASCII: case BT_NMSTRT: #ifdef XML_NS case BT_COLON: #endif case BT_HEX: case BT_DIGIT: case BT_NAME: case BT_MINUS: ptr += MINBPC(enc); break; default: return ptr - start; } } } static const char *PREFIX(skipS)(const ENCODING *enc, const char *ptr) { for (;;) { switch (BYTE_TYPE(enc, ptr)) { case BT_LF: case BT_CR: case BT_S: ptr += MINBPC(enc); break; default: return ptr; } } } static void PREFIX(updatePosition)(const ENCODING *enc, const char *ptr, const char *end, POSITION *pos) { while (ptr != end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ ptr += n; \ break; LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) #undef LEAD_CASE case BT_LF: pos->columnNumber = (unsigned)-1; pos->lineNumber++; ptr += MINBPC(enc); break; case BT_CR: pos->lineNumber++; ptr += MINBPC(enc); if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF) ptr += MINBPC(enc); pos->columnNumber = (unsigned)-1; break; default: ptr += MINBPC(enc); break; } pos->columnNumber++; } } #undef DO_LEAD_CASE #undef MULTIBYTE_CASES #undef INVALID_CASES #undef CHECK_NAME_CASE #undef CHECK_NAME_CASES #undef CHECK_NMSTRT_CASE #undef CHECK_NMSTRT_CASES sitecopy-0.16.6/lib/expat/xmltok/iasciitab.h0000664000076400007640000000461710132320456017103 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, sitecopy-0.16.6/lib/expat/xmltok/asciitab.h0000664000076400007640000000451110132320456016723 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, sitecopy-0.16.6/lib/expat/xmltok/xmltok.h0000664000076400007640000002464210132320456016471 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef XmlTok_INCLUDED #define XmlTok_INCLUDED 1 #ifdef __cplusplus extern "C" { #endif #ifndef XMLTOKAPI #define XMLTOKAPI /* as nothing */ #endif /* The following token may be returned by XmlContentTok */ #define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be start of illegal ]]> sequence */ /* The following tokens may be returned by both XmlPrologTok and XmlContentTok */ #define XML_TOK_NONE -4 /* The string to be scanned is empty */ #define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; might be part of CRLF sequence */ #define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ #define XML_TOK_PARTIAL -1 /* only part of a token */ #define XML_TOK_INVALID 0 /* The following tokens are returned by XmlContentTok; some are also returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok */ #define XML_TOK_START_TAG_WITH_ATTS 1 #define XML_TOK_START_TAG_NO_ATTS 2 #define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag */ #define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4 #define XML_TOK_END_TAG 5 #define XML_TOK_DATA_CHARS 6 #define XML_TOK_DATA_NEWLINE 7 #define XML_TOK_CDATA_SECT_OPEN 8 #define XML_TOK_ENTITY_REF 9 #define XML_TOK_CHAR_REF 10 /* numeric character reference */ /* The following tokens may be returned by both XmlPrologTok and XmlContentTok */ #define XML_TOK_PI 11 /* processing instruction */ #define XML_TOK_XML_DECL 12 /* XML decl or text decl */ #define XML_TOK_COMMENT 13 #define XML_TOK_BOM 14 /* Byte order mark */ /* The following tokens are returned only by XmlPrologTok */ #define XML_TOK_PROLOG_S 15 #define XML_TOK_DECL_OPEN 16 /* */ #define XML_TOK_NAME 18 #define XML_TOK_NMTOKEN 19 #define XML_TOK_POUND_NAME 20 /* #name */ #define XML_TOK_OR 21 /* | */ #define XML_TOK_PERCENT 22 #define XML_TOK_OPEN_PAREN 23 #define XML_TOK_CLOSE_PAREN 24 #define XML_TOK_OPEN_BRACKET 25 #define XML_TOK_CLOSE_BRACKET 26 #define XML_TOK_LITERAL 27 #define XML_TOK_PARAM_ENTITY_REF 28 #define XML_TOK_INSTANCE_START 29 /* The following occur only in element type declarations */ #define XML_TOK_NAME_QUESTION 30 /* name? */ #define XML_TOK_NAME_ASTERISK 31 /* name* */ #define XML_TOK_NAME_PLUS 32 /* name+ */ #define XML_TOK_COND_SECT_OPEN 33 /* */ #define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ #define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ #define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ #define XML_TOK_COMMA 38 /* The following token is returned only by XmlAttributeValueTok */ #define XML_TOK_ATTRIBUTE_VALUE_S 39 /* The following token is returned only by XmlCdataSectionTok */ #define XML_TOK_CDATA_SECT_CLOSE 40 /* With namespace processing this is returned by XmlPrologTok for a name with a colon. */ #define XML_TOK_PREFIXED_NAME 41 #ifdef XML_DTD #define XML_TOK_IGNORE_SECT 42 #endif /* XML_DTD */ #ifdef XML_DTD #define XML_N_STATES 4 #else /* not XML_DTD */ #define XML_N_STATES 3 #endif /* not XML_DTD */ #define XML_PROLOG_STATE 0 #define XML_CONTENT_STATE 1 #define XML_CDATA_SECTION_STATE 2 #ifdef XML_DTD #define XML_IGNORE_SECTION_STATE 3 #endif /* XML_DTD */ #define XML_N_LITERAL_TYPES 2 #define XML_ATTRIBUTE_VALUE_LITERAL 0 #define XML_ENTITY_VALUE_LITERAL 1 /* The size of the buffer passed to XmlUtf8Encode must be at least this. */ #define XML_UTF8_ENCODE_MAX 4 /* The size of the buffer passed to XmlUtf16Encode must be at least this. */ #define XML_UTF16_ENCODE_MAX 2 typedef struct position { /* first line and first column are 0 not 1 */ unsigned long lineNumber; unsigned long columnNumber; } POSITION; typedef struct { const char *name; const char *valuePtr; const char *valueEnd; char normalized; } ATTRIBUTE; struct encoding; typedef struct encoding ENCODING; struct encoding { int (*scanners[XML_N_STATES])(const ENCODING *, const char *, const char *, const char **); int (*literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *, const char *, const char *, const char **); int (*sameName)(const ENCODING *, const char *, const char *); int (*nameMatchesAscii)(const ENCODING *, const char *, const char *, const char *); int (*nameLength)(const ENCODING *, const char *); const char *(*skipS)(const ENCODING *, const char *); int (*getAtts)(const ENCODING *enc, const char *ptr, int attsMax, ATTRIBUTE *atts); int (*charRefNumber)(const ENCODING *enc, const char *ptr); int (*predefinedEntityName)(const ENCODING *, const char *, const char *); void (*updatePosition)(const ENCODING *, const char *ptr, const char *end, POSITION *); int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end, const char **badPtr); void (*utf8Convert)(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim); void (*utf16Convert)(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim); int minBytesPerChar; char isUtf8; char isUtf16; }; /* Scan the string starting at ptr until the end of the next complete token, but do not scan past eptr. Return an integer giving the type of token. Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set. Return XML_TOK_PARTIAL when the string does not contain a complete token; nextTokPtr will not be set. Return XML_TOK_INVALID when the string does not start a valid token; nextTokPtr will be set to point to the character which made the token invalid. Otherwise the string starts with a valid token; nextTokPtr will be set to point to the character following the end of that token. Each data character counts as a single token, but adjacent data characters may be returned together. Similarly for characters in the prolog outside literals, comments and processing instructions. */ #define XmlTok(enc, state, ptr, end, nextTokPtr) \ (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) #define XmlPrologTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) #define XmlContentTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) #define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) #ifdef XML_DTD #define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr) #endif /* XML_DTD */ /* This is used for performing a 2nd-level tokenization on the content of a literal that has already been returned by XmlTok. */ #define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) #define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) #define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) #define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2)) #define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \ (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2)) #define XmlNameLength(enc, ptr) \ (((enc)->nameLength)(enc, ptr)) #define XmlSkipS(enc, ptr) \ (((enc)->skipS)(enc, ptr)) #define XmlGetAttributes(enc, ptr, attsMax, atts) \ (((enc)->getAtts)(enc, ptr, attsMax, atts)) #define XmlCharRefNumber(enc, ptr) \ (((enc)->charRefNumber)(enc, ptr)) #define XmlPredefinedEntityName(enc, ptr, end) \ (((enc)->predefinedEntityName)(enc, ptr, end)) #define XmlUpdatePosition(enc, ptr, end, pos) \ (((enc)->updatePosition)(enc, ptr, end, pos)) #define XmlIsPublicId(enc, ptr, end, badPtr) \ (((enc)->isPublicId)(enc, ptr, end, badPtr)) #define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) #define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) typedef struct { ENCODING initEnc; const ENCODING **encPtr; } INIT_ENCODING; int XMLTOKAPI XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr); int XMLTOKAPI XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); const ENCODING XMLTOKAPI *XmlGetUtf8InternalEncoding(void); const ENCODING XMLTOKAPI *XmlGetUtf16InternalEncoding(void); int XMLTOKAPI XmlUtf8Encode(int charNumber, char *buf); int XMLTOKAPI XmlUtf16Encode(int charNumber, unsigned short *buf); int XMLTOKAPI XmlSizeOfUnknownEncoding(void); ENCODING XMLTOKAPI * XmlInitUnknownEncoding(void *mem, int *table, int (*conv)(void *userData, const char *p), void *userData); int XMLTOKAPI XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr); int XMLTOKAPI XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); const ENCODING XMLTOKAPI *XmlGetUtf8InternalEncodingNS(void); const ENCODING XMLTOKAPI *XmlGetUtf16InternalEncodingNS(void); ENCODING XMLTOKAPI * XmlInitUnknownEncodingNS(void *mem, int *table, int (*conv)(void *userData, const char *p), void *userData); #ifdef __cplusplus } #endif #endif /* not XmlTok_INCLUDED */ sitecopy-0.16.6/lib/expat/xmltok/nametab.h0000664000076400007640000001561210132320456016557 0ustar joejoestatic const unsigned namingBitmap[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE, 0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF, 0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF, 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, 0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, 0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000, 0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060, 0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, 0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003, 0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000, 0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, 0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003, 0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000, 0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, 0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003, 0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000, 0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, 0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB, 0x40000000, 0xF580C900, 0x00000007, 0x02010800, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, 0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, 0x00000000, 0x00004C40, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, 0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF, 0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE, 0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, 0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, 0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF, 0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, 0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF, 0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF, 0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, 0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0, 0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1, 0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, 0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80, 0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3, 0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, 0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, 0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000, 0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF, 0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x1FFF0000, 0x00000002, 0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, 0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF, }; static const unsigned char nmstrtPages[] = { 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; static const unsigned char namePages[] = { 0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, 0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; sitecopy-0.16.6/lib/expat/xmltok/xmltok_impl.h0000664000076400007640000000240110132320456017477 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ enum { BT_NONXML, BT_MALFORM, BT_LT, BT_AMP, BT_RSQB, BT_LEAD2, BT_LEAD3, BT_LEAD4, BT_TRAIL, BT_CR, BT_LF, BT_GT, BT_QUOT, BT_APOS, BT_EQUALS, BT_QUEST, BT_EXCL, BT_SOL, BT_SEMI, BT_NUM, BT_LSQB, BT_S, BT_NMSTRT, BT_COLON, BT_HEX, BT_DIGIT, BT_NAME, BT_MINUS, BT_OTHER, /* known not to be a name or name start character */ BT_NONASCII, /* might be a name or name start character */ BT_PERCNT, BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, BT_COMMA, BT_VERBAR }; #include sitecopy-0.16.6/lib/expat/xmltok/xmlrole.c0000664000076400007640000006426410132320456016634 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "xmldef.h" #include "xmlrole.h" /* Doesn't check: that ,| are not mixed in a model group content of literals */ #ifndef MIN_BYTES_PER_CHAR #define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar) #endif #ifdef XML_DTD #define setTopLevel(state) \ ((state)->handler = ((state)->documentEntity \ ? internalSubset \ : externalSubset1)) #else /* not XML_DTD */ #define setTopLevel(state) ((state)->handler = internalSubset) #endif /* not XML_DTD */ typedef int PROLOG_HANDLER(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc); static PROLOG_HANDLER prolog0, prolog1, prolog2, doctype0, doctype1, doctype2, doctype3, doctype4, doctype5, internalSubset, entity0, entity1, entity2, entity3, entity4, entity5, entity6, entity7, entity8, entity9, notation0, notation1, notation2, notation3, notation4, attlist0, attlist1, attlist2, attlist3, attlist4, attlist5, attlist6, attlist7, attlist8, attlist9, element0, element1, element2, element3, element4, element5, element6, element7, #ifdef XML_DTD externalSubset0, externalSubset1, condSect0, condSect1, condSect2, #endif /* XML_DTD */ declClose, error; static int common(PROLOG_STATE *state, int tok); static int prolog0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: state->handler = prolog1; return XML_ROLE_NONE; case XML_TOK_XML_DECL: state->handler = prolog1; return XML_ROLE_XML_DECL; case XML_TOK_PI: state->handler = prolog1; return XML_ROLE_NONE; case XML_TOK_COMMENT: state->handler = prolog1; case XML_TOK_BOM: return XML_ROLE_NONE; case XML_TOK_DECL_OPEN: if (!XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, "DOCTYPE")) break; state->handler = doctype0; return XML_ROLE_NONE; case XML_TOK_INSTANCE_START: state->handler = error; return XML_ROLE_INSTANCE_START; } return common(state, tok); } static int prolog1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_PI: case XML_TOK_COMMENT: case XML_TOK_BOM: return XML_ROLE_NONE; case XML_TOK_DECL_OPEN: if (!XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, "DOCTYPE")) break; state->handler = doctype0; return XML_ROLE_NONE; case XML_TOK_INSTANCE_START: state->handler = error; return XML_ROLE_INSTANCE_START; } return common(state, tok); } static int prolog2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_PI: case XML_TOK_COMMENT: return XML_ROLE_NONE; case XML_TOK_INSTANCE_START: state->handler = error; return XML_ROLE_INSTANCE_START; } return common(state, tok); } static int doctype0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = doctype1; return XML_ROLE_DOCTYPE_NAME; } return common(state, tok); } static int doctype1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_OPEN_BRACKET: state->handler = internalSubset; return XML_ROLE_NONE; case XML_TOK_DECL_CLOSE: state->handler = prolog2; return XML_ROLE_DOCTYPE_CLOSE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, "SYSTEM")) { state->handler = doctype3; return XML_ROLE_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, "PUBLIC")) { state->handler = doctype2; return XML_ROLE_NONE; } break; } return common(state, tok); } static int doctype2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = doctype3; return XML_ROLE_DOCTYPE_PUBLIC_ID; } return common(state, tok); } static int doctype3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = doctype4; return XML_ROLE_DOCTYPE_SYSTEM_ID; } return common(state, tok); } static int doctype4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_OPEN_BRACKET: state->handler = internalSubset; return XML_ROLE_NONE; case XML_TOK_DECL_CLOSE: state->handler = prolog2; return XML_ROLE_DOCTYPE_CLOSE; } return common(state, tok); } static int doctype5(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_DECL_CLOSE: state->handler = prolog2; return XML_ROLE_DOCTYPE_CLOSE; } return common(state, tok); } static int internalSubset(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_DECL_OPEN: if (XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, "ENTITY")) { state->handler = entity0; return XML_ROLE_NONE; } if (XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, "ATTLIST")) { state->handler = attlist0; return XML_ROLE_NONE; } if (XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, "ELEMENT")) { state->handler = element0; return XML_ROLE_NONE; } if (XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc), end, "NOTATION")) { state->handler = notation0; return XML_ROLE_NONE; } break; case XML_TOK_PI: case XML_TOK_COMMENT: return XML_ROLE_NONE; case XML_TOK_PARAM_ENTITY_REF: return XML_ROLE_PARAM_ENTITY_REF; case XML_TOK_CLOSE_BRACKET: state->handler = doctype5; return XML_ROLE_NONE; } return common(state, tok); } #ifdef XML_DTD static int externalSubset0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { state->handler = externalSubset1; if (tok == XML_TOK_XML_DECL) return XML_ROLE_TEXT_DECL; return externalSubset1(state, tok, ptr, end, enc); } static int externalSubset1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_COND_SECT_OPEN: state->handler = condSect0; return XML_ROLE_NONE; case XML_TOK_COND_SECT_CLOSE: if (state->includeLevel == 0) break; state->includeLevel -= 1; return XML_ROLE_NONE; case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_CLOSE_BRACKET: break; case XML_TOK_NONE: if (state->includeLevel) break; return XML_ROLE_NONE; default: return internalSubset(state, tok, ptr, end, enc); } return common(state, tok); } #endif /* XML_DTD */ static int entity0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_PERCENT: state->handler = entity1; return XML_ROLE_NONE; case XML_TOK_NAME: state->handler = entity2; return XML_ROLE_GENERAL_ENTITY_NAME; } return common(state, tok); } static int entity1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: state->handler = entity7; return XML_ROLE_PARAM_ENTITY_NAME; } return common(state, tok); } static int entity2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, "SYSTEM")) { state->handler = entity4; return XML_ROLE_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, "PUBLIC")) { state->handler = entity3; return XML_ROLE_NONE; } break; case XML_TOK_LITERAL: state->handler = declClose; return XML_ROLE_ENTITY_VALUE; } return common(state, tok); } static int entity3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = entity4; return XML_ROLE_ENTITY_PUBLIC_ID; } return common(state, tok); } static int entity4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = entity5; return XML_ROLE_ENTITY_SYSTEM_ID; } return common(state, tok); } static int entity5(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_DECL_CLOSE: setTopLevel(state); return XML_ROLE_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, "NDATA")) { state->handler = entity6; return XML_ROLE_NONE; } break; } return common(state, tok); } static int entity6(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: state->handler = declClose; return XML_ROLE_ENTITY_NOTATION_NAME; } return common(state, tok); } static int entity7(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, "SYSTEM")) { state->handler = entity9; return XML_ROLE_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, "PUBLIC")) { state->handler = entity8; return XML_ROLE_NONE; } break; case XML_TOK_LITERAL: state->handler = declClose; return XML_ROLE_ENTITY_VALUE; } return common(state, tok); } static int entity8(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = entity9; return XML_ROLE_ENTITY_PUBLIC_ID; } return common(state, tok); } static int entity9(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = declClose; return XML_ROLE_ENTITY_SYSTEM_ID; } return common(state, tok); } static int notation0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: state->handler = notation1; return XML_ROLE_NOTATION_NAME; } return common(state, tok); } static int notation1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, "SYSTEM")) { state->handler = notation3; return XML_ROLE_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, "PUBLIC")) { state->handler = notation2; return XML_ROLE_NONE; } break; } return common(state, tok); } static int notation2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = notation4; return XML_ROLE_NOTATION_PUBLIC_ID; } return common(state, tok); } static int notation3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = declClose; return XML_ROLE_NOTATION_SYSTEM_ID; } return common(state, tok); } static int notation4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = declClose; return XML_ROLE_NOTATION_SYSTEM_ID; case XML_TOK_DECL_CLOSE: setTopLevel(state); return XML_ROLE_NOTATION_NO_SYSTEM_ID; } return common(state, tok); } static int attlist0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = attlist1; return XML_ROLE_ATTLIST_ELEMENT_NAME; } return common(state, tok); } static int attlist1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_DECL_CLOSE: setTopLevel(state); return XML_ROLE_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = attlist2; return XML_ROLE_ATTRIBUTE_NAME; } return common(state, tok); } static int attlist2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: { static const char *types[] = { "CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS", }; int i; for (i = 0; i < (int)(sizeof(types)/sizeof(types[0])); i++) if (XmlNameMatchesAscii(enc, ptr, end, types[i])) { state->handler = attlist8; return XML_ROLE_ATTRIBUTE_TYPE_CDATA + i; } } if (XmlNameMatchesAscii(enc, ptr, end, "NOTATION")) { state->handler = attlist5; return XML_ROLE_NONE; } break; case XML_TOK_OPEN_PAREN: state->handler = attlist3; return XML_ROLE_NONE; } return common(state, tok); } static int attlist3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NMTOKEN: case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = attlist4; return XML_ROLE_ATTRIBUTE_ENUM_VALUE; } return common(state, tok); } static int attlist4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_CLOSE_PAREN: state->handler = attlist8; return XML_ROLE_NONE; case XML_TOK_OR: state->handler = attlist3; return XML_ROLE_NONE; } return common(state, tok); } static int attlist5(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_OPEN_PAREN: state->handler = attlist6; return XML_ROLE_NONE; } return common(state, tok); } static int attlist6(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: state->handler = attlist7; return XML_ROLE_ATTRIBUTE_NOTATION_VALUE; } return common(state, tok); } static int attlist7(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_CLOSE_PAREN: state->handler = attlist8; return XML_ROLE_NONE; case XML_TOK_OR: state->handler = attlist6; return XML_ROLE_NONE; } return common(state, tok); } /* default value */ static int attlist8(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_POUND_NAME: if (XmlNameMatchesAscii(enc, ptr + MIN_BYTES_PER_CHAR(enc), end, "IMPLIED")) { state->handler = attlist1; return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE; } if (XmlNameMatchesAscii(enc, ptr + MIN_BYTES_PER_CHAR(enc), end, "REQUIRED")) { state->handler = attlist1; return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE; } if (XmlNameMatchesAscii(enc, ptr + MIN_BYTES_PER_CHAR(enc), end, "FIXED")) { state->handler = attlist9; return XML_ROLE_NONE; } break; case XML_TOK_LITERAL: state->handler = attlist1; return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE; } return common(state, tok); } static int attlist9(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_LITERAL: state->handler = attlist1; return XML_ROLE_FIXED_ATTRIBUTE_VALUE; } return common(state, tok); } static int element0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = element1; return XML_ROLE_ELEMENT_NAME; } return common(state, tok); } static int element1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, "EMPTY")) { state->handler = declClose; return XML_ROLE_CONTENT_EMPTY; } if (XmlNameMatchesAscii(enc, ptr, end, "ANY")) { state->handler = declClose; return XML_ROLE_CONTENT_ANY; } break; case XML_TOK_OPEN_PAREN: state->handler = element2; state->level = 1; return XML_ROLE_GROUP_OPEN; } return common(state, tok); } static int element2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_POUND_NAME: if (XmlNameMatchesAscii(enc, ptr + MIN_BYTES_PER_CHAR(enc), end, "PCDATA")) { state->handler = element3; return XML_ROLE_CONTENT_PCDATA; } break; case XML_TOK_OPEN_PAREN: state->level = 2; state->handler = element6; return XML_ROLE_GROUP_OPEN; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT; case XML_TOK_NAME_QUESTION: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_OPT; case XML_TOK_NAME_ASTERISK: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_REP; case XML_TOK_NAME_PLUS: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_PLUS; } return common(state, tok); } static int element3(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_CLOSE_PAREN: case XML_TOK_CLOSE_PAREN_ASTERISK: state->handler = declClose; return XML_ROLE_GROUP_CLOSE_REP; case XML_TOK_OR: state->handler = element4; return XML_ROLE_NONE; } return common(state, tok); } static int element4(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = element5; return XML_ROLE_CONTENT_ELEMENT; } return common(state, tok); } static int element5(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_CLOSE_PAREN_ASTERISK: state->handler = declClose; return XML_ROLE_GROUP_CLOSE_REP; case XML_TOK_OR: state->handler = element4; return XML_ROLE_NONE; } return common(state, tok); } static int element6(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_OPEN_PAREN: state->level += 1; return XML_ROLE_GROUP_OPEN; case XML_TOK_NAME: case XML_TOK_PREFIXED_NAME: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT; case XML_TOK_NAME_QUESTION: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_OPT; case XML_TOK_NAME_ASTERISK: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_REP; case XML_TOK_NAME_PLUS: state->handler = element7; return XML_ROLE_CONTENT_ELEMENT_PLUS; } return common(state, tok); } static int element7(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_CLOSE_PAREN: state->level -= 1; if (state->level == 0) state->handler = declClose; return XML_ROLE_GROUP_CLOSE; case XML_TOK_CLOSE_PAREN_ASTERISK: state->level -= 1; if (state->level == 0) state->handler = declClose; return XML_ROLE_GROUP_CLOSE_REP; case XML_TOK_CLOSE_PAREN_QUESTION: state->level -= 1; if (state->level == 0) state->handler = declClose; return XML_ROLE_GROUP_CLOSE_OPT; case XML_TOK_CLOSE_PAREN_PLUS: state->level -= 1; if (state->level == 0) state->handler = declClose; return XML_ROLE_GROUP_CLOSE_PLUS; case XML_TOK_COMMA: state->handler = element6; return XML_ROLE_GROUP_SEQUENCE; case XML_TOK_OR: state->handler = element6; return XML_ROLE_GROUP_CHOICE; } return common(state, tok); } #ifdef XML_DTD static int condSect0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_NAME: if (XmlNameMatchesAscii(enc, ptr, end, "INCLUDE")) { state->handler = condSect1; return XML_ROLE_NONE; } if (XmlNameMatchesAscii(enc, ptr, end, "IGNORE")) { state->handler = condSect2; return XML_ROLE_NONE; } break; } return common(state, tok); } static int condSect1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_OPEN_BRACKET: state->handler = externalSubset1; state->includeLevel += 1; return XML_ROLE_NONE; } return common(state, tok); } static int condSect2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_OPEN_BRACKET: state->handler = externalSubset1; return XML_ROLE_IGNORE_SECT; } return common(state, tok); } #endif /* XML_DTD */ static int declClose(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_PROLOG_S: return XML_ROLE_NONE; case XML_TOK_DECL_CLOSE: setTopLevel(state); return XML_ROLE_NONE; } return common(state, tok); } #if 0 static int ignore(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { switch (tok) { case XML_TOK_DECL_CLOSE: state->handler = internalSubset; return 0; default: return XML_ROLE_NONE; } return common(state, tok); } #endif static int error(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc) { return XML_ROLE_NONE; } static int common(PROLOG_STATE *state, int tok) { #ifdef XML_DTD if (!state->documentEntity && tok == XML_TOK_PARAM_ENTITY_REF) return XML_ROLE_INNER_PARAM_ENTITY_REF; #endif state->handler = error; return XML_ROLE_ERROR; } void XmlPrologStateInit(PROLOG_STATE *state) { state->handler = prolog0; #ifdef XML_DTD state->documentEntity = 1; state->includeLevel = 0; #endif /* XML_DTD */ } #ifdef XML_DTD void XmlPrologStateInitExternalEntity(PROLOG_STATE *state) { state->handler = externalSubset0; state->documentEntity = 0; state->includeLevel = 0; } #endif /* XML_DTD */ sitecopy-0.16.6/lib/expat/xmltok/xmldef.h0000664000076400007640000000272410132320456016427 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #ifdef XML_WINLIB #define WIN32_LEAN_AND_MEAN #define STRICT #include #define malloc(x) HeapAlloc(GetProcessHeap(), 0, (x)) #define calloc(x, y) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (x)*(y)) #define free(x) HeapFree(GetProcessHeap(), 0, (x)) #define realloc(x, y) HeapReAlloc(GetProcessHeap(), 0, x, y) #define abort() /* as nothing */ #else /* not XML_WINLIB */ #include #endif /* not XML_WINLIB */ /* This file can be used for any definitions needed in particular environments. */ #ifdef MOZILLA #include "nspr.h" #define malloc(x) PR_Malloc(x) #define realloc(x, y) PR_Realloc((x), (y)) #define calloc(x, y) PR_Calloc((x),(y)) #define free(x) PR_Free(x) #define int int32 #endif /* MOZILLA */ sitecopy-0.16.6/lib/expat/xmltok/latin1tab.h0000664000076400007640000000457610132320456017036 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, sitecopy-0.16.6/lib/expat/xmltok/xmlrole.h0000664000076400007640000000575710132320456016643 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef XmlRole_INCLUDED #define XmlRole_INCLUDED 1 #include "xmltok.h" #ifdef __cplusplus extern "C" { #endif enum { XML_ROLE_ERROR = -1, XML_ROLE_NONE = 0, XML_ROLE_XML_DECL, XML_ROLE_INSTANCE_START, XML_ROLE_DOCTYPE_NAME, XML_ROLE_DOCTYPE_SYSTEM_ID, XML_ROLE_DOCTYPE_PUBLIC_ID, XML_ROLE_DOCTYPE_CLOSE, XML_ROLE_GENERAL_ENTITY_NAME, XML_ROLE_PARAM_ENTITY_NAME, XML_ROLE_ENTITY_VALUE, XML_ROLE_ENTITY_SYSTEM_ID, XML_ROLE_ENTITY_PUBLIC_ID, XML_ROLE_ENTITY_NOTATION_NAME, XML_ROLE_NOTATION_NAME, XML_ROLE_NOTATION_SYSTEM_ID, XML_ROLE_NOTATION_NO_SYSTEM_ID, XML_ROLE_NOTATION_PUBLIC_ID, XML_ROLE_ATTRIBUTE_NAME, XML_ROLE_ATTRIBUTE_TYPE_CDATA, XML_ROLE_ATTRIBUTE_TYPE_ID, XML_ROLE_ATTRIBUTE_TYPE_IDREF, XML_ROLE_ATTRIBUTE_TYPE_IDREFS, XML_ROLE_ATTRIBUTE_TYPE_ENTITY, XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, XML_ROLE_ATTRIBUTE_ENUM_VALUE, XML_ROLE_ATTRIBUTE_NOTATION_VALUE, XML_ROLE_ATTLIST_ELEMENT_NAME, XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, XML_ROLE_FIXED_ATTRIBUTE_VALUE, XML_ROLE_ELEMENT_NAME, XML_ROLE_CONTENT_ANY, XML_ROLE_CONTENT_EMPTY, XML_ROLE_CONTENT_PCDATA, XML_ROLE_GROUP_OPEN, XML_ROLE_GROUP_CLOSE, XML_ROLE_GROUP_CLOSE_REP, XML_ROLE_GROUP_CLOSE_OPT, XML_ROLE_GROUP_CLOSE_PLUS, XML_ROLE_GROUP_CHOICE, XML_ROLE_GROUP_SEQUENCE, XML_ROLE_CONTENT_ELEMENT, XML_ROLE_CONTENT_ELEMENT_REP, XML_ROLE_CONTENT_ELEMENT_OPT, XML_ROLE_CONTENT_ELEMENT_PLUS, #ifdef XML_DTD XML_ROLE_TEXT_DECL, XML_ROLE_IGNORE_SECT, XML_ROLE_INNER_PARAM_ENTITY_REF, #endif /* XML_DTD */ XML_ROLE_PARAM_ENTITY_REF }; typedef struct prolog_state { int (*handler)(struct prolog_state *state, int tok, const char *ptr, const char *end, const ENCODING *enc); unsigned level; #ifdef XML_DTD unsigned includeLevel; int documentEntity; #endif /* XML_DTD */ } PROLOG_STATE; void XMLTOKAPI XmlPrologStateInit(PROLOG_STATE *); #ifdef XML_DTD void XMLTOKAPI XmlPrologStateInitExternalEntity(PROLOG_STATE *); #endif /* XML_DTD */ #define XmlTokenRole(state, tok, ptr, end, enc) \ (((state)->handler)(state, tok, ptr, end, enc)) #ifdef __cplusplus } #endif #endif /* not XmlRole_INCLUDED */ sitecopy-0.16.6/lib/expat/xmltok/utf8tab.h0000664000076400007640000000451410132320456016524 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, sitecopy-0.16.6/lib/expat/xmltok/xmltok_ns.c0000664000076400007640000000456210132320456017163 0ustar joejoeconst ENCODING *NS(XmlGetUtf8InternalEncoding)(void) { return &ns(internal_utf8_encoding).enc; } const ENCODING *NS(XmlGetUtf16InternalEncoding)(void) { #if XML_BYTE_ORDER == 12 return &ns(internal_little2_encoding).enc; #elif XML_BYTE_ORDER == 21 return &ns(internal_big2_encoding).enc; #else const short n = 1; return *(const char *)&n ? &ns(internal_little2_encoding).enc : &ns(internal_big2_encoding).enc; #endif } static const ENCODING *NS(encodings)[] = { &ns(latin1_encoding).enc, &ns(ascii_encoding).enc, &ns(utf8_encoding).enc, &ns(big2_encoding).enc, &ns(big2_encoding).enc, &ns(little2_encoding).enc, &ns(utf8_encoding).enc /* NO_ENC */ }; static int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr); } static int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr); } int NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, const char *name) { int i = getEncodingIndex(name); if (i == UNKNOWN_ENC) return 0; SET_INIT_ENC_INDEX(p, i); p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); p->initEnc.updatePosition = initUpdatePosition; p->encPtr = encPtr; *encPtr = &(p->initEnc); return 1; } static const ENCODING *NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) { #define ENCODING_MAX 128 char buf[ENCODING_MAX]; char *p = buf; int i; XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); if (ptr != end) return 0; *p = 0; if (streqci(buf, "UTF-16") && enc->minBytesPerChar == 2) return enc; i = getEncodingIndex(buf); if (i == UNKNOWN_ENC) return 0; return NS(encodings)[i]; } int NS(XmlParseXmlDecl)(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **encodingName, const ENCODING **encoding, int *standalone) { return doParseXmlDecl(NS(findEncoding), isGeneralTextEntity, enc, ptr, end, badPtr, versionPtr, encodingName, encoding, standalone); } sitecopy-0.16.6/lib/expat/README0000664000076400007640000000032210132700136014326 0ustar joejoe This is a MODIFIED version of the expat package. For the unabridged source, see: http://www.jclark.com/xml/expat.html See the ChangeLog for details of all changes made. Joe Orton sitecopy-0.16.6/lib/expat/gennmtab/0000775000076400007640000000000011037462346015261 5ustar joejoesitecopy-0.16.6/lib/expat/gennmtab/gennmtab.c0000664000076400007640000002207610132320456017215 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include struct range { int start; int end; }; struct range nmstrt[] = { { '_' }, { ':' }, /* BaseChar */ { 0x0041, 0x005a }, { 0x0061, 0x007a }, { 0x00c0, 0x00d6 }, { 0x00d8, 0x00f6 }, { 0x00f8, 0x00ff }, { 0x0100, 0x0131 }, { 0x0134, 0x013e }, { 0x0141, 0x0148 }, { 0x014a, 0x017e }, { 0x0180, 0x01c3 }, { 0x01cd, 0x01f0 }, { 0x01f4, 0x01f5 }, { 0x01fa, 0x0217 }, { 0x0250, 0x02a8 }, { 0x02bb, 0x02c1 }, { 0x0386 }, { 0x0388, 0x038a }, { 0x038c }, { 0x038e, 0x03a1 }, { 0x03a3, 0x03ce }, { 0x03d0, 0x03d6 }, { 0x03da }, { 0x03dc }, { 0x03de }, { 0x03e0 }, { 0x03e2, 0x03f3 }, { 0x0401, 0x040c }, { 0x040e, 0x044f }, { 0x0451, 0x045c }, { 0x045e, 0x0481 }, { 0x0490, 0x04c4 }, { 0x04c7, 0x04c8 }, { 0x04cb, 0x04cc }, { 0x04d0, 0x04eb }, { 0x04ee, 0x04f5 }, { 0x04f8, 0x04f9 }, { 0x0531, 0x0556 }, { 0x0559 }, { 0x0561, 0x0586 }, { 0x05d0, 0x05ea }, { 0x05f0, 0x05f2 }, { 0x0621, 0x063a }, { 0x0641, 0x064a }, { 0x0671, 0x06b7 }, { 0x06ba, 0x06be }, { 0x06c0, 0x06ce }, { 0x06d0, 0x06d3 }, { 0x06d5 }, { 0x06e5, 0x06e6 }, { 0x0905, 0x0939 }, { 0x093d }, { 0x0958, 0x0961 }, { 0x0985, 0x098c }, { 0x098f, 0x0990 }, { 0x0993, 0x09a8 }, { 0x09aa, 0x09b0 }, { 0x09b2 }, { 0x09b6, 0x09b9 }, { 0x09dc, 0x09dd }, { 0x09df, 0x09e1 }, { 0x09f0, 0x09f1 }, { 0x0a05, 0x0a0a }, { 0x0a0f, 0x0a10 }, { 0x0a13, 0x0a28 }, { 0x0a2a, 0x0a30 }, { 0x0a32, 0x0a33 }, { 0x0a35, 0x0a36 }, { 0x0a38, 0x0a39 }, { 0x0a59, 0x0a5c }, { 0x0a5e }, { 0x0a72, 0x0a74 }, { 0x0a85, 0x0a8b }, { 0x0a8d }, { 0x0a8f, 0x0a91 }, { 0x0a93, 0x0aa8 }, { 0x0aaa, 0x0ab0 }, { 0x0ab2, 0x0ab3 }, { 0x0ab5, 0x0ab9 }, { 0x0abd }, { 0x0ae0 }, { 0x0b05, 0x0b0c }, { 0x0b0f, 0x0b10 }, { 0x0b13, 0x0b28 }, { 0x0b2a, 0x0b30 }, { 0x0b32, 0x0b33 }, { 0x0b36, 0x0b39 }, { 0x0b3d }, { 0x0b5c, 0x0b5d }, { 0x0b5f, 0x0b61 }, { 0x0b85, 0x0b8a }, { 0x0b8e, 0x0b90 }, { 0x0b92, 0x0b95 }, { 0x0b99, 0x0b9a }, { 0x0b9c }, { 0x0b9e, 0x0b9f }, { 0x0ba3, 0x0ba4 }, { 0x0ba8, 0x0baa }, { 0x0bae, 0x0bb5 }, { 0x0bb7, 0x0bb9 }, { 0x0c05, 0x0c0c }, { 0x0c0e, 0x0c10 }, { 0x0c12, 0x0c28 }, { 0x0c2a, 0x0c33 }, { 0x0c35, 0x0c39 }, { 0x0c60, 0x0c61 }, { 0x0c85, 0x0c8c }, { 0x0c8e, 0x0c90 }, { 0x0c92, 0x0ca8 }, { 0x0caa, 0x0cb3 }, { 0x0cb5, 0x0cb9 }, { 0x0cde }, { 0x0ce0, 0x0ce1 }, { 0x0d05, 0x0d0c }, { 0x0d0e, 0x0d10 }, { 0x0d12, 0x0d28 }, { 0x0d2a, 0x0d39 }, { 0x0d60, 0x0d61 }, { 0x0e01, 0x0e2e }, { 0x0e30 }, { 0x0e32, 0x0e33 }, { 0x0e40, 0x0e45 }, { 0x0e81, 0x0e82 }, { 0x0e84 }, { 0x0e87, 0x0e88 }, { 0x0e8a }, { 0x0e8d }, { 0x0e94, 0x0e97 }, { 0x0e99, 0x0e9f }, { 0x0ea1, 0x0ea3 }, { 0x0ea5 }, { 0x0ea7 }, { 0x0eaa, 0x0eab }, { 0x0ead, 0x0eae }, { 0x0eb0 }, { 0x0eb2, 0x0eb3 }, { 0x0ebd }, { 0x0ec0, 0x0ec4 }, { 0x0f40, 0x0f47 }, { 0x0f49, 0x0f69 }, { 0x10a0, 0x10c5 }, { 0x10d0, 0x10f6 }, { 0x1100 }, { 0x1102, 0x1103 }, { 0x1105, 0x1107 }, { 0x1109 }, { 0x110b, 0x110c }, { 0x110e, 0x1112 }, { 0x113c }, { 0x113e }, { 0x1140 }, { 0x114c }, { 0x114e }, { 0x1150 }, { 0x1154, 0x1155 }, { 0x1159 }, { 0x115f, 0x1161 }, { 0x1163 }, { 0x1165 }, { 0x1167 }, { 0x1169 }, { 0x116d, 0x116e }, { 0x1172, 0x1173 }, { 0x1175 }, { 0x119e }, { 0x11a8 }, { 0x11ab }, { 0x11ae, 0x11af }, { 0x11b7, 0x11b8 }, { 0x11ba }, { 0x11bc, 0x11c2 }, { 0x11eb }, { 0x11f0 }, { 0x11f9 }, { 0x1e00, 0x1e9b }, { 0x1ea0, 0x1ef9 }, { 0x1f00, 0x1f15 }, { 0x1f18, 0x1f1d }, { 0x1f20, 0x1f45 }, { 0x1f48, 0x1f4d }, { 0x1f50, 0x1f57 }, { 0x1f59 }, { 0x1f5b }, { 0x1f5d }, { 0x1f5f, 0x1f7d }, { 0x1f80, 0x1fb4 }, { 0x1fb6, 0x1fbc }, { 0x1fbe }, { 0x1fc2, 0x1fc4 }, { 0x1fc6, 0x1fcc }, { 0x1fd0, 0x1fd3 }, { 0x1fd6, 0x1fdb }, { 0x1fe0, 0x1fec }, { 0x1ff2, 0x1ff4 }, { 0x1ff6, 0x1ffc }, { 0x2126 }, { 0x212a, 0x212b }, { 0x212e }, { 0x2180, 0x2182 }, { 0x3041, 0x3094 }, { 0x30a1, 0x30fa }, { 0x3105, 0x312c }, { 0xac00, 0xd7a3 }, /* Ideographic */ { 0x4e00, 0x9fa5 }, { 0x3007 }, { 0x3021, 0x3029 }, }; /* name chars that are not name start chars */ struct range name[] = { { '.' }, { '-' }, /* CombiningChar */ { 0x0300, 0x0345 }, { 0x0360, 0x0361 }, { 0x0483, 0x0486 }, { 0x0591, 0x05a1 }, { 0x05a3, 0x05b9 }, { 0x05bb, 0x05bd }, { 0x05bf }, { 0x05c1, 0x05c2 }, { 0x05c4 }, { 0x064b, 0x0652 }, { 0x0670 }, { 0x06d6, 0x06dc }, { 0x06dd, 0x06df }, { 0x06e0, 0x06e4 }, { 0x06e7, 0x06e8 }, { 0x06ea, 0x06ed }, { 0x0901, 0x0903 }, { 0x093c }, { 0x093e, 0x094c }, { 0x094d }, { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0983 }, { 0x09bc }, { 0x09be }, { 0x09bf }, { 0x09c0, 0x09c4 }, { 0x09c7, 0x09c8 }, { 0x09cb, 0x09cd }, { 0x09d7 }, { 0x09e2, 0x09e3 }, { 0x0a02 }, { 0x0a3c }, { 0x0a3e }, { 0x0a3f }, { 0x0a40, 0x0a42 }, { 0x0a47, 0x0a48 }, { 0x0a4b, 0x0a4d }, { 0x0a70, 0x0a71 }, { 0x0a81, 0x0a83 }, { 0x0abc }, { 0x0abe, 0x0ac5 }, { 0x0ac7, 0x0ac9 }, { 0x0acb, 0x0acd }, { 0x0b01, 0x0b03 }, { 0x0b3c }, { 0x0b3e, 0x0b43 }, { 0x0b47, 0x0b48 }, { 0x0b4b, 0x0b4d }, { 0x0b56, 0x0b57 }, { 0x0b82, 0x0b83 }, { 0x0bbe, 0x0bc2 }, { 0x0bc6, 0x0bc8 }, { 0x0bca, 0x0bcd }, { 0x0bd7 }, { 0x0c01, 0x0c03 }, { 0x0c3e, 0x0c44 }, { 0x0c46, 0x0c48 }, { 0x0c4a, 0x0c4d }, { 0x0c55, 0x0c56 }, { 0x0c82, 0x0c83 }, { 0x0cbe, 0x0cc4 }, { 0x0cc6, 0x0cc8 }, { 0x0cca, 0x0ccd }, { 0x0cd5, 0x0cd6 }, { 0x0d02, 0x0d03 }, { 0x0d3e, 0x0d43 }, { 0x0d46, 0x0d48 }, { 0x0d4a, 0x0d4d }, { 0x0d57 }, { 0x0e31 }, { 0x0e34, 0x0e3a }, { 0x0e47, 0x0e4e }, { 0x0eb1 }, { 0x0eb4, 0x0eb9 }, { 0x0ebb, 0x0ebc }, { 0x0ec8, 0x0ecd }, { 0x0f18, 0x0f19 }, { 0x0f35 }, { 0x0f37 }, { 0x0f39 }, { 0x0f3e }, { 0x0f3f }, { 0x0f71, 0x0f84 }, { 0x0f86, 0x0f8b }, { 0x0f90, 0x0f95 }, { 0x0f97 }, { 0x0f99, 0x0fad }, { 0x0fb1, 0x0fb7 }, { 0x0fb9 }, { 0x20d0, 0x20dc }, { 0x20e1 }, { 0x302a, 0x302f }, { 0x3099 }, { 0x309a }, /* Digit */ { 0x0030, 0x0039 }, { 0x0660, 0x0669 }, { 0x06f0, 0x06f9 }, { 0x0966, 0x096f }, { 0x09e6, 0x09ef }, { 0x0a66, 0x0a6f }, { 0x0ae6, 0x0aef }, { 0x0b66, 0x0b6f }, { 0x0be7, 0x0bef }, { 0x0c66, 0x0c6f }, { 0x0ce6, 0x0cef }, { 0x0d66, 0x0d6f }, { 0x0e50, 0x0e59 }, { 0x0ed0, 0x0ed9 }, { 0x0f20, 0x0f29 }, /* Extender */ { 0xb7 }, { 0x02d0 }, { 0x02d1 }, { 0x0387 }, { 0x0640 }, { 0x0e46 }, { 0x0ec6 }, { 0x3005 }, { 0x3031, 0x3035 }, { 0x309d, 0x309e }, { 0x30fc, 0x30fe }, }; void setTab(char *tab, struct range *ranges, size_t nRanges) { size_t i; int j; for (i = 0; i < nRanges; i++) { if (ranges[i].end) { for (j = ranges[i].start; j <= ranges[i].end; j++) tab[j] = 1; } else tab[ranges[i].start] = 1; } } void printTabs(char *tab) { int nBitmaps = 2; int i, j, k; unsigned char pageIndex[512]; printf( "static const unsigned namingBitmap[] = {\n\ 0x00000000, 0x00000000, 0x00000000, 0x00000000,\n\ 0x00000000, 0x00000000, 0x00000000, 0x00000000,\n\ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,\n\ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,\n"); for (i = 0; i < 512; i++) { int kind = tab[i*256]; for (j = 1; j < 256; j++) if (tab[i*256 +j] != kind) { kind = -1; break; } if (i >= 256 && memcmp(tab + (i - 256)*256, tab + i*256, 256) == 0) pageIndex[i] = pageIndex[i - 256]; else if (kind == -1) { pageIndex[i] = nBitmaps++; for (j = 0; j < 8; j++) { unsigned val = 0; for (k = 0; k < 32; k++) { if (tab[i*256 + j*32 +k]) val |= (1 << k); } printf("0x%08X,", val); putchar((((j + 1) & 3) == 0) ? '\n' : ' '); } } else pageIndex[i] = kind; } printf("};\n"); printf("static const unsigned char nmstrtPages[] = {\n"); for (i = 0; i < 512; i++) { if (i == 256) printf("};\nstatic const unsigned char namePages[] = {\n"); printf("0x%02X,", pageIndex[i]); putchar((((i + 1) & 7) == 0) ? '\n' : ' '); } printf("};\n"); } int main() { char tab[2*65536]; memset(tab, 0, 65536); setTab(tab, nmstrt, sizeof(nmstrt)/sizeof(nmstrt[0])); memcpy(tab + 65536, tab, 65536); setTab(tab + 65536, name, sizeof(name)/sizeof(name[0])); printTabs(tab); return 0; } sitecopy-0.16.6/lib/expat/xmlparse/0000775000076400007640000000000011037462346015321 5ustar joejoesitecopy-0.16.6/lib/expat/xmlparse/xmlparse.c0000664000076400007640000030474410132320456017322 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "xmldef.h" #include "xmlparse.h" #ifdef XML_UNICODE #define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX #define XmlConvert XmlUtf16Convert #define XmlGetInternalEncoding XmlGetUtf16InternalEncoding #define XmlGetInternalEncodingNS XmlGetUtf16InternalEncodingNS #define XmlEncode XmlUtf16Encode #define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((unsigned long)s) & 1)) typedef unsigned short ICHAR; #else #define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX #define XmlConvert XmlUtf8Convert #define XmlGetInternalEncoding XmlGetUtf8InternalEncoding #define XmlGetInternalEncodingNS XmlGetUtf8InternalEncodingNS #define XmlEncode XmlUtf8Encode #define MUST_CONVERT(enc, s) (!(enc)->isUtf8) typedef char ICHAR; #endif #ifndef XML_NS #define XmlInitEncodingNS XmlInitEncoding #define XmlInitUnknownEncodingNS XmlInitUnknownEncoding #undef XmlGetInternalEncodingNS #define XmlGetInternalEncodingNS XmlGetInternalEncoding #define XmlParseXmlDeclNS XmlParseXmlDecl #endif #ifdef XML_UNICODE_WCHAR_T #define XML_T(x) L ## x #else #define XML_T(x) x #endif /* Round up n to be a multiple of sz, where sz is a power of 2. */ #define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) #include "xmltok.h" #include "xmlrole.h" #include "hashtable.h" #define INIT_TAG_BUF_SIZE 32 /* must be a multiple of sizeof(XML_Char) */ #define INIT_DATA_BUF_SIZE 1024 #define INIT_ATTS_SIZE 16 #define INIT_BLOCK_SIZE 1024 #define INIT_BUFFER_SIZE 1024 #define EXPAND_SPARE 24 typedef struct binding { struct prefix *prefix; struct binding *nextTagBinding; struct binding *prevPrefixBinding; const struct attribute_id *attId; XML_Char *uri; int uriLen; int uriAlloc; } BINDING; typedef struct prefix { const XML_Char *name; BINDING *binding; } PREFIX; typedef struct { const XML_Char *str; const XML_Char *localPart; int uriLen; } TAG_NAME; typedef struct tag { struct tag *parent; const char *rawName; int rawNameLength; TAG_NAME name; char *buf; char *bufEnd; BINDING *bindings; } TAG; typedef struct { const XML_Char *name; const XML_Char *textPtr; int textLen; const XML_Char *systemId; const XML_Char *base; const XML_Char *publicId; const XML_Char *notation; char open; } ENTITY; typedef struct block { struct block *next; int size; XML_Char s[1]; } BLOCK; typedef struct { BLOCK *blocks; BLOCK *freeBlocks; const XML_Char *end; XML_Char *ptr; XML_Char *start; } STRING_POOL; /* The XML_Char before the name is used to determine whether an attribute has been specified. */ typedef struct attribute_id { XML_Char *name; PREFIX *prefix; char maybeTokenized; char xmlns; } ATTRIBUTE_ID; typedef struct { const ATTRIBUTE_ID *id; char isCdata; const XML_Char *value; } DEFAULT_ATTRIBUTE; typedef struct { const XML_Char *name; PREFIX *prefix; int nDefaultAtts; int allocDefaultAtts; DEFAULT_ATTRIBUTE *defaultAtts; } ELEMENT_TYPE; typedef struct { HASH_TABLE generalEntities; HASH_TABLE elementTypes; HASH_TABLE attributeIds; HASH_TABLE prefixes; STRING_POOL pool; int complete; int standalone; #ifdef XML_DTD HASH_TABLE paramEntities; #endif /* XML_DTD */ PREFIX defaultPrefix; } DTD; typedef struct open_internal_entity { const char *internalEventPtr; const char *internalEventEndPtr; struct open_internal_entity *next; ENTITY *entity; } OPEN_INTERNAL_ENTITY; typedef enum XML_Error Processor(XML_Parser parser, const char *start, const char *end, const char **endPtr); static Processor prologProcessor; static Processor prologInitProcessor; static Processor contentProcessor; static Processor cdataSectionProcessor; #ifdef XML_DTD static Processor ignoreSectionProcessor; #endif /* XML_DTD */ static Processor epilogProcessor; static Processor errorProcessor; static Processor externalEntityInitProcessor; static Processor externalEntityInitProcessor2; static Processor externalEntityInitProcessor3; static Processor externalEntityContentProcessor; static enum XML_Error handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName); static enum XML_Error processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *, const char *); static enum XML_Error initializeEncoding(XML_Parser parser); static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr); static enum XML_Error processInternalParamEntity(XML_Parser parser, ENTITY *entity); static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, const char *start, const char *end, const char **endPtr); static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); #ifdef XML_DTD static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); #endif /* XML_DTD */ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr); static int addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr); static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, int isCdata, const XML_Char *dfltValue); static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *, STRING_POOL *); static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *, STRING_POOL *); static ATTRIBUTE_ID * getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *); static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static void reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static const XML_Char *getContext(XML_Parser parser); static int setContext(XML_Parser parser, const XML_Char *context); static void normalizePublicId(XML_Char *s); static int dtdInit(DTD *); static void dtdDestroy(DTD *); static int dtdCopy(DTD *newDtd, const DTD *oldDtd); static int copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *); #ifdef XML_DTD static void dtdSwap(DTD *, DTD *); #endif /* XML_DTD */ static void poolInit(STRING_POOL *); static void poolClear(STRING_POOL *); static void poolDestroy(STRING_POOL *); static XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end); static XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end); static int poolGrow(STRING_POOL *pool); static const XML_Char *poolCopyString(STRING_POOL *pool, const XML_Char *s); static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n); #define poolStart(pool) ((pool)->start) #define poolEnd(pool) ((pool)->ptr) #define poolLength(pool) ((pool)->ptr - (pool)->start) #define poolChop(pool) ((void)--(pool->ptr)) #define poolLastChar(pool) (((pool)->ptr)[-1]) #define poolDiscard(pool) ((pool)->ptr = (pool)->start) #define poolFinish(pool) ((pool)->start = (pool)->ptr) #define poolAppendChar(pool, c) \ (((pool)->ptr == (pool)->end && !poolGrow(pool)) \ ? 0 \ : ((*((pool)->ptr)++ = c), 1)) typedef struct { /* The first member must be userData so that the XML_GetUserData macro works. */ void *m_userData; void *m_handlerArg; char *m_buffer; /* first character to be parsed */ const char *m_bufferPtr; /* past last character to be parsed */ char *m_bufferEnd; /* allocated end of buffer */ const char *m_bufferLim; long m_parseEndByteIndex; const char *m_parseEndPtr; XML_Char *m_dataBuf; XML_Char *m_dataBufEnd; XML_XmlDeclHandler m_xmlDeclHandler; XML_StartElementHandler m_startElementHandler; XML_EndElementHandler m_endElementHandler; XML_CharacterDataHandler m_characterDataHandler; XML_ProcessingInstructionHandler m_processingInstructionHandler; XML_CommentHandler m_commentHandler; XML_StartCdataSectionHandler m_startCdataSectionHandler; XML_EndCdataSectionHandler m_endCdataSectionHandler; XML_DefaultHandler m_defaultHandler; XML_UnparsedEntityDeclHandler m_unparsedEntityDeclHandler; XML_NotationDeclHandler m_notationDeclHandler; XML_StartNamespaceDeclHandler m_startNamespaceDeclHandler; XML_EndNamespaceDeclHandler m_endNamespaceDeclHandler; XML_NotStandaloneHandler m_notStandaloneHandler; XML_ExternalEntityRefHandler m_externalEntityRefHandler; void *m_externalEntityRefHandlerArg; XML_UnknownEncodingHandler m_unknownEncodingHandler; const ENCODING *m_encoding; INIT_ENCODING m_initEncoding; const ENCODING *m_internalEncoding; const XML_Char *m_protocolEncodingName; int m_ns; void *m_unknownEncodingMem; void *m_unknownEncodingData; void *m_unknownEncodingHandlerData; void (*m_unknownEncodingRelease)(void *); PROLOG_STATE m_prologState; Processor *m_processor; enum XML_Error m_errorCode; const char *m_eventPtr; const char *m_eventEndPtr; const char *m_positionPtr; OPEN_INTERNAL_ENTITY *m_openInternalEntities; int m_defaultExpandInternalEntities; int m_tagLevel; ENTITY *m_declEntity; const XML_Char *m_declNotationName; const XML_Char *m_declNotationPublicId; ELEMENT_TYPE *m_declElementType; ATTRIBUTE_ID *m_declAttributeId; char m_declAttributeIsCdata; DTD m_dtd; const XML_Char *m_curBase; TAG *m_tagStack; TAG *m_freeTagList; BINDING *m_inheritedBindings; BINDING *m_freeBindingList; int m_attsSize; int m_nSpecifiedAtts; ATTRIBUTE *m_atts; POSITION m_position; STRING_POOL m_tempPool; STRING_POOL m_temp2Pool; char *m_groupConnector; unsigned m_groupSize; int m_hadExternalDoctype; XML_Char m_namespaceSeparator; #ifdef XML_DTD enum XML_ParamEntityParsing m_paramEntityParsing; XML_Parser m_parentParser; #endif } Parser; #define userData (((Parser *)parser)->m_userData) #define handlerArg (((Parser *)parser)->m_handlerArg) #define xmlDeclHandler (((Parser *)parser)->m_xmlDeclHandler) #define startElementHandler (((Parser *)parser)->m_startElementHandler) #define endElementHandler (((Parser *)parser)->m_endElementHandler) #define characterDataHandler (((Parser *)parser)->m_characterDataHandler) #define processingInstructionHandler (((Parser *)parser)->m_processingInstructionHandler) #define commentHandler (((Parser *)parser)->m_commentHandler) #define startCdataSectionHandler (((Parser *)parser)->m_startCdataSectionHandler) #define endCdataSectionHandler (((Parser *)parser)->m_endCdataSectionHandler) #define defaultHandler (((Parser *)parser)->m_defaultHandler) #define unparsedEntityDeclHandler (((Parser *)parser)->m_unparsedEntityDeclHandler) #define notationDeclHandler (((Parser *)parser)->m_notationDeclHandler) #define startNamespaceDeclHandler (((Parser *)parser)->m_startNamespaceDeclHandler) #define endNamespaceDeclHandler (((Parser *)parser)->m_endNamespaceDeclHandler) #define notStandaloneHandler (((Parser *)parser)->m_notStandaloneHandler) #define externalEntityRefHandler (((Parser *)parser)->m_externalEntityRefHandler) #define externalEntityRefHandlerArg (((Parser *)parser)->m_externalEntityRefHandlerArg) #define unknownEncodingHandler (((Parser *)parser)->m_unknownEncodingHandler) #define encoding (((Parser *)parser)->m_encoding) #define initEncoding (((Parser *)parser)->m_initEncoding) #define internalEncoding (((Parser *)parser)->m_internalEncoding) #define unknownEncodingMem (((Parser *)parser)->m_unknownEncodingMem) #define unknownEncodingData (((Parser *)parser)->m_unknownEncodingData) #define unknownEncodingHandlerData \ (((Parser *)parser)->m_unknownEncodingHandlerData) #define unknownEncodingRelease (((Parser *)parser)->m_unknownEncodingRelease) #define protocolEncodingName (((Parser *)parser)->m_protocolEncodingName) #define ns (((Parser *)parser)->m_ns) #define prologState (((Parser *)parser)->m_prologState) #define processor (((Parser *)parser)->m_processor) #define errorCode (((Parser *)parser)->m_errorCode) #define eventPtr (((Parser *)parser)->m_eventPtr) #define eventEndPtr (((Parser *)parser)->m_eventEndPtr) #define positionPtr (((Parser *)parser)->m_positionPtr) #define position (((Parser *)parser)->m_position) #define openInternalEntities (((Parser *)parser)->m_openInternalEntities) #define defaultExpandInternalEntities (((Parser *)parser)->m_defaultExpandInternalEntities) #define tagLevel (((Parser *)parser)->m_tagLevel) #define buffer (((Parser *)parser)->m_buffer) #define bufferPtr (((Parser *)parser)->m_bufferPtr) #define bufferEnd (((Parser *)parser)->m_bufferEnd) #define parseEndByteIndex (((Parser *)parser)->m_parseEndByteIndex) #define parseEndPtr (((Parser *)parser)->m_parseEndPtr) #define bufferLim (((Parser *)parser)->m_bufferLim) #define dataBuf (((Parser *)parser)->m_dataBuf) #define dataBufEnd (((Parser *)parser)->m_dataBufEnd) #define dtd (((Parser *)parser)->m_dtd) #define curBase (((Parser *)parser)->m_curBase) #define declEntity (((Parser *)parser)->m_declEntity) #define declNotationName (((Parser *)parser)->m_declNotationName) #define declNotationPublicId (((Parser *)parser)->m_declNotationPublicId) #define declElementType (((Parser *)parser)->m_declElementType) #define declAttributeId (((Parser *)parser)->m_declAttributeId) #define declAttributeIsCdata (((Parser *)parser)->m_declAttributeIsCdata) #define freeTagList (((Parser *)parser)->m_freeTagList) #define freeBindingList (((Parser *)parser)->m_freeBindingList) #define inheritedBindings (((Parser *)parser)->m_inheritedBindings) #define tagStack (((Parser *)parser)->m_tagStack) #define atts (((Parser *)parser)->m_atts) #define attsSize (((Parser *)parser)->m_attsSize) #define nSpecifiedAtts (((Parser *)parser)->m_nSpecifiedAtts) #define tempPool (((Parser *)parser)->m_tempPool) #define temp2Pool (((Parser *)parser)->m_temp2Pool) #define groupConnector (((Parser *)parser)->m_groupConnector) #define groupSize (((Parser *)parser)->m_groupSize) #define hadExternalDoctype (((Parser *)parser)->m_hadExternalDoctype) #define namespaceSeparator (((Parser *)parser)->m_namespaceSeparator) #ifdef XML_DTD #define parentParser (((Parser *)parser)->m_parentParser) #define paramEntityParsing (((Parser *)parser)->m_paramEntityParsing) #endif /* XML_DTD */ #ifdef _MSC_VER #ifdef _DEBUG Parser *asParser(XML_Parser parser) { return parser; } #endif #endif XML_Parser XML_ParserCreate(const XML_Char *encodingName) { XML_Parser parser = malloc(sizeof(Parser)); if (!parser) return parser; processor = prologInitProcessor; XmlPrologStateInit(&prologState); userData = 0; handlerArg = 0; startElementHandler = 0; endElementHandler = 0; characterDataHandler = 0; processingInstructionHandler = 0; commentHandler = 0; startCdataSectionHandler = 0; endCdataSectionHandler = 0; defaultHandler = 0; unparsedEntityDeclHandler = 0; notationDeclHandler = 0; startNamespaceDeclHandler = 0; endNamespaceDeclHandler = 0; notStandaloneHandler = 0; externalEntityRefHandler = 0; externalEntityRefHandlerArg = parser; unknownEncodingHandler = 0; buffer = 0; bufferPtr = 0; bufferEnd = 0; parseEndByteIndex = 0; parseEndPtr = 0; bufferLim = 0; declElementType = 0; declAttributeId = 0; declEntity = 0; declNotationName = 0; declNotationPublicId = 0; memset(&position, 0, sizeof(POSITION)); errorCode = XML_ERROR_NONE; eventPtr = 0; eventEndPtr = 0; positionPtr = 0; openInternalEntities = 0; tagLevel = 0; tagStack = 0; freeTagList = 0; freeBindingList = 0; inheritedBindings = 0; attsSize = INIT_ATTS_SIZE; atts = malloc(attsSize * sizeof(ATTRIBUTE)); nSpecifiedAtts = 0; dataBuf = malloc(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); groupSize = 0; groupConnector = 0; hadExternalDoctype = 0; unknownEncodingMem = 0; unknownEncodingRelease = 0; unknownEncodingData = 0; unknownEncodingHandlerData = 0; namespaceSeparator = '!'; #ifdef XML_DTD parentParser = 0; #endif ns = 0; poolInit(&tempPool); poolInit(&temp2Pool); protocolEncodingName = encodingName ? poolCopyString(&tempPool, encodingName) : 0; curBase = 0; if (!dtdInit(&dtd) || !atts || !dataBuf || (encodingName && !protocolEncodingName)) { XML_ParserFree(parser); return 0; } dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE; XmlInitEncoding(&initEncoding, &encoding, 0); internalEncoding = XmlGetInternalEncoding(); return parser; } XML_Parser XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) { static const XML_Char implicitContext[] = { XML_T('x'), XML_T('m'), XML_T('l'), XML_T('='), XML_T('h'), XML_T('t'), XML_T('t'), XML_T('p'), XML_T(':'), XML_T('/'), XML_T('/'), XML_T('w'), XML_T('w'), XML_T('w'), XML_T('.'), XML_T('w'), XML_T('3'), XML_T('.'), XML_T('o'), XML_T('r'), XML_T('g'), XML_T('/'), XML_T('X'), XML_T('M'), XML_T('L'), XML_T('/'), XML_T('1'), XML_T('9'), XML_T('9'), XML_T('8'), XML_T('/'), XML_T('n'), XML_T('a'), XML_T('m'), XML_T('e'), XML_T('s'), XML_T('p'), XML_T('a'), XML_T('c'), XML_T('e'), XML_T('\0') }; XML_Parser parser = XML_ParserCreate(encodingName); if (parser) { XmlInitEncodingNS(&initEncoding, &encoding, 0); ns = 1; internalEncoding = XmlGetInternalEncodingNS(); namespaceSeparator = nsSep; } if (!setContext(parser, implicitContext)) { XML_ParserFree(parser); return 0; } return parser; } int XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) { if (!encodingName) protocolEncodingName = 0; else { protocolEncodingName = poolCopyString(&tempPool, encodingName); if (!protocolEncodingName) return 0; } return 1; } XML_Parser XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context, const XML_Char *encodingName) { XML_Parser parser = oldParser; DTD *oldDtd = &dtd; XML_StartElementHandler oldStartElementHandler = startElementHandler; XML_EndElementHandler oldEndElementHandler = endElementHandler; XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler; XML_ProcessingInstructionHandler oldProcessingInstructionHandler = processingInstructionHandler; XML_CommentHandler oldCommentHandler = commentHandler; XML_StartCdataSectionHandler oldStartCdataSectionHandler = startCdataSectionHandler; XML_EndCdataSectionHandler oldEndCdataSectionHandler = endCdataSectionHandler; XML_DefaultHandler oldDefaultHandler = defaultHandler; XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler = startNamespaceDeclHandler; XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler = endNamespaceDeclHandler; XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler; XML_ExternalEntityRefHandler oldExternalEntityRefHandler = externalEntityRefHandler; XML_UnknownEncodingHandler oldUnknownEncodingHandler = unknownEncodingHandler; void *oldUserData = userData; void *oldHandlerArg = handlerArg; int oldDefaultExpandInternalEntities = defaultExpandInternalEntities; void *oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg; #ifdef XML_DTD int oldParamEntityParsing = paramEntityParsing; #endif parser = (ns ? XML_ParserCreateNS(encodingName, namespaceSeparator) : XML_ParserCreate(encodingName)); if (!parser) return 0; startElementHandler = oldStartElementHandler; endElementHandler = oldEndElementHandler; characterDataHandler = oldCharacterDataHandler; processingInstructionHandler = oldProcessingInstructionHandler; commentHandler = oldCommentHandler; startCdataSectionHandler = oldStartCdataSectionHandler; endCdataSectionHandler = oldEndCdataSectionHandler; defaultHandler = oldDefaultHandler; startNamespaceDeclHandler = oldStartNamespaceDeclHandler; endNamespaceDeclHandler = oldEndNamespaceDeclHandler; notStandaloneHandler = oldNotStandaloneHandler; externalEntityRefHandler = oldExternalEntityRefHandler; unknownEncodingHandler = oldUnknownEncodingHandler; userData = oldUserData; if (oldUserData == oldHandlerArg) handlerArg = userData; else handlerArg = parser; if (oldExternalEntityRefHandlerArg != oldParser) externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg; defaultExpandInternalEntities = oldDefaultExpandInternalEntities; #ifdef XML_DTD paramEntityParsing = oldParamEntityParsing; if (context) { #endif /* XML_DTD */ if (!dtdCopy(&dtd, oldDtd) || !setContext(parser, context)) { XML_ParserFree(parser); return 0; } processor = externalEntityInitProcessor; #ifdef XML_DTD } else { dtdSwap(&dtd, oldDtd); parentParser = oldParser; XmlPrologStateInitExternalEntity(&prologState); dtd.complete = 1; hadExternalDoctype = 1; } #endif /* XML_DTD */ return parser; } static void destroyBindings(BINDING *bindings) { for (;;) { BINDING *b = bindings; if (!b) break; bindings = b->nextTagBinding; free(b->uri); free(b); } } void XML_ParserFree(XML_Parser parser) { for (;;) { TAG *p; if (tagStack == 0) { if (freeTagList == 0) break; tagStack = freeTagList; freeTagList = 0; } p = tagStack; tagStack = tagStack->parent; free(p->buf); destroyBindings(p->bindings); free(p); } destroyBindings(freeBindingList); destroyBindings(inheritedBindings); poolDestroy(&tempPool); poolDestroy(&temp2Pool); #ifdef XML_DTD if (parentParser) { if (hadExternalDoctype) dtd.complete = 0; dtdSwap(&dtd, &((Parser *)parentParser)->m_dtd); } #endif /* XML_DTD */ dtdDestroy(&dtd); free((void *)atts); free(groupConnector); free(buffer); free(dataBuf); free(unknownEncodingMem); if (unknownEncodingRelease) unknownEncodingRelease(unknownEncodingData); free(parser); } void XML_UseParserAsHandlerArg(XML_Parser parser) { handlerArg = parser; } void XML_SetUserData(XML_Parser parser, void *p) { if (handlerArg == userData) handlerArg = userData = p; else userData = p; } int XML_SetBase(XML_Parser parser, const XML_Char *p) { if (p) { p = poolCopyString(&dtd.pool, p); if (!p) return 0; curBase = p; } else curBase = 0; return 1; } const XML_Char *XML_GetBase(XML_Parser parser) { return curBase; } int XML_GetSpecifiedAttributeCount(XML_Parser parser) { return nSpecifiedAtts; } void XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end) { startElementHandler = start; endElementHandler = end; } void XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler handler) { characterDataHandler = handler; } void XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler handler) { xmlDeclHandler = handler; } void XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler) { processingInstructionHandler = handler; } void XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler) { commentHandler = handler; } void XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end) { startCdataSectionHandler = start; endCdataSectionHandler = end; } void XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler) { defaultHandler = handler; defaultExpandInternalEntities = 0; } void XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler) { defaultHandler = handler; defaultExpandInternalEntities = 1; } void XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler) { unparsedEntityDeclHandler = handler; } void XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler) { notationDeclHandler = handler; } void XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end) { startNamespaceDeclHandler = start; endNamespaceDeclHandler = end; } void XML_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler) { notStandaloneHandler = handler; } void XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler) { externalEntityRefHandler = handler; } void XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg) { if (arg) externalEntityRefHandlerArg = arg; else externalEntityRefHandlerArg = parser; } void XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *data) { unknownEncodingHandler = handler; unknownEncodingHandlerData = data; } int XML_SetParamEntityParsing(XML_Parser parser, enum XML_ParamEntityParsing parsing) { #ifdef XML_DTD paramEntityParsing = parsing; return 1; #else return parsing == XML_PARAM_ENTITY_PARSING_NEVER; #endif } int XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) { if (len == 0) { if (!isFinal) return 1; positionPtr = bufferPtr; errorCode = processor(parser, bufferPtr, parseEndPtr = bufferEnd, 0); if (errorCode == XML_ERROR_NONE) return 1; eventEndPtr = eventPtr; processor = errorProcessor; return 0; } else if (bufferPtr == bufferEnd) { const char *end; int nLeftOver; parseEndByteIndex += len; positionPtr = s; if (isFinal) { errorCode = processor(parser, s, parseEndPtr = s + len, 0); if (errorCode == XML_ERROR_NONE) return 1; eventEndPtr = eventPtr; processor = errorProcessor; return 0; } errorCode = processor(parser, s, parseEndPtr = s + len, &end); if (errorCode != XML_ERROR_NONE) { eventEndPtr = eventPtr; processor = errorProcessor; return 0; } XmlUpdatePosition(encoding, positionPtr, end, &position); nLeftOver = s + len - end; if (nLeftOver) { if (buffer == 0 || nLeftOver > bufferLim - buffer) { /* FIXME avoid integer overflow */ buffer = buffer == 0 ? malloc(len * 2) : realloc(buffer, len * 2); /* FIXME storage leak if realloc fails */ if (!buffer) { errorCode = XML_ERROR_NO_MEMORY; eventPtr = eventEndPtr = 0; processor = errorProcessor; return 0; } bufferLim = buffer + len * 2; } memcpy(buffer, end, nLeftOver); bufferPtr = buffer; bufferEnd = buffer + nLeftOver; } return 1; } else { memcpy(XML_GetBuffer(parser, len), s, len); return XML_ParseBuffer(parser, len, isFinal); } } int XML_ParseBuffer(XML_Parser parser, int len, int isFinal) { const char *start = bufferPtr; positionPtr = start; bufferEnd += len; parseEndByteIndex += len; errorCode = processor(parser, start, parseEndPtr = bufferEnd, isFinal ? (const char **)0 : &bufferPtr); if (errorCode == XML_ERROR_NONE) { if (!isFinal) XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); return 1; } else { eventEndPtr = eventPtr; processor = errorProcessor; return 0; } } void *XML_GetBuffer(XML_Parser parser, int len) { if (len > bufferLim - bufferEnd) { /* FIXME avoid integer overflow */ int neededSize = len + (bufferEnd - bufferPtr); if (neededSize <= bufferLim - buffer) { memmove(buffer, bufferPtr, bufferEnd - bufferPtr); bufferEnd = buffer + (bufferEnd - bufferPtr); bufferPtr = buffer; } else { char *newBuf; int bufferSize = bufferLim - bufferPtr; if (bufferSize == 0) bufferSize = INIT_BUFFER_SIZE; do { bufferSize *= 2; } while (bufferSize < neededSize); newBuf = malloc(bufferSize); if (newBuf == 0) { errorCode = XML_ERROR_NO_MEMORY; return 0; } bufferLim = newBuf + bufferSize; if (bufferPtr) { memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr); free(buffer); } bufferEnd = newBuf + (bufferEnd - bufferPtr); bufferPtr = buffer = newBuf; } } return bufferEnd; } enum XML_Error XML_GetErrorCode(XML_Parser parser) { return errorCode; } long XML_GetCurrentByteIndex(XML_Parser parser) { if (eventPtr) return parseEndByteIndex - (parseEndPtr - eventPtr); return -1; } int XML_GetCurrentByteCount(XML_Parser parser) { if (eventEndPtr && eventPtr) return eventEndPtr - eventPtr; return 0; } int XML_GetCurrentLineNumber(XML_Parser parser) { if (eventPtr) { XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); positionPtr = eventPtr; } return position.lineNumber + 1; } int XML_GetCurrentColumnNumber(XML_Parser parser) { if (eventPtr) { XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); positionPtr = eventPtr; } return position.columnNumber; } void XML_DefaultCurrent(XML_Parser parser) { if (defaultHandler) { if (openInternalEntities) reportDefault(parser, internalEncoding, openInternalEntities->internalEventPtr, openInternalEntities->internalEventEndPtr); else reportDefault(parser, encoding, eventPtr, eventEndPtr); } } const XML_LChar *XML_ErrorString(int code) { static const XML_LChar *message[] = { 0, XML_T("out of memory"), XML_T("syntax error"), XML_T("no element found"), XML_T("not well-formed"), XML_T("unclosed token"), XML_T("unclosed token"), XML_T("mismatched tag"), XML_T("duplicate attribute"), XML_T("junk after document element"), XML_T("illegal parameter entity reference"), XML_T("undefined entity"), XML_T("recursive entity reference"), XML_T("asynchronous entity"), XML_T("reference to invalid character number"), XML_T("reference to binary entity"), XML_T("reference to external entity in attribute"), XML_T("xml processing instruction not at start of external entity"), XML_T("unknown encoding"), XML_T("encoding specified in XML declaration is incorrect"), XML_T("unclosed CDATA section"), XML_T("error in processing external entity reference"), XML_T("document is not standalone") }; if (code > 0 && code < sizeof(message)/sizeof(message[0])) return message[code]; return 0; } static enum XML_Error contentProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { return doContent(parser, 0, encoding, start, end, endPtr); } static enum XML_Error externalEntityInitProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = initializeEncoding(parser); if (result != XML_ERROR_NONE) return result; processor = externalEntityInitProcessor2; return externalEntityInitProcessor2(parser, start, end, endPtr); } static enum XML_Error externalEntityInitProcessor2(XML_Parser parser, const char *start, const char *end, const char **endPtr) { const char *next; int tok = XmlContentTok(encoding, start, end, &next); switch (tok) { case XML_TOK_BOM: start = next; break; case XML_TOK_PARTIAL: if (endPtr) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (endPtr) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_PARTIAL_CHAR; } processor = externalEntityInitProcessor3; return externalEntityInitProcessor3(parser, start, end, endPtr); } static enum XML_Error externalEntityInitProcessor3(XML_Parser parser, const char *start, const char *end, const char **endPtr) { const char *next; int tok = XmlContentTok(encoding, start, end, &next); switch (tok) { case XML_TOK_XML_DECL: { enum XML_Error result = processXmlDecl(parser, 1, start, next); if (result != XML_ERROR_NONE) return result; start = next; } break; case XML_TOK_PARTIAL: if (endPtr) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (endPtr) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_PARTIAL_CHAR; } processor = externalEntityContentProcessor; tagLevel = 1; return doContent(parser, 1, encoding, start, end, endPtr); } static enum XML_Error externalEntityContentProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { return doContent(parser, 1, encoding, start, end, endPtr); } static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, const char *s, const char *end, const char **nextPtr) { const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } *eventPP = s; for (;;) { const char *next = s; /* XmlContentTok doesn't always set the last arg */ int tok = XmlContentTok(enc, s, end, &next); *eventEndPP = next; switch (tok) { case XML_TOK_TRAILING_CR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } *eventEndPP = end; if (characterDataHandler) { XML_Char c = 0xA; characterDataHandler(handlerArg, &c, 1); } else if (defaultHandler) reportDefault(parser, enc, s, end); if (startTagLevel == 0) return XML_ERROR_NO_ELEMENTS; if (tagLevel != startTagLevel) return XML_ERROR_ASYNC_ENTITY; return XML_ERROR_NONE; case XML_TOK_NONE: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } if (startTagLevel > 0) { if (tagLevel != startTagLevel) return XML_ERROR_ASYNC_ENTITY; return XML_ERROR_NONE; } return XML_ERROR_NO_ELEMENTS; case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; case XML_TOK_ENTITY_REF: { const XML_Char *name; ENTITY *entity; XML_Char ch = XmlPredefinedEntityName(enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (ch) { if (characterDataHandler) characterDataHandler(handlerArg, &ch, 1); else if (defaultHandler) reportDefault(parser, enc, s, next); break; } name = poolStoreString(&dtd.pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd.generalEntities, name, 0); poolDiscard(&dtd.pool); if (!entity) { if (dtd.complete || dtd.standalone) return XML_ERROR_UNDEFINED_ENTITY; if (defaultHandler) reportDefault(parser, enc, s, next); break; } if (entity->open) return XML_ERROR_RECURSIVE_ENTITY_REF; if (entity->notation) return XML_ERROR_BINARY_ENTITY_REF; if (entity) { if (entity->textPtr) { enum XML_Error result; OPEN_INTERNAL_ENTITY openEntity; if (defaultHandler && !defaultExpandInternalEntities) { reportDefault(parser, enc, s, next); break; } entity->open = 1; openEntity.next = openInternalEntities; openInternalEntities = &openEntity; openEntity.entity = entity; openEntity.internalEventPtr = 0; openEntity.internalEventEndPtr = 0; result = doContent(parser, tagLevel, internalEncoding, (char *)entity->textPtr, (char *)(entity->textPtr + entity->textLen), 0); entity->open = 0; openInternalEntities = openEntity.next; if (result) return result; } else if (externalEntityRefHandler) { const XML_Char *context; entity->open = 1; context = getContext(parser); entity->open = 0; if (!context) return XML_ERROR_NO_MEMORY; if (!externalEntityRefHandler(externalEntityRefHandlerArg, context, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; poolDiscard(&tempPool); } else if (defaultHandler) reportDefault(parser, enc, s, next); } break; } case XML_TOK_START_TAG_WITH_ATTS: if (!startElementHandler) { enum XML_Error result = storeAtts(parser, enc, s, 0, 0); if (result) return result; } /* fall through */ case XML_TOK_START_TAG_NO_ATTS: { TAG *tag; if (freeTagList) { tag = freeTagList; freeTagList = freeTagList->parent; } else { tag = malloc(sizeof(TAG)); if (!tag) return XML_ERROR_NO_MEMORY; tag->buf = malloc(INIT_TAG_BUF_SIZE); if (!tag->buf) return XML_ERROR_NO_MEMORY; tag->bufEnd = tag->buf + INIT_TAG_BUF_SIZE; } tag->bindings = 0; tag->parent = tagStack; tagStack = tag; tag->name.localPart = 0; tag->rawName = s + enc->minBytesPerChar; tag->rawNameLength = XmlNameLength(enc, tag->rawName); if (nextPtr) { /* Need to guarantee that: tag->buf + ROUND_UP(tag->rawNameLength, sizeof(XML_Char)) <= tag->bufEnd - sizeof(XML_Char) */ if (tag->rawNameLength + (int)(sizeof(XML_Char) - 1) + (int)sizeof(XML_Char) > tag->bufEnd - tag->buf) { int bufSize = tag->rawNameLength * 4; bufSize = ROUND_UP(bufSize, sizeof(XML_Char)); tag->buf = realloc(tag->buf, bufSize); if (!tag->buf) return XML_ERROR_NO_MEMORY; tag->bufEnd = tag->buf + bufSize; } memcpy(tag->buf, tag->rawName, tag->rawNameLength); tag->rawName = tag->buf; } ++tagLevel; if (startElementHandler) { enum XML_Error result; XML_Char *toPtr; for (;;) { const char *rawNameEnd = tag->rawName + tag->rawNameLength; const char *fromPtr = tag->rawName; int bufSize; if (nextPtr) toPtr = (XML_Char *)(tag->buf + ROUND_UP(tag->rawNameLength, sizeof(XML_Char))); else toPtr = (XML_Char *)tag->buf; tag->name.str = toPtr; XmlConvert(enc, &fromPtr, rawNameEnd, (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1); if (fromPtr == rawNameEnd) break; bufSize = (tag->bufEnd - tag->buf) << 1; tag->buf = realloc(tag->buf, bufSize); if (!tag->buf) return XML_ERROR_NO_MEMORY; tag->bufEnd = tag->buf + bufSize; if (nextPtr) tag->rawName = tag->buf; } *toPtr = XML_T('\0'); result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings)); if (result) return result; startElementHandler(handlerArg, tag->name.str, (const XML_Char **)atts); poolClear(&tempPool); } else { tag->name.str = 0; if (defaultHandler) reportDefault(parser, enc, s, next); } break; } case XML_TOK_EMPTY_ELEMENT_WITH_ATTS: if (!startElementHandler) { enum XML_Error result = storeAtts(parser, enc, s, 0, 0); if (result) return result; } /* fall through */ case XML_TOK_EMPTY_ELEMENT_NO_ATTS: if (startElementHandler || endElementHandler) { const char *rawName = s + enc->minBytesPerChar; enum XML_Error result; BINDING *bindings = 0; TAG_NAME name; name.str = poolStoreString(&tempPool, enc, rawName, rawName + XmlNameLength(enc, rawName)); if (!name.str) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); result = storeAtts(parser, enc, s, &name, &bindings); if (result) return result; poolFinish(&tempPool); if (startElementHandler) startElementHandler(handlerArg, name.str, (const XML_Char **)atts); if (endElementHandler) { if (startElementHandler) *eventPP = *eventEndPP; endElementHandler(handlerArg, name.str); } poolClear(&tempPool); while (bindings) { BINDING *b = bindings; if (endNamespaceDeclHandler) endNamespaceDeclHandler(handlerArg, b->prefix->name); bindings = bindings->nextTagBinding; b->nextTagBinding = freeBindingList; freeBindingList = b; b->prefix->binding = b->prevPrefixBinding; } } else if (defaultHandler) reportDefault(parser, enc, s, next); if (tagLevel == 0) return epilogProcessor(parser, next, end, nextPtr); break; case XML_TOK_END_TAG: if (tagLevel == startTagLevel) return XML_ERROR_ASYNC_ENTITY; else { int len; const char *rawName; TAG *tag = tagStack; tagStack = tag->parent; tag->parent = freeTagList; freeTagList = tag; rawName = s + enc->minBytesPerChar*2; len = XmlNameLength(enc, rawName); if (len != tag->rawNameLength || memcmp(tag->rawName, rawName, len) != 0) { *eventPP = rawName; return XML_ERROR_TAG_MISMATCH; } --tagLevel; if (endElementHandler && tag->name.str) { if (tag->name.localPart) { XML_Char *to = (XML_Char *)tag->name.str + tag->name.uriLen; const XML_Char *from = tag->name.localPart; while ((*to++ = *from++) != 0) ; } endElementHandler(handlerArg, tag->name.str); } else if (defaultHandler) reportDefault(parser, enc, s, next); while (tag->bindings) { BINDING *b = tag->bindings; if (endNamespaceDeclHandler) endNamespaceDeclHandler(handlerArg, b->prefix->name); tag->bindings = tag->bindings->nextTagBinding; b->nextTagBinding = freeBindingList; freeBindingList = b; b->prefix->binding = b->prevPrefixBinding; } if (tagLevel == 0) return epilogProcessor(parser, next, end, nextPtr); } break; case XML_TOK_CHAR_REF: { int n = XmlCharRefNumber(enc, s); if (n < 0) return XML_ERROR_BAD_CHAR_REF; if (characterDataHandler) { XML_Char buf[XML_ENCODE_MAX]; characterDataHandler(handlerArg, buf, XmlEncode(n, (ICHAR *)buf)); } else if (defaultHandler) reportDefault(parser, enc, s, next); } break; case XML_TOK_XML_DECL: return XML_ERROR_MISPLACED_XML_PI; case XML_TOK_DATA_NEWLINE: if (characterDataHandler) { XML_Char c = 0xA; characterDataHandler(handlerArg, &c, 1); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_CDATA_SECT_OPEN: { enum XML_Error result; if (startCdataSectionHandler) startCdataSectionHandler(handlerArg); #if 0 /* Suppose you doing a transformation on a document that involves changing only the character data. You set up a defaultHandler and a characterDataHandler. The defaultHandler simply copies characters through. The characterDataHandler does the transformation and writes the characters out escaping them as necessary. This case will fail to work if we leave out the following two lines (because & and < inside CDATA sections will be incorrectly escaped). However, now we have a start/endCdataSectionHandler, so it seems easier to let the user deal with this. */ else if (characterDataHandler) characterDataHandler(handlerArg, dataBuf, 0); #endif else if (defaultHandler) reportDefault(parser, enc, s, next); result = doCdataSection(parser, enc, &next, end, nextPtr); if (!next) { processor = cdataSectionProcessor; return result; } } break; case XML_TOK_TRAILING_RSQB: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } if (characterDataHandler) { if (MUST_CONVERT(enc, s)) { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); characterDataHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); } else characterDataHandler(handlerArg, (XML_Char *)s, (XML_Char *)end - (XML_Char *)s); } else if (defaultHandler) reportDefault(parser, enc, s, end); if (startTagLevel == 0) { *eventPP = end; return XML_ERROR_NO_ELEMENTS; } if (tagLevel != startTagLevel) { *eventPP = end; return XML_ERROR_ASYNC_ENTITY; } return XML_ERROR_NONE; case XML_TOK_DATA_CHARS: if (characterDataHandler) { if (MUST_CONVERT(enc, s)) { for (;;) { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = s; characterDataHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); if (s == next) break; *eventPP = s; } } else characterDataHandler(handlerArg, (XML_Char *)s, (XML_Char *)next - (XML_Char *)s); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_PI: if (!reportProcessingInstruction(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_COMMENT: if (!reportComment(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; break; default: if (defaultHandler) reportDefault(parser, enc, s, next); break; } *eventPP = s = next; } /* not reached */ } /* If tagNamePtr is non-null, build a real list of attributes, otherwise just check the attributes for well-formedness. */ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr, TAG_NAME *tagNamePtr, BINDING **bindingsPtr) { ELEMENT_TYPE *elementType = 0; int nDefaultAtts = 0; const XML_Char **appAtts; int attIndex = 0; int i; int n; int nPrefixes = 0; BINDING *binding; const XML_Char *localPart; if (tagNamePtr) { elementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, tagNamePtr->str, 0); if (!elementType) { tagNamePtr->str = poolCopyString(&dtd.pool, tagNamePtr->str); if (!tagNamePtr->str) return XML_ERROR_NO_MEMORY; elementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, tagNamePtr->str, sizeof(ELEMENT_TYPE)); if (!elementType) return XML_ERROR_NO_MEMORY; if (ns && !setElementTypePrefix(parser, elementType)) return XML_ERROR_NO_MEMORY; } nDefaultAtts = elementType->nDefaultAtts; } n = XmlGetAttributes(enc, attStr, attsSize, atts); if (n + nDefaultAtts > attsSize) { int oldAttsSize = attsSize; attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; atts = realloc((void *)atts, attsSize * sizeof(ATTRIBUTE)); if (!atts) return XML_ERROR_NO_MEMORY; if (n > oldAttsSize) XmlGetAttributes(enc, attStr, n, atts); } appAtts = (const XML_Char **)atts; for (i = 0; i < n; i++) { ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name, atts[i].name + XmlNameLength(enc, atts[i].name)); if (!attId) return XML_ERROR_NO_MEMORY; if ((attId->name)[-1]) { if (enc == encoding) eventPtr = atts[i].name; return XML_ERROR_DUPLICATE_ATTRIBUTE; } (attId->name)[-1] = 1; appAtts[attIndex++] = attId->name; if (!atts[i].normalized) { enum XML_Error result; int isCdata = 1; if (attId->maybeTokenized) { int j; for (j = 0; j < nDefaultAtts; j++) { if (attId == elementType->defaultAtts[j].id) { isCdata = elementType->defaultAtts[j].isCdata; break; } } } result = storeAttributeValue(parser, enc, isCdata, atts[i].valuePtr, atts[i].valueEnd, &tempPool); if (result) return result; if (tagNamePtr) { appAtts[attIndex] = poolStart(&tempPool); poolFinish(&tempPool); } else poolDiscard(&tempPool); } else if (tagNamePtr) { appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr, atts[i].valueEnd); if (appAtts[attIndex] == 0) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); } if (attId->prefix && tagNamePtr) { if (attId->xmlns) { if (!addBinding(parser, attId->prefix, attId, appAtts[attIndex], bindingsPtr)) return XML_ERROR_NO_MEMORY; --attIndex; } else { attIndex++; nPrefixes++; (attId->name)[-1] = 2; } } else attIndex++; } nSpecifiedAtts = attIndex; if (tagNamePtr) { int j; for (j = 0; j < nDefaultAtts; j++) { const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + j; if (!(da->id->name)[-1] && da->value) { if (da->id->prefix) { if (da->id->xmlns) { if (!addBinding(parser, da->id->prefix, da->id, da->value, bindingsPtr)) return XML_ERROR_NO_MEMORY; } else { (da->id->name)[-1] = 2; nPrefixes++; appAtts[attIndex++] = da->id->name; appAtts[attIndex++] = da->value; } } else { (da->id->name)[-1] = 1; appAtts[attIndex++] = da->id->name; appAtts[attIndex++] = da->value; } } } appAtts[attIndex] = 0; } i = 0; if (nPrefixes) { for (; i < attIndex; i += 2) { if (appAtts[i][-1] == 2) { ATTRIBUTE_ID *id; ((XML_Char *)(appAtts[i]))[-1] = 0; id = (ATTRIBUTE_ID *)lookup(&dtd.attributeIds, appAtts[i], 0); if (id->prefix->binding) { int j; const BINDING *b = id->prefix->binding; const XML_Char *s = appAtts[i]; for (j = 0; j < b->uriLen; j++) { if (!poolAppendChar(&tempPool, b->uri[j])) return XML_ERROR_NO_MEMORY; } while (*s++ != ':') ; do { if (!poolAppendChar(&tempPool, *s)) return XML_ERROR_NO_MEMORY; } while (*s++); appAtts[i] = poolStart(&tempPool); poolFinish(&tempPool); } if (!--nPrefixes) break; } else ((XML_Char *)(appAtts[i]))[-1] = 0; } } for (; i < attIndex; i += 2) ((XML_Char *)(appAtts[i]))[-1] = 0; if (!tagNamePtr) return XML_ERROR_NONE; for (binding = *bindingsPtr; binding; binding = binding->nextTagBinding) binding->attId->name[-1] = 0; if (elementType->prefix) { binding = elementType->prefix->binding; if (!binding) return XML_ERROR_NONE; localPart = tagNamePtr->str; while (*localPart++ != XML_T(':')) ; } else if (dtd.defaultPrefix.binding) { binding = dtd.defaultPrefix.binding; localPart = tagNamePtr->str; } else return XML_ERROR_NONE; tagNamePtr->localPart = localPart; tagNamePtr->uriLen = binding->uriLen; i = binding->uriLen; do { if (i == binding->uriAlloc) { binding->uri = realloc(binding->uri, binding->uriAlloc *= 2); if (!binding->uri) return XML_ERROR_NO_MEMORY; } binding->uri[i++] = *localPart; } while (*localPart++); tagNamePtr->str = binding->uri; return XML_ERROR_NONE; } static int addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr) { BINDING *b; int len; for (len = 0; uri[len]; len++) ; if (namespaceSeparator) len++; if (freeBindingList) { b = freeBindingList; if (len > b->uriAlloc) { b->uri = realloc(b->uri, len + EXPAND_SPARE); if (!b->uri) return 0; b->uriAlloc = len + EXPAND_SPARE; } freeBindingList = b->nextTagBinding; } else { b = malloc(sizeof(BINDING)); if (!b) return 0; b->uri = malloc(sizeof(XML_Char) * len + EXPAND_SPARE); if (!b->uri) { free(b); return 0; } b->uriAlloc = len; } b->uriLen = len; memcpy(b->uri, uri, len * sizeof(XML_Char)); if (namespaceSeparator) b->uri[len - 1] = namespaceSeparator; b->prefix = prefix; b->attId = attId; b->prevPrefixBinding = prefix->binding; if (*uri == XML_T('\0') && prefix == &dtd.defaultPrefix) prefix->binding = 0; else prefix->binding = b; b->nextTagBinding = *bindingsPtr; *bindingsPtr = b; if (startNamespaceDeclHandler) startNamespaceDeclHandler(handlerArg, prefix->name, prefix->binding ? uri : 0); return 1; } /* The idea here is to avoid using stack for each CDATA section when the whole file is parsed with one call. */ static enum XML_Error cdataSectionProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doCdataSection(parser, encoding, &start, end, endPtr); if (start) { processor = contentProcessor; return contentProcessor(parser, start, end, endPtr); } return result; } /* startPtr gets set to non-null is the section is closed, and to null if the section is not yet closed. */ static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, const char *end, const char **nextPtr) { const char *s = *startPtr; const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; *eventPP = s; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } *eventPP = s; *startPtr = 0; for (;;) { const char *next; int tok = XmlCdataSectionTok(enc, s, end, &next); *eventEndPP = next; switch (tok) { case XML_TOK_CDATA_SECT_CLOSE: if (endCdataSectionHandler) endCdataSectionHandler(handlerArg); #if 0 /* see comment under XML_TOK_CDATA_SECT_OPEN */ else if (characterDataHandler) characterDataHandler(handlerArg, dataBuf, 0); #endif else if (defaultHandler) reportDefault(parser, enc, s, next); *startPtr = next; return XML_ERROR_NONE; case XML_TOK_DATA_NEWLINE: if (characterDataHandler) { XML_Char c = 0xA; characterDataHandler(handlerArg, &c, 1); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_DATA_CHARS: if (characterDataHandler) { if (MUST_CONVERT(enc, s)) { for (;;) { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = next; characterDataHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); if (s == next) break; *eventPP = s; } } else characterDataHandler(handlerArg, (XML_Char *)s, (XML_Char *)next - (XML_Char *)s); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL_CHAR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; case XML_TOK_PARTIAL: case XML_TOK_NONE: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_CDATA_SECTION; default: abort(); } *eventPP = s = next; } /* not reached */ } #ifdef XML_DTD /* The idea here is to avoid using stack for each IGNORE section when the whole file is parsed with one call. */ static enum XML_Error ignoreSectionProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doIgnoreSection(parser, encoding, &start, end, endPtr); if (start) { processor = prologProcessor; return prologProcessor(parser, start, end, endPtr); } return result; } /* startPtr gets set to non-null is the section is closed, and to null if the section is not yet closed. */ static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, const char *end, const char **nextPtr) { const char *next; int tok; const char *s = *startPtr; const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; *eventPP = s; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } *eventPP = s; *startPtr = 0; tok = XmlIgnoreSectionTok(enc, s, end, &next); *eventEndPP = next; switch (tok) { case XML_TOK_IGNORE_SECT: if (defaultHandler) reportDefault(parser, enc, s, next); *startPtr = next; return XML_ERROR_NONE; case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL_CHAR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; case XML_TOK_PARTIAL: case XML_TOK_NONE: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_SYNTAX; /* XML_ERROR_UNCLOSED_IGNORE_SECTION */ default: abort(); } /* not reached */ } #endif /* XML_DTD */ static enum XML_Error initializeEncoding(XML_Parser parser) { const char *s; #ifdef XML_UNICODE char encodingBuf[128]; if (!protocolEncodingName) s = 0; else { int i; for (i = 0; protocolEncodingName[i]; i++) { if (i == sizeof(encodingBuf) - 1 || protocolEncodingName[i] >= 0x80 || protocolEncodingName[i] < 0) { encodingBuf[0] = '\0'; break; } encodingBuf[i] = (char)protocolEncodingName[i]; } encodingBuf[i] = '\0'; s = encodingBuf; } #else s = protocolEncodingName; #endif if ((ns ? XmlInitEncodingNS : XmlInitEncoding)(&initEncoding, &encoding, s)) return XML_ERROR_NONE; return handleUnknownEncoding(parser, protocolEncodingName); } static enum XML_Error processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s, const char *next) { const char *encodingName = 0; const ENCODING *newEncoding = 0; const char *version; int standalone = -1; if (!(ns ? XmlParseXmlDeclNS : XmlParseXmlDecl)(isGeneralTextEntity, encoding, s, next, &eventPtr, &version, &encodingName, &newEncoding, &standalone)) return XML_ERROR_SYNTAX; if (!isGeneralTextEntity && standalone == 1) { dtd.standalone = 1; #ifdef XML_DTD if (paramEntityParsing == XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE) paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; #endif /* XML_DTD */ } if (defaultHandler) reportDefault(parser, encoding, s, next); if (!protocolEncodingName) { if (newEncoding) { if (newEncoding->minBytesPerChar != encoding->minBytesPerChar) { eventPtr = encodingName; return XML_ERROR_INCORRECT_ENCODING; } encoding = newEncoding; } else if (encodingName) { enum XML_Error result; const XML_Char *s = poolStoreString(&tempPool, encoding, encodingName, encodingName + XmlNameLength(encoding, encodingName)); if (!s) return XML_ERROR_NO_MEMORY; if (xmlDeclHandler) xmlDeclHandler(userData, version, s, standalone); result = handleUnknownEncoding(parser, s); poolDiscard(&tempPool); if (result == XML_ERROR_UNKNOWN_ENCODING) eventPtr = encodingName; return result; } } return XML_ERROR_NONE; } static enum XML_Error handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName) { if (unknownEncodingHandler) { XML_Encoding info; int i; for (i = 0; i < 256; i++) info.map[i] = -1; info.convert = 0; info.data = 0; info.release = 0; if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName, &info)) { ENCODING *enc; unknownEncodingMem = malloc(XmlSizeOfUnknownEncoding()); if (!unknownEncodingMem) { if (info.release) info.release(info.data); return XML_ERROR_NO_MEMORY; } enc = (ns ? XmlInitUnknownEncodingNS : XmlInitUnknownEncoding)(unknownEncodingMem, info.map, info.convert, info.data); if (enc) { unknownEncodingData = info.data; unknownEncodingRelease = info.release; encoding = enc; return XML_ERROR_NONE; } } if (info.release) info.release(info.data); } return XML_ERROR_UNKNOWN_ENCODING; } static enum XML_Error prologInitProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { enum XML_Error result = initializeEncoding(parser); if (result != XML_ERROR_NONE) return result; processor = prologProcessor; return prologProcessor(parser, s, end, nextPtr); } static enum XML_Error prologProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *next; int tok = XmlPrologTok(encoding, s, end, &next); return doProlog(parser, encoding, s, end, tok, next, nextPtr); } static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr) { #ifdef XML_DTD static const XML_Char externalSubsetName[] = { '#' , '\0' }; #endif /* XML_DTD */ const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } for (;;) { int role; *eventPP = s; *eventEndPP = next; if (tok <= 0) { if (nextPtr != 0 && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: #ifdef XML_DTD if (enc != encoding) return XML_ERROR_NONE; if (parentParser) { if (XmlTokenRole(&prologState, XML_TOK_NONE, end, end, enc) == XML_ROLE_ERROR) return XML_ERROR_SYNTAX; hadExternalDoctype = 0; return XML_ERROR_NONE; } #endif /* XML_DTD */ return XML_ERROR_NO_ELEMENTS; default: tok = -tok; next = end; break; } } role = XmlTokenRole(&prologState, tok, s, next, enc); switch (role) { case XML_ROLE_XML_DECL: { enum XML_Error result = processXmlDecl(parser, 0, s, next); if (result != XML_ERROR_NONE) return result; enc = encoding; } break; #ifdef XML_DTD case XML_ROLE_TEXT_DECL: { enum XML_Error result = processXmlDecl(parser, 1, s, next); if (result != XML_ERROR_NONE) return result; enc = encoding; } break; #endif /* XML_DTD */ case XML_ROLE_DOCTYPE_PUBLIC_ID: #ifdef XML_DTD declEntity = (ENTITY *)lookup(&dtd.paramEntities, externalSubsetName, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; #endif /* XML_DTD */ /* fall through */ case XML_ROLE_ENTITY_PUBLIC_ID: if (!XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_SYNTAX; if (declEntity) { XML_Char *tem = poolStoreString(&dtd.pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); declEntity->publicId = tem; poolFinish(&dtd.pool); } break; case XML_ROLE_DOCTYPE_CLOSE: if (dtd.complete && hadExternalDoctype) { dtd.complete = 0; #ifdef XML_DTD if (paramEntityParsing && externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(&dtd.paramEntities, externalSubsetName, 0); if (!externalEntityRefHandler(externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; } #endif /* XML_DTD */ if (!dtd.complete && !dtd.standalone && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; } break; case XML_ROLE_INSTANCE_START: processor = contentProcessor; return contentProcessor(parser, s, end, nextPtr); case XML_ROLE_ATTLIST_ELEMENT_NAME: { const XML_Char *name = poolStoreString(&dtd.pool, enc, s, next); if (!name) return XML_ERROR_NO_MEMORY; declElementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, name, sizeof(ELEMENT_TYPE)); if (!declElementType) return XML_ERROR_NO_MEMORY; if (declElementType->name != name) poolDiscard(&dtd.pool); else { poolFinish(&dtd.pool); if (!setElementTypePrefix(parser, declElementType)) return XML_ERROR_NO_MEMORY; } break; } case XML_ROLE_ATTRIBUTE_NAME: declAttributeId = getAttributeId(parser, enc, s, next); if (!declAttributeId) return XML_ERROR_NO_MEMORY; declAttributeIsCdata = 0; break; case XML_ROLE_ATTRIBUTE_TYPE_CDATA: declAttributeIsCdata = 1; break; case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE: case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE: if (dtd.complete && !defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, 0)) return XML_ERROR_NO_MEMORY; break; case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE: case XML_ROLE_FIXED_ATTRIBUTE_VALUE: { const XML_Char *attVal; enum XML_Error result = storeAttributeValue(parser, enc, declAttributeIsCdata, s + enc->minBytesPerChar, next - enc->minBytesPerChar, &dtd.pool); if (result) return result; attVal = poolStart(&dtd.pool); poolFinish(&dtd.pool); if (dtd.complete && !defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, attVal)) return XML_ERROR_NO_MEMORY; break; } case XML_ROLE_ENTITY_VALUE: { enum XML_Error result = storeEntityValue(parser, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (declEntity) { declEntity->textPtr = poolStart(&dtd.pool); declEntity->textLen = poolLength(&dtd.pool); poolFinish(&dtd.pool); } else poolDiscard(&dtd.pool); if (result != XML_ERROR_NONE) return result; } break; case XML_ROLE_DOCTYPE_SYSTEM_ID: if (!dtd.standalone #ifdef XML_DTD && !paramEntityParsing #endif /* XML_DTD */ && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; hadExternalDoctype = 1; #ifndef XML_DTD break; #else /* XML_DTD */ if (!declEntity) { declEntity = (ENTITY *)lookup(&dtd.paramEntities, externalSubsetName, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; } /* fall through */ #endif /* XML_DTD */ case XML_ROLE_ENTITY_SYSTEM_ID: if (declEntity) { declEntity->systemId = poolStoreString(&dtd.pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!declEntity->systemId) return XML_ERROR_NO_MEMORY; declEntity->base = curBase; poolFinish(&dtd.pool); } break; case XML_ROLE_ENTITY_NOTATION_NAME: if (declEntity) { declEntity->notation = poolStoreString(&dtd.pool, enc, s, next); if (!declEntity->notation) return XML_ERROR_NO_MEMORY; poolFinish(&dtd.pool); if (unparsedEntityDeclHandler) { *eventEndPP = s; unparsedEntityDeclHandler(handlerArg, declEntity->name, declEntity->base, declEntity->systemId, declEntity->publicId, declEntity->notation); } } break; case XML_ROLE_GENERAL_ENTITY_NAME: { const XML_Char *name; if (XmlPredefinedEntityName(enc, s, next)) { declEntity = 0; break; } name = poolStoreString(&dtd.pool, enc, s, next); if (!name) return XML_ERROR_NO_MEMORY; if (dtd.complete) { declEntity = (ENTITY *)lookup(&dtd.generalEntities, name, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; if (declEntity->name != name) { poolDiscard(&dtd.pool); declEntity = 0; } else poolFinish(&dtd.pool); } else { poolDiscard(&dtd.pool); declEntity = 0; } } break; case XML_ROLE_PARAM_ENTITY_NAME: #ifdef XML_DTD if (dtd.complete) { const XML_Char *name = poolStoreString(&dtd.pool, enc, s, next); if (!name) return XML_ERROR_NO_MEMORY; declEntity = (ENTITY *)lookup(&dtd.paramEntities, name, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; if (declEntity->name != name) { poolDiscard(&dtd.pool); declEntity = 0; } else poolFinish(&dtd.pool); } #else /* not XML_DTD */ declEntity = 0; #endif /* not XML_DTD */ break; case XML_ROLE_NOTATION_NAME: declNotationPublicId = 0; declNotationName = 0; if (notationDeclHandler) { declNotationName = poolStoreString(&tempPool, enc, s, next); if (!declNotationName) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); } break; case XML_ROLE_NOTATION_PUBLIC_ID: if (!XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_SYNTAX; if (declNotationName) { XML_Char *tem = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); declNotationPublicId = tem; poolFinish(&tempPool); } break; case XML_ROLE_NOTATION_SYSTEM_ID: if (declNotationName && notationDeclHandler) { const XML_Char *systemId = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!systemId) return XML_ERROR_NO_MEMORY; *eventEndPP = s; notationDeclHandler(handlerArg, declNotationName, curBase, systemId, declNotationPublicId); } poolClear(&tempPool); break; case XML_ROLE_NOTATION_NO_SYSTEM_ID: if (declNotationPublicId && notationDeclHandler) { *eventEndPP = s; notationDeclHandler(handlerArg, declNotationName, curBase, 0, declNotationPublicId); } poolClear(&tempPool); break; case XML_ROLE_ERROR: switch (tok) { case XML_TOK_PARAM_ENTITY_REF: return XML_ERROR_PARAM_ENTITY_REF; case XML_TOK_XML_DECL: return XML_ERROR_MISPLACED_XML_PI; default: return XML_ERROR_SYNTAX; } #ifdef XML_DTD case XML_ROLE_IGNORE_SECT: { enum XML_Error result; if (defaultHandler) reportDefault(parser, enc, s, next); result = doIgnoreSection(parser, enc, &next, end, nextPtr); if (!next) { processor = ignoreSectionProcessor; return result; } } break; #endif /* XML_DTD */ case XML_ROLE_GROUP_OPEN: if (prologState.level >= groupSize) { if (groupSize) groupConnector = realloc(groupConnector, groupSize *= 2); else groupConnector = malloc(groupSize = 32); if (!groupConnector) return XML_ERROR_NO_MEMORY; } groupConnector[prologState.level] = 0; break; case XML_ROLE_GROUP_SEQUENCE: if (groupConnector[prologState.level] == '|') return XML_ERROR_SYNTAX; groupConnector[prologState.level] = ','; break; case XML_ROLE_GROUP_CHOICE: if (groupConnector[prologState.level] == ',') return XML_ERROR_SYNTAX; groupConnector[prologState.level] = '|'; break; case XML_ROLE_PARAM_ENTITY_REF: #ifdef XML_DTD case XML_ROLE_INNER_PARAM_ENTITY_REF: if (paramEntityParsing && (dtd.complete || role == XML_ROLE_INNER_PARAM_ENTITY_REF)) { const XML_Char *name; ENTITY *entity; name = poolStoreString(&dtd.pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd.paramEntities, name, 0); poolDiscard(&dtd.pool); if (!entity) { /* FIXME what to do if !dtd.complete? */ return XML_ERROR_UNDEFINED_ENTITY; } if (entity->open) return XML_ERROR_RECURSIVE_ENTITY_REF; if (entity->textPtr) { enum XML_Error result; result = processInternalParamEntity(parser, entity); if (result != XML_ERROR_NONE) return result; break; } if (role == XML_ROLE_INNER_PARAM_ENTITY_REF) return XML_ERROR_PARAM_ENTITY_REF; if (externalEntityRefHandler) { dtd.complete = 0; entity->open = 1; if (!externalEntityRefHandler(externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) { entity->open = 0; return XML_ERROR_EXTERNAL_ENTITY_HANDLING; } entity->open = 0; if (dtd.complete) break; } } #endif /* XML_DTD */ if (!dtd.standalone && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; dtd.complete = 0; if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_ROLE_NONE: switch (tok) { case XML_TOK_PI: if (!reportProcessingInstruction(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_COMMENT: if (!reportComment(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; break; } break; } if (defaultHandler) { switch (tok) { case XML_TOK_PI: case XML_TOK_COMMENT: case XML_TOK_BOM: case XML_TOK_XML_DECL: #ifdef XML_DTD case XML_TOK_IGNORE_SECT: #endif /* XML_DTD */ case XML_TOK_PARAM_ENTITY_REF: break; default: if (role != XML_ROLE_IGNORE_SECT) reportDefault(parser, enc, s, next); } } s = next; tok = XmlPrologTok(enc, s, end, &next); } /* not reached */ } static enum XML_Error epilogProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { processor = epilogProcessor; eventPtr = s; for (;;) { const char *next; int tok = XmlPrologTok(encoding, s, end, &next); eventEndPtr = next; switch (tok) { case -XML_TOK_PROLOG_S: if (defaultHandler) { eventEndPtr = end; reportDefault(parser, encoding, s, end); } /* fall through */ case XML_TOK_NONE: if (nextPtr) *nextPtr = end; return XML_ERROR_NONE; case XML_TOK_PROLOG_S: if (defaultHandler) reportDefault(parser, encoding, s, next); break; case XML_TOK_PI: if (!reportProcessingInstruction(parser, encoding, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_COMMENT: if (!reportComment(parser, encoding, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_INVALID: eventPtr = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; default: return XML_ERROR_JUNK_AFTER_DOC_ELEMENT; } eventPtr = s = next; } } #ifdef XML_DTD static enum XML_Error processInternalParamEntity(XML_Parser parser, ENTITY *entity) { const char *s, *end, *next; int tok; enum XML_Error result; OPEN_INTERNAL_ENTITY openEntity; entity->open = 1; openEntity.next = openInternalEntities; openInternalEntities = &openEntity; openEntity.entity = entity; openEntity.internalEventPtr = 0; openEntity.internalEventEndPtr = 0; s = (char *)entity->textPtr; end = (char *)(entity->textPtr + entity->textLen); tok = XmlPrologTok(internalEncoding, s, end, &next); result = doProlog(parser, internalEncoding, s, end, tok, next, 0); entity->open = 0; openInternalEntities = openEntity.next; return result; } #endif /* XML_DTD */ static enum XML_Error errorProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { return errorCode; } static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, const char *ptr, const char *end, STRING_POOL *pool) { enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr, end, pool); if (result) return result; if (!isCdata && poolLength(pool) && poolLastChar(pool) == 0x20) poolChop(pool); if (!poolAppendChar(pool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; return XML_ERROR_NONE; } static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, const char *ptr, const char *end, STRING_POOL *pool) { for (;;) { const char *next; int tok = XmlAttributeValueTok(enc, ptr, end, &next); switch (tok) { case XML_TOK_NONE: return XML_ERROR_NONE; case XML_TOK_INVALID: if (enc == encoding) eventPtr = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: if (enc == encoding) eventPtr = ptr; return XML_ERROR_INVALID_TOKEN; case XML_TOK_CHAR_REF: { XML_Char buf[XML_ENCODE_MAX]; int i; int n = XmlCharRefNumber(enc, ptr); if (n < 0) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_BAD_CHAR_REF; } if (!isCdata && n == 0x20 /* space */ && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20)) break; n = XmlEncode(n, (ICHAR *)buf); if (!n) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_BAD_CHAR_REF; } for (i = 0; i < n; i++) { if (!poolAppendChar(pool, buf[i])) return XML_ERROR_NO_MEMORY; } } break; case XML_TOK_DATA_CHARS: if (!poolAppend(pool, enc, ptr, next)) return XML_ERROR_NO_MEMORY; break; break; case XML_TOK_TRAILING_CR: next = ptr + enc->minBytesPerChar; /* fall through */ case XML_TOK_ATTRIBUTE_VALUE_S: case XML_TOK_DATA_NEWLINE: if (!isCdata && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20)) break; if (!poolAppendChar(pool, 0x20)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_ENTITY_REF: { const XML_Char *name; ENTITY *entity; XML_Char ch = XmlPredefinedEntityName(enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar); if (ch) { if (!poolAppendChar(pool, ch)) return XML_ERROR_NO_MEMORY; break; } name = poolStoreString(&temp2Pool, enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd.generalEntities, name, 0); poolDiscard(&temp2Pool); if (!entity) { if (dtd.complete) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_UNDEFINED_ENTITY; } } else if (entity->open) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_RECURSIVE_ENTITY_REF; } else if (entity->notation) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_BINARY_ENTITY_REF; } else if (!entity->textPtr) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; } else { enum XML_Error result; const XML_Char *textEnd = entity->textPtr + entity->textLen; entity->open = 1; result = appendAttributeValue(parser, internalEncoding, isCdata, (char *)entity->textPtr, (char *)textEnd, pool); entity->open = 0; if (result) return result; } } break; default: abort(); } ptr = next; } /* not reached */ } static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *entityTextPtr, const char *entityTextEnd) { STRING_POOL *pool = &(dtd.pool); for (;;) { const char *next; int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next); switch (tok) { case XML_TOK_PARAM_ENTITY_REF: #ifdef XML_DTD if (parentParser || enc != encoding) { enum XML_Error result; const XML_Char *name; ENTITY *entity; name = poolStoreString(&tempPool, enc, entityTextPtr + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd.paramEntities, name, 0); poolDiscard(&tempPool); if (!entity) { if (enc == encoding) eventPtr = entityTextPtr; return XML_ERROR_UNDEFINED_ENTITY; } if (entity->open) { if (enc == encoding) eventPtr = entityTextPtr; return XML_ERROR_RECURSIVE_ENTITY_REF; } if (entity->systemId) { if (enc == encoding) eventPtr = entityTextPtr; return XML_ERROR_PARAM_ENTITY_REF; } entity->open = 1; result = storeEntityValue(parser, internalEncoding, (char *)entity->textPtr, (char *)(entity->textPtr + entity->textLen)); entity->open = 0; if (result) return result; break; } #endif /* XML_DTD */ eventPtr = entityTextPtr; return XML_ERROR_SYNTAX; case XML_TOK_NONE: return XML_ERROR_NONE; case XML_TOK_ENTITY_REF: case XML_TOK_DATA_CHARS: if (!poolAppend(pool, enc, entityTextPtr, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_TRAILING_CR: next = entityTextPtr + enc->minBytesPerChar; /* fall through */ case XML_TOK_DATA_NEWLINE: if (pool->end == pool->ptr && !poolGrow(pool)) return XML_ERROR_NO_MEMORY; *(pool->ptr)++ = 0xA; break; case XML_TOK_CHAR_REF: { XML_Char buf[XML_ENCODE_MAX]; int i; int n = XmlCharRefNumber(enc, entityTextPtr); if (n < 0) { if (enc == encoding) eventPtr = entityTextPtr; return XML_ERROR_BAD_CHAR_REF; } n = XmlEncode(n, (ICHAR *)buf); if (!n) { if (enc == encoding) eventPtr = entityTextPtr; return XML_ERROR_BAD_CHAR_REF; } for (i = 0; i < n; i++) { if (pool->end == pool->ptr && !poolGrow(pool)) return XML_ERROR_NO_MEMORY; *(pool->ptr)++ = buf[i]; } } break; case XML_TOK_PARTIAL: if (enc == encoding) eventPtr = entityTextPtr; return XML_ERROR_INVALID_TOKEN; case XML_TOK_INVALID: if (enc == encoding) eventPtr = next; return XML_ERROR_INVALID_TOKEN; default: abort(); } entityTextPtr = next; } /* not reached */ } static void normalizeLines(XML_Char *s) { XML_Char *p; for (;; s++) { if (*s == XML_T('\0')) return; if (*s == 0xD) break; } p = s; do { if (*s == 0xD) { *p++ = 0xA; if (*++s == 0xA) s++; } else *p++ = *s++; } while (*s); *p = XML_T('\0'); } static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { const XML_Char *target; XML_Char *data; const char *tem; if (!processingInstructionHandler) { if (defaultHandler) reportDefault(parser, enc, start, end); return 1; } start += enc->minBytesPerChar * 2; tem = start + XmlNameLength(enc, start); target = poolStoreString(&tempPool, enc, start, tem); if (!target) return 0; poolFinish(&tempPool); data = poolStoreString(&tempPool, enc, XmlSkipS(enc, tem), end - enc->minBytesPerChar*2); if (!data) return 0; normalizeLines(data); processingInstructionHandler(handlerArg, target, data); poolClear(&tempPool); return 1; } static int reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { XML_Char *data; if (!commentHandler) { if (defaultHandler) reportDefault(parser, enc, start, end); return 1; } data = poolStoreString(&tempPool, enc, start + enc->minBytesPerChar * 4, end - enc->minBytesPerChar * 3); if (!data) return 0; normalizeLines(data); commentHandler(handlerArg, data); poolClear(&tempPool); return 1; } static void reportDefault(XML_Parser parser, const ENCODING *enc, const char *s, const char *end) { if (MUST_CONVERT(enc, s)) { const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } do { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = s; defaultHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); *eventPP = s; } while (s != end); } else defaultHandler(handlerArg, (XML_Char *)s, (XML_Char *)end - (XML_Char *)s); } static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, int isCdata, const XML_Char *value) { DEFAULT_ATTRIBUTE *att; if (value) { /* The handling of default attributes gets messed up if we have a default which duplicates a non-default. */ int i; for (i = 0; i < type->nDefaultAtts; i++) if (attId == type->defaultAtts[i].id) return 1; } if (type->nDefaultAtts == type->allocDefaultAtts) { if (type->allocDefaultAtts == 0) { type->allocDefaultAtts = 8; type->defaultAtts = malloc(type->allocDefaultAtts*sizeof(DEFAULT_ATTRIBUTE)); } else { type->allocDefaultAtts *= 2; type->defaultAtts = realloc(type->defaultAtts, type->allocDefaultAtts*sizeof(DEFAULT_ATTRIBUTE)); } if (!type->defaultAtts) return 0; } att = type->defaultAtts + type->nDefaultAtts; att->id = attId; att->value = value; att->isCdata = isCdata; if (!isCdata) attId->maybeTokenized = 1; type->nDefaultAtts += 1; return 1; } static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType) { const XML_Char *name; for (name = elementType->name; *name; name++) { if (*name == XML_T(':')) { PREFIX *prefix; const XML_Char *s; for (s = elementType->name; s != name; s++) { if (!poolAppendChar(&dtd.pool, *s)) return 0; } if (!poolAppendChar(&dtd.pool, XML_T('\0'))) return 0; prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&dtd.pool), sizeof(PREFIX)); if (!prefix) return 0; if (prefix->name == poolStart(&dtd.pool)) poolFinish(&dtd.pool); else poolDiscard(&dtd.pool); elementType->prefix = prefix; } } return 1; } static ATTRIBUTE_ID * getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { ATTRIBUTE_ID *id; const XML_Char *name; if (!poolAppendChar(&dtd.pool, XML_T('\0'))) return 0; name = poolStoreString(&dtd.pool, enc, start, end); if (!name) return 0; ++name; id = (ATTRIBUTE_ID *)lookup(&dtd.attributeIds, name, sizeof(ATTRIBUTE_ID)); if (!id) return 0; if (id->name != name) poolDiscard(&dtd.pool); else { poolFinish(&dtd.pool); if (!ns) ; else if (name[0] == 'x' && name[1] == 'm' && name[2] == 'l' && name[3] == 'n' && name[4] == 's' && (name[5] == XML_T('\0') || name[5] == XML_T(':'))) { if (name[5] == '\0') id->prefix = &dtd.defaultPrefix; else id->prefix = (PREFIX *)lookup(&dtd.prefixes, name + 6, sizeof(PREFIX)); id->xmlns = 1; } else { int i; for (i = 0; name[i]; i++) { if (name[i] == XML_T(':')) { int j; for (j = 0; j < i; j++) { if (!poolAppendChar(&dtd.pool, name[j])) return 0; } if (!poolAppendChar(&dtd.pool, XML_T('\0'))) return 0; id->prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&dtd.pool), sizeof(PREFIX)); if (id->prefix->name == poolStart(&dtd.pool)) poolFinish(&dtd.pool); else poolDiscard(&dtd.pool); break; } } } } return id; } #define CONTEXT_SEP XML_T('\f') static const XML_Char *getContext(XML_Parser parser) { HASH_TABLE_ITER iter; int needSep = 0; if (dtd.defaultPrefix.binding) { int i; int len; if (!poolAppendChar(&tempPool, XML_T('='))) return 0; len = dtd.defaultPrefix.binding->uriLen; if (namespaceSeparator != XML_T('\0')) len--; for (i = 0; i < len; i++) if (!poolAppendChar(&tempPool, dtd.defaultPrefix.binding->uri[i])) return 0; needSep = 1; } hashTableIterInit(&iter, &(dtd.prefixes)); for (;;) { int i; int len; const XML_Char *s; PREFIX *prefix = (PREFIX *)hashTableIterNext(&iter); if (!prefix) break; if (!prefix->binding) continue; if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP)) return 0; for (s = prefix->name; *s; s++) if (!poolAppendChar(&tempPool, *s)) return 0; if (!poolAppendChar(&tempPool, XML_T('='))) return 0; len = prefix->binding->uriLen; if (namespaceSeparator != XML_T('\0')) len--; for (i = 0; i < len; i++) if (!poolAppendChar(&tempPool, prefix->binding->uri[i])) return 0; needSep = 1; } hashTableIterInit(&iter, &(dtd.generalEntities)); for (;;) { const XML_Char *s; ENTITY *e = (ENTITY *)hashTableIterNext(&iter); if (!e) break; if (!e->open) continue; if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP)) return 0; for (s = e->name; *s; s++) if (!poolAppendChar(&tempPool, *s)) return 0; needSep = 1; } if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; return tempPool.start; } static int setContext(XML_Parser parser, const XML_Char *context) { const XML_Char *s = context; while (*context != XML_T('\0')) { if (*s == CONTEXT_SEP || *s == XML_T('\0')) { ENTITY *e; if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; e = (ENTITY *)lookup(&dtd.generalEntities, poolStart(&tempPool), 0); if (e) e->open = 1; if (*s != XML_T('\0')) s++; context = s; poolDiscard(&tempPool); } else if (*s == '=') { PREFIX *prefix; if (poolLength(&tempPool) == 0) prefix = &dtd.defaultPrefix; else { if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&tempPool), sizeof(PREFIX)); if (!prefix) return 0; if (prefix->name == poolStart(&tempPool)) poolFinish(&tempPool); else poolDiscard(&tempPool); } for (context = s + 1; *context != CONTEXT_SEP && *context != XML_T('\0'); context++) if (!poolAppendChar(&tempPool, *context)) return 0; if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; if (!addBinding(parser, prefix, 0, poolStart(&tempPool), &inheritedBindings)) return 0; poolDiscard(&tempPool); if (*context != XML_T('\0')) ++context; s = context; } else { if (!poolAppendChar(&tempPool, *s)) return 0; s++; } } return 1; } static void normalizePublicId(XML_Char *publicId) { XML_Char *p = publicId; XML_Char *s; for (s = publicId; *s; s++) { switch (*s) { case 0x20: case 0xD: case 0xA: if (p != publicId && p[-1] != 0x20) *p++ = 0x20; break; default: *p++ = *s; } } if (p != publicId && p[-1] == 0x20) --p; *p = XML_T('\0'); } static int dtdInit(DTD *p) { poolInit(&(p->pool)); hashTableInit(&(p->generalEntities)); hashTableInit(&(p->elementTypes)); hashTableInit(&(p->attributeIds)); hashTableInit(&(p->prefixes)); p->complete = 1; p->standalone = 0; #ifdef XML_DTD hashTableInit(&(p->paramEntities)); #endif /* XML_DTD */ p->defaultPrefix.name = 0; p->defaultPrefix.binding = 0; return 1; } #ifdef XML_DTD static void dtdSwap(DTD *p1, DTD *p2) { DTD tem; memcpy(&tem, p1, sizeof(DTD)); memcpy(p1, p2, sizeof(DTD)); memcpy(p2, &tem, sizeof(DTD)); } #endif /* XML_DTD */ static void dtdDestroy(DTD *p) { HASH_TABLE_ITER iter; hashTableIterInit(&iter, &(p->elementTypes)); for (;;) { ELEMENT_TYPE *e = (ELEMENT_TYPE *)hashTableIterNext(&iter); if (!e) break; if (e->allocDefaultAtts != 0) free(e->defaultAtts); } hashTableDestroy(&(p->generalEntities)); #ifdef XML_DTD hashTableDestroy(&(p->paramEntities)); #endif /* XML_DTD */ hashTableDestroy(&(p->elementTypes)); hashTableDestroy(&(p->attributeIds)); hashTableDestroy(&(p->prefixes)); poolDestroy(&(p->pool)); } /* Do a deep copy of the DTD. Return 0 for out of memory; non-zero otherwise. The new DTD has already been initialized. */ static int dtdCopy(DTD *newDtd, const DTD *oldDtd) { HASH_TABLE_ITER iter; /* Copy the prefix table. */ hashTableIterInit(&iter, &(oldDtd->prefixes)); for (;;) { const XML_Char *name; const PREFIX *oldP = (PREFIX *)hashTableIterNext(&iter); if (!oldP) break; name = poolCopyString(&(newDtd->pool), oldP->name); if (!name) return 0; if (!lookup(&(newDtd->prefixes), name, sizeof(PREFIX))) return 0; } hashTableIterInit(&iter, &(oldDtd->attributeIds)); /* Copy the attribute id table. */ for (;;) { ATTRIBUTE_ID *newA; const XML_Char *name; const ATTRIBUTE_ID *oldA = (ATTRIBUTE_ID *)hashTableIterNext(&iter); if (!oldA) break; /* Remember to allocate the scratch byte before the name. */ if (!poolAppendChar(&(newDtd->pool), XML_T('\0'))) return 0; name = poolCopyString(&(newDtd->pool), oldA->name); if (!name) return 0; ++name; newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name, sizeof(ATTRIBUTE_ID)); if (!newA) return 0; newA->maybeTokenized = oldA->maybeTokenized; if (oldA->prefix) { newA->xmlns = oldA->xmlns; if (oldA->prefix == &oldDtd->defaultPrefix) newA->prefix = &newDtd->defaultPrefix; else newA->prefix = (PREFIX *)lookup(&(newDtd->prefixes), oldA->prefix->name, 0); } } /* Copy the element type table. */ hashTableIterInit(&iter, &(oldDtd->elementTypes)); for (;;) { int i; ELEMENT_TYPE *newE; const XML_Char *name; const ELEMENT_TYPE *oldE = (ELEMENT_TYPE *)hashTableIterNext(&iter); if (!oldE) break; name = poolCopyString(&(newDtd->pool), oldE->name); if (!name) return 0; newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name, sizeof(ELEMENT_TYPE)); if (!newE) return 0; if (oldE->nDefaultAtts) { newE->defaultAtts = (DEFAULT_ATTRIBUTE *)malloc(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); if (!newE->defaultAtts) return 0; } newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts; if (oldE->prefix) newE->prefix = (PREFIX *)lookup(&(newDtd->prefixes), oldE->prefix->name, 0); for (i = 0; i < newE->nDefaultAtts; i++) { newE->defaultAtts[i].id = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0); newE->defaultAtts[i].isCdata = oldE->defaultAtts[i].isCdata; if (oldE->defaultAtts[i].value) { newE->defaultAtts[i].value = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value); if (!newE->defaultAtts[i].value) return 0; } else newE->defaultAtts[i].value = 0; } } /* Copy the entity tables. */ if (!copyEntityTable(&(newDtd->generalEntities), &(newDtd->pool), &(oldDtd->generalEntities))) return 0; #ifdef XML_DTD if (!copyEntityTable(&(newDtd->paramEntities), &(newDtd->pool), &(oldDtd->paramEntities))) return 0; #endif /* XML_DTD */ newDtd->complete = oldDtd->complete; newDtd->standalone = oldDtd->standalone; return 1; } static int copyEntityTable(HASH_TABLE *newTable, STRING_POOL *newPool, const HASH_TABLE *oldTable) { HASH_TABLE_ITER iter; const XML_Char *cachedOldBase = 0; const XML_Char *cachedNewBase = 0; hashTableIterInit(&iter, oldTable); for (;;) { ENTITY *newE; const XML_Char *name; const ENTITY *oldE = (ENTITY *)hashTableIterNext(&iter); if (!oldE) break; name = poolCopyString(newPool, oldE->name); if (!name) return 0; newE = (ENTITY *)lookup(newTable, name, sizeof(ENTITY)); if (!newE) return 0; if (oldE->systemId) { const XML_Char *tem = poolCopyString(newPool, oldE->systemId); if (!tem) return 0; newE->systemId = tem; if (oldE->base) { if (oldE->base == cachedOldBase) newE->base = cachedNewBase; else { cachedOldBase = oldE->base; tem = poolCopyString(newPool, cachedOldBase); if (!tem) return 0; cachedNewBase = newE->base = tem; } } } else { const XML_Char *tem = poolCopyStringN(newPool, oldE->textPtr, oldE->textLen); if (!tem) return 0; newE->textPtr = tem; newE->textLen = oldE->textLen; } if (oldE->notation) { const XML_Char *tem = poolCopyString(newPool, oldE->notation); if (!tem) return 0; newE->notation = tem; } } return 1; } static void poolInit(STRING_POOL *pool) { pool->blocks = 0; pool->freeBlocks = 0; pool->start = 0; pool->ptr = 0; pool->end = 0; } static void poolClear(STRING_POOL *pool) { if (!pool->freeBlocks) pool->freeBlocks = pool->blocks; else { BLOCK *p = pool->blocks; while (p) { BLOCK *tem = p->next; p->next = pool->freeBlocks; pool->freeBlocks = p; p = tem; } } pool->blocks = 0; pool->start = 0; pool->ptr = 0; pool->end = 0; } static void poolDestroy(STRING_POOL *pool) { BLOCK *p = pool->blocks; while (p) { BLOCK *tem = p->next; free(p); p = tem; } pool->blocks = 0; p = pool->freeBlocks; while (p) { BLOCK *tem = p->next; free(p); p = tem; } pool->freeBlocks = 0; pool->ptr = 0; pool->start = 0; pool->end = 0; } static XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end) { if (!pool->ptr && !poolGrow(pool)) return 0; for (;;) { XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end); if (ptr == end) break; if (!poolGrow(pool)) return 0; } return pool->start; } static const XML_Char *poolCopyString(STRING_POOL *pool, const XML_Char *s) { do { if (!poolAppendChar(pool, *s)) return 0; } while (*s++); s = pool->start; poolFinish(pool); return s; } static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n) { if (!pool->ptr && !poolGrow(pool)) return 0; for (; n > 0; --n, s++) { if (!poolAppendChar(pool, *s)) return 0; } s = pool->start; poolFinish(pool); return s; } static XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end) { if (!poolAppend(pool, enc, ptr, end)) return 0; if (pool->ptr == pool->end && !poolGrow(pool)) return 0; *(pool->ptr)++ = 0; return pool->start; } static int poolGrow(STRING_POOL *pool) { if (pool->freeBlocks) { if (pool->start == 0) { pool->blocks = pool->freeBlocks; pool->freeBlocks = pool->freeBlocks->next; pool->blocks->next = 0; pool->start = pool->blocks->s; pool->end = pool->start + pool->blocks->size; pool->ptr = pool->start; return 1; } if (pool->end - pool->start < pool->freeBlocks->size) { BLOCK *tem = pool->freeBlocks->next; pool->freeBlocks->next = pool->blocks; pool->blocks = pool->freeBlocks; pool->freeBlocks = tem; memcpy(pool->blocks->s, pool->start, (pool->end - pool->start) * sizeof(XML_Char)); pool->ptr = pool->blocks->s + (pool->ptr - pool->start); pool->start = pool->blocks->s; pool->end = pool->start + pool->blocks->size; return 1; } } if (pool->blocks && pool->start == pool->blocks->s) { int blockSize = (pool->end - pool->start)*2; pool->blocks = realloc(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); if (!pool->blocks) return 0; pool->blocks->size = blockSize; pool->ptr = pool->blocks->s + (pool->ptr - pool->start); pool->start = pool->blocks->s; pool->end = pool->start + blockSize; } else { BLOCK *tem; int blockSize = pool->end - pool->start; if (blockSize < INIT_BLOCK_SIZE) blockSize = INIT_BLOCK_SIZE; else blockSize *= 2; tem = malloc(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); if (!tem) return 0; tem->size = blockSize; tem->next = pool->blocks; pool->blocks = tem; memcpy(tem->s, pool->start, (pool->ptr - pool->start) * sizeof(XML_Char)); pool->ptr = tem->s + (pool->ptr - pool->start); pool->start = tem->s; pool->end = tem->s + blockSize; } return 1; } sitecopy-0.16.6/lib/expat/xmlparse/hashtable.h0000664000076400007640000000267110132320456017421 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #ifdef XML_UNICODE #ifdef XML_UNICODE_WCHAR_T typedef const wchar_t *KEY; #else /* not XML_UNICODE_WCHAR_T */ typedef const unsigned short *KEY; #endif /* not XML_UNICODE_WCHAR_T */ #else /* not XML_UNICODE */ typedef const char *KEY; #endif /* not XML_UNICODE */ typedef struct { KEY name; } NAMED; typedef struct { NAMED **v; size_t size; size_t used; size_t usedLim; } HASH_TABLE; NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize); void hashTableInit(HASH_TABLE *); void hashTableDestroy(HASH_TABLE *); typedef struct { NAMED **p; NAMED **end; } HASH_TABLE_ITER; void hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); NAMED *hashTableIterNext(HASH_TABLE_ITER *); sitecopy-0.16.6/lib/expat/xmlparse/xmlparse.h0000664000076400007640000004543410132320456017325 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef XmlParse_INCLUDED #define XmlParse_INCLUDED 1 #ifdef __cplusplus extern "C" { #endif #ifndef XMLPARSEAPI #define XMLPARSEAPI /* as nothing */ #endif typedef void *XML_Parser; #ifdef XML_UNICODE_WCHAR_T /* XML_UNICODE_WCHAR_T will work only if sizeof(wchar_t) == 2 and wchar_t uses Unicode. */ /* Information is UTF-16 encoded as wchar_ts */ #ifndef XML_UNICODE #define XML_UNICODE #endif #include typedef wchar_t XML_Char; typedef wchar_t XML_LChar; #else /* not XML_UNICODE_WCHAR_T */ #ifdef XML_UNICODE /* Information is UTF-16 encoded as unsigned shorts */ typedef unsigned short XML_Char; typedef char XML_LChar; #else /* not XML_UNICODE */ /* Information is UTF-8 encoded. */ typedef char XML_Char; typedef char XML_LChar; #endif /* not XML_UNICODE */ #endif /* not XML_UNICODE_WCHAR_T */ /* Constructs a new parser; encoding is the encoding specified by the external protocol or null if there is none specified. */ XML_Parser XMLPARSEAPI XML_ParserCreate(const XML_Char *encoding); /* Constructs a new parser and namespace processor. Element type names and attribute names that belong to a namespace will be expanded; unprefixed attribute names are never expanded; unprefixed element type names are expanded only if there is a default namespace. The expanded name is the concatenation of the namespace URI, the namespace separator character, and the local part of the name. If the namespace separator is '\0' then the namespace URI and the local part will be concatenated without any separator. When a namespace is not declared, the name and prefix will be passed through without expansion. */ XML_Parser XMLPARSEAPI XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); /* atts is array of name/value pairs, terminated by 0; names and values are 0 terminated. */ typedef void (*XML_StartElementHandler)(void *userData, const XML_Char *name, const XML_Char **atts); typedef void (*XML_EndElementHandler)(void *userData, const XML_Char *name); /* s is not 0 terminated. */ typedef void (*XML_CharacterDataHandler)(void *userData, const XML_Char *s, int len); /* target and data are 0 terminated */ typedef void (*XML_ProcessingInstructionHandler)(void *userData, const XML_Char *target, const XML_Char *data); /* data is 0 terminated */ typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data); typedef void (*XML_StartCdataSectionHandler)(void *userData); typedef void (*XML_EndCdataSectionHandler)(void *userData); /* This is called for any characters in the XML document for which there is no applicable handler. This includes both characters that are part of markup which is of a kind that is not reported (comments, markup declarations), or characters that are part of a construct which could be reported but for which no handler has been supplied. The characters are passed exactly as they were in the XML document except that they will be encoded in UTF-8. Line boundaries are not normalized. Note that a byte order mark character is not passed to the default handler. There are no guarantees about how characters are divided between calls to the default handler: for example, a comment might be split between multiple calls. */ typedef void (*XML_DefaultHandler)(void *userData, const XML_Char *s, int len); /* This is called for a declaration of an unparsed (NDATA) entity. The base argument is whatever was set by XML_SetBase. The entityName, systemId and notationName arguments will never be null. The other arguments may be. */ typedef void (*XML_UnparsedEntityDeclHandler)(void *userData, const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); /* This is called for a declaration of notation. The base argument is whatever was set by XML_SetBase. The notationName will never be null. The other arguments can be. */ typedef void (*XML_NotationDeclHandler)(void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* When namespace processing is enabled, these are called once for each namespace declaration. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers. For an xmlns attribute, prefix will be null. For an xmlns="" attribute, uri will be null. */ typedef void (*XML_StartNamespaceDeclHandler)(void *userData, const XML_Char *prefix, const XML_Char *uri); typedef void (*XML_EndNamespaceDeclHandler)(void *userData, const XML_Char *prefix); /* XML declaration handler */ typedef void (*XML_XmlDeclHandler)(void *userdata, const XML_Char *version, const XML_Char *encoding, int standalone); /* This is called if the document is not standalone (it has an external subset or a reference to a parameter entity, but does not have standalone="yes"). If this handler returns 0, then processing will not continue, and the parser will return a XML_ERROR_NOT_STANDALONE error. */ typedef int (*XML_NotStandaloneHandler)(void *userData); /* This is called for a reference to an external parsed general entity. The referenced entity is not automatically parsed. The application can parse it immediately or later using XML_ExternalEntityParserCreate. The parser argument is the parser parsing the entity containing the reference; it can be passed as the parser argument to XML_ExternalEntityParserCreate. The systemId argument is the system identifier as specified in the entity declaration; it will not be null. The base argument is the system identifier that should be used as the base for resolving systemId if systemId was relative; this is set by XML_SetBase; it may be null. The publicId argument is the public identifier as specified in the entity declaration, or null if none was specified; the whitespace in the public identifier will have been normalized as required by the XML spec. The context argument specifies the parsing context in the format expected by the context argument to XML_ExternalEntityParserCreate; context is valid only until the handler returns, so if the referenced entity is to be parsed later, it must be copied. The handler should return 0 if processing should not continue because of a fatal error in the handling of the external entity. In this case the calling parser will return an XML_ERROR_EXTERNAL_ENTITY_HANDLING error. Note that unlike other handlers the first argument is the parser, not userData. */ typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser, const XML_Char *context, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* This structure is filled in by the XML_UnknownEncodingHandler to provide information to the parser about encodings that are unknown to the parser. The map[b] member gives information about byte sequences whose first byte is b. If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c. If map[b] is -1, then the byte sequence is malformed. If map[b] is -n, where n >= 2, then b is the first byte of an n-byte sequence that encodes a single Unicode scalar value. The data member will be passed as the first argument to the convert function. The convert function is used to convert multibyte sequences; s will point to a n-byte sequence where map[(unsigned char)*s] == -n. The convert function must return the Unicode scalar value represented by this byte sequence or -1 if the byte sequence is malformed. The convert function may be null if the encoding is a single-byte encoding, that is if map[b] >= -1 for all bytes b. When the parser is finished with the encoding, then if release is not null, it will call release passing it the data member; once release has been called, the convert function will not be called again. Expat places certain restrictions on the encodings that are supported using this mechanism. 1. Every ASCII character that can appear in a well-formed XML document, other than the characters $@\^`{}~ must be represented by a single byte, and that byte must be the same byte that represents that character in ASCII. 2. No character may require more than 4 bytes to encode. 3. All characters encoded must have Unicode scalar values <= 0xFFFF, (ie characters that would be encoded by surrogates in UTF-16 are not allowed). Note that this restriction doesn't apply to the built-in support for UTF-8 and UTF-16. 4. No Unicode character may be encoded by more than one distinct sequence of bytes. */ typedef struct { int map[256]; void *data; int (*convert)(void *data, const char *s); void (*release)(void *data); } XML_Encoding; /* This is called for an encoding that is unknown to the parser. The encodingHandlerData argument is that which was passed as the second argument to XML_SetUnknownEncodingHandler. The name argument gives the name of the encoding as specified in the encoding declaration. If the callback can provide information about the encoding, it must fill in the XML_Encoding structure, and return 1. Otherwise it must return 0. If info does not describe a suitable encoding, then the parser will return an XML_UNKNOWN_ENCODING error. */ typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData, const XML_Char *name, XML_Encoding *info); void XMLPARSEAPI XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler handler); void XMLPARSEAPI XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end); void XMLPARSEAPI XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler handler); void XMLPARSEAPI XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler); void XMLPARSEAPI XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler); void XMLPARSEAPI XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end); /* This sets the default handler and also inhibits expansion of internal entities. The entity reference will be passed to the default handler. */ void XMLPARSEAPI XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler); /* This sets the default handler but does not inhibit expansion of internal entities. The entity reference will not be passed to the default handler. */ void XMLPARSEAPI XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler); void XMLPARSEAPI XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler); void XMLPARSEAPI XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler); void XMLPARSEAPI XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end); void XMLPARSEAPI XML_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler); void XMLPARSEAPI XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler); /* If a non-null value for arg is specified here, then it will be passed as the first argument to the external entity ref handler instead of the parser object. */ void XMLPARSEAPI XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg); void XMLPARSEAPI XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *encodingHandlerData); /* This can be called within a handler for a start element, end element, processing instruction or character data. It causes the corresponding markup to be passed to the default handler. */ void XMLPARSEAPI XML_DefaultCurrent(XML_Parser parser); /* This value is passed as the userData argument to callbacks. */ void XMLPARSEAPI XML_SetUserData(XML_Parser parser, void *userData); /* Returns the last value set by XML_SetUserData or null. */ #define XML_GetUserData(parser) (*(void **)(parser)) /* This is equivalent to supplying an encoding argument to XML_CreateParser. It must not be called after XML_Parse or XML_ParseBuffer. */ int XMLPARSEAPI XML_SetEncoding(XML_Parser parser, const XML_Char *encoding); /* If this function is called, then the parser will be passed as the first argument to callbacks instead of userData. The userData will still be accessible using XML_GetUserData. */ void XMLPARSEAPI XML_UseParserAsHandlerArg(XML_Parser parser); /* Sets the base to be used for resolving relative URIs in system identifiers in declarations. Resolving relative identifiers is left to the application: this value will be passed through as the base argument to the XML_ExternalEntityRefHandler, XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base argument will be copied. Returns zero if out of memory, non-zero otherwise. */ int XMLPARSEAPI XML_SetBase(XML_Parser parser, const XML_Char *base); const XML_Char XMLPARSEAPI * XML_GetBase(XML_Parser parser); /* Returns the number of the attributes passed in last call to the XML_StartElementHandler that were specified in the start-tag rather than defaulted. */ int XMLPARSEAPI XML_GetSpecifiedAttributeCount(XML_Parser parser); /* Parses some input. Returns 0 if a fatal error is detected. The last call to XML_Parse must have isFinal true; len may be zero for this call (or any other). */ int XMLPARSEAPI XML_Parse(XML_Parser parser, const char *s, int len, int isFinal); void XMLPARSEAPI * XML_GetBuffer(XML_Parser parser, int len); int XMLPARSEAPI XML_ParseBuffer(XML_Parser parser, int len, int isFinal); /* Creates an XML_Parser object that can parse an external general entity; context is a '\0'-terminated string specifying the parse context; encoding is a '\0'-terminated string giving the name of the externally specified encoding, or null if there is no externally specified encoding. The context string consists of a sequence of tokens separated by formfeeds (\f); a token consisting of a name specifies that the general entity of the name is open; a token of the form prefix=uri specifies the namespace for a particular prefix; a token of the form =uri specifies the default namespace. This can be called at any point after the first call to an ExternalEntityRefHandler so longer as the parser has not yet been freed. The new parser is completely independent and may safely be used in a separate thread. The handlers and userData are initialized from the parser argument. Returns 0 if out of memory. Otherwise returns a new XML_Parser object. */ XML_Parser XMLPARSEAPI XML_ExternalEntityParserCreate(XML_Parser parser, const XML_Char *context, const XML_Char *encoding); enum XML_ParamEntityParsing { XML_PARAM_ENTITY_PARSING_NEVER, XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE, XML_PARAM_ENTITY_PARSING_ALWAYS }; /* Controls parsing of parameter entities (including the external DTD subset). If parsing of parameter entities is enabled, then references to external parameter entities (including the external DTD subset) will be passed to the handler set with XML_SetExternalEntityRefHandler. The context passed will be 0. Unlike external general entities, external parameter entities can only be parsed synchronously. If the external parameter entity is to be parsed, it must be parsed during the call to the external entity ref handler: the complete sequence of XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and XML_ParserFree calls must be made during this call. After XML_ExternalEntityParserCreate has been called to create the parser for the external parameter entity (context must be 0 for this call), it is illegal to make any calls on the old parser until XML_ParserFree has been called on the newly created parser. If the library has been compiled without support for parameter entity parsing (ie without XML_DTD being defined), then XML_SetParamEntityParsing will return 0 if parsing of parameter entities is requested; otherwise it will return non-zero. */ int XMLPARSEAPI XML_SetParamEntityParsing(XML_Parser parser, enum XML_ParamEntityParsing parsing); enum XML_Error { XML_ERROR_NONE, XML_ERROR_NO_MEMORY, XML_ERROR_SYNTAX, XML_ERROR_NO_ELEMENTS, XML_ERROR_INVALID_TOKEN, XML_ERROR_UNCLOSED_TOKEN, XML_ERROR_PARTIAL_CHAR, XML_ERROR_TAG_MISMATCH, XML_ERROR_DUPLICATE_ATTRIBUTE, XML_ERROR_JUNK_AFTER_DOC_ELEMENT, XML_ERROR_PARAM_ENTITY_REF, XML_ERROR_UNDEFINED_ENTITY, XML_ERROR_RECURSIVE_ENTITY_REF, XML_ERROR_ASYNC_ENTITY, XML_ERROR_BAD_CHAR_REF, XML_ERROR_BINARY_ENTITY_REF, XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, XML_ERROR_MISPLACED_XML_PI, XML_ERROR_UNKNOWN_ENCODING, XML_ERROR_INCORRECT_ENCODING, XML_ERROR_UNCLOSED_CDATA_SECTION, XML_ERROR_EXTERNAL_ENTITY_HANDLING, XML_ERROR_NOT_STANDALONE }; /* If XML_Parse or XML_ParseBuffer have returned 0, then XML_GetErrorCode returns information about the error. */ enum XML_Error XMLPARSEAPI XML_GetErrorCode(XML_Parser parser); /* These functions return information about the current parse location. They may be called when XML_Parse or XML_ParseBuffer return 0; in this case the location is the location of the character at which the error was detected. They may also be called from any other callback called to report some parse event; in this the location is the location of the first of the sequence of characters that generated the event. */ int XMLPARSEAPI XML_GetCurrentLineNumber(XML_Parser parser); int XMLPARSEAPI XML_GetCurrentColumnNumber(XML_Parser parser); long XMLPARSEAPI XML_GetCurrentByteIndex(XML_Parser parser); /* Return the number of bytes in the current event. Returns 0 if the event is in an internal entity. */ int XMLPARSEAPI XML_GetCurrentByteCount(XML_Parser parser); /* For backwards compatibility with previous versions. */ #define XML_GetErrorLineNumber XML_GetCurrentLineNumber #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber #define XML_GetErrorByteIndex XML_GetCurrentByteIndex /* Frees memory used by the parser. */ void XMLPARSEAPI XML_ParserFree(XML_Parser parser); /* Returns a string describing the error. */ const XML_LChar XMLPARSEAPI *XML_ErrorString(int code); #ifdef __cplusplus } #endif #endif /* not XmlParse_INCLUDED */ sitecopy-0.16.6/lib/expat/xmlparse/hashtable.c0000664000076400007640000000576710132320456017425 0ustar joejoe/* expat XML parser Copyright (C) 1998 James Clark This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "xmldef.h" #ifdef XML_UNICODE_WCHAR_T #ifndef XML_UNICODE #define XML_UNICODE #endif #endif #include "hashtable.h" #define INIT_SIZE 64 static int keyeq(KEY s1, KEY s2) { for (; *s1 == *s2; s1++, s2++) if (*s1 == 0) return 1; return 0; } static unsigned long hash(KEY s) { unsigned long h = 0; while (*s) h = (h << 5) + h + (unsigned char)*s++; return h; } NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize) { size_t i; if (table->size == 0) { if (!createSize) return 0; table->v = calloc(INIT_SIZE, sizeof(NAMED *)); if (!table->v) return 0; table->size = INIT_SIZE; table->usedLim = INIT_SIZE / 2; i = hash(name) & (table->size - 1); } else { unsigned long h = hash(name); for (i = h & (table->size - 1); table->v[i]; i == 0 ? i = table->size - 1 : --i) { if (keyeq(name, table->v[i]->name)) return table->v[i]; } if (!createSize) return 0; if (table->used == table->usedLim) { /* check for overflow */ size_t newSize = table->size * 2; NAMED **newV = calloc(newSize, sizeof(NAMED *)); if (!newV) return 0; for (i = 0; i < table->size; i++) if (table->v[i]) { size_t j; for (j = hash(table->v[i]->name) & (newSize - 1); newV[j]; j == 0 ? j = newSize - 1 : --j) ; newV[j] = table->v[i]; } free(table->v); table->v = newV; table->size = newSize; table->usedLim = newSize/2; for (i = h & (table->size - 1); table->v[i]; i == 0 ? i = table->size - 1 : --i) ; } } table->v[i] = calloc(1, createSize); if (!table->v[i]) return 0; table->v[i]->name = name; (table->used)++; return table->v[i]; } void hashTableDestroy(HASH_TABLE *table) { size_t i; for (i = 0; i < table->size; i++) { NAMED *p = table->v[i]; if (p) free(p); } free(table->v); } void hashTableInit(HASH_TABLE *p) { p->size = 0; p->usedLim = 0; p->used = 0; p->v = 0; } void hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) { iter->p = table->v; iter->end = iter->p + table->size; } NAMED *hashTableIterNext(HASH_TABLE_ITER *iter) { while (iter->p != iter->end) { NAMED *tem = *(iter->p)++; if (tem) return tem; } return 0; } sitecopy-0.16.6/lib/rpmatch.c0000664000076400007640000000466210165765223014160 0ustar joejoe/* Determine whether string value is affirmation or negative response according to current locale's data. Copyright (C) 1996, 1998 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. */ #if HAVE_CONFIG_H # include #endif #if STDC_HEADERS || _LIBC # include # include #else # ifndef NULL # define NULL 0 # endif #endif #if defined(ENABLE_NLS) && defined(HAVE_REGEX_H) #define RP_USE_REGEX #endif #ifdef RP_USE_REGEX # include # include # include # define _(Text) gettext (Text) static int try (const char *response, const char *pattern, const int match, const int nomatch, const char **lastp, regex_t *re) { if (pattern != *lastp) { /* The pattern has changed. */ if (*lastp) { /* Free the old compiled pattern. */ regfree (re); *lastp = NULL; } /* Compile the pattern and cache it for future runs. */ if (regcomp (re, pattern, REG_EXTENDED) != 0) return -1; *lastp = pattern; } /* See if the regular expression matches RESPONSE. */ return regexec (re, response, 0, NULL, 0) == 0 ? match : nomatch; } #endif int rpmatch (const char *response) { #ifdef RP_USE_REGEX /* Match against one of the response patterns, compiling the pattern first if necessary. */ /* We cache the response patterns and compiled regexps here. */ static const char *yesexpr, *noexpr; static regex_t yesre, nore; int result; return ((result = try (response, _("^[yY]"), 1, 0, &yesexpr, &yesre)) ? result : try (response, _("^[nN]"), 0, -1, &noexpr, &nore)); #else /* Test against "^[yY]" and "^[nN]", hardcoded to avoid requiring regex */ return (*response == 'y' || *response == 'Y' ? 1 : *response == 'n' || *response == 'N' ? 0 : -1); #endif } sitecopy-0.16.6/lib/yesno.c0000664000076400007640000000310610165765223013647 0ustar joejoe/* yesno.c -- read a yes/no response from stdin Copyright (C) 1990, 1998 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. */ #if HAVE_CONFIG_H # include #endif #include #if HAVE_STDLIB_H # include #endif #include /* Read one line from standard input and return nonzero if that line begins with y or Y, otherwise return 0. */ int rpmatch (const char *); int yesno (void); int yesno (void) { /* We make some assumptions here: a) leading white space in the response are not vital b) the first 128 characters of the answer are enough (the rest can be ignored) I cannot think for a situation where this is not ok. --drepper@gnu */ char buf[128]; int len = 0; int c; while ((c = getchar ()) != EOF && c != '\n') if ((len > 0 && len < 127) || (len == 0 && !isspace (c))) buf[len++] = c; buf[len] = '\0'; return rpmatch (buf) == 1; } sitecopy-0.16.6/lib/dirname.c0000664000076400007640000000413310165765223014132 0ustar joejoe/* dirname.c -- return all but the last element in a path Copyright (C) 1990, 1998 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. */ #if HAVE_CONFIG_H # include #endif /******************************************************* * THIS IS A MODIFIED dirname IMPLEMENTATION: * - sitecopy wants "" if there is no directory name, * standard GNU implementation gives us "." * - sitecopy wants the trailing slash. *******************************************************/ #include "ne_alloc.h" #if defined STDC_HEADERS || defined HAVE_STRING_H # include #else # include # ifndef strrchr # define strrchr rindex # endif #endif #include "dirname.h" /* Return the leading directories part of PATH, allocated with malloc. If out of memory, return 0. Assumes that trailing slashes have already been removed. */ char * dir_name (const char *path) { char *newpath; char *slash; int length; /* Length of result, not including NUL. */ slash = strrchr (path, '/'); if (slash == 0) { /* File is in the current directory. */ path = ""; length = 0; } else { /* Remove any trailing slashes from the result. while (slash > path && *slash == '/') --slash; */ length = slash - path + 1; } newpath = (char *) ne_malloc (length + 1); if (newpath == 0) return 0; strncpy (newpath, path, length); newpath[length] = 0; return newpath; } sitecopy-0.16.6/lib/linelen.c0000664000076400007640000000306310165765223014142 0ustar joejoe/* Line length calculation routine. Taken from fileutils-4.0i/src/ls.c Copyright (C) 85, 88, 90, 91, 1995-1999 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. $Id: linelen.c,v 1.1 1999/06/25 19:26:46 joe Exp $ */ #if HAVE_TERMIOS_H # include #endif #ifdef GWINSZ_IN_SYS_IOCTL # include #endif #ifdef WINSIZE_IN_PTEM # include # include #endif #ifdef HAVE_UNISTD_H #include /* For STDOUT_FILENO */ #endif #define DEFAULT_LINE_LENGTH 80 int get_line_length( void ) { int ret = DEFAULT_LINE_LENGTH; /* joe: Some systems do this with a 'struct ttysize'? * There is code in tin to do it, but tin has a dodgy license. * DIY, if you have such a system. */ #ifdef TIOCGWINSZ struct winsize ws; if (ioctl (STDOUT_FILENO, TIOCGWINSZ, &ws) != -1 && ws.ws_col != 0) ret = ws.ws_col; #endif return ret; } sitecopy-0.16.6/config.guess0000755000076400007640000012706311037462410014116 0ustar joejoe#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-05-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sitecopy-0.16.6/gnome/0000775000076400007640000000000011037462325012701 5ustar joejoesitecopy-0.16.6/gnome/operations.c0000664000076400007640000005046510232743237015242 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ #include #include "operations.h" extern struct site *selected_site; extern GtkWidget *error_log_list, *error_log_window; extern struct site *all_sites; extern float uploaded_bytes, upload_total; /* For the 'main' upload window */ GtkWidget *upload_window, *main_progressbar, *job_progressbar, *error_button; GtkWidget *status_label, *op_label, *file_label, *dir_label; GtkWidget *begin_button, *close_button, *kill_button, *keep_going_button; pthread_t update_thread_id = 0; volatile int in_critical_section = 0, want_abort = 0; sigjmp_buf abort_buf; /* This sets up a signal handler and provides a wrapper around * site_ transfer operations. * It uses setjmp and longjmp to do backward error recovery. * This allows the aborting of operations without having to * destroy threads, which is A Good Thing, because all * site_updates use the same (single) thread. :) */ /* Signal handler */ void handle_abort( int sig ) { if( in_critical_section ) { /* Can't abort now, so remember we want to for later */ want_abort = 1; } else { do_abort(); } } /* Actually abort the update */ void do_abort(void) { printf("performing longjmp...\n"); want_abort = 0; siglongjmp( abort_buf, 1 ); } /* Enter critical section */ void fe_disable_abort( struct site *site ) { in_critical_section = 1; } /* Leave critical section */ void fe_enable_abort( struct site *site ) { in_critical_section = 0; /* Carry out the abort if we were aborted while in the * critical section */ if( want_abort ) { do_abort(); } } int my_abortable_transfer_wrapper(struct site *site, enum site_op operation ) { int ret; signal( SIGUSR1, handle_abort ); if( !sigsetjmp( abort_buf, 1 ) ) { /* Normal execution */ switch (operation) { case site_op_update: ret = site_update(site); break; case site_op_fetch: ret = site_fetch(site); break; #if 0 /* Can't happen in current code. */ case site_op_resync: ret = site_synch(site); break; #endif #ifndef NDEBUG default: fprintf(stderr, "my_abortable_transfer_wrapper: unknown operation %d. Aborting.\n", operation); abort(); #endif /* !NDEBUG */ } } else { /* The update was aborted */ ret = SITE_ABORTED; } signal( SIGUSR1, SIG_IGN ); return ret; } void close_main_update_window(GtkButton * button, gpointer data) { extern GtkWidget *connection_label; gtk_window_set_modal(GTK_WINDOW(upload_window), FALSE); gtk_widget_destroy(upload_window); connection_label = NULL; return; } void abort_site_update(GtkWidget * button, gpointer data) { extern pthread_t update_tid; gtk_label_set(GTK_LABEL(status_label), "Aborting..."); pthread_kill(update_tid, SIGUSR1); } /* This is just a skel until the next release */ void *update_all_thread(void *no_data) { extern sem_t *update_all_semaphore; pthread_detach(pthread_self()); NE_DEBUG(DEBUG_GNOME, "update_all_thread: detached.\n"); for(;;) { struct site *working_site; NE_DEBUG(DEBUG_GNOME, "update_all_thread: sleeping...\n"); /* sleep straight away */ sem_wait(update_all_semaphore); for (working_site = all_sites; working_site; working_site = working_site->next) { int ret; ret = my_abortable_transfer_wrapper(working_site, site_op_update); set_status_after_operation(ret, GTK_LABEL(status_label)); if (ret == SITE_ABORTED) break; } } } void *update_thread(void *no_data) { int ret; extern sem_t *update_semaphore; extern gboolean site_keepgoing; pthread_detach(pthread_self()); NE_DEBUG(DEBUG_GNOME, "update_thread: detached.\n"); for(;;) { NE_DEBUG(DEBUG_GNOME, "update_thread: sleeping...\n"); /* sleep straight away */ sem_wait(update_semaphore); NE_DEBUG(DEBUG_GNOME, "update_thread: Okay, who woke me up!?\n"); gdk_threads_enter(); gtk_widget_set_sensitive(begin_button, FALSE); gtk_widget_set_sensitive(keep_going_button, FALSE); NE_DEBUG(DEBUG_GNOME, "update_thread: Acquired gtk+ lock\n"); if (verifysite_gnome(selected_site)) { close_main_update_window(NULL, NULL); NE_DEBUG(DEBUG_GNOME, "update_thread: The site was wrong, skipping.\n"); continue; } NE_DEBUG(DEBUG_GNOME, "update_thread: Verified site okay, updating..."); /* Perform the actual update */ if (GTK_TOGGLE_BUTTON(keep_going_button)->active) { site_keepgoing = TRUE; } else { site_keepgoing = FALSE; } gdk_threads_leave(); /* site_update blocks until finished */ NE_DEBUG(DEBUG_GNOME, "update_thread: Entering site_update.\n"); /* we might want to give this a 3rd argument sometime to allow * updating of single files at a time */ /* This calls site_update with a wrapper to facilitate good * abort behaviour */ ret = my_abortable_transfer_wrapper(selected_site, site_op_update); NE_DEBUG(DEBUG_GNOME, "update_thread: site_update returned value of %d.\n", ret); gdk_threads_enter(); switch (ret) { case SITE_CONNECT: gtk_label_set(GTK_LABEL(status_label), "Unable to establish connection."); gtk_label_set(GTK_LABEL(op_label), " "); gtk_label_set(GTK_LABEL(file_label), " "); gtk_label_set(GTK_LABEL(dir_label), " "); break; case SITE_AUTH: gtk_label_set(GTK_LABEL(status_label), "Authentication with the remote server failed.."); gtk_label_set(GTK_LABEL(op_label), " "); gtk_label_set(GTK_LABEL(file_label), " "); gtk_label_set(GTK_LABEL(dir_label), " "); break; case SITE_ERRORS: gtk_label_set(GTK_LABEL(status_label), "There was a problem with the file/directory transfer."); gtk_label_set(GTK_LABEL(op_label), " "); gtk_label_set(GTK_LABEL(file_label), " "); gtk_label_set(GTK_LABEL(dir_label), " "); site_write_stored_state(selected_site); rescan_selected(1); gtk_widget_set_sensitive(error_button, TRUE); break; case SITE_LOOKUP: gtk_label_set(GTK_LABEL(status_label), "Unable to connect: Host name look-up failed."); gtk_label_set(GTK_LABEL(op_label), " "); gtk_label_set(GTK_LABEL(file_label), " "); gtk_label_set(GTK_LABEL(dir_label), " "); break; case SITE_OK: gtk_label_set(GTK_LABEL(status_label), "Update complete. (No errors)"); gtk_label_set(GTK_LABEL(op_label), " "); gtk_label_set(GTK_LABEL(file_label), " "); gtk_label_set(GTK_LABEL(dir_label), " "); site_write_stored_state(selected_site); rescan_selected(1); break; case SITE_FAILED: gtk_label_set(GTK_LABEL(status_label), "Update failed. (Authentication problems)"); gtk_label_set(GTK_LABEL(op_label), " "); gtk_label_set(GTK_LABEL(file_label), " "); gtk_label_set(GTK_LABEL(dir_label), " "); break; case SITE_ABORTED: gtk_label_set(GTK_LABEL(status_label), "Update was aborted."); gtk_label_set(GTK_LABEL(op_label), " "); gtk_label_set(GTK_LABEL(file_label), " "); gtk_label_set(GTK_LABEL(dir_label), " "); site_write_stored_state(selected_site); /*rescan_selected(1);*/ break; default: gtk_label_set(GTK_LABEL(status_label), "Unexpected Update Return Value! Contact Maintainer."); NE_DEBUG(DEBUG_GNOME, "ARG! site_update returned %d.\n", ret); break; } NE_DEBUG(DEBUG_GNOME, "Dealt with site_update's return code. Changing sensitivities.\n"); gtk_widget_hide (kill_button); gtk_widget_show (close_button); gtk_widget_set_sensitive(close_button, TRUE); gtk_window_set_modal(GTK_WINDOW(upload_window), FALSE); gdk_threads_leave(); NE_DEBUG(DEBUG_GNOME, "update_thread: Reported update status okay, looping...\n"); } } int start_main_update(GtkWidget *button, gpointer single_or_all) { extern sem_t *update_semaphore, *update_all_semaphore; gtk_widget_set_sensitive(begin_button, FALSE); /* gtk_widget_set_sensitive(close_button, FALSE);*/ gtk_window_set_modal(GTK_WINDOW(upload_window), TRUE); gtk_widget_hide(close_button); gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (upload_window), "Stop!", GNOME_STOCK_PIXMAP_STOP); kill_button = g_list_last (GNOME_DIALOG (upload_window)->buttons)->data; gtk_signal_connect (GTK_OBJECT(kill_button), "clicked", GTK_SIGNAL_FUNC(abort_site_update), NULL); gtk_widget_show(kill_button); if (strcmp((gchar *)single_or_all, "single") == 0) { printf("updating single site.\n"); sem_post(update_semaphore); } else if (strcmp((gchar *)single_or_all, "all") == 0) { printf("Updating ALL sites that need it.\n"); sem_post(update_all_semaphore); } else { g_assert_not_reached(); } return 1; } int main_update_please(GtkWidget * update_button, gpointer data) { extern GtkWidget *connection_label; GtkWidget *dialog_vbox1; GtkWidget *vbox1; GtkWidget *hseparator3; GtkWidget *table1; GtkWidget *label3; GtkWidget *label6; GtkWidget *hseparator1; GtkWidget *label2; GtkWidget *label1; GtkWidget *dialog_action_area1; uploaded_bytes = 0.0; if (selected_site == NULL) { gnome_error_dialog("You must select a site if you want to upload the changes!"); return 0; } if (!selected_site->remote_is_different) { gfe_status("Remote and local sites are already synchronised."); return 1; } upload_total = selected_site->totalnew + selected_site->totalchanged; make_error_window(); upload_window = gnome_dialog_new("Update Progress", NULL); gtk_widget_set_usize(upload_window, 480, -2); dialog_vbox1 = GNOME_DIALOG(upload_window)->vbox; gtk_widget_show(dialog_vbox1); vbox1 = gtk_vbox_new(FALSE, 1); gtk_widget_ref(vbox1); gtk_widget_show(vbox1); gtk_box_pack_start(GTK_BOX(dialog_vbox1), vbox1, TRUE, TRUE, 0); hseparator3 = gtk_hseparator_new(); gtk_widget_ref(hseparator3); gtk_widget_show(hseparator3); gtk_box_pack_start(GTK_BOX(vbox1), hseparator3, TRUE, TRUE, 3); table1 = gtk_table_new(4, 2, FALSE); gtk_widget_show(table1); gtk_box_pack_start(GTK_BOX(vbox1), table1, TRUE, TRUE, 0); gtk_table_set_row_spacings(GTK_TABLE(table1), 1); gtk_table_set_col_spacings(GTK_TABLE(table1), 2); status_label = gtk_label_new("Click Upload to begin."); gtk_widget_show(status_label); connection_label = status_label; gtk_table_attach(GTK_TABLE(table1), status_label, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(status_label), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(status_label), 7.45058e-09, 0.5); op_label = gtk_label_new(" "); gtk_widget_show(op_label); gtk_table_attach(GTK_TABLE(table1), op_label, 0, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(op_label), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(op_label), 7.45058e-09, 0.5); file_label = gtk_label_new(""); gtk_widget_show(file_label); gtk_table_attach(GTK_TABLE(table1), file_label, 0, 2, 2, 3, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(file_label), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(file_label), 7.45058e-09, 0.5); label3 = gtk_label_new("Status: "); gtk_widget_show(label3); gtk_table_attach(GTK_TABLE(table1), label3, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label3), 7.45058e-09, 0.5); label6 = gtk_label_new("To: "); gtk_widget_show(label6); gtk_table_attach(GTK_TABLE(table1), label6, 0, 1, 3, 4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label6), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label6), 7.45058e-09, 0.5); dir_label = gtk_label_new(" "); gtk_widget_show(dir_label); gtk_table_attach(GTK_TABLE(table1), dir_label, 1, 2, 3, 4, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(dir_label), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(dir_label), 7.45058e-09, 0.5); hseparator1 = gtk_hseparator_new(); gtk_widget_show(hseparator1); gtk_box_pack_start(GTK_BOX(vbox1), hseparator1, TRUE, TRUE, 5); label2 = gtk_label_new("Current Progress"); gtk_widget_show(label2); gtk_box_pack_start(GTK_BOX(vbox1), label2, TRUE, FALSE, 2); gtk_misc_set_alignment(GTK_MISC(label2), 0.5, 1); main_progressbar = gtk_progress_bar_new(); gtk_widget_show(main_progressbar); gtk_box_pack_start(GTK_BOX(vbox1), main_progressbar, TRUE, FALSE, 0); gtk_progress_set_show_text(GTK_PROGRESS(main_progressbar), TRUE); label1 = gtk_label_new("Total Progress"); gtk_widget_show(label1); gtk_box_pack_start(GTK_BOX(vbox1), label1, TRUE, FALSE, 2); gtk_misc_set_alignment(GTK_MISC(label1), 0.5, 1); job_progressbar = gtk_progress_bar_new(); gtk_widget_show(job_progressbar); gtk_box_pack_start(GTK_BOX(vbox1), job_progressbar, TRUE, FALSE, 0); gtk_progress_set_show_text(GTK_PROGRESS(job_progressbar), TRUE); keep_going_button = gtk_check_button_new_with_label("Ignore any errors and always keep going."); gtk_widget_show(keep_going_button); gtk_box_pack_start(GTK_BOX(vbox1), keep_going_button, TRUE, TRUE, 0); dialog_action_area1 = GNOME_DIALOG(upload_window)->action_area; gtk_widget_show(dialog_action_area1); gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1), GTK_BUTTONBOX_END); gtk_button_box_set_spacing(GTK_BUTTON_BOX(dialog_action_area1), 8); gnome_dialog_append_button_with_pixmap(GNOME_DIALOG(upload_window), "Upload", GNOME_STOCK_PIXMAP_CONVERT); begin_button = g_list_last(GNOME_DIALOG(upload_window)->buttons)->data; gtk_widget_show(begin_button); GTK_WIDGET_SET_FLAGS(begin_button, GTK_CAN_DEFAULT); gnome_dialog_append_button_with_pixmap(GNOME_DIALOG(upload_window), "View Errors", GNOME_STOCK_PIXMAP_SEARCH); error_button = g_list_last(GNOME_DIALOG(upload_window)->buttons)->data; gtk_signal_connect_object(GTK_OBJECT(error_button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_show), GTK_OBJECT(error_log_window)); gtk_widget_show(error_button); gtk_widget_set_sensitive(error_button, FALSE); GTK_WIDGET_SET_FLAGS(error_button, GTK_CAN_DEFAULT); gnome_dialog_append_button(GNOME_DIALOG(upload_window), GNOME_STOCK_BUTTON_CLOSE); close_button = g_list_last(GNOME_DIALOG(upload_window)->buttons)->data; gtk_signal_connect(GTK_OBJECT(close_button), "clicked", GTK_SIGNAL_FUNC(close_main_update_window), NULL); /* gtk_signal_connect_object(GTK_OBJECT(close_button), "clicked", GTK_SIGNAL_FUNC(gnome_dialog_close), (gpointer) upload_window); */ gtk_widget_show(close_button); GTK_WIDGET_SET_FLAGS(close_button, GTK_CAN_DEFAULT); if (strcmp((gchar *)data, "single") == 0) { gtk_signal_connect(GTK_OBJECT(begin_button), "clicked", GTK_SIGNAL_FUNC(start_main_update), "single"); } else if (strcmp((gchar *)data, "all") == 0) { gtk_signal_connect(GTK_OBJECT(begin_button), "clicked", GTK_SIGNAL_FUNC(start_main_update), "all"); } else { g_assert_not_reached(); } gtk_widget_show(upload_window); return 2; } int fe_catchup_site(void) { if (selected_site == NULL) { gfe_status("No site has been selected to catch-up."); return 0; } fe_gtk_question("This will mark ALL files as already updated.\nAre you sure you want to do this?", (GnomeReplyCallback) catchup_selected); return 0; } void catchup_selected(gint button_number, gpointer data) { gchar *result; extern GtkCTreeNode *current_site_node; if (button_number == GNOME_YES) { site_catchup(selected_site); result = g_strdup_printf("All files in %s of site %s\nhave been marked as updated.", selected_site->local_root, selected_site->name); gfe_status(result); g_free(result); /* On huge sites, this may take ages? Progress bars/locking of ctree * selection may be advisable... */ site_write_stored_state(selected_site); rebuild_node_files(current_site_node); } } int fe_init_site(void) { if (selected_site == NULL) { gfe_status("No site has been selected to initialise."); return 0; } fe_gtk_question("This will mark all files as *NOT* updated on the remote site.\nAre you sure you want to do this?", (GnomeReplyCallback) initialize_selected); return 0; } void initialize_selected(gint button_number, gpointer data) { gchar *result; extern GtkCTreeNode *current_site_node; switch (button_number) { case GNOME_YES: site_initialize(selected_site); result = g_strdup_printf("All files in %s of site '%s'\nhave been marked as *NOT* updated.", selected_site->local_root, selected_site->name); gfe_status(result); g_free(result); /* On huge sites, this may take ages? Progress bars/locking of ctree * selection may be advisable... */ site_write_stored_state(selected_site); redraw_main_area(); rebuild_node_files(current_site_node); break; case GNOME_NO: break; } } void save_default(void) { extern char *rcfile; extern gboolean rcfile_saved; extern GtkWidget *sitecopy; if (rcfile == NULL) { gnome_app_error(GNOME_APP(sitecopy), "The current rcfile is set to NULL. Sites will not be saved. Contact the maintainer."); return; } if (rcfile_write(rcfile, all_sites) == 0) { gchar *tmp; tmp = g_strdup_printf("Site definitions saved to %s.", rcfile); gfe_status(tmp); g_free(tmp); } else { gnome_error_dialog("There was an error writing the site definitions.\n They may not have saved correctly."); } rcfile_saved = true; } void delete_a_site(GtkWidget * button_or_menu, gpointer data) { gchar *tmp; if (selected_site == NULL) { gnome_error_dialog("Cannot perform deletion - no site appears to be selected"); } else { tmp = g_strdup_printf("Are you sure you wish to permanently delete the record of '%s'?", selected_site->name); fe_gtk_question(tmp, (GnomeReplyCallback) (delete_selected)); } } struct site *find_prev_site(struct site *a_site) { struct site *tmp; tmp = all_sites; while (tmp->next != NULL) { if (strcmp(tmp->next->name, selected_site->name) == 0) { return tmp; } else { tmp = tmp->next; } } return NULL; /* Bad if this ever happens */ } void delete_selected(gint button_number) { struct site *tmp, *tmp2; extern GtkCTree *the_tree; extern GtkCTreeNode *current_site_node; extern gboolean rcfile_saved; if (button_number != GNOME_YES) return; if ((selected_site != NULL) && (all_sites != NULL)) { if (strcmp(all_sites->name, selected_site->name) == 0) { all_sites = all_sites->next; } else { tmp = find_prev_site(selected_site); if (tmp->next != NULL) { tmp2 = tmp->next; tmp->next = tmp2->next; } } gtk_ctree_remove_node(GTK_CTREE(the_tree), GTK_CTREE_NODE(current_site_node)); selected_site = NULL; current_site_node = NULL; } else { gnome_error_dialog("I've detected no site is selected, but one should be selected in order to get here. Oh dear."); } clear_main_area(); rcfile_saved = false; } sitecopy-0.16.6/gnome/share/0000775000076400007640000000000011037462324014002 5ustar joejoesitecopy-0.16.6/gnome/share/anim_yel3.png0000664000076400007640000000467010165765223016404 0ustar joejoePNG  IHDR*+gAMA a oIDATxypUymy/y/1 !X*TD(BqU;ZNktj:NvVj;a /!yk޻9$2e7sxwg~s9 7, s+@@/,._V1D)Ś~"+kdnw,]jؐeYE%Tvt:88B R]U;xiġE rCš{5LJ9wmd- ӴpeETU^G^8r'0eÆ׍ںe)Sbj6 IJl`vP&)(-?Ү}14CP@w{Bqᬨ?XtH58&mkB 3B0\ d8څ&p 9?gTv׍o/!4lgR"D!rz=S)qLfY*^+5>āyCƏsjkzNRH̬I2% 5IMRL&KF T*iؖ 3~cLø$R۝7v-/_WL&A#GRJH!x}>߻7o:ΙJ|(v7;y n[JH$x~pq ˳[[rjЫjj* ezϴSqyܤSiN{XZ>L׋B*cY ڿ zQV^>I==H)IR `6GcK x| !H$q"BlBCSM& ]қ7m*=ztIjB89 =E_d55rrpOߌ> k+Mv's۶8. }1<hݳgLFzdԨs4M9adl"Lr >?pN}M²3ͯ aj+J,tQq3Qբe j)'dϤY 5ԇ W/|rqn pA0gΜu7mܴu3kά_5^4xm[vx%KyW76_/p_Ki}מ]DG֯05j~Suѻ\E1kF@v@sޒsk[,k~{Cxu\W5w(UTZO=z=o?|k$uw69=}Q%!m 9V*+E)sϣk'5-_z7RV3J GzqW;ow{.Dژ7Z!ς&b#GAJᓇi 9юr}tp[9duD>9_'ѾS[:t}{izNgGe/1Rؿ~'7nN]BQZ^IJUtXO|a]W#Z9sU^cJuM_]>ܦ%zcZM] ng !Pف-X"vĺAcg6ɬiؚ*֯}a;k G1, ϴ;vmi&~K8b>p Q(R=tV\.ˎvt(ݵ}w: }q`BfkTfzGD2MN;) +мf/.CB˲ӪnvH5ekf1 xxZ!/9ͼaZ G4epӗͪ.%\vjj̵[IENDB`sitecopy-0.16.6/gnome/share/anim_yel1.png0000664000076400007640000000470410165765223016400 0ustar joejoePNG  IHDR*+gAMA a {IDATxkpTdMvs3C D(bkڙN[өZS:vVk+@KH6lBs{MTbC3χ=s:2NX( *?ţWH䲺H04++NZ?~'?:x4BJҙ,.FBIP1eK_ Pr y\ Ad.UrFU),Ma²,(Bb;H%qds94|~*8k J0S˂T=`$izGK[Xqp%%R*>/DBK! ]e@}v0FZ6 xí0w&$nyZҳ+{pl˲G!R*(RHI1>L:m!rp~vl*ԔVϙ:mhjiEE(\x2K.oXs\σt:eY8m̵'Z4KROŗ/\hZsSi* ~@(Ruط{w*32 GOϻ\NI&xrI$&P *)qz:@NmlMBQ Ł;C&0C''  v;RVN*R2-e۸jAJI* ,@,㦢R0 @,fXy 8CԠfj&M"c;J)R (NMqߏE8Naݫ,[EK4d<0!$ a#B0|\.hE_Y5&C'AWTVkoO>X!^@HгΛ <kX`Hy`/\Z,/R̟?}[[ۃ~?[mڴu;n/4Nب_cvlb˖-ZqDq2>׷'-֋ZTvo[|my[~o 3s癑`-,r==z&n9? G.n{ˍ:JJJ׭0fkQy7wԬmaOo^ÎJ|$|ͪkf 3N/Z1];V/]Ԙu,~a fӹM%V +QJ/ЏLݧN ;˪Voqj#/Wyh2>VfL/wvvtR/X=lݺMS ^޶g%i 'nil/ݿ?{v0 "޾+nZc@l޸9yMP__cΤ&Ɔa|z/r#9G6 ][wJJk@7vw&3gnI  9[X6E&1 Gh=}&DG>|mVnCm}{[r!pPPuO7ϣG^,Rchx4;3xhn Ze(K.mؖűǤ vp(Xop@۶豁g_lzA20cX+g)ɻxp fϹ`v, R?*qL_ڵIENDB`sitecopy-0.16.6/gnome/share/anim_yel0.png0000664000076400007640000000454210165765223016377 0ustar joejoePNG  IHDR*+gAMA a IDATxypU?ݼ%/1 !; PalbQŒ[ڙN-NGNvSubgQ[+d $!!^潻sG ;s8YRd5 ,p#~`ev0xJiiKJ&ضm^,y1Xs~Vq׆;JM6 Cq"/@0-5LaX~JKxo6 蘓n`0:,fg7u (N;3F:a6 t,Q:: %ˁڗhSЧL%VQK`юEy"sꡔMra A"9C51B"DX,]7 84me/_øIqh@Q1WS- (ضDu,BJe Ĵ,h*#*.-1SO'T'Xi0i!$h4j RVr5,[ȓ]B>7GEE0֑B`a&taB 󐌄4QѠ_SG ܈ppHQ1KtDIZuW9)DHAa~PԸcV8E0;QT^Y^xvHG:T=:'Mc4B 5 )m4Hʶ,K*_{3K@,muEP,E$chDR xq$ Ų,Tjߕ@L~UY]fd DOSi"RiDR'I\HaH$u0}>W~mwUU͒R.233*+Wܲt*8vzC\ի|饗66 <GIIÞwX4M|-l<ָ\fkL6 A_N}W,[xg{DL6oڅ}%(֮Sj1zۭ~];w/ti>ѥjx7^;'?iȡÌd-5{xA^:tt~aOS3n/Ctwr@'['xХٶMx=BSKSV[[ǏGQ u;4Qٗ66Ņ c~j]0gnvN ff.p-)&8;IENDB`sitecopy-0.16.6/gnome/share/anim_yel4.png0000664000076400007640000000463610165765223016407 0ustar joejoePNG  IHDR*+gAMA a UIDATxipUﹹn7l$ưZł ԭeSkNߴm;XuZ)vj-ZEEEl$ 7 w?s"Ho9/Μg9s#pxaYyy; ^^h6lӃX\kn^jsĉ!]%kJHtĴ9Ky6;4`Iv tr@rcCȨn:c&)/pxRqs۟}cLY=R~N66K`` M-ϗ^̔/.m 4M4Mn%,,EqpHƩU$na,,KeSK+*1 !}B5䔄 U#ɠJ+dFZ#JJa 9ʪ&tUP4EȨE<KX(tfj|!4 WHFŔO\hhNFUIg2Mհ,sB , ۶e'b =gFWT!4CL@*QwEvTL j'J(Ē_e RA8'M:LDS@G> dsIEbS&Օ.GVhFRQ%j*R4Eq!,T*i8 :^?l* _p~ww}}rL\zKTU$y)GB,"JP3-;T,h!7PB9ڿ.ZrT*E"HoHΓ'%6>@@NڒR*ltk6eNID"[X6n8qoV\YSSWDQ24UAt"TUeY 284H2&ɰ6v8 Q輼EKn}eӪ*9сaTNJOO/0t:Fۑ#4>Lkm!łBN0+^]SS7CI&Çl߾Tb{^[e{5E : _P榕+?s/h/7e} BO3g|~Gfj5K2lܰ`[kkk-ӶlGؽÜ`^/zWϻ:Q3Rd0"/\x]ֱv6\rշKmme.+wM/m79;PbU42~PpaH6yjۥ%e˥g̓ pTNiX:k?$Tw6v;8t wv|чϯ*&W'-߻-NTQD,~BuUOzw4ͦ;Bvn4St@7?n| ۶"hji q!$I‘堧g?ع}gzzz T:I?kK 2MHks-{*&$ocǎJ}TQUA_>o,:0nPV3֦D,=jZ@Q=Jb j&O(gm]虘ㇺz旔CgN8N=`0_%^˴'qض銼չ rùޞKٟ @5pphW谖5YI)WvE:'ntMD%k~W'1P@u-ݷaNUO%Rq6$ť)?(O^*3g9 ^S #GƫλIENDB`sitecopy-0.16.6/gnome/share/sitecopy-dialogs.glade0000664000076400007640000042574310165765223020303 0ustar joejoe xsitecopy-dialogs xsitecopy src pixmaps C True False False False False GnomeDialog update_dialog 480 Update Progress GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False True False False False GtkVBox GnomeDialog:vbox dialog-vbox1 False 8 4 True True GtkHButtonBox GnomeDialog:action_area dialog-action_area1 GTK_BUTTONBOX_END 8 85 27 7 0 0 False True GTK_PACK_END GtkButton upload_button True True clicked upload_button_clicked Wed, 14 Jul 1999 20:25:43 GMT GNOME_STOCK_PIXMAP_CONVERT GtkButton error_button False True True GNOME_STOCK_PIXMAP_SEARCH GtkButton close_button True True GNOME_STOCK_BUTTON_CLOSE GtkVBox vbox1 False 1 0 True True GtkHSeparator hseparator3 3 True True GtkTable table1 4 2 False 1 2 0 True True GtkLabel label3 GTK_JUSTIFY_LEFT False 7.45058e-09 0.5 0 0 0 1 0 1 0 0 False False False False True False GtkLabel label6 GTK_JUSTIFY_LEFT False 7.45058e-09 0.5 0 0 0 1 3 4 0 0 False False False False True False GtkLabel status_label GTK_JUSTIFY_LEFT False 7.45058e-09 0.5 0 0 1 2 0 1 0 0 False False False False True False GtkLabel op_label GTK_JUSTIFY_LEFT False 7.45058e-09 0.5 0 0 0 2 1 2 0 0 False False False False True False GtkLabel file_label GTK_JUSTIFY_LEFT False 7.45058e-09 0.5 0 0 0 2 2 3 0 0 False False False False True False GtkLabel dir_label GTK_JUSTIFY_LEFT False 7.45058e-09 0.5 0 0 1 2 3 4 0 0 False False False False True False GtkHSeparator hseparator1 5 True True GtkLabel label2 GTK_JUSTIFY_CENTER False 0.5 1 0 0 2 True False GtkProgressBar main_progressbar 0 0 100 GTK_PROGRESS_CONTINUOUS GTK_PROGRESS_LEFT_TO_RIGHT False True %P %% 0.5 0.5 0 True False GtkLabel label1 GTK_JUSTIFY_CENTER False 0.5 1 0 0 2 True False GtkProgressBar job_progressbar 0 0 100 GTK_PROGRESS_CONTINUOUS GTK_PROGRESS_LEFT_TO_RIGHT False True %P %% 0.5 0.5 0 True False GtkCheckButton keep_going_button True False True 0 True True GnomeDialog error_log_window 567 248 delete_event gtk_widget_hide error_log_window Sat, 17 Jul 1999 14:28:23 GMT Errors during the recent update GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True True False False False GtkVBox GnomeDialog:vbox dialog-vbox2 False 8 4 True True GtkHButtonBox GnomeDialog:action_area dialog-action_area2 GTK_BUTTONBOX_END 8 85 27 7 0 0 False True GTK_PACK_END GtkButton cancel True True clicked gtk_widget_hide error_log_window Sat, 17 Jul 1999 14:28:44 GMT GNOME_STOCK_BUTTON_CLOSE GtkLabel label9 GTK_JUSTIFY_LEFT False 7.45058e-09 0.5 0 0 0 False False GtkScrolledWindow sc_win GTK_POLICY_AUTOMATIC GTK_POLICY_ALWAYS GTK_UPDATE_CONTINUOUS GTK_UPDATE_CONTINUOUS 0 True True GtkCList error_log_list True 2 265,80 GTK_SELECTION_SINGLE True GTK_SHADOW_IN GtkLabel CList:title label7 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkLabel CList:title label8 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GnomeMessageBox quit_save_question GNOME_MESSAGE_BOX_WARNING Some of your site definitions may not be saved. What would you like to do? Information GTK_WIN_POS_NONE False False False False True False GtkVBox GnomeDialog:vbox dialog-vbox6 False 8 4 True True GtkHButtonBox GnomeDialog:action_area dialog-action_area6 GTK_BUTTONBOX_END 8 85 27 7 0 0 False True GTK_PACK_END GtkButton button12 True True True GNOME_STOCK_PIXMAP_SAVE_AS GtkButton button13 True True GNOME_STOCK_PIXMAP_EXIT GtkButton button14 True True GNOME_STOCK_BUTTON_CANCEL GnomeDialog fetch_list_window GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False False False False GtkVBox GnomeDialog:vbox dialog-vbox7 False 8 4 True True GtkHButtonBox GnomeDialog:action_area dialog-action_area7 GTK_BUTTONBOX_END 8 85 27 7 0 0 False True GTK_PACK_END GtkButton begin_fetch_button True True GNOME_STOCK_PIXMAP_SEARCH GtkButton close_fetch_button True True GNOME_STOCK_BUTTON_CLOSE GtkVBox vbox10 False 5 0 False False GtkHBox hbox4 False 0 0 False False GtkLabel label17 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GtkLabel fetch_message GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 True True GtkProgressBar fetch_list_bar 0 0 100 GTK_PROGRESS_DISCRETE GTK_PROGRESS_LEFT_TO_RIGHT True False %P %% 0.5 0.5 0 False False GtkScrolledWindow scrolledwindow1 GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_UPDATE_CONTINUOUS GTK_UPDATE_CONTINUOUS 0 True True GtkCList fetch_clist 140 True 1 80 GTK_SELECTION_BROWSE True GTK_SHADOW_IN GtkLabel CList:title label18 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GnomePropertyBox xsitecopy_prefs apply apply_prefs Mon, 06 Sep 1999 19:00:00 GMT help prefs_help Mon, 06 Sep 1999 19:00:18 GMT GTK_WIN_POS_NONE False False False False GtkNotebook GnomePropertyBox:notebook notebook2 True True True GTK_POS_TOP False 2 2 False 0 True True GtkVBox vbox12 False 0 GtkFrame frame7 4 0 GTK_SHADOW_ETCHED_IN 0 True True GtkVBox vbox13 False 0 GtkHBox hbox5 2 False 0 0 True False GtkLabel label22 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GtkOptionMenu site_info_optionmenu True Local directory Remote directory Remote hostname Root URL None 0 0 False False GtkFrame frame8 4 0 GTK_SHADOW_ETCHED_IN 0 True False GtkTable table3 2 2 2 False 0 0 GnomeColorPicker up_to_date_colour True color_set on_up_to_date_colour_color_set Mon, 06 Sep 1999 19:04:05 GMT True False Pick a color 1 2 1 2 0 0 False False False False False False GnomeColorPicker update_req_colour True color_set on_update_req_colour_color_set Mon, 06 Sep 1999 19:04:00 GMT True False Pick a color 1 2 0 1 0 0 False False False False False False GtkLabel label23 GTK_JUSTIFY_LEFT False 7.45058e-09 0.5 1 0 0 1 0 1 0 0 False False False False True False GtkLabel label24 GTK_JUSTIFY_LEFT False 7.45058e-09 0.5 1 0 0 1 1 2 0 0 False False False False True False GtkLabel Notebook:tab label19 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkVBox vbox14 False 0 GtkFrame frame9 4 0 GTK_SHADOW_ETCHED_IN 0 True True GtkVBox vbox15 False 0 GtkCheckButton fetch_backup_checkbutton True toggled on_fetch_backup_checkbutton_toggled Mon, 06 Sep 1999 19:04:18 GMT False True 0 True False GtkFrame frame10 4 0 GTK_SHADOW_ETCHED_IN 0 True True GtkVBox vbox16 False 0 GtkCheckButton keep_going_checkbutton True toggled on_keep_going_checkbutton_toggled Mon, 06 Sep 1999 19:04:23 GMT False True 0 True False GtkHBox hbox6 False 0 0 True False GtkCheckButton log_errors_checkbutton True toggled on_log_errors_checkbutton_toggled Mon, 06 Sep 1999 19:04:39 GMT False True 0 False False GnomeFileEntry fileentry1 log 10 Please select a filename for logging output. False False 0 True True GtkEntry GnomeEntry:entry entry2 True True True 0 GtkLabel Notebook:tab label20 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkVBox vbox17 False 0 GtkFrame frame13 4 0 GTK_SHADOW_ETCHED_IN 0 True True GtkVBox vbox20 False 0 GtkHBox hbox7 2 False 0 0 True False GtkLabel label25 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 False False GnomeFileEntry default_rc_fileentry 1 10 Enter a filename where xsitecopy should store your site definitions. False False 0 True True GtkEntry GnomeEntry:entry combo-entry1 True True True 0 GtkFrame frame12 4 0 GTK_SHADOW_ETCHED_IN 0 True True GtkVBox vbox19 False 0 GtkCheckButton confirm_exit_checkbutton True toggled on_confirm_exit_checkbutton_toggled Mon, 06 Sep 1999 19:04:46 GMT True True 0 True False GtkCheckButton save_check_checkbutton True toggled on_save_check_checkbutton_toggled Mon, 06 Sep 1999 19:04:50 GMT True True 0 True False GtkLabel Notebook:tab label21 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkWindow main_panel window1 GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False True True GtkNotebook container True True True GTK_POS_TOP False 2 2 False GtkVBox vbox21 3 False 4 GtkFrame frame14 0 GTK_SHADOW_ETCHED_IN 0 True True GtkTable table4 5 4 2 False 2 2 GtkLabel label33 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 0 1 0 0 False True False False True False GtkLabel label34 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 1 2 0 0 False True False False True False GtkLabel label35 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 2 3 0 0 False True False False True False GnomeEntry username user_history 10 1 2 2 3 0 0 True True False False True False GtkEntry GnomeEntry:entry combo-entry3 True changed change_username Fri, 10 Sep 1999 23:39:07 GMT True True 0 GtkLabel label36 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 3 4 0 0 False True True False True False GtkEntry password True changed change_password Fri, 10 Sep 1999 23:39:16 GMT True True 0 1 2 3 4 0 0 True True False False True False GtkHBox hbox15 False 3 1 2 0 1 0 0 False True False False True False GnomeEntry servername host_history 10 0 True True GtkEntry GnomeEntry:entry combo-entry2 True changed change_hostname Fri, 10 Sep 1999 23:38:42 GMT True True 0 GtkLabel label50 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GtkSpinButton port 12 True changed change_port Fri, 10 Sep 1999 23:38:53 GMT 1 0 True GTK_UPDATE_ALWAYS False True 65532 1 65536 1 10 10 0 True True GtkHBox hbox8 False 0 1 2 1 2 0 0 False True False False True False GtkRadioButton proto_ftp True toggled change_protocol Fri, 10 Sep 1999 23:40:54 GMT True True protocol 0 False False GtkRadioButton proto_dav True toggled change_protocol Fri, 10 Sep 1999 23:40:49 GMT False True protocol 0 False False GtkFrame stats_frame 0 GTK_SHADOW_ETCHED_IN 0 True True GtkLabel stats_label GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkLabel Notebook:tab label26 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkVBox vbox22 3 False 4 GtkFrame frame16 0 GTK_SHADOW_ETCHED_IN 0 True True GtkTable table5 5 3 2 False 2 2 GtkLabel label40 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 2 3 0 0 False True False False True False GtkEntry url True changed change_url Fri, 10 Sep 1999 23:36:28 GMT True True 0 1 2 2 3 0 0 True True False False True False GnomeEntry remote_dir 10 1 2 1 2 0 0 True True False False True False GtkEntry GnomeEntry:entry combo-entry5 True changed change_remote_dir Fri, 10 Sep 1999 23:42:15 GMT True True 0 GtkLabel label38 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 1 2 0 0 False True False False True False GtkLabel label39 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 0 1 0 0 False True False False True False GnomeFileEntry local_dir 10 False False 1 2 0 1 0 0 True True False False True False GtkEntry GnomeEntry:entry combo-entry4 True activate change_local_dir Fri, 10 Sep 1999 23:42:00 GMT True True 0 GtkFrame frame17 0 GTK_SHADOW_ETCHED_IN 0 True True GtkTable table6 5 3 2 False 2 2 GtkLabel label41 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 0 1 0 0 False True False False True False GtkLabel label42 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 1 2 0 0 False True False False True False GtkLabel label43 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 2 3 0 0 False True False False True False GtkHBox hbox10 False 0 1 2 1 2 0 0 False True False False True False GtkRadioButton sym_follow True toggled change_sym_mode Fri, 10 Sep 1999 23:37:39 GMT False True sym_link 0 False False GtkRadioButton sym_ignore True toggled change_sym_mode Fri, 10 Sep 1999 23:37:58 GMT True True sym_link 0 False False GtkRadioButton sym_maintain True toggled change_sym_mode Fri, 10 Sep 1999 23:38:04 GMT False True sym_link 0 False False GtkHBox hbox9 False 0 1 2 0 1 0 0 True True False False True False GtkRadioButton perms_ignore True toggled change_perms Fri, 10 Sep 1999 23:37:14 GMT False True perms 0 False False GtkRadioButton perms_exec True toggled change_perms Fri, 10 Sep 1999 23:37:08 GMT True True perms 0 False False GtkRadioButton perms_all True toggled change_perms Fri, 10 Sep 1999 23:37:19 GMT False True perms 0 False False GtkHBox hbox11 False 0 1 2 2 3 0 0 False True False False True False GtkRadioButton detect_sizetime True toggled change_detect_mode Fri, 10 Sep 1999 23:38:20 GMT False True state_detector 0 False False GtkRadioButton detect_checksum True toggled change_detect_mode Fri, 10 Sep 1999 23:38:29 GMT True True state_detector 0 False False GtkLabel Notebook:tab label27 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkFrame frame18 3 0 GTK_SHADOW_ETCHED_IN GtkVBox vbox23 False 0 GtkCheckButton nodelete True toggled change_delete Fri, 10 Sep 1999 23:34:31 GMT False True 0 True False GtkCheckButton checkmoved True toggled change_move_status Fri, 10 Sep 1999 23:34:40 GMT False True 0 True False GtkCheckButton nooverwrite True toggled change_nooverwrite Fri, 10 Sep 1999 23:35:09 GMT False True 0 True False GtkCheckButton lowercase True toggled change_lowercase Fri, 10 Sep 1999 23:36:08 GMT False True 0 True False GtkCheckButton use_safemode True toggled change_safemode Fri, 10 Sep 1999 23:35:58 GMT False True 0 True False GtkCheckButton ftp_mode True toggled change_passive_ftp Fri, 10 Sep 1999 23:35:47 GMT False True 0 True False GtkLabel Notebook:tab label28 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkVBox vbox24 3 False 4 GtkScrolledWindow scrolledwindow2 GTK_POLICY_AUTOMATIC GTK_POLICY_ALWAYS GTK_UPDATE_CONTINUOUS GTK_UPDATE_CONTINUOUS 0 True True GtkCList excludes_list True select_row select_exclude Fri, 10 Sep 1999 23:43:07 GMT 1 80 GTK_SELECTION_SINGLE True GTK_SHADOW_IN GtkLabel CList:title label44 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkHBox hbox12 1 False 2 0 False True GtkLabel label45 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GnomeEntry excludes_entry excludes_history 10 0 True True GtkEntry GnomeEntry:entry combo-entry7 True changed change_exclude Fri, 10 Sep 1999 23:33:48 GMT True True 0 GtkButton excludes_new True clicked add_exclude Fri, 10 Sep 1999 23:31:29 GMT 0 False False GtkButton exclude_remove True clicked remove_exclude Fri, 10 Sep 1999 23:31:45 GMT 0 False False GtkLabel Notebook:tab label30 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkVBox vbox25 3 False 4 GtkScrolledWindow scrolledwindow3 GTK_POLICY_AUTOMATIC GTK_POLICY_ALWAYS GTK_UPDATE_CONTINUOUS GTK_UPDATE_CONTINUOUS 0 True True GtkCList ascii_list True select_row select_ascii Fri, 10 Sep 1999 23:43:17 GMT 1 80 GTK_SELECTION_SINGLE True GTK_SHADOW_IN GtkLabel CList:title label46 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkHBox hbox13 1 False 2 0 False True GtkLabel label47 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GnomeEntry ascii_entry 10 0 True True GtkEntry GnomeEntry:entry entry10 True changed change_ascii Fri, 10 Sep 1999 23:33:13 GMT True True 0 GtkButton ascii_new True clicked add_ascii Fri, 10 Sep 1999 23:31:57 GMT 0 False False GtkButton ascii_remove True clicked remove_ascii Fri, 10 Sep 1999 23:32:07 GMT 0 False False GtkLabel Notebook:tab label31 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkVBox vbox26 3 False 4 GtkScrolledWindow scrolledwindow4 GTK_POLICY_AUTOMATIC GTK_POLICY_ALWAYS GTK_UPDATE_CONTINUOUS GTK_UPDATE_CONTINUOUS 0 True True GtkCList ignore_list True select_row select_ignore Fri, 10 Sep 1999 23:43:26 GMT 1 80 GTK_SELECTION_SINGLE True GTK_SHADOW_IN GtkLabel CList:title label48 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkHBox hbox14 1 False 2 0 False True GtkLabel label49 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GnomeEntry ignore_entry 10 0 True True GtkEntry GnomeEntry:entry combo-entry8 True changed change_ignore Fri, 10 Sep 1999 23:34:00 GMT True True 0 GtkButton ignore_new True clicked add_ignore Fri, 10 Sep 1999 23:32:18 GMT 0 False False GtkButton ignore_remove True clicked remove_ignore Fri, 10 Sep 1999 23:32:29 GMT 0 False False GtkLabel Notebook:tab ignore_list GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkWindow file_info_container window1 GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False True False GtkTable table7 4 8 4 False 2 6 GtkLabel label51 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 0 1 0 0 False True False False True False GtkEntry entry11 True False True 0 1 4 0 1 0 0 True True False False True False GtkEntry entry14 True False True 0 1 4 1 2 0 0 True True False False True False GtkLabel label52 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 1 2 0 0 False True False False True False GtkLabel label53 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 2 3 0 0 False True False False True False GtkEntry entry15 True False True 0 1 4 2 3 0 0 True True False False True False GtkEntry entry16 True False True 0 1 4 3 4 0 0 True True False False True False GtkEntry entry17 True False True 0 1 4 4 5 0 0 True True False False True False GtkLabel label54 GTK_JUSTIFY_CENTER False 0 0.5 0 0 0 1 3 4 0 0 False True False False True False GtkLabel label55 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 4 5 0 0 False True False False True False GtkLabel label56 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 5 6 0 0 False True False False True False GtkEntry entry12 80 True False True 0 1 2 5 6 0 0 True True False False True False GtkEntry entry13 80 True False True 0 3 4 5 6 0 0 True True False False True False GtkLabel label57 GTK_JUSTIFY_LEFT False 0 0.5 0 0 2 3 5 6 0 0 False True False False True False GtkLabel label58 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 6 7 0 0 False True False False True False GtkEntry entry18 80 True False True 0 1 2 6 7 0 0 True True False False True False GtkEntry entry19 98 True True True 0 3 4 6 7 0 0 True True False False True False GtkLabel label60 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 1 7 8 0 0 False True False False False False GtkEntry entry20 True True True 0 1 3 7 8 0 0 True True False False True False GtkLabel label59 GTK_JUSTIFY_LEFT False 0 0.5 0 0 2 3 6 7 0 0 False True False False True False GtkButton view_button True clicked file_view_clicked Sat, 11 Sep 1999 17:41:27 GMT 3 4 7 8 0 0 False True False False False False GtkWindow site_druid delete_event on_site_druid_delete_event Fri, 08 Oct 1999 14:52:51 GMT Create a new site definition GTK_WINDOW_DIALOG GTK_WIN_POS_NONE False 510 340 True True False GnomeDruid new_site_druid GnomeDruidPageStart start_page Site Creation Druid This Druid will help you to create a new web site definition, that Xsitecopy can then keep track of to ensure your remote site remains in sync with the local copy. In order to do that, you need to answer the questions on the following pages. If you get stuck at all, be sure to consult the information available from Xsitecopy's help menu. Not all the details are mandatory, but you should enter as much as possible to gain the best performance. 255,255,255 0,0,0 25,25,112 25,25,112 255,255,255 gnome-networktool.png xsc_side.xpm GnomeDruidPageStandard general_info next verify_name_and_url Thu, 07 Oct 1999 15:06:15 GMT General Information 255,255,255 25,25,112 25,25,112 gnome-networktool.png GtkVBox GnomeDruidPageStandard:vbox druid-vbox1 False 0 0 True True GtkVBox vbox28 False 0 0 True True GtkLabel label67 370 GTK_JUSTIFY_FILL True 0.5 0.5 0 0 0 True True GtkHSeparator hseparator5 0 True True GtkTable table12 5 2 2 False 0 0 0 True True GtkEntry new_url True True True 0 1 2 1 2 0 0 True False False False True False GtkLabel label86 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 1 2 0 0 False False False False True False GtkLabel label85 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 0 1 0 0 False False False False True False GtkEntry new_name True True True 0 1 2 0 1 0 0 True False False False True False GnomeDruidPageStandard server_info next verify_server_details Thu, 07 Oct 1999 15:06:31 GMT Server Information 255,255,255 25,25,112 25,25,112 i-sock.png GtkVBox GnomeDruidPageStandard:vbox druid-vbox2 False 0 0 True True GtkVBox vbox27 False 0 0 True True GtkLabel label66 370 GTK_JUSTIFY_FILL True 0.5 0.5 0 0 0 True True GtkHSeparator hseparator4 0 True True GtkTable table8 5 5 2 False 0 0 0 True True GtkEntry new_hostname True True True 0 1 2 0 1 0 0 True False False False True False GtkHBox hbox16 False 0 1 2 1 2 0 0 True False False False True False GtkRadioButton new_ftp True toggled set_new_port Thu, 07 Oct 1999 15:18:21 GMT True True new_proto 0 False False GtkRadioButton new_http True toggled set_new_port Thu, 07 Oct 1999 15:18:14 GMT False True new_proto 0 False False GtkSpinButton new_port True 1 0 False GTK_UPDATE_ALWAYS False False 21 1 65536 1 10 10 1 2 2 3 0 0 True False False False True False GtkEntry new_username True True True 0 1 2 3 4 0 0 True False False False True False GtkEntry new_password True True False 0 1 2 4 5 0 0 True False False False True False GtkLabel label64 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 3 4 0 0 False False False False True False GtkLabel label63 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 1 2 3 0 0 False False False False True False GtkLabel label65 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 4 5 0 0 False False False False True False GtkLabel label62 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 1 2 0 0 False False False False True False GtkLabel label61 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 0 1 0 0 False False False False True False GnomeDruidPageStandard directories next verify_directories Thu, 07 Oct 1999 15:06:48 GMT Directories 255,255,255 25,25,112 25,25,112 i-directory.png GtkVBox GnomeDruidPageStandard:vbox druid-vbox6 False 0 0 True True GtkVBox vbox29 False 0 0 True True GtkLabel label68 370 GTK_JUSTIFY_FILL True 0.5 0.5 0 0 0 True True GtkHSeparator hseparator9 0 True True GtkTable table11 5 2 2 False 2 2 0 True False GnomeFileEntry new_local_fentry 10 False False 1 2 0 1 0 0 True False False False True False GtkEntry GnomeEntry:entry new_local_entry True True True 0 GtkLabel label82 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 0 1 0 0 False False False False True False GtkLabel label81 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 1 2 0 0 False False False False True False GtkEntry new_remote_entry True True True 0 1 2 1 2 0 0 True False False False True False GnomeDruidPageStandard file_handling next verify_file_attributes Thu, 07 Oct 1999 15:07:03 GMT File Handling 255,255,255 25,25,112 25,25,112 i-floppy.png GtkVBox GnomeDruidPageStandard:vbox druid-vbox3 False 0 0 True True GtkVBox vbox30 False 0 0 True True GtkLabel label69 370 GTK_JUSTIFY_FILL True 0.5 0.5 0 0 0 True True GtkHSeparator hseparator6 0 True True GtkTable table9 5 3 2 False 2 2 0 True True GtkLabel label71 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 0 1 0 0 False False False False True False GtkHBox hbox18 False 0 1 2 0 1 0 0 True False False False True False GtkRadioButton new_perms_ignore True False True perms 0 False False GtkRadioButton new_perms_exec True True True perms 0 False False GtkRadioButton new_perms_all True False True perms 0 False False GtkLabel label72 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 1 2 0 0 False False False False True False GtkHBox hbox17 False 0 1 2 1 2 0 0 False False False False True False GtkRadioButton new_sym_follow True False True sym_link 0 False False GtkRadioButton new_sym_ignore True True True sym_link 0 False False GtkRadioButton new_sym_maintain True False True sym_link 0 False False GtkLabel label73 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 2 3 0 0 False False False False True False GtkHBox hbox19 False 0 1 2 2 3 0 0 False False False False True False GtkRadioButton new_timesize True False True state_detector 0 False False GtkRadioButton new_checksum True True True state_detector 0 False False GnomeDruidPageStandard update_options next verify_update_options Thu, 07 Oct 1999 15:07:13 GMT Update Attributes 255,255,255 25,25,112 25,25,112 gnome-networktool.png GtkVBox GnomeDruidPageStandard:vbox druid-vbox4 False 0 0 True True GtkVBox vbox31 False 0 0 True True GtkLabel label70 370 GTK_JUSTIFY_FILL True 0.5 0.5 0 0 0 True True GtkHSeparator hseparator7 0 True True GtkVBox vbox32 5 False 0 0 True True GtkCheckButton new_nodelete True False True 0 False False GtkCheckButton new_checkmoved True False True 0 False False GtkCheckButton new_nooverwrite True False True 0 False False GtkCheckButton new_lowercase True False True 0 False False GtkCheckButton new_safe True False True 0 False False GtkCheckButton new_pasv True False True 0 False False GnomeDruidPageStandard server_state next should_we_fetch True Wed, 06 Oct 1999 17:55:01 GMT next set_back_insensitive Thu, 07 Oct 1999 15:10:21 GMT next make_site_from_druid Fri, 08 Oct 1999 14:54:21 GMT Current State of The Remote Site 255,255,255 25,25,112 25,25,112 gnome-networktool.png GtkVBox GnomeDruidPageStandard:vbox druid-vbox5 False 0 0 True True GtkVBox vbox33 False 0 0 True True GtkLabel label74 370 GTK_JUSTIFY_FILL True 0.5 0.5 0 0 0 True True GtkHSeparator hseparator8 0 True True GtkVBox vbox34 4 False 0 0 True True GtkRadioButton new_init True False True 0 False False GtkRadioButton new_catchup True False True 0 False False GtkRadioButton new_fetch_please True False True 0 False False GnomeDruidPageStandard fetch_a_list next check_fetch_worked Thu, 07 Oct 1999 15:08:06 GMT Ready to download file information 255,255,255 25,25,112 25,25,112 gnome-networktool.png GtkVBox GnomeDruidPageStandard:vbox druid-vbox10 False 0 0 True True GtkVBox vbox36 False 0 0 True True GtkLabel label91 370 GTK_JUSTIFY_FILL True 0.5 0.5 0 0 0 True True GtkHSeparator hseparator10 0 True False GtkVBox vbox36 5 False 0 0 False True GtkHBox hbox23 False 0 0 False True GtkLabel label88 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 False False GtkLabel new_fetch_status GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GtkHBox hbox24 False 0 0 True False GtkLabel label90 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GtkLabel fetch_num_files_got GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GtkButton new_fetch_begin True True clicked begin_first_time_fetch Wed, 06 Oct 1999 18:02:54 GMT 0 False False GtkHButtonBox hbuttonbox2 GTK_BUTTONBOX_DEFAULT_STYLE 30 85 27 7 0 0 False False GnomeDruidPageFinish finish_page finish druid_finished Thu, 07 Oct 1999 15:08:32 GMT Creation successful! Enough information has now been gathered, and a suitable site definition has been created. Click finish to close. 25,25,112 25,25,112 255,255,255 0,0,0 255,255,255 gnome-networktool.png xsc_side.xpm GnomeApp slim_mode glade_upload GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False True False True GnomeDock GnomeApp:dock dock1 True 0 True True GnomeDockItem dockitem2 1 GNOME_DOCK_TOP 0 0 0 False True False False False GTK_SHADOW_OUT GtkToolbar toolbar1 1 GTK_ORIENTATION_HORIZONTAL GTK_TOOLBAR_ICONS 16 GTK_TOOLBAR_SPACE_LINE GTK_RELIEF_NONE True GtkButton Toolbar:button button15 Initialise this site GNOME_STOCK_PIXMAP_NEW GtkButton Toolbar:button button16 Catch up this site GNOME_STOCK_PIXMAP_COPY GtkButton Toolbar:button button17 Fetch listing from the remote site GNOME_STOCK_PIXMAP_UNDO True GtkButton Toolbar:button button18 Resync this site GNOME_STOCK_PIXMAP_REFRESH GtkButton Toolbar:button button19 Update this site GNOME_STOCK_PIXMAP_REDO GtkButton Toolbar:button button20 Cancel the current transfer GNOME_STOCK_PIXMAP_STOP True GtkButton Toolbar:button button22 About the program GNOME_STOCK_PIXMAP_ABOUT True GtkButton Toolbar:button button21 Exit the program GNOME_STOCK_PIXMAP_EXIT True GtkCList GnomeDock:contents clist1 158 130 True 2 59,80 GTK_SELECTION_SINGLE True GTK_SHADOW_IN GtkLabel CList:title label92 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GtkLabel CList:title label93 GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 GnomeAppBar GnomeApp:appbar appbar1 True True 0 True True GnomeDialog user_pass_dialog clicked fe_login_clicked Thu, 17 Aug 2000 20:19:36 GMT close fe_login_close Thu, 17 Aug 2000 20:19:45 GMT GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False False False False GtkVBox GnomeDialog:vbox dialog-vbox8 False 8 4 True True GtkHButtonBox GnomeDialog:action_area dialog-action_area8 GTK_BUTTONBOX_DEFAULT_STYLE 8 85 27 7 0 0 False True GTK_PACK_END GtkButton user_pass_ok True True GNOME_STOCK_BUTTON_OK GtkButton user_pass_cancel True True True GNOME_STOCK_BUTTON_CANCEL GtkVBox vbox37 False 5 0 True True GtkLabel user_pass_prompt_label GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 0 False False GtkTable table13 3 2 2 False 3 0 0 True True GtkEntry pass_entry True True False 0 1 2 1 2 0 0 True False False False True False GtkLabel label96 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 1 2 0 0 False False False False True False GtkLabel label95 GTK_JUSTIFY_LEFT False 0 0.5 0 0 0 1 0 1 0 0 False False False False True False GnomeEntry entry23 popup_usernames 10 1 2 0 1 0 0 True False False False True False GtkEntry GnomeEntry:entry user_entry True True True True 0 sitecopy-0.16.6/gnome/share/anim_base.png0000664000076400007640000000436110165765223016437 0ustar joejoePNG  IHDR*+gAMA aIDATx{pTサw< $K Kހb P qWڙN-N[ta jm >1@@&!!l$ݽwΣ$0͈,Yoq眹3߹?nn_Ӽ^S@0,xµšs8ػK'kd6-X0 C;p8a1QaB|^/BxooZPX:/ vvr.q YMi n(+_0p8ûUW+_psB%BA-(*)d*`QJ^7tݠgF z3#/OEDA 0L&!BȪQNg K6['KvS%4aP4a&#JqJ`p0}Ҿ/ E8tdYUӠdTdU L"iq!1M$1'nVt0i:T݀j:r((* " *5i%I$sH٬ !eLZYo8$za?NaB׍)$ l CaGFQBtU= @`y RUSe-0ʠk:dUC2=VEա<%P46`l*1 lEUU]۰/2 1J)x}^|!g&&jDf=\yk5*t: b1 bx#HR8\N|^/>9me7@+ᐬ(p{(.-.-] ݆Dq$SI$tI C0VsJf9Cqq1(S)x=nB!XVl AL#ITb$tMsj@4 8c %dd8)tn&pzVjqLD#PFx!  (><4Uj088+GqIO}ֺz|t1Ȋl6 4?Q0!X|m" J!qF!e8mSʲ!s`s+x(!HV+& ȲpV`CE7H9G緬iXPC*L$Si\ht"1Dٳώ/ն[`~VdzZ n`^ V:XWWb~Ao8WcdŪ]Y]?9~xp7n]vtJA\.KȘĩ^{:Eߨyz˖(emmO<G۱}eA)VX)=yGm\a遾\C n'nc?n|>f*Lf~ޢ'TVR=LJ>3r|wZVǤիﱜwMMCz{zg+k;-(*瞺ɉT-,<#8' TV, %_`Xײys=::z168[+w&elz"x^!ffgᜣeǟDtL%65(,*h&V#0ΠDL&ehPӉBݜvЬ'qiT00[MH)*tMiPU e`&\^o!AquMnDʛ8HF#FeCU5j\FIj@o|̬YT4ApΠ*!` Mס($,Eb6iJd2U9<h6bEQj:%uQ Jl3(FIQWu <^*Ɓ"JAVTȊDRFJV@8$u86$q:q1-\PTMU "H $$c"7ۋ, SHO}%a(9k)qHF)8$#R)BIЩ^Z$=37VCU HJ$c ^DB @c@u{__l6+:D٢uE=GDroTeeg7/+뫝n~=]U0U2{dW7>:iOQ"kOm\S;x3֠ io-]q|D+Ybi~s`1̫mm|TWwCgO5"!4R˿yyŗ:<Ċy <X>22r1?]ܙ831067o >z N~MJ֮٬s *X${GjW1l.حv {'ND<ٝPێ9G0|5wOOΜ>A D?.?ı%nt Hߵs6++;dH_(Ua88?Remote website synchronization utility. TryExec=xsitecopy Exec=xsitecopy Icon=gnome-networktool.png Terminal=0 Type=Application sitecopy-0.16.6/gnome/share/anim_yel2.png0000664000076400007640000000466710165765223016411 0ustar joejoePNG  IHDR*+gAMA a nIDATx՘il\{gl7ljoIPM4lIJJU)VJ ZQj в} ɎmY{>s'",Aبt4sg;'2Fϟ5 P(~F#a+F#ʢpجZX[7Zkͺq*x=J P9n x{4^W,[Rem@@VVUJ+lGl[TD"4¿]9*Бr{G[6 v ):|ZUVU- U94d||kQr v(6e#`rm%Φ$hpt:uk˰} OF0u0*k!#$6l4J*TH(,[dzX8\0 0Mp!*TA Ӿ}4 VXBHl$I.71Mbc|Lro,:iYŜ3K\mLgIgrds"H()RH&Z 㩃Q4m{RL]w׻8 O򙙤,]% 4 JJl[`6/)p8H63`E/8$(6 @ sܼt~$ D"DJJW!Y 4 ƺt&C(v$J"3 2sqd3YfxdcďD+H?UJR9֊ZI"uuunq<^"DVq*X84֚fj'L _(DJ)R @Hc;l{|>Z\EK4e"4!$`#B07^/q(ѺL_Y&$"5|?oM%S)Кov?+Rmٵe7f5ܳqI̙3׌glڸieK34ޠ}&py(vaۜyϏPRRb,f1m[rKi-?Wߜ{ooc~s]4\!gĎ<_K$]̼vŵFWgO}jΪiX{no<@IO6_'DˌS֬yTMK,5f͜>lTrŊ黃R ^:az;cytl >`Ƕdֳ`%``XAJt|&A)#i-\ގBGbta-"v (>/IkM|( +=]]]޵00]&}}ǖ_|x&^~o\1EM̈́H__cɦI &7=3XB|ީ=~ϬƆa|v/>#5և4蝛wAJs@]wH%R7Ox?CCl`[߄u5۷&a8W"-C|&Aop/ö,<"=>w}GC~`p?mۊX;B{G RUMc5g=}oK1iLIENDB`sitecopy-0.16.6/gnome/dir2.xpm0000664000076400007640000000156110165765223014276 0ustar joejoe/* XPM */ static char * dir2_xpm[] = { "16 16 34 1", " c None", ". c #000000", "+ c #7DE66F", "@ c #53CC53", "# c #55D255", "$ c #41B84A", "% c #67DC72", "& c #48C54E", "* c #5CD459", "= c #46C34C", "- c #42B14F", "; c #388D46", "> c #297E3B", ", c #055625", "' c #42B94D", ") c #B3F7AC", "! c #B6F9B6", "~ c #A4F392", "{ c #227335", "] c #2E8543", "^ c #BFFAC3", "/ c #9EF081", "( c #6AD758", "_ c #9DEF78", ": c #267B3C", "< c #AAF7BA", "[ c #3F9E44", "} c #066334", "| c #59D259", "1 c #1F7437", "2 c #ACF7A4", "3 c #37883F", "4 c #78E580", "5 c #43BF40", " ", " ", " .... ", " .+@+@. ", " .#$#$#$...... ", " .%&*&*&*=-&-;.", " ...........>,'.", ".)!~!~!~!~!~.{].", ".^/(_(_(_(_(.{:.", " .<_(_(_(_(_[.:.", " }!|_(_(_(_(_.1.", " }2(_(_(_(_(3..", " .4(5(5(5(5(5..", " ............ ", " ", " "}; sitecopy-0.16.6/gnome/init.h0000664000076400007640000000241010232743237014012 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ #include #include #include #include "config.h" #include "misc.h" #include "operations.h" #include "resynch.h" #include "new_site.h" #include "rcfile.h" #include "common.h" int create_about(void); int create_main_window(void); int xsitecopy_read_configuration(void); sitecopy-0.16.6/gnome/new_site.h0000664000076400007640000001465710232743237014704 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef _NEW_SITE_H_ #define _NEW_SITE_H_ #include #include "sites.h" #include "misc.h" struct create_site_widget_set { GtkWidget *name; GtkWidget *hostname_choice; GtkWidget *username_choice; GtkWidget *checkdelete_choice; GtkWidget *checkmove_choice; GtkWidget *passiveftp_choice; GtkWidget *deletefirst_choice; GtkWidget *protocol_choice; GtkWidget *protocol_choice_menu; GtkWidget *password_choice; GtkWidget *local_choice; GtkWidget *remotedir_choice; GtkWidget *url_choice; GtkWidget *init_choice; GtkWidget *catchup_choice; /* private stuff */ GtkWidget *sym_choice; GtkWidget *sym_choice_menu; GtkWidget *perms_choice; GtkWidget *perms_choice_menu; }; struct site *default_site(void); void set_proto(GtkWidget * menu_item, gpointer data); void set_perms(GtkWidget * menu_item, gpointer data); void set_sym(GtkWidget * menu_item, gpointer data); GtkWidget *create_new_wiz_book(void); void start_new_site_wizard(void); gchar *grab_druid_entry_into_string(gchar *widget_name); /* Callbacks */ gboolean on_site_druid_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data); gboolean verify_name_and_url (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean verify_server_details (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); void set_new_port (GtkToggleButton *togglebutton, gpointer user_data); gboolean verify_directories (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean verify_file_attributes (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean verify_update_options (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean should_we_fetch (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean set_back_insensitive (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean make_site_from_druid (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean check_fetch_worked (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); void begin_first_time_fetch (GtkButton *button, gpointer user_data); void druid_finished (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean on_general_info_cancel (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean on_server_info_cancel (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean on_directories_cancel (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean on_file_handling_cancel (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean on_update_options_cancel (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean on_server_state_cancel (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean on_fetch_a_list_cancel (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); gboolean druid_back(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data); gboolean on_finish_page_cancel (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); #endif /* _NEW_SITE_H_ */ sitecopy-0.16.6/gnome/operations.h0000664000076400007640000000474610232743237015250 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef OPERATIONS_H #define OPERATIONS_H #include #include #include #include #include #include #include #include "gcommon.h" #include "sites.h" #include "common.h" #include "rcfile.h" #include "gcommon.h" #include "misc.h" #include "config.h" #include "tree.h" enum site_op { site_op_update, site_op_fetch, site_op_resync }; /* Abort handling */ void handle_abort( int sig ); void do_abort(void); void fe_disable_abort( struct site *site ); void fe_enable_abort( struct site *site ); int my_abortable_transfer_wrapper( struct site *site, enum site_op operation ); /* Updates */ void *update_all_thread(void *no_data); void *update_thread(void *no_data); void close_main_update_window(GtkButton * button, gpointer data); void abort_site_update(GtkWidget * button, gpointer data); int start_main_update(GtkWidget *button, gpointer single_or_all); int main_update_please(GtkWidget * update_button, gpointer data); /* File List changes */ int fe_catchup_site(void); void catchup_selected(gint button_number, gpointer data); int fe_init_site(void); void initialize_selected(gint button_number, gpointer data); /* Disk accesses */ void save_default(void); /* Saves site definitions to current value of 'rcfile' */ /* Site List changes */ void delete_a_site(GtkWidget * button_or_menu, gpointer data); struct site *find_prev_site(struct site *a_site); /* Used for delete_a_site */ void delete_selected(gint button_number); #endif /* OPERATIONS_H */ sitecopy-0.16.6/gnome/init.c0000664000076400007640000004012310232743237014010 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, 2005, Lee Mallabone * * 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. * */ #include "init.h" GtkWidget *site_tree, *app_bar; GtkWidget *main_area_box, *area_data; GtkWidget *popup_win, *popup_label, *popup_frame; int site_keepgoing = FALSE; extern GtkWidget *sitecopy; extern struct site *all_sites; struct xsitecopy_prefs *main_prefs, *edited_prefs; gboolean fatal_error_encountered = FALSE; int create_about(void) { GtkWidget *about_window; const gchar *people[] = {"Lee Mallabone ", "Joe Orton ", NULL}; about_window = gnome_about_new("XSitecopy", PACKAGE_VERSION, "Copyright (C) 1999,2000 Lee Mallabone", people, "XSitecopy is the official GNOME front end to sitecopy.\nSitecopy is for copying locally stored websites to remote web servers.", NULL); gtk_widget_show(about_window); return 1; } int create_main_window(void) { GtkWidget *ctree_scroller, *app_contents, *panes; /* MENUS */ static GnomeUIInfo file_menu[] = { {GNOME_APP_UI_ITEM, N_("_New site..."), N_("Create a new site definition"), start_new_site_wizard, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW, 'n', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("_Open..."), N_("Open a new rc file. (EXPERIMENTAL)."), open_new_request, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, 'o', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("_Save Sites"), N_("Save the current site definitions"), save_default, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 's', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Sav_e Sites As..."), N_("Save the current site definitions to a file."), saveas_request, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 'e', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("_Delete this site"), N_("Delete the selected site entry"), delete_a_site, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_TRASH, 'w', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_SEPARATOR, {GNOME_APP_UI_ITEM, N_("E_xit"), N_("Exit the program"), quit_please, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT, 'q', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; static GnomeUIInfo ops_menu[] = { {GNOME_APP_UI_ITEM, N_("_Initialise site"), N_("All files will be uploaded if a site is initialised"), fe_init_site, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, 'i', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("'_Catchup' site"), N_("Records the site as already updated."), fe_catchup_site, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, 'c', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("_Fetch site listing"), N_("Figures out which files are new/changed from the actual remote site."), fetch_site_list_please, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REVERT, 'f', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_SEPARATOR, {GNOME_APP_UI_ITEM, N_("_Resynchronize site"), N_("Copies newer files from the remote site to the local drive."), NULL, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REFRESH, 'y', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("_Update site..."), N_("Apply the local site's changes to the remote site."), main_update_please, "single", NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REDO, 'u', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, N_("Update _ALL sites"), N_("Performs the required operations on all site definitions. (TODO)."), main_update_please, "all", NULL, GNOME_APP_PIXMAP_NONE, NULL, 'e', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_SEPARATOR, {GNOME_APP_UI_ITEM, N_("Rescan local directory"), N_("Re-reads the local directory of the selected site."), rescan_selected, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, 'r', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; static GnomeUIInfo report_menu[] = { {GNOME_APP_UI_ITEM, N_("_Required updates"), N_("Displays a brief report of any required updates."), site_report, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW, 'r', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Site web-r_eport"), N_("Generates a web page detailing the changes required on the selected site."), site_web_report, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW, 'e', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Prin_t site info..."), N_("Print information about the selected site"), NULL, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PRINT, 't', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; static GnomeUIInfo backup_menu[] = { {GNOME_APP_UI_ITEM, N_("_Backup files status"), N_("Save the 'state' of your local files, in case of accident."), backup_infofile, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 'b', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Restore files status..."), N_("If a backup has previously been made, it will be restored."), restore_infofile, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 'r', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_SEPARATOR, {GNOME_APP_UI_ITEM, N_("_Backup site definitions"), N_("Backup your site definitions, in case you delete your sites."), backup_rcfile, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 't', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Restore site definitions..."), N_("If a backup has previously been made, it will be restored."), restore_rcfile, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 'r', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; static GnomeUIInfo prefs_menu[] = { {GNOME_APP_UI_ITEM, N_("Preferences..."), N_("Performs the required operations on all site definitions. (TODO)."), NULL, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PREF, 'p', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; static GnomeUIInfo help_menu[] = { {GNOME_APP_UI_ITEM, N_("_About XSitecopy"), N_("Information about XSitecopy"), create_about, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT, 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_HELP("xsitecopy"), GNOMEUIINFO_END }; static GnomeUIInfo main_menu[] = { GNOMEUIINFO_SUBTREE(N_("_File"), file_menu), GNOMEUIINFO_SUBTREE(N_("_Operations"), ops_menu), GNOMEUIINFO_SUBTREE(N_("_Reports"), report_menu), GNOMEUIINFO_SUBTREE(N_("_Settings"), prefs_menu), GNOMEUIINFO_SUBTREE(N_("_Backup"), backup_menu), GNOMEUIINFO_SUBTREE(N_("_Help"), help_menu), GNOMEUIINFO_END }; /* TOOLBAR */ static GnomeUIInfo main_toolbar[] = { {GNOME_APP_UI_ITEM, N_("New site"), N_("Create a new site definition"), start_new_site_wizard, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_NEW, 'n', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Open"), N_("Open a new site definitions file."), open_new_request, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_OPEN, 'o', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Save"), N_("Save the current site definitions"), save_default, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_SAVE, 's', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Delete site"), N_("Delete the selected site"), delete_a_site, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_CUT, 'w', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_SEPARATOR, {GNOME_APP_UI_ITEM, N_("Initialise"), N_("Initialise the site (mark all files as needing to be updated)."), fe_init_site, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_ABOUT, 'i', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Catch-up"), N_("Mark all of the selected site's files as updated."), fe_catchup_site, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_ABOUT, 'c', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_SEPARATOR, {GNOME_APP_UI_ITEM, N_("Download"), N_("Download newer files from the remote site. (Use with care)"), GTK_SIGNAL_FUNC(main_update_please), NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_UNDO, 'u', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Update"), N_("Updates the selected site"), GTK_SIGNAL_FUNC(main_update_please), "single", NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_REDO, 'u', GDK_CONTROL_MASK, NULL }, {GNOME_APP_UI_ITEM, N_("Quit"), N_("Exit the program"), quit_please, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_EXIT, 'q', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; extern GList *errors; GtkWidget *errs; /* MENUS */ gnome_app_create_menus(GNOME_APP(sitecopy), main_menu); /* TOOLBARS */ gnome_app_create_toolbar(GNOME_APP(sitecopy), main_toolbar); /* PANES */ site_tree = ctree_create_sites(); panes = gtk_hpaned_new(); gtk_paned_set_gutter_size(GTK_PANED(panes), 12); gtk_widget_show(panes); /* Arbitrary widget that holds all the site/file detailed info. */ main_area_box = gtk_hbox_new(FALSE, 2); /* Widget is practically arbitrary */ area_data = create_initial_main_area(); /* FIXME: Add some default data to area_data */ gtk_container_add(GTK_CONTAINER(main_area_box), area_data); gtk_widget_show(main_area_box); app_contents = gtk_vbox_new(FALSE, 0); ctree_scroller = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(ctree_scroller), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_show(ctree_scroller); gtk_container_add(GTK_CONTAINER(ctree_scroller), site_tree); gtk_paned_pack1(GTK_PANED(panes), ctree_scroller, false, false); gtk_paned_pack2(GTK_PANED(panes), main_area_box, false, false); /*gtk_container_set_border_width (GTK_CONTAINER (GTK_PANED(panes)->child2), 5); */ /* APP BAR */ app_bar = gnome_appbar_new(FALSE, TRUE, GNOME_PREFERENCES_USER); gtk_widget_show(app_bar); /* Add some hints and stuff */ gnome_app_install_appbar_menu_hints(GNOME_APPBAR(app_bar), main_menu); /* Pack it all in */ gtk_box_pack_start(GTK_BOX(app_contents), panes, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(app_contents), app_bar, FALSE, FALSE, 0); gnome_app_set_contents(GNOME_APP(sitecopy), app_contents); /* FIXME: remove all this once it gets implemented */ gtk_widget_set_sensitive(ops_menu[2].widget, FALSE); /* fetch */ gtk_widget_set_sensitive(ops_menu[4].widget, FALSE); /* resynch */ gtk_widget_set_sensitive(ops_menu[6].widget, FALSE); /* Update all */ gtk_widget_set_sensitive(report_menu[1].widget, FALSE); /* web report */ gtk_widget_set_sensitive(report_menu[2].widget, FALSE); /* print */ gtk_widget_set_sensitive(prefs_menu[0].widget, FALSE); /* prefs */ gtk_widget_set_sensitive(main_toolbar[8].widget, FALSE); /* resynch */ /* SHOW IT ALL */ /* gtk_window_set_default_size (GTK_WINDOW (sitecopy), 610, 376); */ gtk_widget_show(sitecopy); if (errors) { errs = create_site_errors_dialog(); gtk_widget_show(errs); } return 1; } /* Initialisation. Attempts to read configuration info and/or set sensible * defaults where appropriate. */ int xsitecopy_read_configuration(void) { extern GList *errors; /* TODO: * Use the gnome_config functions to * setup preferences for different aspects of the UI/default file * names. Put all the gnome_config calls in this function and rename. */ int ret; extern gchar *rcfile; struct stat *rc_stat, *info_dir_stat; gchar *rcfilename, *infodirname; FILE *rc; /* Allocate and set default preferences */ main_prefs = malloc(sizeof(struct xsitecopy_prefs)); main_prefs->label = local_dir; main_prefs->should_sort = TRUE; main_prefs->site_needs_update_col = 0; main_prefs->site_updated_col = 0; main_prefs->needs_update = NULL; main_prefs->in_sync = NULL; main_prefs->backup_state_before_fetch = FALSE; main_prefs->always_keep_going = FALSE; main_prefs->log_errors = FALSE; main_prefs->error_log_filename = FALSE; main_prefs->quit_confirmation = TRUE; main_prefs->save_confirmation = TRUE; rcfilename = g_strdup_printf("%s/.sitecopyrc", g_get_home_dir()); infodirname = g_strdup_printf("%s/.sitecopy/", g_get_home_dir()); /* FIXME: Read configuration data using gnome-config */ rc_stat = malloc(sizeof(struct stat)); info_dir_stat = malloc(sizeof(struct stat)); if (stat((const char *) rcfilename, rc_stat) != 0) { NE_DEBUG(DEBUG_GNOME, "creating rc...\n"); rc = fopen(rcfilename, "a"); fclose(rc); chmod(rcfilename, 00600); } if (stat((const char *) infodirname, info_dir_stat) != 0) { if (mkdir(infodirname, 00700) != 0) { errors = g_list_append(errors, "FATAL ERROR: Could not create required config directory.\n"); fatal_error_encountered = TRUE; } else { chmod(infodirname, 00700); } } if (init_env()) { errors = g_list_append(errors, "FATAL ERROR: Could not setup the environment correctly!\n"); fatal_error_encountered = TRUE; } ret = init_paths(); switch (ret) { case RC_OPENFILE: errors = g_list_append(errors, "FATAL ERROR: Could not read the site definitions.\n"); fatal_error_encountered = TRUE; break; case RC_DIROPEN: errors = g_list_append(errors, "FATAL ERROR: Could not get information about the file data storage directory.\n"); fatal_error_encountered = TRUE; break; case RC_PERMS: errors = g_list_append(errors, "WARNING: Your sitecopy configuration file has dangerous permissions.\nOther users may be able to read your passwords unless this is corrected.\n"); break; case RC_DIRPERMS: errors = g_list_append(errors, "WARNING: Your sitecopy storage directory (~/.sitecopy) has invalid or insecure permissions.\n"); break; case RC_NETRCPERMS: errors = g_list_append(errors, "WARNING: Your network configuration file (~/.netrc) has invalid or insecure permissions.\n"); break; case 0: break; default: errors = g_list_append(errors, "Could not setup the environment correctly!\n"); fatal_error_encountered = TRUE; } if (init_netrc()) errors = g_list_append(errors, "There was a problem parsing your ~/.netrc file.\n"); /* If this fails, we're really screwed... hmmm.. Need to have a flag to * tell the errors dialog to just die when ok is pressed, if this has * failed. */ /*if (rcfile_read(&all_sites)) { printf("Error: Could not read rcfile: %s.\n", rcfile); errors = g_list_append(errors, "Could not read your site definitions file! (usually ~/.sitecopyrc)\n"); fatal_error_encountered = TRUE; */ ret = rcfile_read(&all_sites); if (ret) { /* So we can use the same gettext strings as sitecopy. */ char const *progname = "xsitecopy"; switch (ret) { case RC_OPENFILE: printf( _("%s: Error: Could not open rcfile: %s.\n"), progname, rcfile ); break; case RC_CORRUPT: printf( _("%s: rcfile corrupt at line %d:\n%s\n"), progname, rcfile_linenum, rcfile_err ); break; default: printf( _("%s: Error: Could not read rcfile: %s.\n"), progname, rcfile ); break; } errors = g_list_append(errors, "Could not read your site definitions file! (usually ~/.sitecopyrc)\n"); fatal_error_encountered = TRUE; } return 1; } sitecopy-0.16.6/gnome/dir_changed.xpm0000664000076400007640000000143610165765223015666 0ustar joejoe/* XPM */ static char * dir_changed_xpm[] = { "16 16 28 1", " c None", ". c #000000", "+ c #DCC679", "@ c #C9AC56", "# c #CAAF5D", "$ c #C89F31", "% c #F8F3D1", "& c #F3E8B4", "* c #F9F5D6", "= c #E3D296", "- c #EBDFB2", "; c #F0E4A9", "> c #E2CE89", ", c #ECDA93", "' c #DDC77C", ") c #D9C376", "! c #CCB367", "~ c #C79F34", "{ c #F6EEC3", "] c #B9922A", "^ c #AF8820", "/ c #CFB96A", "( c #C7AA50", "_ c #D7BF74", ": c #C8A64B", "< c #A58216", "[ c #EEE09F", "} c #987407", " ", " ", " .... ", " .+@+@. ", " .#$#$#$...... ", " .%&*&*&%*=-;>.", " .;+,+,+,')!+~.", " .{,+,+,))!+!].", " .;+,+,)+!+!!^.", " .{,+,)+!+!/(^.", " .;+,_+!+!!(:<.", " .{,_+!+!!::~<.", " .[]~]:]~]^<<}.", " ............ ", " ", " "}; sitecopy-0.16.6/gnome/dir_new.xpm0000664000076400007640000000143210165765223015062 0ustar joejoe/* XPM */ static char * dir_new_xpm[] = { "16 16 28 1", " c None", ". c #000000", "+ c #EF6676", "@ c #DA4561", "# c #DD4A62", "$ c #C43554", "% c #FCCDE0", "& c #FBACBF", "* c #FCD3E5", "= c #F485A5", "- c #F8A5C8", "; c #FA9FAE", "> c #F27990", ", c #F8878F", "' c #EF6A7D", ") c #EC6376", "! c #E15269", "~ c #C53658", "{ c #FCBDD0", "] c #AC3758", "^ c #9F3052", "/ c #E4556D", "( c #D5425E", "_ c #EA6174", ": c #D43F5F", "< c #932849", "[ c #F994A0", "} c #851A42", " ", " ", " .... ", " .+@+@. ", " .#$#$#$...... ", " .%&*&*&%*=-;>.", " .;+,+,+,')!+~.", " .{,+,+,))!+!].", " .;+,+,)+!+!!^.", " .{,+,)+!+!/(^.", " .;+,_+!+!!(:<.", " .{,_+!+!!::~<.", " .[]~]:]~]^<<}.", " ............ ", " ", " "}; sitecopy-0.16.6/gnome/file_widgets.c0000664000076400007640000002604210232743237015516 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. */ #include "config.h" #include #include #include "basename.h" #include "sites.h" #include "file_widgets.h" GtkWidget *file_info_container; extern struct site *selected_site; /* FIXME: This won't work, but `view' is disabled for now anyway. */ static void file_view_clicked(GtkWidget * button, gpointer data) { GtkWidget *base = gtk_object_get_data(GTK_OBJECT(file_info_container), "entry20"); gchar *base_command = gtk_entry_get_text(GTK_ENTRY(base)); system(base_command); } GtkWidget *make_file_info_area(struct site_file *the_file) { const gchar *mime_info = NULL; struct stat *file_data = NULL; GtkWidget *table7; GtkWidget *label51; GtkWidget *entry11; GtkWidget *entry14; GtkWidget *label52; GtkWidget *label53; GtkWidget *entry15; GtkWidget *entry16; GtkWidget *entry17; GtkWidget *label54; GtkWidget *label55; GtkWidget *label56; GtkWidget *entry12; GtkWidget *entry13; GtkWidget *label57; GtkWidget *label58; GtkWidget *entry18; GtkWidget *entry19; GtkWidget *label60; GtkWidget *entry20; GtkWidget *label59; GtkWidget *view_button, *label; g_assert(the_file != NULL); file_info_container = gtk_frame_new(file_name(the_file)); gtk_widget_show(file_info_container); if (!the_file) { label = gtk_label_new("Selected file pointed to null!"); gtk_widget_show(label); gtk_container_add(GTK_CONTAINER(file_info_container), label); return file_info_container; } file_data = (struct stat *) malloc(sizeof(struct stat)); if (the_file->local.exists) { if (stat((const char *) file_full_local(&(the_file->local), selected_site), file_data) == -1) { label = gtk_label_new("Could not retrieve file information"); gtk_widget_show(label); gtk_container_add(GTK_CONTAINER(file_info_container), label); return file_info_container; } } else { label = gtk_label_new("The file does not appear to exist locally any more.\nIt has either been deleted or there is an access problem."); gtk_widget_show(label); gtk_container_add(GTK_CONTAINER(file_info_container), label); return file_info_container; } gtk_object_set_data(GTK_OBJECT(file_info_container), "file_info_container", file_info_container); table7 = gtk_table_new(8, 4, FALSE); gtk_widget_show(table7); gtk_container_add(GTK_CONTAINER(file_info_container), table7); gtk_container_set_border_width(GTK_CONTAINER(table7), 4); gtk_table_set_row_spacings(GTK_TABLE(table7), 2); gtk_table_set_col_spacings(GTK_TABLE(table7), 6); label51 = gtk_label_new("Local filename: "); gtk_widget_show(label51); gtk_table_attach(GTK_TABLE(table7), label51, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label51), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label51), 0, 0.5); entry11 = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entry11), base_name(file_name(the_file))); gtk_widget_show(entry11); gtk_table_attach(GTK_TABLE(table7), entry11, 1, 4, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_entry_set_editable(GTK_ENTRY(entry11), FALSE); entry14 = gtk_entry_new(); if (the_file->local.exists) mime_info = gnome_mime_type((const gchar *) file_full_local(&(the_file->local), selected_site)); if (mime_info && (the_file->type != file_dir)) gtk_entry_set_text(GTK_ENTRY(entry14), mime_info); gtk_widget_show(entry14); gtk_table_attach(GTK_TABLE(table7), entry14, 1, 4, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_entry_set_editable(GTK_ENTRY(entry14), FALSE); label52 = gtk_label_new("Mime type: "); gtk_widget_show(label52); gtk_table_attach(GTK_TABLE(table7), label52, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label52), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label52), 0, 0.5); label53 = gtk_label_new("Last modified: "); gtk_widget_show(label53); gtk_table_attach(GTK_TABLE(table7), label53, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label53), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label53), 0, 0.5); entry15 = gtk_entry_new(); if (the_file->local.exists) gtk_entry_set_text(GTK_ENTRY(entry15), ctime(&(the_file->local.time))); gtk_widget_show(entry15); gtk_table_attach(GTK_TABLE(table7), entry15, 1, 4, 2, 3, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_entry_set_editable(GTK_ENTRY(entry15), FALSE); entry16 = gtk_entry_new(); /*changed */ gtk_entry_set_text(GTK_ENTRY(entry16), ctime(&(file_data->st_ctime))); gtk_widget_show(entry16); gtk_table_attach(GTK_TABLE(table7), entry16, 1, 4, 3, 4, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_entry_set_editable(GTK_ENTRY(entry16), FALSE); entry17 = gtk_entry_new(); /*accessed */ gtk_entry_set_text(GTK_ENTRY(entry17), ctime(&(file_data->st_atime))); gtk_widget_show(entry17); gtk_table_attach(GTK_TABLE(table7), entry17, 1, 4, 4, 5, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_entry_set_editable(GTK_ENTRY(entry17), FALSE); label54 = gtk_label_new("Last changed: "); gtk_widget_show(label54); gtk_table_attach(GTK_TABLE(table7), label54, 0, 1, 3, 4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_misc_set_alignment(GTK_MISC(label54), 0, 0.5); label55 = gtk_label_new("Last accessed: "); gtk_widget_show(label55); gtk_table_attach(GTK_TABLE(table7), label55, 0, 1, 4, 5, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label55), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label55), 0, 0.5); label56 = gtk_label_new("User ID: "); gtk_widget_show(label56); gtk_table_attach(GTK_TABLE(table7), label56, 0, 1, 5, 6, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label56), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label56), 0, 0.5); entry12 = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entry12), g_strdup_printf("%d", file_data->st_uid)); gtk_widget_show(entry12); gtk_table_attach(GTK_TABLE(table7), entry12, 1, 2, 5, 6, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_widget_set_usize(entry12, 80, -2); gtk_entry_set_editable(GTK_ENTRY(entry12), FALSE); entry13 = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entry13), g_strdup_printf("%d", file_data->st_gid)); gtk_widget_show(entry13); gtk_table_attach(GTK_TABLE(table7), entry13, 3, 4, 5, 6, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_widget_set_usize(entry13, 80, -2); gtk_entry_set_editable(GTK_ENTRY(entry13), FALSE); label57 = gtk_label_new("Group ID: "); gtk_widget_show(label57); gtk_table_attach(GTK_TABLE(table7), label57, 2, 3, 5, 6, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label57), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label57), 0, 0.5); label58 = gtk_label_new("Filesize (bytes): "); gtk_widget_show(label58); gtk_table_attach(GTK_TABLE(table7), label58, 0, 1, 6, 7, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label58), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label58), 0, 0.5); entry18 = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entry18), g_strdup_printf("%d", (int) file_data->st_size)); gtk_widget_show(entry18); gtk_table_attach(GTK_TABLE(table7), entry18, 1, 2, 6, 7, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_widget_set_usize(entry18, 80, -2); gtk_entry_set_editable(GTK_ENTRY(entry18), FALSE); entry19 = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entry19), g_strdup_printf("%d", file_data->st_mode)); gtk_widget_show(entry19); gtk_table_attach(GTK_TABLE(table7), entry19, 3, 4, 6, 7, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_widget_set_usize(entry19, 98, -2); label60 = gtk_label_new("Viewer command: "); gtk_widget_show(label60); gtk_table_attach(GTK_TABLE(table7), label60, 0, 1, 7, 8, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND), 0, 0); entry20 = gtk_entry_new(); /*viewer command */ if (gnome_mime_program(mime_info)) gtk_entry_set_text(GTK_ENTRY(entry20), gnome_mime_program(mime_info)); gtk_widget_show(entry20); gtk_table_attach(GTK_TABLE(table7), entry20, 1, 3, 7, 8, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); label59 = gtk_label_new("Protection: "); gtk_widget_show(label59); gtk_table_attach(GTK_TABLE(table7), label59, 2, 3, 6, 7, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label59), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label59), 0, 0.5); view_button = gtk_button_new_with_label("View"); if (the_file->type == file_dir) gtk_widget_set_sensitive(view_button, FALSE); gtk_widget_show(view_button); gtk_table_attach(GTK_TABLE(table7), view_button, 3, 4, 7, 8, (GtkAttachOptions) (0), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_signal_connect(GTK_OBJECT(view_button), "clicked", GTK_SIGNAL_FUNC(file_view_clicked), NULL); return file_info_container; } sitecopy-0.16.6/gnome/site_widgets.h0000664000076400007640000000236310232743237015550 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef FE_GTK_SITE_WIDGETS_H #define FE_GTK_SITE_WIDGETS_H #include #include "rcfile.h" #include "misc.h" #include "gcommon.h" #include "changes.h" #include "minilist.h" GtkWidget *make_site_info_area(struct site *the_site); #endif /* FE_GTK_SITE_WIDGETS_H */ sitecopy-0.16.6/gnome/link_del.xpm0000664000076400007640000000210210165765223015207 0ustar joejoe/* XPM */ static char * link_del_xpm[] = { "16 15 49 1", " c None", ". c #E1846D", "+ c #F5312A", "@ c #FE0505", "# c #FA322F", "$ c #F78983", "% c #EF3024", "& c #FF0000", "* c #FB3330", "= c #EB2F20", "- c #EF2E22", "; c #ABB2C3", "> c #1F3460", ", c #3B4D74", "' c #DFA990", ") c #F7302A", "! c #BF7D4B", "~ c #EB2D1E", "{ c #F63029", "] c #F1877D", "^ c #E42E19", "/ c #C7CCD7", "( c #73809C", "_ c #F7322C", ": c #E0E3E9", "< c #C5CAD6", "[ c #FB0502", "} c #FD0504", "| c #A1A9BC", "1 c #35476F", "2 c #1C315E", "3 c #667492", "4 c #DD2C12", "5 c #E3E5EB", "6 c #DF2B12", "7 c #576687", "8 c #031A4C", "9 c #E01313", "0 c #A83434", "a c #D92C0E", "b c #DE2A11", "c c #3F7462", "d c #8F99AF", "e c #E62C19", "f c #FF3434", "g c #D92B0E", "h c #E51A1A", "i c #FA0501", "j c #F22727", " ", " .+@@#$ ", " %&&&&&&* ", " =&-;>,')&# ", " !&~ ;&&{&] ", " ^& &&/(&_/ ", ":<[&<<<&& &}>(", "|1[&22&&3 &}>;", " 4& && 5(>&% ", " &6& /78(9&0 ", " a&b(cd e&f ", " g&&&&&&h ", " ai@j0 ", " ", " "}; sitecopy-0.16.6/gnome/dir_del.xpm0000664000076400007640000000224010165765223015033 0ustar joejoe/* XPM */ static char * dir_del_xpm[] = { "16 16 54 1", " c None", ". c #000000", "+ c #E1846D", "@ c #F5312A", "# c #FE0505", "$ c #FA322F", "% c #F78983", "& c #EF3024", "* c #FF0000", "= c #FB3330", "- c #EB2F20", "; c #EF2E22", "> c #41B84A", ", c #55D255", "' c #DFA990", ") c #F7302A", "! c #BF7D4B", "~ c #EB2D1E", "{ c #D3FCDC", "] c #B5F7B0", "^ c #F63029", "/ c #F1877D", "( c #85EB80", "_ c #E42E19", ": c #7DE66F", "< c #A5F28D", "[ c #A5F190", "} c #7EE673", "| c #74E36C", "1 c #F7322C", "2 c #42B94D", "3 c #FB0502", "4 c #5DD65D", "5 c #FD0504", "6 c #42A151", "7 c #3C934C", "8 c #DD2C12", "9 c #78E372", "0 c #DF2B12", "a c #73E16A", "b c #E01313", "c c #A83434", "d c #328946", "e c #D92C0E", "f c #DE2A11", "g c #64D660", "h c #E62C19", "i c #FF3434", "j c #AAF598", "k c #D92B0E", "l c #E51A1A", "m c #247B3D", "n c #FA0501", "o c #F22727", " ", " ", " .+@##$% ", " .&******= ", " .-*;>,>')*$.. ", " !*~{]{]**^*/(.", " _*:<:[**}|*12.", " 3*<:<**||4*56.", " 3*:<**|:4:*57.", " 8*<**9:4:4*&7.", " .*0*a:4:4b*cd.", " .e*f:g:4h*i2d.", " .jk******lddm.", " ...en#oc.... ", " ", " "}; sitecopy-0.16.6/gnome/new_site.c0000664000076400007640000017543010232743237014674 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "new_site.h" GtkWidget *site_druid = NULL; struct site *site_to_add = NULL; extern GtkWidget *the_tree; /* This function taken from Glade's generated 'support.c' file. */ GdkImlibImage* create_image (const gchar *filename) { GdkImlibImage *image; gchar *pathname; pathname = gnome_pixmap_file (filename); if (!pathname) { g_warning ("Couldn't find pixmap file: %s", filename); return NULL; } image = gdk_imlib_load_image (pathname); g_free (pathname); return image; } /* After using this function, the info file must still be set before * the site can be used. This only initialises *core* stuff. More should * be done before adding the site to the sites list and/or verifying it. */ struct site *default_site(void) { struct site *new_site = g_malloc0(sizeof(struct site)); new_site->protocol = siteproto_unknown; /* new_site->driver = &ftp_driver;*/ new_site->server.hostname = g_strdup("remote.site.com"); new_site->server.port = 21; new_site->server.username = g_strdup("joe.bloggs"); new_site->server.password = g_strdup("password"); new_site->local_root_user = g_get_home_dir(); new_site->remote_root_user = g_strdup("~/"); /* Let's be conservative. If the user wants more exotic options * they have plenty of time to set them for themselves. */ new_site->perms = sitep_ignore; new_site->symlinks = sitesym_ignore; new_site->state_method = state_timesize; return new_site; } void add_site(gpointer user_data) { struct site *this_site, *last_site; int mode = 0; this_site = g_malloc0( sizeof( struct site ) ); memcpy( this_site, site_to_add, sizeof( struct site ) ); if (verifysite_gnome(this_site) != 0) { g_assert_not_reached(); return; } /* Simple case: we have no sites */ if (!all_sites) { all_sites = this_site; } else { /* Find the end of the sites list */ for(last_site = all_sites; last_site->next != NULL; last_site = last_site->next) ; this_site->prev = last_site; this_site->next = NULL; if (this_site->prev) this_site->prev->next = this_site; } if (GTK_TOGGLE_BUTTON(get_widget(site_druid, "new_init"))->active) { printf("Will init the site...\n"); mode = 1; } else { mode = 2; printf("will catchup the site...\n"); } site_write_stored_state(this_site); if (add_a_site_to_the_tree(this_site, mode) < 0) gnome_error_dialog("There was a problem creating the site"); memset(site_to_add, 0, sizeof(struct site)); return; } /** PRE: site_to_add should already have been allocated with g_malloc **/ void close_druid(void) { if (site_to_add) { g_free(site_to_add); site_to_add = NULL; } gtk_widget_destroy(site_druid); site_druid = NULL; } GtkWidget * create_site_druid() { /**** Start of glade generated code ****/ GtkWidget *new_site_druid; GtkWidget *start_page; GdkColor start_page_logo_bg_color = {0, 6400, 6400, 28672}; GtkWidget *general_info; GdkColor general_info_logo_bg_color = {0, 6400, 6400, 28672}; GtkWidget *druid_vbox1; GtkWidget *vbox28; GtkWidget *label67; GtkWidget *hseparator5; GtkWidget *table12; GtkWidget *new_url; GtkWidget *label86; GtkWidget *label85; GtkWidget *new_name; GtkWidget *server_info; GdkColor server_info_logo_bg_color = {0, 6400, 6400, 28672}; GtkWidget *druid_vbox2; GtkWidget *vbox27; GtkWidget *label66; GtkWidget *hseparator4; GtkWidget *table8; GtkWidget *new_hostname; GtkWidget *hbox16; GSList *new_proto_group = NULL; GtkWidget *new_ftp; GtkWidget *new_http; GtkObject *new_port_adj; GtkWidget *new_port; GtkWidget *new_username; GtkWidget *new_password; GtkWidget *label64; GtkWidget *label63; GtkWidget *label65; GtkWidget *label62; GtkWidget *label61; GtkWidget *directories; GdkColor directories_logo_bg_color = {0, 6400, 6400, 28672}; GtkWidget *druid_vbox6; GtkWidget *vbox29; GtkWidget *label68; GtkWidget *hseparator9; GtkWidget *table11; GtkWidget *new_local_fentry; GtkWidget *new_local_entry; GtkWidget *label82; GtkWidget *label81; GtkWidget *new_remote_entry; GtkWidget *file_handling; GdkColor file_handling_logo_bg_color = {0, 6400, 6400, 28672}; GtkWidget *druid_vbox3; GtkWidget *vbox30; GtkWidget *label69; GtkWidget *hseparator6; GtkWidget *table9; GtkWidget *label71; GtkWidget *hbox18; GSList *perms_group = NULL; GtkWidget *new_perms_ignore; GtkWidget *new_perms_exec; GtkWidget *new_perms_all; GtkWidget *label72; GtkWidget *hbox17; GSList *sym_link_group = NULL; GtkWidget *new_sym_follow; GtkWidget *new_sym_ignore; GtkWidget *new_sym_maintain; GtkWidget *label73; GtkWidget *hbox19; GSList *state_detector_group = NULL; GtkWidget *new_timesize; GtkWidget *new_checksum; GtkWidget *update_options; GdkColor update_options_logo_bg_color = {0, 6400, 6400, 28672}; GtkWidget *druid_vbox4; GtkWidget *vbox31; GtkWidget *label70; GtkWidget *hseparator7; GtkWidget *vbox32; GtkWidget *new_nodelete; GtkWidget *new_checkmoved; GtkWidget *new_nooverwrite; GtkWidget *new_lowercase; GtkWidget *new_safe; GtkWidget *new_pasv; GtkWidget *server_state; GdkColor server_state_logo_bg_color = {0, 6400, 6400, 28672}; GtkWidget *druid_vbox5; GtkWidget *vbox33; GtkWidget *label74; GtkWidget *hseparator8; GtkWidget *vbox34; GSList *vbox34_group = NULL; GtkWidget *new_init; GtkWidget *new_catchup; GtkWidget *new_fetch_please; GtkWidget *fetch_a_list; GdkColor fetch_a_list_logo_bg_color = {0, 6400, 6400, 28672}; GtkWidget *druid_vbox10; GtkWidget *label91; GtkWidget *hseparator10; GtkWidget *vbox36; GtkWidget *hbox23; GtkWidget *label88; GtkWidget *new_fetch_status; GtkWidget *hbox24; GtkWidget *label90; GtkWidget *fetch_num_files_got; GtkWidget *new_fetch_begin; GtkWidget *hbuttonbox2; GtkWidget *finish_page; GdkColor finish_page_logo_bg_color = {0, 6400, 6400, 28672}; site_druid = gtk_window_new(GTK_WINDOW_DIALOG); gtk_object_set_data(GTK_OBJECT(site_druid), "site_druid", site_druid); gtk_window_set_title(GTK_WINDOW(site_druid), "Create a new site definition"); gtk_window_set_default_size(GTK_WINDOW(site_druid), 510, 340); gtk_window_set_policy(GTK_WINDOW(site_druid), TRUE, TRUE, FALSE); new_site_druid = gnome_druid_new(); gtk_widget_ref(new_site_druid); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_site_druid", new_site_druid, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_site_druid); gtk_container_add(GTK_CONTAINER(site_druid), new_site_druid); start_page = gnome_druid_page_start_new(); gtk_widget_ref(start_page); gtk_object_set_data_full(GTK_OBJECT(site_druid), "start_page", start_page, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(start_page); gnome_druid_append_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(start_page)); gnome_druid_set_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(start_page)); gnome_druid_page_start_set_logo_bg_color(GNOME_DRUID_PAGE_START(start_page), &start_page_logo_bg_color); gnome_druid_page_start_set_title(GNOME_DRUID_PAGE_START(start_page), "Site Creation Druid"); gnome_druid_page_start_set_text(GNOME_DRUID_PAGE_START(start_page), "This Druid will help you to create a new web site definition,\nthat Xsitecopy can then keep track of to ensure your remote\nsite remains in sync with the local copy.\n\nIn order to do that, you need to answer the questions on the\nfollowing pages. If you get stuck at all, be sure to consult the\ninformation available from Xsitecopy's help menu.\n\nNot all the details are mandatory, but you should enter as\nmuch as possible to gain the best performance."); gnome_druid_page_start_set_logo(GNOME_DRUID_PAGE_START(start_page), create_image("gnome-networktool.png")); /* gnome_druid_page_start_set_watermark(GNOME_DRUID_PAGE_START(start_page), create_image("xsitecopy/xsc_side.xpm")); */ general_info = gnome_druid_page_standard_new_with_vals("", NULL); gtk_widget_ref(general_info); gtk_object_set_data_full(GTK_OBJECT(site_druid), "general_info", general_info, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show_all(general_info); gnome_druid_append_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(general_info)); gnome_druid_page_standard_set_logo_bg_color(GNOME_DRUID_PAGE_STANDARD(general_info), &general_info_logo_bg_color); gnome_druid_page_standard_set_title(GNOME_DRUID_PAGE_STANDARD(general_info), "General Information"); gnome_druid_page_standard_set_logo(GNOME_DRUID_PAGE_STANDARD(general_info), create_image("gnome-networktool.png")); druid_vbox1 = GNOME_DRUID_PAGE_STANDARD(general_info)->vbox; gtk_widget_ref(druid_vbox1); gtk_object_set_data_full(GTK_OBJECT(site_druid), "druid_vbox1", druid_vbox1, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(druid_vbox1); vbox28 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox28); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox28", vbox28, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox28); gtk_box_pack_start(GTK_BOX(druid_vbox1), vbox28, TRUE, TRUE, 0); label67 = gtk_label_new("First, you should give this site a 'friendly' name to refer to it by. This name is also used by sitecopy (the command line utility) to reference sites.\n\nYou should also enter the root URL of your site. For example, http://www.geocities.com/~xsitecopy-user/\nThis will aid in the generation of web-based reports."); gtk_widget_ref(label67); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label67", label67, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label67); gtk_box_pack_start(GTK_BOX(vbox28), label67, TRUE, TRUE, 0); gtk_widget_set_usize(label67, 370, -2); gtk_label_set_justify(GTK_LABEL(label67), GTK_JUSTIFY_FILL); gtk_label_set_line_wrap(GTK_LABEL(label67), TRUE); hseparator5 = gtk_hseparator_new(); gtk_widget_ref(hseparator5); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hseparator5", hseparator5, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hseparator5); gtk_box_pack_start(GTK_BOX(vbox28), hseparator5, TRUE, TRUE, 0); table12 = gtk_table_new(2, 2, FALSE); gtk_widget_ref(table12); gtk_object_set_data_full(GTK_OBJECT(site_druid), "table12", table12, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(table12); gtk_box_pack_start(GTK_BOX(vbox28), table12, TRUE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(table12), 5); new_url = gtk_entry_new(); gtk_widget_ref(new_url); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_url", new_url, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_url); gtk_table_attach(GTK_TABLE(table12), new_url, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); label86 = gtk_label_new("Root URL: "); gtk_widget_ref(label86); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label86", label86, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label86); gtk_table_attach(GTK_TABLE(table12), label86, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label86), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label86), 0, 0.5); label85 = gtk_label_new("Friendly name: "); gtk_widget_ref(label85); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label85", label85, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label85); gtk_table_attach(GTK_TABLE(table12), label85, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label85), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label85), 0, 0.5); new_name = gtk_entry_new(); gtk_widget_ref(new_name); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_name", new_name, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_name); gtk_table_attach(GTK_TABLE(table12), new_name, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); server_info = gnome_druid_page_standard_new_with_vals("", NULL); gtk_widget_ref(server_info); gtk_object_set_data_full(GTK_OBJECT(site_druid), "server_info", server_info, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show_all(server_info); gnome_druid_append_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(server_info)); gnome_druid_page_standard_set_logo_bg_color(GNOME_DRUID_PAGE_STANDARD(server_info), &server_info_logo_bg_color); gnome_druid_page_standard_set_title(GNOME_DRUID_PAGE_STANDARD(server_info), "Server Information"); gnome_druid_page_standard_set_logo(GNOME_DRUID_PAGE_STANDARD(server_info), create_image("mc/i-sock.png")); druid_vbox2 = GNOME_DRUID_PAGE_STANDARD(server_info)->vbox; gtk_widget_ref(druid_vbox2); gtk_object_set_data_full(GTK_OBJECT(site_druid), "druid_vbox2", druid_vbox2, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(druid_vbox2); vbox27 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox27); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox27", vbox27, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox27); gtk_box_pack_start(GTK_BOX(druid_vbox2), vbox27, TRUE, TRUE, 0); label66 = gtk_label_new("Now enter details about the remote server that your website is stored on. When selecting the protocol, an appropriate default port number will be provided.\nYour password will not appear on screen."); gtk_widget_ref(label66); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label66", label66, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label66); gtk_box_pack_start(GTK_BOX(vbox27), label66, TRUE, TRUE, 0); gtk_widget_set_usize(label66, 370, -2); gtk_label_set_justify(GTK_LABEL(label66), GTK_JUSTIFY_FILL); gtk_label_set_line_wrap(GTK_LABEL(label66), TRUE); hseparator4 = gtk_hseparator_new(); gtk_widget_ref(hseparator4); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hseparator4", hseparator4, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hseparator4); gtk_box_pack_start(GTK_BOX(vbox27), hseparator4, TRUE, TRUE, 0); table8 = gtk_table_new(5, 2, FALSE); gtk_widget_ref(table8); gtk_object_set_data_full(GTK_OBJECT(site_druid), "table8", table8, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(table8); gtk_box_pack_start(GTK_BOX(vbox27), table8, TRUE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(table8), 5); new_hostname = gtk_entry_new(); gtk_widget_ref(new_hostname); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_hostname", new_hostname, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_hostname); gtk_table_attach(GTK_TABLE(table8), new_hostname, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); hbox16 = gtk_hbox_new(FALSE, 0); gtk_widget_ref(hbox16); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hbox16", hbox16, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hbox16); gtk_table_attach(GTK_TABLE(table8), hbox16, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); new_ftp = gtk_radio_button_new_with_label(new_proto_group, "FTP"); new_proto_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_ftp)); gtk_widget_ref(new_ftp); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_ftp", new_ftp, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_ftp); gtk_box_pack_start(GTK_BOX(hbox16), new_ftp, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(new_ftp), TRUE); #ifdef USE_DAV new_http = gtk_radio_button_new_with_label(new_proto_group, "WebDAV"); new_proto_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_http)); gtk_widget_ref(new_http); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_http", new_http, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_http); gtk_box_pack_start(GTK_BOX(hbox16), new_http, FALSE, FALSE, 0); #endif /* USE_DAV */ new_port_adj = gtk_adjustment_new(21, 1, 65536, 1, 10, 10); new_port = gtk_spin_button_new(GTK_ADJUSTMENT(new_port_adj), 1, 0); gtk_widget_ref(new_port); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_port", new_port, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_port); gtk_table_attach(GTK_TABLE(table8), new_port, 1, 2, 2, 3, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); new_username = gtk_entry_new(); gtk_widget_ref(new_username); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_username", new_username, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_username); gtk_table_attach(GTK_TABLE(table8), new_username, 1, 2, 3, 4, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); new_password = gtk_entry_new(); gtk_widget_ref(new_password); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_password", new_password, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_password); gtk_table_attach(GTK_TABLE(table8), new_password, 1, 2, 4, 5, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_entry_set_visibility(GTK_ENTRY(new_password), FALSE); label64 = gtk_label_new("Username: "); gtk_widget_ref(label64); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label64", label64, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label64); gtk_table_attach(GTK_TABLE(table8), label64, 0, 1, 3, 4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label64), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label64), 0, 0.5); label63 = gtk_label_new("Port Number: "); gtk_widget_ref(label63); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label63", label63, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label63); gtk_table_attach(GTK_TABLE(table8), label63, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); label65 = gtk_label_new("Password: "); gtk_widget_ref(label65); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label65", label65, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label65); gtk_table_attach(GTK_TABLE(table8), label65, 0, 1, 4, 5, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label65), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label65), 0, 0.5); label62 = gtk_label_new("Protocol: "); gtk_widget_ref(label62); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label62", label62, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label62); gtk_table_attach(GTK_TABLE(table8), label62, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label62), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label62), 0, 0.5); label61 = gtk_label_new("Host name: "); gtk_widget_ref(label61); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label61", label61, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label61); gtk_table_attach(GTK_TABLE(table8), label61, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label61), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label61), 0, 0.5); directories = gnome_druid_page_standard_new_with_vals("", NULL); gtk_widget_ref(directories); gtk_object_set_data_full(GTK_OBJECT(site_druid), "directories", directories, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show_all(directories); gnome_druid_append_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(directories)); gnome_druid_page_standard_set_logo_bg_color(GNOME_DRUID_PAGE_STANDARD(directories), &directories_logo_bg_color); gnome_druid_page_standard_set_title(GNOME_DRUID_PAGE_STANDARD(directories), "Directories"); gnome_druid_page_standard_set_logo(GNOME_DRUID_PAGE_STANDARD(directories), create_image("mc/i-directory.png")); druid_vbox6 = GNOME_DRUID_PAGE_STANDARD(directories)->vbox; gtk_widget_ref(druid_vbox6); gtk_object_set_data_full(GTK_OBJECT(site_druid), "druid_vbox6", druid_vbox6, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(druid_vbox6); vbox29 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox29); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox29", vbox29, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox29); gtk_box_pack_start(GTK_BOX(druid_vbox6), vbox29, TRUE, TRUE, 0); label68 = gtk_label_new("I now need to know where you store the files that make up your web site; both locally, and on the remote site.\nDirectories must either be absolute (eg. /home/lee/web/), or relative to your login directory, (eg. ~/web/).\n\nAll directories should end with a trailing slash character."); gtk_widget_ref(label68); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label68", label68, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label68); gtk_box_pack_start(GTK_BOX(vbox29), label68, TRUE, TRUE, 0); gtk_widget_set_usize(label68, 370, -2); gtk_label_set_justify(GTK_LABEL(label68), GTK_JUSTIFY_FILL); gtk_label_set_line_wrap(GTK_LABEL(label68), TRUE); hseparator9 = gtk_hseparator_new(); gtk_widget_ref(hseparator9); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hseparator9", hseparator9, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hseparator9); gtk_box_pack_start(GTK_BOX(vbox29), hseparator9, TRUE, TRUE, 0); table11 = gtk_table_new(2, 2, FALSE); gtk_widget_ref(table11); gtk_object_set_data_full(GTK_OBJECT(site_druid), "table11", table11, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(table11); gtk_box_pack_start(GTK_BOX(vbox29), table11, TRUE, FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(table11), 5); gtk_table_set_row_spacings(GTK_TABLE(table11), 2); gtk_table_set_col_spacings(GTK_TABLE(table11), 2); new_local_fentry = gnome_file_entry_new(NULL, NULL); gnome_file_entry_set_directory(GNOME_FILE_ENTRY(new_local_fentry), TRUE); gtk_widget_ref(new_local_fentry); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_local_fentry", new_local_fentry, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_local_fentry); gtk_table_attach(GTK_TABLE(table11), new_local_fentry, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); new_local_entry = gnome_file_entry_gtk_entry(GNOME_FILE_ENTRY(new_local_fentry)); gtk_widget_ref(new_local_entry); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_local_entry", new_local_entry, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_local_entry); label82 = gtk_label_new("Directory for local files: "); gtk_widget_ref(label82); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label82", label82, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label82); gtk_table_attach(GTK_TABLE(table11), label82, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label82), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label82), 0, 0.5); label81 = gtk_label_new("Directory for remote files: "); gtk_widget_ref(label81); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label81", label81, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label81); gtk_table_attach(GTK_TABLE(table11), label81, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label81), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label81), 0, 0.5); new_remote_entry = gtk_entry_new(); gtk_widget_ref(new_remote_entry); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_remote_entry", new_remote_entry, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_remote_entry); gtk_table_attach(GTK_TABLE(table11), new_remote_entry, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); file_handling = gnome_druid_page_standard_new_with_vals("", NULL); gtk_widget_ref(file_handling); gtk_object_set_data_full(GTK_OBJECT(site_druid), "file_handling", file_handling, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show_all(file_handling); gnome_druid_append_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(file_handling)); gnome_druid_page_standard_set_logo_bg_color(GNOME_DRUID_PAGE_STANDARD(file_handling), &file_handling_logo_bg_color); gnome_druid_page_standard_set_title(GNOME_DRUID_PAGE_STANDARD(file_handling), "File Handling"); gnome_druid_page_standard_set_logo(GNOME_DRUID_PAGE_STANDARD(file_handling), create_image("mc/i-floppy.png")); druid_vbox3 = GNOME_DRUID_PAGE_STANDARD(file_handling)->vbox; gtk_widget_ref(druid_vbox3); gtk_object_set_data_full(GTK_OBJECT(site_druid), "druid_vbox3", druid_vbox3, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(druid_vbox3); vbox30 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox30); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox30", vbox30, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox30); gtk_box_pack_start(GTK_BOX(druid_vbox3), vbox30, TRUE, TRUE, 0); label69 = gtk_label_new("Make a choice from the selections below to denote whether you want any file permissiosn to be maintained. You can also choose the way you would like symbolic links to be treated.\n\nFinally, Xsitecopy can determine local changes by 2 different methods. Checksum is the most accurate, but file size and modification time is quicker for large sites."); gtk_widget_ref(label69); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label69", label69, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label69); gtk_box_pack_start(GTK_BOX(vbox30), label69, TRUE, TRUE, 0); gtk_widget_set_usize(label69, 370, -2); gtk_label_set_justify(GTK_LABEL(label69), GTK_JUSTIFY_FILL); gtk_label_set_line_wrap(GTK_LABEL(label69), TRUE); hseparator6 = gtk_hseparator_new(); gtk_widget_ref(hseparator6); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hseparator6", hseparator6, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hseparator6); gtk_box_pack_start(GTK_BOX(vbox30), hseparator6, TRUE, TRUE, 0); table9 = gtk_table_new(3, 2, FALSE); gtk_widget_ref(table9); gtk_object_set_data_full(GTK_OBJECT(site_druid), "table9", table9, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(table9); gtk_box_pack_start(GTK_BOX(vbox30), table9, TRUE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(table9), 5); gtk_table_set_row_spacings(GTK_TABLE(table9), 2); gtk_table_set_col_spacings(GTK_TABLE(table9), 2); label71 = gtk_label_new("Permissions mode: "); gtk_widget_ref(label71); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label71", label71, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label71); gtk_table_attach(GTK_TABLE(table9), label71, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label71), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label71), 0, 0.5); hbox18 = gtk_hbox_new(FALSE, 0); gtk_widget_ref(hbox18); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hbox18", hbox18, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hbox18); gtk_table_attach(GTK_TABLE(table9), hbox18, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); new_perms_ignore = gtk_radio_button_new_with_label(perms_group, "Ignore all"); perms_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_perms_ignore)); gtk_widget_ref(new_perms_ignore); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_perms_ignore", new_perms_ignore, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_perms_ignore); gtk_box_pack_start(GTK_BOX(hbox18), new_perms_ignore, FALSE, FALSE, 0); new_perms_exec = gtk_radio_button_new_with_label(perms_group, "Maintain for Executables only"); perms_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_perms_exec)); gtk_widget_ref(new_perms_exec); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_perms_exec", new_perms_exec, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_perms_exec); gtk_box_pack_start(GTK_BOX(hbox18), new_perms_exec, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(new_perms_ignore), TRUE); new_perms_all = gtk_radio_button_new_with_label(perms_group, "Maintain all"); perms_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_perms_all)); gtk_widget_ref(new_perms_all); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_perms_all", new_perms_all, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_perms_all); gtk_box_pack_start(GTK_BOX(hbox18), new_perms_all, FALSE, FALSE, 0); label72 = gtk_label_new("Symbolic links: "); gtk_widget_ref(label72); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label72", label72, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label72); gtk_table_attach(GTK_TABLE(table9), label72, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label72), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label72), 0, 0.5); hbox17 = gtk_hbox_new(FALSE, 0); gtk_widget_ref(hbox17); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hbox17", hbox17, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hbox17); gtk_table_attach(GTK_TABLE(table9), hbox17, 1, 2, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); new_sym_follow = gtk_radio_button_new_with_label(sym_link_group, "Follow all"); sym_link_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_sym_follow)); gtk_widget_ref(new_sym_follow); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_sym_follow", new_sym_follow, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_sym_follow); gtk_box_pack_start(GTK_BOX(hbox17), new_sym_follow, FALSE, FALSE, 0); new_sym_ignore = gtk_radio_button_new_with_label(sym_link_group, "Ignore links"); sym_link_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_sym_ignore)); gtk_widget_ref(new_sym_ignore); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_sym_ignore", new_sym_ignore, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_sym_ignore); gtk_box_pack_start(GTK_BOX(hbox17), new_sym_ignore, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(new_sym_ignore), TRUE); new_sym_maintain = gtk_radio_button_new_with_label(sym_link_group, "Maintain links"); sym_link_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_sym_maintain)); gtk_widget_ref(new_sym_maintain); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_sym_maintain", new_sym_maintain, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_sym_maintain); gtk_box_pack_start(GTK_BOX(hbox17), new_sym_maintain, FALSE, FALSE, 0); label73 = gtk_label_new("Detect changes by: "); gtk_widget_ref(label73); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label73", label73, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label73); gtk_table_attach(GTK_TABLE(table9), label73, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_label_set_justify(GTK_LABEL(label73), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label73), 0, 0.5); hbox19 = gtk_hbox_new(FALSE, 0); gtk_widget_ref(hbox19); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hbox19", hbox19, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hbox19); gtk_table_attach(GTK_TABLE(table9), hbox19, 1, 2, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); new_timesize = gtk_radio_button_new_with_label(state_detector_group, "Filesize & modification time"); state_detector_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_timesize)); gtk_widget_ref(new_timesize); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_timesize", new_timesize, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_timesize); gtk_box_pack_start(GTK_BOX(hbox19), new_timesize, FALSE, FALSE, 0); new_checksum = gtk_radio_button_new_with_label(state_detector_group, "Checksum"); state_detector_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_checksum)); gtk_widget_ref(new_checksum); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_checksum", new_checksum, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_checksum); gtk_box_pack_start(GTK_BOX(hbox19), new_checksum, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(new_checksum), TRUE); update_options = gnome_druid_page_standard_new_with_vals("", NULL); gtk_widget_ref(update_options); gtk_object_set_data_full(GTK_OBJECT(site_druid), "update_options", update_options, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show_all(update_options); gnome_druid_append_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(update_options)); gnome_druid_page_standard_set_logo_bg_color(GNOME_DRUID_PAGE_STANDARD(update_options), &update_options_logo_bg_color); gnome_druid_page_standard_set_title(GNOME_DRUID_PAGE_STANDARD(update_options), "Update Attributes"); gnome_druid_page_standard_set_logo(GNOME_DRUID_PAGE_STANDARD(update_options), create_image("gnome-networktool.png")); druid_vbox4 = GNOME_DRUID_PAGE_STANDARD(update_options)->vbox; gtk_widget_ref(druid_vbox4); gtk_object_set_data_full(GTK_OBJECT(site_druid), "druid_vbox4", druid_vbox4, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(druid_vbox4); vbox31 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox31); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox31", vbox31, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox31); gtk_box_pack_start(GTK_BOX(druid_vbox4), vbox31, TRUE, TRUE, 0); label70 = gtk_label_new("When mirroring your local changes onto the remote site, there are various options available to Xsitecopy. You can control most of them with the check boxes below."); gtk_widget_ref(label70); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label70", label70, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label70); gtk_box_pack_start(GTK_BOX(vbox31), label70, TRUE, TRUE, 0); gtk_widget_set_usize(label70, 370, -2); gtk_label_set_justify(GTK_LABEL(label70), GTK_JUSTIFY_FILL); gtk_label_set_line_wrap(GTK_LABEL(label70), TRUE); hseparator7 = gtk_hseparator_new(); gtk_widget_ref(hseparator7); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hseparator7", hseparator7, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hseparator7); gtk_box_pack_start(GTK_BOX(vbox31), hseparator7, TRUE, TRUE, 0); vbox32 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox32); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox32", vbox32, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox32); gtk_box_pack_start(GTK_BOX(vbox31), vbox32, TRUE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(vbox32), 5); new_nodelete = gtk_check_button_new_with_label("Delete a file from the server if it is deleted locally"); gtk_widget_ref(new_nodelete); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_nodelete", new_nodelete, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_nodelete); gtk_box_pack_start(GTK_BOX(vbox32), new_nodelete, FALSE, FALSE, 0); new_checkmoved = gtk_check_button_new_with_label("Move a remote file if it is moved locally"); gtk_widget_ref(new_checkmoved); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_checkmoved", new_checkmoved, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_checkmoved); gtk_box_pack_start(GTK_BOX(vbox32), new_checkmoved, FALSE, FALSE, 0); new_nooverwrite = gtk_check_button_new_with_label("When uploading changed files, first delete them"); gtk_widget_ref(new_nooverwrite); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_nooverwrite", new_nooverwrite, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_nooverwrite); gtk_box_pack_start(GTK_BOX(vbox32), new_nooverwrite, FALSE, FALSE, 0); new_lowercase = gtk_check_button_new_with_label("Convert all filenames to lowercase when uploading"); gtk_widget_ref(new_lowercase); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_lowercase", new_lowercase, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_lowercase); gtk_box_pack_start(GTK_BOX(vbox32), new_lowercase, FALSE, FALSE, 0); new_safe = gtk_check_button_new_with_label("Use \"safe mode\""); gtk_widget_ref(new_safe); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_safe", new_safe, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_safe); gtk_box_pack_start(GTK_BOX(vbox32), new_safe, FALSE, FALSE, 0); new_pasv = gtk_check_button_new_with_label("Use passive mode FTP"); gtk_widget_ref(new_pasv); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_pasv", new_pasv, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_pasv); gtk_box_pack_start(GTK_BOX(vbox32), new_pasv, FALSE, FALSE, 0); server_state = gnome_druid_page_standard_new_with_vals("", NULL); gtk_widget_ref(server_state); gtk_object_set_data_full(GTK_OBJECT(site_druid), "server_state", server_state, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show_all(server_state); gnome_druid_append_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(server_state)); gnome_druid_page_standard_set_logo_bg_color(GNOME_DRUID_PAGE_STANDARD(server_state), &server_state_logo_bg_color); gnome_druid_page_standard_set_title(GNOME_DRUID_PAGE_STANDARD(server_state), "Current State of The Remote Site"); gnome_druid_page_standard_set_logo(GNOME_DRUID_PAGE_STANDARD(server_state), create_image("gnome-networktool.png")); druid_vbox5 = GNOME_DRUID_PAGE_STANDARD(server_state)->vbox; gtk_widget_ref(druid_vbox5); gtk_object_set_data_full(GTK_OBJECT(site_druid), "druid_vbox5", druid_vbox5, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(druid_vbox5); vbox33 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox33); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox33", vbox33, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox33); gtk_box_pack_start(GTK_BOX(druid_vbox5), vbox33, TRUE, TRUE, 0); label74 = gtk_label_new("Xsitecopy now needs to know the current state of the remote site. If the site is empty or up to date, that is great. If not, it can attempt to connect to the remote server and figure out what is there."); gtk_widget_ref(label74); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label74", label74, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label74); gtk_box_pack_start(GTK_BOX(vbox33), label74, TRUE, TRUE, 0); gtk_widget_set_usize(label74, 370, -2); gtk_label_set_justify(GTK_LABEL(label74), GTK_JUSTIFY_FILL); gtk_label_set_line_wrap(GTK_LABEL(label74), TRUE); hseparator8 = gtk_hseparator_new(); gtk_widget_ref(hseparator8); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hseparator8", hseparator8, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hseparator8); gtk_box_pack_start(GTK_BOX(vbox33), hseparator8, TRUE, TRUE, 0); vbox34 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox34); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox34", vbox34, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox34); gtk_box_pack_start(GTK_BOX(vbox33), vbox34, TRUE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(vbox34), 4); new_init = gtk_radio_button_new_with_label(vbox34_group, "The remote site is empty."); vbox34_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_init)); gtk_widget_ref(new_init); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_init", new_init, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_init); gtk_box_pack_start(GTK_BOX(vbox34), new_init, FALSE, FALSE, 0); new_catchup = gtk_radio_button_new_with_label(vbox34_group, "The remote site has been uploaded."); vbox34_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_catchup)); gtk_widget_ref(new_catchup); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_catchup", new_catchup, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_catchup); gtk_box_pack_start(GTK_BOX(vbox34), new_catchup, FALSE, FALSE, 0); new_fetch_please = gtk_radio_button_new_with_label(vbox34_group, "Connect to the remote site and figure out the state automatically."); vbox34_group = gtk_radio_button_group(GTK_RADIO_BUTTON(new_fetch_please)); gtk_widget_ref(new_fetch_please); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_fetch_please", new_fetch_please, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_fetch_please); /** Added **/ gtk_widget_set_sensitive(new_fetch_please, FALSE); /** End **/ gtk_box_pack_start(GTK_BOX(vbox34), new_fetch_please, FALSE, FALSE, 0); fetch_a_list = gnome_druid_page_standard_new_with_vals("", NULL); gtk_widget_ref(fetch_a_list); gtk_object_set_data_full(GTK_OBJECT(site_druid), "fetch_a_list", fetch_a_list, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show_all(fetch_a_list); gnome_druid_append_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(fetch_a_list)); gnome_druid_page_standard_set_logo_bg_color(GNOME_DRUID_PAGE_STANDARD(fetch_a_list), &fetch_a_list_logo_bg_color); gnome_druid_page_standard_set_title(GNOME_DRUID_PAGE_STANDARD(fetch_a_list), "Ready to download file information"); gnome_druid_page_standard_set_logo(GNOME_DRUID_PAGE_STANDARD(fetch_a_list), create_image("gnome-networktool.png")); druid_vbox10 = GNOME_DRUID_PAGE_STANDARD(fetch_a_list)->vbox; gtk_widget_ref(druid_vbox10); gtk_object_set_data_full(GTK_OBJECT(site_druid), "druid_vbox10", druid_vbox10, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(druid_vbox10); vbox36 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox36); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox36", vbox36, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox36); gtk_box_pack_start(GTK_BOX(druid_vbox10), vbox36, TRUE, TRUE, 0); label91 = gtk_label_new("When you click on the button below to begin, Xsitecopy will try and establish a connection to the remote server you specified earlier.\n\nIf a connection is made, a file listing will then be obtained. If this fails then you will be asked to initialise or catchup the site for now, and you can attempt another 'fetch' at a later date."); gtk_widget_ref(label91); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label91", label91, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label91); gtk_box_pack_start(GTK_BOX(vbox36), label91, TRUE, TRUE, 0); gtk_widget_set_usize(label91, 370, -2); gtk_label_set_justify(GTK_LABEL(label91), GTK_JUSTIFY_FILL); gtk_label_set_line_wrap(GTK_LABEL(label91), TRUE); hseparator10 = gtk_hseparator_new(); gtk_widget_ref(hseparator10); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hseparator10", hseparator10, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hseparator10); gtk_box_pack_start(GTK_BOX(vbox36), hseparator10, TRUE, FALSE, 0); vbox36 = gtk_vbox_new(FALSE, 0); gtk_widget_ref(vbox36); gtk_object_set_data_full(GTK_OBJECT(site_druid), "vbox36", vbox36, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(vbox36); gtk_box_pack_start(GTK_BOX(vbox36), vbox36, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(vbox36), 5); hbox23 = gtk_hbox_new(FALSE, 0); gtk_widget_ref(hbox23); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hbox23", hbox23, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hbox23); gtk_box_pack_start(GTK_BOX(vbox36), hbox23, FALSE, TRUE, 0); label88 = gtk_label_new("Status: "); gtk_widget_ref(label88); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label88", label88, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label88); gtk_box_pack_start(GTK_BOX(hbox23), label88, FALSE, FALSE, 0); gtk_label_set_justify(GTK_LABEL(label88), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label88), 0, 0.5); new_fetch_status = gtk_label_new("Awaiting user input. "); gtk_widget_ref(new_fetch_status); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_fetch_status", new_fetch_status, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_fetch_status); gtk_box_pack_start(GTK_BOX(hbox23), new_fetch_status, FALSE, FALSE, 0); hbox24 = gtk_hbox_new(FALSE, 0); gtk_widget_ref(hbox24); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hbox24", hbox24, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hbox24); gtk_box_pack_start(GTK_BOX(vbox36), hbox24, TRUE, FALSE, 0); label90 = gtk_label_new("Found information about "); gtk_widget_ref(label90); gtk_object_set_data_full(GTK_OBJECT(site_druid), "label90", label90, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(label90); gtk_box_pack_start(GTK_BOX(hbox24), label90, FALSE, FALSE, 0); fetch_num_files_got = gtk_label_new("0 files."); gtk_widget_ref(fetch_num_files_got); gtk_object_set_data_full(GTK_OBJECT(site_druid), "fetch_num_files_got", fetch_num_files_got, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(fetch_num_files_got); gtk_box_pack_start(GTK_BOX(hbox24), fetch_num_files_got, FALSE, FALSE, 0); new_fetch_begin = gtk_button_new_with_label("Fetch file state"); gtk_widget_ref(new_fetch_begin); gtk_object_set_data_full(GTK_OBJECT(site_druid), "new_fetch_begin", new_fetch_begin, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(new_fetch_begin); gtk_box_pack_start(GTK_BOX(vbox36), new_fetch_begin, FALSE, FALSE, 0); GTK_WIDGET_SET_FLAGS(new_fetch_begin, GTK_CAN_DEFAULT); hbuttonbox2 = gtk_hbutton_box_new(); gtk_widget_ref(hbuttonbox2); gtk_object_set_data_full(GTK_OBJECT(site_druid), "hbuttonbox2", hbuttonbox2, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(hbuttonbox2); gtk_box_pack_start(GTK_BOX(vbox36), hbuttonbox2, FALSE, FALSE, 0); finish_page = gnome_druid_page_finish_new(); gtk_widget_ref(finish_page); gtk_object_set_data_full(GTK_OBJECT(site_druid), "finish_page", finish_page, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show(finish_page); gnome_druid_append_page(GNOME_DRUID(new_site_druid), GNOME_DRUID_PAGE(finish_page)); gnome_druid_page_finish_set_logo_bg_color(GNOME_DRUID_PAGE_FINISH(finish_page), &finish_page_logo_bg_color); gnome_druid_page_finish_set_title(GNOME_DRUID_PAGE_FINISH(finish_page), "Creation successful!"); gnome_druid_page_finish_set_text(GNOME_DRUID_PAGE_FINISH(finish_page), "Enough information has now been gathered,\nand a suitable site definition has been created.\nClick finish to close."); gnome_druid_page_finish_set_logo(GNOME_DRUID_PAGE_FINISH(finish_page), create_image("gnome-networktool.png")); /* gnome_druid_page_finish_set_watermark(GNOME_DRUID_PAGE_FINISH(finish_page), create_image("xsitecopy/xsc_side.xpm")); */ gtk_signal_connect(GTK_OBJECT(site_druid), "delete_event", GTK_SIGNAL_FUNC(on_site_druid_delete_event), NULL); gtk_signal_connect(GTK_OBJECT(start_page), "cancel", GTK_SIGNAL_FUNC(on_general_info_cancel), NULL); gtk_signal_connect(GTK_OBJECT(general_info), "next", GTK_SIGNAL_FUNC(verify_name_and_url), NULL); gtk_signal_connect(GTK_OBJECT(general_info), "cancel", GTK_SIGNAL_FUNC(on_general_info_cancel), NULL); gtk_signal_connect(GTK_OBJECT(server_info), "next", GTK_SIGNAL_FUNC(verify_server_details), NULL); gtk_signal_connect(GTK_OBJECT(server_info), "cancel", GTK_SIGNAL_FUNC(on_server_info_cancel), NULL); gtk_signal_connect(GTK_OBJECT(new_ftp), "toggled", GTK_SIGNAL_FUNC(set_new_port), "ftp"); gtk_signal_connect(GTK_OBJECT(new_http), "toggled", GTK_SIGNAL_FUNC(set_new_port), "http"); gtk_signal_connect(GTK_OBJECT(directories), "next", GTK_SIGNAL_FUNC(verify_directories), NULL); gtk_signal_connect(GTK_OBJECT(directories), "cancel", GTK_SIGNAL_FUNC(on_directories_cancel), NULL); gtk_signal_connect(GTK_OBJECT(file_handling), "next", GTK_SIGNAL_FUNC(verify_file_attributes), NULL); gtk_signal_connect(GTK_OBJECT(file_handling), "cancel", GTK_SIGNAL_FUNC(on_file_handling_cancel), NULL); gtk_signal_connect(GTK_OBJECT(update_options), "next", GTK_SIGNAL_FUNC(verify_update_options), NULL); gtk_signal_connect(GTK_OBJECT(update_options), "cancel", GTK_SIGNAL_FUNC(on_update_options_cancel), NULL); gtk_signal_connect_after(GTK_OBJECT(server_state), "next", GTK_SIGNAL_FUNC(should_we_fetch), NULL); gtk_signal_connect(GTK_OBJECT(server_state), "next", GTK_SIGNAL_FUNC(set_back_insensitive), NULL); /* gtk_signal_connect(GTK_OBJECT(server_state), "next", GTK_SIGNAL_FUNC(make_site_from_druid), NULL);*/ gtk_signal_connect(GTK_OBJECT(server_state), "cancel", GTK_SIGNAL_FUNC(on_server_state_cancel), NULL); gtk_signal_connect(GTK_OBJECT(fetch_a_list), "next", GTK_SIGNAL_FUNC(check_fetch_worked), NULL); gtk_signal_connect(GTK_OBJECT(fetch_a_list), "cancel", GTK_SIGNAL_FUNC(on_fetch_a_list_cancel), NULL); gtk_signal_connect(GTK_OBJECT(new_fetch_begin), "clicked", GTK_SIGNAL_FUNC(begin_first_time_fetch), NULL); gtk_signal_connect(GTK_OBJECT(finish_page), "finish", GTK_SIGNAL_FUNC(druid_finished), NULL); gtk_signal_connect(GTK_OBJECT(finish_page), "back", GTK_SIGNAL_FUNC(druid_back), NULL); gtk_signal_connect(GTK_OBJECT(finish_page), "cancel", GTK_SIGNAL_FUNC(on_finish_page_cancel), NULL); /**** End glade generated code ****/ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(new_ftp), TRUE); return site_druid; } void start_new_site_wizard(void) { /* Bring the druid to the front if it already exists */ NE_DEBUG(DEBUG_GNOME, "started New site druid.\n"); if (site_druid) { gdk_window_raise(site_druid->window); gdk_window_show(site_druid->window); return; } /* Make the bare bones of a site so we can add things to it as the user * moves along the druid. */ site_druid = create_site_druid(); site_to_add = default_site(); gtk_widget_show(site_druid); } /*** Callbacks ***/ gboolean on_site_druid_delete_event(GtkWidget * widget, GdkEvent * event, gpointer user_data) { NE_DEBUG(DEBUG_GNOME, "Caught delete event for new site druid.\n"); close_druid(); return FALSE; } gboolean verify_name_and_url(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { gchar *name_str; NE_DEBUG(DEBUG_GNOME, "Verifying name and URL...\n"); name_str = grab_druid_entry_into_string("new_name"); if (!name_str) { gnome_error_dialog("You must enter a sensible name for this site"); return TRUE; } site_to_add->name = name_str; NE_DEBUG(DEBUG_GNOME, "Name is %s.\n", name_str); site_to_add->url = grab_druid_entry_into_string("new_url"); NE_DEBUG(DEBUG_GNOME, "URL is %s.\n", site_to_add->url); site_to_add->infofile = g_strconcat(copypath, name_str, NULL); return FALSE; } gchar *grab_druid_entry_into_string(gchar *widget_name) { GtkWidget *entry; gchar *tmp_string; g_assert(widget_name != NULL); entry = get_widget(site_druid, widget_name); tmp_string = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry))); /* If the string didn't get allocated, or something went screwy don't * return it. Otherwise do. This is horribly double-negated, but hey. */ if (! ((!tmp_string) || (strlen(tmp_string) < 1))) { return tmp_string; } return NULL; } gboolean verify_server_details(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { /* Hostname */ { gchar *host_str = grab_druid_entry_into_string("new_hostname"); if (host_str != NULL) site_to_add->server.hostname = host_str; } /* Username */ { gchar *user_str = grab_druid_entry_into_string("new_username"); if (user_str != NULL) site_to_add->server.username = user_str; } /* Password */ { gchar *pass_str = grab_druid_entry_into_string("new_password"); if (pass_str != NULL) site_to_add->server.password = pass_str; } /* Port */ { GtkWidget *port = get_widget(site_druid, "new_port"); gint port_int = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(port)); if (port_int) site_to_add->server.port = port_int; } /* Figure out the protocol to use. */ { GtkWidget *protocol = get_widget(site_druid, "new_ftp"); if (GTK_TOGGLE_BUTTON(protocol)->active) { /* FTP was selected */ site_to_add->protocol = siteproto_ftp; } #ifdef USE_DAV else { /* WebDAV was selected */ site_to_add->protocol = siteproto_dav; } #endif /* USE_DAV */ } return FALSE; } /* Sets an appropriate default port when a new protocol is selected. */ void set_new_port(GtkToggleButton * togglebutton, gpointer user_data) { gchar *protocol = (gchar *) user_data; NE_DEBUG (DEBUG_GNOME, "Setting an appropriate port number based on the new protocol.\n"); if (strcmp(protocol, "http") == 0) { NE_DEBUG (DEBUG_GNOME, "Setting a port for HTTP.\n"); gtk_spin_button_set_value(GTK_SPIN_BUTTON(get_widget(site_druid, "new_port")), (float) 80); } else { NE_DEBUG (DEBUG_GNOME, "Setting a port for FTP.\n"); gtk_spin_button_set_value(GTK_SPIN_BUTTON(get_widget(site_druid, "new_port")), (float) 21); } } gboolean verify_directories(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { /* (todo: If there are many places where we have almost identical code for local,remote cases, then consider changing local_isrel to isrel[LOCAL] etc.) */ /* Verify & process local directory. */ { gchar *local_str = grab_druid_entry_into_string("new_local_entry"); if (local_str) { NE_DEBUG(DEBUG_GNOME, "Local dir is %s.\n", local_str); site_to_add->local_root_user = local_str; if (*local_str == '~') site_to_add->local_isrel = TRUE; } else { gnome_error_dialog("You must enter a valid local directory for this site"); return TRUE; } } /* Verify & process remote directory. */ { gchar *remote_str = grab_druid_entry_into_string("new_remote_entry"); if (remote_str) { NE_DEBUG(DEBUG_GNOME, "Remote dir is %s.\n", remote_str); site_to_add->remote_root_user = remote_str; if (*remote_str == '~') site_to_add->remote_isrel = TRUE; } else { gnome_error_dialog("You must enter a valid remote directory for this site"); return TRUE; } } return FALSE; } /* Permissions, sym links, state-change method */ gboolean verify_file_attributes(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { GtkWidget *perms1, *perms2, *perms3; GtkWidget *links1, *links2, *links3; /* Permissions */ perms1 = get_widget(site_druid, "new_perms_all"); perms2 = get_widget(site_druid, "new_perms_exec"); perms3 = get_widget(site_druid, "new_perms_ignore"); if (GTK_TOGGLE_BUTTON(perms1)->active) { site_to_add->perms = sitep_all; } else if (GTK_TOGGLE_BUTTON(perms2)->active) { site_to_add->perms = sitep_exec; } else { site_to_add->perms = sitep_ignore; } /* Symbolic links */ links1 = get_widget(site_druid, "new_sym_follow"); links2 = get_widget(site_druid, "new_sym_ignore"); links3 = get_widget(site_druid, "new_sym_maintain"); if (GTK_TOGGLE_BUTTON(links1)->active) { site_to_add->symlinks = sitesym_follow; } else if (GTK_TOGGLE_BUTTON(links2)->active) { site_to_add->symlinks = sitesym_ignore; } else { site_to_add->symlinks = sitesym_maintain; } /* File State method */ if (GTK_TOGGLE_BUTTON(get_widget(site_druid, "new_timesize"))->active) { site_to_add->state_method = state_timesize; } else { site_to_add->state_method = state_checksum; } return FALSE; } gboolean verify_update_options(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { GtkWidget *del, *move, *change, *lcase, *safe, *pasv; del = get_widget(site_druid, "new_nodelete"); move = get_widget(site_druid, "new_checkmoved"); change = get_widget(site_druid, "new_nooverwrite"); lcase = get_widget(site_druid, "new_lowercase"); safe = get_widget(site_druid, "new_safe"); pasv = get_widget(site_druid, "new_pasv"); site_to_add->nodelete = !(GTK_TOGGLE_BUTTON(del)->active); site_to_add->checkmoved = GTK_TOGGLE_BUTTON(move)->active; site_to_add->nooverwrite = GTK_TOGGLE_BUTTON(change)->active; site_to_add->lowercase = GTK_TOGGLE_BUTTON(lcase)->active; site_to_add->safemode = GTK_TOGGLE_BUTTON(safe)->active; /* Enforce a bit of sanity */ if (site_to_add->safemode) site_to_add->nooverwrite = FALSE; /* If using webdav, let's leave pasv_mode as false */ if (site_to_add->protocol == siteproto_ftp) site_to_add->ftp_pasv_mode = GTK_TOGGLE_BUTTON(pasv)->active; return FALSE; } gboolean should_we_fetch(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { GtkWidget *connect_radio = get_widget(site_druid, "new_fetch_please"); if (!GTK_TOGGLE_BUTTON(connect_radio)->active) { gnome_druid_set_page(GNOME_DRUID(get_widget(site_druid, "new_site_druid")), GNOME_DRUID_PAGE(get_widget(site_druid, "finish_page"))); return TRUE; } return FALSE; } gboolean set_back_insensitive(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { gnome_druid_set_buttons_sensitive(GNOME_DRUID(get_widget(site_druid, "new_site_druid")), FALSE, TRUE, TRUE); return FALSE; } /* This isn't implemented until the 'fetch' API is nicer... */ gboolean check_fetch_worked(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { return FALSE; } void begin_first_time_fetch(GtkButton * button, gpointer user_data) { } gboolean druid_back(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { gnome_druid_set_page(GNOME_DRUID(get_widget(site_druid, "new_site_druid")), GNOME_DRUID_PAGE(get_widget(site_druid, "server_state"))); } /* The user has choosen Finish on the last page of the wizard */ void druid_finished(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { add_site(user_data); close_druid(); } /* This next stuff is pretty lame really, but it was Glade-generated, hence * took very little work, so I'm not complaining. */ gboolean on_general_info_cancel(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { close_druid(); return TRUE; } gboolean on_server_info_cancel(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { close_druid(); return TRUE; } gboolean on_directories_cancel(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { close_druid(); return TRUE; } gboolean on_file_handling_cancel(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { close_druid(); return TRUE; } gboolean on_update_options_cancel(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { close_druid(); return TRUE; } gboolean on_server_state_cancel(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { close_druid(); return TRUE; } gboolean on_fetch_a_list_cancel(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { close_druid(); return TRUE; } gboolean on_finish_page_cancel(GnomeDruidPage * gnomedruidpage, gpointer arg1, gpointer user_data) { close_druid(); return TRUE; } sitecopy-0.16.6/gnome/misc.h0000664000076400007640000000644010232743237014011 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 1999, Lee Mallabone * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef MISC_H #define MISC_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "sites.h" #include "common.h" #include "rcfile.h" #include "protocol.h" #include "dirname.h" #include "new_site.h" #include "gcommon.h" #include "tree.h" #include "changes.h" #include "site_widgets.h" #include "file_widgets.h" #include "operations.h" #define IS_A_FILE 1 #define IS_A_SITE 2 #define SAVEAS 1 #define OPENNEW 2 #define get_widget(obj, string) gtk_object_get_data(GTK_OBJECT(obj), string) /* Possible things that can be displayed next to a site's name in the tree */ typedef enum { local_dir, remote_dir, remote_host, url, none } site_tree_info; struct xsitecopy_prefs { /* "visuals" */ site_tree_info label; gboolean should_sort; long site_needs_update_col; long site_updated_col; GdkColor *needs_update; GdkColor *in_sync; /* "transfer" */ gboolean backup_state_before_fetch; gboolean always_keep_going; gboolean log_errors; gchar *error_log_filename; /* general */ gboolean quit_confirmation; gboolean save_confirmation; }; struct ctree_attachment { int file_or_site; int sorted_yet; void *info_struct; }; void backup_infofile(void); void backup_rcfile(void); void restore_rcfile(void); void restore_rc(gint button_number); int copy_a_file(gchar * input_name, gchar * output_name); void restore_infofile(void); void actual_restoration(gint button_number); /* Exit functions */ GtkWidget *create_quit_save_question(const char *question, int mode); void quit_please(void); /* Load & Save rcfile functions */ void open_new_request(void); void open_newrc(GtkWidget * ok, GtkFileSelection * fileb); void saveas_request(void); void save_sites_as(GtkWidget * ok, GtkFileSelection * fileb); void filename_request(gint mode_num); GtkWidget *create_default_main_area(void); GtkWidget *create_initial_main_area(void); void redraw_main_area(void); void clear_main_area(void); void site_report(void); void site_web_report(void); void rescan_selected(int shouldRedraw); int check_site_and_record_errors(struct site *current); GtkWidget *ctree_create_sites(void); void make_error_window(void); GtkWidget *create_site_errors_dialog(void); GtkWidget *make_transfer_anim(gint direction); #endif /* MISC_H */ sitecopy-0.16.6/gnome/minilist.h0000664000076400007640000000335510232743237014710 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ #include #ifndef MINILIST_H #define MINILIST_H #include "common.h" #include "misc.h" #include "gcommon.h" #include "sites.h" enum minilists { list_exclude, list_ascii, list_ignore }; struct slist_gui { enum minilists type; /* Will point to one of: selected_site->ignores, excludes, ascii */ struct fnlist *data; GtkWidget *list; GtkWidget *entry; int chosen_row; }; void populate_minilist(struct slist_gui *the_gui); void select_minilist_item(GtkWidget * list, gint row, gint column, GdkEventButton * event, gpointer data); void change_minilist_entry(GtkWidget * entry, gpointer data); void add_minilist_item(GtkWidget * button, gpointer data); void remove_minilist_item(GtkWidget * button, gpointer data); #endif /* MINILIST_H */ sitecopy-0.16.6/gnome/changes.h0000664000076400007640000000460510232743237014467 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ #include #include "common.h" #include "sites.h" #include "gcommon.h" #include "misc.h" #include #include "config.h" #include void change_detection_mode(GtkWidget *button, gpointer data); void change_detect_mode(GtkWidget * togglebutton, gpointer data); void change_port(GtkWidget * spinbutton, gpointer data); void change_lowercase(GtkWidget * checkbutton, gpointer data); void change_safemode(GtkWidget * checkbutton, gpointer data); void change_detectmode(GtkWidget * checkbutton, gpointer data); void change_host_name(GtkWidget * entry, gpointer data); void change_protocol(GtkWidget * menu_item, gpointer proto); void change_username(GtkWidget * entry, gpointer data); void change_password(GtkWidget * entry, gpointer data); void change_passive_ftp(GtkWidget * toggle, gpointer data); void change_nooverwrite(GtkWidget * toggle, gpointer data); void change_delete(GtkWidget * toggle, gpointer data); void change_move_status(GtkWidget * toggle, gpointer data); void change_http_expect(GtkWidget * toggle, gpointer data); void change_http_limit(GtkWidget * toggle, gpointer data); void change_perms(GtkWidget * menu_item, gpointer perm_data); void change_sym_mode(GtkWidget * menu_item, gpointer sym_data); void set_local_dir(GtkWidget * entry, gpointer data); void change_local_dir(GtkWidget * entry, gpointer data); void change_remote_dir(GtkWidget * entry); void change_url(GtkWidget * entry, gpointer data); sitecopy-0.16.6/gnome/main.c0000664000076400007640000002077510232743237014004 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. */ #include "config.h" #include #include #include #include #include "sites.h" #include "rcfile.h" #include "common.h" #include "gcommon.h" #include "init.h" #include "misc.h" /* For thread creation. */ #include "operations.h" #include "resynch.h" int generate_pixmaps(void); /* The main gnome_app struct */ GtkWidget *sitecopy; sem_t *update_semaphore = NULL, *fetch_semaphore = NULL; sem_t *update_all_semaphore = NULL, *sync_semaphore = NULL; pthread_t update_tid = 0, fetch_tid = 0, update_all_tid = 0, sync_tid = 0; extern struct site *all_sites; gboolean prompting = false; /* Pixmaps that are used throughout. */ /* dir is closed, dir2 is open */ GdkPixmap *dir, *dir_new, *dir_changed, *dir_del; GdkPixmap *dir2, *dir2_new, *dir2_changed, *dir2_del; GdkPixmap *xsitecopy_file, *xsitecopy_file_new, *xsitecopy_file_changed, *xsitecopy_file_del, *xsitecopy_file_moved; GdkPixmap *symbolic_link, *symbolic_link_new, *symbolic_link_changed, *symbolic_link_del; /* Bitmaps */ GdkBitmap *dir_map, *dir_new_map, *dir_changed_map, *dir_del_map; GdkBitmap *dir2_map, *dir2_new_map, *dir2_changed_map, *dir2_del_map; GdkBitmap *xsitecopy_file_map, *xsitecopy_file_new_map, *xsitecopy_file_changed_map, *xsitecopy_file_del_map, *xsitecopy_file_moved_map; GdkBitmap *symbolic_link_map, *symbolic_link_new_map, *symbolic_link_changed_map, *symbolic_link_del_map; /* Initialises all the pixmaps above */ int generate_pixmaps(void) { GtkStyle *style; #include "dir_changed.xpm" #include "dir_new.xpm" #include "dir_del.xpm" #include "dir.xpm" #include "dir2_changed.xpm" #include "dir2_new.xpm" #include "dir2_del.xpm" #include "dir2.xpm" #include "file_changed.xpm" #include "file_new.xpm" #include "file_del.xpm" #include "file_moved.xpm" #include "file.xpm" #include "link_changed.xpm" #include "link_new.xpm" #include "link_del.xpm" #include "link.xpm" style = gtk_widget_get_style(sitecopy); /* Closed directory */ dir = gdk_pixmap_create_from_xpm_d(sitecopy->window, &dir_map, &style->bg[GTK_STATE_NORMAL], (gchar **) dir_xpm); dir_new = gdk_pixmap_create_from_xpm_d(sitecopy->window, &dir_new_map, &style->bg[GTK_STATE_NORMAL], (gchar **) dir_new_xpm); dir_del = gdk_pixmap_create_from_xpm_d(sitecopy->window, &dir_del_map, &style->bg[GTK_STATE_NORMAL], (gchar **) dir_del_xpm); dir_changed = gdk_pixmap_create_from_xpm_d(sitecopy->window, &dir_changed_map, &style->bg[GTK_STATE_NORMAL], (gchar **) dir_changed_xpm); /* Open directory */ dir2 = gdk_pixmap_create_from_xpm_d(sitecopy->window, &dir2_map, &style->bg[GTK_STATE_NORMAL], (gchar **) dir2_xpm); dir2_new = gdk_pixmap_create_from_xpm_d(sitecopy->window, &dir2_new_map, &style->bg[GTK_STATE_NORMAL], (gchar **) dir2_new_xpm); dir2_del = gdk_pixmap_create_from_xpm_d(sitecopy->window, &dir2_del_map, &style->bg[GTK_STATE_NORMAL], (gchar **) dir2_del_xpm); dir2_changed = gdk_pixmap_create_from_xpm_d(sitecopy->window, &dir2_changed_map, &style->bg[GTK_STATE_NORMAL], (gchar **) dir2_changed_xpm); xsitecopy_file = gdk_pixmap_create_from_xpm_d(sitecopy->window, &xsitecopy_file_map, &style->bg[GTK_STATE_NORMAL], (gchar **) file_xpm); xsitecopy_file_new = gdk_pixmap_create_from_xpm_d(sitecopy->window, &xsitecopy_file_new_map, &style->bg[GTK_STATE_NORMAL], (gchar **) file_new_xpm); xsitecopy_file_del = gdk_pixmap_create_from_xpm_d(sitecopy->window, &xsitecopy_file_del_map, &style->bg[GTK_STATE_NORMAL], (gchar **) file_del_xpm); xsitecopy_file_changed = gdk_pixmap_create_from_xpm_d(sitecopy->window, &xsitecopy_file_changed_map, &style->bg[GTK_STATE_NORMAL], (gchar **) file_changed_xpm); xsitecopy_file_moved = gdk_pixmap_create_from_xpm_d(sitecopy->window, &xsitecopy_file_moved_map, &style->bg[GTK_STATE_NORMAL], (gchar **) file_moved_xpm); symbolic_link = gdk_pixmap_create_from_xpm_d(sitecopy->window, &symbolic_link_map, &style->bg[GTK_STATE_NORMAL], (gchar **) link_xpm); symbolic_link_new = gdk_pixmap_create_from_xpm_d(sitecopy->window, &symbolic_link_new_map, &style->bg[GTK_STATE_NORMAL], (gchar **) link_new_xpm); symbolic_link_del = gdk_pixmap_create_from_xpm_d(sitecopy->window, &symbolic_link_del_map, &style->bg[GTK_STATE_NORMAL], (gchar **) link_del_xpm); symbolic_link_changed = gdk_pixmap_create_from_xpm_d(sitecopy->window, &symbolic_link_changed_map, &style->bg[GTK_STATE_NORMAL], (gchar **) link_changed_xpm); return 1; } int main(int argc, char *argv[]) { static int debug_mask = 0; /* Command line options */ static const struct poptOption options[] = { #ifdef DEBUGGING /* joe: These need updating to the correct values, or better yet, * nick the --debug option code out of console_fe.c... or even * better than that, I'll move it into common.c so we can all use * it and live hapilly ever after. */ {"debug", 'd', POPT_ARG_INT, &debug_mask, 0, N_("Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, 32=XML, 64=GNOME )"), "LEVEL"}, #endif {NULL, '\0', 0, NULL, 0} }; /* Initialise threading */ g_thread_init(NULL); /* Do the gnome init stuff, and create command line options */ gnome_init_with_popt_table("Sitecopy", PACKAGE_VERSION, argc, argv, options, 0, NULL); /* Initilize debugging */ ne_debug_init(stderr, debug_mask); glade_gnome_init(); /* Configuration / Gnome initialisation */ xsitecopy_read_configuration(); sitecopy = gnome_app_new("xsc", "XSitecopy"); gtk_signal_connect(GTK_OBJECT(sitecopy), "delete_event", GTK_SIGNAL_FUNC(quit_please), NULL); gtk_widget_realize(sitecopy); generate_pixmaps(); /* Create semaphores to signal/wait for updates and fetches to be needed */ update_semaphore = malloc(sizeof(sem_t)); sem_init(update_semaphore, 0, 0); fetch_semaphore = malloc(sizeof(sem_t)); sem_init(fetch_semaphore, 0, 0); sync_semaphore = malloc(sizeof(sem_t)); sem_init(sync_semaphore, 0, 0); update_all_semaphore = malloc(sizeof(sem_t)); sem_init(update_all_semaphore, 0, 0); /* Create a thread to do updates on, and another to do an 'update all' */ if (pthread_create(&update_tid, NULL, update_thread, NULL) != 0) { g_error("Could not create a thread - no I/O is possible, exiting..."); exit(-1); } if (pthread_create(&update_all_tid, NULL, update_all_thread, NULL) != 0) { g_error("Could not create a thread - no I/O is possible, exiting..."); exit(-1); } /* Create a thread to do fetches on */ if (pthread_create(&fetch_tid, NULL, fetch_thread, NULL) != 0) { g_error("Could not create a fetch thread - no I/O is possible, exiting..."); exit(-1); } /* And make one for resync too! */ if (pthread_create(&sync_tid, NULL, sync_thread, NULL) != 0) { g_error("Could not create a sync thread - no I/O is possible, exiting..."); exit(-1); } /* Create the GUI and hit the main loop */ create_main_window(); gdk_threads_enter(); gtk_main(); gdk_threads_leave(); exit(0); return 0; } sitecopy-0.16.6/gnome/file_del.xpm0000664000076400007640000000412310165765223015176 0ustar joejoe/* XPM */ static char * file_del_xpm[] = { "16 15 96 2", " c None", ". c #616161", "+ c #414141", "@ c #BDF0BD", "# c #C5F2C5", "$ c #CDF4CD", "% c #D5F6D5", "& c #DEF7DE", "* c #E6F9E6", "= c #EEFBEE", "- c #F6FDF6", "; c #FFFFFF", "> c #000000", ", c #B0EEB0", "' c #B9EFB9", ") c #C1F1C1", "! c #E1846D", "~ c #F5312A", "{ c #FE0505", "] c #FA322F", "^ c #F78983", "/ c #FAFEFA", "( c #A4EBA4", "_ c #B7CD95", ": c #EF3024", "< c #FF0000", "[ c #FB3330", "} c #F7DBD5", "| c #98E898", "1 c #EB2F20", "2 c #EF2E22", "3 c #CEA47F", "4 c #C3E7B9", "5 c #CBE9C1", "6 c #DFA990", "7 c #F7302A", "8 c #F2FCF2", "9 c #BF7D4B", "0 c #EB2D1E", "a c #A7E19D", "b c #ACEDAC", "c c #B4EFB4", "d c #F63029", "e c #F1877D", "f c #E42E19", "g c #B19F62", "h c #A0EAA0", "i c #A8ECA8", "j c #D9A78A", "k c #F7322C", "l c #FB0502", "m c #87DB7D", "n c #8BE68B", "o c #94E794", "p c #BFE6B5", "q c #FD0504", "r c #7CD872", "s c #7FE37F", "t c #B3E4A9", "u c #DD2C12", "v c #989949", "w c #83E483", "x c #9CE99C", "y c #C0A271", "z c #9E752A", "A c #DF2B12", "B c #6EE06E", "C c #77E177", "D c #87E587", "E c #93DD89", "F c #E01313", "G c #A83434", "H c #202020", "I c #41D641", "J c #D92C0E", "K c #DE2A11", "L c #929843", "M c #6FD665", "N c #78D76E", "O c #A39B54", "P c #E62C19", "Q c #FF3434", "R c #C2C2C2", "S c #35D335", "T c #56B834", "U c #D92B0E", "V c #E51A1A", "W c #CAA8A8", "X c #A2A2A2", "Y c #29D029", "Z c #31D231", "` c #39D439", " . c #977423", ".. c #FA0501", "+. c #F22727", "@. c #828282", " . . . . . . . . . . . . . + ", " . @ # $ % & * = - ; ; ; ; > ", " . , ' ) ! ~ { { ] ^ / ; ; > ", " . ( _ : < < < < < < [ } ; > ", " . | 1 < 2 3 4 5 6 7 < ] 8 > ", " . 9 < 0 a b c @ < < d < e > ", " . f < g | h i < < ) j < k > ", " . l < m n o < < b c p < q > ", " . l < r s < < | h i t < q > ", " . u < v < < w n o x y < : > ", " . z < A < B C s D E F < G H ", " . I J < K L M N O P < Q R + ", " . S T U < < < < < < V W + X ", " . Y Z ` .J ..{ +.G R + @. ", " + > > > > > > > > H + X "}; sitecopy-0.16.6/gnome/link_new.xpm0000664000076400007640000000116110165765223015240 0ustar joejoe/* XPM */ static char * link_new_xpm[] = { "16 15 18 1", " c None", ". c #EB8298", "+ c #F7A6B5", "@ c #7E0011", "# c #AE0031", "$ c #D96480", "% c #FDD0DA", "& c #DB3262", "* c #4E0000", "= c #FCCBD5", "- c #F6A3B5", "; c #EC879C", "> c #E57690", ", c #A4002A", "' c #7A000B", ") c #860016", "! c #DF1855", "~ c #D9044A", " ", " ", " .+ ", " .@#. ", " .#@$% ", " +&*&+ ", "=------;- %$@&", ">,''''')! $#@.", " %&@#+ ", " +~*&% ", " &@$ ", " % ", " ", " ", " "}; sitecopy-0.16.6/gnome/site_widgets.c0000664000076400007640000010353110232743237015542 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ #include "site_widgets.h" extern struct site *all_sites; extern GtkWidget *site_list, *status_bar; extern GtkWidget *main_area_box, *area_data; extern GtkWidget *the_tree; extern struct site *selected_site; extern gboolean rcfile_saved; struct slist_gui *the_excludes, *the_ignores, *ascii_files; GtkWidget *main_panel; int last_notepage = 0; /* These widgets are global due to the freak deadlock bugs seen when using my * `get_widget' macro to retrieve per-instance pointers. */ GtkWidget *sym_follow; GtkWidget *sym_ignore; GtkWidget *sym_maintain; GtkWidget *port; GtkWidget *perms_ignore; GtkWidget *perms_exec; GtkWidget *perms_all; GtkWidget *ftp_mode; GtkWidget *nooverwrite; void record_notepage(GtkNotebook * note, GtkNotebookPage * page, gint pagenum, gpointer data) { /* last_notepage = pagenum;*/ NE_DEBUG(DEBUG_GNOME, "Recording notebook page number, %d.\n", pagenum); } GtkWidget * make_site_info_area(struct site *the_site) { int files_on_site; char *tmp; gboolean current_rcfile_saved; GtkWidget *container; GtkWidget *vbox21; GtkWidget *frame14; GtkWidget *table4; GtkWidget *label33; GtkWidget *label34; GtkWidget *label35; GtkWidget *username; GtkWidget *combo_entry3; GtkWidget *label36; GtkWidget *password; GtkWidget *hbox15; GtkWidget *servername; GtkWidget *combo_entry2; GtkWidget *label50; GtkObject *port_adj; GtkWidget *hbox8; GSList *protocol_group = NULL; GtkWidget *proto_ftp; GtkWidget *proto_dav; GtkWidget *stats_frame; GtkWidget *stats_label; GtkWidget *label26; GtkWidget *vbox22; GtkWidget *frame16; GtkWidget *table5; GtkWidget *label40; GtkWidget *url; GtkWidget *remote_dir; GtkWidget *combo_entry5; GtkWidget *label38; GtkWidget *label39; GtkWidget *local_dir; GtkWidget *combo_entry4; GtkWidget *frame17; GtkWidget *table6; GtkWidget *label41; GtkWidget *label42; GtkWidget *label43; GtkWidget *hbox10; GSList *sym_link_group = NULL; GtkWidget *hbox9; GSList *perms_group = NULL; GtkWidget *hbox11; GtkWidget *detection_mode; GtkWidget *detection_button; GtkWidget *label27; GtkWidget *frame18; GtkWidget *vbox23; GtkWidget *nodelete; GtkWidget *checkmoved; GtkWidget *lowercase; GtkWidget *use_safemode; GtkWidget *label28; GtkWidget *vbox24; GtkWidget *scrolledwindow2; GtkWidget *label44; GtkWidget *hbox12; GtkWidget *label45; GtkWidget *exclude_gentry; GtkWidget *excludes_new; GtkWidget *exclude_remove; GtkWidget *label30; GtkWidget *vbox25; GtkWidget *scrolledwindow3; GtkWidget *label46; GtkWidget *hbox13; GtkWidget *label47; GtkWidget *ascii_gentry; GtkWidget *ascii_new; GtkWidget *ascii_remove; GtkWidget *label31; GtkWidget *vbox26; GtkWidget *scrolledwindow4; GtkWidget *label48; GtkWidget *hbox14; GtkWidget *label49; GtkWidget *ignores_gentry; GtkWidget *ignores_label; GtkWidget *ignore_new; GtkWidget *ignore_remove; current_rcfile_saved = rcfile_saved; main_panel = gtk_hbox_new(FALSE, 0); container = gtk_notebook_new(); gtk_widget_show(container); gtk_container_add(GTK_CONTAINER(main_panel), container); vbox21 = gtk_vbox_new(FALSE, 4); gtk_widget_show(vbox21); gtk_container_add(GTK_CONTAINER(container), vbox21); gtk_container_set_border_width(GTK_CONTAINER(vbox21), 3); frame14 = gtk_frame_new("Server Details"); gtk_widget_show(frame14); gtk_box_pack_start(GTK_BOX(vbox21), frame14, TRUE, TRUE, 0); table4 = gtk_table_new(4, 2, FALSE); gtk_widget_show(table4); gtk_container_add(GTK_CONTAINER(frame14), table4); gtk_container_set_border_width(GTK_CONTAINER(table4), 5); gtk_table_set_row_spacings(GTK_TABLE(table4), 2); gtk_table_set_col_spacings(GTK_TABLE(table4), 2); label33 = gtk_label_new("Host Name: "); gtk_widget_show(label33); gtk_table_attach(GTK_TABLE(table4), label33, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label33), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label33), 0, 0.5); label34 = gtk_label_new("Protocol: "); gtk_widget_show(label34); gtk_table_attach(GTK_TABLE(table4), label34, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label34), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label34), 0, 0.5); label35 = gtk_label_new("Username: "); gtk_widget_show(label35); gtk_table_attach(GTK_TABLE(table4), label35, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label35), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label35), 0, 0.5); username = gnome_entry_new("user_history"); gtk_widget_show(username); gtk_table_attach(GTK_TABLE(table4), username, 1, 2, 2, 3, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); combo_entry3 = gnome_entry_gtk_entry(GNOME_ENTRY(username)); gtk_entry_set_text(GTK_ENTRY(combo_entry3), selected_site->server.username); gtk_widget_show(combo_entry3); label36 = gtk_label_new("Password: "); gtk_widget_show(label36); gtk_table_attach(GTK_TABLE(table4), label36, 0, 1, 3, 4, (GtkAttachOptions) (GTK_SHRINK | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label36), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label36), 0, 0.5); password = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(password), selected_site->server.password); gtk_entry_set_visibility(GTK_ENTRY(password), FALSE); gtk_widget_show(password); gtk_table_attach(GTK_TABLE(table4), password, 1, 2, 3, 4, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); hbox15 = gtk_hbox_new(FALSE, 3); gtk_widget_show(hbox15); gtk_table_attach(GTK_TABLE(table4), hbox15, 1, 2, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); servername = gnome_entry_new("host_history"); gtk_widget_show(servername); gtk_box_pack_start(GTK_BOX(hbox15), servername, TRUE, TRUE, 0); combo_entry2 = gnome_entry_gtk_entry(GNOME_ENTRY(servername)); gtk_entry_set_text(GTK_ENTRY(combo_entry2), selected_site->server.hostname); gtk_widget_show(combo_entry2); label50 = gtk_label_new("Port: "); gtk_widget_show(label50); gtk_box_pack_start(GTK_BOX(hbox15), label50, FALSE, FALSE, 0); port_adj = gtk_adjustment_new(65532, 1, 65536, 1, 10, 10); port = gtk_spin_button_new(GTK_ADJUSTMENT(port_adj), 1, 0); gtk_widget_show(port); gtk_box_pack_start(GTK_BOX(hbox15), port, TRUE, TRUE, 0); gtk_widget_set_usize(port, 12, -2); gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(port), TRUE); gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(port), TRUE); hbox8 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox8); gtk_table_attach(GTK_TABLE(table4), hbox8, 1, 2, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); proto_ftp = gtk_radio_button_new_with_label(protocol_group, "FTP"); gtk_signal_connect(GTK_OBJECT(proto_ftp), "toggled", GTK_SIGNAL_FUNC(change_protocol), "ftp"); protocol_group = gtk_radio_button_group(GTK_RADIO_BUTTON(proto_ftp)); gtk_widget_show(proto_ftp); gtk_box_pack_start(GTK_BOX(hbox8), proto_ftp, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(proto_ftp), TRUE); #ifdef USE_DAV proto_dav = gtk_radio_button_new_with_label(protocol_group, "WebDAV"); gtk_signal_connect(GTK_OBJECT(proto_dav), "toggled", GTK_SIGNAL_FUNC(change_protocol), "dav"); protocol_group = gtk_radio_button_group(GTK_RADIO_BUTTON(proto_dav)); gtk_widget_show(proto_dav); gtk_box_pack_start(GTK_BOX(hbox8), proto_dav, FALSE, FALSE, 0); #endif /* USE_DAV */ stats_frame = gtk_frame_new("Site Statistics"); gtk_widget_show(stats_frame); gtk_box_pack_start(GTK_BOX(vbox21), stats_frame, TRUE, TRUE, 0); stats_label = gtk_label_new("\n\n\n\n\n"); files_on_site = selected_site->numnew + selected_site->numchanged + selected_site->numdeleted + selected_site->nummoved + selected_site->numunchanged; if (!selected_site->remote_is_different) { tmp = g_strdup_printf("\nThe local site contains %d files, none of which\nhave changed since the last update.\n\n", files_on_site); } else { tmp = g_strdup_printf("The local site has changed since the last update:\n%d files have been added, %d files have changed,\n%d files have been deleted, %d files have been moved,\n%d remain unchanged. There are currently %d files on the local site.", selected_site->numnew, selected_site->numchanged, selected_site->numdeleted, selected_site->nummoved, selected_site->numunchanged, files_on_site); } gtk_label_set(GTK_LABEL(stats_label), tmp); gtk_widget_show(stats_label); gtk_container_add(GTK_CONTAINER(stats_frame), stats_label); label26 = gtk_label_new("Basic Details"); gtk_widget_show(label26); gtk_notebook_set_tab_label(GTK_NOTEBOOK(container), gtk_notebook_get_nth_page(GTK_NOTEBOOK(container), 0), label26); vbox22 = gtk_vbox_new(FALSE, 4); gtk_widget_show(vbox22); gtk_container_add(GTK_CONTAINER(container), vbox22); gtk_container_set_border_width(GTK_CONTAINER(vbox22), 3); frame16 = gtk_frame_new("Locations"); gtk_widget_show(frame16); gtk_box_pack_start(GTK_BOX(vbox22), frame16, TRUE, TRUE, 0); table5 = gtk_table_new(3, 2, FALSE); gtk_widget_show(table5); gtk_container_add(GTK_CONTAINER(frame16), table5); gtk_container_set_border_width(GTK_CONTAINER(table5), 5); gtk_table_set_row_spacings(GTK_TABLE(table5), 2); gtk_table_set_col_spacings(GTK_TABLE(table5), 2); label40 = gtk_label_new("Root URL of the remote site: "); gtk_widget_show(label40); gtk_table_attach(GTK_TABLE(table5), label40, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label40), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label40), 0, 0.5); url = gtk_entry_new(); if (selected_site->url) gtk_entry_set_text(GTK_ENTRY(url), selected_site->url); gtk_widget_show(url); gtk_table_attach(GTK_TABLE(table5), url, 1, 2, 2, 3, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); remote_dir = gnome_entry_new(NULL); gtk_widget_show(remote_dir); gtk_table_attach(GTK_TABLE(table5), remote_dir, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); combo_entry5 = gnome_entry_gtk_entry(GNOME_ENTRY(remote_dir)); if (selected_site->remote_root_user) gtk_entry_set_text(GTK_ENTRY(combo_entry5), selected_site->remote_root_user); gtk_widget_show(combo_entry5); label38 = gtk_label_new("Directory for remote files: "); gtk_widget_show(label38); gtk_table_attach(GTK_TABLE(table5), label38, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label38), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label38), 0, 0.5); label39 = gtk_label_new("Directory for local files: "); gtk_widget_show(label39); gtk_table_attach(GTK_TABLE(table5), label39, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label39), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label39), 0, 0.5); local_dir = gnome_file_entry_new(NULL, NULL); gtk_widget_show(local_dir); gtk_table_attach(GTK_TABLE(table5), local_dir, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); combo_entry4 = gnome_file_entry_gtk_entry(GNOME_FILE_ENTRY(local_dir)); if (selected_site->local_root_user) gtk_entry_set_text(GTK_ENTRY(combo_entry4), selected_site->local_root_user); gtk_widget_show(combo_entry4); frame17 = gtk_frame_new("File Attributes"); gtk_widget_show(frame17); gtk_box_pack_start(GTK_BOX(vbox22), frame17, TRUE, TRUE, 0); table6 = gtk_table_new(3, 2, FALSE); gtk_widget_show(table6); gtk_container_add(GTK_CONTAINER(frame17), table6); gtk_container_set_border_width(GTK_CONTAINER(table6), 5); gtk_table_set_row_spacings(GTK_TABLE(table6), 2); gtk_table_set_col_spacings(GTK_TABLE(table6), 2); label41 = gtk_label_new("Permissions mode: "); gtk_widget_show(label41); gtk_table_attach(GTK_TABLE(table6), label41, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label41), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label41), 0, 0.5); label42 = gtk_label_new("Symbolic links: "); gtk_widget_show(label42); gtk_table_attach(GTK_TABLE(table6), label42, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label42), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label42), 0, 0.5); label43 = gtk_label_new("Detect changes using: "); gtk_widget_show(label43); gtk_table_attach(GTK_TABLE(table6), label43, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); gtk_label_set_justify(GTK_LABEL(label43), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label43), 0, 0.5); hbox10 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox10); gtk_table_attach(GTK_TABLE(table6), hbox10, 1, 2, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); sym_follow = gtk_radio_button_new_with_label(sym_link_group, "Follow all"); sym_link_group = gtk_radio_button_group(GTK_RADIO_BUTTON(sym_follow)); gtk_widget_show(sym_follow); gtk_box_pack_start(GTK_BOX(hbox10), sym_follow, FALSE, FALSE, 0); sym_ignore = gtk_radio_button_new_with_label(sym_link_group, "Ignore links"); sym_link_group = gtk_radio_button_group(GTK_RADIO_BUTTON(sym_ignore)); gtk_widget_show(sym_ignore); gtk_box_pack_start(GTK_BOX(hbox10), sym_ignore, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sym_ignore), TRUE); sym_maintain = gtk_radio_button_new_with_label(sym_link_group, "Maintain links"); sym_link_group = gtk_radio_button_group(GTK_RADIO_BUTTON(sym_maintain)); gtk_widget_show(sym_maintain); gtk_box_pack_start(GTK_BOX(hbox10), sym_maintain, FALSE, FALSE, 0); hbox9 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox9); gtk_table_attach(GTK_TABLE(table6), hbox9, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND), 0, 0); perms_ignore = gtk_radio_button_new_with_label(perms_group, "Ignore all"); perms_group = gtk_radio_button_group(GTK_RADIO_BUTTON(perms_ignore)); gtk_widget_show(perms_ignore); gtk_box_pack_start(GTK_BOX(hbox9), perms_ignore, FALSE, FALSE, 0); perms_exec = gtk_radio_button_new_with_label(perms_group, "Executables only"); perms_group = gtk_radio_button_group(GTK_RADIO_BUTTON(perms_exec)); gtk_widget_show(perms_exec); gtk_box_pack_start(GTK_BOX(hbox9), perms_exec, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(perms_exec), TRUE); perms_all = gtk_radio_button_new_with_label(perms_group, "Maintain all"); perms_group = gtk_radio_button_group(GTK_RADIO_BUTTON(perms_all)); gtk_widget_show(perms_all); gtk_box_pack_start(GTK_BOX(hbox9), perms_all, FALSE, FALSE, 0); hbox11 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox11); gtk_table_attach(GTK_TABLE(table6), hbox11, 1, 2, 2, 3, (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), (GtkAttachOptions) (GTK_EXPAND), 0, 0); /* Detection mode status */ detection_mode = gtk_label_new(""); gtk_label_set_justify(GTK_LABEL(detection_mode), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(detection_mode), 0, 0.5); gtk_box_pack_start(GTK_BOX(hbox11), detection_mode, TRUE, TRUE, 4); gtk_widget_show(detection_mode); /* Change button */ detection_button = gtk_button_new_with_label("Change"); gtk_signal_connect(GTK_OBJECT(detection_button), "clicked", GTK_SIGNAL_FUNC(change_detection_mode), NULL); gtk_box_pack_start(GTK_BOX(hbox11), detection_button, TRUE, FALSE, 4); gtk_widget_show(detection_button); /* Added */ if (the_site->state_method == state_timesize) gtk_label_set(GTK_LABEL(detection_mode), "File size & modification time"); else gtk_label_set(GTK_LABEL(detection_mode), "File checksum"); /* gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(detect_sizetime), TRUE);*/ /* End */ label27 = gtk_label_new("Locations & Files"); gtk_widget_show(label27); gtk_notebook_set_tab_label(GTK_NOTEBOOK(container), gtk_notebook_get_nth_page(GTK_NOTEBOOK(container), 1), label27); frame18 = gtk_frame_new("Operations checklist"); gtk_widget_show(frame18); gtk_container_add(GTK_CONTAINER(container), frame18); gtk_container_set_border_width(GTK_CONTAINER(frame18), 3); vbox23 = gtk_vbox_new(FALSE, 0); gtk_widget_show(vbox23); gtk_container_add(GTK_CONTAINER(frame18), vbox23); nodelete = gtk_check_button_new_with_label("Delete a file from the server if it is deleted locally"); gtk_widget_show(nodelete); gtk_box_pack_start(GTK_BOX(vbox23), nodelete, TRUE, FALSE, 0); checkmoved = gtk_check_button_new_with_label("Move a remote file if it is moved locally"); gtk_widget_show(checkmoved); gtk_box_pack_start(GTK_BOX(vbox23), checkmoved, TRUE, FALSE, 0); nooverwrite = gtk_check_button_new_with_label("When uploading changed files, first delete them"); gtk_widget_show(nooverwrite); gtk_box_pack_start(GTK_BOX(vbox23), nooverwrite, TRUE, FALSE, 0); lowercase = gtk_check_button_new_with_label("Convert all filenames to lowercase when uploading"); gtk_widget_show(lowercase); gtk_box_pack_start(GTK_BOX(vbox23), lowercase, TRUE, FALSE, 0); use_safemode = gtk_check_button_new_with_label("Use \"safe mode\""); gtk_widget_show(use_safemode); gtk_box_pack_start(GTK_BOX(vbox23), use_safemode, TRUE, FALSE, 0); ftp_mode = gtk_check_button_new_with_label("Use passive mode FTP"); gtk_widget_show(ftp_mode); gtk_box_pack_start(GTK_BOX(vbox23), ftp_mode, TRUE, FALSE, 0); label28 = gtk_label_new("Update Options"); gtk_widget_show(label28); gtk_notebook_set_tab_label(GTK_NOTEBOOK(container), gtk_notebook_get_nth_page(GTK_NOTEBOOK(container), 2), label28); vbox24 = gtk_vbox_new(FALSE, 4); gtk_widget_show(vbox24); gtk_container_add(GTK_CONTAINER(container), vbox24); gtk_container_set_border_width(GTK_CONTAINER(vbox24), 3); scrolledwindow2 = gtk_scrolled_window_new(NULL, NULL); gtk_widget_show(scrolledwindow2); gtk_box_pack_start(GTK_BOX(vbox24), scrolledwindow2, TRUE, TRUE, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow2), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); the_excludes = malloc(sizeof(struct slist_gui)); the_excludes->data = the_site->excludes; the_excludes->type = list_exclude; the_excludes->chosen_row = -1; the_excludes->list = gtk_clist_new(1); gtk_widget_show(the_excludes->list); gtk_container_add(GTK_CONTAINER(scrolledwindow2), the_excludes->list); gtk_clist_set_column_width(GTK_CLIST(the_excludes->list), 0, 80); gtk_clist_column_titles_show(GTK_CLIST(the_excludes->list)); label44 = gtk_label_new("Files and regular expressions to exclude from the site"); gtk_widget_show(label44); gtk_clist_set_column_widget(GTK_CLIST(the_excludes->list), 0, label44); hbox12 = gtk_hbox_new(FALSE, 2); gtk_widget_show(hbox12); gtk_box_pack_start(GTK_BOX(vbox24), hbox12, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox12), 1); label45 = gtk_label_new("Exclude: "); gtk_widget_show(label45); gtk_box_pack_start(GTK_BOX(hbox12), label45, FALSE, FALSE, 0); exclude_gentry = gnome_entry_new("excludes_history"); gtk_widget_show(exclude_gentry); gtk_box_pack_start(GTK_BOX(hbox12), exclude_gentry, TRUE, TRUE, 0); the_excludes->entry = gnome_entry_gtk_entry(GNOME_ENTRY(exclude_gentry)); gtk_widget_show(the_excludes->entry); excludes_new = gtk_button_new_with_label("New"); gtk_widget_show(excludes_new); gtk_box_pack_start(GTK_BOX(hbox12), excludes_new, FALSE, FALSE, 0); exclude_remove = gtk_button_new_with_label("Remove"); gtk_widget_show(exclude_remove); gtk_box_pack_start(GTK_BOX(hbox12), exclude_remove, FALSE, FALSE, 0); label30 = gtk_label_new("Excludes"); gtk_widget_show(label30); gtk_notebook_set_tab_label(GTK_NOTEBOOK(container), gtk_notebook_get_nth_page(GTK_NOTEBOOK(container), 3), label30); /* Actually fill in the excludes list */ populate_minilist(the_excludes); vbox25 = gtk_vbox_new(FALSE, 4); gtk_widget_show(vbox25); gtk_container_add(GTK_CONTAINER(container), vbox25); gtk_container_set_border_width(GTK_CONTAINER(vbox25), 3); scrolledwindow3 = gtk_scrolled_window_new(NULL, NULL); gtk_widget_show(scrolledwindow3); gtk_box_pack_start(GTK_BOX(vbox25), scrolledwindow3, TRUE, TRUE, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); ascii_files = malloc(sizeof(struct slist_gui)); ascii_files->data = the_site->asciis; ascii_files->type = list_ascii; ascii_files->chosen_row = -1; ascii_files->list = gtk_clist_new(1); gtk_widget_show(ascii_files->list); gtk_container_add(GTK_CONTAINER(scrolledwindow3), ascii_files->list); gtk_clist_set_column_width(GTK_CLIST(ascii_files->list), 0, 80); gtk_clist_column_titles_show(GTK_CLIST(ascii_files->list)); label46 = gtk_label_new("Files to transfer in 'ASCII' mode"); gtk_widget_show(label46); gtk_clist_set_column_widget(GTK_CLIST(ascii_files->list), 0, label46); hbox13 = gtk_hbox_new(FALSE, 2); gtk_widget_show(hbox13); gtk_box_pack_start(GTK_BOX(vbox25), hbox13, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox13), 1); label47 = gtk_label_new("Filename: "); gtk_widget_show(label47); gtk_box_pack_start(GTK_BOX(hbox13), label47, FALSE, FALSE, 0); ascii_gentry = gnome_entry_new(NULL); gtk_widget_show(ascii_gentry); gtk_box_pack_start(GTK_BOX(hbox13), ascii_gentry, TRUE, TRUE, 0); ascii_files->entry = gnome_entry_gtk_entry(GNOME_ENTRY(ascii_gentry)); gtk_widget_show(ascii_files->entry); ascii_new = gtk_button_new_with_label("New"); gtk_widget_show(ascii_new); gtk_box_pack_start(GTK_BOX(hbox13), ascii_new, FALSE, FALSE, 0); ascii_remove = gtk_button_new_with_label("Remove"); gtk_widget_show(ascii_remove); gtk_box_pack_start(GTK_BOX(hbox13), ascii_remove, FALSE, FALSE, 0); label31 = gtk_label_new("ASCII"); gtk_widget_show(label31); gtk_notebook_set_tab_label(GTK_NOTEBOOK(container), gtk_notebook_get_nth_page(GTK_NOTEBOOK(container), 4), label31); populate_minilist(ascii_files); vbox26 = gtk_vbox_new(FALSE, 4); gtk_widget_show(vbox26); gtk_container_add(GTK_CONTAINER(container), vbox26); gtk_container_set_border_width(GTK_CONTAINER(vbox26), 3); scrolledwindow4 = gtk_scrolled_window_new(NULL, NULL); gtk_widget_show(scrolledwindow4); gtk_box_pack_start(GTK_BOX(vbox26), scrolledwindow4, TRUE, TRUE, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); the_ignores = malloc(sizeof(struct slist_gui)); the_ignores->data = the_site->ignores; the_ignores->type = list_ignore; the_ignores->chosen_row = -1; the_ignores->list = gtk_clist_new(1); gtk_widget_show(the_ignores->list); gtk_container_add(GTK_CONTAINER(scrolledwindow4), the_ignores->list); gtk_clist_set_column_width(GTK_CLIST(the_ignores->list), 0, 80); gtk_clist_column_titles_show(GTK_CLIST(the_ignores->list)); label48 = gtk_label_new("Files whose *changes* should not be transferred to the remote site"); gtk_widget_show(label48); gtk_clist_set_column_widget(GTK_CLIST(the_ignores->list), 0, label48); populate_minilist(the_ignores); hbox14 = gtk_hbox_new(FALSE, 2); gtk_widget_show(hbox14); gtk_box_pack_start(GTK_BOX(vbox26), hbox14, FALSE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox14), 1); label49 = gtk_label_new("Ignore: "); gtk_widget_show(label49); gtk_box_pack_start(GTK_BOX(hbox14), label49, FALSE, FALSE, 0); ignores_gentry = gnome_entry_new(NULL); gtk_widget_show(ignores_gentry); gtk_box_pack_start(GTK_BOX(hbox14), ignores_gentry, TRUE, TRUE, 0); the_ignores->entry = gnome_entry_gtk_entry(GNOME_ENTRY(ignores_gentry)); gtk_widget_show(the_ignores->entry); ignore_new = gtk_button_new_with_label("New"); gtk_widget_show(ignore_new); gtk_box_pack_start(GTK_BOX(hbox14), ignore_new, FALSE, FALSE, 0); ignore_remove = gtk_button_new_with_label("Remove"); gtk_widget_show(ignore_remove); gtk_box_pack_start(GTK_BOX(hbox14), ignore_remove, FALSE, FALSE, 0); ignores_label = gtk_label_new("Ignore"); gtk_widget_show(ignores_label); gtk_notebook_set_tab_label(GTK_NOTEBOOK(container), gtk_notebook_get_nth_page(GTK_NOTEBOOK(container), 5), ignores_label); if (selected_site->protocol == siteproto_ftp) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(proto_ftp), TRUE); #ifdef USE_DAV if (selected_site->protocol == siteproto_dav) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(proto_dav), TRUE); #endif /* USE_DAV */ gtk_signal_connect(GTK_OBJECT(combo_entry3), "changed", GTK_SIGNAL_FUNC(change_username), NULL); gtk_signal_connect(GTK_OBJECT(password), "changed", GTK_SIGNAL_FUNC(change_password), NULL); gtk_signal_connect(GTK_OBJECT(combo_entry2), "changed", GTK_SIGNAL_FUNC(change_host_name), NULL); gtk_signal_connect(GTK_OBJECT(port), "changed", GTK_SIGNAL_FUNC(change_port), NULL); gtk_signal_connect(GTK_OBJECT(url), "changed", GTK_SIGNAL_FUNC(change_url), NULL); gtk_signal_connect(GTK_OBJECT(combo_entry5), "changed", GTK_SIGNAL_FUNC(change_remote_dir), NULL); /* Sets the local dir, but doesn't do a rescan. */ gtk_signal_connect(GTK_OBJECT(combo_entry4), "changed", GTK_SIGNAL_FUNC(set_local_dir), NULL); /* If activated do a rescan. focus out can get kinda icky if the dir * is not readable. */ gtk_signal_connect(GTK_OBJECT(combo_entry4), "activate", GTK_SIGNAL_FUNC(change_local_dir), NULL); /* gtk_signal_connect(GTK_OBJECT(combo_entry4), "focus_out_event", GTK_SIGNAL_FUNC(change_local_dir), NULL);*/ gtk_signal_connect(GTK_OBJECT(sym_follow), "toggled", GTK_SIGNAL_FUNC(change_sym_mode), "follow"); gtk_signal_connect(GTK_OBJECT(sym_ignore), "toggled", GTK_SIGNAL_FUNC(change_sym_mode), "ignore"); gtk_signal_connect(GTK_OBJECT(sym_maintain), "toggled", GTK_SIGNAL_FUNC(change_sym_mode), "maintain"); gtk_signal_connect(GTK_OBJECT(perms_ignore), "toggled", GTK_SIGNAL_FUNC(change_perms), "ignore"); gtk_signal_connect(GTK_OBJECT(perms_exec), "toggled", GTK_SIGNAL_FUNC(change_perms), "exec"); gtk_signal_connect(GTK_OBJECT(perms_all), "toggled", GTK_SIGNAL_FUNC(change_perms), "all"); gtk_signal_connect(GTK_OBJECT(nodelete), "toggled", GTK_SIGNAL_FUNC(change_delete), NULL); gtk_signal_connect(GTK_OBJECT(checkmoved), "toggled", GTK_SIGNAL_FUNC(change_move_status), NULL); gtk_signal_connect(GTK_OBJECT(nooverwrite), "toggled", GTK_SIGNAL_FUNC(change_nooverwrite), NULL); gtk_signal_connect(GTK_OBJECT(lowercase), "toggled", GTK_SIGNAL_FUNC(change_lowercase), NULL); gtk_signal_connect(GTK_OBJECT(use_safemode), "toggled", GTK_SIGNAL_FUNC(change_safemode), NULL); gtk_signal_connect(GTK_OBJECT(ftp_mode), "toggled", GTK_SIGNAL_FUNC(change_passive_ftp), NULL); gtk_signal_connect(GTK_OBJECT(the_excludes->list), "select_row", GTK_SIGNAL_FUNC(select_minilist_item), the_excludes); gtk_signal_connect(GTK_OBJECT(the_excludes->entry), "changed", GTK_SIGNAL_FUNC(change_minilist_entry), the_excludes); gtk_signal_connect(GTK_OBJECT(excludes_new), "clicked", GTK_SIGNAL_FUNC(add_minilist_item), the_excludes); gtk_signal_connect(GTK_OBJECT(exclude_remove), "clicked", GTK_SIGNAL_FUNC(remove_minilist_item), the_excludes); gtk_signal_connect(GTK_OBJECT(ascii_files->list), "select_row", GTK_SIGNAL_FUNC(select_minilist_item), ascii_files); gtk_signal_connect(GTK_OBJECT(ascii_files->entry), "changed", GTK_SIGNAL_FUNC(change_minilist_entry), ascii_files); gtk_signal_connect(GTK_OBJECT(ascii_new), "clicked", GTK_SIGNAL_FUNC(add_minilist_item), ascii_files); gtk_signal_connect(GTK_OBJECT(ascii_remove), "clicked", GTK_SIGNAL_FUNC(remove_minilist_item), ascii_files); gtk_signal_connect(GTK_OBJECT(the_ignores->list), "select_row", GTK_SIGNAL_FUNC(select_minilist_item), the_ignores); gtk_signal_connect(GTK_OBJECT(the_ignores->entry), "changed", GTK_SIGNAL_FUNC(change_minilist_entry), the_ignores); gtk_signal_connect(GTK_OBJECT(ignore_new), "clicked", GTK_SIGNAL_FUNC(add_minilist_item), the_ignores); gtk_signal_connect(GTK_OBJECT(ignore_remove), "clicked", GTK_SIGNAL_FUNC(remove_minilist_item), the_ignores); gtk_widget_show(main_panel); /* if (main_prefs->remember_notebook_pos) */ /* Why doesn't this work? */ NE_DEBUG(DEBUG_GNOME, "Setting notebook page to page %d.\n", last_notepage); gtk_notebook_set_page(GTK_NOTEBOOK(container), last_notepage); gtk_signal_connect(GTK_OBJECT(container), "switch-page", GTK_SIGNAL_FUNC(record_notepage), NULL); /*******************************************/ /**** Setup the permissions GUI widgets ****/ /*******************************************/ switch (selected_site->perms) { case sitep_ignore: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(perms_ignore), TRUE); break; case sitep_exec: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(perms_exec), TRUE); break; case sitep_all: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(perms_all), TRUE); break; } #ifdef USE_DAV if (selected_site->protocol == siteproto_dav) { gtk_widget_set_sensitive(perms_all, FALSE); gtk_widget_set_sensitive(perms_exec, FALSE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(perms_ignore), TRUE); } #endif /* USE_DAV */ /*****************************************/ /**** Setup the sym links GUI widgets ****/ /*****************************************/ switch (selected_site->symlinks) { case sitesym_ignore: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sym_ignore), TRUE); break; case sitesym_maintain: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sym_maintain), TRUE); break; case sitesym_follow: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sym_follow), TRUE); break; } if (selected_site->protocol == siteproto_ftp) { gtk_widget_set_sensitive(sym_maintain, FALSE); if (selected_site->symlinks == sitesym_maintain) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sym_ignore), TRUE); } /************/ /*** Port ***/ /************/ gtk_spin_button_set_value(GTK_SPIN_BUTTON(port), (float) selected_site->server.port); /***************/ /*** Options ***/ /***************/ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(nodelete), !(selected_site->nodelete)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(nooverwrite), selected_site->nooverwrite); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkmoved), selected_site->checkmoved); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lowercase), selected_site->lowercase); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_safemode), selected_site->safemode); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ftp_mode), selected_site->ftp_pasv_mode); /* Restore rcfile_saved status after bastardization by the various signal * handlers that will have gone off. */ rcfile_saved = current_rcfile_saved; return main_panel; } /* TODO: Add a config option for more stats, like how much space the new * files take up, how many excludes, etc. */ sitecopy-0.16.6/gnome/file_moved.xpm0000664000076400007640000000210410165765223015541 0ustar joejoe/* XPM */ static char * file_moved_xpm[] = { "16 15 49 1", " c None", ". c #3C403C", "+ c #000000", "@ c #9FB09F", "# c #A9B2A9", "$ c #B2B4B2", "% c #B5B5B5", "& c #232323", "* c #3F473F", "= c #AEEDAE", "- c #D4F5D4", "; c #E7F9E7", "> c #F7FDF7", ", c #1F1F1F", "' c #CDF3CD", ") c #DFF7DF", "! c #1C1F1C", "~ c #384638", "{ c #7AE27A", "] c #9FEA9F", "^ c #B2EEB2", "/ c #C5F2C5", "( c #191E19", "_ c #354535", ": c #72E072", "< c #85E485", "[ c #95E095", "} c #95BE95", "| c #181C18", "1 c #324532", "2 c #45D645", "3 c #58DA58", "4 c #6BDE6B", "5 c #80C180", "6 c #9F9F9F", "7 c #3B3B3B", "8 c #95AE95", "9 c #263126", "0 c #1A701A", "a c #247224", "b c #4C744C", "c c #5C5E5C", "d c #686868", "e c #C1F1C1", "f c #94E794", "g c #A7EBA7", "h c #BAEFBA", "i c #8CE58C", "j c #5FDC5F", " ", " .+@#$%& ", " *=+-;>, ", " ++++++++')! ", " + ~{+]^/( ", " + _+:<[}| ", " + 1234567 ", " 8+#$% 90abcd ", " =e-;> ", " fgh') ", " {i]^/ ", " j:<[} ", " 23456 ", " 0abcd ", " "}; sitecopy-0.16.6/gnome/gcommon.h0000664000076400007640000000510410232743237014511 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef GNOME_FE_COMMON_H #define GNOME_FE_COMMON_H #include #include #include "common.h" #include "sites.h" #include "frontend.h" #define glade_widget(xml,string) glade_xml_get_widget(xml,string) enum view_type { gtk_slim, gtk_full }; gboolean xsc_replace_string(char **oldString, char *replacementString); /* For synch and update modes */ gchar *get_glade_filename(void); int fe_gtk_question(char *question, GnomeReplyCallback yes_action); void gfe_status(const char *message); /* void fe_transfer_progress(size_t progress, size_t total); void fe_warning(const char *description, const char *subject, const char *error); */ /* void fe_connection( sock_status status, const char *info ); int fe_login( fe_login_context ctx, const char *realm, const char *hostname, char **username, char **password ); int fe_can_update(const struct site_file *file); void fe_updating(const struct site_file *file); void fe_updated(const struct site_file *file, int success, const char *error); */ int verifysite_gnome(struct site *a_site); /* These have no yet been implemented. * joe: don't need these void fe_synching(const struct site_file *file); void fe_synched(const struct site_file *file, int success, const char *error); */ /* joe: don't need these. void fe_checksumming(const char *filename); void fe_checksummed(const char *filename, int success, const char *error); void fe_setting_perms(const struct site_file *file); void fe_set_perms(const struct site_file *file, int success, const char *error); */ void set_status_after_operation(int return_code, GtkLabel *infoLabel); #endif sitecopy-0.16.6/gnome/link_changed.xpm0000664000076400007640000000116510165765223016044 0ustar joejoe/* XPM */ static char * link_changed_xpm[] = { "16 15 18 1", " c None", ". c #DAD791", "+ c #E8E3B3", "@ c #7E0000", "# c #AE0000", "$ c #DBD460", "% c #F7F5D4", "& c #FF840D", "* c #272727", "= c #F4F3D1", "- c #E5E2B2", "; c #DAD797", "> c #D8D381", ", c #A40000", "' c #7A0000", ") c #860000", "! c #F63900", "~ c #DC0500", " ", " ", " .+ ", " .@#. ", " .#@$% ", " +&*&+ ", "=------;- %$@&", ">,''''')! $#@.", " %&@#+ ", " +~*&% ", " &@$ ", " % ", " ", " ", " "}; sitecopy-0.16.6/gnome/dir2_del.xpm0000664000076400007640000000227710165765223015127 0ustar joejoe/* XPM */ static char * dir2_del_xpm[] = { "16 16 56 1", " c None", ". c #000000", "+ c #E1846D", "@ c #F5312A", "# c #FE0505", "$ c #FA322F", "% c #F78983", "& c #EF3024", "* c #FF0000", "= c #FB3330", "- c #EB2F20", "; c #EF2E22", "> c #41B84A", ", c #55D255", "' c #DFA990", ") c #F7302A", "! c #BF7D4B", "~ c #EB2D1E", "{ c #5CD459", "] c #48C54E", "^ c #F63029", "/ c #F1877D", "( c #388D46", "_ c #E42E19", ": c #161F16", "< c #F7322C", "[ c #42B94D", "} c #B3F7AC", "| c #FB0502", "1 c #B6F9B6", "2 c #A4F392", "3 c #FD0504", "4 c #2E8543", "5 c #BFFAC3", "6 c #9DEF78", "7 c #6AD758", "8 c #267B3C", "9 c #DD2C12", "0 c #96EC7A", "a c #066334", "b c #DF2B12", "c c #E01313", "d c #A83434", "e c #1F7437", "f c #D92C0E", "g c #DE2A11", "h c #8AE570", "i c #E62C19", "j c #FF3434", "k c #37883F", "l c #78E580", "m c #D92B0E", "n c #E51A1A", "o c #43BF40", "p c #FA0501", "q c #F22727", " ", " ", " .+@##$% ", " .&******= ", " .-*;>,>')*$.. ", " !*~{]{]**^*/(.", " ._*...:**..*<[.", ".}|*121**212*34.", ".5|*67**6767*38.", " .9*7**07676*&8.", " a1*b*67676c*de.", " af*g7h76i*jk..", " .lm******n7o..", " ...fp#qd.... ", " ", " "}; sitecopy-0.16.6/gnome/changes.c0000664000076400007640000002174210232743237014463 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ #include #include "changes.h" /* Throughout this file, strdup is used, and not the preferable g_strdup. * This is because many of the fields are allocated in the core of * sitecopy, and g_free and free are not compatible. I didn't fancy my * chances of getting the core of sitecopy dependant upon glib, so only * strdup & free are used in this file. */ extern struct site *selected_site; extern gboolean rcfile_saved; extern GtkWidget *sitecopy; extern GtkWidget *nooverwrite, *sym_maintain, *perms_exec, *perms_all; extern GtkWidget *perms_ignore, *sym_ignore, *port, *ftp_mode; void change_detection_mode(GtkWidget *button, gpointer data) { if ( selected_site->remote_is_different) { gnome_error_dialog_parented("Your local site must be in sync with the remote site\nbefore change-detection mode can be changed.", GTK_WINDOW(sitecopy)); return; } if (selected_site->state_method == state_checksum) selected_site->state_method = state_timesize; else selected_site->state_method = state_checksum; /* Restore file info */ site_readfiles(selected_site); NE_DEBUG (DEBUG_GNOME, "**************\nReadfiles done.\n*************"); site_catchup(selected_site); NE_DEBUG (DEBUG_GNOME, "**************\nCatchup done.\n*************"); site_write_stored_state(selected_site); NE_DEBUG (DEBUG_GNOME, "**************\nStored state written.\n*************"); rescan_selected(TRUE); } void change_port(GtkWidget * spinbutton, gpointer data) { int p = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spinbutton)); selected_site->server.port = p; } void change_lowercase(GtkWidget * checkbutton, gpointer data) { selected_site->lowercase = GTK_TOGGLE_BUTTON(checkbutton)->active; } void change_safemode(GtkWidget * checkbutton, gpointer data) { /* This makes the nooverwrite checkbutton insensitive, * as it can't be used with safe mode. */ gboolean active = GTK_TOGGLE_BUTTON(checkbutton)->active; g_assert(nooverwrite != NULL); if (active) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(nooverwrite), FALSE); gtk_widget_set_sensitive(nooverwrite, !active); selected_site->safemode = active; } void change_host_name(GtkWidget * entry, gpointer data) { char *new_hostname = strdup(gtk_entry_get_text(GTK_ENTRY(entry))); xsc_replace_string(&(selected_site->server.hostname), new_hostname); rcfile_saved = FALSE; } void change_protocol(GtkWidget * menu_item, gpointer proto) { gchar *protoc; extern struct proto_driver ftp_driver; #ifdef USE_DAV extern struct proto_driver dav_driver; #endif protoc = (gchar *) proto; if (strcmp(protoc, "ftp") == 0) { selected_site->protocol = siteproto_ftp; /* Change protocol to ftp */ selected_site->driver = &ftp_driver; /* We can't do sym links with ftp */ gtk_widget_set_sensitive(sym_maintain, FALSE); /* So make sure we ignore them */ if (selected_site->symlinks == sitesym_maintain) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sym_ignore), TRUE); /* Let's set an appropriate default port */ gtk_spin_button_set_value(GTK_SPIN_BUTTON(port), 21); #ifdef USE_DAV /* If using DAV caused the passive FTP checkbox to get de-sensitived, * then make sure it's now sensitive. */ g_assert(ftp_mode != NULL); g_assert(perms_exec != NULL); g_assert(perms_all != NULL); g_assert(perms_ignore != NULL); g_assert(sym_maintain != NULL); gtk_widget_set_sensitive(ftp_mode, TRUE); gtk_widget_set_sensitive(perms_exec, TRUE); gtk_widget_set_sensitive(perms_all, TRUE); } else if (strcmp(protoc, "dav") == 0) { selected_site->protocol = siteproto_dav; /* DAV */ selected_site->driver = &dav_driver; gtk_widget_set_sensitive(GTK_WIDGET(ftp_mode), FALSE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ftp_mode), FALSE); /* Set an appropriate port */ gtk_spin_button_set_value(GTK_SPIN_BUTTON(port), 80); gtk_widget_set_sensitive(sym_maintain, TRUE); gtk_widget_set_sensitive(perms_exec, FALSE); gtk_widget_set_sensitive(perms_all, FALSE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(perms_ignore), TRUE); #endif } rcfile_saved = FALSE; } void change_username(GtkWidget * entry, gpointer data) { gchar *username; username = strdup(gtk_entry_get_text(GTK_ENTRY(entry))); xsc_replace_string(&(selected_site->server.username), username); rcfile_saved = FALSE; } void change_password(GtkWidget * entry, gpointer data) { gchar *new_password = strdup(gtk_entry_get_text(GTK_ENTRY(entry))); xsc_replace_string(&(selected_site->server.password), new_password); rcfile_saved = FALSE; } void change_passive_ftp(GtkWidget * toggle, gpointer data) { selected_site->ftp_pasv_mode = GTK_TOGGLE_BUTTON(toggle)->active; rcfile_saved = FALSE; } void change_nooverwrite(GtkWidget * toggle, gpointer data) { selected_site->nooverwrite = GTK_TOGGLE_BUTTON(toggle)->active; rcfile_saved = FALSE; } void change_delete(GtkWidget * toggle, gpointer data) { if (GTK_TOGGLE_BUTTON(toggle)->active) { selected_site->nodelete = FALSE; } else { selected_site->nodelete = TRUE; } rcfile_saved = FALSE; } void change_move_status(GtkWidget * toggle, gpointer data) { selected_site->checkmoved = GTK_TOGGLE_BUTTON(toggle)->active; rcfile_saved = FALSE; } void change_http_expect(GtkWidget * toggle, gpointer data) { selected_site->http_use_expect = GTK_TOGGLE_BUTTON(toggle)->active; rcfile_saved = FALSE; } void change_http_limit(GtkWidget * toggle, gpointer data) { selected_site->http_limit = GTK_TOGGLE_BUTTON(toggle)->active; rcfile_saved = FALSE; } void change_perms(GtkWidget * menu_item, gpointer perm_data) { gchar *perm_set; perm_set = (gchar *) perm_data; if (strcmp(perm_set, "ignore") == 0) { selected_site->perms = sitep_ignore; } else if (strcmp(perm_set, "exec") == 0) { selected_site->perms = sitep_exec; } else if (strcmp(perm_set, "all") == 0) { selected_site->perms = sitep_all; } rcfile_saved = FALSE; } void change_sym_mode(GtkWidget * menu_item, gpointer sym_data) { gchar *sym_info; sym_info = (gchar *) sym_data; if (strcmp(sym_info, "ignore") == 0) { selected_site->symlinks = sitesym_ignore; } else if (strcmp(sym_info, "follow") == 0) { selected_site->symlinks = sitesym_follow; } else if (strcmp(sym_info, "maintain") == 0) { selected_site->symlinks = sitesym_maintain; } rcfile_saved = FALSE; } /* This is for the 'change' event. */ void set_local_dir(GtkWidget * entry, gpointer data) { gchar *new_local_dir = strdup(gtk_entry_get_text(GTK_ENTRY(entry))); xsc_replace_string(&(selected_site->local_root_user), new_local_dir); if (*selected_site->local_root_user == '~') selected_site->local_isrel = TRUE; else selected_site->local_isrel = FALSE; rcfile_saved = FALSE; } /** FIXME: Sort this, and make sure the event it's connected to is right. * Currently connected to the focus-out-event. */ void change_local_dir(GtkWidget * entry, gpointer data) { set_local_dir(entry, data); rescan_selected(FALSE); } void change_remote_dir(GtkWidget * entry) { gchar *new_remote_dir = strdup(gtk_entry_get_text(GTK_ENTRY(entry))); xsc_replace_string(&(selected_site->remote_root_user), new_remote_dir); if (*new_remote_dir == '~') { selected_site->remote_isrel = TRUE; } else { selected_site->remote_isrel = FALSE; } if (verifysite_gnome(selected_site) != 0) { NE_DEBUG(DEBUG_GNOME, "site did not verify correctly."); return; } if ((*new_remote_dir != '~') && (*new_remote_dir != '/')) { gfe_status("Warning! The remote directory must begin with either a '/' or a '~/'.\n Use ~/ to denote a directory relative to your logon directory"); return; } /* Do we want to enquire about a site_fetch_list if this changes? */ rcfile_saved = FALSE; } void change_url(GtkWidget * entry, gpointer data) { char *new_url= strdup(gtk_entry_get_text(GTK_ENTRY(entry))); xsc_replace_string(&(selected_site->url), new_url); rcfile_saved = FALSE; } sitecopy-0.16.6/gnome/resynch.h0000664000076400007640000000307410232743237014531 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef GNOME_RESYNC_H #define GNOME_RESYNC_H #include #include #include #include #include "sites.h" #include "rcfile.h" #include "gcommon.h" #include "misc.h" #include "operations.h" gboolean delete_fetch(GtkWindow *fnar, gpointer data); int fetch_site_list_please(GtkWidget * update_button, gpointer data); void close_fetch_window(void); int start_fetch_list(void); void *fetch_thread(void *no_data); void *actual_fetch_list(void *nothing); void fe_fetch_found(const struct site_file *file); void *sync_thread(void *no_data); #endif /* GNOME_RESYNC_H */ sitecopy-0.16.6/gnome/file_widgets.h0000664000076400007640000000217110232743237015520 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef FILE_WIDGETS_H #define FILE_WIDGETS_H #include GtkWidget *make_file_info_area(struct site_file *the_file); #endif /* FILE_WIDGETS_H */ sitecopy-0.16.6/gnome/file_new.xpm0000664000076400007640000000236610165765223015232 0ustar joejoe/* XPM */ static char * file_new_xpm[] = { "16 15 61 1", " c None", ". c #616161", "+ c #414141", "@ c #ECA0A0", "# c #EEA8A8", "$ c #F0B1B1", "% c #F1B9B9", "& c #F3C1C1", "* c #F4C9C9", "= c #F6D1D1", "- c #F7DADA", "; c #F9E2E2", "> c #FBEAEA", ", c #FCF2F2", "' c #FEFAFA", ") c #000000", "! c #EA9494", "~ c #EC9C9C", "{ c #EDA4A4", "] c #EFADAD", "^ c #F0B5B5", "/ c #F2BDBD", "( c #F3C5C5", "_ c #F5CDCD", ": c #F7D6D6", "< c #F8DEDE", "[ c #FAE6E6", "} c #FBEEEE", "| c #E88888", "1 c #E99090", "2 c #EB9898", "3 c #E57B7B", "4 c #E78484", "5 c #E88C8C", "6 c #E36F6F", "7 c #E47777", "8 c #E68080", "9 c #E16363", "0 c #E26B6B", "a c #E47373", "b c #DE5757", "c c #E05F5F", "d c #E16767", "e c #DC4A4A", "f c #DD5252", "g c #DF5B5B", "h c #D93E3E", "i c #DB4646", "j c #DD4E4E", "k c #D73232", "l c #D93A3A", "m c #DA4242", "n c #202020", "o c #D62929", "p c #D62E2E", "q c #D83636", "r c #FFFFFF", "s c #C2C2C2", "t c #A2A2A2", "u c #828282", "v c #DFDFDF", " .............+ ", " .@#$%&*=-;>,') ", " .!~{]^/(_:<[}) ", " .|12@#$%&*=-;) ", " .345!~{]^/(_:) ", " .678|12@#$%&*) ", " .90a345!~{]^/) ", " .bcd678|12@#$) ", " .efg90a345!~{) ", " .hijbcd678|12) ", " .klmefg90a...n ", " .opqhijbcd.rs+ ", " .oooklmeftus+t ", " .oooopqvs.s+u ", " +))))))))n+t "}; sitecopy-0.16.6/gnome/file.xpm0000664000076400007640000000236210165765223014355 0ustar joejoe/* XPM */ static char * file_xpm[] = { "16 15 61 1", " c None", ". c #616161", "+ c #414141", "@ c #BDF0BD", "# c #C5F2C5", "$ c #CDF4CD", "% c #D5F6D5", "& c #DEF7DE", "* c #E6F9E6", "= c #EEFBEE", "- c #F6FDF6", "; c #FFFFFF", "> c #000000", ", c #B0EEB0", "' c #B9EFB9", ") c #C1F1C1", "! c #C9F3C9", "~ c #D1F5D1", "{ c #D9F7D9", "] c #E2F8E2", "^ c #EAFAEA", "/ c #F2FCF2", "( c #FAFEFA", "_ c #A4EBA4", ": c #ACEDAC", "< c #B4EFB4", "[ c #98E898", "} c #A0EAA0", "| c #A8ECA8", "1 c #8BE68B", "2 c #94E794", "3 c #9CE99C", "4 c #7FE37F", "5 c #87E587", "6 c #8FE78F", "7 c #73E073", "8 c #7BE27B", "9 c #83E483", "0 c #66DE66", "a c #6EE06E", "b c #77E177", "c c #5ADB5A", "d c #62DD62", "e c #6ADF6A", "f c #4ED84E", "g c #56DA56", "h c #5EDC5E", "i c #202020", "j c #41D641", "k c #49D849", "l c #52D952", "m c #C2C2C2", "n c #35D335", "o c #3DD53D", "p c #45D745", "q c #A2A2A2", "r c #828282", "s c #29D029", "t c #31D231", "u c #39D439", "v c #DFDFDF", " .............+ ", " .@#$%&*=-;;;;> ", " .,')!~{]^/(;;> ", " ._:<@#$%&*=-;> ", " .[}|,')!~{]^/> ", " .123_:<@#$%&*> ", " .456[}|,')!~{> ", " .789123_:<@#$> ", " .0ab456[}|,')> ", " .cde789123_:<> ", " .fgh0ab456...i ", " .jklcde789.;m+ ", " .nopfgh0aqrm+q ", " .stujklvm.m+r ", " +>>>>>>>>i+q "}; sitecopy-0.16.6/gnome/link.xpm0000664000076400007640000000115510165765223014372 0ustar joejoe/* XPM */ static char * link_xpm[] = { "16 15 18 1", " c None", ". c #ABB2C3", "+ c #C7CCD7", "@ c #1F3460", "# c #3B4D74", "$ c #8F99AF", "% c #E3E5EB", "& c #73809C", "* c #031A4C", "= c #E0E3E9", "- c #C5CAD6", "; c #AEB6C6", "> c #A1A9BC", ", c #35476F", "' c #1C315E", ") c #233763", "! c #667492", "~ c #576687", " ", " ", " .+ ", " .@#. ", " .#@$% ", " +&*&+ ", "=------;- %$@&", ">,''''')! $#@.", " %&@#+ ", " +~*&% ", " &@$ ", " % ", " ", " ", " "}; sitecopy-0.16.6/gnome/file_changed.xpm0000664000076400007640000000141310165765223016022 0ustar joejoe/* XPM */ static char * file_changed_xpm[] = { "16 15 28 1", " c None", ". c #616161", "+ c #414141", "@ c #F5DCA1", "# c #F6E0AC", "$ c #F7E5B8", "% c #F9E9C4", "& c #FAEDD0", "* c #FBF1DB", "= c #FCF6E7", "- c #FDFAF3", "; c #FFFFFF", "> c #000000", ", c #F4D795", "' c #F3D389", ") c #F2CF7E", "! c #F0CA72", "~ c #EFC666", "{ c #EEC25A", "] c #EDBE4F", "^ c #ECB943", "/ c #EBB537", "( c #202020", "_ c #E9B02B", ": c #C2C2C2", "< c #A2A2A2", "[ c #828282", "} c #DFDFDF", " .............+ ", " .@#$%&*=-;;;;> ", " .,@#$%&*=-;;;> ", " .',@#$%&*=-;;> ", " .)',@#$%&*=-;> ", " .!)',@#$%&*=-> ", " .~!)',@#$%&*=> ", " .{~!)',@#$%&*> ", " .]{~!)',@#$%&> ", " .^]{~!)',@#$%> ", " ./^]{~!)',...( ", " ._/^]{~!)'.;:+ ", " .__/^]{~!<[:+< ", " .___/^]}:.:+[ ", " +>>>>>>>>(+< "}; sitecopy-0.16.6/gnome/doc/0000775000076400007640000000000011037462356013452 5ustar joejoesitecopy-0.16.6/gnome/doc/topic.dat0000664000076400007640000000013510165765223015261 0ustar joejoexsitecopy.htm XSitecopy manual c44.html Site definitions menus.html The menus todo.html ToDo sitecopy-0.16.6/gnome/doc/x195.html0000664000076400007640000000377711037462356015064 0ustar joejoe Settings

Settings

Preferences

This allows you to set various things. Or at least it will do as soon as I write it. :o)

sitecopy-0.16.6/gnome/doc/c9.html0000664000076400007640000000356011037462355014656 0ustar joejoe Requirements

Requirements

XSitecopy requires the Gnome libraries, version 1.0.14 or above, and all of the pre-requisites of those libraries.

sitecopy-0.16.6/gnome/doc/x117.html0000664000076400007640000000516711037462355015050 0ustar joejoe Excludes, ASCII, and Ignores

Excludes, ASCII, and Ignores

Chances are that while you're editing html locally, things like backup files will get created. While useful, it's likely you don't want them uploaded to your remote web site. The excludes section allows you to specify glob patterns (see the fnmatch(3) and glob(7) man pages). Any files on the local site matching these expressions will be ignored by XSitecopy.

For example my excludes consist of:

  • *.bak

  • core

  • oldweb

because I don't want any backups or core dumps uploaded. I also have a sub-directory on my local site called 'oldweb' which I keep for nostalgic purposes only. This is not uploaded by specifying it as 'an exclude'.

sitecopy-0.16.6/gnome/doc/x135.html0000664000076400007640000000421011037462355015034 0ustar joejoe Deleted Files

Deleted Files

Deleted files appear in a site's file tree because they represent an operation that Xsitecopy must still perform when doing an update. However, given that these files don't exist, the only information Xsitecopy can report is just that.

sitecopy-0.16.6/gnome/doc/x200.html0000664000076400007640000000535011037462356015034 0ustar joejoe Backup

Backup

Backup files status

The state of your files on the remote site is actually stored in a file on the local hard drive. If this file was to become corrupted, then the state would normally have to be initialized, or "caught up". This gives you an alternate option.

Restore files status

If you have a made a backup of your files' state information, this gives you the option to restore it.

Backup site definitions

Saves a backup of your 'rcfile' - the file XSitecopy uses to store the site definitions.

Restore site definitions

If you have previously backed up your site configurations, this will restore them.

sitecopy-0.16.6/gnome/doc/xsitecopy.sgml0000664000076400007640000004136310165765223016374 0ustar joejoe XSitecopy Lee Mallabone lee0@callnetuk.com Requirements XSitecopy requires the Gnome libraries, version 1.0.14 or above, and all of the pre-requisites of those libraries. Installation To compile from the source distribution, change into the source directory and run: ./configure --enable-gnomefe make make install (become root first) To install from a binary rpm, change directory to the location of your freshly downloaded rpm and type the following, (substituting i386 for whatever architecture you are running on, and VERSION for the version you've acquired): rpm -iv xsitecopy-VERSION-1.i386.rpm To rebuild a binary rpm from a source rpm, do the following: rpm --rebuild sitecopy-VERSION-1.src.rpm This will place a binary rpm in /usr/src/redhat/RPMS/i386/ which can be installed as above. Usage Once installed, you should find a shortcut to XSitecopy in the Internet section of your gnome system menu. If you are not running GNOME as your desktop environment, simply type xsitecopy into an xterm. Quick-Start</> <para> If you've never used sitecopy before, you should take a look at the README file that comes with the sitecopy distribution. When you run xsitecopy for the first time, it will set up 2 things in your home directory; a configuration file where your site definitions are stored ($HOME/.sitecopyrc), and a storage directory where it will place configuration files to keep track of the files you add, change, move or delete on the local copies of your websites. ($HOME/.sitecopy/) To create sites, click <emphasis>New site </emphasis>. A Gnome Druid will appear to guide you through the creation process. You must type a name for the site, along with server details and local & remote directory names. All other options may be left at their default values, or configured to your personal taste. </para> </sect1> </chapter> <chapter><title>Creating a site To guide you through the process of creating a site, a step-by-step Druid is provided. At each stage of the druid, the information required is explained. Almost all of the information is optional and can be edited or added at a later date. If you miss out a field that is mandatory for site creation, a dialog will pop up to warn you. We'll now take a look at the various steps of the site creation druid. FIXME. Add lots of nice screenshots, and a commentary. The Main Interface</> <para> At the top is the menu. Below this is the toolbar. Both of these are used to perform operations on sites, and/or retrieve more general information. </para> <para>Below these bars is the main part of Xsitecopy's user interface. As is obvious from glancing at it, the UI is split into 2 main sections. On the left is a tree view with a tree node for each of the sites that Xsitecopy knows about. </para> <!-- FIXME: Add something about site name colours and configurability here --> <para> If you expand a site, the files and directories that it is aware of will be shown in a similar manner to the gnome file manager, gmc. Clicking on a file or directory brings up information about that file in the right side of the window. <!--FIXME: Make the above less crap, and a little more verbose --> </para> </chapter> <chapter><title>Sites</> <para> If you click on a site, the details and attributes of that site will be displayed in the main area of the program. These are divided into what are hopefully logical sections. Each section is separated by a frame, described below. </para> <sect1><title>Basic Details Hostname is the name of your remote web server. For example, ftp.geocities.com. Port specifies the port that should be connected to on the remote server. Unless you know you need to change this, it should be safe to simply use the default value setup by your chosen protocol. Protocol determines the method that sitecopy uses to transfer your files. This is totally dependant upon whether or not you would normally upload files to your website using FTP, or whether you are using a WebDAV server. You should choose the protocol accordingly. Note:- If xsitecopy has been compiled without WebDAV support, FTP will be the only option here. Username is the name you normally use to login when uploading files. If this is incorrect, you will receive errors when trying to upload your files. Password is the password required in order to login to the remote server. This will appear as asterisks on the screen. Site Statistics provides a short summary of the changes (if any) to the local site, since the last update was performed. Locations & Files Directory for local files, is an absolute path in your file system. It should be the root directory of your website that resides on your filesystem. Directory for remote files, is the directory that all files will be uploaded into. It must exist on the remote site for a successful update to be completed. The directory must either have a / prefix if it is an absolute path, or a \~/ prefix if it is relative to your remote login directory. Root URL of the remote site, is a non-essential field, that can be used to generate a "recent changes" web page using the console application, sitecopy, and a provided awk script. Support for report generation is planned for a future version of Xsitecopy. Permissions mode, can be one of Ignore All, Executables Only, or Maintain For All. These options force XSitecopy to either ignore permissions of uploaded files, maintain them for files with the execute bit set locally, or ensure ALL remote files have the same permission bits as the local site, respectively. Symbolic links, can be treated in various ways. `Follow all' will tell XSitecopy to upload the file (or directory?) that any symbolic links point to. `Ignore links' tells XSitecopy not to care if it encounters a symbolic link on the local site. `Maintain all' will attempt to create symbolic links on the remote site, if this is supported by the selected protocol. Update Options Delete a file from the server if it is deleted locally. If this is not checked, then any local files that are deleted will be forgotten about. Selecting this option will force sitecopy to delete anything that is deleted on the local copy of the remote site. Move a remote file if it is moved locally. When not checked, sitecopy will not bother to check if a file has been moved locally, when it appears to be deleted. If you wish all local file moves to be mirrored on the remote site, ensure this option is checked. When uploading changed files, first delete them Convert all filenames to lowercase when uploading Use "safe mode" Use passive mode FTP, should only be unchecked if you actually know you want it unchecked. When uploading changed files, first delete them. This option should not be checked by default. If you find that your FTP server has trouble dealing with over-writing files, then this option will force sitecopy to first delete a changed file remotely, before uploading the newer local copy. Excludes, ASCII, and Ignores Chances are that while you're editing html locally, things like backup files will get created. While useful, it's likely you don't want them uploaded to your remote web site. The excludes section allows you to specify glob patterns (see the fnmatch(3) and glob(7) man pages). Any files on the local site matching these expressions will be ignored by XSitecopy. For example my excludes consist of: *.bak core oldweb because I don't want any backups or core dumps uploaded. I also have a sub-directory on my local site called 'oldweb' which I keep for nostalgic purposes only. This is not uploaded by specifying it as 'an exclude'. Files & Directories Existing Files FIXME: Add a list of the types here, added, changed, unchanged. Deleted Files Deleted files appear in a site's file tree because they represent an operation that Xsitecopy must still perform when doing an update. However, given that these files don't exist, the only information Xsitecopy can report is just that. The Menus File New This will start the site creation wizard. This wizard will take you through the step-by-step process required to give XSitecopy details about a website you wish to upload using XSitecopy. When you click "apply" the program may appear to freeze over for a number of seconds (or longer on large sites). This is currently normal, while XSitecopy processes the local files for the new site. Open Prompts you for the filename of a valid sitecopy configuration file. (rc file). If you specify a valid one, the sites that the file defines will be loaded into XSitecopy. Save sites Saves your site definitions file to the default configuration file. Save sites As... Will prompt you for a filename, and then save your site definitions to the file given. Delete this site Asks for confirmation as to whether you wish to delete the selected site or not. If you do, it will. Quit Select this to exit the program. If your site definitions have not been saved, you will be prompted to save them. Operations A site can be initialised, caught-up, updated, a listing can be fetched, or it can be resynchronized, with the remote site. Initialise site This will make xsitecopy think that there are no files on the remote site. This should be used to upload new files, or if you decide to change remote servers. Catchup site This will force xsitecopy to assume that the remote site is identical to your local copy. Useful for starting new sites that are already online, or if you accidentally initialise a site. Fetch site listing This will make xsitecopy connect to the remote site and attempt to determine what files are there. This is useful if your configuration files have become corrupted, and your local-remote sites are in an inconsistent state. It is also required if you wish to perform a resynchronization on your local site. Resynchronize site Expected by 0.11.0. Update site This will produce a dialog box. Once you are ready to connect to the remote site, hit Begin and xsitecopy will attempt to make a connection. Once one has been established, the operations required to synchronize the remote site with the local one will be committed. Progress indicators display the percentage completed of each operation. Update ALL sites This will perform the above updates, for every site that requires one. Expected by 0.13.0. Reports Required updates This displays a short report (depending upon how many sites you have defined), simply stating which sites require an update. Site web-report This creates a report of all modifications of the selected site, and displays them in your web browser. The browser use depends entirely upon how your gnome-url settings have been configured. (see gnome control-center for more info). NOTE:- This feature is currently a complete hack that requires about 5 things all of which are not likely to hold on a system different to my own. A wide range of report options will be created as soon as sitecopy has reached a 1.0 state. Print site info Not currently implemented. Settings Preferences This allows you to set various things. Or at least it will do as soon as I write it. :o) Backup Backup files status The state of your files on the remote site is actually stored in a file on the local hard drive. If this file was to become corrupted, then the state would normally have to be initialized, or "caught up". This gives you an alternate option. Restore files status If you have a made a backup of your files' state information, this gives you the option to restore it. Backup site definitions Saves a backup of your 'rcfile' - the file XSitecopy uses to store the site definitions. Restore site definitions If you have previously backed up your site configurations, this will restore them. Help About Short dialog about the program. XSitecopy Manual Should bring up this online manual. Troubleshooting Do NOT run xsitecopy as root. My experience has shown that for some reason all the sanity tests that determine (for example) whether a site is selected when you click certain buttons, just fail inexplicably. Once a new site has been created, the site's "statistics" seem to occasionally be wrong. Restarting the program seems to correct that. I *think* this is now fixed, but if you still encounter the problem, please let me know. Todo More, cleaner methods of reporting changes to sites. Re-synchronize mode. Preferences dialog. Output of reports to printers. (use of gnome-print perhaps). Clean up some of the saved-notsaved code. Gnome panel applet for one-click updates. Feel free to email me at lee0@callnetuk.com with any feature requests. Known Bugs Switching between time-size and checksum for change-detection is a bit dodgy at the moment. Occasional crashes are seen every so often when rescanning. These could be random memory corruption, but seem to have gone away recently. sitecopy-0.16.6/gnome/doc/c28.html0000664000076400007640000000551611037462355014742 0ustar joejoe Usage

Usage

Once installed, you should find a shortcut to XSitecopy in the Internet section of your gnome system menu. If you are not running GNOME as your desktop environment, simply type xsitecopy into an xterm.

Quick-Start

If you've never used sitecopy before, you should take a look at the README file that comes with the sitecopy distribution. When you run xsitecopy for the first time, it will set up 2 things in your home directory; a configuration file where your site definitions are stored ($HOME/.sitecopyrc), and a storage directory where it will place configuration files to keep track of the files you add, change, move or delete on the local copies of your websites. ($HOME/.sitecopy/) To create sites, click New site . A Gnome Druid will appear to guide you through the creation process. You must type a name for the site, along with server details and local & remote directory names. All other options may be left at their default values, or configured to your personal taste.

sitecopy-0.16.6/gnome/doc/c35.html0000664000076400007640000000432711037462355014737 0ustar joejoe Creating a site

Creating a site

To guide you through the process of creating a site, a step-by-step Druid is provided. At each stage of the druid, the information required is explained. Almost all of the information is optional and can be edited or added at a later date. If you miss out a field that is mandatory for site creation, a dialog will pop up to warn you.

We'll now take a look at the various steps of the site creation druid. FIXME. Add lots of nice screenshots, and a commentary.

sitecopy-0.16.6/gnome/doc/c243.html0000664000076400007640000000354711037462356015024 0ustar joejoe Known Bugs

Known Bugs

  • Switching between time-size and checksum for change-detection is a bit dodgy at the moment.

  • Occasional crashes are seen every so often when rescanning. These could be random memory corruption, but seem to have gone away recently.

sitecopy-0.16.6/gnome/doc/x70.html0000664000076400007640000000675311037462355014770 0ustar joejoe Locations & Files

Locations & Files

  • Directory for local files, is an absolute path in your file system. It should be the root directory of your website that resides on your filesystem.

  • Directory for remote files, is the directory that all files will be uploaded into. It must exist on the remote site for a successful update to be completed. The directory must either have a / prefix if it is an absolute path, or a \~/ prefix if it is relative to your remote login directory.

  • Root URL of the remote site, is a non-essential field, that can be used to generate a "recent changes" web page using the console application, sitecopy, and a provided awk script. Support for report generation is planned for a future version of Xsitecopy.

  • Permissions mode, can be one of Ignore All, Executables Only, or Maintain For All. These options force XSitecopy to either ignore permissions of uploaded files, maintain them for files with the execute bit set locally, or ensure ALL remote files have the same permission bits as the local site, respectively.

  • Symbolic links, can be treated in various ways. `Follow all' will tell XSitecopy to upload the file (or directory?) that any symbolic links point to. `Ignore links' tells XSitecopy not to care if it encounters a symbolic link on the local site. `Maintain all' will attempt to create symbolic links on the remote site, if this is supported by the selected protocol.

sitecopy-0.16.6/gnome/doc/x214.html0000664000076400007640000000411711037462356015041 0ustar joejoe Help

Help

About

Short dialog about the program.

XSitecopy Manual

Should bring up this online manual.

sitecopy-0.16.6/gnome/doc/c138.html0000664000076400007640000000641211037462356015021 0ustar joejoe The Menus

The Menus

File

New

This will start the site creation wizard. This wizard will take you through the step-by-step process required to give XSitecopy details about a website you wish to upload using XSitecopy. When you click "apply" the program may appear to freeze over for a number of seconds (or longer on large sites). This is currently normal, while XSitecopy processes the local files for the new site.

Open

Prompts you for the filename of a valid sitecopy configuration file. (rc file). If you specify a valid one, the sites that the file defines will be loaded into XSitecopy.

Save sites

Saves your site definitions file to the default configuration file.

Save sites As...

Will prompt you for a filename, and then save your site definitions to the file given.

Delete this site

Asks for confirmation as to whether you wish to delete the selected site or not. If you do, it will.

Quit

Select this to exit the program. If your site definitions have not been saved, you will be prompted to save them.

sitecopy-0.16.6/gnome/doc/c12.html0000664000076400007640000000526211037462355014731 0ustar joejoe Installation

Installation

To compile from the source distribution, change into the source directory and run:

./configure --enable-gnomefe
make
make install (become root first)

To install from a binary rpm, change directory to the location of your freshly downloaded rpm and type the following, (substituting i386 for whatever architecture you are running on, and VERSION for the version you've acquired):

rpm -iv xsitecopy-VERSION-1.i386.rpm

To rebuild a binary rpm from a source rpm, do the following: rpm --rebuild sitecopy-VERSION-1.src.rpm

This will place a binary rpm in /usr/src/redhat/RPMS/i386/ which can be installed as above.

sitecopy-0.16.6/gnome/doc/c39.html0000664000076400007640000000460011037462355014735 0ustar joejoe The Main Interface

The Main Interface

At the top is the menu. Below this is the toolbar. Both of these are used to perform operations on sites, and/or retrieve more general information.

Below these bars is the main part of Xsitecopy's user interface. As is obvious from glancing at it, the UI is split into 2 main sections. On the left is a tree view with a tree node for each of the sites that Xsitecopy knows about.

If you expand a site, the files and directories that it is aware of will be shown in a similar manner to the gnome file manager, gmc. Clicking on a file or directory brings up information about that file in the right side of the window.

sitecopy-0.16.6/gnome/doc/x91.html0000664000076400007640000000636411037462355014771 0ustar joejoe Update Options

Update Options

  • Delete a file from the server if it is deleted locally. If this is not checked, then any local files that are deleted will be forgotten about. Selecting this option will force sitecopy to delete anything that is deleted on the local copy of the remote site.

  • Move a remote file if it is moved locally. When not checked, sitecopy will not bother to check if a file has been moved locally, when it appears to be deleted. If you wish all local file moves to be mirrored on the remote site, ensure this option is checked.

  • When uploading changed files, first delete them

  • Convert all filenames to lowercase when uploading

  • Use "safe mode"

  • Use passive mode FTP, should only be unchecked if you actually know you want it unchecked.

  • When uploading changed files, first delete them. This option should not be checked by default. If you find that your FTP server has trouble dealing with over-writing files, then this option will force sitecopy to first delete a changed file remotely, before uploading the newer local copy.

sitecopy-0.16.6/gnome/doc/book1.html0000664000076400007640000000753211037462356015362 0ustar joejoe XSitecopysitecopy-0.16.6/gnome/doc/c130.html0000664000076400007640000000373511037462355015015 0ustar joejoe Files & Directories

Files & Directories

Existing Files

FIXME: Add a list of the types here, added, changed, unchanged.

sitecopy-0.16.6/gnome/doc/x183.html0000664000076400007640000000536011037462356015047 0ustar joejoe Reports

Reports

Required updates

This displays a short report (depending upon how many sites you have defined), simply stating which sites require an update.

Site web-report

This creates a report of all modifications of the selected site, and displays them in your web browser. The browser use depends entirely upon how your gnome-url settings have been configured. (see gnome control-center for more info).

NOTE:- This feature is currently a complete hack that requires about 5 things all of which are not likely to hold on a system different to my own. A wide range of report options will be created as soon as sitecopy has reached a 1.0 state.

Print site info

Not currently implemented.

sitecopy-0.16.6/gnome/doc/c44.html0000664000076400007640000000662411037462355014741 0ustar joejoe Sites

Sites

If you click on a site, the details and attributes of that site will be displayed in the main area of the program. These are divided into what are hopefully logical sections. Each section is separated by a frame, described below.

Basic Details

  • Hostname is the name of your remote web server. For example, ftp.geocities.com.

  • Port specifies the port that should be connected to on the remote server. Unless you know you need to change this, it should be safe to simply use the default value setup by your chosen protocol.

  • Protocol determines the method that sitecopy uses to transfer your files. This is totally dependant upon whether or not you would normally upload files to your website using FTP, or whether you are using a WebDAV server. You should choose the protocol accordingly. Note:- If xsitecopy has been compiled without WebDAV support, FTP will be the only option here.

  • Username is the name you normally use to login when uploading files. If this is incorrect, you will receive errors when trying to upload your files.

  • Password is the password required in order to login to the remote server. This will appear as asterisks on the screen.

  • Site Statistics provides a short summary of the changes (if any) to the local site, since the last update was performed.

sitecopy-0.16.6/gnome/doc/x160.html0000664000076400007640000000724311037462355015043 0ustar joejoe Operations

Operations

A site can be initialised, caught-up, updated, a listing can be fetched, or it can be resynchronized, with the remote site.

Initialise site

This will make xsitecopy think that there are no files on the remote site. This should be used to upload new files, or if you decide to change remote servers.

Catchup site

This will force xsitecopy to assume that the remote site is identical to your local copy. Useful for starting new sites that are already online, or if you accidentally initialise a site.

Fetch site listing

This will make xsitecopy connect to the remote site and attempt to determine what files are there. This is useful if your configuration files have become corrupted, and your local-remote sites are in an inconsistent state. It is also required if you wish to perform a resynchronization on your local site.

Resynchronize site

Expected by 0.11.0.

Update site

This will produce a dialog box. Once you are ready to connect to the remote site, hit Begin and xsitecopy will attempt to make a connection. Once one has been established, the operations required to synchronize the remote site with the local one will be committed. Progress indicators display the percentage completed of each operation.

Update ALL sites

This will perform the above updates, for every site that requires one. Expected by 0.13.0.

sitecopy-0.16.6/gnome/doc/c227.html0000664000076400007640000000426211037462356015021 0ustar joejoe Todo

Todo

  • More, cleaner methods of reporting changes to sites.

  • Re-synchronize mode.

  • Preferences dialog.

  • Output of reports to printers. (use of gnome-print perhaps).

  • Clean up some of the saved-notsaved code.

  • Gnome panel applet for one-click updates.

Feel free to email me at lee0@callnetuk.com with any feature requests.

sitecopy-0.16.6/gnome/doc/c222.html0000664000076400007640000000427511037462356015020 0ustar joejoe Troubleshooting

Troubleshooting

Do NOT run xsitecopy as root. My experience has shown that for some reason all the sanity tests that determine (for example) whether a site is selected when you click certain buttons, just fail inexplicably.

Once a new site has been created, the site's "statistics" seem to occasionally be wrong. Restarting the program seems to correct that. I *think* this is now fixed, but if you still encounter the problem, please let me know.

sitecopy-0.16.6/gnome/tree.c0000664000076400007640000004447210232743237014017 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ #include "tree.h" /* The app's main CTree */ GtkCTree *the_tree; extern GList *errors; GtkCTreeNode *site_item, *file_item; extern struct site *selected_site; extern GtkCTreeNode *current_site_node; void color_site_node(GtkCTreeNode * node, struct site *site) { /* Implement this once you can auto generate code for a prefs dialog * to make it configurable. if (site->is_different) { gtk_ctree_node_set_foreground (the_tree, node, color); }*/ } /* Generates a GtkCTreeNode from a_file and adds it to parent */ GtkCTreeNode *add_file(char *name, struct site_file *a_file, GtkCTreeNode * parent) { /* External icons */ /* dir is closed, dir2 is open */ extern GdkPixmap *dir, *dir_new, *dir_changed, *dir_del; extern GdkPixmap *dir2, *dir2_new, *dir2_changed, *dir2_del; extern GdkPixmap *xsitecopy_file, *xsitecopy_file_new, *xsitecopy_file_changed, *xsitecopy_file_del, *xsitecopy_file_moved; extern GdkPixmap *symbolic_link, *symbolic_link_new, *symbolic_link_changed, *symbolic_link_del; /* Bitmaps */ extern GdkBitmap *dir_map, *dir_new_map, *dir_changed_map, *dir_del_map; extern GdkBitmap *dir2_map, *dir2_new_map, *dir2_changed_map, *dir2_del_map; extern GdkBitmap *xsitecopy_file_map, *xsitecopy_file_new_map, *xsitecopy_file_changed_map, *xsitecopy_file_del_map, *xsitecopy_file_moved_map; extern GdkBitmap *symbolic_link_map, *symbolic_link_new_map, *symbolic_link_changed_map, *symbolic_link_del_map; GtkCTreeNode *file_im_adding; struct ctree_attachment *file_info_to_add; gchar *node_label[1]; GdkPixmap *image, *image2 = NULL; GdkBitmap *mask, *mask2 = NULL; file_info_to_add = g_malloc0(sizeof(struct ctree_attachment)); file_info_to_add->file_or_site = IS_A_FILE; /* Pointer to this file */ file_info_to_add->info_struct = (gpointer) a_file; /* Check if this file is a symbolic_link or directory */ if (a_file->type == file_link) { if (a_file->diff != file_unchanged) { if (a_file->diff == file_changed) { image = symbolic_link_changed; mask = symbolic_link_changed_map; } else if (a_file->diff == file_deleted) { image = symbolic_link_del; mask = symbolic_link_del_map; } else { image = symbolic_link_new; mask = symbolic_link_new_map; } } else { image = symbolic_link; mask = symbolic_link_map; } } /* Check if it's actually a directory */ else if (a_file->type == file_dir) { if (a_file->diff != file_unchanged) { if (a_file->diff == file_changed) { image = dir_changed; mask = dir_changed_map; image2 = dir2_changed; mask2 = dir2_changed_map; } else if (a_file->diff == file_deleted) { image = dir_del; mask = dir_del_map; image2 = dir2_del; mask2 = dir2_del_map; } else { image = dir_new; mask = dir_new_map; image2 = dir2_new; mask2 = dir2_new_map; } } else { image = dir; mask = dir_map; image2 = dir2; mask2 = dir2_map; } } else { /* Set the image of this new file depending upon file status */ if (a_file->diff != file_unchanged) { if (a_file->diff == file_changed) { image = xsitecopy_file_changed; mask = xsitecopy_file_changed_map; } else if (a_file->diff == file_deleted) { image = xsitecopy_file_del; mask = xsitecopy_file_del_map; } else if (a_file->diff == file_moved) { image = xsitecopy_file_moved; mask = xsitecopy_file_moved_map; } else { image = xsitecopy_file_new; mask = xsitecopy_file_new_map; } } else { image = xsitecopy_file; mask = xsitecopy_file_map; } } /* Set the node's text label accordingly */ node_label[0] = name; /* Add the node */ file_im_adding = gtk_ctree_insert_node(GTK_CTREE(the_tree), GTK_CTREE_NODE(parent), NULL, node_label, 3, image, mask, a_file->type == file_dir ? image2 : image, a_file->type == file_dir ? mask2 : mask, FALSE, FALSE); gtk_ctree_node_set_row_data(GTK_CTREE(the_tree), file_im_adding, (gpointer) file_info_to_add); return file_im_adding; } /* Generates a string to use for a site on the main ctree, given * user preferences. */ gchar *getAppropriateTreeLabel(struct site *a_site) { gchar *tmp; extern struct xsitecopy_prefs *main_prefs; switch (main_prefs->label) { case local_dir: tmp = g_strdup_printf("%s (%s)", a_site->name, a_site->local_root_user ? a_site->local_root_user : "No local directory!"); break; case remote_dir: tmp = g_strdup_printf("%s (%s)", a_site->name, a_site->remote_root_user ? a_site->remote_root_user : "No remote dir"); break; case remote_host: tmp = g_strdup_printf("%s (%s)", a_site->name, a_site->server.hostname ? a_site->server.hostname : "No hostname found"); break; case url: tmp = g_strdup_printf("%s (%s)", a_site->name, a_site->url ? a_site->url : "No URL"); break; default: tmp = g_strdup_printf("%s", a_site->name); break; } return tmp; } /* Creates a new tree node given a_site. Adds it with label, and populates * the node with the relevant file info. * operation determines the following: * * 0: nothing extra happens * 1: the site is initialised as it is added * 2: the site is caught-up as it is added * 3: the site is added but the readfiles is not called * * Mode 3 is not useless. It is used when the local directory can not be read * but the site should still appear in the main tree. */ int add_a_site_to_the_tree(struct site *a_site, gint operation) { struct ctree_attachment *info_to_add; gchar *tmp, *node_label[1]; tmp = getAppropriateTreeLabel(a_site); node_label[0] = tmp; site_item = gtk_ctree_insert_node(GTK_CTREE(the_tree), NULL, NULL, node_label, 0, NULL, NULL, NULL, NULL, FALSE, FALSE); g_free (tmp); info_to_add = malloc(sizeof(struct ctree_attachment)); info_to_add->file_or_site = IS_A_SITE; info_to_add->info_struct = (void *) a_site; gtk_ctree_node_set_row_data(GTK_CTREE(the_tree), site_item, (gpointer) info_to_add); /* Read site info */ if (site_readfiles(a_site) != SITE_OK) /* We effectively have no info file, so just read the stored state. */ site_read_local_state(a_site); /* Catchup or init, if that's required */ if (operation == 1) { site_initialize(a_site); printf("Initialised site\n"); } else if (operation == 2) { site_catchup(a_site); printf("Caught-up new site.\n"); } /* As far as I can tell, this doesn't need to be done. * Not sure why it's in here*/ site_write_stored_state(a_site); if (operation != 3) { gtk_clist_freeze(GTK_CLIST(the_tree)); populate_site_node(GTK_CTREE_NODE(site_item), a_site); gtk_clist_thaw(GTK_CLIST(the_tree)); } return 0; } /* Reads all_sites and creates a tree from that list */ void fill_tree_from_all_sites(GtkWidget * a_ctree) { struct site *current; int ret; for (current = all_sites; current != NULL; current = current->next) { /* Add any errors with the site to the errors list, so that we can * present the user with all the errors, rather than popping lots of * dialogs on screen at once. */ g_assert(current!=NULL); ret = check_site_and_record_errors(current); if ((ret == SITE_NOLOCALDIR) || (ret == SITE_ACCESSLOCALDIR)) { /* Add a site without scanning the (problematic) local directory */ add_a_site_to_the_tree(current, 3); } else { add_a_site_to_the_tree(current, 0); } } } void core_tree_building_function(struct site_file *a_file, GNode * tree) { gchar **comps; gchar *leaf; int i = 0; GNode *branch = NULL; struct site_node_data *leaf_node = g_malloc0(sizeof(struct site_node_data)); /* Tokenize the directory name */ NE_DEBUG(DEBUG_GNOME, "Componentizing %s.\n", file_name(a_file)); comps = g_strsplit(file_name(a_file), "/", -1); leaf = (char *) base_name(file_name(a_file)); /* Rather than chopping off the filename when we tokenize the * directory, it's easier to just ignore the last element of * the resulting array, thus. */ branch = tree; while (comps[i + 1] != NULL) { char *component = comps[i]; GNode *tmp2; for (tmp2 = g_node_first_child(branch); tmp2; tmp2 = tmp2->next) { /* Get the name from the GNode we're looking at. */ char *tmp_name; tmp_name = ((struct site_node_data *) tmp2->data)->name; /* Check if it's the one we're looking for */ NE_DEBUG(DEBUG_GNOME, "Comparing %s with %s.\n", component, tmp_name); if (strcmp(component, tmp_name) == 0) { branch = tmp2; break; } } if (!branch) { NE_DEBUG(DEBUG_GNOME, "Branch became NULL. Oh dear.\n"); break; } i++; } /* Initialise a new data struct, and make it a child of whatever * branch is pointing to. */ leaf_node->name = leaf; leaf_node->file = a_file; g_node_append_data(branch, leaf_node); } GNode *build_tree_from_site(struct site *a_site) { GNode *tree_root; struct site_node_data *tmp; struct site_file *current_dir, *current_file; NE_DEBUG(DEBUG_GNOME, "Called build_tree_from_site for site, %s.\n", a_site->name); /* If this site isn't perfect, then don't try and scan the directory. */ /*{ int ret = rc_verifysite(a_site); if ((ret == SITE_NOLOCALDIR) || (ret == SITE_ACCESSLOCALDIR)) return NULL; }*/ tmp = g_malloc0(sizeof(struct site_node_data)); tmp->name = "ROOT"; /* Create the root node. */ tree_root = g_node_new(tmp); /* For each dir in site->files, blah... */ NE_DEBUG(DEBUG_GNOME, "Created root node, about to enter directory loop...\n"); /* This is not very time efficient, but I'm not the one that dictates the * ordering of files/directories, so don't blame me. * What we do here is create all the directory nodes first (and the * directory nodes _only_), and then add the files once the dirs are known * to be in place. */ for (current_dir = a_site->files_tail; (current_dir) && (current_dir->type == file_dir); current_dir = current_dir->prev) ; /* There! SPLAT! Got you, you little bastard of a bug. */ /* if (!current_dir) return tree_root;*/ if (current_dir) { for (current_dir = current_dir->next; current_dir; current_dir = current_dir->next) { core_tree_building_function(current_dir, tree_root); } } for (current_file = a_site->files; (current_file) && (current_file->type != file_dir); current_file = current_file->next) { core_tree_building_function(current_file, tree_root); } /* FIXME: do files here somehow? */ return tree_root; } /** Takes a root GNode and populates the * GUI component a_node from it. * @param root The file hierarchy that has been built using * build_tree_from_site(). * @param a_node The CTree node for the site these files are a part of. */ #define name(node) (((struct site_node_data *)node->data)->name) #define file(node) (((struct site_node_data *)node->data)->file) void gnode_to_gui(GNode * root, GtkCTreeNode * a_node) { GNode *tmp; GtkCTreeNode *new_node; NE_DEBUG(DEBUG_GNOME, "Building GUI tree from GNode hierarchy... \n"); if (!root) return; tmp = g_node_first_child(root); while (tmp) { new_node = add_file(name(tmp), file(tmp), a_node); gnode_to_gui(tmp, new_node); tmp = g_node_next_sibling(tmp); } gnode_to_gui(tmp, a_node); } void populate_site_node(GtkCTreeNode * site_node, struct site *current) { GNode *tree_structure; /* NE_DEBUG (DEBUG_GNOME, "*********Dumping file types***********\n"); dump_types(current); NE_DEBUG (DEBUG_GNOME, "*********End of dump***********\n"); */ /* Output file info into a tree */ tree_structure = build_tree_from_site(current); /* NE_DEBUG (DEBUG_GNOME, "********Dumping tree structure*********\n"); dump_g_node(tree_structure); NE_DEBUG (DEBUG_GNOME, "********End of Tree Dump*********\n"); */ /* Turn the newly generated tree into a GUI equivalent. */ gnode_to_gui(tree_structure, site_node); /* Colour the site node as required */ color_site_node(GTK_CTREE_NODE(site_node), current); } /** Selection callback **/ void select_ctree_cb(GtkCTree * ctree, GtkCTreeNode * node, gpointer data) { GtkCTreeNode *parent; struct site *current_site; struct site_file *current_file; void *data_to_get; struct ctree_attachment *actual_data; extern GtkWidget *main_area_box, *area_data; /* Make sure that any changes have been confirmed on the selected site, * before selected_site gets changed. This seems to get automatically done * by the signal handler. */ if (GTK_CTREE_ROW(node)->parent == NULL) { /* We're at the top level */ if ((data_to_get = gtk_ctree_node_get_row_data(GTK_CTREE(ctree), GTK_CTREE_NODE(node))) == NULL) { NE_DEBUG(DEBUG_GNOME, "\"Data get\" returned NULL. Oh dear.\n"); } actual_data = (struct ctree_attachment *) data_to_get; if (actual_data->file_or_site != IS_A_SITE) NE_DEBUG(DEBUG_GNOME, "Somehow you've clicked on a site, but ended up with file data!\n"); current_site = (struct site *) actual_data->info_struct; /* Make the data shared */ selected_site = current_site; current_site_node = node; NE_DEBUG (DEBUG_GNOME, "Removing widgets from main data area...\n"); gtk_container_remove(GTK_CONTAINER(main_area_box), area_data); NE_DEBUG (DEBUG_GNOME, "Building site info widgets...\n"); area_data = make_site_info_area(current_site); NE_DEBUG (DEBUG_GNOME, "Adding widgets to main data area..."); gtk_container_add(GTK_CONTAINER(main_area_box), area_data); NE_DEBUG (DEBUG_GNOME, "done.\n"); } else if (GTK_CTREE_ROW(node)->parent != NULL) { parent = GTK_CTREE_ROW(node)->parent; /* Grab the file data from that row */ if ((data_to_get = gtk_ctree_node_get_row_data(GTK_CTREE(ctree), GTK_CTREE_NODE(node))) == NULL) { NE_DEBUG(DEBUG_GNOME, "\"Data get\" for the file returned NULL. Oh dear.\n"); } actual_data = (struct ctree_attachment *) data_to_get; if (actual_data->file_or_site != IS_A_FILE) NE_DEBUG(DEBUG_GNOME, "Somehow you've clicked on a file, but ended up with site data!\n"); current_file = (struct site_file *) actual_data->info_struct; /* Grab the site data from the file's parent */ while (GTK_CTREE_ROW(parent)->parent != NULL) { parent = GTK_CTREE_ROW(parent)->parent; NE_DEBUG(DEBUG_GNOME, "Assigned parent to node->parent.\n"); } if ((data_to_get = gtk_ctree_node_get_row_data(GTK_CTREE(ctree), GTK_CTREE_NODE(parent))) == NULL) { NE_DEBUG(DEBUG_GNOME, "\"Data get\" for the file's parent returned NULL. Oh dear.\n"); } actual_data = (struct ctree_attachment *) data_to_get; if (actual_data->file_or_site != IS_A_SITE) NE_DEBUG(DEBUG_GNOME, "Somehow you've clicked on a file, but it's parent was a file too!?\n"); current_site = (struct site *) actual_data->info_struct; selected_site = current_site; current_site_node = parent; if (current_file == NULL) { gfe_status("Unable to access info about the selected file."); } else { /* This line is causing a mutex to deadlock. why....? */ NE_DEBUG (DEBUG_GNOME, "Removing widgets from main data area...\n"); gtk_container_remove(GTK_CONTAINER(main_area_box), area_data); NE_DEBUG (DEBUG_GNOME, "Making file info area...\n"); area_data = make_file_info_area(current_file); NE_DEBUG (DEBUG_GNOME, "Adding file info area to main area..."); gtk_container_add(GTK_CONTAINER(main_area_box), area_data); NE_DEBUG (DEBUG_GNOME, "done.\n"); } } else { g_warning("If you got to here, something is really buggered, quite frankly.\n"); } } /** Does the equivalent of what refresh_selected used to do; * looks at each file in a site and rebuilds the tree accordingly. */ void rebuild_node_files(GtkCTreeNode * site_node) { /* Get rid of all the files first */ while (GTK_CTREE_ROW(site_node)->children) { gtk_ctree_remove_node(GTK_CTREE(the_tree), GTK_CTREE_NODE(GTK_CTREE_ROW(site_node)->children)); } NE_DEBUG(DEBUG_GNOME, "Removed all children, freezing CTree...\n"); gtk_clist_freeze(GTK_CLIST(the_tree)); populate_site_node(site_node, selected_site); gtk_clist_thaw(GTK_CLIST(the_tree)); NE_DEBUG(DEBUG_GNOME, "Repopulation complete, CTree thawed.\n"); } /**** Debugging stuff ****/ void dump_types(struct site *a_site) { struct site_file *tmp = NULL; for (tmp = a_site->files; tmp; tmp = tmp->next) { printf("%s is of type, %s.\n", tmp->local.filename, (tmp->type == file_dir) ? "directory" : ((tmp->type == file_file) ? "file" : "link")); } } void dump_g_node(GNode * tree) { struct site_node_data *tmp; GNode *tmp2 = tree; GNode *tmp3; while (tmp2) { tmp = tmp2->data; printf("%s has siblings:\n", tmp->name); tmp3 = tmp2; for (; g_node_next_sibling(tmp3); tmp3 = tmp3->next) { printf(" %s ", ((struct site_node_data *) tmp3->data)->name); } printf("\n"); tmp2 = g_node_first_child(tmp2); } } sitecopy-0.16.6/gnome/misc.c0000664000076400007640000006352410237450450014007 0ustar joejoe /* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 1999, Lee Mallabone * * 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. * */ #include "misc.h" int generate_pixmaps(void); extern struct site *all_sites; gboolean rcfile_saved = TRUE; extern char *copypath, *rcfile; /* Global widgets */ extern GtkWidget *main_area_box, *area_data, *the_tree; GtkWidget *error_log_list, *error_log_window; struct site *selected_site; GtkCTreeNode *current_site_node; extern struct proto_driver ftp_driver; #ifdef USE_DAV extern struct proto_driver dav_driver; #endif GList *errors; /************************************************************************/ /* Copies selected_site's infofile to infofile.bak */ void backup_infofile(void) { gchar *backup_name; int ret; if (!selected_site) { gfe_status("No site selected. Cannot backup anything."); return; } backup_name = malloc(BUFSIZ); strcpy(backup_name, selected_site->infofile); strcat(backup_name, ".bak"); NE_DEBUG(DEBUG_GNOME, "selected infofile is %s\n", selected_site->infofile); ret = copy_a_file(selected_site->infofile, backup_name); free(backup_name); switch (ret) { case 1: gfe_status("Could not open infofile"); break; case 2: gfe_status("Could not write backup file"); break; case 0: gfe_status("The state of your files has been backed up.\nIt may be restored at a later date from the backup menu."); break; default: gfe_status("Something is probably broken here."); } } void backup_rcfile(void) { gchar *rcbackup; gint ret; rcbackup = malloc(BUFSIZ); strcpy(rcbackup, rcfile); strcat(rcbackup, ".bak"); ret = copy_a_file(rcfile, rcbackup); free(rcbackup); switch (ret) { case 1: gfe_status("Could not open the rcfile. That is not good."); break; case 2: gfe_status("Could not create backup file."); break; case 0: gfe_status("The details of your sites have been backed up."); break; default: break; } } void restore_rcfile(void) { struct stat *backup_file; gchar *question, *backup_name; backup_name = malloc(BUFSIZ); strcpy(backup_name, rcfile); strcat(backup_name, ".bak"); backup_file = malloc(sizeof(struct stat)); if (stat(backup_name, backup_file) == -1) { gfe_status("Could not find backup rcfile. Site configurations not restored."); free(backup_name); free(backup_file); return; } question = malloc(BUFSIZ); sprintf(question, "The last backup of your rcfile was modified on %s.\nAre you sure you wish to restore the site details from that date?", ctime(&(backup_file->st_ctime))); fe_gtk_question(question, (GnomeReplyCallback) restore_rc); free(question); free(backup_name); free(backup_file); } void restore_rc(gint button_number) { gint ret; gchar *rcfile_backup; if (button_number == GNOME_YES) { rcfile_backup = malloc(strlen(rcfile) + 5); strcpy(rcfile_backup, rcfile); strcat(rcfile_backup, ".bak"); ret = copy_a_file(rcfile_backup, rcfile); switch (ret) { case 1: gfe_status("Could not open a backup"); break; case 2: gfe_status("Could not write to your rcfile"); break; case 0: gfe_status("Backup restored. Currently you will need to restart XSitecopy now."); break; default: printf("there was a problem restoring.\n"); break; } free(rcfile_backup); } } int copy_a_file(gchar * input_name, gchar * output_name) { FILE *input, *output; gchar *buffer; if ((input = fopen(input_name, "r")) == NULL) { return 1; } else if ((output = fopen(output_name, "w")) == NULL) { return 2; } else { buffer = malloc(BUFSIZ); while (fgets(buffer, BUFSIZ, input) != NULL) { fputs(buffer, output); memset(buffer, 0, BUFSIZ); } free(buffer); fclose(input); fclose(output); return 0; } } void restore_infofile(void) { struct stat *backup_file; gchar *question, *backup_name; if (!selected_site) { gfe_status("You must select a site to restore information about."); return; } backup_name = malloc(BUFSIZ); strcpy(backup_name, selected_site->infofile); strcat(backup_name, ".bak"); backup_file = malloc(sizeof(struct stat)); NE_DEBUG(DEBUG_GNOME, "backup is %s\n", strcat(selected_site->infofile, ".bak")); if (stat(backup_name, backup_file) == -1) { gfe_status("Could not find backup info file. File state not restored."); free(backup_name); free(backup_file); return; } question = malloc(BUFSIZ); sprintf(question, "The last backup of your files' state was modified on %s.\nAre you sure you wish to restore the file states from that date?", ctime(&(backup_file->st_ctime))); fe_gtk_question(question, (GnomeReplyCallback) actual_restoration); free(question); free(backup_name); free(backup_file); } void actual_restoration(gint button_number) { gint ret; gchar *backup_name; if (button_number == 0) { backup_name = malloc(BUFSIZ); strcpy(backup_name, selected_site->infofile); strcat(backup_name, ".bak"); ret = copy_a_file(backup_name, selected_site->infofile); switch (ret) { case 1: gfe_status("Could not open the backup."); break; case 2: gfe_status("Could not open the infofile."); break; case 0: gfe_status("Backup restored."); rescan_selected(1); break; default: break; } free(backup_name); } } /* If mode is 0, the buttons will be save, quit, cancel. * otherwise just quit & cancel. */ GtkWidget *create_quit_save_question(const char *question, int mode) { GtkWidget *quit_save_question; GtkWidget *dialog_vbox6; GtkWidget *button12; GtkWidget *button13; GtkWidget *button14; GtkWidget *dialog_action_area6; quit_save_question = gnome_message_box_new(question, GNOME_MESSAGE_BOX_INFO, NULL); gtk_window_set_policy(GTK_WINDOW(quit_save_question), FALSE, FALSE, FALSE); gnome_dialog_set_close(GNOME_DIALOG(quit_save_question), TRUE); dialog_vbox6 = GNOME_DIALOG(quit_save_question)->vbox; gtk_widget_show(dialog_vbox6); if (!mode) { gnome_dialog_append_button_with_pixmap(GNOME_DIALOG(quit_save_question), "Save then quit", GNOME_STOCK_PIXMAP_SAVE_AS); button12 = g_list_last(GNOME_DIALOG(quit_save_question)->buttons)->data; gtk_widget_show(button12); GTK_WIDGET_SET_FLAGS(button12, GTK_CAN_DEFAULT); } gnome_dialog_append_button_with_pixmap(GNOME_DIALOG(quit_save_question), "Just quit", GNOME_STOCK_PIXMAP_EXIT); button13 = g_list_last(GNOME_DIALOG(quit_save_question)->buttons)->data; gtk_widget_show(button13); GTK_WIDGET_SET_FLAGS(button13, GTK_CAN_DEFAULT); gnome_dialog_append_button(GNOME_DIALOG(quit_save_question), GNOME_STOCK_BUTTON_CANCEL); button14 = g_list_last(GNOME_DIALOG(quit_save_question)->buttons)->data; gtk_widget_show(button14); GTK_WIDGET_SET_FLAGS(button14, GTK_CAN_DEFAULT); dialog_action_area6 = GNOME_DIALOG(quit_save_question)->action_area; gtk_widget_grab_default(button14); return quit_save_question; } void quit_please(void) { GtkWidget *qs; int button; /* FIXME: If user cares about unsaved definitions */ if (!rcfile_saved) { qs = create_quit_save_question("Some of your site definitions may not be saved.\nWhat would you like to do?", 0); button = gnome_dialog_run_and_close(GNOME_DIALOG(qs)); switch (button) { case -1: break; case 0: /* How should we handle this if it fails? */ rcfile_write(rcfile, all_sites); gtk_main_quit(); case 1: gtk_main_quit(); case 2: /* Dialog is already closed by default. */ return; default: return; } } else { /* FIXME: if user wants quit question */ qs = create_quit_save_question("Are you sure you want to quit?", 1); button = gnome_dialog_run_and_close(GNOME_DIALOG(qs)); switch (button) { case -1: break; case 0: gtk_main_quit(); case 1: return; break; default: ; } } } void open_new_request(void) { filename_request(OPENNEW); } /* Reads the filename from the GtkFileSelection passed to it, and takes * appropriate action depending upon the filename. * * Success: the global variable all_sites now contains the sites held within * the filename selected in the FileSelection. The main ctree is also rebuilt. */ void open_newrc(GtkWidget * ok, GtkFileSelection * fileb) { struct site *new_sites, *old_sites; gchar *old_rcfile, *new_rcfile; gint new_status; struct stat *stat_tmp; if ((new_rcfile = gtk_file_selection_get_filename(GTK_FILE_SELECTION(fileb))) == NULL) return; stat_tmp = malloc(sizeof(struct stat)); if (stat((const char *) new_rcfile, stat_tmp) != 0) { gfe_status("File does not exist!!"); free(stat_tmp); return; } if (!S_ISREG(stat_tmp->st_mode)) { gfe_status("You must select an actual sitecopy configuration file, (rcfile)."); free(stat_tmp); return; } NE_DEBUG(DEBUG_GNOME, "new rcfile is %s.\n", new_rcfile); old_rcfile = strdup(rcfile); rcfile = new_rcfile; NE_DEBUG(DEBUG_GNOME, "About to parse new rcfile...\n"); new_status = rcfile_read(&new_sites); switch (new_status) { case RC_OPENFILE: gfe_status("Could not open file"); return; case RC_DIROPEN: gfe_status("Could not open directory."); return; case RC_PERMS: gfe_status("Configuration file is not valid:\nPermissions are insecure."); return; case 0: NE_DEBUG(DEBUG_GNOME, "New rcfile successfully loaded into memory.\n"); break; case RC_CORRUPT: gfe_status("Not a valid sitecopy configuration file.\n"); rcfile = old_rcfile; free(new_rcfile); return; } if (new_sites == NULL) { gfe_status("Creation of new sites failed - not a valid sitecopy configuration file?"); /* Free up some memory */ return; } old_sites = all_sites; all_sites = new_sites; free(old_sites); gtk_clist_clear(GTK_CLIST(the_tree)); fill_tree_from_all_sites(the_tree); } void saveas_request(void) { filename_request(SAVEAS); } void save_sites_as(GtkWidget * ok, GtkFileSelection * fileb) { gchar *file_to_saveas; file_to_saveas = gtk_file_selection_get_filename(GTK_FILE_SELECTION(fileb)); NE_DEBUG(DEBUG_GNOME, "saving as file: %s\n", file_to_saveas); if (rcfile_write(file_to_saveas, all_sites) != 0) { gfe_status("There was a problem saving your sites."); } else { gfe_status("Site definitions saved."); } gtk_widget_destroy(GTK_WIDGET(fileb)); } void filename_request(gint mode_num) { GtkWidget *filebox = NULL; if (mode_num == OPENNEW) { filebox = gtk_file_selection_new("Choose a new sitecopy rcfile to load."); } else if (mode_num == SAVEAS) { filebox = gtk_file_selection_new("Save your site definitions to a file."); } else { gfe_status("error with dialog creation."); } gtk_signal_connect_object(GTK_OBJECT(filebox), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(filebox)); gtk_signal_connect_object(GTK_OBJECT(GTK_FILE_SELECTION(filebox)->cancel_button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(filebox)); if (mode_num == OPENNEW) { gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filebox)->ok_button), "clicked", GTK_SIGNAL_FUNC(open_newrc), filebox); } else if (mode_num == SAVEAS) { gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filebox)->ok_button), "clicked", GTK_SIGNAL_FUNC(save_sites_as), filebox); } else { gfe_status("there was an error"); } gtk_signal_connect_object(GTK_OBJECT(GTK_FILE_SELECTION(filebox)->ok_button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(filebox)); gtk_widget_show(filebox); } GtkWidget *create_default_main_area(void) { GtkWidget *vbox, *label; vbox = gtk_vbox_new(FALSE, 5); label = gtk_label_new("No site is currently selected.\n\nPlease choose one from the tree view\non the left before proceeding with any more operations."); gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 10); gtk_widget_show(label); gtk_widget_show(vbox); return vbox; } GtkWidget *create_initial_main_area(void) { GtkWidget *vbox, *label; gchar *summary; gint num_that_need_updates = 0; struct site *tmp_site; vbox = gtk_vbox_new(FALSE, 10); label = gtk_label_new("\nWelcome to XSitecopy!\n\n"); gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 10); gtk_widget_show(label); for (tmp_site = all_sites; tmp_site != NULL; tmp_site = tmp_site->next) { if (tmp_site->remote_is_different) { summary = (char *) malloc(strlen(tmp_site->name) + 32); sprintf(summary, "The site '%s' requires an update.", tmp_site->name); label = gtk_label_new(summary); gtk_widget_show(label); free(summary); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 1); num_that_need_updates++; } } if (all_sites == NULL) { label = gtk_label_new("Click on \"New site\" to begin using the program."); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 10); } else if (num_that_need_updates == 0) { label = gtk_label_new("All local sites are fully synchronized with the remote sites."); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 10); } gtk_widget_show(vbox); return vbox; } void redraw_main_area(void) { gtk_container_remove(GTK_CONTAINER(main_area_box), area_data); area_data = make_site_info_area(selected_site); gtk_container_add(GTK_CONTAINER(main_area_box), area_data); } void clear_main_area(void) { selected_site = NULL; gtk_container_remove(GTK_CONTAINER(main_area_box), area_data); area_data = create_default_main_area(); gtk_container_add(GTK_CONTAINER(main_area_box), area_data); } /** If I start making any decent reports, move the report functions into reports.c **/ void site_report(void) { gtk_container_remove(GTK_CONTAINER(main_area_box), area_data); area_data = create_initial_main_area(); gtk_container_add(GTK_CONTAINER(main_area_box), area_data); } void site_web_report(void) { gchar *lee; gchar *command_to_exec; if (selected_site == NULL) { gfe_status("For a report to be generated, a site must be selected."); return; } /* FIXME: path */ lee = g_strdup_printf("sitecopy -ll %s | awk -f changes.awk > /tmp/xsitecopy_report.html", selected_site->name); system(lee); system("gnome-moz-remote --newwin /tmp/xsitecopy_report.html"); } void rescan_selected(int shouldRedraw) { extern GtkWidget *sitecopy; int ret; char *newLabel; if (!selected_site) { gnome_error_dialog("You must select a site to rescan."); return; } ret = verifysite_gnome(selected_site); if ((ret == SITE_NOLOCALDIR) || (ret == SITE_ACCESSLOCALDIR)) return; gnome_app_flash(GNOME_APP(sitecopy), "Scanning files..."); if (site_readfiles(selected_site)) { gnome_error_dialog("Could not read file information for the local site."); return; } rebuild_node_files(current_site_node); newLabel = getAppropriateTreeLabel(selected_site); gtk_ctree_node_set_text(GTK_CTREE(the_tree), GTK_CTREE_NODE(current_site_node), 0, newLabel); g_free(newLabel); if (shouldRedraw) redraw_main_area(); } int check_site_and_record_errors(struct site *current) { char *errstr; int ret = rcfile_verify(current); if (!ret) { /* joe: is this right? */ errors = g_list_append(errors, "rcfile was corrupt"); return 1; } errstr = (char *) malloc(BUFSIZ); switch (ret) { /* Everything was fine */ case 0: return 0; case SITE_NOSERVER: sprintf(errstr, _("Server not specified in site `%s'.\n"), current->name); break; case SITE_NOREMOTEDIR: sprintf(errstr, _("Remote directory not specified in site `%s'.\n"), current->name); break; case SITE_NOLOCALDIR: sprintf(errstr, _("Local directory not specified in site `%s'.\n"), current->name); break; case SITE_ACCESSLOCALDIR: sprintf(errstr, _("Could not read directory for `%s':\n\t%s\n"), current->name, current->local_root); break; case SITE_INVALIDPORT: sprintf(errstr, _("Invalid port used in site `%s'.\n"), current->name); break; case SITE_NOMAINTAIN: sprintf(errstr, _("Protocol '%s' cannot maintain symbolic links (site `%s').\n"), current->driver->protocol_name, current->name); break; case SITE_NOREMOTEREL: sprintf(errstr, _("Cannot use a relative remote directory protocol '%s' (site `%s').\n"), current->driver->protocol_name, current->name); break; case SITE_NOPERMS: sprintf(errstr, _("%s's protocol does not currently support maintaining permissions."), current->name); break; case SITE_NOLOCALREL: sprintf(errstr, _("Could not find 'relative' local directory")); } errstr = realloc(errstr, strlen(errstr) + 1); errors = g_list_append(errors, errstr); return ret; } GtkWidget *ctree_create_sites(void) { the_tree = gtk_ctree_new(1, 0); gtk_ctree_set_indent(GTK_CTREE(the_tree), 14); gtk_ctree_set_spacing(GTK_CTREE(the_tree), 4); gtk_ctree_set_line_style(GTK_CTREE(the_tree), GTK_CTREE_LINES_DOTTED); gtk_signal_connect(GTK_OBJECT(the_tree), "tree-select-row", GTK_SIGNAL_FUNC(select_ctree_cb), NULL); fill_tree_from_all_sites(the_tree); gtk_widget_set_usize(the_tree, 150, -1); gtk_widget_show(the_tree); gtk_clist_set_column_auto_resize(GTK_CLIST(the_tree), 0, TRUE); return the_tree; } /* GUI making functions. * Most of these were made using Glade. */ void make_error_window(void) { GtkWidget *dialog_vbox2; GtkWidget *label9; GtkWidget *sc_win; GtkWidget *label7; GtkWidget *label8; GtkWidget *dialog_action_area2; GtkWidget *cancel; error_log_window = gnome_dialog_new("Errors during the recent update", NULL); gtk_widget_set_usize(error_log_window, 567, 248); gtk_window_set_policy(GTK_WINDOW(error_log_window), TRUE, TRUE, FALSE); dialog_vbox2 = GNOME_DIALOG(error_log_window)->vbox; gtk_widget_show(dialog_vbox2); label9 = gtk_label_new("There were errors with the following files and/or directories:"); gtk_widget_show(label9); gtk_box_pack_start(GTK_BOX(dialog_vbox2), label9, FALSE, FALSE, 0); gtk_label_set_justify(GTK_LABEL(label9), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(label9), 7.45058e-09, 0.5); sc_win = gtk_scrolled_window_new(NULL, NULL); gtk_widget_show(sc_win); gtk_box_pack_start(GTK_BOX(dialog_vbox2), sc_win, TRUE, TRUE, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sc_win), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); error_log_list = gtk_clist_new(2); gtk_widget_show(error_log_list); gtk_container_add(GTK_CONTAINER(sc_win), error_log_list); gtk_clist_set_column_width(GTK_CLIST(error_log_list), 0, 265); gtk_clist_set_column_width(GTK_CLIST(error_log_list), 1, 80); gtk_clist_column_titles_show(GTK_CLIST(error_log_list)); label7 = gtk_label_new("File/Directory Name"); gtk_widget_show(label7); gtk_clist_set_column_widget(GTK_CLIST(error_log_list), 0, label7); label8 = gtk_label_new("Error code/message"); gtk_widget_show(label8); gtk_clist_set_column_widget(GTK_CLIST(error_log_list), 1, label8); dialog_action_area2 = GNOME_DIALOG(error_log_window)->action_area; gtk_widget_show(dialog_action_area2); gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area2), GTK_BUTTONBOX_END); gtk_button_box_set_spacing(GTK_BUTTON_BOX(dialog_action_area2), 8); gnome_dialog_append_button(GNOME_DIALOG(error_log_window), GNOME_STOCK_BUTTON_CLOSE); cancel = g_list_last(GNOME_DIALOG(error_log_window)->buttons)->data; gtk_widget_show(cancel); GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); gtk_signal_connect_object(GTK_OBJECT(error_log_window), "delete_event", GTK_SIGNAL_FUNC(gtk_widget_hide), GTK_OBJECT(error_log_window)); gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_hide), GTK_OBJECT(error_log_window)); } /* Enumerates any errors with the default rcfile, on startup. */ GtkWidget * create_site_errors_dialog() { GtkWidget *site_errors_dialog; GtkWidget *dialog_vbox2; GtkWidget *vbox1; GtkWidget *label1; GtkWidget *hseparator1; GtkWidget *error_output; GtkWidget *sw; GtkWidget *dialog_action_area2; GtkWidget *button2; GList *current; extern gboolean fatal_error_encountered; site_errors_dialog = gnome_dialog_new(NULL, NULL); GTK_WINDOW(site_errors_dialog)->type = GTK_WINDOW_DIALOG; gtk_window_set_position(GTK_WINDOW(site_errors_dialog), GTK_WIN_POS_CENTER); gtk_window_set_policy(GTK_WINDOW(site_errors_dialog), FALSE, FALSE, FALSE); gnome_dialog_set_close(GNOME_DIALOG(site_errors_dialog), TRUE); dialog_vbox2 = GNOME_DIALOG(site_errors_dialog)->vbox; gtk_widget_show(dialog_vbox2); vbox1 = gtk_vbox_new(FALSE, 0); gtk_widget_show(vbox1); gtk_box_pack_start(GTK_BOX(dialog_vbox2), vbox1, TRUE, TRUE, 0); if (fatal_error_encountered) { label1 = gtk_label_new("WARNING!\n\nThe following FATAL errors were encountered while examining\nyour site definitions. They must be corrected manually.\nXsitecopy will terminate when you press the close button."); } else { label1 = gtk_label_new("WARNING!\n\nThe following errors were encountered while examining\nyour site definitions. Unless corrected, Xsitecopy may fail\nto function properly."); } gtk_widget_show(label1); gtk_box_pack_start(GTK_BOX(vbox1), label1, FALSE, FALSE, 0); hseparator1 = gtk_hseparator_new(); gtk_widget_show(hseparator1); gtk_box_pack_start(GTK_BOX(vbox1), hseparator1, TRUE, TRUE, 8); sw = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_widget_show(sw); error_output = gtk_text_new(NULL, NULL); gtk_widget_show(error_output); gtk_container_add(GTK_CONTAINER(sw), error_output); gtk_box_pack_start(GTK_BOX(vbox1), sw, TRUE, TRUE, 0); dialog_action_area2 = GNOME_DIALOG(site_errors_dialog)->action_area; gtk_widget_show(dialog_action_area2); gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area2), GTK_BUTTONBOX_SPREAD); gtk_button_box_set_spacing(GTK_BUTTON_BOX(dialog_action_area2), 8); gnome_dialog_append_button(GNOME_DIALOG(site_errors_dialog), GNOME_STOCK_BUTTON_OK); button2 = g_list_last(GNOME_DIALOG(site_errors_dialog)->buttons)->data; gtk_widget_show(button2); GTK_WIDGET_SET_FLAGS(button2, GTK_CAN_DEFAULT); for (current = errors; current; current = current->next) { gtk_text_insert(GTK_TEXT(error_output), NULL, NULL, NULL, (const char *) current->data, -1); /* Can't do this anymore, as I can't guarantee the data was in fact * malloc'ed. * g_free (current->data); */ } if (fatal_error_encountered) { gtk_signal_connect(GTK_OBJECT(button2), "clicked", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); } else { gtk_signal_connect_object(GTK_OBJECT(button2), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(site_errors_dialog)); } errors = NULL; gtk_widget_grab_default(button2); return site_errors_dialog; } /* Direction should be 1 for forwards, or 0 for backwards. */ GtkWidget *make_transfer_anim(gint direction) { gchar *pixmap_dir_str; GnomeAnimator *anim; /* Create the animator. */ anim = (GnomeAnimator *) gnome_animator_new_with_size(42, 43); /* Append the animation frames */ pixmap_dir_str = gnome_unconditional_pixmap_file("xsitecopy/anim_base.png"); if (pixmap_dir_str) gnome_animator_append_frame_from_file(anim, pixmap_dir_str, 0, 0, 900); g_free(pixmap_dir_str); pixmap_dir_str = gnome_unconditional_pixmap_file("xsitecopy/anim_yel0.png"); if (pixmap_dir_str) gnome_animator_append_frame_from_file(anim, pixmap_dir_str, 0, 0, 900); g_free(pixmap_dir_str); pixmap_dir_str = gnome_unconditional_pixmap_file("xsitecopy/anim_yel1.png"); if (pixmap_dir_str) gnome_animator_append_frame_from_file(anim, pixmap_dir_str, 0, 0, 900); g_free(pixmap_dir_str); pixmap_dir_str = gnome_unconditional_pixmap_file("xsitecopy/anim_yel2.png"); if (pixmap_dir_str) gnome_animator_append_frame_from_file(anim, pixmap_dir_str, 0, 0, 900); g_free(pixmap_dir_str); pixmap_dir_str = gnome_unconditional_pixmap_file("xsitecopy/anim_yel3.png"); if (pixmap_dir_str) gnome_animator_append_frame_from_file(anim, pixmap_dir_str, 0, 0, 900); g_free(pixmap_dir_str); pixmap_dir_str = gnome_unconditional_pixmap_file("xsitecopy/anim_yel4.png"); if (pixmap_dir_str) gnome_animator_append_frame_from_file(anim, pixmap_dir_str, 0, 0, 900); g_free(pixmap_dir_str); pixmap_dir_str = gnome_unconditional_pixmap_file("xsitecopy/anim_yel5.png"); if (pixmap_dir_str) gnome_animator_append_frame_from_file(anim, pixmap_dir_str, 0, 0, 900); g_free(pixmap_dir_str); /* Set speed, direction and loop */ gnome_animator_set_playback_speed(anim, 20); gnome_animator_set_playback_direction(anim, direction); gnome_animator_set_loop_type(anim, GNOME_ANIMATOR_LOOP_RESTART); return GTK_WIDGET(anim); } sitecopy-0.16.6/gnome/gcommon.c0000664000076400007640000003434210232743237014512 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ /* This file implements all the functions required by sitecopy in * src/frontend.h and also provides a few convenience functions for fun. */ #include #include #include #include "dirname.h" #include "rcfile.h" #include "gcommon.h" #include "config.h" static gint button; GtkWidget *connection_label = NULL; extern sem_t *update_semaphore; extern struct site *selected_site; extern GtkWidget *error_log_list, *error_log_window; /* For the 'main' upload window */ extern GtkWidget *main_progressbar, *job_progressbar, *error_button; extern GtkWidget *status_label, *op_label, *file_label, *dir_label; extern GtkWidget *begin_button; extern struct site *all_sites; /* This value is what makes the entire "job" progress bar possible. */ float upload_total, uploaded_bytes = 0.0; extern GtkWidget *sitecopy; /*************************************************/ /* Returns TRUE if *oldString _was_ replaced with replacementString, or * FALSE if NULL was substituted. */ gboolean xsc_replace_string(char **oldString, char *replacementString) { /* Check the value of replacementString. If it's NULL, or an empty * string, then set *oldString to be NULL also. */ if ( (!replacementString) || (strlen(replacementString) < 1) ) { *oldString = NULL; return FALSE; } /* If oldString is valid, then optionally free any memory used by * *oldString, and then point oldString to replacementString */ if (*oldString) { free(*oldString); } *oldString = replacementString; return TRUE; } /* Searches for the glade file, and loads a static variable with the location. * Once found, the variable is returned straight away. */ gchar *get_glade_filename(void) { static gchar *theFilename = NULL; if (theFilename) return theFilename; /* Search for the glade file in $(datadir)/xsitecopy/, ./ and ../ */ theFilename = gnome_datadir_file("xsitecopy/sitecopy-dialogs.glade"); if ((!theFilename) || (!g_file_exists(theFilename))) { g_free(theFilename); theFilename = g_strdup("sitecopy-dialogs.glade"); if (!g_file_exists(theFilename)) { g_free(theFilename); theFilename = g_strdup("../sitecopy-dialogs.glade"); if (!g_file_exists(theFilename)) { g_error("Can not find sitecopy-dialogs.glade, exiting.\n"); theFilename = NULL; } } } return theFilename; } int fe_gtk_question(char *question, GnomeReplyCallback yes_action) { GtkWidget *question_window; question_window = gnome_app_question(GNOME_APP(sitecopy), (const gchar *) question, yes_action, NULL); gtk_widget_show(question_window); return 1; } void fe_transfer_progress(off_t progress, off_t total) { float div1, div2; /* Update the current file's progress */ div1 = (float) progress; div2 = (float) total; gdk_threads_enter(); /* Let's not do anything silly like divide by zero. */ if (div2) gtk_progress_bar_update(GTK_PROGRESS_BAR(main_progressbar), div1 / div2); /* Update total job progress */ gtk_progress_bar_update(GTK_PROGRESS_BAR(job_progressbar), (uploaded_bytes + (float) progress) / (float) upload_total); gdk_threads_leave(); } void gfe_status(const char *message) { gnome_app_message(GNOME_APP(sitecopy), (const gchar *) message); } void fe_warning(const char *description, const char *subject, const char *error) { /* gnome_warning_dialog(description);*/ } /* The user is required to authenticate themselves for given context, * in the given realm on the given hostname. This is achieved by forming an * appropriate label givne the context, realm and hostname. A dialog is * then constructed with libglade. run_and_close() is performed on the * dialog, then some sanity checking for what was entered. Finally, the * 'out' parameters of the function are set, the gtk+ lock is removed, and * the appropriate value returned. * */ /* Thanks to David Knight. This function was copied almost verbatim from the screem upload wizard. */ int fe_login( fe_login_context ctx, const char *realm, const char *hostname, char *username, char *password ) { GtkWidget *widget; gchar *tmp; gchar const *server_type; GladeXML *login_xml; g_print("fe_login"); gdk_threads_enter(); switch (ctx) { case fe_login_server: server_type = "remote"; break; case fe_login_proxy: server_type = "proxy"; break; #ifndef NDEBUG default: fprintf(stderr, "fe_login: unknown ctx %d. Aborting.\n", (int) ctx); abort(); #endif /* !NDEBUG */ } /* Form a sane prompt for details regardless of whether a realm is * provided or not. */ tmp = g_strdup_printf("The %s server requires authentication.\n\n" "Please enter details for %s%s%s.", server_type, realm?realm:"", realm?" at ":"", hostname); login_xml = glade_xml_new((const char *)get_glade_filename(), "user_pass_dialog"); gtk_label_set(GTK_LABEL(glade_widget(login_xml, "user_pass_prompt_label")), tmp); g_free(tmp); if( username[0] != '\0' ) { widget = glade_xml_get_widget( login_xml, "user_entry" ); gtk_entry_set_text( GTK_ENTRY( widget ), username ); } widget = glade_xml_get_widget(login_xml, "user_pass_dialog"); gtk_window_set_modal(GTK_WINDOW(widget), TRUE); gtk_widget_show_all(widget); glade_xml_signal_autoconnect(login_xml); button = -1; gdk_threads_leave(); sem_wait(update_semaphore); if( button != 0 ) { /* canceled */ gtk_widget_destroy( widget ); return -1; } gdk_threads_enter(); gtk_window_set_modal(GTK_WINDOW(widget), FALSE); widget = glade_xml_get_widget( login_xml, "user_entry" ); strncpy(username, gtk_entry_get_text( GTK_ENTRY( widget ) ), FE_LBUFSIZ); widget = glade_xml_get_widget( login_xml, "pass_entry" ); strncpy(password, gtk_entry_get_text( GTK_ENTRY( widget ) ), FE_LBUFSIZ); widget = glade_xml_get_widget( login_xml, "user_pass_dialog" ); gtk_widget_destroy( widget ); gdk_threads_leave(); return 0; } void fe_login_clicked( GnomeDialog *dialog, gint number ) { button = number; sem_post(update_semaphore); } void fe_login_close( GnomeDialog *dialog ) { sem_post(update_semaphore); } void fe_connection( fe_status status, const char *info) { char *tmp; gdk_threads_enter(); switch (status) { case (fe_namelookup): if (info) { tmp = g_strdup_printf("Looking up %s...", info); gtk_label_set(GTK_LABEL(connection_label), tmp); g_free(tmp); } else { gtk_label_set(GTK_LABEL(connection_label), "Looking up hostname..."); } break; case (fe_connecting): gtk_label_set(GTK_LABEL(connection_label), "Attempting to connect..."); break; case (fe_connected): gtk_label_set(GTK_LABEL(connection_label), "Connected."); break; } gdk_threads_leave(); } int fe_can_update(const struct site_file *file) { g_print("Confirmation given to upload file %s.\n", file->local.filename); return TRUE; } void fe_verified(const char *fname, enum file_diff match) { /* TODO */ } void fe_updating(const struct site_file *file) { char *file_status; gdk_threads_enter(); file_status = g_strdup_printf("Commiting updates to %s...", selected_site->server.hostname); gtk_label_set(GTK_LABEL(status_label), file_status); /* Check this */ g_free(file_status); if (file->type == file_dir) { if (file->diff == file_new) { gtk_label_set(GTK_LABEL(op_label), "Creating directory..."); gtk_label_set(GTK_LABEL(file_label), file_name(file)); /* gtk_label_set (GTK_LABEL (dir_label), file->directory); */ gtk_label_set(GTK_LABEL(dir_label), ""); } else { /* can we move dirs yet? */ gtk_label_set(GTK_LABEL(op_label), "Deleting directory..."); gtk_label_set(GTK_LABEL(dir_label), ""); } } else { switch (file->diff) { case file_changed: gtk_label_set(GTK_LABEL(op_label), "Uploading..."); gtk_label_set(GTK_LABEL(file_label), file_name(file)); gtk_label_set(GTK_LABEL(dir_label), dir_name(file_name(file))); break; case file_new: gtk_label_set(GTK_LABEL(op_label), "Uploading..."); gtk_label_set(GTK_LABEL(file_label), file_name(file)); gtk_label_set(GTK_LABEL(dir_label), dir_name(file_name(file))); break; case file_deleted: gtk_label_set(GTK_LABEL(op_label), "Deleting..."); gtk_label_set(GTK_LABEL(file_label), file_name(file)); gtk_label_set(GTK_LABEL(dir_label), ""); break; case file_moved: gtk_label_set(GTK_LABEL(op_label), "Moving..."); gtk_label_set(GTK_LABEL(file_label), file_name(file)); /* FIXME: Check this, I think it's dodgy. */ gtk_label_set(GTK_LABEL(dir_label), dir_name(file_name(file))); break; case file_unchanged: gtk_label_set(GTK_LABEL(op_label), "ARG! The file hasn't changed, we shouldn't be doing anything!"); } } gdk_threads_leave(); } /* Once a file has been updated, any errors with it are recorded in the * error list, and the progress bar is reset. */ void fe_updated(const struct site_file *file, int success, const char *error) { gchar *error_item[2]; gdk_threads_enter(); if (!success) { g_assert(error!=NULL); error_item[0] = file_name(file); error_item[1] = g_strdup(error); gtk_clist_append(GTK_CLIST(error_log_list), error_item); NE_DEBUG(DEBUG_GNOME, "Error \"%s\" with file: %s\n", error, file_name(file)); g_free(error_item[1]); } gtk_progress_bar_update(GTK_PROGRESS_BAR(main_progressbar), 0.0); /* If the file exists locally, update how many bytes have globally * been updated */ if (file->local.filename) uploaded_bytes += (float) file->local.size; gdk_threads_leave(); } int verifysite_gnome(struct site *a_site) { int ret = rcfile_verify(a_site); if (!ret) return 0; switch (ret) { case SITE_NOSERVER: gnome_error_dialog("Server not specified."); break; case SITE_NOREMOTEDIR: gnome_error_dialog("Remote directory not specified."); break; case SITE_NOLOCALDIR: gnome_error_dialog("Local directory not specified."); break; case SITE_ACCESSLOCALDIR: gnome_error_dialog("Could not read local directory."); break; case SITE_INVALIDPORT: gnome_error_dialog("Invalid port."); break; case SITE_NOMAINTAIN: gnome_error_dialog("The chosen protocol cannot maintain symbolic links"); break; case SITE_NOREMOTEREL: gnome_error_dialog("The chosen protocol cannot use a relative remote directory."); break; case SITE_NOPERMS: gnome_error_dialog("The protocol you are attempting to use does\nnot currently support maintaining permissions."); break; case SITE_NOLOCALREL: gnome_error_dialog("Could not use a 'relative' local directory"); default: gnome_error_dialog("There was an undetermined problem verifying the correctness of your site definition. Please report this to the maintainer."); break; } return ret; } /* Coming soon... */ void fe_synching(const struct site_file *file) { } void fe_synched(const struct site_file *file, int success, const char *error) { } void fe_setting_perms(const struct site_file *file) { } void fe_set_perms(const struct site_file *file, int success, const char *error) { } /* This function keeps the handling of return codes from site_update, * site_fetch and site_resync consistant, as they all return the same * potential values. */ void set_status_after_operation(int return_code, GtkLabel *infoLabel) { g_assert(infoLabel != NULL); switch (return_code) { case SITE_OK: gtk_label_set(GTK_LABEL(infoLabel), "Operation succesfully completed."); site_write_stored_state(selected_site); NE_DEBUG (DEBUG_GNOME, "Site fetch was successful.\n"); break; case SITE_LOOKUP: gtk_label_set(GTK_LABEL(infoLabel), "Host name lookup failed."); NE_DEBUG (DEBUG_GNOME, "lookup failed\n"); break; case SITE_PROXYLOOKUP: gtk_label_set(GTK_LABEL(infoLabel), "Host name lookup for the proxy server failed."); NE_DEBUG (DEBUG_GNOME, "lookup failed\n"); break; case SITE_CONNECT: gtk_label_set(GTK_LABEL(infoLabel), "Could not connect to remote site."); NE_DEBUG (DEBUG_GNOME, "no connection.\n"); break; case SITE_ERRORS: gtk_label_set(GTK_LABEL(infoLabel), "There were errors during the transfer."); NE_DEBUG (DEBUG_GNOME, "no connection.\n"); break; case SITE_AUTH: gtk_label_set(GTK_LABEL(infoLabel), "Could not authenticate you with the remote server."); NE_DEBUG (DEBUG_GNOME, "Could not authenticate\n"); break; case SITE_PROXYAUTH: gtk_label_set(GTK_LABEL(infoLabel), "Could not authenticate you with the proxy server."); NE_DEBUG (DEBUG_GNOME, "Could not do proxy authenticate\n"); break; case SITE_FAILED: gtk_label_set(GTK_LABEL(infoLabel), "The operation failed. No reason was given."); NE_DEBUG (DEBUG_GNOME, "Fetch failed.\n"); break; case SITE_UNSUPPORTED: gtk_label_set(GTK_LABEL(infoLabel), "This operation is unsupported for the selected protocol."); NE_DEBUG (DEBUG_GNOME, "NOt implemented!\n"); break; case SITE_ABORTED: gtk_label_set(GTK_LABEL(infoLabel), "Operation aborted."); NE_DEBUG (DEBUG_GNOME, "Um. We got aborted HERE?!\n"); break; default: gtk_label_set(GTK_LABEL(infoLabel), "This should never appear. Please contact the maintainer."); NE_DEBUG (DEBUG_GNOME, "default.\n"); } } sitecopy-0.16.6/gnome/tree.h0000664000076400007640000000414110232743237014011 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef TREE_H #define TREE_H #include #include #include "sites.h" #include "basename.h" #include "misc.h" #include "file_widgets.h" #include "gcommon.h" #include "site_widgets.h" struct site_node_data { char *name; struct site_file *file; }; void color_site_node(GtkCTreeNode * node, struct site *site); /** Tree generation functions */ GtkCTreeNode *add_file(char *name, struct site_file *a_file, GtkCTreeNode * parent); gchar *getAppropriateTreeLabel(struct site *a_site); int add_a_site_to_the_tree(struct site *a_site, gint operation); void fill_tree_from_all_sites(GtkWidget * a_ctree); void core_tree_building_function(struct site_file *a_file, GNode * tree); GNode *build_tree_from_site(struct site *a_site); void gnode_to_gui(GNode * root, GtkCTreeNode * a_node); void populate_site_node(GtkCTreeNode * site_node, struct site *current); /* Other tree stuff */ void select_ctree_cb(GtkCTree * tree, GtkCTreeNode * node, gpointer data); void rebuild_node_files(GtkCTreeNode * site_node); /* Debugging */ void dump_types(struct site *a_site); void dump_g_node(GNode * tree); #endif /* TREE_H */ sitecopy-0.16.6/gnome/dir2_changed.xpm0000664000076400007640000000157110165765223015750 0ustar joejoe/* XPM */ static char * dir2_changed_xpm[] = { "16 16 34 1", " c None", ". c #000000", "+ c #DCC679", "@ c #C9AC56", "# c #CAAF5D", "$ c #C89F31", "% c #CFB974", "& c #C9A844", "* c #CAB163", "= c #C9A740", "- c #C39B30", "; c #AD8518", "> c #A17A06", ", c #5C4300", "' c #C79F34", ") c #F3E7B0", "! c #F4EABB", "~ c #EDDC98", "{ c #967000", "] c #A37B10", "^ c #F6EEC3", "/ c #E9D588", "( c #CFB360", "_ c #E7D280", ": c #9B7606", "< c #EEE3B3", "[ c #BF931E", "} c #6A5200", "| c #CAB061", "1 c #946F00", "2 c #F0E4AB", "3 c #B0840F", "4 c #DAC683", "5 c #CFA830", " ", " ", " .... ", " .+@+@. ", " .#$#$#$...... ", " .%&*&*&*=-&-;.", " ...........>,'.", ".)!~!~!~!~!~.{].", ".^/(_(_(_(_(.{:.", " .<_(_(_(_(_[.:.", " }!|_(_(_(_(_.1.", " }2(_(_(_(_(3..", " .4(5(5(5(5(5..", " ............ ", " ", " "}; sitecopy-0.16.6/gnome/dir.xpm0000664000076400007640000000142610165765223014214 0ustar joejoe/* XPM */ static char * dir_xpm[] = { "16 16 28 1", " c None", ". c #000000", "+ c #7DE66F", "@ c #53CC53", "# c #55D255", "$ c #41B84A", "% c #CDFCD7", "& c #B5F7B0", "* c #D3FCDC", "= c #8BEE96", "- c #A7F6BF", "; c #ADF6A3", "> c #85EB80", ", c #A5F28D", "' c #7EE673", ") c #74E36C", "! c #5DD65D", "~ c #42B94D", "{ c #BFFAC3", "] c #42A151", "^ c #3C934C", "/ c #62DA5F", "( c #4DCA53", "_ c #73E16A", ": c #4CC74F", "< c #328946", "[ c #AAF598", "} c #247B3D", " ", " ", " .... ", " .+@+@. ", " .#$#$#$...... ", " .%&*&*&%*=-;>.", " .;+,+,+,')!+~.", " .{,+,+,))!+!].", " .;+,+,)+!+!!^.", " .{,+,)+!+!/(^.", " .;+,_+!+!!(:<.", " .{,_+!+!!::~<.", " .[]~]:]~]^<<}.", " ............ ", " ", " "}; sitecopy-0.16.6/gnome/dir2_new.xpm0000664000076400007640000000156510165765223015153 0ustar joejoe/* XPM */ static char * dir2_new_xpm[] = { "16 16 34 1", " c None", ". c #000000", "+ c #EF6676", "@ c #DA4561", "# c #DD4A62", "$ c #C43554", "% c #E55E7E", "& c #D13C58", "* c #DF4E66", "= c #CF3A56", "- c #BC3756", "; c #982D4B", "> c #881F3F", ", c #5C0026", "' c #C53658", ") c #FBA8BA", "! c #FCB3C6", "~ c #F88D97", "{ c #7F1639", "] c #902347", "^ c #FCBDD0", "/ c #F67B7E", "( c #E34C5A", "_ c #F57373", ": c #851C41", "< c #F9A8C5", "[ c #A8354A", "} c #6A003B", "| c #DF4C64", "1 c #7D163D", "2 c #FAA1B1", "3 c #942B41", "4 c #ED708D", "5 c #CD3248", " ", " ", " .... ", " .+@+@. ", " .#$#$#$...... ", " .%&*&*&*=-&-;.", " ...........>,'.", ".)!~!~!~!~!~.{].", ".^/(_(_(_(_(.{:.", " .<_(_(_(_(_[.:.", " }!|_(_(_(_(_.1.", " }2(_(_(_(_(3..", " .4(5(5(5(5(5..", " ............ ", " ", " "}; sitecopy-0.16.6/gnome/resynch.c0000664000076400007640000001752010232743237014525 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ /* FIXME! fetch mode needs to be made a little more generic to accomodate all the * possible calling contexts; ie. normal, from a druid, from slim mode. */ #include "resynch.h" GtkWidget *fetch_list_window, *fetch_anim, *fetch_message; GtkWidget *fetch_clist; GtkWidget *close_fetch_button, *begin_fetch_button; extern GtkWidget *connection_label, *sitecopy; extern struct site *selected_site; /* The user should never close the window during a fetch. */ gboolean delete_fetch(GtkWindow *fnar, gpointer data) { return FALSE; } int fetch_site_list_please(GtkWidget * update_button, gpointer data) { GtkWidget *dialog_vbox7; GtkWidget *vbox10; GtkWidget *hbox4; GtkWidget *label17; GtkWidget *scrolledwindow1; GtkWidget *label18; GtkWidget *dialog_action_area7; if (!selected_site) { gnome_error_dialog("You must select a site before trying to fetch file information"); return 0; } /** Generated by Glade **/ fetch_list_window = gnome_dialog_new(NULL, NULL); gtk_signal_connect(GTK_OBJECT(fetch_list_window), "delete_event", GTK_SIGNAL_FUNC(delete_fetch), NULL); gtk_window_set_title(GTK_WINDOW(fetch_list_window), "XSitecopy: Fetching files"); gtk_window_set_policy(GTK_WINDOW(fetch_list_window), FALSE, FALSE, FALSE); gnome_dialog_set_parent(GNOME_DIALOG(fetch_list_window), GTK_WINDOW(sitecopy)); dialog_vbox7 = GNOME_DIALOG(fetch_list_window)->vbox; gtk_widget_show(dialog_vbox7); vbox10 = gtk_vbox_new(FALSE, 5); gtk_widget_show(vbox10); gtk_box_pack_start(GTK_BOX(dialog_vbox7), vbox10, TRUE, TRUE, 0); hbox4 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox4); gtk_box_pack_start(GTK_BOX(vbox10), hbox4, FALSE, FALSE, 0); label17 = gtk_label_new("Status: "); gtk_widget_show(label17); gtk_box_pack_start(GTK_BOX(hbox4), label17, FALSE, FALSE, 0); fetch_message = gtk_label_new("Awaiting user input"); gtk_widget_show(fetch_message); gtk_box_pack_start(GTK_BOX(hbox4), fetch_message, TRUE, TRUE, 0); gtk_label_set_justify(GTK_LABEL(fetch_message), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment(GTK_MISC(fetch_message), 0, 0.5); fetch_anim = make_transfer_anim(1); gtk_widget_show(fetch_anim); gtk_box_pack_start(GTK_BOX(vbox10), fetch_anim, FALSE, FALSE, 0); scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL); gtk_widget_show(scrolledwindow1); gtk_box_pack_start(GTK_BOX(vbox10), scrolledwindow1, TRUE, TRUE, 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); fetch_clist = gtk_clist_new(1); gtk_widget_show(fetch_clist); gtk_container_add(GTK_CONTAINER(scrolledwindow1), fetch_clist); gtk_widget_set_usize(fetch_clist, -2, 140); gtk_clist_set_column_width(GTK_CLIST(fetch_clist), 0, 80); gtk_clist_set_selection_mode(GTK_CLIST(fetch_clist), GTK_SELECTION_BROWSE); gtk_clist_column_titles_show(GTK_CLIST(fetch_clist)); label18 = gtk_label_new("Found information about these files"); gtk_widget_show(label18); gtk_clist_set_column_widget(GTK_CLIST(fetch_clist), 0, label18); dialog_action_area7 = GNOME_DIALOG(fetch_list_window)->action_area; gtk_widget_show(dialog_action_area7); gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area7), GTK_BUTTONBOX_SPREAD); gtk_button_box_set_spacing(GTK_BUTTON_BOX(dialog_action_area7), 8); gtk_button_box_set_child_ipadding(GTK_BUTTON_BOX(dialog_action_area7), 0, 0); gnome_dialog_append_button_with_pixmap(GNOME_DIALOG(fetch_list_window), "Fetch file states", GNOME_STOCK_PIXMAP_SEARCH); begin_fetch_button = g_list_last(GNOME_DIALOG(fetch_list_window)->buttons)->data; gtk_widget_show(begin_fetch_button); GTK_WIDGET_SET_FLAGS(begin_fetch_button, GTK_CAN_DEFAULT); gnome_dialog_append_button(GNOME_DIALOG(fetch_list_window), GNOME_STOCK_BUTTON_CLOSE); close_fetch_button = g_list_last(GNOME_DIALOG(fetch_list_window)->buttons)->data; gtk_widget_show(close_fetch_button); GTK_WIDGET_SET_FLAGS(close_fetch_button, GTK_CAN_DEFAULT); gtk_signal_connect(GTK_OBJECT(begin_fetch_button), "clicked", GTK_SIGNAL_FUNC(start_fetch_list), NULL); gtk_signal_connect(GTK_OBJECT(close_fetch_button), "clicked", GTK_SIGNAL_FUNC(close_fetch_window), NULL); /** End Glade generated code **/ connection_label = fetch_message; gtk_window_set_modal(GTK_WINDOW(fetch_list_window), TRUE); gtk_widget_show(fetch_list_window); return 1; } void close_fetch_window(void) { gtk_window_set_modal(GTK_WINDOW(fetch_list_window), FALSE); gtk_widget_destroy(fetch_list_window); connection_label = NULL; } int start_fetch_list(void) { extern sem_t *fetch_semaphore; sem_post(fetch_semaphore); return 1; } void *fetch_thread(void *no_data) { int ret; extern struct site *selected_site; extern sem_t *fetch_semaphore; pthread_detach(pthread_self()); for(;;) { NE_DEBUG(DEBUG_GNOME, "fetch_thread: sleeping...\n"); sem_wait(fetch_semaphore); gdk_threads_enter(); gtk_widget_set_sensitive(begin_fetch_button, FALSE); gtk_widget_set_sensitive(close_fetch_button, FALSE); ret = verifysite_gnome(selected_site); gdk_threads_leave(); if (ret) continue; /* start animation */ gdk_threads_enter(); NE_DEBUG (DEBUG_GNOME, "Verified correctness, beginning fetch...\n"); gnome_animator_start(GNOME_ANIMATOR(fetch_anim)); gdk_threads_leave(); /* commence the fetch */ ret = my_abortable_transfer_wrapper(selected_site, site_op_fetch); NE_DEBUG (DEBUG_GNOME, "Fetch terminated, checking return code...\n"); gdk_threads_enter(); /* Set the main label to indicate the terminated status. */ set_status_after_operation(ret, GTK_LABEL(fetch_message)); /* Stop the animation and restore standard dialog state. */ gtk_widget_set_sensitive(close_fetch_button, TRUE); gtk_widget_set_sensitive(begin_fetch_button, TRUE); gnome_animator_stop(GNOME_ANIMATOR(fetch_anim)); /* It's no longer modal when it's closed, right? */ /* gtk_window_set_modal(GTK_WINDOW(fetch_list_window), FALSE);*/ gdk_threads_leave(); } } void fe_fetch_found(const struct site_file *file) { gchar *info; gchar *col[1]; info = g_strdup_printf("Found information for %s.", file_name(file)); gdk_threads_enter(); gtk_label_set(GTK_LABEL(fetch_message), info); g_free(info); col[0] = file_name(file); gtk_clist_append(GTK_CLIST(fetch_clist), col); gdk_threads_leave(); return; } void fe_checksumming(const char *filename) { printf("Xsitecopy: checksumming %s...", filename); } void fe_checksummed(const char *filename, int success, const char *error) { if (success) printf("done.\n"); else printf("failed: %s.\n", error); } void *sync_thread(void *no_data) { return NULL; } sitecopy-0.16.6/gnome/minilist.c0000664000076400007640000001452210237450450014676 0ustar joejoe/* * XSitecopy, for managing remote web sites with a GNOME interface. * Copyright (C) 2000, Lee Mallabone * * 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. * */ #include "minilist.h" extern struct site *selected_site; /** the_gui should have been initialised to have a pointer to the data * it represents, pointers to the GtkCList and GtkEntry widgets, and * the chosen row should be -1. * If a GUI component hasn't been initialised, then the fact you can't * populate data is probably the least of our worries. */ void populate_minilist(struct slist_gui *the_gui) { struct fnlist *current; gchar *to_add[1]; if (!the_gui) { NE_DEBUG(DEBUG_GNOME, "WARNING! gui component was null that should not have been.\n"); return; } for (current = the_gui->data; current != NULL; current = current->next) { /* If the path is absolute, we actually want to display it without * modifying the original text. */ if (current->haspath) /* FIXME: This will barf when 'free'd. */ to_add[0] = g_strjoin(NULL, "/", current->pattern, NULL); else to_add[0] = current->pattern; the_gui->chosen_row = gtk_clist_append(GTK_CLIST(the_gui->list), to_add); gtk_clist_set_row_data(GTK_CLIST(the_gui->list), the_gui->chosen_row, (gpointer) current); } } void select_minilist_item(GtkWidget * list, gint row, gint column, GdkEventButton * event, gpointer data) { struct slist_gui *the_gui = (struct slist_gui *) data; gchar *to_change; the_gui->chosen_row = row; gtk_clist_get_text(GTK_CLIST(the_gui->list), row, 0, &to_change); gtk_entry_set_text(GTK_ENTRY(the_gui->entry), to_change); gtk_entry_select_region(GTK_ENTRY(the_gui->entry), 0, -1); } void change_minilist_entry(GtkWidget * entry, gpointer data) { gchar *text; extern gboolean rcfile_saved; struct slist_gui *the_gui = (struct slist_gui *) data; struct fnlist *selected_data_struct; if (the_gui->chosen_row < 0) return; selected_data_struct = (struct fnlist *) gtk_clist_get_row_data(GTK_CLIST(the_gui->list), the_gui->chosen_row); g_assert (selected_data_struct != NULL); g_assert (the_gui != NULL); text = strdup(gtk_entry_get_text(GTK_ENTRY(entry))); if (! xsc_replace_string(&(selected_data_struct->pattern), text)) return; gtk_clist_set_text(GTK_CLIST(the_gui->list), the_gui->chosen_row, 0, text); /* TODO: Find out how Joe allocates these things, and put in routines * to make sure any existing memory is always freed. */ selected_data_struct->haspath = FALSE; if (*text == '/') { selected_data_struct->haspath = TRUE; /* Strip that leading slash. */ selected_data_struct->pattern++; } gtk_widget_grab_focus(GTK_WIDGET(the_gui->entry)); rcfile_saved = FALSE; } void add_minilist_item(GtkWidget * button, gpointer data) { int added_row; gchar *to_add[1]; struct slist_gui *the_gui = (struct slist_gui *) data; struct fnlist *current, *new_one; if (!the_gui) { NE_DEBUG(DEBUG_GNOME, "WARNING: gui component was null.\n"); return; } to_add[0] = strdup("New filename or expression"); added_row = gtk_clist_append(GTK_CLIST(the_gui->list), to_add); current = the_gui->data; if (current != NULL) while (current->next != NULL) current = current->next; new_one = malloc(sizeof(struct fnlist)); new_one->pattern = to_add[0]; new_one->next = NULL; if (!current) { new_one->prev = NULL; the_gui->data = new_one; switch (the_gui->type) { case list_exclude: selected_site->excludes = the_gui->data; the_gui->data = selected_site->excludes; break; case list_ascii: selected_site->asciis = the_gui->data; the_gui->data = selected_site->asciis; break; case list_ignore: selected_site->ignores = the_gui->data; the_gui->data = selected_site->ignores; break; } } else { new_one->prev = current; current->next = new_one; } gtk_clist_set_row_data(GTK_CLIST(the_gui->list), added_row, (gpointer) new_one); gtk_clist_select_row(GTK_CLIST(the_gui->list), added_row, 0); } void remove_minilist_item(GtkWidget * button, gpointer data) { struct fnlist *current, *to_free; struct slist_gui *the_gui = (struct slist_gui *) data; if (!the_gui) { NE_DEBUG(DEBUG_GNOME, "Warning! gui thingy was null.\n"); return; } if (the_gui->chosen_row < 0) return; current = gtk_clist_get_row_data(GTK_CLIST(the_gui->list), the_gui->chosen_row); gtk_clist_remove(GTK_CLIST(the_gui->list), the_gui->chosen_row); to_free = current; if (current->prev) { current->prev->next = current->next; if (current->next) { current->next->prev = current->next->prev->prev; } } else { /* ick */ /* Small memory leak alert */ switch (the_gui->type) { case list_exclude: selected_site->excludes = the_gui->data->next; the_gui->data = selected_site->excludes; NE_DEBUG(DEBUG_GNOME, "Removing an item from the excludes list.\n"); break; case list_ascii: selected_site->asciis = the_gui->data->next; the_gui->data = selected_site->asciis; NE_DEBUG(DEBUG_GNOME, "Removing an item from the ASCIIs list.\n"); break; case list_ignore: selected_site->ignores = the_gui->data->next; the_gui->data = selected_site->ignores; NE_DEBUG(DEBUG_GNOME, "Removing an item from the ignores list.\n"); break; default: ; } if (the_gui->data) the_gui->data->prev = NULL; } the_gui->chosen_row = -1; gtk_entry_set_text(GTK_ENTRY(the_gui->entry), ""); free(to_free); } sitecopy-0.16.6/gnome/ChangeLog.xsitecopy0000664000076400007640000004015610165765223016513 0ustar joejoeSun Jan 13 21:04:23 2002 Joe Orton * gcommon.c (fe_login): Remove unnecessary g_strdup_printf. Address `unused local var' warning (Peter Moulder). 2002-01-09 Joe Orton Changes from Peter Moulder: * gcommon.c (gfe_status): Made `message' const. * operations.c (catchup_selected, initialized_selected, save_default): Fix memory leaks. 2002-01-09 Joe Orton * gnome/doc/*.htm: Removed from CVS (now generated at release time directly from xsitecopy.sgml). * gnome/doc/topic.dat: Updated for filenames produced by recent DocBook SGML tools. 2002-01-07 Joe Orton * gnome/misc.c (check_site_and_record_errors): Add return value if rcfile_verify fails. 2002-01-07 Joe Orton * gnome/file_widgets.c (file_view_clicked): Make private function static. 2002-01-07 Joe Orton * gnome/changes.c (change_port): Rename port to p to shadowing global symbol. 2002-01-06 Joe Orton * gnome/*.[ch]: Renamed DEBUG() calls to NE_DEBUG. * gnome/main.c (main): Renamed neon_debug_init call to ne_debug_init. 2002-01-06 Joe Orton * gnome/gcommon.c (fe_login): Updated for API change. 2002-01-06 Joe Orton * gnome/*.[ch]: Renamed fe_status to gfe_status. 2001-01-09 Lee Mallabone * operations.c: Fix bug where site details are accessed when no site has been selected. * tree.c: Make sure that the local directory is read when adding sites even if catching them up or doing an init. 2000-12-17 Joe Orton * new_site.c (create_site_druid): Fix typo. 2000-11-02 Lee Mallabone * new_site.c: Fix bug so delete_event is handled correctly. * operations.c, init.c: Changes to allow start_main_update() to handle update_all() as well as single sites. 2000-08-18 Lee Mallabone * gcommon.[ch]: Merge patch from Joe (change detailed below) into main source tree. Closed the bug reported and patched by Joe Pfeiffer. * gcommon.c: Implemented the correct fe_login stuff, thanks to David Knight for work on the screem upload Wizard that I backported to xsitecopy. * everything: make it compile and run again without instant death. 2000-06-28 Joe Orton * main.c: Update for neon debugging interface. * gcommon.c: Update for new fe_connection interface. * gcommon.h: Comment out redundant prototypes. 2000-05-07 Lee Mallabone * site_widgets.c: Fix bug where the site status is nearly *always* unsaved, even if it's actually saved. * changes.c: (change_detect_mode) Rescan the selected site after changing the file state. Fixes the mass of dangling pointers that were previously left around. * changes.c: Okay, so the memory hangling/usage on changing fields was sub-optimal . * gcommon.c: New function, xsc_replace_string(), saves on typing, and sorts out the changes.c mess. * minilist.c: More efficient memory (re)allocation. 2000-04-29 Lee Mallabone * tree.c, new_site.c: Minor messing around trying to find random bugs. Not much luck so far. 2000-04-22 Lee Mallabone * gcommon.c: New function, set_status_after_operation that provides a suitable message for a status label once fetch,update,resync have all finished. * operations.c: More skel code for the update_all thread. 2000-04-21 Lee Mallabone * misc.c, gcommon.c: Changes to sync up with the latest FE API changes in sitecopy 0.10pre. * new_site.c: Fixed a major blooper where first-use would stop the first site created from actually being added to the tree. 2000-04-10 Lee Mallabone * site_widgets.c, changes.c: Changed the state_method code to be a bit more useful. I think there are issues with rescan_selected though. Something is definately causing crashes. 2000-04-07 Lee Mallabone * operations.c, main.c: Changes to add decent abort handling for the new abort API. Skeleton code added for update_all and resync threads. 2000-03-25 Lee Mallabone * README.gnome: Add `hacking' information, update requirements and add a bit of descriptive blurb. * *.xpm: More pixmaps, removed the old cruft. 2000-03-16 Lee Mallabone * resync.c: Integrate threading into fetch mode properly, and add an animation to replace the (faulty) progress bar. * *.xpm: Added pixmaps and renamed the existing ones so that we now have consistent naming (and icons) for links, dirs & files. 2000-03-15 Lee Mallabone * site_widgets.c, changes.c: Removed all get_widget calls as doing so seems to reduce the amount of deadlock conditions, for a random reason. * file_widgets.c: Okay, for some reason it was the GdkDestroyNotify stuff added by glade which was causing the deadlock. removed. It didn't cause deadlock on a simple test case I wrote though. :( * misc.[ch]: New function, make_transfer_anim that returns a GnomeAnimator widget that will play in a specific direction. Will be useful now everything is almost properly threaded. * resync.c, main.c: New thread (and function) for doing a site_fetch. Untested as of yet. 2000-03-11 Lee Mallabone * tree.c, new_site.c: Make site creation (and editing in the same session) actually work properly. Who knows what I was on when I thought file scanning for new sites worked before now. 2000-03-10 Lee Mallabone * main.c, operations.c: Made the application run on 2 threads all the time. A thread for doing updates is now spawned at startup, and sleeps until the user clicks `update site'. Major issues with deadlock still remain though. 2000-03-09 Lee Mallabone * tree.c: Fixed a crash-instantly-on-startup bug where the app would just die if sites' local directories didn't exist. * misc.c, changes.c: Can now change the local directory of a site on the fly, without SEGV. Directory is re-read, and the sites tree is properly rescanned. * new_site.c: Ensure users can only pick a _directory_ for the local directory. 2000-03-07 Lee Mallabone * new_site.c: Fixed bug with moving back from the last page. 2000-02-08 Lee Mallabone * new_site.c: Cleaned a little. Server details are now persistant. Options, attributes, init or catchup are all now working. Just one more bug to nail and this file should be clean. 2000-02-07 Lee Mallabone * tree.c: Abstracted fill_tree_from_sites a little. No idea how this hadn't already been done. * new_site.c: Sites now add themselves to all_sites *and* the main CTree properly. 1999-12-12 Lee Mallabone * gcommon.c: Added *_abort* functions so that xsitecopy will now compile. Shipped files to Joe for 0.9.0, despite the very unstable and unfinished nature. 1999-10-08 Lee Mallabone * new_site.c: Removed a load of old cruft (most of the file actually) and replaced it with a nice GnomeDruid widget. Added callback skels. Still more to do here. 1999-10-07 Lee Mallabone * misc.c: Moved a load of relevant functions into tree.c. Deleted some old cruft, and re-arranged a few things to make it all more logical. 1999-10-04 Lee Mallabone * resynch.c: Got rid of the not-working legacy fetch-mode GUI, and added a nice new Glade generated one. * all files: Cleanups to all files. Now we get hardly any warnings with -Wall. * init.c: Noticed the 'update site' menu option wasn't actually connected to a signal. Fixed. * changes.c, site_widgets.c: Fixed the bug with strange port numbers getting changed. Implemented site options. (eg. nodelete, checkmoved). 1999-10-02 Lee Mallabone * minilist.c: Fixed the whole minilist problem. Deletion now works properly. 1999-09-29 Lee Mallabone * file_widgets.c (make_file_info_area): gnome_mime_info() seems to report directories as text/plain. Which, whether it's right or not, seems a bit crap to me. Fixed the bug where the view button would try and edit a directory. * tree.c: Big rewrite. We now have a proper hierarchical file/directory structure for xsitecopy. This involves an intermediate stage of GNodes before recursing over the data to create the GtkCTree contents. * misc.c: Changes & cleanups to accomodate the new tree code. * minilist.[ch]: Fixed bug where you couldn't create an item unless items already existed. This makes everything a little less generic, but hey. 1999-09-26 Lee Mallabone * site_widgets.c (make_site_info_area): Fixed bug where the ignore list wasn't getting populated. 1999-09-19 Lee Mallabone * tree.c: New file. Start of an algorithm to generate proper directory structures into the site trees. 1999-09-11 Lee Mallabone * init.c (xsitecopy_read_configuration): renamed fe_gnome_init(). Started adding code to read gnome-config info. Cleaned up some of what was already there. * minilist.[ch]: New files. These abstract out what would have been excludes.c, ascii.c and ignores.c. Thankfully I had the brain to realise it could all be done much nicer before wasting time on separate files. This is also fairly future proof. * site_widgets.c: Completely redesigned the site info/edit GUI. Made (imho) a really nice one with glade, and began incorporating it into the app. Long way to go yet due to Joe's API redesign. 1999-09-07 Lee Mallabone * site_widgets.c: Made the local directory widget sensitive. Can now change local directory on the fly. It's a little broken though. 1999-09-06 Lee Mallabone * misc.c: Added a proper rescan function. This can now be used from the operations menu, and can be called after adding/removing excludes, changing the local directory, adding files to your site while xsitecopy is running, etc. * operations.c: Changed refresh_site() into rebuild_node_files(). Should fix the "seg-fault when clicking a file, after an update" bug reported by Nick Silberstein. * misc.c: Made whether the site tree gets sorted or not a little more consistent. Will now be user-decidable. 1999-09-05 Lee Mallabone * misc.c: Rewrote the tree population code. Removed the thoroughly disgusting check_dir() function and cleaned code layout a little. * misc.h: Added a struct for accessing preferences information, in preparation for when I actually implement them. :) 1999-08-29 Lee Mallabone * file_widgets.c: plugged the (small) memory leak this file created. * misc.c: Started rewrite of the ctree populate code. 1999-08-29 Lee Mallabone * all files: renamed everything to remove the legacy fe_[gtk|gnome] prefixes. Hopefully it might be a little easier for other people to identify which files do what now. 1999-08-28 Lee Mallabone * fe_gtk_site_widgets.c: added #ifdef 0 around the web dav options as Joe disabled/made them default. 1999-08-23 Lee Mallabone * fe_gtk_site_ops.c: Changed upload dialog to a new, much more 'gnomified' dialog. Comments welcome. Disable 'cancel' ability though, as I can't get it working yet. 1999-08-21 Lee Mallabone * fe_gnome_common.c: Abstracted the rc_verifysite() stuff; everything that needs to should now be able to report site definition problems properly. * fe_gtk_main.c (create_site_errors_dialog): If there is a problem with the rcfile, xsitecopy will now popup a dialog on startup with all the problems, rather than just spewing a load of stuff all over the console. *fe_gtk_main.c (check_site_and_record_errors): Call rc_verifysite() on all the sites, and add any errors to the linked list 'errors'. 1999-08-18 Lee Mallabone * fe_gnome_common.c: Removed legacy code. * fe_gtk_main.c: quite a few changes that I've not updated the changelog about; now have 2 new webdav options. Cleaned up the quit "are you sure?" code. Made nicer dialogs with glade. 1999-07-02 Lee Mallabone * doc/xsitecopy.[sgml|html]: Minor updates to reflect latest status of the menu options. * fe_gnome_resynch.c: Disabled fetch mode for 0.6.10. * fe_gtk_main.c: Plugged a HUUUUGE memory leak. XSitecopy should now use sane amounts of memory, instead of the stupid amounts it previously used. This makes me happy. :) Finished site creation wizard. Seems to work well, but had problems creating a "scanning files..." dialog. 1999-07-01 Lee Mallabone * fe_gtk_excludes.c: Fixed a seg-fault bug when adding excludes to sites that didn't have any. 1999-06-30 Lee Mallabone * fe_gnome_common.c: Finally fixed the job progressbar bug. Now works a treat here. Also minor mem cleanups in fe_updated(). 1999-06-30 Lee Mallabone * fe_gnome_creation.c: Now uses the all new site creation wizard. 1999-06-30 Lee Mallabone * fe_gtk_changes.c: Memory alloc cleanups. Sites should use a little less memory now, in theory. 1999-06-29 Lee Mallabone * fe_gnome_new_site.c: slight cleanups. * fe_gtk_main.c: changes in preparation for new site creation wizard. * fe_gtk_changes.c: change_root_dir now works properly and is called by the focus-out-event. 1999-05-23 Lee Mallabone * fe_gnome_resynch.c: Fetch mode now working just fine. Could be a bit prettier, but the functionality is all there. 1999-05-23 Lee Mallabone * fe_gtk_main.c: Added in "Open new rcfile" capability. Preliminary fetch mode added. Still needs work though. Abstracted the fe_connect* stuff a bit so that it will work for update, fetch, *and* resynch modes. 1999-04-26 Lee Mallabone * fe_gtk_main.c: Grrr, nuked some changelog entries while trying to sync my code with Joe's. :( Refresh now works properly - thanks to people on gtk-list for that. Implemented editing a site's remote directory, including giving warnings for insane dirs. * rcfile.c: Changes to rcfile_write(). It should now actually be stable and not write rubbish for remote directories. 1999-04-18 Lee Mallabone * fe_gtk_main.c (refresh_site_node): Sorted out the refresh functions. Cleaned fe_gtk_main.c up a bit. Removed old, useless code. Can't understand why gtk_ctree_set_node_info seems to be setting my node labels as complete garbage. 1999-04-10 Lee Mallabone * xsitecopy.sgml, topic.dat: Pretty much finished off documenting the 'sites' widgets. * fe_gtk_main.c/h: Did a bit of abstraction. copy_a_file() now does just that. Added rcfile backup and restore functions. * fe_gnome_creation.c: Added rcfile backup/restore menu options. Disabled 'open' menu option again ready for a 0.5.2 release. 1999-04-09 Lee Mallabone * fe_gtk_main.c: Backup and restore options now fully working. * fe_gnome_creation.c: slight edit to menus. 1999-04-08 Lee Mallabone * fe_gnome_creation.c: Added backup_menu. * fe_gtk_main.c: Added backup_infofile(), restore_infofile(), and actual_restoration() to allow backing up of file states. 1999-04-06 Lee Mallabone * fe_gnome.c: Fixed a bug with closing the window and xsitecopy not actually terminating properly. 1999-04-05 Lee Mallabone * fe_gtk_main.c: saveas_request() and save_sites_as() added. Laid down some code for open a new rcfile. * fe_gnome_creation.c: Save as, added to file menu. 1999-04-02 Lee Mallabone * fe_gtk_site_widgets.c (make_site_info_area): added nooverwrite checkbox. * rcfile.c (rcfile_write): added support for nooverwrite option. * fe_gtk_main.c, fe_gnome.c: populate_site_node() flat tree view now an option. sitecopy-0.16.6/BUGS0000664000076400007640000000705311037463740012266 0ustar joejoe From Jan Hendrik Schreier: no display of protocol in standard banner line is confusing. --- SEGTERM during a --fetch gets a SIGSEGV --- Bugs in 0.11.4: - MacOS X 10.1 catchup/sitecopy not recording times properly doesn't *** possibly CPP fileset.h duplication bug - FTP fetch mode does MDTM for each file when 0.10.x didn't and is hence very slow for large sites (Dave Hollis) - rm foo; --synch brings back foo with 1970-01-01 modtime (Dave Hollis) --- From Kobaz Mi'Daire: If there is an "&" in a directory name on the remote end and you do a sitecopy -f, then try to preform a sync operation on the site, either using -u or -s, sitecopy thinks the directory has not been created, trys to create it, and fails because it already exists. Also if a directory on the remote end is all caps, this problem shows up as well. --- From: "Jean Jordaan" Currently, it looks like there are things that sitecopy silently ignores if it doesn't understand. For example, I had this: exclude Queries/makeTSV exclude Queries/makeMatrix exclude Queries/doReduce That was wrong; missing a leading slash. It should be: exclude /Queries/makeTSV exclude /Queries/makeMatrix exclude /Queries/doReduce But sitecopy didn't let me know that those excludes were being ignored. -- From: "Pascal Ung": trying not to use clear password inside .sitecopyrc (preferring, user and password challenge) we found that it doesn't work in the following case: the .htaccess contains kind of: require user webmaster enduser Order deny,allow Deny from all Allow from .userdomain.fr require user webmaster --- Volker Kuhlmann: ftp: echo_quit never set. --- On Thu, Apr 25, 2002 at 06:07:02PM +0200, Dave Hollis wrote: > After fetching and synchronizing I noticed that files which had been > updated by my colleague and consequently fetched, still had the date of > the old file after it had been overwritten. --- From: Luc Bastiaenssen To: sitecopy@lyra.org Subject: [sitecopy] large files Date: Tue, 07 Jun 2005 17:00:07 +0200 To get support for large files I've used following compile option as suggested in previous thread: export CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" But I also had to tweak 'src/sitestore.c' to avoid "filezize overflow" message --- On Sun, Jul 17, 2005 at 11:38:35PM +0200, Dirk Pirschel wrote: > Yes, i am using safe mode. We are two webmasters at this site, so that > safe mode is mandatory. ... > The best performance would be: Fetch the directory listing via ls -laR, > remove files which are excluded, and perform MDTM commands only on the > remaining files. sitecopy currently performs MDTM commands on every > (possibly excluded) file, and excludes the files later... :-( --- From: "Matthew Palmer" <320586@bugs.debian.org> Sitecopy has supported scp/sftp modes of transfer for a while now, however the manual page has no information on how to make it all work. - Matt --- From: Heiko Schlittermann I thing there's a bug or at least flaw: Even if 'safe' is specified in the config file, it deletes files on the server if the local copy is deleted and the server file changed meanwhile. Should it behave the same way as it does for file changes (refus to overwrite?) --- From: Wes Groleau When it needs to create or delete directories, it does them _after_ the contents. So if a tree is four levels deep, it takes four runs of sitecopy to update it. [occurs after a --fetch] sitecopy-0.16.6/README0000664000076400007640000000502010166227777012465 0ustar joejoe sitecopy allows you to easily maintain remote Web sites. The program will upload files to the server which have changed locally, and delete files from the server which have been removed locally, to keep the remote site synchronized with the local site, with a single command. sitecopy will also optionally try to spot files you move locally, and move them remotely. FTP, WebDAV and HTTP-based authoring servers are supported. sitecopy is designed to not care about what is actually on the remote server - it simply keeps a record of what it THINKS is in on the remote server, and work from that. * Read 'NEWS' for a list of changes in this release * Read 'INSTALL' for installation instructions * See the man page, doc/sitecopy.1 (or 'man sitecopy'), for instructions on how to start using sitecopy. * For information on the OS/2 port, see 'README.emx' * For information on the GNOME interface, see 'README.gnome' * Send bug reports, feature requests etc to * Web site at http://www.lyra.org/sitecopy/ * Discussion list: subscribe by mail to , or via the Web at http://www.lyra.org/mailman/listinfo/sitecopy/ sitecopy is: Copyright (C) 1998-2005 Joe Orton The GNOME frontend is: Copyright (C) 1999-2000 Lee Mallabone Portions are: Copyright (C) 1987-2004 Free Software Foundation, Inc Copyright (C) 1999-2000 Tommi Komulainen Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) Copyright (C) 2003 Nobuyuki Tsuchimura Copyright (C) 2004 Aleix Conchillo Flaque Copyright (C) 2004 David A Knight Copyright (C) 2004 Jiang Lei Copyright (C) 2004 Aleix Conchillo Flaque The bundled Expat XML parser is: Copyright (C) 1998 James Clark 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. sitecopy-0.16.6/autogen.sh0000775000076400007640000000047610165770043013604 0ustar joejoe#!/bin/sh -ex rm -rf config.cache autom4te*.cache test -f .version || echo -n 0.0.0 > .version ${ACLOCAL:-aclocal} -I m4/neon ${AUTOHEADER:-autoheader} ${AUTOCONF:-autoconf} cp /usr/share/libtool/config.sub . cp /usr/share/libtool/config.guess . rm -rf autom4te*.cache rm -rf intl cp -pr /usr/share/gettext/intl intl sitecopy-0.16.6/configure.in0000664000076400007640000001462410774672442014126 0ustar joejoednl This file is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Library General Public dnl License as published by the Free Software Foundation; either dnl version 2 of the License, or (at your option) any later version. dnl This library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Library General Public License for more details. dnl You should have received a copy of the GNU Library General Public License dnl along with this library; see the file COPYING.LIB. If not, write to dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. dnl This configure script is: dnl Copyright (C) 2000-2008 Joe Orton (joe@manyfish.co.uk) dnl Portions are: dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) dnl dnl Extract the version (sans LF) from .version, created at release-time. m4_define(sc_version, m4_translit(m4_include(.version), [ ])) AC_INIT([sitecopy], [sc_version], [sitecopy@lyra.org]) AC_CONFIG_SRCDIR(src/sites.c) AC_CONFIG_HEADER(config.h) EXTRAOBJS="" proto_msg="" top_builddir=`pwd` AC_DEFINE([_GNU_SOURCE], [1], [Always defined]) NEON_WITH_LIBS dnl Optional features AC_ARG_ENABLE(ftp, AC_HELP_STRING([--disable-ftp], [disable FTP support]),, [enable_ftp=yes]) AC_ARG_ENABLE(webdav, AC_HELP_STRING([--disable-webdav], [disable WebDAV support]),, [enable_webdav=yes]) AC_ARG_ENABLE(rsh, AC_HELP_STRING([--disable-rsh], [disable rsh/rcp support]),, [enable_rsh=yes]) AC_ARG_ENABLE(gnomefe, AC_HELP_STRING([--enable-gnomefe], [enable GNOME front end])) dnl Check for programs AC_PROG_CC AC_PROG_MAKE_SET AC_ISC_POSIX AC_PROG_INSTALL AC_LANG_C AC_C_INLINE AC_C_CONST AC_HEADER_STDC AC_EXEEXT if test "$enable_ftp" = "yes"; then EXTRAOBJS="$EXTRAOBJS src/ftp.o src/ftpdriver.o" proto_msg="FTP" AC_DEFINE(USE_FTP, 1, [Define to compile the FTP protocol driver]) fi if test "$enable_webdav" = "yes"; then # Add the required DAV objects to NEONOBJS proto_msg="WebDAV ${proto_msg}" EXTRAOBJS="$EXTRAOBJS src/davdriver.o" AC_DEFINE(USE_DAV, 1, [Define to compile the WebDAV protocol driver]) fi # XML parser support is always required NEON_NEED_XML_PARSER=yes if test "$enable_rsh" = "yes"; then EXTRAOBJS="$EXTRAOBJS src/rshdriver.o" proto_msg="rsh/rcp ${proto_msg}" AC_DEFINE(USE_RSH, 1, [Define to compile the rsh/rcp protocol driver]) fi AC_ARG_ENABLE(sftp, AC_HELP_STRING([--disable-sftp], [disable sftp/ssh support]),, [enable_sftp=no AC_CHECK_FUNCS([socketpair pipe], [enable_sftp=yes; break]) ]) if test "$enable_sftp" = "yes"; then EXTRAOBJS="$EXTRAOBJS src/sftpdriver.o" proto_msg="sftp/ssh ${proto_msg}" AC_DEFINE([USE_SFTP], 1, [Define to compile the sftp/ssh protocol driver]) fi dnl Strip the binary in debug mode. NEON_DEBUG(,[LDFLAGS="-s $LDFLAGS"]) dnl Check for library functions AC_CACHE_CHECK([for GNU fnmatch], [sc_cv_gnu_fnmatch], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int flags = FNM_LEADING_DIR;]])], [sc_cv_gnu_fnmatch=yes], [sc_cv_gnu_fnmatch=no])]) if test "$sc_cv_gnu_fnmatch" = "no"; then AC_LIBOBJ(lib/fnmatch) fi # Support neon 0.24 through 0.28 NE_REQUIRE_VERSIONS([0], [24 25 26 27 28]) dnl But we don't use zlib or ACL support NEON_WITHOUT_ZLIB NEON_WITHOUT_ACL dnl Build neon NEON_VPATH_BUNDLED(["\$(top_srcdir)/lib/neon"], ["\$(top_builddir)/lib/neon"], [ NEON_XML_PARSER([\$(top_srcdir)/lib/expat], [\$(top_builddir)/lib/expat]) NEON_NORMAL_BUILD ]) dnl Check for getopt_long AC_CHECK_FUNC(getopt_long,,[AC_LIBOBJ(lib/getopt) AC_LIBOBJ(lib/getopt1)]) dnl Check for strcasecmp AC_CHECK_FUNC(strcasecmp,,[AC_LIBOBJ(lib/strcasecmp)]) dnl Check for stuff AC_CHECK_FUNCS(strdup strsignal strerror memcpy setlocale nl_langinfo) AC_TYPE_SIGNAL AC_CHECK_HEADERS(stdarg.h string.h strings.h sys/time.h regex.h \ locale.h langinfo.h stdlib.h unistd.h limits.h sys/select.h fcntl.h) SOCKLEN_ARG_TYPE if test "$enable_gnomefe" = "yes"; then AC_CHECK_LIB(pthread, pthread_create, gnome_is_ok=yes, gnome_is_ok=no) AM_PATH_LIBGLADE([],[],[gnome]) fi ALL_LINGUAS="ru fr cs ja de tr nn it" AM_GNU_GETTEXT([no-libtool]) if test "$USE_NLS" = "yes"; then if test "$USE_INCLUDED_LIBINTL" = "yes"; then nls_msg="Built using included libintl" CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl" else nls_msg="Built using native support" fi else nls_msg="Not built" fi NEON_WARNINGS dnl -------------------------------- dnl FE configuration dnl -------------------------------- if test "$enable_gnomefe" = "yes"; then if test "$gnome_is_ok" = "yes"; then EXTRAOBJS="$EXTRAOBJS \$(GNOMEOBJS)" LIBS="$LIBS $GNOME_LIBS $GTK_LIBS $GNOME_LIBDIR $GNOMEUI_LIBS $LIBGLADE_LIBS" CPPFLAGS="$CPPFLAGS $GNOME_INCLUDEDIR $LIBGLADE_CFLAGS" GNOME_SC_HELPDIR="`gnome-config --datadir`/gnome/help/xsitecopy" SHORTCUT_LOCATION="`gnome-config --datadir`/gnome/apps/Internet" TARGET="xsitecopy" fe_msg="GNOME" else AC_MSG_ERROR([could not find the required GNOME libraries]) fi else # Console front end EXTRAOBJS="$EXTRAOBJS src/console_fe.o" AC_LIBOBJ(lib/rpmatch) AC_LIBOBJ(lib/yesno) fe_msg="Console" TARGET="sitecopy" fi # This goes in CPPFLAGS so libneon/Makefile can pick up config.h CPPFLAGS="$CPPFLAGS -I\$(top_builddir)" dnl Makefile substitutions AC_SUBST(GNOME_SC_HELPDIR) AC_SUBST(XSC_HELP) AC_SUBST(SHORTCUT_LOCATION) AC_SUBST(EXTRAOBJS) AC_SUBST(TARGET) AC_CONFIG_FILES([Makefile lib/neon/Makefile po/Makefile.in intl/Makefile]) AC_OUTPUT AC_MSG_NOTICE([Configured sitecopy $PACKAGE_VERSION: Install prefix: ${prefix} Compiler: ${CC} Frontend: ${fe_msg} (executable named '${TARGET}') Supported protocols: ${proto_msg} neon library: ${neon_library_message} XML Parser: ${neon_xml_parser_message} SSL library: ${ne_SSL_message} Internationalization: ${nls_msg} ]) if test "$enable_gnomefe" = "yes"; then AC_MSG_NOTICE([The GNOME frontend is currently unmaintained.]) fi # Create all the necessary directories for VPATH builds. for i in gnome src intl lib/expat lib/expat/xmltok lib/expat/gennmtab \ lib/expat/xmlparse; do test -d $i || mkdir $i done sitecopy-0.16.6/aclocal.m40000664000076400007640000041140311037462374013443 0ustar joejoe# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # codeset.m4 serial 2 (gettext-0.16) dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET); return !cs;], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) # gettext.m4 serial 60 (gettext-0.17) dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) # glibc2.m4 serial 1 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.0 or newer. # From Bruno Haible. AC_DEFUN([gt_GLIBC2], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, ac_cv_gnu_library_2, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2=yes, ac_cv_gnu_library_2=no) ] ) AC_SUBST(GLIBC2) GLIBC2="$ac_cv_gnu_library_2" ] ) # glibc21.m4 serial 3 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([gl_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) # iconv.m4 serial AM6 (gettext-0.17) dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_TRY_RUN([ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) # intdiv0.m4 serial 2 (gettext-0.17) dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ gt_cv_int_divbyzero_sigfpe= changequote(,)dnl case "$host_os" in macos* | darwin[6-9]* | darwin[1-9][0-9]*) # On MacOS X 10.2 or newer, just assume the same as when cross- # compiling. If we were to perform the real test, 1 Crash Report # dialog window would pop up. case "$host_cpu" in i[34567]86 | x86_64) gt_cv_int_divbyzero_sigfpe="guessing yes" ;; esac ;; esac changequote([,])dnl if test -z "$gt_cv_int_divbyzero_sigfpe"; then AC_TRY_RUN([ #include #include static void sigfpe_handler (int sig) { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. changequote(,)dnl case "$host_cpu" in alpha* | i[34567]86 | x86_64 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac changequote([,])dnl ]) fi ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) # intl.m4 serial 8 (gettext-0.17) dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006. AC_PREREQ(2.52) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([gt_GLIBC2])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([gl_VISIBILITY])dnl AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl AC_REQUIRE([gt_TYPE_WCHAR_T])dnl AC_REQUIRE([gt_TYPE_WINT_T])dnl AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gt_TYPE_INTMAX_T]) AC_REQUIRE([gt_PRINTF_POSIX]) AC_REQUIRE([gl_GLIBC21])dnl AC_REQUIRE([gl_XSIZE])dnl AC_REQUIRE([gt_INTL_MACOSX])dnl AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). gt_CHECK_DECL(_snprintf, [#include ]) gt_CHECK_DECL(_snwprintf, [#include ]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(getc_unlocked, [#include ]) case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi AC_SUBST([HAVE_ASPRINTF]) if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi AC_SUBST([HAVE_SNPRINTF]) if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi AC_SUBST([HAVE_WPRINTF]) AM_LANGINFO_CODESET gt_LC_MESSAGES dnl Compilation on mingw and Cygwin needs special Makefile rules, because dnl 1. when we install a shared library, we must arrange to export dnl auxiliary pointer variables for every exported variable, dnl 2. when we install a shared library and a static library simultaneously, dnl the include file specifies __declspec(dllimport) and therefore we dnl must arrange to define the auxiliary pointer variables for the dnl exported variables _also_ in the static library. if test "$enable_shared" = yes; then case "$host_os" in mingw* | cygwin*) is_woe32dll=yes ;; *) is_woe32dll=no ;; esac else is_woe32dll=no fi WOE32DLL=$is_woe32dll AC_SUBST([WOE32DLL]) dnl On mingw and Cygwin, we can activate special Makefile rules which add dnl version information to the shared libraries and executables. case "$host_os" in mingw* | cygwin*) is_woe32=yes ;; *) is_woe32=no ;; esac WOE32=$is_woe32 AC_SUBST([WOE32]) if test $WOE32 = yes; then dnl Check for a program that compiles Windows resource files. AC_CHECK_TOOL([WINDRES], [windres]) fi dnl Determine whether when creating a library, "-lc" should be passed to dnl libtool or not. On many platforms, it is required for the libtool option dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool dnl in the *.la files - makes it impossible to create multithreaded programs, dnl because libtool also reorders the -lc to come before the -pthread, and dnl this disables pthread_create() . case "$host_os" in hpux*) LTLIBC="" ;; *) LTLIBC="-lc" ;; esac AC_SUBST([LTLIBC]) dnl Rename some macros and functions used for locking. AH_BOTTOM([ #define __libc_lock_t gl_lock_t #define __libc_lock_define gl_lock_define #define __libc_lock_define_initialized gl_lock_define_initialized #define __libc_lock_init gl_lock_init #define __libc_lock_lock gl_lock_lock #define __libc_lock_unlock gl_lock_unlock #define __libc_lock_recursive_t gl_recursive_lock_t #define __libc_lock_define_recursive gl_recursive_lock_define #define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized #define __libc_lock_init_recursive gl_recursive_lock_init #define __libc_lock_lock_recursive gl_recursive_lock_lock #define __libc_lock_unlock_recursive gl_recursive_lock_unlock #define glthread_in_use libintl_thread_in_use #define glthread_lock_init libintl_lock_init #define glthread_lock_lock libintl_lock_lock #define glthread_lock_unlock libintl_lock_unlock #define glthread_lock_destroy libintl_lock_destroy #define glthread_rwlock_init libintl_rwlock_init #define glthread_rwlock_rdlock libintl_rwlock_rdlock #define glthread_rwlock_wrlock libintl_rwlock_wrlock #define glthread_rwlock_unlock libintl_rwlock_unlock #define glthread_rwlock_destroy libintl_rwlock_destroy #define glthread_recursive_lock_init libintl_recursive_lock_init #define glthread_recursive_lock_lock libintl_recursive_lock_lock #define glthread_recursive_lock_unlock libintl_recursive_lock_unlock #define glthread_recursive_lock_destroy libintl_recursive_lock_destroy #define glthread_once libintl_once #define glthread_once_call libintl_once_call #define glthread_once_singlethreaded libintl_once_singlethreaded ]) ]) dnl Checks for the core files of the intl subdirectory: dnl dcigettext.c dnl eval-plural.h dnl explodename.c dnl finddomain.c dnl gettextP.h dnl gmo.h dnl hash-string.h hash-string.c dnl l10nflist.c dnl libgnuintl.h.in (except the *printf stuff) dnl loadinfo.h dnl loadmsgcat.c dnl localealias.c dnl log.c dnl plural-exp.h plural-exp.c dnl plural.y dnl Used by libglocale. AC_DEFUN([gt_INTL_SUBDIR_CORE], [ AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gl_LOCK])dnl AC_TRY_LINK( [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }], [], [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1, [Define to 1 if the compiler understands __builtin_expect.])]) AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h]) AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \ stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \ argz_next __fsetlocking]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(feof_unlocked, [#include ]) gt_CHECK_DECL(fgets_unlocked, [#include ]) AM_ICONV dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined, dnl and a _NL_LOCALE_NAME macro always. AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name, [AC_TRY_LINK([#include #include ], [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES)); return !cs; ], gt_cv_nl_locale_name=yes, gt_cv_nl_locale_name=no) ]) if test $gt_cv_nl_locale_name = yes; then AC_DEFINE(HAVE_NL_LOCALE_NAME, 1, [Define if you have and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.]) fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi ]) dnl gt_CHECK_DECL(FUNC, INCLUDES) dnl Check whether a function is declared. AC_DEFUN([gt_CHECK_DECL], [ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, [AC_TRY_COMPILE([$2], [ #ifndef $1 char *p = (char *) $1; #endif ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) if test $ac_cv_have_decl_$1 = yes; then gt_value=1 else gt_value=0 fi AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) ]) # intlmacosx.m4 serial 1 (gettext-0.17) dnl Copyright (C) 2004-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on MacOS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], gt_cv_func_CFPreferencesCopyAppValue, [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) # intmax.m4 serial 3 (gettext-0.16) dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the system has the 'intmax_t' type, but don't attempt to dnl find a replacement if it is lacking. AC_DEFUN([gt_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, [AC_TRY_COMPILE([ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) fi ]) # inttypes-pri.m4 serial 4 (gettext-0.16) dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.52) # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_CHECK_HEADERS([inttypes.h]) if test $ac_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) PRI_MACROS_BROKEN=1 else PRI_MACROS_BROKEN=0 fi AC_SUBST([PRI_MACROS_BROKEN]) ]) # inttypes_h.m4 serial 7 dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1; return !i;], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) # lcmessage.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995. # Check whether LC_MESSAGES is available in . AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) if test $gt_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi ]) # lib-ld.m4 serial 3 (gettext-0.13) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) # lib-link.m4 serial 13 (gettext-0.17) dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.54) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Autoconf >= 2.61 supports dots in --with options. define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], [ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` LIB[]NAME[]_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) # lib-prefix.m4 serial 5 (gettext-0.15) dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing dnl the basename of the libdir, either "lib" or "lib64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. The current dnl practice is that on a system supporting 32-bit and 64-bit instruction dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit dnl libraries go under $prefix/lib. We determine the compiler's default dnl mode by looking at the compiler's library search path. If at least dnl of its elements ends in /lib64 or points to a directory whose absolute dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the dnl default, namely "lib". acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ]) # a macro to get the libs/cflags for libglade # serial 1 dnl AM_PATH_LIBGLADE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]) dnl Test to see if libglade is installed, and define LIBGLADE_CFLAGS, LIBS dnl AC_DEFUN([AM_PATH_LIBGLADE], [dnl dnl Get the cflags and libraries from the libglade-config script dnl AC_ARG_WITH(libglade-config, [ --with-libglade-config=LIBGLADE_CONFIG Location of libglade-config], LIBGLADE_CONFIG="$withval") module_args= for module in . $3; do case "$module" in gnome) module_args="$module_args gnome" ;; bonobo) module_args="$module_args bonobo" ;; gnomedb) module_args="$module_args gnomedb" ;; esac done AC_PATH_PROG(LIBGLADE_CONFIG, libglade-config, no) AC_MSG_CHECKING(for libglade) if test "$LIBGLADE_CONFIG" = "no"; then AC_MSG_RESULT(no) ifelse([$2], , :, [$2]) else if $LIBGLADE_CONFIG --check $module_args; then LIBGLADE_CFLAGS=`$LIBGLADE_CONFIG --cflags $module_args` LIBGLADE_LIBS=`$LIBGLADE_CONFIG --libs $module_args` AC_MSG_RESULT(yes) ifelse([$1], , :, [$1]) else echo "*** libglade was not compiled with support for $module_args" 1>&2 AC_MSG_RESULT(no) ifelse([$2], , :, [$2]) fi fi AC_SUBST(LIBGLADE_CFLAGS) AC_SUBST(LIBGLADE_LIBS) ]) # lock.m4 serial 7 (gettext-0.17) dnl Copyright (C) 2005-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Tests for a multithreading library to be used. dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS, dnl USE_PTH_THREADS, USE_WIN32_THREADS dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with dnl libtool). dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for dnl programs that really need multithread functionality. The difference dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread". dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl multithread-safe programs. AC_DEFUN([gl_LOCK_EARLY], [ AC_REQUIRE([gl_LOCK_EARLY_BODY]) ]) dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once. AC_DEFUN([gl_LOCK_EARLY_BODY], [ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that dnl influences the result of the autoconf tests that test for *_unlocked dnl declarations, on AIX 5 at least. Therefore it must come early. AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl AC_BEFORE([$0], [gl_ARGP])dnl AC_REQUIRE([AC_CANONICAL_HOST]) dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems. dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes dnl AC_GNU_SOURCE. m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], [AC_REQUIRE([AC_GNU_SOURCE])]) dnl Check for multithreading. AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) AC_HELP_STRING([--disable-threads], [build without multithread safety]), [gl_use_threads=$enableval], [case "$host_os" in dnl Disable multithreading by default on OSF/1, because it interferes dnl with fork()/exec(): When msgexec is linked with -lpthread, its child dnl process gets an endless segmentation fault inside execvp(). osf*) gl_use_threads=no ;; *) gl_use_threads=yes ;; esac ]) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # For using : case "$host_os" in osf*) # On OSF/1, the compiler needs the flag -D_REENTRANT so that it # groks . cc also understands the flag -pthread, but # we don't use it because 1. gcc-2.95 doesn't understand -pthread, # 2. putting a flag into CPPFLAGS that has an effect on the linker # causes the AC_TRY_LINK test below to succeed unexpectedly, # leading to wrong values of LIBTHREAD and LTLIBTHREAD. CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of 'errno' in . case "$host_os" in aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac fi ]) dnl The guts of gl_LOCK. Needs to be expanded only once. AC_DEFUN([gl_LOCK_BODY], [ AC_REQUIRE([gl_LOCK_EARLY_BODY]) gl_threads_api=none LIBTHREAD= LTLIBTHREAD= LIBMULTITHREAD= LTLIBMULTITHREAD= if test "$gl_use_threads" != no; then dnl Check whether the compiler and linker support weak declarations. AC_MSG_CHECKING([whether imported symbols can be declared weak]) gl_have_weak=no AC_TRY_LINK([extern void xyzzy (); #pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes]) AC_MSG_RESULT([$gl_have_weak]) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that # it groks . It's added above, in gl_LOCK_EARLY_BODY. AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no) if test "$gl_have_pthread_h" = yes; then # Other possible tests: # -lpthreads (FSU threads, PCthreads) # -lgthreads gl_have_pthread= # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist # in libc. IRIX 6.5 has the first one in both libc and libpthread, but # the second one only in libpthread, and lock.c needs it. AC_TRY_LINK([#include ], [pthread_mutex_lock((pthread_mutex_t*)0); pthread_mutexattr_init((pthread_mutexattr_t*)0);], [gl_have_pthread=yes]) # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) if test -n "$gl_have_pthread"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. AC_CHECK_LIB(pthread, pthread_kill, [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. # Therefore pthread_in_use() needs to actually try to create a # thread: pthread_create from libc will fail, whereas # pthread_create will actually create a thread. case "$host_os" in solaris* | hpux*) AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1, [Define if the pthread_in_use() detection is hard.]) esac ]) else # Some library is needed. Try libpthread and libc_r. AC_CHECK_LIB(pthread, pthread_kill, [gl_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread]) if test -z "$gl_have_pthread"; then # For FreeBSD 4. AC_CHECK_LIB(c_r, pthread_kill, [gl_have_pthread=yes LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r]) fi fi if test -n "$gl_have_pthread"; then gl_threads_api=posix AC_DEFINE([USE_POSIX_THREADS], 1, [Define if the POSIX multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then AC_DEFINE([USE_POSIX_THREADS_WEAK], 1, [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. AC_CHECK_TYPE([pthread_rwlock_t], [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1, [Define if the POSIX multithreading library has read/write locks.])], [], [#include ]) # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. AC_TRY_COMPILE([#include ], [#if __FreeBSD__ == 4 error "No, in FreeBSD 4.0 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; #endif], [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, [Define if the defines PTHREAD_MUTEX_RECURSIVE.])]) fi fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then gl_have_solaristhread= gl_save_LIBS="$LIBS" LIBS="$LIBS -lthread" AC_TRY_LINK([#include #include ], [thr_self();], [gl_have_solaristhread=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then gl_threads_api=solaris LIBTHREAD=-lthread LTLIBTHREAD=-lthread LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" AC_DEFINE([USE_SOLARIS_THREADS], 1, [Define if the old Solaris multithreading library can be used.]) if test $gl_have_weak = yes; then AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1, [Define if references to the old Solaris multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi fi fi if test "$gl_use_threads" = pth; then gl_save_CPPFLAGS="$CPPFLAGS" AC_LIB_LINKFLAGS(pth) gl_have_pth= gl_save_LIBS="$LIBS" LIBS="$LIBS -lpth" AC_TRY_LINK([#include ], [pth_self();], gl_have_pth=yes) LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then gl_threads_api=pth LIBTHREAD="$LIBPTH" LTLIBTHREAD="$LTLIBPTH" LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" AC_DEFINE([USE_PTH_THREADS], 1, [Define if the GNU Pth multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then AC_DEFINE([USE_PTH_THREADS_WEAK], 1, [Define if references to the GNU Pth multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi else CPPFLAGS="$gl_save_CPPFLAGS" fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then if { case "$host_os" in mingw*) true;; *) false;; esac }; then gl_threads_api=win32 AC_DEFINE([USE_WIN32_THREADS], 1, [Define if the Win32 multithreading API can be used.]) fi fi fi fi AC_MSG_CHECKING([for multithread API to use]) AC_MSG_RESULT([$gl_threads_api]) AC_SUBST(LIBTHREAD) AC_SUBST(LTLIBTHREAD) AC_SUBST(LIBMULTITHREAD) AC_SUBST(LTLIBMULTITHREAD) ]) AC_DEFUN([gl_LOCK], [ AC_REQUIRE([gl_LOCK_EARLY]) AC_REQUIRE([gl_LOCK_BODY]) gl_PREREQ_LOCK ]) # Prerequisites of lib/lock.c. AC_DEFUN([gl_PREREQ_LOCK], [ AC_REQUIRE([AC_C_INLINE]) ]) dnl Survey of platforms: dnl dnl Platform Available Compiler Supports test-lock dnl flavours option weak result dnl --------------- --------- --------- -------- --------- dnl Linux 2.4/glibc posix -lpthread Y OK dnl dnl GNU Hurd/glibc posix dnl dnl FreeBSD 5.3 posix -lc_r Y dnl posix -lkse ? Y dnl posix -lpthread ? Y dnl posix -lthr Y dnl dnl FreeBSD 5.2 posix -lc_r Y dnl posix -lkse Y dnl posix -lthr Y dnl dnl FreeBSD 4.0,4.10 posix -lc_r Y OK dnl dnl NetBSD 1.6 -- dnl dnl OpenBSD 3.4 posix -lpthread Y OK dnl dnl MacOS X 10.[123] posix -lpthread Y OK dnl dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK dnl dnl HP-UX 11 posix -lpthread N (cc) OK dnl Y (gcc) dnl dnl IRIX 6.5 posix -lpthread Y 0.5 dnl dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK dnl dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK dnl -lpthread (gcc) Y dnl dnl Cygwin posix -lpthread Y OK dnl dnl Any of the above pth -lpth 0.0 dnl dnl Mingw win32 N OK dnl dnl BeOS 5 -- dnl dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is dnl turned off: dnl OK if all three tests terminate OK, dnl 0.5 if the first test terminates OK but the second one loops endlessly, dnl 0.0 if the first test already loops endlessly. # longlong.m4 serial 13 dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. # This fixes a bug in Autoconf 2.61, but can be removed once we # assume 2.62 everywhere. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), HAVE_LONG_LONG_INT will not be # defined. In this case you can treat 'long long int' like 'long int'. AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], [AC_LINK_IFELSE( [_AC_TYPE_LONG_LONG_SNIPPET], [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. dnl If cross compiling, assume the bug isn't important, since dnl nobody cross compiles for this platform as far as we know. AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[@%:@include @%:@ifndef LLONG_MAX @%:@ define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) @%:@ define LLONG_MAX (HALF - 1 + HALF) @%:@endif]], [[long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0;]])], [ac_cv_type_long_long_int=yes], [ac_cv_type_long_long_int=no], [ac_cv_type_long_long_int=yes])], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then AC_DEFINE([HAVE_LONG_LONG_INT], 1, [Define to 1 if the system has the type `long long int'.]) fi ]) # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. # This fixes a bug in Autoconf 2.61, but can be removed once we # assume 2.62 everywhere. # Note: If the type 'unsigned long long int' exists but is only 32 bits # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT # will not be defined. In this case you can treat 'unsigned long long int' # like 'unsigned long int'. AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ AC_CACHE_CHECK([for unsigned long long int], [ac_cv_type_unsigned_long_long_int], [AC_LINK_IFELSE( [_AC_TYPE_LONG_LONG_SNIPPET], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) # Expands to a C program that can be used to test for simultaneous support # of 'long long' and 'unsigned long long'. We don't want to say that # 'long long' is available if 'unsigned long long' is not, or vice versa, # because too many programs rely on the symmetry between signed and unsigned # integer types (excluding 'bool'). AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], [ AC_LANG_PROGRAM( [[/* Test preprocessor. */ #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) error in preprocessor; #endif #if ! (18446744073709551615ULL <= -1ull) error in preprocessor; #endif /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63;]], [[/* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull));]]) ]) # nls.m4 serial 3 (gettext-0.15) dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) # po.m4 serial 15 (gettext-0.17) dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.17]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" < #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, [ AC_EGREP_CPP(notposix, [ #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif ], gt_cv_func_printf_posix="guessing no", gt_cv_func_printf_posix="guessing yes") ]) ]) case $gt_cv_func_printf_posix in *yes) AC_DEFINE(HAVE_POSIX_PRINTF, 1, [Define if your printf() function supports format strings with positions.]) ;; esac ]) # progtest.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. AC_PREREQ(2.50) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # size_max.m4 serial 6 dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS(stdint.h) dnl First test whether the system already has SIZE_MAX. AC_MSG_CHECKING([for SIZE_MAX]) AC_CACHE_VAL([gl_cv_size_max], [ gl_cv_size_max= AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], gl_cv_size_max=yes) if test -z "$gl_cv_size_max"; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. Try hard to find a definition that can dnl be used in a preprocessor #if, i.e. doesn't contain a cast. AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], [#include #include ], size_t_bits_minus_1=) AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], [#include ], fits_in_uint=) if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_TRY_COMPILE([#include extern size_t foo; extern unsigned long foo; ], [], fits_in_uint=0) fi dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl works only with 'long' integers in the host environment, while we dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. if test $fits_in_uint = 1; then gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else dnl Shouldn't happen, but who knows... gl_cv_size_max='((size_t)~(size_t)0)' fi fi ]) AC_MSG_RESULT([$gl_cv_size_max]) if test "$gl_cv_size_max" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi ]) dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. dnl Remove this when we can assume autoconf >= 2.61. m4_ifdef([AC_COMPUTE_INT], [], [ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) ]) # stdint_h.m4 serial 6 dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1; return !i;], gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) # uintmax_t.m4 serial 10 dnl Copyright (C) 1997-2004, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. AC_PREREQ(2.13) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) test $ac_cv_type_unsigned_long_long_int = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) else AC_DEFINE(HAVE_UINTMAX_T, 1, [Define if you have the 'uintmax_t' type in or .]) fi ]) # visibility.m4 serial 1 (gettext-0.15) dnl Copyright (C) 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Tests whether the compiler supports the command-line option dnl -fvisibility=hidden and the function and variable attributes dnl __attribute__((__visibility__("hidden"))) and dnl __attribute__((__visibility__("default"))). dnl Does *not* test for __visibility__("protected") - which has tricky dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on dnl MacOS X. dnl Does *not* test for __visibility__("internal") - which has processor dnl dependent semantics. dnl Does *not* test for #pragma GCC visibility push(hidden) - which is dnl "really only recommended for legacy code". dnl Set the variable CFLAG_VISIBILITY. dnl Defines and sets the variable HAVE_VISIBILITY. AC_DEFUN([gl_VISIBILITY], [ AC_REQUIRE([AC_PROG_CC]) CFLAG_VISIBILITY= HAVE_VISIBILITY=0 if test -n "$GCC"; then AC_MSG_CHECKING([for simple visibility declarations]) AC_CACHE_VAL(gl_cv_cc_visibility, [ gl_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" AC_TRY_COMPILE( [extern __attribute__((__visibility__("hidden"))) int hiddenvar; extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void);], [], gl_cv_cc_visibility=yes, gl_cv_cc_visibility=no) CFLAGS="$gl_save_CFLAGS"]) AC_MSG_RESULT([$gl_cv_cc_visibility]) if test $gl_cv_cc_visibility = yes; then CFLAG_VISIBILITY="-fvisibility=hidden" HAVE_VISIBILITY=1 fi fi AC_SUBST([CFLAG_VISIBILITY]) AC_SUBST([HAVE_VISIBILITY]) AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) ]) # wchar_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wchar_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, [AC_TRY_COMPILE([#include wchar_t foo = (wchar_t)'\0';], , gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) fi ]) # wint_t.m4 serial 2 (gettext-0.17) dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, [AC_TRY_COMPILE([ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) fi ]) # xsize.m4 serial 3 dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS(stdint.h) ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) m4_include([m4/neon/neon-xml-parser.m4]) m4_include([m4/neon/neon.m4]) m4_include([m4/neon/socklen-arg-type.m4]) sitecopy-0.16.6/tests/0000775000076400007640000000000011037462323012734 5ustar joejoesitecopy-0.16.6/tests/server.test0000775000076400007640000000453010165765223015156 0ustar joejoe#! /bin/sh # Server testing. # Pass sitename as argument #1, directory as argument #2, logfile as #3 # PRECONDITIONS: Localdir, remote dir empty, .sitecopy/sitename empty # TODO: Check whether preconditions hold. failexit() { echo echo FAIL: on test: $1 echo $tests completed successfully before failure. echo exit 1 } runsitecopy() { sitecopy $scargs $* $sitename 1>&3 2>&4 return $? } # Called for a test which should succeed # with sitecopy optype as arg 1, test name as arg 2 oktest() { echo "***** Test: $2 *****" 1>&3 1>&4 echo "Runing test: $2" if ! runsitecopy $1; then echo "- Test failed." failexit $2 else echo "- Test succeeded." fi tests=$[ tests + 1 ]; } # Called for a test which should fail # with sitecopy optype as arg 1, test name as arg 2 failtest() { # Failure test echo "Running test: $2" echo "***** Test: $2 *****" >&3 >&4 if runsitecopy $1; then echo "- Test failed." failexit else echo "- Test succeeded." fi tests=$[ tests + 1 ]; } if [ $# -ne 3 ]; then echo Usage: $0 sitename localdir logfile exit -1 fi ### Set this appropriately ### scargs="--debug=9" tests=0 sitename=$1 ldir=$2 cd $ldir logfile=$3-out debugfile=$3-debug # Use fd 3 for the logfile exec 3> $logfile exec 4> $debugfile echo Logging started 1>&3 #### Create directory mkdir foo oktest --update "Create directory" ### Upload file echo "hello world" > foo/file oktest --update "Upload file" ### Move file mv foo/file file oktest --update "Move file" ### Remove directory rmdir foo oktest --update "Remove directory" ### Remove file rm file oktest --update "Remove file" ### Uploading weird filenames touch "this>a>weird>name" oktest --update "Upload weird filename" ### Fetching weird filenames oktest --fetch "Fetch weird filename" ### Deleting weird filenames # Only here to clear the decks rm "this>a>weird>name" oktest --update "Delete weird filename" ### Create an existing directory mkdir bar runsitecopy --update rmdir bar runsitecopy --init $sitename mkdir bar failtest --update "Create existing directory" ### Delete a nonexistent directory mkdir norman runsitecopy --catchup rmdir norman failtest --update "Delete nonexistent directory" ### Download file runsitecopy --catchup echo hello world > myfile runsitecopy --update rm myfile oktest --synch "Download file" ### End of tests echo echo PASS: $tests tests completed. echo sitecopy-0.16.6/ChangeLog.CVS0000664000076400007640000056714510166006221014011 0ustar joejoeFri Oct 1 00:06:30 2004 Joe Orton * src/lsparser.c (ls_init): Initialize curdir to empty string. Sat Sep 18 09:46:21 2004 Joe Orton * src/console_fe.c (fe_updated): Cosmetic: don't wrap short error messages onto a new line. Sat Sep 18 09:16:13 2004 Joe Orton * src/rcfile.c (init_paths): Fail if the rcfile is not a regular file. Mon Sep 13 22:47:10 2004 Joe Orton * po/it.po: Update from Cristian Rigamonti. * THANKS: Update Cristian's e-mail address. Mon Sep 13 22:42:58 2004 Joe Orton * po/Makefile.in.in: Update from gettext. Sun Sep 12 17:10:31 2004 Joe Orton * src/ftp.c (struct ftp_session): Add pi_curaddr and rfc2428_mode fields. (parse_epasv_reply): New function. (parse_reply): Handle 229 EPSV replies. (ftp_data_open): Try EPSV before PASV unless it's known to fail. Sun Sep 12 17:06:36 2004 Joe Orton * src/ftp.c (authenticate): Renamed from log_in. (ftp_open): Update, and fix error path to close socket and not set ->connected flag. Sun Sep 12 12:30:23 2004 Joe Orton * src/sitesi.h (DEBUG_DUMP_FILE_PROPS): Use NE_FMT_OFF_T to print file sizes. Sun Sep 12 12:17:19 2004 Joe Orton * src/sitestore.c (end_element): Don't give an error on bad permissions mode (migration issue from <0.14.0). Sun Sep 12 12:04:14 2004 Joe Orton * po/POTFILES.in: Regenerate listing all C sources. Sun Sep 12 11:47:07 2004 Joe Orton * src/common.h (ne_has_support) [HAVE_NEON024]: Define for 0.24.x compatibility. Sun Sep 12 11:40:27 2004 Joe Orton * src/common.c (map_debug_options): Use ne_token. Sun Sep 12 11:36:13 2004 Joe Orton * configure.in: Define HAVE_NEON024 if neon 0.24.x is used. * src/common.h (ne_xml_failed): Define for neon 0.24/0.25 compatibility. * src/sitestore.c (parse_storage_file): Use ne_xml_failed. Sun Sep 12 11:34:23 2004 Joe Orton * src/davdriver.c (init): Drop Expect: 100 support; use ne_has_support to detect SSL support. (put_if_unmodified): New function, for neon 0.25 compatibility. (file_upload_cond): Use put_if_unmodified. Sat Sep 11 01:51:18 2004 Joe Orton * src/console_fe.c (fe_setting_perms): Differentiate directories from files. Sat Sep 11 01:47:46 2004 Joe Orton * src/rcfile.c (rcfile_read): Make "protocol ssh" equivalent to "protocol rsh" with "rsh ssh" and "rcp scp". Sat Sep 11 00:32:48 2004 Joe Orton * configure.in: Modernise a little; require neon 0.24.x; pick up SSL library message properly. Sat Sep 11 00:30:50 2004 Joe Orton * src/rshdriver.c: Rewrite by Nobuyuki Tsuchimura, adapted to use lsparser interface for fetch_list implementation. * src/common.h, src/common.c: Add DEBUG_RSH, "rsh" debug channel. Sat Sep 11 00:28:44 2004 Joe Orton * src/lsparser.c (ls_pflist_add): New function, factored out from ftp_fetch. * src/ftp.c (ftp_fetch): Use ls_pflist_add. Sat Sep 11 00:11:34 2004 Joe Orton * src/lsparser.c (ls_init): Strip trailing slash internally. (ls_parse): Strip whitespace internally. * src/ftp.c (ftp_fetch): Simplify accordingly. Fri Sep 10 23:22:37 2004 Joe Orton * src/lsparser.c, src/lsparser.h: New files, factored out from ftp.c. * Makefile.in: Build it. * src/ftp.c (parse_permissions): Removed function. (ftp_fetch): Use the new lsparser interface. Fri Sep 10 20:57:28 2004 Joe Orton * src/vfsdriver.c: New file, from David Knight. Fri Sep 10 20:54:52 2004 Joe Orton * src/sites.h (struct site_file): Drop 'marked' field. (struct site): Drop only_marked field. * src/sites.c (throughout): Drop support for "only marked" updates. Fri Sep 10 20:41:13 2004 Joe Orton * src/nulldriver.c: New file. * Makefile.in: Build it, by default. * src/console_fe.c (parse_cmdline): Support --dry-run argument for --update. (act_on_site): Support dry run updates using NULL protocol driver. (usage): Document --dry-run. Thu Sep 9 23:39:38 2004 Joe Orton * src/rcfile.c (rcfile_verify): Directory perms cannot be maintained over WebDAV. (rcfile_read): Clear ->dirperms on "permissions none". (rcfile_write): Write "permissions dir" if appropriate. Thu Sep 9 23:34:46 2004 Joe Orton * src/sites.h (struct site): Add dirperms field. * src/sitesi.h (file_compare): Compare directory permissions bits if site->dirperms is true. * src/rcfile.c (rcfile_read): Support 'permissions dir'. * src/sites.c (update_create_directories): Set dir perms as necessary for new and changed files. * src/sitestore.c (site_write_stored_state): Write permissions mode for directories. (start_element): Clear current stored state on start-element; initialise stored.mode to -1. Thu Sep 9 23:04:43 2004 Joe Orton * src/sitefiles.c (file_state_copy): Don't inline. Thu Sep 9 18:31:30 2004 Joe Orton * gnome/main.c (main): Use PACKAGE_VERSION. * gnome/init.c (create_about): Use PACKAGE_VERSION. Thu Sep 9 18:30:52 2004 Joe Orton * configure.in: GNOME fe fixes from Andrew Burton. Thu Sep 9 18:21:03 2004 Joe Orton * configure.in: Fix AC_LIBOBJ use for recent autoconf. Thu Sep 9 18:18:59 2004 Joe Orton * src/ftp.c (set_pisockerr): Print a debug message. (ftp_finish): Use run_command rather than execute to avoid re-opening the connection just to send a QUIT; avoid double-closing the socket in that case. Tue Jul 29 21:05:25 2003 Joe Orton * src/rcfile.c (init_paths): Relax permissions check to fix false positives on some platforms. Wed Jul 2 21:11:39 2003 Joe Orton * configure.in: Fix use of included getopt on BSDs. Mon Jun 30 20:10:23 2003 Joe Orton * src/ftp.c (dtp_open_passive): Renamed from ftp_connect_pasv. (ftp_close): Removed. (ftp_finish): Close the PI socket here. (dtp_open_active): Renamed from ftp_active_open. (dtp_close): Renamed from ftp_data_close. (parse_permissions): Renamed from ftp_decode_perms. ... all callers updated. Mon Jun 30 19:59:06 2003 Joe Orton * src/sitestore.c (fn_escape): Don't escape '/', '.' or '-'. (end_element): Better error handling. Mon Jun 30 19:56:02 2003 Joe Orton * src/ftp.c (ftp_active_open, ftp_connect_pasv, ftp_open): Update for neon 0.24 socket API. (ftp_fetch): Use an 'unsigned long' filesize; ensure a zero default file size. Sun Jun 29 22:12:58 2003 Joe Orton * src/davdriver.c (verify_trusted, fetch_list): Update for neon 0.24 compatibility. Sun Jun 29 22:12:07 2003 Joe Orton * src/ftp.c (ftp_fetch): Strip leading tabs and spaces from parsed lines. Tue Jun 17 21:08:25 2003 Joe Orton * src/ftp.c (receive_file): Fix fwrite argument order; fix handling of NE_SOCK_CLOSED (David Madore ). Sun Jun 15 10:42:08 2003 Joe Orton * src/davdriver.c (verify_trusted): New function. (init): Use verify_trusted for a trusted cert. Wed Jun 4 17:54:38 2003 Joe Orton * src/ftp.c (ftp_fetch): Fix handling of empty lines. Wed Jun 4 17:39:41 2003 Joe Orton * src/common.c (debug_map): Add ssl -> NE_DBG_SSL mapping. Tue May 20 20:44:55 2003 Joe Orton * src/sitestore.c (fn_escape): Remove extraneous semi-colon. Tue May 20 20:41:14 2003 Joe Orton * src/sitestore.c (parse_storage_file): Renamed from site_read_stored_state_new. (site_read_stored_state): Drop support for detection of non-XML storage files. (site_read_stored_state_old): Removed function. Tue May 20 20:39:26 2003 Joe Orton * configure.in: Add $(top_builddir)/intl to CPPFLAGS for the included libintl build. * Makefile.in: Build intl before libneon, since libintl.h is now a generated file. Fri May 9 15:29:19 2003 Joe Orton * src/ftp.c (send_file_binary): Renamed from send_file to prevent conflict with AIX system call of the same name. (Takeshi NISHIMATSU, * src/sitestore.c (site_write_stored_state): Write to options element. Tue May 6 22:12:56 2003 Joe Orton * src/frontend.h (fe_accept_cert): New prototype. * src/sites.h (struct site): Add certfile field, drop server_cert field. * src/console_fe.c (fe_accept_cert): New function. (verify_sites): Don't handle SITE_NOSERVERCERT. * src/davdriver.c (verify_cert): New function. (init): If a cached cert exists, trust it; otherwise use verify_cert as server cert verification callback. * src/rcfile.c (rcfile_read): Drop server-cert option; fill in certfile field. (rcfile_verify): Drop SITE_NOSERVERCERT constraint. Tue May 6 21:10:37 2003 Joe Orton * src/sites.h (struct site): Removed charset field. * src/common.c (init_charset): Removed. * src/console_fe.c (list_site_definitions): Don't print charset. * src/rcfile.c (rcfile_read): Ignore charset field. * src/sites.c (fe_initialize): Don't call init_charset. Tue May 6 21:06:22 2003 Joe Orton * src/sitestore.c (site_read_stored_state_new): Call ne_xml_parse with 0 length to finalize parse. (fn_escape, fn_unescape): New functions. (site_write_stored_state): Use fn_escape. (end_element): Use fn_unescape. Tue May 6 20:28:54 2003 Joe Orton * src/sitestore.c (start_element): Replaces check_context. (char_data): New function. (end_element, elmmap): Adapted for neon 0.24 XML API. Un-escape filenames. (site_write_stored_state): Escape filenames. Tue May 6 20:22:14 2003 Joe Orton * src/davdriver.c (check_context, end_element): Removed. (start_element): New function. (fetch_list, fetch_elms[]): Adapt for neon 0.24 XML API. Sun Mar 30 19:14:38 2003 Joe Orton * src/davdriver.c (init): Update for neon 0.24 SSL API. Sun Mar 30 17:39:05 2003 Joe Orton * configure.in: Add "it" to ALL_LINGUAS. Sun Mar 16 11:32:03 2003 Joe Orton * src/rcfile.c (rcfile_read): Parse the 'server-cert' option. (rcfile_verify): Fail with SITE_NOSERVERCERT if SSL is enabled and no server cert is given. * src/sites.h (struct site): Add server_cert field. * src/davdriver.c (h2s_init): Removed function. (init): Load specified server_cert; fold in h2s_init. Sun Mar 16 10:45:20 2003 Joe Orton * po/it.po: New file, from Cristian Rigamonti . Sun Mar 16 10:43:23 2003 Joe Orton * src/davdriver.c (init): Fix segfault if SSL is requested but not supported. Wed Feb 19 21:32:20 2003 Joe Orton * Makefile.in (DOCS): Remove FAQ; fix from Juergen Daubert . Convert $(EXE) to @EXEEXT@. Wed Feb 19 21:29:48 2003 Joe Orton * src/console_fe.c (main): Log default charset for debugging. Wed Feb 19 21:18:39 2003 Joe Orton * configure.in: Disable bundled expat pending build fix. Wed Feb 19 21:11:31 2003 Joe Orton * src/sitestore.c: Never request UTF-8 "decoding" of "filename" element. Wed Feb 19 20:25:12 2003 Joe Orton * src/common.c (init_charset): Default to ISO-8859-1 if the codeset from nl_langinfo is "ANSI_X3.4-1968". Thu Feb 13 08:21:57 2003 Joe Orton * src/ftp.c (send_file): Fix FTP file upload corruption. Tue Feb 11 19:51:28 2003 Joe Orton * Makefile.in (LIBS): Include @LIBINTL@ (patch from Nathan Hand ). Tue Feb 11 19:47:32 2003 Joe Orton * src/ftp.c (ftp_get): Handle errors from fclose(). Sun Feb 9 20:52:37 2003 Joe Orton * src/ftp.c (parse_pasv_reply): Renamed from ftp_read_pasv. Sun Feb 9 20:44:41 2003 Joe Orton * src/ftp.c (read_reply, parse_reply, log_in, run_command, execute): Rewrite and refactor of ftp_read, ftp_exec, ftp_login, ftp_response. Avoid exec/read/login infinite loops. Sun Feb 9 16:41:35 2003 Joe Orton * Makefile.in: Removed all uninstall- targets. Sun Feb 9 12:23:01 2003 Joe Orton * src/common.c (init_charset): New function. (default_charset): New global. * src/sites.h (struct site): Add charset field. * src/console_fe.c (main): Always call setlocale() if available. (list_site_definitions): List charset. * src/rcfile.c (rcfile_read): Read charset field. * src/sites.c (fe_initialize): Call init_charset. * src/sitestore.c (site_write_stored_state): Write out charset in XML declaration. Remove encoding mess. Write respect-encoding into . (site_read_stored_state_new): Fail if encoding from declaration and config don't match. Fri Feb 7 16:52:36 2003 Joe Orton * configure.in: Update for autoconf 2.5.x, simplifications. Fix to always require an XML parser. Fri Feb 7 16:49:34 2003 Joe Orton * src/sitestore.c (site_write_stored_state): Use single quotes for sitestate and saved-by attributes. Sun Nov 17 10:22:33 2002 Joe Orton * src/sites.c (site_get_protoname): Update to use proto_string field of site object. (everywhere): Update for neon 0.22 API. Mon Nov 11 14:23:04 2002 Joe Orton Ensure trailing slash is used in Request-URI for collections. * src/davdriver.c (coll_escape): New function. (dir_create, dir_remove): Mon Nov 11 14:21:27 2002 Joe Orton * src/rcfile.c (rcfile_read): Always fill in proto_string field. (rcfile_write): Write out proto_string field as protocol name. * src/sites.h (struct site): Make proto_string field always valid. Tue Nov 5 20:54:11 2002 Joe Orton * src/davdriver.c (file_read): Use ne_begin_request/ne_end_request directly, rather than obsolete ne_read_file. (get_server_port): Use ne_service_lookup. (h2s): Adjust for error codes in neon >=0.20. Tue Nov 5 20:47:15 2002 Joe Orton * src/davdriver.c (syserr): Renamed from set_err, take errno value. Updated all callers. Tue Nov 5 20:44:43 2002 Joe Orton * src/console_fe.c (main, version): Use PACKAGE_NAME, PACKAGE_VERSION. Tue Nov 5 20:44:10 2002 Joe Orton * src/sitefiles.c (file_full_local): Use ne_concat. Tue Nov 5 20:42:38 2002 Joe Orton * src/rshdriver.c: Use ne_vsnprintf throughout. Tue Nov 5 20:41:13 2002 Joe Orton * src/davdriver.c (set_err): Use varargs-style ne_set_error; simplify callers. Sat Aug 31 23:46:31 2002 Joe Orton * src/ftpdriver.c (init): Enable usecwd support. * src/rcfile.c (rcfile_read, rcfile_write): Support 'ftp usecwd' config option. Sat Aug 31 23:43:20 2002 Joe Orton * src/davdriver.c (file_download): Open local file with O_TRUNC. Sat Aug 31 23:41:15 2002 Joe Orton * src/ftp.c (maybe_chdir, ftp_set_usecwd): New functions. (struct ftp_session_s): Add 'cwd' field. (ftp_put): Call maybe_chdir before uploading. (ftp_login): Invalidate stored 'cwd'. Mon Mar 11 22:04:43 2002 Joe Orton * src/sitestore.c (site_write_stored_state): Escape any non-ASCII characters. Mon Feb 25 20:42:38 2002 Joe Orton * src/ftp.c (ftp_fetch): Use ne_shave rather than STRIP_EOL. Mon Feb 25 20:41:09 2002 Joe Orton * src/rshdriver.c (fetch_list): Removed. Sun Jan 13 21:56:08 2002 Joe Orton * configure.in: Create 'intl' directory too. Sun Jan 13 21:11:38 2002 Joe Orton * doc/changes.awk: Comment update from Peter Moulder. Sun Jan 13 20:55:17 2002 Joe Orton Build system cleanups from Peter Moulder: * Makefile.in: Replace sc_datadir with pkgdatadir. Add ALL_CFLAGS as the concatenation of INCLUDES, CPPFLAGS, CFLAGS. Update .PHONY; add .SUFFIXES. Use MKINSTALLDIRS rather than "$(INSTALL) -d". (install*): Support DESTDIR. (uninstall-nls): New target. * configure.in: Export NLSUNINSTALL. Use INCLUDES rather than CFLAGS where appropriate. Add LIBGLADE_CFLAGS to INCLUDES for GNOME frontend build. Sun Jan 13 20:41:33 2002 Joe Orton * src/console_fe.c (act_on_site): Fix typo in verify error output (thanks to Thomas Schultz). Sun Jan 13 20:14:46 2002 Joe Orton * src/davdriver.c (pfind_results): Fix when absoluteURI given using "https://" scheme. Better debugging. Wed Jan 9 23:05:19 2002 Joe Orton * Makefile.in (install-xsitecopy): Fix installing HTML docs. Wed Jan 9 20:59:21 2002 Joe Orton * .release.sh: Generate xsitecopy documentation from SGML sources. Wed Jan 9 20:54:50 2002 Joe Orton * Makefile.in: Simplify handling of XSC_DOCS and XSC_PNGS. * Makefile.in: Changes from Peter Moulder: (subdirs, clean): Use `cd && make'. (distclean): Act recursively. Sun Jan 6 23:18:40 2002 Joe Orton * configure.in: Fix GNOME_INCLUDEDIR include (Olaf Hering). Sun Jan 6 10:03:42 2002 Joe Orton * Makefile.in: Cleanup. Mon Dec 31 00:57:53 2001 Joe Orton * src/davdriver.c (file_move): Always overwrite destination resource. Thu Dec 20 09:31:27 2001 Joe Orton * Makefile.in (install-nls): Fix for non-GNU make. Thu Dec 20 01:22:36 2001 Joe Orton * configure.in: Bumped to 0.11.1. Thu Dec 20 01:17:07 2001 Joe Orton * Makefile.in, configure.in: Cleanups of CFLAGS/CPPFLAGS usage. Don't add "-I/lib" to CFLAGS. Thu Dec 20 01:07:39 2001 Joe Orton * configure.in: Add INTLLIBS to LIBS if NLS enabled. Add intl dir to front of SUBDIRS, so that libintl.h is generated early. Sat Dec 8 01:36:03 2001 Joe Orton * configure.in: Remove --extra-{includes,libs}, off_t format string detection. Require that an external neon is version 0.18 or later. Don't need zlib support in a bundled neon build. Display SSL library detected. Sat Dec 8 01:27:50 2001 Joe Orton * src/console_fe.c (fe_can_update, fe_fetch_found): Use NE_FMT_OFF_T for off_t format string. * src/sitestore.c (site_write_stored_state): Similarly. Sat Dec 8 01:27:10 2001 Joe Orton * src/console_fe.c (get_username): Simplify, pass in the buffer. (fe_login): Updated for new fe_login API. Sat Dec 8 00:00:03 2001 Joe Orton * src/davdriver.c (auth_common, server_auth_cb, proxy_auth_cb): Updated for neon 0.18 auth API, fe_login changes. Fri Dec 7 23:53:28 2001 Joe Orton * src/ftp.c (ftp_set_server, ftp_login): Store username and password as fixed-size buffers; adapt for fe_login change. Fri Dec 7 23:52:28 2001 Joe Orton * src/frontend.h (fe_login): Pass username and password as fixed-size buffers. Sat Nov 17 18:52:56 2001 Joe Orton * src/console_fe.c (fe_verified): Implemented. (abort_handler): Dump core on segfaults. (act_on_site): Update for site_verify interface changes. (usage): Advertise --verify support. Sat Nov 17 18:46:59 2001 Joe Orton * src/frontend.h (fe_verified): Pass const char * filename rather than a struct site_file *. * src/sites.c (site_verify_compare): Fixes. Updated for fe_verified change. (site_verify): Added a 'numremoved' argument. Sun Nov 4 22:46:23 2001 Joe Orton * src/sites.c (munge_modtime): Split out of site_fetch_walk. Sun Nov 4 22:07:50 2001 Joe Orton * src/davdriver.c: Update for neon 0.17 API. Manually escape/unescape URIs. Sun Nov 4 19:49:52 2001 Joe Orton * configure.in, po/nn.po: Added 'nn' translation from Karl Ove Hufthammer . Sun Nov 4 19:12:26 2001 Joe Orton * src/sites.c (synch_files): Call file_downloaded after setting file permissions. Sun Nov 4 16:58:28 2001 Joe Orton * src/sites.c (site_fetch_walk): Set stored modtime of new files to the current date/time. Sun Sep 23 21:38:54 2001 Joe Orton * Makefile.in: Remove DEFS. Add -DLOCALEDIR into CFLAGS. * configure.in: Remove SDEFS/DEFS. Add -DHAVE_CONFIG_H to CFLAGS. * po/Makefile.in.in: Remove from CVS, add at autogen.sh time. Sun Sep 23 20:36:10 2001 Joe Orton * src/sites.h (struct site): Add http_tolerant field. * src/rcfile.c (rcfile_read): Handle "http tolerant" option. * src/davdriver.c (init): Skip OPTIONS check if http_tolerant is set. Sun Sep 23 20:33:44 2001 Joe Orton * src/davdriver.c (ENABLE_PROGRESS, DISABLE_PROGRESS): New macros. (file_upload, file_upload_cond, file_download, file_read): Conditionally enable progress callbacks for interesting transfers. Sun Jun 24 16:21:41 2001 Joe Orton * configure.in: Check out to print integers of type off_t, and define FORMAT_OFF_T apropriately. Sun Jun 24 16:17:43 2001 Joe Orton * src/sitestore.c (site_write_stored_state): Use FORMAT_OFF_T to print integers of type off_t. (end_element): Fix warning, size_t is unsigned. Sun Jun 10 11:54:38 2001 Joe Orton * src/davdriver.c (end_element): Don't check for private pointer is NULL. Sun Jun 10 11:48:59 2001 Joe Orton * src/frontend.h: Add back 'enum fe_status', and use it in fe_connection. Sun Jun 10 11:47:47 2001 Joe Orton * src/ftp.c (ftp_decode_perms): Better algorithm from Michael Lindner . Sun Jun 10 03:33:53 2001 Joe Orton * src/console_fe.c (fe_can_update): Print number of bytes to upload for files. Sat Jun 9 21:56:11 2001 Joe Orton * */*: Updated for neon 0.15 symbol changes. Tue May 29 20:55:18 2001 Joe Orton * po/Makefile.in.in: Replaced with copy from gettext 0.10.37. * intl/*: Updated to gettext 0.10.37. Sun Apr 22 19:54:21 2001 Joe Orton * src/sites.c (site_fetch): Don't fetch checksums if main fetch failed. Only need modtimes in fetch if using safe mode or state timesize. Wed Apr 18 00:56:26 2001 Joe Orton * src/sitestore.c (decode_utf8_double): Remove redundant function. Tue Apr 17 10:01:10 2001 Joe Orton * src/rshdriver.c (run_rsh): Make sure the buffer is NUL-terminated. (Nobuyuki Tsuchimura). Fri Mar 2 17:55:29 2001 Joe Orton * src/ftp.c (ftp_read_pasv): Recognise address/port info when not in parentheses. (patch by Rob Funk ). Sun Feb 18 16:57:22 2001 Joe Orton * Makefile.in: Note that 'make install' might only work as root. Wed Feb 14 23:41:33 2001 Joe Orton * configure.in: Bumped version to 0.10.15. Wed Feb 14 23:39:09 2001 Joe Orton * Makefile.in: Remove bogus PHONY, add an 'all' target. Wed Feb 14 23:22:57 2001 Joe Orton * src/sitestore.c (end_element) [DEBUGGING]: Comment-out tokens after #endif. Wed Feb 14 23:21:09 2001 Joe Orton * src/console_fe.c: Removed trailing comma in actions enum. Wed Feb 14 22:59:40 2001 Joe Orton * src/sitefiles.c (file_perms_changed): The perms have always changed in nooverwrite mode. Wed Feb 14 22:37:07 2001 Joe Orton * configure.in: Add AC_TYPE_SIGNAL. Wed Feb 14 22:34:50 2001 Joe Orton * src/ftpdriver.c (init): Don't return SITE_ERRORS only SITE_FAILED. Wed Feb 14 22:33:36 2001 Joe Orton * src/console_fe.c (abort_handler, quit_handler): Use RETSIGTYPE for return type. Sun Jan 28 22:44:35 2001 Joe Orton * configure.in: Add intl and po to SUBDIRS when NLS is being built. Remove NLSTARGS. Generate intl/Makefile. Use NEON_REQUIRE to require neon 0.10 or later. Sun Jan 28 22:43:26 2001 Joe Orton * Makefile.in: Remove NLSTARGS, and display the recursion steps in subdirs. Sun Jan 28 10:30:07 2001 Joe Orton * Makefile.in: Remove neon-specific tester programs. Tue Jan 16 08:11:53 2001 Joe Orton * src/sites.c (site_fetch_walk): Only do the modtime munge if the file already exists locally. And do munge stored = local. (thanks to Nobuyuki Tsuchimura). Mon Jan 15 22:33:08 2001 Joe Orton * configure.in: Bumped version to 0.10.14. Mon Jan 15 22:31:31 2001 Joe Orton * configure.in: Use $(top_builddir) rather than ${top_builddir} when adding top-level dir to CFLAGS. Mon Jan 15 22:31:02 2001 Joe Orton * Makefile.in (clean): Clean in SUBDIRS too. Mon Jan 15 19:45:35 2001 Joe Orton * configure.in: Bumped version to 0.10.13. Mon Jan 15 19:43:50 2001 Joe Orton * configure.in: Tidy up post-configure message, and remove the message hinting at GNU make. Sun Jan 14 16:31:49 2001 Joe Orton * src/davdriver.c: Added 'struct private' to hold pre-resource private property details. (pfind_results, end_element): Use new struct private. (create_private): New function. (fetch_list): Use new neon-0.10 API for dav_propfind_set_complex. Sun Jan 14 11:15:14 2001 Joe Orton * Makefile.in (subdirs): Bail out immediately if a subdir build fails. Sun Jan 14 10:59:55 2001 Joe Orton * Makefile.in (intl_OBJS): Hard-code intl/ prefix into objects list rather than using $(addprefix). Sun Jan 14 10:56:59 2001 Joe Orton * configure.in: Use new NEON_VPATH_BUNDLED macro from neon-0.10. Mon Jan 8 20:00:49 2001 Joe Orton * sitecopy.spec.in: Use separate build dirs for xsitecopy and sitecopy. (Nobuyuki Tsuchimura). Sun Jan 7 19:28:14 2001 Joe Orton * configure.in: Bumped version to 0.10.12. Sun Jan 7 17:48:19 2001 Joe Orton * lib/yesno.c (yesno): Add declaration to fix warning. Sun Jan 7 17:44:58 2001 Joe Orton * src/rshdriver.c: Include string.h to fix warnings. Sun Jan 7 17:35:58 2001 Joe Orton * configure.in: Pass srcdir/libneon and builddir/libneon to NEON_BUNDLED appropriately (Peter Moulder). Sun Jan 7 17:12:57 2001 Joe Orton * gnome/doc/xsitecopy.sgml: Doc fix from Peter Moulder. Sat Jan 6 11:11:37 2001 Joe Orton * src/ftp.c (send_file_ascii): Only call progress for every 4K of upload, rather than for every line. Wed Jan 3 22:22:01 2001 Joe Orton * configure.in: Bumped version to 0.10.11. Wed Jan 3 22:20:07 2001 Joe Orton * sitecopy.spec.in: Fix xsitecopy build (Nobuyuki Tsuchimura). Wed Jan 3 21:48:48 2001 Joe Orton * configure.in: Only add 'po' to SUBDIRS if NLS is enabled. Wed Jan 3 21:39:29 2001 Joe Orton * Makefile.in: Hard-code top_builddir as '.'. Add NEONLIBS to LIBS. Wed Jan 3 21:37:17 2001 Joe Orton * configure.in: Include top_builddir in bundled libneon/expat paths. Wed Jan 3 21:29:24 2001 Joe Orton * src/fileset.c: Include string_utils.h (Peter Moulder). Thu Dec 28 12:56:29 2000 Peter Moulder * Allow building outside of srcdir. Makefile.in: Insert $(top_srcdir)/ in a few places. configure.in: Create directories if necessary. * Makefile.in: add @CPPFLAGS@ to INCLUDES. Fri Dec 22 23:49:34 2000 Joe Orton * configure.in: Bumped version to 0.10.10. Fri Dec 22 23:45:43 2000 Joe Orton * src/sites.c (site_fetch_walk): In the modtime munging logic, when marking unchanged files the same, copy stored->local rather than local->stored, since local will be zero in this case. Fri Dec 22 23:22:25 2000 Joe Orton * src/console_fe.c (main): Fix warning on str_action qualifier. Fri Dec 22 23:15:22 2000 Joe Orton * Makefile.in: Recursive make for neon 0.9 build. Fri Dec 22 23:14:53 2000 Joe Orton * configure.in: Build neon the way neon 0.9 wants it. Fri Dec 22 22:50:30 2000 Joe Orton * src/davdriver.c: Rewritten fetch handling to use PROPFIND interface from neon 0.9. Fri Dec 22 21:22:05 2000 Joe Orton * configure.in: Bumped version to 0.10.10. Fri Dec 22 21:19:05 2000 Joe Orton * src/ftp.c (ftp_data_close): Possible fix for false negative "250 Transfer Complete" error messages: accept any FTP_OK response as FTP_SENT. Fri Dec 22 21:04:33 2000 Joe Orton * src/ftp.c (ftp_fetch): Recognise ".:" directory in fetch response (Phil Davis ). Sun Dec 17 15:55:56 2000 Joe Orton * src/ftp.c (ftp_response): Add 253 as a DELE succesful code (Hans Meine ). Sun Dec 10 23:19:19 2000 Joe Orton * configure.in: Bumped version to 0.10.9. Sun Dec 10 23:03:15 2000 Joe Orton * src/ftp.c (recv_file): Don't treat a SOCK_CLOSED return value from sock_read as an error. Sun Dec 10 23:02:00 2000 Joe Orton * src/console_fe.c (verify_sites): Add A_COND_STORED flag to operation: carry on regardless if the stored state file doesn't exist. Thu Dec 7 23:49:26 2000 Joe Orton * configure.in: Bumped version to 0.10.8. Thu Dec 7 23:39:19 2000 Joe Orton * configure.in: Adapt for new NEON_LIBRARY interface. Thu Dec 7 21:37:55 2000 Joe Orton * src/davdriver.c (h2s_init): New function. (init): Call h2s_init, make sure we only ever return SITE_FAILED not SITE_ERRORS. Thu Dec 7 21:36:50 2000 Joe Orton * src/sites.c (site_fetch, site_synch, site_update): Always call proto_finish when returning in error cases, to make sure site->last_error is set appropriately. Thu Dec 7 21:32:56 2000 Joe Orton * src/ftp.c (handle_socket_error): Fix wrong and missing parameters. Wed Dec 6 21:04:26 2000 Joe Orton * src/sites.h (site_update, site_fetch, site_synch): Clean up the defined return code semantics. Now, SITE_FAILED is returned if the operation could not being, and site->last_error is guaranteed to be set. SITE_ERRORS is returned if errors occured *during* the operation, which have already been passed to the frontend using the fe_* functions. * src/protocol.h: Define what happens if init() doesn't return SITE_OK. Wed Dec 6 20:37:16 2000 Joe Orton * src/davdriver.c (init): Return SITE_ERRORS for errors in init. Sun Nov 19 17:56:33 2000 Joe Orton * configure.in: Bumped version to 0.10.7. Sun Nov 19 17:54:37 2000 Joe Orton * src/ftp.c (handle_socket_error): Check sock_get_error doesn't return NULL. (ftp_put): Change sock_transfer return value to be boolean. Sat Nov 18 12:24:04 2000 Joe Orton * Makefile.in: Add libneon/dates.o to NEONOBJS (Ross Nicoll ). * Makefile.in: Add auto-regenerate Makefile from Makefile.in if Makefile.in has been changed. Sat Nov 18 12:20:05 2000 Joe Orton * src/sitesi.h (DEBUG_DUMP_FILE_PROPS): Add server modtime if present. Sat Nov 18 12:16:52 2000 Joe Orton * src/console_fe.c: Read stored state in fetch mode as well, so we get the server modtime to compare against the *real* server modtime. Sat Nov 18 11:48:47 2000 Joe Orton * src/ftp.c (ftp_fetch): Better checking for the top-level directory name in the directory line. Return failure if a line could not be parsed. Thu Nov 16 20:21:31 2000 Joe Orton * src/sites.c (site_fetch_walk): In state timesize, and with safe mode, check whether the modtime really indicates the file has changed. Sun Oct 29 14:15:19 2000 Joe Orton * src/ftp.c: Massive error handling clean-up. Sun Oct 29 12:36:29 2000 Joe Orton * sitecopy.spec.in: Fix man page location. 2000-10-07 Joe Orton * src/davdriver.c (fetch_list): Use hip_xml_push_handler from neon 0.8.0. Sat Sep 16 15:39:09 2000 Joe Orton * src/ftp.c (ftp_put_cond): Don't leak file descriptors. Mon Sep 11 15:29:24 2000 Joe Orton * configure.in: Bumped version to 0.10.6. Mon Sep 11 15:28:26 2000 Joe Orton * src/ftp.c, src/rshdriver.c, src/sites.h: Include snprintf.h if HAVE_SNPRINTF_H is defined. Mon Sep 11 15:27:30 2000 Joe Orton * lib/snprintf.h, lib/snprintf.c: Move static declarations into snprintf.c. Add vsnprintf prototype to snprintf.h. Mon Sep 11 15:10:51 2000 Joe Orton * configure.in: Use NEON_REPLACE_SNPRINTF. Mon Sep 11 13:35:16 2000 Joe Orton * configure.in: Bumped version to 0.10.5. Mon Sep 11 13:32:06 2000 Joe Orton * src/davdriver.c (init): Disable expect-100 if it is not enabled (workaround neon bug). Mon Sep 11 13:27:34 2000 Joe Orton * src/ftp.c (ftp_put): Don't leak file descriptors. Tue Sep 5 21:26:30 2000 Joe Orton * src/ftp.c (ftp_open): Fix pi_socket comparison, from Fabrice Noilhan . Fri Aug 18 02:39:16 2000 Joe Orton * configure.in: Bumped version to 0.10.4. Fri Aug 18 02:38:05 2000 Joe Orton * po/cs.po: Update from Petr Prazak . Fri Aug 18 02:28:00 2000 Joe Orton * gnome/*: Update from Lee. Fri Aug 18 02:27:14 2000 Joe Orton * src/rcfile.c (rcfile_write): Patch from Lee, to output empty user/pass strings correctly. Tue Aug 15 20:40:03 2000 Joe Orton * configure.in: Bumped version to 0.10.3. Tue Aug 15 20:28:20 2000 Joe Orton * src/sites.c (site_update): Only delete directories if nodelete is not specified. Thu Aug 3 11:09:11 2000 Joe Orton * configure.in, Makefile.in: Move NEONOBJS definitions into Makefile.in Thu Aug 3 11:03:38 2000 Joe Orton * src/*.c: Use ne_* allocation functions rather than x*. Wed Aug 2 12:35:50 2000 Joe Orton * po/de.po: Updated German translation from Thomas Schultz. Tue Aug 1 22:55:53 2000 Joe Orton * src/common.c (map_debug_options): New function. * src/console_fe.c (map_debug_opts): Removed function. (parse_cmdline): Use map_debug_options. Tue Aug 1 17:51:49 2000 Joe Orton * src/ftp.c (ftp_get, ftp_read_file): Remove 'remotesize' parameter. Tue Aug 1 17:49:55 2000 Joe Orton * src/protocol.h: Removed 'remotesize' argument from file_read and file_download handlers. * src/davdriver.c, src/ftpdriver.c, src/rshdriver.c: Update similarly. * src/sites.c (synch_files, site_fetch_checksum): Update similarly. Tue Aug 1 14:35:35 2000 Joe Orton * configure.in: Bumped version to 0.10.2. Tue Aug 1 14:32:11 2000 Joe Orton * src/ftp.c (recv_file): Read till EOF. Call sock_call_progress. Tue Aug 1 12:55:20 2000 Joe Orton * src/sites.c (site_fetch_walk): In safe mode, set server modtime as fetched modtime. Tue Aug 1 12:52:53 2000 Joe Orton * src/console_fe.c (fe_transfer_progress), src/davdriver.c (file_download, file_read), src/ftp.c (recv_file, ftp_get, ftp_read_file), src/ftpdriver.c (file_download, file_read), src/rshdriver.c (file_download, file_read): Use 'off_t' not 'size_t' for file sizes. Tue Aug 1 12:49:08 2000 Joe Orton * src/protocol.h, src/sites.h: Use 'off_t' not 'size_t' for file sizes. Tue Aug 1 12:47:30 2000 Joe Orton * src/frontend.h (fe_transfer_progress): Use 'off_t' parameters. Tue Aug 1 12:15:17 2000 Joe Orton * src/ftpdriver.c (f2s): Map FTP_FAILED onto SITE_FAILED. Tue Aug 1 12:12:41 2000 Joe Orton * src/sitefiles.c (file_perms_changed): If in tempupload mode, always return true regardless of local and stored file state. Sun Jul 30 09:30:41 2000 Joe Orton * src/rshdriver.c Patch from David Knight: (run_rsh): Add "-l username" if a remote username is specified. (file_upload): Use user@host similarly. Fri Jul 28 17:40:04 2000 Joe Orton * configure.in: Bumped version to 0.10.1. Fri Jul 28 17:39:50 2000 Joe Orton * gnome/*: Quick fixes so it compiles and links again. Fri Jul 28 13:47:04 2000 Joe Orton * configure.in: Bumped version to 0.10.0. Mon Jul 24 16:47:32 2000 Joe Orton * src/davdriver.c (h2s): Return SITE_ERRORS as generic error message error. Mon Jul 24 16:40:36 2000 Joe Orton * src/console_fe.c (fe_warning): Nicer layour of messages. Mon Jul 24 16:39:41 2000 Joe Orton * src/ftp.c (ftp_put): Fix error case for file transfer. Mon Jul 24 16:39:01 2000 Joe Orton * src/sitefiles.c (file_uploaded, file_downloaded): Copy permissions mode across too. Mon Jul 24 00:19:08 2000 Joe Orton * src/sites.c (site_read_local_state): Free directory stack after use. Sat Jul 22 14:10:47 2000 Joe Orton * src/console_fe.c (version): Removed expat/libxml. Sat Jul 22 13:35:59 2000 Joe Orton * src/sitefiles.c, src/sites.c: Include neon_md5.h not md5.h. Sat Jul 22 13:35:21 2000 Joe Orton * src/console_fe.c (usage): Don't include neon version line. Sat Jul 22 13:33:13 2000 Joe Orton * configure.in: Updated for NEON_LIBRARY macro changes. Thu Jul 20 18:43:04 2000 Joe Orton * src/console_fe.c (init_signals): Use abort_handler for SIGHUP, SIGUSR1 and SIGUSR2. Thu Jul 20 11:16:44 2000 Joe Orton * configure.in: Use NEON_WARNINGS macro for --enable-warnings. Add "de" to ALL_LINGUAS. Wed Jul 19 19:36:37 2000 Joe Orton * po/de.po: Added German translation from Thomas Schultz . Wed Jul 19 19:28:29 2000 Joe Orton * src/davdriver.c (file_move): Pass overwrite parameter to dav_move. (h2s): Set error message for HTTP_TIMEOUT. (end_resource): Add description argument. Wed Jul 19 19:11:01 2000 Joe Orton * src/rcfile.c (rcfile_verify): Don't allow symlinks maintain mode for WebDAV any more. Sat Jul 8 19:05:20 2000 Joe Orton * src/ftp.c (ftp_fetch): Skip over a Windows drive specification in the directory string. Sat Jul 8 18:10:30 2000 Joe Orton * src/console_fe.c (fe_fetch_found): Print ASCII if file is ASCII. [DEBUGGING] (map_debug_opts): New function. (parse_cmdline, usage): Use textual debug channel specifiers Sat Jul 8 17:46:33 2000 Joe Orton * sitecopy.spec.in: Update from Nobuyuki Tsuchimura. Sat Jul 8 17:43:50 2000 Joe Orton * po/POTFILES.in: Added libneon/socket.c and src/sites.c. Sat Jul 8 17:42:07 2000 Joe Orton * configure.in: Mostly moved into macros/neon.m4 and macros/neon-xml-parser.m4 Sat Jul 8 17:37:29 2000 Joe Orton * src/sitestore.c (end_element, site_read_stored_state_new): Use new hip_xml interface. Fri Jul 7 22:25:29 2000 Joe Orton * src/rcfile.c (rcfile_read): Added "http secure" option. Fri Jul 7 22:22:48 2000 Joe Orton * src/ftp.c: Ported to new neon socket interface. (send_file_ascii): Imported function, since neon socket.c lost this. Fri Jul 7 20:57:54 2000 Joe Orton * src/common.c (debug): Removed function. Mon May 29 01:03:04 2000 Joe Orton * src/protocol.h: Removed PROTO_* return codes. Unified init, set_server, set_proxy, verify handlers into single init handler, which is passed the struct site *. New get_server_port and get_proxy_port handlers. * src/davdriver.c, src/ftpdriver.c: Updated as above. * src/sites.c (everywhere): s/PROTO_OK/SITE_OK/g. (proto_init): Simplified as above. (p2s): Removed function. (fe_initialize): Call sock_init. Mon May 29 01:06:45 2000 Joe Orton * src/ftp.c: Overhauled for new neon socket handling interface. Mon May 29 01:00:44 2000 Joe Orton * src/davdriver.c (start_element): Removed. (end_element): Moved functionality of start_element here. (fetch_list): Updated for new dav_prop / hip_xml interface. Mon May 29 00:31:37 2000 Joe Orton * src/sites.h: Re-order struct site_file, and bit-slice the enum fields; save 12 bytes. Sun May 28 16:32:06 2000 Joe Orton * src/rcfile.c (rcfile_read): Set site->proto_string for all 'protocol' options. (rcfile_verify): Reflect get_tcp_port -> sock_service_lookup rename. Tue May 9 22:10:29 2000 Joe Orton * src/ftp.[ch]: Use sock_block_reader not proto_read_block. Tue May 9 22:09:26 2000 Joe Orton * src/protocol.h, src/davdriver.c, src/rshdriver.c, src/ftpdriver.c: Use sock_block_reader not proto_read_block. Tue May 9 22:08:06 2000 Joe Orton * src/davdriver.c: Implemented fetch mode. (file_download): Open local file for writing, not reading. Set error message correctly if writing fails. Tue May 9 22:07:05 2000 Joe Orton * src/console_fe.c (verify_sites): Display error string for corrupt storage file. Tue May 9 22:04:43 2000 Joe Orton * src/sites.c (synch_files): Only set permissions if contents have not changed. Sun May 7 22:02:16 2000 Joe Orton * README.gnome: Update from Lee. Sun May 7 15:05:02 2000 Joe Orton * Makefile.in, configure.in: Build fix for --disable-rsh --disable-webdav. Sun May 7 15:03:40 2000 Joe Orton * po/Makefile.in.in (install-data-yes): Be less verbose. Tue May 2 16:48:58 2000 Joe Orton * src/sitestore.c: Added (no) namespace to elements for hip_xml changes, and request UTF8-decoding for the filename element only. Tue May 2 13:19:07 2000 Joe Orton * configure.in, config.h.in: Check for regex.h. * lib/rpmatch.c (RP_USE_REGEX): Only use regex matching if regex.h is present. Sun Apr 30 22:50:09 2000 Joe Orton * configure.in: Bumped version to 0.10.0-beta2. Sun Apr 30 22:42:48 2000 Joe Orton * src/davdriver.c (verify): Fixed error messages regarding server capabilities. Sun Apr 30 20:26:49 2000 Joe Orton * configure.in: Bumped version to 0.10.0-beta. Sun Apr 30 20:26:18 2000 Joe Orton * src/davdriver.c (fetch_list): Disable for release. Sun Apr 30 20:14:43 2000 Joe Orton * lib/xalloc.c (xstrdup): Renamed from strdup. (xstrndup): Renamed from strndup. Sun Apr 30 20:14:05 2000 Joe Orton * po/POTFILES.in: Added libneon files. Sun Apr 30 20:13:17 2000 Joe Orton * config.h.in: Fixed defines for libneon. * configure.in: Build libneon/dav_props.o for WebDAV too. Sun Apr 30 19:59:17 2000 Joe Orton * src/sites.c (fe_initialize): New function. Sun Apr 30 19:58:01 2000 Joe Orton * src/ftp.c, src/davdriver.c, src/rcfile.c, src/sitefiles.c, src/sites.c, src/sitestore.c: Use xstrdup not strdup. Sun Apr 30 19:53:51 2000 Joe Orton * Makefile.in: Removed MAINOBJS, GNOMEOBJS, ALLLIBOBJS, EXPATOBJS, EXES. Renamed COMPOBJS to ALLOBJS. (clean): Remove ALLOBJS. Sun Apr 30 19:10:33 2000 Joe Orton * src/rcfile.c (rcfile_verify): Allow exec permissions for WebDAV. Sun Apr 30 19:01:44 2000 Joe Orton * src/console_fe.c (abort_handler): Don't try to save stored state from a SEGV within the critical section. (init_signals): Handle SIGSEGV. (issue_error): Handle SITE_FAILED. (act_on_site) [case action_update]: Use site_open_storage_file. * src/sites.c (proto_init, p2s): Return SITE_FAILED as generic error code. Sun Apr 30 18:52:36 2000 Joe Orton * src/davdriver.c (file_chmod): Implemented using PROPPATCH. Sun Apr 30 18:45:17 2000 Joe Orton * src/protocol.h: Added support parameter to verify handler. * src/sites.c: Pass support parameter to verify. * src/ftpdriver.c, src/rshdriver.c, src/davdriver.c: Change verify handler as above. Sat Apr 29 15:08:02 2000 Joe Orton * src/sites.c (update_files): Skip moved and unchanged files. (proto_init): Don't call fe_connection. (site_catchup, site_destroy_stored, site_destroy): Use site_enter/leave. Sat Apr 29 15:07:09 2000 Joe Orton * src/common.c (md5_hexify, md5_unhexify): Removed functions. Sat Apr 29 15:04:38 2000 Joe Orton * src/sitestore.c (site_open_storage_file, site_close_storage_file): New functions. (end_element): Read server modtime correctly (fixes safe mode). Sun Apr 23 16:17:57 2000 Joe Orton * configure.in, Makefile.in: GNOME: Set LIBS and CFLAGS in configure. Sun Apr 23 11:27:42 2000 Joe Orton * src/protocol.h: Pass boolean to fetch_list indicating whether modification times should be retrieved. * src/ftp.c (ftp_fetch_walktree): Renamed to ftp_fetch_modtimes. (ftp_fetch): Removed function. (ftp_fetch_gettree): Renamed to ftp_fetch. * src/ftpdriver.c (fetch_list): Modified for both of above. Sun Apr 23 11:23:22 2000 Joe Orton * doc/*.html, doc/topic.dat, doc/xsitecopy.sgml: Removed. * gnome/doc/*: New GNOME documentation from Lee. Sun Apr 23 11:22:53 2000 Joe Orton * .cvsignore: Added aclocal.m4. Sun Apr 23 11:16:18 2000 Joe Orton * macros/: New directory. * aclocal.m4: File now generated at distribution time by aclocal. Sun Apr 23 10:59:46 2000 Joe Orton * Makefile.in: Changes from Lee. Moved GNOME docs into gnome/doc. * configure.in: Changes from Lee. Sun Apr 23 10:54:48 2000 Joe Orton * gnome/*: New files from Lee. Thu Apr 13 09:52:29 2000 Joe Orton * src/davdriver.c (init): Set user-agent. Thu Apr 13 09:48:12 2000 Joe Orton * src/sites.c (proto_init): Call set_proxy before set_server so that the protocol layer can omit doing a DNS lookup on the server if a proxy is being used. Wed Apr 12 22:42:15 2000 Joe Orton * po/cs.po: Update from Petr Prazak. Wed Apr 12 22:28:18 2000 Joe Orton * src/davdriver.c (h2p): Set error message for PROXYAUTH + SERVERAUTH appropriate. (all callers): Pass session to h2p. (file_upload, file_upload_cond, file_download): Set error string appropriately if fopen() fails. Wed Apr 12 22:26:53 2000 Joe Orton * src/rshdriver.c (run_rsh, run_rcp, init): Support 'rsh_cmd' and 'rcp_cmd' options. Wed Apr 12 22:24:10 2000 Joe Orton * src/sitestore.c (end_element): Add error checking for strto(u)l return values. Wed Apr 12 19:31:28 2000 Joe Orton * src/console_fe.c: Use site_get_protoname(). (main, list_site_definitions): Only display named sites for --view mode if any sites are named. (issue_error): Added SITE_PROXYLOOKUP message. Wed Apr 12 19:29:58 2000 Joe Orton * src/rcfile.c (rcfile_read): Accept "dav" and "webdav" as names for the WebDAV driver. If an unknown protocol is used, store the string name in site->proto_string. Wed Apr 12 19:29:13 2000 Joe Orton * src/sites.c (site_get_protoname): New function. (proto_init): Set rsh_cmd and rcp_cmd options. Tue Apr 11 11:12:16 2000 Joe Orton * src/rcfile.c (rcfile_write): Write out state method (Lee Mallabone). Mon Apr 10 19:39:54 2000 Joe Orton * src/davdriver.c (h2p): Map HTTP_PROXYAUTH onto PROTO_PROXYAUTH. * src/sites.c (p2s): Map PROTO_PROXYAUTH onto SITE_PROXYAUTH. Mon Apr 10 19:36:52 2000 Joe Orton * src/protocol.h: Added PROTO_PROXYAUTH return code. * src/sites.h: Added SITE_PROXYAUTH return code. * src/console_fe.c (issue_error): Handle SITE_PROXYAUTH return code. Mon Apr 10 19:36:02 2000 Joe Orton * src/console_fe.c (verify_sites): Removed no username/passowrd messages. (fe_login, get_username): New functions. Mon Apr 10 19:33:19 2000 Joe Orton * src/rcfile.c (rcfile_verify): Allow ommission of username and/or password in rcfile entries. FEAPI: SITE_NOUSERNAME/PASSWORD return codes removed. Mon Apr 10 16:34:58 2000 Joe Orton * src/sites.c (site_synch): Only connect to the server if there are deleted, changed or ignored files in the site. Mon Apr 10 15:06:28 2000 Joe Orton * lib/dates.[ch], lib/base65.[ch], lib/md5.[ch], lib/string_utils.[ch]: Removed files. Mon Apr 10 14:40:59 2000 Joe Orton * src/socket.[ch]: Removed files. Sat Apr 8 13:34:20 2000 Joe Orton * src/httpdav.c, src/httpdav.h, src/httpauth.c, src/httpauth.h: Removed files. Sat Apr 8 13:33:25 2000 Joe Orton * src/rcfile.c (rcfile_verify): Renamed from rc_verifysite. Sat Apr 8 13:29:57 2000 Joe Orton * src/socket.c: Mass renaming to use "sock_" prefix to all functions. No perror() calls. Add SOCK_TIMEOUT return value. Sat Apr 8 13:29:14 2000 Joe Orton * src/frontend.h (fe_disable_abort, fe_enable_abort): Pass site. Sat Apr 8 13:27:07 2000 Joe Orton * src/fileset.h (FS_NAME): Wrap as critical section. Sat Apr 8 13:25:10 2000 Joe Orton * src/sites.c [HANDLE_ABORT]: Removed. (proto_init): Call init, set_server, set_proxy and verify handlers. (proto_finish): New function. (site_update): Iterate over list of updater functions. Sat Apr 8 13:22:20 2000 Joe Orton * src/sitesi.h (site_enter, site_leave): Critical section management. * src/sitefiles.c (file_state_copy, file_set_diff): Enter and leave critical section. Sat Apr 8 12:49:35 2000 Joe Orton * src/sitefiles.c (file_delete): Renamed from file_remove, integrated file_destroy. Wrap as critical section. (file_uploaded, file_downloaded): Wrap as critical section. Sat Apr 8 12:47:27 2000 Joe Orton * src/protocol.h: Added set_server(), set_proxy() and verify() handlers to protocol driver. init() takes an options object. Sat Apr 8 12:28:25 2000 Joe Orton * src/frontend.h (fe_enable_abort, fe_disable_abort, fe_login): New functions. Sat Apr 8 12:26:54 2000 Joe Orton * src/sitestore.c: Rewritten to parse XML storage files using hip_xml. Sat Apr 8 00:33:43 2000 Joe Orton * src/ftp.c (ftp_exec, ftp_data_open): Reimplement using printf-like varargs. (all callers): Simplify greatly using above. Sat Apr 8 00:31:22 2000 Joe Orton * src/davdriver.c (server_auth_cb, proxy_auth_cb, h2p, set_server, set_proxy, verify): New functions. Sat Apr 8 00:29:45 2000 Joe Orton * src/console_fe.c (fe_disable_abort, fe_enable_abort, abort_now): New functions. (fe_abort_update, fe_abort_synch): Removed functions. Sat Apr 8 00:28:39 2000 Joe Orton * src/common.c [!HAVE_STRDUP] (strdup): Removed function. Sat Apr 8 00:24:16 2000 Joe Orton * config.h.in: Added USE_FTP define. Sat Apr 8 00:23:52 2000 Joe Orton * configure.in: Added --disable-ftp option. Sat Apr 8 00:23:10 2000 Joe Orton * po/ja.po: Update from Nobuyuki Tsuchimura. Sat Apr 8 00:08:36 2000 Joe Orton * gnome/*: Update from Lee. Fri Apr 7 19:15:10 2000 Joe Orton * src/rcfile.c (rcfile_read): Added support for 'rsh' and 'rcp' rcfile options. * src/sites.h: Added 'rsh_cmd' and 'rcp_cmd' fields to struct site. Fri Apr 7 19:12:53 2000 Joe Orton * src/rcfile.c (rc_verifysite) [USE_FTP]: Compile-time conditional support for FTP. Thu Apr 6 14:37:42 2000 Joe Orton * lib/string_utils.c (sbuffer_zappend): Implement as call to sbuffer_append. Thu Apr 6 14:36:45 2000 Joe Orton * src/ftp.c: Transparent session structure. Use FTP_* return codes rather than PROTO_*. Wed Apr 5 16:32:27 2000 Joe Orton * lib/string_utils.c (sbuffer_altered): New function. Wed Apr 5 16:26:29 2000 Joe Orton * lib/string_utils.c, lib/netrc.c, lib/base64.c, lib/dates.c, lib/dirname.c, lib/getopt.c: Use xmalloc() rather than malloc(). * lib/xalloc.c: New file. Wed Apr 5 16:23:46 2000 Joe Orton * config.h.in: Added USE_RSH, HAVE_DEBUG_FUNC for libneon, HAVE_LIBXML, removed USE_BROKEN_PROPFIND. Wed Apr 5 16:22:33 2000 Joe Orton * Makefile.in: Added http_utils.o and hip_xml.o (from libneon) to OBJECTS. (src/davdriver.o): New dependancy listing. Wed Apr 5 16:21:25 2000 Joe Orton * configure.in: Added --enable-libxml option, message showing which XML parser is being used. Tue Mar 28 15:08:56 2000 Joe Orton * Makefile.in: Updated deps, use libneon. Tue Mar 28 15:06:38 2000 Joe Orton * src/*: Removed 'bool' type. Tue Mar 28 14:02:18 2000 Joe Orton * src/sites.h: Added 'rsh' and 'unknown' protocols. FE API: Do not presume site->driver is non-NULL. * src/rshdriver.c: New file. * src/rcfile.c (rcfile_read): Support 'protocol rsh' and unknown protocols. (rc_verifysite): Set protocol ->driver here. FE API: New return code from rc_verifysite: SITE_UNSUPPORTED. No need to set ->driver when changing site->protocol, rc_verifysite Tue Mar 28 14:00:12 2000 Joe Orton * configure.in: New expat/libxml test logic from cadaver. Display configuration details when finished condiguring. Tue Mar 28 13:59:04 2000 Joe Orton * lib/string_utils.[ch]: Imported new versions from cadaver. Sun Mar 26 19:05:02 2000 Joe Orton * src/ftpdriver.c, src/davdriver.c: Added protocol driver modules. Sun Mar 26 19:00:53 2000 Joe Orton * src/sites.c: Added session support for protocol drivers. Removed protocol driver structure definitions. (site_update): Iterate over list of handler functions. Sun Mar 26 11:55:47 2000 Joe Orton * src/protocol.h: Added session support. Sat Mar 25 15:46:46 2000 Joe Orton * Makefile.in, gnome/*: Update from Lee. Thu Mar 23 20:45:18 2000 Joe Orton * configure.in: Bumped to 0.9.9. Thu Mar 23 20:43:16 2000 Joe Orton * gnome/operations.c (main_update_please): Fix from Lee Mallabone. Tue Mar 14 23:45:35 2000 Joe Orton * src/common.c (debug): Send debugging messages to debug_stream rather than stderr. * src/console_fe.c (init): Added --logfile option, to redirect debug_stream to a file. Sat Mar 11 13:57:56 2000 Joe Orton * gnome/*: Update from Lee Mallabone. Thu Mar 9 20:41:35 2000 Joe Orton * doc/xsitecopy.sgml: Update from Lee Mallabone. Thu Mar 9 20:37:40 2000 Joe Orton * src/socket.c (transfer): Call fe_transfer_progress when transfer is complete. Tue Mar 7 22:58:00 2000 Joe Orton * gnome/*: Update from Lee Mallabone. Tue Mar 7 20:53:55 2000 Joe Orton * configure.in: Added 'ja' to ALL_LINGUAS. Tue Mar 7 20:51:36 2000 Joe Orton * src/sitestore.c (site_write_stored_state): Don't escape '_'. Tue Mar 7 20:35:48 2000 Joe Orton * src/sites.c (site_fetch_checksum): Don't checksum excluded files (Nobuyuki Tsuchimura). Tue Mar 7 20:25:25 2000 Joe Orton * po/ja.po: New file, from Nobuyuki Tsuchimura. Tue Mar 7 20:23:51 2000 Joe Orton * src/console_fe.c (verify_sites) [case SITE_NOSAFEOVER]: conjuction -> conjuction typo (Nobuyuki Tsuchimura). Sat Feb 26 16:04:28 2000 Joe Orton * src/console_fe.c (act_on_site) [case action_list]: Display number of items to update if remote site has changed. Mon Feb 21 22:54:33 2000 Joe Orton * Makefile.in: Use $(MAKE) instead of 'make' when recursing. Thu Feb 10 17:55:48 2000 Joe Orton * src/sites.c (site_synch): Carry on if keepgoing is set. Thu Feb 10 17:40:49 2000 Joe Orton * src/sitefiles.c (fnlist_match): Use GNU FNM_LEADING_DIR fnmatch() extension to exclude files within excluded directories (required for fetch). Thu Feb 10 17:33:33 2000 Joe Orton * configure.in: Added check for GNU fnmatch. Thu Feb 10 16:57:13 2000 Joe Orton * configure.in: Added cs to ALL_LINGUAS. Thu Feb 10 16:56:41 2000 Joe Orton * src/rcfile.c (rcfile_write): Added in some missing options. Thu Feb 10 16:28:00 2000 Joe Orton * po/cs.po: New file, from Petr Prazak . Thu Feb 10 16:14:11 2000 Joe Orton * src/console_fe.c (get_perms_mode, get_symlinks_mode): New functions to replace old PERMSMODE/SYMLINKSMODE macros, to allow localization of strings. (set_action): New function to replace SETACTION macro, to allow localization of strings. * src/sites.h (PERMSMODE, SY4MLINKSMODE): Removed macros. * src/console_fe.c. (issue_error): Mark strings for gettext (Petr Prazak). (main): Translate action string correctly (Petr Prazak). Sun Feb 6 21:48:33 2000 Joe Orton * configure.in: Moved checks for SOCKSv4/v5 earlier. Sun Feb 6 21:45:14 2000 Joe Orton * configure.in, config.h.in, src/common.h: Added SOCKSv5 support (thanks to Volkan Yavuz ). Tue Feb 1 15:49:37 2000 Joe Orton * configure.in: Added 'fr' to ALL_LINGUAS. Tue Feb 1 15:46:14 2000 Joe Orton * po/fr.po: New file, from Sylvain 'Murdock' Glaize . Tue Feb 1 15:36:47 2000 Joe Orton * src/sitestore.c (SINGLEBYTE_UTF8): New macro. (decode_utf8_double): New function. (site_xml_cdata): Decode double-byte UTF-8 encodings of 8-bit characters. Thu Jan 20 20:11:47 2000 Joe Orton * src/console_fe.c: Added closing quote in comment (Nobuyuki Tsuchimura). q Thu Jan 20 17:29:50 2000 Joe Orton * src/ftp.c (ftp_fetch_gettree): Skip absolute pathname in directory names (patch by Nobuyuki Tsuchimura ). Thu Jan 20 17:01:11 2000 Joe Orton * configure.in: Added check for xmlparse.h in xmlparse/. Tue Jan 18 20:24:23 2000 Joe Orton * tools/cvsdist: Create Makefile.emx from Makefile.emx.in. config.h.emx likewise. * Makefile.emx.in, config.h.emx.in: Renamed from *.emx. Tue Jan 18 19:16:02 2000 Joe Orton * src/socket.c (read_line): Use sock_recv again. Tue Jan 18 19:11:24 2000 Joe Orton * src/sitefiles.c (file_insert): Set the file type according to parameter. (file_set_local, file_set_stored): Don't set the file type. (file_set_stored): Set a shoved file to be deleted not new. Sat Jan 15 01:18:18 2000 Joe Orton * src/sites.c (site_flatlist_items): Use file_name() for displaying filenames: patch from Niall Smart . Sat Jan 15 01:16:34 2000 Joe Orton * src/sites.c (site_update_move_files): New function. (site_update): Move files using above before uploading changed files. Sun Dec 12 13:53:10 1999 Joe Orton * gnome/*: Update from Lee Mallabone. Thu Dec 9 15:28:55 1999 Joe Orton * src/sitefiles.c: Removed file_compare. * src/sitesi.h: Added file_compare, inlined. Thu Dec 9 15:24:19 1999 Joe Orton * src/sitefiles.c (file_compare): Another slight optimisation. Thu Dec 9 15:14:56 1999 Joe Orton * src/sitefiles.c (file_compare): Return immediately on determining file has changed. Wed Dec 8 16:51:30 1999 Joe Orton * doc/sitecopy.1: Spelling and other fixes. Wed Dec 8 16:32:41 1999 Joe Orton * src/ftp.c (ftp_read_pasv): Return error if no '(' found in response. Wed Dec 8 16:31:03 1999 Joe Orton * FAQ: Added entry about "cannot create directory" errors. Wed Dec 8 16:26:59 1999 Joe Orton * src/sites.c (temp_upload_filename): Strings are char *, not int. Wed Dec 8 16:24:33 1999 Joe Orton * src/console_fe.c: Define _GNU_SOURCE to pick up strsignal definition from string.h. Fri Dec 3 00:11:17 1999 Joe Orton * src/ftp.h, src/ftp.c: Rewrite to support >1 session at a time. Wed Nov 24 15:22:52 1999 Joe Orton * src/ftp.c (ftp_fetch_gettree): Allocate zero-length string correctly. Wed Nov 17 00:44:08 1999 Joe Orton * src/console_fe.c (fe_fetch_found): Display remote filenames rather than using file_name(). Tue Nov 16 17:08:00 1999 Joe Orton * src/console_fe.c: Don't read the stored state for fetch mode. Tue Nov 16 16:57:23 1999 Joe Orton * src/sitefiles.c (site_stats_increase, site_stats_decrease): Made inline, moved to sitesi.h. (file_insert): Removed. * src/sitefiles.c (file_set_stored, file_set_local): Removed. * src/fileset.h: Generic hack file_set implementation. * src/fileset.c (file_insert): Added from sitefiles.c. (file_set_local, file_set_stored): Use fileset.h. * configure.in: Added src/fileset.o to OBJECTS. Sun Nov 14 13:34:21 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.9.0-pre. Sun Nov 14 13:30:35 1999 Joe Orton * configure.in: Error on --enable-gnomefe for 0.9.0-pre release. Sun Nov 14 13:19:28 1999 Joe Orton * src/sitestore.c (site_read_stored_state, site_read_stored_state_*): Changed return codes to SITE_OK, SITE_FAILED, SITE_ERRORS. * src/sites.c (site_read_local_state): No return value. (site_readfiles): Returns any of the return codes of site_read_stored_state. * src/console_fe.c (init_sites): Handles return codes of site_read_stored_state appropriately. Clear 'use_this' field of sites for which an error is returned, so act_on_site ignores them. Thu Nov 4 14:37:55 1999 Joe Orton * src/sites.c (temp_upload_filename): New function. Prefixes filename with ".in." for temporary uploads. (site_update_files): Use it. Thu Nov 4 01:54:41 1999 Joe Orton * src/console_fe.c (usage): Update debug levels. Thu Nov 4 01:52:30 1999 Joe Orton * doc/sitecopy.1: Concepts section, better wording for exclude, new section on ignore, updated debug levels. Wed Nov 3 09:55:24 1999 Joe Orton * src/console_fe.c (verify_sites): Handle SITE_NOSAFETEMPUP error from rc_verifysite. Tue Nov 2 19:21:44 1999 Joe Orton * configure.in: Bumped version to 0.9.0-beta2. Tue Nov 2 19:20:34 1999 Joe Orton * src/sitefiles.c (file_set_*): Always give file properties debugging message. Tue Nov 2 18:00:33 1999 Joe Orton * src/sites.c (site_update_files): If tempupload is set, upload a changed file to `filename.in', then rename to `filename'. Tue Nov 2 16:39:53 1999 Joe Orton * src/sites.h: Added tempupload field to struct site. * src/rcfile.c (rcfile_read): Parse tempupload option. (rcfile_write): Boolean options written out easier, added tempupload option. (rc_verifysite): Disallow tempupload in conjunction with safe mode. FE API: New return code from rc_verifysite: SITE_NOSAFETEMPUP. Sun Oct 31 12:52:22 1999 Joe Orton * src/frontend.h: Added fe_verifying, fe_verified. Thu Oct 21 00:43:22 1999 Joe Orton * src/sites.c (site_update_*): Made onlymarked a site option rather than a function argument. Made keepgoing a site option rather than a global variable. Removed fe_prompting completely, fe_can_update is ALWAYS called now. * src/console_fe.c: Updated for above changes. Wed Oct 20 15:27:24 1999 Joe Orton * src/frontend.h: Removed fe_promting. Tue Oct 19 00:08:27 1999 Joe Orton * src/socket.c, configure.in, config.h.in, config.h.emx: Removed Linux 2.2 sendfile() handling. Mon Oct 18 22:34:36 1999 Joe Orton * src/sites.c (site_synch_delete_directories): Fixed segfault and skipping problems. Mon Oct 18 22:22:05 1999 Joe Orton * src/sites.c (site_update_files): Skip deleted files, fix segfault. Mon Oct 18 21:24:49 1999 Joe Orton * src/sites.c: Fixed fe_can_update problems. Mon Oct 18 21:20:19 1999 Joe Orton * src/console_fe.c (fe_can_update): Added missing break causing incorrect fallthrough and confused prompts. Mon Oct 18 21:13:20 1999 Joe Orton * Makefile.in, configure.in, gnome/*: GNOME update from Lee Mallabone. Mon Oct 18 01:18:20 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.9.0-beta. Mon Oct 18 01:05:23 1999 Joe Orton * src/console_fe.c (act_on_site): Display warning on changed state method at the end of list display, and only in non-flatlist mode. Mon Oct 18 00:59:51 1999 Joe Orton * src/sites.h: Added ftp_echo_quit field to struct site. * src/rcfile.c (rcfile_read, rcfile_write): Support for "ftp showquit" option (ftp_echo_quit field). * src/ftp.c: Added echo_response global, ftp_echo_quit public global. (ftp_read): Display command response if echo_response is set. (ftp_close): Set echo_response from ftp_echo_quit. * src/sites.c (proto_init): Set global ftp_echo_quit from site field of the same name. * doc/sitecopy.1: Added "ftp showquit" option. Mon Oct 18 00:42:04 1999 Joe Orton * doc/sitecopy.1: Added --show-progress option. Mon Oct 18 00:39:28 1999 Joe Orton * src/common.h: Added BINARY_R_FOPEN for fopen() flags for reading binary files. * src/sitestore.c, src/httpdav.c: Use BINARY_R_FOPEN. Mon Oct 18 00:38:29 1999 Joe Orton * src/sites.c (site_read_local_state): Always read file size, regardless of state method. Sun Oct 17 23:10:23 1999 Joe Orton * doc/sitecopy.1: Updated for "http expect". Sun Oct 17 22:05:35 1999 Joe Orton * src/rcfile.c (rcfile_write): Write "http expect" correctly. Sun Oct 17 22:03:48 1999 Joe Orton * src/httpdav.c (http_req_fixedheaders): Only send "Connection: Keep-Alive" header if not using a proxy. Sat Oct 9 10:40:57 1999 Joe Orton * src/console_fe.c (abort_handler, fe_abort_update): Abort safely using fe_abort_update. (quit_handler): New function. (init_signals): abort_handler handles SIGINT, quit_handler all other termination signals. Sat Oct 9 10:37:23 1999 Joe Orton * src/testdav.c, Makefile.in: testdav removed (use cadaver instead :). Fri Oct 8 19:57:39 1999 Joe Orton * src/sites.c (site_update_*): Call fe_abort_update() after each update operation, and return SITE_ABORTED if it returns non-zero. (site_update): Pass up SITE_ABORTED return value from site_update_*. (site_synch_*, site_synch): Similarly. Fri Oct 8 15:01:17 1999 Joe Orton * src/sites.h: Made the SITE_ codes negative. Fri Oct 8 12:08:57 1999 Joe Orton * Makefile.in, configure.in: Hard-code lib/ into LIBOBJS, rather than using $(addprefix...). Thu Oct 7 12:12:30 1999 Joe Orton * src/sites.c: Removed site_pseudourl. Thu Oct 7 11:37:39 1999 Joe Orton * src/console_fe.c: Single 'flags' field in action_info. (parse_cmdline): Added '--show-progress' option. (fe_updated): Print upload progress. Mon Oct 4 22:34:23 1999 Joe Orton * src/sites.c (site_pseudourl): Fix from Lee Mallabone. Mon Oct 4 13:49:08 1999 Joe Orton * src/console_fe.c (issue_error): Handle SITE_UNIMPL too. Mon Oct 4 13:48:15 1999 Joe Orton * src/sitestore.c (site_read_stored_state): Don't return error on empty storage file. Mon Oct 4 13:46:37 1999 Joe Orton * src/i18n.h: Easy-access to _ and N_ macros. * src/console_fe.c, src/common.c: Use i18n.h. Mon Oct 4 00:12:13 1999 Joe Orton * src/sitestore.c (site_read_stored_state): Only return error on opening stored state file if the file doesn't exist. Return success if stored state file doesn't exist. Sun Oct 3 13:45:08 1999 Joe Orton * src/console_fe.c: Don't use MAINTAINER_ADDR, it messed up xgettext. Wed Sep 29 20:32:53 1999 Joe Orton * src/httpdav.c (http_get_callback): Reset the progress counter when it goes past the total. Wed Sep 29 19:39:25 1999 Joe Orton * src/sitefiles.c (file_compare): Compare linktargets correctly. Wed Sep 29 16:48:06 1999 Joe Orton * src/console_fe.c (main) [HAVE_SETLOCALE]: Remove set_locale call. Wed Sep 29 16:15:07 1999 Joe Orton * Makefile.in (intl_OBJS): Updated for gettext-0.10.35. Wed Sep 29 16:13:38 1999 Joe Orton * configure.in: Updated for gettext-0.10.35 macros. * intl/: Imported gettext-0.10.35 sources. Wed Sep 29 15:59:29 1999 Joe Orton * aclocal.m4: Use AM_LC_MESSAGES, AM_PATH_PROG_WITH_TEST, AM_GNU_GETTEXT, AM_WITH_NLS from gettext-0.10.35. Wed Sep 29 15:58:37 1999 Joe Orton * po/Makefile.in.in: New version from gettext-0.10.35. Wed Sep 29 13:09:35 1999 Joe Orton * Makefile.in: Compile and link intl/*.o objects in NLS build. * configure.in: Add in NLS extras. Wed Sep 29 13:09:00 1999 Joe Orton * po/sitecopy.pot: Extracted new messages. Wed Sep 29 11:25:52 1999 Joe Orton * src/sites.c (site_fetch_walk): Only need to fudge the modification time when using state_timesize. (site_read_local_state): Exported interface. Tue Sep 28 23:22:21 1999 Joe Orton * src/console_fe.c: (main): Modularized. (verify_site): New function, separated from main(). Only reads local state and stored state when necessary for the given action. (act_on_site): New function, separated from main(). Tue Sep 28 23:13:37 1999 Joe Orton * src/sitefiles.c (file_set_stored): Typo in shove test. Tue Sep 28 22:27:58 1999 Joe Orton * src/console_fe.c (issue_error): New function. (main): Unified standard site_* error handling. Tue Sep 28 22:20:59 1999 Joe Orton * tools/: New directory, tools for the maintainer. * sitecopy.lsm.in: LSM entry template. Tue Sep 28 20:19:44 1999 Joe Orton * src/rcfile.c (rcfile_write, rcfile_read): Write and read the 'http expect' option. * src/sites.h: Renamed 'http_no_expect' member of struct site to 'http_use_expect'. * src/httpdav.c: Renamed http_disable_expect to http_enable_expect. (http_init): Reversed semantics as above. * src/sites.c (proto_init): As above. Tue Sep 28 20:15:56 1999 Joe Orton * src/sitesi.h (for_each_file): New macro. Tue Sep 28 20:09:32 1999 Joe Orton * src/sites.c (site_verify, site_verify_compare): New functions, beginning of verify mode implementation. * src/console_fe.c (init, main): Verify mode interface. Tue Sep 28 16:39:22 1999 Joe Orton * Makefile.in (src/sitestore.o, src/sitefiles.o): Both depend on src/sites.h as well as src/sitesi.h Tue Sep 28 15:51:01 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.9.0-alpha2. Mon Sep 27 22:26:15 1999 Joe Orton * src/sitestore.c (site_write_stored_state): Write modification times as raw time_t values. (site_read_stored_state_new): Read modification times as raw time_t values. * configure.in: Remove dates.o from default LIBOBJS, now required only in WebDAV builds again. Mon Sep 27 12:33:21 1999 Joe Orton * src/sitestore.c (site_write_stored_state): Set stored state method to be current state method. Mon Sep 27 12:28:55 1999 Joe Orton * src/sitestore.c (site_write_stored_state) [CYGWIN||EMX]: Open storage file in binary. Sat Sep 18 16:59:27 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.9.0-alpha. Sat Sep 18 16:59:14 1999 Joe Orton * src/rcfile.c (rcfile_read): Default to following symlinks. Sat Sep 18 16:57:35 1999 Joe Orton * doc/examplerc: Updated for some of the new features since 0.8.0. Sat Sep 18 16:56:58 1999 Joe Orton * doc/changes.awk: Added '/' between URL and filename. Sat Sep 18 14:13:18 1999 Joe Orton * src/sitefiles.c (file_insert): New function, amalgamation of file_append, file_prepend, and file_create. Sat Sep 18 13:46:32 1999 Joe Orton * src/sitefiles.c (file_download): Fix typo. Sat Sep 18 13:43:22 1999 Joe Orton * src/sitefiles.c (file_set_local, file_set_remote): Significant changes. Handle renamed files. Prefer a move to changed direct match. Sat Sep 18 12:41:13 1999 Joe Orton * src/ftp.c (ftp_fetch): if0 out the walk tree stage... remote modtimes are ignored now. Sat Sep 18 12:40:31 1999 Joe Orton * src/console_fe.c (fe_fetch_found): Put the newlines back in. Sat Sep 18 12:39:37 1999 Joe Orton * src/common.h: Added DEBUG_FLUSH and DEBUG_FILESEXTRA. * src/common.c (debug) [DEBUGGING]: Flush stderr if DEBUG_FLUSH set. Sat Sep 18 12:38:13 1999 Joe Orton * src/sitesi.h (DEBUG_GIVE_DIFF): Returns diff string. Sat Sep 18 11:02:56 1999 Joe Orton * src/sites.h: Added 'checkrenames' field to struct site. * src/rcfile.c (rcfile_read): Read 'checkmoved renames' option. (rc_verifysite): Check for using 'checkrenames' when not using checksumming. FE API: New return code from rc_verifysite: SITE_NORENAMES. Fri Sep 17 12:28:59 1999 Joe Orton * src/sites.h: Use 'fnlist's for excludes, asciis, ignores. * src/sitefiles.c (fnlist_match): New function, modified version of slist_fnmatch. (file_is*): Use fnlist_match. * src/rcfile.c (rcfile_read, rcfile_write): Modified for fnlists. Fri Sep 17 12:24:37 1999 Joe Orton * src/httpauth.c (http_auth_challenge): Put challenges on linked list, and free them afterwards. (http_auth_init): Use callback to supply username and password on-demand. (http_auth_get_creds): New function. (http_auth_challenge_digest, http_auth_challenge_basic): Use http_auth_get_creds to get username + password. * src/httpdav.c (http_give_creds): New function, supplies username + password. (http_init): Modified for http_auth_init changes as above. Fri Sep 17 11:29:27 1999 Joe Orton * src/sitesi.h: New file, contains internal sites code prototypes. * src/sites.h: Removed internal prototypes. * src/sites.c, src/sitefiles.c, src/sitestore.c: Include sitesi.h not sites.h * Makefile.in: Updated deps as above. Thu Sep 16 14:44:30 1999 Joe Orton * lib/string_utils.c: Removed 'slist' handling. Thu Sep 16 10:13:01 1999 Joe Orton * src/sitestore.c (site_write_stored_state): Close the file, and return success code appropriately. Thu Sep 16 09:42:03 1999 Joe Orton * src/sites.h: Added comment section on filename handling. Wed Sep 15 19:54:05 1999 Joe Orton * src/sitefiles.c (file_is*, slist_fnmatch): Adding debugging messages. Wed Sep 15 19:52:34 1999 Joe Orton * src/sitestore.c (site_read_stored_state_old): Fixed filename handling and general brokenness. Wed Sep 15 19:50:16 1999 Joe Orton * src/httpdav.c (dav_fetch_gotresource) [DEBUGGING]: Fixed to display date without leaking memory Wed Sep 15 19:43:19 1999 Joe Orton * src/httpauth.c: (http_auth_response_body): Debugging fix. Wed Sep 15 19:38:02 1999 Joe Orton * src/common.h (debug): Use GNU CC __attribute__ to indicate printf-style arguments. Wed Sep 15 19:36:41 1999 Joe Orton * src/sitestore.c (site_write_stored_state): Don't write a character reference for '.'. Wed Sep 15 19:32:25 1999 Joe Orton * src/sites.c (site_destroy): Update site stats correctly. (site_catchup): Set the diff after copying local state to stored. Wed Sep 15 19:03:23 1999 Joe Orton * src/sitefiles.c (file_set_local, file_set_stored): Append directories to the end of the files list, prepend everything else. Fri Sep 10 19:41:09 1999 Joe Orton * src/sitestore.c (site_write_stored_state): Write out XML character reference when necessary. Fri Sep 10 18:38:50 1999 Joe Orton * src/frontend.h (fe_checksumming, fe_checksummed): Changed to take a filename rather than a struct file *. * src/console_fe.c (fe_checksumming, fe_checksummed): As above. Fri Sep 10 17:25:21 1999 Joe Orton * src/protocol.h: Added 'checksum', 'type' fields to struct proto_file, and removed 'isdir'. * src/httpdav.c (dav_fetch_gotresource, dav_xml_endelm, dav_xml_startelm): Modified to set file 'type' appropriately. * src/ftp.c (ftp_fetch_gettree, ftp_fetch_walktree): As above. * src/sites.c (site_fetch): Call site_fetch_checksum before rebuilding the files list. (site_fetch_checksum): Modified to write the checksum directly into the 'proto_file' list. (site_fetch_walk): Modified to copy the 'type' and 'checksum' fields appropriately. Fri Sep 10 16:31:04 1999 Joe Orton * src/sites.c (site_synch_create_directories, site_synch_files, site_synch_delete_directories): Modified to dynamically update files list. Fri Sep 10 11:10:17 1999 Joe Orton * src/sites.c (file_retrieve_server): New function. (site_update_files): Completed safe mode implementation. Wed Sep 8 15:52:53 1999 Joe Orton * src/sites.c (site_fetch_walk): Set ascii appropriately, and copy over the modification time so that existing files won't all appear changed. Wed Sep 8 15:08:51 1999 Joe Orton * src/ftp.c (ftp_getmodtime): Removed redundant argument. Wed Sep 8 15:07:13 1999 Joe Orton * src/socket.c (send_file_ascii): Added dummy fe_transfer_progress call so we get progress dots when uploading ASCII files. Return 0 on successful upload. Wed Sep 8 15:04:32 1999 Joe Orton * src/sitefiles.c (file_uploaded): Set exists and ascii too. * src/sites.c (site_update_files): Call file_uploaded after file_chmod to update list correctly. Wed Sep 8 11:31:19 1999 Joe Orton * src/sitefiles.c (file_perms_changed, file_contents_changed): New functions. * src/frontend.h (fe_setting_perms, fe_set_perms): New FE API calls. * src/sites.c (site_update_files): Just chmod changed files when file contents are unchanged. (file_chmod): Use new fe_*_perms calls. * src/console_fe.c (fe_setting_perms, fe_set_perms): Implementation. Wed Sep 8 11:30:09 1999 Joe Orton * src/ftp.c (ftp_chmod): Use mininum of 3 digits in chmod. Tue Sep 7 20:23:49 1999 Joe Orton * src/sites.c (file_chmod): New function. (site_update_files): Use file_chmod for new files, changed files when nooverwrite is set. Tue Sep 7 20:21:07 1999 Joe Orton * src/sitefiles.c (file_uploaded): Only copy over fields relevant to a file upload. Tue Sep 7 19:54:08 1999 Joe Orton * src/httpdav.c (http_parse_status): Cope with spaces between HTTP-Version and Status-Code tokens. Use friendly error messages. Fix bug in HTTP-Version parsing. Check that Status-Code is made up of digits. Tue Sep 7 17:23:57 1999 Joe Orton * src/httpauth.c, src/httpdav.c: Removed _t's from HTTP auth structure/enum names. * src/httpauth.c: Made private stuff static. Tue Sep 7 12:16:43 1999 Joe Orton * src/ftp.c (ftp_decode_perms): New function. (ftp_fetch): Get file permissions. Mon Sep 6 17:53:29 1999 Joe Orton * src/sitefiles.c (file_full_remote): Fixed off-by-one error in lowercase conversion. Mon Sep 6 17:15:34 1999 Joe Orton * src/rcfile.c (rcfile_read): Added 'lowercase' option. Mon Sep 6 16:26:55 1999 Joe Orton * src/sitestore.c (site_write_stored_state): Write out the file's stored size regardless of state method. Mon Sep 6 16:17:03 1999 Joe Orton * Makefile.in: Updated dependancies. Mon Sep 6 16:15:31 1999 Joe Orton * src/sitefiles.h: Removed file. Mon Sep 6 15:48:12 1999 Joe Orton * lib/string_utils.h (CONCAT2, CONCAT3): New macros. * src/ftp.c, src/sitefiles.c, src/sites.c: Use CONCAT2. Mon Sep 6 15:37:45 1999 Joe Orton * src/protocol.h: Removed 'directory' from struct proto_file. * src/sites.c (site_fetch_walk): Changed as above. * src/ftp.c (ftp_fetch_gettree, ftp_fetch_walktree): Changed as above. * src/httpdav.c (dav_fetch_parse_href, dav_fetch_gotresource): Changed as above. Mon Sep 6 13:57:52 1999 Joe Orton * src/protocol.h: Use size_t for 'remotesize' parameter for file_get and file_read. * src/httpdav.c (http_get, http_file_read): As above. * src/ftp.c (ftp_get, ftp_file_read): As above. Mon Sep 6 13:56:15 1999 Joe Orton * src/ftp.c (ftp_read_file): New function, implementation of read_file handler. (ftp_get): Use ftp_settype. * src/socket.c (read_file_blocks): New function. * src/sites.c. Added ftp_read_file to FTP driver. Mon Sep 6 13:55:14 1999 Joe Orton * src/sites.c (site_fetch_checksum): Only checksum files which exist remotely. Mon Sep 6 10:31:52 1999 Joe Orton * src/protocol.h: Modified file_read handler to take remote file size. * src/httpdav.c (http_read_file): As above. (http_read_file_block): New function, calls fe_t_p then callback. * src/sites.c (site_fetch_checksum): Checksum remote files. (site_fetch): Modified to call site_fetch_walk before calling pdriver finish, call site_fetch_checksum too. * src/frontend.h (fe_checksumming, fe_checksummed): New functions. * src/console_fe.c (fe_checksumming, fe_checksummed): Implementation. Sun Sep 5 13:42:44 1999 Joe Orton * src/protocol.h: Added file_read handler. * src/httpdav.c (http_read_file): New function, implemenation of file_read handler. * src/sites.c: Added NULL to FTP and http_read_file to WebDAV for file_read handlers in protocol drivers. Sun Sep 5 12:06:39 1999 Joe Orton * src/sitestore.c (site_write_stored_state): Minimize file size. Fri Sep 3 15:10:16 1999 Joe Orton * src/sites.h [struct site]: Added 'numignored' member. Split the 'is_different' member into local_ and remote_to cope with 'nodelete' and 'ignored' files. * src/sitefiles.c (site_stats_increase, site_stats_decrease, site_stats_update): New functions, to manage the num* and total* fields of sites accurately. (file_remove, file_set_diff, file_set_local, file_set_stored): Modified to use site_stats_* appropriately. * src/sites.c (site_update, site_readfiles, site_catchup): Rely on num* and total* and is_different to be updated dynamically, rather than setting them explicitly. * src/console_fe.c (site_normlist): Modified to show ignored changed files in brackets. Fri Sep 3 15:05:44 1999 Joe Orton * src/sitefiles.c (file_set_stored, file_set_local): Modified to find a single moved file candidate, and to prefer a direct match over a moved file candidate. Fri Sep 3 13:34:25 1999 Joe Orton * src/sitestore.c (site_write_stored_state): Only write out checksum-algorithm when using checksumming. Fri Sep 3 09:04:11 1999 Joe Orton * src/console_fe.c (main): Handle nooverwrite + safe mode error. Thu Sep 2 13:36:28 1999 Joe Orton * doc/sitecopy.1: Added explanation of 'state' keyword. Thu Sep 2 13:32:46 1999 Joe Orton * src/sites.h: Added 'stored_state_method' to struct site. * src/sitestore.c (site_xml_endelm, site_read_stored_state_old): Set stored_state_method appropriately. * src/console_fe.c (main): Display warning if stored state method differs from current state method. Thu Sep 2 12:46:12 1999 Joe Orton * src/common.c (md5_unhexify): New function. * src/sitestore.c (site_xml_endelm): Read checksum using md5_unhexify. * src/rcfile.c (rcfile_read): Added 'state checksum' and 'state timesize' options. Wed Sep 1 14:30:51 1999 Joe Orton * src/sitefiles.c (file_compare): Return file_moved when the filenames differ but the states are otherwise the same. (file_set_local, file_set_remote): Modified for above change. (files_state_copy): Destroy the destination state before copying over it. (file_state_copy, file_state_destroy): Updated for filename in state. * src/sites.c (site_destroy_stored): Remove file from linked list correctly before destroying it. Mon Aug 30 13:05:11 1999 Joe Orton * src/sites.c (site_read_local_state): Put the "." or ".." test first while scanning directories, losing two wasted "lstat" calls per local directory. Sun Aug 29 22:14:46 1999 Joe Orton * src/sites.c (site_initialize): Removed all code, put in a call to site_destroy_stored. Sun Aug 29 21:42:04 1999 Joe Orton * src/sitefiles.c (file_name): New function, easy access to a filename. * src/console.c (everywhere): Use file_name. Don't use 'old'. Sun Aug 29 21:12:59 1999 Joe Orton * src/sites.h: Make filename part of file state. Removed 'old' member from struct site_file. * src/sitefiles.c (file_set_stored, file_set_local): Split down file_set_state, and integrated "moved files" check. (file_full_stored, file_full_local): Take a file state as first parameter, rather than a file. * src/sites.c (site_update_*, site_synch_*): Changed for file_full_(stored,local). (site_checkmoved): Removed function. (site_readfiles): Removed site_checkmoved call. (site_fetch_walk): Use file_set_stored. (site_read_local_state): Use file_set_local. * src/sitestore.c (everywhere). Updated for filename in file state. (site_xml_endelm): Use file_set_stored. Sun Aug 29 19:21:12 1999 Joe Orton * src/sites.h: Use string list for ASCII patterns in struct site. * src/rcfile.c (rcfile_read): Changed as above. (rcfile_write): Dump ascii, excludes, and ingores string lists out using generic DUMP_SLIST macro. Sun Aug 29 18:44:29 1999 Joe Orton * src/sitefiles.c (slist_fnmatch): Abstracted fnmatch'ing against string lists. (file_isexcluded, file_isascii): Use slist_fnmatch. Sun Aug 29 18:09:21 1999 Joe Orton * Makefile.in, configure.in, gnome/*.[ch]: Source files rename (Lee Mallabone). Sun Aug 29 17:49:39 1999 Joe Orton * src/console_fe.c (main): Don't need to call site_readfiles if we are in init mode (allows --init over corrupted .sitecopy/ files). Sun Aug 29 17:47:43 1999 Joe Orton * Makefile.in, configure.in: Updated for lib/string_utils.c, now always need lib/md5.c, lib/dates.c. Sun Aug 29 17:45:41 1999 Joe Orton * src/sites.c (site_checkmoved): Compare filenames by their base_name() again. Sun Aug 29 16:42:06 1999 Joe Orton * lib/string_utils.c: Added 'string list' handling. (slist_prepend): New function. (slist_deep_copy): New function. * src/sites.h: Added 'ignores' to struct site. 'excludes' now uses generic string list. * src/sitefiles.c, src/rcfile.c: Changed for generic string list handling of excludes. * src/rcfile.c (rcfile_read): 'ignores' handling. Deep copy string list from default site entry. Sun Aug 29 16:40:54 1999 Joe Orton * lib/string_utils.c: Renamed from lib/strsplit.c. (split_string): Renamed from strsplit. (pair_string): Renamed from strpairs. (shave_string): Renamed from strstrip. * src/httpauth.c, src/httpdav.c: Renamed function as above. Sun Aug 29 13:35:17 1999 Joe Orton * src/sitefiles.c (file_state_copy): Copy one state onto another. (file_set_diff): Reduce num* and total* as appropriate before changing the diff. (file_set_state): Pretend newly-created files are 'deleted' before the diff is set properly. * src/sitefiles.h (DEBUG_DUMP_FILE): New macro, to dump a file and a file state. * src/sites.c (site_catchup): Updated for abstract state changes. Use file_state_copy for changed and new files. Remove deleted files from the files list. (site_read_local_state): Bitwise-and the protection mode with octal 777. Sun Aug 29 13:09:49 1999 Joe Orton * src/socket.c (send_file_binary, send_file_ascii): Changed to return zero on success, non-zero on error. * src/ftp.c (ftp_put, ftp_put_cond): Check send_file_* return codes appropriately. Sat Aug 28 20:07:46 1999 Joe Orton * src/sitestore.c (site_read_stored_state_new, site_xml_startelm, site_xml_endelm, site_xml_cdata, site_xml_get_tag): Implementaion of parsing XML-format stored state files using expat. Sat Aug 28 17:06:22 1999 Joe Orton * src/sitestore.c (site_read_stored_state_old): Updated to use file_set_state to dynamically update the files list. Sat Aug 28 16:07:48 1999 Joe Orton * src/console_fe.c (main): Display the remote root in the banner lines. Sat Aug 28 15:08:40 1999 Joe Orton * gnome/*: Merged changes from Lee Mallabone. Sat Aug 28 13:53:31 1999 Joe Orton * Makefile.emx, config.h.emx: Updated to build WebDAV code (Steffen Siebert). Sat Aug 28 13:50:00 1999 Joe Orton * src/common.h [__EMX__]: strncasecmp is strnicmp. Fri Aug 27 18:03:45 1999 Joe Orton * src/sites.c (proto_init): ifdef out http_disable_expect and http_conn_limit with USE_DAV (Steffen Siebert). Fri Aug 27 11:24:42 1999 Joe Orton * configure.in: Added check for xmlparse.h in xmltok/ and xml/. Give a warning if found library but no header, and only define HAVE_LIBEXPAT if both are found. Fri Aug 27 10:59:34 1999 Joe Orton * src/httpdav.c (http_init): Set http_expect_works to -1 always... play safe. Wed Aug 25 13:23:56 1999 Joe Orton * src/frontend.h (fe_warning): New function. * src/console_fe.c (fe_warning): Implementation. Wed Aug 25 13:15:26 1999 Joe Orton * src/sitestore.c (site_write_stored_state): New function, writes out the stored state in XML. Wed Aug 25 12:28:04 1999 Joe Orton * configure.in: Added sitefiles.o and sitestore.o to OBJECTS. * Makefile.in: Added sitefiles.o and sitestore.o dependancies. Wed Aug 25 12:25:58 1999 Joe Orton * src/sitefiles.c: New file. (file_*): Moved here from sites.c. * src/sites.c (file_*): Removed. Wed Aug 25 10:11:13 1999 Joe Orton * src/sitestore.c: New file. (site_read_stored_state): New function, reads the stored state. (site_read_stored_state_new): For the new XML format. (site_read_stored_state_old): For the old-style format (slightly modified site_readremotefiles). * src/sites.c (site_readremotefiles): Removed function. (site_read_localstate): Renamed from site_readlocalfiles. Wed Aug 25 09:20:52 1999 Joe Orton * src/sites.c: Removed dirname.h include. Tue Aug 24 18:14:18 1999 Joe Orton * src/sites.h: Added 'lowercase' member to struct site. * src/sites.c (file_full_remote): Returns filename in lowercase if 'lowercase' is set for the site. Tue Aug 24 18:07:34 1999 Joe Orton * src/sites.c (file_state_destroy): New function. (file_destroy): Use it. (site_destroy_stored): New function. (site_fetch): Calls site_destroy_remote before altering files list, allow it to be called at any time. Tue Aug 24 12:51:49 1999 Joe Orton * configure.in: Use supplied expat source if none found in system. * Makefile.in: Add expat dependancies. * expat/*: Integrated expat sources. Tue Aug 24 10:19:28 1999 Joe Orton * configure.in: Added AC_EXEEXT to check for executable extension. Tue Aug 24 09:32:02 1999 Joe Orton * configure.in: Link against both -lxmltok and -lxmlparse when looking for XML_Parse there. Sun Aug 22 10:40:23 1999 Joe Orton * src/sites.c (proto_init): Use proper return code, rather than SITE_OK always. Sat Aug 21 16:34:02 1999 Joe Orton * src/*: Renamed 'struct site_file_t' to 'struct site_file', 'struct site_t' to 'struct site'. * src/sites.h: Abstracted file state: 'struct file_state' represents a complete state of a file. 'struct site_file' * src/sites.c (file_compare): Returns the file_diff of a given file, derived directly from the file's alocal and stored state. (file_set_state): Sets the local and/or stored state for a file. (site_readlocalfiles): Large simplification to use file_set_state. (site_fetch_walk): Uses file_set_state. (file_destroy): Function renamed from site_destroyfile. (file_remove): Function renamed from file_delete. (file_checksum): Sets the checksum of a local file. (site_checkmoved): Modified to check file type, and file_compare. (file_full_remote, file_full_local): Replacements for full_remote and full_local fields in struct site_file. Sat Aug 21 12:12:53 1999 Joe Orton * src/sites.h: In 'struct site', use two 'struct proto_host's for the server and proxy details. * src/sites.c (proto_init): Modified for above changes. Sat Aug 21 12:04:19 1999 Joe Orton * src/ftp.c (ftp_put_cond, ftp_put): Check the return code from send_file_(ascii,binary) and return an error if it failed, even if the server indicated success. Fri Aug 20 18:22:04 1999 Joe Orton * src/console_fe.c: Added generic contact-maintainer message. Made file-private functions and variables static. (fe_can_update): Handle file_link. Fri Aug 20 17:59:13 1999 Joe Orton * src/common.h: Changed to using short for bool rather than int, saves 6 bytes in struct file, 26 in struct site. * src/console_fe.c (main): In the longopts struct, use the option char for --prompting and --allsites, and a dummy for --flatlist, since an 'int *' is required here, not a 'short *'. Fri Aug 20 17:54:08 1999 Joe Orton * src/rcfile.c (rcfile_read): Added 'default' site entry, which sets the default for any of the normal site options. Use LINESIZE rather than BUFSIZ for line buffers: 128 rather than 1024 bytes. Fri Aug 20 10:04:00 1999 Joe Orton * .cvsignore: Added strpairs Thu Aug 19 22:46:41 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.10. Thu Aug 19 22:43:48 1999 Joe Orton * src/sites.c (site_update_remove_directories): Deleted reduntant prototype. Thu Aug 19 22:38:47 1999 Joe Orton * src/console_fe.c (main): Handle no permissions support in WebDAV rcfile error. * src/rcfile.[ch] (rc_verifysite): Disallow using permissions mirroring for sites using WebDAV. FE API: New return code from rc_verifysite: SITE_NOPERMS. Thu Aug 19 11:25:11 1999 Joe Orton * src/socket.c, src/socket.h, src/ftp.c: Renamed send_file to send_file_binary to fix AIX build. Wed Aug 18 19:52:40 1999 Joe Orton * src/sites.c (site_synch_*, site_update_*, proto_init, site_checkmoved, file_*): Functions internal to file declared as static. * src/httpdav.c (many): Similarly. Wed Aug 18 18:30:52 1999 Joe Orton * src/sites.c (site_update_files) [file_new case]: Added debugging to show success or failure of the file_upload call. Tue Aug 17 20:04:20 1999 Joe Orton * src/rcfile.c (rcfile_write): Changes from Lee Mallabone, support for 'http limit' and 'http noexpect' options. * gnome/...: Changes from Lee Mallabone, support for 'http limit' and 'http noexpect' options. Sat Aug 14 23:55:04 1999 Joe Orton * po/ru.po: New file, from Michael Sobolev . Fri Aug 6 14:39:42 1999 Joe Orton * configure.in: Swapped AC_ISC_POSIX and AC_PROG_CC. Fri Aug 6 13:21:44 1999 Joe Orton * src/testdav.c (get_body): New function, reads body for HTTP request. (main): PROPPATCH support, updated for http_init change, case-insensitive to method names on command line. * Makefile.in: Link httpauth.o into testdav. Wed Aug 4 14:32:30 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.9. Wed Aug 4 14:29:11 1999 Joe Orton * src/common.h: Added DEBUG_SITES debugging constant. * src/sites.c (site_update_files): Added debugging messages. Wed Aug 4 14:13:28 1999 Joe Orton * Makefile.in: Added .c.o rule to explicitly add -o to compile line. Thu Jul 29 16:12:15 1999 Joe Orton * src/httpdav.c (http_put) [CYGWIN||EMX]: Use binary mode for fopen. * src/httpda.c (http_req_sendbody): Added debug message showing how many bytes transfer() reports as sent. Mon Jul 26 23:20:08 1999 Joe Orton * configure.in: Added checks for expat in -lxmltok and -lxmlparse, as per Debian libxmltok1 package. Mon Jul 26 23:03:10 1999 Joe Orton * sitecopy.spec.in: Enabled debugging. Mon Jul 26 18:14:33 1999 Joe Orton * src/console_fe.c (init): const'ed longopts, and added last element of all zeroes (as required by getopt_long). Mon Jul 26 12:10:26 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.8. Mon Jul 26 12:09:32 1999 Joe Orton * src/socket.c: Added errno.h include (finally) Mon Jul 26 11:54:10 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.7. Mon Jul 26 11:47:56 1999 Joe Orton * src/httpauth.c (http_auth_clean): Only show debugging messages for DEBUG_HTTPAUTH. Mon Jul 26 11:39:41 1999 Joe Orton * src/httpdav.h, src/httpdav.c: Added http_conn_limit global. * src/httpdav.c (http_request): Close the connection after each request if http_conn_limit is set. * src/sites.h: Added http_limit member to site_t. * src/rcfile.c (rcfile_read): Added 'http limit' site option, setting http_limit. * src/sites.c (proto_init): Set http_conn_limit according to site->http_limit. Mon Jul 26 11:32:37 1999 Joe Orton * src/socket.c (read_line): Revert to using recv rather than sock_recv. Mon Jul 26 11:30:57 1999 Joe Orton * src/socket.c (transfer): Only transfer a fixed number of bytes when one is specified. Sun Jul 25 17:35:20 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.6. Sun Jul 25 17:29:45 1999 Joe Orton * src/ftp.c (ftp_open): Set the transfer type if one is required. Patch by Tim Ricketts . Sun Jul 25 17:21:01 1999 Joe Orton * src/socket.c (transfer): Debugging messages for Linux 2.2 sendfile() support. (read_line): Debugging messages for error cases. Sun Jul 25 17:16:26 1999 Joe Orton * src/ftp.c (ftp_data_close): Check return value of close() on data socket. (ftp_put): Added debugging message if send_file[_ascii] returns an error. (ftp_read): Set the error correctly if read_line() returns an error. Sun Jul 25 14:08:39 1999 Joe Orton * src/console_fe.c (site_normlist): Use different 'Deleted files' message when nodelete is set. Sun Jul 25 11:12:48 1999 Joe Orton * src/ftp.c (ftp_exec): Removed reduntant cast of command to (char *) when calling send_line. Fri Jul 23 17:34:06 1999 Joe Orton * src/sites.c (site_readlocalfiles): Remove debugging message which fired regardless of file type (caused segfault on named pipes etc). Fri Jul 23 17:33:10 1999 Joe Orton * src/httpdav.c (http_init, http_finish, http_new_request): Added some debugging messages. Thu Jul 22 15:13:40 1999 Joe Orton * doc/sitecopy.1: Updated for proxy support, 'http noexpect' option, new HTTP RFC's. Thu Jul 22 15:11:36 1999 Joe Orton * src/sites.c (site_update_links, site_update_create_directories, site_update_delete_files, site_update_delete_directories): Use CALL() everywhere. Thu Jul 22 14:20:47 1999 Joe Orton * src/httpdav.c (http_parse_status): Use first digit of status code directly as class rather than doing a /100. Thu Jul 22 14:06:33 1999 Joe Orton * src/httpdav.c (dav_rmdir): Fail if we get 207, or any non-2xx class response, rather than any non-204 status. Thu Jul 22 13:16:53 1999 Joe Orton * src/httpdav.c (http_init): Do the name lookup on the proxy when we have a proxy, and on the server when we have a server. Thu Jul 22 12:20:16 1999 Joe Orton * src/httpauth.c (http_auth_verify_response): Free up everything we strdup. Check we have a current sess->unq_nonce before free'ing it. Thu Jul 22 12:11:33 1999 Joe Orton * src/httpauth.c (http_auth_request_digest): For qop=auth-int, use MD5 digest of empty string for H(entity-body). Thu Jul 22 11:25:47 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.5. Thu Jul 22 11:24:28 1999 Joe Orton * src/httpdav.c (http_response_read): Fix typo, read bodies with set content-length properly. Thu Jul 22 11:10:57 1999 Joe Orton * src/httpauth.c (http_auth_challenge_basic): Set session scheme on success. Thu Jul 22 09:45:41 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.4. Thu Jul 22 09:24:18 1999 Joe Orton * src/httpdav.c (http_request): Read trailing headers after chunked messages, store Authentiation-Info value. Thu Jul 22 09:21:52 1999 Joe Orton * src/httpdav.c (http_request): Overwrite Authorization parameters with 'x's unless debug channel 256 is specified. * src/common.h: Reserve debug channel 256. Thu Jul 22 09:11:14 1999 Joe Orton * src/ftp.c (ftp_exec): Don't display complete PASS command in debugging information. Tue Jul 20 17:41:01 1999 Joe Orton * src/httpdav.c (http_request): Send absoluteURI in Request-Line if using proxy server. (http_strcat_hostname): Renamed, pass proto_host_t as argument. Tue Jul 20 17:39:36 1999 Joe Orton * src/httpauth.c (http_auth_request_basic): Allocate memory properly. Tue Jul 20 15:12:34 1999 Joe Orton * src/protocol.h: Added proto_host_t to store a server's address, port, and authentication details. Changed driver ->init prototype to pass two proto_host_t's giving the server and proxy information, if any. * src/httpdav.c, src/httpdav.c (http_init, http_open, http_strcat_remoteserver, http_mkdir_with_put): Updated for above changes. * src/ftp.c, src/ftp.h (ftp_init): Updated for above changes. Tue Jul 20 14:33:42 1999 Joe Orton * src/console_fe.c (main): Changed 'sitecopy: Site...' header line to display current usage mode, site name, and server only. Tue Jul 20 14:25:32 1999 Joe Orton * src/protocol.h: Added hardcoded port member to protocol driver. * src/rcfile.c (rc_verifysite): Fallback on hardcoded port number if lookup by name fails. * src/sites.c: Added hardcoded port numbers to FTP and DAV drivers of 21 and 80 respectively. Tue Jul 20 14:19:52 1999 Joe Orton * src/rcfile.c (rcfile_read): Added 'proxy-*' options to support proxy servers. * src/sites.h: Added proxy_* members to site_t. Tue Jul 20 14:18:08 1999 Joe Orton * src/sites.c (proto_init): New function, to initialize the protocol driver. (site_update, site_synch, site_fetch): Use proto_init. Tue Jul 20 14:00:16 1999 Joe Orton * .cvsignore: Added strpairs. Mon Jul 19 15:59:49 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.3. Mon Jul 19 15:45:41 1999 Joe Orton * src/httpdav.c: Added http_disable_expect to disable 'Expect: 100-continue' support. (http_init): Set http_expect_works to -1 if http_disable_expect is set. * src/sites.h: Added 'http_no_expect' member to site_t. * src/rcfile.c (rcfile_read): Added 'http noexpect' option. * src/sites.c (site_update,site_synch,site_fetch): Set http_disable_expect according to site->http_no_expect. Mon Jul 19 11:05:34 1999 Joe Orton * src/httpdav.c (http_response_read): New function, reads a block of response body. (http_request): Simplification of response body read handling. Localize variables better. Mon Jul 19 09:18:57 1999 Joe Orton * Makefile.in (src/httpdav.o): Depends on httpauth.h. Sun Jul 18 19:19:01 1999 Joe Orton * src/httpdav.c (http_request): Updated for auth changes. Sun Jul 18 19:17:23 1999 Joe Orton * src/common.h: Added DEBUG_HTTPAUTH debug constant. * src/httpauth.c: Changed to use DEBUG_HTTPAUTH for debugging. Sun Jul 18 19:07:24 1999 Joe Orton * src/httpauth.c: Completed implementation of HTTP authentication to RFC2617. (http_auth_request): Return the header value, rather than pass it as an argument. (http_auth_request_basic, http_auth_request_digest): Use dynamically allocated buffer for field value, avoid buffer overruns. (http_auth_response_body, http_auth_verify_response): New functions, to handle the 'Authentication-Info' header and authenticate the server. * src/httpauth.h: Changes as above. Added interface usage description. Fri Jul 16 23:45:46 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.2. Fri Jul 16 23:42:29 1999 Joe Orton * gnome/fe_gtk_site_ops.c: Error handling improved (Lee Mallabone). Fri Jul 16 23:42:20 1999 Joe Orton * configure.in: Added message to advise using GNU make. Fri Jul 16 09:09:06 1999 Joe Orton * lib/snprintf.c, lib/snprintf.h: Renamed dtoa() to doubletoa() to avoid conflict with cygwin dtoa() in - thanks to Andy Cowling. Thu Jul 15 15:17:02 1999 Joe Orton * src/httpauth.c: Removed reliance on 'http_req_t' structure, abstracted session state. (http_auth_new_request): New function, takes method, URI and optionally entity-body. * src/httpdav.c (http_request): Updated for above changes. Thu Jul 15 11:27:17 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.1. Wed Jul 14 11:46:49 1999 Joe Orton * src/httpauth.c (http_auth_request_digest): Don't quote 'algorithm=' value. Generate 'nc=' value properly, give quoted cnonce value, but digest it unquoted. Wed Jul 14 11:38:10 1999 Joe Orton * src/httpdav.c: Added http_can_authenticate global. (http_request): Made authentication status persistent beyond a single request. Wed Jul 14 11:34:32 1999 Joe Orton * src/httpauth.c (http_auth_request_digest): More commas in 'Authorization:' header, quote 'qop=' value. Wed Jul 14 11:32:53 1999 Joe Orton * lib/strsplit.c [STRPAIRS_TEST] (main): Command-line strpairs tester. * Makefile.in: Fixed strsplit tester, added strpairs tester. Wed Jul 14 10:20:45 1999 Joe Orton * src/httpdav.c (http_request): Removed very stupid strtok from header-line parser, split the line properly by ':' position. Tue Jul 13 18:03:21 1999 Joe Orton * configure.in: Removed sitecopy.spec from AC_OUTPUT, now generated at distribution time. Tue Jul 13 14:40:28 1999 Joe Orton * src/httpdav.h: Removed date member of http_req_t. * src/httpdav.c (http_request): Removed 'Date:' header handling. * src/httpauth.c (http_auth_request_digest): Fixed handling of ASCII MD5 digests, added commas between fields in 'Authorization:' header, removed extra ':' in Request-Digest calculation. (http_auth_request): Call http_auth_request_basic with Basic challenges. * src/common.c (md5_hexify): Require 33 byte buffer, write trailing \0. Mon Jul 12 18:17:51 1999 Joe Orton * configure.in: Added src/httpauth.o to OBJECTS for WebDAV build. Mon Jul 12 18:00:26 1999 Joe Orton * src/httpauth.c: Reimplementation continues. (http_auth_request, http_auth_request_digest, http_auth_request_digest): New functions. (http_auth_finish): New function, to clean up after ourselves. * src/httpdav.c: Added call to http_auth_finish(). Mon Jul 12 17:59:37 1999 Joe Orton * configure.in: Remove linelen.o from LIBOBJS (console_fe), until we actually need it. Mon Jul 12 17:56:47 1999 Joe Orton * src/common.c (md5_hex_stream) (md5_hex): Removed functions. (md5_hexify): Renamed from hexify_md5, changed to write ASCII to buffer given as argument. Mon Jul 12 15:39:19 1999 Joe Orton * lib/snprintf.h: Added sys/types.h define to pick up size_t, patch by Andy Cowling . Mon Jul 12 09:49:08 1999 Joe Orton * tests/server.test: Added file download (synch) test. Mon Jul 12 09:00:19 1999 Joe Orton * Makefile.emx: Updates from Steffen Siebert. * config.h.emx: Define HAVE_STRING_H (Steffen Siebert). Mon Jul 12 08:58:54 1999 Joe Orton * src/socket.c [HAVE_SYS_SELECT_H]: Include sys/select.h. * configure.in: Added sys/select.h to CHECK_HEADERS. * config.h.in: Added HAVE_SYS_SELECT_H. * config.h.emx: Define HAVE_SYS_SELECT_H 1. Sun Jul 11 22:55:01 1999 Joe Orton * src/sites.c: Changes to remove all traces of the 'updated' member of site_file_t. (site_update_*): Dynamically update the files list, by changing the ->diff after a successfull update operation. (site_catchup): Dynamically update the files list. (site_writefiles): Rewritten, uses new info file format. Sun Jul 11 19:41:12 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.0. Fri Jul 9 13:17:25 1999 Joe Orton * src/httpdav.c: Separation of authentication code into separate module. (http_init): Added http_auth_init call. (http_request): Simplified authentication handling a little. * src/httpauth.c: New file. Added authentication globals from httpdav.c. (http_auth_init): New function, stores the username and password we are using to authenticate. Thu Jul 8 23:25:13 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.7.0-pre. Thu Jul 8 23:21:35 1999 Joe Orton * gnome/fe_gtk_main.c: Disallow new sites with no name. (Lee Mallabone) Thu Jul 8 23:08:25 1999 Joe Orton * src/common.h: Added new debug constant DEBUG_GNOME. (Lee Mallabone) * gnome/fe_gnome.c, gnome/fe_gtk_main.c: Debugging and command line options changes. (Lee Mallabone) Thu Jul 8 15:41:26 1999 Joe Orton * src/sites.c (site_readlocalfiles): Added fe_warning for stat() failure. Dynamically grow the directory stack. Thu Jul 8 15:14:33 1999 Joe Orton * src/httpdav.c (http_auth_request): Added fe_warning for warning of switch from digest -> basic auth spoof attack. Thu Jul 8 15:12:54 1999 Joe Orton * src/sites.c (site_readlocalfiles): Fix 'free(NULL)' line. Thu Jul 8 14:42:41 1999 Joe Orton * Makefile.in (distclean): Use 'find' to delete .orig, .rej etc. Thu Jul 8 12:34:06 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.6.13. Thu Jul 8 12:07:05 1999 Joe Orton * src/rcfile.c (rcfile_read): Create excludes list doubly linked (Lee Mallabone). * src/sites.h: Make excludes list doubly linked (Lee Mallabone). * configure.in: GNOME changes - updated OBJECTS, die when --enable-gnomefe is used and cannot find GNOME properly. (Lee Mallabone) Wed Jul 7 22:31:34 1999 Joe Orton * src/httpdav.c (http_request): Added handling for read-till-socket-close response message length case. (http_get): Use given remote file size for total download size. Wed Jul 7 22:28:13 1999 Joe Orton * tests/server.test: New file, mini testsuite for servers. Wed Jul 7 17:45:34 1999 Joe Orton * src/sites.c (site_update_files) [file_new case]: Added safe mode handling. Wed Jul 7 17:36:38 1999 Joe Orton * src/common.h: Added DEBUG_GTK to debugging constants. Tue Jul 6 19:24:56 1999 Joe Orton * src/sites.c (site_update_files): Use fe_warning when chmod fails. * src/protocol.h: fe_warning takes two arguments. * src/console_fe.c (fe_warning): As above. Tue Jul 6 19:02:42 1999 Joe Orton * src/protocol.h: Added file_get_modtime handler to protocol driver, to retrieve the remote modification time of files. * src/sites.c: Added file_get_modtime handlers to FTP and WebDAV drivers. (site_update_files) [file_changed case]: Added safe mode handling. Tue Jul 6 19:00:24 1999 Joe Orton * src/ftp.c, src/ftp.h (ftp_ext_get_modtime): External interface to ftp_getmodtime. Tue Jul 6 18:57:54 1999 Joe Orton * src/frontend.h: Added fe_warning prototype. * src/console_fe.c (fe_ynprompt): Removed function. (fe_warning): New function - displays warning messages. Tue Jul 6 17:59:48 1999 Joe Orton * src/rcfile.c (rc_verifysite): Disallow using nooverwrite mode and safe mode at the same time. FE API: New return code from rc_verifysite: SITE_NOSAFEOVER. Tue Jul 6 17:40:30 1999 Joe Orton * src/httpdav.c (http_dateparse): HTTP-date parser. (http_get_lastmod): New function, catches date from Last-Modified header. (http_getmodtime): New function, does a HEAD and fetches modification time of remote file. (http_put_if_unmodified): If server does not claim HTTP/1.1 compliance, try fetching mod time using http_getmodtime. Tue Jul 6 17:38:59 1999 Joe Orton * configure.in: Add dates.o to LIBOBJS for WebDAV. * Makefile.in: Added dates.o to ALLLIBOBJS, updated dependancies for lib/dates.?. Tue Jul 6 17:36:24 1999 Joe Orton * lib/dates.c, lib/dates.h: New files. (rfc1123_parse, rfc1123_date): Moved from common.c (rfc1036_parse): Resurrected. (asctime_parse): New function, to parse asctime()-style dates. * src/common.c, src/common.h: Removed date manipulation code. Tue Jul 6 16:03:13 1999 Joe Orton * doc/sitecopy.1: Added safe mode. Tue Jul 6 15:50:50 1999 Joe Orton * src/rcfile.c (rcfile_read): 'safe' keyword sets ->safemode. Tue Jul 6 15:49:10 1999 Joe Orton * src/sites.h (struct site_t): Added safemode member. (struct site_file_t): Added servertime member. Tue Jul 6 15:37:16 1999 Joe Orton * src/httpdav.c (http_put_if_unmodified): Check server claims to at least HTTP/1.1 compliance. Tue Jul 6 15:19:24 1999 Joe Orton * src/ftp.c (ftp_getmodtime): New function, does MDTM. (ftp_fetch_walktree): Use ftp_getmodtime. (ftp_put_cond): New function, performs a conditional put by checking MDTM before doing STOR. * src/httpdav.c (http_parse_status): Parse the HTTP-Version and Status-Code strings properly, setting http_version_major and http_version_minor appropriately. (http_put_if_unmodified): New function, performs a conditional put by sending the "If-Unmodified-Since" header in the PUT request. * src/protocol.h: Added conditional put to protocol driver. Fri May 28 17:26:14 1999 Joe Orton * src/sites.c [!HAVE_SNPRINTF]: Include snprintf.h. Mon Jul 5 18:38:01 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.6.12. Mon Jul 5 18:36:07 1999 Joe Orton * src/httpdav.c (http_request): Only pass the response body back to the caller when the response is 2xx class. Mon Jul 5 17:50:35 1999 Joe Orton * src/sites.c (site_fetch_walk): Store dummy rel_local on the heap, rather than malloc'ing it for every file. Mon Jul 5 17:41:15 1999 Joe Orton * src/console_fe.c (fe_synching): Display 'Moving' message correctly. Mon Jul 5 17:39:48 1999 Joe Orton * src/sites.c (site_fetch): Initialize files to NULL - fixes segfault on empty remote site. Mon Jul 5 17:28:07 1999 Joe Orton * src/sites.c (site_fetch_walk): Still loop properly after excluded file. Mon Jul 5 16:11:28 1999 Joe Orton * lib/basename.h: New file, with base_name declaration. * src/common.h: Removed base_name declaration. * src/httpdav.c, src/sites.c, src/console_fe.c: Added basename.h include. Mon Jul 5 15:51:34 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.6.11. Sun Jul 4 15:11:35 1999 Joe Orton * src/protocol.h: Fetch mode interface changed to pass files list as argument. * src/sites.c (site_fetch): Altered for new fetch mode interface. (site_fetch_callback): Removed. (site_fetch_walk): New function, to create a real files list from the dummy files list. * src/httpdav.c, src/httpdav.h, src/ftp.c, src/ftp.h: Adjusted for new fetch mode interface. Sun Jul 4 13:54:49 1999 Joe Orton * src/httpdav.c: Undefine RE and UN after URI character map array. Sun Jul 4 13:52:40 1999 Joe Orton * src/sites.c (site_synch_files) [file_deleted,file_changed case]: Pass the driver error string to fe_synched on file_download failure. Sat Jul 3 11:09:19 1999 Joe Orton * src/sites.c: Fixed typo. Sat Jul 3 10:58:34 1999 Joe Orton * Makefile.in (install-xsitecopy): xsitecopy.desktop is in gnome/. Sat Jul 3 10:57:06 1999 Joe Orton * Makefile.in: Added fe_gnome_new_site.o and mguru.o to GNOMEOBJS. Added $(topdir)/src to INCLUDES. Fri Jul 2 19:29:19 1999 Joe Orton * doc/*, gnome/*: Merged changes from Lee Mallabone. Fri Jul 2 17:19:15 1999 Joe Orton * src/rcfile.c (rcfile_write): Added quotes around 'exclude' values (suggested by Lee Mallabone). Thu Jul 1 10:38:04 1999 Joe Orton * src/rcfile.c (rcfile_write): Write out local_root_user and remote_root_user for 'local' and 'remote' rcfile fields, respectively. Tue Jun 29 00:43:54 1999 Joe Orton * src/rcfile.c, src/socket.c, src/httpdav.c: cygwin port by Andy Cowling . * src/console_fe.c (version): Added cygwin platform. Mon Jun 28 16:58:27 1999 Joe Orton * src/sites.c (site_update_files) [file_changed case]: Perform a chmod after the put when nooverwite is set - patch from Olivier Calle . Sun Jun 27 20:22:10 1999 Joe Orton * src/sites.c (site_fetch) (site_synch): Set ftp_use_passive here too - patch from Paul Crowley . Sat Jun 26 20:59:18 1999 Joe Orton * src/console_fe.c (fe_transfer_progress) [PROGRESS_SPINNER]: Removed. Fri Jun 25 21:56:54 1999 Joe Orton * po/POTFILES.in: Added lib/rpmatch.c Fri Jun 25 20:43:52 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.6.10. Fri Jun 25 20:38:01 1999 Joe Orton * configure.in: Only add linelen.o to LIBOBJS for console frontend. Fri Jun 25 20:27:37 1999 Joe Orton * lib/yesno.c: New file. Added from fileutils-4.0i. * lib/rpmatch.c: New file. Added from fileutils-4.0i. * src/console_fe.c: Added yesno() declaration. (fe_ynprompt): #if 0'ed out. (fe_can_update): Use yesno() rather than fe_ynprompt. * configure.in: Added rpmatch.o and yesno.o to LIBOBJS. * Makefile.emx: Added lib/rpmatch.o and lib/yesno.o to OBJECTS. Fri Jun 25 20:07:18 1999 Joe Orton * lib/linelen.c: New file. (get_line_length): Returns console line length, or 80 if this cannot be determined. From fileutils-4.0i. * configure.in: Added linelen.o to LIBOBJS. Added termios.h to AC_CHECK_HEADERS. Added jm_WINSIZE_IN_PTEM and AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL calls. * config.h.in: Added GWINSZ_IN_SYS_IOCTL, WINSIZE_IN_PTEM, HAVE_TERMIOS_H. * Makefile.emx: Added lib/linelen.o to OBJECTS. * aclocal.m4: Added jm_WINSIZE_IN_PTEM, AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL, AM_SYS_POSIX_TERMIOS, jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H (latter not needed?). Thu Jun 24 10:39:40 1999 Joe Orton * lib/base64.c [BASE64_TEST] (main): Added usage message. Wed Jun 23 12:16:53 1999 Joe Orton * Makefile.in (base64): Build from only lib/base64.c Wed Jun 23 11:59:35 1999 Joe Orton * lib/snprintf.c, lib/snprintf.h: Moved includes to .c from .h, bracketed in HAVE_*_H checks. Wed Jun 23 11:52:27 1999 Joe Orton * src/sites.h: Removed const from ->*_root in site_t. Comment about site_t->*_root* added. * src/rcfile.c (rc_verifysite): remote_root is strdup'd from remote_root_user. Tue Jun 22 22:54:47 1999 Joe Orton * src/sites.c (site_update_files): file_changed, nooverwrite == true, check file_delete returns PROTO_OK. Tue Jun 22 22:38:38 1999 Joe Orton * src/common.c, src/common.h (base64): Removed function. * lib/base64.c, lib/base64.h: New files. (base64) Moved function from common.[ch]. * configure.in: Add base64.o to LIBOBJS for WebDAV build. * Makefile.in: Added base64.o to ALLLIBOBJS, added and altered dependancies. * src/httpdav.c: Include base64.h. Tue Jun 22 20:22:47 1999 Joe Orton * src/httpdav.c (http_get_content_charset): New function, gets the charset from the Content-Type and places it in http_content_charset. Tue Jun 22 20:19:05 1999 Joe Orton * Makefile.in: httpdav.o depends on strsplit.h, strsplit.o depends on config.h. Tue Jun 22 20:17:51 1999 Joe Orton * lib/strsplit.c (strsplit) (strpairs): Fixed allocation of memory for arrays. Tue Jun 22 11:07:57 1999 Joe Orton * lib/strsplit.c, lib/strsplit.h (strpairs_free): New function, frees pairs array correctly. Tue Jun 22 10:52:58 1999 Joe Orton * lib/strsplit.c (strpairs): Cope with missing separators. Mon Jun 21 01:36:33 1999 Joe Orton * sitecopy.spec.in (%description): sitecopy has a lower-case s. Mon Jun 21 01:34:38 1999 Joe Orton * configure.in: Linux 2.2 sendfile() support made a --with option. Mon Jun 21 01:19:34 1999 Joe Orton * src/httpdav.c (http_parse_status): Calculate request class here. (http_request): Loop while any 1xx class responses are returned. Mon Jun 21 00:30:53 1999 Joe Orton * src/httpdav.c (http_auth_challenge): Updated to use strpairs and strstrip. Mon Jun 21 00:26:29 1999 Joe Orton * lib/strsplit.c, lib/strsplit.h (strstrip): New function. Sun Jun 20 23:54:06 1999 Joe Orton * lib/strsplit.c, lib/strsplit.h (strpairs): New function. Sun Jun 20 23:37:36 1999 Joe Orton * .cvsignore: Added strsplit. Sun Jun 20 23:35:40 1999 Joe Orton * configure.in: Added strsplit.o to LIBOBJS for DAV builds. Sun Jun 20 23:34:18 1999 Joe Orton * src/httpdav.c (http_options_parsehdr): Use strsplit to parse 'DAV:' header correctly. Sun Jun 20 23:33:29 1999 Joe Orton * lib/strsplit.c (strsplit_free): Corrected. Sun Jun 20 23:24:58 1999 Joe Orton * Makefile.in (strsplit): Added strsplit tester goal. Sun Jun 20 23:21:46 1999 Joe Orton * lib/strsplit.c, lib/strsplit.h (strsplit_free): Added new function. Sun Jun 20 23:14:37 1999 Joe Orton * lib/strsplit.c: Fixed quotes starting component case. [STRSPLIT_TEST] (main): Added usage message. Sun Jun 20 22:45:46 1999 Joe Orton * lib/strsplit.c, lib/strsplit.h: New files. Generic string splitter function. Sat Jun 12 21:05:13 1999 Joe Orton * doc/update.sh: Fixed default changes.awk location. Sat Jun 12 20:43:53 1999 Joe Orton * src/socket.c (host_lookup): Removed unnecessary gethostbyaddr call - can now specify servers by IP address which don't have a reverse DNS hostname entry. Sat Jun 12 20:16:33 1999 Joe Orton * po/Makefile.in.in (mostlyclean): Clean *.o too. Sat Jun 12 17:50:48 1999 Joe Orton * .cvsignore: Added sitecopy.spec. Sat Jun 12 17:49:33 1999 Joe Orton * Makefile.in (subdirs): Added @ for silent invocation of make. Sat Jun 12 17:03:04 1999 Joe Orton * src/common.h: Added sig_handler typedef. Sat Jun 12 17:02:29 1999 Joe Orton * src/console_fe.c (abort_handler): Renamed from sighandler. Tue Jun 8 23:06:14 1999 Joe Orton * Makefile.in: Use NLSTARGS to build in intl and po. subdirs goal added. Tue Jun 8 22:59:40 1999 Joe Orton * configure.in: Fix quoting of -DLOCALEDIR in SDEFS when building NLS support. Use NLSTARGS to make in intl and po. Tue Jun 8 22:55:39 1999 Joe Orton * src/*.c: Include string.h and strings.h (only) when present. Tue Jun 8 22:50:49 1999 Joe Orton * config.h.in, configure.in: Added strings.h check. * config.h.emx: Updated with missing defs from config.h.in. Tue Jun 8 22:46:45 1999 Joe Orton * configure.in: Enabled NLS stuff. * Makefile.in: Started on NLS build. Mon Jun 7 22:12:44 1999 Joe Orton * mkinstalldirs: New file, required by po/Makefile install goal. Mon Jun 7 22:03:12 1999 Joe Orton * po/sitecopy.pot: Extracted new messages. Mon Jun 7 22:00:38 1999 Joe Orton * src/common.c (hexify_md5): Moved into #ifdef USE_DAV section, added prototype. Mon Jun 7 21:56:28 1999 Joe Orton * src/httpdav.c: Added in last of missing prototypes, use 'authentication' not 'authorization' in comments. Tue Jun 1 23:16:39 1999 Joe Orton * src/httpdav.c (http_parse_status): Use strchr not strrchr to check for \r. Tue Jun 1 23:14:44 1999 Joe Orton * config.h.in, configure.in: Added check for limits.h (used by lib/md5.h). Tue Jun 1 23:07:26 1999 Joe Orton * src/socket.c, src/ftp.c, src/httpdav.c, src/common.c, src/sites.c, src/console_fe.c: Only include stdlib.h and unistd.h when present. * configure.in, config.h.in: Add checks for stdlib.h and unistd.h. Tue Jun 1 23:00:01 1999 Joe Orton * Makefile.in (INCLUDES): Use top_srcdir instead of '.'. Mon May 31 19:57:39 1999 Joe Orton * Makefile.emx (OBJECTS): Added lib/basename.o and lib/dirname.o (thanks to Steffen Siebert). Mon May 31 18:55:35 1999 Joe Orton * src/httpdav.c (dav_xml_cdata): Don't do anything when passed a segment of cdata which is entirely leading whitespace. (http_request): Fixed multi-line header handling. Mon May 31 18:11:52 1999 Joe Orton * src/socket.c (read_line): Return -2 when no newline is found within len. Mon May 31 17:41:30 1999 Joe Orton * lib/dirname.c (dir_name): Include the trailing slash. Sat May 29 14:36:26 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.6.9. Sat May 29 14:34:27 1999 Joe Orton * src/console_fe.c (version): Show if using sendfile. Sat May 29 14:33:19 1999 Joe Orton * src/socket.c (transfer): If sendfile gives EINVAL, then do normal user-space copying. Sat May 29 14:31:12 1999 Joe Orton * src/testdav.c (usage): Fixed typo. Sat May 29 00:02:51 1999 Joe Orton * src/socket.c (transfer): Use sendfile() when present, and we know how much to send. Fri May 28 23:29:42 1999 Joe Orton * configure.in: Added Linux 2.2 sendfile() check. * config.h.in: Added HAVE_LX22_SENDFILE define. * src/socket.c: sendfile() declared. Fri May 28 20:23:30 1999 Joe Orton * src/socket.c, src/socket.h (sock_read): Made count const. (sock_recv): Made count, flags const. * src/socket.h: Updated read_line and transfer prototypes to match implementations. Fri May 28 20:17:22 1999 Joe Orton * doc/sitecopy.1: Updated, adding --help and --version, INVOCATION section, when to use fetch mode. Fri May 28 20:14:43 1999 Joe Orton * src/console_fe.c: Fixed port output, added --version to help output. Fri May 28 20:13:51 1999 Joe Orton * doc/examplerc: Restored to former glory, got emptied during the move. Fri May 28 20:06:04 1999 Joe Orton * lib/dirname.c (dir_name): Modified to return "" not "." if no directory name is found. Fri May 28 19:53:37 1999 Joe Orton * Makefile.in: Fixed install goals. Fri May 28 17:26:14 1999 Joe Orton * src/sites.c [!HAVE_SNPRINTF]: Include snprintf.h. Fri May 28 17:19:45 1999 Joe Orton * src/ftp.c, src/ftp.c, src/rcfile.h: Use void in declarations of functions which take no arguments. Fri May 28 17:16:51 1999 Joe Orton * config.h.in: Added HAVE_SYS_TIME_H (Dobrica Pavlinusic). * config.h.emx: Define HAVE_SYS_TIME_H. Fri May 28 17:11:53 1999 Joe Orton * src/socket.c [HAVE_SYS_TIME_H]: Only include sys/time.h when present (Dobrica Pavlinusic). * src/socket.c: Include config.h (Dobrica Pavlinusic). * src/httpdav.c: Don't include sys/time.h any more (was only used for select(), now used through sock_block). Fri May 28 16:59:13 1999 Joe Orton * sitecopy.spec -> sitecopy.spec.in: Renamed, use @VERSION@ to pick up package version (Dobrica Pavlinusic). * configure.in: Added sitecopy.spec to AC_OUTPUT (Dobrica Pavlinusic). Fri May 28 16:56:04 1999 Joe Orton * configure.in: Added some -W's to CFLAGS with warnings on. Added sys/time.h to CHECK_HEADERS (thanks to Dobrica Pavlinusic ). Fri May 28 16:51:49 1999 Joe Orton * src/rcfile.c (rc_get_netrc_password): const arguments and return, added prototype. * src/rcfile.c (rc_verifysite): Rearranged to const password. Fri May 28 16:46:43 1999 Joe Orton * lib/netrc.c, lib/netrc.h (search_netrc): const 'host' argument. Fri May 28 16:15:15 1999 Joe Orton * src/console_fe.c, src/sites.c, src/ftp.c: Added missing prototypes. Thu May 27 20:17:34 1999 Joe Orton * src/httpdav.c (HTTP_FATAL_ERROR): Modified to take only a single argument rather than a variable number, makes SunOS 5 cc happy. Two callers modified. Thu May 27 20:14:23 1999 Joe Orton * Makefile.in (ALLLIBOBJS): Added to include objects in lib. Thu May 27 19:58:31 1999 Joe Orton * src/sites.c (site_readremotefiles): Fixed a memory leak, work harder to prevent SEGV on corrupt info file (not infallible yet). Thu May 27 19:19:05 1999 Joe Orton * configure.in: Added -lresolv check (from fetchmail), made socket check only try -linet if it's not in -lsocket. Thu May 27 19:03:29 1999 Joe Orton * po/POTFILES.in: Added common.c. Thu May 27 19:02:03 1999 Joe Orton * src/common.c: Added NLS _ defines (used by strerror). Thu May 27 18:57:51 1999 Joe Orton * src/socket.c: Include sys/time.h for struct timeval (patch by Andrew Haylett ). Thu May 27 18:28:38 1999 Joe Orton * src/testdav.c: Added PROPFIND tester, renamed 'upload' to 'put'. Made 'trace' work again. Updated for new connection API. Thu May 27 18:20:03 1999 Joe Orton * configure.in: Added basename.o and dirname.o to initial LIBOBJS. Thu May 27 18:19:04 1999 Joe Orton * ABOUT-NLS: Replaced with December 1998 version. Thu May 27 18:14:14 1999 Joe Orton * src/common.c (basename,dirname): Removed functions. Thu May 27 18:11:09 1999 Joe Orton * config.h.emx, config.h.in, configure.in: Removed basename and dirname tests. * src/common.h: Added base_name prototype. Thu May 27 18:05:22 1999 Joe Orton * src/sites.c (site_fetch_callback): Replaced dirname with dir_name. Include dirname.h. Thu May 27 18:04:38 1999 Joe Orton * lib/basename.c, lib/dirname.c, lib/dirname.h: New files, from GNU fileutils. Thu May 27 13:49:09 1999 Joe Orton * src/sites.c, src/console_fe.c: Replaced basename with base_name everwhere. Thu May 27 13:47:58 1999 Joe Orton * Makefile.in: Added comment noting GNU make requirement. Thu May 27 11:36:31 1999 Joe Orton * src/ftp.c (ftp_response): Break out of loop to return on read() failure, making final return non-redundant. Thu May 27 11:34:15 1999 Joe Orton * src/sites.c (site_fetch): Removed redundant return at end, never reached. Wed May 26 13:06:43 1999 Joe Orton * src/common.h: Added comment about libc 5.4.44's basename weirdness. Wed May 26 12:49:19 1999 Joe Orton * src/sites.c (file_append,file_prepend): Don't inline - shave several k off i386/ELF binary. Wed May 26 12:41:45 1999 Joe Orton * configure.in: --help output: Moved GNOME messages, wording updates. Wed May 26 12:37:39 1999 Joe Orton * configure.in: Added --enable-warnings to add -Wall to CFLAGS. Wed May 26 12:36:29 1999 Joe Orton * lib/md5.c: Removed fixed HAVE_MEMCPY define. Tue May 25 23:50:56 1999 Joe Orton * configure.in: Added memcpy to CHECK_FUNCS. Tue May 25 21:26:56 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.6.8. Tue May 25 21:09:19 1999 Joe Orton * config.h.emx: Defined HAVE_STRERROR as 1. Tue May 25 00:20:11 1999 Joe Orton * src/common.c, src/common.h: Added strerror using sys_errlist where not present (from fetchmail). * configure.in, config.h.in: Added strerror test. Tue May 25 00:19:23 1999 Joe Orton * configure.in, config.h.in: Added SOCKS support. Mon May 24 23:43:24 1999 Joe Orton * src/console_fe.c (usage): Print usage info to stdout. Mon May 24 22:45:46 1999 Joe Orton * src/ftp.c (ftp_response): Trim newline from \r not \n. Mon May 24 22:31:26 1999 Joe Orton * configure.in, Makefile.in: Use SDEFS for the -D...'s we pass. * configure.in: Don't output NLS Makefiles. Mon May 24 22:13:13 1999 Joe Orton * po/sitecopy.pot: Extracted new strings using xgettext. Mon May 24 22:10:22 1999 Joe Orton * src/httpdav.c (dav_xml_cdata): Drop straight out when not collecting cdata. * src/httpdav.c: Comments update. Mon May 24 19:36:35 1999 Joe Orton * src/httpdav.c: Only reallocate cdata buffer when it grows above CDATASHRINK. Mon May 24 19:16:40 1999 Joe Orton * src/console_fe.c: const'ed progname and sitenames[]. Mon May 24 19:12:49 1999 Joe Orton * configure.in: Added ANSI C headers test (AC_STDC_HEADERS), temporarily commented out NLS macros, substitute INTLLIBS. * config.h.in: Added STDC_HEADERS. Mon May 24 19:11:46 1999 Joe Orton * src/httpdav.c (dav_xml_parsetag): Removed tmp, now unused. Mon May 24 19:09:48 1999 Joe Orton * src/sites.c (file_isexcluded): const'ed filename args. Mon May 24 18:24:05 1999 Joe Orton * configure.in, config.h.in: Added dirname checks (from Dobrica Pavlinusic ). * common.c, common.h: Added HAVE_DIRNAME around dirname() defn. Added HAVE_BASENAME around basename() defn. Mon May 24 18:17:34 1999 Joe Orton * configure.in: Added string.h to AC_CHECK_HEADERS list. * config.h.in: Added HAVE_STRING_H Mon May 24 18:12:48 1999 Joe Orton * lib/snprintf.h: Include string.h for strlen(). Mon May 24 18:07:14 1999 Joe Orton * configure.in: Switch to using AM_* NLS macros. Added -DLOCALEDIR to $DEFS when --enable-nls is used. Added AC_ISC_POSIX at start (required by NLS macros). * aclocal.m4: Removed ud_* and md_* NLS macros (duplicates of AM_* macros from GNOME?). Mon May 24 18:06:10 1999 Joe Orton * Makefile.emx: Removed unnecessary comments. Mon May 24 18:04:43 1999 Joe Orton * src/console_fe.c (main): Call setlocale and textdomain. Sun May 23 11:12:46 1999 Joe Orton * Makefile.in: GNOME goals update from Lee Mallabone. Only install man page when building console FE. Mon May 17 12:33:56 1999 Joe Orton * config.h.in: Added HAVE_STPCPY for libintl. Mon May 17 12:33:00 1999 Joe Orton * src/sites.c (pseudo_url): ANSI C fix, added '1' in ? : sequence. Mon May 17 12:08:24 1999 Joe Orton * src/httpdav.c: Added support for multi-line headers (untested). Mon May 17 11:09:05 1999 Joe Orton * src/httpdav.c: Skip any trailing headers after chunked message body. Mon May 17 00:39:33 1999 Joe Orton * src/httpdav.c: Fetch mode rewrite complete - 0-out cdata buffer on first malloc. * src/httpdav.c: Fetch mode memory usage optimisations: removed two strdup()'s when resolving tag namespaces. Made initial cdata buffer 128 bytes rather than 1k. Free files off doc->files list after passing back to fetch callback. Sun May 16 18:23:12 1999 Joe Orton * src/console_fe.c: Updated for new site_update onlymarked argument. Sun May 16 18:05:38 1999 Joe Orton * src/console_fe.c: Dummy implementation of new connection API. Sun May 16 18:02:30 1999 Joe Orton * src/sites.c, src/sites.h: Removed 'ignore' functionality, added 'marked' and 'onlymarked' argument to site_update as a more useful replacement. Sun May 16 18:01:19 1999 Joe Orton * src/sites.c: Removed old fe_connect* calls. * src/frontend.h: New connection status API - fe_connection(). * src/httpdav.c, src/ftp.c: Use of new fe_connection() call. Sun May 16 15:41:12 1999 Joe Orton * Makefile.in (uritest): Depend on .o's not .c's (except src/httpdav.c). Sun May 16 15:39:42 1999 Joe Orton * src/httpdav.c (uri_encode): Fixed to work with 8-bit characters. Sun May 16 13:51:38 1999 Joe Orton * src/console_fe.c: Shuffled code to only call rc_verifysite for sites we are interested in -> faster startup for normal usage (don't stat all local directories). Sun May 16 00:29:53 1999 Joe Orton * src/sites.c: Took out the last perror() call. Sun May 16 00:20:39 1999 Joe Orton * Makefile.in (DOCS): Added doc/update.sh. Sun May 16 00:13:34 1999 Joe Orton * src/httpdav.c, src/ftp.c: Fixed two DEBUG() calls which didn't have a `;'. Sun May 16 00:11:29 1999 Joe Orton * src/common.c, src/common.h: New, hopefully more portable debugging mechanism, not reliant on DEBUG(a,b...) macros which broke some creaky old compilers. Sat May 15 22:58:42 1999 Joe Orton * po/sitecopy.pot: Extracted messages using xgettext. Sat May 15 18:41:40 1999 Joe Orton * src/httpdav.c: Fixed href handling. Sat May 15 18:19:04 1999 Joe Orton * src/httpdav.c: Removed HTTP-date parser, use only RFC1123-style date parser in DAV:href. * src/common.c, src/common.h: Removed RFC1036-style date parser. Sat May 15 17:56:58 1999 Joe Orton * src/httpdav.c (http_head): Removed reduntant http_request call. Sat May 15 17:23:19 1999 Joe Orton * src/sites.h: const'ed driver in site_t. Sat May 15 16:03:13 1999 Joe Orton * src/sites.c, src/sites.h: Added 'ignore' member of site_file_t, where files with ignore = true will be skipped in site_update. * src/sites.c: Moved common sections of file_append and file_prepend to file_create. Sat May 15 15:55:56 1999 Joe Orton * po/POTFILES.in: Added lib/getopt.c Sat May 15 15:53:26 1999 Joe Orton * src/httpdav.c, src/protocol.h: First stage of fetch mode rewrite complete. Sat May 15 15:52:29 1999 Joe Orton * config.h.emx: Added #undef's for all NLS defines. Sat May 15 15:51:36 1999 Joe Orton * src/sites.c: const the protocol driver structs. Sat May 15 12:33:12 1999 Joe Orton * ABOUT-NLS: Replaced with December 1997 version Sat May 15 12:29:52 1999 Joe Orton * lib/getopt1.c, lib/getopt.h: Updated for newer versions. Sat May 15 12:19:59 1999 Joe Orton * src/console_fe.c: Completed marking strings for translation. Sat May 15 12:19:08 1999 Joe Orton * lib/getopt.c: Replaced with newer version from gettext-0.10.35 (with NLS support). Fri May 14 10:25:03 1999 Joe Orton * src/ftp.c: Redone for new fetch mode callback. Fri May 14 10:24:45 1999 Joe Orton * src/httpdav.[ch]: Started large rewrite of fetch mode routines. Fri May 14 10:25:18 1999 Joe Orton * src/sites.c, protocol.h: New fetch mode callback mechanism. No longer passing directory name and file name separately. Fri May 14 10:23:16 1999 Joe Orton * config.h.in: Added HAVE_LOCALE_H and ENABLE_NLS Fri May 14 10:20:25 1999 Joe Orton * src/console_fe.c: Started marking messages for translation. Sun May 9 00:53:19 1999 Joe Orton * configure.in: Moved netrc.o from OBJECTS to LIBOBJS. Sat May 8 23:39:51 1999 Joe Orton * src/rcfile.c: Create ->prev links for sites list. Sat May 8 23:37:34 1999 Joe Orton * src/sites.c, src/sites.h: Sites list doubly linked, const'ed name argument to site_find, added comment for site_keepgoing, really removed DIRPREFIX. Sat May 8 23:04:44 1999 Joe Orton * Makefile.in (EXES): Added testdav Sat May 8 22:37:56 1999 Joe Orton * src/sites.c, src/sites.h, src/rcfile.c: Completely removed name mapping. Sat May 8 15:33:09 1999 Joe Orton * src/httpdav.c: Only allow 204 as the 'success' code in dav_rmdir. Sat May 8 15:22:33 1999 Joe Orton * Makefile.emx: Updated for new directory layout, pruned unused bits. Sat May 8 15:21:22 1999 Joe Orton * configure.in: Generate LIBOBJS for objects in lib/. Sat May 8 15:19:26 1999 Joe Orton * Makefile.in: Added LIBOBJS to handle objects in lib/, updated GNOME dependancies. Sat May 8 15:18:19 1999 Joe Orton * src/console_fe.c: Added k to short getopt list. Sat May 8 15:11:50 1999 Joe Orton * src/httpdav.c: Fixed dav_rmdir false negative, escape 8-bit char's in uri_encode, comments update. Thu May 6 23:11:44 1999 Joe Orton * Makefile.in: lib/netrc.o and lib/md5.o depend on config.h Thu May 6 23:09:52 1999 Joe Orton * lib/netrc.c: Include not "..." Thu May 6 23:08:48 1999 Joe Orton * src/sites.c: Corrected the dirstack again. Thu May 6 23:07:18 1999 Joe Orton * src/httpdav.c: Decode URI's from cdata. Thu May 6 00:29:47 1999 Joe Orton * Makefile.in: Added INTLLIBS to LIBS and tidied testdav target. Thu May 6 00:16:13 1999 Joe Orton * config.h.in, configure.in, aclocal.m4: Added NLS config. * po/POTFILES.in: Added for NLS. Wed May 5 18:53:19 1999 Joe Orton * src/console_fe.c: Added NLS _ and libintl.h include. * intl/* po/* ABOUT-NLS: Added by gettextize. Wed May 5 18:43:36 1999 Joe Orton * */*: Split package into src/, gnome/, lib/ doc/ directories * configure.in, Makefile.in: Updated to build correctly in new structure. Wed May 5 16:22:56 1999 Joe Orton * sites.c: Corrected free()'ing of items on the directory stack. Wed May 5 00:41:02 1999 Joe Orton * httpdav.c: Fixed some leaks. Wed May 5 00:31:01 1999 Joe Orton * sites.c (site_readlocalfiles): Fixed a couple of leaks in the tree walker. Wed May 5 00:24:41 1999 Joe Orton * common.c, sites.c, ftp.c, rcfile.c: Use not "config.h" Wed May 5 00:20:45 1999 Joe Orton * httpdav.[ch]: Added URI encoder/decoder for basic support of escaped characters in URI's. Added http_request_end, added calls everywhere. Added 'class' member == status/100 to http_req_t, used everywhere. Wed May 5 00:20:01 1999 Joe Orton * console_fe.c: Support for site_keepgoing with --keep-going option (-k). Wed May 5 00:19:01 1999 Joe Orton * sites.[ch]: Added site_keepgoing: forces site_update to carry on despite errors encountered. Mon May 3 13:52:43 1999 Joe Orton * console_fe.c: Updated to use site_pseudourl and local relative site dir handling. Mon May 3 13:46:04 1999 Joe Orton * sites.[ch], rcfile.[ch]: Allow relative local site directory. Added _remote_user member to site information for better handling of relative directories. Removed DIRPREFIX completely. Added site_pseudourl() for giving pseudo-URL remote location of site. FE API: New return code from rc_verifysite: SITE_NOLOCALREL Mon May 3 13:42:44 1999 Joe Orton * config.h.in: Added const to defines. Mon May 3 11:20:50 1999 Joe Orton * httpdav.[ch]: Removed HEAD check in http_init. Mon May 3 11:03:50 1999 Joe Orton * httpdav.c: Added prototypes of fetch mode functions. Tue Apr 27 23:14:26 1999 Joe Orton * common.c: Removed unnecessary extern of int quiet. Tue Apr 27 23:13:42 1999 Joe Orton * rcfile.c: Comment update, removed proto_driver extern's. Tue Apr 27 23:08:52 1999 Joe Orton * console_fe.c: Removed extern's of copypath, rcfile, all_sites. Un-extern'ed progname. Tue Apr 27 23:08:30 1999 Joe Orton * rcfile.c: Removed progname. Tue Apr 27 23:04:57 1999 Joe Orton * sites.h: Added extern of all_sites. Tue Apr 27 23:02:50 1999 Joe Orton * rcfile.h: Added extern's of rcfile and copypath. Tue Apr 27 22:58:51 1999 Joe Orton * sites.h: Removed MAXEXCLUDES #define (no longer used). Added extern's of proto_driver's. Added local_isrel to site_t. Mon Apr 26 23:24:06 1999 Joe Orton * sites.[ch], rcfile.c: Excludes mode changes: use linked list for internal representation, allow and match against paths in exclude patterns. Mon Apr 26 23:22:27 1999 Joe Orton * console_fe.c: Fixed status message when moving a file. Mon Apr 26 23:16:18 1999 Joe Orton * console_fe.c: Flush stderr at start of signal handler. Mon Apr 26 22:56:27 1999 Joe Orton * sites.c: Replaced uses of DRV with CALL Mon Apr 26 22:45:03 1999 Joe Orton * rcfile.c: #if 0'ed out 'rename' key - name mapping no longer supported. Sun Apr 25 23:56:27 1999 Joe Orton * httpdav.c: Wait on 100-continue expectation using new sock_block(). Sun Apr 25 23:52:14 1999 Joe Orton * socket.[ch]: Added sock_block to wait for data on a socket. * socket.[ch]: Added sock_read and sock_recv which implement read() and recv() with a set timeout given by SOCKET_TIMEOUT. * socket.c: Changed all read() and recv() calls to timeout based sock_{read,recv} calls. Sun Apr 25 19:07:06 1999 Joe Orton * httpdav.c: Added HTTP-date parser, checks RFC1123-style then RFC1036-style. Sun Apr 25 19:06:13 1999 Joe Orton * common.[ch]: Added parser for RFC1036-style dates. Sun Apr 25 14:09:36 1999 Joe Orton * Makefile.in: Added standalone netrc tester target Sun Apr 25 13:57:16 1999 Joe Orton * common.c: Removed stdarg.h include after further consideration. Fri Apr 23 20:34:57 1999 Joe Orton * common.c: Added snprintf include, ifdef'ed stdarg.h include. Fri Apr 23 19:23:23 1999 Joe Orton * sites.c: #ifdef USE_DAV around proto driver and httpdav.h include (Steffen Siebert). Fri Apr 23 19:22:12 1999 Joe Orton * Makefile.in (snprintf.o): Depends on config.h Fri Apr 23 19:18:09 1999 Joe Orton * config.h.in, configure.in: Added stdarg.h check so snprintf.o is slightly happier on MIPS. * snprintf.c: Removed HAVE_CONFIG_H around #include for config.h. Fri Apr 23 00:15:59 1999 Joe Orton * changes.awk: Use --flatlist rather than -ll in the usage example. Thu Apr 22 23:13:34 1999 Joe Orton * console_fe.c (main): Prefix catchup and init status messages with progname. Thu Apr 22 23:12:03 1999 Joe Orton * Makefile.in (testdav): Added LIBS and LDFLAGS. Thu Apr 22 23:10:31 1999 Joe Orton * testdav.c: Updated for new HTTP code. Thu Apr 22 21:46:26 1999 Joe Orton * httpdav.[ch]: Updated response body handling logic to be nearly 2068-compliant, added http_init_checks to allow skipping HEAD and OPTIONS in http_init (for testdav). Added http_request_init decl. Wed Apr 21 14:36:46 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.6.0-pre Wed Apr 21 14:35:26 1999 Joe Orton * console_fe.c: Proper fetch+synch mode return code interpretation, status messages. Wed Apr 21 14:31:11 1999 Joe Orton * sites.[ch]: Sorted out site_{fetch,update,synch} return codes, returning SITE_AUTH when driver->init returns PROTO_AUTH. Wed Apr 21 14:29:13 1999 Joe Orton * httpdav.c: http_init calls http_open and returns PROTO_CONNECT when appropriate. dav_fetch returns PROTO_OK and PROTO_ERROR appropriately. Wed Apr 21 13:58:07 1999 Joe Orton * ftp.c: Made ftp_open return relevant code, and ftp_init return PROTO_AUTH when ftp_login fails. Wed Apr 21 12:24:25 1999 Joe Orton * protocol.h: Added PROTO_AUTH return code to driver->init. Tue Apr 20 15:47:25 1999 Joe Orton * httpdav.[ch]: Revised MKCOL logic, added HEAD and OPTIONS requests. Tue Apr 20 14:54:02 1999 Joe Orton * sites.[ch], rcfile.c: Removed http_mkcol_off option. Tue Apr 20 09:36:21 1999 Joe Orton * Makefile.in: Tidied PHONY targets Mon Apr 19 23:30:10 1999 Joe Orton * ftp.[ch], protocol.h, sites.c: Pass remote root directory to driver init. Mon Apr 19 23:25:12 1999 Joe Orton * console_fe.c, rcfile.[ch]: Added check for relative remote directories in WebDAV. Mon Apr 19 23:17:12 1999 Joe Orton * rcfile.c (rcfile_write): Took out unnecessary malloc's. Mon Apr 19 11:34:26 1999 Joe Orton * ftp.c: Remember the transfer mode and only change it when actually necessary. Mon Apr 19 01:16:59 1999 Joe Orton * httpdav.c, configure.in, config.h.in, configure: Added workaround for broken PROPFIND on IIS5 beta. Mon Apr 19 00:54:42 1999 Joe Orton * configure.in, configure: Added --with-extra-* options for finding libexpat in strange and mysterious places. Sun Apr 18 13:37:02 1999 Joe Orton * console_fe.c: Added view mode to help output. Sun Apr 18 11:26:34 1999 Joe Orton * sites.c: Added "Maintain" to SYMLINKSMODE macro Sun Apr 18 00:31:23 1999 Joe Orton * httpdav.c: Added parser for absolute URI's including scheme and host part as used in element. Sat Apr 17 14:18:40 1999 Joe Orton * httpdav.c: Keep fetch list in sorted order (by depth). Sat Apr 17 13:54:27 1999 Joe Orton * console_fe.c: Use PACKAGE rather than progname for program name in version output. Fri Apr 16 12:48:41 1999 Joe Orton * httpdav.c: Enhanced to accept interim 100 (Continue) responses followed by regular response, as per RFC 2068. * httpdav.c: Changed MKCOL/MKCOL handling to be less strict about response codes. * httpdav.c: Removed "encoding=..." and "charset=..." in PROPFIND requests, from XML body and Content-Type header respectively. Wed Apr 14 11:04:34 1999 Joe Orton * common.c: RFC1123 tester extended to take cmdline argument, comment updates to parser. Wed Apr 14 11:01:31 1999 Joe Orton * httpdav.[ch]: Fixed authentication, removed XML namespace resolution debugging messages, added fe_transfer_progress calls to GET response body callback, XML CDATA whitespace cleaner cleaned up. Wed Apr 14 11:00:00 1999 Joe Orton * console_fe.c: More verbose output from fe_fetch_found. Wed Apr 14 09:43:22 1999 Joe Orton * console_fe.c: Added fetch mode indicator to version output. Wed Apr 14 09:08:55 1999 Joe Orton * httpdav.c: CDATA clean fixes, and call Tue Apr 13 14:33:30 1999 Joe Orton * httpdav.c: Fixed MOVE Destination header * httpdav.c, rcfile.c, sites.h, sites.c: Merged changes from Yarom Last to work with non-WebDAV HTTP authoring servers. Tue Apr 13 14:12:21 1999 Joe Orton * httpdav.c: Trim leading whitespace for CDATA. Sun Apr 11 16:03:00 1999 Joe Orton * httpdav.[ch], sites.c: Added file download handler for WebDAV. Sun Apr 11 15:23:07 1999 Joe Orton * protocol.h, httpdav.[ch]: Finished basic implementation of fetch mode for WebDAV driver. Sun Apr 11 15:19:00 1999 Joe Orton * sites.c: Fixed site_destroy bug where files_tail was not set to NULL. Sun Apr 11 14:37:10 1999 Joe Orton * console_fe.c, common.h: Removed Gtk debugging channel, updated console --help message for XML channel. Sun Apr 11 14:34:45 1999 Joe Orton * sites.c, console_fe.c: Moved fe_prompting into sites.c Sun Apr 11 11:08:10 1999 Joe Orton * sites.[ch], console_fe.c, frontend.h: Interface cleanups, use void where appropriate, better use of extern. Sun Apr 11 10:54:31 1999 Joe Orton * sites.c: Decreased MAXDIRS to 500 Sat Apr 10 16:53:54 1999 Joe Orton * rcfile.c, sites.h: Added 'remote_isrel' boolean for remote path. Sat Apr 10 16:49:49 1999 Joe Orton * httpdav.[ch], ftp.[ch], sites.c: Moved the protocol driver declarations into sites.c, better abstraction of FTP and WebDAV code. Tue Apr 6 12:08:05 1999 Joe Orton * sites.c: Set return code in site_synch_files if utime() fails. Mon Apr 5 10:12:14 1999 Joe Orton * rcfile.c: Added nooverwrite support to rcfile_write (Lee). Sat Apr 3 15:17:52 1999 Joe Orton * common.[ch]: Added RFC1123-style date parser, extended standalone tester to use this too. Sat Apr 3 12:13:10 1999 Joe Orton * common.c: Changed md5_buffer to take const char *. Sat Apr 3 02:43:28 1999 Joe Orton * httpdav.[ch]: More implementation of XML body handling. Thu Apr 1 01:04:34 1999 Joe Orton * httpdav.c: Began implementing fetch mode, PROPFIND response XML parsing using expat. Wed Mar 31 21:41:16 1999 Joe Orton * httpdav.[ch]: Major rewrite to be slightly more modular. Wed Mar 31 17:04:33 1999 Joe Orton * configure.in: Added expat check Tue Mar 30 21:56:08 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.5.1. Tue Mar 30 21:35:21 1999 Joe Orton * sites.c, sites.h, rcfile.c: 'nooverwrite' option, for doing a delete before uploading a changed file. Tue Mar 30 17:37:52 1999 Joe Orton * sites.c: Split site_update_files to separate file deletion, modified site_update to delete files before uploading changes, for quota-limited sites. Tue Mar 30 16:03:15 1999 Joe Orton * sites.c: Fixed typo Tue Mar 30 10:33:44 1999 Joe Orton * configure.in: Removed getopt check, changed getopt1.c to getopt1.o and added getopt.o to getopt_long check. Tue Mar 30 10:29:56 1999 Joe Orton * Makefile.in: Made rcfile.o dependant on all the right .h's. Tue Mar 30 09:46:34 1999 Joe Orton * fe_gnome.c, fe_gnome_creation.c: Load pixmaps into executable. Tue Mar 30 00:00:36 1999 Joe Orton * sites.c: Update 'updated' flag in site_update_links, and read the local symlink target name properly. Mon Mar 29 23:40:44 1999 Joe Orton * config.h.emx: Replaced #defines with #undefs where appropriate. Wed Mar 24 17:53:49 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.5.0. Wed Mar 24 17:51:05 1999 Joe Orton * console_fe.c: No leading slashes when updating. Error messages tidied up. Wed Mar 24 07:35:37 1999 Joe Orton * httpdav.c: Prevent yucky segfault on response headers with no value. * socket.c: send_file_ascii implemented properly. Tue Mar 23 14:25:27 1999 Joe Orton * httpdav.c: Added value to "No-Passthrough" header for PyDAV interop. Mon Mar 22 00:33:05 1999 Joe Orton * configure.in, Makefile.in: GNOME cleanups (Lee). Sun Mar 21 15:23:11 1999 Joe Orton * configure.in, Makefile.in: Cleanups for frontend choice. * configure.in, Makefile.in, fe_*.[ch], README.emx, xsitecopy.desktop, aclocal.mv, INSTALL: Merged GNOME front end from Lee Mallabone . Thu Mar 18 21:20:43 1999 Joe Orton * socket.c: send_file_ascii implementation. * protocol.h, ftp.h, httpdav.h: Changed driver to allow ASCII file uploads and downloads. * ftp.c: Do ASCII uploads when requested. * httpdav.c: Ignore ASCII upload parameter. * sites.c: Check for ASCII files, request ACSII mode from protocol driver when appropriate. * rcfile.c: Parse 'ascii' keyword. Thu Mar 18 19:37:45 1999 Joe Orton * console_fe.c: Allow only one operation mode on the command line. Only compile in --debug long option when debugging is on. Thu Mar 18 18:57:19 1999 Joe Orton * console_fe.c, sites.c, sites.h: Moved site_flatlist* into sites.c and changed to take output stream as parameter. Thu Mar 18 16:59:20 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.4.10 Thu Mar 18 12:46:25 1999 Joe Orton * configure.in: Added the strsignal check * console_fe.c: Use strsignal if present. Thu Mar 18 11:49:59 1999 Joe Orton * configure.in, *.emx: Bumped version to 0.4.9 * configure.in: Removed getopt check, added getopt.o into OBJECTS for getopt_long check instead. Thu Mar 18 11:41:33 1999 Joe Orton * rcfile.c: Stat failed error typo fix from Andrey A. Chernov Thu Mar 18 11:20:56 1999 Joe Orton * sites.c, sites.h, console_fe.c: Renamed num_changed to is_different. * sites.c: Changed site_initialize to update num* counters, and set is_different appropriately. Wed Mar 17 18:36:09 1999 Joe Orton * Makefile.emx, config.h.emx: Added getopt_long * configure.in, config.h: Added getopt_long check. Wed Mar 17 11:20:02 1999 Joe Orton * configure.in, config.h.emx: Bumped version to 0.4.8. Wed Mar 17 10:54:37 1999 Joe Orton * sites.c: Maintain files_tail when deleting files too. Tue Mar 16 21:48:23 1999 Joe Orton * console_fe.c: Implemented dummy connection status calls. * frontend.h, sites.c: Simple connection status FE calls from Lee Mallabone. Tue Mar 16 19:21:00 1999 Joe Orton * configure: Updated with autoconf 2.13 Tue Mar 16 18:41:05 1999 Joe Orton * httpdav.c: Non-chunked body debug display error, changed delete for directories to add the trailing / again. Tue Mar 16 16:41:05 1999 Joe Orton * rcfile.c, netrc.c, ftp.c: Compiler warning fixes - cast argument to is*() to unsigned. Tue Mar 16 16:03:38 1999 Joe Orton * socket.c: Better host_lookup fix from Steffen Siebert. Tue Mar 16 14:48:58 1999 Joe Orton * console_fe.c: GNU-style long options. Mon Mar 15 18:53:33 1999 Joe Orton * socket.c: Added a inet_addr check to host_lookup * ftp.c: Improved debugging messages. Call ftp_open from ftp_init. * sites.c, sites.h: Tied down the return codes from site_update. * console_fe.c: Display message according to return code from site_update. Sun Mar 14 11:07:38 1999 Joe Orton * rcfile.c: rcfile_write from Lee Mallabone. Sun Mar 14 10:40:48 1999 Joe Orton * frontend.h, console_fe.c, sites.c: Added fe_fetch_found API Sat Mar 13 16:50:22 1999 Joe Orton * socket.c: EMX: Binary mode open() for recv_file (Steffen Siebert). * rcfile.c: EMX: No perms check in init_paths (Steffen Siebert). Fri Mar 12 13:41:02 1999 Joe Orton * ChangeLog: Several entries lost due to operator stupidity... * ftp.c: Allow 125 as 'ready for file response' * testdav.c: Extended for TRACE persistent connection stress tester + HEAD. Mon Mar 1 00:44:44 1999 Joe Orton * Makefile.emx: Updated from Makefile.in, hacked to copy config.h.emx onto config.h. * config.h.emx: Created with defaults for EMX? Mon Mar 1 00:08:06 1999 Joe Orton * config.h.in, configure.in: Add check for strdup. Sun Feb 28 12:04:32 1999 Joe Orton * rcfile.c: Enabled option of symlink 'maintain' mode. * sites.c: Added support for symlink 'maintain' mode. * protocol.h: Added link_create, link_change, link_remove handlers to drivers. * httpdav.c: Added support for link_* handlers using MKREF and DELETE: dav_mkref, dav_chref, dav_rmref. Sat Feb 27 18:13:01 1999 Joe Orton * socket.c: Open files with O_BINARY for EMX (Steffen Siebert). Sat Feb 27 13:51:06 1999 Joe Orton * console_fe.c, rcfile.c: Moved environment initialization into rcfile.c init_env(). * rcfile.[ch]: Use global vars: rcfile_read doesn't take filename parameter, init_paths doesn't take any. * rcfile.[ch]: Added netrc handling functions. * netrc.[ch]: New files - ~/.netrc parser by Gordon Matzigkeit * configure.in, snprintf.[ch]: Add check for and implementation of snprintf(). Sat Feb 27 12:17:53 1999 Joe Orton * ftp.c: Final fix for ftp_active_open. Sat Feb 27 12:15:23 1999 Joe Orton * configure.in: Only add httpdav.o, md5.o to OBJECTS when WebDAV is enabled. * httpdav.c: Take out the silly whole-file USE_DAV * common.c: Only compile md5_ when USE_DAV is defined. Thu Feb 25 19:34:38 1999 Joe Orton * configure.in: Add check for gethostbyname, in libnsl on SunOS, also add -I. to CFLAGS for picking up e.g. fnmatch.h * Makefile.in: Use $(OBJECTS) rather than $^ Thu Feb 25 00:48:38 1999 Joe Orton * config.h.in, configure: Add checks for getopt and strcasecmp. * getopt.[ch], strcasecmp.c: Added GNU implementations. * console_fe.c: Use getopt.h when no system getopt(). Wed Feb 24 13:29:39 1999 Joe Orton * ftp.c: Fixed ftp_active_open bug. Tue Feb 23 22:54:38 1999 Joe Orton * rcfile.c, httpdav.c, common.c: Include config.h * configure.in, config.h.in, Makefile.in: Minor tweaks. * console_fe.c, rcfile.c: Moved copypath, rcfile, progname declarations into rcfile.c. * console_fe.c, sites.c: Moved prompting to sites.c and renamed to fe_prompting. Mon Feb 22 23:49:04 1999 Joe Orton * Makefile.in, configure.in, aclocal.m4: autoconf installer - first crack. * fnmatch.[ch]: Added fnmatch implementation from GNU fileutils. * sites.c: Use fnmatch.h when no system fnmatch(). Mon Feb 22 22:09:33 1999 Joe Orton * sites.c: Changes for EMX port (Win32, OS/2) from Steffen Siebert . Mon Feb 22 21:57:20 1999 Joe Orton * sites.c: Removed old error reporting mechanism from synchronize mode code. * sites.c: File also marked changed when local and remote sizes differ - from Steffen Siebert . Mon Feb 15 00:52:44 1999 Joe Orton * sites.h: Implemented total file size counters. Sun Feb 7 01:33:39 1999 Joe Orton * rcfile.c, console_fe.c: init_paths, for checking file permissions. Pass sites list as argument to rcfile_read. * rcfile.h, sites.h: Moved rcfile-specific stuff out of sites.h. * sites.c: Implemented file_{append,prepend}. Mon Feb 1 17:36:02 1999 Joe Orton * console_fe.c: Cosmetic cleanups in site_{update,synch}. Mon Feb 1 14:52:08 1999 Joe Orton * sites.c, httpdav.c: Include for errno definition. * sites.c: Removed the last %as from the ftp_fetch_gettree scanf. * console_fe.c: Removed strsignal() from sighandler. * sitecopy-0.4.0 released. Sun Jan 31 21:27:56 1999 Joe Orton * ftp.c: Improved ftp_exec and ftp_read so commands which fail due to broken connections will be retried. * console_fe.c: Check for no changes before site_synch. * ftp.c, console_fe.c: gcc -pedantic cleanups. * console_fe.c, frontend.h, sites.c: Added error reporting to fe_updated and fe_synched. Sat Jan 30 10:58:58 1999 Joe Orton * sites.c: site_destroy added, cleanups to ensure all site_file_t strings are distinct (i.e. separate malloc's). * *.h, *.c: Moved unneeded prototypes from .h's to .c's. Thu Jan 28 23:05:36 1999 Joe Orton * sites.c: Set site->has_changed = false after success in site_update and site_catchup. Mon Jan 25 00:20:57 1999 Joe Orton * rcfile.c, console_fe.c: Enhanced rcfile error reporting (due to popular confusion). More errors detected, too. * console_fe.c: Tidied up so site_verify is called for all sites now, regardless. Sun Jan 24 00:26:51 1999 Joe Orton * console_fe.c: Updated dump sites mode. Sat Jan 23 02:23:00 1999 Joe Orton * httpdav.c: Upload rather than download request bodies again, more debugging messages. * socket.c, httpdav.c: Checking write() return codes, handle partial writes in send_data. Wed Jan 20 17:04:19 1999 Joe Orton * sites.c, frontend.h, console_fe.c: Separated FE calls for site_synch from site_update. * console_fe.c: Spelling cleanups. Mon Jan 18 00:22:36 1999 Joe Orton * console_fe.c: Split normal and flat list mode functions. Changed flat list mode to be more easily parseable. * changes.awk: Updated for new flat list mode. Thu Jan 14 00:13:06 1999 Joe Orton * sites.c: Synch mode implementation. * console_fe.c: Synch mode changes. * protocol.h, ftp.c, httpdav.c: Driver error reporting change. * socket.c, ftp.c: ftp_get implementation. * ftp.c: Fetch mode clean ups. * sites.c: Added name mapping and exclusions to fetch mode. * socket.c: Extra error checking in transfer(). Mon Jan 11 01:26:21 1999 Joe Orton * sitecopy.1: Man page update. * examplerc: Added sample rcfile. Fri Jan 8 14:40:24 1999 Joe Orton * testdav.c: Updated for new driver interface. * ftp.c: Extra checks in MDTM response parser. Cleaned up return codes for driver functions. Wed Jan 6 19:28:03 1999 Joe Orton * console_fe.c: Added flat listing mode, -lf. More debugging tidying. * changes.awk: Added sample -lf mode parser. * Makefile: Cleaned clean. Sun Jan 3 17:27:34 1999 Joe Orton * ftp.c: Made connection handling more sensible. * console_fe.c: Do-it-to-all-sites option, -a Sat Jan 2 17:05:06 1999 Joe Orton * console_fe.c: Cosmetic: display pseudo-URL in site header. * sites.c: site_fetch implementation begins. Logic added to site_update so that files only get updated if directories are created successfully. * ftp.c: ftp_fetch implementation complete. Put ftp_quit into ftp_finish so the FTP session gets closed properly again. Fri Jan 1 02:26:43 1999 Joe Orton * ftp.c: Work on fetch-remote-file-listing implementation begins. Thu Dec 31 11:55:20 1998 Joe Orton * ftp.c: Non-PASV open - ensure dtp socket closed in error cases. Speed-up: Only execute `TYPE I' once per connection. Tue Dec 29 21:49:04 1998 Joe Orton * README: Minor documentation update. * ftp.c: Improved connection handling mechanism, to handle connections which break mid-update. Improved non-PASV mode code to read success codes appropriately. * console_fe.c: Improved for new FE interface, and for new debugging stuff. Sat Dec 26 02:26:03 1998 Joe Orton * common.h, common.c, sites.c, httpdav.c, ftp.c: Improved debugging mechanism. * ftp.c, httpdav.c, protocol.h, sites.c: Slight tidy up of protocol driver. * sites.c, frontend.h, console_fe.c: Major changes on the FE interface. * sites.c: Cleaned up upload/chmod interworking a bit. * httpdav.c: Fixed small leak in digest auth code. Thu Dec 24 23:16:07 1998 Joe Orton * aclocal.m4, configure.in, Makefile.in: Added first hack at autoconfization from Lee Mallabone. * common.h: Added missing #includes. Wed Dec 23 14:03:30 1998 Joe Orton * httpdav.c: Debugging improvements. * sites.c: printf->fe_status cleanups from Lee Mallabone Mon Dec 21 00:41:54 1998 Joe Orton * sites.h, protocol.h, sites.c: Removed reduntant `protocol_t' stuff. Fri Dec 18 11:33:15 1998 Joe Orton * console_fe.c: Added signal handling so state gets saved if terminated half way through an update. * console_fe.c, sites.c: site_writefiles() is never called from in sites.c. Thu Dec 17 20:52:24 1998 Joe Orton * sites.c: Fixed muckup in rcfile parser which prevented 'ftp nopasv' mode working. Wed Dec 16 12:59:13 1998 Joe Orton * sitecopy-0.3.0 released. * sites.c: Fixed the so-broken-I'm-not-really-sure-how-it-worked-at at-all rcfile parser. * httpdav.c: Added spoof check when basic auth used after digest. * sites.c: Debugging cleanups. * httpdav.c: Status code parsing and interpretation fixes, better RFC2068 compliance. Tue Dec 15 17:10:53 1998 Joe Orton * console_fe.c: Couple of cosmetic cleanups: displaying symlink mode. * httpdav.c: Handle `100 (Continue)' response correctly. * sites.c: Fixed directory names corruption bug. Mon Dec 14 16:05:22 1998 Joe Orton * sites.c: Added check for existence of local dirctory. * httpdav.c, socket.c: Cleanups for FreeBSD by Nik Clayton * sites.c: Added symlink handling options to rcfile. Thu Dec 10 20:20:27 1998 Joe Orton * sitecopy.1: Man page started Mon Dec 7 14:52:14 1998 Joe Orton * sites.c: Fix from Gal Goldschmidt to prevent infinite looping into cyclicly symlinked directories. (Symlinks are now ignored completely, as they should be until they can be handled sensibly.) * sites.c: Fix from Aloril for segfault when updating two sites at once. Sun Dec 6 21:43:12 1998 Joe Orton * httpdav.c: Added digest authentication for entity body too. Many fixes for read_line's that return errors. * sites.c: Updated to use error string from specific protocol driver. * httpdav.c: Using CRLF at end of header lines rather than just LF. Sat Dec 5 12:34:02 1998 Joe Orton * httpdav.c: Small string handling clean ups. Fri Dec 4 00:33:32 1998 Joe Orton * httpdav.c: Fixed read chunk debugging display corruption (cosmetic). * md5.c, md5.h: Added MD5 implementation from GNU textutils - by Ulrich Drepper * common.c: Added text -> MD5 -> hex conversion algorithms. * httpdav.c: Digest authentication implemented (except for entity-response digest). Wed Dec 2 20:39:56 1998 Joe Orton * sites.c: Modified to allow choice of FTP PASV-mode (or not) from rcfile. * httpdav.c: More improvements to http_request. * httpdav.c: Fixed very, very stupid Host: request header. Wed Dec 2 00:59:52 1998 Joe Orton * httpdav.c: Finished off rewrite of request functions. Authentication only used on auth. * sites.c: Fixed broken remote file move. Mon Nov 30 18:52:27 1998 Joe Orton * Added site_initialize to sites.c to remove crap ->files = NULL hack to init the site. * Non-PASV-mode FTP patch from James Youngman Mon Nov 30 00:55:34 1998 Joe Orton * Restructuring HTTP request functions to make digest auth possible. Fri Nov 27 21:06:15 1998 Joe Orton * Broken FTP PASV socket connection stuff fixed. Fri Nov 27 00:23:23 1998 Joe Orton * HTTP unfixes: removed Content-Type and \n-terminated lines work- arounds since PyDAV has been fixed. Tue Nov 24 22:38:39 1998 Joe Orton * HTTP fixes: - Workaround for \n-terminated lines for PyDAV testing - Dumb logic when getting response, non-persistent connections work again. * HTTP PUT: don't bother waiting around for a 100 if it times out first time. * sitecopy-0.2.9 released. Tue Nov 24 00:58:56 1998 Joe Orton * HTTP-DAV: - Try and cope gracefully when the server doesn't respect "Expect: 100-continue" - Send dummy Content-Type with PUT - Parse and interpret response headers - Read response body properly - including 'chunked' transfer encoding - Persistent connections might work now too. Mon Nov 23 00:16:00 1998 Joe Orton * Console FE cleanups for multi-protocol changes. * Added default service name to protocol driver interface. * User-Agent added to HTTP-DAV requests. Thu Nov 19 23:15:47 1998 Joe Orton * HTTP-DAV Code: - HTTP/1.0 basic authentication (first hack) - HTTP/1.1 persistent connections (first hack) - some semblence of structure in httpdav.c now. - (ab)Use the HTTP/1.1 100-continue thing for PUT's * Clean up of site_update - filename handling code was all broken. * Removed all dirname() crud from sites.c, fixed corrupt directory names in local tree. Sun Nov 15 22:47:33 1998 Joe Orton * DAV is a compile-time option * Makefile clean ups. Sat Nov 14 12:55:22 1998 Joe Orton * Filename rewriting implemented - 'rename' key in rcfile. * Rewrite of much of filename handling code to be slightly more sensible. * Extended rcfile parser for key+two values per line. Fri Nov 13 00:07:55 1998 Joe Orton * Basic implementation of HTTP-DAV client complete: MKCOL, DELETE, PUT, MOVE. Not very HTTP/1.1 compliant yet. * Allow port specification in rcfile. Wed Nov 11 20:42:51 1998 Joe Orton * Generic socket handling code moved from ftp.c into socket.c. * Made sites.c use generic protocol driver interface (protocol.h), made FTP code into protocol driver. * Started basic implementation of HTTP-DAV client Sun Nov 8 22:11:09 1998 Joe Orton * Full implementation of non-recursive tree traverse algorithm complete. Thu Nov 5 01:35:24 1998 Joe Orton * Rewrite of remote file list file parser, to prevent filenames with spaces breaking everything. Mon Nov 2 23:54:43 1998 Joe Orton * 'exclude' option added, simple implementation in ftw callback. Core implementation of non-recursive tree traverse to replace ftw() stuff, will enable 'exclude CVS' or whatever. Sun Nov 1 10:39:08 1998 Joe Orton * rcfile parser modified to allow quoted values (which can also contain #'s, and escaped quotes: `exclude "#\""' is valid. Sat Oct 24 18:31:39 1998 Joe Orton * Major changes for FE modularization complete. Fri Oct 23 17:53:02 1998 Joe Orton * Began splitting of interface into separate modules to allow for Gtk front end (under development by Lee Mallabone). * When the directory creation order was fixed, it broke the directory deletion order - both now correct (hopefully). Doubly linked list is proving very handy. * Started tidying up the debug code a bit. Tue Oct 20 19:50:27 1998 Joe Orton * Docs updates after excellent advice from Bob van der Poel. * Added 'quiet mode', from patch submitted by Peter Marbaise Thu Oct 12 13:09:00 1998 Joe Orton * sitecopy-0.2.0 released Fri Oct 9 22:24:29 1998 Joe Orton * Largish overhaul to fix problems created while adding confirmations. sites.c code generally a bit less crap now. Fri Oct 9 15:25:29 1998 Joe Orton * Optional confirmations while updating remote sites. Thu Oct 8 22:24:17 1998 Joe Orton * Complete rewrite of 'moved files' code - made it sensible * Differences between remote and local now counted, resulting in: - Connects to FTP server only made when necessary - Tidier 'list site' mode output - Exit codes for list site mode too Wed Oct 7 19:56:24 1998 Joe Orton * Finished off relative remote filenames stuff. * Exit code stuff Mon Oct 5 01:44:40 1998 Joe Orton * Made 'file moved' checking optional on a per-site basis. Sun Oct 4 17:57:30 1998 Joe Orton * Checking for whether a file has been moved added - file has been moved only if size, basename and mod time match. * Multiple site names can be specified in cmdline. * Couple of debugging tidy ups. Wed Sep 30 15:31:10 1998 Joe Orton * Added 'nodelete' option to keep remote files. * Allow rcfile and site storage directory to be specified on cmdline. Mon Sep 28 16:07:02 1998 Joe Orton * Make .'s appear when uploading: thanks to Karl Heinz Marbaise Sun Sep 27 16:11:12 1998 Joe Orton * Modified filename handling in preparation for allowing different local/remote names, and relative remote filenames. Sat Sep 26 02:32:05 1998 Joe Orton * Fixed directory creation order bug * Tidied up FTP error reporting. Fri Sep 25 19:10:51 1998 Joe Orton * Added `permissions' mirroring - new rcfile key. Thu Sep 24 13:15:20 1998 Joe Orton * Added `view sites' mode, to view site defs from rc file. * Allow comments in rcfile. Tue Sep 22 22:22:24 1998 Joe Orton * Debugging messages tidied up a lot * sitecopy-0.1 released. Tue Sep 22 17:31:15 1998 Joe Orton * Directories are distinguished from files * Probable bug fix of segfault after long upload sequence (ftp_exec still wasn't quite malloc'ing properly) * 'Catchup' and 'Init' invocation modes added * Fixed silly segfault from giving invalid site name Monday September 22nd, 1998: * Implemented info file read+write * Implemented file change/new/delete detection Tuesday September 16th, 1998: * Implemented read of $HOME/.sitecopyrc. Sunday September 14th, 1998: * Split FTP code into ftp.c * Designed some of interface for site info storage Sunday September 6th, 1998: * Segfault irradicated (ftp_exec malloc problem?) * Full site upload now works. Saturday September 5th, 1998: * FTP + recursive site_put implemented * Segfault consistently after about 10 uploads. sitecopy-0.16.6/po/0000775000076400007640000000000011037462357012217 5ustar joejoesitecopy-0.16.6/po/Makevars.template0000664000076400007640000000341611035206526015521 0ustar joejoe# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = sitecopy@lists.manyfish.co.uk # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = sitecopy-0.16.6/po/boldquot.sed0000664000076400007640000000033110165765223014541 0ustar joejoes/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g sitecopy-0.16.6/po/tr.po0000664000076400007640000014263511037413774013216 0ustar joejoe# sitecopy localization for turkish (tr) # Copyright (C) 2001 Free Software Foundation, Inc. # A. Sinan Unur , 2001. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: sitecopy-0.10.10\n" "Report-Msgid-Bugs-To: sitecopy@lyra.org\n" "POT-Creation-Date: 2008-07-16 16:31+0100\n" "PO-Revision-Date: 2001-01-03 HO:MI+ZONE\n" "Last-Translator: A. Sinan Unur \n" "Language-Team: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-9\n" "Content-Transfer-Encoding: 8bit\n" #: src/console_fe.c:119 msgid "Show changes to" msgstr "Deiiklikleri gster" #: src/console_fe.c:119 msgid "showing changes to" msgstr "deiiklikler gsteriliyor" #: src/console_fe.c:119 src/console_fe.c:120 msgid "local" msgstr "yerel" #: src/console_fe.c:120 msgid "Synchronize" msgstr "Eletir" #: src/console_fe.c:120 msgid "synchronizing" msgstr "eletiriliyor" #: src/console_fe.c:125 msgid "Fetch" msgstr "ncele" #: src/console_fe.c:125 msgid "fetching" msgstr "inceleniyor" #: src/console_fe.c:125 src/console_fe.c:126 src/console_fe.c:127 msgid "remote" msgstr "sunucu" #: src/console_fe.c:126 gnome/init.c:198 msgid "Update" msgstr "Gncelletir" #: src/console_fe.c:126 msgid "updating" msgstr "gncelletiriliyor" #: src/console_fe.c:127 msgid "Verify" msgstr "Kontrol et" #: src/console_fe.c:127 msgid "verifying" msgstr "kontrol ediliyor" #: src/console_fe.c:128 msgid "Catch up" msgstr "Gncelle" #: src/console_fe.c:128 msgid "catching up" msgstr "gncelleniyor" #: src/console_fe.c:128 src/console_fe.c:129 msgid "stored" msgstr "yklendi" #: src/console_fe.c:129 msgid "Initialize" msgstr "Hazrla" #: src/console_fe.c:129 msgid "initializing" msgstr "hazrlanyor" #: src/console_fe.c:134 msgid "" "You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n" msgstr "" "Bu mesajn asla verilmemesi gerekir.\n" "Bu durumu ltfen sitecopy@lyra.org adresine iletin.\n" #: src/console_fe.c:196 #, c-format msgid "%s: Error: No site called `%s' found - skipping.\n" msgstr "%s: Hata: `%s' adnda bir site bulunamadi - atlyorum.\n" #: src/console_fe.c:214 #, c-format msgid "%s: No valid sites specified.\n" msgstr "%s: Geerli bir site adna rastlanmad.\n" #: src/console_fe.c:216 #, c-format msgid "%s: No sites specified.\n" msgstr "%s: Hi bir site ad verilmedi.\n" #: src/console_fe.c:218 src/console_fe.c:369 src/console_fe.c:529 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Ek bilgi iin `%s --help' komutunu deneyin.\n" #: src/console_fe.c:228 #, c-format msgid "%s: %c%s site `%s' (on %s in %s)\n" msgstr "" "%s: %c%s: `%s' sitesi\n" "\t(%s sunucusunda %s kt)\n" #: src/console_fe.c:249 #, c-format msgid "* These items have been added since the last update:\n" msgstr "* Son gncelletirmeden bu yana eklenenler:\n" #: src/console_fe.c:254 src/console_fe.c:285 #, c-format msgid "dir:" msgstr "ktk:" #: src/console_fe.c:261 #, c-format msgid "* These items have been changed since the last update:\n" msgstr "* Son gncelletirmeden bu yana deienler:\n" #: src/console_fe.c:263 #, c-format msgid " Changes to items in [brackets] are ignored during updates.\n" msgstr "" " [Parantez] iindeki birimlere yapilan deiiklikler gncelletirme " "srasnda gz nne alnmaz.\n" #: src/console_fe.c:277 #, c-format msgid "* These items have been deleted, but will be left on the server:\n" msgstr "* Yerel kopyas silinip sunucudan silinmeyeckler:\n" #: src/console_fe.c:279 #, c-format msgid "* These items have been deleted since the last update:\n" msgstr "* Son gncelletirmeden bu yana silinenler:\n" #: src/console_fe.c:292 #, c-format msgid "* These items have been moved since the last update:\n" msgstr "* Son gncelletirmeden bu yana tananlar:\n" #: src/console_fe.c:310 src/console_fe.c:322 msgid "Ignored" msgstr "Gz nne alnmaz" #: src/console_fe.c:312 msgid "Maintained for executables" msgstr "Programlar iin korunur" #: src/console_fe.c:314 msgid "Always maintained" msgstr "Her zaman korunur" #: src/console_fe.c:324 msgid "Maintained" msgstr "Korunur" #: src/console_fe.c:326 msgid "Followed" msgstr "zlenir" #: src/console_fe.c:337 #, c-format msgid "" "Site: %s\n" "\tServer: %s" msgstr "" "Site: %s\n" "\tSunucu: %s" #: src/console_fe.c:339 #, c-format msgid " Port: " msgstr " Port: " #: src/console_fe.c:341 #, c-format msgid "(default)\n" msgstr "(varsaylan)\n" #: src/console_fe.c:343 #, c-format msgid "%d\n" msgstr "%d\n" #: src/console_fe.c:345 #, c-format msgid "\tProtocol: %s Username: %s\n" msgstr "\tProtokol: %s Kullanc:%s \n" #: src/console_fe.c:348 msgid "(unspecified)" msgstr "(belirtilmemi)" #: src/console_fe.c:350 #, c-format msgid "\tPassive mode FTP will not be used.\n" msgstr "\t Pasif FTP ilem biimi kullanlmayacak.\n" #: src/console_fe.c:351 #, c-format msgid "" "\tRemote directory: %s\n" "\tLocal directory: %s\n" msgstr "" "\tSunucudaki ktk: %s\n" "\tYerel ktk: %s\n" #: src/console_fe.c:353 #, c-format msgid "\tPermissions: %s Symlinks: %s\n" msgstr "\tzinler: %s Sembolik linkler: %s\n" #: src/console_fe.c:356 #, c-format msgid "\tRemote files will not be deleted.\n" msgstr "\tSunucudaki dosyalar silinmez.\n" #: src/console_fe.c:358 #, c-format msgid "\tFiles will be moved remotely if moved locally.\n" msgstr "\tYeri deien dosyalar, sunucuda da tanr.\n" #: src/console_fe.c:367 #, c-format msgid "%s: Error: Only specify ONE operation mode at a time.\n" msgstr "%s: Hata: Sadece tek BR ilem biimi belirtin.\n" #: src/console_fe.c:489 #, c-format msgid "%s: Error: Debug channel %s not known.\n" msgstr "%s: Hata: zleme kanal %s bilinmiyor.\n" #: src/console_fe.c:497 #, c-format msgid "%s: Warning: Could not open `%s' to use as logfile.\n" msgstr "%s: Uyar: `%s' dosyas izleme kayd iin alamad.\n" #: src/console_fe.c:540 #, c-format msgid "%s: Error: Dry run mode is currently only supported for updates.\n" msgstr "" #: src/console_fe.c:556 #, c-format msgid "" "%s: Warning: Only %d sites can be specified on the command line!\n" "Extra entries are being skipped.\n" msgstr "" "%s: Uyar: Komut satrnda en fazla %d adet site belirtilebilir!\n" "Fazlas gz nne alnmayacak.\n" #: src/console_fe.c:581 msgid "WARNING: Server certificate is not trusted." msgstr "" #: src/console_fe.c:584 #, c-format msgid "Certificate was issued for server `%s'.\n" msgstr "" #: src/console_fe.c:586 msgid "WARNING: Certificate does not specify a server" msgstr "" #: src/console_fe.c:588 #, c-format msgid "Fingerprint: %s\n" msgstr "" #: src/console_fe.c:591 #, c-format msgid "Issued to: %s\n" msgstr "" #: src/console_fe.c:595 #, c-format msgid "Issued by: %s\n" msgstr "" #: src/console_fe.c:598 #, c-format msgid "Do you wish to accept this certificate? (y/n) " msgstr "" #: src/console_fe.c:607 msgid "server" msgstr "sunucu" #: src/console_fe.c:607 msgid "proxy server" msgstr "ara sunucu" #: src/console_fe.c:613 #, c-format msgid "Authentication required for %s on %s `%s':\n" msgstr "" #: src/console_fe.c:616 #, c-format msgid "Authentication required on %s `%s':\n" msgstr "" #: src/console_fe.c:619 msgid "Username: " msgstr "Kullanc: " #: src/console_fe.c:624 #, c-format msgid "Username: %s\n" msgstr "Kullanci: %s\n" #: src/console_fe.c:626 src/console_fe.c:650 msgid "Password: " msgstr "ifre: " #: src/console_fe.c:636 #, c-format msgid "Retrying: [" msgstr "Tekrar deneniyor: [" #: src/console_fe.c:647 #, c-format msgid "%s: Encrypted client certificate configured%s%s.\n" msgstr "" #: src/console_fe.c:682 #, c-format msgid "Create %s/" msgstr "%s/ ktn yarat" #: src/console_fe.c:684 #, c-format msgid "Delete %s/" msgstr "%s/ ktn sil" #: src/console_fe.c:692 #, fuzzy, c-format msgid "Upload %s (%s bytes)" msgstr "%s dosyasn gnder" #: src/console_fe.c:694 #, c-format msgid "Delete %s" msgstr "%s dosyasn sil" #: src/console_fe.c:695 #, c-format msgid "Move %s->%s" msgstr "%s dosyasn %s'ye ta" #: src/console_fe.c:699 #, c-format msgid "" "%s: in fe_can_update/file_file\n" "%s" msgstr "" #: src/console_fe.c:706 #, c-format msgid "Change %s" msgstr "%s dosyasn deitir" #: src/console_fe.c:707 #, c-format msgid "Create %s" msgstr "%s dosyasn yarat" #: src/console_fe.c:708 #, c-format msgid "Remove %s" msgstr "%s dosyasn sil" #: src/console_fe.c:711 #, c-format msgid "" "%s: in fe_can_update/file_link\n" "%s" msgstr "" #: src/console_fe.c:717 #, c-format msgid "? (y/n) " msgstr "? (e/h) " #: src/console_fe.c:726 #, c-format msgid "Checksumming %s: [" msgstr "%s dosyasnn kontrol toplam hesaplanyor: [ " #: src/console_fe.c:741 src/console_fe.c:852 src/console_fe.c:913 #, c-format msgid "] done.\n" msgstr "] tamamland.\n" #: src/console_fe.c:743 src/console_fe.c:915 #, c-format msgid "" "] failed:\n" "%s\n" msgstr "" "] baarsz oldu:\n" "%s\n" #: src/console_fe.c:753 #, fuzzy, c-format msgid "Setting permissions on %s%s: " msgstr "%s dosyasnn izinleri konuyor: " #: src/console_fe.c:763 src/console_fe.c:841 src/console_fe.c:907 #, c-format msgid "done.\n" msgstr "tamamland.\n" #: src/console_fe.c:765 src/console_fe.c:909 #, c-format msgid "" "failed:\n" "%s\n" msgstr "" "baarsz oldu:\n" "%s\n" #: src/console_fe.c:784 src/console_fe.c:871 #, c-format msgid "Creating %s/: " msgstr "%s/ kt yaratlyor: " #: src/console_fe.c:786 src/console_fe.c:873 #, c-format msgid "Deleting %s/: " msgstr "%s/ kt siliniyor: " #: src/console_fe.c:793 #, c-format msgid "Uploading %s: [" msgstr "%s dosyas gnderiliyor: [" #: src/console_fe.c:796 src/console_fe.c:815 src/console_fe.c:883 #, c-format msgid "Deleting %s: " msgstr "%s dosyas siliniyor: " #: src/console_fe.c:799 src/console_fe.c:886 #, c-format msgid "Moving %s->%s: " msgstr "%s dosyas %s'ye tanyor: " #: src/console_fe.c:803 #, c-format msgid "" "%s: in fe_updating/file_file\n" "%s" msgstr "" #: src/console_fe.c:811 #, c-format msgid "Changing %s: " msgstr "%s dosyas deitiriliyor: " #: src/console_fe.c:813 #, c-format msgid "Creating %s: " msgstr "%s dosyas yaratlyor: " #: src/console_fe.c:817 #, c-format msgid "" "%s: in fe_updating/file_link\n" "%s" msgstr "" #: src/console_fe.c:834 #, fuzzy, c-format msgid "Failed to update %s:%c%s\n" msgstr "" "%s'yi gncelletirme baarsz oldu:\n" "%s\n" #: src/console_fe.c:843 #, fuzzy, c-format msgid "failed:%c%s\n" msgstr "" "baarsz oldu:\n" "%s\n" #: src/console_fe.c:855 #, fuzzy, c-format msgid "] failed:%c%s\n" msgstr "" "] baarsz oldu:\n" "%s\n" #: src/console_fe.c:880 #, c-format msgid "Downloading %s: [" msgstr "%s dosyas indiriliyor: [" #: src/console_fe.c:925 #, fuzzy msgid "Changed on server" msgstr "%s dosyasn deitir" #: src/console_fe.c:928 msgid "Added on server" msgstr "" #: src/console_fe.c:936 #, fuzzy, c-format msgid "%s: %s\n" msgstr "%s: Hata: %s\n" #: src/console_fe.c:956 #, c-format msgid "Directory: %s/\n" msgstr "Ktk: %s/\n" #: src/console_fe.c:961 #, fuzzy, c-format msgid "File: %s - size %s%s\n" msgstr "Dosya: %s - boyutu %ld%s\n" #: src/console_fe.c:963 msgid " (ASCII)" msgstr " (ASCII)" #: src/console_fe.c:966 #, c-format msgid "Link: %s - target %s\n" msgstr "Link: %s - hedefi %s\n" #: src/console_fe.c:979 gnome/init.c:402 #, c-format msgid "%s: Error: Could not open rcfile: %s.\n" msgstr "%s: Hata: Kurulum dosyas %s alamad.\n" #: src/console_fe.c:983 gnome/init.c:407 #, c-format msgid "" "%s: rcfile corrupt at line %d:\n" "%s\n" msgstr "" "%s: kurulum dosyasnda bozukluk var. satr %d:\n" "%s\n" #: src/console_fe.c:1002 #, c-format msgid "" "%s: Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: `%s'nin kt okunamad:\n" "\t%s\n" #: src/console_fe.c:1006 #, c-format msgid "%s: Server not specified in site `%s'.\n" msgstr "%s: `%s' sitesinin tanmnda sunucu belirtilmemi.\n" #: src/console_fe.c:1010 #, c-format msgid "%s: Remote directory not specified in site `%s'.\n" msgstr "%s: `%s' sitesinin tanmnda sunucudaki ktk belirtilmemi.\n" #: src/console_fe.c:1014 #, c-format msgid "%s: Local directory not specified in site `%s'.\n" msgstr "%s: `%s' sitesinin tanmnda yerel ktk belirtilmemi.\n" #: src/console_fe.c:1018 #, c-format msgid "%s: Invalid port used in site `%s'.\n" msgstr "%s: `%s' sitesinin tanmnda geersiz port belirtilmi.\n" #: src/console_fe.c:1022 #, c-format msgid "%s: %s cannot maintain symbolic links (site `%s').\n" msgstr "" "%s: %s protokol ile sembolik linklerin korunmas mmkn deil (`%s' " "sitesi).\n" #: src/console_fe.c:1026 #, c-format msgid "%s: Cannot use a relative remote directory in %s (site `%s').\n" msgstr "" "%s: %s protokol ile sunucuda greli ktklerin kullanlmas mmkn deil (`%" "s' sitesi).\n" #: src/console_fe.c:1029 #, c-format msgid "%s: File permissions are not supported in %s (site `%s').\n" msgstr "%s: %s protokol dosya izinlerini desteklemiyor (`%s' sitesi).\n" #: src/console_fe.c:1032 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n" msgstr "" #: src/console_fe.c:1035 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n" msgstr "" #: src/console_fe.c:1038 #, c-format msgid "%s: Can only check for renamed files when checksumming (site `%s').\n" msgstr "" "%s: Ad deien dosyalar sadece kontrol toplamlar hesaplanarak " "belirlenebilir (`%s' sitesi).\n" #: src/console_fe.c:1041 #, c-format msgid "%s: The protocol `%s' is unsupported (site `%s').\n" msgstr "%s: `%s' protokol desteklenmiyor (`%s' sitesi).\n" #: src/console_fe.c:1048 #, c-format msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" msgstr "" # msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" # msgstr "" # "%s: `%s' sitesinde %d sayl bilinmeyen bir hata ile karilald \n" # "ltfen bu durumu iletin.\n" #: src/console_fe.c:1066 #, c-format msgid "" "%s: Error: Corrupt site storage file for `%s':\n" "%s: %s\n" msgstr "" "%s: Hata: Bozuk site veritaban `%s':\n" "%s: %s\n" #: src/console_fe.c:1075 #, c-format msgid "" "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n" msgstr "" "%s: Hata: `%s' sitesinin veritaban yok.\n" "%s: --init, --catchup ya da --fetch seenekelerinden birini kullanarak\n" "veritabann yaratn.\n" #: src/console_fe.c:1088 #, c-format msgid "%s: Skipping site `%s'.\n" msgstr "%s: `%s' sitesi atlanyor.\n" #: src/console_fe.c:1103 #, c-format msgid "%s: %s completed successfully.\n" msgstr "%s: %s baaryla tamamland.\n" #: src/console_fe.c:1109 #, c-format msgid "%s: %s unsupported for %s.\n" msgstr "%s: %s, %s sitesinde desteklenmiyor.\n" #: src/console_fe.c:1114 #, c-format msgid "%s: Errors occurred while %s the %s site.\n" msgstr "%s: %s: `%s' sitesinde hatalarla karlald.\n" #: src/console_fe.c:1119 #, c-format msgid "%s: Error: Could not resolve remote hostname (%s).\n" msgstr "%s: Hata: %s sunucusunun adresi bulunamad.\n" #: src/console_fe.c:1125 #, c-format msgid "%s: Error: Could not resolve hostname of proxy server (%s).\n" msgstr "%s: Hata: %s ara sunucusunun adresi bulunamad.\n" #: src/console_fe.c:1131 #, c-format msgid "%s: Error: Could not connect to proxy server (%s port %d).\n" msgstr "%s: Hata: %s ara sunucusu ile %d portundan balant kurulamad.\n" #: src/console_fe.c:1134 #, c-format msgid "%s: Error: Could not connect to server (%s port %d).\n" msgstr "%s: Hata: %s sunucusu ile %d portundan balant kurulamad.\n" #: src/console_fe.c:1140 #, c-format msgid "%s: Error: Could not authorise user on server.\n" msgstr "%s: Hata: Kullanc sunucu tarafndan onaylanmad.\n" #: src/console_fe.c:1145 #, c-format msgid "%s: Error: %s\n" msgstr "%s: Hata: %s\n" #: src/console_fe.c:1149 #, c-format msgid "%s: Error: Could not authorise user on proxy server (%s).\n" msgstr "%s: Hata: Kullanc %s ara sunucusu tarafndan onaylanmad.\n" #: src/console_fe.c:1154 #, c-format msgid "" "%s: in issue_error\n" "%s" msgstr "" "%s: in issue_error\n" "%s" #: src/console_fe.c:1168 #, c-format msgid "%s: Error: Environment variable HOME not set.\n" msgstr "%s: Hata: Ortam deikeni HOME belirtilmemi.\n" #: src/console_fe.c:1176 #, c-format msgid "%s: Error: Could not open rcfile: %s\n" msgstr "%s: Hata: %s adl kurulum dosyas alamad.\n" #: src/console_fe.c:1179 #, c-format msgid "%s: Error: rcfile permissions allow other users to read your rcfile.\n" msgstr "%s: Hata: Kurulum dosyas baka kullanclar tarafndan okunabilir.\n" #: src/console_fe.c:1180 src/console_fe.c:1192 #, c-format msgid "%s: Set the permissions to 0600.\n" msgstr "%s: Dosya izinlerini 0600 olarak belirtin.\n" #: src/console_fe.c:1183 #, c-format msgid "%s: Error: Could not open storage directory: %s\n" msgstr "%s: Hata: Veritaban kt %s alamad.\n" #: src/console_fe.c:1184 #, c-format msgid "" "%s: You need to create this directory and set the permissions to 0700.\n" msgstr "%s: Bu kt yaratn ve izinlerini 0700 olarak belirtin.\n" #: src/console_fe.c:1187 #, c-format msgid "%s: Error: storage directory permissions incorrect.\n" msgstr "%s: Hata: Veritaban ktnn izinleri yanl.\n" #: src/console_fe.c:1188 #, c-format msgid "%s: Set the permissions to 0700.\n" msgstr "%s: zinleri 0700 olarak belirtin.\n" #: src/console_fe.c:1191 #, c-format msgid "%s: Error: ~/.netrc permissions incorrect.\n" msgstr "%s: Hata: ~/.netrc dosyasnn izinleri yanl.\n" #: src/console_fe.c:1197 #, c-format msgid "" "%s: init_paths gave %d\n" "%s" msgstr "" "%s: init_paths gave %d\n" "%s" #: src/console_fe.c:1204 #, c-format msgid "%s: Error: Could not parse ~/.netrc.\n" msgstr "%s: Hata ~/.netrc dosyas anlalamad.\n" #: src/console_fe.c:1222 src/console_fe.c:1321 #, c-format msgid "%s: Nothing to do - no changes found.\n" msgstr "%s: Hi deiiklik yok.\n" #: src/console_fe.c:1231 #, c-format msgid "" "%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n" msgstr "" "%s: Hata: Veritaban dosyas %s yazm iin alamad.\n" "%s: Hata: %s\n" "%s: `%s' sitesi gncelletirilmeyecek.\n" #: src/console_fe.c:1255 #, fuzzy, c-format msgid "" "%s: Warning: Current state method differs from stored in site `%s'.\n" "%s: All existing files will appear changed (use catchup?).\n" msgstr "" "%s: Uyar: Kullanmdaki durum belirleme yntemi `%s' sitesi\n" "veritabanndakinden farkl.\n" "%s: Btn dosyalar deimis grnecek (sunucudan gncellensin mi?)\n" #: src/console_fe.c:1261 #, c-format msgid "%s: The remote site needs updating (%d items to update).\n" msgstr "" "%s: Sunucunun gncelletirilmesi gerek.\n" "\t(Gncelletirilecek dosya adedi: %d)\n" #: src/console_fe.c:1263 #, c-format msgid "%s: The remote site needs updating (1 item to update).\n" msgstr "%s: Sunucudaki bir adet dosyann gncelletirilmesi gerek.\n" #: src/console_fe.c:1266 #, c-format msgid "%s: The remote site does not need updating.\n" msgstr "%s: Sunucunun gncelletirilmesi gerekli deil.\n" #: src/console_fe.c:1274 #, c-format msgid "%s: All the files and directories are marked as NOT updated remotely.\n" msgstr "" "%s: Btn dosya ve ktkler sunucuda gncel DEL olarak iaretlendi.\n" #: src/console_fe.c:1279 #, c-format msgid "%s: All the files and and directories are marked as updated remotely.\n" msgstr "%s: Btn dosya ve ktkler sunucuda gncel olarak iaretlendi.\n" #: src/console_fe.c:1288 #, c-format msgid "" "%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n" msgstr "" "%s: `%s' sitesinden dosya listesi indirme baarsz oldu:\n" "%s: %s\n" #: src/console_fe.c:1302 #, fuzzy, c-format msgid "" "%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n" msgstr "" "%s: `%s' sitesinden dosya listesi indirme baarsz oldu:\n" "%s: %s\n" #: src/console_fe.c:1309 #, c-format msgid "%s: Verify found %d files missing from server.\n" msgstr "" #: src/console_fe.c:1312 #, fuzzy, c-format msgid "%s: Remote site not synchronized with stored state.\n" msgstr "%s: `%s' sitesinin tanmnda sunucudaki ktk belirtilmemi.\n" #: src/console_fe.c:1325 #, c-format msgid "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" msgstr "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" #: src/console_fe.c:1333 #, c-format msgid "" "%s: in act_on_site\n" "%s" msgstr "" "%s: in act_on_site\n" "%s" #: src/console_fe.c:1344 #, c-format msgid "Usage: %s [OPTIONS] [MODE] [sitename]...\n" msgstr "Kullanm biimi: %s [SEENEKLER] [LEM BM] [site ad] ...\n" #: src/console_fe.c:1346 #, c-format msgid "Options: \n" msgstr "Seenekler: \n" #: src/console_fe.c:1349 #, fuzzy, c-format msgid "" " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" msgstr "" " -d, --debug=KANAL[,KANAL] Hatalar belirtilen KANAL'lardan izle.\n" " Hata izleme ilevi iin aaidaki kanallar kullanilabilir.\n" " socket, files, rcfile, ftp, http, httpbody, xml, xmlparse, cleartext\n" " Uyar: cleartext kanal ile, (normalde gizli) ifreler de gsterilir.\n" " -g, --logfile=DOSYA Hata izleme mesajlarn (stderr yerine) DOSYA'ya ekle.\n" #: src/console_fe.c:1356 #, fuzzy, c-format msgid "" " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites " "(default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote " "state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n" msgstr "" " -r, --rcfile=FILE Ayr bir kurulum dosyas kullan.\n" " -p, --storepath=PATH Ayr bir veritaban kt kullan.\n" " -y, --prompting Her gncelletrimeden nce onay iste.\n" " -a, --allsites lemi btn sitelere uygula.\n" " -k, --keep-going Hatalara ramen ileme devam et.\n" " -o, --show-progress Dosya aktarmnn gelimesini yzde olarak gster.\n" " -q, --quiet lem srasnda zet bilgi ver.\n" " -qq, --silent lem srasnda hi bilgi verme.\n" "lem biimleri:\n" " -l, --list Sunucu ile yerel site arasndaki farklar listele.\n" " (varsaylan)\n" " -ll, --flatlist Sunucu ile yerel site arasndaki farklarn dz " "listele.\n" " -v, --view Site tanmlarnn dkmn ver.\n" " -i, --initialize Btn dosya ve ktkleri gncel DEL olarak " "iaretle.\n" " -f, --fetch Sunucudaki dosya ve ktkleri ren.\n" " -c, --catchup Btn dosya ve ktkleri gncel olarak iaretle.\n" " -s, --synchronize Yerel siteyi sunucudan gncelletir.\n" " -u, --update Sunucuyu gncelletir.\n" " -h, --help Bu yardm mesajn gster.\n" " -V, --version Srm bilgilerini gster.\n" "Hata raporlar ve isteklerinizi sitecopy@lyra.org adresine.\n" "ngilizce olarak iletin.\n" #: src/sitestore.c:326 #, c-format msgid "Invalid checksum at line %d" msgstr "" #: src/sitestore.c:371 #, c-format msgid "Boolean missing in 'ascii' at line %d" msgstr "" #: src/sitestore.c:396 #, c-format msgid "Size overflow (%s) in '%s' at line %d" msgstr "" #: src/davdriver.c:195 msgid "The connection timed out." msgstr "Balant sre snr ald." #: src/davdriver.c:224 #, fuzzy msgid "Could not write SSL certificate" msgstr "%s dosyasna yazm yaplamad" #: src/davdriver.c:244 msgid "SSL support has not be compiled in." msgstr "SSL destei yok." #: src/davdriver.c:252 #, fuzzy, c-format msgid "Could not load certificate `%s'." msgstr "%s dosyasna yazm yaplamad" #: src/davdriver.c:290 #, fuzzy, c-format msgid "Could not read SSL client certificate '%s'." msgstr "%s dosyasna yazm yaplamad" #: src/davdriver.c:303 #, fuzzy, c-format msgid "Could not decrypt SSL client certificate '%s'." msgstr "%s dosyasna yazm yaplamad" #: src/davdriver.c:325 msgid "The server does not appear to be a WebDAV server." msgstr "Bu sunucu WebDAV sunucusu deil." #: src/davdriver.c:330 msgid "The server does not support the executable live property." msgstr "The server does not support the executable live property." #: src/davdriver.c:376 src/davdriver.c:443 src/davdriver.c:480 src/ftp.c:888 #: src/ftp.c:972 #, fuzzy msgid "Could not open file" msgstr "Dosya alamad: " #: src/davdriver.c:411 #, fuzzy, c-format msgid "Could not stat file: %s" msgstr "%s dosyasna yazm yaplamad" #: src/davdriver.c:670 msgid "Could not access resource" msgstr "Kaynaa eriim baarsz oldu" #: src/sites.c:160 msgid "Could not set modification time of local file." msgstr "Yerel dosyann deiim vakti ayarlanamad." #: src/sites.c:308 msgid "" "Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode." msgstr "" "Sunucuya aktarma tamamland, ama dosyann deiim vakti alnamad.\n" "If this message persists, turn off safe mode." #: src/sites.c:515 msgid "Remote file has been modified - not overwriting with local changes" msgstr "Sunucudaki dosya deimi - yerel dosya stne yazlmayacak" #: src/sites.c:828 msgid "Could not examine file." msgstr "Dosya incelenemedi." #: src/sites.c:871 msgid "Could not checksum file" msgstr "Dosyann kotrol toplam hesaplanamad" #: src/sites.c:887 msgid "The target of the symlink could not be read." msgstr "Sembolik linkin hedefi okunamad." #: src/common.c:113 msgid "Unknown system error" msgstr "Bilinmeyen sistem hatas" #: src/ftp.c:153 #, c-format msgid "%s: connection was closed by server." msgstr "%s: balant sunucu tarafinden kesildi." #: src/ftp.c:157 #, c-format msgid "%s: connection timed out." msgstr "%s: balant bekleme snr ald." #: src/ftp.c:195 #, fuzzy msgid "Could not read response line" msgstr "Yant metni okunamad" #: src/ftp.c:229 #, fuzzy msgid "Cannot parse MDTM response; wrong length." msgstr "Durum satr anlalamad." #: src/ftp.c:236 #, fuzzy msgid "Cannot parse MDTM response." msgstr "Durum satr anlalamad." #: src/ftp.c:260 #, fuzzy msgid "Could not find address in PASV response" msgstr "Yant metni okunamad" #: src/ftp.c:267 #, fuzzy msgid "Could not parse PASV response" msgstr "Yant metni okunamad" #: src/ftp.c:276 msgid "Invalid IP address in PASV response" msgstr "" #: src/ftp.c:296 #, fuzzy msgid "Malformed EPSV response" msgstr "Yant metni okunamad" #: src/ftp.c:304 #, fuzzy msgid "Malformed port in EPSV response" msgstr "Yant metni okunamad" #: src/ftp.c:449 msgid "Error sending file" msgstr "" #: src/ftp.c:463 src/ftp.c:489 #, fuzzy msgid "Error reading file" msgstr "stek metni gnderilirken hata" #: src/ftp.c:480 #, fuzzy msgid "Could not send file" msgstr "Dosya alamad: " #: src/ftp.c:510 src/ftp.c:991 #, fuzzy msgid "Error writing to file" msgstr "Yant beklerken hata" #: src/ftp.c:516 msgid "Receiving file" msgstr "" #: src/ftp.c:532 #, fuzzy msgid "Could not connect passive data socket" msgstr "SSL balants kurulamad" #: src/ftp.c:647 msgid "Active open failed: could not determine address of control socket" msgstr "" #: src/ftp.c:659 #, fuzzy msgid "Active open failed: could not create socket" msgstr "SSL balants kurulamad" #: src/ftp.c:667 msgid "Active open failed: could not bind to address" msgstr "" #: src/ftp.c:677 msgid "Active open failed: could not determine address of data socket" msgstr "" #: src/ftp.c:684 #, fuzzy msgid "Could not determine bound port number for data socket" msgstr "SSL balants kurulamad" #: src/ftp.c:727 msgid "Active open failed: could not accept connection" msgstr "" #: src/ftp.c:800 msgid "Error closing data socket" msgstr "" #: src/ftp.c:894 #, fuzzy msgid "Could not determine length of file" msgstr "Dosya alamad: " #: src/ftp.c:905 #, fuzzy msgid "Could not rewind to beginning of file" msgstr "Dosya alamad: " #: src/ftp.c:1152 #, fuzzy msgid "Could not read 'LIST' response." msgstr "Yant metni okunamad" #: src/ftp.c:1161 #, fuzzy, c-format msgid "Parse error in LIST response: %s" msgstr "Yant metni okunamad" #: gnome/init.c:51 msgid "_New site..." msgstr "" #: gnome/init.c:51 gnome/init.c:171 msgid "Create a new site definition" msgstr "" #: gnome/init.c:54 msgid "_Open..." msgstr "" #: gnome/init.c:54 msgid "Open a new rc file. (EXPERIMENTAL)." msgstr "" #: gnome/init.c:57 msgid "_Save Sites" msgstr "" #: gnome/init.c:57 gnome/init.c:177 msgid "Save the current site definitions" msgstr "" #: gnome/init.c:60 msgid "Sav_e Sites As..." msgstr "" #: gnome/init.c:60 msgid "Save the current site definitions to a file." msgstr "" #: gnome/init.c:63 #, fuzzy msgid "_Delete this site" msgstr "%s dosyasn sil" #: gnome/init.c:63 msgid "Delete the selected site entry" msgstr "" #: gnome/init.c:69 msgid "E_xit" msgstr "" #: gnome/init.c:69 gnome/init.c:202 msgid "Exit the program" msgstr "" #: gnome/init.c:78 #, fuzzy msgid "_Initialise site" msgstr "Hazrla" #: gnome/init.c:78 msgid "All files will be uploaded if a site is initialised" msgstr "" #: gnome/init.c:81 #, fuzzy msgid "'_Catchup' site" msgstr "Gncelle" #: gnome/init.c:81 msgid "Records the site as already updated." msgstr "" #: gnome/init.c:84 msgid "_Fetch site listing" msgstr "" #: gnome/init.c:84 msgid "Figures out which files are new/changed from the actual remote site." msgstr "" #: gnome/init.c:88 #, fuzzy msgid "_Resynchronize site" msgstr "eletiriliyor" #: gnome/init.c:88 msgid "Copies newer files from the remote site to the local drive." msgstr "" #: gnome/init.c:91 msgid "_Update site..." msgstr "" #: gnome/init.c:91 msgid "Apply the local site's changes to the remote site." msgstr "" #: gnome/init.c:94 msgid "Update _ALL sites" msgstr "" #: gnome/init.c:94 gnome/init.c:137 msgid "Performs the required operations on all site definitions. (TODO)." msgstr "" #: gnome/init.c:98 msgid "Rescan local directory" msgstr "" #: gnome/init.c:98 #, fuzzy msgid "Re-reads the local directory of the selected site." msgstr "%s: `%s' sitesinin tanmnda yerel ktk belirtilmemi.\n" #: gnome/init.c:106 msgid "_Required updates" msgstr "" #: gnome/init.c:106 msgid "Displays a brief report of any required updates." msgstr "" #: gnome/init.c:109 msgid "Site web-r_eport" msgstr "" #: gnome/init.c:109 msgid "" "Generates a web page detailing the changes required on the selected site." msgstr "" #: gnome/init.c:112 msgid "Prin_t site info..." msgstr "" #: gnome/init.c:112 msgid "Print information about the selected site" msgstr "" #: gnome/init.c:119 msgid "_Backup files status" msgstr "" #: gnome/init.c:119 msgid "Save the 'state' of your local files, in case of accident." msgstr "" #: gnome/init.c:122 msgid "Restore files status..." msgstr "" #: gnome/init.c:122 gnome/init.c:129 msgid "If a backup has previously been made, it will be restored." msgstr "" #: gnome/init.c:126 msgid "_Backup site definitions" msgstr "" #: gnome/init.c:126 msgid "Backup your site definitions, in case you delete your sites." msgstr "" #: gnome/init.c:129 msgid "Restore site definitions..." msgstr "" #: gnome/init.c:137 msgid "Preferences..." msgstr "" #: gnome/init.c:146 msgid "_About XSitecopy" msgstr "" #: gnome/init.c:146 msgid "Information about XSitecopy" msgstr "" #: gnome/init.c:158 msgid "_File" msgstr "" #: gnome/init.c:159 #, fuzzy msgid "_Operations" msgstr "Seenekler: \n" #: gnome/init.c:160 msgid "_Reports" msgstr "" #: gnome/init.c:161 msgid "_Settings" msgstr "" #: gnome/init.c:162 msgid "_Backup" msgstr "" #: gnome/init.c:163 msgid "_Help" msgstr "" #: gnome/init.c:171 msgid "New site" msgstr "" #: gnome/init.c:174 msgid "Open" msgstr "" #: gnome/init.c:174 msgid "Open a new site definitions file." msgstr "" #: gnome/init.c:177 msgid "Save" msgstr "" #: gnome/init.c:180 #, fuzzy msgid "Delete site" msgstr "%s dosyasn sil" #: gnome/init.c:180 msgid "Delete the selected site" msgstr "" #: gnome/init.c:185 #, fuzzy msgid "Initialise" msgstr "Hazrla" #: gnome/init.c:185 msgid "Initialise the site (mark all files as needing to be updated)." msgstr "" #: gnome/init.c:188 #, fuzzy msgid "Catch-up" msgstr "Gncelle" #: gnome/init.c:188 msgid "Mark all of the selected site's files as updated." msgstr "" #: gnome/init.c:194 #, fuzzy msgid "Download" msgstr "%s dosyas indiriliyor: [" #: gnome/init.c:194 msgid "Download newer files from the remote site. (Use with care)" msgstr "" #: gnome/init.c:198 msgid "Updates the selected site" msgstr "" #: gnome/init.c:202 msgid "Quit" msgstr "" #: gnome/init.c:412 #, fuzzy, c-format msgid "%s: Error: Could not read rcfile: %s.\n" msgstr "%s: Hata: Kurulum dosyas %s alamad.\n" #: gnome/main.c:184 msgid "" "Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" msgstr "" #: gnome/misc.c:580 #, fuzzy, c-format msgid "Server not specified in site `%s'.\n" msgstr "%s: `%s' sitesinin tanmnda sunucu belirtilmemi.\n" #: gnome/misc.c:584 #, fuzzy, c-format msgid "Remote directory not specified in site `%s'.\n" msgstr "%s: `%s' sitesinin tanmnda sunucudaki ktk belirtilmemi.\n" #: gnome/misc.c:588 #, fuzzy, c-format msgid "Local directory not specified in site `%s'.\n" msgstr "%s: `%s' sitesinin tanmnda yerel ktk belirtilmemi.\n" #: gnome/misc.c:592 #, fuzzy, c-format msgid "" "Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: `%s'nin kt okunamad:\n" "\t%s\n" #: gnome/misc.c:596 #, fuzzy, c-format msgid "Invalid port used in site `%s'.\n" msgstr "%s: `%s' sitesinin tanmnda geersiz port belirtilmi.\n" #: gnome/misc.c:600 #, fuzzy, c-format msgid "Protocol '%s' cannot maintain symbolic links (site `%s').\n" msgstr "" "%s: %s protokol ile sembolik linklerin korunmas mmkn deil (`%s' " "sitesi).\n" #: gnome/misc.c:604 #, fuzzy, c-format msgid "Cannot use a relative remote directory protocol '%s' (site `%s').\n" msgstr "" "%s: %s protokol ile sunucuda greli ktklerin kullanlmas mmkn deil (`%" "s' sitesi).\n" #: gnome/misc.c:607 #, c-format msgid "%s's protocol does not currently support maintaining permissions." msgstr "" #: gnome/misc.c:611 #, fuzzy, c-format msgid "Could not find 'relative' local directory" msgstr "SSL balants kurulamad" #: lib/neon/ne_redirect.c:92 #, fuzzy msgid "Could not parse redirect destination URL" msgstr "Durum satr anlalamad." #: lib/neon/ne_gnutls.c:162 #, c-format msgid "[unprintable:#%lu]" msgstr "" #: lib/neon/ne_gnutls.c:188 msgid "[unprintable]" msgstr "" #: lib/neon/ne_gnutls.c:696 lib/neon/ne_openssl.c:419 msgid "Server certificate was missing commonName attribute in subject name" msgstr "" #: lib/neon/ne_gnutls.c:736 lib/neon/ne_openssl.c:638 #, fuzzy, c-format msgid "SSL negotiation failed: %s" msgstr "%s dosyasna yazm yaplamad" #: lib/neon/ne_gnutls.c:745 msgid "Server did not send certificate chain" msgstr "" #: lib/neon/ne_openssl.c:451 #, c-format msgid "Certificate verification error: %s" msgstr "" #: lib/neon/ne_openssl.c:657 msgid "SSL server did not present certificate" msgstr "" #: lib/neon/ne_openssl.c:666 msgid "Server certificate changed: connection intercepted?" msgstr "" #: lib/neon/ne_session.c:356 lib/neon/ne_session.c:367 msgid "[invalid date]" msgstr "" #: lib/neon/ne_session.c:380 msgid "certificate is not yet valid" msgstr "" #: lib/neon/ne_session.c:381 msgid "certificate has expired" msgstr "" #: lib/neon/ne_session.c:382 msgid "certificate issued for a different hostname" msgstr "" #: lib/neon/ne_session.c:383 msgid "issuer is not trusted" msgstr "" #: lib/neon/ne_session.c:388 msgid "Server certificate verification failed: " msgstr "" #: lib/neon/ne_socket.c:514 lib/neon/ne_socket.c:568 lib/neon/ne_socket.c:671 #, fuzzy msgid "Connection closed" msgstr "Balant sunucu tarafndan kesildi" #: lib/neon/ne_socket.c:578 lib/neon/ne_socket.c:683 #, fuzzy msgid "Secure connection truncated" msgstr "Balant sre snr ald." #: lib/neon/ne_socket.c:590 lib/neon/ne_socket.c:695 #, fuzzy, c-format msgid "SSL error: %s" msgstr "%s: Hata: %s\n" #: lib/neon/ne_socket.c:593 #, c-format msgid "SSL error code %d/%d/%lu" msgstr "" #: lib/neon/ne_socket.c:676 #, fuzzy, c-format msgid "SSL alert received: %s" msgstr "%s: Hata: %s\n" #: lib/neon/ne_socket.c:691 msgid "SSL socket read failed" msgstr "" #: lib/neon/ne_socket.c:790 msgid "Line too long" msgstr "Satr ok uzun" #: lib/neon/ne_socket.c:935 lib/neon/ne_socket.c:941 msgid "Host not found" msgstr "Sunucu bulunamad" #: lib/neon/ne_socket.c:1048 #, fuzzy msgid "Connection timed out" msgstr "Balant sre snr ald." #: lib/neon/ne_socket.c:1210 msgid "Socket descriptor number exceeds FD_SETSIZE" msgstr "" #: lib/neon/ne_socket.c:1270 msgid "Socket family not supported" msgstr "" #: lib/neon/ne_socket.c:1493 msgid "Client certificate verification failed" msgstr "" #: lib/neon/ne_socket.c:1509 msgid "SSL disabled due to lack of entropy" msgstr "" #: lib/neon/ne_socket.c:1516 msgid "SSL disabled due to library version mismatch" msgstr "" #: lib/neon/ne_socket.c:1522 #, fuzzy msgid "Could not create SSL structure" msgstr "SSL balants kurulamad" #: lib/neon/ne_request.c:194 #, fuzzy, c-format msgid "%s: connection was closed by proxy server" msgstr "%s: balant ara sunucu tarafinden kesildi." #: lib/neon/ne_request.c:197 #, fuzzy, c-format msgid "%s: connection was closed by server" msgstr "%s: balant sunucu tarafinden kesildi." #: lib/neon/ne_request.c:202 #, fuzzy, c-format msgid "%s: connection timed out" msgstr "%s: balant bekleme snr ald." #: lib/neon/ne_request.c:307 msgid "offset invalid" msgstr "" #: lib/neon/ne_request.c:312 #, fuzzy, c-format msgid "Could not seek to offset %s of request body file: %s" msgstr "%s dosyasna yazm yaplamad" #: lib/neon/ne_request.c:360 msgid "Could not send request body" msgstr "stek metni gnderilemedi" #: lib/neon/ne_request.c:699 msgid "Could not read chunk size" msgstr "Para boyutu renilemedi" #: lib/neon/ne_request.c:706 msgid "Could not parse chunk size" msgstr "Para boyutu anlalamad" #: lib/neon/ne_request.c:743 msgid "Could not read response body" msgstr "Yant metni okunamad" #: lib/neon/ne_request.c:759 #, fuzzy msgid "Could not read chunk delimiter" msgstr "Para boyutu renilemedi" #: lib/neon/ne_request.c:762 msgid "Chunk delimiter was invalid" msgstr "" #: lib/neon/ne_request.c:868 msgid "Could not read status line" msgstr "Durum satr okunamad" #: lib/neon/ne_request.c:890 #, fuzzy msgid "Could not parse response status line" msgstr "Durum satr anlalamad." #: lib/neon/ne_request.c:902 #, fuzzy msgid "Could not read interim response headers" msgstr "Yant metni okunamad" #: lib/neon/ne_request.c:936 msgid "Could not send request" msgstr "stek gnderilemedi" #: lib/neon/ne_request.c:984 lib/neon/ne_request.c:1002 #: lib/neon/ne_request.c:1012 msgid "Error reading response headers" msgstr "Yant balklar okunurken hata" #: lib/neon/ne_request.c:1030 msgid "Response header too long" msgstr "Yant bal ok uzun" #: lib/neon/ne_request.c:1112 msgid "Response exceeded maximum number of header fields" msgstr "" #: lib/neon/ne_request.c:1129 #, fuzzy, c-format msgid "Could not resolve hostname `%s': %s" msgstr "%s: Hata: %s sunucusunun adresi bulunamad.\n" #: lib/neon/ne_request.c:1260 msgid "Unknown transfer-coding in response" msgstr "" #: lib/neon/ne_request.c:1271 msgid "Invalid Content-Length in response" msgstr "" #: lib/neon/ne_request.c:1344 #, c-format msgid "Could not write to file: %s" msgstr "%s dosyasna yazm yaplamad" #: lib/neon/ne_request.c:1417 #, fuzzy, c-format msgid "Could not create SSL connection through proxy server: %s" msgstr "Ara sunucu zerinden SSL balants kurulamad" #: lib/neon/ne_request.c:1464 #, fuzzy msgid "Could not create socket" msgstr "SSL balants kurulamad" #: lib/neon/ne_request.c:1526 msgid "Could not connect to proxy server" msgstr "Ara sunucuyla balant kurulamad" #: lib/neon/ne_request.c:1527 msgid "Could not connect to server" msgstr "Sunucuyla balant kurulamad" #: lib/neon/ne_xml.c:280 #, fuzzy, c-format msgid "XML parse error at line %d: invalid element name" msgstr "" "%s: kurulum dosyasnda bozukluk var. satr %d:\n" "%s\n" #: lib/neon/ne_xml.c:452 #, fuzzy msgid "Unknown error" msgstr "Bilinmeyen sistem hatas" #: lib/neon/ne_xml.c:537 msgid "Invalid Byte Order Mark" msgstr "" #: lib/neon/ne_xml.c:625 #, fuzzy, c-format msgid "XML parse error at line %d: %s" msgstr "" "%s: kurulum dosyasnda bozukluk var. satr %d:\n" "%s\n" #: lib/neon/ne_props.c:371 lib/neon/ne_props.c:435 msgid "Response exceeds maximum property count" msgstr "" #: lib/neon/ne_compress.c:184 #, c-format msgid "%s: %s (code %d)" msgstr "" #: lib/neon/ne_compress.c:232 #, fuzzy msgid "Could not inflate data" msgstr "Dosya alamad: " #: lib/neon/ne_compress.c:293 #, fuzzy msgid "Could not initialize zlib" msgstr "Dosyaya yazm yaplamad: " #: lib/neon/ne_xmlreq.c:36 #, fuzzy, c-format msgid "Could not parse response: %s" msgstr "Yant metni okunamad" #: lib/neon/ne_basic.c:98 #, fuzzy, c-format msgid "Could not determine file size: %s" msgstr "Dosya alamad: " #: lib/neon/ne_basic.c:149 msgid "Response did not include requested range" msgstr "" #: lib/neon/ne_basic.c:183 msgid "Range is not satisfiable" msgstr "" #: lib/neon/ne_basic.c:188 #, fuzzy msgid "Resource does not support ranged GET requests" msgstr "Sunucu ksmi GET ilemini desteklemiyor." #: lib/neon/ne_auth.c:130 #, fuzzy, c-format msgid "Could not authenticate to server: %s" msgstr "Sunucuyla balant kurulamad" #: lib/neon/ne_auth.c:135 #, fuzzy, c-format msgid "Could not authenticate to proxy server: %s" msgstr "Ara sunucuyla balant kurulamad" #: lib/neon/ne_auth.c:358 #, c-format msgid "rejected %s challenge" msgstr "" #: lib/neon/ne_auth.c:374 msgid "missing realm in Basic challenge" msgstr "" #: lib/neon/ne_auth.c:469 msgid "invalid Negotiate token" msgstr "" #: lib/neon/ne_auth.c:492 msgid "GSSAPI authentication error: " msgstr "" #: lib/neon/ne_auth.c:505 #, c-format msgid "GSSAPI failure (code %u)" msgstr "" #: lib/neon/ne_auth.c:540 msgid "ignoring empty Negotiate continuation" msgstr "" #: lib/neon/ne_auth.c:555 msgid "Negotiate response verification failed: invalid response header token" msgstr "" #: lib/neon/ne_auth.c:577 #, c-format msgid "Negotiate response verification failure: %s" msgstr "" #: lib/neon/ne_auth.c:697 msgid "unknown algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:701 msgid "incompatible algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:705 msgid "missing parameter in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:709 msgid "initial Digest challenge was stale" msgstr "" #: lib/neon/ne_auth.c:716 msgid "stale Digest challenge with new algorithm or realm" msgstr "" #: lib/neon/ne_auth.c:728 #, fuzzy msgid "could not parse domain in Digest challenge" msgstr "Durum satr anlalamad." #: lib/neon/ne_auth.c:1036 msgid "Digest mutual authentication failure: missing parameters" msgstr "" #: lib/neon/ne_auth.c:1041 msgid "Digest mutual authentication failure: client nonce mismatch" msgstr "" #: lib/neon/ne_auth.c:1051 msgid "Digest mutual authentication failure: could not parse nonce count" msgstr "" #: lib/neon/ne_auth.c:1056 #, c-format msgid "Digest mutual authentication failure: nonce count mismatch (%u not %u)" msgstr "" #: lib/neon/ne_auth.c:1099 msgid "Digest mutual authentication failure: request-digest mismatch" msgstr "" #: lib/neon/ne_auth.c:1225 #, c-format msgid "ignored %s challenge" msgstr "" #: lib/neon/ne_auth.c:1304 #, fuzzy msgid "could not parse challenge" msgstr "Para boyutu anlalamad" #: lib/neon/ne_207.c:198 #, c-format msgid "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" msgstr "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" #: lib/neon/ne_locks.c:584 msgid "LOCK response missing Lock-Token header" msgstr "" #: lib/neon/ne_locks.c:759 #, c-format msgid "Response missing activelock for %s" msgstr "" #: lib/neon/ne_locks.c:801 #, c-format msgid "No activelock for <%s> returned in LOCK refresh response" msgstr "" #: lib/rpmatch.c:79 msgid "^[yY]" msgstr "^[eEyY]" #: lib/rpmatch.c:82 msgid "^[nN]" msgstr "^[hHnN]" #: lib/getopt.c:664 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: `%s' seeneini anlam belirsiz\n" #: lib/getopt.c:688 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: `--%s' seenei argman almyor\n" #: lib/getopt.c:693 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: `%c%s' seenei argman almyor\n" #: lib/getopt.c:710 lib/getopt.c:883 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: `%s' seeneine argman gerek\n" #: lib/getopt.c:739 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: `--%s' seenei bilinmiyor\n" #: lib/getopt.c:743 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: `%c%s' seenei bilinmiyor\n" #: lib/getopt.c:769 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: anlamsz seenek --%c\n" #: lib/getopt.c:772 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: geersiz seenek --%c\n" #: lib/getopt.c:802 lib/getopt.c:932 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: %c seeneine argman gerek\n" #: lib/getopt.c:849 #, fuzzy, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: `%s' seeneini anlam belirsiz\n" # msgid "%s: option `-W %s' is ambiguous\n" # msgstr "`-W %s' seeneinin anlam belirsiz\n" #: lib/getopt.c:867 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: `-W %s' seenei argman almyor\n" #, fuzzy #~ msgid "%s\n" #~ msgstr "%d\n" #, fuzzy #~ msgid "%s: %s" #~ msgstr "%s: Hata: %s\n" #~ msgid "%s: Aborted.\n" #~ msgstr "%s: Vazgeildi.\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal: %s (%d)\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: %s (%d) hatas sinyallendi: \n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal %d\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: %d numaral hata sinyallendi.\n" #~ msgid "%s: Cannot recover from segmentation fault, aborting.\n" #~ msgstr "%s: Sanal bellek hatasndan dn yok, vazgeiliyor.\n" #~ msgid "%s: Aborting update...\n" #~ msgstr "%s: Gncelletirmeden vazgeiliyor...\n" #~ msgid "%s: Terminating.\n" #~ msgstr "%s: Program kapanyor.\n" #, fuzzy #~ msgid " of request body file: %s" #~ msgstr "%s dosyasna yazm yaplamad" #~ msgid "Server was not authenticated correctly." #~ msgstr "Server was not authenticated correctly." #~ msgid "Proxy server was not authenticated correctly." #~ msgstr "Proxy server was not authenticated correctly." #, fuzzy #~ msgid "Error reading request body." #~ msgstr "stek metni gnderilirken hata" #, fuzzy #~ msgid "unknown error code" #~ msgstr "Bilinmeyen sistem hatas" #~ msgid "Error reading chunked response body" #~ msgstr "Paral yant metnini okurken hata" #~ msgid "document root" #~ msgstr "document root" #~ msgid "unknown element" #~ msgstr "unknown element" #~ msgid "unspecified" #~ msgstr "unspecified" #~ msgid "XML is not valid (%s found in parent %s)" #~ msgstr "Geersiz XML (%2$s'nin altnda %1$s bulundu)" #, fuzzy #~ msgid "Unknown XML element `%s (in %s)'" #~ msgstr "Bilinmeyen XML birimi `%s:%s'" #~ msgid "" #~ "The server did not authenticate itself correctly.\n" #~ "Report this error to your server administrator." #~ msgstr "" #~ "The server did not authenticate itself correctly.\n" #~ "Report this error to your server administrator." #~ msgid "" #~ "The proxy server did not authenticate itself correctly.\n" #~ "Report this error to your proxy server administrator." #~ msgstr "" #~ "The proxy server did not authenticate itself correctly.\n" #~ "Report this error to your proxy server administrator." #, fuzzy #~ msgid "Host `%s' not found" #~ msgstr "Sunucu bulunamad" #~ msgid "Host not found (try again later?)" #~ msgstr "Sunucu bulunamad (daha sonra tekrar denensin mi?)" #~ msgid "Host exists but has no address." #~ msgstr "Sunucu bulundu, ama adresi yok." #~ msgid "Non-recoverable error in resolver library." #~ msgstr "Adres ararken gveri dn olamayan bir hata ile karslald." #~ msgid "Malformed header line." #~ msgstr "Bozuk balk satr" #~ msgid "This application does not have SSL support." #~ msgstr "Bu programda SSL destei yok." #, fuzzy #~ msgid "Recent Changes" #~ msgstr "%s dosyasn deitir" #, fuzzy #~ msgid "Changed Items" #~ msgstr "%s dosyasn deitir" #, fuzzy #~ msgid "Deleted Items" #~ msgstr "%s dosyasn sil" #~ msgid "%s: Failed to fetch file listing for verification.\n" #~ msgstr "%s: Kontrol iin dosya listesi indirme baarsz oldu:\n" #~ msgid "%s: Verify indicates differences.\n" #~ msgstr "%s: Kontrol ilemi deiiklik olduunu gsteriyor.\n" sitecopy-0.16.6/po/cs.gmo0000664000076400007640000004074311037462356013337 0ustar joejoe, 0$"?b+#=!3:nFFD8>}+6:./i;5% &10Xe%<3R'.1d6tE4+&*R7}=:$.0S&q1U4JI'Q!y!2, 967pE/4SbG6~$,%<,b- &"(H h s577A'5i+$ $ . @ N a { !    !!;!V!m!.!! ! !! ! " "" *"8"H"Z"y"""" "V" ## %#0# K#W# g# r#B}# ## ###$#$ 8$D$1^$9$,$&$%3%i:%%)% % %%V%U& ^&l&r& x&&& && && &&&&& && '?':N( (%(%(*($!)AF))!)7))**A1*Cs*T*? +'L+t+;+>+3+;2,5n,+,,,2,h0-,-2-8-'2.3Z...y.;7/Vs/;/90+@07l0@080,15K1&1-1,1272;2E2DA3-3%3%3484,U47464C48554n55\F6E666767+Q7 }7(7+7,7# 8)D8+n888 88<8<+9<h9E9>9*:3:E:-T:&:: :: :::' ;!4;V;r;;;;;;<,1<^< z< << < < < < < < <!<= =*= <= G=XT=== === >>&>I.> x>"> >!>>> > ?)?.G?#v?-?? ?k? X@+f@@@@Y@ A 'A4A:A@AIARA [A hA rAA AAAAA A AA r>eCivK*U^D#:9?%T jm/|xp;Ey[L,w"]4\I!R=A Vhus3McQ&F'{tO} dbo@nP0Ya -BJ86gX(N. fH21l<ZS7_+)zGq$`~k5W Files will be moved remotely if moved locally. Passive mode FTP will not be used. Permissions: %s Symlinks: %s Protocol: %s Username: %s Remote directory: %s Local directory: %s Remote files will not be deleted. Changes to items in [brackets] are ignored during updates. Port: %s: %c%s site `%s' (on %s in %s) %s: %s cannot maintain symbolic links (site `%s'). %s: %s completed successfully. %s: %s unsupported for %s. %s: All the files and and directories are marked as updated remotely. %s: All the files and directories are marked as NOT updated remotely. %s: Can only check for renamed files when checksumming (site `%s'). %s: Cannot use a relative remote directory in %s (site `%s'). %s: Could not read directory for `%s': %s %s: Error: %s %s: Error: Corrupt site storage file for `%s': %s: %s %s: Error: Could not authorise user on proxy server (%s). %s: Error: Could not authorise user on server. %s: Error: Could not connect to proxy server (%s port %d). %s: Error: Could not connect to server (%s port %d). %s: Error: Could not open rcfile: %s %s: Error: Could not open rcfile: %s. %s: Error: Could not open storage directory: %s %s: Error: Could not open storage file for writing (%s) %s: Error: %s %s: Will not update site `%s'. %s: Error: Could not parse ~/.netrc. %s: Error: Could not resolve hostname of proxy server (%s). %s: Error: Could not resolve remote hostname (%s). %s: Error: Debug channel %s not known. %s: Error: Environment variable HOME not set. %s: Error: No site called `%s' found - skipping. %s: Error: No storage file for `%s'. %s: Use --init, --catchup or --fetch to create a storage file. %s: Error: Only specify ONE operation mode at a time. %s: Error: rcfile permissions allow other users to read your rcfile. %s: Error: storage directory permissions incorrect. %s: Error: ~/.netrc permissions incorrect. %s: Errors occurred while %s the %s site. %s: Failed to fetch file listing for site `%s': %s: %s %s: Failed to fetch file listing to verify site `%s': %s: %s %s: File permissions are not supported in %s (site `%s'). %s: Invalid port used in site `%s'. %s: Local directory not specified in site `%s'. %s: No sites specified. %s: No valid sites specified. %s: Nothing to do - no changes found. %s: Refusing to delete all local files with a synchronize operation. %s: Use --update to update the remote site. %s: Remote directory not specified in site `%s'. %s: Remote site not synchronized with stored state. %s: Safe mode cannot be used in conjunction with nooverwrite (site `%s'). %s: Safe mode cannot be used in conjunction with tempupload (site `%s'). %s: Server not specified in site `%s'. %s: Set the permissions to 0600. %s: Set the permissions to 0700. %s: Skipping site `%s'. %s: The protocol `%s' is unsupported (site `%s'). %s: The remote site does not need updating. %s: The remote site needs updating (%d items to update). %s: The remote site needs updating (1 item to update). %s: Unhandled error %d in site `%s' - please contact the maintainer. %s: Verify found %d files missing from server. %s: Warning: Could not open `%s' to use as logfile. %s: Warning: Current state method differs from stored in site `%s'. %s: All existing files will appear changed (use catchup?). %s: Warning: Only %d sites can be specified on the command line! Extra entries are being skipped. %s: You need to create this directory and set the permissions to 0700. %s: connection timed out.%s: connection was closed by server.%s: illegal option -- %c %s: invalid option -- %c %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: rcfile corrupt at line %d: %s %s: unrecognized option `%c%s' %s: unrecognized option `--%s' (default) (unspecified)* These items have been added since the last update: * These items have been changed since the last update: * These items have been deleted since the last update: * These items have been deleted, but will be left on the server: * These items have been moved since the last update: ? (y/n) Added on serverAlways maintainedAuthentication required for %s on %s `%s': Authentication required on %s `%s': Catch upChange %sChanged on serverChanging %s: Checksumming %s: [Could not access resourceCould not checksum fileCould not connect to proxy serverCould not connect to serverCould not examine file.Could not parse chunk sizeCould not read chunk sizeCould not read response bodyCould not read status lineCould not send requestCould not send request bodyCould not set modification time of local file.Could not write to file: %sCreate %sCreate %s/Creating %s/: Creating %s: Delete %sDelete %s/Deleting %s/: Deleting %s: Directory: %s/ Downloading %s: [Error reading response headersFetchFollowedHost not foundIgnoredInitializeInvalid HTTP status line in status element at line %d of response: Status line was: %sLine too longLink: %s - target %s MaintainedMaintained for executablesMove %s->%sMoving %s->%s: Options: Password: Remote file has been modified - not overwriting with local changesRemove %sResponse header too longRetrying: [SSL support has not be compiled in.Show changes toSite: %s Server: %sSynchronizeThe connection timed out.The server does not appear to be a WebDAV server.The server does not support the executable live property.The target of the symlink could not be read.Try `%s --help' for more information. Unknown system errorUpdateUpload succeeded, but could not retrieve modification time. If this message persists, turn off safe mode.Uploading %s: [Usage: %s [OPTIONS] [MODE] [sitename]... Username: Username: %s VerifyYou should never see this message. Please contact the maintainer at sitecopy@lyra.org ] done. ] failed: %s ^[nN]^[yY]catching updir:done. failed: %s fetchinginitializinglocalproxy serverremoteservershowing changes tostoredsynchronizingupdatingverifyingProject-Id-Version: sitecopy 0.11.4 Report-Msgid-Bugs-To: sitecopy@lyra.org POT-Creation-Date: 2008-07-16 16:31+0100 PO-Revision-Date: 2002-04-09 11:12+0100 Last-Translator: Petr Prazak Language-Team: cz MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit Soubory pesunut lokln budou tak pesunuty vzdlen. Pasvn md FTP nebude pouit. Prva: %s Symbolick odkazy: %s Protokol: %s Jmno uivatele: %s Vzdlen adres: %s Mstn adres: %s Vzdlen soubory nebudou vymazny. Zmny poloek v [zvorkch] jsou bhem aktualizace ignorovny. Port: %s: %c%s msta `%s' (na %s v %s) %s: %s neme udrovat symbolick odkazy (msto `%s'). %s: %s spn dokonena. %s: Akce "%s" nen implementovna pro %s. %s: Vechny soubory a adrese jsou oznaeny jako aktualizovan. %s: Vechny soubory a adrese jsou oznaeny jako NEaktualizovan. %s: Pesunut soubory lze zjistit pouze s zapnutm kontrolnm soutem (msto `%s'). %s: Nelze pouit relativn vzdlen adres v %s (msto `%s'). %s: Nelze nast adres pro `%s': %s %s: Chyba: %s %s: Chyba: Poruen ukldac soubor pro msto `%s': %s: %s %s: Chyba: Nelze autorizovat uivatele na proxy serveru (%s). %s: Chyba: Nelze autorizovat uivatele na serveru. %s: Chyba: Nelze se pipojit k proxy serveru (%s port %d). %s: Chyba: Nelze se pipojit k serveru (%s port %d). %s: Chyba: Nelze otevt dic soubor: %s %s: Chyba: Nelze otevt dic soubor: %s. %s: Chyba: Nelze otevt adres pro ukldn: %s %s: Chyba: Nalze zapisovat do ukldacho souboru (%s) %s: Chyba: %s %s: Nebudu aktualizovat msto `%s'. %s: Chyba: Nelze zpracovat soubor ~/.netrc. %s: Chyba: Nelze najt adresu proxy serveru (%s). %s: Chyba: Nelze najt adresu vzdlenho potae (%s). %s: Chyba: Ladic kanl %s nen znm. %s: Chyba: Promnn prosted HOME nen nastavena. %s: Chyba: Msto '%s' nenalezeno / peskakuji %s: Chyba: Pro `%s' nenalezen ukldac soubor. %s: Pro jeho vytvoen pouijte pepnae --init, --catchup nebo --fetch. %s: Chyba: Specifikujte najednou pouze JEDEN operan md. %s: Chyba: Prva pstupu k dicmu souboru dovoluj ostatnm uivatelm jeho ten. %s: Chyba: Nesprvn prvo pstupu adrese pro ukldn. %s: Chyba: Nesprvn prva pstupu k souboru ~/.netrc . %s: Bhem %s %sho msta se vyskytly chyby. %s: Nelze zskat seznam soubor pro msto `%s': %s: %s %s: Nelze zskat seznam soubor pro kontrolu msta `%s': %s: %s %s: V %s nejsou prva soubor podporovny (msto `%s'). %s: Pro msto `%s' je pouit neplatn port. %s: Pro msto `%s' nen specifikovn mstn adres. %s: dn msta nebyla specifikovna. %s: dn platn msta nebyla specifikovna. %s: Nen co dlat - dn zmny nenalezeny. %s: Odmtm smazat vechny lokln soubory operac synchronizace. %s: Pouijte pepna --update pro aktualizaci vzdlenho msta. %s: Pro msto `%s' nen specifikovn vzdlen adres. %s: Vzdlen msto nen synchronizovno s uloenm stavem. %s: Bezpen md nelze pout ve spojen s nooverwrite (msto `%s'). %s: Bezpen md nelze pout ve spojen s tempupload (msto `%s'). %s: Pro msto `%s' nen specifikovn server. %s: Nastavte prva pstupu na 0600. %s: Nastavte prva pstupu na 0700. %s: Peskakuji msto `%s'. %s: V %s nejsou prva soubor podporovny (msto `%s'). %s: Vzdlen msto nen nutno aktualizovat. %s: Vzdlen msto je nutno aktualizovat (%d poloek). %s: Vzdlen msto je nutno aktualizovat (1 poloka). %s: Neoeten chyba %d v mst `%s' - kontaktujte prosm sprvce. %s: Kontrola nalezla %d soubor chybjcch na serveru. %s: Varovn: Nelze otevt soubor `%s' pro zznam. %s: Varovn: Souasn metoda pro uloen stavu se li od metody uloen v mst `%s'. %s: Vechny existujc soubory budou vykazovat zmny (pouijte catchup?). %s: Varovn: na pkazov dce lze specifikovat pouze %d mst ! Peskakuji dal poloky. %s: Muste tento adres vytvoit a nastavit prva pstupu na 0700. %s: spojen vyprelo.%s: server ukonil spojen.%s: nesprvn volba -- %c %s: nesprvn volba -- %c %s: volba `%c%s' nedovoluje dn parametr %s: volba `%s' nen jednoznan %s: volba `%s' vyaduje njak parametr %s: volba `--%s' nedovoluje dn parametr %s: volba `-W %s' nedovoluje dn parametr %s: volba `-W %s' nen jednoznan %s: volba vyaduje njak parametr -- %c %s: dic soubor pokozen na dku %d: %s %s: neznm volba `%c%s' %s: neznm volba `--%s' (standardn) (nespecifikovno)* Nsledujc poloky byly pidny od posledn aktualizace: * Nsledujc poloky byly zmnny od posledn aktualizace: * Nsledujc poloky byly smazny od posledn aktualizace: * Nsledujc poloky byly vymazny, ale budou ponechny na serveru: * Nsledujc poloky byly pesunuty od posledn aktualizace: ? (a/n) Pidno na serverVdy udrovnyJe vyadovna autentizace pro %s na %s `%s': Je vyadovna autentizace na %s `%s': DohnnZmnit %sZmnno na serveruMnm %s: Kontroln souet %s: [Nelze pistupovat ke zdrojiNelze spotat kontroln souet souboruNelze se pipojit k proxy serveruNelze se pipojit k serveruNelze prozkoumat soubor.Nelze zpracovat velikost blokuNelze nast velikost blokuNelze nast tlo odpovdiNelze pest stavov dekNelze poslat poadavekNelze odeslat tlo poadavkuNelze nastavit as zmny pro lokln soubor.Nelze zapsat do souboru: %sVytvoit %sVytvoit %s/Vytvm %s/: Vytvm %s: Smazat %sSmazat %s/Mau %s/: Mau %s: Adres: %s/ Stahuji %s: [Chyba pi ten hlaviek odpovdiStaenSledovnyPota nenalezenIgnorovnyInicializaceNeplatn dka HTTP stavu ve stavovm prvku na dku %d odpovdi: Stavov dka byla: %sdek je pli dlouhOdkaz: %s - cl %s UdrovnyUdrovny pro programyPesunout %s->%sPesunuji %s->%s: Volby: Heslo: Vzdlen soubor byl modifikovn - nebudu jej pepisovat loklnmi zmnamiOdstranit %sHlavika odpovdi je pli dlouhOpakuji: [Podpora SSL nebyla zakompilovna.Zobrazen zmn proMsto: %s Server: %sSynchonizaceSpojen vyprelo.Nezd se, e by server podporoval WebDAV.Server nepodporuje 'executable live property'.Nelze st cl symbolickho odkazu.Vce informac zskte pkazem `%s --help'. Neznm systmov chybaAktualizacePosln soubor usplo, ale nen mon zskat as zmny. Pokud tato zprva petrvv, vypnte bezpen md.Poslm %s: [Pouit: %s [VOLBY] [MD] [jmno msta]... Jmno uivatele: Jmno uivatele: %s KontrolaTuhle zprvu byste nemli vidt.. Kontaktujte prosm sprvce na adrese sitecopy@lyra.org ] hotovo. ] chyba: %s ^[nN]^[aA]dohnnadres:hotovo. selhalo: %s stahovninicializaceloklnproxy serveruvzdlenserveruzobrazen zmn prouloensynchonizaceaktualizacekontrolysitecopy-0.16.6/po/ru.gmo0000664000076400007640000001403611037462357013355 0ustar joejoe> SH$I"n++%&;0b%.1E4`+$0&1>'p!!,b Gl   ,  %3 ,Y - &   5< 7r 7 5  # 2 < G V d t   &   ) , 5 C H O ?[ +0".JS.W9:5012b6i964pA-3.I.x%%,q M (G2g()#3#E#iDCBEY     '4@I-    8(0:.3*9&>/=;!"1)<%5$ ,#+ 6 4 -'27 Passive mode FTP will not be used. Permissions: %s Symlinks: %s Protocol: %s Username: %s Remote directory: %s Local directory: %s Port: %d %s: Could not read directory for `%s': %s %s: Error: Could not open rcfile: %s %s: Error: Could not open rcfile: %s. %s: Error: Could not open storage directory: %s %s: Error: Could not parse ~/.netrc. %s: Error: Environment variable HOME not set. %s: Error: No site called `%s' found - skipping. %s: Error: rcfile permissions allow other users to read your rcfile. %s: Error: storage directory permissions incorrect. %s: Error: ~/.netrc permissions incorrect. %s: Invalid port used in site `%s'. %s: Local directory not specified in site `%s'. %s: Nothing to do - no changes found. %s: Remote directory not specified in site `%s'. %s: Server not specified in site `%s'. %s: Set the permissions to 0600. %s: Set the permissions to 0700. %s: The remote site does not need updating. %s: Warning: Only %d sites can be specified on the command line! Extra entries are being skipped. %s: You need to create this directory and set the permissions to 0700. %s: illegal option -- %c %s: invalid option -- %c %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: unrecognized option `%c%s' %s: unrecognized option `--%s' * These items have been added since the last update: * These items have been changed since the last update: * These items have been deleted since the last update: * These items have been moved since the last update: Create %s/Creating %s/: Delete %sDelete %s/Deleting %s/: Deleting %s: Directory: %s/ Downloading %s: [Moving %s->%s: Options: Site: %s Server: %sTry `%s --help' for more information. Unknown system errorUploading %s: [Usage: %s [OPTIONS] [MODE] [sitename]... ] done. ] failed: %s dir:done. failed: %s Project-Id-Version: sitecopy 0.11.5 Report-Msgid-Bugs-To: sitecopy@lyra.org POT-Creation-Date: 2008-07-16 16:31+0100 PO-Revision-Date: 2002-11-11 14:28+0000 Last-Translator: Michael Sobolev Language-Team: ru MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit FTP . : %s : %s : %s : %s : %s : %s : %d %s: `%s': %s %s: : : %s %s: : : %s. %s: : : %s %s: : ~/.netrc. %s: : HOME. %s: : %s -- . %s: : . %s: : . %s: : ~/.netrc . %s: `%s' Port. %s: `%s' Local. %s: -- . %s: `%s' Remote. %s: `%s' Server. %s: 0600. %s: 0700. %s: . %s: : %d ! . %s: 0700. %s: -- %c %s: -- %c %s: `%c%s' %s: `%s' %s: `%s' %s: `--%s' %s: `-W %s' %s: `-W %s' %s: -- %c %s: `%c%s' %s: `--%s' * : * : * : * : %s/ %s/: %s %s/ %s/: %s: : %s/ %s: [ %s->%s: : : %s : %s `%s --help' . %s: [: %s [] [] [sitename]... ] . ] : %s :. : %s sitecopy-0.16.6/po/quot.sed0000664000076400007640000000023110165765223013677 0ustar joejoes/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g sitecopy-0.16.6/po/fr.po0000664000076400007640000014052511037413774013174 0ustar joejoe# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: sitecopy 0.9.3\n" "Report-Msgid-Bugs-To: sitecopy@lyra.org\n" "POT-Creation-Date: 2008-07-16 16:31+0100\n" "PO-Revision-Date: 2000-01-31 00:00+0100\n" "Last-Translator: Sylvain Glaize \n" "Language-Team: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=latin-1\n" "Content-Transfer-Encoding: 8bit\n" #: src/console_fe.c:119 msgid "Show changes to" msgstr "Montrer les changements sur" #: src/console_fe.c:119 msgid "showing changes to" msgstr "changements sur" #: src/console_fe.c:119 src/console_fe.c:120 msgid "local" msgstr "local" #: src/console_fe.c:120 msgid "Synchronize" msgstr "Synchroniser" #: src/console_fe.c:120 msgid "synchronizing" msgstr "synchronisation" #: src/console_fe.c:125 msgid "Fetch" msgstr "Recuprer" #: src/console_fe.c:125 msgid "fetching" msgstr "recupration" #: src/console_fe.c:125 src/console_fe.c:126 src/console_fe.c:127 msgid "remote" msgstr "distant" #: src/console_fe.c:126 gnome/init.c:198 msgid "Update" msgstr "Mise jour" #: src/console_fe.c:126 msgid "updating" msgstr "mise jour en cours" #: src/console_fe.c:127 msgid "Verify" msgstr "Vrifier" #: src/console_fe.c:127 msgid "verifying" msgstr "vrification" #: src/console_fe.c:128 msgid "Catch up" msgstr "Ratraper" #: src/console_fe.c:128 msgid "catching up" msgstr "ratrapage" #: src/console_fe.c:128 src/console_fe.c:129 msgid "stored" msgstr "archiv" #: src/console_fe.c:129 msgid "Initialize" msgstr "Initialiser" #: src/console_fe.c:129 msgid "initializing" msgstr "initialisation" #: src/console_fe.c:134 msgid "" "You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n" msgstr "" "Vous ne devriez jamais voir ce message.\n" "Contactez sitecopy@lyra.org s'il vous plait\n" #: src/console_fe.c:196 #, c-format msgid "%s: Error: No site called `%s' found - skipping.\n" msgstr "%s: Erreur: Aucun site du nom de `%s' trouv - site ignor.\n" #: src/console_fe.c:214 #, c-format msgid "%s: No valid sites specified.\n" msgstr "%s: Aucun site valide spcifi.\n" #: src/console_fe.c:216 #, c-format msgid "%s: No sites specified.\n" msgstr "%s: Aucun site spcifi.\n" #: src/console_fe.c:218 src/console_fe.c:369 src/console_fe.c:529 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Essayez `%s --help' pour plus d'informations.\n" #: src/console_fe.c:228 #, c-format msgid "%s: %c%s site `%s' (on %s in %s)\n" msgstr "%s: %c%s le site `%s' (sur %s dans %s)\n" #: src/console_fe.c:249 #, c-format msgid "* These items have been added since the last update:\n" msgstr "* Ces entres ont t ajoutes depuis la dernire mise jour:\n" #: src/console_fe.c:254 src/console_fe.c:285 #, c-format msgid "dir:" msgstr "rp:" #: src/console_fe.c:261 #, c-format msgid "* These items have been changed since the last update:\n" msgstr "* Ces entres ont t modifies depuis la dernire mise jour.\n" #: src/console_fe.c:263 #, c-format msgid " Changes to items in [brackets] are ignored during updates.\n" msgstr " Les changements des objets entre [crochets] sont ignors durant la mise jour.\n" #: src/console_fe.c:277 #, c-format msgid "* These items have been deleted, but will be left on the server:\n" msgstr "* Ces objets ont t dtruits, mais seront laisss sur le serveur:\n" #: src/console_fe.c:279 #, c-format msgid "* These items have been deleted since the last update:\n" msgstr "* Ces objets ont t dtruits depuis la dernire mise jour:\n" #: src/console_fe.c:292 #, c-format msgid "* These items have been moved since the last update:\n" msgstr "* Ces objets ont t dplacs depuis la dernire mise jour:\n" #: src/console_fe.c:310 src/console_fe.c:322 #, fuzzy msgid "Ignored" msgstr "archiv" #: src/console_fe.c:312 msgid "Maintained for executables" msgstr "" #: src/console_fe.c:314 msgid "Always maintained" msgstr "" #: src/console_fe.c:324 msgid "Maintained" msgstr "" #: src/console_fe.c:326 msgid "Followed" msgstr "" #: src/console_fe.c:337 #, c-format msgid "" "Site: %s\n" "\tServer: %s" msgstr "" "Site: %s\n" "\tServeur: %s" #: src/console_fe.c:339 #, c-format msgid " Port: " msgstr " Port: " #: src/console_fe.c:341 #, c-format msgid "(default)\n" msgstr "" #: src/console_fe.c:343 #, c-format msgid "%d\n" msgstr "%d\n" #: src/console_fe.c:345 #, c-format msgid "\tProtocol: %s Username: %s\n" msgstr "\tProtocol: %s Utilisateur: %s\n" #: src/console_fe.c:348 msgid "(unspecified)" msgstr "" #: src/console_fe.c:350 #, c-format msgid "\tPassive mode FTP will not be used.\n" msgstr "\tLe FTP en mode passif ne sera pas utilis.\n" #: src/console_fe.c:351 #, c-format msgid "" "\tRemote directory: %s\n" "\tLocal directory: %s\n" msgstr "" "\tRpertoire distant: %s\n" "\tRpertoire local: %s\n" #: src/console_fe.c:353 #, c-format msgid "\tPermissions: %s Symlinks: %s\n" msgstr "\tPermissions: %s Liens symboliques: %s\n" #: src/console_fe.c:356 #, c-format msgid "\tRemote files will not be deleted.\n" msgstr "\tLes fichiers distants ne seront pas dtruits.\n" #: src/console_fe.c:358 #, c-format msgid "\tFiles will be moved remotely if moved locally.\n" msgstr "\tLes fichiers seront dplacs distance s'ils ont t dplacs localement.\n" #: src/console_fe.c:367 #, c-format msgid "%s: Error: Only specify ONE operation mode at a time.\n" msgstr "" #: src/console_fe.c:489 #, c-format msgid "%s: Error: Debug channel %s not known.\n" msgstr "" #: src/console_fe.c:497 #, fuzzy, c-format msgid "%s: Warning: Could not open `%s' to use as logfile.\n" msgstr "%s: Erreur: impossible d'ouvrir le fichier de ressources: %s.\n" #: src/console_fe.c:540 #, c-format msgid "%s: Error: Dry run mode is currently only supported for updates.\n" msgstr "" #: src/console_fe.c:556 #, c-format msgid "" "%s: Warning: Only %d sites can be specified on the command line!\n" "Extra entries are being skipped.\n" msgstr "" "%s: Attention: Seuls %d sites peuvent tre spcifis sur la ligne de commande!\n" "Les entres supplmentaires sont ignores.\n" #: src/console_fe.c:581 msgid "WARNING: Server certificate is not trusted." msgstr "" #: src/console_fe.c:584 #, c-format msgid "Certificate was issued for server `%s'.\n" msgstr "" #: src/console_fe.c:586 msgid "WARNING: Certificate does not specify a server" msgstr "" #: src/console_fe.c:588 #, c-format msgid "Fingerprint: %s\n" msgstr "" #: src/console_fe.c:591 #, c-format msgid "Issued to: %s\n" msgstr "" #: src/console_fe.c:595 #, c-format msgid "Issued by: %s\n" msgstr "" #: src/console_fe.c:598 #, c-format msgid "Do you wish to accept this certificate? (y/n) " msgstr "" #: src/console_fe.c:607 msgid "server" msgstr "" #: src/console_fe.c:607 msgid "proxy server" msgstr "" #: src/console_fe.c:613 #, c-format msgid "Authentication required for %s on %s `%s':\n" msgstr "" #: src/console_fe.c:616 #, c-format msgid "Authentication required on %s `%s':\n" msgstr "" #: src/console_fe.c:619 msgid "Username: " msgstr "" #: src/console_fe.c:624 #, fuzzy, c-format msgid "Username: %s\n" msgstr "\tProtocol: %s Utilisateur: %s\n" #: src/console_fe.c:626 src/console_fe.c:650 msgid "Password: " msgstr "" #: src/console_fe.c:636 #, fuzzy, c-format msgid "Retrying: [" msgstr "vrification" #: src/console_fe.c:647 #, c-format msgid "%s: Encrypted client certificate configured%s%s.\n" msgstr "" #: src/console_fe.c:682 #, c-format msgid "Create %s/" msgstr "Cr %s/" #: src/console_fe.c:684 #, c-format msgid "Delete %s/" msgstr "Efface %s/" #: src/console_fe.c:692 #, fuzzy, c-format msgid "Upload %s (%s bytes)" msgstr "Envoie %s" #: src/console_fe.c:694 #, c-format msgid "Delete %s" msgstr "Efface %s" #: src/console_fe.c:695 #, c-format msgid "Move %s->%s" msgstr "Dplace %s->%s" #: src/console_fe.c:699 #, c-format msgid "" "%s: in fe_can_update/file_file\n" "%s" msgstr "" "%s: dans fe_can_update/file_file\n" "%s" #: src/console_fe.c:706 #, c-format msgid "Change %s" msgstr "Change %s" #: src/console_fe.c:707 #, c-format msgid "Create %s" msgstr "Cr %s" #: src/console_fe.c:708 #, c-format msgid "Remove %s" msgstr "Enlve %s" #: src/console_fe.c:711 #, c-format msgid "" "%s: in fe_can_update/file_link\n" "%s" msgstr "" "%s: dans fe_can_update/file_link\n" "%s" #: src/console_fe.c:717 #, c-format msgid "? (y/n) " msgstr "? (y=oui/n=non)" #: src/console_fe.c:726 #, c-format msgid "Checksumming %s: [" msgstr "Calcul de la somme de contrle %s: [" #: src/console_fe.c:741 src/console_fe.c:852 src/console_fe.c:913 #, c-format msgid "] done.\n" msgstr "] fait.\n" #: src/console_fe.c:743 src/console_fe.c:915 #, c-format msgid "" "] failed:\n" "%s\n" msgstr "" "] chou:\n" "%s\n" #: src/console_fe.c:753 #, fuzzy, c-format msgid "Setting permissions on %s%s: " msgstr "Placement des permissions sur %s: " #: src/console_fe.c:763 src/console_fe.c:841 src/console_fe.c:907 #, c-format msgid "done.\n" msgstr "fait.\n" #: src/console_fe.c:765 src/console_fe.c:909 #, fuzzy, c-format msgid "" "failed:\n" "%s\n" msgstr "" "] chou:\n" "%s\n" #: src/console_fe.c:784 src/console_fe.c:871 #, c-format msgid "Creating %s/: " msgstr "Cration de %s/: " #: src/console_fe.c:786 src/console_fe.c:873 #, c-format msgid "Deleting %s/: " msgstr "Effacement de %s/: " #: src/console_fe.c:793 #, c-format msgid "Uploading %s: [" msgstr "Mise jour de %s: [" #: src/console_fe.c:796 src/console_fe.c:815 src/console_fe.c:883 #, c-format msgid "Deleting %s: " msgstr "Effacement de %s: " #: src/console_fe.c:799 src/console_fe.c:886 #, c-format msgid "Moving %s->%s: " msgstr "Dplacement %s->%s: " #: src/console_fe.c:803 #, c-format msgid "" "%s: in fe_updating/file_file\n" "%s" msgstr "" "%s: dans fe_updating/file_file\n" "%s" #: src/console_fe.c:811 #, c-format msgid "Changing %s: " msgstr "Changement de %s: " #: src/console_fe.c:813 #, c-format msgid "Creating %s: " msgstr "Cration de %s: " #: src/console_fe.c:817 #, c-format msgid "" "%s: in fe_updating/file_link\n" "%s" msgstr "" "%s: dans fe_updating/file_link\n" "%s" #: src/console_fe.c:834 #, fuzzy, c-format msgid "Failed to update %s:%c%s\n" msgstr "" "Mise jour choue sur %s:\n" "%s\n" #: src/console_fe.c:843 #, fuzzy, c-format msgid "failed:%c%s\n" msgstr "" "] chou:\n" "%s\n" #: src/console_fe.c:855 #, fuzzy, c-format msgid "] failed:%c%s\n" msgstr "" "] chou:\n" "%s\n" #: src/console_fe.c:880 #, c-format msgid "Downloading %s: [" msgstr "Chargement de %s: [" #: src/console_fe.c:925 #, fuzzy msgid "Changed on server" msgstr "Change %s" #: src/console_fe.c:928 msgid "Added on server" msgstr "" #: src/console_fe.c:936 #, fuzzy, c-format msgid "%s: %s\n" msgstr "" "%s: dans issue_error\n" "%s" #: src/console_fe.c:956 #, c-format msgid "Directory: %s/\n" msgstr "Rpertoire: %s/\n" #: src/console_fe.c:961 #, fuzzy, c-format msgid "File: %s - size %s%s\n" msgstr "Fichier: %s - taille %ld\n" #: src/console_fe.c:963 msgid " (ASCII)" msgstr "" #: src/console_fe.c:966 #, c-format msgid "Link: %s - target %s\n" msgstr "Lien: %s - cible %s\n" #: src/console_fe.c:979 gnome/init.c:402 #, c-format msgid "%s: Error: Could not open rcfile: %s.\n" msgstr "%s: Erreur: impossible d'ouvrir le fichier de ressources: %s.\n" #: src/console_fe.c:983 gnome/init.c:407 #, c-format msgid "" "%s: rcfile corrupt at line %d:\n" "%s\n" msgstr "" "%s: erreur dans le fichier de ressources la ligne %d:\n" "%s\n" #: src/console_fe.c:1002 #, c-format msgid "" "%s: Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: Impossible de lire le rpertoire pour `%s':\n" "\t%s\n" #: src/console_fe.c:1006 #, c-format msgid "%s: Server not specified in site `%s'.\n" msgstr "%s: serveur non spcifi sur le site `%s'.\n" #: src/console_fe.c:1010 #, c-format msgid "%s: Remote directory not specified in site `%s'.\n" msgstr "%s: rpertoire distant non spcifie sur le site `%s'.\n" #: src/console_fe.c:1014 #, c-format msgid "%s: Local directory not specified in site `%s'.\n" msgstr "%s: rpertoire local non spcifi sur le site `%s'.\n" #: src/console_fe.c:1018 #, c-format msgid "%s: Invalid port used in site `%s'.\n" msgstr "%s: port invalide utilis sur le site `%s'.\n" #: src/console_fe.c:1022 #, c-format msgid "%s: %s cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s ne peut pas garder les liens symboliques (site `%s').\n" #: src/console_fe.c:1026 #, c-format msgid "%s: Cannot use a relative remote directory in %s (site `%s').\n" msgstr "%s: Ne peut pas utiliser de rpertoire relatif sur %s (site `%s').\n" #: src/console_fe.c:1029 #, c-format msgid "%s: File permissions are not supported in %s (site `%s').\n" msgstr "%s: les permissions de fichier ne sont pas support sur %s (site `%s').\n" #: src/console_fe.c:1032 #, fuzzy, c-format msgid "" "%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n" msgstr "%s: le mode scuris ne peut pas tre utilis avec le remplacement de fichiers (site `%s').\n" #: src/console_fe.c:1035 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n" msgstr "%s: le mode scuris ne peut pas tre utilis avec la mise jour temporaire (site `%s').\n" #: src/console_fe.c:1038 #, c-format msgid "%s: Can only check for renamed files when checksumming (site `%s').\n" msgstr "%s: peut seulement vrifier les fichiers renomms lors du calcul de la somme de contrle (site %s).\n" #: src/console_fe.c:1041 #, fuzzy, c-format msgid "%s: The protocol `%s' is unsupported (site `%s').\n" msgstr "%s: les permissions de fichier ne sont pas support sur %s (site `%s').\n" #: src/console_fe.c:1048 #, c-format msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" msgstr "%s: erreur non trait %d sur le site `%s' - contactez le responsable du projet s'il vous plait.\n" #: src/console_fe.c:1066 #, fuzzy, c-format msgid "" "%s: Error: Corrupt site storage file for `%s':\n" "%s: %s\n" msgstr "%s: erreur: fichier de mise jour corrompu sur `%s'.\n" #: src/console_fe.c:1075 #, c-format msgid "" "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n" msgstr "" "%s: erreur: aucun fichier de mise jour pour `%s'.\n" "%s: utilisez --init, --catchup ou --fetch pour crer ce fichier.\n" #: src/console_fe.c:1088 #, c-format msgid "%s: Skipping site `%s'.\n" msgstr "%s: ignore le site `%s'.\n" #: src/console_fe.c:1103 #, c-format msgid "%s: %s completed successfully.\n" msgstr "%s: %s. Succs.\n" #: src/console_fe.c:1109 #, fuzzy, c-format msgid "%s: %s unsupported for %s.\n" msgstr "%s: %s non implment pour %s.\n" #: src/console_fe.c:1114 #, c-format msgid "%s: Errors occurred while %s the %s site.\n" msgstr "%s: des erreurs ont eu lieu lors du traitement (%s) sur le site %s.\n" #: src/console_fe.c:1119 #, fuzzy, c-format msgid "%s: Error: Could not resolve remote hostname (%s).\n" msgstr "%s: erreur: impossible de trouver le nom de l'hte distant.\n" #: src/console_fe.c:1125 #, fuzzy, c-format msgid "%s: Error: Could not resolve hostname of proxy server (%s).\n" msgstr "%s: erreur: impossible de trouver le nom de l'hte distant.\n" #: src/console_fe.c:1131 #, fuzzy, c-format msgid "%s: Error: Could not connect to proxy server (%s port %d).\n" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: src/console_fe.c:1134 #, fuzzy, c-format msgid "%s: Error: Could not connect to server (%s port %d).\n" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: src/console_fe.c:1140 #, c-format msgid "%s: Error: Could not authorise user on server.\n" msgstr "%s: erreur: impossible d'entrer sur le serveur avec cet utilisateur.\n" #: src/console_fe.c:1145 #, fuzzy, c-format msgid "%s: Error: %s\n" msgstr "" "%s: dans issue_error\n" "%s" #: src/console_fe.c:1149 #, fuzzy, c-format msgid "%s: Error: Could not authorise user on proxy server (%s).\n" msgstr "%s: erreur: impossible d'entrer sur le serveur avec cet utilisateur.\n" #: src/console_fe.c:1154 #, c-format msgid "" "%s: in issue_error\n" "%s" msgstr "" "%s: dans issue_error\n" "%s" #: src/console_fe.c:1168 #, c-format msgid "%s: Error: Environment variable HOME not set.\n" msgstr "%s: erreur: la variable d'environnement HOME n'est pas dtermine.\n" #: src/console_fe.c:1176 #, c-format msgid "%s: Error: Could not open rcfile: %s\n" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/console_fe.c:1179 #, c-format msgid "%s: Error: rcfile permissions allow other users to read your rcfile.\n" msgstr "%s: erreur: les permissions sur votre fichier de ressources permet d'autres utilisateurs de le lire.\n" #: src/console_fe.c:1180 src/console_fe.c:1192 #, c-format msgid "%s: Set the permissions to 0600.\n" msgstr "%s: changez les permissions en 0600.\n" #: src/console_fe.c:1183 #, c-format msgid "%s: Error: Could not open storage directory: %s\n" msgstr "%s: erreur: impossible d'ouvrir le fichier de mise jour: %s\n" #: src/console_fe.c:1184 #, c-format msgid "" "%s: You need to create this directory and set the permissions to 0700.\n" msgstr "%s: vous devez crer ce rpertoire et changer ses permissions en 0700.\n" #: src/console_fe.c:1187 #, c-format msgid "%s: Error: storage directory permissions incorrect.\n" msgstr "%s: erreur: permissions du rpertoire du fichier de mise jour incorrect.\n" #: src/console_fe.c:1188 #, c-format msgid "%s: Set the permissions to 0700.\n" msgstr "%s: changez les permissions en 0700.\n" #: src/console_fe.c:1191 #, c-format msgid "%s: Error: ~/.netrc permissions incorrect.\n" msgstr "%s: erreur: permissions de ~/.netrc incorrectes.\n" #: src/console_fe.c:1197 #, c-format msgid "" "%s: init_paths gave %d\n" "%s" msgstr "" "%s: init_paths a donn %d\n" "%s" #: src/console_fe.c:1204 #, c-format msgid "%s: Error: Could not parse ~/.netrc.\n" msgstr "%s: erreur: impossible de comprendre ~/.netrc.\n" #: src/console_fe.c:1222 src/console_fe.c:1321 #, c-format msgid "%s: Nothing to do - no changes found.\n" msgstr "%s: rien faire - aucune modification trouve.\n" #: src/console_fe.c:1231 #, c-format msgid "" "%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n" msgstr "" #: src/console_fe.c:1255 #, fuzzy, c-format msgid "" "%s: Warning: Current state method differs from stored in site `%s'.\n" "%s: All existing files will appear changed (use catchup?).\n" msgstr "" "%s: attention: la mthode spcifie est diffrente de celle enregistre sur le site `%s'.\n" "%s: tous les fichiers existants seront marqus comme changs (Ratraper?).\n" #: src/console_fe.c:1261 #, fuzzy, c-format msgid "%s: The remote site needs updating (%d items to update).\n" msgstr "%s: le site distant besoin d'une mise jour.\n" #: src/console_fe.c:1263 #, fuzzy, c-format msgid "%s: The remote site needs updating (1 item to update).\n" msgstr "%s: le site distant besoin d'une mise jour.\n" #: src/console_fe.c:1266 #, c-format msgid "%s: The remote site does not need updating.\n" msgstr "%s: le site distant n'a pas besoin de mise jour.\n" #: src/console_fe.c:1274 #, c-format msgid "%s: All the files and directories are marked as NOT updated remotely.\n" msgstr "%s: tous les fichiers et les rpertoires sont marqus comme NON mis jours sur le site distant,\n" #: src/console_fe.c:1279 #, c-format msgid "%s: All the files and and directories are marked as updated remotely.\n" msgstr "%s: tous les fichiers et rpertoires sont marqus comme mis jours sur le site distant.\n" #: src/console_fe.c:1288 #, fuzzy, c-format msgid "" "%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n" msgstr "%s: erreur dans la rcupration de la liste des fichiers.\n" #: src/console_fe.c:1302 #, fuzzy, c-format msgid "" "%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n" msgstr "%s: erreur dans la rcupration de la liste des fichiers.\n" #: src/console_fe.c:1309 #, c-format msgid "%s: Verify found %d files missing from server.\n" msgstr "" #: src/console_fe.c:1312 #, fuzzy, c-format msgid "%s: Remote site not synchronized with stored state.\n" msgstr "%s: rpertoire distant non spcifie sur le site `%s'.\n" #: src/console_fe.c:1325 #, c-format msgid "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" msgstr "" #: src/console_fe.c:1333 #, c-format msgid "" "%s: in act_on_site\n" "%s" msgstr "" "%s: dans act_on_site\n" "%s" #: src/console_fe.c:1344 #, c-format msgid "Usage: %s [OPTIONS] [MODE] [sitename]...\n" msgstr "Utilisation: %s [OPTIONS] [MODE] [nom du site]...\n" #: src/console_fe.c:1346 #, c-format msgid "Options: \n" msgstr "Options: \n" #: src/console_fe.c:1349 #, fuzzy, c-format msgid "" " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" msgstr "" " -d, --debug=NIVEAU Place le niveau de debug au niveau NIVEAU, qui est " "la somme de:\n" " 1=socket, 2=fichiers, 4=ressources, 8=WebDAV, 16=FTP 32=XML, 128=HTTP-auth\n" " 256=affiche les dtails de motdepasse/authentification en texte brut.\n" #: src/console_fe.c:1356 #, fuzzy, c-format msgid "" " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites " "(default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote " "state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n" msgstr "" " -r, --rcfile=FICHIER Utiliser un autre fichier de ressources\n" " -p, --storepath=CHEMIN Utiliser un autre rpertoire de mise jour\n" " -y, --prompting Demande confirmation avant chaque changement\n" " -a, --allsites Effectue l'opration sur TOUS les sites dfinis\n" " -k, --keep-going Continue la mise jour mme en cas d'erreur\n" " -o, --show-progress Affiche le pourcentage des transferts de fichier\n" " -q, --quiet Silence lors des oprations\n" " -qq, --silent Encore plus silencieux\n" "Mode d'oprations:\n" " -l, --list Liste les changements entre le site distant et " "local (defaut)\n" " -ll, --flatlist Liste `plate' des changements entre le site " "distant et local\n" " -v, --view Affiche une liste des dfinitions de site\n" " -i, --initialize Marque tous les fichiers et rpertoires comme non mis jour.\n" " -f, --fetch Liste les fichiers du site distant\n" " -c, --catchup Marque tous les fichiers et rpertoires comme mis jour\n" " -s, --synchronize Met jour le site local partir du fichier distant\n" " -u, --update Met jour le site distant\n" " -h, --help Affiche ce message d'aide\n" " -V, --version Affiche des informations sur la version\n" "Envoyez vos demande de fonctionnalits et les rapports de bugs (en anglais) sitecopy@lyra.org\n" #: src/sitestore.c:326 #, c-format msgid "Invalid checksum at line %d" msgstr "" #: src/sitestore.c:371 #, c-format msgid "Boolean missing in 'ascii' at line %d" msgstr "" #: src/sitestore.c:396 #, c-format msgid "Size overflow (%s) in '%s' at line %d" msgstr "" #: src/davdriver.c:195 msgid "The connection timed out." msgstr "" #: src/davdriver.c:224 #, fuzzy msgid "Could not write SSL certificate" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/davdriver.c:244 msgid "SSL support has not be compiled in." msgstr "" #: src/davdriver.c:252 #, fuzzy, c-format msgid "Could not load certificate `%s'." msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/davdriver.c:290 #, fuzzy, c-format msgid "Could not read SSL client certificate '%s'." msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/davdriver.c:303 #, fuzzy, c-format msgid "Could not decrypt SSL client certificate '%s'." msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/davdriver.c:325 msgid "The server does not appear to be a WebDAV server." msgstr "" #: src/davdriver.c:330 msgid "The server does not support the executable live property." msgstr "" #: src/davdriver.c:376 src/davdriver.c:443 src/davdriver.c:480 src/ftp.c:888 #: src/ftp.c:972 #, fuzzy msgid "Could not open file" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/davdriver.c:411 #, fuzzy, c-format msgid "Could not stat file: %s" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/davdriver.c:670 msgid "Could not access resource" msgstr "" #: src/sites.c:160 msgid "Could not set modification time of local file." msgstr "" #: src/sites.c:308 msgid "" "Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode." msgstr "" #: src/sites.c:515 msgid "Remote file has been modified - not overwriting with local changes" msgstr "" #: src/sites.c:828 msgid "Could not examine file." msgstr "" #: src/sites.c:871 msgid "Could not checksum file" msgstr "" #: src/sites.c:887 msgid "The target of the symlink could not be read." msgstr "" #: src/common.c:113 msgid "Unknown system error" msgstr "Erreur systme inconnue" #: src/ftp.c:153 #, c-format msgid "%s: connection was closed by server." msgstr "" #: src/ftp.c:157 #, c-format msgid "%s: connection timed out." msgstr "" #: src/ftp.c:195 #, fuzzy msgid "Could not read response line" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:229 #, fuzzy msgid "Cannot parse MDTM response; wrong length." msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:236 #, fuzzy msgid "Cannot parse MDTM response." msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:260 #, fuzzy msgid "Could not find address in PASV response" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:267 #, fuzzy msgid "Could not parse PASV response" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:276 msgid "Invalid IP address in PASV response" msgstr "" #: src/ftp.c:296 #, fuzzy msgid "Malformed EPSV response" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:304 #, fuzzy msgid "Malformed port in EPSV response" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:449 msgid "Error sending file" msgstr "" #: src/ftp.c:463 src/ftp.c:489 msgid "Error reading file" msgstr "" #: src/ftp.c:480 #, fuzzy msgid "Could not send file" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:510 src/ftp.c:991 msgid "Error writing to file" msgstr "" #: src/ftp.c:516 msgid "Receiving file" msgstr "" #: src/ftp.c:532 #, fuzzy msgid "Could not connect passive data socket" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: src/ftp.c:647 msgid "Active open failed: could not determine address of control socket" msgstr "" #: src/ftp.c:659 #, fuzzy msgid "Active open failed: could not create socket" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: src/ftp.c:667 msgid "Active open failed: could not bind to address" msgstr "" #: src/ftp.c:677 msgid "Active open failed: could not determine address of data socket" msgstr "" #: src/ftp.c:684 #, fuzzy msgid "Could not determine bound port number for data socket" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: src/ftp.c:727 msgid "Active open failed: could not accept connection" msgstr "" #: src/ftp.c:800 msgid "Error closing data socket" msgstr "" #: src/ftp.c:894 #, fuzzy msgid "Could not determine length of file" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:905 #, fuzzy msgid "Could not rewind to beginning of file" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:1152 #, fuzzy msgid "Could not read 'LIST' response." msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: src/ftp.c:1161 #, fuzzy, c-format msgid "Parse error in LIST response: %s" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: gnome/init.c:51 msgid "_New site..." msgstr "" #: gnome/init.c:51 gnome/init.c:171 msgid "Create a new site definition" msgstr "" #: gnome/init.c:54 msgid "_Open..." msgstr "" #: gnome/init.c:54 msgid "Open a new rc file. (EXPERIMENTAL)." msgstr "" #: gnome/init.c:57 msgid "_Save Sites" msgstr "" #: gnome/init.c:57 gnome/init.c:177 msgid "Save the current site definitions" msgstr "" #: gnome/init.c:60 msgid "Sav_e Sites As..." msgstr "" #: gnome/init.c:60 msgid "Save the current site definitions to a file." msgstr "" #: gnome/init.c:63 #, fuzzy msgid "_Delete this site" msgstr "Efface %s" #: gnome/init.c:63 msgid "Delete the selected site entry" msgstr "" #: gnome/init.c:69 msgid "E_xit" msgstr "" #: gnome/init.c:69 gnome/init.c:202 msgid "Exit the program" msgstr "" #: gnome/init.c:78 #, fuzzy msgid "_Initialise site" msgstr "Initialiser" #: gnome/init.c:78 msgid "All files will be uploaded if a site is initialised" msgstr "" #: gnome/init.c:81 #, fuzzy msgid "'_Catchup' site" msgstr "Ratraper" #: gnome/init.c:81 msgid "Records the site as already updated." msgstr "" #: gnome/init.c:84 msgid "_Fetch site listing" msgstr "" #: gnome/init.c:84 msgid "Figures out which files are new/changed from the actual remote site." msgstr "" #: gnome/init.c:88 #, fuzzy msgid "_Resynchronize site" msgstr "synchronisation" #: gnome/init.c:88 msgid "Copies newer files from the remote site to the local drive." msgstr "" #: gnome/init.c:91 msgid "_Update site..." msgstr "" #: gnome/init.c:91 msgid "Apply the local site's changes to the remote site." msgstr "" #: gnome/init.c:94 msgid "Update _ALL sites" msgstr "" #: gnome/init.c:94 gnome/init.c:137 msgid "Performs the required operations on all site definitions. (TODO)." msgstr "" #: gnome/init.c:98 msgid "Rescan local directory" msgstr "" #: gnome/init.c:98 #, fuzzy msgid "Re-reads the local directory of the selected site." msgstr "%s: rpertoire local non spcifi sur le site `%s'.\n" #: gnome/init.c:106 msgid "_Required updates" msgstr "" #: gnome/init.c:106 msgid "Displays a brief report of any required updates." msgstr "" #: gnome/init.c:109 msgid "Site web-r_eport" msgstr "" #: gnome/init.c:109 msgid "" "Generates a web page detailing the changes required on the selected site." msgstr "" #: gnome/init.c:112 msgid "Prin_t site info..." msgstr "" #: gnome/init.c:112 msgid "Print information about the selected site" msgstr "" #: gnome/init.c:119 msgid "_Backup files status" msgstr "" #: gnome/init.c:119 msgid "Save the 'state' of your local files, in case of accident." msgstr "" #: gnome/init.c:122 msgid "Restore files status..." msgstr "" #: gnome/init.c:122 gnome/init.c:129 msgid "If a backup has previously been made, it will be restored." msgstr "" #: gnome/init.c:126 msgid "_Backup site definitions" msgstr "" #: gnome/init.c:126 msgid "Backup your site definitions, in case you delete your sites." msgstr "" #: gnome/init.c:129 msgid "Restore site definitions..." msgstr "" #: gnome/init.c:137 msgid "Preferences..." msgstr "" #: gnome/init.c:146 msgid "_About XSitecopy" msgstr "" #: gnome/init.c:146 msgid "Information about XSitecopy" msgstr "" #: gnome/init.c:158 msgid "_File" msgstr "" #: gnome/init.c:159 #, fuzzy msgid "_Operations" msgstr "Options: \n" #: gnome/init.c:160 msgid "_Reports" msgstr "" #: gnome/init.c:161 msgid "_Settings" msgstr "" #: gnome/init.c:162 msgid "_Backup" msgstr "" #: gnome/init.c:163 msgid "_Help" msgstr "" #: gnome/init.c:171 msgid "New site" msgstr "" #: gnome/init.c:174 msgid "Open" msgstr "" #: gnome/init.c:174 msgid "Open a new site definitions file." msgstr "" #: gnome/init.c:177 msgid "Save" msgstr "" #: gnome/init.c:180 #, fuzzy msgid "Delete site" msgstr "Efface %s" #: gnome/init.c:180 msgid "Delete the selected site" msgstr "" #: gnome/init.c:185 #, fuzzy msgid "Initialise" msgstr "Initialiser" #: gnome/init.c:185 msgid "Initialise the site (mark all files as needing to be updated)." msgstr "" #: gnome/init.c:188 #, fuzzy msgid "Catch-up" msgstr "Ratraper" #: gnome/init.c:188 msgid "Mark all of the selected site's files as updated." msgstr "" #: gnome/init.c:194 #, fuzzy msgid "Download" msgstr "Chargement de %s: [" #: gnome/init.c:194 msgid "Download newer files from the remote site. (Use with care)" msgstr "" #: gnome/init.c:198 msgid "Updates the selected site" msgstr "" #: gnome/init.c:202 msgid "Quit" msgstr "" #: gnome/init.c:412 #, fuzzy, c-format msgid "%s: Error: Could not read rcfile: %s.\n" msgstr "%s: Erreur: impossible d'ouvrir le fichier de ressources: %s.\n" #: gnome/main.c:184 msgid "" "Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" msgstr "" #: gnome/misc.c:580 #, fuzzy, c-format msgid "Server not specified in site `%s'.\n" msgstr "%s: serveur non spcifi sur le site `%s'.\n" #: gnome/misc.c:584 #, fuzzy, c-format msgid "Remote directory not specified in site `%s'.\n" msgstr "%s: rpertoire distant non spcifie sur le site `%s'.\n" #: gnome/misc.c:588 #, fuzzy, c-format msgid "Local directory not specified in site `%s'.\n" msgstr "%s: rpertoire local non spcifi sur le site `%s'.\n" #: gnome/misc.c:592 #, fuzzy, c-format msgid "" "Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: Impossible de lire le rpertoire pour `%s':\n" "\t%s\n" #: gnome/misc.c:596 #, fuzzy, c-format msgid "Invalid port used in site `%s'.\n" msgstr "%s: port invalide utilis sur le site `%s'.\n" #: gnome/misc.c:600 #, fuzzy, c-format msgid "Protocol '%s' cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s ne peut pas garder les liens symboliques (site `%s').\n" #: gnome/misc.c:604 #, fuzzy, c-format msgid "Cannot use a relative remote directory protocol '%s' (site `%s').\n" msgstr "%s: Ne peut pas utiliser de rpertoire relatif sur %s (site `%s').\n" #: gnome/misc.c:607 #, c-format msgid "%s's protocol does not currently support maintaining permissions." msgstr "" #: gnome/misc.c:611 #, fuzzy, c-format msgid "Could not find 'relative' local directory" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: lib/neon/ne_redirect.c:92 #, fuzzy msgid "Could not parse redirect destination URL" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_gnutls.c:162 #, c-format msgid "[unprintable:#%lu]" msgstr "" #: lib/neon/ne_gnutls.c:188 msgid "[unprintable]" msgstr "" #: lib/neon/ne_gnutls.c:696 lib/neon/ne_openssl.c:419 msgid "Server certificate was missing commonName attribute in subject name" msgstr "" #: lib/neon/ne_gnutls.c:736 lib/neon/ne_openssl.c:638 #, fuzzy, c-format msgid "SSL negotiation failed: %s" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_gnutls.c:745 msgid "Server did not send certificate chain" msgstr "" #: lib/neon/ne_openssl.c:451 #, c-format msgid "Certificate verification error: %s" msgstr "" #: lib/neon/ne_openssl.c:657 msgid "SSL server did not present certificate" msgstr "" #: lib/neon/ne_openssl.c:666 msgid "Server certificate changed: connection intercepted?" msgstr "" #: lib/neon/ne_session.c:356 lib/neon/ne_session.c:367 msgid "[invalid date]" msgstr "" #: lib/neon/ne_session.c:380 msgid "certificate is not yet valid" msgstr "" #: lib/neon/ne_session.c:381 msgid "certificate has expired" msgstr "" #: lib/neon/ne_session.c:382 msgid "certificate issued for a different hostname" msgstr "" #: lib/neon/ne_session.c:383 msgid "issuer is not trusted" msgstr "" #: lib/neon/ne_session.c:388 msgid "Server certificate verification failed: " msgstr "" #: lib/neon/ne_socket.c:514 lib/neon/ne_socket.c:568 lib/neon/ne_socket.c:671 msgid "Connection closed" msgstr "" #: lib/neon/ne_socket.c:578 lib/neon/ne_socket.c:683 msgid "Secure connection truncated" msgstr "" #: lib/neon/ne_socket.c:590 lib/neon/ne_socket.c:695 #, fuzzy, c-format msgid "SSL error: %s" msgstr "" "%s: dans issue_error\n" "%s" #: lib/neon/ne_socket.c:593 #, c-format msgid "SSL error code %d/%d/%lu" msgstr "" #: lib/neon/ne_socket.c:676 #, fuzzy, c-format msgid "SSL alert received: %s" msgstr "" "%s: dans issue_error\n" "%s" #: lib/neon/ne_socket.c:691 msgid "SSL socket read failed" msgstr "" #: lib/neon/ne_socket.c:790 msgid "Line too long" msgstr "" #: lib/neon/ne_socket.c:935 lib/neon/ne_socket.c:941 msgid "Host not found" msgstr "" #: lib/neon/ne_socket.c:1048 msgid "Connection timed out" msgstr "" #: lib/neon/ne_socket.c:1210 msgid "Socket descriptor number exceeds FD_SETSIZE" msgstr "" #: lib/neon/ne_socket.c:1270 msgid "Socket family not supported" msgstr "" #: lib/neon/ne_socket.c:1493 msgid "Client certificate verification failed" msgstr "" #: lib/neon/ne_socket.c:1509 msgid "SSL disabled due to lack of entropy" msgstr "" #: lib/neon/ne_socket.c:1516 msgid "SSL disabled due to library version mismatch" msgstr "" #: lib/neon/ne_socket.c:1522 #, fuzzy msgid "Could not create SSL structure" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: lib/neon/ne_request.c:194 #, fuzzy, c-format msgid "%s: connection was closed by proxy server" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: lib/neon/ne_request.c:197 #, c-format msgid "%s: connection was closed by server" msgstr "" #: lib/neon/ne_request.c:202 #, c-format msgid "%s: connection timed out" msgstr "" #: lib/neon/ne_request.c:307 msgid "offset invalid" msgstr "" #: lib/neon/ne_request.c:312 #, fuzzy, c-format msgid "Could not seek to offset %s of request body file: %s" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_request.c:360 msgid "Could not send request body" msgstr "" #: lib/neon/ne_request.c:699 msgid "Could not read chunk size" msgstr "" #: lib/neon/ne_request.c:706 #, fuzzy msgid "Could not parse chunk size" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_request.c:743 msgid "Could not read response body" msgstr "" #: lib/neon/ne_request.c:759 #, fuzzy msgid "Could not read chunk delimiter" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_request.c:762 msgid "Chunk delimiter was invalid" msgstr "" #: lib/neon/ne_request.c:868 msgid "Could not read status line" msgstr "" #: lib/neon/ne_request.c:890 #, fuzzy msgid "Could not parse response status line" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_request.c:902 #, fuzzy msgid "Could not read interim response headers" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_request.c:936 msgid "Could not send request" msgstr "" #: lib/neon/ne_request.c:984 lib/neon/ne_request.c:1002 #: lib/neon/ne_request.c:1012 msgid "Error reading response headers" msgstr "" #: lib/neon/ne_request.c:1030 msgid "Response header too long" msgstr "" #: lib/neon/ne_request.c:1112 msgid "Response exceeded maximum number of header fields" msgstr "" #: lib/neon/ne_request.c:1129 #, fuzzy, c-format msgid "Could not resolve hostname `%s': %s" msgstr "%s: erreur: impossible de trouver le nom de l'hte distant.\n" #: lib/neon/ne_request.c:1260 msgid "Unknown transfer-coding in response" msgstr "" #: lib/neon/ne_request.c:1271 msgid "Invalid Content-Length in response" msgstr "" #: lib/neon/ne_request.c:1344 #, fuzzy, c-format msgid "Could not write to file: %s" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_request.c:1417 #, fuzzy, c-format msgid "Could not create SSL connection through proxy server: %s" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: lib/neon/ne_request.c:1464 #, fuzzy msgid "Could not create socket" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: lib/neon/ne_request.c:1526 #, fuzzy msgid "Could not connect to proxy server" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: lib/neon/ne_request.c:1527 #, fuzzy msgid "Could not connect to server" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: lib/neon/ne_xml.c:280 #, fuzzy, c-format msgid "XML parse error at line %d: invalid element name" msgstr "" "%s: erreur dans le fichier de ressources la ligne %d:\n" "%s\n" #: lib/neon/ne_xml.c:452 #, fuzzy msgid "Unknown error" msgstr "Erreur systme inconnue" #: lib/neon/ne_xml.c:537 msgid "Invalid Byte Order Mark" msgstr "" #: lib/neon/ne_xml.c:625 #, fuzzy, c-format msgid "XML parse error at line %d: %s" msgstr "" "%s: erreur dans le fichier de ressources la ligne %d:\n" "%s\n" #: lib/neon/ne_props.c:371 lib/neon/ne_props.c:435 msgid "Response exceeds maximum property count" msgstr "" #: lib/neon/ne_compress.c:184 #, c-format msgid "%s: %s (code %d)" msgstr "" #: lib/neon/ne_compress.c:232 #, fuzzy msgid "Could not inflate data" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_compress.c:293 #, fuzzy msgid "Could not initialize zlib" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_xmlreq.c:36 #, fuzzy, c-format msgid "Could not parse response: %s" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_basic.c:98 #, fuzzy, c-format msgid "Could not determine file size: %s" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_basic.c:149 msgid "Response did not include requested range" msgstr "" #: lib/neon/ne_basic.c:183 msgid "Range is not satisfiable" msgstr "" #: lib/neon/ne_basic.c:188 msgid "Resource does not support ranged GET requests" msgstr "" #: lib/neon/ne_auth.c:130 #, fuzzy, c-format msgid "Could not authenticate to server: %s" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: lib/neon/ne_auth.c:135 #, fuzzy, c-format msgid "Could not authenticate to proxy server: %s" msgstr "%s: erreur: impossible de se connecter l'hte distant.\n" #: lib/neon/ne_auth.c:358 #, c-format msgid "rejected %s challenge" msgstr "" #: lib/neon/ne_auth.c:374 msgid "missing realm in Basic challenge" msgstr "" #: lib/neon/ne_auth.c:469 msgid "invalid Negotiate token" msgstr "" #: lib/neon/ne_auth.c:492 msgid "GSSAPI authentication error: " msgstr "" #: lib/neon/ne_auth.c:505 #, c-format msgid "GSSAPI failure (code %u)" msgstr "" #: lib/neon/ne_auth.c:540 msgid "ignoring empty Negotiate continuation" msgstr "" #: lib/neon/ne_auth.c:555 msgid "Negotiate response verification failed: invalid response header token" msgstr "" #: lib/neon/ne_auth.c:577 #, c-format msgid "Negotiate response verification failure: %s" msgstr "" #: lib/neon/ne_auth.c:697 msgid "unknown algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:701 msgid "incompatible algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:705 msgid "missing parameter in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:709 msgid "initial Digest challenge was stale" msgstr "" #: lib/neon/ne_auth.c:716 msgid "stale Digest challenge with new algorithm or realm" msgstr "" #: lib/neon/ne_auth.c:728 #, fuzzy msgid "could not parse domain in Digest challenge" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_auth.c:1036 msgid "Digest mutual authentication failure: missing parameters" msgstr "" #: lib/neon/ne_auth.c:1041 msgid "Digest mutual authentication failure: client nonce mismatch" msgstr "" #: lib/neon/ne_auth.c:1051 msgid "Digest mutual authentication failure: could not parse nonce count" msgstr "" #: lib/neon/ne_auth.c:1056 #, c-format msgid "Digest mutual authentication failure: nonce count mismatch (%u not %u)" msgstr "" #: lib/neon/ne_auth.c:1099 msgid "Digest mutual authentication failure: request-digest mismatch" msgstr "" #: lib/neon/ne_auth.c:1225 #, c-format msgid "ignored %s challenge" msgstr "" #: lib/neon/ne_auth.c:1304 #, fuzzy msgid "could not parse challenge" msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #: lib/neon/ne_207.c:198 #, c-format msgid "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" msgstr "" #: lib/neon/ne_locks.c:584 msgid "LOCK response missing Lock-Token header" msgstr "" #: lib/neon/ne_locks.c:759 #, c-format msgid "Response missing activelock for %s" msgstr "" #: lib/neon/ne_locks.c:801 #, c-format msgid "No activelock for <%s> returned in LOCK refresh response" msgstr "" #: lib/rpmatch.c:79 msgid "^[yY]" msgstr "[yY=oui]" #: lib/rpmatch.c:82 msgid "^[nN]" msgstr "[nN=non]" #: lib/getopt.c:664 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: l'option `%s' est ambigu\n" #: lib/getopt.c:688 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: l'option `--%s' ne demande pas d'argument\n" #: lib/getopt.c:693 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: l'option `%c%s' ne demande pas d'argument\n" #: lib/getopt.c:710 lib/getopt.c:883 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: l'option `%s' demande un argument\n" #: lib/getopt.c:739 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: option non reconnue `--%s'\n" #: lib/getopt.c:743 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: option non reconnue `%c%s'\n" #: lib/getopt.c:769 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: option illgale -- %c\n" #: lib/getopt.c:772 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: option invalide -- %c\n" #: lib/getopt.c:802 lib/getopt.c:932 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: l'option demande un argument -- %c\n" #: lib/getopt.c:849 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: l'option `-W %s' est ambigu\n" #: lib/getopt.c:867 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: l'option `-W %s' ne demande pas d'argument\n" #~ msgid "%s\n" #~ msgstr "%s\n" #, fuzzy #~ msgid "%s: %s" #~ msgstr "" #~ "%s: dans issue_error\n" #~ "%s" #, fuzzy #~ msgid "%s: Aborted.\n" #~ msgstr "%s: %s abandonn.\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal: %s (%d)\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: Signal reu: %s (%d)\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal %d\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: Signal reu %d\n" #~ msgid "%s: Terminating.\n" #~ msgstr "%s: Termin.\n" #, fuzzy #~ msgid " of request body file: %s" #~ msgstr "%s: erreur: impossible d'ouvrir le fichier de ressources: %s\n" #, fuzzy #~ msgid "unknown error code" #~ msgstr "Erreur systme inconnue" #, fuzzy #~ msgid "Recent Changes" #~ msgstr "Change %s" #, fuzzy #~ msgid "Changed Items" #~ msgstr "Change %s" #, fuzzy #~ msgid "Deleted Items" #~ msgstr "Efface %s" #~ msgid "%s: Failed to fetch file listing for verification.\n" #~ msgstr "%s: erreur dans la rcupration de la liste des fichiers pour vrification.\n" #~ msgid "%s: Verify indicates differences.\n" #~ msgstr "%s: la vrification montre des diffrences.\n" #~ msgid "%s: Aborting update... completing current operation...\n" #~ msgstr "%s: Abandon de la mise jour... terminaison de l'opration en cours...\n" #~ msgid "%s: Username not specified in site `%s'.\n" #~ msgstr "%s: nom d'utilisateur non spcifi sur le site `%s'.\n" #~ msgid "%s: Password not specified in site `%s'.\n" #~ msgstr "%s: mot de passe non spcifi sur le site `%s'.\n" #, fuzzy #~ msgid "%s: The remote site needs updating (1 thing to update).\n" #~ msgstr "%s: le site distant besoin d'une mise jour.\n" sitecopy-0.16.6/po/cs.po0000664000076400007640000015352211037413774013173 0ustar joejoe# The czech translation for sitecopy # Copyright (C) 2000 Free Software Foundation, Inc. # Petr Prazak , 2000-2002. # msgid "" msgstr "" "Project-Id-Version: sitecopy 0.11.4\n" "Report-Msgid-Bugs-To: sitecopy@lyra.org\n" "POT-Creation-Date: 2008-07-16 16:31+0100\n" "PO-Revision-Date: 2002-04-09 11:12+0100\n" "Last-Translator: Petr Prazak \n" "Language-Team: cz\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-2\n" "Content-Transfer-Encoding: 8bit\n" # src/console_fe.c:107 #: src/console_fe.c:119 msgid "Show changes to" msgstr "Zobrazen zmn pro" # src/console_fe.c:107 #: src/console_fe.c:119 msgid "showing changes to" msgstr "zobrazen zmn pro" # src/console_fe.c:107 src/console_fe.c:108 #: src/console_fe.c:119 src/console_fe.c:120 msgid "local" msgstr "lokln" # src/console_fe.c:108 #: src/console_fe.c:120 msgid "Synchronize" msgstr "Synchonizace" # src/console_fe.c:108 #: src/console_fe.c:120 msgid "synchronizing" msgstr "synchonizace" # src/console_fe.c:111 #: src/console_fe.c:125 msgid "Fetch" msgstr "Staen" # src/console_fe.c:111 #: src/console_fe.c:125 msgid "fetching" msgstr "stahovn" # src/console_fe.c:111 src/console_fe.c:112 src/console_fe.c:113 #: src/console_fe.c:125 src/console_fe.c:126 src/console_fe.c:127 msgid "remote" msgstr "vzdlen" # src/console_fe.c:112 #: src/console_fe.c:126 gnome/init.c:198 msgid "Update" msgstr "Aktualizace" # src/console_fe.c:112 #: src/console_fe.c:126 msgid "updating" msgstr "aktualizace" # src/console_fe.c:113 #: src/console_fe.c:127 msgid "Verify" msgstr "Kontrola" # src/console_fe.c:113 #: src/console_fe.c:127 msgid "verifying" msgstr "kontroly" # src/console_fe.c:114 #: src/console_fe.c:128 msgid "Catch up" msgstr "Dohnn" # src/console_fe.c:114 #: src/console_fe.c:128 msgid "catching up" msgstr "dohnn" # src/console_fe.c:114 src/console_fe.c:115 #: src/console_fe.c:128 src/console_fe.c:129 msgid "stored" msgstr "uloen" # src/console_fe.c:115 #: src/console_fe.c:129 msgid "Initialize" msgstr "Inicializace" # src/console_fe.c:115 #: src/console_fe.c:129 msgid "initializing" msgstr "inicializace" # src/console_fe.c:120 #: src/console_fe.c:134 msgid "" "You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n" msgstr "" "Tuhle zprvu byste nemli vidt..\n" "Kontaktujte prosm sprvce na adrese sitecopy@lyra.org\n" # src/console_fe.c:182 #: src/console_fe.c:196 #, c-format msgid "%s: Error: No site called `%s' found - skipping.\n" msgstr "%s: Chyba: Msto '%s' nenalezeno / peskakuji\n" # src/console_fe.c:200 #: src/console_fe.c:214 #, c-format msgid "%s: No valid sites specified.\n" msgstr "%s: dn platn msta nebyla specifikovna.\n" # src/console_fe.c:202 #: src/console_fe.c:216 #, c-format msgid "%s: No sites specified.\n" msgstr "%s: dn msta nebyla specifikovna.\n" # src/console_fe.c:204 src/console_fe.c:383 src/console_fe.c:530 #: src/console_fe.c:218 src/console_fe.c:369 src/console_fe.c:529 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Vce informac zskte pkazem `%s --help'.\n" # src/console_fe.c:214 #: src/console_fe.c:228 #, c-format msgid "%s: %c%s site `%s' (on %s in %s)\n" msgstr "%s: %c%s msta `%s' (na %s v %s)\n" # src/console_fe.c:266 #: src/console_fe.c:249 #, c-format msgid "* These items have been added since the last update:\n" msgstr "* Nsledujc poloky byly pidny od posledn aktualizace:\n" # src/console_fe.c:271 src/console_fe.c:302 #: src/console_fe.c:254 src/console_fe.c:285 #, c-format msgid "dir:" msgstr "adres:" # src/console_fe.c:278 #: src/console_fe.c:261 #, c-format msgid "* These items have been changed since the last update:\n" msgstr "* Nsledujc poloky byly zmnny od posledn aktualizace:\n" # src/console_fe.c:280 #: src/console_fe.c:263 #, c-format msgid " Changes to items in [brackets] are ignored during updates.\n" msgstr " Zmny poloek v [zvorkch] jsou bhem aktualizace ignorovny.\n" # src/console_fe.c:294 #: src/console_fe.c:277 #, c-format msgid "* These items have been deleted, but will be left on the server:\n" msgstr "* Nsledujc poloky byly vymazny, ale budou ponechny na serveru:\n" # src/console_fe.c:296 #: src/console_fe.c:279 #, c-format msgid "* These items have been deleted since the last update:\n" msgstr "* Nsledujc poloky byly smazny od posledn aktualizace:\n" # src/console_fe.c:309 #: src/console_fe.c:292 #, c-format msgid "* These items have been moved since the last update:\n" msgstr "* Nsledujc poloky byly pesunuty od posledn aktualizace:\n" # src/console_fe.c:327 src/console_fe.c:339 #: src/console_fe.c:310 src/console_fe.c:322 msgid "Ignored" msgstr "Ignorovny" # src/console_fe.c:329 #: src/console_fe.c:312 msgid "Maintained for executables" msgstr "Udrovny pro programy" # src/console_fe.c:331 #: src/console_fe.c:314 msgid "Always maintained" msgstr "Vdy udrovny" # src/console_fe.c:341 #: src/console_fe.c:324 msgid "Maintained" msgstr "Udrovny" # src/console_fe.c:343 #: src/console_fe.c:326 msgid "Followed" msgstr "Sledovny" # src/console_fe.c:352 #: src/console_fe.c:337 #, c-format msgid "" "Site: %s\n" "\tServer: %s" msgstr "" "Msto: %s\n" "\tServer: %s" # src/console_fe.c:354 #: src/console_fe.c:339 #, c-format msgid " Port: " msgstr " Port: " #: src/console_fe.c:341 #, c-format msgid "(default)\n" msgstr "(standardn)\n" # src/console_fe.c:358 #: src/console_fe.c:343 #, c-format msgid "%d\n" msgstr "" # src/console_fe.c:360 #: src/console_fe.c:345 #, c-format msgid "\tProtocol: %s Username: %s\n" msgstr "\tProtokol: %s Jmno uivatele: %s\n" #: src/console_fe.c:348 msgid "(unspecified)" msgstr "(nespecifikovno)" # src/console_fe.c:364 #: src/console_fe.c:350 #, c-format msgid "\tPassive mode FTP will not be used.\n" msgstr "\tPasvn md FTP nebude pouit.\n" # src/console_fe.c:365 #: src/console_fe.c:351 #, c-format msgid "" "\tRemote directory: %s\n" "\tLocal directory: %s\n" msgstr "" "\tVzdlen adres: %s\n" "\tMstn adres: %s\n" # src/console_fe.c:367 #: src/console_fe.c:353 #, c-format msgid "\tPermissions: %s Symlinks: %s\n" msgstr "\tPrva: %s Symbolick odkazy: %s\n" # src/console_fe.c:370 #: src/console_fe.c:356 #, c-format msgid "\tRemote files will not be deleted.\n" msgstr "\tVzdlen soubory nebudou vymazny.\n" # src/console_fe.c:372 #: src/console_fe.c:358 #, c-format msgid "\tFiles will be moved remotely if moved locally.\n" msgstr "\tSoubory pesunut lokln budou tak pesunuty vzdlen.\n" # src/console_fe.c:381 #: src/console_fe.c:367 #, c-format msgid "%s: Error: Only specify ONE operation mode at a time.\n" msgstr "%s: Chyba: Specifikujte najednou pouze JEDEN operan md.\n" #: src/console_fe.c:489 #, c-format msgid "%s: Error: Debug channel %s not known.\n" msgstr "%s: Chyba: Ladic kanl %s nen znm.\n" # src/console_fe.c:506 #: src/console_fe.c:497 #, c-format msgid "%s: Warning: Could not open `%s' to use as logfile.\n" msgstr "%s: Varovn: Nelze otevt soubor `%s' pro zznam.\n" #: src/console_fe.c:540 #, c-format msgid "%s: Error: Dry run mode is currently only supported for updates.\n" msgstr "" # src/console_fe.c:543 #: src/console_fe.c:556 #, c-format msgid "" "%s: Warning: Only %d sites can be specified on the command line!\n" "Extra entries are being skipped.\n" msgstr "" "%s: Varovn: na pkazov dce lze specifikovat pouze %d mst !\n" "Peskakuji dal poloky.\n" #: src/console_fe.c:581 msgid "WARNING: Server certificate is not trusted." msgstr "" #: src/console_fe.c:584 #, c-format msgid "Certificate was issued for server `%s'.\n" msgstr "" #: src/console_fe.c:586 msgid "WARNING: Certificate does not specify a server" msgstr "" #: src/console_fe.c:588 #, c-format msgid "Fingerprint: %s\n" msgstr "" #: src/console_fe.c:591 #, c-format msgid "Issued to: %s\n" msgstr "" #: src/console_fe.c:595 #, c-format msgid "Issued by: %s\n" msgstr "" #: src/console_fe.c:598 #, c-format msgid "Do you wish to accept this certificate? (y/n) " msgstr "" #: src/console_fe.c:607 msgid "server" msgstr "serveru" #: src/console_fe.c:607 msgid "proxy server" msgstr "proxy serveru" #: src/console_fe.c:613 #, c-format msgid "Authentication required for %s on %s `%s':\n" msgstr "Je vyadovna autentizace pro %s na %s `%s':\n" #: src/console_fe.c:616 #, c-format msgid "Authentication required on %s `%s':\n" msgstr "Je vyadovna autentizace na %s `%s':\n" #: src/console_fe.c:619 msgid "Username: " msgstr "Jmno uivatele: " # src/console_fe.c:360 #: src/console_fe.c:624 #, c-format msgid "Username: %s\n" msgstr "Jmno uivatele: %s\n" #: src/console_fe.c:626 src/console_fe.c:650 msgid "Password: " msgstr "Heslo: " # src/console_fe.c:113 #: src/console_fe.c:636 #, c-format msgid "Retrying: [" msgstr "Opakuji: [" #: src/console_fe.c:647 #, c-format msgid "%s: Encrypted client certificate configured%s%s.\n" msgstr "" # src/console_fe.c:573 #: src/console_fe.c:682 #, c-format msgid "Create %s/" msgstr "Vytvoit %s/" # src/console_fe.c:575 #: src/console_fe.c:684 #, c-format msgid "Delete %s/" msgstr "Smazat %s/" # src/console_fe.c:581 #: src/console_fe.c:692 #, fuzzy, c-format msgid "Upload %s (%s bytes)" msgstr "Poslat %s (%" # src/console_fe.c:582 #: src/console_fe.c:694 #, c-format msgid "Delete %s" msgstr "Smazat %s" # src/console_fe.c:583 #: src/console_fe.c:695 #, c-format msgid "Move %s->%s" msgstr "Pesunout %s->%s" # src/console_fe.c:587 #: src/console_fe.c:699 #, c-format msgid "" "%s: in fe_can_update/file_file\n" "%s" msgstr "" # src/console_fe.c:594 #: src/console_fe.c:706 #, c-format msgid "Change %s" msgstr "Zmnit %s" # src/console_fe.c:595 #: src/console_fe.c:707 #, c-format msgid "Create %s" msgstr "Vytvoit %s" # src/console_fe.c:596 #: src/console_fe.c:708 #, c-format msgid "Remove %s" msgstr "Odstranit %s" # src/console_fe.c:599 #: src/console_fe.c:711 #, c-format msgid "" "%s: in fe_can_update/file_link\n" "%s" msgstr "" # src/console_fe.c:605 #: src/console_fe.c:717 #, c-format msgid "? (y/n) " msgstr "? (a/n) " # src/console_fe.c:612 #: src/console_fe.c:726 #, c-format msgid "Checksumming %s: [" msgstr "Kontroln souet %s: [" # src/console_fe.c:627 src/console_fe.c:723 src/console_fe.c:779 #: src/console_fe.c:741 src/console_fe.c:852 src/console_fe.c:913 #, c-format msgid "] done.\n" msgstr "] hotovo.\n" # src/console_fe.c:629 src/console_fe.c:646 src/console_fe.c:726 # src/console_fe.c:781 #: src/console_fe.c:743 src/console_fe.c:915 #, c-format msgid "" "] failed:\n" "%s\n" msgstr "" "] chyba:\n" "%s\n" # src/console_fe.c:637 #: src/console_fe.c:753 #, fuzzy, c-format msgid "Setting permissions on %s%s: " msgstr "Nastavuji prva pro %s: " # src/console_fe.c:644 src/console_fe.c:712 src/console_fe.c:773 #: src/console_fe.c:763 src/console_fe.c:841 src/console_fe.c:907 #, c-format msgid "done.\n" msgstr "hotovo.\n" # src/console_fe.c:714 src/console_fe.c:775 #: src/console_fe.c:765 src/console_fe.c:909 #, c-format msgid "" "failed:\n" "%s\n" msgstr "" "selhalo:\n" "%s\n" # src/console_fe.c:657 src/console_fe.c:738 #: src/console_fe.c:784 src/console_fe.c:871 #, c-format msgid "Creating %s/: " msgstr "Vytvm %s/: " # src/console_fe.c:659 src/console_fe.c:740 #: src/console_fe.c:786 src/console_fe.c:873 #, c-format msgid "Deleting %s/: " msgstr "Mau %s/: " # src/console_fe.c:665 #: src/console_fe.c:793 #, c-format msgid "Uploading %s: [" msgstr "Poslm %s: [" # src/console_fe.c:666 src/console_fe.c:684 src/console_fe.c:750 #: src/console_fe.c:796 src/console_fe.c:815 src/console_fe.c:883 #, c-format msgid "Deleting %s: " msgstr "Mau %s: " # src/console_fe.c:668 src/console_fe.c:753 #: src/console_fe.c:799 src/console_fe.c:886 #, c-format msgid "Moving %s->%s: " msgstr "Pesunuji %s->%s: " # src/console_fe.c:672 #: src/console_fe.c:803 #, c-format msgid "" "%s: in fe_updating/file_file\n" "%s" msgstr "" # src/console_fe.c:680 #: src/console_fe.c:811 #, c-format msgid "Changing %s: " msgstr "Mnm %s: " # src/console_fe.c:682 #: src/console_fe.c:813 #, c-format msgid "Creating %s: " msgstr "Vytvm %s: " # src/console_fe.c:686 #: src/console_fe.c:817 #, c-format msgid "" "%s: in fe_updating/file_link\n" "%s" msgstr "" # src/console_fe.c:706 #: src/console_fe.c:834 #, fuzzy, c-format msgid "Failed to update %s:%c%s\n" msgstr "" "Nezdailo se aktualizovat %s:\n" "%s\n" # src/console_fe.c:714 src/console_fe.c:775 #: src/console_fe.c:843 #, fuzzy, c-format msgid "failed:%c%s\n" msgstr "" "selhalo:\n" "%s\n" # src/console_fe.c:629 src/console_fe.c:646 src/console_fe.c:726 # src/console_fe.c:781 #: src/console_fe.c:855 #, fuzzy, c-format msgid "] failed:%c%s\n" msgstr "" "] chyba:\n" "%s\n" # src/console_fe.c:747 #: src/console_fe.c:880 #, c-format msgid "Downloading %s: [" msgstr "Stahuji %s: [" # src/console_fe.c:594 #: src/console_fe.c:925 msgid "Changed on server" msgstr "Zmnno na serveru" #: src/console_fe.c:928 msgid "Added on server" msgstr "Pidno na server" #: src/console_fe.c:936 #, c-format msgid "%s: %s\n" msgstr "" # src/console_fe.c:797 #: src/console_fe.c:956 #, c-format msgid "Directory: %s/\n" msgstr "Adres: %s/\n" # src/console_fe.c:801 #: src/console_fe.c:961 #, fuzzy, c-format msgid "File: %s - size %s%s\n" msgstr "Soubor: %s - velikost %" #: src/console_fe.c:963 msgid " (ASCII)" msgstr "" # src/console_fe.c:805 #: src/console_fe.c:966 #, c-format msgid "Link: %s - target %s\n" msgstr "Odkaz: %s - cl %s\n" # src/console_fe.c:817 #: src/console_fe.c:979 gnome/init.c:402 #, c-format msgid "%s: Error: Could not open rcfile: %s.\n" msgstr "%s: Chyba: Nelze otevt dic soubor: %s.\n" # src/console_fe.c:821 #: src/console_fe.c:983 gnome/init.c:407 #, c-format msgid "" "%s: rcfile corrupt at line %d:\n" "%s\n" msgstr "" "%s: dic soubor pokozen na dku %d:\n" "%s\n" # src/console_fe.c:840 #: src/console_fe.c:1002 #, c-format msgid "" "%s: Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: Nelze nast adres pro `%s':\n" "\t%s\n" # src/console_fe.c:844 #: src/console_fe.c:1006 #, c-format msgid "%s: Server not specified in site `%s'.\n" msgstr "%s: Pro msto `%s' nen specifikovn server.\n" # src/console_fe.c:856 #: src/console_fe.c:1010 #, c-format msgid "%s: Remote directory not specified in site `%s'.\n" msgstr "%s: Pro msto `%s' nen specifikovn vzdlen adres.\n" # src/console_fe.c:860 #: src/console_fe.c:1014 #, c-format msgid "%s: Local directory not specified in site `%s'.\n" msgstr "%s: Pro msto `%s' nen specifikovn mstn adres.\n" # src/console_fe.c:864 #: src/console_fe.c:1018 #, c-format msgid "%s: Invalid port used in site `%s'.\n" msgstr "%s: Pro msto `%s' je pouit neplatn port.\n" # src/console_fe.c:868 #: src/console_fe.c:1022 #, c-format msgid "%s: %s cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s neme udrovat symbolick odkazy (msto `%s').\n" # src/console_fe.c:872 #: src/console_fe.c:1026 #, c-format msgid "%s: Cannot use a relative remote directory in %s (site `%s').\n" msgstr "%s: Nelze pouit relativn vzdlen adres v %s (msto `%s').\n" # src/console_fe.c:875 #: src/console_fe.c:1029 #, c-format msgid "%s: File permissions are not supported in %s (site `%s').\n" msgstr "%s: V %s nejsou prva soubor podporovny (msto `%s').\n" # src/console_fe.c:878 #: src/console_fe.c:1032 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n" msgstr "%s: Bezpen md nelze pout ve spojen s nooverwrite (msto `%s').\n" # src/console_fe.c:881 #: src/console_fe.c:1035 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n" msgstr "%s: Bezpen md nelze pout ve spojen s tempupload (msto `%s').\n" # src/console_fe.c:884 #: src/console_fe.c:1038 #, c-format msgid "%s: Can only check for renamed files when checksumming (site `%s').\n" msgstr "" "%s: Pesunut soubory lze zjistit pouze s zapnutm kontrolnm soutem (msto " "`%s').\n" # src/console_fe.c:875 #: src/console_fe.c:1041 #, c-format msgid "%s: The protocol `%s' is unsupported (site `%s').\n" msgstr "%s: V %s nejsou prva soubor podporovny (msto `%s').\n" # src/console_fe.c:890 #: src/console_fe.c:1048 #, c-format msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" msgstr "%s: Neoeten chyba %d v mst `%s' - kontaktujte prosm sprvce.\n" # src/console_fe.c:908 #: src/console_fe.c:1066 #, c-format msgid "" "%s: Error: Corrupt site storage file for `%s':\n" "%s: %s\n" msgstr "" "%s: Chyba: Poruen ukldac soubor pro msto `%s':\n" "%s: %s\n" # src/console_fe.c:913 #: src/console_fe.c:1075 #, c-format msgid "" "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n" msgstr "" "%s: Chyba: Pro `%s' nenalezen ukldac soubor.\n" "%s: Pro jeho vytvoen pouijte pepnae --init, --catchup nebo --fetch.\n" # src/console_fe.c:925 #: src/console_fe.c:1088 #, c-format msgid "%s: Skipping site `%s'.\n" msgstr "%s: Peskakuji msto `%s'.\n" # src/console_fe.c:937 #: src/console_fe.c:1103 #, c-format msgid "%s: %s completed successfully.\n" msgstr "%s: %s spn dokonena.\n" # src/console_fe.c:946 #: src/console_fe.c:1109 #, c-format msgid "%s: %s unsupported for %s.\n" msgstr "%s: Akce \"%s\" nen implementovna pro %s.\n" # src/console_fe.c:951 #: src/console_fe.c:1114 #, c-format msgid "%s: Errors occurred while %s the %s site.\n" msgstr "%s: Bhem %s %sho msta se vyskytly chyby.\n" # src/console_fe.c:956 #: src/console_fe.c:1119 #, c-format msgid "%s: Error: Could not resolve remote hostname (%s).\n" msgstr "%s: Chyba: Nelze najt adresu vzdlenho potae (%s).\n" # src/console_fe.c:956 #: src/console_fe.c:1125 #, c-format msgid "%s: Error: Could not resolve hostname of proxy server (%s).\n" msgstr "%s: Chyba: Nelze najt adresu proxy serveru (%s).\n" # src/console_fe.c:961 #: src/console_fe.c:1131 #, c-format msgid "%s: Error: Could not connect to proxy server (%s port %d).\n" msgstr "%s: Chyba: Nelze se pipojit k proxy serveru (%s port %d).\n" # src/console_fe.c:961 #: src/console_fe.c:1134 #, c-format msgid "%s: Error: Could not connect to server (%s port %d).\n" msgstr "%s: Chyba: Nelze se pipojit k serveru (%s port %d).\n" # src/console_fe.c:966 #: src/console_fe.c:1140 #, c-format msgid "%s: Error: Could not authorise user on server.\n" msgstr "%s: Chyba: Nelze autorizovat uivatele na serveru.\n" #: src/console_fe.c:1145 #, c-format msgid "%s: Error: %s\n" msgstr "%s: Chyba: %s\n" # src/console_fe.c:966 #: src/console_fe.c:1149 #, c-format msgid "%s: Error: Could not authorise user on proxy server (%s).\n" msgstr "%s: Chyba: Nelze autorizovat uivatele na proxy serveru (%s).\n" # src/console_fe.c:971 #: src/console_fe.c:1154 #, c-format msgid "" "%s: in issue_error\n" "%s" msgstr "" # src/console_fe.c:984 #: src/console_fe.c:1168 #, c-format msgid "%s: Error: Environment variable HOME not set.\n" msgstr "%s: Chyba: Promnn prosted HOME nen nastavena.\n" # src/console_fe.c:992 #: src/console_fe.c:1176 #, c-format msgid "%s: Error: Could not open rcfile: %s\n" msgstr "%s: Chyba: Nelze otevt dic soubor: %s\n" # src/console_fe.c:995 #: src/console_fe.c:1179 #, c-format msgid "%s: Error: rcfile permissions allow other users to read your rcfile.\n" msgstr "" "%s: Chyba: Prva pstupu k dicmu souboru dovoluj ostatnm uivatelm " "jeho ten.\n" # src/console_fe.c:996 src/console_fe.c:1008 #: src/console_fe.c:1180 src/console_fe.c:1192 #, c-format msgid "%s: Set the permissions to 0600.\n" msgstr "%s: Nastavte prva pstupu na 0600.\n" # src/console_fe.c:999 #: src/console_fe.c:1183 #, c-format msgid "%s: Error: Could not open storage directory: %s\n" msgstr "%s: Chyba: Nelze otevt adres pro ukldn: %s\n" # src/console_fe.c:1000 #: src/console_fe.c:1184 #, c-format msgid "" "%s: You need to create this directory and set the permissions to 0700.\n" msgstr "%s: Muste tento adres vytvoit a nastavit prva pstupu na 0700.\n" # src/console_fe.c:1003 #: src/console_fe.c:1187 #, c-format msgid "%s: Error: storage directory permissions incorrect.\n" msgstr "%s: Chyba: Nesprvn prvo pstupu adrese pro ukldn.\n" # src/console_fe.c:1004 #: src/console_fe.c:1188 #, c-format msgid "%s: Set the permissions to 0700.\n" msgstr "%s: Nastavte prva pstupu na 0700.\n" # src/console_fe.c:1007 #: src/console_fe.c:1191 #, c-format msgid "%s: Error: ~/.netrc permissions incorrect.\n" msgstr "%s: Chyba: Nesprvn prva pstupu k souboru ~/.netrc .\n" # src/console_fe.c:1013 #: src/console_fe.c:1197 #, c-format msgid "" "%s: init_paths gave %d\n" "%s" msgstr "" # src/console_fe.c:1020 #: src/console_fe.c:1204 #, c-format msgid "%s: Error: Could not parse ~/.netrc.\n" msgstr "%s: Chyba: Nelze zpracovat soubor ~/.netrc.\n" # src/console_fe.c:1046 src/console_fe.c:1121 #: src/console_fe.c:1222 src/console_fe.c:1321 #, c-format msgid "%s: Nothing to do - no changes found.\n" msgstr "%s: Nen co dlat - dn zmny nenalezeny.\n" #: src/console_fe.c:1231 #, c-format msgid "" "%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n" msgstr "" "%s: Chyba: Nalze zapisovat do ukldacho souboru (%s)\n" "%s: Chyba: %s\n" "%s: Nebudu aktualizovat msto `%s'.\n" # src/console_fe.c:1063 #: src/console_fe.c:1255 #, c-format msgid "" "%s: Warning: Current state method differs from stored in site `%s'.\n" "%s: All existing files will appear changed (use catchup?).\n" msgstr "" "%s: Varovn: Souasn metoda pro uloen stavu se li od metody uloen v " "mst `%s'.\n" "%s: Vechny existujc soubory budou vykazovat zmny (pouijte catchup?).\n" # src/console_fe.c:1069 #: src/console_fe.c:1261 #, c-format msgid "%s: The remote site needs updating (%d items to update).\n" msgstr "%s: Vzdlen msto je nutno aktualizovat (%d poloek).\n" # src/console_fe.c:1071 #: src/console_fe.c:1263 #, c-format msgid "%s: The remote site needs updating (1 item to update).\n" msgstr "%s: Vzdlen msto je nutno aktualizovat (1 poloka).\n" # src/console_fe.c:1074 #: src/console_fe.c:1266 #, c-format msgid "%s: The remote site does not need updating.\n" msgstr "%s: Vzdlen msto nen nutno aktualizovat.\n" # src/console_fe.c:1082 #: src/console_fe.c:1274 #, c-format msgid "%s: All the files and directories are marked as NOT updated remotely.\n" msgstr "%s: Vechny soubory a adrese jsou oznaeny jako NEaktualizovan.\n" # src/console_fe.c:1087 #: src/console_fe.c:1279 #, c-format msgid "%s: All the files and and directories are marked as updated remotely.\n" msgstr "%s: Vechny soubory a adrese jsou oznaeny jako aktualizovan.\n" # src/console_fe.c:1096 #: src/console_fe.c:1288 #, c-format msgid "" "%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n" msgstr "" "%s: Nelze zskat seznam soubor pro msto `%s':\n" "%s: %s\n" # src/console_fe.c:1096 #: src/console_fe.c:1302 #, c-format msgid "" "%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n" msgstr "" "%s: Nelze zskat seznam soubor pro kontrolu msta `%s':\n" "%s: %s\n" #: src/console_fe.c:1309 #, c-format msgid "%s: Verify found %d files missing from server.\n" msgstr "%s: Kontrola nalezla %d soubor chybjcch na serveru.\n" # src/console_fe.c:856 #: src/console_fe.c:1312 #, c-format msgid "%s: Remote site not synchronized with stored state.\n" msgstr "%s: Vzdlen msto nen synchronizovno s uloenm stavem.\n" #: src/console_fe.c:1325 #, c-format msgid "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" msgstr "" "%s: Odmtm smazat vechny lokln soubory operac synchronizace.\n" "%s: Pouijte pepna --update pro aktualizaci vzdlenho msta.\n" # src/console_fe.c:1127 #: src/console_fe.c:1333 #, c-format msgid "" "%s: in act_on_site\n" "%s" msgstr "" # src/console_fe.c:1137 #: src/console_fe.c:1344 #, c-format msgid "Usage: %s [OPTIONS] [MODE] [sitename]...\n" msgstr "Pouit: %s [VOLBY] [MD] [jmno msta]...\n" # src/console_fe.c:1139 #: src/console_fe.c:1346 #, c-format msgid "Options: \n" msgstr "Volby: \n" # src/console_fe.c:1142 #: src/console_fe.c:1349 #, fuzzy, c-format msgid "" " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" msgstr "" " -d, --debug=KL[,KL] Nastav ladn pro dan KL, kter me bt:\n" " socket, files, rcfile, ftp, http, httpbody, xml, xmlparse, cleartext\n" " Varovn: cleartext zobrazuje (normln skryt) hesla v prostm textu\n" " -g, --logfile=FILE Pipoj ladic hlen do souboru FILE (jinak na std. " "chybov vstup)\n" # src/console_fe.c:1149 #: src/console_fe.c:1356 #, fuzzy, c-format msgid "" " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites " "(default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote " "state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n" msgstr "" " -r, --rcfile=SOUBOR Pouij alternativn dic soubor pro bh\n" " -p, --storepath=CESTA Pouij alternativn adres pro uloen msta\n" " -y, --prompting Ped kadou aktualizac vyaduj potvrzen\n" " -a, --allsites Prove operaci pro VECHNY definovan msta\n" " -k, --keep-going Pokrauj v aktualizaci bez ohledu na chyby\n" " -o, --show-progress Zobraz celkov postup penosu soubor\n" " -q, --quiet Bu zticha bhem provdn operace\n" " -qq, --silent Ml bhem provdn operace\n" "Operan mdy:\n" " -l, --list Vypi zmny mezi vzdlenm a loklnm mstem " "(implicitn)\n" " -ll, --flatlist Ploch list zmn mezi vzdlenm a loklnm mstem\n" " -v, --view Zobraz seznam definic mst\n" " -i, --initialize Ozna vechny soubory a adrese jako " "neaktualizovan\n" " -f, --fetch Zjisti jak soubory jsou na vzdlenm mst\n" " -e, --verify Zkontroluj zda uloen stav odpovd stavu " "vzdlenho msta\n" " -c, --catchup Ozna vechny soubory a adrese jako aktualizovan\n" " -s, --synchronize Aktualizuj lokln msto se vzdlenho msta\n" " -u, --update Aktualizuj vzdlen msto\n" " -h, --help Zobraz tuto npovdu\n" " -V, --version Zobraz informaci o verzi programu\n" "Polete prosm poadavky na vlastnosti a hlen o chybch na adresu " "sitecopy@lyra.org\n" "Pipomnky k pekladu poslejte na adresu prazak@grisoft.cz\n" #: src/sitestore.c:326 #, c-format msgid "Invalid checksum at line %d" msgstr "" #: src/sitestore.c:371 #, c-format msgid "Boolean missing in 'ascii' at line %d" msgstr "" #: src/sitestore.c:396 #, c-format msgid "Size overflow (%s) in '%s' at line %d" msgstr "" #: src/davdriver.c:195 msgid "The connection timed out." msgstr "Spojen vyprelo." # src/console_fe.c:992 #: src/davdriver.c:224 #, fuzzy msgid "Could not write SSL certificate" msgstr "Nelze zapsat do souboru: %s" #: src/davdriver.c:244 msgid "SSL support has not be compiled in." msgstr "Podpora SSL nebyla zakompilovna." # src/console_fe.c:992 #: src/davdriver.c:252 #, fuzzy, c-format msgid "Could not load certificate `%s'." msgstr "Nelze zapsat do souboru: %s" # src/console_fe.c:992 #: src/davdriver.c:290 #, fuzzy, c-format msgid "Could not read SSL client certificate '%s'." msgstr "Nelze zapsat do souboru: %s" # src/console_fe.c:992 #: src/davdriver.c:303 #, fuzzy, c-format msgid "Could not decrypt SSL client certificate '%s'." msgstr "Nelze zapsat do souboru: %s" #: src/davdriver.c:325 msgid "The server does not appear to be a WebDAV server." msgstr "Nezd se, e by server podporoval WebDAV." #: src/davdriver.c:330 msgid "The server does not support the executable live property." msgstr "Server nepodporuje 'executable live property'." # src/console_fe.c:992 #: src/davdriver.c:376 src/davdriver.c:443 src/davdriver.c:480 src/ftp.c:888 #: src/ftp.c:972 #, fuzzy msgid "Could not open file" msgstr "Nelze otevt soubor: " # src/console_fe.c:992 #: src/davdriver.c:411 #, fuzzy, c-format msgid "Could not stat file: %s" msgstr "Nelze zapsat do souboru: %s" #: src/davdriver.c:670 msgid "Could not access resource" msgstr "Nelze pistupovat ke zdroji" #: src/sites.c:160 msgid "Could not set modification time of local file." msgstr "Nelze nastavit as zmny pro lokln soubor." #: src/sites.c:308 msgid "" "Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode." msgstr "" "Posln soubor usplo, ale nen mon zskat as zmny.\n" "Pokud tato zprva petrvv, vypnte bezpen md." #: src/sites.c:515 msgid "Remote file has been modified - not overwriting with local changes" msgstr "" "Vzdlen soubor byl modifikovn - nebudu jej pepisovat loklnmi zmnami" #: src/sites.c:828 msgid "Could not examine file." msgstr "Nelze prozkoumat soubor." #: src/sites.c:871 msgid "Could not checksum file" msgstr "Nelze spotat kontroln souet souboru" #: src/sites.c:887 msgid "The target of the symlink could not be read." msgstr "Nelze st cl symbolickho odkazu." # src/common.c:87 #: src/common.c:113 msgid "Unknown system error" msgstr "Neznm systmov chyba" #: src/ftp.c:153 #, c-format msgid "%s: connection was closed by server." msgstr "%s: server ukonil spojen." #: src/ftp.c:157 #, c-format msgid "%s: connection timed out." msgstr "%s: spojen vyprelo." #: src/ftp.c:195 #, fuzzy msgid "Could not read response line" msgstr "Nelze nast tlo odpovdi" #: src/ftp.c:229 #, fuzzy msgid "Cannot parse MDTM response; wrong length." msgstr "Nelze zpracovat stavov dek odpovdi." #: src/ftp.c:236 #, fuzzy msgid "Cannot parse MDTM response." msgstr "Nelze zpracovat stavov dek odpovdi." #: src/ftp.c:260 #, fuzzy msgid "Could not find address in PASV response" msgstr "Nelze nast tlo odpovdi" #: src/ftp.c:267 #, fuzzy msgid "Could not parse PASV response" msgstr "Nelze nast tlo odpovdi" #: src/ftp.c:276 msgid "Invalid IP address in PASV response" msgstr "" #: src/ftp.c:296 #, fuzzy msgid "Malformed EPSV response" msgstr "Nelze nast tlo odpovdi" #: src/ftp.c:304 #, fuzzy msgid "Malformed port in EPSV response" msgstr "Nelze nast tlo odpovdi" #: src/ftp.c:449 msgid "Error sending file" msgstr "" #: src/ftp.c:463 src/ftp.c:489 #, fuzzy msgid "Error reading file" msgstr "Chyba pi cten tla poadavku" # src/console_fe.c:992 #: src/ftp.c:480 #, fuzzy msgid "Could not send file" msgstr "Nelze otevt soubor: " #: src/ftp.c:510 src/ftp.c:991 #, fuzzy msgid "Error writing to file" msgstr "Chyba pi ekn na odpovd" #: src/ftp.c:516 msgid "Receiving file" msgstr "" #: src/ftp.c:532 #, fuzzy msgid "Could not connect passive data socket" msgstr "Nelze navzat SSL spojen" #: src/ftp.c:647 msgid "Active open failed: could not determine address of control socket" msgstr "" #: src/ftp.c:659 #, fuzzy msgid "Active open failed: could not create socket" msgstr "Nelze navzat SSL spojen" #: src/ftp.c:667 msgid "Active open failed: could not bind to address" msgstr "" #: src/ftp.c:677 msgid "Active open failed: could not determine address of data socket" msgstr "" #: src/ftp.c:684 #, fuzzy msgid "Could not determine bound port number for data socket" msgstr "Nelze navzat SSL spojen" #: src/ftp.c:727 msgid "Active open failed: could not accept connection" msgstr "" #: src/ftp.c:800 msgid "Error closing data socket" msgstr "" # src/console_fe.c:992 #: src/ftp.c:894 #, fuzzy msgid "Could not determine length of file" msgstr "Nelze zjistit dlku souboru: %s" # src/console_fe.c:992 #: src/ftp.c:905 #, fuzzy msgid "Could not rewind to beginning of file" msgstr "Nelze zjistit dlku souboru: %s" #: src/ftp.c:1152 #, fuzzy msgid "Could not read 'LIST' response." msgstr "Nelze nast tlo odpovdi" #: src/ftp.c:1161 #, fuzzy, c-format msgid "Parse error in LIST response: %s" msgstr "Nelze nast tlo odpovdi" #: gnome/init.c:51 msgid "_New site..." msgstr "" #: gnome/init.c:51 gnome/init.c:171 msgid "Create a new site definition" msgstr "" #: gnome/init.c:54 msgid "_Open..." msgstr "" #: gnome/init.c:54 msgid "Open a new rc file. (EXPERIMENTAL)." msgstr "" #: gnome/init.c:57 msgid "_Save Sites" msgstr "" #: gnome/init.c:57 gnome/init.c:177 msgid "Save the current site definitions" msgstr "" #: gnome/init.c:60 msgid "Sav_e Sites As..." msgstr "" #: gnome/init.c:60 msgid "Save the current site definitions to a file." msgstr "" # src/console_fe.c:582 #: gnome/init.c:63 #, fuzzy msgid "_Delete this site" msgstr "Smazat %s" #: gnome/init.c:63 msgid "Delete the selected site entry" msgstr "" #: gnome/init.c:69 msgid "E_xit" msgstr "" #: gnome/init.c:69 gnome/init.c:202 msgid "Exit the program" msgstr "" # src/console_fe.c:115 #: gnome/init.c:78 #, fuzzy msgid "_Initialise site" msgstr "Inicializace" #: gnome/init.c:78 msgid "All files will be uploaded if a site is initialised" msgstr "" # src/console_fe.c:114 #: gnome/init.c:81 #, fuzzy msgid "'_Catchup' site" msgstr "Dohnn" #: gnome/init.c:81 msgid "Records the site as already updated." msgstr "" #: gnome/init.c:84 msgid "_Fetch site listing" msgstr "" #: gnome/init.c:84 msgid "Figures out which files are new/changed from the actual remote site." msgstr "" # src/console_fe.c:108 #: gnome/init.c:88 #, fuzzy msgid "_Resynchronize site" msgstr "synchonizace" #: gnome/init.c:88 msgid "Copies newer files from the remote site to the local drive." msgstr "" #: gnome/init.c:91 msgid "_Update site..." msgstr "" #: gnome/init.c:91 msgid "Apply the local site's changes to the remote site." msgstr "" #: gnome/init.c:94 msgid "Update _ALL sites" msgstr "" #: gnome/init.c:94 gnome/init.c:137 msgid "Performs the required operations on all site definitions. (TODO)." msgstr "" #: gnome/init.c:98 msgid "Rescan local directory" msgstr "" # src/console_fe.c:860 #: gnome/init.c:98 #, fuzzy msgid "Re-reads the local directory of the selected site." msgstr "%s: Pro msto `%s' nen specifikovn mstn adres.\n" #: gnome/init.c:106 msgid "_Required updates" msgstr "" #: gnome/init.c:106 msgid "Displays a brief report of any required updates." msgstr "" #: gnome/init.c:109 msgid "Site web-r_eport" msgstr "" #: gnome/init.c:109 msgid "" "Generates a web page detailing the changes required on the selected site." msgstr "" #: gnome/init.c:112 msgid "Prin_t site info..." msgstr "" #: gnome/init.c:112 msgid "Print information about the selected site" msgstr "" #: gnome/init.c:119 msgid "_Backup files status" msgstr "" #: gnome/init.c:119 msgid "Save the 'state' of your local files, in case of accident." msgstr "" #: gnome/init.c:122 msgid "Restore files status..." msgstr "" #: gnome/init.c:122 gnome/init.c:129 msgid "If a backup has previously been made, it will be restored." msgstr "" #: gnome/init.c:126 msgid "_Backup site definitions" msgstr "" #: gnome/init.c:126 msgid "Backup your site definitions, in case you delete your sites." msgstr "" #: gnome/init.c:129 msgid "Restore site definitions..." msgstr "" #: gnome/init.c:137 msgid "Preferences..." msgstr "" #: gnome/init.c:146 msgid "_About XSitecopy" msgstr "" #: gnome/init.c:146 msgid "Information about XSitecopy" msgstr "" #: gnome/init.c:158 msgid "_File" msgstr "" # src/console_fe.c:1139 #: gnome/init.c:159 #, fuzzy msgid "_Operations" msgstr "Volby: \n" #: gnome/init.c:160 msgid "_Reports" msgstr "" #: gnome/init.c:161 msgid "_Settings" msgstr "" #: gnome/init.c:162 msgid "_Backup" msgstr "" #: gnome/init.c:163 msgid "_Help" msgstr "" #: gnome/init.c:171 msgid "New site" msgstr "" #: gnome/init.c:174 msgid "Open" msgstr "" #: gnome/init.c:174 msgid "Open a new site definitions file." msgstr "" #: gnome/init.c:177 msgid "Save" msgstr "" # src/console_fe.c:582 #: gnome/init.c:180 #, fuzzy msgid "Delete site" msgstr "Smazat %s" #: gnome/init.c:180 msgid "Delete the selected site" msgstr "" # src/console_fe.c:115 #: gnome/init.c:185 #, fuzzy msgid "Initialise" msgstr "Inicializace" #: gnome/init.c:185 msgid "Initialise the site (mark all files as needing to be updated)." msgstr "" # src/console_fe.c:114 #: gnome/init.c:188 #, fuzzy msgid "Catch-up" msgstr "Dohnn" #: gnome/init.c:188 msgid "Mark all of the selected site's files as updated." msgstr "" # src/console_fe.c:747 #: gnome/init.c:194 #, fuzzy msgid "Download" msgstr "Stahuji %s: [" #: gnome/init.c:194 msgid "Download newer files from the remote site. (Use with care)" msgstr "" #: gnome/init.c:198 msgid "Updates the selected site" msgstr "" #: gnome/init.c:202 msgid "Quit" msgstr "" # src/console_fe.c:817 #: gnome/init.c:412 #, fuzzy, c-format msgid "%s: Error: Could not read rcfile: %s.\n" msgstr "%s: Chyba: Nelze otevt dic soubor: %s.\n" #: gnome/main.c:184 msgid "" "Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" msgstr "" # src/console_fe.c:844 #: gnome/misc.c:580 #, fuzzy, c-format msgid "Server not specified in site `%s'.\n" msgstr "%s: Pro msto `%s' nen specifikovn server.\n" # src/console_fe.c:856 #: gnome/misc.c:584 #, fuzzy, c-format msgid "Remote directory not specified in site `%s'.\n" msgstr "%s: Pro msto `%s' nen specifikovn vzdlen adres.\n" # src/console_fe.c:860 #: gnome/misc.c:588 #, fuzzy, c-format msgid "Local directory not specified in site `%s'.\n" msgstr "%s: Pro msto `%s' nen specifikovn mstn adres.\n" # src/console_fe.c:840 #: gnome/misc.c:592 #, fuzzy, c-format msgid "" "Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: Nelze nast adres pro `%s':\n" "\t%s\n" # src/console_fe.c:864 #: gnome/misc.c:596 #, fuzzy, c-format msgid "Invalid port used in site `%s'.\n" msgstr "%s: Pro msto `%s' je pouit neplatn port.\n" # src/console_fe.c:868 #: gnome/misc.c:600 #, fuzzy, c-format msgid "Protocol '%s' cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s neme udrovat symbolick odkazy (msto `%s').\n" # src/console_fe.c:872 #: gnome/misc.c:604 #, fuzzy, c-format msgid "Cannot use a relative remote directory protocol '%s' (site `%s').\n" msgstr "%s: Nelze pouit relativn vzdlen adres v %s (msto `%s').\n" #: gnome/misc.c:607 #, c-format msgid "%s's protocol does not currently support maintaining permissions." msgstr "" #: gnome/misc.c:611 #, fuzzy, c-format msgid "Could not find 'relative' local directory" msgstr "Nelze navzat SSL spojen" #: lib/neon/ne_redirect.c:92 #, fuzzy msgid "Could not parse redirect destination URL" msgstr "Nelze zpracovat stavov dek odpovdi." #: lib/neon/ne_gnutls.c:162 #, c-format msgid "[unprintable:#%lu]" msgstr "" #: lib/neon/ne_gnutls.c:188 msgid "[unprintable]" msgstr "" #: lib/neon/ne_gnutls.c:696 lib/neon/ne_openssl.c:419 msgid "Server certificate was missing commonName attribute in subject name" msgstr "" # src/console_fe.c:992 #: lib/neon/ne_gnutls.c:736 lib/neon/ne_openssl.c:638 #, fuzzy, c-format msgid "SSL negotiation failed: %s" msgstr "Nelze zapsat do souboru: %s" #: lib/neon/ne_gnutls.c:745 msgid "Server did not send certificate chain" msgstr "" #: lib/neon/ne_openssl.c:451 #, c-format msgid "Certificate verification error: %s" msgstr "" #: lib/neon/ne_openssl.c:657 msgid "SSL server did not present certificate" msgstr "" #: lib/neon/ne_openssl.c:666 msgid "Server certificate changed: connection intercepted?" msgstr "" #: lib/neon/ne_session.c:356 lib/neon/ne_session.c:367 msgid "[invalid date]" msgstr "" #: lib/neon/ne_session.c:380 msgid "certificate is not yet valid" msgstr "" #: lib/neon/ne_session.c:381 msgid "certificate has expired" msgstr "" #: lib/neon/ne_session.c:382 msgid "certificate issued for a different hostname" msgstr "" #: lib/neon/ne_session.c:383 msgid "issuer is not trusted" msgstr "" #: lib/neon/ne_session.c:388 msgid "Server certificate verification failed: " msgstr "" #: lib/neon/ne_socket.c:514 lib/neon/ne_socket.c:568 lib/neon/ne_socket.c:671 #, fuzzy msgid "Connection closed" msgstr "Server ukonil spojen." #: lib/neon/ne_socket.c:578 lib/neon/ne_socket.c:683 #, fuzzy msgid "Secure connection truncated" msgstr "Spojen vyprelo." #: lib/neon/ne_socket.c:590 lib/neon/ne_socket.c:695 #, fuzzy, c-format msgid "SSL error: %s" msgstr "%s: Chyba: %s\n" #: lib/neon/ne_socket.c:593 #, c-format msgid "SSL error code %d/%d/%lu" msgstr "" #: lib/neon/ne_socket.c:676 #, fuzzy, c-format msgid "SSL alert received: %s" msgstr "%s: Chyba: %s\n" #: lib/neon/ne_socket.c:691 msgid "SSL socket read failed" msgstr "" #: lib/neon/ne_socket.c:790 msgid "Line too long" msgstr "dek je pli dlouh" #: lib/neon/ne_socket.c:935 lib/neon/ne_socket.c:941 msgid "Host not found" msgstr "Pota nenalezen" #: lib/neon/ne_socket.c:1048 #, fuzzy msgid "Connection timed out" msgstr "Spojen vyprelo." #: lib/neon/ne_socket.c:1210 msgid "Socket descriptor number exceeds FD_SETSIZE" msgstr "" #: lib/neon/ne_socket.c:1270 msgid "Socket family not supported" msgstr "" #: lib/neon/ne_socket.c:1493 msgid "Client certificate verification failed" msgstr "" #: lib/neon/ne_socket.c:1509 msgid "SSL disabled due to lack of entropy" msgstr "" #: lib/neon/ne_socket.c:1516 msgid "SSL disabled due to library version mismatch" msgstr "" #: lib/neon/ne_socket.c:1522 #, fuzzy msgid "Could not create SSL structure" msgstr "Nelze navzat SSL spojen" #: lib/neon/ne_request.c:194 #, fuzzy, c-format msgid "%s: connection was closed by proxy server" msgstr "%s: proxy server ukonil spojen." #: lib/neon/ne_request.c:197 #, fuzzy, c-format msgid "%s: connection was closed by server" msgstr "%s: server ukonil spojen." #: lib/neon/ne_request.c:202 #, fuzzy, c-format msgid "%s: connection timed out" msgstr "%s: spojen vyprelo." #: lib/neon/ne_request.c:307 msgid "offset invalid" msgstr "" # src/console_fe.c:992 #: lib/neon/ne_request.c:312 #, fuzzy, c-format msgid "Could not seek to offset %s of request body file: %s" msgstr "Nelze zapsat do souboru: %s" #: lib/neon/ne_request.c:360 msgid "Could not send request body" msgstr "Nelze odeslat tlo poadavku" #: lib/neon/ne_request.c:699 msgid "Could not read chunk size" msgstr "Nelze nast velikost bloku" #: lib/neon/ne_request.c:706 msgid "Could not parse chunk size" msgstr "Nelze zpracovat velikost bloku" #: lib/neon/ne_request.c:743 msgid "Could not read response body" msgstr "Nelze nast tlo odpovdi" #: lib/neon/ne_request.c:759 #, fuzzy msgid "Could not read chunk delimiter" msgstr "Nelze nast velikost bloku" #: lib/neon/ne_request.c:762 msgid "Chunk delimiter was invalid" msgstr "" #: lib/neon/ne_request.c:868 msgid "Could not read status line" msgstr "Nelze pest stavov dek" #: lib/neon/ne_request.c:890 #, fuzzy msgid "Could not parse response status line" msgstr "Nelze zpracovat stavov dek odpovdi." #: lib/neon/ne_request.c:902 #, fuzzy msgid "Could not read interim response headers" msgstr "Nelze nast tlo odpovdi" #: lib/neon/ne_request.c:936 msgid "Could not send request" msgstr "Nelze poslat poadavek" #: lib/neon/ne_request.c:984 lib/neon/ne_request.c:1002 #: lib/neon/ne_request.c:1012 msgid "Error reading response headers" msgstr "Chyba pi ten hlaviek odpovdi" #: lib/neon/ne_request.c:1030 msgid "Response header too long" msgstr "Hlavika odpovdi je pli dlouh" #: lib/neon/ne_request.c:1112 #, fuzzy msgid "Response exceeded maximum number of header fields" msgstr "Odpov pekrocila maximln poet poloek v hlavicce." # src/console_fe.c:956 #: lib/neon/ne_request.c:1129 #, fuzzy, c-format msgid "Could not resolve hostname `%s': %s" msgstr "%s: Chyba: Nelze najt adresu vzdlenho potae (%s).\n" #: lib/neon/ne_request.c:1260 msgid "Unknown transfer-coding in response" msgstr "" #: lib/neon/ne_request.c:1271 msgid "Invalid Content-Length in response" msgstr "" # src/console_fe.c:992 #: lib/neon/ne_request.c:1344 #, c-format msgid "Could not write to file: %s" msgstr "Nelze zapsat do souboru: %s" #: lib/neon/ne_request.c:1417 #, fuzzy, c-format msgid "Could not create SSL connection through proxy server: %s" msgstr "Nelze navzat SSL spojen pes proxy server." #: lib/neon/ne_request.c:1464 #, fuzzy msgid "Could not create socket" msgstr "Nelze navzat SSL spojen" # src/console_fe.c:961 #: lib/neon/ne_request.c:1526 msgid "Could not connect to proxy server" msgstr "Nelze se pipojit k proxy serveru" # src/console_fe.c:961 #: lib/neon/ne_request.c:1527 msgid "Could not connect to server" msgstr "Nelze se pipojit k serveru" # src/console_fe.c:821 #: lib/neon/ne_xml.c:280 #, fuzzy, c-format msgid "XML parse error at line %d: invalid element name" msgstr "Chyba zpracovn XML na dku %d: %s." # src/common.c:87 #: lib/neon/ne_xml.c:452 #, fuzzy msgid "Unknown error" msgstr "Neznm systmov chyba" #: lib/neon/ne_xml.c:537 msgid "Invalid Byte Order Mark" msgstr "" # src/console_fe.c:821 #: lib/neon/ne_xml.c:625 #, fuzzy, c-format msgid "XML parse error at line %d: %s" msgstr "Chyba zpracovn XML na dku %d: %s." #: lib/neon/ne_props.c:371 lib/neon/ne_props.c:435 #, fuzzy msgid "Response exceeds maximum property count" msgstr "Odpov pekrocila maximln poet poloek v hlavicce." #: lib/neon/ne_compress.c:184 #, c-format msgid "%s: %s (code %d)" msgstr "" # src/console_fe.c:992 #: lib/neon/ne_compress.c:232 #, fuzzy msgid "Could not inflate data" msgstr "Nelze otevt soubor: " # src/console_fe.c:992 #: lib/neon/ne_compress.c:293 #, fuzzy msgid "Could not initialize zlib" msgstr "Nelze otevt soubor: " #: lib/neon/ne_xmlreq.c:36 #, fuzzy, c-format msgid "Could not parse response: %s" msgstr "Nelze nast tlo odpovdi" # src/console_fe.c:992 #: lib/neon/ne_basic.c:98 #, fuzzy, c-format msgid "Could not determine file size: %s" msgstr "Nelze zjistit dlku souboru: %s" #: lib/neon/ne_basic.c:149 msgid "Response did not include requested range" msgstr "" #: lib/neon/ne_basic.c:183 #, fuzzy msgid "Range is not satisfiable" msgstr "Rozsah nen uspokojiv." #: lib/neon/ne_basic.c:188 #, fuzzy msgid "Resource does not support ranged GET requests" msgstr "Server nedovoluje sten pkazy GET." # src/console_fe.c:961 #: lib/neon/ne_auth.c:130 #, fuzzy, c-format msgid "Could not authenticate to server: %s" msgstr "Nelze se pipojit k serveru" # src/console_fe.c:961 #: lib/neon/ne_auth.c:135 #, fuzzy, c-format msgid "Could not authenticate to proxy server: %s" msgstr "Nelze se pipojit k proxy serveru" #: lib/neon/ne_auth.c:358 #, c-format msgid "rejected %s challenge" msgstr "" #: lib/neon/ne_auth.c:374 msgid "missing realm in Basic challenge" msgstr "" #: lib/neon/ne_auth.c:469 msgid "invalid Negotiate token" msgstr "" #: lib/neon/ne_auth.c:492 #, fuzzy msgid "GSSAPI authentication error: " msgstr "Je vyadovna autentizace na %s `%s':\n" #: lib/neon/ne_auth.c:505 #, c-format msgid "GSSAPI failure (code %u)" msgstr "" #: lib/neon/ne_auth.c:540 msgid "ignoring empty Negotiate continuation" msgstr "" #: lib/neon/ne_auth.c:555 msgid "Negotiate response verification failed: invalid response header token" msgstr "" #: lib/neon/ne_auth.c:577 #, c-format msgid "Negotiate response verification failure: %s" msgstr "" #: lib/neon/ne_auth.c:697 msgid "unknown algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:701 msgid "incompatible algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:705 msgid "missing parameter in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:709 msgid "initial Digest challenge was stale" msgstr "" #: lib/neon/ne_auth.c:716 msgid "stale Digest challenge with new algorithm or realm" msgstr "" #: lib/neon/ne_auth.c:728 #, fuzzy msgid "could not parse domain in Digest challenge" msgstr "Nelze zpracovat stavov dek odpovdi." #: lib/neon/ne_auth.c:1036 msgid "Digest mutual authentication failure: missing parameters" msgstr "" #: lib/neon/ne_auth.c:1041 msgid "Digest mutual authentication failure: client nonce mismatch" msgstr "" #: lib/neon/ne_auth.c:1051 msgid "Digest mutual authentication failure: could not parse nonce count" msgstr "" #: lib/neon/ne_auth.c:1056 #, c-format msgid "Digest mutual authentication failure: nonce count mismatch (%u not %u)" msgstr "" #: lib/neon/ne_auth.c:1099 msgid "Digest mutual authentication failure: request-digest mismatch" msgstr "" #: lib/neon/ne_auth.c:1225 #, c-format msgid "ignored %s challenge" msgstr "" #: lib/neon/ne_auth.c:1304 #, fuzzy msgid "could not parse challenge" msgstr "Nelze zpracovat velikost bloku" #: lib/neon/ne_207.c:198 #, c-format msgid "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" msgstr "" "Neplatn dka HTTP stavu ve stavovm prvku na dku %d odpovdi:\n" "Stavov dka byla: %s" #: lib/neon/ne_locks.c:584 msgid "LOCK response missing Lock-Token header" msgstr "" #: lib/neon/ne_locks.c:759 #, c-format msgid "Response missing activelock for %s" msgstr "" #: lib/neon/ne_locks.c:801 #, c-format msgid "No activelock for <%s> returned in LOCK refresh response" msgstr "" # lib/rpmatch.c:75 #: lib/rpmatch.c:79 msgid "^[yY]" msgstr "^[aA]" # lib/rpmatch.c:78 #: lib/rpmatch.c:82 msgid "^[nN]" msgstr "^[nN]" # lib/getopt.c:680 #: lib/getopt.c:664 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: volba `%s' nen jednoznan\n" # lib/getopt.c:704 #: lib/getopt.c:688 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: volba `--%s' nedovoluje dn parametr\n" # lib/getopt.c:709 #: lib/getopt.c:693 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: volba `%c%s' nedovoluje dn parametr\n" # lib/getopt.c:726 lib/getopt.c:899 #: lib/getopt.c:710 lib/getopt.c:883 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: volba `%s' vyaduje njak parametr\n" # lib/getopt.c:755 #: lib/getopt.c:739 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: neznm volba `--%s'\n" # lib/getopt.c:759 #: lib/getopt.c:743 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: neznm volba `%c%s'\n" # lib/getopt.c:785 #: lib/getopt.c:769 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: nesprvn volba -- %c\n" # lib/getopt.c:788 #: lib/getopt.c:772 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: nesprvn volba -- %c\n" # lib/getopt.c:818 lib/getopt.c:948 #: lib/getopt.c:802 lib/getopt.c:932 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: volba vyaduje njak parametr -- %c\n" # lib/getopt.c:865 #: lib/getopt.c:849 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: volba `-W %s' nen jednoznan\n" # lib/getopt.c:883 #: lib/getopt.c:867 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: volba `-W %s' nedovoluje dn parametr\n" #~ msgid " bytes)" #~ msgstr " byt)" #, fuzzy #~ msgid "%s: %s" #~ msgstr "%s: Chyba: %s\n" # src/console_fe.c:942 #~ msgid "%s: Aborted.\n" #~ msgstr "%s: Perueno.\n" # src/console_fe.c:231 src/console_fe.c:250 #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal: %s (%d)\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: Zachycen signl: %s (%d)\n" # src/console_fe.c:234 src/console_fe.c:253 #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal %d\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: Zachycen signl: (%d)\n" #~ msgid "%s: Cannot recover from segmentation fault, aborting.\n" #~ msgstr "%s: Nelze se zotavit z vpadku stranky, konm.\n" #~ msgid "%s: Aborting update...\n" #~ msgstr "%s: Peruuji aktualizaci...\n" # src/console_fe.c:241 src/console_fe.c:255 #~ msgid "%s: Terminating.\n" #~ msgstr "%s: Konm.\n" # src/console_fe.c:992 #, fuzzy #~ msgid " of request body file: %s" #~ msgstr "Nelze zapsat do souboru: %s" #~ msgid "Error reading request body." #~ msgstr "Chyba pi cten tla poadavku" # src/common.c:87 #, fuzzy #~ msgid "unknown error code" #~ msgstr "Neznm systmov chyba" #~ msgid "Error reading chunked response body" #~ msgstr "Chyba pi ten bloku tla odpovdi" #~ msgid "document root" #~ msgstr "koen dokumentu" #~ msgid "unknown element" #~ msgstr "neznm prvek" #~ msgid "unspecified" #~ msgstr "neureno" #~ msgid "XML is not valid (%s found in parent %s)" #~ msgstr "XML nen platn (%s nalezeno v rodii %s)" #~ msgid "Unknown XML element `%s (in %s)'" #~ msgstr "Neznm XML prvek `%s (v %s)'" #~ msgid "" #~ "The server did not authenticate itself correctly.\n" #~ "Report this error to your server administrator." #~ msgstr "" #~ "Server se nesprvn autentizoval.\n" #~ "Nahlate tuto chybu vaemu sprvci serveru." #~ msgid "" #~ "The proxy server did not authenticate itself correctly.\n" #~ "Report this error to your proxy server administrator." #~ msgstr "" #~ "Proxy server se nesprvn autentizoval.\n" #~ "Nahlate tuto chybu vaemu sprvci proxy serveru." #~ msgid "%s: socket error." #~ msgstr "%s: chyba socketu." #~ msgid "Timed out waiting for 100 Continue" #~ msgstr "as vyprel pi cekn na 100 Continue" #, fuzzy #~ msgid "Host `%s' not found" #~ msgstr "Pota nenalezen" #~ msgid "Host not found (try again later?)" #~ msgstr "Pota nenalezen (zkuste znovu pozdji?)" #~ msgid "Host exists but has no address." #~ msgstr "Pota existuje ale nem dnou adresu." #~ msgid "Non-recoverable error in resolver library." #~ msgstr "Nezotaviteln chyba v knihovn resolveru." #~ msgid "Malformed header line." #~ msgstr "Pokozen dek hlaviky." #~ msgid "This application does not have SSL support." #~ msgstr "Tato aplikace nem podporu SSL." sitecopy-0.16.6/po/de.po0000664000076400007640000014632711037413774013163 0ustar joejoe# The German translation for sitecopy. # Thomas Schultz , 2000. # msgid "" msgstr "" "Project-Id-Version: sitecopy 0.11.3\n" "Report-Msgid-Bugs-To: sitecopy@lyra.org\n" "POT-Creation-Date: 2008-07-16 16:31+0100\n" "PO-Revision-Date: 2002-01-13 13:37+0100\n" "Last-Translator: Thomas Schultz \n" "Language-Team: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: src/console_fe.c:119 msgid "Show changes to" msgstr "Anzeigen der Vernderungen" #: src/console_fe.c:119 msgid "showing changes to" msgstr "Anzeigen der Vernderungen an" #: src/console_fe.c:119 src/console_fe.c:120 msgid "local" msgstr "der lokalen Daten" #: src/console_fe.c:120 msgid "Synchronize" msgstr "Abgleich" #: src/console_fe.c:120 msgid "synchronizing" msgstr "Abgleichen" #: src/console_fe.c:125 msgid "Fetch" msgstr "Holen" #: src/console_fe.c:125 msgid "fetching" msgstr "Holen" #: src/console_fe.c:125 src/console_fe.c:126 src/console_fe.c:127 msgid "remote" msgstr "des Servers" #: src/console_fe.c:126 gnome/init.c:198 msgid "Update" msgstr "Aktualisieren" #: src/console_fe.c:126 msgid "updating" msgstr "Aktualisieren" #: src/console_fe.c:127 msgid "Verify" msgstr "Vergleich" #: src/console_fe.c:127 msgid "verifying" msgstr "Vergleichen" #: src/console_fe.c:128 msgid "Catch up" msgstr "Kennzeichnung als `aktualisiert'" #: src/console_fe.c:128 msgid "catching up" msgstr "als `aktualisiert' kennzeichnen" #: src/console_fe.c:128 src/console_fe.c:129 msgid "stored" msgstr "des Datenbank-Verzeichnisses" #: src/console_fe.c:129 msgid "Initialize" msgstr "Initialisierung" #: src/console_fe.c:129 msgid "initializing" msgstr "Initialisieren" #: src/console_fe.c:134 msgid "" "You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n" msgstr "" "Sie sollten diesen Text nie zu Gesicht bekommen.\n" "Bitte wenden Sie sich an den Maintainer \n" #: src/console_fe.c:196 #, c-format msgid "%s: Error: No site called `%s' found - skipping.\n" msgstr "%s: Fehler: Keine Site namens `%s' gefunden - bergangen.\n" #: src/console_fe.c:214 #, c-format msgid "%s: No valid sites specified.\n" msgstr "%s: Keine gltigen Sites angegeben.\n" #: src/console_fe.c:216 #, c-format msgid "%s: No sites specified.\n" msgstr "%s: Keine Sites angegeben.\n" #: src/console_fe.c:218 src/console_fe.c:369 src/console_fe.c:529 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Mit `%s --help' erhalten Sie mehr Informationen.\n" #: src/console_fe.c:228 #, c-format msgid "%s: %c%s site `%s' (on %s in %s)\n" msgstr "%s: %c%s der Site `%s' (auf %s in %s)\n" #: src/console_fe.c:249 #, c-format msgid "* These items have been added since the last update:\n" msgstr "* Diese Eintrge sind seit der letzten Aktualisierung dazugekommen:\n" #: src/console_fe.c:254 src/console_fe.c:285 #, c-format msgid "dir:" msgstr "Verzeichnis:" #: src/console_fe.c:261 #, c-format msgid "* These items have been changed since the last update:\n" msgstr "* Diese Eintrge wurden seit der letzten Aktualisierung gendert:\n" #: src/console_fe.c:263 #, c-format msgid " Changes to items in [brackets] are ignored during updates.\n" msgstr "" " nderungen an Eintrgen in [Klammern] werden bei der Aktualisierung " "ignoriert.\n" #: src/console_fe.c:277 #, c-format msgid "* These items have been deleted, but will be left on the server:\n" msgstr "" "* Diese Eintrge wurden gelscht, werden jedoch auf dem Server gelassen:\n" #: src/console_fe.c:279 #, c-format msgid "* These items have been deleted since the last update:\n" msgstr "* Diese Eintrge wurden seit der letzten Aktualisierung gelscht:\n" #: src/console_fe.c:292 #, c-format msgid "* These items have been moved since the last update:\n" msgstr "* Diese Eintrge wurden seit der letzten Aktualisierung verschoben:\n" #: src/console_fe.c:310 src/console_fe.c:322 msgid "Ignored" msgstr "Ignorieren" #: src/console_fe.c:312 msgid "Maintained for executables" msgstr "Bei ausfhrbaren Dateien beibehalten" #: src/console_fe.c:314 msgid "Always maintained" msgstr "Immer beibehalten" #: src/console_fe.c:324 msgid "Maintained" msgstr "Beibehalten" #: src/console_fe.c:326 msgid "Followed" msgstr "Auflsen" #: src/console_fe.c:337 #, c-format msgid "" "Site: %s\n" "\tServer: %s" msgstr "" "Site: %s\n" "\tServer: %s" #: src/console_fe.c:339 #, c-format msgid " Port: " msgstr " Port: " #: src/console_fe.c:341 #, c-format msgid "(default)\n" msgstr "(Voreinstellung)\n" #: src/console_fe.c:343 #, c-format msgid "%d\n" msgstr "%d\n" #: src/console_fe.c:345 #, c-format msgid "\tProtocol: %s Username: %s\n" msgstr "\tProtokoll: %s Benutzername: %s\n" #: src/console_fe.c:348 msgid "(unspecified)" msgstr "(nicht angegeben)" #: src/console_fe.c:350 #, c-format msgid "\tPassive mode FTP will not be used.\n" msgstr "\tFTP wird nicht im `passive'-Modus verwendet.\n" #: src/console_fe.c:351 #, c-format msgid "" "\tRemote directory: %s\n" "\tLocal directory: %s\n" msgstr "" "\tVerzeichnis auf dem Server: %s\n" "\tLokales Verzeichnis: %s\n" #: src/console_fe.c:353 #, c-format msgid "\tPermissions: %s Symlinks: %s\n" msgstr "\tZugriffsrechte: %s Symbolische Links: %s\n" #: src/console_fe.c:356 #, c-format msgid "\tRemote files will not be deleted.\n" msgstr "\tAuf dem Server werden keine Dateien gelscht.\n" #: src/console_fe.c:358 #, c-format msgid "\tFiles will be moved remotely if moved locally.\n" msgstr "\tLokal verschobene Dateien werden auf dem Server verschoben.\n" #: src/console_fe.c:367 #, c-format msgid "%s: Error: Only specify ONE operation mode at a time.\n" msgstr "%s: Fehler: Geben Sie nur EINEN Modus gleichzeitig an.\n" #: src/console_fe.c:489 #, c-format msgid "%s: Error: Debug channel %s not known.\n" msgstr "%s: Fehler: Debug-Schlssel %s ist unbekannt.\n" #: src/console_fe.c:497 #, c-format msgid "%s: Warning: Could not open `%s' to use as logfile.\n" msgstr "%s: Warnung: Konnte `%s' nicht als Logfile ffnen.\n" #: src/console_fe.c:540 #, c-format msgid "%s: Error: Dry run mode is currently only supported for updates.\n" msgstr "" #: src/console_fe.c:556 #, c-format msgid "" "%s: Warning: Only %d sites can be specified on the command line!\n" "Extra entries are being skipped.\n" msgstr "" "%s: Warnung: An der Kommandozeile knnen nur %d Sites angegeben werden!\n" "Weitere Eintrge werden bergangen.\n" #: src/console_fe.c:581 msgid "WARNING: Server certificate is not trusted." msgstr "" #: src/console_fe.c:584 #, c-format msgid "Certificate was issued for server `%s'.\n" msgstr "" #: src/console_fe.c:586 msgid "WARNING: Certificate does not specify a server" msgstr "" #: src/console_fe.c:588 #, c-format msgid "Fingerprint: %s\n" msgstr "" #: src/console_fe.c:591 #, c-format msgid "Issued to: %s\n" msgstr "" #: src/console_fe.c:595 #, c-format msgid "Issued by: %s\n" msgstr "" #: src/console_fe.c:598 #, c-format msgid "Do you wish to accept this certificate? (y/n) " msgstr "" #: src/console_fe.c:607 msgid "server" msgstr "Server" #: src/console_fe.c:607 msgid "proxy server" msgstr "Proxy-Server" #: src/console_fe.c:613 #, c-format msgid "Authentication required for %s on %s `%s':\n" msgstr "Anmeldung wird bentigt fr %s auf %s `%s':\n" #: src/console_fe.c:616 #, c-format msgid "Authentication required on %s `%s':\n" msgstr "Anmeldung wird bentigt auf %s `%s':\n" #: src/console_fe.c:619 msgid "Username: " msgstr "Benutzername: " #: src/console_fe.c:624 #, c-format msgid "Username: %s\n" msgstr "Benutzername: %s\n" #: src/console_fe.c:626 src/console_fe.c:650 msgid "Password: " msgstr "Passwort: " #: src/console_fe.c:636 #, c-format msgid "Retrying: [" msgstr "Erneuter Versuch: [" #: src/console_fe.c:647 #, c-format msgid "%s: Encrypted client certificate configured%s%s.\n" msgstr "" #: src/console_fe.c:682 #, c-format msgid "Create %s/" msgstr "Lege %s/ an" #: src/console_fe.c:684 #, c-format msgid "Delete %s/" msgstr "Lsche %s/" #: src/console_fe.c:692 #, fuzzy, c-format msgid "Upload %s (%s bytes)" msgstr "Aktualisiere %s (" #: src/console_fe.c:694 #, c-format msgid "Delete %s" msgstr "Lsche %s" #: src/console_fe.c:695 #, c-format msgid "Move %s->%s" msgstr "Verschiebe %s->%s" #: src/console_fe.c:699 #, c-format msgid "" "%s: in fe_can_update/file_file\n" "%s" msgstr "" "%s: in fe_can_update/file_file\n" "%s" #: src/console_fe.c:706 #, c-format msgid "Change %s" msgstr "Verndere %s" #: src/console_fe.c:707 #, c-format msgid "Create %s" msgstr "Erstelle %s" #: src/console_fe.c:708 #, c-format msgid "Remove %s" msgstr "Entferne %s" #: src/console_fe.c:711 #, c-format msgid "" "%s: in fe_can_update/file_link\n" "%s" msgstr "" "%s: in fe_can_update/file_link\n" "%s" #: src/console_fe.c:717 #, c-format msgid "? (y/n) " msgstr "? (j/n) " #: src/console_fe.c:726 #, c-format msgid "Checksumming %s: [" msgstr "Errechne Prfsumme von %s: [" #: src/console_fe.c:741 src/console_fe.c:852 src/console_fe.c:913 #, c-format msgid "] done.\n" msgstr "] fertig.\n" #: src/console_fe.c:743 src/console_fe.c:915 #, c-format msgid "" "] failed:\n" "%s\n" msgstr "" "] gescheitert:\n" "%s\n" #: src/console_fe.c:753 #, fuzzy, c-format msgid "Setting permissions on %s%s: " msgstr "Setze Zugriffsrechte auf %s: " #: src/console_fe.c:763 src/console_fe.c:841 src/console_fe.c:907 #, c-format msgid "done.\n" msgstr "fertig.\n" #: src/console_fe.c:765 src/console_fe.c:909 #, c-format msgid "" "failed:\n" "%s\n" msgstr "" "gescheitert:\n" "%s\n" #: src/console_fe.c:784 src/console_fe.c:871 #, c-format msgid "Creating %s/: " msgstr "Lege %s/ an: " #: src/console_fe.c:786 src/console_fe.c:873 #, c-format msgid "Deleting %s/: " msgstr "Lsche %s/: " #: src/console_fe.c:793 #, c-format msgid "Uploading %s: [" msgstr "Lade %s hoch: [" #: src/console_fe.c:796 src/console_fe.c:815 src/console_fe.c:883 #, c-format msgid "Deleting %s: " msgstr "Lsche %s: " #: src/console_fe.c:799 src/console_fe.c:886 #, c-format msgid "Moving %s->%s: " msgstr "Verschiebe %s->%s: " #: src/console_fe.c:803 #, c-format msgid "" "%s: in fe_updating/file_file\n" "%s" msgstr "" "%s: in fe_updating/file_file\n" "%s" #: src/console_fe.c:811 #, c-format msgid "Changing %s: " msgstr "ndere %s: " #: src/console_fe.c:813 #, c-format msgid "Creating %s: " msgstr "Lege %s an: " #: src/console_fe.c:817 #, c-format msgid "" "%s: in fe_updating/file_link\n" "%s" msgstr "" "%s: in fe_updating/file_link\n" "%s" #: src/console_fe.c:834 #, fuzzy, c-format msgid "Failed to update %s:%c%s\n" msgstr "" "Aktualisierung von %s gescheitert:\n" "%s\n" #: src/console_fe.c:843 #, fuzzy, c-format msgid "failed:%c%s\n" msgstr "" "gescheitert:\n" "%s\n" #: src/console_fe.c:855 #, fuzzy, c-format msgid "] failed:%c%s\n" msgstr "" "] gescheitert:\n" "%s\n" #: src/console_fe.c:880 #, c-format msgid "Downloading %s: [" msgstr "Lade %s herunter: [" #: src/console_fe.c:925 msgid "Changed on server" msgstr "Auf dem Server verndert" #: src/console_fe.c:928 msgid "Added on server" msgstr "Auf dem Server hinzugefgt" #: src/console_fe.c:936 #, c-format msgid "%s: %s\n" msgstr "%s: %s\n" #: src/console_fe.c:956 #, c-format msgid "Directory: %s/\n" msgstr "Verzeichnis: %s/\n" #: src/console_fe.c:961 #, fuzzy, c-format msgid "File: %s - size %s%s\n" msgstr "Datei: %s - Gre %" #: src/console_fe.c:963 msgid " (ASCII)" msgstr " (ASCII)" #: src/console_fe.c:966 #, c-format msgid "Link: %s - target %s\n" msgstr "Link: %s - zeigt auf %s\n" #: src/console_fe.c:979 gnome/init.c:402 #, c-format msgid "%s: Error: Could not open rcfile: %s.\n" msgstr "%s: Fehler: Konnte rc-Datei nicht ffnen: %s.\n" #: src/console_fe.c:983 gnome/init.c:407 #, c-format msgid "" "%s: rcfile corrupt at line %d:\n" "%s\n" msgstr "" "%s: rc-Datei in Zeile %d beschdigt:\n" "%s\n" #: src/console_fe.c:1002 #, c-format msgid "" "%s: Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: Konnte Verzeichnis fr `%s' nicht einlesen:\n" "\t%s\n" #: src/console_fe.c:1006 #, c-format msgid "%s: Server not specified in site `%s'.\n" msgstr "%s: Fr die Site `%s' ist kein Server angegeben.\n" #: src/console_fe.c:1010 #, c-format msgid "%s: Remote directory not specified in site `%s'.\n" msgstr "%s: Fr die Site `%s' ist kein Verzeichnis auf dem Server angegeben.\n" #: src/console_fe.c:1014 #, c-format msgid "%s: Local directory not specified in site `%s'.\n" msgstr "%s: Fr die Site `%s' ist kein lokales Verzeichnis angegeben.\n" #: src/console_fe.c:1018 #, c-format msgid "%s: Invalid port used in site `%s'.\n" msgstr "%s: Fr die Site `%s' ist ein ungltiger Port angegeben.\n" #: src/console_fe.c:1022 #, c-format msgid "%s: %s cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s kann keine symbolischen Links beibehalten (Site `%s').\n" #: src/console_fe.c:1026 #, c-format msgid "%s: Cannot use a relative remote directory in %s (site `%s').\n" msgstr "" "%s: Bei %s ist keine relative Verzeichnisangabe auf dem Server mglich (Site " "`%s').\n" #: src/console_fe.c:1029 #, c-format msgid "%s: File permissions are not supported in %s (site `%s').\n" msgstr "%s: %s untersttzt keine Zugriffsrechte (Site `%s').\n" #: src/console_fe.c:1032 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n" msgstr "" "%s: Der sichere Modus kann nicht in Verbindung mit nooverwrite verwendet " "werden (Site `%s').\n" #: src/console_fe.c:1035 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n" msgstr "" "%s: Der sichere Modus kann nicht in Verbindung mit tempupload verwendet " "werden (Site `%s').\n" #: src/console_fe.c:1038 #, c-format msgid "%s: Can only check for renamed files when checksumming (site `%s').\n" msgstr "" "%s: Kann nur bei Verwendung von Prfsummen auf umbenannte Dateien testen " "(Site `%s').\n" #: src/console_fe.c:1041 #, c-format msgid "%s: The protocol `%s' is unsupported (site `%s').\n" msgstr "%s: Protokoll `%s' wird nicht untersttzt (Site `%s').\n" #: src/console_fe.c:1048 #, c-format msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" msgstr "" "%s: Unvorhergesehener Fehler %d in Site `%s' - bitte wenden Sie sich an den " "Maintainer.\n" #: src/console_fe.c:1066 #, c-format msgid "" "%s: Error: Corrupt site storage file for `%s':\n" "%s: %s\n" msgstr "" "%s: Fehler: Datei fr Site `%s' beschdigt:\n" "%s: %s\n" #: src/console_fe.c:1075 #, c-format msgid "" "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n" msgstr "" "%s: Fehler: Fr `%s' existiert noch keine Datei.\n" "%s: Verwenden Sie --init, --catchup oder --fetch um die Datei zu erstellen.\n" #: src/console_fe.c:1088 #, c-format msgid "%s: Skipping site `%s'.\n" msgstr "%s: berspringe Site `%s'.\n" #: src/console_fe.c:1103 #, c-format msgid "%s: %s completed successfully.\n" msgstr "%s: %s erfolgreich abgeschlossen.\n" #: src/console_fe.c:1109 #, c-format msgid "%s: %s unsupported for %s.\n" msgstr "%s: %s wird bei %s nicht untersttzt.\n" #: src/console_fe.c:1114 #, c-format msgid "%s: Errors occurred while %s the %s site.\n" msgstr "%s: Fehler beim %s %s.\n" #: src/console_fe.c:1119 #, c-format msgid "%s: Error: Could not resolve remote hostname (%s).\n" msgstr "%s: Fehler: Konnte den Namen des Servers nicht auflsen (%s).\n" #: src/console_fe.c:1125 #, c-format msgid "%s: Error: Could not resolve hostname of proxy server (%s).\n" msgstr "%s: Fehler: Konnte den Namen des Proxy-Servers nicht auflsen (%s).\n" #: src/console_fe.c:1131 #, c-format msgid "%s: Error: Could not connect to proxy server (%s port %d).\n" msgstr "" "%s: Fehler: Verbindungsaufbau zum Proxy-Server gescheitert (%s Port %d).\n" #: src/console_fe.c:1134 #, c-format msgid "%s: Error: Could not connect to server (%s port %d).\n" msgstr "%s: Fehler: Verbindungsaufbau zum Server gescheitert (%s Port %d).\n" #: src/console_fe.c:1140 #, c-format msgid "%s: Error: Could not authorise user on server.\n" msgstr "%s: Fehler: Konnte auf dem Server den Benutzer nicht anmelden.\n" #: src/console_fe.c:1145 #, c-format msgid "%s: Error: %s\n" msgstr "%s: Fehler: %s\n" #: src/console_fe.c:1149 #, c-format msgid "%s: Error: Could not authorise user on proxy server (%s).\n" msgstr "" "%s: Fehler: Konnte auf dem Proxy-Server (%s) den Benutzer nicht anmelden.\n" #: src/console_fe.c:1154 #, c-format msgid "" "%s: in issue_error\n" "%s" msgstr "" "%s: in issue_error\n" "%s" #: src/console_fe.c:1168 #, c-format msgid "%s: Error: Environment variable HOME not set.\n" msgstr "%s: Fehler: Umgebungsvariable HOME nicht gesetzt.\n" #: src/console_fe.c:1176 #, c-format msgid "%s: Error: Could not open rcfile: %s\n" msgstr "%s: Fehler: Konnte rc-Datei nicht ffnen: %s\n" #: src/console_fe.c:1179 #, c-format msgid "%s: Error: rcfile permissions allow other users to read your rcfile.\n" msgstr "" "%s: Fehler: Die Zugriffsrechte der rc-Datei erlauben anderen Benutzern " "lesenden Zugriff.\n" #: src/console_fe.c:1180 src/console_fe.c:1192 #, c-format msgid "%s: Set the permissions to 0600.\n" msgstr "%s: Setzen Sie die Zugriffsrechte auf 0600.\n" #: src/console_fe.c:1183 #, c-format msgid "%s: Error: Could not open storage directory: %s\n" msgstr "%s: Fehler: Konnte Datenbank-Verzeichnis nicht ffnen: %s\n" #: src/console_fe.c:1184 #, c-format msgid "" "%s: You need to create this directory and set the permissions to 0700.\n" msgstr "%s: Legen Sie dieses Verzeichnis mit den Zugriffsrechten 0700 an.\n" #: src/console_fe.c:1187 #, c-format msgid "%s: Error: storage directory permissions incorrect.\n" msgstr "%s: Fehler: Das Datenbank-Verzeichnis hat falsche Zugriffsrechte.\n" #: src/console_fe.c:1188 #, c-format msgid "%s: Set the permissions to 0700.\n" msgstr "%s: Setzen Sie die Zugriffsrechte auf 0700.\n" #: src/console_fe.c:1191 #, c-format msgid "%s: Error: ~/.netrc permissions incorrect.\n" msgstr "%s: Fehler: ~/.netrc hat falsche Zugriffsrechte.\n" #: src/console_fe.c:1197 #, c-format msgid "" "%s: init_paths gave %d\n" "%s" msgstr "" "%s: init_paths gab %d zurck\n" "%s" #: src/console_fe.c:1204 #, c-format msgid "%s: Error: Could not parse ~/.netrc.\n" msgstr "%s: Fehler: Konnte ~/.netrc nicht einlesen.\n" #: src/console_fe.c:1222 src/console_fe.c:1321 #, c-format msgid "%s: Nothing to do - no changes found.\n" msgstr "%s: Nichts zu tun - keine nderungen vorgefunden.\n" #: src/console_fe.c:1231 #, c-format msgid "" "%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n" msgstr "" "%s: Fehler: Kein Schreibzugriff auf die Datei der Site (%s)\n" "%s: Fehler: %s\n" "%s: Kann Site `%s' nicht aktualisieren.\n" #: src/console_fe.c:1255 #, fuzzy, c-format msgid "" "%s: Warning: Current state method differs from stored in site `%s'.\n" "%s: All existing files will appear changed (use catchup?).\n" msgstr "" "%s: Warnung: Aktuelle Abfrage-Methode weicht von der in Site `%s' " "gespeicherten ab.\n" "%s: Alle bestehenden Dateien werden als gendert erscheinen (`catchup' " "verwenden?).\n" #: src/console_fe.c:1261 #, c-format msgid "%s: The remote site needs updating (%d items to update).\n" msgstr "" "%s: Verzeichnis auf dem Server muss aktualisiert werden (%d Eintrge).\n" #: src/console_fe.c:1263 #, c-format msgid "%s: The remote site needs updating (1 item to update).\n" msgstr "%s: Verzeichnis auf dem Server muss aktualisiert werden (1 Eintrag).\n" #: src/console_fe.c:1266 #, c-format msgid "%s: The remote site does not need updating.\n" msgstr "%s: Der Server ist bereits auf dem neuesten Stand.\n" #: src/console_fe.c:1274 #, c-format msgid "%s: All the files and directories are marked as NOT updated remotely.\n" msgstr "" "%s: Alle Dateien und Verzeichnisse wurden als zu aktualisieren " "gekennzeichnet.\n" #: src/console_fe.c:1279 #, c-format msgid "%s: All the files and and directories are marked as updated remotely.\n" msgstr "" "%s: Alle Dateien und Verzeichnisse wurden als aktualisiert gekennzeichnet.\n" #: src/console_fe.c:1288 #, c-format msgid "" "%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n" msgstr "" "%s: Holen der Datei-Liste von Site `%s' gescheitert:\n" "%s: %s\n" #: src/console_fe.c:1302 #, c-format msgid "" "%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n" msgstr "" "%s: Holen der Datei-Liste zum Vergleich mit Site `%s' gescheitert:\n" "%s: %s\n" #: src/console_fe.c:1309 #, c-format msgid "%s: Verify found %d files missing from server.\n" msgstr "%s: Der Vergleich hat %d auf dem Server fehlende Dateien gefunden.\n" #: src/console_fe.c:1312 #, fuzzy, c-format msgid "%s: Remote site not synchronized with stored state.\n" msgstr "%s: Die Site ist mit dem gespeicherten Zustand nicht synchron.\n" #: src/console_fe.c:1325 #, c-format msgid "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" msgstr "" "%s: Ich weigere mich, beim Abgleich (synchronize) alle lokalen Dateien zu " "lschen.\n" "%s: Um die Dateien hochzuladen steht --update (aktualisieren) zur " "Verfgung.\n" #: src/console_fe.c:1333 #, c-format msgid "" "%s: in act_on_site\n" "%s" msgstr "" "%s: in act_on_site\n" "%s" #: src/console_fe.c:1344 #, c-format msgid "Usage: %s [OPTIONS] [MODE] [sitename]...\n" msgstr "Aufruf: %s [OPTIONEN] [MODUS] [sitename]...\n" #: src/console_fe.c:1346 #, c-format msgid "Options: \n" msgstr "Optionen: \n" #: src/console_fe.c:1349 #, fuzzy, c-format msgid "" " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" msgstr "" " -d, --debug=WAS[,WAS] Aktiviert Debug-Meldungen; WAS ist eins der " "folgenden:\n" " socket, files, rcfile, ftp, http, httpbody, xml, xmlparse, cleartext\n" " Warnung: cleartext zeigt die (normalerweise verborgene) Passwrter an\n" " -g, --logfile=DATEI Schreibe Debug-Meldungen in DATEI (sonst auf " "stderr)\n" #: src/console_fe.c:1356 #, fuzzy, c-format msgid "" " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites " "(default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote " "state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n" msgstr "" " -r, --rcfile=DATEI Verwende eine andere rc-Datei\n" " -p, --storepath=PFAD Verwende anderes Datenbank-Verzeichnis\n" " -y, --prompting Vor jeder Aktualisierung nachfragen\n" " -a, --allsites Aktion auf ALLEN bekannten Sites ausfhren\n" " -k, --keep-going Aktualisierung bei Fehlern fortsetzen\n" " -o, --show-progress Zeige, zu wie viel Prozent der Transfer beendet ist\n" " -q, --quiet Beim Ausfhren ruhig bleiben\n" " -qq, --silent Beim Ausfhren still bleiben (strker als `-q')\n" "Aktions-Modi:\n" " -l, --list Zeige Vernderungen zwischen lokalem Verzeichnis\n" " und Server an (Voreinstellung)\n" " -ll, --flatlist Wie `-l', erlaubt leichteres Weiterverarbeiten\n" " -v, --view Gib eine Liste der definierten Sites aus\n" " -i, --initialize Kennzeichne alle Dateien als zu aktualisieren\n" " -f, --fetch Finde heraus, welche Dateien auf dem Server liegen\n" " -e, --verify Vergleiche den gespeicherten mit dem wirklichen\n" " Zustand der Site\n" " -c, --catchup Kennzeichne alle Dateien als aktualisiert\n" " -s, --synchronize Gleiche die lokalen Dateien an den Server an\n" " -u, --update Aktualisiere die Dateien auf dem Server\n" " -h, --help Gib diese Hilfe aus\n" " -V, --version Gib die Versionsnummer aus\n" "Wenden Sie sich bei Problemen oder Anregungen bitte an sitecopy@lyra.org\n" #: src/sitestore.c:326 #, c-format msgid "Invalid checksum at line %d" msgstr "" #: src/sitestore.c:371 #, c-format msgid "Boolean missing in 'ascii' at line %d" msgstr "" #: src/sitestore.c:396 #, c-format msgid "Size overflow (%s) in '%s' at line %d" msgstr "" #: src/davdriver.c:195 msgid "The connection timed out." msgstr "Verbindung wegen Zeitberschreitung abgebrochen." #: src/davdriver.c:224 #, fuzzy msgid "Could not write SSL certificate" msgstr "Konnte nicht in diese Datei schreiben: %s" #: src/davdriver.c:244 msgid "SSL support has not be compiled in." msgstr "Untersttzung fr SSL wurde beim Compilieren nicht aktiviert." #: src/davdriver.c:252 #, fuzzy, c-format msgid "Could not load certificate `%s'." msgstr "Konnte nicht in diese Datei schreiben: %s" #: src/davdriver.c:290 #, fuzzy, c-format msgid "Could not read SSL client certificate '%s'." msgstr "Konnte nicht in diese Datei schreiben: %s" #: src/davdriver.c:303 #, fuzzy, c-format msgid "Could not decrypt SSL client certificate '%s'." msgstr "Konnte nicht in diese Datei schreiben: %s" #: src/davdriver.c:325 msgid "The server does not appear to be a WebDAV server." msgstr "Der Server scheint kein WebDAV-Server zu sein." #: src/davdriver.c:330 msgid "The server does not support the executable live property." msgstr "Der Server untersttzt das Zugriffsrecht `ausfhrbar' nicht." #: src/davdriver.c:376 src/davdriver.c:443 src/davdriver.c:480 src/ftp.c:888 #: src/ftp.c:972 #, fuzzy msgid "Could not open file" msgstr "Konnte Datei nicht ffnen: " #: src/davdriver.c:411 #, fuzzy, c-format msgid "Could not stat file: %s" msgstr "Konnte nicht in diese Datei schreiben: %s" #: src/davdriver.c:670 msgid "Could not access resource" msgstr "Konnte nicht auf Ressource zugreifen" #: src/sites.c:160 msgid "Could not set modification time of local file." msgstr "Konnte den Zeitstempel der lokalen Datei nicht ndern." #: src/sites.c:308 msgid "" "Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode." msgstr "" "Hochladen war erfolgreich, konnte aber Zeitstempel nicht abfragen.\n" "Stelle den `sicheren Modus' ab, wenn diese Meldung weiter auftritt." #: src/sites.c:515 msgid "Remote file has been modified - not overwriting with local changes" msgstr "" "Datei auf dem Server wurde gendert - berschreibe nicht mit lokalen " "nderungen" #: src/sites.c:828 msgid "Could not examine file." msgstr "Konnte Datei nicht untersuchen." #: src/sites.c:871 msgid "Could not checksum file" msgstr "Konnte keine Prfsumme fr Datei errechnen." #: src/sites.c:887 msgid "The target of the symlink could not be read." msgstr "Konnte das Ziel des symbolischen Links nicht lesen." #: src/common.c:113 msgid "Unknown system error" msgstr "Unbekannter System-Fehler" #: src/ftp.c:153 #, c-format msgid "%s: connection was closed by server." msgstr "%s: Verbindung vom Server geschlossen." #: src/ftp.c:157 #, c-format msgid "%s: connection timed out." msgstr "%s: Verbindung wegen Zeitberschreitung geschlossen." #: src/ftp.c:195 #, fuzzy msgid "Could not read response line" msgstr "Konnte Rumpf der Antwort nicht lesen" #: src/ftp.c:229 #, fuzzy msgid "Cannot parse MDTM response; wrong length." msgstr "Konnte Status-Zeile des Servers nicht interpretieren." #: src/ftp.c:236 #, fuzzy msgid "Cannot parse MDTM response." msgstr "Konnte Status-Zeile des Servers nicht interpretieren." #: src/ftp.c:260 #, fuzzy msgid "Could not find address in PASV response" msgstr "Konnte Rumpf der Antwort nicht lesen" #: src/ftp.c:267 #, fuzzy msgid "Could not parse PASV response" msgstr "Konnte Rumpf der Antwort nicht lesen" #: src/ftp.c:276 msgid "Invalid IP address in PASV response" msgstr "" #: src/ftp.c:296 #, fuzzy msgid "Malformed EPSV response" msgstr "Konnte Rumpf der Antwort nicht lesen" #: src/ftp.c:304 #, fuzzy msgid "Malformed port in EPSV response" msgstr "Konnte Rumpf der Antwort nicht lesen" #: src/ftp.c:449 msgid "Error sending file" msgstr "" #: src/ftp.c:463 src/ftp.c:489 #, fuzzy msgid "Error reading file" msgstr "Fehler beim Lesen des Rumpfs der Anfrage" #: src/ftp.c:480 #, fuzzy msgid "Could not send file" msgstr "Konnte Datei nicht ffnen: " #: src/ftp.c:510 src/ftp.c:991 #, fuzzy msgid "Error writing to file" msgstr "Fehler beim Warten auf Antwort" #: src/ftp.c:516 msgid "Receiving file" msgstr "" #: src/ftp.c:532 #, fuzzy msgid "Could not connect passive data socket" msgstr "Konnte keine SSL-Sitzung herstellen" #: src/ftp.c:647 msgid "Active open failed: could not determine address of control socket" msgstr "" #: src/ftp.c:659 #, fuzzy msgid "Active open failed: could not create socket" msgstr "Konnte keine SSL-Sitzung herstellen" #: src/ftp.c:667 msgid "Active open failed: could not bind to address" msgstr "" #: src/ftp.c:677 msgid "Active open failed: could not determine address of data socket" msgstr "" #: src/ftp.c:684 #, fuzzy msgid "Could not determine bound port number for data socket" msgstr "Konnte keine SSL-Sitzung herstellen" #: src/ftp.c:727 msgid "Active open failed: could not accept connection" msgstr "" #: src/ftp.c:800 msgid "Error closing data socket" msgstr "" #: src/ftp.c:894 #, fuzzy msgid "Could not determine length of file" msgstr "Konnte Lnge der Datei nicht herausfinden: %s" #: src/ftp.c:905 #, fuzzy msgid "Could not rewind to beginning of file" msgstr "Konnte Lnge der Datei nicht herausfinden: %s" #: src/ftp.c:1152 #, fuzzy msgid "Could not read 'LIST' response." msgstr "Konnte Rumpf der Antwort nicht lesen" #: src/ftp.c:1161 #, fuzzy, c-format msgid "Parse error in LIST response: %s" msgstr "Konnte Rumpf der Antwort nicht lesen" #: gnome/init.c:51 msgid "_New site..." msgstr "" #: gnome/init.c:51 gnome/init.c:171 msgid "Create a new site definition" msgstr "" #: gnome/init.c:54 msgid "_Open..." msgstr "" #: gnome/init.c:54 msgid "Open a new rc file. (EXPERIMENTAL)." msgstr "" #: gnome/init.c:57 msgid "_Save Sites" msgstr "" #: gnome/init.c:57 gnome/init.c:177 msgid "Save the current site definitions" msgstr "" #: gnome/init.c:60 msgid "Sav_e Sites As..." msgstr "" #: gnome/init.c:60 msgid "Save the current site definitions to a file." msgstr "" #: gnome/init.c:63 #, fuzzy msgid "_Delete this site" msgstr "Lsche %s" #: gnome/init.c:63 msgid "Delete the selected site entry" msgstr "" #: gnome/init.c:69 msgid "E_xit" msgstr "" #: gnome/init.c:69 gnome/init.c:202 msgid "Exit the program" msgstr "" #: gnome/init.c:78 #, fuzzy msgid "_Initialise site" msgstr "Initialisierung" #: gnome/init.c:78 msgid "All files will be uploaded if a site is initialised" msgstr "" #: gnome/init.c:81 #, fuzzy msgid "'_Catchup' site" msgstr "Kennzeichnung als `aktualisiert'" #: gnome/init.c:81 msgid "Records the site as already updated." msgstr "" #: gnome/init.c:84 msgid "_Fetch site listing" msgstr "" #: gnome/init.c:84 msgid "Figures out which files are new/changed from the actual remote site." msgstr "" #: gnome/init.c:88 #, fuzzy msgid "_Resynchronize site" msgstr "Abgleichen" #: gnome/init.c:88 msgid "Copies newer files from the remote site to the local drive." msgstr "" #: gnome/init.c:91 msgid "_Update site..." msgstr "" #: gnome/init.c:91 msgid "Apply the local site's changes to the remote site." msgstr "" #: gnome/init.c:94 msgid "Update _ALL sites" msgstr "" #: gnome/init.c:94 gnome/init.c:137 msgid "Performs the required operations on all site definitions. (TODO)." msgstr "" #: gnome/init.c:98 msgid "Rescan local directory" msgstr "" #: gnome/init.c:98 #, fuzzy msgid "Re-reads the local directory of the selected site." msgstr "%s: Fr die Site `%s' ist kein lokales Verzeichnis angegeben.\n" #: gnome/init.c:106 msgid "_Required updates" msgstr "" #: gnome/init.c:106 msgid "Displays a brief report of any required updates." msgstr "" #: gnome/init.c:109 msgid "Site web-r_eport" msgstr "" #: gnome/init.c:109 msgid "" "Generates a web page detailing the changes required on the selected site." msgstr "" #: gnome/init.c:112 msgid "Prin_t site info..." msgstr "" #: gnome/init.c:112 msgid "Print information about the selected site" msgstr "" #: gnome/init.c:119 msgid "_Backup files status" msgstr "" #: gnome/init.c:119 msgid "Save the 'state' of your local files, in case of accident." msgstr "" #: gnome/init.c:122 msgid "Restore files status..." msgstr "" #: gnome/init.c:122 gnome/init.c:129 msgid "If a backup has previously been made, it will be restored." msgstr "" #: gnome/init.c:126 msgid "_Backup site definitions" msgstr "" #: gnome/init.c:126 msgid "Backup your site definitions, in case you delete your sites." msgstr "" #: gnome/init.c:129 msgid "Restore site definitions..." msgstr "" #: gnome/init.c:137 msgid "Preferences..." msgstr "" #: gnome/init.c:146 msgid "_About XSitecopy" msgstr "" #: gnome/init.c:146 msgid "Information about XSitecopy" msgstr "" #: gnome/init.c:158 msgid "_File" msgstr "" #: gnome/init.c:159 #, fuzzy msgid "_Operations" msgstr "Optionen: \n" #: gnome/init.c:160 msgid "_Reports" msgstr "" #: gnome/init.c:161 msgid "_Settings" msgstr "" #: gnome/init.c:162 msgid "_Backup" msgstr "" #: gnome/init.c:163 msgid "_Help" msgstr "" #: gnome/init.c:171 msgid "New site" msgstr "" #: gnome/init.c:174 msgid "Open" msgstr "" #: gnome/init.c:174 msgid "Open a new site definitions file." msgstr "" #: gnome/init.c:177 msgid "Save" msgstr "" #: gnome/init.c:180 #, fuzzy msgid "Delete site" msgstr "Lsche %s" #: gnome/init.c:180 msgid "Delete the selected site" msgstr "" #: gnome/init.c:185 #, fuzzy msgid "Initialise" msgstr "Initialisierung" #: gnome/init.c:185 msgid "Initialise the site (mark all files as needing to be updated)." msgstr "" #: gnome/init.c:188 #, fuzzy msgid "Catch-up" msgstr "Kennzeichnung als `aktualisiert'" #: gnome/init.c:188 msgid "Mark all of the selected site's files as updated." msgstr "" #: gnome/init.c:194 #, fuzzy msgid "Download" msgstr "Lade %s herunter: [" #: gnome/init.c:194 msgid "Download newer files from the remote site. (Use with care)" msgstr "" #: gnome/init.c:198 msgid "Updates the selected site" msgstr "" #: gnome/init.c:202 msgid "Quit" msgstr "" #: gnome/init.c:412 #, fuzzy, c-format msgid "%s: Error: Could not read rcfile: %s.\n" msgstr "%s: Fehler: Konnte rc-Datei nicht ffnen: %s.\n" #: gnome/main.c:184 msgid "" "Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" msgstr "" #: gnome/misc.c:580 #, fuzzy, c-format msgid "Server not specified in site `%s'.\n" msgstr "%s: Fr die Site `%s' ist kein Server angegeben.\n" #: gnome/misc.c:584 #, fuzzy, c-format msgid "Remote directory not specified in site `%s'.\n" msgstr "%s: Fr die Site `%s' ist kein Verzeichnis auf dem Server angegeben.\n" #: gnome/misc.c:588 #, fuzzy, c-format msgid "Local directory not specified in site `%s'.\n" msgstr "%s: Fr die Site `%s' ist kein lokales Verzeichnis angegeben.\n" #: gnome/misc.c:592 #, fuzzy, c-format msgid "" "Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: Konnte Verzeichnis fr `%s' nicht einlesen:\n" "\t%s\n" #: gnome/misc.c:596 #, fuzzy, c-format msgid "Invalid port used in site `%s'.\n" msgstr "%s: Fr die Site `%s' ist ein ungltiger Port angegeben.\n" #: gnome/misc.c:600 #, fuzzy, c-format msgid "Protocol '%s' cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s kann keine symbolischen Links beibehalten (Site `%s').\n" #: gnome/misc.c:604 #, fuzzy, c-format msgid "Cannot use a relative remote directory protocol '%s' (site `%s').\n" msgstr "" "%s: Bei %s ist keine relative Verzeichnisangabe auf dem Server mglich (Site " "`%s').\n" #: gnome/misc.c:607 #, c-format msgid "%s's protocol does not currently support maintaining permissions." msgstr "" #: gnome/misc.c:611 #, fuzzy, c-format msgid "Could not find 'relative' local directory" msgstr "Konnte keine SSL-Sitzung herstellen" #: lib/neon/ne_redirect.c:92 #, fuzzy msgid "Could not parse redirect destination URL" msgstr "Konnte Status-Zeile des Servers nicht interpretieren." #: lib/neon/ne_gnutls.c:162 #, c-format msgid "[unprintable:#%lu]" msgstr "" #: lib/neon/ne_gnutls.c:188 msgid "[unprintable]" msgstr "" #: lib/neon/ne_gnutls.c:696 lib/neon/ne_openssl.c:419 msgid "Server certificate was missing commonName attribute in subject name" msgstr "" #: lib/neon/ne_gnutls.c:736 lib/neon/ne_openssl.c:638 #, fuzzy, c-format msgid "SSL negotiation failed: %s" msgstr "Konnte nicht in diese Datei schreiben: %s" #: lib/neon/ne_gnutls.c:745 msgid "Server did not send certificate chain" msgstr "" #: lib/neon/ne_openssl.c:451 #, c-format msgid "Certificate verification error: %s" msgstr "" #: lib/neon/ne_openssl.c:657 msgid "SSL server did not present certificate" msgstr "" #: lib/neon/ne_openssl.c:666 msgid "Server certificate changed: connection intercepted?" msgstr "" #: lib/neon/ne_session.c:356 lib/neon/ne_session.c:367 msgid "[invalid date]" msgstr "" #: lib/neon/ne_session.c:380 msgid "certificate is not yet valid" msgstr "" #: lib/neon/ne_session.c:381 msgid "certificate has expired" msgstr "" #: lib/neon/ne_session.c:382 msgid "certificate issued for a different hostname" msgstr "" #: lib/neon/ne_session.c:383 msgid "issuer is not trusted" msgstr "" #: lib/neon/ne_session.c:388 msgid "Server certificate verification failed: " msgstr "" #: lib/neon/ne_socket.c:514 lib/neon/ne_socket.c:568 lib/neon/ne_socket.c:671 #, fuzzy msgid "Connection closed" msgstr "Verbindung vom Server geschlossen" #: lib/neon/ne_socket.c:578 lib/neon/ne_socket.c:683 #, fuzzy msgid "Secure connection truncated" msgstr "Verbindung wegen Zeitberschreitung abgebrochen." #: lib/neon/ne_socket.c:590 lib/neon/ne_socket.c:695 #, fuzzy, c-format msgid "SSL error: %s" msgstr "%s: Fehler: %s\n" #: lib/neon/ne_socket.c:593 #, c-format msgid "SSL error code %d/%d/%lu" msgstr "" #: lib/neon/ne_socket.c:676 #, fuzzy, c-format msgid "SSL alert received: %s" msgstr "%s: Fehler: %s\n" #: lib/neon/ne_socket.c:691 msgid "SSL socket read failed" msgstr "" #: lib/neon/ne_socket.c:790 msgid "Line too long" msgstr "Zeile zu lang" #: lib/neon/ne_socket.c:935 lib/neon/ne_socket.c:941 msgid "Host not found" msgstr "Host nicht gefunden" #: lib/neon/ne_socket.c:1048 #, fuzzy msgid "Connection timed out" msgstr "Verbindung wegen Zeitberschreitung abgebrochen." #: lib/neon/ne_socket.c:1210 msgid "Socket descriptor number exceeds FD_SETSIZE" msgstr "" #: lib/neon/ne_socket.c:1270 msgid "Socket family not supported" msgstr "" #: lib/neon/ne_socket.c:1493 msgid "Client certificate verification failed" msgstr "" #: lib/neon/ne_socket.c:1509 msgid "SSL disabled due to lack of entropy" msgstr "" #: lib/neon/ne_socket.c:1516 msgid "SSL disabled due to library version mismatch" msgstr "" #: lib/neon/ne_socket.c:1522 #, fuzzy msgid "Could not create SSL structure" msgstr "Konnte keine SSL-Sitzung herstellen" #: lib/neon/ne_request.c:194 #, fuzzy, c-format msgid "%s: connection was closed by proxy server" msgstr "%s: Verbindung vom Proxy-Server geschlossen." #: lib/neon/ne_request.c:197 #, fuzzy, c-format msgid "%s: connection was closed by server" msgstr "%s: Verbindung vom Server geschlossen." #: lib/neon/ne_request.c:202 #, fuzzy, c-format msgid "%s: connection timed out" msgstr "%s: Verbindung wegen Zeitberschreitung geschlossen." #: lib/neon/ne_request.c:307 msgid "offset invalid" msgstr "" #: lib/neon/ne_request.c:312 #, fuzzy, c-format msgid "Could not seek to offset %s of request body file: %s" msgstr "Konnte nicht in diese Datei schreiben: %s" #: lib/neon/ne_request.c:360 msgid "Could not send request body" msgstr "Konnte den Rumpf der Anfrage nicht schicken" #: lib/neon/ne_request.c:699 msgid "Could not read chunk size" msgstr "Lesefehler bei Ermittlung der Blockgre" #: lib/neon/ne_request.c:706 msgid "Could not parse chunk size" msgstr "Parser-Fehler bei Ermittlung der Blockgre" #: lib/neon/ne_request.c:743 msgid "Could not read response body" msgstr "Konnte Rumpf der Antwort nicht lesen" #: lib/neon/ne_request.c:759 #, fuzzy msgid "Could not read chunk delimiter" msgstr "Lesefehler bei Ermittlung der Blockgre" #: lib/neon/ne_request.c:762 msgid "Chunk delimiter was invalid" msgstr "" #: lib/neon/ne_request.c:868 msgid "Could not read status line" msgstr "Konnte Status-Zeile des Servers nicht lesen" #: lib/neon/ne_request.c:890 #, fuzzy msgid "Could not parse response status line" msgstr "Konnte Status-Zeile des Servers nicht interpretieren." #: lib/neon/ne_request.c:902 #, fuzzy msgid "Could not read interim response headers" msgstr "Konnte Rumpf der Antwort nicht lesen" #: lib/neon/ne_request.c:936 msgid "Could not send request" msgstr "Konnte keine Anfrage (request) schicken" #: lib/neon/ne_request.c:984 lib/neon/ne_request.c:1002 #: lib/neon/ne_request.c:1012 msgid "Error reading response headers" msgstr "Fehler beim Lesen der Kopfzeilen (header) der Antwort" #: lib/neon/ne_request.c:1030 msgid "Response header too long" msgstr "Kopfzeilen (header) der Antwort zu lang" #: lib/neon/ne_request.c:1112 #, fuzzy msgid "Response exceeded maximum number of header fields" msgstr "Antwort hatte zu viele Header-Felder." #: lib/neon/ne_request.c:1129 #, fuzzy, c-format msgid "Could not resolve hostname `%s': %s" msgstr "%s: Fehler: Konnte den Namen des Servers nicht auflsen (%s).\n" #: lib/neon/ne_request.c:1260 msgid "Unknown transfer-coding in response" msgstr "" #: lib/neon/ne_request.c:1271 msgid "Invalid Content-Length in response" msgstr "" #: lib/neon/ne_request.c:1344 #, c-format msgid "Could not write to file: %s" msgstr "Konnte nicht in diese Datei schreiben: %s" #: lib/neon/ne_request.c:1417 #, fuzzy, c-format msgid "Could not create SSL connection through proxy server: %s" msgstr "Konnte durch den Proxy-Server keine SSL-Verbindung herstellen" #: lib/neon/ne_request.c:1464 #, fuzzy msgid "Could not create socket" msgstr "Konnte keine SSL-Sitzung herstellen" #: lib/neon/ne_request.c:1526 msgid "Could not connect to proxy server" msgstr "Verbindungsaufbau zum Proxy-Server gescheitert." #: lib/neon/ne_request.c:1527 msgid "Could not connect to server" msgstr "Verbindungsaufbau zum Server gescheitert." #: lib/neon/ne_xml.c:280 #, fuzzy, c-format msgid "XML parse error at line %d: invalid element name" msgstr "Fehler beim XML-Parsing in Zeile %d: %s." #: lib/neon/ne_xml.c:452 #, fuzzy msgid "Unknown error" msgstr "Unbekannter System-Fehler" #: lib/neon/ne_xml.c:537 msgid "Invalid Byte Order Mark" msgstr "" #: lib/neon/ne_xml.c:625 #, fuzzy, c-format msgid "XML parse error at line %d: %s" msgstr "Fehler beim XML-Parsing in Zeile %d: %s." #: lib/neon/ne_props.c:371 lib/neon/ne_props.c:435 #, fuzzy msgid "Response exceeds maximum property count" msgstr "Antwort hatte zu viele Header-Felder." #: lib/neon/ne_compress.c:184 #, c-format msgid "%s: %s (code %d)" msgstr "" #: lib/neon/ne_compress.c:232 #, fuzzy msgid "Could not inflate data" msgstr "Konnte Datei nicht ffnen: " #: lib/neon/ne_compress.c:293 #, fuzzy msgid "Could not initialize zlib" msgstr "Konnte Datei nicht ffnen: " #: lib/neon/ne_xmlreq.c:36 #, fuzzy, c-format msgid "Could not parse response: %s" msgstr "Konnte Rumpf der Antwort nicht lesen" #: lib/neon/ne_basic.c:98 #, fuzzy, c-format msgid "Could not determine file size: %s" msgstr "Konnte Lnge der Datei nicht herausfinden: %s" #: lib/neon/ne_basic.c:149 msgid "Response did not include requested range" msgstr "" #: lib/neon/ne_basic.c:183 #, fuzzy msgid "Range is not satisfiable" msgstr "Range is not satisfiable." #: lib/neon/ne_basic.c:188 #, fuzzy msgid "Resource does not support ranged GET requests" msgstr "Server ermglicht keine teilweisen GETs." #: lib/neon/ne_auth.c:130 #, fuzzy, c-format msgid "Could not authenticate to server: %s" msgstr "Verbindungsaufbau zum Server gescheitert." #: lib/neon/ne_auth.c:135 #, fuzzy, c-format msgid "Could not authenticate to proxy server: %s" msgstr "Verbindungsaufbau zum Proxy-Server gescheitert." #: lib/neon/ne_auth.c:358 #, c-format msgid "rejected %s challenge" msgstr "" #: lib/neon/ne_auth.c:374 msgid "missing realm in Basic challenge" msgstr "" #: lib/neon/ne_auth.c:469 msgid "invalid Negotiate token" msgstr "" #: lib/neon/ne_auth.c:492 #, fuzzy msgid "GSSAPI authentication error: " msgstr "Anmeldung wird bentigt auf %s `%s':\n" #: lib/neon/ne_auth.c:505 #, c-format msgid "GSSAPI failure (code %u)" msgstr "" #: lib/neon/ne_auth.c:540 msgid "ignoring empty Negotiate continuation" msgstr "" #: lib/neon/ne_auth.c:555 msgid "Negotiate response verification failed: invalid response header token" msgstr "" #: lib/neon/ne_auth.c:577 #, c-format msgid "Negotiate response verification failure: %s" msgstr "" #: lib/neon/ne_auth.c:697 msgid "unknown algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:701 msgid "incompatible algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:705 msgid "missing parameter in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:709 msgid "initial Digest challenge was stale" msgstr "" #: lib/neon/ne_auth.c:716 msgid "stale Digest challenge with new algorithm or realm" msgstr "" #: lib/neon/ne_auth.c:728 #, fuzzy msgid "could not parse domain in Digest challenge" msgstr "Konnte Status-Zeile des Servers nicht interpretieren." #: lib/neon/ne_auth.c:1036 msgid "Digest mutual authentication failure: missing parameters" msgstr "" #: lib/neon/ne_auth.c:1041 msgid "Digest mutual authentication failure: client nonce mismatch" msgstr "" #: lib/neon/ne_auth.c:1051 msgid "Digest mutual authentication failure: could not parse nonce count" msgstr "" #: lib/neon/ne_auth.c:1056 #, c-format msgid "Digest mutual authentication failure: nonce count mismatch (%u not %u)" msgstr "" #: lib/neon/ne_auth.c:1099 msgid "Digest mutual authentication failure: request-digest mismatch" msgstr "" #: lib/neon/ne_auth.c:1225 #, c-format msgid "ignored %s challenge" msgstr "" #: lib/neon/ne_auth.c:1304 #, fuzzy msgid "could not parse challenge" msgstr "Parser-Fehler bei Ermittlung der Blockgre" #: lib/neon/ne_207.c:198 #, c-format msgid "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" msgstr "" "Ungltige HTTP Status-Zeile im Status-Element in Zeile %d der Antwort:\n" "Status-Zeile war: %s" #: lib/neon/ne_locks.c:584 msgid "LOCK response missing Lock-Token header" msgstr "" #: lib/neon/ne_locks.c:759 #, c-format msgid "Response missing activelock for %s" msgstr "" #: lib/neon/ne_locks.c:801 #, c-format msgid "No activelock for <%s> returned in LOCK refresh response" msgstr "" #: lib/rpmatch.c:79 msgid "^[yY]" msgstr "^[jJyY]" #: lib/rpmatch.c:82 msgid "^[nN]" msgstr "^[nN]" #: lib/getopt.c:664 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: Option `%s' ist mehrdeutig\n" #: lib/getopt.c:688 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: Option `--%s' darf kein Argument haben\n" #: lib/getopt.c:693 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: Option `%c%s' darf kein Argument haben\n" #: lib/getopt.c:710 lib/getopt.c:883 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: Option `%s' erfordert ein Argument\n" #: lib/getopt.c:739 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: unbekannte Option `--%s'\n" #: lib/getopt.c:743 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: unbekannte Option `%c%s'\n" #: lib/getopt.c:769 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: unerlaubte Option -- %c\n" #: lib/getopt.c:772 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: ungltige Option -- %c\n" #: lib/getopt.c:802 lib/getopt.c:932 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: Option erfordert ein Argument -- %c\n" #: lib/getopt.c:849 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: Option `-W %s' ist mehrdeutig\n" #: lib/getopt.c:867 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: Option `-W %s' darf kein Argument haben\n" #~ msgid " bytes)" #~ msgstr " Byte)" #~ msgid "%s\n" #~ msgstr "%s\n" #, fuzzy #~ msgid "%s: %s" #~ msgstr "%s: %s\n" #~ msgid "%s: Aborted.\n" #~ msgstr "%s: Abgebrochen.\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal: %s (%d)\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: Signal empfangen: %s (%d)\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal %d\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: Signal %d empfangen\n" #~ msgid "%s: Cannot recover from segmentation fault, aborting.\n" #~ msgstr "%s: Kann Zugriffsverletzung nicht beheben, breche ab.\n" #~ msgid "%s: Aborting update...\n" #~ msgstr "%s: Breche Aktualisierung ab...\n" #~ msgid "%s: Terminating.\n" #~ msgstr "%s: Beende.\n" #, fuzzy #~ msgid " of request body file: %s" #~ msgstr "Konnte nicht in diese Datei schreiben: %s" #~ msgid "Error reading request body." #~ msgstr "Fehler beim Lesen des Rumpfs der Anfrage" #, fuzzy #~ msgid "unknown error code" #~ msgstr "Unbekannter System-Fehler" #~ msgid "Error reading chunked response body" #~ msgstr "Fehler beim blockweisen Lesen des Rumpfs der Antwort" #~ msgid "document root" #~ msgstr "Wurzel (root) des Dokuments" #~ msgid "unknown element" #~ msgstr "unbekanntes Element" #~ msgid "unspecified" #~ msgstr "nicht angegeben" #~ msgid "XML is not valid (%s found in parent %s)" #~ msgstr "XML ist ungltig (%s im `parent' %s gefunden)" #~ msgid "Unknown XML element `%s (in %s)'" #~ msgstr "Unbekanntes XML-Element `%s (in %s)'" #~ msgid "" #~ "The server did not authenticate itself correctly.\n" #~ "Report this error to your server administrator." #~ msgstr "" #~ "Der Server hat sich nicht korrekt authentifiziert.\n" #~ "Melden Sie diesen Fehler bitte dem Administrator des Servers." #~ msgid "" #~ "The proxy server did not authenticate itself correctly.\n" #~ "Report this error to your proxy server administrator." #~ msgstr "" #~ "Der Proxy-Server hat sich nicht korrekt authentifiziert.\n" #~ "Melden Sie diesen Fehler bitte dem Administrator des Proxy-Servers." #~ msgid "%s: socket error." #~ msgstr "%s: Socket-Fehler." #~ msgid "Timed out waiting for 100 Continue" #~ msgstr "Zeitberschreitung beim Warten auf \"100 Fortfahren\"" #, fuzzy #~ msgid "Host `%s' not found" #~ msgstr "Host nicht gefunden" #~ msgid "Host not found (try again later?)" #~ msgstr "Host nicht gefunden (spter nochmal versuchen?)" #~ msgid "Host exists but has no address." #~ msgstr "Host existiert, hat aber keine Adresse." #~ msgid "Non-recoverable error in resolver library." #~ msgstr "Nicht-behebbarer Fehler beim Auflsen des Namens." #~ msgid "Malformed header line." #~ msgstr "Kopfzeile hat ungltiges Format." #~ msgid "This application does not have SSL support." #~ msgstr "Diese Anwendung bietet keine SSL-Untersttzung." #, fuzzy #~ msgid "Recent Changes" #~ msgstr "Verndere %s" #, fuzzy #~ msgid "Changed Items" #~ msgstr "Verndere %s" #, fuzzy #~ msgid "Deleted Items" #~ msgstr "Lsche %s" sitecopy-0.16.6/po/Makefile.in.in0000664000076400007640000003552411035206526014672 0ustar joejoe# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.17 GETTEXT_MACRO_VERSION = 0.17 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: check-macro-version all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. check-macro-version: @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && $(SHELL) ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sitecopy-0.16.6/po/en@boldquot.header0000664000076400007640000000247110165765223015650 0ustar joejoe# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # sitecopy-0.16.6/po/it.po0000664000076400007640000015351511037413774013204 0ustar joejoe# Italian translations for sitecopy package. # Copyright (C) 2003 Joe Orton # This file is distributed under the same license as the sitecopy package. # Cristian Rigamonti , 2003, 2004, 2005, 2006. # msgid "" msgstr "" "Project-Id-Version: sitecopy 0.16.3\n" "Report-Msgid-Bugs-To: sitecopy@lyra.org\n" "POT-Creation-Date: 2008-07-16 16:31+0100\n" "PO-Revision-Date: 2006-03-12 16:17+0100\n" "Last-Translator: Cristian Rigamonti \n" "Language-Team: Italian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: src/console_fe.c:119 msgid "Show changes to" msgstr "Mostra i cambiamenti a" # "Elenco cambiamenti" corretto per integrarsi con le altre stringhe. #: src/console_fe.c:119 msgid "showing changes to" msgstr "Elenco cambiamenti" #: src/console_fe.c:119 src/console_fe.c:120 msgid "local" msgstr "locale" #: src/console_fe.c:120 msgid "Synchronize" msgstr "Sincronizza" #: src/console_fe.c:120 msgid "synchronizing" msgstr "sincronizzazione" #: src/console_fe.c:125 msgid "Fetch" msgstr "Scarica" #: src/console_fe.c:125 msgid "fetching" msgstr "scaricamento" #: src/console_fe.c:125 src/console_fe.c:126 src/console_fe.c:127 msgid "remote" msgstr "remoto" #: src/console_fe.c:126 gnome/init.c:198 msgid "Update" msgstr "Aggiorna" #: src/console_fe.c:126 msgid "updating" msgstr "aggiornamento" #: src/console_fe.c:127 msgid "Verify" msgstr "Verifica" #: src/console_fe.c:127 msgid "verifying" msgstr "verifica" #: src/console_fe.c:128 msgid "Catch up" msgstr "Riallinea" #: src/console_fe.c:128 msgid "catching up" msgstr "riallineamento" #: src/console_fe.c:128 src/console_fe.c:129 msgid "stored" msgstr "archiviato" #: src/console_fe.c:129 msgid "Initialize" msgstr "Inizializza" #: src/console_fe.c:129 msgid "initializing" msgstr "inizializzazione" #: src/console_fe.c:134 msgid "" "You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n" msgstr "" "Questo messaggio non dovrebbe comparire.\n" "Contattare il curatore a sitecopy@lyra.org\n" #: src/console_fe.c:196 #, c-format msgid "%s: Error: No site called `%s' found - skipping.\n" msgstr "%s: errore: non stato trovato alcun sito chiamato \"%s\" - omesso.\n" #: src/console_fe.c:214 #, c-format msgid "%s: No valid sites specified.\n" msgstr "%s: non stato specificato alcun sito valido.\n" #: src/console_fe.c:216 #, c-format msgid "%s: No sites specified.\n" msgstr "%s: non stato specificato alcun sito.\n" #: src/console_fe.c:218 src/console_fe.c:369 src/console_fe.c:529 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Provare \"%s --help\" per maggiori informazioni.\n" #: src/console_fe.c:228 #, c-format msgid "%s: %c%s site `%s' (on %s in %s)\n" msgstr "%s: %c%s del sito \"%s\" (su %s in %s)\n" #: src/console_fe.c:249 #, c-format msgid "* These items have been added since the last update:\n" msgstr "" "* Rispetto al precedente aggiornamento questi oggetti sono stati aggiunti:\n" #: src/console_fe.c:254 src/console_fe.c:285 #, c-format msgid "dir:" msgstr "dir:" #: src/console_fe.c:261 #, c-format msgid "* These items have been changed since the last update:\n" msgstr "" "* Rispetto al precedente aggiornamento questi oggetti sono stati " "modificati:\n" #: src/console_fe.c:263 #, c-format msgid " Changes to items in [brackets] are ignored during updates.\n" msgstr "" " Le modifiche agli oggetti tra [parentesi] sono ignorate durante gli " "aggiornamenti.\n" #: src/console_fe.c:277 #, c-format msgid "* These items have been deleted, but will be left on the server:\n" msgstr "" "* Questi oggetti sono stati eliminati, ma verranno lasciati sul server:\n" #: src/console_fe.c:279 #, c-format msgid "* These items have been deleted since the last update:\n" msgstr "" "* Rispetto al precedente aggiornamento questi oggetti sono stati eliminati:\n" #: src/console_fe.c:292 #, c-format msgid "* These items have been moved since the last update:\n" msgstr "" "* Rispetto al precedente aggiornamento questi oggetti sono stati spostati:\n" #: src/console_fe.c:310 src/console_fe.c:322 msgid "Ignored" msgstr "Ignorati" #: src/console_fe.c:312 msgid "Maintained for executables" msgstr "Mantenuti per gli eseguibili" #: src/console_fe.c:314 msgid "Always maintained" msgstr "Mantenuti sempre" #: src/console_fe.c:324 msgid "Maintained" msgstr "Mantenuti" #: src/console_fe.c:326 msgid "Followed" msgstr "Seguiti" #: src/console_fe.c:337 #, c-format msgid "" "Site: %s\n" "\tServer: %s" msgstr "" "Sito: %s\n" "\tServer: %s" #: src/console_fe.c:339 #, c-format msgid " Port: " msgstr " Porta: " #: src/console_fe.c:341 #, c-format msgid "(default)\n" msgstr "(predefinito)\n" #: src/console_fe.c:343 #, c-format msgid "%d\n" msgstr "%d\n" #: src/console_fe.c:345 #, c-format msgid "\tProtocol: %s Username: %s\n" msgstr "\tProtocollo: %s Nome utente: %s\n" #: src/console_fe.c:348 msgid "(unspecified)" msgstr "(non specificato)" #: src/console_fe.c:350 #, c-format msgid "\tPassive mode FTP will not be used.\n" msgstr "\tNon sar usata la modalit passiva FTP.\n" #: src/console_fe.c:351 #, c-format msgid "" "\tRemote directory: %s\n" "\tLocal directory: %s\n" msgstr "" "\tDirectory remota: %s\n" "\tDirectory locale: %s\n" #: src/console_fe.c:353 #, c-format msgid "\tPermissions: %s Symlinks: %s\n" msgstr "\tPermessi: %s Link simbolici: %s\n" #: src/console_fe.c:356 #, c-format msgid "\tRemote files will not be deleted.\n" msgstr "\tI file remoti non saranno eliminati.\n" #: src/console_fe.c:358 #, c-format msgid "\tFiles will be moved remotely if moved locally.\n" msgstr "\tI file spostati localmente lo saranno anche sul server-\n" #: src/console_fe.c:367 #, c-format msgid "%s: Error: Only specify ONE operation mode at a time.\n" msgstr "%s: errore: Specificare solo UNA modalit di operazione alla volta.\n" #: src/console_fe.c:489 #, c-format msgid "%s: Error: Debug channel %s not known.\n" msgstr "%s: errore: il livello di debug %s sconosciuto.\n" #: src/console_fe.c:497 #, c-format msgid "%s: Warning: Could not open `%s' to use as logfile.\n" msgstr "" "%s: attenzione: impossibile aprire \"%s\" per usarlo come file di log.\n" #: src/console_fe.c:540 #, c-format msgid "%s: Error: Dry run mode is currently only supported for updates.\n" msgstr "" "%s: Errore: la modalit simulazione al momento supportata solo per gli " "aggiornamenti.\n" #: src/console_fe.c:556 #, c-format msgid "" "%s: Warning: Only %d sites can be specified on the command line!\n" "Extra entries are being skipped.\n" msgstr "" "%s: attenzione: possibile specificare solo %d siti sulla riga di comando!\n" "Le voci ulteriori saranno ignorate.\n" #: src/console_fe.c:581 msgid "WARNING: Server certificate is not trusted." msgstr "ATTENZIONE: il certificato del server non fidato." #: src/console_fe.c:584 #, c-format msgid "Certificate was issued for server `%s'.\n" msgstr " stato emesso un certificato per il server \"%s\".\n" #: src/console_fe.c:586 msgid "WARNING: Certificate does not specify a server" msgstr "ATTENZIONE: il certificato non specifica un server" #: src/console_fe.c:588 #, c-format msgid "Fingerprint: %s\n" msgstr "Impronta digitale: %s\n" #: src/console_fe.c:591 #, c-format msgid "Issued to: %s\n" msgstr "Emesso per: %s\n" #: src/console_fe.c:595 #, c-format msgid "Issued by: %s\n" msgstr "Emesso da: %s\n" #: src/console_fe.c:598 #, c-format msgid "Do you wish to accept this certificate? (y/n) " msgstr "Si intende accettare questo certificato? (s/n)" #: src/console_fe.c:607 msgid "server" msgstr "server" #: src/console_fe.c:607 msgid "proxy server" msgstr "server proxy" #: src/console_fe.c:613 #, c-format msgid "Authentication required for %s on %s `%s':\n" msgstr " richiesta l'autenticazione per %s su %s \"%s\":\n" #: src/console_fe.c:616 #, c-format msgid "Authentication required on %s `%s':\n" msgstr "Autenticazione richiesta su %s \"%s\":\n" #: src/console_fe.c:619 msgid "Username: " msgstr "Nome utente: " #: src/console_fe.c:624 #, c-format msgid "Username: %s\n" msgstr "Nome utente: %s\n" #: src/console_fe.c:626 src/console_fe.c:650 msgid "Password: " msgstr "Password: " #: src/console_fe.c:636 #, c-format msgid "Retrying: [" msgstr "Riprovo: [" #: src/console_fe.c:647 #, c-format msgid "%s: Encrypted client certificate configured%s%s.\n" msgstr "%s: Certificato client cifrato configurato%s%s.\n" #: src/console_fe.c:682 #, c-format msgid "Create %s/" msgstr "Crea %s/" #: src/console_fe.c:684 #, c-format msgid "Delete %s/" msgstr "Elimina %s/" #: src/console_fe.c:692 #, fuzzy, c-format msgid "Upload %s (%s bytes)" msgstr "Carica %s (%" #: src/console_fe.c:694 #, c-format msgid "Delete %s" msgstr "Elimina %s" #: src/console_fe.c:695 #, c-format msgid "Move %s->%s" msgstr "Sposta %s->%s" #: src/console_fe.c:699 #, c-format msgid "" "%s: in fe_can_update/file_file\n" "%s" msgstr "" "%s: in fe_can_update/file_file\n" "%s" #: src/console_fe.c:706 #, c-format msgid "Change %s" msgstr "Modifica %s" #: src/console_fe.c:707 #, c-format msgid "Create %s" msgstr "Crea %s" #: src/console_fe.c:708 #, c-format msgid "Remove %s" msgstr "Rimuovi %s" #: src/console_fe.c:711 #, c-format msgid "" "%s: in fe_can_update/file_link\n" "%s" msgstr "" "%s: in fe_can_update/file_link\n" "%s" #: src/console_fe.c:717 #, c-format msgid "? (y/n) " msgstr "? (s/n) " #: src/console_fe.c:726 #, c-format msgid "Checksumming %s: [" msgstr "Calcolo del codice di controllo su %s in corso: [" #: src/console_fe.c:741 src/console_fe.c:852 src/console_fe.c:913 #, c-format msgid "] done.\n" msgstr "] fatto.\n" #: src/console_fe.c:743 src/console_fe.c:915 #, c-format msgid "" "] failed:\n" "%s\n" msgstr "" "] fallito:\n" "%s\n" #: src/console_fe.c:753 #, c-format msgid "Setting permissions on %s%s: " msgstr "Impostazione dei permessi su %s%s: " #: src/console_fe.c:763 src/console_fe.c:841 src/console_fe.c:907 #, c-format msgid "done.\n" msgstr "fatto.\n" #: src/console_fe.c:765 src/console_fe.c:909 #, c-format msgid "" "failed:\n" "%s\n" msgstr "" "fallito:\n" "%s\n" #: src/console_fe.c:784 src/console_fe.c:871 #, c-format msgid "Creating %s/: " msgstr "Creazione di %s/: " #: src/console_fe.c:786 src/console_fe.c:873 #, c-format msgid "Deleting %s/: " msgstr "Eliminazione di %s/: " #: src/console_fe.c:793 #, c-format msgid "Uploading %s: [" msgstr "Caricamento di %s: [" #: src/console_fe.c:796 src/console_fe.c:815 src/console_fe.c:883 #, c-format msgid "Deleting %s: " msgstr "Eliminazione di %s: " #: src/console_fe.c:799 src/console_fe.c:886 #, c-format msgid "Moving %s->%s: " msgstr "Spostamento %s->%s: " #: src/console_fe.c:803 #, c-format msgid "" "%s: in fe_updating/file_file\n" "%s" msgstr "" "%s: in fe_updating/file_file\n" "%s" #: src/console_fe.c:811 #, c-format msgid "Changing %s: " msgstr "Modifica di %s: " #: src/console_fe.c:813 #, c-format msgid "Creating %s: " msgstr "Creazione %s: " #: src/console_fe.c:817 #, c-format msgid "" "%s: in fe_updating/file_link\n" "%s" msgstr "" "%s: in fe_updating/file_link\n" "%s" #: src/console_fe.c:834 #, c-format msgid "Failed to update %s:%c%s\n" msgstr "Aggiornamento fallito di %s:%c%s\n" #: src/console_fe.c:843 #, c-format msgid "failed:%c%s\n" msgstr "fallito:%c%s\n" #: src/console_fe.c:855 #, c-format msgid "] failed:%c%s\n" msgstr "] fallito:%c%s\n" #: src/console_fe.c:880 #, c-format msgid "Downloading %s: [" msgstr "Scaricamento di %s: [" #: src/console_fe.c:925 msgid "Changed on server" msgstr "Modificati sul server" #: src/console_fe.c:928 msgid "Added on server" msgstr "Aggiunti sul server" #: src/console_fe.c:936 #, c-format msgid "%s: %s\n" msgstr "%s: %s\n" #: src/console_fe.c:956 #, c-format msgid "Directory: %s/\n" msgstr "Directory: %s/\n" #: src/console_fe.c:961 #, fuzzy, c-format msgid "File: %s - size %s%s\n" msgstr "File: %s - dimensione %" #: src/console_fe.c:963 msgid " (ASCII)" msgstr " (ASCII)" #: src/console_fe.c:966 #, c-format msgid "Link: %s - target %s\n" msgstr "Link: %s - obiettivo %s\n" #: src/console_fe.c:979 gnome/init.c:402 #, c-format msgid "%s: Error: Could not open rcfile: %s.\n" msgstr "%s: errore: impossibile aprire il file di configurazione: %s.\n" #: src/console_fe.c:983 gnome/init.c:407 #, c-format msgid "" "%s: rcfile corrupt at line %d:\n" "%s\n" msgstr "" "%s: file di configurazione danneggiato alla riga %d:\n" "%s\n" #: src/console_fe.c:1002 #, c-format msgid "" "%s: Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: impossibile leggere la directory per \"%s\":\n" "\t%s\n" #: src/console_fe.c:1006 #, c-format msgid "%s: Server not specified in site `%s'.\n" msgstr "%s: server non specificato nel sito \"%s\".\n" #: src/console_fe.c:1010 #, c-format msgid "%s: Remote directory not specified in site `%s'.\n" msgstr "%s: directory non specificata nel sito \"%s\".\n" #: src/console_fe.c:1014 #, c-format msgid "%s: Local directory not specified in site `%s'.\n" msgstr "%s: directory locale non specificata nel sito \"%s\".\n" #: src/console_fe.c:1018 #, c-format msgid "%s: Invalid port used in site `%s'.\n" msgstr "%s: porta non valida usata nel sito \"%s\".\n" #: src/console_fe.c:1022 #, c-format msgid "%s: %s cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s impossibile mantenere i link simbolici (sito \"%s\").\n" #: src/console_fe.c:1026 #, c-format msgid "%s: Cannot use a relative remote directory in %s (site `%s').\n" msgstr "" "%s: impossibile usare una directory remota relativa in %s (sito \"%s\").\n" #: src/console_fe.c:1029 #, c-format msgid "%s: File permissions are not supported in %s (site `%s').\n" msgstr "%s: i permessi sui file non sono supportati in %s (sito \"%s\").\n" #: src/console_fe.c:1032 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n" msgstr "" "%s: la modalit sicura non si pu usare insieme a nooverwrite (sito \"%s" "\").\n" #: src/console_fe.c:1035 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n" msgstr "" "%s: la modalit sicura non si pu usare insieme a tempupload (sito \"%s\").\n" #: src/console_fe.c:1038 #, c-format msgid "%s: Can only check for renamed files when checksumming (site `%s').\n" msgstr "" "%s: il controllo dei file rinominati possibile solo con attivando il " "checksum (sito \"%s\").\n" #: src/console_fe.c:1041 #, c-format msgid "%s: The protocol `%s' is unsupported (site `%s').\n" msgstr "%s: il protocollo \"%s\" non supportato (sito \"%s\").\n" #: src/console_fe.c:1048 #, c-format msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" msgstr "" "%s: errore non trattato %d nel sito \"%s\" - si prega di contattare il " "curatore.\n" #: src/console_fe.c:1066 #, c-format msgid "" "%s: Error: Corrupt site storage file for `%s':\n" "%s: %s\n" msgstr "" "%s: errore: file di archivio corrotto per il sito \"%s\":\n" "%s: %s\n" #: src/console_fe.c:1075 #, c-format msgid "" "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n" msgstr "" "%s: errore: manca il file di archivio per \"%s\".\n" "%s: usare --init, --catchup o --fetch per creare un file di archivio.\n" #: src/console_fe.c:1088 #, c-format msgid "%s: Skipping site `%s'.\n" msgstr "%s: ignoro il sito \"%s\".\n" #: src/console_fe.c:1103 #, c-format msgid "%s: %s completed successfully.\n" msgstr "%s: %s completato con successo.\n" #: src/console_fe.c:1109 #, c-format msgid "%s: %s unsupported for %s.\n" msgstr "%s: %s non supportato per %s.\n" #: src/console_fe.c:1114 #, c-format msgid "%s: Errors occurred while %s the %s site.\n" msgstr "%s: si sono verificati errori durante %s del sito %s.\n" #: src/console_fe.c:1119 #, c-format msgid "%s: Error: Could not resolve remote hostname (%s).\n" msgstr "%s: errore: impossibile risolvere il nome host remoto (%s).\n" #: src/console_fe.c:1125 #, c-format msgid "%s: Error: Could not resolve hostname of proxy server (%s).\n" msgstr "" "%s: errore: impossibile risolvere il nome host del server proxy (%s).\n" #: src/console_fe.c:1131 #, c-format msgid "%s: Error: Could not connect to proxy server (%s port %d).\n" msgstr "%s: errore: impossibile connettersi al server proxy (%s port %d).\n" #: src/console_fe.c:1134 #, c-format msgid "%s: Error: Could not connect to server (%s port %d).\n" msgstr "%s: errore: impossibile connettersi al server (%s port %d).\n" #: src/console_fe.c:1140 #, c-format msgid "%s: Error: Could not authorise user on server.\n" msgstr "%s: errore: impossibile autorizzare l'utente sul server.\n" #: src/console_fe.c:1145 #, c-format msgid "%s: Error: %s\n" msgstr "%s: errore: %s\n" #: src/console_fe.c:1149 #, c-format msgid "%s: Error: Could not authorise user on proxy server (%s).\n" msgstr "%s: errore: impossibile autorizzare l'utente sul server proxy (%s).\n" #: src/console_fe.c:1154 #, c-format msgid "" "%s: in issue_error\n" "%s" msgstr "" "%s: in issue_error\n" "%s" #: src/console_fe.c:1168 #, c-format msgid "%s: Error: Environment variable HOME not set.\n" msgstr "%s: errore: la variabile di ambiente HOME non impostata.\n" #: src/console_fe.c:1176 #, c-format msgid "%s: Error: Could not open rcfile: %s\n" msgstr "%s: errore: impossibile aprire il file di configurazione: %s\n" #: src/console_fe.c:1179 #, c-format msgid "%s: Error: rcfile permissions allow other users to read your rcfile.\n" msgstr "" "%s: errore: i permessi del file di configurazione lo rendono leggibile per " "gli altri utenti.\n" #: src/console_fe.c:1180 src/console_fe.c:1192 #, c-format msgid "%s: Set the permissions to 0600.\n" msgstr "%s: impostare i permessi a 0600.\n" #: src/console_fe.c:1183 #, c-format msgid "%s: Error: Could not open storage directory: %s\n" msgstr "%s: errore: impossibile aprire la directory degli archivi: %s\n" #: src/console_fe.c:1184 #, c-format msgid "" "%s: You need to create this directory and set the permissions to 0700.\n" msgstr "" "%s: necessario creare questa directory e impostare i permessi a 0700.\n" #: src/console_fe.c:1187 #, c-format msgid "%s: Error: storage directory permissions incorrect.\n" msgstr "%s: errore: i permessi della directory degli archivi sono scorretti.\n" #: src/console_fe.c:1188 #, c-format msgid "%s: Set the permissions to 0700.\n" msgstr "%s: impostare i permessi a 0700.\n" #: src/console_fe.c:1191 #, c-format msgid "%s: Error: ~/.netrc permissions incorrect.\n" msgstr "%s: errore: i permessi di ~/.netrc sono scorretti.\n" #: src/console_fe.c:1197 #, c-format msgid "" "%s: init_paths gave %d\n" "%s" msgstr "" "%s: init_paths produce %d\n" "%s" #: src/console_fe.c:1204 #, c-format msgid "%s: Error: Could not parse ~/.netrc.\n" msgstr "%s: errore: impossibile leggere ~/.netrc.\n" #: src/console_fe.c:1222 src/console_fe.c:1321 #, c-format msgid "%s: Nothing to do - no changes found.\n" msgstr "%s: niente da fare - nessun cambiamento trovato.\n" #: src/console_fe.c:1231 #, c-format msgid "" "%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n" msgstr "" "%s: errore: impossibile aprire per la lettura il file di archivio (%s)\n" "%s: errore: %s\n" "%s: impossibile aggiornare il sito \"%s\".\n" #: src/console_fe.c:1255 #, c-format msgid "" "%s: Warning: Current state method differs from stored in site `%s'.\n" "%s: All existing files will appear changed (use catchup?).\n" msgstr "" "%s: attenzione: il metodo di stato attuale diverso da quello usato nel " "sito \"%s\".\n" "%s: tutti i file esistenti appariranno modificati (suggerimento: usare " "catchup?).\n" #: src/console_fe.c:1261 #, c-format msgid "%s: The remote site needs updating (%d items to update).\n" msgstr "" "%s: il sito remoto deve essere aggiornato (%d oggetti da aggiornare).\n" #: src/console_fe.c:1263 #, c-format msgid "%s: The remote site needs updating (1 item to update).\n" msgstr "%s: il sito remoto deve essere aggiornato (1 oggetto da aggiornare).\n" #: src/console_fe.c:1266 #, c-format msgid "%s: The remote site does not need updating.\n" msgstr "%s: il sito remoto non deve essere aggiornato.\n" #: src/console_fe.c:1274 #, c-format msgid "%s: All the files and directories are marked as NOT updated remotely.\n" msgstr "" "%s: tutti i file e le directory sono considerati come NON aggiornati sul " "server.\n" #: src/console_fe.c:1279 #, c-format msgid "%s: All the files and and directories are marked as updated remotely.\n" msgstr "" "%s: tutti i file e le directory sono considerati come aggiornati sul " "server.\n" #: src/console_fe.c:1288 #, c-format msgid "" "%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n" msgstr "" "%s: impossibile scaricare la lista dei file per il sito \"%s\":\n" "%s: %s\n" #: src/console_fe.c:1302 #, c-format msgid "" "%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n" msgstr "" "%s: impossibile scaricare la lista dei file per verificare il sito \"%s\":\n" "%s: %s\n" #: src/console_fe.c:1309 #, c-format msgid "%s: Verify found %d files missing from server.\n" msgstr "%s: la verifica ha trovato %d file mancanti dal server.\n" #: src/console_fe.c:1312 #, c-format msgid "%s: Remote site not synchronized with stored state.\n" msgstr "%s: il sito remoto non sincronizzato con l'immagine locale.\n" #: src/console_fe.c:1325 #, c-format msgid "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" msgstr "" "%s: mi rifiuto di eliminare tutti i file locali con un'operazione di " "sincronizzazione.\n" "%s: usare --update per agiornare il sito remoto.\n" #: src/console_fe.c:1333 #, c-format msgid "" "%s: in act_on_site\n" "%s" msgstr "" "%s: in act_on_site\n" "%s" #: src/console_fe.c:1344 #, c-format msgid "Usage: %s [OPTIONS] [MODE] [sitename]...\n" msgstr "Uso: %s [OPZIONI] [MODALITA] [nome del sito]...\n" #: src/console_fe.c:1346 #, c-format msgid "Options: \n" msgstr "Opzioni: \n" #: src/console_fe.c:1349 #, c-format msgid "" " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" msgstr "" " -d, --debug=CODICE[,CODICE] Attiva il debugging per ogni CODICE:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Attenzione: cleartext mostra in chiaro le password (di solito " "nascoste)\n" " -g, --logfile=FILE Accoda i messaggi di debugging al FILE (altrimenti " "usa stderr)\n" #: src/console_fe.c:1356 #, c-format msgid "" " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites " "(default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote " "state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n" msgstr "" " -r, --rcfile=FILE Usa un file di configurazione alternativo\n" " -p, --storepath=PATH Usa una directory degli archivi alternativa\n" " -y, --prompting Chiedi conferma prima di ogni aggiornamento\n" " -a, --allsites Esegue l'operazione su TUTTI i siti definiti\n" " -k, --keep-going Porta a termine un aggiornamento ignorando gli " "errori\n" " -o, --show-progress Mostra la percentuale di completamento del " "trasferimento file\n" " -q, --quiet Esegue l'operazione mostrando solo i nomi dei file\n" " -qq, --silent Esegue l'operazione senza mostrare nulla\n" " -n, --dry-run Simulazione: mostra l'operazione senza eseguirla\n" "Modalit di operazione:\n" " -l, --list Elenca i cambiamenti tra siti remoti e locali " "(predefinita)\n" " -ll, --flatlist Come sopra ma usando una lista semplice\n" " -v, --view Mostra la lista delle definizioni dei siti\n" " -i, --initialize Considera tutti i file e directory come non " "aggiornati\n" " -f, --fetch Scarica la lista dei file presenti sul sito remoto\n" " -e, --verify Verifica che l'informazione archiviata corrisponda " "allo stato del sito remoto\n" " -c, --catchup Riallinea: marca tutti i file e directory come " "aggiornati\n" " -s, --synchronize Sincronizza il sito locale usando il sito remoto " "come riferimento\n" " -u, --update Aggiorna il sito remoto\n" " -h, --help Mostra questo messaggio di aiuto\n" " -V, --version Mostra informazioni sulla versione\n" "Spedire richieste di miglioramento e notifiche di errore a sitecopy@lyra." "org\n" #: src/sitestore.c:326 #, c-format msgid "Invalid checksum at line %d" msgstr "Codice di controllo non valido alla riga %d" #: src/sitestore.c:371 #, c-format msgid "Boolean missing in 'ascii' at line %d" msgstr "Booleano mancante in 'ascii' alla riga %d" #: src/sitestore.c:396 #, c-format msgid "Size overflow (%s) in '%s' at line %d" msgstr "Dimensione eccessiva (%s) in '%s' alla riga %d" #: src/davdriver.c:195 msgid "The connection timed out." msgstr "Tempo di connessione scaduto." #: src/davdriver.c:224 #, fuzzy msgid "Could not write SSL certificate" msgstr "Impossibile leggere il certificato SSL client '%s'." #: src/davdriver.c:244 msgid "SSL support has not be compiled in." msgstr "Il supporto SSL non stato compilato." #: src/davdriver.c:252 #, c-format msgid "Could not load certificate `%s'." msgstr "Impossibile caricare il certificato \"%s\"." #: src/davdriver.c:290 #, c-format msgid "Could not read SSL client certificate '%s'." msgstr "Impossibile leggere il certificato SSL client '%s'." #: src/davdriver.c:303 #, c-format msgid "Could not decrypt SSL client certificate '%s'." msgstr "Impossibile decifrare il certificato SSL client '%s'." #: src/davdriver.c:325 msgid "The server does not appear to be a WebDAV server." msgstr "Il server non sembra essere un server WebDAV." #: src/davdriver.c:330 msgid "The server does not support the executable live property." msgstr "Il server non supporta la propriet live executable" #: src/davdriver.c:376 src/davdriver.c:443 src/davdriver.c:480 src/ftp.c:888 #: src/ftp.c:972 msgid "Could not open file" msgstr "Impossibile aprire il file" #: src/davdriver.c:411 #, c-format msgid "Could not stat file: %s" msgstr "Impossibile fare stat del file: %s" #: src/davdriver.c:670 msgid "Could not access resource" msgstr "Impossibile accedere alla risorsa" #: src/sites.c:160 msgid "Could not set modification time of local file." msgstr "Impossibile impostare l'orario di modifica del file locale." #: src/sites.c:308 msgid "" "Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode." msgstr "" "L'aggiornamento avvenuto, ma impossibile recuperare l'orario di " "modifica.\n" "Se questo messaggio persiste, disabilitare la modalit sicura." #: src/sites.c:515 msgid "Remote file has been modified - not overwriting with local changes" msgstr "" "Il sito remoto stato modificato - non sar sovrascritto con i cambiamenti " "locali" #: src/sites.c:828 msgid "Could not examine file." msgstr "Impossibile esaminare il file." #: src/sites.c:871 msgid "Could not checksum file" msgstr "Impossibile calcolare il codice di controllo per il file" #: src/sites.c:887 msgid "The target of the symlink could not be read." msgstr "Impossibile leggere l'obiettivo del link simbolico." #: src/common.c:113 msgid "Unknown system error" msgstr "Errore di sistema sconosciuto" #: src/ftp.c:153 #, c-format msgid "%s: connection was closed by server." msgstr "%s: la connessione stata chiusa dal server." #: src/ftp.c:157 #, c-format msgid "%s: connection timed out." msgstr "%s: tempo di connessione scaduto." #: src/ftp.c:195 msgid "Could not read response line" msgstr "Impossibile leggere la riga della risposta" #: src/ftp.c:229 msgid "Cannot parse MDTM response; wrong length." msgstr "Impossibile analizzare la risposta MDTM; lunghezza errata." #: src/ftp.c:236 msgid "Cannot parse MDTM response." msgstr "Impossibile analizzare la risposta MDTM." #: src/ftp.c:260 msgid "Could not find address in PASV response" msgstr "Impossibile trovare un indirizzo nella risposta PASV" #: src/ftp.c:267 msgid "Could not parse PASV response" msgstr "Impossibile leggere la risposta PASV" #: src/ftp.c:276 msgid "Invalid IP address in PASV response" msgstr "Indirizzo IP non valido nella risposta PASV" #: src/ftp.c:296 msgid "Malformed EPSV response" msgstr "Risposta EPSV malformata" #: src/ftp.c:304 msgid "Malformed port in EPSV response" msgstr "Porta malformata nella risposta EPSV" #: src/ftp.c:449 msgid "Error sending file" msgstr "Errore nell'invio del file" #: src/ftp.c:463 src/ftp.c:489 msgid "Error reading file" msgstr "Errore nella lettura del file" #: src/ftp.c:480 msgid "Could not send file" msgstr "Impossibile inviare il file" #: src/ftp.c:510 src/ftp.c:991 msgid "Error writing to file" msgstr "Errore nella scrittura del file" #: src/ftp.c:516 msgid "Receiving file" msgstr "Ricezione del file" #: src/ftp.c:532 msgid "Could not connect passive data socket" msgstr "Impossibile creare la struttura SSL" #: src/ftp.c:647 msgid "Active open failed: could not determine address of control socket" msgstr "" "Errore active open: impossibile determinare l'indirizzo del socket di " "controllo" #: src/ftp.c:659 msgid "Active open failed: could not create socket" msgstr "Errore active open: impossibile creare il socket" #: src/ftp.c:667 msgid "Active open failed: could not bind to address" msgstr "Errore active open: impossibile collegarsi all'indirizzo" #: src/ftp.c:677 msgid "Active open failed: could not determine address of data socket" msgstr "" "Errore active open: impossibile determinare l'indirizzo del socket dati" #: src/ftp.c:684 msgid "Could not determine bound port number for data socket" msgstr "Impossibile determinare il numero di porta per il socket dati" #: src/ftp.c:727 msgid "Active open failed: could not accept connection" msgstr "Errore active open: impossibile accettare la connessione" #: src/ftp.c:800 msgid "Error closing data socket" msgstr "Errore nella chiusura del socket dati" #: src/ftp.c:894 msgid "Could not determine length of file" msgstr "Impossibile determinare la lunghezza del file" #: src/ftp.c:905 msgid "Could not rewind to beginning of file" msgstr "Impossibile tornare all'inizio del file" #: src/ftp.c:1152 msgid "Could not read 'LIST' response." msgstr "Impossibile leggere la risposta \"LIST\"" #: src/ftp.c:1161 #, c-format msgid "Parse error in LIST response: %s" msgstr "Errore di analisi nella risposta LIST: %s" #: gnome/init.c:51 msgid "_New site..." msgstr "_Nuovo sito..." #: gnome/init.c:51 gnome/init.c:171 msgid "Create a new site definition" msgstr "Crea la definizione per un nuovo sito" #: gnome/init.c:54 msgid "_Open..." msgstr "_Apri..." #: gnome/init.c:54 msgid "Open a new rc file. (EXPERIMENTAL)." msgstr "Apre un nuovo file di configurazione (SPERIMENTALE)." #: gnome/init.c:57 msgid "_Save Sites" msgstr "_Salva siti" #: gnome/init.c:57 gnome/init.c:177 msgid "Save the current site definitions" msgstr "Salva le attuali definizioni dei siti" #: gnome/init.c:60 msgid "Sav_e Sites As..." msgstr "Sa_lva siti come..." #: gnome/init.c:60 msgid "Save the current site definitions to a file." msgstr "Salva le attuali definizioni dei siti in un file." #: gnome/init.c:63 msgid "_Delete this site" msgstr "Eli_mina questo sito" #: gnome/init.c:63 msgid "Delete the selected site entry" msgstr "Elimina la voce selezionata" #: gnome/init.c:69 msgid "E_xit" msgstr "_Esci" #: gnome/init.c:69 gnome/init.c:202 msgid "Exit the program" msgstr "Esce dal programma" #: gnome/init.c:78 msgid "_Initialise site" msgstr "_Inizializza sito" #: gnome/init.c:78 msgid "All files will be uploaded if a site is initialised" msgstr "Se un sito inizializzato tutti i file verranno caricati" #: gnome/init.c:81 msgid "'_Catchup' site" msgstr "_Riallinea sito" #: gnome/init.c:81 msgid "Records the site as already updated." msgstr "Considera il sito come gi aggiornato." #: gnome/init.c:84 msgid "_Fetch site listing" msgstr "Scarica la _lista dei file" #: gnome/init.c:84 msgid "Figures out which files are new/changed from the actual remote site." msgstr "Controlla quali file sono nuovi/modificati sul sito remoto" #: gnome/init.c:88 msgid "_Resynchronize site" msgstr "_Sincronizza sito" #: gnome/init.c:88 msgid "Copies newer files from the remote site to the local drive." msgstr "Copia i nuovi file dal sito remoto alla copia locale." #: gnome/init.c:91 msgid "_Update site..." msgstr "_Aggiorna sito..." #: gnome/init.c:91 msgid "Apply the local site's changes to the remote site." msgstr "Applica le modifiche locali al sito remoto." #: gnome/init.c:94 msgid "Update _ALL sites" msgstr "Aggiorna _TUTTI i siti" #: gnome/init.c:94 gnome/init.c:137 msgid "Performs the required operations on all site definitions. (TODO)." msgstr "" "Esegue le operazioni richieste su tutti i siti definiti (NON DISPONIBILE)." #: gnome/init.c:98 msgid "Rescan local directory" msgstr "Analizza copia locale" #: gnome/init.c:98 msgid "Re-reads the local directory of the selected site." msgstr "Rilegge la copia locale del sito selezionato." #: gnome/init.c:106 msgid "_Required updates" msgstr "A_ggiornamenti richiesti" #: gnome/init.c:106 msgid "Displays a brief report of any required updates." msgstr "Mostra una breve lista dei siti da aggiornare." #: gnome/init.c:109 msgid "Site web-r_eport" msgstr "Aggiornamenti richiesti (pagina _web)" #: gnome/init.c:109 msgid "" "Generates a web page detailing the changes required on the selected site." msgstr "" "Genera una pagina web con i dettagli dell'aggiornamento richiesto per il " "sito selezionato." #: gnome/init.c:112 msgid "Prin_t site info..." msgstr "_Informazioni sul sito..." #: gnome/init.c:112 msgid "Print information about the selected site" msgstr "Mostra informazioni sul sito selezionato" #: gnome/init.c:119 msgid "_Backup files status" msgstr "_Backup della situazione" #: gnome/init.c:119 msgid "Save the 'state' of your local files, in case of accident." msgstr "Salva lo stato dei file locali a scopo di backup." #: gnome/init.c:122 msgid "Restore files status..." msgstr "_Ripristina la situazione..." #: gnome/init.c:122 gnome/init.c:129 msgid "If a backup has previously been made, it will be restored." msgstr "Ripristina lo stato dei file locali da un backup esistente." #: gnome/init.c:126 msgid "_Backup site definitions" msgstr "_Backup delle definizioni" #: gnome/init.c:126 msgid "Backup your site definitions, in case you delete your sites." msgstr "Salva le definizioni dei siti a scopo di backup" #: gnome/init.c:129 msgid "Restore site definitions..." msgstr "Ripristina le definizioni dei siti..." #: gnome/init.c:137 msgid "Preferences..." msgstr "Preferenze..." #: gnome/init.c:146 msgid "_About XSitecopy" msgstr "I_nformazioni su XSitecopy" #: gnome/init.c:146 msgid "Information about XSitecopy" msgstr "Informazioni su XSitecopy" #: gnome/init.c:158 msgid "_File" msgstr "_File" #: gnome/init.c:159 msgid "_Operations" msgstr "_Operazioni" #: gnome/init.c:160 msgid "_Reports" msgstr "_Rapporti" #: gnome/init.c:161 msgid "_Settings" msgstr "_Impostazioni" #: gnome/init.c:162 msgid "_Backup" msgstr "_Backup" #: gnome/init.c:163 msgid "_Help" msgstr "A_iuto" #: gnome/init.c:171 msgid "New site" msgstr "Nuovo sito" #: gnome/init.c:174 msgid "Open" msgstr "Apri" #: gnome/init.c:174 msgid "Open a new site definitions file." msgstr "Apre una nuova definizione di sito." #: gnome/init.c:177 msgid "Save" msgstr "Salva" #: gnome/init.c:180 msgid "Delete site" msgstr "Elimina sito" #: gnome/init.c:180 msgid "Delete the selected site" msgstr "Elimina il sito selezionato" #: gnome/init.c:185 msgid "Initialise" msgstr "Inizializza" #: gnome/init.c:185 msgid "Initialise the site (mark all files as needing to be updated)." msgstr "Considera tutti i file come non aggiornati" #: gnome/init.c:188 msgid "Catch-up" msgstr "Riallinea" #: gnome/init.c:188 msgid "Mark all of the selected site's files as updated." msgstr "Considera tutti i file come aggiornati" #: gnome/init.c:194 msgid "Download" msgstr "Scarica" #: gnome/init.c:194 msgid "Download newer files from the remote site. (Use with care)" msgstr "Scarica i nuovi file dal sito remoto (usare con cautela)." #: gnome/init.c:198 msgid "Updates the selected site" msgstr "Aggiorna il sito selezionato" #: gnome/init.c:202 msgid "Quit" msgstr "Esci" #: gnome/init.c:412 #, c-format msgid "%s: Error: Could not read rcfile: %s.\n" msgstr "%s: Errore: impossibile aprire il file di configurazione: %s.\n" #: gnome/main.c:184 msgid "" "Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" msgstr "" "Livello di debug (somma di: 1=socket, 2=file, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" #: gnome/misc.c:580 #, c-format msgid "Server not specified in site `%s'.\n" msgstr "Server non specificato nel sito \"%s\".\n" #: gnome/misc.c:584 #, c-format msgid "Remote directory not specified in site `%s'.\n" msgstr "Directory remota non specificata nel sito \"%s\".\n" #: gnome/misc.c:588 #, c-format msgid "Local directory not specified in site `%s'.\n" msgstr "Directory locale non specificata nel sito \"%s\".\n" #: gnome/misc.c:592 #, c-format msgid "" "Could not read directory for `%s':\n" "\t%s\n" msgstr "" "Impossibile leggere la directory per \"%s\":\n" "\t%s\n" #: gnome/misc.c:596 #, c-format msgid "Invalid port used in site `%s'.\n" msgstr "Porta non valida usata nel sito \"%s\".\n" #: gnome/misc.c:600 #, c-format msgid "Protocol '%s' cannot maintain symbolic links (site `%s').\n" msgstr "Il protocollo \"%s\" non mantiene i link simbolici (sito \"%s\").\n" #: gnome/misc.c:604 #, c-format msgid "Cannot use a relative remote directory protocol '%s' (site `%s').\n" msgstr "" "Impossibile usare una directory remota relativa in \"%s\" (sito \"%s\").\n" #: gnome/misc.c:607 #, c-format msgid "%s's protocol does not currently support maintaining permissions." msgstr "Il protocollo di %s non permette di mantenere i permessi dei file." #: gnome/misc.c:611 #, c-format msgid "Could not find 'relative' local directory" msgstr "Impossibile trovare la directory locale relativa" #: lib/neon/ne_redirect.c:92 #, fuzzy msgid "Could not parse redirect destination URL" msgstr "Impossibile analizzare l'indirizzo di redirezione" #: lib/neon/ne_gnutls.c:162 #, c-format msgid "[unprintable:#%lu]" msgstr "" #: lib/neon/ne_gnutls.c:188 msgid "[unprintable]" msgstr "" #: lib/neon/ne_gnutls.c:696 lib/neon/ne_openssl.c:419 msgid "Server certificate was missing commonName attribute in subject name" msgstr "" "Il certificato del server non contiene l'attributo commonName nel nome del " "soggetto" #: lib/neon/ne_gnutls.c:736 lib/neon/ne_openssl.c:638 #, c-format msgid "SSL negotiation failed: %s" msgstr "Errore di negoziazione SSL: %s" #: lib/neon/ne_gnutls.c:745 msgid "Server did not send certificate chain" msgstr "Il server non ha spedito la catena di certificazione" #: lib/neon/ne_openssl.c:451 #, c-format msgid "Certificate verification error: %s" msgstr "Errore di verifica del certificato: %s" #: lib/neon/ne_openssl.c:657 msgid "SSL server did not present certificate" msgstr "Il server SSL non ha offerto alcun certificato" #: lib/neon/ne_openssl.c:666 msgid "Server certificate changed: connection intercepted?" msgstr "" "Il certificato del server cambiato: la connessione pu essere stata " "intercettata?" #: lib/neon/ne_session.c:356 lib/neon/ne_session.c:367 msgid "[invalid date]" msgstr "[data non valida]" #: lib/neon/ne_session.c:380 msgid "certificate is not yet valid" msgstr "il certificato non ancora valido" #: lib/neon/ne_session.c:381 msgid "certificate has expired" msgstr "il certificato scaduto" #: lib/neon/ne_session.c:382 msgid "certificate issued for a different hostname" msgstr "il certificato stato emesso per un altro nome host" #: lib/neon/ne_session.c:383 msgid "issuer is not trusted" msgstr "chi ha rilasciato il certificato non fidato" #: lib/neon/ne_session.c:388 msgid "Server certificate verification failed: " msgstr "Errore nella verifica del certificato del server: " #: lib/neon/ne_socket.c:514 lib/neon/ne_socket.c:568 lib/neon/ne_socket.c:671 msgid "Connection closed" msgstr "Connessione chiusa" #: lib/neon/ne_socket.c:578 lib/neon/ne_socket.c:683 msgid "Secure connection truncated" msgstr "Connessione sicura interrotta" #: lib/neon/ne_socket.c:590 lib/neon/ne_socket.c:695 #, c-format msgid "SSL error: %s" msgstr "errore SSL: %s" #: lib/neon/ne_socket.c:593 #, c-format msgid "SSL error code %d/%d/%lu" msgstr "Codice di errore SSL %d/%d/%lu" #: lib/neon/ne_socket.c:676 #, c-format msgid "SSL alert received: %s" msgstr "Avviso SSL ricevuto: %s" #: lib/neon/ne_socket.c:691 msgid "SSL socket read failed" msgstr "Errore di lettura socket SSL" #: lib/neon/ne_socket.c:790 msgid "Line too long" msgstr "Linea troppo lunga" #: lib/neon/ne_socket.c:935 lib/neon/ne_socket.c:941 msgid "Host not found" msgstr "Host non trovato" #: lib/neon/ne_socket.c:1048 #, fuzzy msgid "Connection timed out" msgstr "Tempo di connessione scaduto." #: lib/neon/ne_socket.c:1210 msgid "Socket descriptor number exceeds FD_SETSIZE" msgstr "Il numero del descrittore socket eccede FD_SETSIZE" #: lib/neon/ne_socket.c:1270 msgid "Socket family not supported" msgstr "" #: lib/neon/ne_socket.c:1493 msgid "Client certificate verification failed" msgstr "Errore nella verifica del certificato del client" #: lib/neon/ne_socket.c:1509 msgid "SSL disabled due to lack of entropy" msgstr "SSL disabilitato per mancanza di entropia" #: lib/neon/ne_socket.c:1516 msgid "SSL disabled due to library version mismatch" msgstr "SSL disabilitato: la versione della libreria non corrisponde" #: lib/neon/ne_socket.c:1522 msgid "Could not create SSL structure" msgstr "Impossibile creare la struttura SSL" #: lib/neon/ne_request.c:194 #, fuzzy, c-format msgid "%s: connection was closed by proxy server" msgstr "%s: la connessione stata chiusa dal server proxy." #: lib/neon/ne_request.c:197 #, fuzzy, c-format msgid "%s: connection was closed by server" msgstr "%s: la connessione stata chiusa dal server." #: lib/neon/ne_request.c:202 #, fuzzy, c-format msgid "%s: connection timed out" msgstr "%s: tempo di connessione scaduto." #: lib/neon/ne_request.c:307 msgid "offset invalid" msgstr "offset invalido" #: lib/neon/ne_request.c:312 #, c-format msgid "Could not seek to offset %s of request body file: %s" msgstr "Impossibile posizionarsi all'offset %s del corpo della richiesta: %s" #: lib/neon/ne_request.c:360 msgid "Could not send request body" msgstr "Impossibile inviare il corpo della richiesta" #: lib/neon/ne_request.c:699 msgid "Could not read chunk size" msgstr "Impossibile leggere la dimensione del chunk" #: lib/neon/ne_request.c:706 msgid "Could not parse chunk size" msgstr "Impossibile analizzare la dimensione del chunk" #: lib/neon/ne_request.c:743 msgid "Could not read response body" msgstr "Impossibile leggere il corpo della risposta" #: lib/neon/ne_request.c:759 msgid "Could not read chunk delimiter" msgstr "Impossibile leggere il delimitatore del chunk" #: lib/neon/ne_request.c:762 msgid "Chunk delimiter was invalid" msgstr "Delimitatore del chunk non valido" #: lib/neon/ne_request.c:868 msgid "Could not read status line" msgstr "Impossibile leggere la riga di stato" #: lib/neon/ne_request.c:890 #, fuzzy msgid "Could not parse response status line" msgstr "Impossibile analizzare la riga di stato della risposta." #: lib/neon/ne_request.c:902 msgid "Could not read interim response headers" msgstr "Impossibile leggere le intestazioni della risposta temporanea" #: lib/neon/ne_request.c:936 msgid "Could not send request" msgstr "Impossibile inviare la richiesta" #: lib/neon/ne_request.c:984 lib/neon/ne_request.c:1002 #: lib/neon/ne_request.c:1012 msgid "Error reading response headers" msgstr "Errore nella lettura delle intestazioni di risposta" #: lib/neon/ne_request.c:1030 msgid "Response header too long" msgstr "Intestazione di risposta troppo lunga" #: lib/neon/ne_request.c:1112 #, fuzzy msgid "Response exceeded maximum number of header fields" msgstr "" "La risposta ha oltrepassato il numero massimo di campi di intestazione." #: lib/neon/ne_request.c:1129 #, c-format msgid "Could not resolve hostname `%s': %s" msgstr "Impossibile risolvere il nome dell'host \"%s\": %s" #: lib/neon/ne_request.c:1260 msgid "Unknown transfer-coding in response" msgstr "" #: lib/neon/ne_request.c:1271 msgid "Invalid Content-Length in response" msgstr "Content-Length non valido nella risposta" #: lib/neon/ne_request.c:1344 #, c-format msgid "Could not write to file: %s" msgstr "Impossibile scrivere il file: %s" #: lib/neon/ne_request.c:1417 #, fuzzy, c-format msgid "Could not create SSL connection through proxy server: %s" msgstr "Impossibile creare una connessione SSL attraverso il server proxy" #: lib/neon/ne_request.c:1464 msgid "Could not create socket" msgstr "Impossibile creare il socket" #: lib/neon/ne_request.c:1526 msgid "Could not connect to proxy server" msgstr "Impossibile connettersi al server proxy" #: lib/neon/ne_request.c:1527 msgid "Could not connect to server" msgstr "Impossibile connettersi al server" #: lib/neon/ne_xml.c:280 #, c-format msgid "XML parse error at line %d: invalid element name" msgstr "Errore di analisi XML alla riga %d: nome di elemento non valido" #: lib/neon/ne_xml.c:452 msgid "Unknown error" msgstr "Errore sconosciuto" #: lib/neon/ne_xml.c:537 msgid "Invalid Byte Order Mark" msgstr "Byte Order Mark non valido" #: lib/neon/ne_xml.c:625 #, fuzzy, c-format msgid "XML parse error at line %d: %s" msgstr "Errore di analisi XML alla riga %d: %s." #: lib/neon/ne_props.c:371 lib/neon/ne_props.c:435 msgid "Response exceeds maximum property count" msgstr "La risposta ha oltrepassato il numero massimo di propriet" #: lib/neon/ne_compress.c:184 #, c-format msgid "%s: %s (code %d)" msgstr "%s: %s (codice %d)" #: lib/neon/ne_compress.c:232 msgid "Could not inflate data" msgstr "Impossibile decomprimere i dati" #: lib/neon/ne_compress.c:293 msgid "Could not initialize zlib" msgstr "Impossibile inizializzare zlib" #: lib/neon/ne_xmlreq.c:36 #, c-format msgid "Could not parse response: %s" msgstr "Impossibile leggere la risposta: %s" #: lib/neon/ne_basic.c:98 #, c-format msgid "Could not determine file size: %s" msgstr "Impossibile determinare la dimensione del file: %s" #: lib/neon/ne_basic.c:149 msgid "Response did not include requested range" msgstr "La risposta non includeva l'intervallo richiesto" #: lib/neon/ne_basic.c:183 msgid "Range is not satisfiable" msgstr "Impossibile soddisfare il range" #: lib/neon/ne_basic.c:188 #, fuzzy msgid "Resource does not support ranged GET requests" msgstr "La risorsa non supporta GET con range." #: lib/neon/ne_auth.c:130 #, fuzzy, c-format msgid "Could not authenticate to server: %s" msgstr "Impossibile connettersi al server" #: lib/neon/ne_auth.c:135 #, fuzzy, c-format msgid "Could not authenticate to proxy server: %s" msgstr "Impossibile connettersi al server proxy" #: lib/neon/ne_auth.c:358 #, c-format msgid "rejected %s challenge" msgstr "" #: lib/neon/ne_auth.c:374 #, fuzzy msgid "missing realm in Basic challenge" msgstr "Realm o nonce mancante nella sfida di autenticazione Digest" #: lib/neon/ne_auth.c:469 msgid "invalid Negotiate token" msgstr "" #: lib/neon/ne_auth.c:492 #, fuzzy msgid "GSSAPI authentication error: " msgstr "Errore di autenticazione GSSAPI (%s)" #: lib/neon/ne_auth.c:505 #, c-format msgid "GSSAPI failure (code %u)" msgstr "" #: lib/neon/ne_auth.c:540 msgid "ignoring empty Negotiate continuation" msgstr "" #: lib/neon/ne_auth.c:555 msgid "Negotiate response verification failed: invalid response header token" msgstr "" #: lib/neon/ne_auth.c:577 #, fuzzy, c-format msgid "Negotiate response verification failure: %s" msgstr "Errore nella verifica del certificato del server: " #: lib/neon/ne_auth.c:697 #, fuzzy msgid "unknown algorithm in Digest challenge" msgstr "Algoritmo sconosciuto nella sfida di autenticazione Digest" #: lib/neon/ne_auth.c:701 #, fuzzy msgid "incompatible algorithm in Digest challenge" msgstr "Algoritmo incompatibile nella sfida di autenticazione Digest" #: lib/neon/ne_auth.c:705 #, fuzzy msgid "missing parameter in Digest challenge" msgstr "Realm o nonce mancante nella sfida di autenticazione Digest" #: lib/neon/ne_auth.c:709 msgid "initial Digest challenge was stale" msgstr "" #: lib/neon/ne_auth.c:716 msgid "stale Digest challenge with new algorithm or realm" msgstr "" #: lib/neon/ne_auth.c:728 #, fuzzy msgid "could not parse domain in Digest challenge" msgstr "Impossibile analizzare la riga di stato della risposta." #: lib/neon/ne_auth.c:1036 msgid "Digest mutual authentication failure: missing parameters" msgstr "Autenticazione mutua digest fallita: parametri mancanti" #: lib/neon/ne_auth.c:1041 msgid "Digest mutual authentication failure: client nonce mismatch" msgstr "Autenticazione mutua digest fallita: nonce del client non coincide" #: lib/neon/ne_auth.c:1051 #, fuzzy msgid "Digest mutual authentication failure: could not parse nonce count" msgstr "Autenticazione mutua digest fallita: nonce del client non coincide" #: lib/neon/ne_auth.c:1056 #, c-format msgid "Digest mutual authentication failure: nonce count mismatch (%u not %u)" msgstr "" "Autenticazione mutua digest fallita: conteggio nonce non coincide (%u non %u)" #: lib/neon/ne_auth.c:1099 msgid "Digest mutual authentication failure: request-digest mismatch" msgstr "Autenticazione mutua digest fallita: richiesta e digest non coincidono" #: lib/neon/ne_auth.c:1225 #, c-format msgid "ignored %s challenge" msgstr "" #: lib/neon/ne_auth.c:1304 #, fuzzy msgid "could not parse challenge" msgstr "Impossibile analizzare la dimensione del chunk" #: lib/neon/ne_207.c:198 #, c-format msgid "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" msgstr "" "Linea di stato HTTP non valida nell'elemento di stato alla riga %d della " "risposta:\n" "La riga di stato era: %s" #: lib/neon/ne_locks.c:584 msgid "LOCK response missing Lock-Token header" msgstr "Header Lock-Token mancante nella risposta LOCK" #: lib/neon/ne_locks.c:759 #, c-format msgid "Response missing activelock for %s" msgstr "Activelock mancante nella risposta per %s" #: lib/neon/ne_locks.c:801 #, c-format msgid "No activelock for <%s> returned in LOCK refresh response" msgstr "Nessun activelock per <%s> nella risposta di refresh LOCK" #: lib/rpmatch.c:79 msgid "^[yY]" msgstr "^[sS]" #: lib/rpmatch.c:82 msgid "^[nN]" msgstr "^[nN]" #: lib/getopt.c:664 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: l'opzione \"%s\" ambigua\n" #: lib/getopt.c:688 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: l'opzione \"--%s\" non ammette argomenti\n" #: lib/getopt.c:693 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: l'opzione \"%c%s\" non ammette argomenti\n" #: lib/getopt.c:710 lib/getopt.c:883 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: l'opzione \"%s\" richiede un argumento\n" #: lib/getopt.c:739 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: opzione non riconosciuta \"--%s\"\n" #: lib/getopt.c:743 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: opzione non riconosciuta \"%c%s\"\n" #: lib/getopt.c:769 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: opzione illegale -- %c\n" #: lib/getopt.c:772 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: opzione non valida -- %c\n" #: lib/getopt.c:802 lib/getopt.c:932 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: l'opzione richiede un argumento -- %c\n" #: lib/getopt.c:849 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: l'opzione \"-W %s\" ambigua\n" #: lib/getopt.c:867 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: l'opzione \"-W %s\" non ammette argomenti\n" #~ msgid " bytes)" #~ msgstr " byte)" #~ msgid "%s\n" #~ msgstr "%s\n" #~ msgid "%s: %s" #~ msgstr "%s: %s" #~ msgid "No Lock-Token header given" #~ msgstr "Header Lock-Token mancante" #~ msgid "%s: Aborted.\n" #~ msgstr "%s: annullato.\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal: %s (%d)\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: intercettato il segnale: %s (%d)\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal %d\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: intercettato il segnale %d\n" #~ msgid "%s: Cannot recover from segmentation fault, aborting.\n" #~ msgstr "" #~ "%s: impossibile riprendere dopo un segmentation fault, annullamento in " #~ "corso.\n" #~ msgid "%s: Aborting update...\n" #~ msgstr "%s: annullamento dell'aggiornamento in corso...\n" #~ msgid "%s: Terminating.\n" #~ msgstr "%s sta terminando.\n" #, fuzzy #~ msgid " of request body file: %s" #~ msgstr "Impossibile scrivere il file: %s" #~ msgid "Server was not authenticated correctly." #~ msgstr "Il server non si autenticato correttamente" #~ msgid "Proxy server was not authenticated correctly." #~ msgstr "Il server proxy non si autenticato correttamente" #~ msgid "Error reading request body." #~ msgstr "Errore nella lettura del corpo della richiesta." #~ msgid "unknown error code" #~ msgstr "codice di errore sconosciuto" sitecopy-0.16.6/po/tr.gmo0000664000076400007640000003645411037462357013364 0ustar joejoel H0I$z"+# =1ox!3FF^D>+)U6d:/;5B%x&0e%\<3'.1Jd|6E4^+*7:"$]0&q1'!!"2;,n974 bBG$,F\r,%,-D&r"  57K7A53<N W ao! %?\w.     ' 1< KYi{ V " 0 F Q l x B  !#!4!D! Y!e!1!9!,!&"?"T"i["")" " ##V#v# ### ### ## ## ####$ $$ %$?/$-o%*%&%%'&7&bW&& &&2&N'S'%q'@'F'^(Y~("( (- )<7)3t)@)<)-&*(T**}*j*(+0<+,m+'+.+7+),0,D,0&-/W-/-A-?-89.8r. .(..q/=/3/+/#0B01^000N0;15L1`1:1#2'B2j22222$2$ 3"03$S3%x3 32334 24@4,P4,}4,424, 575@5R5[5q5.55%5!6"6@6T6n66666*67,7?7R7k77777 7778!8)8;8M8VU888888 9 &949;<9x99999999 :97:!q:,:: :p:W;?r; ;; ;Y;2<A<W<_< g<u< |<< < << <<<<<<==-9M&;`s#=K7!Tpc$hr<:8U*a?W) ty|jJ(BSw4k Ql0~mLuG\@Z^YdH5I>}FNion"V2CeX.%A{ /6 Pg ,3+zOf v]Db[R'qE_1x Files will be moved remotely if moved locally. Passive mode FTP will not be used. Permissions: %s Symlinks: %s Protocol: %s Username: %s Remote directory: %s Local directory: %s Remote files will not be deleted. Changes to items in [brackets] are ignored during updates. Port: (ASCII)%d %s: %c%s site `%s' (on %s in %s) %s: %s cannot maintain symbolic links (site `%s'). %s: %s completed successfully. %s: %s unsupported for %s. %s: All the files and and directories are marked as updated remotely. %s: All the files and directories are marked as NOT updated remotely. %s: Can only check for renamed files when checksumming (site `%s'). %s: Cannot use a relative remote directory in %s (site `%s'). %s: Could not read directory for `%s': %s %s: Error: %s %s: Error: Corrupt site storage file for `%s': %s: %s %s: Error: Could not authorise user on proxy server (%s). %s: Error: Could not authorise user on server. %s: Error: Could not connect to proxy server (%s port %d). %s: Error: Could not connect to server (%s port %d). %s: Error: Could not open rcfile: %s %s: Error: Could not open rcfile: %s. %s: Error: Could not open storage directory: %s %s: Error: Could not open storage file for writing (%s) %s: Error: %s %s: Will not update site `%s'. %s: Error: Could not parse ~/.netrc. %s: Error: Could not resolve hostname of proxy server (%s). %s: Error: Could not resolve remote hostname (%s). %s: Error: Debug channel %s not known. %s: Error: Environment variable HOME not set. %s: Error: No site called `%s' found - skipping. %s: Error: No storage file for `%s'. %s: Use --init, --catchup or --fetch to create a storage file. %s: Error: Only specify ONE operation mode at a time. %s: Error: rcfile permissions allow other users to read your rcfile. %s: Error: storage directory permissions incorrect. %s: Error: ~/.netrc permissions incorrect. %s: Errors occurred while %s the %s site. %s: Failed to fetch file listing for site `%s': %s: %s %s: File permissions are not supported in %s (site `%s'). %s: Invalid port used in site `%s'. %s: Local directory not specified in site `%s'. %s: No sites specified. %s: No valid sites specified. %s: Nothing to do - no changes found. %s: Refusing to delete all local files with a synchronize operation. %s: Use --update to update the remote site. %s: Remote directory not specified in site `%s'. %s: Server not specified in site `%s'. %s: Set the permissions to 0600. %s: Set the permissions to 0700. %s: Skipping site `%s'. %s: The protocol `%s' is unsupported (site `%s'). %s: The remote site does not need updating. %s: The remote site needs updating (%d items to update). %s: The remote site needs updating (1 item to update). %s: Warning: Could not open `%s' to use as logfile. %s: Warning: Only %d sites can be specified on the command line! Extra entries are being skipped. %s: You need to create this directory and set the permissions to 0700. %s: connection timed out.%s: connection was closed by server.%s: illegal option -- %c %s: in act_on_site %s%s: in issue_error %s%s: init_paths gave %d %s%s: invalid option -- %c %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option requires an argument -- %c %s: rcfile corrupt at line %d: %s %s: unrecognized option `%c%s' %s: unrecognized option `--%s' (default) (unspecified)* These items have been added since the last update: * These items have been changed since the last update: * These items have been deleted since the last update: * These items have been deleted, but will be left on the server: * These items have been moved since the last update: ? (y/n) Always maintainedCatch upChange %sChanging %s: Checksumming %s: [Could not access resourceCould not checksum fileCould not connect to proxy serverCould not connect to serverCould not examine file.Could not parse chunk sizeCould not read chunk sizeCould not read response bodyCould not read status lineCould not send requestCould not send request bodyCould not set modification time of local file.Could not write to file: %sCreate %sCreate %s/Creating %s/: Creating %s: Delete %sDelete %s/Deleting %s/: Deleting %s: Directory: %s/ Downloading %s: [Error reading response headersFetchFollowedHost not foundIgnoredInitializeInvalid HTTP status line in status element at line %d of response: Status line was: %sLine too longLink: %s - target %s MaintainedMaintained for executablesMove %s->%sMoving %s->%s: Options: Password: Remote file has been modified - not overwriting with local changesRemove %sResponse header too longRetrying: [SSL support has not be compiled in.Show changes toSite: %s Server: %sSynchronizeThe connection timed out.The server does not appear to be a WebDAV server.The server does not support the executable live property.The target of the symlink could not be read.Try `%s --help' for more information. Unknown system errorUpdateUpload succeeded, but could not retrieve modification time. If this message persists, turn off safe mode.Uploading %s: [Usage: %s [OPTIONS] [MODE] [sitename]... Username: Username: %s VerifyYou should never see this message. Please contact the maintainer at sitecopy@lyra.org ] done. ] failed: %s ^[nN]^[yY]catching updir:done. failed: %s fetchinginitializinglocalproxy serverremoteservershowing changes tostoredsynchronizingupdatingverifyingProject-Id-Version: sitecopy-0.10.10 Report-Msgid-Bugs-To: sitecopy@lyra.org POT-Creation-Date: 2008-07-16 16:31+0100 PO-Revision-Date: 2001-01-03 HO:MI+ZONE Last-Translator: A. Sinan Unur Language-Team: tr MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-9 Content-Transfer-Encoding: 8bit Yeri deien dosyalar, sunucuda da tanr. Pasif FTP ilem biimi kullanlmayacak. zinler: %s Sembolik linkler: %s Protokol: %s Kullanc:%s Sunucudaki ktk: %s Yerel ktk: %s Sunucudaki dosyalar silinmez. [Parantez] iindeki birimlere yapilan deiiklikler gncelletirme srasnda gz nne alnmaz. Port: (ASCII)%d %s: %c%s: `%s' sitesi (%s sunucusunda %s kt) %s: %s protokol ile sembolik linklerin korunmas mmkn deil (`%s' sitesi). %s: %s baaryla tamamland. %s: %s, %s sitesinde desteklenmiyor. %s: Btn dosya ve ktkler sunucuda gncel olarak iaretlendi. %s: Btn dosya ve ktkler sunucuda gncel DEL olarak iaretlendi. %s: Ad deien dosyalar sadece kontrol toplamlar hesaplanarak belirlenebilir (`%s' sitesi). %s: %s protokol ile sunucuda greli ktklerin kullanlmas mmkn deil (`%s' sitesi). %s: `%s'nin kt okunamad: %s %s: Hata: %s %s: Hata: Bozuk site veritaban `%s': %s: %s %s: Hata: Kullanc %s ara sunucusu tarafndan onaylanmad. %s: Hata: Kullanc sunucu tarafndan onaylanmad. %s: Hata: %s ara sunucusu ile %d portundan balant kurulamad. %s: Hata: %s sunucusu ile %d portundan balant kurulamad. %s: Hata: %s adl kurulum dosyas alamad. %s: Hata: Kurulum dosyas %s alamad. %s: Hata: Veritaban kt %s alamad. %s: Hata: Veritaban dosyas %s yazm iin alamad. %s: Hata: %s %s: `%s' sitesi gncelletirilmeyecek. %s: Hata ~/.netrc dosyas anlalamad. %s: Hata: %s ara sunucusunun adresi bulunamad. %s: Hata: %s sunucusunun adresi bulunamad. %s: Hata: zleme kanal %s bilinmiyor. %s: Hata: Ortam deikeni HOME belirtilmemi. %s: Hata: `%s' adnda bir site bulunamadi - atlyorum. %s: Hata: `%s' sitesinin veritaban yok. %s: --init, --catchup ya da --fetch seenekelerinden birini kullanarak veritabann yaratn. %s: Hata: Sadece tek BR ilem biimi belirtin. %s: Hata: Kurulum dosyas baka kullanclar tarafndan okunabilir. %s: Hata: Veritaban ktnn izinleri yanl. %s: Hata: ~/.netrc dosyasnn izinleri yanl. %s: %s: `%s' sitesinde hatalarla karlald. %s: `%s' sitesinden dosya listesi indirme baarsz oldu: %s: %s %s: %s protokol dosya izinlerini desteklemiyor (`%s' sitesi). %s: `%s' sitesinin tanmnda geersiz port belirtilmi. %s: `%s' sitesinin tanmnda yerel ktk belirtilmemi. %s: Hi bir site ad verilmedi. %s: Geerli bir site adna rastlanmad. %s: Hi deiiklik yok. %s: Refusing to delete all local files with a synchronize operation. %s: Use --update to update the remote site. %s: `%s' sitesinin tanmnda sunucudaki ktk belirtilmemi. %s: `%s' sitesinin tanmnda sunucu belirtilmemi. %s: Dosya izinlerini 0600 olarak belirtin. %s: zinleri 0700 olarak belirtin. %s: `%s' sitesi atlanyor. %s: `%s' protokol desteklenmiyor (`%s' sitesi). %s: Sunucunun gncelletirilmesi gerekli deil. %s: Sunucunun gncelletirilmesi gerek. (Gncelletirilecek dosya adedi: %d) %s: Sunucudaki bir adet dosyann gncelletirilmesi gerek. %s: Uyar: `%s' dosyas izleme kayd iin alamad. %s: Uyar: Komut satrnda en fazla %d adet site belirtilebilir! Fazlas gz nne alnmayacak. %s: Bu kt yaratn ve izinlerini 0700 olarak belirtin. %s: balant bekleme snr ald.%s: balant sunucu tarafinden kesildi.%s: anlamsz seenek --%c %s: in act_on_site %s%s: in issue_error %s%s: init_paths gave %d %s%s: geersiz seenek --%c %s: `%c%s' seenei argman almyor %s: `%s' seeneini anlam belirsiz %s: `%s' seeneine argman gerek %s: `--%s' seenei argman almyor %s: `-W %s' seenei argman almyor %s: %c seeneine argman gerek %s: kurulum dosyasnda bozukluk var. satr %d: %s %s: `%c%s' seenei bilinmiyor %s: `--%s' seenei bilinmiyor (varsaylan) (belirtilmemi)* Son gncelletirmeden bu yana eklenenler: * Son gncelletirmeden bu yana deienler: * Son gncelletirmeden bu yana silinenler: * Yerel kopyas silinip sunucudan silinmeyeckler: * Son gncelletirmeden bu yana tananlar: ? (e/h) Her zaman korunurGncelle%s dosyasn deitir%s dosyas deitiriliyor: %s dosyasnn kontrol toplam hesaplanyor: [ Kaynaa eriim baarsz olduDosyann kotrol toplam hesaplanamadAra sunucuyla balant kurulamadSunucuyla balant kurulamadDosya incelenemedi.Para boyutu anlalamadPara boyutu renilemediYant metni okunamadDurum satr okunamadstek gnderilemedistek metni gnderilemediYerel dosyann deiim vakti ayarlanamad.%s dosyasna yazm yaplamad%s dosyasn yarat%s/ ktn yarat%s/ kt yaratlyor: %s dosyas yaratlyor: %s dosyasn sil%s/ ktn sil%s/ kt siliniyor: %s dosyas siliniyor: Ktk: %s/ %s dosyas indiriliyor: [Yant balklar okunurken hatancelezlenirSunucu bulunamadGz nne alnmazHazrlaInvalid HTTP status line in status element at line %d of response: Status line was: %sSatr ok uzunLink: %s - hedefi %s KorunurProgramlar iin korunur%s dosyasn %s'ye ta%s dosyas %s'ye tanyor: Seenekler: ifre: Sunucudaki dosya deimi - yerel dosya stne yazlmayacak%s dosyasn silYant bal ok uzunTekrar deneniyor: [SSL destei yok.Deiiklikleri gsterSite: %s Sunucu: %sEletirBalant sre snr ald.Bu sunucu WebDAV sunucusu deil.The server does not support the executable live property.Sembolik linkin hedefi okunamad.Ek bilgi iin `%s --help' komutunu deneyin. Bilinmeyen sistem hatasGncelletirSunucuya aktarma tamamland, ama dosyann deiim vakti alnamad. If this message persists, turn off safe mode.%s dosyas gnderiliyor: [Kullanm biimi: %s [SEENEKLER] [LEM BM] [site ad] ... Kullanc: Kullanci: %s Kontrol etBu mesajn asla verilmemesi gerekir. Bu durumu ltfen sitecopy@lyra.org adresine iletin. ] tamamland. ] baarsz oldu: %s ^[hHnN]^[eEyY]gncelleniyorktk:tamamland. baarsz oldu: %s inceleniyorhazrlanyoryerelara sunucusunucusunucudeiiklikler gsteriliyoryklendieletiriliyorgncelletiriliyorkontrol ediliyorsitecopy-0.16.6/po/insert-header.sin0000664000076400007640000000124010165765223015460 0ustar joejoe# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } sitecopy-0.16.6/po/ja.gmo0000664000076400007640000003357511037462357013332 0ustar joejoe  0 $: "_  + # = /!83ZFFDX>+6:?/z;5%&B0i%<3.11`d6E.4t+*7:8$s0&1(JZI'!!9[2t,97EF4bG$l$,,%J,p- &"6V5v77A5^+  )!Ac. 4 >I X f p{    $ 4 ?BJ  # 19D,~&iX )h      ! !!!$!7! >!L! U!K_!6"!"!# &#4G#&|#*# #%#9#9$&Q$7x$5$P$97%(q%5%C%+&?@&5&'&-&1 '(>'Og'E'1'=/(vm(+(?)7P).)!)K)5%*%[*=*#*-*1+=C+B+A+1,8,X,#x,1,!,/,. -LO-8-\-12.d."....'./"/'R/'z/(/2/!/* 0#K0#o0000.011*1"=1`1 o1 y111(1"1" 2,2G2f22022 2 2 2 3 3 3 )3 63B3U3j3}333333333 4O4 d4 n4$|444 4404@52U5'5555T6*i6 6666 66 66 6777'7:7C7 L7W7\7k7 r7F_3 @}?+GKD"L:dk~r[=\xZ*6,PbAehy1]RSO8Y'%^7(>on`Em.9 #M!t{iH-0;s|J< IfT CW2N/gc4)5a$Ujp uXvlzwq Q&BV Files will be moved remotely if moved locally. Passive mode FTP will not be used. Permissions: %s Symlinks: %s Protocol: %s Username: %s Remote directory: %s Local directory: %s Remote files will not be deleted. Changes to items in [brackets] are ignored during updates. Port: %s: %c%s site `%s' (on %s in %s) %s: %s cannot maintain symbolic links (site `%s'). %s: %s completed successfully. %s: %s unsupported for %s. %s: All the files and and directories are marked as updated remotely. %s: All the files and directories are marked as NOT updated remotely. %s: Can only check for renamed files when checksumming (site `%s'). %s: Cannot use a relative remote directory in %s (site `%s'). %s: Could not read directory for `%s': %s %s: Error: Corrupt site storage file for `%s': %s: %s %s: Error: Could not authorise user on proxy server (%s). %s: Error: Could not authorise user on server. %s: Error: Could not connect to proxy server (%s port %d). %s: Error: Could not connect to server (%s port %d). %s: Error: Could not open rcfile: %s %s: Error: Could not open rcfile: %s. %s: Error: Could not open storage directory: %s %s: Error: Could not parse ~/.netrc. %s: Error: Could not resolve hostname of proxy server (%s). %s: Error: Could not resolve remote hostname (%s). %s: Error: Environment variable HOME not set. %s: Error: No site called `%s' found - skipping. %s: Error: No storage file for `%s'. %s: Use --init, --catchup or --fetch to create a storage file. %s: Error: Only specify ONE operation mode at a time. %s: Error: rcfile permissions allow other users to read your rcfile. %s: Error: storage directory permissions incorrect. %s: Error: ~/.netrc permissions incorrect. %s: Errors occurred while %s the %s site. %s: Failed to fetch file listing for site `%s': %s: %s %s: File permissions are not supported in %s (site `%s'). %s: Invalid port used in site `%s'. %s: Local directory not specified in site `%s'. %s: No sites specified. %s: No valid sites specified. %s: Nothing to do - no changes found. %s: Remote directory not specified in site `%s'. %s: Safe mode cannot be used in conjunction with nooverwrite (site `%s'). %s: Safe mode cannot be used in conjunction with tempupload (site `%s'). %s: Server not specified in site `%s'. %s: Set the permissions to 0600. %s: Set the permissions to 0700. %s: Skipping site `%s'. %s: The protocol `%s' is unsupported (site `%s'). %s: The remote site does not need updating. %s: The remote site needs updating (%d items to update). %s: The remote site needs updating (1 item to update). %s: Unhandled error %d in site `%s' - please contact the maintainer. %s: Warning: Could not open `%s' to use as logfile. %s: Warning: Only %d sites can be specified on the command line! Extra entries are being skipped. %s: You need to create this directory and set the permissions to 0700. %s: connection timed out.%s: connection was closed by server.%s: illegal option -- %c %s: in fe_updating/file_link %s%s: invalid option -- %c %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: rcfile corrupt at line %d: %s %s: unrecognized option `%c%s' %s: unrecognized option `--%s' * These items have been added since the last update: * These items have been changed since the last update: * These items have been deleted since the last update: * These items have been deleted, but will be left on the server: * These items have been moved since the last update: ? (y/n) Always maintainedAuthentication required for %s on %s `%s': Catch upChange %sChanging %s: Checksumming %s: [Could not access resourceCould not checksum fileCould not connect to proxy serverCould not connect to serverCould not examine file.Could not parse chunk sizeCould not read chunk sizeCould not read response bodyCould not set modification time of local file.Could not write to file: %sCreate %sCreate %s/Creating %s/: Creating %s: Delete %sDelete %s/Deleting %s/: Deleting %s: Directory: %s/ Downloading %s: [FetchFollowedIgnoredInitializeLink: %s - target %s MaintainedMaintained for executablesMove %s->%sMoving %s->%s: Options: Password: Remote file has been modified - not overwriting with local changesRemove %sRetrying: [SSL support has not be compiled in.Show changes toSite: %s Server: %sSynchronizeThe connection timed out.The server does not appear to be a WebDAV server.The server does not support the executable live property.The target of the symlink could not be read.Try `%s --help' for more information. Unknown system errorUpdateUpload succeeded, but could not retrieve modification time. If this message persists, turn off safe mode.Uploading %s: [Usage: %s [OPTIONS] [MODE] [sitename]... Username: Username: %s Verify] done. ] failed: %s catching updir:done. failed: %s fetchinginitializinglocalproxy serverremoteservershowing changes tostoredsynchronizingupdatingverifyingProject-Id-Version: sitecopy 0.10.14 Report-Msgid-Bugs-To: sitecopy@lyra.org POT-Creation-Date: 2008-07-16 16:31+0100 PO-Revision-Date: 2001-01-16 07:32+0900 Last-Translator: Nobuyuki Tsuchimura Language-Team: ja MIME-Version: 1.0 Content-Type: text/plain; charset=EUC-JP Content-Transfer-Encoding: 8-bit ǰưեϥСǤưޤ Passive mode FTP ϻȤޤ ե°: %s : %s ץȥ: %s 桼: %s Сǥ쥯ȥ: %s ǥ쥯ȥ: %s С¦ΥեϺޤ [] ΥեϹޤ ݡ: %s: %c%s - `%s' (on %s in %s) %s: %s ϥܥå󥯤Ȥޤʥ `%s'ˡ %s: %sޤ %s: %s %s ǤϼƤޤ %s: СΥեϺǿǤȤƵϿޤ %s: С˥ե뤬ʤΤȤƵϿޤ %s: checkmoved renames state checksum Ʊ˻ꤷƲʥ `%s') %s: %s ǤХǥ쥯ȥȤޤʥ `%s'ˡ %s: ǥ쥯ȥ꤬ɤޤ`%s': %s %s: 顼: Ͽե `%s' Ƥޤ: %s: %s %s: 顼: ץС (%s) ǥ桼ǧڤ˼Ԥޤ %s: 顼: 桼ǧڤ˼Ԥޤ %s: 顼: ץС (%s port %d) ³Ǥޤ %s: 顼: С (%s port %d) ³Ǥޤ %s: 顼: rcfile '%s' ɤޤ %s: 顼: rcfile %s 򥪡ץǤޤ %s: 顼: Ͽѥǥ쥯ȥ %s ޤ %s: 顼: ~/.netrc Ͻޤ %s: 顼: ץСΥۥ̾ (%s) IP ɥ쥹ѴǤޤ %s: 顼: СΥۥ̾ (%s) IP ɥ쥹ѴǤޤ %s: 顼: Ķѿ HOME Ƥޤ %s: 顼: %sפȤȤϤޤ󡣥åפޤ %s: 顼: `%s' εϿե뤬ޤ %s: ޤ --init, --catchup ,--fetch Τ줫¹ԤƲ %s: 顼: ưϣĤꤷƲ %s: 顼: ʤ rcfile ¾ͤɤ°ˤʤäƤޤ %s: 顼: Ͽѥǥ쥯ȥ°ɤޤ %s: 顼: ~/.netrc °ɤޤ %s: %s%sǥ顼ޤ %s: '%s' ΥСˤեΰ˼Ԥޤ: %s: %s %s: %s Ǥϥե°Ȥޤʥ `%s'ˡ %s: `%s' ΥݡȤ̵Ǥ %s: `%s' ǥǥ쥯ȥ꤬ꤵƤޤ %s: ̾ꤵƤޤ %s: Ͽ줿̾ꤵƤޤ %s: ѹ줿ե뤬ʤΤǡ⤷ޤ %s: `%s' ǥСǥ쥯ȥ꤬ꤵƤޤ %s: safe nooverwrite ƱˤϻǤޤʥ `%s'ˡ %s: safe tempupload ƱˤϻǤޤʥ `%s'ˡ %s: '%s' ǥСꤵƤޤ %s: ° 0600 ˤƲ %s: ° 0700 ˤƲ %s: `%s' 򥹥åפޤ %s: `%s' ץȥϻȤޤʥ `%s'ˡ %s: ФΥեϺǿǤ %s: ФΥեϹɬפǤ%dġˡ %s: ФΥեϹɬפǤ1ġˡ %s: ͽ̥顼 %d `%s' ǵޤ - ԤޤϢ %s: ٹ: '%s' եȤƥץǤޤ %s: ٹ: ޥɥ饤󤫤 %d ĤΥȤǤޤ ¿Τ̵뤷ޤ %s: Υǥ쥯ȥ° 0700 ˤƲ %s: ³ॢȤǤ%s: ³Сڤޤ%s: ʥץ -- %c %s: in fe_updating/file_link %s%s: ̵ʥץ -- %c %s: ץ `%c%s' ˰פǤ %s: ץ `%s' ʣΰ̣˲Ǥޤ %s: ץ `--%s' ˰ɬפǤ %s: ץ `--%s' ˰פǤ %s: ץ `-W %s' ϰפǤ %s: ץ `-W %s' ʣΰ̣˲Ǥޤ %s: ɬפʥץ -- %c %s: rcfile %d ԤǴְäƤޤ: %s %s: ץ `%c%s' Ϥޤ %s: ץ `--%s' Ϥޤ * ե: * ѹ줿ե: * 줿ե: * 줿եʥСˤϻĤޤ: * ư줿ե: ޤ (y/n) ٤Ƥ°򰷤%s ؤǧڤ %s ɬפǤ '%s': Ѥߥޡ%s ѹѹ %s: å׻ %s: [꥽˥ǤޤեΥå׻ǤޤץС³ǤޤץС³ǤޤեǤǤޤchunk 礭ϤǤޤchunk 礭ɤޤresponse body ɤޤեκǽѹǤޤե뤬񤱤ޤ: %s%s %s/ %s/: %s: %s %s/ %s/: %s: ǥ쥯ȥ: %s/ %s: [եΰ򤿤ɤ̵뤹: %s - %s 󥯤Ȥư¹°򰷤%s %s ˰ưư %s->%s: ץ ѥ: СΥե뤬Ƥޤ - եѹ񤭤ޤ%s ӳǧ: [SSL ǽѥ뤵Ƥޤɽ: %s С: %s³ॢȡΥС WebDAV СǤϤʤ褦ǤΥС executable live property 򥵥ݡȤƤޤܥå󥯤Υե뤬ɤޤ`%s --help' Ǿܤɽޤ ̤ΤΥƥ२顼åץɤޤեκǽǤޤǤ ΥåĤФʤ顢safe mode Ʋåץ %s: [Ȥ: %s [OPTIONS] [MODE] [sitename]... 桼̾: 桼̾: %s ӳǧ] λ. ] : %s Ѥߥޡǥ쥯ȥ:λ : %s եΰץСССɽϿӳǧsitecopy-0.16.6/po/nn.po0000664000076400007640000014743411037413774013206 0ustar joejoe# Norwegian Nynorsk sitecopy translation. # Copyright (C) 2001 Karl Ove Hufthammer. # Karl Ove Hufthammer , 2002. # msgid "" msgstr "" "Project-Id-Version: sitecopy 0.11.4\n" "Report-Msgid-Bugs-To: sitecopy@lyra.org\n" "POT-Creation-Date: 2008-07-16 16:31+0100\n" "PO-Revision-Date: 2002-11-07 18:11+0100\n" "Last-Translator: Karl Ove Hufthammer \n" "Language-Team: Norwegian Nynorsk \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/console_fe.c:119 msgid "Show changes to" msgstr "Vis endringar i" #: src/console_fe.c:119 msgid "showing changes to" msgstr "viser endringar i" #: src/console_fe.c:119 src/console_fe.c:120 msgid "local" msgstr "lokal" #: src/console_fe.c:120 msgid "Synchronize" msgstr "Synkroniser" #: src/console_fe.c:120 msgid "synchronizing" msgstr "synkroniserer" #: src/console_fe.c:125 msgid "Fetch" msgstr "Hent" #: src/console_fe.c:125 msgid "fetching" msgstr "hentar" #: src/console_fe.c:125 src/console_fe.c:126 src/console_fe.c:127 msgid "remote" msgstr "fjerntliggande" #: src/console_fe.c:126 gnome/init.c:198 msgid "Update" msgstr "Oppdater" #: src/console_fe.c:126 msgid "updating" msgstr "oppdaterer" #: src/console_fe.c:127 msgid "Verify" msgstr "Stadfest" #: src/console_fe.c:127 msgid "verifying" msgstr "Stadfestar" #: src/console_fe.c:128 msgid "Catch up" msgstr "Gjer oppdatert" #: src/console_fe.c:128 msgid "catching up" msgstr "gjer oppdatert" #: src/console_fe.c:128 src/console_fe.c:129 msgid "stored" msgstr "lagra" #: src/console_fe.c:129 msgid "Initialize" msgstr "Initier" #: src/console_fe.c:129 msgid "initializing" msgstr "initierer" #: src/console_fe.c:134 msgid "" "You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n" msgstr "" "Du skal aldri sjå denne feilmeldinga.\n" "Kontakt vedlikehaldaren på sitecopy@lyra.org\n" #: src/console_fe.c:196 #, c-format msgid "%s: Error: No site called `%s' found - skipping.\n" msgstr "%s: Feil: Fann ikkje nettstaden «%s». Hoppar over.\n" #: src/console_fe.c:214 #, c-format msgid "%s: No valid sites specified.\n" msgstr "%s: Ingen gyldige nettstader valt.\n" #: src/console_fe.c:216 #, c-format msgid "%s: No sites specified.\n" msgstr "%s: Ingen nettstader valt.\n" #: src/console_fe.c:218 src/console_fe.c:369 src/console_fe.c:529 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Prøv «%s --help» for meir informasjon.\n" #: src/console_fe.c:228 #, c-format msgid "%s: %c%s site `%s' (on %s in %s)\n" msgstr "%s: %c%s nettstaden «%s» (på %s i %s)\n" #: src/console_fe.c:249 #, c-format msgid "* These items have been added since the last update:\n" msgstr "– Følgjande er lagt til etter førre oppdatering:\n" #: src/console_fe.c:254 src/console_fe.c:285 #, c-format msgid "dir:" msgstr "katalog:" #: src/console_fe.c:261 #, c-format msgid "* These items have been changed since the last update:\n" msgstr "– Følgjande er endra etter førre oppdatering:\n" #: src/console_fe.c:263 #, c-format msgid " Changes to items in [brackets] are ignored during updates.\n" msgstr " Endringar i [klammer] blir ignorert ved oppdateringar.\n" #: src/console_fe.c:277 #, c-format msgid "* These items have been deleted, but will be left on the server:\n" msgstr "– Følgjande er sletta, men ligg igjen på tenaren:\n" #: src/console_fe.c:279 #, c-format msgid "* These items have been deleted since the last update:\n" msgstr "– Følgjande er sletta etter førre oppdatering:\n" #: src/console_fe.c:292 #, c-format msgid "* These items have been moved since the last update:\n" msgstr "– Følgjande er flytta etter førre oppdatering:\n" #: src/console_fe.c:310 src/console_fe.c:322 msgid "Ignored" msgstr "Ignorert" #: src/console_fe.c:312 msgid "Maintained for executables" msgstr "Opprettheldt for kjørbare filer" #: src/console_fe.c:314 msgid "Always maintained" msgstr "Alltid opprettheldt" #: src/console_fe.c:324 msgid "Maintained" msgstr "Opprettheldt" #: src/console_fe.c:326 msgid "Followed" msgstr "Følgt" #: src/console_fe.c:337 #, c-format msgid "" "Site: %s\n" "\tServer: %s" msgstr "" "Nettstad: %s\n" "\tTenar: %s" #: src/console_fe.c:339 #, c-format msgid " Port: " msgstr " Port: " #: src/console_fe.c:341 #, c-format msgid "(default)\n" msgstr "(standard)\n" #: src/console_fe.c:343 #, c-format msgid "%d\n" msgstr "%d\n" #: src/console_fe.c:345 #, c-format msgid "\tProtocol: %s Username: %s\n" msgstr "\tProtokoll: %s Brukarnamn: %s\n" #: src/console_fe.c:348 msgid "(unspecified)" msgstr "(ikkje valt)" #: src/console_fe.c:350 #, c-format msgid "\tPassive mode FTP will not be used.\n" msgstr "\tPassiv FTP blir ikkje brukt.\n" #: src/console_fe.c:351 #, c-format msgid "" "\tRemote directory: %s\n" "\tLocal directory: %s\n" msgstr "" "\tFjerntliggande katalog: %s\n" "\tLokal katalog: %s\n" #: src/console_fe.c:353 #, c-format msgid "\tPermissions: %s Symlinks: %s\n" msgstr "\tLøyve: %s Symbolske lenkjer: %s\n" #: src/console_fe.c:356 #, c-format msgid "\tRemote files will not be deleted.\n" msgstr "\tFiler på tenaren blir ikkje sletta.\n" #: src/console_fe.c:358 #, c-format msgid "\tFiles will be moved remotely if moved locally.\n" msgstr "\tFiler blir flytta på tenaren når dei blir flytta lokalt.\n" #: src/console_fe.c:367 #, c-format msgid "%s: Error: Only specify ONE operation mode at a time.\n" msgstr "%s: Feil: Vel berre éin operasjonsmodus om gongen.\n" #: src/console_fe.c:489 #, c-format msgid "%s: Error: Debug channel %s not known.\n" msgstr "%s: Feil: Avlusingskanalen %s er ukjend.\n" #: src/console_fe.c:497 #, c-format msgid "%s: Warning: Could not open `%s' to use as logfile.\n" msgstr "%s: Åtvaring: Klarte ikkje opna «%s» for loggføring.\n" #: src/console_fe.c:540 #, c-format msgid "%s: Error: Dry run mode is currently only supported for updates.\n" msgstr "" #: src/console_fe.c:556 #, c-format msgid "" "%s: Warning: Only %d sites can be specified on the command line!\n" "Extra entries are being skipped.\n" msgstr "" "%s: Åtvaring: Berre %d nettstader kan veljast frå kommandolinja!\n" "Resten av nettstadane blir ikkje oppdaterte.\n" #: src/console_fe.c:581 #, fuzzy msgid "WARNING: Server certificate is not trusted." msgstr "Tenarsertifikatet er ikkje gyldig enno" #: src/console_fe.c:584 #, fuzzy, c-format msgid "Certificate was issued for server `%s'.\n" msgstr "Sertifikatet er utferda av:" #: src/console_fe.c:586 msgid "WARNING: Certificate does not specify a server" msgstr "" #: src/console_fe.c:588 #, fuzzy, c-format msgid "Fingerprint: %s\n" msgstr "Fingeravtrykk: %s" #: src/console_fe.c:591 #, c-format msgid "Issued to: %s\n" msgstr "" #: src/console_fe.c:595 #, c-format msgid "Issued by: %s\n" msgstr "" #: src/console_fe.c:598 #, c-format msgid "Do you wish to accept this certificate? (y/n) " msgstr "" #: src/console_fe.c:607 msgid "server" msgstr "tenar" #: src/console_fe.c:607 msgid "proxy server" msgstr "mellomtenar" #: src/console_fe.c:613 #, c-format msgid "Authentication required for %s on %s `%s':\n" msgstr "Krev autentisering for %s på %s «%s»:\n" #: src/console_fe.c:616 #, c-format msgid "Authentication required on %s `%s':\n" msgstr "Krev autentisering på %s «%s»:\n" #: src/console_fe.c:619 msgid "Username: " msgstr "Brukarnamn: " #: src/console_fe.c:624 #, c-format msgid "Username: %s\n" msgstr "Brukarnamn: %s\n" #: src/console_fe.c:626 src/console_fe.c:650 msgid "Password: " msgstr "Passord: " #: src/console_fe.c:636 #, c-format msgid "Retrying: [" msgstr "Prøver på nytt: [" #: src/console_fe.c:647 #, c-format msgid "%s: Encrypted client certificate configured%s%s.\n" msgstr "" #: src/console_fe.c:682 #, c-format msgid "Create %s/" msgstr "Opprett %s/" #: src/console_fe.c:684 #, c-format msgid "Delete %s/" msgstr "Slett %s/" #: src/console_fe.c:692 #, fuzzy, c-format msgid "Upload %s (%s bytes)" msgstr "Last opp %s (%" #: src/console_fe.c:694 #, c-format msgid "Delete %s" msgstr "Slett %s" #: src/console_fe.c:695 #, c-format msgid "Move %s->%s" msgstr "Flytt %s til %s" #: src/console_fe.c:699 #, c-format msgid "" "%s: in fe_can_update/file_file\n" "%s" msgstr "" "%s: i fe_can_update/file_file\n" "%s" #: src/console_fe.c:706 #, c-format msgid "Change %s" msgstr "Endra %s" #: src/console_fe.c:707 #, c-format msgid "Create %s" msgstr "Opprett %s" #: src/console_fe.c:708 #, c-format msgid "Remove %s" msgstr "Fjern %s" #: src/console_fe.c:711 #, c-format msgid "" "%s: in fe_can_update/file_link\n" "%s" msgstr "" "%s: i fe_can_update/file_link\n" "%s" #: src/console_fe.c:717 #, c-format msgid "? (y/n) " msgstr "? (j/n)" #: src/console_fe.c:726 #, c-format msgid "Checksumming %s: [" msgstr "Reknar ut sjekksum til %s: [" #: src/console_fe.c:741 src/console_fe.c:852 src/console_fe.c:913 #, c-format msgid "] done.\n" msgstr "] ferdig.\n" #: src/console_fe.c:743 src/console_fe.c:915 #, c-format msgid "" "] failed:\n" "%s\n" msgstr "" "] mislykka:\n" "%s\n" #: src/console_fe.c:753 #, fuzzy, c-format msgid "Setting permissions on %s%s: " msgstr "Sett løyve på %s: " #: src/console_fe.c:763 src/console_fe.c:841 src/console_fe.c:907 #, c-format msgid "done.\n" msgstr "ferdig.\n" #: src/console_fe.c:765 src/console_fe.c:909 #, c-format msgid "" "failed:\n" "%s\n" msgstr "" "mislykka:\n" "%s\n" #: src/console_fe.c:784 src/console_fe.c:871 #, c-format msgid "Creating %s/: " msgstr "Opprettar %s/:" #: src/console_fe.c:786 src/console_fe.c:873 #, c-format msgid "Deleting %s/: " msgstr "Slettar %s/:" #: src/console_fe.c:793 #, c-format msgid "Uploading %s: [" msgstr "Lastar opp %s: [" #: src/console_fe.c:796 src/console_fe.c:815 src/console_fe.c:883 #, c-format msgid "Deleting %s: " msgstr "Slettar %s: " #: src/console_fe.c:799 src/console_fe.c:886 #, c-format msgid "Moving %s->%s: " msgstr "Flyttar %s til %s: " #: src/console_fe.c:803 #, c-format msgid "" "%s: in fe_updating/file_file\n" "%s" msgstr "" "%s: i fe_updating/file_file\n" "%s" #: src/console_fe.c:811 #, c-format msgid "Changing %s: " msgstr "Endrar %s: " #: src/console_fe.c:813 #, c-format msgid "Creating %s: " msgstr "Opprettar %s: " #: src/console_fe.c:817 #, c-format msgid "" "%s: in fe_updating/file_link\n" "%s" msgstr "" "%s: i fe_updating/file_link\n" "%s" #: src/console_fe.c:834 #, fuzzy, c-format msgid "Failed to update %s:%c%s\n" msgstr "" "Klarte ikkje oppdatera %s:\n" "%s\n" #: src/console_fe.c:843 #, fuzzy, c-format msgid "failed:%c%s\n" msgstr "" "mislykka:\n" "%s\n" #: src/console_fe.c:855 #, fuzzy, c-format msgid "] failed:%c%s\n" msgstr "" "] mislykka:\n" "%s\n" #: src/console_fe.c:880 #, c-format msgid "Downloading %s: [" msgstr "Lastar ned %s: [" #: src/console_fe.c:925 msgid "Changed on server" msgstr "Endra på tenaren" #: src/console_fe.c:928 msgid "Added on server" msgstr "Lagt til på tenaren" #: src/console_fe.c:936 #, c-format msgid "%s: %s\n" msgstr "%s: %s\n" #: src/console_fe.c:956 #, c-format msgid "Directory: %s/\n" msgstr "Katalog: %s/\n" #: src/console_fe.c:961 #, fuzzy, c-format msgid "File: %s - size %s%s\n" msgstr "Fil: %s – storleik %" #: src/console_fe.c:963 msgid " (ASCII)" msgstr " (ASCII)" #: src/console_fe.c:966 #, c-format msgid "Link: %s - target %s\n" msgstr "Lenkje: %s – mål %s\n" #: src/console_fe.c:979 gnome/init.c:402 #, c-format msgid "%s: Error: Could not open rcfile: %s.\n" msgstr "%s: Feil: Klarte ikkje opna «rcfile»-fila: %s.\n" #: src/console_fe.c:983 gnome/init.c:407 #, c-format msgid "" "%s: rcfile corrupt at line %d:\n" "%s\n" msgstr "" "%s: «rcfile»-fila er øydelagt – linje %d:\n" "%s\n" #: src/console_fe.c:1002 #, c-format msgid "" "%s: Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: Klarte ikkje lesa katalog for «%s»:\n" "\t%s\n" #: src/console_fe.c:1006 #, c-format msgid "%s: Server not specified in site `%s'.\n" msgstr "%s: Ingen tenar valt for nettstaden «%s».\n" #: src/console_fe.c:1010 #, c-format msgid "%s: Remote directory not specified in site `%s'.\n" msgstr "%s: Fjerntliggande katalog ikkje valt for nettstaden «%s».\n" #: src/console_fe.c:1014 #, c-format msgid "%s: Local directory not specified in site `%s'.\n" msgstr "%s: Lokal katalog ikkje valt for nettstaden «%s».\n" #: src/console_fe.c:1018 #, c-format msgid "%s: Invalid port used in site `%s'.\n" msgstr "%s: Ugyldig port brukt for nettstaden «%s».\n" #: src/console_fe.c:1022 #, c-format msgid "%s: %s cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s klarte ikkje oppretthelda symbolske lenkjer (nettstad: «%s»).\n" #: src/console_fe.c:1026 #, c-format msgid "%s: Cannot use a relative remote directory in %s (site `%s').\n" msgstr "" "%s: Klarte ikkje bruka ein relativ fjerntliggande katalog i %s (nettstad: «%" "s»).\n" #: src/console_fe.c:1029 #, c-format msgid "%s: File permissions are not supported in %s (site `%s').\n" msgstr "%s: Filløyver er ikkje støtta i %s (nettstad: «%s»).\n" #: src/console_fe.c:1032 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n" msgstr "" "%s: Sikkermodus kan ikkje brukast saman med «nooverwrite» (nettstad: «%s»).\n" #: src/console_fe.c:1035 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n" msgstr "" "%s: Sikkermodus kan ikkje brukast saman med «tempupload» (nettstad: «%s»).\n" #: src/console_fe.c:1038 #, c-format msgid "%s: Can only check for renamed files when checksumming (site `%s').\n" msgstr "" "%s: Kan berre sjå etter filer med endra namn ved bruk av sjekksum (nettstad: " "«%s»).\n" #: src/console_fe.c:1041 #, c-format msgid "%s: The protocol `%s' is unsupported (site `%s').\n" msgstr "%s: Støttar ikkje protokollen «%s» (nettstad: «%s»).\n" #: src/console_fe.c:1048 #, c-format msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" msgstr "" "%s: Klarte ikkje handtera feil %d i nettstaden «%s» – kontakt " "vedlikehaldaren.\n" #: src/console_fe.c:1066 #, c-format msgid "" "%s: Error: Corrupt site storage file for `%s':\n" "%s: %s\n" msgstr "" "%s: Feil: Øydelagd lagringsfil for «%s»:\n" "%s: %s\n" #: src/console_fe.c:1075 #, c-format msgid "" "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n" msgstr "" "%s: Feil: Det finst inga lagringsfil for «%s».\n" "%s: Bruk --init, --catchup eller --fetch for å laga ei lagringsfil.\n" #: src/console_fe.c:1088 #, c-format msgid "%s: Skipping site `%s'.\n" msgstr "%s: Hoppar over nettstaden «%s».\n" #: src/console_fe.c:1103 #, c-format msgid "%s: %s completed successfully.\n" msgstr "%s: %singa var vellykka.\n" #: src/console_fe.c:1109 #, c-format msgid "%s: %s unsupported for %s.\n" msgstr "%s: %s ikkje støtta for %s.\n" #: src/console_fe.c:1114 #, c-format msgid "%s: Errors occurred while %s the %s site.\n" msgstr "%s: Det oppsto feil ved %s av den %se nettstaden.\n" #: src/console_fe.c:1119 #, c-format msgid "%s: Error: Could not resolve remote hostname (%s).\n" msgstr "%s: Feil: Fann ikkje adressa til nettverksvert (%s).\n" #: src/console_fe.c:1125 #, c-format msgid "%s: Error: Could not resolve hostname of proxy server (%s).\n" msgstr "%s: Feil: Fann ikkje adressa til mellomtenar (%s).\n" #: src/console_fe.c:1131 #, c-format msgid "%s: Error: Could not connect to proxy server (%s port %d).\n" msgstr "%s: Feil: Klarte ikkje kopla til mellomtenar (%s port %d).\n" #: src/console_fe.c:1134 #, c-format msgid "%s: Error: Could not connect to server (%s port %d).\n" msgstr "%s: Feil: Klarte ikkje kopla til tenar (%s port %d).\n" #: src/console_fe.c:1140 #, c-format msgid "%s: Error: Could not authorise user on server.\n" msgstr "%s: Feil: Klarte ikkje autentisera brukar på tenar.\n" #: src/console_fe.c:1145 #, c-format msgid "%s: Error: %s\n" msgstr "%s: Feil: %s\n" #: src/console_fe.c:1149 #, c-format msgid "%s: Error: Could not authorise user on proxy server (%s).\n" msgstr "%s: Feil: Klarte ikkje autentisera brukar på mellomtenar (%s).\n" #: src/console_fe.c:1154 #, c-format msgid "" "%s: in issue_error\n" "%s" msgstr "" "%s: i issue_error\n" "%s" #: src/console_fe.c:1168 #, c-format msgid "%s: Error: Environment variable HOME not set.\n" msgstr "%s: Feil: Miljøvariabelen «HOME» er ikkje sett.\n" #: src/console_fe.c:1176 #, c-format msgid "%s: Error: Could not open rcfile: %s\n" msgstr "%s: Feil: Klate ikkje opna «rcfile»: %s\n" #: src/console_fe.c:1179 #, c-format msgid "%s: Error: rcfile permissions allow other users to read your rcfile.\n" msgstr "%s: Feil: «rcfile»-løyva gjer at andre kan lesa «rcfile»-fila di.\n" #: src/console_fe.c:1180 src/console_fe.c:1192 #, c-format msgid "%s: Set the permissions to 0600.\n" msgstr "%s: Set løyva til 0600.\n" #: src/console_fe.c:1183 #, c-format msgid "%s: Error: Could not open storage directory: %s\n" msgstr "%s: Feil: Klarte ikkje opna lagringskatalog: %s\n" #: src/console_fe.c:1184 #, c-format msgid "" "%s: You need to create this directory and set the permissions to 0700.\n" msgstr "%s: Du må oppretta denne katalogen og setja løyvet til 0700.\n" #: src/console_fe.c:1187 #, c-format msgid "%s: Error: storage directory permissions incorrect.\n" msgstr "%s: Feil: løyva sett for lagringskatalogen er feil.\n" #: src/console_fe.c:1188 #, c-format msgid "%s: Set the permissions to 0700.\n" msgstr "%s: Set løyva til 0700.\n" #: src/console_fe.c:1191 #, c-format msgid "%s: Error: ~/.netrc permissions incorrect.\n" msgstr "%s: Feil: feil løyve til ~/.netrc.\n" #: src/console_fe.c:1197 #, c-format msgid "" "%s: init_paths gave %d\n" "%s" msgstr "" "%s: init_paths gav %d\n" "%s" #: src/console_fe.c:1204 #, c-format msgid "%s: Error: Could not parse ~/.netrc.\n" msgstr "%s: Feil: Klarte ikkje tolka ~/.netrc.\n" #: src/console_fe.c:1222 src/console_fe.c:1321 #, c-format msgid "%s: Nothing to do - no changes found.\n" msgstr "%s: Fann ingen endringar.\n" #: src/console_fe.c:1231 #, c-format msgid "" "%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n" msgstr "" "%s: Feil: Klarte ikkje opna lagringsfil (%s)\n" "%s: Feil: %s\n" "%s: Klarte ikkje oppdatera nettstaden «%s».\n" #: src/console_fe.c:1255 #, c-format msgid "" "%s: Warning: Current state method differs from stored in site `%s'.\n" "%s: All existing files will appear changed (use catchup?).\n" msgstr "" "%s: Åtvaring: Statusmetoden valt er forskjellig frå den lagra for nettstaden " "«%s».\n" "%s: Alle filer vil visast som endra (bruk «gjer oppdatert»?).\n" #: src/console_fe.c:1261 #, c-format msgid "%s: The remote site needs updating (%d items to update).\n" msgstr "%s: Nettstaden må oppdaterast (%d element).\n" #: src/console_fe.c:1263 #, c-format msgid "%s: The remote site needs updating (1 item to update).\n" msgstr "%s: Nettstaden må oppdaterast (eitt element).\n" #: src/console_fe.c:1266 #, c-format msgid "%s: The remote site does not need updating.\n" msgstr "%s: Nettstaden treng ikkje oppdaterast.\n" #: src/console_fe.c:1274 #, c-format msgid "%s: All the files and directories are marked as NOT updated remotely.\n" msgstr "%s: Alle filer og katalogar er markerte som IKKJE oppdaterte.\n" #: src/console_fe.c:1279 #, c-format msgid "%s: All the files and and directories are marked as updated remotely.\n" msgstr "%s: Alle filer og katalogar er markerte som oppdaterte.\n" #: src/console_fe.c:1288 #, c-format msgid "" "%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n" msgstr "" "%s: Klarte ikkje henta fillista for å stadfesta nettstaden «%s»:\n" "%s: %s\n" #: src/console_fe.c:1302 #, c-format msgid "" "%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n" msgstr "" "%s: Klarte ikkje henta fillista for nettstaden «%s»:\n" "%s: %s\n" #: src/console_fe.c:1309 #, c-format msgid "%s: Verify found %d files missing from server.\n" msgstr "%s: Stadfesting fann %d filer som manglar frå tenaren.\n" #: src/console_fe.c:1312 #, c-format msgid "%s: Remote site not synchronized with stored state.\n" msgstr "%s: Fjerntliggande nettstad er ikkje synkronisert.\n" #: src/console_fe.c:1325 #, c-format msgid "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" msgstr "" "%s: Nektar å sletta alle filer med ein synkroniseringsoperasjon.\n" "%s: Bruk --update for å oppdatera nettstaden.\n" #: src/console_fe.c:1333 #, c-format msgid "" "%s: in act_on_site\n" "%s" msgstr "" "%s: i act_on_site\n" "%s" #: src/console_fe.c:1344 #, c-format msgid "Usage: %s [OPTIONS] [MODE] [sitename]...\n" msgstr "Bruk: %s [VAL] [MODUS] [nettstad] ...\n" # Alternativ? Flagg? #: src/console_fe.c:1346 #, c-format msgid "Options: \n" msgstr "Val: \n" #: src/console_fe.c:1349 #, fuzzy, c-format msgid "" " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" msgstr "" " -d, --debug=NØKKEL[,NØKKEL] Slå på avlusing for kvar NØKKEL, som kan " "vera:\n" " socket, files, rcfile, ftp, http, httpbody, xml, xmlparse, " "cleartext\n" " Åtvaring: cleartext viser (vanlegvis skjulte) passord som rein " "tekst\n" " -g, --logfile=FIL Legg til avlusingsmeldingar i FIL\n" " (elles blir «stderr» brukt)\n" #: src/console_fe.c:1356 #, fuzzy, c-format msgid "" " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites " "(default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote " "state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n" msgstr "" " -r, --rcfile=FIL Bruk alternativ kontrollfil\n" " -p, --storepath=STI Bruk alternativ lagringskatalog\n" " -y, --prompting Be om stadfesting før kvar oppdatering\n" " -a, --allsites Utfør valt operasjon på ALLE definerte nettstader\n" " -k, --keep-going Held fram med oppdatering sjølv ved feil\n" " -o, --show-progress Vis framgangsinformasjon\n" " -q, --quiet Vis berre filnamn ved oppdatering\n" " -qq, --silent Vis ingenting ved oppdatering\n" "Operasjonsmodus:\n" " -l, --list Vis endringar mellom lokal og fjern nettstad " "(standard)\n" " -ll, --flatlist Flat liste over endringar mellom lokal og fjern " "nettstad\n" " -v, --view Vis liste over nettstaddefinisjonar\n" " -i, --initialize Marker alle filer og katalogar som ikkje oppdaterte\n" " -f, --fetch Finn ut kva filer som finst på den fjerne nettstaden\n" " -e, --verify Stadfest at lagra statusinformasjon stemmer\n" " -c, --catchup Marker alle filer og katalogar som oppdaterte\n" " -s, --synchronize Oppdater den lokale nettstaden frå den fjerne " "nettstaden\n" " -u, --update Oppdater den fjerne nettstaden\n" " -h, --help Vis denne hjelpeteksten\n" " -V, --version Vis versjonsinformasjon\n" "Rapporter feil og send forslag til sitecopy@lyra.org\n" #: src/sitestore.c:326 #, c-format msgid "Invalid checksum at line %d" msgstr "" #: src/sitestore.c:371 #, c-format msgid "Boolean missing in 'ascii' at line %d" msgstr "" #: src/sitestore.c:396 #, c-format msgid "Size overflow (%s) in '%s' at line %d" msgstr "" #: src/davdriver.c:195 msgid "The connection timed out." msgstr "Sambandet vart tidsavbrote." #: src/davdriver.c:224 #, fuzzy msgid "Could not write SSL certificate" msgstr "Åtvaring: Klarte ikkje lagra sertifikat" #: src/davdriver.c:244 msgid "SSL support has not be compiled in." msgstr "SSL-støtte er ikkje kompilert inn." #: src/davdriver.c:252 #, fuzzy, c-format msgid "Could not load certificate `%s'." msgstr "Åtvaring: Klarte ikkje lagra sertifikat" #: src/davdriver.c:290 #, fuzzy, c-format msgid "Could not read SSL client certificate '%s'." msgstr "Åtvaring: Klarte ikkje lagra sertifikat" #: src/davdriver.c:303 #, fuzzy, c-format msgid "Could not decrypt SSL client certificate '%s'." msgstr "Åtvaring: Klarte ikkje lagra sertifikat" #: src/davdriver.c:325 msgid "The server does not appear to be a WebDAV server." msgstr "Tenaren er ikkje ein WebDAV-tenar." #: src/davdriver.c:330 msgid "The server does not support the executable live property." msgstr "Tenaren støttar ikkje kjørbar-eigenskapen." #: src/davdriver.c:376 src/davdriver.c:443 src/davdriver.c:480 src/ftp.c:888 #: src/ftp.c:972 msgid "Could not open file" msgstr "Klarte ikkje opna fil" #: src/davdriver.c:411 #, fuzzy, c-format msgid "Could not stat file: %s" msgstr "Klarte ikkje skriva til fil: %s" #: src/davdriver.c:670 msgid "Could not access resource" msgstr "Fekk ikkje tilgang til ressursen" #: src/sites.c:160 msgid "Could not set modification time of local file." msgstr "Klarte ikkje endra endringstida til lokal fil." #: src/sites.c:308 msgid "" "Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode." msgstr "" "Opplastinga var vellykka, men klarte ikkje henta endringstid.\n" "Slå av sikkermodus viss denne meldinga ikkje forsvinn." #: src/sites.c:515 msgid "Remote file has been modified - not overwriting with local changes" msgstr "" "Fjerntliggande fil har blitt endra, og blir ikkje overskriven av lokal fil" #: src/sites.c:828 msgid "Could not examine file." msgstr "Klarte ikkje gjennomlesa fila." #: src/sites.c:871 msgid "Could not checksum file" msgstr "Klarte ikkje laga sjekksum for fila" #: src/sites.c:887 msgid "The target of the symlink could not be read." msgstr "Klarte ikkje lesa målet til den symbolske lenkja." #: src/common.c:113 msgid "Unknown system error" msgstr "Ukjend systemfeil" #: src/ftp.c:153 #, c-format msgid "%s: connection was closed by server." msgstr "%s: tilkoplinga vart lukka av tenaren." #: src/ftp.c:157 #, c-format msgid "%s: connection timed out." msgstr "%s: sambandet vart tidsavbrote." #: src/ftp.c:195 #, fuzzy msgid "Could not read response line" msgstr "Klarte ikkje lesa svar" #: src/ftp.c:229 #, fuzzy msgid "Cannot parse MDTM response; wrong length." msgstr "Klarte ikkje tolka statuslinja i svaret." #: src/ftp.c:236 #, fuzzy msgid "Cannot parse MDTM response." msgstr "Klarte ikkje lesa «LIST»-svar." #: src/ftp.c:260 #, fuzzy msgid "Could not find address in PASV response" msgstr "Klarte ikkje lesa «LIST»-svar." #: src/ftp.c:267 #, fuzzy msgid "Could not parse PASV response" msgstr "Klarte ikkje lesa «LIST»-svar." #: src/ftp.c:276 msgid "Invalid IP address in PASV response" msgstr "" #: src/ftp.c:296 #, fuzzy msgid "Malformed EPSV response" msgstr "Klarte ikkje lesa «LIST»-svar." #: src/ftp.c:304 #, fuzzy msgid "Malformed port in EPSV response" msgstr "Klarte ikkje lesa «LIST»-svar." #: src/ftp.c:449 msgid "Error sending file" msgstr "Feil ved sending av fil" #: src/ftp.c:463 src/ftp.c:489 #, fuzzy msgid "Error reading file" msgstr "Feil ved sending av fil" #: src/ftp.c:480 #, fuzzy msgid "Could not send file" msgstr "Klarte ikkje opna fil" #: src/ftp.c:510 src/ftp.c:991 #, fuzzy msgid "Error writing to file" msgstr "Feil ved sending av fil" #: src/ftp.c:516 msgid "Receiving file" msgstr "" #: src/ftp.c:532 msgid "Could not connect passive data socket" msgstr "Klarte ikkje kopla til passiv datasokkel" #: src/ftp.c:647 msgid "Active open failed: could not determine address of control socket" msgstr "" #: src/ftp.c:659 #, fuzzy msgid "Active open failed: could not create socket" msgstr "Klarte ikkje forhandla SSL-økt" #: src/ftp.c:667 msgid "Active open failed: could not bind to address" msgstr "" #: src/ftp.c:677 msgid "Active open failed: could not determine address of data socket" msgstr "" #: src/ftp.c:684 #, fuzzy msgid "Could not determine bound port number for data socket" msgstr "Klarte ikkje kopla til passiv datasokkel" #: src/ftp.c:727 msgid "Active open failed: could not accept connection" msgstr "" #: src/ftp.c:800 msgid "Error closing data socket" msgstr "Feil ved lukking av datasokkel" #: src/ftp.c:894 msgid "Could not determine length of file" msgstr "Klarte ikkje fastesetja fillengd" #: src/ftp.c:905 #, fuzzy msgid "Could not rewind to beginning of file" msgstr "Klarte ikkje fastesetja fillengd" #: src/ftp.c:1152 msgid "Could not read 'LIST' response." msgstr "Klarte ikkje lesa «LIST»-svar." #: src/ftp.c:1161 #, fuzzy, c-format msgid "Parse error in LIST response: %s" msgstr "Klarte ikkje lesa «LIST»-svar." #: gnome/init.c:51 msgid "_New site..." msgstr "" #: gnome/init.c:51 gnome/init.c:171 msgid "Create a new site definition" msgstr "" #: gnome/init.c:54 msgid "_Open..." msgstr "" #: gnome/init.c:54 msgid "Open a new rc file. (EXPERIMENTAL)." msgstr "" #: gnome/init.c:57 msgid "_Save Sites" msgstr "" #: gnome/init.c:57 gnome/init.c:177 msgid "Save the current site definitions" msgstr "" #: gnome/init.c:60 msgid "Sav_e Sites As..." msgstr "" #: gnome/init.c:60 msgid "Save the current site definitions to a file." msgstr "" #: gnome/init.c:63 #, fuzzy msgid "_Delete this site" msgstr "Slett %s" #: gnome/init.c:63 msgid "Delete the selected site entry" msgstr "" #: gnome/init.c:69 #, fuzzy msgid "E_xit" msgstr "Avslutt" #: gnome/init.c:69 gnome/init.c:202 msgid "Exit the program" msgstr "" #: gnome/init.c:78 #, fuzzy msgid "_Initialise site" msgstr "Initier" #: gnome/init.c:78 msgid "All files will be uploaded if a site is initialised" msgstr "" #: gnome/init.c:81 #, fuzzy msgid "'_Catchup' site" msgstr "Gjer oppdatert" #: gnome/init.c:81 msgid "Records the site as already updated." msgstr "" #: gnome/init.c:84 msgid "_Fetch site listing" msgstr "" #: gnome/init.c:84 msgid "Figures out which files are new/changed from the actual remote site." msgstr "" #: gnome/init.c:88 #, fuzzy msgid "_Resynchronize site" msgstr "synkroniserer" #: gnome/init.c:88 msgid "Copies newer files from the remote site to the local drive." msgstr "" #: gnome/init.c:91 msgid "_Update site..." msgstr "" #: gnome/init.c:91 msgid "Apply the local site's changes to the remote site." msgstr "" #: gnome/init.c:94 msgid "Update _ALL sites" msgstr "" #: gnome/init.c:94 gnome/init.c:137 msgid "Performs the required operations on all site definitions. (TODO)." msgstr "" #: gnome/init.c:98 msgid "Rescan local directory" msgstr "" #: gnome/init.c:98 #, fuzzy msgid "Re-reads the local directory of the selected site." msgstr "%s: Lokal katalog ikkje valt for nettstaden «%s».\n" #: gnome/init.c:106 msgid "_Required updates" msgstr "" #: gnome/init.c:106 msgid "Displays a brief report of any required updates." msgstr "" #: gnome/init.c:109 msgid "Site web-r_eport" msgstr "" #: gnome/init.c:109 msgid "" "Generates a web page detailing the changes required on the selected site." msgstr "" #: gnome/init.c:112 msgid "Prin_t site info..." msgstr "" #: gnome/init.c:112 msgid "Print information about the selected site" msgstr "" #: gnome/init.c:119 msgid "_Backup files status" msgstr "" #: gnome/init.c:119 msgid "Save the 'state' of your local files, in case of accident." msgstr "" #: gnome/init.c:122 msgid "Restore files status..." msgstr "" #: gnome/init.c:122 gnome/init.c:129 msgid "If a backup has previously been made, it will be restored." msgstr "" #: gnome/init.c:126 msgid "_Backup site definitions" msgstr "" #: gnome/init.c:126 msgid "Backup your site definitions, in case you delete your sites." msgstr "" #: gnome/init.c:129 msgid "Restore site definitions..." msgstr "" #: gnome/init.c:137 msgid "Preferences..." msgstr "" #: gnome/init.c:146 msgid "_About XSitecopy" msgstr "" #: gnome/init.c:146 msgid "Information about XSitecopy" msgstr "" #: gnome/init.c:158 msgid "_File" msgstr "" # Alternativ? Flagg? #: gnome/init.c:159 #, fuzzy msgid "_Operations" msgstr "Val: \n" #: gnome/init.c:160 msgid "_Reports" msgstr "" #: gnome/init.c:161 msgid "_Settings" msgstr "" #: gnome/init.c:162 msgid "_Backup" msgstr "" #: gnome/init.c:163 #, fuzzy msgid "_Help" msgstr "Hjelp" #: gnome/init.c:171 msgid "New site" msgstr "" #: gnome/init.c:174 msgid "Open" msgstr "" #: gnome/init.c:174 msgid "Open a new site definitions file." msgstr "" #: gnome/init.c:177 msgid "Save" msgstr "" #: gnome/init.c:180 #, fuzzy msgid "Delete site" msgstr "Slett %s" #: gnome/init.c:180 msgid "Delete the selected site" msgstr "" #: gnome/init.c:185 #, fuzzy msgid "Initialise" msgstr "Initier" #: gnome/init.c:185 msgid "Initialise the site (mark all files as needing to be updated)." msgstr "" #: gnome/init.c:188 #, fuzzy msgid "Catch-up" msgstr "Gjer oppdatert" #: gnome/init.c:188 msgid "Mark all of the selected site's files as updated." msgstr "" #: gnome/init.c:194 #, fuzzy msgid "Download" msgstr "Lastar ned %s: [" #: gnome/init.c:194 msgid "Download newer files from the remote site. (Use with care)" msgstr "" #: gnome/init.c:198 msgid "Updates the selected site" msgstr "" #: gnome/init.c:202 msgid "Quit" msgstr "" #: gnome/init.c:412 #, fuzzy, c-format msgid "%s: Error: Could not read rcfile: %s.\n" msgstr "%s: Feil: Klarte ikkje opna «rcfile»-fila: %s.\n" #: gnome/main.c:184 msgid "" "Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" msgstr "" #: gnome/misc.c:580 #, fuzzy, c-format msgid "Server not specified in site `%s'.\n" msgstr "%s: Ingen tenar valt for nettstaden «%s».\n" #: gnome/misc.c:584 #, fuzzy, c-format msgid "Remote directory not specified in site `%s'.\n" msgstr "%s: Fjerntliggande katalog ikkje valt for nettstaden «%s».\n" #: gnome/misc.c:588 #, fuzzy, c-format msgid "Local directory not specified in site `%s'.\n" msgstr "%s: Lokal katalog ikkje valt for nettstaden «%s».\n" #: gnome/misc.c:592 #, fuzzy, c-format msgid "" "Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: Klarte ikkje lesa katalog for «%s»:\n" "\t%s\n" #: gnome/misc.c:596 #, fuzzy, c-format msgid "Invalid port used in site `%s'.\n" msgstr "%s: Ugyldig port brukt for nettstaden «%s».\n" #: gnome/misc.c:600 #, fuzzy, c-format msgid "Protocol '%s' cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s klarte ikkje oppretthelda symbolske lenkjer (nettstad: «%s»).\n" #: gnome/misc.c:604 #, fuzzy, c-format msgid "Cannot use a relative remote directory protocol '%s' (site `%s').\n" msgstr "" "%s: Klarte ikkje bruka ein relativ fjerntliggande katalog i %s (nettstad: «%" "s»).\n" #: gnome/misc.c:607 #, c-format msgid "%s's protocol does not currently support maintaining permissions." msgstr "" #: gnome/misc.c:611 #, fuzzy, c-format msgid "Could not find 'relative' local directory" msgstr "Klarte ikkje forhandla SSL-økt" #: lib/neon/ne_redirect.c:92 #, fuzzy msgid "Could not parse redirect destination URL" msgstr "Klarte ikkje tolka vidaresendingsadresse." #: lib/neon/ne_gnutls.c:162 #, c-format msgid "[unprintable:#%lu]" msgstr "" #: lib/neon/ne_gnutls.c:188 msgid "[unprintable]" msgstr "" #: lib/neon/ne_gnutls.c:696 lib/neon/ne_openssl.c:419 msgid "Server certificate was missing commonName attribute in subject name" msgstr "" #: lib/neon/ne_gnutls.c:736 lib/neon/ne_openssl.c:638 #, fuzzy, c-format msgid "SSL negotiation failed: %s" msgstr "Klarte ikkje skriva til fil: %s" #: lib/neon/ne_gnutls.c:745 msgid "Server did not send certificate chain" msgstr "" #: lib/neon/ne_openssl.c:451 #, c-format msgid "Certificate verification error: %s" msgstr "" #: lib/neon/ne_openssl.c:657 msgid "SSL server did not present certificate" msgstr "" #: lib/neon/ne_openssl.c:666 #, fuzzy msgid "Server certificate changed: connection intercepted?" msgstr "Tenarsertifikatet er utgått på dato." #: lib/neon/ne_session.c:356 lib/neon/ne_session.c:367 msgid "[invalid date]" msgstr "[ugyldig dato]" #: lib/neon/ne_session.c:380 #, fuzzy msgid "certificate is not yet valid" msgstr "Sertifikatet er gyldig" #: lib/neon/ne_session.c:381 #, fuzzy msgid "certificate has expired" msgstr "Tenarsertifikatet er utgått på dato." #: lib/neon/ne_session.c:382 #, fuzzy msgid "certificate issued for a different hostname" msgstr "Sertifikatet er utferda av:" #: lib/neon/ne_session.c:383 msgid "issuer is not trusted" msgstr "" #: lib/neon/ne_session.c:388 #, fuzzy msgid "Server certificate verification failed: " msgstr "Tenarsertifikatet er utgått på dato." #: lib/neon/ne_socket.c:514 lib/neon/ne_socket.c:568 lib/neon/ne_socket.c:671 #, fuzzy msgid "Connection closed" msgstr "Tilkoplinga vart lukka av tenaren" #: lib/neon/ne_socket.c:578 lib/neon/ne_socket.c:683 #, fuzzy msgid "Secure connection truncated" msgstr "Sambandet vart tidsavbrote." #: lib/neon/ne_socket.c:590 lib/neon/ne_socket.c:695 #, fuzzy, c-format msgid "SSL error: %s" msgstr "%s: Feil: %s\n" #: lib/neon/ne_socket.c:593 #, c-format msgid "SSL error code %d/%d/%lu" msgstr "" #: lib/neon/ne_socket.c:676 #, fuzzy, c-format msgid "SSL alert received: %s" msgstr "%s: Feil: %s\n" #: lib/neon/ne_socket.c:691 msgid "SSL socket read failed" msgstr "" #: lib/neon/ne_socket.c:790 msgid "Line too long" msgstr "For lang linje" #: lib/neon/ne_socket.c:935 lib/neon/ne_socket.c:941 msgid "Host not found" msgstr "Fann ikkje vert" #: lib/neon/ne_socket.c:1048 #, fuzzy msgid "Connection timed out" msgstr "Sambandet vart tidsavbrote." #: lib/neon/ne_socket.c:1210 msgid "Socket descriptor number exceeds FD_SETSIZE" msgstr "" #: lib/neon/ne_socket.c:1270 msgid "Socket family not supported" msgstr "" #: lib/neon/ne_socket.c:1493 #, fuzzy msgid "Client certificate verification failed" msgstr "Tenarsertifikatet er utgått på dato." #: lib/neon/ne_socket.c:1509 #, fuzzy msgid "SSL disabled due to lack of entropy" msgstr "SSL avslått grunna mangel på entropi" #: lib/neon/ne_socket.c:1516 #, fuzzy msgid "SSL disabled due to library version mismatch" msgstr "SSL avslått grunna mangel på entropi" #: lib/neon/ne_socket.c:1522 #, fuzzy msgid "Could not create SSL structure" msgstr "Klarte ikkje forhandla SSL-økt" #: lib/neon/ne_request.c:194 #, fuzzy, c-format msgid "%s: connection was closed by proxy server" msgstr "%s: tilkoplinga vart lukka av mellomtenaren." #: lib/neon/ne_request.c:197 #, fuzzy, c-format msgid "%s: connection was closed by server" msgstr "%s: tilkoplinga vart lukka av tenaren." #: lib/neon/ne_request.c:202 #, fuzzy, c-format msgid "%s: connection timed out" msgstr "%s: sambandet vart tidsavbrote." #: lib/neon/ne_request.c:307 msgid "offset invalid" msgstr "" #: lib/neon/ne_request.c:312 #, fuzzy, c-format msgid "Could not seek to offset %s of request body file: %s" msgstr "Klarte ikkje skriva til fil: %s" #: lib/neon/ne_request.c:360 msgid "Could not send request body" msgstr "Klarte ikkje senda førespurnad" #: lib/neon/ne_request.c:699 msgid "Could not read chunk size" msgstr "Klarte ikkje lesa storleik på oppdelt svar" #: lib/neon/ne_request.c:706 msgid "Could not parse chunk size" msgstr "Klarte ikkje tolka storleik på oppdelt svar" #: lib/neon/ne_request.c:743 msgid "Could not read response body" msgstr "Klarte ikkje lesa svar" #: lib/neon/ne_request.c:759 #, fuzzy msgid "Could not read chunk delimiter" msgstr "Klarte ikkje lesa storleik på oppdelt svar" #: lib/neon/ne_request.c:762 msgid "Chunk delimiter was invalid" msgstr "" #: lib/neon/ne_request.c:868 msgid "Could not read status line" msgstr "Klarte ikkje lesa statuslinja" #: lib/neon/ne_request.c:890 #, fuzzy msgid "Could not parse response status line" msgstr "Klarte ikkje tolka statuslinja i svaret." #: lib/neon/ne_request.c:902 #, fuzzy msgid "Could not read interim response headers" msgstr "Klarte ikkje lesa svarlinje" #: lib/neon/ne_request.c:936 msgid "Could not send request" msgstr "Klarte ikkje senda førespurnad" #: lib/neon/ne_request.c:984 lib/neon/ne_request.c:1002 #: lib/neon/ne_request.c:1012 msgid "Error reading response headers" msgstr "Feil ved lesing av svarhovud" #: lib/neon/ne_request.c:1030 msgid "Response header too long" msgstr "For langt svarhovud" #: lib/neon/ne_request.c:1112 #, fuzzy msgid "Response exceeded maximum number of header fields" msgstr "Svaret inneheld for mange header-felt." #: lib/neon/ne_request.c:1129 #, fuzzy, c-format msgid "Could not resolve hostname `%s': %s" msgstr "%s: Feil: Fann ikkje adressa til nettverksvert (%s).\n" #: lib/neon/ne_request.c:1260 msgid "Unknown transfer-coding in response" msgstr "" #: lib/neon/ne_request.c:1271 msgid "Invalid Content-Length in response" msgstr "" #: lib/neon/ne_request.c:1344 #, c-format msgid "Could not write to file: %s" msgstr "Klarte ikkje skriva til fil: %s" #: lib/neon/ne_request.c:1417 #, fuzzy, c-format msgid "Could not create SSL connection through proxy server: %s" msgstr "Klarte ikkje oppretta SSL-tilkopling til mellomtenar" #: lib/neon/ne_request.c:1464 #, fuzzy msgid "Could not create socket" msgstr "Klarte ikkje forhandla SSL-økt" #: lib/neon/ne_request.c:1526 msgid "Could not connect to proxy server" msgstr "Klarte ikkje kopla til mellomtenar" #: lib/neon/ne_request.c:1527 msgid "Could not connect to server" msgstr "Klarte ikkje kopla til tenaren." #: lib/neon/ne_xml.c:280 #, fuzzy, c-format msgid "XML parse error at line %d: invalid element name" msgstr "XML-tolkingsfeil på linje %d: %s." #: lib/neon/ne_xml.c:452 #, fuzzy msgid "Unknown error" msgstr "Ukjend systemfeil" #: lib/neon/ne_xml.c:537 msgid "Invalid Byte Order Mark" msgstr "" #: lib/neon/ne_xml.c:625 #, fuzzy, c-format msgid "XML parse error at line %d: %s" msgstr "XML-tolkingsfeil på linje %d: %s." #: lib/neon/ne_props.c:371 lib/neon/ne_props.c:435 #, fuzzy msgid "Response exceeds maximum property count" msgstr "Svaret inneheld for mange header-felt." #: lib/neon/ne_compress.c:184 #, c-format msgid "%s: %s (code %d)" msgstr "" #: lib/neon/ne_compress.c:232 #, fuzzy msgid "Could not inflate data" msgstr "Klarte ikkje opna fil: " #: lib/neon/ne_compress.c:293 #, fuzzy msgid "Could not initialize zlib" msgstr "Klarte ikkje opna fil: " #: lib/neon/ne_xmlreq.c:36 #, fuzzy, c-format msgid "Could not parse response: %s" msgstr "Klarte ikkje lesa «LIST»-svar." #: lib/neon/ne_basic.c:98 #, fuzzy, c-format msgid "Could not determine file size: %s" msgstr "Fann ikkje fillengda: %s" #: lib/neon/ne_basic.c:149 msgid "Response did not include requested range" msgstr "" #: lib/neon/ne_basic.c:183 #, fuzzy msgid "Range is not satisfiable" msgstr "Området finst ikkje." #: lib/neon/ne_basic.c:188 #, fuzzy msgid "Resource does not support ranged GET requests" msgstr "Tenaren kan ikkje handtera kommandoar for delvis GET." #: lib/neon/ne_auth.c:130 #, fuzzy, c-format msgid "Could not authenticate to server: %s" msgstr "Klarte ikkje kopla til tenaren." #: lib/neon/ne_auth.c:135 #, fuzzy, c-format msgid "Could not authenticate to proxy server: %s" msgstr "Klarte ikkje kopla til mellomtenar" #: lib/neon/ne_auth.c:358 #, c-format msgid "rejected %s challenge" msgstr "" #: lib/neon/ne_auth.c:374 msgid "missing realm in Basic challenge" msgstr "" #: lib/neon/ne_auth.c:469 msgid "invalid Negotiate token" msgstr "" #: lib/neon/ne_auth.c:492 #, fuzzy msgid "GSSAPI authentication error: " msgstr "Krev autentisering på %s «%s»:\n" #: lib/neon/ne_auth.c:505 #, c-format msgid "GSSAPI failure (code %u)" msgstr "" #: lib/neon/ne_auth.c:540 msgid "ignoring empty Negotiate continuation" msgstr "" #: lib/neon/ne_auth.c:555 msgid "Negotiate response verification failed: invalid response header token" msgstr "" #: lib/neon/ne_auth.c:577 #, fuzzy, c-format msgid "Negotiate response verification failure: %s" msgstr "Tenarsertifikatet er utgått på dato." #: lib/neon/ne_auth.c:697 msgid "unknown algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:701 msgid "incompatible algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:705 msgid "missing parameter in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:709 msgid "initial Digest challenge was stale" msgstr "" #: lib/neon/ne_auth.c:716 msgid "stale Digest challenge with new algorithm or realm" msgstr "" #: lib/neon/ne_auth.c:728 #, fuzzy msgid "could not parse domain in Digest challenge" msgstr "Klarte ikkje tolka statuslinja i svaret." #: lib/neon/ne_auth.c:1036 msgid "Digest mutual authentication failure: missing parameters" msgstr "" #: lib/neon/ne_auth.c:1041 msgid "Digest mutual authentication failure: client nonce mismatch" msgstr "" #: lib/neon/ne_auth.c:1051 msgid "Digest mutual authentication failure: could not parse nonce count" msgstr "" #: lib/neon/ne_auth.c:1056 #, c-format msgid "Digest mutual authentication failure: nonce count mismatch (%u not %u)" msgstr "" #: lib/neon/ne_auth.c:1099 msgid "Digest mutual authentication failure: request-digest mismatch" msgstr "" #: lib/neon/ne_auth.c:1225 #, c-format msgid "ignored %s challenge" msgstr "" #: lib/neon/ne_auth.c:1304 #, fuzzy msgid "could not parse challenge" msgstr "Klarte ikkje tolka storleik på oppdelt svar" #: lib/neon/ne_207.c:198 #, c-format msgid "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" msgstr "" "Ugyldig HTTP-statuslinje i statuselement på linje %d av svaret:\n" "Statuslinja var: %s" #: lib/neon/ne_locks.c:584 msgid "LOCK response missing Lock-Token header" msgstr "" #: lib/neon/ne_locks.c:759 #, c-format msgid "Response missing activelock for %s" msgstr "" #: lib/neon/ne_locks.c:801 #, c-format msgid "No activelock for <%s> returned in LOCK refresh response" msgstr "" #: lib/rpmatch.c:79 msgid "^[yY]" msgstr "^[jJ]" #: lib/rpmatch.c:82 msgid "^[nN]" msgstr "^[nN]" #: lib/getopt.c:664 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: valet «%s» er tvetydig\n" #: lib/getopt.c:688 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: valet «--%s» kan ikkje innehelda argument\n" #: lib/getopt.c:693 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: valet «%c%s» kan ikkje innehelda argument\n" #: lib/getopt.c:710 lib/getopt.c:883 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: valet «%s» krev eit argument\n" #: lib/getopt.c:739 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: valet «--%s» er ukjent\n" #: lib/getopt.c:743 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: valet «%c%s» er ukjent\n" #: lib/getopt.c:769 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: valet -- %c er ulovleg\n" #: lib/getopt.c:772 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: valet -- %c er ugyldig\n" # 1003.2 specifies the format of this message. #: lib/getopt.c:802 lib/getopt.c:932 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: valet krev eit argument -- %c\n" #: lib/getopt.c:849 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: valet «-W %s» er tvetydig\n" #: lib/getopt.c:867 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: valet «-W %s» kan ikkje innehelda argument\n" #~ msgid " bytes)" #~ msgstr " byte)" #~ msgid "%s\n" #~ msgstr "%s\n" #, fuzzy #~ msgid "%s: %s" #~ msgstr "%s: %s\n" #~ msgid "%s: Aborted.\n" #~ msgstr "%s: Avbrote.\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal: %s (%d)\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: Fanga opp signal: %s (%d)\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal %d\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: Fanga opp signal %d\n" #~ msgid "%s: Cannot recover from segmentation fault, aborting.\n" #~ msgstr "%s: Klarer ikkje å overleva segmenteringsfeil. Avsluttar.\n" #~ msgid "%s: Aborting update...\n" #~ msgstr "%s: Avbryt oppdatering ...\n" #~ msgid "%s: Terminating.\n" #~ msgstr "%s: Avsluttar.\n" #, fuzzy #~ msgid " of request body file: %s" #~ msgstr "Klarte ikkje skriva til fil: %s" #~ msgid "Server was not authenticated correctly." #~ msgstr "Tenaren vart ikkje rett autentisert." #~ msgid "Proxy server was not authenticated correctly." #~ msgstr "Mellomtenaren vart ikkje rett autentisert." #~ msgid "Error reading request body." #~ msgstr "Klarte ikkje lesa svartekst" #, fuzzy #~ msgid "unknown error code" #~ msgstr "%s: ukjend feil." #~ msgid "Error reading chunked response body" #~ msgstr "Feil ved lesing av oppdelt svar" #~ msgid "document root" #~ msgstr "dokumentrot" #~ msgid "unknown element" #~ msgstr "ukjent element" #~ msgid "unspecified" #~ msgstr "ikkje spesifisert" #~ msgid "XML is not valid (%s found in parent %s)" #~ msgstr "Ugyldig XML (%s vart funnen i forelder %s)" #~ msgid "Unknown XML element `%s (in %s)'" #~ msgstr "Ukjent XML-element «%s (i %s)»" #~ msgid "" #~ "The server did not authenticate itself correctly.\n" #~ "Report this error to your server administrator." #~ msgstr "" #~ "Tenaren autentiserte ikkje seg sjølv korrekt.\n" #~ "Rapporter dette til tenaransvarleg." #~ msgid "" #~ "The proxy server did not authenticate itself correctly.\n" #~ "Report this error to your proxy server administrator." #~ msgstr "" #~ "Mellomtenaren autentiserte ikkje seg sjølv korrekt.\n" #~ "Rapporter dette til tenaransvarleg." #~ msgid "Could not create active data socket (getsockname failed)" #~ msgstr "Klarte ikkje oppretta aktiv datasokkel (feil ved «getsockname»)" #~ msgid "Could create active data socket (socket failed)" #~ msgstr "Klarte oppretta aktiv datasokkel (feil ved «socket»)" #~ msgid "Could not create active data socket (bind failed)" #~ msgstr "Klarte ikkje oppretta aktiv datasokkel (feil ved «bind»)" #~ msgid "Could not create active data socket (accept failed)" #~ msgstr "Klarte ikkje oppretta aktiv datasokkel (feil ved «accept»)" #~ msgid "Error while downloading file" #~ msgstr "Feil ved nedlasting av fil" #~ msgid "Redirected to a different server.\n" #~ msgstr "Vidaresendt til ein annan tenar.\n" #~ msgid "%s: socket error." #~ msgstr "%s: sokkelfeil." #~ msgid "Timed out waiting for 100 Continue" #~ msgstr "Tidsavbrot ved venting på 100 Continue" #~ msgid "Error waiting for response" #~ msgstr "Feil ved venting på svar" #~ msgid "Malformed header line." #~ msgstr "Misforma linje i svarhovud." #~ msgid "Host not found (try again later?)" #~ msgstr "Fann ikkje vert (prøv igjen seinare?)" #~ msgid "Host exists but has no address." #~ msgstr "Verten finst, men har inga adresse." #~ msgid "Non-recoverable error in resolver library." #~ msgstr "Uoppretteleg feil i biblioteket for namneoppslag." #~ msgid "This application does not have SSL support." #~ msgstr "Dette programmet støttar ikkje SSL." #~ msgid "Filling entropy pool" #~ msgstr "Fyller entropisamling" #~ msgid "Failed to find enough entropy on your system" #~ msgstr "Fann ikkje nok entropi på systemet" #~ msgid "Unable to get certificate from peer" #~ msgstr "Klarte ikkje henta sertifikat frå tenar" #~ msgid "SSL connection using %s" #~ msgstr "SSL-samband med %s" #~ msgid "Unknown" #~ msgstr "Ukjend" #~ msgid "[unable to calculate]" #~ msgstr "[klarte ikkje rekna ut]" #~ msgid "This certificate belongs to:" #~ msgstr "Sertifikatet tilhører:" #~ msgid " from %s" #~ msgstr " frå %s" #~ msgid " to %s" #~ msgstr " til %s" #~ msgid "SSL Certificate check" #~ msgstr "SSL-sertifikatkontroll" #~ msgid "(r)eject, accept (o)nce, (a)ccept always" #~ msgstr "(a)vvis, godta (e)in gong, (g)odta alltid" #~ msgid "roa" #~ msgstr "reg" #~ msgid "(r)eject, accept (o)nce" #~ msgstr "(a)vvis, godta (e)in gong" #~ msgid "ro" #~ msgstr "ae" #~ msgid "Certificate saved" #~ msgstr "Sertifikatet er lagra" sitecopy-0.16.6/po/remove-potcdate.sed0000664000076400007640000000007211037462356016010 0ustar joejoe/^"POT-Creation-Date: .*"$/{ x s/P/P/ ta g d bb :a x :b } sitecopy-0.16.6/po/sitecopy.pot0000664000076400007640000010612211037413774014603 0ustar joejoe# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Joe Orton # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: @PACKAGE@ @VERSION@\n" "Report-Msgid-Bugs-To: sitecopy@lyra.org\n" "POT-Creation-Date: 2008-07-16 16:31+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/console_fe.c:119 msgid "Show changes to" msgstr "" #: src/console_fe.c:119 msgid "showing changes to" msgstr "" #: src/console_fe.c:119 src/console_fe.c:120 msgid "local" msgstr "" #: src/console_fe.c:120 msgid "Synchronize" msgstr "" #: src/console_fe.c:120 msgid "synchronizing" msgstr "" #: src/console_fe.c:125 msgid "Fetch" msgstr "" #: src/console_fe.c:125 msgid "fetching" msgstr "" #: src/console_fe.c:125 src/console_fe.c:126 src/console_fe.c:127 msgid "remote" msgstr "" #: src/console_fe.c:126 gnome/init.c:198 msgid "Update" msgstr "" #: src/console_fe.c:126 msgid "updating" msgstr "" #: src/console_fe.c:127 msgid "Verify" msgstr "" #: src/console_fe.c:127 msgid "verifying" msgstr "" #: src/console_fe.c:128 msgid "Catch up" msgstr "" #: src/console_fe.c:128 msgid "catching up" msgstr "" #: src/console_fe.c:128 src/console_fe.c:129 msgid "stored" msgstr "" #: src/console_fe.c:129 msgid "Initialize" msgstr "" #: src/console_fe.c:129 msgid "initializing" msgstr "" #: src/console_fe.c:134 msgid "" "You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n" msgstr "" #: src/console_fe.c:196 #, c-format msgid "%s: Error: No site called `%s' found - skipping.\n" msgstr "" #: src/console_fe.c:214 #, c-format msgid "%s: No valid sites specified.\n" msgstr "" #: src/console_fe.c:216 #, c-format msgid "%s: No sites specified.\n" msgstr "" #: src/console_fe.c:218 src/console_fe.c:369 src/console_fe.c:529 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "" #: src/console_fe.c:228 #, c-format msgid "%s: %c%s site `%s' (on %s in %s)\n" msgstr "" #: src/console_fe.c:249 #, c-format msgid "* These items have been added since the last update:\n" msgstr "" #: src/console_fe.c:254 src/console_fe.c:285 #, c-format msgid "dir:" msgstr "" #: src/console_fe.c:261 #, c-format msgid "* These items have been changed since the last update:\n" msgstr "" #: src/console_fe.c:263 #, c-format msgid " Changes to items in [brackets] are ignored during updates.\n" msgstr "" #: src/console_fe.c:277 #, c-format msgid "* These items have been deleted, but will be left on the server:\n" msgstr "" #: src/console_fe.c:279 #, c-format msgid "* These items have been deleted since the last update:\n" msgstr "" #: src/console_fe.c:292 #, c-format msgid "* These items have been moved since the last update:\n" msgstr "" #: src/console_fe.c:310 src/console_fe.c:322 msgid "Ignored" msgstr "" #: src/console_fe.c:312 msgid "Maintained for executables" msgstr "" #: src/console_fe.c:314 msgid "Always maintained" msgstr "" #: src/console_fe.c:324 msgid "Maintained" msgstr "" #: src/console_fe.c:326 msgid "Followed" msgstr "" #: src/console_fe.c:337 #, c-format msgid "" "Site: %s\n" "\tServer: %s" msgstr "" #: src/console_fe.c:339 #, c-format msgid " Port: " msgstr "" #: src/console_fe.c:341 #, c-format msgid "(default)\n" msgstr "" #: src/console_fe.c:343 #, c-format msgid "%d\n" msgstr "" #: src/console_fe.c:345 #, c-format msgid "\tProtocol: %s Username: %s\n" msgstr "" #: src/console_fe.c:348 msgid "(unspecified)" msgstr "" #: src/console_fe.c:350 #, c-format msgid "\tPassive mode FTP will not be used.\n" msgstr "" #: src/console_fe.c:351 #, c-format msgid "" "\tRemote directory: %s\n" "\tLocal directory: %s\n" msgstr "" #: src/console_fe.c:353 #, c-format msgid "\tPermissions: %s Symlinks: %s\n" msgstr "" #: src/console_fe.c:356 #, c-format msgid "\tRemote files will not be deleted.\n" msgstr "" #: src/console_fe.c:358 #, c-format msgid "\tFiles will be moved remotely if moved locally.\n" msgstr "" #: src/console_fe.c:367 #, c-format msgid "%s: Error: Only specify ONE operation mode at a time.\n" msgstr "" #: src/console_fe.c:489 #, c-format msgid "%s: Error: Debug channel %s not known.\n" msgstr "" #: src/console_fe.c:497 #, c-format msgid "%s: Warning: Could not open `%s' to use as logfile.\n" msgstr "" #: src/console_fe.c:540 #, c-format msgid "%s: Error: Dry run mode is currently only supported for updates.\n" msgstr "" #: src/console_fe.c:556 #, c-format msgid "" "%s: Warning: Only %d sites can be specified on the command line!\n" "Extra entries are being skipped.\n" msgstr "" #: src/console_fe.c:581 msgid "WARNING: Server certificate is not trusted." msgstr "" #: src/console_fe.c:584 #, c-format msgid "Certificate was issued for server `%s'.\n" msgstr "" #: src/console_fe.c:586 msgid "WARNING: Certificate does not specify a server" msgstr "" #: src/console_fe.c:588 #, c-format msgid "Fingerprint: %s\n" msgstr "" #: src/console_fe.c:591 #, c-format msgid "Issued to: %s\n" msgstr "" #: src/console_fe.c:595 #, c-format msgid "Issued by: %s\n" msgstr "" #: src/console_fe.c:598 #, c-format msgid "Do you wish to accept this certificate? (y/n) " msgstr "" #: src/console_fe.c:607 msgid "server" msgstr "" #: src/console_fe.c:607 msgid "proxy server" msgstr "" #: src/console_fe.c:613 #, c-format msgid "Authentication required for %s on %s `%s':\n" msgstr "" #: src/console_fe.c:616 #, c-format msgid "Authentication required on %s `%s':\n" msgstr "" #: src/console_fe.c:619 msgid "Username: " msgstr "" #: src/console_fe.c:624 #, c-format msgid "Username: %s\n" msgstr "" #: src/console_fe.c:626 src/console_fe.c:650 msgid "Password: " msgstr "" #: src/console_fe.c:636 #, c-format msgid "Retrying: [" msgstr "" #: src/console_fe.c:647 #, c-format msgid "%s: Encrypted client certificate configured%s%s.\n" msgstr "" #: src/console_fe.c:682 #, c-format msgid "Create %s/" msgstr "" #: src/console_fe.c:684 #, c-format msgid "Delete %s/" msgstr "" #: src/console_fe.c:692 #, c-format msgid "Upload %s (%s bytes)" msgstr "" #: src/console_fe.c:694 #, c-format msgid "Delete %s" msgstr "" #: src/console_fe.c:695 #, c-format msgid "Move %s->%s" msgstr "" #: src/console_fe.c:699 #, c-format msgid "" "%s: in fe_can_update/file_file\n" "%s" msgstr "" #: src/console_fe.c:706 #, c-format msgid "Change %s" msgstr "" #: src/console_fe.c:707 #, c-format msgid "Create %s" msgstr "" #: src/console_fe.c:708 #, c-format msgid "Remove %s" msgstr "" #: src/console_fe.c:711 #, c-format msgid "" "%s: in fe_can_update/file_link\n" "%s" msgstr "" #: src/console_fe.c:717 #, c-format msgid "? (y/n) " msgstr "" #: src/console_fe.c:726 #, c-format msgid "Checksumming %s: [" msgstr "" #: src/console_fe.c:741 src/console_fe.c:852 src/console_fe.c:913 #, c-format msgid "] done.\n" msgstr "" #: src/console_fe.c:743 src/console_fe.c:915 #, c-format msgid "" "] failed:\n" "%s\n" msgstr "" #: src/console_fe.c:753 #, c-format msgid "Setting permissions on %s%s: " msgstr "" #: src/console_fe.c:763 src/console_fe.c:841 src/console_fe.c:907 #, c-format msgid "done.\n" msgstr "" #: src/console_fe.c:765 src/console_fe.c:909 #, c-format msgid "" "failed:\n" "%s\n" msgstr "" #: src/console_fe.c:784 src/console_fe.c:871 #, c-format msgid "Creating %s/: " msgstr "" #: src/console_fe.c:786 src/console_fe.c:873 #, c-format msgid "Deleting %s/: " msgstr "" #: src/console_fe.c:793 #, c-format msgid "Uploading %s: [" msgstr "" #: src/console_fe.c:796 src/console_fe.c:815 src/console_fe.c:883 #, c-format msgid "Deleting %s: " msgstr "" #: src/console_fe.c:799 src/console_fe.c:886 #, c-format msgid "Moving %s->%s: " msgstr "" #: src/console_fe.c:803 #, c-format msgid "" "%s: in fe_updating/file_file\n" "%s" msgstr "" #: src/console_fe.c:811 #, c-format msgid "Changing %s: " msgstr "" #: src/console_fe.c:813 #, c-format msgid "Creating %s: " msgstr "" #: src/console_fe.c:817 #, c-format msgid "" "%s: in fe_updating/file_link\n" "%s" msgstr "" #: src/console_fe.c:834 #, c-format msgid "Failed to update %s:%c%s\n" msgstr "" #: src/console_fe.c:843 #, c-format msgid "failed:%c%s\n" msgstr "" #: src/console_fe.c:855 #, c-format msgid "] failed:%c%s\n" msgstr "" #: src/console_fe.c:880 #, c-format msgid "Downloading %s: [" msgstr "" #: src/console_fe.c:925 msgid "Changed on server" msgstr "" #: src/console_fe.c:928 msgid "Added on server" msgstr "" #: src/console_fe.c:936 #, c-format msgid "%s: %s\n" msgstr "" #: src/console_fe.c:956 #, c-format msgid "Directory: %s/\n" msgstr "" #: src/console_fe.c:961 #, c-format msgid "File: %s - size %s%s\n" msgstr "" #: src/console_fe.c:963 msgid " (ASCII)" msgstr "" #: src/console_fe.c:966 #, c-format msgid "Link: %s - target %s\n" msgstr "" #: src/console_fe.c:979 gnome/init.c:402 #, c-format msgid "%s: Error: Could not open rcfile: %s.\n" msgstr "" #: src/console_fe.c:983 gnome/init.c:407 #, c-format msgid "" "%s: rcfile corrupt at line %d:\n" "%s\n" msgstr "" #: src/console_fe.c:1002 #, c-format msgid "" "%s: Could not read directory for `%s':\n" "\t%s\n" msgstr "" #: src/console_fe.c:1006 #, c-format msgid "%s: Server not specified in site `%s'.\n" msgstr "" #: src/console_fe.c:1010 #, c-format msgid "%s: Remote directory not specified in site `%s'.\n" msgstr "" #: src/console_fe.c:1014 #, c-format msgid "%s: Local directory not specified in site `%s'.\n" msgstr "" #: src/console_fe.c:1018 #, c-format msgid "%s: Invalid port used in site `%s'.\n" msgstr "" #: src/console_fe.c:1022 #, c-format msgid "%s: %s cannot maintain symbolic links (site `%s').\n" msgstr "" #: src/console_fe.c:1026 #, c-format msgid "%s: Cannot use a relative remote directory in %s (site `%s').\n" msgstr "" #: src/console_fe.c:1029 #, c-format msgid "%s: File permissions are not supported in %s (site `%s').\n" msgstr "" #: src/console_fe.c:1032 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n" msgstr "" #: src/console_fe.c:1035 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n" msgstr "" #: src/console_fe.c:1038 #, c-format msgid "%s: Can only check for renamed files when checksumming (site `%s').\n" msgstr "" #: src/console_fe.c:1041 #, c-format msgid "%s: The protocol `%s' is unsupported (site `%s').\n" msgstr "" #: src/console_fe.c:1048 #, c-format msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" msgstr "" #: src/console_fe.c:1066 #, c-format msgid "" "%s: Error: Corrupt site storage file for `%s':\n" "%s: %s\n" msgstr "" #: src/console_fe.c:1075 #, c-format msgid "" "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n" msgstr "" #: src/console_fe.c:1088 #, c-format msgid "%s: Skipping site `%s'.\n" msgstr "" #: src/console_fe.c:1103 #, c-format msgid "%s: %s completed successfully.\n" msgstr "" #: src/console_fe.c:1109 #, c-format msgid "%s: %s unsupported for %s.\n" msgstr "" #: src/console_fe.c:1114 #, c-format msgid "%s: Errors occurred while %s the %s site.\n" msgstr "" #: src/console_fe.c:1119 #, c-format msgid "%s: Error: Could not resolve remote hostname (%s).\n" msgstr "" #: src/console_fe.c:1125 #, c-format msgid "%s: Error: Could not resolve hostname of proxy server (%s).\n" msgstr "" #: src/console_fe.c:1131 #, c-format msgid "%s: Error: Could not connect to proxy server (%s port %d).\n" msgstr "" #: src/console_fe.c:1134 #, c-format msgid "%s: Error: Could not connect to server (%s port %d).\n" msgstr "" #: src/console_fe.c:1140 #, c-format msgid "%s: Error: Could not authorise user on server.\n" msgstr "" #: src/console_fe.c:1145 #, c-format msgid "%s: Error: %s\n" msgstr "" #: src/console_fe.c:1149 #, c-format msgid "%s: Error: Could not authorise user on proxy server (%s).\n" msgstr "" #: src/console_fe.c:1154 #, c-format msgid "" "%s: in issue_error\n" "%s" msgstr "" #: src/console_fe.c:1168 #, c-format msgid "%s: Error: Environment variable HOME not set.\n" msgstr "" #: src/console_fe.c:1176 #, c-format msgid "%s: Error: Could not open rcfile: %s\n" msgstr "" #: src/console_fe.c:1179 #, c-format msgid "%s: Error: rcfile permissions allow other users to read your rcfile.\n" msgstr "" #: src/console_fe.c:1180 src/console_fe.c:1192 #, c-format msgid "%s: Set the permissions to 0600.\n" msgstr "" #: src/console_fe.c:1183 #, c-format msgid "%s: Error: Could not open storage directory: %s\n" msgstr "" #: src/console_fe.c:1184 #, c-format msgid "" "%s: You need to create this directory and set the permissions to 0700.\n" msgstr "" #: src/console_fe.c:1187 #, c-format msgid "%s: Error: storage directory permissions incorrect.\n" msgstr "" #: src/console_fe.c:1188 #, c-format msgid "%s: Set the permissions to 0700.\n" msgstr "" #: src/console_fe.c:1191 #, c-format msgid "%s: Error: ~/.netrc permissions incorrect.\n" msgstr "" #: src/console_fe.c:1197 #, c-format msgid "" "%s: init_paths gave %d\n" "%s" msgstr "" #: src/console_fe.c:1204 #, c-format msgid "%s: Error: Could not parse ~/.netrc.\n" msgstr "" #: src/console_fe.c:1222 src/console_fe.c:1321 #, c-format msgid "%s: Nothing to do - no changes found.\n" msgstr "" #: src/console_fe.c:1231 #, c-format msgid "" "%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n" msgstr "" #: src/console_fe.c:1255 #, c-format msgid "" "%s: Warning: Current state method differs from stored in site `%s'.\n" "%s: All existing files will appear changed (use catchup?).\n" msgstr "" #: src/console_fe.c:1261 #, c-format msgid "%s: The remote site needs updating (%d items to update).\n" msgstr "" #: src/console_fe.c:1263 #, c-format msgid "%s: The remote site needs updating (1 item to update).\n" msgstr "" #: src/console_fe.c:1266 #, c-format msgid "%s: The remote site does not need updating.\n" msgstr "" #: src/console_fe.c:1274 #, c-format msgid "%s: All the files and directories are marked as NOT updated remotely.\n" msgstr "" #: src/console_fe.c:1279 #, c-format msgid "%s: All the files and and directories are marked as updated remotely.\n" msgstr "" #: src/console_fe.c:1288 #, c-format msgid "" "%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n" msgstr "" #: src/console_fe.c:1302 #, c-format msgid "" "%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n" msgstr "" #: src/console_fe.c:1309 #, c-format msgid "%s: Verify found %d files missing from server.\n" msgstr "" #: src/console_fe.c:1312 #, c-format msgid "%s: Remote site not synchronized with stored state.\n" msgstr "" #: src/console_fe.c:1325 #, c-format msgid "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" msgstr "" #: src/console_fe.c:1333 #, c-format msgid "" "%s: in act_on_site\n" "%s" msgstr "" #: src/console_fe.c:1344 #, c-format msgid "Usage: %s [OPTIONS] [MODE] [sitename]...\n" msgstr "" #: src/console_fe.c:1346 #, c-format msgid "Options: \n" msgstr "" #: src/console_fe.c:1349 #, c-format msgid "" " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" msgstr "" #: src/console_fe.c:1356 #, c-format msgid "" " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites " "(default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote " "state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n" msgstr "" #: src/sitestore.c:326 #, c-format msgid "Invalid checksum at line %d" msgstr "" #: src/sitestore.c:371 #, c-format msgid "Boolean missing in 'ascii' at line %d" msgstr "" #: src/sitestore.c:396 #, c-format msgid "Size overflow (%s) in '%s' at line %d" msgstr "" #: src/davdriver.c:195 msgid "The connection timed out." msgstr "" #: src/davdriver.c:224 msgid "Could not write SSL certificate" msgstr "" #: src/davdriver.c:244 msgid "SSL support has not be compiled in." msgstr "" #: src/davdriver.c:252 #, c-format msgid "Could not load certificate `%s'." msgstr "" #: src/davdriver.c:290 #, c-format msgid "Could not read SSL client certificate '%s'." msgstr "" #: src/davdriver.c:303 #, c-format msgid "Could not decrypt SSL client certificate '%s'." msgstr "" #: src/davdriver.c:325 msgid "The server does not appear to be a WebDAV server." msgstr "" #: src/davdriver.c:330 msgid "The server does not support the executable live property." msgstr "" #: src/davdriver.c:376 src/davdriver.c:443 src/davdriver.c:480 src/ftp.c:888 #: src/ftp.c:972 msgid "Could not open file" msgstr "" #: src/davdriver.c:411 #, c-format msgid "Could not stat file: %s" msgstr "" #: src/davdriver.c:670 msgid "Could not access resource" msgstr "" #: src/sites.c:160 msgid "Could not set modification time of local file." msgstr "" #: src/sites.c:308 msgid "" "Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode." msgstr "" #: src/sites.c:515 msgid "Remote file has been modified - not overwriting with local changes" msgstr "" #: src/sites.c:828 msgid "Could not examine file." msgstr "" #: src/sites.c:871 msgid "Could not checksum file" msgstr "" #: src/sites.c:887 msgid "The target of the symlink could not be read." msgstr "" #: src/common.c:113 msgid "Unknown system error" msgstr "" #: src/ftp.c:153 #, c-format msgid "%s: connection was closed by server." msgstr "" #: src/ftp.c:157 #, c-format msgid "%s: connection timed out." msgstr "" #: src/ftp.c:195 msgid "Could not read response line" msgstr "" #: src/ftp.c:229 msgid "Cannot parse MDTM response; wrong length." msgstr "" #: src/ftp.c:236 msgid "Cannot parse MDTM response." msgstr "" #: src/ftp.c:260 msgid "Could not find address in PASV response" msgstr "" #: src/ftp.c:267 msgid "Could not parse PASV response" msgstr "" #: src/ftp.c:276 msgid "Invalid IP address in PASV response" msgstr "" #: src/ftp.c:296 msgid "Malformed EPSV response" msgstr "" #: src/ftp.c:304 msgid "Malformed port in EPSV response" msgstr "" #: src/ftp.c:449 msgid "Error sending file" msgstr "" #: src/ftp.c:463 src/ftp.c:489 msgid "Error reading file" msgstr "" #: src/ftp.c:480 msgid "Could not send file" msgstr "" #: src/ftp.c:510 src/ftp.c:991 msgid "Error writing to file" msgstr "" #: src/ftp.c:516 msgid "Receiving file" msgstr "" #: src/ftp.c:532 msgid "Could not connect passive data socket" msgstr "" #: src/ftp.c:647 msgid "Active open failed: could not determine address of control socket" msgstr "" #: src/ftp.c:659 msgid "Active open failed: could not create socket" msgstr "" #: src/ftp.c:667 msgid "Active open failed: could not bind to address" msgstr "" #: src/ftp.c:677 msgid "Active open failed: could not determine address of data socket" msgstr "" #: src/ftp.c:684 msgid "Could not determine bound port number for data socket" msgstr "" #: src/ftp.c:727 msgid "Active open failed: could not accept connection" msgstr "" #: src/ftp.c:800 msgid "Error closing data socket" msgstr "" #: src/ftp.c:894 msgid "Could not determine length of file" msgstr "" #: src/ftp.c:905 msgid "Could not rewind to beginning of file" msgstr "" #: src/ftp.c:1152 msgid "Could not read 'LIST' response." msgstr "" #: src/ftp.c:1161 #, c-format msgid "Parse error in LIST response: %s" msgstr "" #: gnome/init.c:51 msgid "_New site..." msgstr "" #: gnome/init.c:51 gnome/init.c:171 msgid "Create a new site definition" msgstr "" #: gnome/init.c:54 msgid "_Open..." msgstr "" #: gnome/init.c:54 msgid "Open a new rc file. (EXPERIMENTAL)." msgstr "" #: gnome/init.c:57 msgid "_Save Sites" msgstr "" #: gnome/init.c:57 gnome/init.c:177 msgid "Save the current site definitions" msgstr "" #: gnome/init.c:60 msgid "Sav_e Sites As..." msgstr "" #: gnome/init.c:60 msgid "Save the current site definitions to a file." msgstr "" #: gnome/init.c:63 msgid "_Delete this site" msgstr "" #: gnome/init.c:63 msgid "Delete the selected site entry" msgstr "" #: gnome/init.c:69 msgid "E_xit" msgstr "" #: gnome/init.c:69 gnome/init.c:202 msgid "Exit the program" msgstr "" #: gnome/init.c:78 msgid "_Initialise site" msgstr "" #: gnome/init.c:78 msgid "All files will be uploaded if a site is initialised" msgstr "" #: gnome/init.c:81 msgid "'_Catchup' site" msgstr "" #: gnome/init.c:81 msgid "Records the site as already updated." msgstr "" #: gnome/init.c:84 msgid "_Fetch site listing" msgstr "" #: gnome/init.c:84 msgid "Figures out which files are new/changed from the actual remote site." msgstr "" #: gnome/init.c:88 msgid "_Resynchronize site" msgstr "" #: gnome/init.c:88 msgid "Copies newer files from the remote site to the local drive." msgstr "" #: gnome/init.c:91 msgid "_Update site..." msgstr "" #: gnome/init.c:91 msgid "Apply the local site's changes to the remote site." msgstr "" #: gnome/init.c:94 msgid "Update _ALL sites" msgstr "" #: gnome/init.c:94 gnome/init.c:137 msgid "Performs the required operations on all site definitions. (TODO)." msgstr "" #: gnome/init.c:98 msgid "Rescan local directory" msgstr "" #: gnome/init.c:98 msgid "Re-reads the local directory of the selected site." msgstr "" #: gnome/init.c:106 msgid "_Required updates" msgstr "" #: gnome/init.c:106 msgid "Displays a brief report of any required updates." msgstr "" #: gnome/init.c:109 msgid "Site web-r_eport" msgstr "" #: gnome/init.c:109 msgid "" "Generates a web page detailing the changes required on the selected site." msgstr "" #: gnome/init.c:112 msgid "Prin_t site info..." msgstr "" #: gnome/init.c:112 msgid "Print information about the selected site" msgstr "" #: gnome/init.c:119 msgid "_Backup files status" msgstr "" #: gnome/init.c:119 msgid "Save the 'state' of your local files, in case of accident." msgstr "" #: gnome/init.c:122 msgid "Restore files status..." msgstr "" #: gnome/init.c:122 gnome/init.c:129 msgid "If a backup has previously been made, it will be restored." msgstr "" #: gnome/init.c:126 msgid "_Backup site definitions" msgstr "" #: gnome/init.c:126 msgid "Backup your site definitions, in case you delete your sites." msgstr "" #: gnome/init.c:129 msgid "Restore site definitions..." msgstr "" #: gnome/init.c:137 msgid "Preferences..." msgstr "" #: gnome/init.c:146 msgid "_About XSitecopy" msgstr "" #: gnome/init.c:146 msgid "Information about XSitecopy" msgstr "" #: gnome/init.c:158 msgid "_File" msgstr "" #: gnome/init.c:159 msgid "_Operations" msgstr "" #: gnome/init.c:160 msgid "_Reports" msgstr "" #: gnome/init.c:161 msgid "_Settings" msgstr "" #: gnome/init.c:162 msgid "_Backup" msgstr "" #: gnome/init.c:163 msgid "_Help" msgstr "" #: gnome/init.c:171 msgid "New site" msgstr "" #: gnome/init.c:174 msgid "Open" msgstr "" #: gnome/init.c:174 msgid "Open a new site definitions file." msgstr "" #: gnome/init.c:177 msgid "Save" msgstr "" #: gnome/init.c:180 msgid "Delete site" msgstr "" #: gnome/init.c:180 msgid "Delete the selected site" msgstr "" #: gnome/init.c:185 msgid "Initialise" msgstr "" #: gnome/init.c:185 msgid "Initialise the site (mark all files as needing to be updated)." msgstr "" #: gnome/init.c:188 msgid "Catch-up" msgstr "" #: gnome/init.c:188 msgid "Mark all of the selected site's files as updated." msgstr "" #: gnome/init.c:194 msgid "Download" msgstr "" #: gnome/init.c:194 msgid "Download newer files from the remote site. (Use with care)" msgstr "" #: gnome/init.c:198 msgid "Updates the selected site" msgstr "" #: gnome/init.c:202 msgid "Quit" msgstr "" #: gnome/init.c:412 #, c-format msgid "%s: Error: Could not read rcfile: %s.\n" msgstr "" #: gnome/main.c:184 msgid "" "Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" msgstr "" #: gnome/misc.c:580 #, c-format msgid "Server not specified in site `%s'.\n" msgstr "" #: gnome/misc.c:584 #, c-format msgid "Remote directory not specified in site `%s'.\n" msgstr "" #: gnome/misc.c:588 #, c-format msgid "Local directory not specified in site `%s'.\n" msgstr "" #: gnome/misc.c:592 #, c-format msgid "" "Could not read directory for `%s':\n" "\t%s\n" msgstr "" #: gnome/misc.c:596 #, c-format msgid "Invalid port used in site `%s'.\n" msgstr "" #: gnome/misc.c:600 #, c-format msgid "Protocol '%s' cannot maintain symbolic links (site `%s').\n" msgstr "" #: gnome/misc.c:604 #, c-format msgid "Cannot use a relative remote directory protocol '%s' (site `%s').\n" msgstr "" #: gnome/misc.c:607 #, c-format msgid "%s's protocol does not currently support maintaining permissions." msgstr "" #: gnome/misc.c:611 #, c-format msgid "Could not find 'relative' local directory" msgstr "" #: lib/neon/ne_redirect.c:92 msgid "Could not parse redirect destination URL" msgstr "" #: lib/neon/ne_gnutls.c:162 #, c-format msgid "[unprintable:#%lu]" msgstr "" #: lib/neon/ne_gnutls.c:188 msgid "[unprintable]" msgstr "" #: lib/neon/ne_gnutls.c:696 lib/neon/ne_openssl.c:419 msgid "Server certificate was missing commonName attribute in subject name" msgstr "" #: lib/neon/ne_gnutls.c:736 lib/neon/ne_openssl.c:638 #, c-format msgid "SSL negotiation failed: %s" msgstr "" #: lib/neon/ne_gnutls.c:745 msgid "Server did not send certificate chain" msgstr "" #: lib/neon/ne_openssl.c:451 #, c-format msgid "Certificate verification error: %s" msgstr "" #: lib/neon/ne_openssl.c:657 msgid "SSL server did not present certificate" msgstr "" #: lib/neon/ne_openssl.c:666 msgid "Server certificate changed: connection intercepted?" msgstr "" #: lib/neon/ne_session.c:356 lib/neon/ne_session.c:367 msgid "[invalid date]" msgstr "" #: lib/neon/ne_session.c:380 msgid "certificate is not yet valid" msgstr "" #: lib/neon/ne_session.c:381 msgid "certificate has expired" msgstr "" #: lib/neon/ne_session.c:382 msgid "certificate issued for a different hostname" msgstr "" #: lib/neon/ne_session.c:383 msgid "issuer is not trusted" msgstr "" #: lib/neon/ne_session.c:388 msgid "Server certificate verification failed: " msgstr "" #: lib/neon/ne_socket.c:514 lib/neon/ne_socket.c:568 lib/neon/ne_socket.c:671 msgid "Connection closed" msgstr "" #: lib/neon/ne_socket.c:578 lib/neon/ne_socket.c:683 msgid "Secure connection truncated" msgstr "" #: lib/neon/ne_socket.c:590 lib/neon/ne_socket.c:695 #, c-format msgid "SSL error: %s" msgstr "" #: lib/neon/ne_socket.c:593 #, c-format msgid "SSL error code %d/%d/%lu" msgstr "" #: lib/neon/ne_socket.c:676 #, c-format msgid "SSL alert received: %s" msgstr "" #: lib/neon/ne_socket.c:691 msgid "SSL socket read failed" msgstr "" #: lib/neon/ne_socket.c:790 msgid "Line too long" msgstr "" #: lib/neon/ne_socket.c:935 lib/neon/ne_socket.c:941 msgid "Host not found" msgstr "" #: lib/neon/ne_socket.c:1048 msgid "Connection timed out" msgstr "" #: lib/neon/ne_socket.c:1210 msgid "Socket descriptor number exceeds FD_SETSIZE" msgstr "" #: lib/neon/ne_socket.c:1270 msgid "Socket family not supported" msgstr "" #: lib/neon/ne_socket.c:1493 msgid "Client certificate verification failed" msgstr "" #: lib/neon/ne_socket.c:1509 msgid "SSL disabled due to lack of entropy" msgstr "" #: lib/neon/ne_socket.c:1516 msgid "SSL disabled due to library version mismatch" msgstr "" #: lib/neon/ne_socket.c:1522 msgid "Could not create SSL structure" msgstr "" #: lib/neon/ne_request.c:194 #, c-format msgid "%s: connection was closed by proxy server" msgstr "" #: lib/neon/ne_request.c:197 #, c-format msgid "%s: connection was closed by server" msgstr "" #: lib/neon/ne_request.c:202 #, c-format msgid "%s: connection timed out" msgstr "" #: lib/neon/ne_request.c:307 msgid "offset invalid" msgstr "" #: lib/neon/ne_request.c:312 #, c-format msgid "Could not seek to offset %s of request body file: %s" msgstr "" #: lib/neon/ne_request.c:360 msgid "Could not send request body" msgstr "" #: lib/neon/ne_request.c:699 msgid "Could not read chunk size" msgstr "" #: lib/neon/ne_request.c:706 msgid "Could not parse chunk size" msgstr "" #: lib/neon/ne_request.c:743 msgid "Could not read response body" msgstr "" #: lib/neon/ne_request.c:759 msgid "Could not read chunk delimiter" msgstr "" #: lib/neon/ne_request.c:762 msgid "Chunk delimiter was invalid" msgstr "" #: lib/neon/ne_request.c:868 msgid "Could not read status line" msgstr "" #: lib/neon/ne_request.c:890 msgid "Could not parse response status line" msgstr "" #: lib/neon/ne_request.c:902 msgid "Could not read interim response headers" msgstr "" #: lib/neon/ne_request.c:936 msgid "Could not send request" msgstr "" #: lib/neon/ne_request.c:984 lib/neon/ne_request.c:1002 #: lib/neon/ne_request.c:1012 msgid "Error reading response headers" msgstr "" #: lib/neon/ne_request.c:1030 msgid "Response header too long" msgstr "" #: lib/neon/ne_request.c:1112 msgid "Response exceeded maximum number of header fields" msgstr "" #: lib/neon/ne_request.c:1129 #, c-format msgid "Could not resolve hostname `%s': %s" msgstr "" #: lib/neon/ne_request.c:1260 msgid "Unknown transfer-coding in response" msgstr "" #: lib/neon/ne_request.c:1271 msgid "Invalid Content-Length in response" msgstr "" #: lib/neon/ne_request.c:1344 #, c-format msgid "Could not write to file: %s" msgstr "" #: lib/neon/ne_request.c:1417 #, c-format msgid "Could not create SSL connection through proxy server: %s" msgstr "" #: lib/neon/ne_request.c:1464 msgid "Could not create socket" msgstr "" #: lib/neon/ne_request.c:1526 msgid "Could not connect to proxy server" msgstr "" #: lib/neon/ne_request.c:1527 msgid "Could not connect to server" msgstr "" #: lib/neon/ne_xml.c:280 #, c-format msgid "XML parse error at line %d: invalid element name" msgstr "" #: lib/neon/ne_xml.c:452 msgid "Unknown error" msgstr "" #: lib/neon/ne_xml.c:537 msgid "Invalid Byte Order Mark" msgstr "" #: lib/neon/ne_xml.c:625 #, c-format msgid "XML parse error at line %d: %s" msgstr "" #: lib/neon/ne_props.c:371 lib/neon/ne_props.c:435 msgid "Response exceeds maximum property count" msgstr "" #: lib/neon/ne_compress.c:184 #, c-format msgid "%s: %s (code %d)" msgstr "" #: lib/neon/ne_compress.c:232 msgid "Could not inflate data" msgstr "" #: lib/neon/ne_compress.c:293 msgid "Could not initialize zlib" msgstr "" #: lib/neon/ne_xmlreq.c:36 #, c-format msgid "Could not parse response: %s" msgstr "" #: lib/neon/ne_basic.c:98 #, c-format msgid "Could not determine file size: %s" msgstr "" #: lib/neon/ne_basic.c:149 msgid "Response did not include requested range" msgstr "" #: lib/neon/ne_basic.c:183 msgid "Range is not satisfiable" msgstr "" #: lib/neon/ne_basic.c:188 msgid "Resource does not support ranged GET requests" msgstr "" #: lib/neon/ne_auth.c:130 #, c-format msgid "Could not authenticate to server: %s" msgstr "" #: lib/neon/ne_auth.c:135 #, c-format msgid "Could not authenticate to proxy server: %s" msgstr "" #: lib/neon/ne_auth.c:358 #, c-format msgid "rejected %s challenge" msgstr "" #: lib/neon/ne_auth.c:374 msgid "missing realm in Basic challenge" msgstr "" #: lib/neon/ne_auth.c:469 msgid "invalid Negotiate token" msgstr "" #: lib/neon/ne_auth.c:492 msgid "GSSAPI authentication error: " msgstr "" #: lib/neon/ne_auth.c:505 #, c-format msgid "GSSAPI failure (code %u)" msgstr "" #: lib/neon/ne_auth.c:540 msgid "ignoring empty Negotiate continuation" msgstr "" #: lib/neon/ne_auth.c:555 msgid "Negotiate response verification failed: invalid response header token" msgstr "" #: lib/neon/ne_auth.c:577 #, c-format msgid "Negotiate response verification failure: %s" msgstr "" #: lib/neon/ne_auth.c:697 msgid "unknown algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:701 msgid "incompatible algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:705 msgid "missing parameter in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:709 msgid "initial Digest challenge was stale" msgstr "" #: lib/neon/ne_auth.c:716 msgid "stale Digest challenge with new algorithm or realm" msgstr "" #: lib/neon/ne_auth.c:728 msgid "could not parse domain in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:1036 msgid "Digest mutual authentication failure: missing parameters" msgstr "" #: lib/neon/ne_auth.c:1041 msgid "Digest mutual authentication failure: client nonce mismatch" msgstr "" #: lib/neon/ne_auth.c:1051 msgid "Digest mutual authentication failure: could not parse nonce count" msgstr "" #: lib/neon/ne_auth.c:1056 #, c-format msgid "Digest mutual authentication failure: nonce count mismatch (%u not %u)" msgstr "" #: lib/neon/ne_auth.c:1099 msgid "Digest mutual authentication failure: request-digest mismatch" msgstr "" #: lib/neon/ne_auth.c:1225 #, c-format msgid "ignored %s challenge" msgstr "" #: lib/neon/ne_auth.c:1304 msgid "could not parse challenge" msgstr "" #: lib/neon/ne_207.c:198 #, c-format msgid "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" msgstr "" #: lib/neon/ne_locks.c:584 msgid "LOCK response missing Lock-Token header" msgstr "" #: lib/neon/ne_locks.c:759 #, c-format msgid "Response missing activelock for %s" msgstr "" #: lib/neon/ne_locks.c:801 #, c-format msgid "No activelock for <%s> returned in LOCK refresh response" msgstr "" #: lib/rpmatch.c:79 msgid "^[yY]" msgstr "" #: lib/rpmatch.c:82 msgid "^[nN]" msgstr "" #: lib/getopt.c:664 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "" #: lib/getopt.c:688 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" #: lib/getopt.c:693 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" #: lib/getopt.c:710 lib/getopt.c:883 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "" #: lib/getopt.c:739 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "" #: lib/getopt.c:743 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "" #: lib/getopt.c:769 #, c-format msgid "%s: illegal option -- %c\n" msgstr "" #: lib/getopt.c:772 #, c-format msgid "%s: invalid option -- %c\n" msgstr "" #: lib/getopt.c:802 lib/getopt.c:932 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "" #: lib/getopt.c:849 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "" #: lib/getopt.c:867 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "" sitecopy-0.16.6/po/LINGUAS0000664000076400007640000000003011037415627013233 0ustar joejoecs de fr it ja nn ru tr sitecopy-0.16.6/po/it.gmo0000664000076400007640000011160611037462357013344 0ustar joejoeeD l0$"?b+#2f =k%%%%A%!&#&+&3<&p&&F&F&D:'>'+'1'(6+(:b(/(;(5 )%?)&e)0)e)%#*&I*<p*3*'*A +.K+1z+d+6,EH,4,+,*,7-=R-:-$-0-!.:.&Y.q.1.4$/JY/I/'/!0!80Z02s0,0907 1EE1/1411bp2G23$53Z3t3!3!3334$4>4,X44%4,4-4 $5&E5"l5555 5 5557.67f6A6567/7-O7+}7A7>7*83:8n828+8$8<9%A9g9)9B999":(%: N:X: j:x::&::;:;6;%N;!t;;;;.;5<!N<"p<<)<'<<= .=O=c====+=>$>'>>'f>>>>#>%?4-?b?v??.??? @ @!@>@ M@Z[@ @ @ @@@A A;,A8hAFA=A&B06B.gBB:BBBB CC>CQCgCxCCDCCCICAD:PDDD D>D DE"EV?E#EE EEF'F =FKF,aF FFFF1F G*G:G8CG|G#G!G G G GAG@HOH)cH:HHH2HI$(I-MIB{I II(I'J0J"IJlJJ JJ#J,JK -K;K&VK}K#KKK:K! L,,LYL3uL(LCL%M#U"dU,U&U<UWU-] ]]]B]%]^ ^;^ Z^{^M^Q^]:_G_3_0`E`?U`D`9`Ba<Wa=a>a>bPb*b>bF:c<c2cXc;JdCdvdDAe]eEe3*f6^fEfPf?,g*lg4g(g/g1%hWh-h>iKMiJi*i!j!1jSj5mj/jFjEkO`k8kEk/lplHGm!m-mmm!n!4nVnvnnnn+no)1o+[o,o o*o8p$9p$^ppppKpMqLNqHqKq0r89r8rr0rOrG,sts9ss+s0s%0t/Vt)t(t:tEu Zu du&nu2u uuu1u!-v0Ovv5v!v8v#$w'Hw!pw#ww5w= x2Gx-zxx0x4x-yMy)lyy$y.y#z&)z3Pz-z+z/z={+L{*x{${0{'{D!|f| |,|;|" } /}P}X}%a}}}\} ~ ~ ~*~F~b~x~B~7~MFV.. 9Mc%i3!/Q:YZ;[d ~* (܂k+q+&Ƀ.>Q0j „$ۄ& '5 J9U4#Ʌ ) "J- x(>Ɇ --[&n0RƇ $0::k%)̈% 9D)\<É.?&\1%ϊ1'SE2S̋4 &U#|%݌.2! T`-~33/DWu~?0T 23?TT ŐԐ ,F[v| Ñܑ )"B4e ’ϒ- %29@ S^ o}"o&krMPYD?NBjL[}//d[; U*0B!c$ x@TfW Z>(LWlA'EKC MZp:N6!Ic#4i-0O`8Fu(b 58H 3+.n],4_F9<) :X C\Jg w^mhERyv|"7`dqYP16H ~ aQ+DK2VzVQS#%XU&'=;-1s_3^,.tJ?<){A5a$]eGe=R%>@7T\2bG *SO9I Files will be moved remotely if moved locally. Passive mode FTP will not be used. Permissions: %s Symlinks: %s Protocol: %s Username: %s Remote directory: %s Local directory: %s Remote files will not be deleted. -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be: socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, cleartext Warning: cleartext displays (normally hidden) passwords in plain text -g, --logfile=FILE Append debugging messages to FILE (else use stderr) -r, --rcfile=FILE Use alternate run control file -p, --storepath=PATH Use alternate site storage directory -y, --prompting Request confirmation before making each update -a, --allsites Perform the operation on ALL defined sites -k, --keep-going Carry on an update regardless of errors -o, --show-progress Display total percentage file transfer complete -q, --quiet Be quiet while performing the operation -qq, --silent Be silent while perforing the operation -n, --dry-run Display but do not carry out the operation Operation modes: -l, --list List changes between remote and local sites (default) -ll, --flatlist Flat list of changes between remote and local sites -v, --view Display a list of the site definitions -i, --initialize Mark all files and directories as not updated -f, --fetch Find out what files are on the remote site -e, --verify Verify stored state of site matches real remote state -c, --catchup Mark all files and directories as updated -s, --synchronize Update the local site from the remote site -u, --update Update the remote site -h, --help Display this help message -V, --version Display version information Please send feature requests and bug reports to sitecopy@lyra.org Changes to items in [brackets] are ignored during updates. Port: (ASCII)%d %s's protocol does not currently support maintaining permissions.%s: %c%s site `%s' (on %s in %s) %s: %s %s: %s (code %d)%s: %s cannot maintain symbolic links (site `%s'). %s: %s completed successfully. %s: %s unsupported for %s. %s: All the files and and directories are marked as updated remotely. %s: All the files and directories are marked as NOT updated remotely. %s: Can only check for renamed files when checksumming (site `%s'). %s: Cannot use a relative remote directory in %s (site `%s'). %s: Could not read directory for `%s': %s %s: Encrypted client certificate configured%s%s. %s: Error: %s %s: Error: Corrupt site storage file for `%s': %s: %s %s: Error: Could not authorise user on proxy server (%s). %s: Error: Could not authorise user on server. %s: Error: Could not connect to proxy server (%s port %d). %s: Error: Could not connect to server (%s port %d). %s: Error: Could not open rcfile: %s %s: Error: Could not open rcfile: %s. %s: Error: Could not open storage directory: %s %s: Error: Could not open storage file for writing (%s) %s: Error: %s %s: Will not update site `%s'. %s: Error: Could not parse ~/.netrc. %s: Error: Could not read rcfile: %s. %s: Error: Could not resolve hostname of proxy server (%s). %s: Error: Could not resolve remote hostname (%s). %s: Error: Debug channel %s not known. %s: Error: Dry run mode is currently only supported for updates. %s: Error: Environment variable HOME not set. %s: Error: No site called `%s' found - skipping. %s: Error: No storage file for `%s'. %s: Use --init, --catchup or --fetch to create a storage file. %s: Error: Only specify ONE operation mode at a time. %s: Error: rcfile permissions allow other users to read your rcfile. %s: Error: storage directory permissions incorrect. %s: Error: ~/.netrc permissions incorrect. %s: Errors occurred while %s the %s site. %s: Failed to fetch file listing for site `%s': %s: %s %s: Failed to fetch file listing to verify site `%s': %s: %s %s: File permissions are not supported in %s (site `%s'). %s: Invalid port used in site `%s'. %s: Local directory not specified in site `%s'. %s: No sites specified. %s: No valid sites specified. %s: Nothing to do - no changes found. %s: Refusing to delete all local files with a synchronize operation. %s: Use --update to update the remote site. %s: Remote directory not specified in site `%s'. %s: Remote site not synchronized with stored state. %s: Safe mode cannot be used in conjunction with nooverwrite (site `%s'). %s: Safe mode cannot be used in conjunction with tempupload (site `%s'). %s: Server not specified in site `%s'. %s: Set the permissions to 0600. %s: Set the permissions to 0700. %s: Skipping site `%s'. %s: The protocol `%s' is unsupported (site `%s'). %s: The remote site does not need updating. %s: The remote site needs updating (%d items to update). %s: The remote site needs updating (1 item to update). %s: Unhandled error %d in site `%s' - please contact the maintainer. %s: Verify found %d files missing from server. %s: Warning: Could not open `%s' to use as logfile. %s: Warning: Current state method differs from stored in site `%s'. %s: All existing files will appear changed (use catchup?). %s: Warning: Only %d sites can be specified on the command line! Extra entries are being skipped. %s: You need to create this directory and set the permissions to 0700. %s: connection timed out.%s: connection was closed by server.%s: illegal option -- %c %s: in act_on_site %s%s: in fe_can_update/file_file %s%s: in fe_can_update/file_link %s%s: in fe_updating/file_file %s%s: in fe_updating/file_link %s%s: in issue_error %s%s: init_paths gave %d %s%s: invalid option -- %c %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: rcfile corrupt at line %d: %s %s: unrecognized option `%c%s' %s: unrecognized option `--%s' '_Catchup' site(default) (unspecified)* These items have been added since the last update: * These items have been changed since the last update: * These items have been deleted since the last update: * These items have been deleted, but will be left on the server: * These items have been moved since the last update: ? (y/n) Active open failed: could not accept connectionActive open failed: could not bind to addressActive open failed: could not create socketActive open failed: could not determine address of control socketActive open failed: could not determine address of data socketAdded on serverAll files will be uploaded if a site is initialisedAlways maintainedApply the local site's changes to the remote site.Authentication required for %s on %s `%s': Authentication required on %s `%s': Backup your site definitions, in case you delete your sites.Boolean missing in 'ascii' at line %dCannot parse MDTM response.Cannot parse MDTM response; wrong length.Cannot use a relative remote directory protocol '%s' (site `%s'). Catch upCatch-upCertificate verification error: %sCertificate was issued for server `%s'. Change %sChanged on serverChanging %s: Checksumming %s: [Chunk delimiter was invalidClient certificate verification failedConnection closedCopies newer files from the remote site to the local drive.Could not access resourceCould not checksum fileCould not connect passive data socketCould not connect to proxy serverCould not connect to serverCould not create SSL structureCould not create socketCould not decrypt SSL client certificate '%s'.Could not determine bound port number for data socketCould not determine file size: %sCould not determine length of fileCould not examine file.Could not find 'relative' local directoryCould not find address in PASV responseCould not inflate dataCould not initialize zlibCould not load certificate `%s'.Could not open fileCould not parse PASV responseCould not parse chunk sizeCould not parse response: %sCould not read 'LIST' response.Could not read SSL client certificate '%s'.Could not read chunk delimiterCould not read chunk sizeCould not read directory for `%s': %s Could not read interim response headersCould not read response bodyCould not read response lineCould not read status lineCould not resolve hostname `%s': %sCould not rewind to beginning of fileCould not seek to offset %s of request body file: %sCould not send fileCould not send requestCould not send request bodyCould not set modification time of local file.Could not stat file: %sCould not write to file: %sCreate %sCreate %s/Create a new site definitionCreating %s/: Creating %s: Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, 32=XML, 64=GNOME )Delete %sDelete %s/Delete siteDelete the selected siteDelete the selected site entryDeleting %s/: Deleting %s: Digest mutual authentication failure: client nonce mismatchDigest mutual authentication failure: missing parametersDigest mutual authentication failure: nonce count mismatch (%u not %u)Digest mutual authentication failure: request-digest mismatchDirectory: %s/ Displays a brief report of any required updates.Do you wish to accept this certificate? (y/n) DownloadDownload newer files from the remote site. (Use with care)Downloading %s: [E_xitError closing data socketError reading fileError reading response headersError sending fileError writing to fileExit the programFailed to update %s:%c%s FetchFigures out which files are new/changed from the actual remote site.Fingerprint: %s FollowedGenerates a web page detailing the changes required on the selected site.Host not foundIf a backup has previously been made, it will be restored.IgnoredInformation about XSitecopyInitialiseInitialise the site (mark all files as needing to be updated).InitializeInvalid Byte Order MarkInvalid Content-Length in responseInvalid HTTP status line in status element at line %d of response: Status line was: %sInvalid IP address in PASV responseInvalid checksum at line %dInvalid port used in site `%s'. Issued by: %s Issued to: %s LOCK response missing Lock-Token headerLine too longLink: %s - target %s Local directory not specified in site `%s'. MaintainedMaintained for executablesMalformed EPSV responseMalformed port in EPSV responseMark all of the selected site's files as updated.Move %s->%sMoving %s->%s: New siteNo activelock for <%s> returned in LOCK refresh responseOpenOpen a new rc file. (EXPERIMENTAL).Open a new site definitions file.Options: Parse error in LIST response: %sPassword: Performs the required operations on all site definitions. (TODO).Preferences...Prin_t site info...Print information about the selected siteProtocol '%s' cannot maintain symbolic links (site `%s'). QuitRange is not satisfiableRe-reads the local directory of the selected site.Receiving fileRecords the site as already updated.Remote directory not specified in site `%s'. Remote file has been modified - not overwriting with local changesRemove %sRescan local directoryResponse did not include requested rangeResponse exceeds maximum property countResponse header too longResponse missing activelock for %sRestore files status...Restore site definitions...Retrying: [SSL alert received: %sSSL disabled due to lack of entropySSL disabled due to library version mismatchSSL error code %d/%d/%luSSL error: %sSSL negotiation failed: %sSSL server did not present certificateSSL socket read failedSSL support has not be compiled in.Sav_e Sites As...SaveSave the 'state' of your local files, in case of accident.Save the current site definitionsSave the current site definitions to a file.Secure connection truncatedServer certificate changed: connection intercepted?Server certificate verification failed: Server certificate was missing commonName attribute in subject nameServer did not send certificate chainServer not specified in site `%s'. Setting permissions on %s%s: Show changes toSite web-r_eportSite: %s Server: %sSize overflow (%s) in '%s' at line %dSocket descriptor number exceeds FD_SETSIZESynchronizeThe connection timed out.The server does not appear to be a WebDAV server.The server does not support the executable live property.The target of the symlink could not be read.Try `%s --help' for more information. Unknown errorUnknown system errorUpdateUpdate _ALL sitesUpdates the selected siteUpload succeeded, but could not retrieve modification time. If this message persists, turn off safe mode.Uploading %s: [Usage: %s [OPTIONS] [MODE] [sitename]... Username: Username: %s VerifyWARNING: Certificate does not specify a serverWARNING: Server certificate is not trusted.XML parse error at line %d: invalid element nameYou should never see this message. Please contact the maintainer at sitecopy@lyra.org [invalid date]] done. ] failed: %s ] failed:%c%s ^[nN]^[yY]_About XSitecopy_Backup_Backup files status_Backup site definitions_Delete this site_Fetch site listing_File_Help_Initialise site_New site..._Open..._Operations_Reports_Required updates_Resynchronize site_Save Sites_Settings_Update site...catching upcertificate has expiredcertificate is not yet validcertificate issued for a different hostnamedir:done. failed: %s failed:%c%s fetchinginitializingissuer is not trustedlocaloffset invalidproxy serverremoteservershowing changes tostoredsynchronizingupdatingverifyingProject-Id-Version: sitecopy 0.16.3 Report-Msgid-Bugs-To: sitecopy@lyra.org POT-Creation-Date: 2008-07-16 16:31+0100 PO-Revision-Date: 2006-03-12 16:17+0100 Last-Translator: Cristian Rigamonti Language-Team: Italian MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); I file spostati localmente lo saranno anche sul server- Non sar usata la modalit passiva FTP. Permessi: %s Link simbolici: %s Protocollo: %s Nome utente: %s Directory remota: %s Directory locale: %s I file remoti non saranno eliminati. -d, --debug=CODICE[,CODICE] Attiva il debugging per ogni CODICE: socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, cleartext Attenzione: cleartext mostra in chiaro le password (di solito nascoste) -g, --logfile=FILE Accoda i messaggi di debugging al FILE (altrimenti usa stderr) -r, --rcfile=FILE Usa un file di configurazione alternativo -p, --storepath=PATH Usa una directory degli archivi alternativa -y, --prompting Chiedi conferma prima di ogni aggiornamento -a, --allsites Esegue l'operazione su TUTTI i siti definiti -k, --keep-going Porta a termine un aggiornamento ignorando gli errori -o, --show-progress Mostra la percentuale di completamento del trasferimento file -q, --quiet Esegue l'operazione mostrando solo i nomi dei file -qq, --silent Esegue l'operazione senza mostrare nulla -n, --dry-run Simulazione: mostra l'operazione senza eseguirla Modalit di operazione: -l, --list Elenca i cambiamenti tra siti remoti e locali (predefinita) -ll, --flatlist Come sopra ma usando una lista semplice -v, --view Mostra la lista delle definizioni dei siti -i, --initialize Considera tutti i file e directory come non aggiornati -f, --fetch Scarica la lista dei file presenti sul sito remoto -e, --verify Verifica che l'informazione archiviata corrisponda allo stato del sito remoto -c, --catchup Riallinea: marca tutti i file e directory come aggiornati -s, --synchronize Sincronizza il sito locale usando il sito remoto come riferimento -u, --update Aggiorna il sito remoto -h, --help Mostra questo messaggio di aiuto -V, --version Mostra informazioni sulla versione Spedire richieste di miglioramento e notifiche di errore a sitecopy@lyra.org Le modifiche agli oggetti tra [parentesi] sono ignorate durante gli aggiornamenti. Porta: (ASCII)%d Il protocollo di %s non permette di mantenere i permessi dei file.%s: %c%s del sito "%s" (su %s in %s) %s: %s %s: %s (codice %d)%s: %s impossibile mantenere i link simbolici (sito "%s"). %s: %s completato con successo. %s: %s non supportato per %s. %s: tutti i file e le directory sono considerati come aggiornati sul server. %s: tutti i file e le directory sono considerati come NON aggiornati sul server. %s: il controllo dei file rinominati possibile solo con attivando il checksum (sito "%s"). %s: impossibile usare una directory remota relativa in %s (sito "%s"). %s: impossibile leggere la directory per "%s": %s %s: Certificato client cifrato configurato%s%s. %s: errore: %s %s: errore: file di archivio corrotto per il sito "%s": %s: %s %s: errore: impossibile autorizzare l'utente sul server proxy (%s). %s: errore: impossibile autorizzare l'utente sul server. %s: errore: impossibile connettersi al server proxy (%s port %d). %s: errore: impossibile connettersi al server (%s port %d). %s: errore: impossibile aprire il file di configurazione: %s %s: errore: impossibile aprire il file di configurazione: %s. %s: errore: impossibile aprire la directory degli archivi: %s %s: errore: impossibile aprire per la lettura il file di archivio (%s) %s: errore: %s %s: impossibile aggiornare il sito "%s". %s: errore: impossibile leggere ~/.netrc. %s: Errore: impossibile aprire il file di configurazione: %s. %s: errore: impossibile risolvere il nome host del server proxy (%s). %s: errore: impossibile risolvere il nome host remoto (%s). %s: errore: il livello di debug %s sconosciuto. %s: Errore: la modalit simulazione al momento supportata solo per gli aggiornamenti. %s: errore: la variabile di ambiente HOME non impostata. %s: errore: non stato trovato alcun sito chiamato "%s" - omesso. %s: errore: manca il file di archivio per "%s". %s: usare --init, --catchup o --fetch per creare un file di archivio. %s: errore: Specificare solo UNA modalit di operazione alla volta. %s: errore: i permessi del file di configurazione lo rendono leggibile per gli altri utenti. %s: errore: i permessi della directory degli archivi sono scorretti. %s: errore: i permessi di ~/.netrc sono scorretti. %s: si sono verificati errori durante %s del sito %s. %s: impossibile scaricare la lista dei file per il sito "%s": %s: %s %s: impossibile scaricare la lista dei file per verificare il sito "%s": %s: %s %s: i permessi sui file non sono supportati in %s (sito "%s"). %s: porta non valida usata nel sito "%s". %s: directory locale non specificata nel sito "%s". %s: non stato specificato alcun sito. %s: non stato specificato alcun sito valido. %s: niente da fare - nessun cambiamento trovato. %s: mi rifiuto di eliminare tutti i file locali con un'operazione di sincronizzazione. %s: usare --update per agiornare il sito remoto. %s: directory non specificata nel sito "%s". %s: il sito remoto non sincronizzato con l'immagine locale. %s: la modalit sicura non si pu usare insieme a nooverwrite (sito "%s"). %s: la modalit sicura non si pu usare insieme a tempupload (sito "%s"). %s: server non specificato nel sito "%s". %s: impostare i permessi a 0600. %s: impostare i permessi a 0700. %s: ignoro il sito "%s". %s: il protocollo "%s" non supportato (sito "%s"). %s: il sito remoto non deve essere aggiornato. %s: il sito remoto deve essere aggiornato (%d oggetti da aggiornare). %s: il sito remoto deve essere aggiornato (1 oggetto da aggiornare). %s: errore non trattato %d nel sito "%s" - si prega di contattare il curatore. %s: la verifica ha trovato %d file mancanti dal server. %s: attenzione: impossibile aprire "%s" per usarlo come file di log. %s: attenzione: il metodo di stato attuale diverso da quello usato nel sito "%s". %s: tutti i file esistenti appariranno modificati (suggerimento: usare catchup?). %s: attenzione: possibile specificare solo %d siti sulla riga di comando! Le voci ulteriori saranno ignorate. %s: necessario creare questa directory e impostare i permessi a 0700. %s: tempo di connessione scaduto.%s: la connessione stata chiusa dal server.%s: opzione illegale -- %c %s: in act_on_site %s%s: in fe_can_update/file_file %s%s: in fe_can_update/file_link %s%s: in fe_updating/file_file %s%s: in fe_updating/file_link %s%s: in issue_error %s%s: init_paths produce %d %s%s: opzione non valida -- %c %s: l'opzione "%c%s" non ammette argomenti %s: l'opzione "%s" ambigua %s: l'opzione "%s" richiede un argumento %s: l'opzione "--%s" non ammette argomenti %s: l'opzione "-W %s" non ammette argomenti %s: l'opzione "-W %s" ambigua %s: l'opzione richiede un argumento -- %c %s: file di configurazione danneggiato alla riga %d: %s %s: opzione non riconosciuta "%c%s" %s: opzione non riconosciuta "--%s" _Riallinea sito(predefinito) (non specificato)* Rispetto al precedente aggiornamento questi oggetti sono stati aggiunti: * Rispetto al precedente aggiornamento questi oggetti sono stati modificati: * Rispetto al precedente aggiornamento questi oggetti sono stati eliminati: * Questi oggetti sono stati eliminati, ma verranno lasciati sul server: * Rispetto al precedente aggiornamento questi oggetti sono stati spostati: ? (s/n) Errore active open: impossibile accettare la connessioneErrore active open: impossibile collegarsi all'indirizzoErrore active open: impossibile creare il socketErrore active open: impossibile determinare l'indirizzo del socket di controlloErrore active open: impossibile determinare l'indirizzo del socket datiAggiunti sul serverSe un sito inizializzato tutti i file verranno caricatiMantenuti sempreApplica le modifiche locali al sito remoto. richiesta l'autenticazione per %s su %s "%s": Autenticazione richiesta su %s "%s": Salva le definizioni dei siti a scopo di backupBooleano mancante in 'ascii' alla riga %dImpossibile analizzare la risposta MDTM.Impossibile analizzare la risposta MDTM; lunghezza errata.Impossibile usare una directory remota relativa in "%s" (sito "%s"). RiallineaRiallineaErrore di verifica del certificato: %s stato emesso un certificato per il server "%s". Modifica %sModificati sul serverModifica di %s: Calcolo del codice di controllo su %s in corso: [Delimitatore del chunk non validoErrore nella verifica del certificato del clientConnessione chiusaCopia i nuovi file dal sito remoto alla copia locale.Impossibile accedere alla risorsaImpossibile calcolare il codice di controllo per il fileImpossibile creare la struttura SSLImpossibile connettersi al server proxyImpossibile connettersi al serverImpossibile creare la struttura SSLImpossibile creare il socketImpossibile decifrare il certificato SSL client '%s'.Impossibile determinare il numero di porta per il socket datiImpossibile determinare la dimensione del file: %sImpossibile determinare la lunghezza del fileImpossibile esaminare il file.Impossibile trovare la directory locale relativaImpossibile trovare un indirizzo nella risposta PASVImpossibile decomprimere i datiImpossibile inizializzare zlibImpossibile caricare il certificato "%s".Impossibile aprire il fileImpossibile leggere la risposta PASVImpossibile analizzare la dimensione del chunkImpossibile leggere la risposta: %sImpossibile leggere la risposta "LIST"Impossibile leggere il certificato SSL client '%s'.Impossibile leggere il delimitatore del chunkImpossibile leggere la dimensione del chunkImpossibile leggere la directory per "%s": %s Impossibile leggere le intestazioni della risposta temporaneaImpossibile leggere il corpo della rispostaImpossibile leggere la riga della rispostaImpossibile leggere la riga di statoImpossibile risolvere il nome dell'host "%s": %sImpossibile tornare all'inizio del fileImpossibile posizionarsi all'offset %s del corpo della richiesta: %sImpossibile inviare il fileImpossibile inviare la richiestaImpossibile inviare il corpo della richiestaImpossibile impostare l'orario di modifica del file locale.Impossibile fare stat del file: %sImpossibile scrivere il file: %sCrea %sCrea %s/Crea la definizione per un nuovo sitoCreazione di %s/: Creazione %s: Livello di debug (somma di: 1=socket, 2=file, 4=rcfile, 8=WebDAV, 16=FTP, 32=XML, 64=GNOME )Elimina %sElimina %s/Elimina sitoElimina il sito selezionatoElimina la voce selezionataEliminazione di %s/: Eliminazione di %s: Autenticazione mutua digest fallita: nonce del client non coincideAutenticazione mutua digest fallita: parametri mancantiAutenticazione mutua digest fallita: conteggio nonce non coincide (%u non %u)Autenticazione mutua digest fallita: richiesta e digest non coincidonoDirectory: %s/ Mostra una breve lista dei siti da aggiornare.Si intende accettare questo certificato? (s/n)ScaricaScarica i nuovi file dal sito remoto (usare con cautela).Scaricamento di %s: [_EsciErrore nella chiusura del socket datiErrore nella lettura del fileErrore nella lettura delle intestazioni di rispostaErrore nell'invio del fileErrore nella scrittura del fileEsce dal programmaAggiornamento fallito di %s:%c%s ScaricaControlla quali file sono nuovi/modificati sul sito remotoImpronta digitale: %s SeguitiGenera una pagina web con i dettagli dell'aggiornamento richiesto per il sito selezionato.Host non trovatoRipristina lo stato dei file locali da un backup esistente.IgnoratiInformazioni su XSitecopyInizializzaConsidera tutti i file come non aggiornatiInizializzaByte Order Mark non validoContent-Length non valido nella rispostaLinea di stato HTTP non valida nell'elemento di stato alla riga %d della risposta: La riga di stato era: %sIndirizzo IP non valido nella risposta PASVCodice di controllo non valido alla riga %dPorta non valida usata nel sito "%s". Emesso da: %s Emesso per: %s Header Lock-Token mancante nella risposta LOCKLinea troppo lungaLink: %s - obiettivo %s Directory locale non specificata nel sito "%s". MantenutiMantenuti per gli eseguibiliRisposta EPSV malformataPorta malformata nella risposta EPSVConsidera tutti i file come aggiornatiSposta %s->%sSpostamento %s->%s: Nuovo sitoNessun activelock per <%s> nella risposta di refresh LOCKApriApre un nuovo file di configurazione (SPERIMENTALE).Apre una nuova definizione di sito.Opzioni: Errore di analisi nella risposta LIST: %sPassword: Esegue le operazioni richieste su tutti i siti definiti (NON DISPONIBILE).Preferenze..._Informazioni sul sito...Mostra informazioni sul sito selezionatoIl protocollo "%s" non mantiene i link simbolici (sito "%s"). EsciImpossibile soddisfare il rangeRilegge la copia locale del sito selezionato.Ricezione del fileConsidera il sito come gi aggiornato.Directory remota non specificata nel sito "%s". Il sito remoto stato modificato - non sar sovrascritto con i cambiamenti localiRimuovi %sAnalizza copia localeLa risposta non includeva l'intervallo richiestoLa risposta ha oltrepassato il numero massimo di proprietIntestazione di risposta troppo lungaActivelock mancante nella risposta per %s_Ripristina la situazione...Ripristina le definizioni dei siti...Riprovo: [Avviso SSL ricevuto: %sSSL disabilitato per mancanza di entropiaSSL disabilitato: la versione della libreria non corrispondeCodice di errore SSL %d/%d/%luerrore SSL: %sErrore di negoziazione SSL: %sIl server SSL non ha offerto alcun certificatoErrore di lettura socket SSLIl supporto SSL non stato compilato.Sa_lva siti come...SalvaSalva lo stato dei file locali a scopo di backup.Salva le attuali definizioni dei sitiSalva le attuali definizioni dei siti in un file.Connessione sicura interrottaIl certificato del server cambiato: la connessione pu essere stata intercettata?Errore nella verifica del certificato del server: Il certificato del server non contiene l'attributo commonName nel nome del soggettoIl server non ha spedito la catena di certificazioneServer non specificato nel sito "%s". Impostazione dei permessi su %s%s: Mostra i cambiamenti aAggiornamenti richiesti (pagina _web)Sito: %s Server: %sDimensione eccessiva (%s) in '%s' alla riga %dIl numero del descrittore socket eccede FD_SETSIZESincronizzaTempo di connessione scaduto.Il server non sembra essere un server WebDAV.Il server non supporta la propriet live executableImpossibile leggere l'obiettivo del link simbolico.Provare "%s --help" per maggiori informazioni. Errore sconosciutoErrore di sistema sconosciutoAggiornaAggiorna _TUTTI i sitiAggiorna il sito selezionatoL'aggiornamento avvenuto, ma impossibile recuperare l'orario di modifica. Se questo messaggio persiste, disabilitare la modalit sicura.Caricamento di %s: [Uso: %s [OPZIONI] [MODALITA] [nome del sito]... Nome utente: Nome utente: %s VerificaATTENZIONE: il certificato non specifica un serverATTENZIONE: il certificato del server non fidato.Errore di analisi XML alla riga %d: nome di elemento non validoQuesto messaggio non dovrebbe comparire. Contattare il curatore a sitecopy@lyra.org [data non valida]] fatto. ] fallito: %s ] fallito:%c%s ^[nN]^[sS]I_nformazioni su XSitecopy_Backup_Backup della situazione_Backup delle definizioniEli_mina questo sitoScarica la _lista dei file_FileA_iuto_Inizializza sito_Nuovo sito..._Apri..._Operazioni_RapportiA_ggiornamenti richiesti_Sincronizza sito_Salva siti_Impostazioni_Aggiorna sito...riallineamentoil certificato scadutoil certificato non ancora validoil certificato stato emesso per un altro nome hostdir:fatto. fallito: %s fallito:%c%s scaricamentoinizializzazionechi ha rilasciato il certificato non fidatolocaleoffset invalidoserver proxyremotoserverElenco cambiamentiarchiviatosincronizzazioneaggiornamentoverificasitecopy-0.16.6/po/en@quot.header0000664000076400007640000000226310165765223015006 0ustar joejoe# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # sitecopy-0.16.6/po/de.gmo0000664000076400007640000004331611037462357013322 0ustar joejoe 0$"+1#]=!33SFoFD>B+6:/.;^5%&0eN%<3'K.s1d69Ep4+*7B=z:$0Ib&q1JLI'! !+M2f,97E8/~4bGF$!!Aa,%,<-i &"" B M5[77A 5C y   + $  ! !(!;!U!!m!!!!!!"0"G".c"" " "" " " "" ##"#4#S#Y#b#q# y#V# ## # $ %$1$ A$ L$BW$ $$ $#$$$ %%18%9j%,%&%% &i&~&)& & &&V&/' 8'F'L' R'^'c' j'v' '' ''''' '' '>'=').e)-)#)9)/ *QP****&**>*"&+&I+Kp+O+V ,Tc,4,,3,J1-?|-I-C.-J..x.:.s.,V/D/>/.0260:i0}07"1YZ1B111)2<A2J~25292>93x3$3233E4]4\1515,5,567663n6G6E6X07C737l8Bn848&8 9*9!@9!b999999+:B:'b:+:,:":(;(/;X;v;;;D;B;B@<I<D<==6=,H=%u= = == ==$ >+0>/\>)>>+>(?$+?+P?'|?+?6?)@ 1@ =@ I@ W@ d@ n@ y@ @@@5@@@@ AA[,A AA A$AAA B BOB mB'yBB=BBC#C0,C.]C<C3C1C/D IDWDD,DE*E S+IAL2xOm)UHY\;. Ba4&:Gw!yWRKqP59?Jz,@uXc(rdgN*}~ Files will be moved remotely if moved locally. Passive mode FTP will not be used. Permissions: %s Symlinks: %s Protocol: %s Username: %s Remote directory: %s Local directory: %s Remote files will not be deleted. Changes to items in [brackets] are ignored during updates. Port: (ASCII)%d %s: %c%s site `%s' (on %s in %s) %s: %s %s: %s cannot maintain symbolic links (site `%s'). %s: %s completed successfully. %s: %s unsupported for %s. %s: All the files and and directories are marked as updated remotely. %s: All the files and directories are marked as NOT updated remotely. %s: Can only check for renamed files when checksumming (site `%s'). %s: Cannot use a relative remote directory in %s (site `%s'). %s: Could not read directory for `%s': %s %s: Error: %s %s: Error: Corrupt site storage file for `%s': %s: %s %s: Error: Could not authorise user on proxy server (%s). %s: Error: Could not authorise user on server. %s: Error: Could not connect to proxy server (%s port %d). %s: Error: Could not connect to server (%s port %d). %s: Error: Could not open rcfile: %s %s: Error: Could not open rcfile: %s. %s: Error: Could not open storage directory: %s %s: Error: Could not open storage file for writing (%s) %s: Error: %s %s: Will not update site `%s'. %s: Error: Could not parse ~/.netrc. %s: Error: Could not resolve hostname of proxy server (%s). %s: Error: Could not resolve remote hostname (%s). %s: Error: Debug channel %s not known. %s: Error: Environment variable HOME not set. %s: Error: No site called `%s' found - skipping. %s: Error: No storage file for `%s'. %s: Use --init, --catchup or --fetch to create a storage file. %s: Error: Only specify ONE operation mode at a time. %s: Error: rcfile permissions allow other users to read your rcfile. %s: Error: storage directory permissions incorrect. %s: Error: ~/.netrc permissions incorrect. %s: Errors occurred while %s the %s site. %s: Failed to fetch file listing for site `%s': %s: %s %s: Failed to fetch file listing to verify site `%s': %s: %s %s: File permissions are not supported in %s (site `%s'). %s: Invalid port used in site `%s'. %s: Local directory not specified in site `%s'. %s: No sites specified. %s: No valid sites specified. %s: Nothing to do - no changes found. %s: Refusing to delete all local files with a synchronize operation. %s: Use --update to update the remote site. %s: Remote directory not specified in site `%s'. %s: Safe mode cannot be used in conjunction with nooverwrite (site `%s'). %s: Safe mode cannot be used in conjunction with tempupload (site `%s'). %s: Server not specified in site `%s'. %s: Set the permissions to 0600. %s: Set the permissions to 0700. %s: Skipping site `%s'. %s: The protocol `%s' is unsupported (site `%s'). %s: The remote site does not need updating. %s: The remote site needs updating (%d items to update). %s: The remote site needs updating (1 item to update). %s: Unhandled error %d in site `%s' - please contact the maintainer. %s: Verify found %d files missing from server. %s: Warning: Could not open `%s' to use as logfile. %s: Warning: Only %d sites can be specified on the command line! Extra entries are being skipped. %s: You need to create this directory and set the permissions to 0700. %s: connection timed out.%s: connection was closed by server.%s: illegal option -- %c %s: in act_on_site %s%s: in fe_can_update/file_file %s%s: in fe_can_update/file_link %s%s: in fe_updating/file_file %s%s: in fe_updating/file_link %s%s: in issue_error %s%s: init_paths gave %d %s%s: invalid option -- %c %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: rcfile corrupt at line %d: %s %s: unrecognized option `%c%s' %s: unrecognized option `--%s' (default) (unspecified)* These items have been added since the last update: * These items have been changed since the last update: * These items have been deleted since the last update: * These items have been deleted, but will be left on the server: * These items have been moved since the last update: ? (y/n) Added on serverAlways maintainedAuthentication required for %s on %s `%s': Authentication required on %s `%s': Catch upChange %sChanged on serverChanging %s: Checksumming %s: [Could not access resourceCould not checksum fileCould not connect to proxy serverCould not connect to serverCould not examine file.Could not parse chunk sizeCould not read chunk sizeCould not read response bodyCould not read status lineCould not send requestCould not send request bodyCould not set modification time of local file.Could not write to file: %sCreate %sCreate %s/Creating %s/: Creating %s: Delete %sDelete %s/Deleting %s/: Deleting %s: Directory: %s/ Downloading %s: [Error reading response headersFetchFollowedHost not foundIgnoredInitializeInvalid HTTP status line in status element at line %d of response: Status line was: %sLine too longLink: %s - target %s MaintainedMaintained for executablesMove %s->%sMoving %s->%s: Options: Password: Remote file has been modified - not overwriting with local changesRemove %sResponse header too longRetrying: [SSL support has not be compiled in.Show changes toSite: %s Server: %sSynchronizeThe connection timed out.The server does not appear to be a WebDAV server.The server does not support the executable live property.The target of the symlink could not be read.Try `%s --help' for more information. Unknown system errorUpdateUpload succeeded, but could not retrieve modification time. If this message persists, turn off safe mode.Uploading %s: [Usage: %s [OPTIONS] [MODE] [sitename]... Username: Username: %s VerifyYou should never see this message. Please contact the maintainer at sitecopy@lyra.org ] done. ] failed: %s ^[nN]^[yY]catching updir:done. failed: %s fetchinginitializinglocalproxy serverremoteservershowing changes tostoredsynchronizingupdatingverifyingProject-Id-Version: sitecopy 0.11.3 Report-Msgid-Bugs-To: sitecopy@lyra.org POT-Creation-Date: 2008-07-16 16:31+0100 PO-Revision-Date: 2002-01-13 13:37+0100 Last-Translator: Thomas Schultz Language-Team: de MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Lokal verschobene Dateien werden auf dem Server verschoben. FTP wird nicht im `passive'-Modus verwendet. Zugriffsrechte: %s Symbolische Links: %s Protokoll: %s Benutzername: %s Verzeichnis auf dem Server: %s Lokales Verzeichnis: %s Auf dem Server werden keine Dateien gelscht. nderungen an Eintrgen in [Klammern] werden bei der Aktualisierung ignoriert. Port: (ASCII)%d %s: %c%s der Site `%s' (auf %s in %s) %s: %s %s: %s kann keine symbolischen Links beibehalten (Site `%s'). %s: %s erfolgreich abgeschlossen. %s: %s wird bei %s nicht untersttzt. %s: Alle Dateien und Verzeichnisse wurden als aktualisiert gekennzeichnet. %s: Alle Dateien und Verzeichnisse wurden als zu aktualisieren gekennzeichnet. %s: Kann nur bei Verwendung von Prfsummen auf umbenannte Dateien testen (Site `%s'). %s: Bei %s ist keine relative Verzeichnisangabe auf dem Server mglich (Site `%s'). %s: Konnte Verzeichnis fr `%s' nicht einlesen: %s %s: Fehler: %s %s: Fehler: Datei fr Site `%s' beschdigt: %s: %s %s: Fehler: Konnte auf dem Proxy-Server (%s) den Benutzer nicht anmelden. %s: Fehler: Konnte auf dem Server den Benutzer nicht anmelden. %s: Fehler: Verbindungsaufbau zum Proxy-Server gescheitert (%s Port %d). %s: Fehler: Verbindungsaufbau zum Server gescheitert (%s Port %d). %s: Fehler: Konnte rc-Datei nicht ffnen: %s %s: Fehler: Konnte rc-Datei nicht ffnen: %s. %s: Fehler: Konnte Datenbank-Verzeichnis nicht ffnen: %s %s: Fehler: Kein Schreibzugriff auf die Datei der Site (%s) %s: Fehler: %s %s: Kann Site `%s' nicht aktualisieren. %s: Fehler: Konnte ~/.netrc nicht einlesen. %s: Fehler: Konnte den Namen des Proxy-Servers nicht auflsen (%s). %s: Fehler: Konnte den Namen des Servers nicht auflsen (%s). %s: Fehler: Debug-Schlssel %s ist unbekannt. %s: Fehler: Umgebungsvariable HOME nicht gesetzt. %s: Fehler: Keine Site namens `%s' gefunden - bergangen. %s: Fehler: Fr `%s' existiert noch keine Datei. %s: Verwenden Sie --init, --catchup oder --fetch um die Datei zu erstellen. %s: Fehler: Geben Sie nur EINEN Modus gleichzeitig an. %s: Fehler: Die Zugriffsrechte der rc-Datei erlauben anderen Benutzern lesenden Zugriff. %s: Fehler: Das Datenbank-Verzeichnis hat falsche Zugriffsrechte. %s: Fehler: ~/.netrc hat falsche Zugriffsrechte. %s: Fehler beim %s %s. %s: Holen der Datei-Liste von Site `%s' gescheitert: %s: %s %s: Holen der Datei-Liste zum Vergleich mit Site `%s' gescheitert: %s: %s %s: %s untersttzt keine Zugriffsrechte (Site `%s'). %s: Fr die Site `%s' ist ein ungltiger Port angegeben. %s: Fr die Site `%s' ist kein lokales Verzeichnis angegeben. %s: Keine Sites angegeben. %s: Keine gltigen Sites angegeben. %s: Nichts zu tun - keine nderungen vorgefunden. %s: Ich weigere mich, beim Abgleich (synchronize) alle lokalen Dateien zu lschen. %s: Um die Dateien hochzuladen steht --update (aktualisieren) zur Verfgung. %s: Fr die Site `%s' ist kein Verzeichnis auf dem Server angegeben. %s: Der sichere Modus kann nicht in Verbindung mit nooverwrite verwendet werden (Site `%s'). %s: Der sichere Modus kann nicht in Verbindung mit tempupload verwendet werden (Site `%s'). %s: Fr die Site `%s' ist kein Server angegeben. %s: Setzen Sie die Zugriffsrechte auf 0600. %s: Setzen Sie die Zugriffsrechte auf 0700. %s: berspringe Site `%s'. %s: Protokoll `%s' wird nicht untersttzt (Site `%s'). %s: Der Server ist bereits auf dem neuesten Stand. %s: Verzeichnis auf dem Server muss aktualisiert werden (%d Eintrge). %s: Verzeichnis auf dem Server muss aktualisiert werden (1 Eintrag). %s: Unvorhergesehener Fehler %d in Site `%s' - bitte wenden Sie sich an den Maintainer. %s: Der Vergleich hat %d auf dem Server fehlende Dateien gefunden. %s: Warnung: Konnte `%s' nicht als Logfile ffnen. %s: Warnung: An der Kommandozeile knnen nur %d Sites angegeben werden! Weitere Eintrge werden bergangen. %s: Legen Sie dieses Verzeichnis mit den Zugriffsrechten 0700 an. %s: Verbindung wegen Zeitberschreitung geschlossen.%s: Verbindung vom Server geschlossen.%s: unerlaubte Option -- %c %s: in act_on_site %s%s: in fe_can_update/file_file %s%s: in fe_can_update/file_link %s%s: in fe_updating/file_file %s%s: in fe_updating/file_link %s%s: in issue_error %s%s: init_paths gab %d zurck %s%s: ungltige Option -- %c %s: Option `%c%s' darf kein Argument haben %s: Option `%s' ist mehrdeutig %s: Option `%s' erfordert ein Argument %s: Option `--%s' darf kein Argument haben %s: Option `-W %s' darf kein Argument haben %s: Option `-W %s' ist mehrdeutig %s: Option erfordert ein Argument -- %c %s: rc-Datei in Zeile %d beschdigt: %s %s: unbekannte Option `%c%s' %s: unbekannte Option `--%s' (Voreinstellung) (nicht angegeben)* Diese Eintrge sind seit der letzten Aktualisierung dazugekommen: * Diese Eintrge wurden seit der letzten Aktualisierung gendert: * Diese Eintrge wurden seit der letzten Aktualisierung gelscht: * Diese Eintrge wurden gelscht, werden jedoch auf dem Server gelassen: * Diese Eintrge wurden seit der letzten Aktualisierung verschoben: ? (j/n) Auf dem Server hinzugefgtImmer beibehaltenAnmeldung wird bentigt fr %s auf %s `%s': Anmeldung wird bentigt auf %s `%s': Kennzeichnung als `aktualisiert'Verndere %sAuf dem Server verndertndere %s: Errechne Prfsumme von %s: [Konnte nicht auf Ressource zugreifenKonnte keine Prfsumme fr Datei errechnen.Verbindungsaufbau zum Proxy-Server gescheitert.Verbindungsaufbau zum Server gescheitert.Konnte Datei nicht untersuchen.Parser-Fehler bei Ermittlung der BlockgreLesefehler bei Ermittlung der BlockgreKonnte Rumpf der Antwort nicht lesenKonnte Status-Zeile des Servers nicht lesenKonnte keine Anfrage (request) schickenKonnte den Rumpf der Anfrage nicht schickenKonnte den Zeitstempel der lokalen Datei nicht ndern.Konnte nicht in diese Datei schreiben: %sErstelle %sLege %s/ anLege %s/ an: Lege %s an: Lsche %sLsche %s/Lsche %s/: Lsche %s: Verzeichnis: %s/ Lade %s herunter: [Fehler beim Lesen der Kopfzeilen (header) der AntwortHolenAuflsenHost nicht gefundenIgnorierenInitialisierungUngltige HTTP Status-Zeile im Status-Element in Zeile %d der Antwort: Status-Zeile war: %sZeile zu langLink: %s - zeigt auf %s BeibehaltenBei ausfhrbaren Dateien beibehaltenVerschiebe %s->%sVerschiebe %s->%s: Optionen: Passwort: Datei auf dem Server wurde gendert - berschreibe nicht mit lokalen nderungenEntferne %sKopfzeilen (header) der Antwort zu langErneuter Versuch: [Untersttzung fr SSL wurde beim Compilieren nicht aktiviert.Anzeigen der VernderungenSite: %s Server: %sAbgleichVerbindung wegen Zeitberschreitung abgebrochen.Der Server scheint kein WebDAV-Server zu sein.Der Server untersttzt das Zugriffsrecht `ausfhrbar' nicht.Konnte das Ziel des symbolischen Links nicht lesen.Mit `%s --help' erhalten Sie mehr Informationen. Unbekannter System-FehlerAktualisierenHochladen war erfolgreich, konnte aber Zeitstempel nicht abfragen. Stelle den `sicheren Modus' ab, wenn diese Meldung weiter auftritt.Lade %s hoch: [Aufruf: %s [OPTIONEN] [MODUS] [sitename]... Benutzername: Benutzername: %s VergleichSie sollten diesen Text nie zu Gesicht bekommen. Bitte wenden Sie sich an den Maintainer ] fertig. ] gescheitert: %s ^[nN]^[jJyY]als `aktualisiert' kennzeichnenVerzeichnis:fertig. gescheitert: %s HolenInitialisierender lokalen DatenProxy-Serverdes ServersServerAnzeigen der Vernderungen andes Datenbank-VerzeichnissesAbgleichenAktualisierenVergleichensitecopy-0.16.6/po/fr.gmo0000664000076400007640000002562011037462357013337 0ustar joejoev| 0 $" "G j + # =   !$ 3F z F F D( >m + / % &. 0U % . 1 d Er4+*:D$0& 14If'!!,5EbbG Sm!!7,Q~%,- &>"e5776An5   # -8 G U _j y     &&2Ynu)V  $* 0<AH Q^dk~  >L,2+_!./R _h'l=Ya=dC4HE}=>>@/C<u0gK 1Z D H ,!4G!|! !0!7!Z "+{"%"%""3 #`A#z#G$e$$#$#$!$!%$%<%Y%.t%%&%.%/&!H&'j&;&&&?'@N'>'C'>(Q(a( j(t($((((( ( (( ))-) A) K)W)l){) ) ))) ).)* +*7*2L**T** *** +++ +)+8+>+F+V+^+n+ +"Q(DOUL%kf2*Y?+4\S-#3roc1MdKAGgZH@:EtsC&T7[XnilIh =$aB_68Rb;F^.mjVu/ >pWeN ]5,<0)'vqJP9` ! Files will be moved remotely if moved locally. Passive mode FTP will not be used. Permissions: %s Symlinks: %s Protocol: %s Username: %s Remote directory: %s Local directory: %s Remote files will not be deleted. Changes to items in [brackets] are ignored during updates. Port: %d %s: %c%s site `%s' (on %s in %s) %s: %s cannot maintain symbolic links (site `%s'). %s: %s completed successfully. %s: All the files and and directories are marked as updated remotely. %s: All the files and directories are marked as NOT updated remotely. %s: Can only check for renamed files when checksumming (site `%s'). %s: Cannot use a relative remote directory in %s (site `%s'). %s: Could not read directory for `%s': %s %s: Error: Could not authorise user on server. %s: Error: Could not open rcfile: %s %s: Error: Could not open rcfile: %s. %s: Error: Could not open storage directory: %s %s: Error: Could not parse ~/.netrc. %s: Error: Environment variable HOME not set. %s: Error: No site called `%s' found - skipping. %s: Error: No storage file for `%s'. %s: Use --init, --catchup or --fetch to create a storage file. %s: Error: rcfile permissions allow other users to read your rcfile. %s: Error: storage directory permissions incorrect. %s: Error: ~/.netrc permissions incorrect. %s: Errors occurred while %s the %s site. %s: File permissions are not supported in %s (site `%s'). %s: Invalid port used in site `%s'. %s: Local directory not specified in site `%s'. %s: No sites specified. %s: No valid sites specified. %s: Nothing to do - no changes found. %s: Remote directory not specified in site `%s'. %s: Safe mode cannot be used in conjunction with tempupload (site `%s'). %s: Server not specified in site `%s'. %s: Set the permissions to 0600. %s: Set the permissions to 0700. %s: Skipping site `%s'. %s: The remote site does not need updating. %s: Unhandled error %d in site `%s' - please contact the maintainer. %s: Warning: Only %d sites can be specified on the command line! Extra entries are being skipped. %s: You need to create this directory and set the permissions to 0700. %s: illegal option -- %c %s: in act_on_site %s%s: in fe_can_update/file_file %s%s: in fe_can_update/file_link %s%s: in fe_updating/file_file %s%s: in fe_updating/file_link %s%s: in issue_error %s%s: init_paths gave %d %s%s: invalid option -- %c %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: rcfile corrupt at line %d: %s %s: unrecognized option `%c%s' %s: unrecognized option `--%s' * These items have been added since the last update: * These items have been changed since the last update: * These items have been deleted since the last update: * These items have been deleted, but will be left on the server: * These items have been moved since the last update: ? (y/n) Catch upChange %sChanging %s: Checksumming %s: [Create %sCreate %s/Creating %s/: Creating %s: Delete %sDelete %s/Deleting %s/: Deleting %s: Directory: %s/ Downloading %s: [FetchInitializeLink: %s - target %s Move %s->%sMoving %s->%s: Options: Remove %sShow changes toSite: %s Server: %sSynchronizeTry `%s --help' for more information. Unknown system errorUpdateUploading %s: [Usage: %s [OPTIONS] [MODE] [sitename]... VerifyYou should never see this message. Please contact the maintainer at sitecopy@lyra.org ] done. ] failed: %s ^[nN]^[yY]catching updir:done. fetchinginitializinglocalremoteshowing changes tostoredsynchronizingupdatingverifyingProject-Id-Version: sitecopy 0.9.3 Report-Msgid-Bugs-To: sitecopy@lyra.org POT-Creation-Date: 2008-07-16 16:31+0100 PO-Revision-Date: 2000-01-31 00:00+0100 Last-Translator: Sylvain Glaize Language-Team: fr MIME-Version: 1.0 Content-Type: text/plain; charset=latin-1 Content-Transfer-Encoding: 8bit Les fichiers seront dplacs distance s'ils ont t dplacs localement. Le FTP en mode passif ne sera pas utilis. Permissions: %s Liens symboliques: %s Protocol: %s Utilisateur: %s Rpertoire distant: %s Rpertoire local: %s Les fichiers distants ne seront pas dtruits. Les changements des objets entre [crochets] sont ignors durant la mise jour. Port: %d %s: %c%s le site `%s' (sur %s dans %s) %s: %s ne peut pas garder les liens symboliques (site `%s'). %s: %s. Succs. %s: tous les fichiers et rpertoires sont marqus comme mis jours sur le site distant. %s: tous les fichiers et les rpertoires sont marqus comme NON mis jours sur le site distant, %s: peut seulement vrifier les fichiers renomms lors du calcul de la somme de contrle (site %s). %s: Ne peut pas utiliser de rpertoire relatif sur %s (site `%s'). %s: Impossible de lire le rpertoire pour `%s': %s %s: erreur: impossible d'entrer sur le serveur avec cet utilisateur. %s: erreur: impossible d'ouvrir le fichier de ressources: %s %s: Erreur: impossible d'ouvrir le fichier de ressources: %s. %s: erreur: impossible d'ouvrir le fichier de mise jour: %s %s: erreur: impossible de comprendre ~/.netrc. %s: erreur: la variable d'environnement HOME n'est pas dtermine. %s: Erreur: Aucun site du nom de `%s' trouv - site ignor. %s: erreur: aucun fichier de mise jour pour `%s'. %s: utilisez --init, --catchup ou --fetch pour crer ce fichier. %s: erreur: les permissions sur votre fichier de ressources permet d'autres utilisateurs de le lire. %s: erreur: permissions du rpertoire du fichier de mise jour incorrect. %s: erreur: permissions de ~/.netrc incorrectes. %s: des erreurs ont eu lieu lors du traitement (%s) sur le site %s. %s: les permissions de fichier ne sont pas support sur %s (site `%s'). %s: port invalide utilis sur le site `%s'. %s: rpertoire local non spcifi sur le site `%s'. %s: Aucun site spcifi. %s: Aucun site valide spcifi. %s: rien faire - aucune modification trouve. %s: rpertoire distant non spcifie sur le site `%s'. %s: le mode scuris ne peut pas tre utilis avec la mise jour temporaire (site `%s'). %s: serveur non spcifi sur le site `%s'. %s: changez les permissions en 0600. %s: changez les permissions en 0700. %s: ignore le site `%s'. %s: le site distant n'a pas besoin de mise jour. %s: erreur non trait %d sur le site `%s' - contactez le responsable du projet s'il vous plait. %s: Attention: Seuls %d sites peuvent tre spcifis sur la ligne de commande! Les entres supplmentaires sont ignores. %s: vous devez crer ce rpertoire et changer ses permissions en 0700. %s: option illgale -- %c %s: dans act_on_site %s%s: dans fe_can_update/file_file %s%s: dans fe_can_update/file_link %s%s: dans fe_updating/file_file %s%s: dans fe_updating/file_link %s%s: dans issue_error %s%s: init_paths a donn %d %s%s: option invalide -- %c %s: l'option `%c%s' ne demande pas d'argument %s: l'option `%s' est ambigu %s: l'option `%s' demande un argument %s: l'option `--%s' ne demande pas d'argument %s: l'option `-W %s' ne demande pas d'argument %s: l'option `-W %s' est ambigu %s: l'option demande un argument -- %c %s: erreur dans le fichier de ressources la ligne %d: %s %s: option non reconnue `%c%s' %s: option non reconnue `--%s' * Ces entres ont t ajoutes depuis la dernire mise jour: * Ces entres ont t modifies depuis la dernire mise jour. * Ces objets ont t dtruits depuis la dernire mise jour: * Ces objets ont t dtruits, mais seront laisss sur le serveur: * Ces objets ont t dplacs depuis la dernire mise jour: ? (y=oui/n=non)RatraperChange %sChangement de %s: Calcul de la somme de contrle %s: [Cr %sCr %s/Cration de %s/: Cration de %s: Efface %sEfface %s/Effacement de %s/: Effacement de %s: Rpertoire: %s/ Chargement de %s: [RecuprerInitialiserLien: %s - cible %s Dplace %s->%sDplacement %s->%s: Options: Enlve %sMontrer les changements surSite: %s Serveur: %sSynchroniserEssayez `%s --help' pour plus d'informations. Erreur systme inconnueMise jourMise jour de %s: [Utilisation: %s [OPTIONS] [MODE] [nom du site]... VrifierVous ne devriez jamais voir ce message. Contactez sitecopy@lyra.org s'il vous plait ] fait. ] chou: %s [nN=non][yY=oui]ratrapagerp:fait. recuprationinitialisationlocaldistantchangements surarchivsynchronisationmise jour en coursvrificationsitecopy-0.16.6/po/nn.gmo0000664000076400007640000004323511037462357013345 0ustar joejoe,< X0Y$"+#=A!3F/FvD>+Am6|:/;5Z%&0e%t<3' .31bd6E04v+*7=::x$0 "&Aqh14 JAI'!! B2[,97E-/s4bXG$B\!r! &,@m%,- &- "T w  5 7!7>!Av!5!!!"+"$E"j" s"}" """"%"!#*#"F#i######$"$9$.U$$ $ $$ $ $ $$ $%%&%@%_%r%x%%% %V% %& &)& D&P& `& k&Bv& && &#& '' 1'='1W'9','&'(,(i3(()( ( ((V(N)]) f)t)z) ))) )) )) ))))) )* *l*<++&+!,/(,&X,9,,,,),,G-I-c-8->-W-SQ... .3.@/5W/;/5/*/1*00\0h0'0315R1)13151v242G253$F32k3K3>39)4.c4444#45q"5=535P6OW6,666#7:,7(g7-7/7S78B89{88pM9?99&:E:a: v: :::: ;$;0@;q;#;0;1; <"7<2Z<<< < <5<2=3K=6=3===>)>"E>h>w>> >> >#>(?")?L? l???,? ?+@<@S@q@@.@@ A AA&A5A >A HA UA bApAAAAAAAAATBWBfB ~B BBBB BJB,C5CIC#]CCC CC"C,C2!D*TDDDuDE&!E HEUEeEUnEE EEEEE FF F)F 0F:F @FLF[FaFsF yF F FmB%higcMzk Lq&?0+~y 4-T),!Nn{I/]<>97_Sl[ O*3w U|x1}KGCV(EH$dXD2@soWb;fvYF"6PRu A=5\'J:Z8jp^ t`eQa#.r Files will be moved remotely if moved locally. Passive mode FTP will not be used. Permissions: %s Symlinks: %s Protocol: %s Username: %s Remote directory: %s Local directory: %s Remote files will not be deleted. Changes to items in [brackets] are ignored during updates. Port: (ASCII)%d %s: %c%s site `%s' (on %s in %s) %s: %s %s: %s cannot maintain symbolic links (site `%s'). %s: %s completed successfully. %s: %s unsupported for %s. %s: All the files and and directories are marked as updated remotely. %s: All the files and directories are marked as NOT updated remotely. %s: Can only check for renamed files when checksumming (site `%s'). %s: Cannot use a relative remote directory in %s (site `%s'). %s: Could not read directory for `%s': %s %s: Error: %s %s: Error: Corrupt site storage file for `%s': %s: %s %s: Error: Could not authorise user on proxy server (%s). %s: Error: Could not authorise user on server. %s: Error: Could not connect to proxy server (%s port %d). %s: Error: Could not connect to server (%s port %d). %s: Error: Could not open rcfile: %s %s: Error: Could not open rcfile: %s. %s: Error: Could not open storage directory: %s %s: Error: Could not open storage file for writing (%s) %s: Error: %s %s: Will not update site `%s'. %s: Error: Could not parse ~/.netrc. %s: Error: Could not resolve hostname of proxy server (%s). %s: Error: Could not resolve remote hostname (%s). %s: Error: Debug channel %s not known. %s: Error: Environment variable HOME not set. %s: Error: No site called `%s' found - skipping. %s: Error: No storage file for `%s'. %s: Use --init, --catchup or --fetch to create a storage file. %s: Error: Only specify ONE operation mode at a time. %s: Error: rcfile permissions allow other users to read your rcfile. %s: Error: storage directory permissions incorrect. %s: Error: ~/.netrc permissions incorrect. %s: Errors occurred while %s the %s site. %s: Failed to fetch file listing for site `%s': %s: %s %s: Failed to fetch file listing to verify site `%s': %s: %s %s: File permissions are not supported in %s (site `%s'). %s: Invalid port used in site `%s'. %s: Local directory not specified in site `%s'. %s: No sites specified. %s: No valid sites specified. %s: Nothing to do - no changes found. %s: Refusing to delete all local files with a synchronize operation. %s: Use --update to update the remote site. %s: Remote directory not specified in site `%s'. %s: Remote site not synchronized with stored state. %s: Safe mode cannot be used in conjunction with nooverwrite (site `%s'). %s: Safe mode cannot be used in conjunction with tempupload (site `%s'). %s: Server not specified in site `%s'. %s: Set the permissions to 0600. %s: Set the permissions to 0700. %s: Skipping site `%s'. %s: The protocol `%s' is unsupported (site `%s'). %s: The remote site does not need updating. %s: The remote site needs updating (%d items to update). %s: The remote site needs updating (1 item to update). %s: Unhandled error %d in site `%s' - please contact the maintainer. %s: Verify found %d files missing from server. %s: Warning: Could not open `%s' to use as logfile. %s: Warning: Current state method differs from stored in site `%s'. %s: All existing files will appear changed (use catchup?). %s: Warning: Only %d sites can be specified on the command line! Extra entries are being skipped. %s: You need to create this directory and set the permissions to 0700. %s: connection timed out.%s: connection was closed by server.%s: illegal option -- %c %s: in act_on_site %s%s: in fe_can_update/file_file %s%s: in fe_can_update/file_link %s%s: in fe_updating/file_file %s%s: in fe_updating/file_link %s%s: in issue_error %s%s: init_paths gave %d %s%s: invalid option -- %c %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: rcfile corrupt at line %d: %s %s: unrecognized option `%c%s' %s: unrecognized option `--%s' (default) (unspecified)* These items have been added since the last update: * These items have been changed since the last update: * These items have been deleted since the last update: * These items have been deleted, but will be left on the server: * These items have been moved since the last update: ? (y/n) Added on serverAlways maintainedAuthentication required for %s on %s `%s': Authentication required on %s `%s': Catch upChange %sChanged on serverChanging %s: Checksumming %s: [Could not access resourceCould not checksum fileCould not connect passive data socketCould not connect to proxy serverCould not connect to serverCould not determine length of fileCould not examine file.Could not open fileCould not parse chunk sizeCould not read 'LIST' response.Could not read chunk sizeCould not read response bodyCould not read status lineCould not send requestCould not send request bodyCould not set modification time of local file.Could not write to file: %sCreate %sCreate %s/Creating %s/: Creating %s: Delete %sDelete %s/Deleting %s/: Deleting %s: Directory: %s/ Downloading %s: [Error closing data socketError reading response headersError sending fileFetchFollowedHost not foundIgnoredInitializeInvalid HTTP status line in status element at line %d of response: Status line was: %sLine too longLink: %s - target %s MaintainedMaintained for executablesMove %s->%sMoving %s->%s: Options: Password: Remote file has been modified - not overwriting with local changesRemove %sResponse header too longRetrying: [SSL support has not be compiled in.Show changes toSite: %s Server: %sSynchronizeThe connection timed out.The server does not appear to be a WebDAV server.The server does not support the executable live property.The target of the symlink could not be read.Try `%s --help' for more information. Unknown system errorUpdateUpload succeeded, but could not retrieve modification time. If this message persists, turn off safe mode.Uploading %s: [Usage: %s [OPTIONS] [MODE] [sitename]... Username: Username: %s VerifyYou should never see this message. Please contact the maintainer at sitecopy@lyra.org [invalid date]] done. ] failed: %s ^[nN]^[yY]catching updir:done. failed: %s fetchinginitializinglocalproxy serverremoteservershowing changes tostoredsynchronizingupdatingverifyingProject-Id-Version: sitecopy 0.11.4 Report-Msgid-Bugs-To: sitecopy@lyra.org POT-Creation-Date: 2008-07-16 16:31+0100 PO-Revision-Date: 2002-11-07 18:11+0100 Last-Translator: Karl Ove Hufthammer Language-Team: Norwegian Nynorsk MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Filer blir flytta på tenaren når dei blir flytta lokalt. Passiv FTP blir ikkje brukt. Løyve: %s Symbolske lenkjer: %s Protokoll: %s Brukarnamn: %s Fjerntliggande katalog: %s Lokal katalog: %s Filer på tenaren blir ikkje sletta. Endringar i [klammer] blir ignorert ved oppdateringar. Port: (ASCII)%d %s: %c%s nettstaden «%s» (på %s i %s) %s: %s %s: %s klarte ikkje oppretthelda symbolske lenkjer (nettstad: «%s»). %s: %singa var vellykka. %s: %s ikkje støtta for %s. %s: Alle filer og katalogar er markerte som oppdaterte. %s: Alle filer og katalogar er markerte som IKKJE oppdaterte. %s: Kan berre sjå etter filer med endra namn ved bruk av sjekksum (nettstad: «%s»). %s: Klarte ikkje bruka ein relativ fjerntliggande katalog i %s (nettstad: «%s»). %s: Klarte ikkje lesa katalog for «%s»: %s %s: Feil: %s %s: Feil: Øydelagd lagringsfil for «%s»: %s: %s %s: Feil: Klarte ikkje autentisera brukar på mellomtenar (%s). %s: Feil: Klarte ikkje autentisera brukar på tenar. %s: Feil: Klarte ikkje kopla til mellomtenar (%s port %d). %s: Feil: Klarte ikkje kopla til tenar (%s port %d). %s: Feil: Klate ikkje opna «rcfile»: %s %s: Feil: Klarte ikkje opna «rcfile»-fila: %s. %s: Feil: Klarte ikkje opna lagringskatalog: %s %s: Feil: Klarte ikkje opna lagringsfil (%s) %s: Feil: %s %s: Klarte ikkje oppdatera nettstaden «%s». %s: Feil: Klarte ikkje tolka ~/.netrc. %s: Feil: Fann ikkje adressa til mellomtenar (%s). %s: Feil: Fann ikkje adressa til nettverksvert (%s). %s: Feil: Avlusingskanalen %s er ukjend. %s: Feil: Miljøvariabelen «HOME» er ikkje sett. %s: Feil: Fann ikkje nettstaden «%s». Hoppar over. %s: Feil: Det finst inga lagringsfil for «%s». %s: Bruk --init, --catchup eller --fetch for å laga ei lagringsfil. %s: Feil: Vel berre éin operasjonsmodus om gongen. %s: Feil: «rcfile»-løyva gjer at andre kan lesa «rcfile»-fila di. %s: Feil: løyva sett for lagringskatalogen er feil. %s: Feil: feil løyve til ~/.netrc. %s: Det oppsto feil ved %s av den %se nettstaden. %s: Klarte ikkje henta fillista for å stadfesta nettstaden «%s»: %s: %s %s: Klarte ikkje henta fillista for nettstaden «%s»: %s: %s %s: Filløyver er ikkje støtta i %s (nettstad: «%s»). %s: Ugyldig port brukt for nettstaden «%s». %s: Lokal katalog ikkje valt for nettstaden «%s». %s: Ingen nettstader valt. %s: Ingen gyldige nettstader valt. %s: Fann ingen endringar. %s: Nektar å sletta alle filer med ein synkroniseringsoperasjon. %s: Bruk --update for å oppdatera nettstaden. %s: Fjerntliggande katalog ikkje valt for nettstaden «%s». %s: Fjerntliggande nettstad er ikkje synkronisert. %s: Sikkermodus kan ikkje brukast saman med «nooverwrite» (nettstad: «%s»). %s: Sikkermodus kan ikkje brukast saman med «tempupload» (nettstad: «%s»). %s: Ingen tenar valt for nettstaden «%s». %s: Set løyva til 0600. %s: Set løyva til 0700. %s: Hoppar over nettstaden «%s». %s: Støttar ikkje protokollen «%s» (nettstad: «%s»). %s: Nettstaden treng ikkje oppdaterast. %s: Nettstaden må oppdaterast (%d element). %s: Nettstaden må oppdaterast (eitt element). %s: Klarte ikkje handtera feil %d i nettstaden «%s» – kontakt vedlikehaldaren. %s: Stadfesting fann %d filer som manglar frå tenaren. %s: Åtvaring: Klarte ikkje opna «%s» for loggføring. %s: Åtvaring: Statusmetoden valt er forskjellig frå den lagra for nettstaden «%s». %s: Alle filer vil visast som endra (bruk «gjer oppdatert»?). %s: Åtvaring: Berre %d nettstader kan veljast frå kommandolinja! Resten av nettstadane blir ikkje oppdaterte. %s: Du må oppretta denne katalogen og setja løyvet til 0700. %s: sambandet vart tidsavbrote.%s: tilkoplinga vart lukka av tenaren.%s: valet -- %c er ulovleg %s: i act_on_site %s%s: i fe_can_update/file_file %s%s: i fe_can_update/file_link %s%s: i fe_updating/file_file %s%s: i fe_updating/file_link %s%s: i issue_error %s%s: init_paths gav %d %s%s: valet -- %c er ugyldig %s: valet «%c%s» kan ikkje innehelda argument %s: valet «%s» er tvetydig %s: valet «%s» krev eit argument %s: valet «--%s» kan ikkje innehelda argument %s: valet «-W %s» kan ikkje innehelda argument %s: valet «-W %s» er tvetydig %s: valet krev eit argument -- %c %s: «rcfile»-fila er øydelagt – linje %d: %s %s: valet «%c%s» er ukjent %s: valet «--%s» er ukjent (standard) (ikkje valt)– Følgjande er lagt til etter førre oppdatering: – Følgjande er endra etter førre oppdatering: – Følgjande er sletta etter førre oppdatering: – Følgjande er sletta, men ligg igjen på tenaren: – Følgjande er flytta etter førre oppdatering: ? (j/n)Lagt til på tenarenAlltid opprettheldtKrev autentisering for %s på %s «%s»: Krev autentisering på %s «%s»: Gjer oppdatertEndra %sEndra på tenarenEndrar %s: Reknar ut sjekksum til %s: [Fekk ikkje tilgang til ressursenKlarte ikkje laga sjekksum for filaKlarte ikkje kopla til passiv datasokkelKlarte ikkje kopla til mellomtenarKlarte ikkje kopla til tenaren.Klarte ikkje fastesetja fillengdKlarte ikkje gjennomlesa fila.Klarte ikkje opna filKlarte ikkje tolka storleik på oppdelt svarKlarte ikkje lesa «LIST»-svar.Klarte ikkje lesa storleik på oppdelt svarKlarte ikkje lesa svarKlarte ikkje lesa statuslinjaKlarte ikkje senda førespurnadKlarte ikkje senda førespurnadKlarte ikkje endra endringstida til lokal fil.Klarte ikkje skriva til fil: %sOpprett %sOpprett %s/Opprettar %s/:Opprettar %s: Slett %sSlett %s/Slettar %s/:Slettar %s: Katalog: %s/ Lastar ned %s: [Feil ved lukking av datasokkelFeil ved lesing av svarhovudFeil ved sending av filHentFølgtFann ikkje vertIgnorertInitierUgyldig HTTP-statuslinje i statuselement på linje %d av svaret: Statuslinja var: %sFor lang linjeLenkje: %s – mål %s OpprettheldtOpprettheldt for kjørbare filerFlytt %s til %sFlyttar %s til %s: Val: Passord: Fjerntliggande fil har blitt endra, og blir ikkje overskriven av lokal filFjern %sFor langt svarhovudPrøver på nytt: [SSL-støtte er ikkje kompilert inn.Vis endringar iNettstad: %s Tenar: %sSynkroniserSambandet vart tidsavbrote.Tenaren er ikkje ein WebDAV-tenar.Tenaren støttar ikkje kjørbar-eigenskapen.Klarte ikkje lesa målet til den symbolske lenkja.Prøv «%s --help» for meir informasjon. Ukjend systemfeilOppdaterOpplastinga var vellykka, men klarte ikkje henta endringstid. Slå av sikkermodus viss denne meldinga ikkje forsvinn.Lastar opp %s: [Bruk: %s [VAL] [MODUS] [nettstad] ... Brukarnamn: Brukarnamn: %s StadfestDu skal aldri sjå denne feilmeldinga. Kontakt vedlikehaldaren på sitecopy@lyra.org [ugyldig dato]] ferdig. ] mislykka: %s ^[nN]^[jJ]gjer oppdatertkatalog:ferdig. mislykka: %s hentarinitiererlokalmellomtenarfjerntliggandetenarviser endringar ilagrasynkronisereroppdatererStadfestarsitecopy-0.16.6/po/POTFILES.in0000664000076400007640000000252710404771356014001 0ustar joejoe./src/rcfile.c ./src/ftpdriver.c ./src/rshdriver.c ./src/vfsdriver.c ./src/console_fe.c ./src/sitestore.c ./src/nulldriver.c ./src/davdriver.c ./src/sitefiles.c ./src/sites.c ./src/common.c ./src/ftp.c ./src/lsparser.c ./src/sftpdriver.c ./gnome/init.c ./gnome/changes.c ./gnome/operations.c ./gnome/site_widgets.c ./gnome/gcommon.c ./gnome/tree.c ./gnome/file_widgets.c ./gnome/resynch.c ./gnome/new_site.c ./gnome/main.c ./gnome/minilist.c ./gnome/misc.c ./lib/neon/ne_redirect.c ./lib/neon/ne_gnutls.c ./lib/neon/ne_i18n.c ./lib/neon/ne_openssl.c ./lib/neon/ne_session.c ./lib/neon/ne_socket.c ./lib/neon/ne_request.c ./lib/neon/ne_alloc.c ./lib/neon/ne_stubssl.c ./lib/neon/ne_utils.c ./lib/neon/ne_xml.c ./lib/neon/ne_props.c ./lib/neon/ne_string.c ./lib/neon/ne_compress.c ./lib/neon/ne_xmlreq.c ./lib/neon/ne_basic.c ./lib/neon/ne_md5.c ./lib/neon/ne_sspi.c ./lib/neon/ne_uri.c ./lib/neon/ne_acl.c ./lib/neon/ne_dates.c ./lib/neon/ne_auth.c ./lib/neon/ne_207.c ./lib/neon/ne_locks.c ./lib/rpmatch.c ./lib/dirname.c ./lib/fnmatch.c ./lib/getopt.c ./lib/getopt1.c ./lib/strcasecmp.c ./lib/linelen.c ./lib/basename.c ./lib/netrc.c ./lib/yesno.c ./lib/expat/xmlparse/xmlparse.c ./lib/expat/xmlparse/hashtable.c ./lib/expat/gennmtab/gennmtab.c ./lib/expat/xmltok/xmltok_ns.c ./lib/expat/xmltok/xmltok.c ./lib/expat/xmltok/xmltok_impl.c ./lib/expat/xmltok/xmlrole.c sitecopy-0.16.6/po/ru.po0000664000076400007640000012542411037413774013214 0ustar joejoe# SOME DESCRIPTIVE TITLE. # Copyright (C) Michael Sobolev, 1999 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: sitecopy 0.11.5\n" "Report-Msgid-Bugs-To: sitecopy@lyra.org\n" "POT-Creation-Date: 2008-07-16 16:31+0100\n" "PO-Revision-Date: 2002-11-11 14:28+0000\n" "Last-Translator: Michael Sobolev \n" "Language-Team: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=koi8-r\n" "Content-Transfer-Encoding: 8bit\n" #: src/console_fe.c:119 msgid "Show changes to" msgstr "" #: src/console_fe.c:119 msgid "showing changes to" msgstr "" #: src/console_fe.c:119 src/console_fe.c:120 msgid "local" msgstr "" #: src/console_fe.c:120 msgid "Synchronize" msgstr "" #: src/console_fe.c:120 msgid "synchronizing" msgstr "" #: src/console_fe.c:125 msgid "Fetch" msgstr "" #: src/console_fe.c:125 msgid "fetching" msgstr "" #: src/console_fe.c:125 src/console_fe.c:126 src/console_fe.c:127 msgid "remote" msgstr "" #: src/console_fe.c:126 gnome/init.c:198 msgid "Update" msgstr "" #: src/console_fe.c:126 msgid "updating" msgstr "" #: src/console_fe.c:127 msgid "Verify" msgstr "" #: src/console_fe.c:127 msgid "verifying" msgstr "" #: src/console_fe.c:128 msgid "Catch up" msgstr "" #: src/console_fe.c:128 msgid "catching up" msgstr "" #: src/console_fe.c:128 src/console_fe.c:129 msgid "stored" msgstr "" #: src/console_fe.c:129 msgid "Initialize" msgstr "" #: src/console_fe.c:129 msgid "initializing" msgstr "" #: src/console_fe.c:134 msgid "" "You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n" msgstr "" #: src/console_fe.c:196 #, c-format msgid "%s: Error: No site called `%s' found - skipping.\n" msgstr "%s: : %s -- .\n" #: src/console_fe.c:214 #, c-format msgid "%s: No valid sites specified.\n" msgstr "" #: src/console_fe.c:216 #, c-format msgid "%s: No sites specified.\n" msgstr "" #: src/console_fe.c:218 src/console_fe.c:369 src/console_fe.c:529 #, c-format msgid "Try `%s --help' for more information.\n" msgstr " `%s --help' .\n" #: src/console_fe.c:228 #, c-format msgid "%s: %c%s site `%s' (on %s in %s)\n" msgstr "" #: src/console_fe.c:249 #, c-format msgid "* These items have been added since the last update:\n" msgstr "* :\n" #: src/console_fe.c:254 src/console_fe.c:285 #, c-format msgid "dir:" msgstr ":" #: src/console_fe.c:261 #, c-format msgid "* These items have been changed since the last update:\n" msgstr "* :\n" #: src/console_fe.c:263 #, c-format msgid " Changes to items in [brackets] are ignored during updates.\n" msgstr "" #: src/console_fe.c:277 #, c-format msgid "* These items have been deleted, but will be left on the server:\n" msgstr "" #: src/console_fe.c:279 #, c-format msgid "* These items have been deleted since the last update:\n" msgstr "* :\n" #: src/console_fe.c:292 #, c-format msgid "* These items have been moved since the last update:\n" msgstr "* :\n" #: src/console_fe.c:310 src/console_fe.c:322 msgid "Ignored" msgstr "" #: src/console_fe.c:312 msgid "Maintained for executables" msgstr "" #: src/console_fe.c:314 msgid "Always maintained" msgstr "" #: src/console_fe.c:324 msgid "Maintained" msgstr "" #: src/console_fe.c:326 msgid "Followed" msgstr "" #: src/console_fe.c:337 #, c-format msgid "" "Site: %s\n" "\tServer: %s" msgstr "" ": %s\n" "\t: %s" #: src/console_fe.c:339 #, c-format msgid " Port: " msgstr " : " #: src/console_fe.c:341 #, c-format msgid "(default)\n" msgstr "" #: src/console_fe.c:343 #, c-format msgid "%d\n" msgstr "%d\n" #: src/console_fe.c:345 #, c-format msgid "\tProtocol: %s Username: %s\n" msgstr "\t: %s : %s\n" #: src/console_fe.c:348 msgid "(unspecified)" msgstr "" #: src/console_fe.c:350 #, c-format msgid "\tPassive mode FTP will not be used.\n" msgstr "\t FTP .\n" #: src/console_fe.c:351 #, c-format msgid "" "\tRemote directory: %s\n" "\tLocal directory: %s\n" msgstr "" "\t : %s\n" "\t : %s\n" #: src/console_fe.c:353 #, c-format msgid "\tPermissions: %s Symlinks: %s\n" msgstr "\t : %s : %s\n" #: src/console_fe.c:356 #, c-format msgid "\tRemote files will not be deleted.\n" msgstr "" #: src/console_fe.c:358 #, c-format msgid "\tFiles will be moved remotely if moved locally.\n" msgstr "" #: src/console_fe.c:367 #, c-format msgid "%s: Error: Only specify ONE operation mode at a time.\n" msgstr "" #: src/console_fe.c:489 #, c-format msgid "%s: Error: Debug channel %s not known.\n" msgstr "" #: src/console_fe.c:497 #, fuzzy, c-format msgid "%s: Warning: Could not open `%s' to use as logfile.\n" msgstr "%s: : : %s.\n" #: src/console_fe.c:540 #, c-format msgid "%s: Error: Dry run mode is currently only supported for updates.\n" msgstr "" #: src/console_fe.c:556 #, c-format msgid "" "%s: Warning: Only %d sites can be specified on the command line!\n" "Extra entries are being skipped.\n" msgstr "" "%s: : %d !\n" " .\n" #: src/console_fe.c:581 msgid "WARNING: Server certificate is not trusted." msgstr "" #: src/console_fe.c:584 #, c-format msgid "Certificate was issued for server `%s'.\n" msgstr "" #: src/console_fe.c:586 msgid "WARNING: Certificate does not specify a server" msgstr "" #: src/console_fe.c:588 #, c-format msgid "Fingerprint: %s\n" msgstr "" #: src/console_fe.c:591 #, c-format msgid "Issued to: %s\n" msgstr "" #: src/console_fe.c:595 #, c-format msgid "Issued by: %s\n" msgstr "" #: src/console_fe.c:598 #, c-format msgid "Do you wish to accept this certificate? (y/n) " msgstr "" #: src/console_fe.c:607 msgid "server" msgstr "" #: src/console_fe.c:607 msgid "proxy server" msgstr "" #: src/console_fe.c:613 #, c-format msgid "Authentication required for %s on %s `%s':\n" msgstr "" #: src/console_fe.c:616 #, c-format msgid "Authentication required on %s `%s':\n" msgstr "" #: src/console_fe.c:619 msgid "Username: " msgstr "" #: src/console_fe.c:624 #, fuzzy, c-format msgid "Username: %s\n" msgstr "\t: %s : %s\n" #: src/console_fe.c:626 src/console_fe.c:650 msgid "Password: " msgstr "" #: src/console_fe.c:636 #, c-format msgid "Retrying: [" msgstr "" #: src/console_fe.c:647 #, c-format msgid "%s: Encrypted client certificate configured%s%s.\n" msgstr "" #: src/console_fe.c:682 #, c-format msgid "Create %s/" msgstr " %s/" #: src/console_fe.c:684 #, c-format msgid "Delete %s/" msgstr " %s/" #: src/console_fe.c:692 #, fuzzy, c-format msgid "Upload %s (%s bytes)" msgstr " %s" #: src/console_fe.c:694 #, c-format msgid "Delete %s" msgstr " %s" #: src/console_fe.c:695 #, c-format msgid "Move %s->%s" msgstr "" #: src/console_fe.c:699 #, c-format msgid "" "%s: in fe_can_update/file_file\n" "%s" msgstr "" #: src/console_fe.c:706 #, c-format msgid "Change %s" msgstr "" #: src/console_fe.c:707 #, c-format msgid "Create %s" msgstr "" #: src/console_fe.c:708 #, c-format msgid "Remove %s" msgstr "" #: src/console_fe.c:711 #, c-format msgid "" "%s: in fe_can_update/file_link\n" "%s" msgstr "" #: src/console_fe.c:717 #, c-format msgid "? (y/n) " msgstr "" #: src/console_fe.c:726 #, c-format msgid "Checksumming %s: [" msgstr "" #: src/console_fe.c:741 src/console_fe.c:852 src/console_fe.c:913 #, c-format msgid "] done.\n" msgstr "] .\n" #: src/console_fe.c:743 src/console_fe.c:915 #, c-format msgid "" "] failed:\n" "%s\n" msgstr "" "] :\n" "%s\n" #: src/console_fe.c:753 #, fuzzy, c-format msgid "Setting permissions on %s%s: " msgstr "%s: 0600.\n" #: src/console_fe.c:763 src/console_fe.c:841 src/console_fe.c:907 #, c-format msgid "done.\n" msgstr ".\n" #: src/console_fe.c:765 src/console_fe.c:909 #, c-format msgid "" "failed:\n" "%s\n" msgstr "" ":\n" "%s\n" #: src/console_fe.c:784 src/console_fe.c:871 #, c-format msgid "Creating %s/: " msgstr " %s/: " #: src/console_fe.c:786 src/console_fe.c:873 #, c-format msgid "Deleting %s/: " msgstr " %s/: " #: src/console_fe.c:793 #, c-format msgid "Uploading %s: [" msgstr " %s: [" #: src/console_fe.c:796 src/console_fe.c:815 src/console_fe.c:883 #, c-format msgid "Deleting %s: " msgstr " %s: " #: src/console_fe.c:799 src/console_fe.c:886 #, c-format msgid "Moving %s->%s: " msgstr " %s->%s: " #: src/console_fe.c:803 #, c-format msgid "" "%s: in fe_updating/file_file\n" "%s" msgstr "" #: src/console_fe.c:811 #, c-format msgid "Changing %s: " msgstr "" #: src/console_fe.c:813 #, c-format msgid "Creating %s: " msgstr "" #: src/console_fe.c:817 #, c-format msgid "" "%s: in fe_updating/file_link\n" "%s" msgstr "" #: src/console_fe.c:834 #, fuzzy, c-format msgid "Failed to update %s:%c%s\n" msgstr "" " %s:\n" "%s\n" #: src/console_fe.c:843 #, fuzzy, c-format msgid "failed:%c%s\n" msgstr "" ":\n" "%s\n" #: src/console_fe.c:855 #, fuzzy, c-format msgid "] failed:%c%s\n" msgstr "" "] :\n" "%s\n" #: src/console_fe.c:880 #, c-format msgid "Downloading %s: [" msgstr " %s: [" #: src/console_fe.c:925 msgid "Changed on server" msgstr "" #: src/console_fe.c:928 msgid "Added on server" msgstr "" #: src/console_fe.c:936 #, fuzzy, c-format msgid "%s: %s\n" msgstr "%s\n" #: src/console_fe.c:956 #, c-format msgid "Directory: %s/\n" msgstr ": %s/\n" #: src/console_fe.c:961 #, c-format msgid "File: %s - size %s%s\n" msgstr "" #: src/console_fe.c:963 msgid " (ASCII)" msgstr "" #: src/console_fe.c:966 #, c-format msgid "Link: %s - target %s\n" msgstr "" #: src/console_fe.c:979 gnome/init.c:402 #, c-format msgid "%s: Error: Could not open rcfile: %s.\n" msgstr "%s: : : %s.\n" #: src/console_fe.c:983 gnome/init.c:407 #, c-format msgid "" "%s: rcfile corrupt at line %d:\n" "%s\n" msgstr "" #: src/console_fe.c:1002 #, c-format msgid "" "%s: Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: `%s':\n" "\t%s\n" #: src/console_fe.c:1006 #, c-format msgid "%s: Server not specified in site `%s'.\n" msgstr "%s: `%s' Server.\n" #: src/console_fe.c:1010 #, c-format msgid "%s: Remote directory not specified in site `%s'.\n" msgstr "%s: `%s' Remote.\n" #: src/console_fe.c:1014 #, c-format msgid "%s: Local directory not specified in site `%s'.\n" msgstr "%s: `%s' Local.\n" #: src/console_fe.c:1018 #, c-format msgid "%s: Invalid port used in site `%s'.\n" msgstr "%s: `%s' Port.\n" #: src/console_fe.c:1022 #, c-format msgid "%s: %s cannot maintain symbolic links (site `%s').\n" msgstr "" #: src/console_fe.c:1026 #, c-format msgid "%s: Cannot use a relative remote directory in %s (site `%s').\n" msgstr "" #: src/console_fe.c:1029 #, c-format msgid "%s: File permissions are not supported in %s (site `%s').\n" msgstr "" #: src/console_fe.c:1032 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n" msgstr "" #: src/console_fe.c:1035 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n" msgstr "" #: src/console_fe.c:1038 #, c-format msgid "%s: Can only check for renamed files when checksumming (site `%s').\n" msgstr "" #: src/console_fe.c:1041 #, c-format msgid "%s: The protocol `%s' is unsupported (site `%s').\n" msgstr "" #: src/console_fe.c:1048 #, c-format msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" msgstr "" #: src/console_fe.c:1066 #, fuzzy, c-format msgid "" "%s: Error: Corrupt site storage file for `%s':\n" "%s: %s\n" msgstr "%s: : : %s\n" #: src/console_fe.c:1075 #, c-format msgid "" "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n" msgstr "" #: src/console_fe.c:1088 #, c-format msgid "%s: Skipping site `%s'.\n" msgstr "" #: src/console_fe.c:1103 #, c-format msgid "%s: %s completed successfully.\n" msgstr "" #: src/console_fe.c:1109 #, fuzzy, c-format msgid "%s: %s unsupported for %s.\n" msgstr "" "%s: %s.\n" #: src/console_fe.c:1114 #, c-format msgid "%s: Errors occurred while %s the %s site.\n" msgstr "" #: src/console_fe.c:1119 #, fuzzy, c-format msgid "%s: Error: Could not resolve remote hostname (%s).\n" msgstr "%s: : : %s.\n" #: src/console_fe.c:1125 #, fuzzy, c-format msgid "%s: Error: Could not resolve hostname of proxy server (%s).\n" msgstr "%s: : : %s\n" #: src/console_fe.c:1131 #, fuzzy, c-format msgid "%s: Error: Could not connect to proxy server (%s port %d).\n" msgstr "%s: : : %s\n" #: src/console_fe.c:1134 #, fuzzy, c-format msgid "%s: Error: Could not connect to server (%s port %d).\n" msgstr "%s: : : %s.\n" #: src/console_fe.c:1140 #, c-format msgid "%s: Error: Could not authorise user on server.\n" msgstr "" #: src/console_fe.c:1145 #, c-format msgid "%s: Error: %s\n" msgstr "" #: src/console_fe.c:1149 #, fuzzy, c-format msgid "%s: Error: Could not authorise user on proxy server (%s).\n" msgstr "%s: : : %s.\n" #: src/console_fe.c:1154 #, c-format msgid "" "%s: in issue_error\n" "%s" msgstr "" #: src/console_fe.c:1168 #, c-format msgid "%s: Error: Environment variable HOME not set.\n" msgstr "%s: : HOME.\n" #: src/console_fe.c:1176 #, c-format msgid "%s: Error: Could not open rcfile: %s\n" msgstr "%s: : : %s\n" #: src/console_fe.c:1179 #, c-format msgid "%s: Error: rcfile permissions allow other users to read your rcfile.\n" msgstr "" "%s: : " " .\n" #: src/console_fe.c:1180 src/console_fe.c:1192 #, c-format msgid "%s: Set the permissions to 0600.\n" msgstr "%s: 0600.\n" #: src/console_fe.c:1183 #, c-format msgid "%s: Error: Could not open storage directory: %s\n" msgstr "%s: : : %s\n" #: src/console_fe.c:1184 #, c-format msgid "" "%s: You need to create this directory and set the permissions to 0700.\n" msgstr "" "%s: " "0700.\n" #: src/console_fe.c:1187 #, c-format msgid "%s: Error: storage directory permissions incorrect.\n" msgstr "%s: : .\n" #: src/console_fe.c:1188 #, c-format msgid "%s: Set the permissions to 0700.\n" msgstr "%s: 0700.\n" #: src/console_fe.c:1191 #, c-format msgid "%s: Error: ~/.netrc permissions incorrect.\n" msgstr "%s: : ~/.netrc .\n" #: src/console_fe.c:1197 #, c-format msgid "" "%s: init_paths gave %d\n" "%s" msgstr "" #: src/console_fe.c:1204 #, c-format msgid "%s: Error: Could not parse ~/.netrc.\n" msgstr "%s: : ~/.netrc.\n" #: src/console_fe.c:1222 src/console_fe.c:1321 #, c-format msgid "%s: Nothing to do - no changes found.\n" msgstr "%s: -- .\n" #: src/console_fe.c:1231 #, c-format msgid "" "%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n" msgstr "" #: src/console_fe.c:1255 #, c-format msgid "" "%s: Warning: Current state method differs from stored in site `%s'.\n" "%s: All existing files will appear changed (use catchup?).\n" msgstr "" #: src/console_fe.c:1261 #, fuzzy, c-format msgid "%s: The remote site needs updating (%d items to update).\n" msgstr "%s: .\n" #: src/console_fe.c:1263 #, fuzzy, c-format msgid "%s: The remote site needs updating (1 item to update).\n" msgstr "%s: .\n" #: src/console_fe.c:1266 #, c-format msgid "%s: The remote site does not need updating.\n" msgstr "%s: .\n" #: src/console_fe.c:1274 #, c-format msgid "%s: All the files and directories are marked as NOT updated remotely.\n" msgstr "" #: src/console_fe.c:1279 #, c-format msgid "%s: All the files and and directories are marked as updated remotely.\n" msgstr "" #: src/console_fe.c:1288 #, fuzzy, c-format msgid "" "%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n" msgstr "%s: .\n" #: src/console_fe.c:1302 #, fuzzy, c-format msgid "" "%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n" msgstr "%s: .\n" #: src/console_fe.c:1309 #, c-format msgid "%s: Verify found %d files missing from server.\n" msgstr "" #: src/console_fe.c:1312 #, fuzzy, c-format msgid "%s: Remote site not synchronized with stored state.\n" msgstr "%s: `%s' Remote.\n" #: src/console_fe.c:1325 #, c-format msgid "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" msgstr "" #: src/console_fe.c:1333 #, c-format msgid "" "%s: in act_on_site\n" "%s" msgstr "" #: src/console_fe.c:1344 #, c-format msgid "Usage: %s [OPTIONS] [MODE] [sitename]...\n" msgstr ": %s [] [] [sitename]...\n" #: src/console_fe.c:1346 #, c-format msgid "Options: \n" msgstr ": \n" #: src/console_fe.c:1349 #, c-format msgid "" " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" msgstr "" #: src/console_fe.c:1356 #, c-format msgid "" " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites " "(default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote " "state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n" msgstr "" #: src/sitestore.c:326 #, c-format msgid "Invalid checksum at line %d" msgstr "" #: src/sitestore.c:371 #, c-format msgid "Boolean missing in 'ascii' at line %d" msgstr "" #: src/sitestore.c:396 #, c-format msgid "Size overflow (%s) in '%s' at line %d" msgstr "" #: src/davdriver.c:195 msgid "The connection timed out." msgstr "" #: src/davdriver.c:224 #, fuzzy msgid "Could not write SSL certificate" msgstr "%s: : : %s\n" #: src/davdriver.c:244 msgid "SSL support has not be compiled in." msgstr "" #: src/davdriver.c:252 #, fuzzy, c-format msgid "Could not load certificate `%s'." msgstr "%s: : : %s\n" #: src/davdriver.c:290 #, fuzzy, c-format msgid "Could not read SSL client certificate '%s'." msgstr "%s: : : %s\n" #: src/davdriver.c:303 #, fuzzy, c-format msgid "Could not decrypt SSL client certificate '%s'." msgstr "%s: : : %s\n" #: src/davdriver.c:325 msgid "The server does not appear to be a WebDAV server." msgstr "" #: src/davdriver.c:330 msgid "The server does not support the executable live property." msgstr "" #: src/davdriver.c:376 src/davdriver.c:443 src/davdriver.c:480 src/ftp.c:888 #: src/ftp.c:972 #, fuzzy msgid "Could not open file" msgstr "%s: : : %s\n" #: src/davdriver.c:411 #, fuzzy, c-format msgid "Could not stat file: %s" msgstr "%s: : : %s\n" #: src/davdriver.c:670 msgid "Could not access resource" msgstr "" #: src/sites.c:160 msgid "Could not set modification time of local file." msgstr "" #: src/sites.c:308 msgid "" "Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode." msgstr "" #: src/sites.c:515 msgid "Remote file has been modified - not overwriting with local changes" msgstr "" #: src/sites.c:828 msgid "Could not examine file." msgstr "" #: src/sites.c:871 msgid "Could not checksum file" msgstr "" #: src/sites.c:887 msgid "The target of the symlink could not be read." msgstr "" #: src/common.c:113 msgid "Unknown system error" msgstr " " #: src/ftp.c:153 #, c-format msgid "%s: connection was closed by server." msgstr "" #: src/ftp.c:157 #, c-format msgid "%s: connection timed out." msgstr "" #: src/ftp.c:195 #, fuzzy msgid "Could not read response line" msgstr "%s: : : %s\n" #: src/ftp.c:229 #, fuzzy msgid "Cannot parse MDTM response; wrong length." msgstr "%s: : : %s\n" #: src/ftp.c:236 #, fuzzy msgid "Cannot parse MDTM response." msgstr "%s: : : %s\n" #: src/ftp.c:260 #, fuzzy msgid "Could not find address in PASV response" msgstr "%s: : : %s\n" #: src/ftp.c:267 #, fuzzy msgid "Could not parse PASV response" msgstr "%s: : : %s\n" #: src/ftp.c:276 msgid "Invalid IP address in PASV response" msgstr "" #: src/ftp.c:296 #, fuzzy msgid "Malformed EPSV response" msgstr "%s: : : %s\n" #: src/ftp.c:304 #, fuzzy msgid "Malformed port in EPSV response" msgstr "%s: : : %s\n" #: src/ftp.c:449 msgid "Error sending file" msgstr "" #: src/ftp.c:463 src/ftp.c:489 msgid "Error reading file" msgstr "" #: src/ftp.c:480 #, fuzzy msgid "Could not send file" msgstr "%s: : : %s\n" #: src/ftp.c:510 src/ftp.c:991 msgid "Error writing to file" msgstr "" #: src/ftp.c:516 msgid "Receiving file" msgstr "" #: src/ftp.c:532 #, fuzzy msgid "Could not connect passive data socket" msgstr "%s: : : %s\n" #: src/ftp.c:647 msgid "Active open failed: could not determine address of control socket" msgstr "" #: src/ftp.c:659 #, fuzzy msgid "Active open failed: could not create socket" msgstr "%s: : : %s\n" #: src/ftp.c:667 msgid "Active open failed: could not bind to address" msgstr "" #: src/ftp.c:677 msgid "Active open failed: could not determine address of data socket" msgstr "" #: src/ftp.c:684 #, fuzzy msgid "Could not determine bound port number for data socket" msgstr "%s: : : %s\n" #: src/ftp.c:727 msgid "Active open failed: could not accept connection" msgstr "" #: src/ftp.c:800 msgid "Error closing data socket" msgstr "" #: src/ftp.c:894 #, fuzzy msgid "Could not determine length of file" msgstr "%s: : : %s\n" #: src/ftp.c:905 #, fuzzy msgid "Could not rewind to beginning of file" msgstr "%s: : : %s\n" #: src/ftp.c:1152 #, fuzzy msgid "Could not read 'LIST' response." msgstr "%s: : : %s\n" #: src/ftp.c:1161 #, fuzzy, c-format msgid "Parse error in LIST response: %s" msgstr "%s: : : %s\n" #: gnome/init.c:51 msgid "_New site..." msgstr "" #: gnome/init.c:51 gnome/init.c:171 msgid "Create a new site definition" msgstr "" #: gnome/init.c:54 msgid "_Open..." msgstr "" #: gnome/init.c:54 msgid "Open a new rc file. (EXPERIMENTAL)." msgstr "" #: gnome/init.c:57 msgid "_Save Sites" msgstr "" #: gnome/init.c:57 gnome/init.c:177 msgid "Save the current site definitions" msgstr "" #: gnome/init.c:60 msgid "Sav_e Sites As..." msgstr "" #: gnome/init.c:60 msgid "Save the current site definitions to a file." msgstr "" #: gnome/init.c:63 #, fuzzy msgid "_Delete this site" msgstr " %s" #: gnome/init.c:63 msgid "Delete the selected site entry" msgstr "" #: gnome/init.c:69 msgid "E_xit" msgstr "" #: gnome/init.c:69 gnome/init.c:202 msgid "Exit the program" msgstr "" #: gnome/init.c:78 msgid "_Initialise site" msgstr "" #: gnome/init.c:78 msgid "All files will be uploaded if a site is initialised" msgstr "" #: gnome/init.c:81 msgid "'_Catchup' site" msgstr "" #: gnome/init.c:81 msgid "Records the site as already updated." msgstr "" #: gnome/init.c:84 msgid "_Fetch site listing" msgstr "" #: gnome/init.c:84 msgid "Figures out which files are new/changed from the actual remote site." msgstr "" #: gnome/init.c:88 msgid "_Resynchronize site" msgstr "" #: gnome/init.c:88 msgid "Copies newer files from the remote site to the local drive." msgstr "" #: gnome/init.c:91 msgid "_Update site..." msgstr "" #: gnome/init.c:91 msgid "Apply the local site's changes to the remote site." msgstr "" #: gnome/init.c:94 msgid "Update _ALL sites" msgstr "" #: gnome/init.c:94 gnome/init.c:137 msgid "Performs the required operations on all site definitions. (TODO)." msgstr "" #: gnome/init.c:98 msgid "Rescan local directory" msgstr "" #: gnome/init.c:98 #, fuzzy msgid "Re-reads the local directory of the selected site." msgstr "%s: `%s' Local.\n" #: gnome/init.c:106 msgid "_Required updates" msgstr "" #: gnome/init.c:106 msgid "Displays a brief report of any required updates." msgstr "" #: gnome/init.c:109 msgid "Site web-r_eport" msgstr "" #: gnome/init.c:109 msgid "" "Generates a web page detailing the changes required on the selected site." msgstr "" #: gnome/init.c:112 msgid "Prin_t site info..." msgstr "" #: gnome/init.c:112 msgid "Print information about the selected site" msgstr "" #: gnome/init.c:119 msgid "_Backup files status" msgstr "" #: gnome/init.c:119 msgid "Save the 'state' of your local files, in case of accident." msgstr "" #: gnome/init.c:122 msgid "Restore files status..." msgstr "" #: gnome/init.c:122 gnome/init.c:129 msgid "If a backup has previously been made, it will be restored." msgstr "" #: gnome/init.c:126 msgid "_Backup site definitions" msgstr "" #: gnome/init.c:126 msgid "Backup your site definitions, in case you delete your sites." msgstr "" #: gnome/init.c:129 msgid "Restore site definitions..." msgstr "" #: gnome/init.c:137 msgid "Preferences..." msgstr "" #: gnome/init.c:146 msgid "_About XSitecopy" msgstr "" #: gnome/init.c:146 msgid "Information about XSitecopy" msgstr "" #: gnome/init.c:158 msgid "_File" msgstr "" #: gnome/init.c:159 #, fuzzy msgid "_Operations" msgstr ": \n" #: gnome/init.c:160 msgid "_Reports" msgstr "" #: gnome/init.c:161 msgid "_Settings" msgstr "" #: gnome/init.c:162 msgid "_Backup" msgstr "" #: gnome/init.c:163 msgid "_Help" msgstr "" #: gnome/init.c:171 msgid "New site" msgstr "" #: gnome/init.c:174 msgid "Open" msgstr "" #: gnome/init.c:174 msgid "Open a new site definitions file." msgstr "" #: gnome/init.c:177 msgid "Save" msgstr "" #: gnome/init.c:180 #, fuzzy msgid "Delete site" msgstr " %s" #: gnome/init.c:180 msgid "Delete the selected site" msgstr "" #: gnome/init.c:185 msgid "Initialise" msgstr "" #: gnome/init.c:185 msgid "Initialise the site (mark all files as needing to be updated)." msgstr "" #: gnome/init.c:188 msgid "Catch-up" msgstr "" #: gnome/init.c:188 msgid "Mark all of the selected site's files as updated." msgstr "" #: gnome/init.c:194 #, fuzzy msgid "Download" msgstr " %s: [" #: gnome/init.c:194 msgid "Download newer files from the remote site. (Use with care)" msgstr "" #: gnome/init.c:198 msgid "Updates the selected site" msgstr "" #: gnome/init.c:202 msgid "Quit" msgstr "" #: gnome/init.c:412 #, fuzzy, c-format msgid "%s: Error: Could not read rcfile: %s.\n" msgstr "%s: : : %s.\n" #: gnome/main.c:184 msgid "" "Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" msgstr "" #: gnome/misc.c:580 #, fuzzy, c-format msgid "Server not specified in site `%s'.\n" msgstr "%s: `%s' Server.\n" #: gnome/misc.c:584 #, fuzzy, c-format msgid "Remote directory not specified in site `%s'.\n" msgstr "%s: `%s' Remote.\n" #: gnome/misc.c:588 #, fuzzy, c-format msgid "Local directory not specified in site `%s'.\n" msgstr "%s: `%s' Local.\n" #: gnome/misc.c:592 #, fuzzy, c-format msgid "" "Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: `%s':\n" "\t%s\n" #: gnome/misc.c:596 #, fuzzy, c-format msgid "Invalid port used in site `%s'.\n" msgstr "%s: `%s' Port.\n" #: gnome/misc.c:600 #, c-format msgid "Protocol '%s' cannot maintain symbolic links (site `%s').\n" msgstr "" #: gnome/misc.c:604 #, c-format msgid "Cannot use a relative remote directory protocol '%s' (site `%s').\n" msgstr "" #: gnome/misc.c:607 #, c-format msgid "%s's protocol does not currently support maintaining permissions." msgstr "" #: gnome/misc.c:611 #, fuzzy, c-format msgid "Could not find 'relative' local directory" msgstr "%s: : : %s\n" #: lib/neon/ne_redirect.c:92 #, fuzzy msgid "Could not parse redirect destination URL" msgstr "%s: : : %s\n" #: lib/neon/ne_gnutls.c:162 #, c-format msgid "[unprintable:#%lu]" msgstr "" #: lib/neon/ne_gnutls.c:188 msgid "[unprintable]" msgstr "" #: lib/neon/ne_gnutls.c:696 lib/neon/ne_openssl.c:419 msgid "Server certificate was missing commonName attribute in subject name" msgstr "" #: lib/neon/ne_gnutls.c:736 lib/neon/ne_openssl.c:638 #, fuzzy, c-format msgid "SSL negotiation failed: %s" msgstr "%s: : : %s\n" #: lib/neon/ne_gnutls.c:745 msgid "Server did not send certificate chain" msgstr "" #: lib/neon/ne_openssl.c:451 #, c-format msgid "Certificate verification error: %s" msgstr "" #: lib/neon/ne_openssl.c:657 msgid "SSL server did not present certificate" msgstr "" #: lib/neon/ne_openssl.c:666 msgid "Server certificate changed: connection intercepted?" msgstr "" #: lib/neon/ne_session.c:356 lib/neon/ne_session.c:367 msgid "[invalid date]" msgstr "" #: lib/neon/ne_session.c:380 msgid "certificate is not yet valid" msgstr "" #: lib/neon/ne_session.c:381 msgid "certificate has expired" msgstr "" #: lib/neon/ne_session.c:382 msgid "certificate issued for a different hostname" msgstr "" #: lib/neon/ne_session.c:383 msgid "issuer is not trusted" msgstr "" #: lib/neon/ne_session.c:388 msgid "Server certificate verification failed: " msgstr "" #: lib/neon/ne_socket.c:514 lib/neon/ne_socket.c:568 lib/neon/ne_socket.c:671 msgid "Connection closed" msgstr "" #: lib/neon/ne_socket.c:578 lib/neon/ne_socket.c:683 msgid "Secure connection truncated" msgstr "" #: lib/neon/ne_socket.c:590 lib/neon/ne_socket.c:695 #, c-format msgid "SSL error: %s" msgstr "" #: lib/neon/ne_socket.c:593 #, c-format msgid "SSL error code %d/%d/%lu" msgstr "" #: lib/neon/ne_socket.c:676 #, c-format msgid "SSL alert received: %s" msgstr "" #: lib/neon/ne_socket.c:691 msgid "SSL socket read failed" msgstr "" #: lib/neon/ne_socket.c:790 msgid "Line too long" msgstr "" #: lib/neon/ne_socket.c:935 lib/neon/ne_socket.c:941 msgid "Host not found" msgstr "" #: lib/neon/ne_socket.c:1048 msgid "Connection timed out" msgstr "" #: lib/neon/ne_socket.c:1210 msgid "Socket descriptor number exceeds FD_SETSIZE" msgstr "" #: lib/neon/ne_socket.c:1270 msgid "Socket family not supported" msgstr "" #: lib/neon/ne_socket.c:1493 msgid "Client certificate verification failed" msgstr "" #: lib/neon/ne_socket.c:1509 msgid "SSL disabled due to lack of entropy" msgstr "" #: lib/neon/ne_socket.c:1516 msgid "SSL disabled due to library version mismatch" msgstr "" #: lib/neon/ne_socket.c:1522 msgid "Could not create SSL structure" msgstr "" #: lib/neon/ne_request.c:194 #, c-format msgid "%s: connection was closed by proxy server" msgstr "" #: lib/neon/ne_request.c:197 #, c-format msgid "%s: connection was closed by server" msgstr "" #: lib/neon/ne_request.c:202 #, c-format msgid "%s: connection timed out" msgstr "" #: lib/neon/ne_request.c:307 msgid "offset invalid" msgstr "" #: lib/neon/ne_request.c:312 #, fuzzy, c-format msgid "Could not seek to offset %s of request body file: %s" msgstr "%s: : : %s\n" #: lib/neon/ne_request.c:360 msgid "Could not send request body" msgstr "" #: lib/neon/ne_request.c:699 msgid "Could not read chunk size" msgstr "" #: lib/neon/ne_request.c:706 #, fuzzy msgid "Could not parse chunk size" msgstr "%s: : : %s\n" #: lib/neon/ne_request.c:743 msgid "Could not read response body" msgstr "" #: lib/neon/ne_request.c:759 #, fuzzy msgid "Could not read chunk delimiter" msgstr "%s: : : %s\n" #: lib/neon/ne_request.c:762 msgid "Chunk delimiter was invalid" msgstr "" #: lib/neon/ne_request.c:868 msgid "Could not read status line" msgstr "" #: lib/neon/ne_request.c:890 #, fuzzy msgid "Could not parse response status line" msgstr "%s: : : %s\n" #: lib/neon/ne_request.c:902 #, fuzzy msgid "Could not read interim response headers" msgstr "%s: : : %s\n" #: lib/neon/ne_request.c:936 msgid "Could not send request" msgstr "" #: lib/neon/ne_request.c:984 lib/neon/ne_request.c:1002 #: lib/neon/ne_request.c:1012 msgid "Error reading response headers" msgstr "" #: lib/neon/ne_request.c:1030 msgid "Response header too long" msgstr "" #: lib/neon/ne_request.c:1112 msgid "Response exceeded maximum number of header fields" msgstr "" #: lib/neon/ne_request.c:1129 #, fuzzy, c-format msgid "Could not resolve hostname `%s': %s" msgstr "%s: : : %s.\n" #: lib/neon/ne_request.c:1260 msgid "Unknown transfer-coding in response" msgstr "" #: lib/neon/ne_request.c:1271 msgid "Invalid Content-Length in response" msgstr "" #: lib/neon/ne_request.c:1344 #, fuzzy, c-format msgid "Could not write to file: %s" msgstr "%s: : : %s\n" #: lib/neon/ne_request.c:1417 #, fuzzy, c-format msgid "Could not create SSL connection through proxy server: %s" msgstr "%s: : : %s\n" #: lib/neon/ne_request.c:1464 #, fuzzy msgid "Could not create socket" msgstr "%s: : : %s\n" #: lib/neon/ne_request.c:1526 msgid "Could not connect to proxy server" msgstr "" #: lib/neon/ne_request.c:1527 msgid "Could not connect to server" msgstr "" #: lib/neon/ne_xml.c:280 #, c-format msgid "XML parse error at line %d: invalid element name" msgstr "" #: lib/neon/ne_xml.c:452 #, fuzzy msgid "Unknown error" msgstr " " #: lib/neon/ne_xml.c:537 msgid "Invalid Byte Order Mark" msgstr "" #: lib/neon/ne_xml.c:625 #, c-format msgid "XML parse error at line %d: %s" msgstr "" #: lib/neon/ne_props.c:371 lib/neon/ne_props.c:435 msgid "Response exceeds maximum property count" msgstr "" #: lib/neon/ne_compress.c:184 #, c-format msgid "%s: %s (code %d)" msgstr "" #: lib/neon/ne_compress.c:232 #, fuzzy msgid "Could not inflate data" msgstr "%s: : : %s\n" #: lib/neon/ne_compress.c:293 #, fuzzy msgid "Could not initialize zlib" msgstr "%s: : : %s\n" #: lib/neon/ne_xmlreq.c:36 #, fuzzy, c-format msgid "Could not parse response: %s" msgstr "%s: : : %s\n" #: lib/neon/ne_basic.c:98 #, fuzzy, c-format msgid "Could not determine file size: %s" msgstr "%s: : : %s\n" #: lib/neon/ne_basic.c:149 msgid "Response did not include requested range" msgstr "" #: lib/neon/ne_basic.c:183 msgid "Range is not satisfiable" msgstr "" #: lib/neon/ne_basic.c:188 msgid "Resource does not support ranged GET requests" msgstr "" #: lib/neon/ne_auth.c:130 #, fuzzy, c-format msgid "Could not authenticate to server: %s" msgstr "%s: : : %s\n" #: lib/neon/ne_auth.c:135 #, fuzzy, c-format msgid "Could not authenticate to proxy server: %s" msgstr "%s: : : %s.\n" #: lib/neon/ne_auth.c:358 #, c-format msgid "rejected %s challenge" msgstr "" #: lib/neon/ne_auth.c:374 msgid "missing realm in Basic challenge" msgstr "" #: lib/neon/ne_auth.c:469 msgid "invalid Negotiate token" msgstr "" #: lib/neon/ne_auth.c:492 msgid "GSSAPI authentication error: " msgstr "" #: lib/neon/ne_auth.c:505 #, c-format msgid "GSSAPI failure (code %u)" msgstr "" #: lib/neon/ne_auth.c:540 msgid "ignoring empty Negotiate continuation" msgstr "" #: lib/neon/ne_auth.c:555 msgid "Negotiate response verification failed: invalid response header token" msgstr "" #: lib/neon/ne_auth.c:577 #, c-format msgid "Negotiate response verification failure: %s" msgstr "" #: lib/neon/ne_auth.c:697 msgid "unknown algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:701 msgid "incompatible algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:705 msgid "missing parameter in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:709 msgid "initial Digest challenge was stale" msgstr "" #: lib/neon/ne_auth.c:716 msgid "stale Digest challenge with new algorithm or realm" msgstr "" #: lib/neon/ne_auth.c:728 #, fuzzy msgid "could not parse domain in Digest challenge" msgstr "%s: : : %s\n" #: lib/neon/ne_auth.c:1036 msgid "Digest mutual authentication failure: missing parameters" msgstr "" #: lib/neon/ne_auth.c:1041 msgid "Digest mutual authentication failure: client nonce mismatch" msgstr "" #: lib/neon/ne_auth.c:1051 msgid "Digest mutual authentication failure: could not parse nonce count" msgstr "" #: lib/neon/ne_auth.c:1056 #, c-format msgid "Digest mutual authentication failure: nonce count mismatch (%u not %u)" msgstr "" #: lib/neon/ne_auth.c:1099 msgid "Digest mutual authentication failure: request-digest mismatch" msgstr "" #: lib/neon/ne_auth.c:1225 #, c-format msgid "ignored %s challenge" msgstr "" #: lib/neon/ne_auth.c:1304 #, fuzzy msgid "could not parse challenge" msgstr "%s: : : %s\n" #: lib/neon/ne_207.c:198 #, c-format msgid "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" msgstr "" #: lib/neon/ne_locks.c:584 msgid "LOCK response missing Lock-Token header" msgstr "" #: lib/neon/ne_locks.c:759 #, c-format msgid "Response missing activelock for %s" msgstr "" #: lib/neon/ne_locks.c:801 #, c-format msgid "No activelock for <%s> returned in LOCK refresh response" msgstr "" #: lib/rpmatch.c:79 msgid "^[yY]" msgstr "" #: lib/rpmatch.c:82 msgid "^[nN]" msgstr "" #: lib/getopt.c:664 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: `%s'\n" #: lib/getopt.c:688 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: `--%s' \n" #: lib/getopt.c:693 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: `%c%s' \n" #: lib/getopt.c:710 lib/getopt.c:883 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: `%s' \n" #: lib/getopt.c:739 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: `--%s'\n" #: lib/getopt.c:743 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: `%c%s'\n" #: lib/getopt.c:769 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: -- %c\n" #: lib/getopt.c:772 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: -- %c\n" #: lib/getopt.c:802 lib/getopt.c:932 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: -- %c\n" #: lib/getopt.c:849 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: `-W %s'\n" #: lib/getopt.c:867 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: `-W %s' \n" #~ msgid "%s\n" #~ msgstr "%s\n" #, fuzzy #~ msgid "%s: %s" #~ msgstr "%s\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal: %s (%d)\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: : %s (%d)\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal %d\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: %d\n" #~ msgid "%s: Terminating.\n" #~ msgstr "%s: .\n" #, fuzzy #~ msgid " of request body file: %s" #~ msgstr "%s: : : %s\n" #, fuzzy #~ msgid "unknown error code" #~ msgstr " " #, fuzzy #~ msgid "Deleted Items" #~ msgstr " %s" #, fuzzy #~ msgid "%s: Aborting update... completing current operation...\n" #~ msgstr "" #~ "%s: , ... " #~ msgid "%s: Username not specified in site `%s'.\n" #~ msgstr "%s: `%s' Username.\n" #~ msgid "%s: Password not specified in site `%s'.\n" #~ msgstr "%s: `%s' Password.\n" #, fuzzy #~ msgid "%s: The remote site needs updating (1 thing to update).\n" #~ msgstr "%s: .\n" #~ msgid "%s: Argh, unhandled error.\n" #~ msgstr "%s: .\n" sitecopy-0.16.6/po/ja.po0000664000076400007640000013510111037413774013151 0ustar joejoe# The Japanese translation for sitecopy # Nobuyuki Tsuchimura , 2000. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: sitecopy 0.10.14\n" "Report-Msgid-Bugs-To: sitecopy@lyra.org\n" "POT-Creation-Date: 2008-07-16 16:31+0100\n" "PO-Revision-Date: 2001-01-16 07:32+0900\n" "Last-Translator: Nobuyuki Tsuchimura \n" "Language-Team: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=EUC-JP\n" "Content-Transfer-Encoding: 8-bit\n" #: src/console_fe.c:119 msgid "Show changes to" msgstr "ɽ" #: src/console_fe.c:119 msgid "showing changes to" msgstr "ɽ" #: src/console_fe.c:119 src/console_fe.c:120 msgid "local" msgstr "" #: src/console_fe.c:120 msgid "Synchronize" msgstr "" #: src/console_fe.c:120 msgid "synchronizing" msgstr "" #: src/console_fe.c:125 msgid "Fetch" msgstr "եΰ" #: src/console_fe.c:125 msgid "fetching" msgstr "եΰ" #: src/console_fe.c:125 src/console_fe.c:126 src/console_fe.c:127 msgid "remote" msgstr "С" #: src/console_fe.c:126 gnome/init.c:198 msgid "Update" msgstr "" #: src/console_fe.c:126 msgid "updating" msgstr "" #: src/console_fe.c:127 msgid "Verify" msgstr "ӳǧ" #: src/console_fe.c:127 msgid "verifying" msgstr "ӳǧ" #: src/console_fe.c:128 msgid "Catch up" msgstr "Ѥߥޡ" #: src/console_fe.c:128 msgid "catching up" msgstr "Ѥߥޡ" #: src/console_fe.c:128 src/console_fe.c:129 msgid "stored" msgstr "Ͽ" #: src/console_fe.c:129 msgid "Initialize" msgstr "" #: src/console_fe.c:129 msgid "initializing" msgstr "" #: src/console_fe.c:134 msgid "" "You should never see this message.\n" "Please contact the maintainer at sitecopy@lyra.org\n" msgstr "" #: src/console_fe.c:196 #, c-format msgid "%s: Error: No site called `%s' found - skipping.\n" msgstr "%s: 顼: %sפȤȤϤޤ󡣥åפޤ\n" #: src/console_fe.c:214 #, c-format msgid "%s: No valid sites specified.\n" msgstr "%s: Ͽ줿̾ꤵƤޤ\n" #: src/console_fe.c:216 #, c-format msgid "%s: No sites specified.\n" msgstr "%s: ̾ꤵƤޤ\n" #: src/console_fe.c:218 src/console_fe.c:369 src/console_fe.c:529 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "`%s --help' Ǿܤɽޤ\n" #: src/console_fe.c:228 #, c-format msgid "%s: %c%s site `%s' (on %s in %s)\n" msgstr "%s: %c%s - `%s' (on %s in %s)\n" #: src/console_fe.c:249 #, c-format msgid "* These items have been added since the last update:\n" msgstr "* ե:\n" #: src/console_fe.c:254 src/console_fe.c:285 #, c-format msgid "dir:" msgstr "ǥ쥯ȥ:" #: src/console_fe.c:261 #, c-format msgid "* These items have been changed since the last update:\n" msgstr "* ѹ줿ե:\n" #: src/console_fe.c:263 #, c-format msgid " Changes to items in [brackets] are ignored during updates.\n" msgstr " [] ΥեϹޤ\n" #: src/console_fe.c:277 #, c-format msgid "* These items have been deleted, but will be left on the server:\n" msgstr "* 줿եʥСˤϻĤޤ:\n" #: src/console_fe.c:279 #, c-format msgid "* These items have been deleted since the last update:\n" msgstr "* 줿ե:\n" #: src/console_fe.c:292 #, c-format msgid "* These items have been moved since the last update:\n" msgstr "* ư줿ե:\n" #: src/console_fe.c:310 src/console_fe.c:322 msgid "Ignored" msgstr "̵뤹" #: src/console_fe.c:312 msgid "Maintained for executables" msgstr "¹°򰷤" #: src/console_fe.c:314 msgid "Always maintained" msgstr "٤Ƥ°򰷤" #: src/console_fe.c:324 msgid "Maintained" msgstr "󥯤Ȥư" #: src/console_fe.c:326 msgid "Followed" msgstr "򤿤ɤ" #: src/console_fe.c:337 #, c-format msgid "" "Site: %s\n" "\tServer: %s" msgstr "" ": %s\n" "\tС: %s" #: src/console_fe.c:339 #, c-format msgid " Port: " msgstr " ݡ: " #: src/console_fe.c:341 #, c-format msgid "(default)\n" msgstr "" #: src/console_fe.c:343 #, c-format msgid "%d\n" msgstr "" #: src/console_fe.c:345 #, c-format msgid "\tProtocol: %s Username: %s\n" msgstr "\tץȥ: %s 桼: %s\n" #: src/console_fe.c:348 msgid "(unspecified)" msgstr "" #: src/console_fe.c:350 #, c-format msgid "\tPassive mode FTP will not be used.\n" msgstr "\tPassive mode FTP ϻȤޤ\n" #: src/console_fe.c:351 #, c-format msgid "" "\tRemote directory: %s\n" "\tLocal directory: %s\n" msgstr "" "\tСǥ쥯ȥ: %s\n" "\tǥ쥯ȥ: %s\n" #: src/console_fe.c:353 #, c-format msgid "\tPermissions: %s Symlinks: %s\n" msgstr "\tե°: %s : %s\n" #: src/console_fe.c:356 #, c-format msgid "\tRemote files will not be deleted.\n" msgstr "\tС¦ΥեϺޤ\n" #: src/console_fe.c:358 #, c-format msgid "\tFiles will be moved remotely if moved locally.\n" msgstr "\tǰưեϥСǤưޤ\n" #: src/console_fe.c:367 #, c-format msgid "%s: Error: Only specify ONE operation mode at a time.\n" msgstr "%s: 顼: ưϣĤꤷƲ\n" #: src/console_fe.c:489 #, c-format msgid "%s: Error: Debug channel %s not known.\n" msgstr "" #: src/console_fe.c:497 #, c-format msgid "%s: Warning: Could not open `%s' to use as logfile.\n" msgstr "%s: ٹ: '%s' եȤƥץǤޤ\n" #: src/console_fe.c:540 #, c-format msgid "%s: Error: Dry run mode is currently only supported for updates.\n" msgstr "" #: src/console_fe.c:556 #, c-format msgid "" "%s: Warning: Only %d sites can be specified on the command line!\n" "Extra entries are being skipped.\n" msgstr "" "%s: ٹ: ޥɥ饤󤫤 %d ĤΥȤǤޤ\n" "¿Τ̵뤷ޤ\n" #: src/console_fe.c:581 msgid "WARNING: Server certificate is not trusted." msgstr "" #: src/console_fe.c:584 #, c-format msgid "Certificate was issued for server `%s'.\n" msgstr "" #: src/console_fe.c:586 msgid "WARNING: Certificate does not specify a server" msgstr "" #: src/console_fe.c:588 #, c-format msgid "Fingerprint: %s\n" msgstr "" #: src/console_fe.c:591 #, c-format msgid "Issued to: %s\n" msgstr "" #: src/console_fe.c:595 #, c-format msgid "Issued by: %s\n" msgstr "" #: src/console_fe.c:598 #, c-format msgid "Do you wish to accept this certificate? (y/n) " msgstr "" #: src/console_fe.c:607 msgid "server" msgstr "С" #: src/console_fe.c:607 msgid "proxy server" msgstr "ץС" #: src/console_fe.c:613 #, c-format msgid "Authentication required for %s on %s `%s':\n" msgstr "%s ؤǧڤ %s ɬפǤ '%s':\n" #: src/console_fe.c:616 #, fuzzy, c-format msgid "Authentication required on %s `%s':\n" msgstr "%s ؤǧڤ %s ɬפǤ '%s':\n" # msgid "Authentication required on %s `%s':\n" # msgstr "ǧڤ %s ɬפǤ:\n" #: src/console_fe.c:619 msgid "Username: " msgstr "桼̾: " #: src/console_fe.c:624 #, c-format msgid "Username: %s\n" msgstr "桼̾: %s\n" #: src/console_fe.c:626 src/console_fe.c:650 msgid "Password: " msgstr "ѥ: " #: src/console_fe.c:636 #, c-format msgid "Retrying: [" msgstr "ӳǧ: [" #: src/console_fe.c:647 #, c-format msgid "%s: Encrypted client certificate configured%s%s.\n" msgstr "" #: src/console_fe.c:682 #, c-format msgid "Create %s/" msgstr "%s/ " #: src/console_fe.c:684 #, c-format msgid "Delete %s/" msgstr "%s/ " #: src/console_fe.c:692 #, fuzzy, c-format msgid "Upload %s (%s bytes)" msgstr "%s 򥢥åץ" #: src/console_fe.c:694 #, c-format msgid "Delete %s" msgstr "%s " #: src/console_fe.c:695 #, c-format msgid "Move %s->%s" msgstr "%s %s ˰ư" #: src/console_fe.c:699 #, c-format msgid "" "%s: in fe_can_update/file_file\n" "%s" msgstr "" #: src/console_fe.c:706 #, c-format msgid "Change %s" msgstr "%s ѹ" #: src/console_fe.c:707 #, c-format msgid "Create %s" msgstr "%s " #: src/console_fe.c:708 #, c-format msgid "Remove %s" msgstr "%s " #: src/console_fe.c:711 #, c-format msgid "" "%s: in fe_can_update/file_link\n" "%s" msgstr "" #: src/console_fe.c:717 #, c-format msgid "? (y/n) " msgstr "ޤ (y/n) " #: src/console_fe.c:726 #, c-format msgid "Checksumming %s: [" msgstr "å׻ %s: [" #: src/console_fe.c:741 src/console_fe.c:852 src/console_fe.c:913 #, c-format msgid "] done.\n" msgstr "] λ.\n" #: src/console_fe.c:743 src/console_fe.c:915 #, c-format msgid "" "] failed:\n" "%s\n" msgstr "" "] :\n" "%s\n" #: src/console_fe.c:753 #, fuzzy, c-format msgid "Setting permissions on %s%s: " msgstr "ե° %s: " #: src/console_fe.c:763 src/console_fe.c:841 src/console_fe.c:907 #, c-format msgid "done.\n" msgstr "λ\n" #: src/console_fe.c:765 src/console_fe.c:909 #, c-format msgid "" "failed:\n" "%s\n" msgstr "" ":\n" "%s\n" #: src/console_fe.c:784 src/console_fe.c:871 #, c-format msgid "Creating %s/: " msgstr " %s/: " #: src/console_fe.c:786 src/console_fe.c:873 #, c-format msgid "Deleting %s/: " msgstr " %s/: " #: src/console_fe.c:793 #, c-format msgid "Uploading %s: [" msgstr "åץ %s: [" #: src/console_fe.c:796 src/console_fe.c:815 src/console_fe.c:883 #, c-format msgid "Deleting %s: " msgstr " %s: " #: src/console_fe.c:799 src/console_fe.c:886 #, c-format msgid "Moving %s->%s: " msgstr "ư %s->%s: " #: src/console_fe.c:803 #, c-format msgid "" "%s: in fe_updating/file_file\n" "%s" msgstr "" #: src/console_fe.c:811 #, c-format msgid "Changing %s: " msgstr "ѹ %s: " #: src/console_fe.c:813 #, c-format msgid "Creating %s: " msgstr " %s: " #: src/console_fe.c:817 #, c-format msgid "" "%s: in fe_updating/file_link\n" "%s" msgstr "" "%s: in fe_updating/file_link\n" "%s" #: src/console_fe.c:834 #, fuzzy, c-format msgid "Failed to update %s:%c%s\n" msgstr "" "˼ %s:\n" "%s\n" #: src/console_fe.c:843 #, fuzzy, c-format msgid "failed:%c%s\n" msgstr "" ":\n" "%s\n" #: src/console_fe.c:855 #, fuzzy, c-format msgid "] failed:%c%s\n" msgstr "" "] :\n" "%s\n" #: src/console_fe.c:880 #, c-format msgid "Downloading %s: [" msgstr " %s: [" #: src/console_fe.c:925 #, fuzzy msgid "Changed on server" msgstr "%s ѹ" #: src/console_fe.c:928 msgid "Added on server" msgstr "" #: src/console_fe.c:936 #, fuzzy, c-format msgid "%s: %s\n" msgstr "桼̾: %s\n" #: src/console_fe.c:956 #, c-format msgid "Directory: %s/\n" msgstr "ǥ쥯ȥ: %s/\n" #: src/console_fe.c:961 #, fuzzy, c-format msgid "File: %s - size %s%s\n" msgstr "ե: %s - %ld%s\n" #: src/console_fe.c:963 msgid " (ASCII)" msgstr "" #: src/console_fe.c:966 #, c-format msgid "Link: %s - target %s\n" msgstr ": %s - %s\n" #: src/console_fe.c:979 gnome/init.c:402 #, c-format msgid "%s: Error: Could not open rcfile: %s.\n" msgstr "%s: 顼: rcfile %s 򥪡ץǤޤ\n" #: src/console_fe.c:983 gnome/init.c:407 #, c-format msgid "" "%s: rcfile corrupt at line %d:\n" "%s\n" msgstr "" "%s: rcfile %d ԤǴְäƤޤ:\n" "%s\n" #: src/console_fe.c:1002 #, c-format msgid "" "%s: Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: ǥ쥯ȥ꤬ɤޤ`%s':\n" "\t%s\n" #: src/console_fe.c:1006 #, c-format msgid "%s: Server not specified in site `%s'.\n" msgstr "%s: '%s' ǥСꤵƤޤ\n" #: src/console_fe.c:1010 #, c-format msgid "%s: Remote directory not specified in site `%s'.\n" msgstr "%s: `%s' ǥСǥ쥯ȥ꤬ꤵƤޤ\n" #: src/console_fe.c:1014 #, c-format msgid "%s: Local directory not specified in site `%s'.\n" msgstr "%s: `%s' ǥǥ쥯ȥ꤬ꤵƤޤ\n" #: src/console_fe.c:1018 #, c-format msgid "%s: Invalid port used in site `%s'.\n" msgstr "%s: `%s' ΥݡȤ̵Ǥ\n" #: src/console_fe.c:1022 #, c-format msgid "%s: %s cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s ϥܥå󥯤Ȥޤʥ `%s'ˡ\n" #: src/console_fe.c:1026 #, c-format msgid "%s: Cannot use a relative remote directory in %s (site `%s').\n" msgstr "%s: %s ǤХǥ쥯ȥȤޤʥ `%s'ˡ\n" #: src/console_fe.c:1029 #, c-format msgid "%s: File permissions are not supported in %s (site `%s').\n" msgstr "%s: %s Ǥϥե°Ȥޤʥ `%s'ˡ\n" #: src/console_fe.c:1032 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with nooverwrite (site `%s').\n" msgstr "%s: safe nooverwrite ƱˤϻǤޤʥ `%s'ˡ\n" #: src/console_fe.c:1035 #, c-format msgid "" "%s: Safe mode cannot be used in conjunction with tempupload (site `%s').\n" msgstr "%s: safe tempupload ƱˤϻǤޤʥ `%s'ˡ\n" #: src/console_fe.c:1038 #, c-format msgid "%s: Can only check for renamed files when checksumming (site `%s').\n" msgstr "" "%s: checkmoved renames state checksum Ʊ˻ꤷƲʥ `%" "s')\n" #: src/console_fe.c:1041 #, c-format msgid "%s: The protocol `%s' is unsupported (site `%s').\n" msgstr "%s: `%s' ץȥϻȤޤʥ `%s'ˡ\n" #: src/console_fe.c:1048 #, c-format msgid "%s: Unhandled error %d in site `%s' - please contact the maintainer.\n" msgstr "" "%s: ͽ̥顼 %d `%s' ǵޤ - ԤޤϢ\n" #: src/console_fe.c:1066 #, c-format msgid "" "%s: Error: Corrupt site storage file for `%s':\n" "%s: %s\n" msgstr "" "%s: 顼: Ͽե `%s' Ƥޤ:\n" "%s: %s\n" #: src/console_fe.c:1075 #, c-format msgid "" "%s: Error: No storage file for `%s'.\n" "%s: Use --init, --catchup or --fetch to create a storage file.\n" msgstr "" "%s: 顼: `%s' εϿե뤬ޤ\n" "%s: ޤ --init, --catchup ,--fetch Τ줫¹ԤƲ\n" #: src/console_fe.c:1088 #, c-format msgid "%s: Skipping site `%s'.\n" msgstr "%s: `%s' 򥹥åפޤ\n" #: src/console_fe.c:1103 #, c-format msgid "%s: %s completed successfully.\n" msgstr "%s: %sޤ\n" #: src/console_fe.c:1109 #, c-format msgid "%s: %s unsupported for %s.\n" msgstr "%s: %s %s ǤϼƤޤ\n" #: src/console_fe.c:1114 #, c-format msgid "%s: Errors occurred while %s the %s site.\n" msgstr "%s: %s%sǥ顼ޤ\n" #: src/console_fe.c:1119 #, c-format msgid "%s: Error: Could not resolve remote hostname (%s).\n" msgstr "%s: 顼: СΥۥ̾ (%s) IP ɥ쥹ѴǤޤ\n" #: src/console_fe.c:1125 #, c-format msgid "%s: Error: Could not resolve hostname of proxy server (%s).\n" msgstr "" "%s: 顼: ץСΥۥ̾ (%s) IP ɥ쥹ѴǤޤ" "\n" #: src/console_fe.c:1131 #, c-format msgid "%s: Error: Could not connect to proxy server (%s port %d).\n" msgstr "%s: 顼: ץС (%s port %d) ³Ǥޤ\n" #: src/console_fe.c:1134 #, c-format msgid "%s: Error: Could not connect to server (%s port %d).\n" msgstr "%s: 顼: С (%s port %d) ³Ǥޤ\n" #: src/console_fe.c:1140 #, c-format msgid "%s: Error: Could not authorise user on server.\n" msgstr "%s: 顼: 桼ǧڤ˼Ԥޤ\n" #: src/console_fe.c:1145 #, c-format msgid "%s: Error: %s\n" msgstr "" #: src/console_fe.c:1149 #, c-format msgid "%s: Error: Could not authorise user on proxy server (%s).\n" msgstr "%s: 顼: ץС (%s) ǥ桼ǧڤ˼Ԥޤ\n" #: src/console_fe.c:1154 #, c-format msgid "" "%s: in issue_error\n" "%s" msgstr "" #: src/console_fe.c:1168 #, c-format msgid "%s: Error: Environment variable HOME not set.\n" msgstr "%s: 顼: Ķѿ HOME Ƥޤ\n" #: src/console_fe.c:1176 #, c-format msgid "%s: Error: Could not open rcfile: %s\n" msgstr "%s: 顼: rcfile '%s' ɤޤ\n" #: src/console_fe.c:1179 #, c-format msgid "%s: Error: rcfile permissions allow other users to read your rcfile.\n" msgstr "%s: 顼: ʤ rcfile ¾ͤɤ°ˤʤäƤޤ\n" #: src/console_fe.c:1180 src/console_fe.c:1192 #, c-format msgid "%s: Set the permissions to 0600.\n" msgstr "%s: ° 0600 ˤƲ\n" #: src/console_fe.c:1183 #, c-format msgid "%s: Error: Could not open storage directory: %s\n" msgstr "%s: 顼: Ͽѥǥ쥯ȥ %s ޤ\n" #: src/console_fe.c:1184 #, c-format msgid "" "%s: You need to create this directory and set the permissions to 0700.\n" msgstr "%s: Υǥ쥯ȥ° 0700 ˤƲ\n" #: src/console_fe.c:1187 #, c-format msgid "%s: Error: storage directory permissions incorrect.\n" msgstr "%s: 顼: Ͽѥǥ쥯ȥ°ɤޤ\n" #: src/console_fe.c:1188 #, c-format msgid "%s: Set the permissions to 0700.\n" msgstr "%s: ° 0700 ˤƲ\n" #: src/console_fe.c:1191 #, c-format msgid "%s: Error: ~/.netrc permissions incorrect.\n" msgstr "%s: 顼: ~/.netrc °ɤޤ\n" #: src/console_fe.c:1197 #, c-format msgid "" "%s: init_paths gave %d\n" "%s" msgstr "" #: src/console_fe.c:1204 #, c-format msgid "%s: Error: Could not parse ~/.netrc.\n" msgstr "%s: 顼: ~/.netrc Ͻޤ\n" #: src/console_fe.c:1222 src/console_fe.c:1321 #, c-format msgid "%s: Nothing to do - no changes found.\n" msgstr "%s: ѹ줿ե뤬ʤΤǡ⤷ޤ\n" #: src/console_fe.c:1231 #, c-format msgid "" "%s: Error: Could not open storage file for writing (%s)\n" "%s: Error: %s\n" "%s: Will not update site `%s'.\n" msgstr "" #: src/console_fe.c:1255 #, fuzzy, c-format msgid "" "%s: Warning: Current state method differs from stored in site `%s'.\n" "%s: All existing files will appear changed (use catchup?).\n" msgstr "" "%s: ٹ: `%s' θߤ state ꤬ϿȰۤʤޤ\n" "%s: ե뤬ѹ줿Ȥưޤ--catchup ȤȤ⡩\n" #: src/console_fe.c:1261 #, c-format msgid "%s: The remote site needs updating (%d items to update).\n" msgstr "%s: ФΥեϹɬפǤ%dġˡ\n" #: src/console_fe.c:1263 #, c-format msgid "%s: The remote site needs updating (1 item to update).\n" msgstr "%s: ФΥեϹɬפǤ1ġˡ\n" #: src/console_fe.c:1266 #, c-format msgid "%s: The remote site does not need updating.\n" msgstr "%s: ФΥեϺǿǤ\n" #: src/console_fe.c:1274 #, c-format msgid "%s: All the files and directories are marked as NOT updated remotely.\n" msgstr "%s: С˥ե뤬ʤΤȤƵϿޤ\n" #: src/console_fe.c:1279 #, c-format msgid "%s: All the files and and directories are marked as updated remotely.\n" msgstr "%s: СΥեϺǿǤȤƵϿޤ\n" #: src/console_fe.c:1288 #, c-format msgid "" "%s: Failed to fetch file listing for site `%s':\n" "%s: %s\n" msgstr "" "%s: '%s' ΥСˤեΰ˼Ԥޤ:\n" "%s: %s\n" #: src/console_fe.c:1302 #, fuzzy, c-format msgid "" "%s: Failed to fetch file listing to verify site `%s':\n" "%s: %s\n" msgstr "" "%s: '%s' ΥСˤեΰ˼Ԥޤ:\n" "%s: %s\n" #: src/console_fe.c:1309 #, c-format msgid "%s: Verify found %d files missing from server.\n" msgstr "" #: src/console_fe.c:1312 #, fuzzy, c-format msgid "%s: Remote site not synchronized with stored state.\n" msgstr "%s: `%s' ǥСǥ쥯ȥ꤬ꤵƤޤ\n" #: src/console_fe.c:1325 #, c-format msgid "" "%s: Refusing to delete all local files with a synchronize operation.\n" "%s: Use --update to update the remote site.\n" msgstr "" #: src/console_fe.c:1333 #, c-format msgid "" "%s: in act_on_site\n" "%s" msgstr "" #: src/console_fe.c:1344 #, c-format msgid "Usage: %s [OPTIONS] [MODE] [sitename]...\n" msgstr "Ȥ: %s [OPTIONS] [MODE] [sitename]...\n" #: src/console_fe.c:1346 #, c-format msgid "Options: \n" msgstr "ץ \n" #: src/console_fe.c:1349 #, fuzzy, c-format msgid "" " -d, --debug=KEY[,KEY] Turn debugging on for each KEY, which may be:\n" " socket, files, rcfile, ftp, http, httpbody, rsh, sftp, xml, xmlparse, " "cleartext\n" " Warning: cleartext displays (normally hidden) passwords in plain text\n" " -g, --logfile=FILE Append debugging messages to FILE (else use stderr)\n" msgstr "" " -d, --debug=KEY[,KEY] ǥХå -- KEY ˤϰʲ:\n" " socket, files, rcfile, ftp, http, httpbody, xml, xmlparse, cleartext\n" " ٹ: cleartext Ǥ̾ﱣѥɤʿʸɽ\n" " -g, --logfile=FILE ǥХå FILE ɵ̾ stderr ѡ\n" #: src/console_fe.c:1356 #, fuzzy, c-format msgid "" " -r, --rcfile=FILE Use alternate run control file\n" " -p, --storepath=PATH Use alternate site storage directory\n" " -y, --prompting Request confirmation before making each update\n" " -a, --allsites Perform the operation on ALL defined sites\n" " -k, --keep-going Carry on an update regardless of errors\n" " -o, --show-progress Display total percentage file transfer complete\n" " -q, --quiet Be quiet while performing the operation\n" " -qq, --silent Be silent while perforing the operation\n" " -n, --dry-run Display but do not carry out the operation\n" "Operation modes:\n" " -l, --list List changes between remote and local sites " "(default)\n" " -ll, --flatlist Flat list of changes between remote and local sites\n" " -v, --view Display a list of the site definitions\n" " -i, --initialize Mark all files and directories as not updated\n" " -f, --fetch Find out what files are on the remote site\n" " -e, --verify Verify stored state of site matches real remote " "state\n" " -c, --catchup Mark all files and directories as updated\n" " -s, --synchronize Update the local site from the remote site\n" " -u, --update Update the remote site\n" " -h, --help Display this help message\n" " -V, --version Display version information\n" "Please send feature requests and bug reports to sitecopy@lyra.org\n" msgstr "" " -r, --rcfile=FILE run control file \n" " -p, --storepath=PATH Ͽǥ쥯ȥ\n" " -y, --prompting ˳ǧ\n" " -a, --allsites 줿Ȥ٤Ƥ\n" " -k, --keep-going 顼äƤ⹹ư³\n" " -o, --show-progress եž˿ʹԾɽ\n" " -q, --quiet ưɽ򸺤餹\n" " -qq, --silent ưɽʤ\n" "Operation modes:\n" " -l, --list եξ֤ɽ (default)\n" " -ll, --flatlist եξ֤ʰɽ\n" " -v, --view Ȥɽ\n" " -i, --initialize С˥ե뤬ʤȵϿ\n" " -f, --fetch Сˤեΰ\n" " -c, --catchup СΥեϺǿǤȵϿ\n" " -s, --synchronize СΥե\n" " -u, --update СΥե򹹿\n" " -h, --help Υإפɽ\n" " -V, --version Сɽ\n" "ƤȥХݡȤ sitecopy@lyra.org ޤǤɤ\n" #: src/sitestore.c:326 #, c-format msgid "Invalid checksum at line %d" msgstr "" #: src/sitestore.c:371 #, c-format msgid "Boolean missing in 'ascii' at line %d" msgstr "" #: src/sitestore.c:396 #, c-format msgid "Size overflow (%s) in '%s' at line %d" msgstr "" #: src/davdriver.c:195 msgid "The connection timed out." msgstr "³ॢȡ" #: src/davdriver.c:224 #, fuzzy msgid "Could not write SSL certificate" msgstr "ե뤬񤱤ޤ: %s" #: src/davdriver.c:244 msgid "SSL support has not be compiled in." msgstr "SSL ǽѥ뤵Ƥޤ" #: src/davdriver.c:252 #, fuzzy, c-format msgid "Could not load certificate `%s'." msgstr "ե뤬񤱤ޤ: %s" #: src/davdriver.c:290 #, fuzzy, c-format msgid "Could not read SSL client certificate '%s'." msgstr "ե뤬񤱤ޤ: %s" #: src/davdriver.c:303 #, fuzzy, c-format msgid "Could not decrypt SSL client certificate '%s'." msgstr "ե뤬񤱤ޤ: %s" #: src/davdriver.c:325 msgid "The server does not appear to be a WebDAV server." msgstr "ΥС WebDAV СǤϤʤ褦Ǥ" #: src/davdriver.c:330 msgid "The server does not support the executable live property." msgstr "ΥС executable live property 򥵥ݡȤƤޤ" #: src/davdriver.c:376 src/davdriver.c:443 src/davdriver.c:480 src/ftp.c:888 #: src/ftp.c:972 #, fuzzy msgid "Could not open file" msgstr "ե뤬ɤޤ: " #: src/davdriver.c:411 #, fuzzy, c-format msgid "Could not stat file: %s" msgstr "ե뤬񤱤ޤ: %s" #: src/davdriver.c:670 msgid "Could not access resource" msgstr "꥽˥Ǥޤ" #: src/sites.c:160 msgid "Could not set modification time of local file." msgstr "եκǽѹǤޤ" #: src/sites.c:308 msgid "" "Upload succeeded, but could not retrieve modification time.\n" "If this message persists, turn off safe mode." msgstr "" "åץɤޤեκǽǤޤǤ" "\n" "ΥåĤФʤ顢safe mode Ʋ" #: src/sites.c:515 msgid "Remote file has been modified - not overwriting with local changes" msgstr "" "СΥե뤬Ƥޤ - եѹ񤭤ޤ" "" #: src/sites.c:828 msgid "Could not examine file." msgstr "եǤǤޤ" #: src/sites.c:871 msgid "Could not checksum file" msgstr "եΥå׻Ǥޤ" #: src/sites.c:887 msgid "The target of the symlink could not be read." msgstr "ܥå󥯤Υե뤬ɤޤ" #: src/common.c:113 msgid "Unknown system error" msgstr "̤ΤΥƥ२顼" #: src/ftp.c:153 #, c-format msgid "%s: connection was closed by server." msgstr "%s: ³Сڤޤ" #: src/ftp.c:157 #, c-format msgid "%s: connection timed out." msgstr "%s: ³ॢȤǤ" #: src/ftp.c:195 #, fuzzy msgid "Could not read response line" msgstr "response body ɤޤ" #: src/ftp.c:229 msgid "Cannot parse MDTM response; wrong length." msgstr "" #: src/ftp.c:236 msgid "Cannot parse MDTM response." msgstr "" #: src/ftp.c:260 #, fuzzy msgid "Could not find address in PASV response" msgstr "response body ɤޤ" #: src/ftp.c:267 #, fuzzy msgid "Could not parse PASV response" msgstr "response body ɤޤ" #: src/ftp.c:276 msgid "Invalid IP address in PASV response" msgstr "" #: src/ftp.c:296 #, fuzzy msgid "Malformed EPSV response" msgstr "response body ɤޤ" #: src/ftp.c:304 #, fuzzy msgid "Malformed port in EPSV response" msgstr "response body ɤޤ" #: src/ftp.c:449 msgid "Error sending file" msgstr "" #: src/ftp.c:463 src/ftp.c:489 #, fuzzy msgid "Error reading file" msgstr "chunked response body ɤޤ" #: src/ftp.c:480 #, fuzzy msgid "Could not send file" msgstr "ե뤬ɤޤ: " #: src/ftp.c:510 src/ftp.c:991 #, fuzzy msgid "Error writing to file" msgstr "ե뤬񤱤ޤ: " #: src/ftp.c:516 msgid "Receiving file" msgstr "" #: src/ftp.c:532 #, fuzzy msgid "Could not connect passive data socket" msgstr "ץС SSL ³Ǥޤ" #: src/ftp.c:647 msgid "Active open failed: could not determine address of control socket" msgstr "" #: src/ftp.c:659 #, fuzzy msgid "Active open failed: could not create socket" msgstr "ץС SSL ³Ǥޤ" #: src/ftp.c:667 msgid "Active open failed: could not bind to address" msgstr "" #: src/ftp.c:677 msgid "Active open failed: could not determine address of data socket" msgstr "" #: src/ftp.c:684 #, fuzzy msgid "Could not determine bound port number for data socket" msgstr "ץС SSL ³Ǥޤ" #: src/ftp.c:727 msgid "Active open failed: could not accept connection" msgstr "" #: src/ftp.c:800 msgid "Error closing data socket" msgstr "" #: src/ftp.c:894 #, fuzzy msgid "Could not determine length of file" msgstr "ե뤬ɤޤ: " #: src/ftp.c:905 #, fuzzy msgid "Could not rewind to beginning of file" msgstr "ե뤬ɤޤ: " #: src/ftp.c:1152 #, fuzzy msgid "Could not read 'LIST' response." msgstr "response body ɤޤ" #: src/ftp.c:1161 #, fuzzy, c-format msgid "Parse error in LIST response: %s" msgstr "response body ɤޤ" #: gnome/init.c:51 msgid "_New site..." msgstr "" #: gnome/init.c:51 gnome/init.c:171 msgid "Create a new site definition" msgstr "" #: gnome/init.c:54 msgid "_Open..." msgstr "" #: gnome/init.c:54 msgid "Open a new rc file. (EXPERIMENTAL)." msgstr "" #: gnome/init.c:57 msgid "_Save Sites" msgstr "" #: gnome/init.c:57 gnome/init.c:177 msgid "Save the current site definitions" msgstr "" #: gnome/init.c:60 msgid "Sav_e Sites As..." msgstr "" #: gnome/init.c:60 msgid "Save the current site definitions to a file." msgstr "" #: gnome/init.c:63 #, fuzzy msgid "_Delete this site" msgstr "%s " #: gnome/init.c:63 msgid "Delete the selected site entry" msgstr "" #: gnome/init.c:69 msgid "E_xit" msgstr "" #: gnome/init.c:69 gnome/init.c:202 msgid "Exit the program" msgstr "" #: gnome/init.c:78 #, fuzzy msgid "_Initialise site" msgstr "" #: gnome/init.c:78 msgid "All files will be uploaded if a site is initialised" msgstr "" #: gnome/init.c:81 #, fuzzy msgid "'_Catchup' site" msgstr "Ѥߥޡ" #: gnome/init.c:81 msgid "Records the site as already updated." msgstr "" #: gnome/init.c:84 msgid "_Fetch site listing" msgstr "" #: gnome/init.c:84 msgid "Figures out which files are new/changed from the actual remote site." msgstr "" #: gnome/init.c:88 #, fuzzy msgid "_Resynchronize site" msgstr "" #: gnome/init.c:88 msgid "Copies newer files from the remote site to the local drive." msgstr "" #: gnome/init.c:91 msgid "_Update site..." msgstr "" #: gnome/init.c:91 msgid "Apply the local site's changes to the remote site." msgstr "" #: gnome/init.c:94 msgid "Update _ALL sites" msgstr "" #: gnome/init.c:94 gnome/init.c:137 msgid "Performs the required operations on all site definitions. (TODO)." msgstr "" #: gnome/init.c:98 msgid "Rescan local directory" msgstr "" #: gnome/init.c:98 #, fuzzy msgid "Re-reads the local directory of the selected site." msgstr "%s: `%s' ǥǥ쥯ȥ꤬ꤵƤޤ\n" #: gnome/init.c:106 msgid "_Required updates" msgstr "" #: gnome/init.c:106 msgid "Displays a brief report of any required updates." msgstr "" #: gnome/init.c:109 msgid "Site web-r_eport" msgstr "" #: gnome/init.c:109 msgid "" "Generates a web page detailing the changes required on the selected site." msgstr "" #: gnome/init.c:112 msgid "Prin_t site info..." msgstr "" #: gnome/init.c:112 msgid "Print information about the selected site" msgstr "" #: gnome/init.c:119 msgid "_Backup files status" msgstr "" #: gnome/init.c:119 msgid "Save the 'state' of your local files, in case of accident." msgstr "" #: gnome/init.c:122 msgid "Restore files status..." msgstr "" #: gnome/init.c:122 gnome/init.c:129 msgid "If a backup has previously been made, it will be restored." msgstr "" #: gnome/init.c:126 msgid "_Backup site definitions" msgstr "" #: gnome/init.c:126 msgid "Backup your site definitions, in case you delete your sites." msgstr "" #: gnome/init.c:129 msgid "Restore site definitions..." msgstr "" #: gnome/init.c:137 msgid "Preferences..." msgstr "" #: gnome/init.c:146 msgid "_About XSitecopy" msgstr "" #: gnome/init.c:146 msgid "Information about XSitecopy" msgstr "" #: gnome/init.c:158 msgid "_File" msgstr "" #: gnome/init.c:159 #, fuzzy msgid "_Operations" msgstr "ץ \n" #: gnome/init.c:160 msgid "_Reports" msgstr "" #: gnome/init.c:161 msgid "_Settings" msgstr "" #: gnome/init.c:162 msgid "_Backup" msgstr "" #: gnome/init.c:163 msgid "_Help" msgstr "" #: gnome/init.c:171 msgid "New site" msgstr "" #: gnome/init.c:174 msgid "Open" msgstr "" #: gnome/init.c:174 msgid "Open a new site definitions file." msgstr "" #: gnome/init.c:177 msgid "Save" msgstr "" #: gnome/init.c:180 #, fuzzy msgid "Delete site" msgstr "%s " #: gnome/init.c:180 msgid "Delete the selected site" msgstr "" #: gnome/init.c:185 #, fuzzy msgid "Initialise" msgstr "" #: gnome/init.c:185 msgid "Initialise the site (mark all files as needing to be updated)." msgstr "" #: gnome/init.c:188 #, fuzzy msgid "Catch-up" msgstr "Ѥߥޡ" #: gnome/init.c:188 msgid "Mark all of the selected site's files as updated." msgstr "" #: gnome/init.c:194 #, fuzzy msgid "Download" msgstr " %s: [" #: gnome/init.c:194 msgid "Download newer files from the remote site. (Use with care)" msgstr "" #: gnome/init.c:198 msgid "Updates the selected site" msgstr "" #: gnome/init.c:202 msgid "Quit" msgstr "" #: gnome/init.c:412 #, fuzzy, c-format msgid "%s: Error: Could not read rcfile: %s.\n" msgstr "%s: 顼: rcfile %s 򥪡ץǤޤ\n" #: gnome/main.c:184 msgid "" "Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, " "32=XML, 64=GNOME )" msgstr "" #: gnome/misc.c:580 #, fuzzy, c-format msgid "Server not specified in site `%s'.\n" msgstr "%s: '%s' ǥСꤵƤޤ\n" #: gnome/misc.c:584 #, fuzzy, c-format msgid "Remote directory not specified in site `%s'.\n" msgstr "%s: `%s' ǥСǥ쥯ȥ꤬ꤵƤޤ\n" #: gnome/misc.c:588 #, fuzzy, c-format msgid "Local directory not specified in site `%s'.\n" msgstr "%s: `%s' ǥǥ쥯ȥ꤬ꤵƤޤ\n" #: gnome/misc.c:592 #, fuzzy, c-format msgid "" "Could not read directory for `%s':\n" "\t%s\n" msgstr "" "%s: ǥ쥯ȥ꤬ɤޤ`%s':\n" "\t%s\n" #: gnome/misc.c:596 #, fuzzy, c-format msgid "Invalid port used in site `%s'.\n" msgstr "%s: `%s' ΥݡȤ̵Ǥ\n" #: gnome/misc.c:600 #, fuzzy, c-format msgid "Protocol '%s' cannot maintain symbolic links (site `%s').\n" msgstr "%s: %s ϥܥå󥯤Ȥޤʥ `%s'ˡ\n" #: gnome/misc.c:604 #, fuzzy, c-format msgid "Cannot use a relative remote directory protocol '%s' (site `%s').\n" msgstr "%s: %s ǤХǥ쥯ȥȤޤʥ `%s'ˡ\n" #: gnome/misc.c:607 #, c-format msgid "%s's protocol does not currently support maintaining permissions." msgstr "" #: gnome/misc.c:611 #, fuzzy, c-format msgid "Could not find 'relative' local directory" msgstr "ץС SSL ³Ǥޤ" #: lib/neon/ne_redirect.c:92 #, fuzzy msgid "Could not parse redirect destination URL" msgstr "chunk 礭ϤǤޤ" #: lib/neon/ne_gnutls.c:162 #, c-format msgid "[unprintable:#%lu]" msgstr "" #: lib/neon/ne_gnutls.c:188 msgid "[unprintable]" msgstr "" #: lib/neon/ne_gnutls.c:696 lib/neon/ne_openssl.c:419 msgid "Server certificate was missing commonName attribute in subject name" msgstr "" #: lib/neon/ne_gnutls.c:736 lib/neon/ne_openssl.c:638 #, fuzzy, c-format msgid "SSL negotiation failed: %s" msgstr "ե뤬񤱤ޤ: %s" #: lib/neon/ne_gnutls.c:745 msgid "Server did not send certificate chain" msgstr "" #: lib/neon/ne_openssl.c:451 #, c-format msgid "Certificate verification error: %s" msgstr "" #: lib/neon/ne_openssl.c:657 msgid "SSL server did not present certificate" msgstr "" #: lib/neon/ne_openssl.c:666 msgid "Server certificate changed: connection intercepted?" msgstr "" #: lib/neon/ne_session.c:356 lib/neon/ne_session.c:367 msgid "[invalid date]" msgstr "" #: lib/neon/ne_session.c:380 msgid "certificate is not yet valid" msgstr "" #: lib/neon/ne_session.c:381 msgid "certificate has expired" msgstr "" #: lib/neon/ne_session.c:382 msgid "certificate issued for a different hostname" msgstr "" #: lib/neon/ne_session.c:383 msgid "issuer is not trusted" msgstr "" #: lib/neon/ne_session.c:388 msgid "Server certificate verification failed: " msgstr "" #: lib/neon/ne_socket.c:514 lib/neon/ne_socket.c:568 lib/neon/ne_socket.c:671 #, fuzzy msgid "Connection closed" msgstr "%s: ³Сڤޤ" #: lib/neon/ne_socket.c:578 lib/neon/ne_socket.c:683 #, fuzzy msgid "Secure connection truncated" msgstr "³ॢȡ" #: lib/neon/ne_socket.c:590 lib/neon/ne_socket.c:695 #, c-format msgid "SSL error: %s" msgstr "" #: lib/neon/ne_socket.c:593 #, c-format msgid "SSL error code %d/%d/%lu" msgstr "" #: lib/neon/ne_socket.c:676 #, c-format msgid "SSL alert received: %s" msgstr "" #: lib/neon/ne_socket.c:691 msgid "SSL socket read failed" msgstr "" #: lib/neon/ne_socket.c:790 msgid "Line too long" msgstr "" #: lib/neon/ne_socket.c:935 lib/neon/ne_socket.c:941 msgid "Host not found" msgstr "" #: lib/neon/ne_socket.c:1048 #, fuzzy msgid "Connection timed out" msgstr "³ॢȡ" #: lib/neon/ne_socket.c:1210 msgid "Socket descriptor number exceeds FD_SETSIZE" msgstr "" #: lib/neon/ne_socket.c:1270 msgid "Socket family not supported" msgstr "" #: lib/neon/ne_socket.c:1493 msgid "Client certificate verification failed" msgstr "" #: lib/neon/ne_socket.c:1509 msgid "SSL disabled due to lack of entropy" msgstr "" #: lib/neon/ne_socket.c:1516 msgid "SSL disabled due to library version mismatch" msgstr "" #: lib/neon/ne_socket.c:1522 #, fuzzy msgid "Could not create SSL structure" msgstr "ץС SSL ³Ǥޤ" #: lib/neon/ne_request.c:194 #, fuzzy, c-format msgid "%s: connection was closed by proxy server" msgstr "%s: ³ץСڤޤ" #: lib/neon/ne_request.c:197 #, fuzzy, c-format msgid "%s: connection was closed by server" msgstr "%s: ³Сڤޤ" #: lib/neon/ne_request.c:202 #, fuzzy, c-format msgid "%s: connection timed out" msgstr "%s: ³ॢȤǤ" #: lib/neon/ne_request.c:307 msgid "offset invalid" msgstr "" #: lib/neon/ne_request.c:312 #, fuzzy, c-format msgid "Could not seek to offset %s of request body file: %s" msgstr "ե뤬񤱤ޤ: %s" #: lib/neon/ne_request.c:360 msgid "Could not send request body" msgstr "" #: lib/neon/ne_request.c:699 msgid "Could not read chunk size" msgstr "chunk 礭ɤޤ" #: lib/neon/ne_request.c:706 msgid "Could not parse chunk size" msgstr "chunk 礭ϤǤޤ" #: lib/neon/ne_request.c:743 msgid "Could not read response body" msgstr "response body ɤޤ" #: lib/neon/ne_request.c:759 #, fuzzy msgid "Could not read chunk delimiter" msgstr "chunk 礭ɤޤ" #: lib/neon/ne_request.c:762 msgid "Chunk delimiter was invalid" msgstr "" #: lib/neon/ne_request.c:868 msgid "Could not read status line" msgstr "" #: lib/neon/ne_request.c:890 #, fuzzy msgid "Could not parse response status line" msgstr "response body ɤޤ" #: lib/neon/ne_request.c:902 #, fuzzy msgid "Could not read interim response headers" msgstr "response body ɤޤ" #: lib/neon/ne_request.c:936 msgid "Could not send request" msgstr "" #: lib/neon/ne_request.c:984 lib/neon/ne_request.c:1002 #: lib/neon/ne_request.c:1012 msgid "Error reading response headers" msgstr "" #: lib/neon/ne_request.c:1030 msgid "Response header too long" msgstr "" #: lib/neon/ne_request.c:1112 msgid "Response exceeded maximum number of header fields" msgstr "" #: lib/neon/ne_request.c:1129 #, fuzzy, c-format msgid "Could not resolve hostname `%s': %s" msgstr "%s: 顼: СΥۥ̾ (%s) IP ɥ쥹ѴǤޤ\n" #: lib/neon/ne_request.c:1260 msgid "Unknown transfer-coding in response" msgstr "" #: lib/neon/ne_request.c:1271 msgid "Invalid Content-Length in response" msgstr "" #: lib/neon/ne_request.c:1344 #, c-format msgid "Could not write to file: %s" msgstr "ե뤬񤱤ޤ: %s" #: lib/neon/ne_request.c:1417 #, fuzzy, c-format msgid "Could not create SSL connection through proxy server: %s" msgstr "ץС SSL ³Ǥޤ" #: lib/neon/ne_request.c:1464 #, fuzzy msgid "Could not create socket" msgstr "ץС SSL ³Ǥޤ" #: lib/neon/ne_request.c:1526 msgid "Could not connect to proxy server" msgstr "ץС³Ǥޤ" #: lib/neon/ne_request.c:1527 msgid "Could not connect to server" msgstr "ץС³Ǥޤ" #: lib/neon/ne_xml.c:280 #, fuzzy, c-format msgid "XML parse error at line %d: invalid element name" msgstr "" "%s: rcfile %d ԤǴְäƤޤ:\n" "%s\n" #: lib/neon/ne_xml.c:452 #, fuzzy msgid "Unknown error" msgstr "̤ΤΥƥ२顼" #: lib/neon/ne_xml.c:537 msgid "Invalid Byte Order Mark" msgstr "" #: lib/neon/ne_xml.c:625 #, fuzzy, c-format msgid "XML parse error at line %d: %s" msgstr "" "%s: rcfile %d ԤǴְäƤޤ:\n" "%s\n" #: lib/neon/ne_props.c:371 lib/neon/ne_props.c:435 msgid "Response exceeds maximum property count" msgstr "" #: lib/neon/ne_compress.c:184 #, c-format msgid "%s: %s (code %d)" msgstr "" #: lib/neon/ne_compress.c:232 #, fuzzy msgid "Could not inflate data" msgstr "ե뤬ɤޤ: " #: lib/neon/ne_compress.c:293 #, fuzzy msgid "Could not initialize zlib" msgstr "ե뤬񤱤ޤ: " #: lib/neon/ne_xmlreq.c:36 #, fuzzy, c-format msgid "Could not parse response: %s" msgstr "response body ɤޤ" #: lib/neon/ne_basic.c:98 #, fuzzy, c-format msgid "Could not determine file size: %s" msgstr "ե뤬ɤޤ: " #: lib/neon/ne_basic.c:149 msgid "Response did not include requested range" msgstr "" #: lib/neon/ne_basic.c:183 msgid "Range is not satisfiable" msgstr "" #: lib/neon/ne_basic.c:188 #, fuzzy msgid "Resource does not support ranged GET requests" msgstr "Сեʬ򥵥ݡȤƤޤ" #: lib/neon/ne_auth.c:130 #, fuzzy, c-format msgid "Could not authenticate to server: %s" msgstr "ץС³Ǥޤ" #: lib/neon/ne_auth.c:135 #, fuzzy, c-format msgid "Could not authenticate to proxy server: %s" msgstr "ץС³Ǥޤ" #: lib/neon/ne_auth.c:358 #, c-format msgid "rejected %s challenge" msgstr "" #: lib/neon/ne_auth.c:374 msgid "missing realm in Basic challenge" msgstr "" #: lib/neon/ne_auth.c:469 msgid "invalid Negotiate token" msgstr "" #: lib/neon/ne_auth.c:492 #, fuzzy msgid "GSSAPI authentication error: " msgstr "%s ؤǧڤ %s ɬפǤ '%s':\n" #: lib/neon/ne_auth.c:505 #, c-format msgid "GSSAPI failure (code %u)" msgstr "" #: lib/neon/ne_auth.c:540 msgid "ignoring empty Negotiate continuation" msgstr "" #: lib/neon/ne_auth.c:555 msgid "Negotiate response verification failed: invalid response header token" msgstr "" #: lib/neon/ne_auth.c:577 #, c-format msgid "Negotiate response verification failure: %s" msgstr "" #: lib/neon/ne_auth.c:697 msgid "unknown algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:701 msgid "incompatible algorithm in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:705 msgid "missing parameter in Digest challenge" msgstr "" #: lib/neon/ne_auth.c:709 msgid "initial Digest challenge was stale" msgstr "" #: lib/neon/ne_auth.c:716 msgid "stale Digest challenge with new algorithm or realm" msgstr "" #: lib/neon/ne_auth.c:728 #, fuzzy msgid "could not parse domain in Digest challenge" msgstr "chunk 礭ϤǤޤ" #: lib/neon/ne_auth.c:1036 msgid "Digest mutual authentication failure: missing parameters" msgstr "" #: lib/neon/ne_auth.c:1041 msgid "Digest mutual authentication failure: client nonce mismatch" msgstr "" #: lib/neon/ne_auth.c:1051 msgid "Digest mutual authentication failure: could not parse nonce count" msgstr "" #: lib/neon/ne_auth.c:1056 #, c-format msgid "Digest mutual authentication failure: nonce count mismatch (%u not %u)" msgstr "" #: lib/neon/ne_auth.c:1099 msgid "Digest mutual authentication failure: request-digest mismatch" msgstr "" #: lib/neon/ne_auth.c:1225 #, c-format msgid "ignored %s challenge" msgstr "" #: lib/neon/ne_auth.c:1304 #, fuzzy msgid "could not parse challenge" msgstr "chunk 礭ϤǤޤ" #: lib/neon/ne_207.c:198 #, c-format msgid "" "Invalid HTTP status line in status element at line %d of response:\n" "Status line was: %s" msgstr "" #: lib/neon/ne_locks.c:584 msgid "LOCK response missing Lock-Token header" msgstr "" #: lib/neon/ne_locks.c:759 #, c-format msgid "Response missing activelock for %s" msgstr "" #: lib/neon/ne_locks.c:801 #, c-format msgid "No activelock for <%s> returned in LOCK refresh response" msgstr "" #: lib/rpmatch.c:79 msgid "^[yY]" msgstr "" #: lib/rpmatch.c:82 msgid "^[nN]" msgstr "" #: lib/getopt.c:664 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: ץ `%s' ʣΰ̣˲Ǥޤ\n" #: lib/getopt.c:688 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: ץ `--%s' ˰פǤ\n" #: lib/getopt.c:693 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: ץ `%c%s' ˰פǤ\n" #: lib/getopt.c:710 lib/getopt.c:883 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: ץ `--%s' ˰ɬפǤ\n" #: lib/getopt.c:739 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: ץ `--%s' Ϥޤ\n" #: lib/getopt.c:743 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: ץ `%c%s' Ϥޤ\n" #: lib/getopt.c:769 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: ʥץ -- %c\n" #: lib/getopt.c:772 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: ̵ʥץ -- %c\n" #: lib/getopt.c:802 lib/getopt.c:932 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: ɬפʥץ -- %c\n" #: lib/getopt.c:849 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: ץ `-W %s' ʣΰ̣˲Ǥޤ\n" #: lib/getopt.c:867 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: ץ `-W %s' ϰפǤ\n" #, fuzzy #~ msgid "%s: %s" #~ msgstr "桼̾: %s\n" #~ msgid "%s: Aborted.\n" #~ msgstr "%s: Ǥޤ\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal: %s (%d)\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: ʥ %s (%d) ޤ\n" #~ msgid "" #~ "\n" #~ "\n" #~ "%s: Caught signal %d\n" #~ msgstr "" #~ "\n" #~ "\n" #~ "%s: ʥ %d ޤ\n" #~ msgid "%s: Terminating.\n" #~ msgstr "%s: λƤޤ\n" #, fuzzy #~ msgid " of request body file: %s" #~ msgstr "ե뤬񤱤ޤ: %s" #, fuzzy #~ msgid "Error reading request body." #~ msgstr "chunked response body ɤޤ" #, fuzzy #~ msgid "unknown error code" #~ msgstr "̤ΤΥƥ२顼" #~ msgid "Error reading chunked response body" #~ msgstr "chunked response body ɤޤ" #~ msgid "" #~ "The server did not authenticate itself correctly.\n" #~ "Report this error to your server administrator." #~ msgstr "" #~ "ΥСʪǤ뤳ȤǧǤޤǤ\n" #~ "СԤˤΥ顼ϢƲ" #~ msgid "" #~ "The proxy server did not authenticate itself correctly.\n" #~ "Report this error to your proxy server administrator." #~ msgstr "" #~ "ΥץСʪǤ뤳ȤǧǤޤǤ\n" #~ "ץСԤˤΥ顼ϢƲ" #, fuzzy #~ msgid "Recent Changes" #~ msgstr "%s ѹ" #, fuzzy #~ msgid "Changed Items" #~ msgstr "%s ѹ" #, fuzzy #~ msgid "Deleted Items" #~ msgstr "%s " #~ msgid "%s: Failed to fetch file listing for verification.\n" #~ msgstr "%s: ӳǧ˥Сˤեΰ˼Ԥޤ\n" #~ msgid "%s: Verify indicates differences.\n" #~ msgstr "%s: ӳǧǰۤʤե뤬ޤ\n" sitecopy-0.16.6/po/Makevars0000664000076400007640000000204410165765223013712 0ustar joejoe# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = sitecopy # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Joe Orton # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = sitecopy-0.16.6/po/remove-potcdate.sin0000664000076400007640000000066010165765223016031 0ustar joejoe# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } sitecopy-0.16.6/po/Rules-quot0000664000076400007640000000337611035206526014223 0ustar joejoe# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header sitecopy-0.16.6/config.h.in0000664000076400007640000005047711037462404013632 0ustar joejoe/* config.h.in. Generated from configure.in by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to specific EGD socket path */ #undef EGD_PATH /* Define if EGD should be supported */ #undef ENABLE_EGD /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define if GSS_C_NT_HOSTBASED_SERVICE is not defined otherwise */ #undef GSS_C_NT_HOSTBASED_SERVICE /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if the compiler understands __builtin_expect. */ #undef HAVE_BUILTIN_EXPECT /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define to 1 if you have the `CRYPTO_set_idptr_callback' function. */ #undef HAVE_CRYPTO_SET_IDPTR_CALLBACK /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FEOF_UNLOCKED /* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FGETS_UNLOCKED /* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_GETC_UNLOCKED /* Define to 1 if you have the declaration of `h_errno', and to 0 if you don't. */ #undef HAVE_DECL_H_ERRNO /* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't. */ #undef HAVE_DECL_STPCPY /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the declaration of `_snprintf', and to 0 if you don't. */ #undef HAVE_DECL__SNPRINTF /* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you don't. */ #undef HAVE_DECL__SNWPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define if you have expat */ #undef HAVE_EXPAT /* Define to 1 if you have the `fcntl' function. */ #undef HAVE_FCNTL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fstat64' function. */ #undef HAVE_FSTAT64 /* Define to 1 if you have the `fwprintf' function. */ #undef HAVE_FWPRINTF /* Define to 1 if you have the `gai_strerror' function. */ #undef HAVE_GAI_STRERROR /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getegid' function. */ #undef HAVE_GETEGID /* Define to 1 if you have the `geteuid' function. */ #undef HAVE_GETEUID /* Define to 1 if you have the `getgid' function. */ #undef HAVE_GETGID /* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `getsockopt' function. */ #undef HAVE_GETSOCKOPT /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define if GnuTLS support is enabled */ #undef HAVE_GNUTLS /* Define to 1 if you have the `gnutls_session_get_data2' function. */ #undef HAVE_GNUTLS_SESSION_GET_DATA2 /* Define to 1 if you have the `gnutls_sign_callback_set' function. */ #undef HAVE_GNUTLS_SIGN_CALLBACK_SET /* Define to 1 if you have the `gnutls_x509_dn_get_rdn_ava' function. */ #undef HAVE_GNUTLS_X509_DN_GET_RDN_AVA /* Define if GSSAPI support is enabled */ #undef HAVE_GSSAPI /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_GENERIC_H /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_H /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_H /* Define to 1 if you have the `gss_init_sec_context' function. */ #undef HAVE_GSS_INIT_SEC_CONTEXT /* Define to 1 if you have the `hstrerror' function. */ #undef HAVE_HSTRERROR /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_ICONV_H /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define if you have the 'intmax_t' type in or . */ #undef HAVE_INTMAX_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_INTTYPES_H_WITH_UINTMAX /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define if you have libxml */ #undef HAVE_LIBXML /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_PARSER_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_XMLVERSION_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if you have the `lseek64' function. */ #undef HAVE_LSEEK64 /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mempcpy' function. */ #undef HAVE_MEMPCPY /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_TCP_H /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Define if you have and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined. */ #undef HAVE_NL_LOCALE_NAME /* Define if OpenSSL support is enabled */ #undef HAVE_OPENSSL /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_OPENSSLV_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SSL_H /* Define if pakchois library supported */ #undef HAVE_PAKCHOIS /* Define to 1 if you have the `pipe' function. */ #undef HAVE_PIPE /* Define to 1 if you have the `poll' function. */ #undef HAVE_POLL /* Define if your printf() function supports format strings with positions. */ #undef HAVE_POSIX_PRINTF /* Define to 1 if you have the `pthread_mutex_init' function. */ #undef HAVE_PTHREAD_MUTEX_INIT /* Define to 1 if you have the `pthread_mutex_lock' function. */ #undef HAVE_PTHREAD_MUTEX_LOCK /* Define if the defines PTHREAD_MUTEX_RECURSIVE. */ #undef HAVE_PTHREAD_MUTEX_RECURSIVE /* Define if the POSIX multithreading library has read/write locks. */ #undef HAVE_PTHREAD_RWLOCK /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the header file. */ #undef HAVE_REGEX_H /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `setsockopt' function. */ #undef HAVE_SETSOCKOPT /* Define to 1 if you have the `setvbuf' function. */ #undef HAVE_SETVBUF /* Define to 1 if you have the `signal' function. */ #undef HAVE_SIGNAL /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `socketpair' function. */ #undef HAVE_SOCKETPAIR /* Define to 1 if the system has the type `socklen_t'. */ #undef HAVE_SOCKLEN_T /* Define to 1 if you have the header file. */ #undef HAVE_SOCKS_H /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_STDINT_H_WITH_UINTMAX /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `stpcpy' function. */ #undef HAVE_STPCPY /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Define to 1 if you have the `strtoq' function. */ #undef HAVE_STRTOQ /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if `tm_gmtoff' is member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_GMTOFF /* Define to 1 if `__tm_gmtoff' is member of `struct tm'. */ #undef HAVE_STRUCT_TM___TM_GMTOFF /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_POLL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define if the timezone global is available */ #undef HAVE_TIMEZONE /* Use trio printf replacement library */ #undef HAVE_TRIO /* Define to 1 if you have the header file. */ #undef HAVE_TRIO_H /* Define to 1 if you have the `tsearch' function. */ #undef HAVE_TSEARCH /* Define if you have the 'uintmax_t' type in or . */ #undef HAVE_UINTMAX_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define to 1 or 0, depending whether the compiler supports simple visibility declarations. */ #undef HAVE_VISIBILITY /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define if you have the 'wchar_t' type. */ #undef HAVE_WCHAR_T /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN /* Define if you have the 'wint_t' type. */ #undef HAVE_WINT_T /* Define if using expat which includes xmlparse.h */ #undef HAVE_XMLPARSE_H /* Define to 1 if you have the `\' function. */ #undef HAVE__ /* Define to 1 if you have the `__fsetlocking' function. */ #undef HAVE___FSETLOCKING /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Define if integer division by zero raises signal SIGFPE. */ #undef INTDIV0_RAISES_SIGFPE /* Define to be the neon version string */ #undef NEON_VERSION /* Define to enable debugging */ #undef NE_DEBUGGING /* Define to be printf format string for ne_off_t */ #undef NE_FMT_NE_OFF_T /* Define to be printf format string for off64_t */ #undef NE_FMT_OFF64_T /* Define to be printf format string for off_t */ #undef NE_FMT_OFF_T /* Define to be printf format string for size_t */ #undef NE_FMT_SIZE_T /* Define to be printf format string for ssize_t */ #undef NE_FMT_SSIZE_T /* Define to be printf format string for XML_Size */ #undef NE_FMT_XML_SIZE /* Defined if DAV is supported */ #undef NE_HAVE_DAV /* Defined if IPV6 is supported */ #undef NE_HAVE_IPV6 /* Defined if LFS is supported */ #undef NE_HAVE_LFS /* Defined if SOCKS is supported */ #undef NE_HAVE_SOCKS /* Defined if SSL is supported */ #undef NE_HAVE_SSL /* Defined if TS_SSL is supported */ #undef NE_HAVE_TS_SSL /* Defined if ZLIB is supported */ #undef NE_HAVE_ZLIB /* Define to be filename of an SSL CA root bundle */ #undef NE_SSL_CA_BUNDLE /* Define if poll() should be used */ #undef NE_USE_POLL /* Define to be neon library major version */ #undef NE_VERSION_MAJOR /* Define to be neon library minor version */ #undef NE_VERSION_MINOR /* Define to be neon library patch version */ #undef NE_VERSION_PATCH /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define if exists and defines unusable PRI* macros. */ #undef PRI_MACROS_BROKEN /* Define if the pthread_in_use() detection is hard. */ #undef PTHREAD_IN_USE_DETECTION_HARD /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* The size of `off64_t', as computed by sizeof. */ #undef SIZEOF_OFF64_T /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T /* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T /* The size of `ssize_t', as computed by sizeof. */ #undef SIZEOF_SSIZE_T /* The size of `XML_Size', as computed by sizeof. */ #undef SIZEOF_XML_SIZE /* Define as the maximum value of type 'size_t', if the system doesn't define it. */ #undef SIZE_MAX /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Define to compile the WebDAV protocol driver */ #undef USE_DAV /* Define to compile the FTP protocol driver */ #undef USE_FTP /* Define if getaddrinfo supports AI_ADDRCONFIG */ #undef USE_GAI_ADDRCONFIG /* Define if getaddrinfo() should be used */ #undef USE_GETADDRINFO /* Define if the POSIX multithreading library can be used. */ #undef USE_POSIX_THREADS /* Define if references to the POSIX multithreading library should be made weak. */ #undef USE_POSIX_THREADS_WEAK /* Define if the GNU Pth multithreading library can be used. */ #undef USE_PTH_THREADS /* Define if references to the GNU Pth multithreading library should be made weak. */ #undef USE_PTH_THREADS_WEAK /* Define to compile the rsh/rcp protocol driver */ #undef USE_RSH /* Define to compile the sftp/ssh protocol driver */ #undef USE_SFTP /* Define if the old Solaris multithreading library can be used. */ #undef USE_SOLARIS_THREADS /* Define if references to the old Solaris multithreading library should be made weak. */ #undef USE_SOLARIS_THREADS_WEAK /* Define if the Win32 multithreading API can be used. */ #undef USE_WIN32_THREADS /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Enable extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define if in_addr_t is not available */ #undef in_addr_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to be the type of the third argument to getsockname */ #undef ksize_t /* Define to `long int' if does not define. */ #undef off_t /* Define as the type of the result of subtracting two pointers, if the system doesn't define it. */ #undef ptrdiff_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define if socklen_t is not available */ #undef socklen_t /* Define to unsigned long or unsigned long long if and don't define. */ #undef uintmax_t #if defined(HAVE_STPCPY) && defined(HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY && !defined(stpcpy) char *stpcpy(char *, const char *); #endif #define __libc_lock_t gl_lock_t #define __libc_lock_define gl_lock_define #define __libc_lock_define_initialized gl_lock_define_initialized #define __libc_lock_init gl_lock_init #define __libc_lock_lock gl_lock_lock #define __libc_lock_unlock gl_lock_unlock #define __libc_lock_recursive_t gl_recursive_lock_t #define __libc_lock_define_recursive gl_recursive_lock_define #define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized #define __libc_lock_init_recursive gl_recursive_lock_init #define __libc_lock_lock_recursive gl_recursive_lock_lock #define __libc_lock_unlock_recursive gl_recursive_lock_unlock #define glthread_in_use libintl_thread_in_use #define glthread_lock_init libintl_lock_init #define glthread_lock_lock libintl_lock_lock #define glthread_lock_unlock libintl_lock_unlock #define glthread_lock_destroy libintl_lock_destroy #define glthread_rwlock_init libintl_rwlock_init #define glthread_rwlock_rdlock libintl_rwlock_rdlock #define glthread_rwlock_wrlock libintl_rwlock_wrlock #define glthread_rwlock_unlock libintl_rwlock_unlock #define glthread_rwlock_destroy libintl_rwlock_destroy #define glthread_recursive_lock_init libintl_recursive_lock_init #define glthread_recursive_lock_lock libintl_recursive_lock_lock #define glthread_recursive_lock_unlock libintl_recursive_lock_unlock #define glthread_recursive_lock_destroy libintl_recursive_lock_destroy #define glthread_once libintl_once #define glthread_once_call libintl_once_call #define glthread_once_singlethreaded libintl_once_singlethreaded sitecopy-0.16.6/intl/0000755000076400007640000000000011030440077012531 5ustar joejoesitecopy-0.16.6/intl/dcgettext.c0000644000076400007640000000342110243450466014700 0ustar joejoe/* Implementation of the dcgettext(3) function. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.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 DCGETTEXT __dcgettext # define DCIGETTEXT __dcigettext #else # define DCGETTEXT libintl_dcgettext # define DCIGETTEXT libintl_dcigettext #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCGETTEXT (const char *domainname, const char *msgid, int category) { return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ INTDEF(__dcgettext) weak_alias (__dcgettext, dcgettext); #endif sitecopy-0.16.6/intl/intl-compat.c0000644000076400007640000000662410273400522015133 0ustar joejoe/* intl-compat.c - Stub functions to call gettext functions from GNU gettext Library. Copyright (C) 1995, 2000-2003, 2005 Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" /* @@ end of prolog @@ */ /* This file redirects the gettext functions (without prefix) to those defined in the included GNU libintl library (with "libintl_" prefix). It is compiled into libintl in order to make the AM_GNU_GETTEXT test of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which has the redirections primarily in the include file. It is also compiled into libgnuintl so that libgnuintl.so can be used as LD_PRELOADable library on glibc systems, to provide the extra features that the functions in the libc don't have (namely, logging). */ #undef gettext #undef dgettext #undef dcgettext #undef ngettext #undef dngettext #undef dcngettext #undef textdomain #undef bindtextdomain #undef bind_textdomain_codeset /* When building a DLL, we must export some functions. Note that because the functions are only defined for binary backward compatibility, we don't need to use __declspec(dllimport) in any case. */ #if HAVE_VISIBILITY && BUILDING_DLL # define DLL_EXPORTED __attribute__((__visibility__("default"))) #elif defined _MSC_VER && BUILDING_DLL # define DLL_EXPORTED __declspec(dllexport) #else # define DLL_EXPORTED #endif DLL_EXPORTED char * gettext (const char *msgid) { return libintl_gettext (msgid); } DLL_EXPORTED char * dgettext (const char *domainname, const char *msgid) { return libintl_dgettext (domainname, msgid); } DLL_EXPORTED char * dcgettext (const char *domainname, const char *msgid, int category) { return libintl_dcgettext (domainname, msgid, category); } DLL_EXPORTED char * ngettext (const char *msgid1, const char *msgid2, unsigned long int n) { return libintl_ngettext (msgid1, msgid2, n); } DLL_EXPORTED char * dngettext (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n) { return libintl_dngettext (domainname, msgid1, msgid2, n); } DLL_EXPORTED char * dcngettext (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n, int category) { return libintl_dcngettext (domainname, msgid1, msgid2, n, category); } DLL_EXPORTED char * textdomain (const char *domainname) { return libintl_textdomain (domainname); } DLL_EXPORTED char * bindtextdomain (const char *domainname, const char *dirname) { return libintl_bindtextdomain (domainname, dirname); } DLL_EXPORTED char * bind_textdomain_codeset (const char *domainname, const char *codeset) { return libintl_bind_textdomain_codeset (domainname, codeset); } sitecopy-0.16.6/intl/COPYING.LIB-2.00000644000076400007640000006131310243450466014502 0ustar joejoe GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Library 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This 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. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! sitecopy-0.16.6/intl/ref-del.sin0000644000076400007640000000203010243450467014566 0ustar joejoe# Remove this package from a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program 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, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. # # Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// s/ @PACKAGE@ / / s/^/# Packages using this file:/ } sitecopy-0.16.6/intl/localealias.c0000644000076400007640000002454610521642220015157 0ustar joejoe/* Handle aliases for locale names. Copyright (C) 1995-1999, 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #if defined _LIBC || defined HAVE___FSETLOCKING # include #endif #include #ifdef __GNUC__ # undef alloca # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #include #include "gettextP.h" #if ENABLE_RELOCATABLE # include "relocatable.h" #else # define relocate(pathname) (pathname) #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 strcasecmp __strcasecmp # ifndef mempcpy # define mempcpy __mempcpy # endif # define HAVE_MEMPCPY 1 # define HAVE___FSETLOCKING 1 #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include #else # include "lock.h" #endif #ifndef internal_function # define internal_function #endif /* Some optimizations for glibc. */ #ifdef _LIBC # define FEOF(fp) feof_unlocked (fp) # define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp) #else # define FEOF(fp) feof (fp) # define FGETS(buf, n, fp) fgets (buf, n, fp) #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif #if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED # undef fgets # define fgets(buf, len, s) fgets_unlocked (buf, len, s) #endif #if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED # undef feof # define feof(s) feof_unlocked (s) #endif __libc_lock_define_initialized (static, lock) struct alias_map { const char *alias; const char *value; }; #ifndef _LIBC # define libc_freeres_ptr(decl) decl #endif libc_freeres_ptr (static char *string_space); static size_t string_space_act; static size_t string_space_max; libc_freeres_ptr (static struct alias_map *map); static size_t nmap; static size_t maxmap; /* Prototypes for local functions. */ static size_t read_alias_file (const char *fname, int fname_len) internal_function; static int extend_alias_table (void); static int alias_compare (const struct alias_map *map1, const struct alias_map *map2); const char * _nl_expand_alias (const char *name) { static const char *locale_alias_path; struct alias_map *retval; const char *result = NULL; size_t added; __libc_lock_lock (lock); if (locale_alias_path == NULL) locale_alias_path = LOCALE_ALIAS_PATH; do { struct alias_map item; item.alias = name; if (nmap > 0) retval = (struct alias_map *) bsearch (&item, map, nmap, sizeof (struct alias_map), (int (*) (const void *, const void *) ) alias_compare); else retval = NULL; /* We really found an alias. Return the value. */ if (retval != NULL) { result = retval->value; break; } /* 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] == PATH_SEPARATOR) ++locale_alias_path; start = locale_alias_path; while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR) ++locale_alias_path; if (start < locale_alias_path) added = read_alias_file (start, locale_alias_path - start); } } while (added != 0); __libc_lock_unlock (lock); return result; } static size_t internal_function read_alias_file (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); #ifdef HAVE_MEMPCPY mempcpy (mempcpy (full_fname, fname, fname_len), aliasfile, sizeof aliasfile); #else memcpy (full_fname, fname, fname_len); memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); #endif #ifdef _LIBC /* Note the file is opened with cancellation in the I/O functions disabled. */ fp = fopen (relocate (full_fname), "rc"); #else fp = fopen (relocate (full_fname), "r"); #endif freea (full_fname); if (fp == NULL) return 0; #ifdef HAVE___FSETLOCKING /* No threads present. */ __fsetlocking (fp, FSETLOCKING_BYCALLER); #endif 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 We avoid a multi-kilobyte buffer here since this would use up stack space which we might not have if the program ran out of memory. */ char buf[400]; char *alias; char *value; char *cp; int complete_line; if (FGETS (buf, sizeof buf, fp) == NULL) /* EOF reached. */ break; /* Determine whether the line is complete. */ complete_line = strchr (buf, '\n') != NULL; cp = buf; /* Ignore leading white space. */ while (isspace ((unsigned char) cp[0])) ++cp; /* A leading '#' signals a comment line. */ if (cp[0] != '\0' && cp[0] != '#') { alias = cp++; while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) ++cp; /* Terminate alias name. */ if (cp[0] != '\0') *cp++ = '\0'; /* Now look for the beginning of the value. */ while (isspace ((unsigned char) cp[0])) ++cp; if (cp[0] != '\0') { value = cp++; while (cp[0] != '\0' && !isspace ((unsigned char) 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'; #ifdef IN_LIBGLOCALE /* glibc's locale.alias contains entries for ja_JP and ko_KR that make it impossible to use a Japanese or Korean UTF-8 locale under the name "ja_JP" or "ko_KR". Ignore these entries. */ if (strchr (alias, '_') == NULL) #endif { size_t alias_len; size_t value_len; if (nmap >= maxmap) if (__builtin_expect (extend_alias_table (), 0)) goto out; alias_len = strlen (alias) + 1; value_len = strlen (value) + 1; if (string_space_act + alias_len + value_len > string_space_max) { /* Increase size of memory pool. */ size_t new_size = (string_space_max + (alias_len + value_len > 1024 ? alias_len + value_len : 1024)); char *new_pool = (char *) realloc (string_space, new_size); if (new_pool == NULL) goto out; if (__builtin_expect (string_space != new_pool, 0)) { size_t i; for (i = 0; i < nmap; i++) { map[i].alias += new_pool - string_space; map[i].value += new_pool - string_space; } } string_space = new_pool; string_space_max = new_size; } map[nmap].alias = (const char *) memcpy (&string_space[string_space_act], alias, alias_len); string_space_act += alias_len; map[nmap].value = (const char *) memcpy (&string_space[string_space_act], value, value_len); string_space_act += value_len; ++nmap; ++added; } } } /* Possibly not the whole line fits into the buffer. Ignore the rest of the line. */ if (! complete_line) do if (FGETS (buf, sizeof buf, fp) == NULL) /* Make sure the inner loop will be left. The outer loop will exit at the `feof' test. */ break; while (strchr (buf, '\n') == NULL); } out: /* 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 (*) (const void *, const void *)) alias_compare); return added; } static int extend_alias_table () { size_t new_size; struct alias_map *new_map; new_size = maxmap == 0 ? 100 : 2 * maxmap; new_map = (struct alias_map *) realloc (map, (new_size * sizeof (struct alias_map))); if (new_map == NULL) /* Simply don't extend: we don't have any more core. */ return -1; map = new_map; maxmap = new_size; return 0; } static int alias_compare (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; ++p1; ++p2; } while (c1 == c2); return c1 - c2; #endif } sitecopy-0.16.6/intl/os2compat.h0000644000076400007640000000302610243450466014622 0ustar joejoe/* OS/2 compatibility defines. This file is intended to be included from config.h Copyright (C) 2001-2002 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* When included from os2compat.h we need all the original definitions */ #ifndef OS2_AWARE #undef LIBDIR #define LIBDIR _nlos2_libdir extern char *_nlos2_libdir; #undef LOCALEDIR #define LOCALEDIR _nlos2_localedir extern char *_nlos2_localedir; #undef LOCALE_ALIAS_PATH #define LOCALE_ALIAS_PATH _nlos2_localealiaspath extern char *_nlos2_localealiaspath; #endif #undef HAVE_STRCASECMP #define HAVE_STRCASECMP 1 #define strcasecmp stricmp #define strncasecmp strnicmp /* We have our own getenv() which works even if library is compiled as DLL */ #define getenv _nl_getenv /* Older versions of gettext used -1 as the value of LC_MESSAGES */ #define LC_MESSAGES_COMPAT (-1) sitecopy-0.16.6/intl/ref-add.sin0000644000076400007640000000210510243450467014555 0ustar joejoe# Add this package to a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program 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, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. # # Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// ta :a s/ @PACKAGE@ / @PACKAGE@ / tb s/ $/ @PACKAGE@ / :b s/^/# Packages using this file:/ } sitecopy-0.16.6/intl/lock.c0000644000076400007640000005413010512434754013641 0ustar joejoe/* Locking in multithreaded situations. Copyright (C) 2005-2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible , 2005. Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, gthr-win32.h. */ #include #include "lock.h" /* ========================================================================= */ #if USE_POSIX_THREADS /* Use the POSIX threads library. */ # if PTHREAD_IN_USE_DETECTION_HARD /* The function to be executed by a dummy thread. */ static void * dummy_thread_func (void *arg) { return arg; } int glthread_in_use (void) { static int tested; static int result; /* 1: linked with -lpthread, 0: only with libc */ if (!tested) { pthread_t thread; if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0) /* Thread creation failed. */ result = 0; else { /* Thread creation works. */ void *retval; if (pthread_join (thread, &retval) != 0) abort (); result = 1; } tested = 1; } return result; } # endif /* -------------------------- gl_lock_t datatype -------------------------- */ /* ------------------------- gl_rwlock_t datatype ------------------------- */ # if HAVE_PTHREAD_RWLOCK # if !defined PTHREAD_RWLOCK_INITIALIZER void glthread_rwlock_init (gl_rwlock_t *lock) { if (pthread_rwlock_init (&lock->rwlock, NULL) != 0) abort (); lock->initialized = 1; } void glthread_rwlock_rdlock (gl_rwlock_t *lock) { if (!lock->initialized) { if (pthread_mutex_lock (&lock->guard) != 0) abort (); if (!lock->initialized) glthread_rwlock_init (lock); if (pthread_mutex_unlock (&lock->guard) != 0) abort (); } if (pthread_rwlock_rdlock (&lock->rwlock) != 0) abort (); } void glthread_rwlock_wrlock (gl_rwlock_t *lock) { if (!lock->initialized) { if (pthread_mutex_lock (&lock->guard) != 0) abort (); if (!lock->initialized) glthread_rwlock_init (lock); if (pthread_mutex_unlock (&lock->guard) != 0) abort (); } if (pthread_rwlock_wrlock (&lock->rwlock) != 0) abort (); } void glthread_rwlock_unlock (gl_rwlock_t *lock) { if (!lock->initialized) abort (); if (pthread_rwlock_unlock (&lock->rwlock) != 0) abort (); } void glthread_rwlock_destroy (gl_rwlock_t *lock) { if (!lock->initialized) abort (); if (pthread_rwlock_destroy (&lock->rwlock) != 0) abort (); lock->initialized = 0; } # endif # else void glthread_rwlock_init (gl_rwlock_t *lock) { if (pthread_mutex_init (&lock->lock, NULL) != 0) abort (); if (pthread_cond_init (&lock->waiting_readers, NULL) != 0) abort (); if (pthread_cond_init (&lock->waiting_writers, NULL) != 0) abort (); lock->waiting_writers_count = 0; lock->runcount = 0; } void glthread_rwlock_rdlock (gl_rwlock_t *lock) { if (pthread_mutex_lock (&lock->lock) != 0) abort (); /* Test whether only readers are currently running, and whether the runcount field will not overflow. */ /* POSIX says: "It is implementation-defined whether the calling thread acquires the lock when a writer does not hold the lock and there are writers blocked on the lock." Let's say, no: give the writers a higher priority. */ while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_readers. */ if (pthread_cond_wait (&lock->waiting_readers, &lock->lock) != 0) abort (); } lock->runcount++; if (pthread_mutex_unlock (&lock->lock) != 0) abort (); } void glthread_rwlock_wrlock (gl_rwlock_t *lock) { if (pthread_mutex_lock (&lock->lock) != 0) abort (); /* Test whether no readers or writers are currently running. */ while (!(lock->runcount == 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_writers. */ lock->waiting_writers_count++; if (pthread_cond_wait (&lock->waiting_writers, &lock->lock) != 0) abort (); lock->waiting_writers_count--; } lock->runcount--; /* runcount becomes -1 */ if (pthread_mutex_unlock (&lock->lock) != 0) abort (); } void glthread_rwlock_unlock (gl_rwlock_t *lock) { if (pthread_mutex_lock (&lock->lock) != 0) abort (); if (lock->runcount < 0) { /* Drop a writer lock. */ if (!(lock->runcount == -1)) abort (); lock->runcount = 0; } else { /* Drop a reader lock. */ if (!(lock->runcount > 0)) abort (); lock->runcount--; } if (lock->runcount == 0) { /* POSIX recommends that "write locks shall take precedence over read locks", to avoid "writer starvation". */ if (lock->waiting_writers_count > 0) { /* Wake up one of the waiting writers. */ if (pthread_cond_signal (&lock->waiting_writers) != 0) abort (); } else { /* Wake up all waiting readers. */ if (pthread_cond_broadcast (&lock->waiting_readers) != 0) abort (); } } if (pthread_mutex_unlock (&lock->lock) != 0) abort (); } void glthread_rwlock_destroy (gl_rwlock_t *lock) { if (pthread_mutex_destroy (&lock->lock) != 0) abort (); if (pthread_cond_destroy (&lock->waiting_readers) != 0) abort (); if (pthread_cond_destroy (&lock->waiting_writers) != 0) abort (); } # endif /* --------------------- gl_recursive_lock_t datatype --------------------- */ # if HAVE_PTHREAD_MUTEX_RECURSIVE # if !(defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) void glthread_recursive_lock_init (gl_recursive_lock_t *lock) { pthread_mutexattr_t attributes; if (pthread_mutexattr_init (&attributes) != 0) abort (); if (pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE) != 0) abort (); if (pthread_mutex_init (&lock->recmutex, &attributes) != 0) abort (); if (pthread_mutexattr_destroy (&attributes) != 0) abort (); lock->initialized = 1; } void glthread_recursive_lock_lock (gl_recursive_lock_t *lock) { if (!lock->initialized) { if (pthread_mutex_lock (&lock->guard) != 0) abort (); if (!lock->initialized) glthread_recursive_lock_init (lock); if (pthread_mutex_unlock (&lock->guard) != 0) abort (); } if (pthread_mutex_lock (&lock->recmutex) != 0) abort (); } void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock) { if (!lock->initialized) abort (); if (pthread_mutex_unlock (&lock->recmutex) != 0) abort (); } void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) { if (!lock->initialized) abort (); if (pthread_mutex_destroy (&lock->recmutex) != 0) abort (); lock->initialized = 0; } # endif # else void glthread_recursive_lock_init (gl_recursive_lock_t *lock) { if (pthread_mutex_init (&lock->mutex, NULL) != 0) abort (); lock->owner = (pthread_t) 0; lock->depth = 0; } void glthread_recursive_lock_lock (gl_recursive_lock_t *lock) { pthread_t self = pthread_self (); if (lock->owner != self) { if (pthread_mutex_lock (&lock->mutex) != 0) abort (); lock->owner = self; } if (++(lock->depth) == 0) /* wraparound? */ abort (); } void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock) { if (lock->owner != pthread_self ()) abort (); if (lock->depth == 0) abort (); if (--(lock->depth) == 0) { lock->owner = (pthread_t) 0; if (pthread_mutex_unlock (&lock->mutex) != 0) abort (); } } void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) { if (lock->owner != (pthread_t) 0) abort (); if (pthread_mutex_destroy (&lock->mutex) != 0) abort (); } # endif /* -------------------------- gl_once_t datatype -------------------------- */ static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT; int glthread_once_singlethreaded (pthread_once_t *once_control) { /* We don't know whether pthread_once_t is an integer type, a floating-point type, a pointer type, or a structure type. */ char *firstbyte = (char *)once_control; if (*firstbyte == *(const char *)&fresh_once) { /* First time use of once_control. Invert the first byte. */ *firstbyte = ~ *(const char *)&fresh_once; return 1; } else return 0; } #endif /* ========================================================================= */ #if USE_PTH_THREADS /* Use the GNU Pth threads library. */ /* -------------------------- gl_lock_t datatype -------------------------- */ /* ------------------------- gl_rwlock_t datatype ------------------------- */ /* --------------------- gl_recursive_lock_t datatype --------------------- */ /* -------------------------- gl_once_t datatype -------------------------- */ void glthread_once_call (void *arg) { void (**gl_once_temp_addr) (void) = (void (**) (void)) arg; void (*initfunction) (void) = *gl_once_temp_addr; initfunction (); } int glthread_once_singlethreaded (pth_once_t *once_control) { /* We know that pth_once_t is an integer type. */ if (*once_control == PTH_ONCE_INIT) { /* First time use of once_control. Invert the marker. */ *once_control = ~ PTH_ONCE_INIT; return 1; } else return 0; } #endif /* ========================================================================= */ #if USE_SOLARIS_THREADS /* Use the old Solaris threads library. */ /* -------------------------- gl_lock_t datatype -------------------------- */ /* ------------------------- gl_rwlock_t datatype ------------------------- */ /* --------------------- gl_recursive_lock_t datatype --------------------- */ void glthread_recursive_lock_init (gl_recursive_lock_t *lock) { if (mutex_init (&lock->mutex, USYNC_THREAD, NULL) != 0) abort (); lock->owner = (thread_t) 0; lock->depth = 0; } void glthread_recursive_lock_lock (gl_recursive_lock_t *lock) { thread_t self = thr_self (); if (lock->owner != self) { if (mutex_lock (&lock->mutex) != 0) abort (); lock->owner = self; } if (++(lock->depth) == 0) /* wraparound? */ abort (); } void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock) { if (lock->owner != thr_self ()) abort (); if (lock->depth == 0) abort (); if (--(lock->depth) == 0) { lock->owner = (thread_t) 0; if (mutex_unlock (&lock->mutex) != 0) abort (); } } void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) { if (lock->owner != (thread_t) 0) abort (); if (mutex_destroy (&lock->mutex) != 0) abort (); } /* -------------------------- gl_once_t datatype -------------------------- */ void glthread_once (gl_once_t *once_control, void (*initfunction) (void)) { if (!once_control->inited) { /* Use the mutex to guarantee that if another thread is already calling the initfunction, this thread waits until it's finished. */ if (mutex_lock (&once_control->mutex) != 0) abort (); if (!once_control->inited) { once_control->inited = 1; initfunction (); } if (mutex_unlock (&once_control->mutex) != 0) abort (); } } int glthread_once_singlethreaded (gl_once_t *once_control) { /* We know that gl_once_t contains an integer type. */ if (!once_control->inited) { /* First time use of once_control. Invert the marker. */ once_control->inited = ~ 0; return 1; } else return 0; } #endif /* ========================================================================= */ #if USE_WIN32_THREADS /* -------------------------- gl_lock_t datatype -------------------------- */ void glthread_lock_init (gl_lock_t *lock) { InitializeCriticalSection (&lock->lock); lock->guard.done = 1; } void glthread_lock_lock (gl_lock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_lock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } EnterCriticalSection (&lock->lock); } void glthread_lock_unlock (gl_lock_t *lock) { if (!lock->guard.done) abort (); LeaveCriticalSection (&lock->lock); } void glthread_lock_destroy (gl_lock_t *lock) { if (!lock->guard.done) abort (); DeleteCriticalSection (&lock->lock); lock->guard.done = 0; } /* ------------------------- gl_rwlock_t datatype ------------------------- */ static inline void gl_waitqueue_init (gl_waitqueue_t *wq) { wq->array = NULL; wq->count = 0; wq->alloc = 0; wq->offset = 0; } /* Enqueues the current thread, represented by an event, in a wait queue. Returns INVALID_HANDLE_VALUE if an allocation failure occurs. */ static HANDLE gl_waitqueue_add (gl_waitqueue_t *wq) { HANDLE event; unsigned int index; if (wq->count == wq->alloc) { unsigned int new_alloc = 2 * wq->alloc + 1; HANDLE *new_array = (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE)); if (new_array == NULL) /* No more memory. */ return INVALID_HANDLE_VALUE; /* Now is a good opportunity to rotate the array so that its contents starts at offset 0. */ if (wq->offset > 0) { unsigned int old_count = wq->count; unsigned int old_alloc = wq->alloc; unsigned int old_offset = wq->offset; unsigned int i; if (old_offset + old_count > old_alloc) { unsigned int limit = old_offset + old_count - old_alloc; for (i = 0; i < limit; i++) new_array[old_alloc + i] = new_array[i]; } for (i = 0; i < old_count; i++) new_array[i] = new_array[old_offset + i]; wq->offset = 0; } wq->array = new_array; wq->alloc = new_alloc; } event = CreateEvent (NULL, TRUE, FALSE, NULL); if (event == INVALID_HANDLE_VALUE) /* No way to allocate an event. */ return INVALID_HANDLE_VALUE; index = wq->offset + wq->count; if (index >= wq->alloc) index -= wq->alloc; wq->array[index] = event; wq->count++; return event; } /* Notifies the first thread from a wait queue and dequeues it. */ static inline void gl_waitqueue_notify_first (gl_waitqueue_t *wq) { SetEvent (wq->array[wq->offset + 0]); wq->offset++; wq->count--; if (wq->count == 0 || wq->offset == wq->alloc) wq->offset = 0; } /* Notifies all threads from a wait queue and dequeues them all. */ static inline void gl_waitqueue_notify_all (gl_waitqueue_t *wq) { unsigned int i; for (i = 0; i < wq->count; i++) { unsigned int index = wq->offset + i; if (index >= wq->alloc) index -= wq->alloc; SetEvent (wq->array[index]); } wq->count = 0; wq->offset = 0; } void glthread_rwlock_init (gl_rwlock_t *lock) { InitializeCriticalSection (&lock->lock); gl_waitqueue_init (&lock->waiting_readers); gl_waitqueue_init (&lock->waiting_writers); lock->runcount = 0; lock->guard.done = 1; } void glthread_rwlock_rdlock (gl_rwlock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_rwlock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } EnterCriticalSection (&lock->lock); /* Test whether only readers are currently running, and whether the runcount field will not overflow. */ if (!(lock->runcount + 1 > 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_readers. */ HANDLE event = gl_waitqueue_add (&lock->waiting_readers); if (event != INVALID_HANDLE_VALUE) { DWORD result; LeaveCriticalSection (&lock->lock); /* Wait until another thread signals this event. */ result = WaitForSingleObject (event, INFINITE); if (result == WAIT_FAILED || result == WAIT_TIMEOUT) abort (); CloseHandle (event); /* The thread which signalled the event already did the bookkeeping: removed us from the waiting_readers, incremented lock->runcount. */ if (!(lock->runcount > 0)) abort (); return; } else { /* Allocation failure. Weird. */ do { LeaveCriticalSection (&lock->lock); Sleep (1); EnterCriticalSection (&lock->lock); } while (!(lock->runcount + 1 > 0)); } } lock->runcount++; LeaveCriticalSection (&lock->lock); } void glthread_rwlock_wrlock (gl_rwlock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_rwlock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } EnterCriticalSection (&lock->lock); /* Test whether no readers or writers are currently running. */ if (!(lock->runcount == 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_writers. */ HANDLE event = gl_waitqueue_add (&lock->waiting_writers); if (event != INVALID_HANDLE_VALUE) { DWORD result; LeaveCriticalSection (&lock->lock); /* Wait until another thread signals this event. */ result = WaitForSingleObject (event, INFINITE); if (result == WAIT_FAILED || result == WAIT_TIMEOUT) abort (); CloseHandle (event); /* The thread which signalled the event already did the bookkeeping: removed us from the waiting_writers, set lock->runcount = -1. */ if (!(lock->runcount == -1)) abort (); return; } else { /* Allocation failure. Weird. */ do { LeaveCriticalSection (&lock->lock); Sleep (1); EnterCriticalSection (&lock->lock); } while (!(lock->runcount == 0)); } } lock->runcount--; /* runcount becomes -1 */ LeaveCriticalSection (&lock->lock); } void glthread_rwlock_unlock (gl_rwlock_t *lock) { if (!lock->guard.done) abort (); EnterCriticalSection (&lock->lock); if (lock->runcount < 0) { /* Drop a writer lock. */ if (!(lock->runcount == -1)) abort (); lock->runcount = 0; } else { /* Drop a reader lock. */ if (!(lock->runcount > 0)) abort (); lock->runcount--; } if (lock->runcount == 0) { /* POSIX recommends that "write locks shall take precedence over read locks", to avoid "writer starvation". */ if (lock->waiting_writers.count > 0) { /* Wake up one of the waiting writers. */ lock->runcount--; gl_waitqueue_notify_first (&lock->waiting_writers); } else { /* Wake up all waiting readers. */ lock->runcount += lock->waiting_readers.count; gl_waitqueue_notify_all (&lock->waiting_readers); } } LeaveCriticalSection (&lock->lock); } void glthread_rwlock_destroy (gl_rwlock_t *lock) { if (!lock->guard.done) abort (); if (lock->runcount != 0) abort (); DeleteCriticalSection (&lock->lock); if (lock->waiting_readers.array != NULL) free (lock->waiting_readers.array); if (lock->waiting_writers.array != NULL) free (lock->waiting_writers.array); lock->guard.done = 0; } /* --------------------- gl_recursive_lock_t datatype --------------------- */ void glthread_recursive_lock_init (gl_recursive_lock_t *lock) { lock->owner = 0; lock->depth = 0; InitializeCriticalSection (&lock->lock); lock->guard.done = 1; } void glthread_recursive_lock_lock (gl_recursive_lock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_recursive_lock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } { DWORD self = GetCurrentThreadId (); if (lock->owner != self) { EnterCriticalSection (&lock->lock); lock->owner = self; } if (++(lock->depth) == 0) /* wraparound? */ abort (); } } void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock) { if (lock->owner != GetCurrentThreadId ()) abort (); if (lock->depth == 0) abort (); if (--(lock->depth) == 0) { lock->owner = 0; LeaveCriticalSection (&lock->lock); } } void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) { if (lock->owner != 0) abort (); DeleteCriticalSection (&lock->lock); lock->guard.done = 0; } /* -------------------------- gl_once_t datatype -------------------------- */ void glthread_once (gl_once_t *once_control, void (*initfunction) (void)) { if (once_control->inited <= 0) { if (InterlockedIncrement (&once_control->started) == 0) { /* This thread is the first one to come to this once_control. */ InitializeCriticalSection (&once_control->lock); EnterCriticalSection (&once_control->lock); once_control->inited = 0; initfunction (); once_control->inited = 1; LeaveCriticalSection (&once_control->lock); } else { /* Undo last operation. */ InterlockedDecrement (&once_control->started); /* Some other thread has already started the initialization. Yield the CPU while waiting for the other thread to finish initializing and taking the lock. */ while (once_control->inited < 0) Sleep (0); if (once_control->inited <= 0) { /* Take the lock. This blocks until the other thread has finished calling the initfunction. */ EnterCriticalSection (&once_control->lock); LeaveCriticalSection (&once_control->lock); if (!(once_control->inited > 0)) abort (); } } } } #endif /* ========================================================================= */ sitecopy-0.16.6/intl/textdomain.c0000644000076400007640000000746610523627535015102 0ustar joejoe/* Implementation of the textdomain(3) function. Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include # define gl_rwlock_define __libc_rwlock_define # define gl_rwlock_wrlock __libc_rwlock_wrlock # define gl_rwlock_unlock __libc_rwlock_unlock #else # include "lock.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 TEXTDOMAIN __textdomain # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define TEXTDOMAIN libintl_textdomain #endif /* Lock variable to protect the global data in the gettext implementation. */ gl_rwlock_define (extern, _nl_state_lock attribute_hidden) /* 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 (const char *domainname) { char *new_domain; char *old_domain; /* A NULL pointer requests the current setting. */ if (domainname == NULL) return (char *) _nl_current_default_domain; gl_rwlock_wrlock (_nl_state_lock); old_domain = (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; new_domain = (char *) _nl_current_default_domain; } else if (strcmp (domainname, old_domain) == 0) /* This can happen and people will use it to signal that some environment variable changed. */ new_domain = old_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. */ #if defined _LIBC || defined HAVE_STRDUP new_domain = strdup (domainname); #else size_t len = strlen (domainname) + 1; new_domain = (char *) malloc (len); if (new_domain != NULL) memcpy (new_domain, domainname, len); #endif if (new_domain != NULL) _nl_current_default_domain = new_domain; } /* We use this possibility to signal a change of the loaded catalogs since this is most likely the case and there is no other easy we to do it. Do it only when the call was successful. */ if (new_domain != NULL) { ++_nl_msg_cat_cntr; if (old_domain != new_domain && old_domain != _nl_default_default_domain) free (old_domain); } gl_rwlock_unlock (_nl_state_lock); return new_domain; } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__textdomain, textdomain); #endif sitecopy-0.16.6/intl/plural-exp.h0000644000076400007640000001013110704164571015000 0ustar joejoe/* Expression parsing and evaluation for plural form selection. Copyright (C) 2000-2003, 2005-2007 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PLURAL_EXP_H #define _PLURAL_EXP_H #ifndef internal_function # define internal_function #endif #ifndef attribute_hidden # define attribute_hidden #endif #ifdef __cplusplus extern "C" { #endif enum expression_operator { /* Without arguments: */ var, /* The variable "n". */ num, /* Decimal number. */ /* Unary operators: */ lnot, /* Logical NOT. */ /* Binary operators: */ mult, /* Multiplication. */ divide, /* Division. */ module, /* Modulo operation. */ plus, /* Addition. */ minus, /* Subtraction. */ less_than, /* Comparison. */ greater_than, /* Comparison. */ less_or_equal, /* Comparison. */ greater_or_equal, /* Comparison. */ equal, /* Comparison for equality. */ not_equal, /* Comparison for inequality. */ land, /* Logical AND. */ lor, /* Logical OR. */ /* Ternary operators: */ qmop /* Question mark operator. */ }; /* This is the representation of the expressions to determine the plural form. */ struct expression { int nargs; /* Number of arguments. */ enum expression_operator operation; union { unsigned long int num; /* Number value for `num'. */ struct expression *args[3]; /* Up to three arguments. */ } val; }; /* This is the data structure to pass information to the parser and get the result in a thread-safe way. */ struct parse_args { const char *cp; struct expression *res; }; /* Names for the libintl functions are a problem. This source code is used 1. in the GNU C Library library, 2. in the GNU libintl library, 3. in the GNU gettext tools. The function names in each situation must be different, to allow for binary incompatible changes in 'struct expression'. Furthermore, 1. in the GNU C Library library, the names have a __ prefix, 2.+3. in the GNU libintl library and in the GNU gettext tools, the names must follow ANSI C and not start with __. So we have to distinguish the three cases. */ #ifdef _LIBC # define FREE_EXPRESSION __gettext_free_exp # define PLURAL_PARSE __gettextparse # define GERMANIC_PLURAL __gettext_germanic_plural # define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural #elif defined (IN_LIBINTL) # define FREE_EXPRESSION libintl_gettext_free_exp # define PLURAL_PARSE libintl_gettextparse # define GERMANIC_PLURAL libintl_gettext_germanic_plural # define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural #else # define FREE_EXPRESSION free_plural_expression # define PLURAL_PARSE parse_plural_expression # define GERMANIC_PLURAL germanic_plural # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression #endif extern void FREE_EXPRESSION (struct expression *exp) internal_function; extern int PLURAL_PARSE (void *arg); extern struct expression GERMANIC_PLURAL attribute_hidden; extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry, const struct expression **pluralp, unsigned long int *npluralsp) internal_function; #if !defined (_LIBC) && !defined (IN_LIBINTL) && !defined (IN_LIBGLOCALE) extern unsigned long int plural_eval (const struct expression *pexp, unsigned long int n); #endif #ifdef __cplusplus } #endif #endif /* _PLURAL_EXP_H */ sitecopy-0.16.6/intl/plural.y0000644000076400007640000001657610521642220014237 0ustar joejoe%{ /* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* For bison < 2.0, the bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. This can go away once the AM_INTL_SUBDIR macro requires bison >= 2.0. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "plural-exp.h" /* The main function generated by the parser is called __gettextparse, but we want it to be called PLURAL_PARSE. */ #ifndef _LIBC # define __gettextparse PLURAL_PARSE #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg %} %pure_parser %expect 7 %union { unsigned long int num; enum expression_operator op; struct expression *exp; } %{ /* Prototypes for local functions. */ static int yylex (YYSTYPE *lval, const char **pexp); static void yyerror (const char *str); /* Allocation of expressions. */ static struct expression * new_exp (int nargs, enum expression_operator op, struct expression * const *args) { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (enum expression_operator op) { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (enum expression_operator op, struct expression *right) { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (enum expression_operator op, struct expression *left, struct expression *right) { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (enum expression_operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch) { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } %} /* This declares that all operators have the same associativity and the precedence order as in C. See [Harbison, Steele: C, A Reference Manual]. There is no unary minus and no bitwise operators. Operators with the same syntactic behaviour have been merged into a single token, to save space in the array generated by bison. */ %right '?' /* ? */ %left '|' /* || */ %left '&' /* && */ %left EQUOP2 /* == != */ %left CMPOP2 /* < > <= >= */ %left ADDOP2 /* + - */ %left MULOP2 /* * / % */ %right '!' /* ! */ %token EQUOP2 CMPOP2 ADDOP2 MULOP2 %token NUMBER %type exp %% start: exp { if ($1 == NULL) YYABORT; ((struct parse_args *) arg)->res = $1; } ; exp: exp '?' exp ':' exp { $$ = new_exp_3 (qmop, $1, $3, $5); } | exp '|' exp { $$ = new_exp_2 (lor, $1, $3); } | exp '&' exp { $$ = new_exp_2 (land, $1, $3); } | exp EQUOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp CMPOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp ADDOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp MULOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | '!' exp { $$ = new_exp_1 (lnot, $2); } | 'n' { $$ = new_exp_0 (var); } | NUMBER { if (($$ = new_exp_0 (num)) != NULL) $$->val.num = $1; } | '(' exp ')' { $$ = $2; } ; %% void internal_function FREE_EXPRESSION (struct expression *exp) { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (YYSTYPE *lval, const char **pexp) { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (const char *str) { /* Do nothing. We don't print error messages here. */ } sitecopy-0.16.6/intl/finddomain.c0000644000076400007640000001367310704165175015031 0ustar joejoe/* Handle list of needed message catalogs Copyright (C) 1995-1999, 2000-2001, 2003-2007 Free 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 Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include # define gl_rwlock_define_initialized __libc_rwlock_define_initialized # define gl_rwlock_rdlock __libc_rwlock_rdlock # define gl_rwlock_wrlock __libc_rwlock_wrlock # define gl_rwlock_unlock __libc_rwlock_unlock #else # include "lock.h" #endif /* @@ end of prolog @@ */ /* List of already loaded domains. */ static struct loaded_l10nfile *_nl_loaded_domains; /* Return a data structure describing the message catalog described by the DOMAINNAME and CATEGORY parameters with respect to the currently established bindings. */ struct loaded_l10nfile * internal_function _nl_find_domain (const char *dirname, char *locale, const char *domainname, struct binding *domainbinding) { struct loaded_l10nfile *retval; const char *language; const char *modifier; const char *territory; const char *codeset; const char *normalized_codeset; const char *alias_value; int mask; /* LOCALE can consist of up to four recognized parts for the XPG syntax: language[_territory][.codeset][@modifier] Beside the first part 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 parts will be stripped off according to the following order: (1) codeset (2) normalized codeset (3) territory (4) modifier */ /* We need to protect modifying the _NL_LOADED_DOMAINS data. */ gl_rwlock_define_initialized (static, lock); gl_rwlock_rdlock (lock); /* If we have already tested for this locale entry there has to be one data set in the list of loaded domains. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, 0, locale, NULL, NULL, NULL, NULL, domainname, 0); gl_rwlock_unlock (lock); if (retval != NULL) { /* We know something about this locale. */ int cnt; if (retval->decided <= 0) _nl_load_domain (retval, domainbinding); 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], domainbinding); if (retval->successor[cnt]->data != NULL) break; } return retval; /* 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) { #if defined _LIBC || defined HAVE_STRDUP locale = strdup (alias_value); if (locale == NULL) return NULL; #else size_t len = strlen (alias_value) + 1; locale = (char *) malloc (len); if (locale == NULL) return NULL; memcpy (locale, alias_value, len); #endif } /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_', '.', and `@'. */ mask = _nl_explode_name (locale, &language, &modifier, &territory, &codeset, &normalized_codeset); if (mask == -1) /* This means we are out of core. */ return NULL; /* We need to protect modifying the _NL_LOADED_DOMAINS data. */ gl_rwlock_wrlock (lock); /* Create all possible locale entries which might be interested in generalization. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, mask, language, territory, codeset, normalized_codeset, modifier, domainname, 1); gl_rwlock_unlock (lock); if (retval == NULL) /* This means we are out of core. */ goto out; if (retval->decided <= 0) _nl_load_domain (retval, domainbinding); 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], domainbinding); if (retval->successor[cnt]->data != NULL) break; } } /* The room for an alias was dynamically allocated. Free it now. */ if (alias_value != NULL) free (locale); out: /* The space for normalized_codeset is dynamically allocated. Free it. */ if (mask & XPG_NORM_CODESET) free ((void *) normalized_codeset); return retval; } #ifdef _LIBC /* This is called from iconv/gconv_db.c's free_mem, as locales must be freed before freeing gconv steps arrays. */ void __libc_freeres_fn_section _nl_finddomain_subfreeres () { struct loaded_l10nfile *runp = _nl_loaded_domains; while (runp != NULL) { struct loaded_l10nfile *here = runp; if (runp->data != NULL) _nl_unload_domain ((struct loaded_domain *) runp->data); runp = runp->next; free ((char *) here->filename); free (here); } } #endif sitecopy-0.16.6/intl/tsearch.h0000644000076400007640000000536610556542133014355 0ustar joejoe/* Binary tree data structure. Copyright (C) 2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _TSEARCH_H #define _TSEARCH_H #if HAVE_TSEARCH /* Get tseach(), tfind(), tdelete(), twalk() declarations. */ #include #else #ifdef __cplusplus extern "C" { #endif /* See , for details. */ typedef enum { preorder, postorder, endorder, leaf } VISIT; /* Searches an element in the tree *VROOTP that compares equal to KEY. If one is found, it is returned. Otherwise, a new element equal to KEY is inserted in the tree and is returned. */ extern void * tsearch (const void *key, void **vrootp, int (*compar) (const void *, const void *)); /* Searches an element in the tree *VROOTP that compares equal to KEY. If one is found, it is returned. Otherwise, NULL is returned. */ extern void * tfind (const void *key, void *const *vrootp, int (*compar) (const void *, const void *)); /* Searches an element in the tree *VROOTP that compares equal to KEY. If one is found, it is removed from the tree, and its parent node is returned. Otherwise, NULL is returned. */ extern void * tdelete (const void *key, void **vrootp, int (*compar) (const void *, const void *)); /* Perform a depth-first, left-to-right traversal of the tree VROOT. The ACTION function is called: - for non-leaf nodes: 3 times, before the left subtree traversal, after the left subtree traversal but before the right subtree traversal, and after the right subtree traversal, - for leaf nodes: once. The arguments passed to ACTION are: 1. the node; it can be casted to a 'const void * const *', i.e. into a pointer to the key, 2. an indicator which visit of the node this is, 3. the level of the node in the tree (0 for the root). */ extern void twalk (const void *vroot, void (*action) (const void *, VISIT, int)); #ifdef __cplusplus } #endif #endif #endif /* _TSEARCH_H */ sitecopy-0.16.6/intl/printf-args.h0000644000076400007640000000662110713434433015151 0ustar joejoe/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PRINTF_ARGS_H #define _PRINTF_ARGS_H /* This file can be parametrized with the following macros: ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. PRINTF_FETCHARGS Name of the function to be declared. STATIC Set to 'static' to declare the function static. */ /* Default parameters. */ #ifndef PRINTF_FETCHARGS # define PRINTF_FETCHARGS printf_fetchargs #endif /* Get size_t. */ #include /* Get wchar_t. */ #if HAVE_WCHAR_T # include #endif /* Get wint_t. */ #if HAVE_WINT_T # include #endif /* Get va_list. */ #include /* Argument types */ typedef enum { TYPE_NONE, TYPE_SCHAR, TYPE_UCHAR, TYPE_SHORT, TYPE_USHORT, TYPE_INT, TYPE_UINT, TYPE_LONGINT, TYPE_ULONGINT, #if HAVE_LONG_LONG_INT TYPE_LONGLONGINT, TYPE_ULONGLONGINT, #endif TYPE_DOUBLE, TYPE_LONGDOUBLE, TYPE_CHAR, #if HAVE_WINT_T TYPE_WIDE_CHAR, #endif TYPE_STRING, #if HAVE_WCHAR_T TYPE_WIDE_STRING, #endif TYPE_POINTER, TYPE_COUNT_SCHAR_POINTER, TYPE_COUNT_SHORT_POINTER, TYPE_COUNT_INT_POINTER, TYPE_COUNT_LONGINT_POINTER #if HAVE_LONG_LONG_INT , TYPE_COUNT_LONGLONGINT_POINTER #endif #if ENABLE_UNISTDIO /* The unistdio extensions. */ , TYPE_U8_STRING , TYPE_U16_STRING , TYPE_U32_STRING #endif } arg_type; /* Polymorphic argument */ typedef struct { arg_type type; union { signed char a_schar; unsigned char a_uchar; short a_short; unsigned short a_ushort; int a_int; unsigned int a_uint; long int a_longint; unsigned long int a_ulongint; #if HAVE_LONG_LONG_INT long long int a_longlongint; unsigned long long int a_ulonglongint; #endif float a_float; double a_double; long double a_longdouble; int a_char; #if HAVE_WINT_T wint_t a_wide_char; #endif const char* a_string; #if HAVE_WCHAR_T const wchar_t* a_wide_string; #endif void* a_pointer; signed char * a_count_schar_pointer; short * a_count_short_pointer; int * a_count_int_pointer; long int * a_count_longint_pointer; #if HAVE_LONG_LONG_INT long long int * a_count_longlongint_pointer; #endif #if ENABLE_UNISTDIO /* The unistdio extensions. */ const uint8_t * a_u8_string; const uint16_t * a_u16_string; const uint32_t * a_u32_string; #endif } a; } argument; typedef struct { size_t count; argument *arg; } arguments; /* Fetch the arguments, putting them into a. */ #ifdef STATIC STATIC #else extern #endif int PRINTF_FETCHARGS (va_list args, arguments *a); #endif /* _PRINTF_ARGS_H */ sitecopy-0.16.6/intl/libgnuintl.h.in0000644000076400007640000003415310712467017015475 0ustar joejoe/* Message catalogs for internationalization. Copyright (C) 1995-1997, 2000-2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBINTL_H #define _LIBINTL_H 1 #include /* The LC_MESSAGES locale category is the category used by the functions gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. On systems that don't define it, use an arbitrary value instead. On Solaris, defines __LOCALE_H (or _LOCALE_H in Solaris 2.5) then includes (i.e. this file!) and then only defines LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES in this case. */ #if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun)) # define LC_MESSAGES 1729 #endif /* We define an additional symbol to signal that we use the GNU implementation of gettext. */ #define __USE_GNU_GETTEXT 1 /* Provide information about the supported file formats. Returns the maximum minor revision number supported for a given major revision. */ #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ ((major) == 0 || (major) == 1 ? 1 : -1) /* Resolve a platform specific conflict on DJGPP. GNU gettext takes precedence over _conio_gettext. */ #ifdef __DJGPP__ # undef gettext #endif #ifdef __cplusplus extern "C" { #endif /* Version number: (major<<16) + (minor<<8) + subminor */ #define LIBINTL_VERSION 0x001100 extern int libintl_version; /* We redirect the functions to those prefixed with "libintl_". This is necessary, because some systems define gettext/textdomain/... in the C library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). If we used the unprefixed names, there would be cases where the definition in the C library would override the one in the libintl.so shared library. Recall that on ELF systems, the symbols are looked up in the following order: 1. in the executable, 2. in the shared libraries specified on the link command line, in order, 3. in the dependencies of the shared libraries specified on the link command line, 4. in the dlopen()ed shared libraries, in the order in which they were dlopen()ed. The definition in the C library would override the one in libintl.so if either * -lc is given on the link command line and -lintl isn't, or * -lc is given on the link command line before -lintl, or * libintl.so is a dependency of a dlopen()ed shared library but not linked to the executable at link time. Since Solaris gettext() behaves differently than GNU gettext(), this would be unacceptable. The redirection happens by default through macros in C, so that &gettext is independent of the compilation unit, but through inline functions in C++, in order not to interfere with the name mangling of class fields or class methods called 'gettext'. */ /* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. If he doesn't, we choose the method. A third possible method is _INTL_REDIRECT_ASM, supported only by GCC. */ #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) # if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus) # define _INTL_REDIRECT_ASM # else # ifdef __cplusplus # define _INTL_REDIRECT_INLINE # else # define _INTL_REDIRECT_MACROS # endif # endif #endif /* Auxiliary macros. */ #ifdef _INTL_REDIRECT_ASM # define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) # define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring # define _INTL_STRINGIFY(prefix) #prefix #else # define _INTL_ASM(cname) #endif /* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return its n-th argument literally. This enables GCC to warn for example about printf (gettext ("foo %y")). */ #if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus) # define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n))) #else # define _INTL_MAY_RETURN_STRING_ARG(n) #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). */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_gettext (const char *__msgid) _INTL_MAY_RETURN_STRING_ARG (1); static inline char *gettext (const char *__msgid) { return libintl_gettext (__msgid); } #else #ifdef _INTL_REDIRECT_MACROS # define gettext libintl_gettext #endif extern char *gettext (const char *__msgid) _INTL_ASM (libintl_gettext) _INTL_MAY_RETURN_STRING_ARG (1); #endif /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dgettext (const char *__domainname, const char *__msgid) _INTL_MAY_RETURN_STRING_ARG (2); static inline char *dgettext (const char *__domainname, const char *__msgid) { return libintl_dgettext (__domainname, __msgid); } #else #ifdef _INTL_REDIRECT_MACROS # define dgettext libintl_dgettext #endif extern char *dgettext (const char *__domainname, const char *__msgid) _INTL_ASM (libintl_dgettext) _INTL_MAY_RETURN_STRING_ARG (2); #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, int __category) _INTL_MAY_RETURN_STRING_ARG (2); static inline char *dcgettext (const char *__domainname, const char *__msgid, int __category) { return libintl_dcgettext (__domainname, __msgid, __category); } #else #ifdef _INTL_REDIRECT_MACROS # define dcgettext libintl_dcgettext #endif extern char *dcgettext (const char *__domainname, const char *__msgid, int __category) _INTL_ASM (libintl_dcgettext) _INTL_MAY_RETURN_STRING_ARG (2); #endif /* Similar to `gettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); static inline char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) { return libintl_ngettext (__msgid1, __msgid2, __n); } #else #ifdef _INTL_REDIRECT_MACROS # define ngettext libintl_ngettext #endif extern char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_ASM (libintl_ngettext) _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); #endif /* Similar to `dgettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); static inline char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) { return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); } #else #ifdef _INTL_REDIRECT_MACROS # define dngettext libintl_dngettext #endif extern char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_ASM (libintl_dngettext) _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); #endif /* Similar to `dcgettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); static inline char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) { return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); } #else #ifdef _INTL_REDIRECT_MACROS # define dcngettext libintl_dcngettext #endif extern char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) _INTL_ASM (libintl_dcngettext) _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); #endif #ifndef IN_LIBGLOCALE /* 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". */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_textdomain (const char *__domainname); static inline char *textdomain (const char *__domainname) { return libintl_textdomain (__domainname); } #else #ifdef _INTL_REDIRECT_MACROS # define textdomain libintl_textdomain #endif extern char *textdomain (const char *__domainname) _INTL_ASM (libintl_textdomain); #endif /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_bindtextdomain (const char *__domainname, const char *__dirname); static inline char *bindtextdomain (const char *__domainname, const char *__dirname) { return libintl_bindtextdomain (__domainname, __dirname); } #else #ifdef _INTL_REDIRECT_MACROS # define bindtextdomain libintl_bindtextdomain #endif extern char *bindtextdomain (const char *__domainname, const char *__dirname) _INTL_ASM (libintl_bindtextdomain); #endif /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_bind_textdomain_codeset (const char *__domainname, const char *__codeset); static inline char *bind_textdomain_codeset (const char *__domainname, const char *__codeset) { return libintl_bind_textdomain_codeset (__domainname, __codeset); } #else #ifdef _INTL_REDIRECT_MACROS # define bind_textdomain_codeset libintl_bind_textdomain_codeset #endif extern char *bind_textdomain_codeset (const char *__domainname, const char *__codeset) _INTL_ASM (libintl_bind_textdomain_codeset); #endif #endif /* IN_LIBGLOCALE */ /* Support for format strings with positions in *printf(), following the POSIX/XSI specification. Note: These replacements for the *printf() functions are visible only in source files that #include or #include "gettext.h". Packages that use *printf() in source files that don't refer to _() or gettext() but for which the format string could be the return value of _() or gettext() need to add this #include. Oh well. */ #if !@HAVE_POSIX_PRINTF@ #include #include /* Get va_list. */ #if __STDC__ || defined __cplusplus || defined _MSC_VER # include #else # include #endif #undef fprintf #define fprintf libintl_fprintf extern int fprintf (FILE *, const char *, ...); #undef vfprintf #define vfprintf libintl_vfprintf extern int vfprintf (FILE *, const char *, va_list); #undef printf #if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__ /* Don't break __attribute__((format(printf,M,N))). This redefinition is only possible because the libc in NetBSD, Cygwin, mingw does not have a function __printf__. */ # define libintl_printf __printf__ #endif #define printf libintl_printf extern int printf (const char *, ...); #undef vprintf #define vprintf libintl_vprintf extern int vprintf (const char *, va_list); #undef sprintf #define sprintf libintl_sprintf extern int sprintf (char *, const char *, ...); #undef vsprintf #define vsprintf libintl_vsprintf extern int vsprintf (char *, const char *, va_list); #if @HAVE_SNPRINTF@ #undef snprintf #define snprintf libintl_snprintf extern int snprintf (char *, size_t, const char *, ...); #undef vsnprintf #define vsnprintf libintl_vsnprintf extern int vsnprintf (char *, size_t, const char *, va_list); #endif #if @HAVE_ASPRINTF@ #undef asprintf #define asprintf libintl_asprintf extern int asprintf (char **, const char *, ...); #undef vasprintf #define vasprintf libintl_vasprintf extern int vasprintf (char **, const char *, va_list); #endif #if @HAVE_WPRINTF@ #undef fwprintf #define fwprintf libintl_fwprintf extern int fwprintf (FILE *, const wchar_t *, ...); #undef vfwprintf #define vfwprintf libintl_vfwprintf extern int vfwprintf (FILE *, const wchar_t *, va_list); #undef wprintf #define wprintf libintl_wprintf extern int wprintf (const wchar_t *, ...); #undef vwprintf #define vwprintf libintl_vwprintf extern int vwprintf (const wchar_t *, va_list); #undef swprintf #define swprintf libintl_swprintf extern int swprintf (wchar_t *, size_t, const wchar_t *, ...); #undef vswprintf #define vswprintf libintl_vswprintf extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); #endif #endif /* Support for relocatable packages. */ /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ #define libintl_set_relocation_prefix libintl_set_relocation_prefix extern void libintl_set_relocation_prefix (const char *orig_prefix, const char *curr_prefix); #ifdef __cplusplus } #endif #endif /* libintl.h */ sitecopy-0.16.6/intl/VERSION0000644000076400007640000000004610756154331013612 0ustar joejoeGNU gettext library from gettext-0.17 sitecopy-0.16.6/intl/libintl.rc0000644000076400007640000000323310626376114014527 0ustar joejoe/* Resources for intl.dll */ #include VS_VERSION_INFO VERSIONINFO FILEVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0 PRODUCTVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0 FILEFLAGSMASK 0x3fL /* VS_FFI_FILEFLAGSMASK */ #ifdef _DEBUG FILEFLAGS 0x1L /* VS_FF_DEBUG */ #else FILEFLAGS 0x0L #endif FILEOS 0x10004L /* VOS_DOS_WINDOWS32 */ FILETYPE 0x2L /* VFT_DLL */ FILESUBTYPE 0x0L /* VFT2_UNKNOWN */ BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "04090000" /* Lang = US English, Charset = ASCII */ BEGIN VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\0" VALUE "CompanyName", "Free Software Foundation\0" VALUE "FileDescription", "LGPLed libintl for Windows NT/2000/XP/Vista and Windows 95/98/ME\0" VALUE "FileVersion", PACKAGE_VERSION_STRING "\0" VALUE "InternalName", "intl.dll\0" VALUE "LegalCopyright", "Copyright (C) 1995-2007\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "intl.dll\0" VALUE "ProductName", "libintl: accessing NLS message catalogs\0" VALUE "ProductVersion", PACKAGE_VERSION_STRING "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x0409, 0 /* US English, ASCII */ END END sitecopy-0.16.6/intl/ChangeLog0000644000076400007640000000010710756154331014312 0ustar joejoe2007-11-07 GNU * Version 0.17 released. sitecopy-0.16.6/intl/lock.h0000644000076400007640000012735610713465060013656 0ustar joejoe/* Locking in multithreaded situations. Copyright (C) 2005-2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible , 2005. Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, gthr-win32.h. */ /* This file contains locking primitives for use with a given thread library. It does not contain primitives for creating threads or for other synchronization primitives. Normal (non-recursive) locks: Type: gl_lock_t Declaration: gl_lock_define(extern, name) Initializer: gl_lock_define_initialized(, name) Initialization: gl_lock_init (name); Taking the lock: gl_lock_lock (name); Releasing the lock: gl_lock_unlock (name); De-initialization: gl_lock_destroy (name); Read-Write (non-recursive) locks: Type: gl_rwlock_t Declaration: gl_rwlock_define(extern, name) Initializer: gl_rwlock_define_initialized(, name) Initialization: gl_rwlock_init (name); Taking the lock: gl_rwlock_rdlock (name); gl_rwlock_wrlock (name); Releasing the lock: gl_rwlock_unlock (name); De-initialization: gl_rwlock_destroy (name); Recursive locks: Type: gl_recursive_lock_t Declaration: gl_recursive_lock_define(extern, name) Initializer: gl_recursive_lock_define_initialized(, name) Initialization: gl_recursive_lock_init (name); Taking the lock: gl_recursive_lock_lock (name); Releasing the lock: gl_recursive_lock_unlock (name); De-initialization: gl_recursive_lock_destroy (name); Once-only execution: Type: gl_once_t Initializer: gl_once_define(extern, name) Execution: gl_once (name, initfunction); */ #ifndef _LOCK_H #define _LOCK_H /* ========================================================================= */ #if USE_POSIX_THREADS /* Use the POSIX threads library. */ # include # include # ifdef __cplusplus extern "C" { # endif # if PTHREAD_IN_USE_DETECTION_HARD /* The pthread_in_use() detection needs to be done at runtime. */ # define pthread_in_use() \ glthread_in_use () extern int glthread_in_use (void); # endif # if USE_POSIX_THREADS_WEAK /* Use weak references to the POSIX threads library. */ /* Weak references avoid dragging in external libraries if the other parts of the program don't use them. Here we use them, because we don't want every program that uses libintl to depend on libpthread. This assumes that libpthread would not be loaded after libintl; i.e. if libintl is loaded first, by an executable that does not depend on libpthread, and then a module is dynamically loaded that depends on libpthread, libintl will not be multithread-safe. */ /* The way to test at runtime whether libpthread is present is to test whether a function pointer's value, such as &pthread_mutex_init, is non-NULL. However, some versions of GCC have a bug through which, in PIC mode, &foo != NULL always evaluates to true if there is a direct call to foo(...) in the same function. To avoid this, we test the address of a function in libpthread that we don't use. */ # pragma weak pthread_mutex_init # pragma weak pthread_mutex_lock # pragma weak pthread_mutex_unlock # pragma weak pthread_mutex_destroy # pragma weak pthread_rwlock_init # pragma weak pthread_rwlock_rdlock # pragma weak pthread_rwlock_wrlock # pragma weak pthread_rwlock_unlock # pragma weak pthread_rwlock_destroy # pragma weak pthread_once # pragma weak pthread_cond_init # pragma weak pthread_cond_wait # pragma weak pthread_cond_signal # pragma weak pthread_cond_broadcast # pragma weak pthread_cond_destroy # pragma weak pthread_mutexattr_init # pragma weak pthread_mutexattr_settype # pragma weak pthread_mutexattr_destroy # ifndef pthread_self # pragma weak pthread_self # endif # if !PTHREAD_IN_USE_DETECTION_HARD # pragma weak pthread_cancel # define pthread_in_use() (pthread_cancel != NULL) # endif # else # if !PTHREAD_IN_USE_DETECTION_HARD # define pthread_in_use() 1 # endif # endif /* -------------------------- gl_lock_t datatype -------------------------- */ typedef pthread_mutex_t gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) \ STORAGECLASS pthread_mutex_t NAME; # define gl_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pthread_mutex_t NAME = gl_lock_initializer; # define gl_lock_initializer \ PTHREAD_MUTEX_INITIALIZER # define gl_lock_init(NAME) \ do \ { \ if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) \ abort (); \ } \ while (0) # define gl_lock_lock(NAME) \ do \ { \ if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_lock_unlock(NAME) \ do \ { \ if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_lock_destroy(NAME) \ do \ { \ if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) \ abort (); \ } \ while (0) /* ------------------------- gl_rwlock_t datatype ------------------------- */ # if HAVE_PTHREAD_RWLOCK # ifdef PTHREAD_RWLOCK_INITIALIZER typedef pthread_rwlock_t gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS pthread_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ PTHREAD_RWLOCK_INITIALIZER # define gl_rwlock_init(NAME) \ do \ { \ if (pthread_in_use () && pthread_rwlock_init (&NAME, NULL) != 0) \ abort (); \ } \ while (0) # define gl_rwlock_rdlock(NAME) \ do \ { \ if (pthread_in_use () && pthread_rwlock_rdlock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_rwlock_wrlock(NAME) \ do \ { \ if (pthread_in_use () && pthread_rwlock_wrlock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_rwlock_unlock(NAME) \ do \ { \ if (pthread_in_use () && pthread_rwlock_unlock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_rwlock_destroy(NAME) \ do \ { \ if (pthread_in_use () && pthread_rwlock_destroy (&NAME) != 0) \ abort (); \ } \ while (0) # else typedef struct { int initialized; pthread_mutex_t guard; /* protects the initialization */ pthread_rwlock_t rwlock; /* read-write lock */ } gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ { 0, PTHREAD_MUTEX_INITIALIZER } # define gl_rwlock_init(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_init (&NAME); \ } \ while (0) # define gl_rwlock_rdlock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_rdlock (&NAME); \ } \ while (0) # define gl_rwlock_wrlock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_wrlock (&NAME); \ } \ while (0) # define gl_rwlock_unlock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_unlock (&NAME); \ } \ while (0) # define gl_rwlock_destroy(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_destroy (&NAME); \ } \ while (0) extern void glthread_rwlock_init (gl_rwlock_t *lock); extern void glthread_rwlock_rdlock (gl_rwlock_t *lock); extern void glthread_rwlock_wrlock (gl_rwlock_t *lock); extern void glthread_rwlock_unlock (gl_rwlock_t *lock); extern void glthread_rwlock_destroy (gl_rwlock_t *lock); # endif # else typedef struct { pthread_mutex_t lock; /* protects the remaining fields */ pthread_cond_t waiting_readers; /* waiting readers */ pthread_cond_t waiting_writers; /* waiting writers */ unsigned int waiting_writers_count; /* number of waiting writers */ int runcount; /* number of readers running, or -1 when a writer runs */ } gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 } # define gl_rwlock_init(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_init (&NAME); \ } \ while (0) # define gl_rwlock_rdlock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_rdlock (&NAME); \ } \ while (0) # define gl_rwlock_wrlock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_wrlock (&NAME); \ } \ while (0) # define gl_rwlock_unlock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_unlock (&NAME); \ } \ while (0) # define gl_rwlock_destroy(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_rwlock_destroy (&NAME); \ } \ while (0) extern void glthread_rwlock_init (gl_rwlock_t *lock); extern void glthread_rwlock_rdlock (gl_rwlock_t *lock); extern void glthread_rwlock_wrlock (gl_rwlock_t *lock); extern void glthread_rwlock_unlock (gl_rwlock_t *lock); extern void glthread_rwlock_destroy (gl_rwlock_t *lock); # endif /* --------------------- gl_recursive_lock_t datatype --------------------- */ # if HAVE_PTHREAD_MUTEX_RECURSIVE # if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP typedef pthread_mutex_t gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS pthread_mutex_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pthread_mutex_t NAME = gl_recursive_lock_initializer; # ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER # define gl_recursive_lock_initializer \ PTHREAD_RECURSIVE_MUTEX_INITIALIZER # else # define gl_recursive_lock_initializer \ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP # endif # define gl_recursive_lock_init(NAME) \ do \ { \ if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) \ abort (); \ } \ while (0) # define gl_recursive_lock_lock(NAME) \ do \ { \ if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_recursive_lock_unlock(NAME) \ do \ { \ if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_recursive_lock_destroy(NAME) \ do \ { \ if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) \ abort (); \ } \ while (0) # else typedef struct { pthread_mutex_t recmutex; /* recursive mutex */ pthread_mutex_t guard; /* protects the initialization */ int initialized; } gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 } # define gl_recursive_lock_init(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_recursive_lock_init (&NAME); \ } \ while (0) # define gl_recursive_lock_lock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_recursive_lock_lock (&NAME); \ } \ while (0) # define gl_recursive_lock_unlock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_recursive_lock_unlock (&NAME); \ } \ while (0) # define gl_recursive_lock_destroy(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_recursive_lock_destroy (&NAME); \ } \ while (0) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock); # endif # else /* Old versions of POSIX threads on Solaris did not have recursive locks. We have to implement them ourselves. */ typedef struct { pthread_mutex_t mutex; pthread_t owner; unsigned long depth; } gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 } # define gl_recursive_lock_init(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_recursive_lock_init (&NAME); \ } \ while (0) # define gl_recursive_lock_lock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_recursive_lock_lock (&NAME); \ } \ while (0) # define gl_recursive_lock_unlock(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_recursive_lock_unlock (&NAME); \ } \ while (0) # define gl_recursive_lock_destroy(NAME) \ do \ { \ if (pthread_in_use ()) \ glthread_recursive_lock_destroy (&NAME); \ } \ while (0) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock); # endif /* -------------------------- gl_once_t datatype -------------------------- */ typedef pthread_once_t gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT; # define gl_once(NAME, INITFUNCTION) \ do \ { \ if (pthread_in_use ()) \ { \ if (pthread_once (&NAME, INITFUNCTION) != 0) \ abort (); \ } \ else \ { \ if (glthread_once_singlethreaded (&NAME)) \ INITFUNCTION (); \ } \ } \ while (0) extern int glthread_once_singlethreaded (pthread_once_t *once_control); # ifdef __cplusplus } # endif #endif /* ========================================================================= */ #if USE_PTH_THREADS /* Use the GNU Pth threads library. */ # include # include # ifdef __cplusplus extern "C" { # endif # if USE_PTH_THREADS_WEAK /* Use weak references to the GNU Pth threads library. */ # pragma weak pth_mutex_init # pragma weak pth_mutex_acquire # pragma weak pth_mutex_release # pragma weak pth_rwlock_init # pragma weak pth_rwlock_acquire # pragma weak pth_rwlock_release # pragma weak pth_once # pragma weak pth_cancel # define pth_in_use() (pth_cancel != NULL) # else # define pth_in_use() 1 # endif /* -------------------------- gl_lock_t datatype -------------------------- */ typedef pth_mutex_t gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) \ STORAGECLASS pth_mutex_t NAME; # define gl_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pth_mutex_t NAME = gl_lock_initializer; # define gl_lock_initializer \ PTH_MUTEX_INIT # define gl_lock_init(NAME) \ do \ { \ if (pth_in_use() && !pth_mutex_init (&NAME)) \ abort (); \ } \ while (0) # define gl_lock_lock(NAME) \ do \ { \ if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) \ abort (); \ } \ while (0) # define gl_lock_unlock(NAME) \ do \ { \ if (pth_in_use() && !pth_mutex_release (&NAME)) \ abort (); \ } \ while (0) # define gl_lock_destroy(NAME) \ (void)(&NAME) /* ------------------------- gl_rwlock_t datatype ------------------------- */ typedef pth_rwlock_t gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS pth_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pth_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ PTH_RWLOCK_INIT # define gl_rwlock_init(NAME) \ do \ { \ if (pth_in_use() && !pth_rwlock_init (&NAME)) \ abort (); \ } \ while (0) # define gl_rwlock_rdlock(NAME) \ do \ { \ if (pth_in_use() \ && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) \ abort (); \ } \ while (0) # define gl_rwlock_wrlock(NAME) \ do \ { \ if (pth_in_use() \ && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) \ abort (); \ } \ while (0) # define gl_rwlock_unlock(NAME) \ do \ { \ if (pth_in_use() && !pth_rwlock_release (&NAME)) \ abort (); \ } \ while (0) # define gl_rwlock_destroy(NAME) \ (void)(&NAME) /* --------------------- gl_recursive_lock_t datatype --------------------- */ /* In Pth, mutexes are recursive by default. */ typedef pth_mutex_t gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS pth_mutex_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS pth_mutex_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ PTH_MUTEX_INIT # define gl_recursive_lock_init(NAME) \ do \ { \ if (pth_in_use() && !pth_mutex_init (&NAME)) \ abort (); \ } \ while (0) # define gl_recursive_lock_lock(NAME) \ do \ { \ if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) \ abort (); \ } \ while (0) # define gl_recursive_lock_unlock(NAME) \ do \ { \ if (pth_in_use() && !pth_mutex_release (&NAME)) \ abort (); \ } \ while (0) # define gl_recursive_lock_destroy(NAME) \ (void)(&NAME) /* -------------------------- gl_once_t datatype -------------------------- */ typedef pth_once_t gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS pth_once_t NAME = PTH_ONCE_INIT; # define gl_once(NAME, INITFUNCTION) \ do \ { \ if (pth_in_use ()) \ { \ void (*gl_once_temp) (void) = INITFUNCTION; \ if (!pth_once (&NAME, glthread_once_call, &gl_once_temp)) \ abort (); \ } \ else \ { \ if (glthread_once_singlethreaded (&NAME)) \ INITFUNCTION (); \ } \ } \ while (0) extern void glthread_once_call (void *arg); extern int glthread_once_singlethreaded (pth_once_t *once_control); # ifdef __cplusplus } # endif #endif /* ========================================================================= */ #if USE_SOLARIS_THREADS /* Use the old Solaris threads library. */ # include # include # include # ifdef __cplusplus extern "C" { # endif # if USE_SOLARIS_THREADS_WEAK /* Use weak references to the old Solaris threads library. */ # pragma weak mutex_init # pragma weak mutex_lock # pragma weak mutex_unlock # pragma weak mutex_destroy # pragma weak rwlock_init # pragma weak rw_rdlock # pragma weak rw_wrlock # pragma weak rw_unlock # pragma weak rwlock_destroy # pragma weak thr_self # pragma weak thr_suspend # define thread_in_use() (thr_suspend != NULL) # else # define thread_in_use() 1 # endif /* -------------------------- gl_lock_t datatype -------------------------- */ typedef mutex_t gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) \ STORAGECLASS mutex_t NAME; # define gl_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS mutex_t NAME = gl_lock_initializer; # define gl_lock_initializer \ DEFAULTMUTEX # define gl_lock_init(NAME) \ do \ { \ if (thread_in_use () && mutex_init (&NAME, USYNC_THREAD, NULL) != 0) \ abort (); \ } \ while (0) # define gl_lock_lock(NAME) \ do \ { \ if (thread_in_use () && mutex_lock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_lock_unlock(NAME) \ do \ { \ if (thread_in_use () && mutex_unlock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_lock_destroy(NAME) \ do \ { \ if (thread_in_use () && mutex_destroy (&NAME) != 0) \ abort (); \ } \ while (0) /* ------------------------- gl_rwlock_t datatype ------------------------- */ typedef rwlock_t gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ DEFAULTRWLOCK # define gl_rwlock_init(NAME) \ do \ { \ if (thread_in_use () && rwlock_init (&NAME, USYNC_THREAD, NULL) != 0) \ abort (); \ } \ while (0) # define gl_rwlock_rdlock(NAME) \ do \ { \ if (thread_in_use () && rw_rdlock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_rwlock_wrlock(NAME) \ do \ { \ if (thread_in_use () && rw_wrlock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_rwlock_unlock(NAME) \ do \ { \ if (thread_in_use () && rw_unlock (&NAME) != 0) \ abort (); \ } \ while (0) # define gl_rwlock_destroy(NAME) \ do \ { \ if (thread_in_use () && rwlock_destroy (&NAME) != 0) \ abort (); \ } \ while (0) /* --------------------- gl_recursive_lock_t datatype --------------------- */ /* Old Solaris threads did not have recursive locks. We have to implement them ourselves. */ typedef struct { mutex_t mutex; thread_t owner; unsigned long depth; } gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ { DEFAULTMUTEX, (thread_t) 0, 0 } # define gl_recursive_lock_init(NAME) \ do \ { \ if (thread_in_use ()) \ glthread_recursive_lock_init (&NAME); \ } \ while (0) # define gl_recursive_lock_lock(NAME) \ do \ { \ if (thread_in_use ()) \ glthread_recursive_lock_lock (&NAME); \ } \ while (0) # define gl_recursive_lock_unlock(NAME) \ do \ { \ if (thread_in_use ()) \ glthread_recursive_lock_unlock (&NAME); \ } \ while (0) # define gl_recursive_lock_destroy(NAME) \ do \ { \ if (thread_in_use ()) \ glthread_recursive_lock_destroy (&NAME); \ } \ while (0) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock); /* -------------------------- gl_once_t datatype -------------------------- */ typedef struct { volatile int inited; mutex_t mutex; } gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS gl_once_t NAME = { 0, DEFAULTMUTEX }; # define gl_once(NAME, INITFUNCTION) \ do \ { \ if (thread_in_use ()) \ { \ glthread_once (&NAME, INITFUNCTION); \ } \ else \ { \ if (glthread_once_singlethreaded (&NAME)) \ INITFUNCTION (); \ } \ } \ while (0) extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void)); extern int glthread_once_singlethreaded (gl_once_t *once_control); # ifdef __cplusplus } # endif #endif /* ========================================================================= */ #if USE_WIN32_THREADS # include # ifdef __cplusplus extern "C" { # endif /* We can use CRITICAL_SECTION directly, rather than the Win32 Event, Mutex, Semaphore types, because - we need only to synchronize inside a single process (address space), not inter-process locking, - we don't need to support trylock operations. (TryEnterCriticalSection does not work on Windows 95/98/ME. Packages that need trylock usually define their own mutex type.) */ /* There is no way to statically initialize a CRITICAL_SECTION. It needs to be done lazily, once only. For this we need spinlocks. */ typedef struct { volatile int done; volatile long started; } gl_spinlock_t; /* -------------------------- gl_lock_t datatype -------------------------- */ typedef struct { gl_spinlock_t guard; /* protects the initialization */ CRITICAL_SECTION lock; } gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_lock_t NAME; # define gl_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_lock_t NAME = gl_lock_initializer; # define gl_lock_initializer \ { { 0, -1 } } # define gl_lock_init(NAME) \ glthread_lock_init (&NAME) # define gl_lock_lock(NAME) \ glthread_lock_lock (&NAME) # define gl_lock_unlock(NAME) \ glthread_lock_unlock (&NAME) # define gl_lock_destroy(NAME) \ glthread_lock_destroy (&NAME) extern void glthread_lock_init (gl_lock_t *lock); extern void glthread_lock_lock (gl_lock_t *lock); extern void glthread_lock_unlock (gl_lock_t *lock); extern void glthread_lock_destroy (gl_lock_t *lock); /* ------------------------- gl_rwlock_t datatype ------------------------- */ /* It is impossible to implement read-write locks using plain locks, without introducing an extra thread dedicated to managing read-write locks. Therefore here we need to use the low-level Event type. */ typedef struct { HANDLE *array; /* array of waiting threads, each represented by an event */ unsigned int count; /* number of waiting threads */ unsigned int alloc; /* length of allocated array */ unsigned int offset; /* index of first waiting thread in array */ } gl_waitqueue_t; typedef struct { gl_spinlock_t guard; /* protects the initialization */ CRITICAL_SECTION lock; /* protects the remaining fields */ gl_waitqueue_t waiting_readers; /* waiting readers */ gl_waitqueue_t waiting_writers; /* waiting writers */ int runcount; /* number of readers running, or -1 when a writer runs */ } gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME; # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer; # define gl_rwlock_initializer \ { { 0, -1 } } # define gl_rwlock_init(NAME) \ glthread_rwlock_init (&NAME) # define gl_rwlock_rdlock(NAME) \ glthread_rwlock_rdlock (&NAME) # define gl_rwlock_wrlock(NAME) \ glthread_rwlock_wrlock (&NAME) # define gl_rwlock_unlock(NAME) \ glthread_rwlock_unlock (&NAME) # define gl_rwlock_destroy(NAME) \ glthread_rwlock_destroy (&NAME) extern void glthread_rwlock_init (gl_rwlock_t *lock); extern void glthread_rwlock_rdlock (gl_rwlock_t *lock); extern void glthread_rwlock_wrlock (gl_rwlock_t *lock); extern void glthread_rwlock_unlock (gl_rwlock_t *lock); extern void glthread_rwlock_destroy (gl_rwlock_t *lock); /* --------------------- gl_recursive_lock_t datatype --------------------- */ /* The Win32 documentation says that CRITICAL_SECTION already implements a recursive lock. But we need not rely on it: It's easy to implement a recursive lock without this assumption. */ typedef struct { gl_spinlock_t guard; /* protects the initialization */ DWORD owner; unsigned long depth; CRITICAL_SECTION lock; } gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME; # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; # define gl_recursive_lock_initializer \ { { 0, -1 }, 0, 0 } # define gl_recursive_lock_init(NAME) \ glthread_recursive_lock_init (&NAME) # define gl_recursive_lock_lock(NAME) \ glthread_recursive_lock_lock (&NAME) # define gl_recursive_lock_unlock(NAME) \ glthread_recursive_lock_unlock (&NAME) # define gl_recursive_lock_destroy(NAME) \ glthread_recursive_lock_destroy (&NAME) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock); /* -------------------------- gl_once_t datatype -------------------------- */ typedef struct { volatile int inited; volatile long started; CRITICAL_SECTION lock; } gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS gl_once_t NAME = { -1, -1 }; # define gl_once(NAME, INITFUNCTION) \ glthread_once (&NAME, INITFUNCTION) extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void)); # ifdef __cplusplus } # endif #endif /* ========================================================================= */ #if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS) /* Provide dummy implementation if threads are not supported. */ /* -------------------------- gl_lock_t datatype -------------------------- */ typedef int gl_lock_t; # define gl_lock_define(STORAGECLASS, NAME) # define gl_lock_define_initialized(STORAGECLASS, NAME) # define gl_lock_init(NAME) # define gl_lock_lock(NAME) # define gl_lock_unlock(NAME) /* ------------------------- gl_rwlock_t datatype ------------------------- */ typedef int gl_rwlock_t; # define gl_rwlock_define(STORAGECLASS, NAME) # define gl_rwlock_define_initialized(STORAGECLASS, NAME) # define gl_rwlock_init(NAME) # define gl_rwlock_rdlock(NAME) # define gl_rwlock_wrlock(NAME) # define gl_rwlock_unlock(NAME) /* --------------------- gl_recursive_lock_t datatype --------------------- */ typedef int gl_recursive_lock_t; # define gl_recursive_lock_define(STORAGECLASS, NAME) # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) # define gl_recursive_lock_init(NAME) # define gl_recursive_lock_lock(NAME) # define gl_recursive_lock_unlock(NAME) /* -------------------------- gl_once_t datatype -------------------------- */ typedef int gl_once_t; # define gl_once_define(STORAGECLASS, NAME) \ STORAGECLASS gl_once_t NAME = 0; # define gl_once(NAME, INITFUNCTION) \ do \ { \ if (NAME == 0) \ { \ NAME = ~ 0; \ INITFUNCTION (); \ } \ } \ while (0) #endif /* ========================================================================= */ #endif /* _LOCK_H */ sitecopy-0.16.6/intl/loadmsgcat.c0000644000076400007640000010270010704170670015021 0ustar joejoe/* Load needed message catalogs. Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #ifdef __GNUC__ # undef alloca # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #ifdef _LIBC # include # include #endif #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || (defined _LIBC && defined _POSIX_MAPPED_FILES) # include # undef HAVE_MMAP # define HAVE_MMAP 1 #else # undef HAVE_MMAP #endif #if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC # include #endif #if defined HAVE_INTTYPES_H || defined _LIBC # include #endif #include "gmo.h" #include "gettextP.h" #include "hash-string.h" #include "plural-exp.h" #ifdef _LIBC # include "../locale/localeinfo.h" # include #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include #else # include "lock.h" #endif /* Provide fallback values for macros that ought to be defined in . Note that our fallback values need not be literal strings, because we don't use them with preprocessor string concatenation. */ #if !defined PRId8 || PRI_MACROS_BROKEN # undef PRId8 # define PRId8 "d" #endif #if !defined PRIi8 || PRI_MACROS_BROKEN # undef PRIi8 # define PRIi8 "i" #endif #if !defined PRIo8 || PRI_MACROS_BROKEN # undef PRIo8 # define PRIo8 "o" #endif #if !defined PRIu8 || PRI_MACROS_BROKEN # undef PRIu8 # define PRIu8 "u" #endif #if !defined PRIx8 || PRI_MACROS_BROKEN # undef PRIx8 # define PRIx8 "x" #endif #if !defined PRIX8 || PRI_MACROS_BROKEN # undef PRIX8 # define PRIX8 "X" #endif #if !defined PRId16 || PRI_MACROS_BROKEN # undef PRId16 # define PRId16 "d" #endif #if !defined PRIi16 || PRI_MACROS_BROKEN # undef PRIi16 # define PRIi16 "i" #endif #if !defined PRIo16 || PRI_MACROS_BROKEN # undef PRIo16 # define PRIo16 "o" #endif #if !defined PRIu16 || PRI_MACROS_BROKEN # undef PRIu16 # define PRIu16 "u" #endif #if !defined PRIx16 || PRI_MACROS_BROKEN # undef PRIx16 # define PRIx16 "x" #endif #if !defined PRIX16 || PRI_MACROS_BROKEN # undef PRIX16 # define PRIX16 "X" #endif #if !defined PRId32 || PRI_MACROS_BROKEN # undef PRId32 # define PRId32 "d" #endif #if !defined PRIi32 || PRI_MACROS_BROKEN # undef PRIi32 # define PRIi32 "i" #endif #if !defined PRIo32 || PRI_MACROS_BROKEN # undef PRIo32 # define PRIo32 "o" #endif #if !defined PRIu32 || PRI_MACROS_BROKEN # undef PRIu32 # define PRIu32 "u" #endif #if !defined PRIx32 || PRI_MACROS_BROKEN # undef PRIx32 # define PRIx32 "x" #endif #if !defined PRIX32 || PRI_MACROS_BROKEN # undef PRIX32 # define PRIX32 "X" #endif #if !defined PRId64 || PRI_MACROS_BROKEN # undef PRId64 # define PRId64 (sizeof (long) == 8 ? "ld" : "lld") #endif #if !defined PRIi64 || PRI_MACROS_BROKEN # undef PRIi64 # define PRIi64 (sizeof (long) == 8 ? "li" : "lli") #endif #if !defined PRIo64 || PRI_MACROS_BROKEN # undef PRIo64 # define PRIo64 (sizeof (long) == 8 ? "lo" : "llo") #endif #if !defined PRIu64 || PRI_MACROS_BROKEN # undef PRIu64 # define PRIu64 (sizeof (long) == 8 ? "lu" : "llu") #endif #if !defined PRIx64 || PRI_MACROS_BROKEN # undef PRIx64 # define PRIx64 (sizeof (long) == 8 ? "lx" : "llx") #endif #if !defined PRIX64 || PRI_MACROS_BROKEN # undef PRIX64 # define PRIX64 (sizeof (long) == 8 ? "lX" : "llX") #endif #if !defined PRIdLEAST8 || PRI_MACROS_BROKEN # undef PRIdLEAST8 # define PRIdLEAST8 "d" #endif #if !defined PRIiLEAST8 || PRI_MACROS_BROKEN # undef PRIiLEAST8 # define PRIiLEAST8 "i" #endif #if !defined PRIoLEAST8 || PRI_MACROS_BROKEN # undef PRIoLEAST8 # define PRIoLEAST8 "o" #endif #if !defined PRIuLEAST8 || PRI_MACROS_BROKEN # undef PRIuLEAST8 # define PRIuLEAST8 "u" #endif #if !defined PRIxLEAST8 || PRI_MACROS_BROKEN # undef PRIxLEAST8 # define PRIxLEAST8 "x" #endif #if !defined PRIXLEAST8 || PRI_MACROS_BROKEN # undef PRIXLEAST8 # define PRIXLEAST8 "X" #endif #if !defined PRIdLEAST16 || PRI_MACROS_BROKEN # undef PRIdLEAST16 # define PRIdLEAST16 "d" #endif #if !defined PRIiLEAST16 || PRI_MACROS_BROKEN # undef PRIiLEAST16 # define PRIiLEAST16 "i" #endif #if !defined PRIoLEAST16 || PRI_MACROS_BROKEN # undef PRIoLEAST16 # define PRIoLEAST16 "o" #endif #if !defined PRIuLEAST16 || PRI_MACROS_BROKEN # undef PRIuLEAST16 # define PRIuLEAST16 "u" #endif #if !defined PRIxLEAST16 || PRI_MACROS_BROKEN # undef PRIxLEAST16 # define PRIxLEAST16 "x" #endif #if !defined PRIXLEAST16 || PRI_MACROS_BROKEN # undef PRIXLEAST16 # define PRIXLEAST16 "X" #endif #if !defined PRIdLEAST32 || PRI_MACROS_BROKEN # undef PRIdLEAST32 # define PRIdLEAST32 "d" #endif #if !defined PRIiLEAST32 || PRI_MACROS_BROKEN # undef PRIiLEAST32 # define PRIiLEAST32 "i" #endif #if !defined PRIoLEAST32 || PRI_MACROS_BROKEN # undef PRIoLEAST32 # define PRIoLEAST32 "o" #endif #if !defined PRIuLEAST32 || PRI_MACROS_BROKEN # undef PRIuLEAST32 # define PRIuLEAST32 "u" #endif #if !defined PRIxLEAST32 || PRI_MACROS_BROKEN # undef PRIxLEAST32 # define PRIxLEAST32 "x" #endif #if !defined PRIXLEAST32 || PRI_MACROS_BROKEN # undef PRIXLEAST32 # define PRIXLEAST32 "X" #endif #if !defined PRIdLEAST64 || PRI_MACROS_BROKEN # undef PRIdLEAST64 # define PRIdLEAST64 PRId64 #endif #if !defined PRIiLEAST64 || PRI_MACROS_BROKEN # undef PRIiLEAST64 # define PRIiLEAST64 PRIi64 #endif #if !defined PRIoLEAST64 || PRI_MACROS_BROKEN # undef PRIoLEAST64 # define PRIoLEAST64 PRIo64 #endif #if !defined PRIuLEAST64 || PRI_MACROS_BROKEN # undef PRIuLEAST64 # define PRIuLEAST64 PRIu64 #endif #if !defined PRIxLEAST64 || PRI_MACROS_BROKEN # undef PRIxLEAST64 # define PRIxLEAST64 PRIx64 #endif #if !defined PRIXLEAST64 || PRI_MACROS_BROKEN # undef PRIXLEAST64 # define PRIXLEAST64 PRIX64 #endif #if !defined PRIdFAST8 || PRI_MACROS_BROKEN # undef PRIdFAST8 # define PRIdFAST8 "d" #endif #if !defined PRIiFAST8 || PRI_MACROS_BROKEN # undef PRIiFAST8 # define PRIiFAST8 "i" #endif #if !defined PRIoFAST8 || PRI_MACROS_BROKEN # undef PRIoFAST8 # define PRIoFAST8 "o" #endif #if !defined PRIuFAST8 || PRI_MACROS_BROKEN # undef PRIuFAST8 # define PRIuFAST8 "u" #endif #if !defined PRIxFAST8 || PRI_MACROS_BROKEN # undef PRIxFAST8 # define PRIxFAST8 "x" #endif #if !defined PRIXFAST8 || PRI_MACROS_BROKEN # undef PRIXFAST8 # define PRIXFAST8 "X" #endif #if !defined PRIdFAST16 || PRI_MACROS_BROKEN # undef PRIdFAST16 # define PRIdFAST16 "d" #endif #if !defined PRIiFAST16 || PRI_MACROS_BROKEN # undef PRIiFAST16 # define PRIiFAST16 "i" #endif #if !defined PRIoFAST16 || PRI_MACROS_BROKEN # undef PRIoFAST16 # define PRIoFAST16 "o" #endif #if !defined PRIuFAST16 || PRI_MACROS_BROKEN # undef PRIuFAST16 # define PRIuFAST16 "u" #endif #if !defined PRIxFAST16 || PRI_MACROS_BROKEN # undef PRIxFAST16 # define PRIxFAST16 "x" #endif #if !defined PRIXFAST16 || PRI_MACROS_BROKEN # undef PRIXFAST16 # define PRIXFAST16 "X" #endif #if !defined PRIdFAST32 || PRI_MACROS_BROKEN # undef PRIdFAST32 # define PRIdFAST32 "d" #endif #if !defined PRIiFAST32 || PRI_MACROS_BROKEN # undef PRIiFAST32 # define PRIiFAST32 "i" #endif #if !defined PRIoFAST32 || PRI_MACROS_BROKEN # undef PRIoFAST32 # define PRIoFAST32 "o" #endif #if !defined PRIuFAST32 || PRI_MACROS_BROKEN # undef PRIuFAST32 # define PRIuFAST32 "u" #endif #if !defined PRIxFAST32 || PRI_MACROS_BROKEN # undef PRIxFAST32 # define PRIxFAST32 "x" #endif #if !defined PRIXFAST32 || PRI_MACROS_BROKEN # undef PRIXFAST32 # define PRIXFAST32 "X" #endif #if !defined PRIdFAST64 || PRI_MACROS_BROKEN # undef PRIdFAST64 # define PRIdFAST64 PRId64 #endif #if !defined PRIiFAST64 || PRI_MACROS_BROKEN # undef PRIiFAST64 # define PRIiFAST64 PRIi64 #endif #if !defined PRIoFAST64 || PRI_MACROS_BROKEN # undef PRIoFAST64 # define PRIoFAST64 PRIo64 #endif #if !defined PRIuFAST64 || PRI_MACROS_BROKEN # undef PRIuFAST64 # define PRIuFAST64 PRIu64 #endif #if !defined PRIxFAST64 || PRI_MACROS_BROKEN # undef PRIxFAST64 # define PRIxFAST64 PRIx64 #endif #if !defined PRIXFAST64 || PRI_MACROS_BROKEN # undef PRIXFAST64 # define PRIXFAST64 PRIX64 #endif #if !defined PRIdMAX || PRI_MACROS_BROKEN # undef PRIdMAX # define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld") #endif #if !defined PRIiMAX || PRI_MACROS_BROKEN # undef PRIiMAX # define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli") #endif #if !defined PRIoMAX || PRI_MACROS_BROKEN # undef PRIoMAX # define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo") #endif #if !defined PRIuMAX || PRI_MACROS_BROKEN # undef PRIuMAX # define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu") #endif #if !defined PRIxMAX || PRI_MACROS_BROKEN # undef PRIxMAX # define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx") #endif #if !defined PRIXMAX || PRI_MACROS_BROKEN # undef PRIXMAX # define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX") #endif #if !defined PRIdPTR || PRI_MACROS_BROKEN # undef PRIdPTR # define PRIdPTR \ (sizeof (void *) == sizeof (long) ? "ld" : \ sizeof (void *) == sizeof (int) ? "d" : \ "lld") #endif #if !defined PRIiPTR || PRI_MACROS_BROKEN # undef PRIiPTR # define PRIiPTR \ (sizeof (void *) == sizeof (long) ? "li" : \ sizeof (void *) == sizeof (int) ? "i" : \ "lli") #endif #if !defined PRIoPTR || PRI_MACROS_BROKEN # undef PRIoPTR # define PRIoPTR \ (sizeof (void *) == sizeof (long) ? "lo" : \ sizeof (void *) == sizeof (int) ? "o" : \ "llo") #endif #if !defined PRIuPTR || PRI_MACROS_BROKEN # undef PRIuPTR # define PRIuPTR \ (sizeof (void *) == sizeof (long) ? "lu" : \ sizeof (void *) == sizeof (int) ? "u" : \ "llu") #endif #if !defined PRIxPTR || PRI_MACROS_BROKEN # undef PRIxPTR # define PRIxPTR \ (sizeof (void *) == sizeof (long) ? "lx" : \ sizeof (void *) == sizeof (int) ? "x" : \ "llx") #endif #if !defined PRIXPTR || PRI_MACROS_BROKEN # undef PRIXPTR # define PRIXPTR \ (sizeof (void *) == sizeof (long) ? "lX" : \ sizeof (void *) == sizeof (int) ? "X" : \ "llX") #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ISO C functions. This is required by the standard because some ISO C functions will require linking with this object file and the name space must not be polluted. */ # define open(name, flags) open_not_cancel_2 (name, flags) # define close(fd) close_not_cancel_no_status (fd) # define read(fd, buf, n) read_not_cancel (fd, buf, n) # define mmap(addr, len, prot, flags, fd, offset) \ __mmap (addr, len, prot, flags, fd, offset) # define munmap(addr, len) __munmap (addr, len) #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in . */ #if !defined O_BINARY && defined _O_BINARY /* For MSC-compatible compilers. */ # define O_BINARY _O_BINARY # define O_TEXT _O_TEXT #endif #ifdef __BEOS__ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif /* On reasonable systems, binary I/O is the default. */ #ifndef O_BINARY # define O_BINARY 0 #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; /* Expand a system dependent string segment. Return NULL if unsupported. */ static const char * get_sysdep_segment_value (const char *name) { /* Test for an ISO C 99 section 7.8.1 format string directive. Syntax: P R I { d | i | o | u | x | X } { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */ /* We don't use a table of 14 times 6 'const char *' strings here, because data relocations cost startup time. */ if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I') { if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u' || name[3] == 'x' || name[3] == 'X') { if (name[4] == '8' && name[5] == '\0') { if (name[3] == 'd') return PRId8; if (name[3] == 'i') return PRIi8; if (name[3] == 'o') return PRIo8; if (name[3] == 'u') return PRIu8; if (name[3] == 'x') return PRIx8; if (name[3] == 'X') return PRIX8; abort (); } if (name[4] == '1' && name[5] == '6' && name[6] == '\0') { if (name[3] == 'd') return PRId16; if (name[3] == 'i') return PRIi16; if (name[3] == 'o') return PRIo16; if (name[3] == 'u') return PRIu16; if (name[3] == 'x') return PRIx16; if (name[3] == 'X') return PRIX16; abort (); } if (name[4] == '3' && name[5] == '2' && name[6] == '\0') { if (name[3] == 'd') return PRId32; if (name[3] == 'i') return PRIi32; if (name[3] == 'o') return PRIo32; if (name[3] == 'u') return PRIu32; if (name[3] == 'x') return PRIx32; if (name[3] == 'X') return PRIX32; abort (); } if (name[4] == '6' && name[5] == '4' && name[6] == '\0') { if (name[3] == 'd') return PRId64; if (name[3] == 'i') return PRIi64; if (name[3] == 'o') return PRIo64; if (name[3] == 'u') return PRIu64; if (name[3] == 'x') return PRIx64; if (name[3] == 'X') return PRIX64; abort (); } if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A' && name[7] == 'S' && name[8] == 'T') { if (name[9] == '8' && name[10] == '\0') { if (name[3] == 'd') return PRIdLEAST8; if (name[3] == 'i') return PRIiLEAST8; if (name[3] == 'o') return PRIoLEAST8; if (name[3] == 'u') return PRIuLEAST8; if (name[3] == 'x') return PRIxLEAST8; if (name[3] == 'X') return PRIXLEAST8; abort (); } if (name[9] == '1' && name[10] == '6' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST16; if (name[3] == 'i') return PRIiLEAST16; if (name[3] == 'o') return PRIoLEAST16; if (name[3] == 'u') return PRIuLEAST16; if (name[3] == 'x') return PRIxLEAST16; if (name[3] == 'X') return PRIXLEAST16; abort (); } if (name[9] == '3' && name[10] == '2' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST32; if (name[3] == 'i') return PRIiLEAST32; if (name[3] == 'o') return PRIoLEAST32; if (name[3] == 'u') return PRIuLEAST32; if (name[3] == 'x') return PRIxLEAST32; if (name[3] == 'X') return PRIXLEAST32; abort (); } if (name[9] == '6' && name[10] == '4' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST64; if (name[3] == 'i') return PRIiLEAST64; if (name[3] == 'o') return PRIoLEAST64; if (name[3] == 'u') return PRIuLEAST64; if (name[3] == 'x') return PRIxLEAST64; if (name[3] == 'X') return PRIXLEAST64; abort (); } } if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S' && name[7] == 'T') { if (name[8] == '8' && name[9] == '\0') { if (name[3] == 'd') return PRIdFAST8; if (name[3] == 'i') return PRIiFAST8; if (name[3] == 'o') return PRIoFAST8; if (name[3] == 'u') return PRIuFAST8; if (name[3] == 'x') return PRIxFAST8; if (name[3] == 'X') return PRIXFAST8; abort (); } if (name[8] == '1' && name[9] == '6' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST16; if (name[3] == 'i') return PRIiFAST16; if (name[3] == 'o') return PRIoFAST16; if (name[3] == 'u') return PRIuFAST16; if (name[3] == 'x') return PRIxFAST16; if (name[3] == 'X') return PRIXFAST16; abort (); } if (name[8] == '3' && name[9] == '2' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST32; if (name[3] == 'i') return PRIiFAST32; if (name[3] == 'o') return PRIoFAST32; if (name[3] == 'u') return PRIuFAST32; if (name[3] == 'x') return PRIxFAST32; if (name[3] == 'X') return PRIXFAST32; abort (); } if (name[8] == '6' && name[9] == '4' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST64; if (name[3] == 'i') return PRIiFAST64; if (name[3] == 'o') return PRIoFAST64; if (name[3] == 'u') return PRIuFAST64; if (name[3] == 'x') return PRIxFAST64; if (name[3] == 'X') return PRIXFAST64; abort (); } } if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X' && name[7] == '\0') { if (name[3] == 'd') return PRIdMAX; if (name[3] == 'i') return PRIiMAX; if (name[3] == 'o') return PRIoMAX; if (name[3] == 'u') return PRIuMAX; if (name[3] == 'x') return PRIxMAX; if (name[3] == 'X') return PRIXMAX; abort (); } if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R' && name[7] == '\0') { if (name[3] == 'd') return PRIdPTR; if (name[3] == 'i') return PRIiPTR; if (name[3] == 'o') return PRIoPTR; if (name[3] == 'u') return PRIuPTR; if (name[3] == 'x') return PRIxPTR; if (name[3] == 'X') return PRIXPTR; abort (); } } } /* Test for a glibc specific printf() format directive flag. */ if (name[0] == 'I' && name[1] == '\0') { #if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) /* The 'I' flag, in numeric format directives, replaces ASCII digits with the 'outdigits' defined in the LC_CTYPE locale facet. This is used for Farsi (Persian) and maybe Arabic. */ return "I"; #else return ""; #endif } /* Other system dependent strings are not valid. */ return NULL; } /* Load the message catalogs specified by FILENAME. If it is no valid message catalog do nothing. */ void internal_function _nl_load_domain (struct loaded_l10nfile *domain_file, struct binding *domainbinding) { __libc_lock_define_initialized_recursive (static, lock) int fd = -1; size_t size; #ifdef _LIBC struct stat64 st; #else struct stat st; #endif struct mo_file_header *data = (struct mo_file_header *) -1; int use_mmap = 0; struct loaded_domain *domain; int revision; const char *nullentry; size_t nullentrylen; __libc_lock_lock_recursive (lock); if (domain_file->decided != 0) { /* There are two possibilities: + this is the same thread calling again during this initialization via _nl_find_msg. We have initialized everything this call needs. + this is another thread which tried to initialize this object. Not necessary anymore since if the lock is available this is finished. */ goto done; } domain_file->decided = -1; domain_file->data = NULL; /* Note that it would be useless to store domainbinding in domain_file because domainbinding might be == NULL now but != NULL later (after a call to bind_textdomain_codeset). */ /* 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_file->filename == NULL) goto out; /* Try to open the addressed file. */ fd = open (domain_file->filename, O_RDONLY | O_BINARY); if (fd == -1) goto out; /* We must know about the size of the file. */ if ( #ifdef _LIBC __builtin_expect (fstat64 (fd, &st) != 0, 0) #else __builtin_expect (fstat (fd, &st) != 0, 0) #endif || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) || __builtin_expect (size < sizeof (struct mo_file_header), 0)) /* Something went wrong. */ goto out; #ifdef HAVE_MMAP /* 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, size, PROT_READ, MAP_PRIVATE, fd, 0); if (__builtin_expect (data != (struct mo_file_header *) -1, 1)) { /* mmap() call was successful. */ close (fd); fd = -1; 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) { size_t to_read; char *read_ptr; data = (struct mo_file_header *) malloc (size); if (data == NULL) goto out; to_read = size; read_ptr = (char *) data; do { long int nb = (long int) read (fd, read_ptr, to_read); if (nb <= 0) { #ifdef EINTR if (nb == -1 && errno == EINTR) continue; #endif goto out; } read_ptr += nb; to_read -= nb; } while (to_read > 0); close (fd); fd = -1; } /* Using the magic number we can test whether it really is a message catalog file. */ if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED, 0)) { /* The magic number is wrong: not a message catalog file. */ #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); goto out; } domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain)); if (domain == NULL) goto out; domain_file->data = domain; domain->data = (char *) data; domain->use_mmap = use_mmap; domain->mmap_size = size; domain->must_swap = data->magic != _MAGIC; domain->malloced = NULL; /* Fill in the information about the available tables. */ revision = W (domain->must_swap, data->revision); /* We support only the major revisions 0 and 1. */ switch (revision >> 16) { case 0: case 1: domain->nstrings = W (domain->must_swap, data->nstrings); domain->orig_tab = (const struct string_desc *) ((char *) data + W (domain->must_swap, data->orig_tab_offset)); domain->trans_tab = (const 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 = (domain->hash_size > 2 ? (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->hash_tab_offset)) : NULL); domain->must_swap_hash_tab = domain->must_swap; /* Now dispatch on the minor revision. */ switch (revision & 0xffff) { case 0: domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; break; case 1: default: { nls_uint32 n_sysdep_strings; if (domain->hash_tab == NULL) /* This is invalid. These minor revisions need a hash table. */ goto invalid; n_sysdep_strings = W (domain->must_swap, data->n_sysdep_strings); if (n_sysdep_strings > 0) { nls_uint32 n_sysdep_segments; const struct sysdep_segment *sysdep_segments; const char **sysdep_segment_values; const nls_uint32 *orig_sysdep_tab; const nls_uint32 *trans_sysdep_tab; nls_uint32 n_inmem_sysdep_strings; size_t memneed; char *mem; struct sysdep_string_desc *inmem_orig_sysdep_tab; struct sysdep_string_desc *inmem_trans_sysdep_tab; nls_uint32 *inmem_hash_tab; unsigned int i, j; /* Get the values of the system dependent segments. */ n_sysdep_segments = W (domain->must_swap, data->n_sysdep_segments); sysdep_segments = (const struct sysdep_segment *) ((char *) data + W (domain->must_swap, data->sysdep_segments_offset)); sysdep_segment_values = (const char **) alloca (n_sysdep_segments * sizeof (const char *)); for (i = 0; i < n_sysdep_segments; i++) { const char *name = (char *) data + W (domain->must_swap, sysdep_segments[i].offset); nls_uint32 namelen = W (domain->must_swap, sysdep_segments[i].length); if (!(namelen > 0 && name[namelen - 1] == '\0')) { freea (sysdep_segment_values); goto invalid; } sysdep_segment_values[i] = get_sysdep_segment_value (name); } orig_sysdep_tab = (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->orig_sysdep_tab_offset)); trans_sysdep_tab = (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->trans_sysdep_tab_offset)); /* Compute the amount of additional memory needed for the system dependent strings and the augmented hash table. At the same time, also drop string pairs which refer to an undefined system dependent segment. */ n_inmem_sysdep_strings = 0; memneed = domain->hash_size * sizeof (nls_uint32); for (i = 0; i < n_sysdep_strings; i++) { int valid = 1; size_t needs[2]; for (j = 0; j < 2; j++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, j == 0 ? orig_sysdep_tab[i] : trans_sysdep_tab[i])); size_t need = 0; const struct segment_pair *p = sysdep_string->segments; if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END) for (p = sysdep_string->segments;; p++) { nls_uint32 sysdepref; need += W (domain->must_swap, p->segsize); sysdepref = W (domain->must_swap, p->sysdepref); if (sysdepref == SEGMENTS_END) break; if (sysdepref >= n_sysdep_segments) { /* Invalid. */ freea (sysdep_segment_values); goto invalid; } if (sysdep_segment_values[sysdepref] == NULL) { /* This particular string pair is invalid. */ valid = 0; break; } need += strlen (sysdep_segment_values[sysdepref]); } needs[j] = need; if (!valid) break; } if (valid) { n_inmem_sysdep_strings++; memneed += needs[0] + needs[1]; } } memneed += 2 * n_inmem_sysdep_strings * sizeof (struct sysdep_string_desc); if (n_inmem_sysdep_strings > 0) { unsigned int k; /* Allocate additional memory. */ mem = (char *) malloc (memneed); if (mem == NULL) goto invalid; domain->malloced = mem; inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem; mem += n_inmem_sysdep_strings * sizeof (struct sysdep_string_desc); inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem; mem += n_inmem_sysdep_strings * sizeof (struct sysdep_string_desc); inmem_hash_tab = (nls_uint32 *) mem; mem += domain->hash_size * sizeof (nls_uint32); /* Compute the system dependent strings. */ k = 0; for (i = 0; i < n_sysdep_strings; i++) { int valid = 1; for (j = 0; j < 2; j++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, j == 0 ? orig_sysdep_tab[i] : trans_sysdep_tab[i])); const struct segment_pair *p = sysdep_string->segments; if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END) for (p = sysdep_string->segments;; p++) { nls_uint32 sysdepref; sysdepref = W (domain->must_swap, p->sysdepref); if (sysdepref == SEGMENTS_END) break; if (sysdep_segment_values[sysdepref] == NULL) { /* This particular string pair is invalid. */ valid = 0; break; } } if (!valid) break; } if (valid) { for (j = 0; j < 2; j++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, j == 0 ? orig_sysdep_tab[i] : trans_sysdep_tab[i])); const char *static_segments = (char *) data + W (domain->must_swap, sysdep_string->offset); const struct segment_pair *p = sysdep_string->segments; /* Concatenate the segments, and fill inmem_orig_sysdep_tab[k] (for j == 0) and inmem_trans_sysdep_tab[k] (for j == 1). */ struct sysdep_string_desc *inmem_tab_entry = (j == 0 ? inmem_orig_sysdep_tab : inmem_trans_sysdep_tab) + k; if (W (domain->must_swap, p->sysdepref) == SEGMENTS_END) { /* Only one static segment. */ inmem_tab_entry->length = W (domain->must_swap, p->segsize); inmem_tab_entry->pointer = static_segments; } else { inmem_tab_entry->pointer = mem; for (p = sysdep_string->segments;; p++) { nls_uint32 segsize = W (domain->must_swap, p->segsize); nls_uint32 sysdepref = W (domain->must_swap, p->sysdepref); size_t n; if (segsize > 0) { memcpy (mem, static_segments, segsize); mem += segsize; static_segments += segsize; } if (sysdepref == SEGMENTS_END) break; n = strlen (sysdep_segment_values[sysdepref]); memcpy (mem, sysdep_segment_values[sysdepref], n); mem += n; } inmem_tab_entry->length = mem - inmem_tab_entry->pointer; } } k++; } } if (k != n_inmem_sysdep_strings) abort (); /* Compute the augmented hash table. */ for (i = 0; i < domain->hash_size; i++) inmem_hash_tab[i] = W (domain->must_swap_hash_tab, domain->hash_tab[i]); for (i = 0; i < n_inmem_sysdep_strings; i++) { const char *msgid = inmem_orig_sysdep_tab[i].pointer; 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)); for (;;) { if (inmem_hash_tab[idx] == 0) { /* Hash table entry is empty. Use it. */ inmem_hash_tab[idx] = 1 + domain->nstrings + i; break; } if (idx >= domain->hash_size - incr) idx -= domain->hash_size - incr; else idx += incr; } } domain->n_sysdep_strings = n_inmem_sysdep_strings; domain->orig_sysdep_tab = inmem_orig_sysdep_tab; domain->trans_sysdep_tab = inmem_trans_sysdep_tab; domain->hash_tab = inmem_hash_tab; domain->must_swap_hash_tab = 0; } else { domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; } freea (sysdep_segment_values); } else { domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; } } break; } break; default: /* This is an invalid revision. */ invalid: /* This is an invalid .mo file. */ if (domain->malloced) free (domain->malloced); #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); free (domain); domain_file->data = NULL; goto out; } /* No caches of converted translations so far. */ domain->conversions = NULL; domain->nconversions = 0; gl_rwlock_init (domain->conversions_lock); /* Get the header entry and look for a plural specification. */ #ifdef IN_LIBGLOCALE nullentry = _nl_find_msg (domain_file, domainbinding, NULL, "", &nullentrylen); #else nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); #endif EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); out: if (fd != -1) close (fd); domain_file->decided = 1; done: __libc_lock_unlock_recursive (lock); } #ifdef _LIBC void internal_function __libc_freeres_fn_section _nl_unload_domain (struct loaded_domain *domain) { size_t i; if (domain->plural != &__gettext_germanic_plural) __gettext_free_exp ((struct expression *) domain->plural); for (i = 0; i < domain->nconversions; i++) { struct converted_domain *convd = &domain->conversions[i]; free (convd->encoding); if (convd->conv_tab != NULL && convd->conv_tab != (char **) -1) free (convd->conv_tab); if (convd->conv != (__gconv_t) -1) __gconv_close (convd->conv); } if (domain->conversions != NULL) free (domain->conversions); __libc_rwlock_fini (domain->conversions_lock); if (domain->malloced) free (domain->malloced); # ifdef _POSIX_MAPPED_FILES if (domain->use_mmap) munmap ((caddr_t) domain->data, domain->mmap_size); else # endif /* _POSIX_MAPPED_FILES */ free ((void *) domain->data); free (domain); } #endif sitecopy-0.16.6/intl/localcharset.h0000644000076400007640000000256310243450466015364 0ustar joejoe/* Determine a canonical name for the current locale's character encoding. Copyright (C) 2000-2003 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LOCALCHARSET_H #define _LOCALCHARSET_H #ifdef __cplusplus extern "C" { #endif /* Determine the current locale's character encoding, and canonicalize it into one of the canonical names listed in config.charset. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ extern const char * locale_charset (void); #ifdef __cplusplus } #endif #endif /* _LOCALCHARSET_H */ sitecopy-0.16.6/intl/explodename.c0000644000076400007640000000654610704163767015230 0ustar joejoe/* Copyright (C) 1995-1998, 2000-2001, 2003, 2005, 2007 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif /* @@ end of prolog @@ */ /* Split a locale name NAME into a leading language part and all the rest. Return a pointer to the first character after the language, i.e. to the first byte of the rest. */ static char *_nl_find_language (const char *name); static char * _nl_find_language (const char *name) { while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '.') ++name; return (char *) name; } int _nl_explode_name (char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset) { char *cp; int mask; *modifier = NULL; *territory = NULL; *codeset = NULL; *normalized_codeset = NULL; /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_', '.', and `@'. */ mask = 0; *language = cp = name; cp = _nl_find_language (*language); 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; mask |= XPG_TERRITORY; } if (cp[0] == '.') { /* Next is the codeset. */ cp[0] = '\0'; *codeset = ++cp; while (cp[0] != '\0' && cp[0] != '@') ++cp; mask |= XPG_CODESET; if (*codeset != cp && (*codeset)[0] != '\0') { *normalized_codeset = _nl_normalize_codeset (*codeset, cp - *codeset); if (*normalized_codeset == NULL) return -1; else if (strcmp (*codeset, *normalized_codeset) == 0) free ((char *) *normalized_codeset); else mask |= XPG_NORM_CODESET; } } } if (cp[0] == '@') { /* Next is the modifier. */ cp[0] = '\0'; *modifier = ++cp; if (cp[0] != '\0') mask |= XPG_MODIFIER; } if (*territory != NULL && (*territory)[0] == '\0') mask &= ~XPG_TERRITORY; if (*codeset != NULL && (*codeset)[0] == '\0') mask &= ~XPG_CODESET; return mask; } sitecopy-0.16.6/intl/l10nflist.c0000644000076400007640000002557210447013345014531 0ustar joejoe/* Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for stpcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #if defined _LIBC || defined HAVE_ARGZ_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #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. */ # ifndef stpcpy # define stpcpy(dest, src) __stpcpy(dest, src) # endif #else # ifndef HAVE_STPCPY static char *stpcpy (char *dest, const char *src); # endif #endif /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. */ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) #endif /* Define function which are usually not available. */ #ifdef _LIBC # define __argz_count(argz, len) INTUSE(__argz_count) (argz, len) #elif defined HAVE_ARGZ_COUNT # undef __argz_count # define __argz_count argz_count #else /* Returns the number of strings in ARGZ. */ static size_t argz_count__ (const char *argz, size_t len) { size_t count = 0; while (len > 0) { size_t part_len = strlen (argz); argz += part_len + 1; len -= part_len + 1; count++; } return count; } # undef __argz_count # define __argz_count(argz, len) argz_count__ (argz, len) #endif /* !_LIBC && !HAVE_ARGZ_COUNT */ #ifdef _LIBC # define __argz_stringify(argz, len, sep) \ INTUSE(__argz_stringify) (argz, len, sep) #elif defined HAVE_ARGZ_STRINGIFY # undef __argz_stringify # define __argz_stringify argz_stringify #else /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's except the last into the character SEP. */ static void argz_stringify__ (char *argz, size_t len, int sep) { while (len > 0) { size_t part_len = strlen (argz); argz += part_len; len -= part_len + 1; if (len > 0) *argz++ = sep; } } # undef __argz_stringify # define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep) #endif /* !_LIBC && !HAVE_ARGZ_STRINGIFY */ #ifdef _LIBC #elif defined HAVE_ARGZ_NEXT # undef __argz_next # define __argz_next argz_next #else static char * argz_next__ (char *argz, size_t argz_len, const char *entry) { if (entry) { if (entry < argz + argz_len) entry = strchr (entry, '\0') + 1; return entry >= argz + argz_len ? NULL : (char *) entry; } else if (argz_len > 0) return argz; else return 0; } # undef __argz_next # define __argz_next(argz, len, entry) argz_next__ (argz, len, entry) #endif /* !_LIBC && !HAVE_ARGZ_NEXT */ /* Return number of bits set in X. */ static inline int pop (int x) { /* We assume that no more than 16 bits are used. */ x = ((x & ~0x5555) >> 1) + (x & 0x5555); x = ((x & ~0x3333) >> 2) + (x & 0x3333); x = ((x >> 4) + x) & 0x0f0f; x = ((x >> 8) + x) & 0xff; return x; } struct loaded_l10nfile * _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *filename, int do_allocate) { char *abs_filename; struct loaded_l10nfile **lastp; struct loaded_l10nfile *retval; char *cp; size_t dirlist_count; size_t entries; int cnt; /* If LANGUAGE contains an absolute directory specification, we ignore DIRLIST. */ if (IS_ABSOLUTE_PATH (language)) dirlist_len = 0; /* Allocate room for the full file name. */ abs_filename = (char *) malloc (dirlist_len + strlen (language) + ((mask & XPG_TERRITORY) != 0 ? strlen (territory) + 1 : 0) + ((mask & XPG_CODESET) != 0 ? strlen (codeset) + 1 : 0) + ((mask & XPG_NORM_CODESET) != 0 ? strlen (normalized_codeset) + 1 : 0) + ((mask & XPG_MODIFIER) != 0 ? strlen (modifier) + 1 : 0) + 1 + strlen (filename) + 1); if (abs_filename == NULL) return NULL; /* Construct file name. */ cp = abs_filename; if (dirlist_len > 0) { memcpy (cp, dirlist, dirlist_len); __argz_stringify (cp, dirlist_len, PATH_SEPARATOR); cp += dirlist_len; cp[-1] = '/'; } cp = stpcpy (cp, language); if ((mask & XPG_TERRITORY) != 0) { *cp++ = '_'; cp = stpcpy (cp, territory); } if ((mask & XPG_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, codeset); } if ((mask & XPG_NORM_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, normalized_codeset); } if ((mask & XPG_MODIFIER) != 0) { *cp++ = '@'; cp = stpcpy (cp, modifier); } *cp++ = '/'; stpcpy (cp, filename); /* Look in list of already loaded domains whether it is already available. */ lastp = l10nfile_list; for (retval = *l10nfile_list; retval != NULL; retval = retval->next) if (retval->filename != NULL) { int compare = strcmp (retval->filename, abs_filename); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It's not in the list. */ retval = NULL; break; } lastp = &retval->next; } if (retval != NULL || do_allocate == 0) { free (abs_filename); return retval; } dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1); /* Allocate a new loaded_l10nfile. */ retval = (struct loaded_l10nfile *) malloc (sizeof (*retval) + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0)) * sizeof (struct loaded_l10nfile *))); if (retval == NULL) { free (abs_filename); return NULL; } retval->filename = abs_filename; /* We set retval->data to NULL here; it is filled in later. Setting retval->decided to 1 here means that retval does not correspond to a real file (dirlist_count > 1) or is not worth looking up (if an unnormalized codeset was specified). */ retval->decided = (dirlist_count > 1 || ((mask & XPG_CODESET) != 0 && (mask & XPG_NORM_CODESET) != 0)); retval->data = NULL; retval->next = *lastp; *lastp = retval; entries = 0; /* Recurse to fill the inheritance list of RETVAL. If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL entry does not correspond to a real file; retval->filename contains colons. In this case we loop across all elements of DIRLIST and across all bit patterns dominated by MASK. If the DIRLIST is a single directory or entirely redundant (i.e. DIRLIST_COUNT == 1), we loop across all bit patterns dominated by MASK, excluding MASK itself. In either case, we loop down from MASK to 0. This has the effect that the extra bits in the locale name are dropped in this order: first the modifier, then the territory, then the codeset, then the normalized_codeset. */ for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt) if ((cnt & ~mask) == 0 && !((cnt & XPG_CODESET) != 0 && (cnt & XPG_NORM_CODESET) != 0)) { if (dirlist_count > 1) { /* Iterate over all elements of the DIRLIST. */ char *dir = NULL; while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir)) != NULL) retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt, language, territory, codeset, normalized_codeset, modifier, filename, 1); } else retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, cnt, language, territory, codeset, normalized_codeset, modifier, filename, 1); } retval->successor[entries] = NULL; return retval; } /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ const char * _nl_normalize_codeset (const char *codeset, size_t name_len) { int len = 0; int only_digit = 1; char *retval; char *wp; size_t cnt; for (cnt = 0; cnt < name_len; ++cnt) if (isalnum ((unsigned char) codeset[cnt])) { ++len; if (isalpha ((unsigned char) codeset[cnt])) only_digit = 0; } retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1); if (retval != NULL) { if (only_digit) wp = stpcpy (retval, "iso"); else wp = retval; for (cnt = 0; cnt < name_len; ++cnt) if (isalpha ((unsigned char) codeset[cnt])) *wp++ = tolower ((unsigned char) codeset[cnt]); else if (isdigit ((unsigned char) codeset[cnt])) *wp++ = codeset[cnt]; *wp = '\0'; } return (const char *) 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 (char *dest, const char *src) { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif sitecopy-0.16.6/intl/tsearch.c0000644000076400007640000004462010624140346014340 0ustar joejoe/* Copyright (C) 1995, 1996, 1997, 2000, 2006 Free Software Foundation, Inc. Contributed by Bernd Schmidt , 1997. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tree search for red/black trees. The algorithm for adding nodes is taken from one of the many "Algorithms" books by Robert Sedgewick, although the implementation differs. The algorithm for deleting nodes can probably be found in a book named "Introduction to Algorithms" by Cormen/Leiserson/Rivest. At least that's the book that my professor took most algorithms from during the "Data Structures" course... Totally public domain. */ /* Red/black trees are binary trees in which the edges are colored either red or black. They have the following properties: 1. The number of black edges on every path from the root to a leaf is constant. 2. No two red edges are adjacent. Therefore there is an upper bound on the length of every path, it's O(log n) where n is the number of nodes in the tree. No path can be longer than 1+2*P where P is the length of the shortest path in the tree. Useful for the implementation: 3. If one of the children of a node is NULL, then the other one is red (if it exists). In the implementation, not the edges are colored, but the nodes. The color interpreted as the color of the edge leading to this node. The color is meaningless for the root node, but we color the root node black for convenience. All added nodes are red initially. Adding to a red/black tree is rather easy. The right place is searched with a usual binary tree search. Additionally, whenever a node N is reached that has two red successors, the successors are colored black and the node itself colored red. This moves red edges up the tree where they pose less of a problem once we get to really insert the new node. Changing N's color to red may violate rule 2, however, so rotations may become necessary to restore the invariants. Adding a new red leaf may violate the same rule, so afterwards an additional check is run and the tree possibly rotated. Deleting is hairy. There are mainly two nodes involved: the node to be deleted (n1), and another node that is to be unchained from the tree (n2). If n1 has a successor (the node with a smallest key that is larger than n1), then the successor becomes n2 and its contents are copied into n1, otherwise n1 becomes n2. Unchaining a node may violate rule 1: if n2 is black, one subtree is missing one black edge afterwards. The algorithm must try to move this error upwards towards the root, so that the subtree that does not have enough black edges becomes the whole tree. Once that happens, the error has disappeared. It may not be necessary to go all the way up, since it is possible that rotations and recoloring can fix the error before that. Although the deletion algorithm must walk upwards through the tree, we do not store parent pointers in the nodes. Instead, delete allocates a small array of parent pointers and fills it while descending the tree. Since we know that the length of a path is O(log n), where n is the number of nodes, this is likely to use less memory. */ /* Tree rotations look like this: A C / \ / \ B C A G / \ / \ --> / \ D E F G B F / \ D E In this case, A has been rotated left. This preserves the ordering of the binary tree. */ #include /* Specification. */ #ifdef IN_LIBINTL # include "tsearch.h" #else # include #endif #include typedef int (*__compar_fn_t) (const void *, const void *); typedef void (*__action_fn_t) (const void *, VISIT, int); #ifndef weak_alias # define __tsearch tsearch # define __tfind tfind # define __tdelete tdelete # define __twalk twalk #endif #ifndef internal_function /* Inside GNU libc we mark some function in a special way. In other environments simply ignore the marking. */ # define internal_function #endif typedef struct node_t { /* Callers expect this to be the first element in the structure - do not move! */ const void *key; struct node_t *left; struct node_t *right; unsigned int red:1; } *node; typedef const struct node_t *const_node; #undef DEBUGGING #ifdef DEBUGGING /* Routines to check tree invariants. */ #include #define CHECK_TREE(a) check_tree(a) static void check_tree_recurse (node p, int d_sofar, int d_total) { if (p == NULL) { assert (d_sofar == d_total); return; } check_tree_recurse (p->left, d_sofar + (p->left && !p->left->red), d_total); check_tree_recurse (p->right, d_sofar + (p->right && !p->right->red), d_total); if (p->left) assert (!(p->left->red && p->red)); if (p->right) assert (!(p->right->red && p->red)); } static void check_tree (node root) { int cnt = 0; node p; if (root == NULL) return; root->red = 0; for(p = root->left; p; p = p->left) cnt += !p->red; check_tree_recurse (root, 0, cnt); } #else #define CHECK_TREE(a) #endif /* Possibly "split" a node with two red successors, and/or fix up two red edges in a row. ROOTP is a pointer to the lowest node we visited, PARENTP and GPARENTP pointers to its parent/grandparent. P_R and GP_R contain the comparison values that determined which way was taken in the tree to reach ROOTP. MODE is 1 if we need not do the split, but must check for two red edges between GPARENTP and ROOTP. */ static void maybe_split_for_insert (node *rootp, node *parentp, node *gparentp, int p_r, int gp_r, int mode) { node root = *rootp; node *rp, *lp; rp = &(*rootp)->right; lp = &(*rootp)->left; /* See if we have to split this node (both successors red). */ if (mode == 1 || ((*rp) != NULL && (*lp) != NULL && (*rp)->red && (*lp)->red)) { /* This node becomes red, its successors black. */ root->red = 1; if (*rp) (*rp)->red = 0; if (*lp) (*lp)->red = 0; /* If the parent of this node is also red, we have to do rotations. */ if (parentp != NULL && (*parentp)->red) { node gp = *gparentp; node p = *parentp; /* There are two main cases: 1. The edge types (left or right) of the two red edges differ. 2. Both red edges are of the same type. There exist two symmetries of each case, so there is a total of 4 cases. */ if ((p_r > 0) != (gp_r > 0)) { /* Put the child at the top of the tree, with its parent and grandparent as successors. */ p->red = 1; gp->red = 1; root->red = 0; if (p_r < 0) { /* Child is left of parent. */ p->left = *rp; *rp = p; gp->right = *lp; *lp = gp; } else { /* Child is right of parent. */ p->right = *lp; *lp = p; gp->left = *rp; *rp = gp; } *gparentp = root; } else { *gparentp = *parentp; /* Parent becomes the top of the tree, grandparent and child are its successors. */ p->red = 0; gp->red = 1; if (p_r < 0) { /* Left edges. */ gp->left = p->right; p->right = gp; } else { /* Right edges. */ gp->right = p->left; p->left = gp; } } } } } /* Find or insert datum into search tree. KEY is the key to be located, ROOTP is the address of tree root, COMPAR the ordering function. */ void * __tsearch (const void *key, void **vrootp, __compar_fn_t compar) { node q; node *parentp = NULL, *gparentp = NULL; node *rootp = (node *) vrootp; node *nextp; int r = 0, p_r = 0, gp_r = 0; /* No they might not, Mr Compiler. */ if (rootp == NULL) return NULL; /* This saves some additional tests below. */ if (*rootp != NULL) (*rootp)->red = 0; CHECK_TREE (*rootp); nextp = rootp; while (*nextp != NULL) { node root = *rootp; r = (*compar) (key, root->key); if (r == 0) return root; maybe_split_for_insert (rootp, parentp, gparentp, p_r, gp_r, 0); /* If that did any rotations, parentp and gparentp are now garbage. That doesn't matter, because the values they contain are never used again in that case. */ nextp = r < 0 ? &root->left : &root->right; if (*nextp == NULL) break; gparentp = parentp; parentp = rootp; rootp = nextp; gp_r = p_r; p_r = r; } q = (struct node_t *) malloc (sizeof (struct node_t)); if (q != NULL) { *nextp = q; /* link new node to old */ q->key = key; /* initialize new node */ q->red = 1; q->left = q->right = NULL; if (nextp != rootp) /* There may be two red edges in a row now, which we must avoid by rotating the tree. */ maybe_split_for_insert (nextp, rootp, parentp, r, p_r, 1); } return q; } #ifdef weak_alias weak_alias (__tsearch, tsearch) #endif /* Find datum in search tree. KEY is the key to be located, ROOTP is the address of tree root, COMPAR the ordering function. */ void * __tfind (key, vrootp, compar) const void *key; void *const *vrootp; __compar_fn_t compar; { node *rootp = (node *) vrootp; if (rootp == NULL) return NULL; CHECK_TREE (*rootp); while (*rootp != NULL) { node root = *rootp; int r; r = (*compar) (key, root->key); if (r == 0) return root; rootp = r < 0 ? &root->left : &root->right; } return NULL; } #ifdef weak_alias weak_alias (__tfind, tfind) #endif /* Delete node with given key. KEY is the key to be deleted, ROOTP is the address of the root of tree, COMPAR the comparison function. */ void * __tdelete (const void *key, void **vrootp, __compar_fn_t compar) { node p, q, r, retval; int cmp; node *rootp = (node *) vrootp; node root, unchained; /* Stack of nodes so we remember the parents without recursion. It's _very_ unlikely that there are paths longer than 40 nodes. The tree would need to have around 250.000 nodes. */ int stacksize = 100; int sp = 0; node *nodestack[100]; if (rootp == NULL) return NULL; p = *rootp; if (p == NULL) return NULL; CHECK_TREE (p); while ((cmp = (*compar) (key, (*rootp)->key)) != 0) { if (sp == stacksize) abort (); nodestack[sp++] = rootp; p = *rootp; rootp = ((cmp < 0) ? &(*rootp)->left : &(*rootp)->right); if (*rootp == NULL) return NULL; } /* This is bogus if the node to be deleted is the root... this routine really should return an integer with 0 for success, -1 for failure and errno = ESRCH or something. */ retval = p; /* We don't unchain the node we want to delete. Instead, we overwrite it with its successor and unchain the successor. If there is no successor, we really unchain the node to be deleted. */ root = *rootp; r = root->right; q = root->left; if (q == NULL || r == NULL) unchained = root; else { node *parent = rootp, *up = &root->right; for (;;) { if (sp == stacksize) abort (); nodestack[sp++] = parent; parent = up; if ((*up)->left == NULL) break; up = &(*up)->left; } unchained = *up; } /* We know that either the left or right successor of UNCHAINED is NULL. R becomes the other one, it is chained into the parent of UNCHAINED. */ r = unchained->left; if (r == NULL) r = unchained->right; if (sp == 0) *rootp = r; else { q = *nodestack[sp-1]; if (unchained == q->right) q->right = r; else q->left = r; } if (unchained != root) root->key = unchained->key; if (!unchained->red) { /* Now we lost a black edge, which means that the number of black edges on every path is no longer constant. We must balance the tree. */ /* NODESTACK now contains all parents of R. R is likely to be NULL in the first iteration. */ /* NULL nodes are considered black throughout - this is necessary for correctness. */ while (sp > 0 && (r == NULL || !r->red)) { node *pp = nodestack[sp - 1]; p = *pp; /* Two symmetric cases. */ if (r == p->left) { /* Q is R's brother, P is R's parent. The subtree with root R has one black edge less than the subtree with root Q. */ q = p->right; if (q->red) { /* If Q is red, we know that P is black. We rotate P left so that Q becomes the top node in the tree, with P below it. P is colored red, Q is colored black. This action does not change the black edge count for any leaf in the tree, but we will be able to recognize one of the following situations, which all require that Q is black. */ q->red = 0; p->red = 1; /* Left rotate p. */ p->right = q->left; q->left = p; *pp = q; /* Make sure pp is right if the case below tries to use it. */ nodestack[sp++] = pp = &q->left; q = p->right; } /* We know that Q can't be NULL here. We also know that Q is black. */ if ((q->left == NULL || !q->left->red) && (q->right == NULL || !q->right->red)) { /* Q has two black successors. We can simply color Q red. The whole subtree with root P is now missing one black edge. Note that this action can temporarily make the tree invalid (if P is red). But we will exit the loop in that case and set P black, which both makes the tree valid and also makes the black edge count come out right. If P is black, we are at least one step closer to the root and we'll try again the next iteration. */ q->red = 1; r = p; } else { /* Q is black, one of Q's successors is red. We can repair the tree with one operation and will exit the loop afterwards. */ if (q->right == NULL || !q->right->red) { /* The left one is red. We perform the same action as in maybe_split_for_insert where two red edges are adjacent but point in different directions: Q's left successor (let's call it Q2) becomes the top of the subtree we are looking at, its parent (Q) and grandparent (P) become its successors. The former successors of Q2 are placed below P and Q. P becomes black, and Q2 gets the color that P had. This changes the black edge count only for node R and its successors. */ node q2 = q->left; q2->red = p->red; p->right = q2->left; q->left = q2->right; q2->right = q; q2->left = p; *pp = q2; p->red = 0; } else { /* It's the right one. Rotate P left. P becomes black, and Q gets the color that P had. Q's right successor also becomes black. This changes the black edge count only for node R and its successors. */ q->red = p->red; p->red = 0; q->right->red = 0; /* left rotate p */ p->right = q->left; q->left = p; *pp = q; } /* We're done. */ sp = 1; r = NULL; } } else { /* Comments: see above. */ q = p->left; if (q->red) { q->red = 0; p->red = 1; p->left = q->right; q->right = p; *pp = q; nodestack[sp++] = pp = &q->right; q = p->left; } if ((q->right == NULL || !q->right->red) && (q->left == NULL || !q->left->red)) { q->red = 1; r = p; } else { if (q->left == NULL || !q->left->red) { node q2 = q->right; q2->red = p->red; p->left = q2->right; q->right = q2->left; q2->left = q; q2->right = p; *pp = q2; p->red = 0; } else { q->red = p->red; p->red = 0; q->left->red = 0; p->left = q->right; q->right = p; *pp = q; } sp = 1; r = NULL; } } --sp; } if (r != NULL) r->red = 0; } free (unchained); return retval; } #ifdef weak_alias weak_alias (__tdelete, tdelete) #endif /* Walk the nodes of a tree. ROOT is the root of the tree to be walked, ACTION the function to be called at each node. LEVEL is the level of ROOT in the whole tree. */ static void internal_function trecurse (const void *vroot, __action_fn_t action, int level) { const_node root = (const_node) vroot; if (root->left == NULL && root->right == NULL) (*action) (root, leaf, level); else { (*action) (root, preorder, level); if (root->left != NULL) trecurse (root->left, action, level + 1); (*action) (root, postorder, level); if (root->right != NULL) trecurse (root->right, action, level + 1); (*action) (root, endorder, level); } } /* Walk the nodes of a tree. ROOT is the root of the tree to be walked, ACTION the function to be called at each node. */ void __twalk (const void *vroot, __action_fn_t action) { const_node root = (const_node) vroot; CHECK_TREE (root); if (root != NULL && action != NULL) trecurse (root, action, 0); } #ifdef weak_alias weak_alias (__twalk, twalk) #endif #ifdef _LIBC /* The standardized functions miss an important functionality: the tree cannot be removed easily. We provide a function to do this. */ static void internal_function tdestroy_recurse (node root, __free_fn_t freefct) { if (root->left != NULL) tdestroy_recurse (root->left, freefct); if (root->right != NULL) tdestroy_recurse (root->right, freefct); (*freefct) ((void *) root->key); /* Free the node itself. */ free (root); } void __tdestroy (void *vroot, __free_fn_t freefct) { node root = (node) vroot; CHECK_TREE (root); if (root != NULL) tdestroy_recurse (root, freefct); } weak_alias (__tdestroy, tdestroy) #endif /* _LIBC */ sitecopy-0.16.6/intl/printf-parse.h0000644000076400007640000000421310243450467015325 0ustar joejoe/* Parse printf format string. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PRINTF_PARSE_H #define _PRINTF_PARSE_H #include "printf-args.h" /* Flags */ #define FLAG_GROUP 1 /* ' flag */ #define FLAG_LEFT 2 /* - flag */ #define FLAG_SHOWSIGN 4 /* + flag */ #define FLAG_SPACE 8 /* space flag */ #define FLAG_ALT 16 /* # flag */ #define FLAG_ZERO 32 /* arg_index value indicating that no argument is consumed. */ #define ARG_NONE (~(size_t)0) /* A parsed directive. */ typedef struct { const char* dir_start; const char* dir_end; int flags; const char* width_start; const char* width_end; size_t width_arg_index; const char* precision_start; const char* precision_end; size_t precision_arg_index; char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ size_t arg_index; } char_directive; /* A parsed format string. */ typedef struct { size_t count; char_directive *dir; size_t max_width_length; size_t max_precision_length; } char_directives; /* Parses the format string. Fills in the number N of directives, and fills in directives[0], ..., directives[N-1], and sets directives[N].dir_start to the end of the format string. Also fills in the arg_type fields of the arguments and the needed count of arguments. */ #ifdef STATIC STATIC #else extern #endif int printf_parse (const char *format, char_directives *d, arguments *a); #endif /* _PRINTF_PARSE_H */ sitecopy-0.16.6/intl/vasnprintf.c0000644000076400007640000035070310713725563015114 0ustar joejoe/* vsprintf with automatic memory allocation. Copyright (C) 1999, 2002-2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file can be parametrized with the following macros: VASNPRINTF The name of the function being defined. FCHAR_T The element type of the format string. DCHAR_T The element type of the destination (result) string. FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters in the format string are ASCII. MUST be set if FCHAR_T and DCHAR_T are not the same type. DIRECTIVE Structure denoting a format directive. Depends on FCHAR_T. DIRECTIVES Structure denoting the set of format directives of a format string. Depends on FCHAR_T. PRINTF_PARSE Function that parses a format string. Depends on FCHAR_T. DCHAR_CPY memcpy like function for DCHAR_T[] arrays. DCHAR_SET memset like function for DCHAR_T[] arrays. DCHAR_MBSNLEN mbsnlen like function for DCHAR_T[] arrays. SNPRINTF The system's snprintf (or similar) function. This may be either snprintf or swprintf. TCHAR_T The element type of the argument and result string of the said SNPRINTF function. This may be either char or wchar_t. The code exploits that sizeof (TCHAR_T) | sizeof (DCHAR_T) and alignof (TCHAR_T) <= alignof (DCHAR_T). DCHAR_IS_TCHAR Set to 1 if DCHAR_T and TCHAR_T are the same type. DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[]. DCHAR_IS_UINT8_T Set to 1 if DCHAR_T is uint8_t. DCHAR_IS_UINT16_T Set to 1 if DCHAR_T is uint16_t. DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t. */ /* Tell glibc's to provide a prototype for snprintf(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifndef VASNPRINTF # include #endif #ifndef IN_LIBINTL # include #endif /* Specification. */ #ifndef VASNPRINTF # if WIDE_CHAR_VERSION # include "vasnwprintf.h" # else # include "vasnprintf.h" # endif #endif #include /* localeconv() */ #include /* snprintf(), sprintf() */ #include /* abort(), malloc(), realloc(), free() */ #include /* memcpy(), strlen() */ #include /* errno */ #include /* CHAR_BIT */ #include /* DBL_MAX_EXP, LDBL_MAX_EXP */ #if HAVE_NL_LANGINFO # include #endif #ifndef VASNPRINTF # if WIDE_CHAR_VERSION # include "wprintf-parse.h" # else # include "printf-parse.h" # endif #endif /* Checked size_t computations. */ #include "xsize.h" #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL # include # include "float+.h" #endif #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL # include # include "isnan.h" #endif #if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL # include # include "isnanl-nolibm.h" # include "fpucw.h" #endif #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL # include # include "isnan.h" # include "printf-frexp.h" #endif #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL # include # include "isnanl-nolibm.h" # include "printf-frexpl.h" # include "fpucw.h" #endif /* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ #ifndef EOVERFLOW # define EOVERFLOW E2BIG #endif #if HAVE_WCHAR_T # if HAVE_WCSLEN # define local_wcslen wcslen # else /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid a dependency towards this library, here is a local substitute. Define this substitute only once, even if this file is included twice in the same compilation unit. */ # ifndef local_wcslen_defined # define local_wcslen_defined 1 static size_t local_wcslen (const wchar_t *s) { const wchar_t *ptr; for (ptr = s; *ptr != (wchar_t) 0; ptr++) ; return ptr - s; } # endif # endif #endif /* Default parameters. */ #ifndef VASNPRINTF # if WIDE_CHAR_VERSION # define VASNPRINTF vasnwprintf # define FCHAR_T wchar_t # define DCHAR_T wchar_t # define TCHAR_T wchar_t # define DCHAR_IS_TCHAR 1 # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives # define PRINTF_PARSE wprintf_parse # define DCHAR_CPY wmemcpy # else # define VASNPRINTF vasnprintf # define FCHAR_T char # define DCHAR_T char # define TCHAR_T char # define DCHAR_IS_TCHAR 1 # define DIRECTIVE char_directive # define DIRECTIVES char_directives # define PRINTF_PARSE printf_parse # define DCHAR_CPY memcpy # endif #endif #if WIDE_CHAR_VERSION /* TCHAR_T is wchar_t. */ # define USE_SNPRINTF 1 # if HAVE_DECL__SNWPRINTF /* On Windows, the function swprintf() has a different signature than on Unix; we use the _snwprintf() function instead. */ # define SNPRINTF _snwprintf # else /* Unix. */ # define SNPRINTF swprintf # endif #else /* TCHAR_T is char. */ # /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'. But don't use it on BeOS, since BeOS snprintf produces no output if the size argument is >= 0x3000000. */ # if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ # define USE_SNPRINTF 1 # else # define USE_SNPRINTF 0 # endif # if HAVE_DECL__SNPRINTF /* Windows. */ # define SNPRINTF _snprintf # else /* Unix. */ # define SNPRINTF snprintf /* Here we need to call the native snprintf, not rpl_snprintf. */ # undef snprintf # endif #endif /* Here we need to call the native sprintf, not rpl_sprintf. */ #undef sprintf #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL /* Determine the decimal-point character according to the current locale. */ # ifndef decimal_point_char_defined # define decimal_point_char_defined 1 static char decimal_point_char () { const char *point; /* Determine it in a multithread-safe way. We know nl_langinfo is multithread-safe on glibc systems, but is not required to be multithread- safe by POSIX. sprintf(), however, is multithread-safe. localeconv() is rarely multithread-safe. */ # if HAVE_NL_LANGINFO && __GLIBC__ point = nl_langinfo (RADIXCHAR); # elif 1 char pointbuf[5]; sprintf (pointbuf, "%#.0f", 1.0); point = &pointbuf[1]; # else point = localeconv () -> decimal_point; # endif /* The decimal point is always a single byte: either '.' or ','. */ return (point[0] != '\0' ? point[0] : '.'); } # endif #endif #if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL /* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ static int is_infinite_or_zero (double x) { return isnan (x) || x + x == x; } #endif #if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL /* Equivalent to !isfinite(x), but does not require libm. */ static int is_infinitel (long double x) { return isnanl (x) || (x + x == x && x != 0.0L); } #endif #if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL /* Converting 'long double' to decimal without rare rounding bugs requires real bignums. We use the naming conventions of GNU gmp, but vastly simpler (and slower) algorithms. */ typedef unsigned int mp_limb_t; # define GMP_LIMB_BITS 32 typedef int mp_limb_verify[2 * (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS) - 1]; typedef unsigned long long mp_twolimb_t; # define GMP_TWOLIMB_BITS 64 typedef int mp_twolimb_verify[2 * (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS) - 1]; /* Representation of a bignum >= 0. */ typedef struct { size_t nlimbs; mp_limb_t *limbs; /* Bits in little-endian order, allocated with malloc(). */ } mpn_t; /* Compute the product of two bignums >= 0. Return the allocated memory in case of success, NULL in case of memory allocation failure. */ static void * multiply (mpn_t src1, mpn_t src2, mpn_t *dest) { const mp_limb_t *p1; const mp_limb_t *p2; size_t len1; size_t len2; if (src1.nlimbs <= src2.nlimbs) { len1 = src1.nlimbs; p1 = src1.limbs; len2 = src2.nlimbs; p2 = src2.limbs; } else { len1 = src2.nlimbs; p1 = src2.limbs; len2 = src1.nlimbs; p2 = src1.limbs; } /* Now 0 <= len1 <= len2. */ if (len1 == 0) { /* src1 or src2 is zero. */ dest->nlimbs = 0; dest->limbs = (mp_limb_t *) malloc (1); } else { /* Here 1 <= len1 <= len2. */ size_t dlen; mp_limb_t *dp; size_t k, i, j; dlen = len1 + len2; dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t)); if (dp == NULL) return NULL; for (k = len2; k > 0; ) dp[--k] = 0; for (i = 0; i < len1; i++) { mp_limb_t digit1 = p1[i]; mp_twolimb_t carry = 0; for (j = 0; j < len2; j++) { mp_limb_t digit2 = p2[j]; carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; carry += dp[i + j]; dp[i + j] = (mp_limb_t) carry; carry = carry >> GMP_LIMB_BITS; } dp[i + len2] = (mp_limb_t) carry; } /* Normalise. */ while (dlen > 0 && dp[dlen - 1] == 0) dlen--; dest->nlimbs = dlen; dest->limbs = dp; } return dest->limbs; } /* Compute the quotient of a bignum a >= 0 and a bignum b > 0. a is written as a = q * b + r with 0 <= r < b. q is the quotient, r the remainder. Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd, q is incremented. Return the allocated memory in case of success, NULL in case of memory allocation failure. */ static void * divide (mpn_t a, mpn_t b, mpn_t *q) { /* Algorithm: First normalise a and b: a=[a[m-1],...,a[0]], b=[b[n-1],...,b[0]] with m>=0 and n>0 (in base beta = 2^GMP_LIMB_BITS). If m=n=1, perform a single-precision division: r:=0, j:=m, while j>0 do {Here (q[m-1]*beta^(m-1)+...+q[j]*beta^j) * b[0] + r*beta^j = = a[m-1]*beta^(m-1)+...+a[j]*beta^j und 0<=r=n>1, perform a multiple-precision division: We have a/b < beta^(m-n+1). s:=intDsize-1-(hightest bit in b[n-1]), 0<=s=beta/2. For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).} Compute q* : q* := floor((r[j+n]*beta+r[j+n-1])/b[n-1]). In case of overflow (q* >= beta) set q* := beta-1. Compute c2 := ((r[j+n]*beta+r[j+n-1]) - q* * b[n-1])*beta + r[j+n-2] and c3 := b[n-2] * q*. {We have 0 <= c2 < 2*beta^2, even 0 <= c2 < beta^2 if no overflow occurred. Furthermore 0 <= c3 < beta^2. If there was overflow and r[j+n]*beta+r[j+n-1] - q* * b[n-1] >= beta, i.e. c2 >= beta^2, the next test can be skipped.} While c3 > c2, {Here 0 <= c2 < c3 < beta^2} Put q* := q* - 1, c2 := c2 + b[n-1]*beta, c3 := c3 - b[n-2]. If q* > 0: Put r := r - b * q* * beta^j. In detail: [r[n+j],...,r[j]] := [r[n+j],...,r[j]] - q* * [b[n-1],...,b[0]]. hence: u:=0, for i:=0 to n-1 do u := u + q* * b[i], r[j+i]:=r[j+i]-(u mod beta) (+ beta, if carry), u:=u div beta (+ 1, if carry in subtraction) r[n+j]:=r[n+j]-u. {Since always u = (q* * [b[i-1],...,b[0]] div beta^i) + 1 < q* + 1 <= beta, the carry u does not overflow.} If a negative carry occurs, put q* := q* - 1 and [r[n+j],...,r[j]] := [r[n+j],...,r[j]] + [0,b[n-1],...,b[0]]. Set q[j] := q*. Normalise [q[m-n],..,q[0]]; this yields the quotient q. Shift [r[n-1],...,r[0]] right by s bits and normalise; this yields the rest r. The room for q[j] can be allocated at the memory location of r[n+j]. Finally, round-to-even: Shift r left by 1 bit. If r > b or if r = b and q[0] is odd, q := q+1. */ const mp_limb_t *a_ptr = a.limbs; size_t a_len = a.nlimbs; const mp_limb_t *b_ptr = b.limbs; size_t b_len = b.nlimbs; mp_limb_t *roomptr; mp_limb_t *tmp_roomptr = NULL; mp_limb_t *q_ptr; size_t q_len; mp_limb_t *r_ptr; size_t r_len; /* Allocate room for a_len+2 digits. (Need a_len+1 digits for the real division and 1 more digit for the final rounding of q.) */ roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t)); if (roomptr == NULL) return NULL; /* Normalise a. */ while (a_len > 0 && a_ptr[a_len - 1] == 0) a_len--; /* Normalise b. */ for (;;) { if (b_len == 0) /* Division by zero. */ abort (); if (b_ptr[b_len - 1] == 0) b_len--; else break; } /* Here m = a_len >= 0 and n = b_len > 0. */ if (a_len < b_len) { /* m beta^(m-2) <= a/b < beta^m */ r_ptr = roomptr; q_ptr = roomptr + 1; { mp_limb_t den = b_ptr[0]; mp_limb_t remainder = 0; const mp_limb_t *sourceptr = a_ptr + a_len; mp_limb_t *destptr = q_ptr + a_len; size_t count; for (count = a_len; count > 0; count--) { mp_twolimb_t num = ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr; *--destptr = num / den; remainder = num % den; } /* Normalise and store r. */ if (remainder > 0) { r_ptr[0] = remainder; r_len = 1; } else r_len = 0; /* Normalise q. */ q_len = a_len; if (q_ptr[q_len - 1] == 0) q_len--; } } else { /* n>1: multiple precision division. beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==> beta^(m-n-1) <= a/b < beta^(m-n+1). */ /* Determine s. */ size_t s; { mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */ s = 31; if (msd >= 0x10000) { msd = msd >> 16; s -= 16; } if (msd >= 0x100) { msd = msd >> 8; s -= 8; } if (msd >= 0x10) { msd = msd >> 4; s -= 4; } if (msd >= 0x4) { msd = msd >> 2; s -= 2; } if (msd >= 0x2) { msd = msd >> 1; s -= 1; } } /* 0 <= s < GMP_LIMB_BITS. Copy b, shifting it left by s bits. */ if (s > 0) { tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t)); if (tmp_roomptr == NULL) { free (roomptr); return NULL; } { const mp_limb_t *sourceptr = b_ptr; mp_limb_t *destptr = tmp_roomptr; mp_twolimb_t accu = 0; size_t count; for (count = b_len; count > 0; count--) { accu += (mp_twolimb_t) *sourceptr++ << s; *destptr++ = (mp_limb_t) accu; accu = accu >> GMP_LIMB_BITS; } /* accu must be zero, since that was how s was determined. */ if (accu != 0) abort (); } b_ptr = tmp_roomptr; } /* Copy a, shifting it left by s bits, yields r. Memory layout: At the beginning: r = roomptr[0..a_len], at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */ r_ptr = roomptr; if (s == 0) { memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t)); r_ptr[a_len] = 0; } else { const mp_limb_t *sourceptr = a_ptr; mp_limb_t *destptr = r_ptr; mp_twolimb_t accu = 0; size_t count; for (count = a_len; count > 0; count--) { accu += (mp_twolimb_t) *sourceptr++ << s; *destptr++ = (mp_limb_t) accu; accu = accu >> GMP_LIMB_BITS; } *destptr++ = (mp_limb_t) accu; } q_ptr = roomptr + b_len; q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */ { size_t j = a_len - b_len; /* m-n */ mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */ mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */ mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */ ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd; /* Division loop, traversed m-n+1 times. j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */ for (;;) { mp_limb_t q_star; mp_limb_t c1; if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */ { /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */ mp_twolimb_t num = ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS) | r_ptr[j + b_len - 1]; q_star = num / b_msd; c1 = num % b_msd; } else { /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */ q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */ /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) {<= beta !}. If yes, jump directly to the subtraction loop. (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */ if (r_ptr[j + b_len] > b_msd || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd) /* r[j+n] >= b[n-1]+1 or r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a carry. */ goto subtract; } /* q_star = q*, c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, 0, decrease it by b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2 this can happen only twice. */ if (c3 > c2) { q_star = q_star - 1; /* q* := q* - 1 */ if (c3 - c2 > b_msdd) q_star = q_star - 1; /* q* := q* - 1 */ } } if (q_star > 0) subtract: { /* Subtract r := r - b * q* * beta^j. */ mp_limb_t cr; { const mp_limb_t *sourceptr = b_ptr; mp_limb_t *destptr = r_ptr + j; mp_twolimb_t carry = 0; size_t count; for (count = b_len; count > 0; count--) { /* Here 0 <= carry <= q*. */ carry = carry + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++ + (mp_limb_t) ~(*destptr); /* Here 0 <= carry <= beta*q* + beta-1. */ *destptr++ = ~(mp_limb_t) carry; carry = carry >> GMP_LIMB_BITS; /* <= q* */ } cr = (mp_limb_t) carry; } /* Subtract cr from r_ptr[j + b_len], then forget about r_ptr[j + b_len]. */ if (cr > r_ptr[j + b_len]) { /* Subtraction gave a carry. */ q_star = q_star - 1; /* q* := q* - 1 */ /* Add b back. */ { const mp_limb_t *sourceptr = b_ptr; mp_limb_t *destptr = r_ptr + j; mp_limb_t carry = 0; size_t count; for (count = b_len; count > 0; count--) { mp_limb_t source1 = *sourceptr++; mp_limb_t source2 = *destptr; *destptr++ = source1 + source2 + carry; carry = (carry ? source1 >= (mp_limb_t) ~source2 : source1 > (mp_limb_t) ~source2); } } /* Forget about the carry and about r[j+n]. */ } } /* q* is determined. Store it as q[j]. */ q_ptr[j] = q_star; if (j == 0) break; j--; } } r_len = b_len; /* Normalise q. */ if (q_ptr[q_len - 1] == 0) q_len--; # if 0 /* Not needed here, since we need r only to compare it with b/2, and b is shifted left by s bits. */ /* Shift r right by s bits. */ if (s > 0) { mp_limb_t ptr = r_ptr + r_len; mp_twolimb_t accu = 0; size_t count; for (count = r_len; count > 0; count--) { accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS; accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s); *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS); } } # endif /* Normalise r. */ while (r_len > 0 && r_ptr[r_len - 1] == 0) r_len--; } /* Compare r << 1 with b. */ if (r_len > b_len) goto increment_q; { size_t i; for (i = b_len;;) { mp_limb_t r_i = (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0) | (i < r_len ? r_ptr[i] << 1 : 0); mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0); if (r_i > b_i) goto increment_q; if (r_i < b_i) goto keep_q; if (i == 0) break; i--; } } if (q_len > 0 && ((q_ptr[0] & 1) != 0)) /* q is odd. */ increment_q: { size_t i; for (i = 0; i < q_len; i++) if (++(q_ptr[i]) != 0) goto keep_q; q_ptr[q_len++] = 1; } keep_q: if (tmp_roomptr != NULL) free (tmp_roomptr); q->limbs = q_ptr; q->nlimbs = q_len; return roomptr; } /* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal representation. Destroys the contents of a. Return the allocated memory - containing the decimal digits in low-to-high order, terminated with a NUL character - in case of success, NULL in case of memory allocation failure. */ static char * convert_to_decimal (mpn_t a, size_t extra_zeroes) { mp_limb_t *a_ptr = a.limbs; size_t a_len = a.nlimbs; /* 0.03345 is slightly larger than log(2)/(9*log(10)). */ size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1); char *c_ptr = (char *) malloc (xsum (c_len, extra_zeroes)); if (c_ptr != NULL) { char *d_ptr = c_ptr; for (; extra_zeroes > 0; extra_zeroes--) *d_ptr++ = '0'; while (a_len > 0) { /* Divide a by 10^9, in-place. */ mp_limb_t remainder = 0; mp_limb_t *ptr = a_ptr + a_len; size_t count; for (count = a_len; count > 0; count--) { mp_twolimb_t num = ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr; *ptr = num / 1000000000; remainder = num % 1000000000; } /* Store the remainder as 9 decimal digits. */ for (count = 9; count > 0; count--) { *d_ptr++ = '0' + (remainder % 10); remainder = remainder / 10; } /* Normalize a. */ if (a_ptr[a_len - 1] == 0) a_len--; } /* Remove leading zeroes. */ while (d_ptr > c_ptr && d_ptr[-1] == '0') d_ptr--; /* But keep at least one zero. */ if (d_ptr == c_ptr) *d_ptr++ = '0'; /* Terminate the string. */ *d_ptr = '\0'; } return c_ptr; } # if NEED_PRINTF_LONG_DOUBLE /* Assuming x is finite and >= 0: write x as x = 2^e * m, where m is a bignum. Return the allocated memory in case of success, NULL in case of memory allocation failure. */ static void * decode_long_double (long double x, int *ep, mpn_t *mp) { mpn_t m; int exp; long double y; size_t i; /* Allocate memory for result. */ m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); if (m.limbs == NULL) return NULL; /* Split into exponential part and mantissa. */ y = frexpl (x, &exp); if (!(y >= 0.0L && y < 1.0L)) abort (); /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * LDBL_MANT_BIT), and the latter is an integer. */ /* Convert the mantissa (y * LDBL_MANT_BIT) to a sequence of limbs. I'm not sure whether it's safe to cast a 'long double' value between 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int', doesn't matter). */ # if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0 # if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 { mp_limb_t hi, lo; y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2)); hi = (int) y; y -= hi; if (!(y >= 0.0L && y < 1.0L)) abort (); y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); lo = (int) y; y -= lo; if (!(y >= 0.0L && y < 1.0L)) abort (); m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; } # else { mp_limb_t d; y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS); d = (int) y; y -= d; if (!(y >= 0.0L && y < 1.0L)) abort (); m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d; } # endif # endif for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) { mp_limb_t hi, lo; y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); hi = (int) y; y -= hi; if (!(y >= 0.0L && y < 1.0L)) abort (); y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); lo = (int) y; y -= lo; if (!(y >= 0.0L && y < 1.0L)) abort (); m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; } if (!(y == 0.0L)) abort (); /* Normalise. */ while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) m.nlimbs--; *mp = m; *ep = exp - LDBL_MANT_BIT; return m.limbs; } # endif # if NEED_PRINTF_DOUBLE /* Assuming x is finite and >= 0: write x as x = 2^e * m, where m is a bignum. Return the allocated memory in case of success, NULL in case of memory allocation failure. */ static void * decode_double (double x, int *ep, mpn_t *mp) { mpn_t m; int exp; double y; size_t i; /* Allocate memory for result. */ m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); if (m.limbs == NULL) return NULL; /* Split into exponential part and mantissa. */ y = frexp (x, &exp); if (!(y >= 0.0 && y < 1.0)) abort (); /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * DBL_MANT_BIT), and the latter is an integer. */ /* Convert the mantissa (y * DBL_MANT_BIT) to a sequence of limbs. I'm not sure whether it's safe to cast a 'double' value between 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only 'double' values between 0 and 2^16 (to 'unsigned int' or 'int', doesn't matter). */ # if (DBL_MANT_BIT % GMP_LIMB_BITS) != 0 # if (DBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 { mp_limb_t hi, lo; y *= (mp_limb_t) 1 << (DBL_MANT_BIT % (GMP_LIMB_BITS / 2)); hi = (int) y; y -= hi; if (!(y >= 0.0 && y < 1.0)) abort (); y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); lo = (int) y; y -= lo; if (!(y >= 0.0 && y < 1.0)) abort (); m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; } # else { mp_limb_t d; y *= (mp_limb_t) 1 << (DBL_MANT_BIT % GMP_LIMB_BITS); d = (int) y; y -= d; if (!(y >= 0.0 && y < 1.0)) abort (); m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d; } # endif # endif for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) { mp_limb_t hi, lo; y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); hi = (int) y; y -= hi; if (!(y >= 0.0 && y < 1.0)) abort (); y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); lo = (int) y; y -= lo; if (!(y >= 0.0 && y < 1.0)) abort (); m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; } if (!(y == 0.0)) abort (); /* Normalise. */ while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) m.nlimbs--; *mp = m; *ep = exp - DBL_MANT_BIT; return m.limbs; } # endif /* Assuming x = 2^e * m is finite and >= 0, and n is an integer: Returns the decimal representation of round (x * 10^n). Return the allocated memory - containing the decimal digits in low-to-high order, terminated with a NUL character - in case of success, NULL in case of memory allocation failure. */ static char * scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) { int s; size_t extra_zeroes; unsigned int abs_n; unsigned int abs_s; mp_limb_t *pow5_ptr; size_t pow5_len; unsigned int s_limbs; unsigned int s_bits; mpn_t pow5; mpn_t z; void *z_memory; char *digits; if (memory == NULL) return NULL; /* x = 2^e * m, hence y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m) = round (2^s * 5^n * m). */ s = e + n; extra_zeroes = 0; /* Factor out a common power of 10 if possible. */ if (s > 0 && n > 0) { extra_zeroes = (s < n ? s : n); s -= extra_zeroes; n -= extra_zeroes; } /* Here y = round (2^s * 5^n * m) * 10^extra_zeroes. Before converting to decimal, we need to compute z = round (2^s * 5^n * m). */ /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same sign. 2.322 is slightly larger than log(5)/log(2). */ abs_n = (n >= 0 ? n : -n); abs_s = (s >= 0 ? s : -s); pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1 + abs_s / GMP_LIMB_BITS + 1) * sizeof (mp_limb_t)); if (pow5_ptr == NULL) { free (memory); return NULL; } /* Initialize with 1. */ pow5_ptr[0] = 1; pow5_len = 1; /* Multiply with 5^|n|. */ if (abs_n > 0) { static mp_limb_t const small_pow5[13 + 1] = { 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, 48828125, 244140625, 1220703125 }; unsigned int n13; for (n13 = 0; n13 <= abs_n; n13 += 13) { mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13]; size_t j; mp_twolimb_t carry = 0; for (j = 0; j < pow5_len; j++) { mp_limb_t digit2 = pow5_ptr[j]; carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; pow5_ptr[j] = (mp_limb_t) carry; carry = carry >> GMP_LIMB_BITS; } if (carry > 0) pow5_ptr[pow5_len++] = (mp_limb_t) carry; } } s_limbs = abs_s / GMP_LIMB_BITS; s_bits = abs_s % GMP_LIMB_BITS; if (n >= 0 ? s >= 0 : s <= 0) { /* Multiply with 2^|s|. */ if (s_bits > 0) { mp_limb_t *ptr = pow5_ptr; mp_twolimb_t accu = 0; size_t count; for (count = pow5_len; count > 0; count--) { accu += (mp_twolimb_t) *ptr << s_bits; *ptr++ = (mp_limb_t) accu; accu = accu >> GMP_LIMB_BITS; } if (accu > 0) { *ptr = (mp_limb_t) accu; pow5_len++; } } if (s_limbs > 0) { size_t count; for (count = pow5_len; count > 0;) { count--; pow5_ptr[s_limbs + count] = pow5_ptr[count]; } for (count = s_limbs; count > 0;) { count--; pow5_ptr[count] = 0; } pow5_len += s_limbs; } pow5.limbs = pow5_ptr; pow5.nlimbs = pow5_len; if (n >= 0) { /* Multiply m with pow5. No division needed. */ z_memory = multiply (m, pow5, &z); } else { /* Divide m by pow5 and round. */ z_memory = divide (m, pow5, &z); } } else { pow5.limbs = pow5_ptr; pow5.nlimbs = pow5_len; if (n >= 0) { /* n >= 0, s < 0. Multiply m with pow5, then divide by 2^|s|. */ mpn_t numerator; mpn_t denominator; void *tmp_memory; tmp_memory = multiply (m, pow5, &numerator); if (tmp_memory == NULL) { free (pow5_ptr); free (memory); return NULL; } /* Construct 2^|s|. */ { mp_limb_t *ptr = pow5_ptr + pow5_len; size_t i; for (i = 0; i < s_limbs; i++) ptr[i] = 0; ptr[s_limbs] = (mp_limb_t) 1 << s_bits; denominator.limbs = ptr; denominator.nlimbs = s_limbs + 1; } z_memory = divide (numerator, denominator, &z); free (tmp_memory); } else { /* n < 0, s > 0. Multiply m with 2^s, then divide by pow5. */ mpn_t numerator; mp_limb_t *num_ptr; num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1) * sizeof (mp_limb_t)); if (num_ptr == NULL) { free (pow5_ptr); free (memory); return NULL; } { mp_limb_t *destptr = num_ptr; { size_t i; for (i = 0; i < s_limbs; i++) *destptr++ = 0; } if (s_bits > 0) { const mp_limb_t *sourceptr = m.limbs; mp_twolimb_t accu = 0; size_t count; for (count = m.nlimbs; count > 0; count--) { accu += (mp_twolimb_t) *sourceptr++ << s_bits; *destptr++ = (mp_limb_t) accu; accu = accu >> GMP_LIMB_BITS; } if (accu > 0) *destptr++ = (mp_limb_t) accu; } else { const mp_limb_t *sourceptr = m.limbs; size_t count; for (count = m.nlimbs; count > 0; count--) *destptr++ = *sourceptr++; } numerator.limbs = num_ptr; numerator.nlimbs = destptr - num_ptr; } z_memory = divide (numerator, pow5, &z); free (num_ptr); } } free (pow5_ptr); free (memory); /* Here y = round (x * 10^n) = z * 10^extra_zeroes. */ if (z_memory == NULL) return NULL; digits = convert_to_decimal (z, extra_zeroes); free (z_memory); return digits; } # if NEED_PRINTF_LONG_DOUBLE /* Assuming x is finite and >= 0, and n is an integer: Returns the decimal representation of round (x * 10^n). Return the allocated memory - containing the decimal digits in low-to-high order, terminated with a NUL character - in case of success, NULL in case of memory allocation failure. */ static char * scale10_round_decimal_long_double (long double x, int n) { int e; mpn_t m; void *memory = decode_long_double (x, &e, &m); return scale10_round_decimal_decoded (e, m, memory, n); } # endif # if NEED_PRINTF_DOUBLE /* Assuming x is finite and >= 0, and n is an integer: Returns the decimal representation of round (x * 10^n). Return the allocated memory - containing the decimal digits in low-to-high order, terminated with a NUL character - in case of success, NULL in case of memory allocation failure. */ static char * scale10_round_decimal_double (double x, int n) { int e; mpn_t m; void *memory = decode_double (x, &e, &m); return scale10_round_decimal_decoded (e, m, memory, n); } # endif # if NEED_PRINTF_LONG_DOUBLE /* Assuming x is finite and > 0: Return an approximation for n with 10^n <= x < 10^(n+1). The approximation is usually the right n, but may be off by 1 sometimes. */ static int floorlog10l (long double x) { int exp; long double y; double z; double l; /* Split into exponential part and mantissa. */ y = frexpl (x, &exp); if (!(y >= 0.0L && y < 1.0L)) abort (); if (y == 0.0L) return INT_MIN; if (y < 0.5L) { while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2)))) { y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2)); exp -= GMP_LIMB_BITS; } if (y < (1.0L / (1 << 16))) { y *= 1.0L * (1 << 16); exp -= 16; } if (y < (1.0L / (1 << 8))) { y *= 1.0L * (1 << 8); exp -= 8; } if (y < (1.0L / (1 << 4))) { y *= 1.0L * (1 << 4); exp -= 4; } if (y < (1.0L / (1 << 2))) { y *= 1.0L * (1 << 2); exp -= 2; } if (y < (1.0L / (1 << 1))) { y *= 1.0L * (1 << 1); exp -= 1; } } if (!(y >= 0.5L && y < 1.0L)) abort (); /* Compute an approximation for l = log2(x) = exp + log2(y). */ l = exp; z = y; if (z < 0.70710678118654752444) { z *= 1.4142135623730950488; l -= 0.5; } if (z < 0.8408964152537145431) { z *= 1.1892071150027210667; l -= 0.25; } if (z < 0.91700404320467123175) { z *= 1.0905077326652576592; l -= 0.125; } if (z < 0.9576032806985736469) { z *= 1.0442737824274138403; l -= 0.0625; } /* Now 0.95 <= z <= 1.01. */ z = 1 - z; /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ... Four terms are enough to get an approximation with error < 10^-7. */ l -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); /* Finally multiply with log(2)/log(10), yields an approximation for log10(x). */ l *= 0.30102999566398119523; /* Round down to the next integer. */ return (int) l + (l < 0 ? -1 : 0); } # endif # if NEED_PRINTF_DOUBLE /* Assuming x is finite and > 0: Return an approximation for n with 10^n <= x < 10^(n+1). The approximation is usually the right n, but may be off by 1 sometimes. */ static int floorlog10 (double x) { int exp; double y; double z; double l; /* Split into exponential part and mantissa. */ y = frexp (x, &exp); if (!(y >= 0.0 && y < 1.0)) abort (); if (y == 0.0) return INT_MIN; if (y < 0.5) { while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2)))) { y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2)); exp -= GMP_LIMB_BITS; } if (y < (1.0 / (1 << 16))) { y *= 1.0 * (1 << 16); exp -= 16; } if (y < (1.0 / (1 << 8))) { y *= 1.0 * (1 << 8); exp -= 8; } if (y < (1.0 / (1 << 4))) { y *= 1.0 * (1 << 4); exp -= 4; } if (y < (1.0 / (1 << 2))) { y *= 1.0 * (1 << 2); exp -= 2; } if (y < (1.0 / (1 << 1))) { y *= 1.0 * (1 << 1); exp -= 1; } } if (!(y >= 0.5 && y < 1.0)) abort (); /* Compute an approximation for l = log2(x) = exp + log2(y). */ l = exp; z = y; if (z < 0.70710678118654752444) { z *= 1.4142135623730950488; l -= 0.5; } if (z < 0.8408964152537145431) { z *= 1.1892071150027210667; l -= 0.25; } if (z < 0.91700404320467123175) { z *= 1.0905077326652576592; l -= 0.125; } if (z < 0.9576032806985736469) { z *= 1.0442737824274138403; l -= 0.0625; } /* Now 0.95 <= z <= 1.01. */ z = 1 - z; /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ... Four terms are enough to get an approximation with error < 10^-7. */ l -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); /* Finally multiply with log(2)/log(10), yields an approximation for log10(x). */ l *= 0.30102999566398119523; /* Round down to the next integer. */ return (int) l + (l < 0 ? -1 : 0); } # endif #endif DCHAR_T * VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, const FCHAR_T *format, va_list args) { DIRECTIVES d; arguments a; if (PRINTF_PARSE (format, &d, &a) < 0) /* errno is already set. */ return NULL; #define CLEANUP() \ free (d.dir); \ if (a.arg) \ free (a.arg); if (PRINTF_FETCHARGS (args, &a) < 0) { CLEANUP (); errno = EINVAL; return NULL; } { size_t buf_neededlength; TCHAR_T *buf; TCHAR_T *buf_malloced; const FCHAR_T *cp; size_t i; DIRECTIVE *dp; /* Output string accumulator. */ DCHAR_T *result; size_t allocated; size_t length; /* Allocate a small buffer that will hold a directive passed to sprintf or snprintf. */ buf_neededlength = xsum4 (7, d.max_width_length, d.max_precision_length, 6); #if HAVE_ALLOCA if (buf_neededlength < 4000 / sizeof (TCHAR_T)) { buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T)); buf_malloced = NULL; } else #endif { size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T)); if (size_overflow_p (buf_memsize)) goto out_of_memory_1; buf = (TCHAR_T *) malloc (buf_memsize); if (buf == NULL) goto out_of_memory_1; buf_malloced = buf; } if (resultbuf != NULL) { result = resultbuf; allocated = *lengthp; } else { result = NULL; allocated = 0; } length = 0; /* Invariants: result is either == resultbuf or == NULL or malloc-allocated. If length > 0, then result != NULL. */ /* Ensures that allocated >= needed. Aborts through a jump to out_of_memory if needed is SIZE_MAX or otherwise too big. */ #define ENSURE_ALLOCATION(needed) \ if ((needed) > allocated) \ { \ size_t memory_size; \ DCHAR_T *memory; \ \ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ if ((needed) > allocated) \ allocated = (needed); \ memory_size = xtimes (allocated, sizeof (DCHAR_T)); \ if (size_overflow_p (memory_size)) \ goto out_of_memory; \ if (result == resultbuf || result == NULL) \ memory = (DCHAR_T *) malloc (memory_size); \ else \ memory = (DCHAR_T *) realloc (result, memory_size); \ if (memory == NULL) \ goto out_of_memory; \ if (result == resultbuf && length > 0) \ DCHAR_CPY (memory, result, length); \ result = memory; \ } for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) { if (cp != dp->dir_start) { size_t n = dp->dir_start - cp; size_t augmented_length = xsum (length, n); ENSURE_ALLOCATION (augmented_length); /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we need that the format string contains only ASCII characters if FCHAR_T and DCHAR_T are not the same type. */ if (sizeof (FCHAR_T) == sizeof (DCHAR_T)) { DCHAR_CPY (result + length, (const DCHAR_T *) cp, n); length = augmented_length; } else { do result[length++] = (unsigned char) *cp++; while (--n > 0); } } if (i == d.count) break; /* Execute a single directive. */ if (dp->conversion == '%') { size_t augmented_length; if (!(dp->arg_index == ARG_NONE)) abort (); augmented_length = xsum (length, 1); ENSURE_ALLOCATION (augmented_length); result[length] = '%'; length = augmented_length; } else { if (!(dp->arg_index != ARG_NONE)) abort (); if (dp->conversion == 'n') { switch (a.arg[dp->arg_index].type) { case TYPE_COUNT_SCHAR_POINTER: *a.arg[dp->arg_index].a.a_count_schar_pointer = length; break; case TYPE_COUNT_SHORT_POINTER: *a.arg[dp->arg_index].a.a_count_short_pointer = length; break; case TYPE_COUNT_INT_POINTER: *a.arg[dp->arg_index].a.a_count_int_pointer = length; break; case TYPE_COUNT_LONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longint_pointer = length; break; #if HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; break; #endif default: abort (); } } #if ENABLE_UNISTDIO /* The unistdio extensions. */ else if (dp->conversion == 'U') { arg_type type = a.arg[dp->arg_index].type; int flags = dp->flags; int has_width; size_t width; int has_precision; size_t precision; has_width = 0; width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->width_arg_index].a.a_int; if (arg < 0) { /* "A negative field width is taken as a '-' flag followed by a positive field width." */ flags |= FLAG_LEFT; width = (unsigned int) (-arg); } else width = arg; } else { const FCHAR_T *digitp = dp->width_start; do width = xsum (xtimes (width, 10), *digitp++ - '0'); while (digitp != dp->width_end); } has_width = 1; } has_precision = 0; precision = 0; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) { precision = arg; has_precision = 1; } } else { const FCHAR_T *digitp = dp->precision_start + 1; precision = 0; while (digitp != dp->precision_end) precision = xsum (xtimes (precision, 10), *digitp++ - '0'); has_precision = 1; } } switch (type) { case TYPE_U8_STRING: { const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string; const uint8_t *arg_end; size_t characters; if (has_precision) { /* Use only PRECISION characters, from the left. */ arg_end = arg; characters = 0; for (; precision > 0; precision--) { int count = u8_strmblen (arg_end); if (count == 0) break; if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EILSEQ; return NULL; } arg_end += count; characters++; } } else if (has_width) { /* Use the entire string, and count the number of characters. */ arg_end = arg; characters = 0; for (;;) { int count = u8_strmblen (arg_end); if (count == 0) break; if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EILSEQ; return NULL; } arg_end += count; characters++; } } else { /* Use the entire string. */ arg_end = arg + u8_strlen (arg); /* The number of characters doesn't matter. */ characters = 0; } if (has_width && width > characters && !(dp->flags & FLAG_LEFT)) { size_t n = width - characters; ENSURE_ALLOCATION (xsum (length, n)); DCHAR_SET (result + length, ' ', n); length += n; } # if DCHAR_IS_UINT8_T { size_t n = arg_end - arg; ENSURE_ALLOCATION (xsum (length, n)); DCHAR_CPY (result + length, arg, n); length += n; } # else { /* Convert. */ DCHAR_T *converted = result + length; size_t converted_len = allocated - length; # if DCHAR_IS_TCHAR /* Convert from UTF-8 to locale encoding. */ if (u8_conv_to_encoding (locale_charset (), iconveh_question_mark, arg, arg_end - arg, NULL, &converted, &converted_len) < 0) # else /* Convert from UTF-8 to UTF-16/UTF-32. */ converted = U8_TO_DCHAR (arg, arg_end - arg, converted, &converted_len); if (converted == NULL) # endif { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = saved_errno; return NULL; } if (converted != result + length) { ENSURE_ALLOCATION (xsum (length, converted_len)); DCHAR_CPY (result + length, converted, converted_len); free (converted); } length += converted_len; } # endif if (has_width && width > characters && (dp->flags & FLAG_LEFT)) { size_t n = width - characters; ENSURE_ALLOCATION (xsum (length, n)); DCHAR_SET (result + length, ' ', n); length += n; } } break; case TYPE_U16_STRING: { const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string; const uint16_t *arg_end; size_t characters; if (has_precision) { /* Use only PRECISION characters, from the left. */ arg_end = arg; characters = 0; for (; precision > 0; precision--) { int count = u16_strmblen (arg_end); if (count == 0) break; if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EILSEQ; return NULL; } arg_end += count; characters++; } } else if (has_width) { /* Use the entire string, and count the number of characters. */ arg_end = arg; characters = 0; for (;;) { int count = u16_strmblen (arg_end); if (count == 0) break; if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EILSEQ; return NULL; } arg_end += count; characters++; } } else { /* Use the entire string. */ arg_end = arg + u16_strlen (arg); /* The number of characters doesn't matter. */ characters = 0; } if (has_width && width > characters && !(dp->flags & FLAG_LEFT)) { size_t n = width - characters; ENSURE_ALLOCATION (xsum (length, n)); DCHAR_SET (result + length, ' ', n); length += n; } # if DCHAR_IS_UINT16_T { size_t n = arg_end - arg; ENSURE_ALLOCATION (xsum (length, n)); DCHAR_CPY (result + length, arg, n); length += n; } # else { /* Convert. */ DCHAR_T *converted = result + length; size_t converted_len = allocated - length; # if DCHAR_IS_TCHAR /* Convert from UTF-16 to locale encoding. */ if (u16_conv_to_encoding (locale_charset (), iconveh_question_mark, arg, arg_end - arg, NULL, &converted, &converted_len) < 0) # else /* Convert from UTF-16 to UTF-8/UTF-32. */ converted = U16_TO_DCHAR (arg, arg_end - arg, converted, &converted_len); if (converted == NULL) # endif { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = saved_errno; return NULL; } if (converted != result + length) { ENSURE_ALLOCATION (xsum (length, converted_len)); DCHAR_CPY (result + length, converted, converted_len); free (converted); } length += converted_len; } # endif if (has_width && width > characters && (dp->flags & FLAG_LEFT)) { size_t n = width - characters; ENSURE_ALLOCATION (xsum (length, n)); DCHAR_SET (result + length, ' ', n); length += n; } } break; case TYPE_U32_STRING: { const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string; const uint32_t *arg_end; size_t characters; if (has_precision) { /* Use only PRECISION characters, from the left. */ arg_end = arg; characters = 0; for (; precision > 0; precision--) { int count = u32_strmblen (arg_end); if (count == 0) break; if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EILSEQ; return NULL; } arg_end += count; characters++; } } else if (has_width) { /* Use the entire string, and count the number of characters. */ arg_end = arg; characters = 0; for (;;) { int count = u32_strmblen (arg_end); if (count == 0) break; if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EILSEQ; return NULL; } arg_end += count; characters++; } } else { /* Use the entire string. */ arg_end = arg + u32_strlen (arg); /* The number of characters doesn't matter. */ characters = 0; } if (has_width && width > characters && !(dp->flags & FLAG_LEFT)) { size_t n = width - characters; ENSURE_ALLOCATION (xsum (length, n)); DCHAR_SET (result + length, ' ', n); length += n; } # if DCHAR_IS_UINT32_T { size_t n = arg_end - arg; ENSURE_ALLOCATION (xsum (length, n)); DCHAR_CPY (result + length, arg, n); length += n; } # else { /* Convert. */ DCHAR_T *converted = result + length; size_t converted_len = allocated - length; # if DCHAR_IS_TCHAR /* Convert from UTF-32 to locale encoding. */ if (u32_conv_to_encoding (locale_charset (), iconveh_question_mark, arg, arg_end - arg, NULL, &converted, &converted_len) < 0) # else /* Convert from UTF-32 to UTF-8/UTF-16. */ converted = U32_TO_DCHAR (arg, arg_end - arg, converted, &converted_len); if (converted == NULL) # endif { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = saved_errno; return NULL; } if (converted != result + length) { ENSURE_ALLOCATION (xsum (length, converted_len)); DCHAR_CPY (result + length, converted, converted_len); free (converted); } length += converted_len; } # endif if (has_width && width > characters && (dp->flags & FLAG_LEFT)) { size_t n = width - characters; ENSURE_ALLOCATION (xsum (length, n)); DCHAR_SET (result + length, ' ', n); length += n; } } break; default: abort (); } } #endif #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL else if ((dp->conversion == 'a' || dp->conversion == 'A') # if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE)) && (0 # if NEED_PRINTF_DOUBLE || a.arg[dp->arg_index].type == TYPE_DOUBLE # endif # if NEED_PRINTF_LONG_DOUBLE || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE # endif ) # endif ) { arg_type type = a.arg[dp->arg_index].type; int flags = dp->flags; int has_width; size_t width; int has_precision; size_t precision; size_t tmp_length; DCHAR_T tmpbuf[700]; DCHAR_T *tmp; DCHAR_T *pad_ptr; DCHAR_T *p; has_width = 0; width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->width_arg_index].a.a_int; if (arg < 0) { /* "A negative field width is taken as a '-' flag followed by a positive field width." */ flags |= FLAG_LEFT; width = (unsigned int) (-arg); } else width = arg; } else { const FCHAR_T *digitp = dp->width_start; do width = xsum (xtimes (width, 10), *digitp++ - '0'); while (digitp != dp->width_end); } has_width = 1; } has_precision = 0; precision = 0; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) { precision = arg; has_precision = 1; } } else { const FCHAR_T *digitp = dp->precision_start + 1; precision = 0; while (digitp != dp->precision_end) precision = xsum (xtimes (precision, 10), *digitp++ - '0'); has_precision = 1; } } /* Allocate a temporary buffer of sufficient size. */ if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) ((LDBL_DIG + 1) * 0.831 /* decimal -> hexadecimal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) ((DBL_DIG + 1) * 0.831 /* decimal -> hexadecimal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Account for sign, decimal point etc. */ tmp_length = xsum (tmp_length, 12); if (tmp_length < width) tmp_length = width; tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) tmp = tmpbuf; else { size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T)); if (size_overflow_p (tmp_memsize)) /* Overflow, would lead to out of memory. */ goto out_of_memory; tmp = (DCHAR_T *) malloc (tmp_memsize); if (tmp == NULL) /* Out of memory. */ goto out_of_memory; } pad_ptr = NULL; p = tmp; if (type == TYPE_LONGDOUBLE) { # if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE long double arg = a.arg[dp->arg_index].a.a_longdouble; if (isnanl (arg)) { if (dp->conversion == 'A') { *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; } else { *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; } } else { int sign = 0; DECL_LONG_DOUBLE_ROUNDING BEGIN_LONG_DOUBLE_ROUNDING (); if (signbit (arg)) /* arg < 0.0L or negative zero */ { sign = -1; arg = -arg; } if (sign < 0) *p++ = '-'; else if (flags & FLAG_SHOWSIGN) *p++ = '+'; else if (flags & FLAG_SPACE) *p++ = ' '; if (arg > 0.0L && arg + arg == arg) { if (dp->conversion == 'A') { *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; } else { *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; } } else { int exponent; long double mantissa; if (arg > 0.0L) mantissa = printf_frexpl (arg, &exponent); else { exponent = 0; mantissa = 0.0L; } if (has_precision && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1) { /* Round the mantissa. */ long double tail = mantissa; size_t q; for (q = precision; ; q--) { int digit = (int) tail; tail -= digit; if (q == 0) { if (digit & 1 ? tail >= 0.5L : tail > 0.5L) tail = 1 - tail; else tail = - tail; break; } tail *= 16.0L; } if (tail != 0.0L) for (q = precision; q > 0; q--) tail *= 0.0625L; mantissa += tail; } *p++ = '0'; *p++ = dp->conversion - 'A' + 'X'; pad_ptr = p; { int digit; digit = (int) mantissa; mantissa -= digit; *p++ = '0' + digit; if ((flags & FLAG_ALT) || mantissa > 0.0L || precision > 0) { *p++ = decimal_point_char (); /* This loop terminates because we assume that FLT_RADIX is a power of 2. */ while (mantissa > 0.0L) { mantissa *= 16.0L; digit = (int) mantissa; mantissa -= digit; *p++ = digit + (digit < 10 ? '0' : dp->conversion - 10); if (precision > 0) precision--; } while (precision > 0) { *p++ = '0'; precision--; } } } *p++ = dp->conversion - 'A' + 'P'; # if WIDE_CHAR_VERSION { static const wchar_t decimal_format[] = { '%', '+', 'd', '\0' }; SNPRINTF (p, 6 + 1, decimal_format, exponent); } while (*p != '\0') p++; # else if (sizeof (DCHAR_T) == 1) { sprintf ((char *) p, "%+d", exponent); while (*p != '\0') p++; } else { char expbuf[6 + 1]; const char *ep; sprintf (expbuf, "%+d", exponent); for (ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } # endif } END_LONG_DOUBLE_ROUNDING (); } # else abort (); # endif } else { # if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE double arg = a.arg[dp->arg_index].a.a_double; if (isnan (arg)) { if (dp->conversion == 'A') { *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; } else { *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; } } else { int sign = 0; if (signbit (arg)) /* arg < 0.0 or negative zero */ { sign = -1; arg = -arg; } if (sign < 0) *p++ = '-'; else if (flags & FLAG_SHOWSIGN) *p++ = '+'; else if (flags & FLAG_SPACE) *p++ = ' '; if (arg > 0.0 && arg + arg == arg) { if (dp->conversion == 'A') { *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; } else { *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; } } else { int exponent; double mantissa; if (arg > 0.0) mantissa = printf_frexp (arg, &exponent); else { exponent = 0; mantissa = 0.0; } if (has_precision && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1) { /* Round the mantissa. */ double tail = mantissa; size_t q; for (q = precision; ; q--) { int digit = (int) tail; tail -= digit; if (q == 0) { if (digit & 1 ? tail >= 0.5 : tail > 0.5) tail = 1 - tail; else tail = - tail; break; } tail *= 16.0; } if (tail != 0.0) for (q = precision; q > 0; q--) tail *= 0.0625; mantissa += tail; } *p++ = '0'; *p++ = dp->conversion - 'A' + 'X'; pad_ptr = p; { int digit; digit = (int) mantissa; mantissa -= digit; *p++ = '0' + digit; if ((flags & FLAG_ALT) || mantissa > 0.0 || precision > 0) { *p++ = decimal_point_char (); /* This loop terminates because we assume that FLT_RADIX is a power of 2. */ while (mantissa > 0.0) { mantissa *= 16.0; digit = (int) mantissa; mantissa -= digit; *p++ = digit + (digit < 10 ? '0' : dp->conversion - 10); if (precision > 0) precision--; } while (precision > 0) { *p++ = '0'; precision--; } } } *p++ = dp->conversion - 'A' + 'P'; # if WIDE_CHAR_VERSION { static const wchar_t decimal_format[] = { '%', '+', 'd', '\0' }; SNPRINTF (p, 6 + 1, decimal_format, exponent); } while (*p != '\0') p++; # else if (sizeof (DCHAR_T) == 1) { sprintf ((char *) p, "%+d", exponent); while (*p != '\0') p++; } else { char expbuf[6 + 1]; const char *ep; sprintf (expbuf, "%+d", exponent); for (ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } # endif } } # else abort (); # endif } /* The generated string now extends from tmp to p, with the zero padding insertion point being at pad_ptr. */ if (has_width && p - tmp < width) { size_t pad = width - (p - tmp); DCHAR_T *end = p + pad; if (flags & FLAG_LEFT) { /* Pad with spaces on the right. */ for (; pad > 0; pad--) *p++ = ' '; } else if ((flags & FLAG_ZERO) && pad_ptr != NULL) { /* Pad with zeroes. */ DCHAR_T *q = end; while (p > pad_ptr) *--q = *--p; for (; pad > 0; pad--) *p++ = '0'; } else { /* Pad with spaces on the left. */ DCHAR_T *q = end; while (p > tmp) *--q = *--p; for (; pad > 0; pad--) *p++ = ' '; } p = end; } { size_t count = p - tmp; if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); /* Make room for the result. */ if (count >= allocated - length) { size_t n = xsum (length, count); ENSURE_ALLOCATION (n); } /* Append the result. */ memcpy (result + length, tmp, count * sizeof (DCHAR_T)); if (tmp != tmpbuf) free (tmp); length += count; } } #endif #if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL else if ((dp->conversion == 'f' || dp->conversion == 'F' || dp->conversion == 'e' || dp->conversion == 'E' || dp->conversion == 'g' || dp->conversion == 'G' || dp->conversion == 'a' || dp->conversion == 'A') && (0 # if NEED_PRINTF_DOUBLE || a.arg[dp->arg_index].type == TYPE_DOUBLE # elif NEED_PRINTF_INFINITE_DOUBLE || (a.arg[dp->arg_index].type == TYPE_DOUBLE /* The systems (mingw) which produce wrong output for Inf, -Inf, and NaN also do so for -0.0. Therefore we treat this case here as well. */ && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double)) # endif # if NEED_PRINTF_LONG_DOUBLE || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE # elif NEED_PRINTF_INFINITE_LONG_DOUBLE || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE /* Some systems produce wrong output for Inf, -Inf, and NaN. */ && is_infinitel (a.arg[dp->arg_index].a.a_longdouble)) # endif )) { # if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) arg_type type = a.arg[dp->arg_index].type; # endif int flags = dp->flags; int has_width; size_t width; int has_precision; size_t precision; size_t tmp_length; DCHAR_T tmpbuf[700]; DCHAR_T *tmp; DCHAR_T *pad_ptr; DCHAR_T *p; has_width = 0; width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->width_arg_index].a.a_int; if (arg < 0) { /* "A negative field width is taken as a '-' flag followed by a positive field width." */ flags |= FLAG_LEFT; width = (unsigned int) (-arg); } else width = arg; } else { const FCHAR_T *digitp = dp->width_start; do width = xsum (xtimes (width, 10), *digitp++ - '0'); while (digitp != dp->width_end); } has_width = 1; } has_precision = 0; precision = 0; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) { precision = arg; has_precision = 1; } } else { const FCHAR_T *digitp = dp->precision_start + 1; precision = 0; while (digitp != dp->precision_end) precision = xsum (xtimes (precision, 10), *digitp++ - '0'); has_precision = 1; } } /* POSIX specifies the default precision to be 6 for %f, %F, %e, %E, but not for %g, %G. Implementations appear to use the same default precision also for %g, %G. */ if (!has_precision) precision = 6; /* Allocate a temporary buffer of sufficient size. */ # if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1); # elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0); # elif NEED_PRINTF_LONG_DOUBLE tmp_length = LDBL_DIG + 1; # elif NEED_PRINTF_DOUBLE tmp_length = DBL_DIG + 1; # else tmp_length = 0; # endif if (tmp_length < precision) tmp_length = precision; # if NEED_PRINTF_LONG_DOUBLE # if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE if (type == TYPE_LONGDOUBLE) # endif if (dp->conversion == 'f' || dp->conversion == 'F') { long double arg = a.arg[dp->arg_index].a.a_longdouble; if (!(isnanl (arg) || arg + arg == arg)) { /* arg is finite and nonzero. */ int exponent = floorlog10l (arg < 0 ? -arg : arg); if (exponent >= 0 && tmp_length < exponent + precision) tmp_length = exponent + precision; } } # endif # if NEED_PRINTF_DOUBLE # if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE if (type == TYPE_DOUBLE) # endif if (dp->conversion == 'f' || dp->conversion == 'F') { double arg = a.arg[dp->arg_index].a.a_double; if (!(isnan (arg) || arg + arg == arg)) { /* arg is finite and nonzero. */ int exponent = floorlog10 (arg < 0 ? -arg : arg); if (exponent >= 0 && tmp_length < exponent + precision) tmp_length = exponent + precision; } } # endif /* Account for sign, decimal point etc. */ tmp_length = xsum (tmp_length, 12); if (tmp_length < width) tmp_length = width; tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) tmp = tmpbuf; else { size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T)); if (size_overflow_p (tmp_memsize)) /* Overflow, would lead to out of memory. */ goto out_of_memory; tmp = (DCHAR_T *) malloc (tmp_memsize); if (tmp == NULL) /* Out of memory. */ goto out_of_memory; } pad_ptr = NULL; p = tmp; # if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE # if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE if (type == TYPE_LONGDOUBLE) # endif { long double arg = a.arg[dp->arg_index].a.a_longdouble; if (isnanl (arg)) { if (dp->conversion >= 'A' && dp->conversion <= 'Z') { *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; } else { *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; } } else { int sign = 0; DECL_LONG_DOUBLE_ROUNDING BEGIN_LONG_DOUBLE_ROUNDING (); if (signbit (arg)) /* arg < 0.0L or negative zero */ { sign = -1; arg = -arg; } if (sign < 0) *p++ = '-'; else if (flags & FLAG_SHOWSIGN) *p++ = '+'; else if (flags & FLAG_SPACE) *p++ = ' '; if (arg > 0.0L && arg + arg == arg) { if (dp->conversion >= 'A' && dp->conversion <= 'Z') { *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; } else { *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; } } else { # if NEED_PRINTF_LONG_DOUBLE pad_ptr = p; if (dp->conversion == 'f' || dp->conversion == 'F') { char *digits; size_t ndigits; digits = scale10_round_decimal_long_double (arg, precision); if (digits == NULL) { END_LONG_DOUBLE_ROUNDING (); goto out_of_memory; } ndigits = strlen (digits); if (ndigits > precision) do { --ndigits; *p++ = digits[ndigits]; } while (ndigits > precision); else *p++ = '0'; /* Here ndigits <= precision. */ if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); for (; precision > ndigits; precision--) *p++ = '0'; while (ndigits > 0) { --ndigits; *p++ = digits[ndigits]; } } free (digits); } else if (dp->conversion == 'e' || dp->conversion == 'E') { int exponent; if (arg == 0.0L) { exponent = 0; *p++ = '0'; if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); for (; precision > 0; precision--) *p++ = '0'; } } else { /* arg > 0.0L. */ int adjusted; char *digits; size_t ndigits; exponent = floorlog10l (arg); adjusted = 0; for (;;) { digits = scale10_round_decimal_long_double (arg, (int)precision - exponent); if (digits == NULL) { END_LONG_DOUBLE_ROUNDING (); goto out_of_memory; } ndigits = strlen (digits); if (ndigits == precision + 1) break; if (ndigits < precision || ndigits > precision + 2) /* The exponent was not guessed precisely enough. */ abort (); if (adjusted) /* None of two values of exponent is the right one. Prevent an endless loop. */ abort (); free (digits); if (ndigits == precision) exponent -= 1; else exponent += 1; adjusted = 1; } /* Here ndigits = precision+1. */ *p++ = digits[--ndigits]; if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); while (ndigits > 0) { --ndigits; *p++ = digits[ndigits]; } } free (digits); } *p++ = dp->conversion; /* 'e' or 'E' */ # if WIDE_CHAR_VERSION { static const wchar_t decimal_format[] = { '%', '+', '.', '2', 'd', '\0' }; SNPRINTF (p, 6 + 1, decimal_format, exponent); } while (*p != '\0') p++; # else if (sizeof (DCHAR_T) == 1) { sprintf ((char *) p, "%+.2d", exponent); while (*p != '\0') p++; } else { char expbuf[6 + 1]; const char *ep; sprintf (expbuf, "%+.2d", exponent); for (ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } # endif } else if (dp->conversion == 'g' || dp->conversion == 'G') { if (precision == 0) precision = 1; /* precision >= 1. */ if (arg == 0.0L) /* The exponent is 0, >= -4, < precision. Use fixed-point notation. */ { size_t ndigits = precision; /* Number of trailing zeroes that have to be dropped. */ size_t nzeroes = (flags & FLAG_ALT ? 0 : precision - 1); --ndigits; *p++ = '0'; if ((flags & FLAG_ALT) || ndigits > nzeroes) { *p++ = decimal_point_char (); while (ndigits > nzeroes) { --ndigits; *p++ = '0'; } } } else { /* arg > 0.0L. */ int exponent; int adjusted; char *digits; size_t ndigits; size_t nzeroes; exponent = floorlog10l (arg); adjusted = 0; for (;;) { digits = scale10_round_decimal_long_double (arg, (int)(precision - 1) - exponent); if (digits == NULL) { END_LONG_DOUBLE_ROUNDING (); goto out_of_memory; } ndigits = strlen (digits); if (ndigits == precision) break; if (ndigits < precision - 1 || ndigits > precision + 1) /* The exponent was not guessed precisely enough. */ abort (); if (adjusted) /* None of two values of exponent is the right one. Prevent an endless loop. */ abort (); free (digits); if (ndigits < precision) exponent -= 1; else exponent += 1; adjusted = 1; } /* Here ndigits = precision. */ /* Determine the number of trailing zeroes that have to be dropped. */ nzeroes = 0; if ((flags & FLAG_ALT) == 0) while (nzeroes < ndigits && digits[nzeroes] == '0') nzeroes++; /* The exponent is now determined. */ if (exponent >= -4 && exponent < (long)precision) { /* Fixed-point notation: max(exponent,0)+1 digits, then the decimal point, then the remaining digits without trailing zeroes. */ if (exponent >= 0) { size_t count = exponent + 1; /* Note: count <= precision = ndigits. */ for (; count > 0; count--) *p++ = digits[--ndigits]; if ((flags & FLAG_ALT) || ndigits > nzeroes) { *p++ = decimal_point_char (); while (ndigits > nzeroes) { --ndigits; *p++ = digits[ndigits]; } } } else { size_t count = -exponent - 1; *p++ = '0'; *p++ = decimal_point_char (); for (; count > 0; count--) *p++ = '0'; while (ndigits > nzeroes) { --ndigits; *p++ = digits[ndigits]; } } } else { /* Exponential notation. */ *p++ = digits[--ndigits]; if ((flags & FLAG_ALT) || ndigits > nzeroes) { *p++ = decimal_point_char (); while (ndigits > nzeroes) { --ndigits; *p++ = digits[ndigits]; } } *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */ # if WIDE_CHAR_VERSION { static const wchar_t decimal_format[] = { '%', '+', '.', '2', 'd', '\0' }; SNPRINTF (p, 6 + 1, decimal_format, exponent); } while (*p != '\0') p++; # else if (sizeof (DCHAR_T) == 1) { sprintf ((char *) p, "%+.2d", exponent); while (*p != '\0') p++; } else { char expbuf[6 + 1]; const char *ep; sprintf (expbuf, "%+.2d", exponent); for (ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } # endif } free (digits); } } else abort (); # else /* arg is finite. */ abort (); # endif } END_LONG_DOUBLE_ROUNDING (); } } # if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE else # endif # endif # if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE { double arg = a.arg[dp->arg_index].a.a_double; if (isnan (arg)) { if (dp->conversion >= 'A' && dp->conversion <= 'Z') { *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; } else { *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; } } else { int sign = 0; if (signbit (arg)) /* arg < 0.0 or negative zero */ { sign = -1; arg = -arg; } if (sign < 0) *p++ = '-'; else if (flags & FLAG_SHOWSIGN) *p++ = '+'; else if (flags & FLAG_SPACE) *p++ = ' '; if (arg > 0.0 && arg + arg == arg) { if (dp->conversion >= 'A' && dp->conversion <= 'Z') { *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; } else { *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; } } else { # if NEED_PRINTF_DOUBLE pad_ptr = p; if (dp->conversion == 'f' || dp->conversion == 'F') { char *digits; size_t ndigits; digits = scale10_round_decimal_double (arg, precision); if (digits == NULL) goto out_of_memory; ndigits = strlen (digits); if (ndigits > precision) do { --ndigits; *p++ = digits[ndigits]; } while (ndigits > precision); else *p++ = '0'; /* Here ndigits <= precision. */ if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); for (; precision > ndigits; precision--) *p++ = '0'; while (ndigits > 0) { --ndigits; *p++ = digits[ndigits]; } } free (digits); } else if (dp->conversion == 'e' || dp->conversion == 'E') { int exponent; if (arg == 0.0) { exponent = 0; *p++ = '0'; if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); for (; precision > 0; precision--) *p++ = '0'; } } else { /* arg > 0.0. */ int adjusted; char *digits; size_t ndigits; exponent = floorlog10 (arg); adjusted = 0; for (;;) { digits = scale10_round_decimal_double (arg, (int)precision - exponent); if (digits == NULL) goto out_of_memory; ndigits = strlen (digits); if (ndigits == precision + 1) break; if (ndigits < precision || ndigits > precision + 2) /* The exponent was not guessed precisely enough. */ abort (); if (adjusted) /* None of two values of exponent is the right one. Prevent an endless loop. */ abort (); free (digits); if (ndigits == precision) exponent -= 1; else exponent += 1; adjusted = 1; } /* Here ndigits = precision+1. */ *p++ = digits[--ndigits]; if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); while (ndigits > 0) { --ndigits; *p++ = digits[ndigits]; } } free (digits); } *p++ = dp->conversion; /* 'e' or 'E' */ # if WIDE_CHAR_VERSION { static const wchar_t decimal_format[] = /* Produce the same number of exponent digits as the native printf implementation. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ { '%', '+', '.', '3', 'd', '\0' }; # else { '%', '+', '.', '2', 'd', '\0' }; # endif SNPRINTF (p, 6 + 1, decimal_format, exponent); } while (*p != '\0') p++; # else { static const char decimal_format[] = /* Produce the same number of exponent digits as the native printf implementation. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ "%+.3d"; # else "%+.2d"; # endif if (sizeof (DCHAR_T) == 1) { sprintf ((char *) p, decimal_format, exponent); while (*p != '\0') p++; } else { char expbuf[6 + 1]; const char *ep; sprintf (expbuf, decimal_format, exponent); for (ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } } # endif } else if (dp->conversion == 'g' || dp->conversion == 'G') { if (precision == 0) precision = 1; /* precision >= 1. */ if (arg == 0.0) /* The exponent is 0, >= -4, < precision. Use fixed-point notation. */ { size_t ndigits = precision; /* Number of trailing zeroes that have to be dropped. */ size_t nzeroes = (flags & FLAG_ALT ? 0 : precision - 1); --ndigits; *p++ = '0'; if ((flags & FLAG_ALT) || ndigits > nzeroes) { *p++ = decimal_point_char (); while (ndigits > nzeroes) { --ndigits; *p++ = '0'; } } } else { /* arg > 0.0. */ int exponent; int adjusted; char *digits; size_t ndigits; size_t nzeroes; exponent = floorlog10 (arg); adjusted = 0; for (;;) { digits = scale10_round_decimal_double (arg, (int)(precision - 1) - exponent); if (digits == NULL) goto out_of_memory; ndigits = strlen (digits); if (ndigits == precision) break; if (ndigits < precision - 1 || ndigits > precision + 1) /* The exponent was not guessed precisely enough. */ abort (); if (adjusted) /* None of two values of exponent is the right one. Prevent an endless loop. */ abort (); free (digits); if (ndigits < precision) exponent -= 1; else exponent += 1; adjusted = 1; } /* Here ndigits = precision. */ /* Determine the number of trailing zeroes that have to be dropped. */ nzeroes = 0; if ((flags & FLAG_ALT) == 0) while (nzeroes < ndigits && digits[nzeroes] == '0') nzeroes++; /* The exponent is now determined. */ if (exponent >= -4 && exponent < (long)precision) { /* Fixed-point notation: max(exponent,0)+1 digits, then the decimal point, then the remaining digits without trailing zeroes. */ if (exponent >= 0) { size_t count = exponent + 1; /* Note: count <= precision = ndigits. */ for (; count > 0; count--) *p++ = digits[--ndigits]; if ((flags & FLAG_ALT) || ndigits > nzeroes) { *p++ = decimal_point_char (); while (ndigits > nzeroes) { --ndigits; *p++ = digits[ndigits]; } } } else { size_t count = -exponent - 1; *p++ = '0'; *p++ = decimal_point_char (); for (; count > 0; count--) *p++ = '0'; while (ndigits > nzeroes) { --ndigits; *p++ = digits[ndigits]; } } } else { /* Exponential notation. */ *p++ = digits[--ndigits]; if ((flags & FLAG_ALT) || ndigits > nzeroes) { *p++ = decimal_point_char (); while (ndigits > nzeroes) { --ndigits; *p++ = digits[ndigits]; } } *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */ # if WIDE_CHAR_VERSION { static const wchar_t decimal_format[] = /* Produce the same number of exponent digits as the native printf implementation. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ { '%', '+', '.', '3', 'd', '\0' }; # else { '%', '+', '.', '2', 'd', '\0' }; # endif SNPRINTF (p, 6 + 1, decimal_format, exponent); } while (*p != '\0') p++; # else { static const char decimal_format[] = /* Produce the same number of exponent digits as the native printf implementation. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ "%+.3d"; # else "%+.2d"; # endif if (sizeof (DCHAR_T) == 1) { sprintf ((char *) p, decimal_format, exponent); while (*p != '\0') p++; } else { char expbuf[6 + 1]; const char *ep; sprintf (expbuf, decimal_format, exponent); for (ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } } # endif } free (digits); } } else abort (); # else /* arg is finite. */ if (!(arg == 0.0)) abort (); pad_ptr = p; if (dp->conversion == 'f' || dp->conversion == 'F') { *p++ = '0'; if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); for (; precision > 0; precision--) *p++ = '0'; } } else if (dp->conversion == 'e' || dp->conversion == 'E') { *p++ = '0'; if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); for (; precision > 0; precision--) *p++ = '0'; } *p++ = dp->conversion; /* 'e' or 'E' */ *p++ = '+'; /* Produce the same number of exponent digits as the native printf implementation. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ *p++ = '0'; # endif *p++ = '0'; *p++ = '0'; } else if (dp->conversion == 'g' || dp->conversion == 'G') { *p++ = '0'; if (flags & FLAG_ALT) { size_t ndigits = (precision > 0 ? precision - 1 : 0); *p++ = decimal_point_char (); for (; ndigits > 0; --ndigits) *p++ = '0'; } } else abort (); # endif } } } # endif /* The generated string now extends from tmp to p, with the zero padding insertion point being at pad_ptr. */ if (has_width && p - tmp < width) { size_t pad = width - (p - tmp); DCHAR_T *end = p + pad; if (flags & FLAG_LEFT) { /* Pad with spaces on the right. */ for (; pad > 0; pad--) *p++ = ' '; } else if ((flags & FLAG_ZERO) && pad_ptr != NULL) { /* Pad with zeroes. */ DCHAR_T *q = end; while (p > pad_ptr) *--q = *--p; for (; pad > 0; pad--) *p++ = '0'; } else { /* Pad with spaces on the left. */ DCHAR_T *q = end; while (p > tmp) *--q = *--p; for (; pad > 0; pad--) *p++ = ' '; } p = end; } { size_t count = p - tmp; if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); /* Make room for the result. */ if (count >= allocated - length) { size_t n = xsum (length, count); ENSURE_ALLOCATION (n); } /* Append the result. */ memcpy (result + length, tmp, count * sizeof (DCHAR_T)); if (tmp != tmpbuf) free (tmp); length += count; } } #endif else { arg_type type = a.arg[dp->arg_index].type; int flags = dp->flags; #if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION int has_width; size_t width; #endif #if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION int has_precision; size_t precision; #endif #if NEED_PRINTF_UNBOUNDED_PRECISION int prec_ourselves; #else # define prec_ourselves 0 #endif #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION int pad_ourselves; #else # define pad_ourselves 0 #endif TCHAR_T *fbp; unsigned int prefix_count; int prefixes[2]; #if !USE_SNPRINTF size_t tmp_length; TCHAR_T tmpbuf[700]; TCHAR_T *tmp; #endif #if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION has_width = 0; width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->width_arg_index].a.a_int; if (arg < 0) { /* "A negative field width is taken as a '-' flag followed by a positive field width." */ flags |= FLAG_LEFT; width = (unsigned int) (-arg); } else width = arg; } else { const FCHAR_T *digitp = dp->width_start; do width = xsum (xtimes (width, 10), *digitp++ - '0'); while (digitp != dp->width_end); } has_width = 1; } #endif #if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION has_precision = 0; precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->precision_arg_index].a.a_int; /* "A negative precision is taken as if the precision were omitted." */ if (arg >= 0) { precision = arg; has_precision = 1; } } else { const FCHAR_T *digitp = dp->precision_start + 1; precision = 0; while (digitp != dp->precision_end) precision = xsum (xtimes (precision, 10), *digitp++ - '0'); has_precision = 1; } } #endif #if !USE_SNPRINTF /* Allocate a temporary buffer of sufficient size for calling sprintf. */ { switch (dp->conversion) { case 'd': case 'i': case 'u': # if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Multiply by 2, as an estimate for FLAG_GROUP. */ tmp_length = xsum (tmp_length, tmp_length); /* Add 1, to account for a leading sign. */ tmp_length = xsum (tmp_length, 1); break; case 'o': # if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Add 1, to account for a leading sign. */ tmp_length = xsum (tmp_length, 1); break; case 'x': case 'X': # if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Add 2, to account for a leading sign or alternate form. */ tmp_length = xsum (tmp_length, 2); break; case 'f': case 'F': if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ else tmp_length = (unsigned int) (DBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ tmp_length = xsum (tmp_length, precision); break; case 'e': case 'E': case 'g': case 'G': tmp_length = 12; /* sign, decimal point, exponent etc. */ tmp_length = xsum (tmp_length, precision); break; case 'a': case 'A': if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_DIG * 0.831 /* decimal -> hexadecimal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (DBL_DIG * 0.831 /* decimal -> hexadecimal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Account for sign, decimal point etc. */ tmp_length = xsum (tmp_length, 12); break; case 'c': # if HAVE_WINT_T && !WIDE_CHAR_VERSION if (type == TYPE_WIDE_CHAR) tmp_length = MB_CUR_MAX; else # endif tmp_length = 1; break; case 's': # if HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { tmp_length = local_wcslen (a.arg[dp->arg_index].a.a_wide_string); # if !WIDE_CHAR_VERSION tmp_length = xtimes (tmp_length, MB_CUR_MAX); # endif } else # endif tmp_length = strlen (a.arg[dp->arg_index].a.a_string); break; case 'p': tmp_length = (unsigned int) (sizeof (void *) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading 0x */ break; default: abort (); } # if ENABLE_UNISTDIO /* Padding considers the number of characters, therefore the number of elements after padding may be > max (tmp_length, width) but is certainly <= tmp_length + width. */ tmp_length = xsum (tmp_length, width); # else /* Padding considers the number of elements, says POSIX. */ if (tmp_length < width) tmp_length = width; # endif tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ } if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T)) tmp = tmpbuf; else { size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T)); if (size_overflow_p (tmp_memsize)) /* Overflow, would lead to out of memory. */ goto out_of_memory; tmp = (TCHAR_T *) malloc (tmp_memsize); if (tmp == NULL) /* Out of memory. */ goto out_of_memory; } #endif /* Decide whether to handle the precision ourselves. */ #if NEED_PRINTF_UNBOUNDED_PRECISION switch (dp->conversion) { case 'd': case 'i': case 'u': case 'o': case 'x': case 'X': case 'p': prec_ourselves = has_precision && (precision > 0); break; default: prec_ourselves = 0; break; } #endif /* Decide whether to perform the padding ourselves. */ #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION switch (dp->conversion) { # if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need to perform the padding after this conversion. Functions with unistdio extensions perform the padding based on character count rather than element count. */ case 'c': case 's': # endif # if NEED_PRINTF_FLAG_ZERO case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': # endif pad_ourselves = 1; break; default: pad_ourselves = prec_ourselves; break; } #endif /* Construct the format string for calling snprintf or sprintf. */ fbp = buf; *fbp++ = '%'; #if NEED_PRINTF_FLAG_GROUPING /* The underlying implementation doesn't support the ' flag. Produce no grouping characters in this case; this is acceptable because the grouping is locale dependent. */ #else if (flags & FLAG_GROUP) *fbp++ = '\''; #endif if (flags & FLAG_LEFT) *fbp++ = '-'; if (flags & FLAG_SHOWSIGN) *fbp++ = '+'; if (flags & FLAG_SPACE) *fbp++ = ' '; if (flags & FLAG_ALT) *fbp++ = '#'; if (!pad_ourselves) { if (flags & FLAG_ZERO) *fbp++ = '0'; if (dp->width_start != dp->width_end) { size_t n = dp->width_end - dp->width_start; /* The width specification is known to consist only of standard ASCII characters. */ if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) { memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T)); fbp += n; } else { const FCHAR_T *mp = dp->width_start; do *fbp++ = (unsigned char) *mp++; while (--n > 0); } } } if (!prec_ourselves) { if (dp->precision_start != dp->precision_end) { size_t n = dp->precision_end - dp->precision_start; /* The precision specification is known to consist only of standard ASCII characters. */ if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) { memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T)); fbp += n; } else { const FCHAR_T *mp = dp->precision_start; do *fbp++ = (unsigned char) *mp++; while (--n > 0); } } } switch (type) { #if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ *fbp++ = 'I'; *fbp++ = '6'; *fbp++ = '4'; break; # else *fbp++ = 'l'; /*FALLTHROUGH*/ # endif #endif case TYPE_LONGINT: case TYPE_ULONGINT: #if HAVE_WINT_T case TYPE_WIDE_CHAR: #endif #if HAVE_WCHAR_T case TYPE_WIDE_STRING: #endif *fbp++ = 'l'; break; case TYPE_LONGDOUBLE: *fbp++ = 'L'; break; default: break; } #if NEED_PRINTF_DIRECTIVE_F if (dp->conversion == 'F') *fbp = 'f'; else #endif *fbp = dp->conversion; #if USE_SNPRINTF # if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) fbp[1] = '%'; fbp[2] = 'n'; fbp[3] = '\0'; # else /* On glibc2 systems from glibc >= 2.3 - probably also older ones - we know that snprintf's returns value conforms to ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes. Therefore we can avoid using %n in this situation. On glibc2 systems from 2004-10-18 or newer, the use of %n in format strings in writable memory may crash the program (if compiled with _FORTIFY_SOURCE=2), so we should avoid it in this situation. */ fbp[1] = '\0'; # endif #else fbp[1] = '\0'; #endif /* Construct the arguments for calling snprintf or sprintf. */ prefix_count = 0; if (!pad_ourselves && dp->width_arg_index != ARG_NONE) { if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; } if (dp->precision_arg_index != ARG_NONE) { if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; } #if USE_SNPRINTF /* The SNPRINTF result is appended after result[0..length]. The latter is an array of DCHAR_T; SNPRINTF appends an array of TCHAR_T to it. This is possible because sizeof (TCHAR_T) divides sizeof (DCHAR_T) and alignof (TCHAR_T) <= alignof (DCHAR_T). */ # define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T)) /* Prepare checking whether snprintf returns the count via %n. */ ENSURE_ALLOCATION (xsum (length, 1)); *(TCHAR_T *) (result + length) = '\0'; #endif for (;;) { int count = -1; #if USE_SNPRINTF int retcount = 0; size_t maxlen = allocated - length; /* SNPRINTF can fail if its second argument is > INT_MAX. */ if (maxlen > INT_MAX / TCHARS_PER_DCHAR) maxlen = INT_MAX / TCHARS_PER_DCHAR; maxlen = maxlen * TCHARS_PER_DCHAR; # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ retcount = SNPRINTF ((TCHAR_T *) (result + length), \ maxlen, buf, \ arg, &count); \ break; \ case 1: \ retcount = SNPRINTF ((TCHAR_T *) (result + length), \ maxlen, buf, \ prefixes[0], arg, &count); \ break; \ case 2: \ retcount = SNPRINTF ((TCHAR_T *) (result + length), \ maxlen, buf, \ prefixes[0], prefixes[1], arg, \ &count); \ break; \ default: \ abort (); \ } #else # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ count = sprintf (tmp, buf, arg); \ break; \ case 1: \ count = sprintf (tmp, buf, prefixes[0], arg); \ break; \ case 2: \ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ arg); \ break; \ default: \ abort (); \ } #endif switch (type) { case TYPE_SCHAR: { int arg = a.arg[dp->arg_index].a.a_schar; SNPRINTF_BUF (arg); } break; case TYPE_UCHAR: { unsigned int arg = a.arg[dp->arg_index].a.a_uchar; SNPRINTF_BUF (arg); } break; case TYPE_SHORT: { int arg = a.arg[dp->arg_index].a.a_short; SNPRINTF_BUF (arg); } break; case TYPE_USHORT: { unsigned int arg = a.arg[dp->arg_index].a.a_ushort; SNPRINTF_BUF (arg); } break; case TYPE_INT: { int arg = a.arg[dp->arg_index].a.a_int; SNPRINTF_BUF (arg); } break; case TYPE_UINT: { unsigned int arg = a.arg[dp->arg_index].a.a_uint; SNPRINTF_BUF (arg); } break; case TYPE_LONGINT: { long int arg = a.arg[dp->arg_index].a.a_longint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGINT: { unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; SNPRINTF_BUF (arg); } break; #if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: { long long int arg = a.arg[dp->arg_index].a.a_longlongint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGLONGINT: { unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; SNPRINTF_BUF (arg); } break; #endif case TYPE_DOUBLE: { double arg = a.arg[dp->arg_index].a.a_double; SNPRINTF_BUF (arg); } break; case TYPE_LONGDOUBLE: { long double arg = a.arg[dp->arg_index].a.a_longdouble; SNPRINTF_BUF (arg); } break; case TYPE_CHAR: { int arg = a.arg[dp->arg_index].a.a_char; SNPRINTF_BUF (arg); } break; #if HAVE_WINT_T case TYPE_WIDE_CHAR: { wint_t arg = a.arg[dp->arg_index].a.a_wide_char; SNPRINTF_BUF (arg); } break; #endif case TYPE_STRING: { const char *arg = a.arg[dp->arg_index].a.a_string; SNPRINTF_BUF (arg); } break; #if HAVE_WCHAR_T case TYPE_WIDE_STRING: { const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; SNPRINTF_BUF (arg); } break; #endif case TYPE_POINTER: { void *arg = a.arg[dp->arg_index].a.a_pointer; SNPRINTF_BUF (arg); } break; default: abort (); } #if USE_SNPRINTF /* Portability: Not all implementations of snprintf() are ISO C 99 compliant. Determine the number of bytes that snprintf() has produced or would have produced. */ if (count >= 0) { /* Verify that snprintf() has NUL-terminated its result. */ if (count < maxlen && ((TCHAR_T *) (result + length)) [count] != '\0') abort (); /* Portability hack. */ if (retcount > count) count = retcount; } else { /* snprintf() doesn't understand the '%n' directive. */ if (fbp[1] != '\0') { /* Don't use the '%n' directive; instead, look at the snprintf() return value. */ fbp[1] = '\0'; continue; } else { /* Look at the snprintf() return value. */ if (retcount < 0) { /* HP-UX 10.20 snprintf() is doubly deficient: It doesn't understand the '%n' directive, *and* it returns -1 (rather than the length that would have been required) when the buffer is too small. */ size_t bigger_need = xsum (xtimes (allocated, 2), 12); ENSURE_ALLOCATION (bigger_need); continue; } else count = retcount; } } #endif /* Attempt to handle failure. */ if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EINVAL; return NULL; } #if USE_SNPRINTF /* Handle overflow of the allocated buffer. If such an overflow occurs, a C99 compliant snprintf() returns a count >= maxlen. However, a non-compliant snprintf() function returns only count = maxlen - 1. To cover both cases, test whether count >= maxlen - 1. */ if ((unsigned int) count + 1 >= maxlen) { /* If maxlen already has attained its allowed maximum, allocating more memory will not increase maxlen. Instead of looping, bail out. */ if (maxlen == INT_MAX / TCHARS_PER_DCHAR) goto overflow; else { /* Need at least count * sizeof (TCHAR_T) bytes. But allocate proportionally, to avoid looping eternally if snprintf() reports a too small count. */ size_t n = xmax (xsum (length, (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR), xtimes (allocated, 2)); ENSURE_ALLOCATION (n); continue; } } #endif #if NEED_PRINTF_UNBOUNDED_PRECISION if (prec_ourselves) { /* Handle the precision. */ TCHAR_T *prec_ptr = # if USE_SNPRINTF (TCHAR_T *) (result + length); # else tmp; # endif size_t prefix_count; size_t move; prefix_count = 0; /* Put the additional zeroes after the sign. */ if (count >= 1 && (*prec_ptr == '-' || *prec_ptr == '+' || *prec_ptr == ' ')) prefix_count = 1; /* Put the additional zeroes after the 0x prefix if (flags & FLAG_ALT) || (dp->conversion == 'p'). */ else if (count >= 2 && prec_ptr[0] == '0' && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X')) prefix_count = 2; move = count - prefix_count; if (precision > move) { /* Insert zeroes. */ size_t insert = precision - move; TCHAR_T *prec_end; # if USE_SNPRINTF size_t n = xsum (length, (count + insert + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR); length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; ENSURE_ALLOCATION (n); length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; prec_ptr = (TCHAR_T *) (result + length); # endif prec_end = prec_ptr + count; prec_ptr += prefix_count; while (prec_end > prec_ptr) { prec_end--; prec_end[insert] = prec_end[0]; } prec_end += insert; do *--prec_end = '0'; while (prec_end > prec_ptr); count += insert; } } #endif #if !DCHAR_IS_TCHAR # if !USE_SNPRINTF if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); # endif /* Convert from TCHAR_T[] to DCHAR_T[]. */ if (dp->conversion == 'c' || dp->conversion == 's') { /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING TYPE_WIDE_STRING. The result string is not certainly ASCII. */ const TCHAR_T *tmpsrc; DCHAR_T *tmpdst; size_t tmpdst_len; /* This code assumes that TCHAR_T is 'char'. */ typedef int TCHAR_T_verify [2 * (sizeof (TCHAR_T) == 1) - 1]; # if USE_SNPRINTF tmpsrc = (TCHAR_T *) (result + length); # else tmpsrc = tmp; # endif tmpdst = NULL; tmpdst_len = 0; if (DCHAR_CONV_FROM_ENCODING (locale_charset (), iconveh_question_mark, tmpsrc, count, NULL, &tmpdst, &tmpdst_len) < 0) { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = saved_errno; return NULL; } ENSURE_ALLOCATION (xsum (length, tmpdst_len)); DCHAR_CPY (result + length, tmpdst, tmpdst_len); free (tmpdst); count = tmpdst_len; } else { /* The result string is ASCII. Simple 1:1 conversion. */ # if USE_SNPRINTF /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a no-op conversion, in-place on the array starting at (result + length). */ if (sizeof (DCHAR_T) != sizeof (TCHAR_T)) # endif { const TCHAR_T *tmpsrc; DCHAR_T *tmpdst; size_t n; # if USE_SNPRINTF if (result == resultbuf) { tmpsrc = (TCHAR_T *) (result + length); /* ENSURE_ALLOCATION will not move tmpsrc (because it's part of resultbuf). */ ENSURE_ALLOCATION (xsum (length, count)); } else { /* ENSURE_ALLOCATION will move the array (because it uses realloc(). */ ENSURE_ALLOCATION (xsum (length, count)); tmpsrc = (TCHAR_T *) (result + length); } # else tmpsrc = tmp; ENSURE_ALLOCATION (xsum (length, count)); # endif tmpdst = result + length; /* Copy backwards, because of overlapping. */ tmpsrc += count; tmpdst += count; for (n = count; n > 0; n--) *--tmpdst = (unsigned char) *--tmpsrc; } } #endif #if DCHAR_IS_TCHAR && !USE_SNPRINTF /* Make room for the result. */ if (count > allocated - length) { /* Need at least count elements. But allocate proportionally. */ size_t n = xmax (xsum (length, count), xtimes (allocated, 2)); ENSURE_ALLOCATION (n); } #endif /* Here count <= allocated - length. */ /* Perform padding. */ #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION if (pad_ourselves && has_width) { size_t w; # if ENABLE_UNISTDIO /* Outside POSIX, it's preferrable to compare the width against the number of _characters_ of the converted value. */ w = DCHAR_MBSNLEN (result + length, count); # else /* The width is compared against the number of _bytes_ of the converted value, says POSIX. */ w = count; # endif if (w < width) { size_t pad = width - w; # if USE_SNPRINTF /* Make room for the result. */ if (xsum (count, pad) > allocated - length) { /* Need at least count + pad elements. But allocate proportionally. */ size_t n = xmax (xsum3 (length, count, pad), xtimes (allocated, 2)); length += count; ENSURE_ALLOCATION (n); length -= count; } /* Here count + pad <= allocated - length. */ # endif { # if !DCHAR_IS_TCHAR || USE_SNPRINTF DCHAR_T * const rp = result + length; # else DCHAR_T * const rp = tmp; # endif DCHAR_T *p = rp + count; DCHAR_T *end = p + pad; # if NEED_PRINTF_FLAG_ZERO DCHAR_T *pad_ptr; # if !DCHAR_IS_TCHAR if (dp->conversion == 'c' || dp->conversion == 's') /* No zero-padding for string directives. */ pad_ptr = NULL; else # endif { pad_ptr = (*rp == '-' ? rp + 1 : rp); /* No zero-padding of "inf" and "nan". */ if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z') || (*pad_ptr >= 'a' && *pad_ptr <= 'z')) pad_ptr = NULL; } # endif /* The generated string now extends from rp to p, with the zero padding insertion point being at pad_ptr. */ count = count + pad; /* = end - rp */ if (flags & FLAG_LEFT) { /* Pad with spaces on the right. */ for (; pad > 0; pad--) *p++ = ' '; } # if NEED_PRINTF_FLAG_ZERO else if ((flags & FLAG_ZERO) && pad_ptr != NULL) { /* Pad with zeroes. */ DCHAR_T *q = end; while (p > pad_ptr) *--q = *--p; for (; pad > 0; pad--) *p++ = '0'; } # endif else { /* Pad with spaces on the left. */ DCHAR_T *q = end; while (p > rp) *--q = *--p; for (; pad > 0; pad--) *p++ = ' '; } } } } #endif #if DCHAR_IS_TCHAR && !USE_SNPRINTF if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); #endif /* Here still count <= allocated - length. */ #if !DCHAR_IS_TCHAR || USE_SNPRINTF /* The snprintf() result did fit. */ #else /* Append the sprintf() result. */ memcpy (result + length, tmp, count * sizeof (DCHAR_T)); #endif #if !USE_SNPRINTF if (tmp != tmpbuf) free (tmp); #endif #if NEED_PRINTF_DIRECTIVE_F if (dp->conversion == 'F') { /* Convert the %f result to upper case for %F. */ DCHAR_T *rp = result + length; size_t rc; for (rc = count; rc > 0; rc--, rp++) if (*rp >= 'a' && *rp <= 'z') *rp = *rp - 'a' + 'A'; } #endif length += count; break; } } } } /* Add the final NUL. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; if (result != resultbuf && length + 1 < allocated) { /* Shrink the allocated memory if possible. */ DCHAR_T *memory; memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T)); if (memory != NULL) result = memory; } if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); *lengthp = length; /* Note that we can produce a big string of a length > INT_MAX. POSIX says that snprintf() fails with errno = EOVERFLOW in this case, but that's only because snprintf() returns an 'int'. This function does not have this limitation. */ return result; overflow: if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EOVERFLOW; return NULL; out_of_memory: if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); out_of_memory_1: CLEANUP (); errno = ENOMEM; return NULL; } } #undef TCHARS_PER_DCHAR #undef SNPRINTF #undef USE_SNPRINTF #undef DCHAR_CPY #undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE #undef DCHAR_IS_TCHAR #undef TCHAR_T #undef DCHAR_T #undef FCHAR_T #undef VASNPRINTF sitecopy-0.16.6/intl/COPYING.LIB-2.10000644000076400007640000006366110243450466014513 0ustar joejoe GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. ^L Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. ^L GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. ^L Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. ^L 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. ^L 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. ^L 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. ^L 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS ^L How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! sitecopy-0.16.6/intl/relocatable.c0000644000076400007640000003353410512434754015173 0ustar joejoe/* Provide relocatable packages. Copyright (C) 2003-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for getline(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #include /* Specification. */ #include "relocatable.h" #if ENABLE_RELOCATABLE #include #include #include #include #ifdef NO_XMALLOC # define xmalloc malloc #else # include "xalloc.h" #endif #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ # define WIN32_LEAN_AND_MEAN # include #endif #if DEPENDS_ON_LIBCHARSET # include #endif #if DEPENDS_ON_LIBICONV && HAVE_ICONV # include #endif #if DEPENDS_ON_LIBINTL && ENABLE_NLS # include #endif /* Faked cheap 'bool'. */ #undef bool #undef false #undef true #define bool int #define false 0 #define true 1 /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) # define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) # define FILE_SYSTEM_PREFIX_LEN(P) 0 #endif /* Original installation prefix. */ static char *orig_prefix; static size_t orig_prefix_len; /* Current installation prefix. */ static char *curr_prefix; static size_t curr_prefix_len; /* These prefixes do not end in a slash. Anything that will be concatenated to them must start with a slash. */ /* Sets the original and the current installation prefix of this module. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ static void set_this_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) { if (orig_prefix_arg != NULL && curr_prefix_arg != NULL /* Optimization: if orig_prefix and curr_prefix are equal, the relocation is a nop. */ && strcmp (orig_prefix_arg, curr_prefix_arg) != 0) { /* Duplicate the argument strings. */ char *memory; orig_prefix_len = strlen (orig_prefix_arg); curr_prefix_len = strlen (curr_prefix_arg); memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1); #ifdef NO_XMALLOC if (memory != NULL) #endif { memcpy (memory, orig_prefix_arg, orig_prefix_len + 1); orig_prefix = memory; memory += orig_prefix_len + 1; memcpy (memory, curr_prefix_arg, curr_prefix_len + 1); curr_prefix = memory; return; } } orig_prefix = NULL; curr_prefix = NULL; /* Don't worry about wasted memory here - this function is usually only called once. */ } /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ void set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) { set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); /* Now notify all dependent libraries. */ #if DEPENDS_ON_LIBCHARSET libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); #endif #if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); #endif #if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); #endif } #if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR) /* Convenience function: Computes the current installation prefix, based on the original installation prefix, the original installation directory of a particular file, and the current pathname of this file. Returns NULL upon failure. */ #ifdef IN_LIBRARY #define compute_curr_prefix local_compute_curr_prefix static #endif const char * compute_curr_prefix (const char *orig_installprefix, const char *orig_installdir, const char *curr_pathname) { const char *curr_installdir; const char *rel_installdir; if (curr_pathname == NULL) return NULL; /* Determine the relative installation directory, relative to the prefix. This is simply the difference between orig_installprefix and orig_installdir. */ if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix)) != 0) /* Shouldn't happen - nothing should be installed outside $(prefix). */ return NULL; rel_installdir = orig_installdir + strlen (orig_installprefix); /* Determine the current installation directory. */ { const char *p_base = curr_pathname + FILE_SYSTEM_PREFIX_LEN (curr_pathname); const char *p = curr_pathname + strlen (curr_pathname); char *q; while (p > p_base) { p--; if (ISSLASH (*p)) break; } q = (char *) xmalloc (p - curr_pathname + 1); #ifdef NO_XMALLOC if (q == NULL) return NULL; #endif memcpy (q, curr_pathname, p - curr_pathname); q[p - curr_pathname] = '\0'; curr_installdir = q; } /* Compute the current installation prefix by removing the trailing rel_installdir from it. */ { const char *rp = rel_installdir + strlen (rel_installdir); const char *cp = curr_installdir + strlen (curr_installdir); const char *cp_base = curr_installdir + FILE_SYSTEM_PREFIX_LEN (curr_installdir); while (rp > rel_installdir && cp > cp_base) { bool same = false; const char *rpi = rp; const char *cpi = cp; while (rpi > rel_installdir && cpi > cp_base) { rpi--; cpi--; if (ISSLASH (*rpi) || ISSLASH (*cpi)) { if (ISSLASH (*rpi) && ISSLASH (*cpi)) same = true; break; } /* Do case-insensitive comparison if the filesystem is always or often case-insensitive. It's better to accept the comparison if the difference is only in case, rather than to fail. */ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS - case insignificant filesystem */ if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi) != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi)) break; #else if (*rpi != *cpi) break; #endif } if (!same) break; /* The last pathname component was the same. opi and cpi now point to the slash before it. */ rp = rpi; cp = cpi; } if (rp > rel_installdir) /* Unexpected: The curr_installdir does not end with rel_installdir. */ return NULL; { size_t curr_prefix_len = cp - curr_installdir; char *curr_prefix; curr_prefix = (char *) xmalloc (curr_prefix_len + 1); #ifdef NO_XMALLOC if (curr_prefix == NULL) return NULL; #endif memcpy (curr_prefix, curr_installdir, curr_prefix_len); curr_prefix[curr_prefix_len] = '\0'; return curr_prefix; } } } #endif /* !IN_LIBRARY || PIC */ #if defined PIC && defined INSTALLDIR /* Full pathname of shared library, or NULL. */ static char *shared_library_fullname; #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ /* Determine the full pathname of the shared library when it is loaded. */ BOOL WINAPI DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved) { (void) reserved; if (event == DLL_PROCESS_ATTACH) { /* The DLL is being loaded into an application's address range. */ static char location[MAX_PATH]; if (!GetModuleFileName (module_handle, location, sizeof (location))) /* Shouldn't happen. */ return FALSE; if (!IS_PATH_WITH_DIR (location)) /* Shouldn't happen. */ return FALSE; { #if defined __CYGWIN__ /* On Cygwin, we need to convert paths coming from Win32 system calls to the Unix-like slashified notation. */ static char location_as_posix_path[2 * MAX_PATH]; /* There's no error return defined for cygwin_conv_to_posix_path. See cygwin-api/func-cygwin-conv-to-posix-path.html. Does it overflow the buffer of expected size MAX_PATH or does it truncate the path? I don't know. Let's catch both. */ cygwin_conv_to_posix_path (location, location_as_posix_path); location_as_posix_path[MAX_PATH - 1] = '\0'; if (strlen (location_as_posix_path) >= MAX_PATH - 1) /* A sign of buffer overflow or path truncation. */ return FALSE; shared_library_fullname = strdup (location_as_posix_path); #else shared_library_fullname = strdup (location); #endif } } return TRUE; } #else /* Unix except Cygwin */ static void find_shared_library_fullname () { #if defined __linux__ && __GLIBC__ >= 2 /* Linux has /proc/self/maps. glibc 2 has the getline() function. */ FILE *fp; /* Open the current process' maps file. It describes one VMA per line. */ fp = fopen ("/proc/self/maps", "r"); if (fp) { unsigned long address = (unsigned long) &find_shared_library_fullname; for (;;) { unsigned long start, end; int c; if (fscanf (fp, "%lx-%lx", &start, &end) != 2) break; if (address >= start && address <= end - 1) { /* Found it. Now see if this line contains a filename. */ while (c = getc (fp), c != EOF && c != '\n' && c != '/') continue; if (c == '/') { size_t size; int len; ungetc (c, fp); shared_library_fullname = NULL; size = 0; len = getline (&shared_library_fullname, &size, fp); if (len >= 0) { /* Success: filled shared_library_fullname. */ if (len > 0 && shared_library_fullname[len - 1] == '\n') shared_library_fullname[len - 1] = '\0'; } } break; } while (c = getc (fp), c != EOF && c != '\n') continue; } fclose (fp); } #endif } #endif /* (WIN32 or Cygwin) / (Unix except Cygwin) */ /* Return the full pathname of the current shared library. Return NULL if unknown. Guaranteed to work only on Linux, Cygwin and Woe32. */ static char * get_shared_library_fullname () { #if !(defined _WIN32 || defined __WIN32__ || defined __CYGWIN__) static bool tried_find_shared_library_fullname; if (!tried_find_shared_library_fullname) { find_shared_library_fullname (); tried_find_shared_library_fullname = true; } #endif return shared_library_fullname; } #endif /* PIC */ /* Returns the pathname, relocated according to the current installation directory. */ const char * relocate (const char *pathname) { #if defined PIC && defined INSTALLDIR static int initialized; /* Initialization code for a shared library. */ if (!initialized) { /* At this point, orig_prefix and curr_prefix likely have already been set through the main program's set_program_name_and_installdir function. This is sufficient in the case that the library has initially been installed in the same orig_prefix. But we can do better, to also cover the cases that 1. it has been installed in a different prefix before being moved to orig_prefix and (later) to curr_prefix, 2. unlike the program, it has not moved away from orig_prefix. */ const char *orig_installprefix = INSTALLPREFIX; const char *orig_installdir = INSTALLDIR; const char *curr_prefix_better; curr_prefix_better = compute_curr_prefix (orig_installprefix, orig_installdir, get_shared_library_fullname ()); if (curr_prefix_better == NULL) curr_prefix_better = curr_prefix; set_relocation_prefix (orig_installprefix, curr_prefix_better); initialized = 1; } #endif /* Note: It is not necessary to perform case insensitive comparison here, even for DOS-like filesystems, because the pathname argument was typically created from the same Makefile variable as orig_prefix came from. */ if (orig_prefix != NULL && curr_prefix != NULL && strncmp (pathname, orig_prefix, orig_prefix_len) == 0) { if (pathname[orig_prefix_len] == '\0') /* pathname equals orig_prefix. */ return curr_prefix; if (ISSLASH (pathname[orig_prefix_len])) { /* pathname starts with orig_prefix. */ const char *pathname_tail = &pathname[orig_prefix_len]; char *result = (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1); #ifdef NO_XMALLOC if (result != NULL) #endif { memcpy (result, curr_prefix, curr_prefix_len); strcpy (result + curr_prefix_len, pathname_tail); return result; } } } /* Nothing to relocate. */ return pathname; } #endif sitecopy-0.16.6/intl/intl-exports.c0000644000076400007640000000273310430721231015347 0ustar joejoe/* List of exported symbols of libintl on Cygwin. Copyright (C) 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* IMP(x) is a symbol that contains the address of x. */ #define IMP(x) _imp__##x /* Ensure that the variable x is exported from the library, and that a pseudo-variable IMP(x) is available. */ #define VARIABLE(x) \ /* Export x without redefining x. This code was found by compiling a \ snippet: \ extern __declspec(dllexport) int x; int x = 42; */ \ asm (".section .drectve\n"); \ asm (".ascii \" -export:" #x ",data\"\n"); \ asm (".data\n"); \ /* Allocate a pseudo-variable IMP(x). */ \ extern int x; \ void * IMP(x) = &x; VARIABLE(libintl_version) sitecopy-0.16.6/intl/dgettext.c0000644000076400007640000000337110243450466014541 0ustar joejoe/* Implementation of the dgettext(3) function. Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #include #ifdef _LIBC # include #else # include "libgnuintl.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 INTUSE(__dcgettext) #else # define DGETTEXT libintl_dgettext # define DCGETTEXT libintl_dcgettext #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale. */ char * DGETTEXT (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 sitecopy-0.16.6/intl/version.c0000644000076400007640000000173110273401770014371 0ustar joejoe/* libintl library version. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "libgnuintl.h" /* Version number: (major<<16) + (minor<<8) + subminor */ int libintl_version = LIBINTL_VERSION; sitecopy-0.16.6/intl/log.c0000644000076400007640000000623110266711126013466 0ustar joejoe/* Log file output. Copyright (C) 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include /* Handle multi-threaded applications. */ #ifdef _LIBC # include #else # include "lock.h" #endif /* Print an ASCII string with quotes and escape sequences where needed. */ static void print_escaped (FILE *stream, const char *str) { putc ('"', stream); for (; *str != '\0'; str++) if (*str == '\n') { fputs ("\\n\"", stream); if (str[1] == '\0') return; fputs ("\n\"", stream); } else { if (*str == '"' || *str == '\\') putc ('\\', stream); putc (*str, stream); } putc ('"', stream); } static char *last_logfilename = NULL; static FILE *last_logfile = NULL; __libc_lock_define_initialized (static, lock) static inline void _nl_log_untranslated_locked (const char *logfilename, const char *domainname, const char *msgid1, const char *msgid2, int plural) { FILE *logfile; /* Can we reuse the last opened logfile? */ if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0) { /* Close the last used logfile. */ if (last_logfilename != NULL) { if (last_logfile != NULL) { fclose (last_logfile); last_logfile = NULL; } free (last_logfilename); last_logfilename = NULL; } /* Open the logfile. */ last_logfilename = (char *) malloc (strlen (logfilename) + 1); if (last_logfilename == NULL) return; strcpy (last_logfilename, logfilename); last_logfile = fopen (logfilename, "a"); if (last_logfile == NULL) return; } logfile = last_logfile; fprintf (logfile, "domain "); print_escaped (logfile, domainname); fprintf (logfile, "\nmsgid "); print_escaped (logfile, msgid1); if (plural) { fprintf (logfile, "\nmsgid_plural "); print_escaped (logfile, msgid2); fprintf (logfile, "\nmsgstr[0] \"\"\n"); } else fprintf (logfile, "\nmsgstr \"\"\n"); putc ('\n', logfile); } /* Add to the log file an entry denoting a failed translation. */ void _nl_log_untranslated (const char *logfilename, const char *domainname, const char *msgid1, const char *msgid2, int plural) { __libc_lock_lock (lock); _nl_log_untranslated_locked (logfilename, domainname, msgid1, msgid2, plural); __libc_lock_unlock (lock); } sitecopy-0.16.6/intl/localename.c0000644000076400007640000012457110632060514015010 0ustar joejoe/* Determine name of the currently selected locale. Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Ulrich Drepper , 1995. */ /* Win32 code written by Tor Lillqvist . */ /* MacOS X code written by Bruno Haible . */ #include /* Specification. */ #ifdef IN_LIBINTL # include "gettextP.h" #else # include "localename.h" #endif #include #include #if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE # include # include # if HAVE_CFLOCALECOPYCURRENT # include # elif HAVE_CFPREFERENCESCOPYAPPVALUE # include # endif #endif #if defined _WIN32 || defined __WIN32__ # define WIN32_NATIVE #endif #ifdef WIN32_NATIVE # define WIN32_LEAN_AND_MEAN # include /* List of language codes, sorted by value: 0x01 LANG_ARABIC 0x02 LANG_BULGARIAN 0x03 LANG_CATALAN 0x04 LANG_CHINESE 0x05 LANG_CZECH 0x06 LANG_DANISH 0x07 LANG_GERMAN 0x08 LANG_GREEK 0x09 LANG_ENGLISH 0x0a LANG_SPANISH 0x0b LANG_FINNISH 0x0c LANG_FRENCH 0x0d LANG_HEBREW 0x0e LANG_HUNGARIAN 0x0f LANG_ICELANDIC 0x10 LANG_ITALIAN 0x11 LANG_JAPANESE 0x12 LANG_KOREAN 0x13 LANG_DUTCH 0x14 LANG_NORWEGIAN 0x15 LANG_POLISH 0x16 LANG_PORTUGUESE 0x17 LANG_RHAETO_ROMANCE 0x18 LANG_ROMANIAN 0x19 LANG_RUSSIAN 0x1a LANG_CROATIAN == LANG_SERBIAN 0x1b LANG_SLOVAK 0x1c LANG_ALBANIAN 0x1d LANG_SWEDISH 0x1e LANG_THAI 0x1f LANG_TURKISH 0x20 LANG_URDU 0x21 LANG_INDONESIAN 0x22 LANG_UKRAINIAN 0x23 LANG_BELARUSIAN 0x24 LANG_SLOVENIAN 0x25 LANG_ESTONIAN 0x26 LANG_LATVIAN 0x27 LANG_LITHUANIAN 0x28 LANG_TAJIK 0x29 LANG_FARSI 0x2a LANG_VIETNAMESE 0x2b LANG_ARMENIAN 0x2c LANG_AZERI 0x2d LANG_BASQUE 0x2e LANG_SORBIAN 0x2f LANG_MACEDONIAN 0x30 LANG_SUTU 0x31 LANG_TSONGA 0x32 LANG_TSWANA 0x33 LANG_VENDA 0x34 LANG_XHOSA 0x35 LANG_ZULU 0x36 LANG_AFRIKAANS 0x37 LANG_GEORGIAN 0x38 LANG_FAEROESE 0x39 LANG_HINDI 0x3a LANG_MALTESE 0x3b LANG_SAAMI 0x3c LANG_GAELIC 0x3d LANG_YIDDISH 0x3e LANG_MALAY 0x3f LANG_KAZAK 0x40 LANG_KYRGYZ 0x41 LANG_SWAHILI 0x42 LANG_TURKMEN 0x43 LANG_UZBEK 0x44 LANG_TATAR 0x45 LANG_BENGALI 0x46 LANG_PUNJABI 0x47 LANG_GUJARATI 0x48 LANG_ORIYA 0x49 LANG_TAMIL 0x4a LANG_TELUGU 0x4b LANG_KANNADA 0x4c LANG_MALAYALAM 0x4d LANG_ASSAMESE 0x4e LANG_MARATHI 0x4f LANG_SANSKRIT 0x50 LANG_MONGOLIAN 0x51 LANG_TIBETAN 0x52 LANG_WELSH 0x53 LANG_CAMBODIAN 0x54 LANG_LAO 0x55 LANG_BURMESE 0x56 LANG_GALICIAN 0x57 LANG_KONKANI 0x58 LANG_MANIPURI 0x59 LANG_SINDHI 0x5a LANG_SYRIAC 0x5b LANG_SINHALESE 0x5c LANG_CHEROKEE 0x5d LANG_INUKTITUT 0x5e LANG_AMHARIC 0x5f LANG_TAMAZIGHT 0x60 LANG_KASHMIRI 0x61 LANG_NEPALI 0x62 LANG_FRISIAN 0x63 LANG_PASHTO 0x64 LANG_TAGALOG 0x65 LANG_DIVEHI 0x66 LANG_EDO 0x67 LANG_FULFULDE 0x68 LANG_HAUSA 0x69 LANG_IBIBIO 0x6a LANG_YORUBA 0x70 LANG_IGBO 0x71 LANG_KANURI 0x72 LANG_OROMO 0x73 LANG_TIGRINYA 0x74 LANG_GUARANI 0x75 LANG_HAWAIIAN 0x76 LANG_LATIN 0x77 LANG_SOMALI 0x78 LANG_YI 0x79 LANG_PAPIAMENTU */ /* Mingw headers don't have latest language and sublanguage codes. */ # ifndef LANG_AFRIKAANS # define LANG_AFRIKAANS 0x36 # endif # ifndef LANG_ALBANIAN # define LANG_ALBANIAN 0x1c # endif # ifndef LANG_AMHARIC # define LANG_AMHARIC 0x5e # endif # ifndef LANG_ARABIC # define LANG_ARABIC 0x01 # endif # ifndef LANG_ARMENIAN # define LANG_ARMENIAN 0x2b # endif # ifndef LANG_ASSAMESE # define LANG_ASSAMESE 0x4d # endif # ifndef LANG_AZERI # define LANG_AZERI 0x2c # endif # ifndef LANG_BASQUE # define LANG_BASQUE 0x2d # endif # ifndef LANG_BELARUSIAN # define LANG_BELARUSIAN 0x23 # endif # ifndef LANG_BENGALI # define LANG_BENGALI 0x45 # endif # ifndef LANG_BURMESE # define LANG_BURMESE 0x55 # endif # ifndef LANG_CAMBODIAN # define LANG_CAMBODIAN 0x53 # endif # ifndef LANG_CATALAN # define LANG_CATALAN 0x03 # endif # ifndef LANG_CHEROKEE # define LANG_CHEROKEE 0x5c # endif # ifndef LANG_DIVEHI # define LANG_DIVEHI 0x65 # endif # ifndef LANG_EDO # define LANG_EDO 0x66 # endif # ifndef LANG_ESTONIAN # define LANG_ESTONIAN 0x25 # endif # ifndef LANG_FAEROESE # define LANG_FAEROESE 0x38 # endif # ifndef LANG_FARSI # define LANG_FARSI 0x29 # endif # ifndef LANG_FRISIAN # define LANG_FRISIAN 0x62 # endif # ifndef LANG_FULFULDE # define LANG_FULFULDE 0x67 # endif # ifndef LANG_GAELIC # define LANG_GAELIC 0x3c # endif # ifndef LANG_GALICIAN # define LANG_GALICIAN 0x56 # endif # ifndef LANG_GEORGIAN # define LANG_GEORGIAN 0x37 # endif # ifndef LANG_GUARANI # define LANG_GUARANI 0x74 # endif # ifndef LANG_GUJARATI # define LANG_GUJARATI 0x47 # endif # ifndef LANG_HAUSA # define LANG_HAUSA 0x68 # endif # ifndef LANG_HAWAIIAN # define LANG_HAWAIIAN 0x75 # endif # ifndef LANG_HEBREW # define LANG_HEBREW 0x0d # endif # ifndef LANG_HINDI # define LANG_HINDI 0x39 # endif # ifndef LANG_IBIBIO # define LANG_IBIBIO 0x69 # endif # ifndef LANG_IGBO # define LANG_IGBO 0x70 # endif # ifndef LANG_INDONESIAN # define LANG_INDONESIAN 0x21 # endif # ifndef LANG_INUKTITUT # define LANG_INUKTITUT 0x5d # endif # ifndef LANG_KANNADA # define LANG_KANNADA 0x4b # endif # ifndef LANG_KANURI # define LANG_KANURI 0x71 # endif # ifndef LANG_KASHMIRI # define LANG_KASHMIRI 0x60 # endif # ifndef LANG_KAZAK # define LANG_KAZAK 0x3f # endif # ifndef LANG_KONKANI # define LANG_KONKANI 0x57 # endif # ifndef LANG_KYRGYZ # define LANG_KYRGYZ 0x40 # endif # ifndef LANG_LAO # define LANG_LAO 0x54 # endif # ifndef LANG_LATIN # define LANG_LATIN 0x76 # endif # ifndef LANG_LATVIAN # define LANG_LATVIAN 0x26 # endif # ifndef LANG_LITHUANIAN # define LANG_LITHUANIAN 0x27 # endif # ifndef LANG_MACEDONIAN # define LANG_MACEDONIAN 0x2f # endif # ifndef LANG_MALAY # define LANG_MALAY 0x3e # endif # ifndef LANG_MALAYALAM # define LANG_MALAYALAM 0x4c # endif # ifndef LANG_MALTESE # define LANG_MALTESE 0x3a # endif # ifndef LANG_MANIPURI # define LANG_MANIPURI 0x58 # endif # ifndef LANG_MARATHI # define LANG_MARATHI 0x4e # endif # ifndef LANG_MONGOLIAN # define LANG_MONGOLIAN 0x50 # endif # ifndef LANG_NEPALI # define LANG_NEPALI 0x61 # endif # ifndef LANG_ORIYA # define LANG_ORIYA 0x48 # endif # ifndef LANG_OROMO # define LANG_OROMO 0x72 # endif # ifndef LANG_PAPIAMENTU # define LANG_PAPIAMENTU 0x79 # endif # ifndef LANG_PASHTO # define LANG_PASHTO 0x63 # endif # ifndef LANG_PUNJABI # define LANG_PUNJABI 0x46 # endif # ifndef LANG_RHAETO_ROMANCE # define LANG_RHAETO_ROMANCE 0x17 # endif # ifndef LANG_SAAMI # define LANG_SAAMI 0x3b # endif # ifndef LANG_SANSKRIT # define LANG_SANSKRIT 0x4f # endif # ifndef LANG_SERBIAN # define LANG_SERBIAN 0x1a # endif # ifndef LANG_SINDHI # define LANG_SINDHI 0x59 # endif # ifndef LANG_SINHALESE # define LANG_SINHALESE 0x5b # endif # ifndef LANG_SLOVAK # define LANG_SLOVAK 0x1b # endif # ifndef LANG_SOMALI # define LANG_SOMALI 0x77 # endif # ifndef LANG_SORBIAN # define LANG_SORBIAN 0x2e # endif # ifndef LANG_SUTU # define LANG_SUTU 0x30 # endif # ifndef LANG_SWAHILI # define LANG_SWAHILI 0x41 # endif # ifndef LANG_SYRIAC # define LANG_SYRIAC 0x5a # endif # ifndef LANG_TAGALOG # define LANG_TAGALOG 0x64 # endif # ifndef LANG_TAJIK # define LANG_TAJIK 0x28 # endif # ifndef LANG_TAMAZIGHT # define LANG_TAMAZIGHT 0x5f # endif # ifndef LANG_TAMIL # define LANG_TAMIL 0x49 # endif # ifndef LANG_TATAR # define LANG_TATAR 0x44 # endif # ifndef LANG_TELUGU # define LANG_TELUGU 0x4a # endif # ifndef LANG_THAI # define LANG_THAI 0x1e # endif # ifndef LANG_TIBETAN # define LANG_TIBETAN 0x51 # endif # ifndef LANG_TIGRINYA # define LANG_TIGRINYA 0x73 # endif # ifndef LANG_TSONGA # define LANG_TSONGA 0x31 # endif # ifndef LANG_TSWANA # define LANG_TSWANA 0x32 # endif # ifndef LANG_TURKMEN # define LANG_TURKMEN 0x42 # endif # ifndef LANG_UKRAINIAN # define LANG_UKRAINIAN 0x22 # endif # ifndef LANG_URDU # define LANG_URDU 0x20 # endif # ifndef LANG_UZBEK # define LANG_UZBEK 0x43 # endif # ifndef LANG_VENDA # define LANG_VENDA 0x33 # endif # ifndef LANG_VIETNAMESE # define LANG_VIETNAMESE 0x2a # endif # ifndef LANG_WELSH # define LANG_WELSH 0x52 # endif # ifndef LANG_XHOSA # define LANG_XHOSA 0x34 # endif # ifndef LANG_YI # define LANG_YI 0x78 # endif # ifndef LANG_YIDDISH # define LANG_YIDDISH 0x3d # endif # ifndef LANG_YORUBA # define LANG_YORUBA 0x6a # endif # ifndef LANG_ZULU # define LANG_ZULU 0x35 # endif # ifndef SUBLANG_ARABIC_SAUDI_ARABIA # define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 # endif # ifndef SUBLANG_ARABIC_IRAQ # define SUBLANG_ARABIC_IRAQ 0x02 # endif # ifndef SUBLANG_ARABIC_EGYPT # define SUBLANG_ARABIC_EGYPT 0x03 # endif # ifndef SUBLANG_ARABIC_LIBYA # define SUBLANG_ARABIC_LIBYA 0x04 # endif # ifndef SUBLANG_ARABIC_ALGERIA # define SUBLANG_ARABIC_ALGERIA 0x05 # endif # ifndef SUBLANG_ARABIC_MOROCCO # define SUBLANG_ARABIC_MOROCCO 0x06 # endif # ifndef SUBLANG_ARABIC_TUNISIA # define SUBLANG_ARABIC_TUNISIA 0x07 # endif # ifndef SUBLANG_ARABIC_OMAN # define SUBLANG_ARABIC_OMAN 0x08 # endif # ifndef SUBLANG_ARABIC_YEMEN # define SUBLANG_ARABIC_YEMEN 0x09 # endif # ifndef SUBLANG_ARABIC_SYRIA # define SUBLANG_ARABIC_SYRIA 0x0a # endif # ifndef SUBLANG_ARABIC_JORDAN # define SUBLANG_ARABIC_JORDAN 0x0b # endif # ifndef SUBLANG_ARABIC_LEBANON # define SUBLANG_ARABIC_LEBANON 0x0c # endif # ifndef SUBLANG_ARABIC_KUWAIT # define SUBLANG_ARABIC_KUWAIT 0x0d # endif # ifndef SUBLANG_ARABIC_UAE # define SUBLANG_ARABIC_UAE 0x0e # endif # ifndef SUBLANG_ARABIC_BAHRAIN # define SUBLANG_ARABIC_BAHRAIN 0x0f # endif # ifndef SUBLANG_ARABIC_QATAR # define SUBLANG_ARABIC_QATAR 0x10 # endif # ifndef SUBLANG_AZERI_LATIN # define SUBLANG_AZERI_LATIN 0x01 # endif # ifndef SUBLANG_AZERI_CYRILLIC # define SUBLANG_AZERI_CYRILLIC 0x02 # endif # ifndef SUBLANG_BENGALI_INDIA # define SUBLANG_BENGALI_INDIA 0x01 # endif # ifndef SUBLANG_BENGALI_BANGLADESH # define SUBLANG_BENGALI_BANGLADESH 0x02 # endif # ifndef SUBLANG_CHINESE_MACAU # define SUBLANG_CHINESE_MACAU 0x05 # endif # ifndef SUBLANG_ENGLISH_SOUTH_AFRICA # define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 # endif # ifndef SUBLANG_ENGLISH_JAMAICA # define SUBLANG_ENGLISH_JAMAICA 0x08 # endif # ifndef SUBLANG_ENGLISH_CARIBBEAN # define SUBLANG_ENGLISH_CARIBBEAN 0x09 # endif # ifndef SUBLANG_ENGLISH_BELIZE # define SUBLANG_ENGLISH_BELIZE 0x0a # endif # ifndef SUBLANG_ENGLISH_TRINIDAD # define SUBLANG_ENGLISH_TRINIDAD 0x0b # endif # ifndef SUBLANG_ENGLISH_ZIMBABWE # define SUBLANG_ENGLISH_ZIMBABWE 0x0c # endif # ifndef SUBLANG_ENGLISH_PHILIPPINES # define SUBLANG_ENGLISH_PHILIPPINES 0x0d # endif # ifndef SUBLANG_ENGLISH_INDONESIA # define SUBLANG_ENGLISH_INDONESIA 0x0e # endif # ifndef SUBLANG_ENGLISH_HONGKONG # define SUBLANG_ENGLISH_HONGKONG 0x0f # endif # ifndef SUBLANG_ENGLISH_INDIA # define SUBLANG_ENGLISH_INDIA 0x10 # endif # ifndef SUBLANG_ENGLISH_MALAYSIA # define SUBLANG_ENGLISH_MALAYSIA 0x11 # endif # ifndef SUBLANG_ENGLISH_SINGAPORE # define SUBLANG_ENGLISH_SINGAPORE 0x12 # endif # ifndef SUBLANG_FRENCH_LUXEMBOURG # define SUBLANG_FRENCH_LUXEMBOURG 0x05 # endif # ifndef SUBLANG_FRENCH_MONACO # define SUBLANG_FRENCH_MONACO 0x06 # endif # ifndef SUBLANG_FRENCH_WESTINDIES # define SUBLANG_FRENCH_WESTINDIES 0x07 # endif # ifndef SUBLANG_FRENCH_REUNION # define SUBLANG_FRENCH_REUNION 0x08 # endif # ifndef SUBLANG_FRENCH_CONGO # define SUBLANG_FRENCH_CONGO 0x09 # endif # ifndef SUBLANG_FRENCH_SENEGAL # define SUBLANG_FRENCH_SENEGAL 0x0a # endif # ifndef SUBLANG_FRENCH_CAMEROON # define SUBLANG_FRENCH_CAMEROON 0x0b # endif # ifndef SUBLANG_FRENCH_COTEDIVOIRE # define SUBLANG_FRENCH_COTEDIVOIRE 0x0c # endif # ifndef SUBLANG_FRENCH_MALI # define SUBLANG_FRENCH_MALI 0x0d # endif # ifndef SUBLANG_FRENCH_MOROCCO # define SUBLANG_FRENCH_MOROCCO 0x0e # endif # ifndef SUBLANG_FRENCH_HAITI # define SUBLANG_FRENCH_HAITI 0x0f # endif # ifndef SUBLANG_GERMAN_LUXEMBOURG # define SUBLANG_GERMAN_LUXEMBOURG 0x04 # endif # ifndef SUBLANG_GERMAN_LIECHTENSTEIN # define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 # endif # ifndef SUBLANG_KASHMIRI_INDIA # define SUBLANG_KASHMIRI_INDIA 0x02 # endif # ifndef SUBLANG_MALAY_MALAYSIA # define SUBLANG_MALAY_MALAYSIA 0x01 # endif # ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM # define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 # endif # ifndef SUBLANG_NEPALI_INDIA # define SUBLANG_NEPALI_INDIA 0x02 # endif # ifndef SUBLANG_PUNJABI_INDIA # define SUBLANG_PUNJABI_INDIA 0x01 # endif # ifndef SUBLANG_PUNJABI_PAKISTAN # define SUBLANG_PUNJABI_PAKISTAN 0x02 # endif # ifndef SUBLANG_ROMANIAN_ROMANIA # define SUBLANG_ROMANIAN_ROMANIA 0x01 # endif # ifndef SUBLANG_ROMANIAN_MOLDOVA # define SUBLANG_ROMANIAN_MOLDOVA 0x02 # endif # ifndef SUBLANG_SERBIAN_LATIN # define SUBLANG_SERBIAN_LATIN 0x02 # endif # ifndef SUBLANG_SERBIAN_CYRILLIC # define SUBLANG_SERBIAN_CYRILLIC 0x03 # endif # ifndef SUBLANG_SINDHI_PAKISTAN # define SUBLANG_SINDHI_PAKISTAN 0x01 # endif # ifndef SUBLANG_SINDHI_AFGHANISTAN # define SUBLANG_SINDHI_AFGHANISTAN 0x02 # endif # ifndef SUBLANG_SPANISH_GUATEMALA # define SUBLANG_SPANISH_GUATEMALA 0x04 # endif # ifndef SUBLANG_SPANISH_COSTA_RICA # define SUBLANG_SPANISH_COSTA_RICA 0x05 # endif # ifndef SUBLANG_SPANISH_PANAMA # define SUBLANG_SPANISH_PANAMA 0x06 # endif # ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC # define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 # endif # ifndef SUBLANG_SPANISH_VENEZUELA # define SUBLANG_SPANISH_VENEZUELA 0x08 # endif # ifndef SUBLANG_SPANISH_COLOMBIA # define SUBLANG_SPANISH_COLOMBIA 0x09 # endif # ifndef SUBLANG_SPANISH_PERU # define SUBLANG_SPANISH_PERU 0x0a # endif # ifndef SUBLANG_SPANISH_ARGENTINA # define SUBLANG_SPANISH_ARGENTINA 0x0b # endif # ifndef SUBLANG_SPANISH_ECUADOR # define SUBLANG_SPANISH_ECUADOR 0x0c # endif # ifndef SUBLANG_SPANISH_CHILE # define SUBLANG_SPANISH_CHILE 0x0d # endif # ifndef SUBLANG_SPANISH_URUGUAY # define SUBLANG_SPANISH_URUGUAY 0x0e # endif # ifndef SUBLANG_SPANISH_PARAGUAY # define SUBLANG_SPANISH_PARAGUAY 0x0f # endif # ifndef SUBLANG_SPANISH_BOLIVIA # define SUBLANG_SPANISH_BOLIVIA 0x10 # endif # ifndef SUBLANG_SPANISH_EL_SALVADOR # define SUBLANG_SPANISH_EL_SALVADOR 0x11 # endif # ifndef SUBLANG_SPANISH_HONDURAS # define SUBLANG_SPANISH_HONDURAS 0x12 # endif # ifndef SUBLANG_SPANISH_NICARAGUA # define SUBLANG_SPANISH_NICARAGUA 0x13 # endif # ifndef SUBLANG_SPANISH_PUERTO_RICO # define SUBLANG_SPANISH_PUERTO_RICO 0x14 # endif # ifndef SUBLANG_SWEDISH_FINLAND # define SUBLANG_SWEDISH_FINLAND 0x02 # endif # ifndef SUBLANG_TAMAZIGHT_ARABIC # define SUBLANG_TAMAZIGHT_ARABIC 0x01 # endif # ifndef SUBLANG_TAMAZIGHT_ALGERIA_LATIN # define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02 # endif # ifndef SUBLANG_TIGRINYA_ETHIOPIA # define SUBLANG_TIGRINYA_ETHIOPIA 0x01 # endif # ifndef SUBLANG_TIGRINYA_ERITREA # define SUBLANG_TIGRINYA_ERITREA 0x02 # endif # ifndef SUBLANG_URDU_PAKISTAN # define SUBLANG_URDU_PAKISTAN 0x01 # endif # ifndef SUBLANG_URDU_INDIA # define SUBLANG_URDU_INDIA 0x02 # endif # ifndef SUBLANG_UZBEK_LATIN # define SUBLANG_UZBEK_LATIN 0x01 # endif # ifndef SUBLANG_UZBEK_CYRILLIC # define SUBLANG_UZBEK_CYRILLIC 0x02 # endif #endif # if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ /* Canonicalize a MacOS X locale name to a Unix locale name. NAME is a sufficiently large buffer. On input, it contains the MacOS X locale name. On output, it contains the Unix locale name. */ # if !defined IN_LIBINTL static # endif void gl_locale_name_canonicalize (char *name) { /* This conversion is based on a posting by Deborah GoldSmith on 2005-03-08, http://lists.apple.com/archives/carbon-dev/2005/Mar/msg00293.html */ /* Convert legacy (NeXTstep inherited) English names to Unix (ISO 639 and ISO 3166) names. Prior to MacOS X 10.3, there is no API for doing this. Therefore we do it ourselves, using a table based on the results of the MacOS X 10.3.8 function CFLocaleCreateCanonicalLocaleIdentifierFromString(). */ typedef struct { const char legacy[21+1]; const char unixy[5+1]; } legacy_entry; static const legacy_entry legacy_table[] = { { "Afrikaans", "af" }, { "Albanian", "sq" }, { "Amharic", "am" }, { "Arabic", "ar" }, { "Armenian", "hy" }, { "Assamese", "as" }, { "Aymara", "ay" }, { "Azerbaijani", "az" }, { "Basque", "eu" }, { "Belarusian", "be" }, { "Belorussian", "be" }, { "Bengali", "bn" }, { "Brazilian Portugese", "pt_BR" }, { "Brazilian Portuguese", "pt_BR" }, { "Breton", "br" }, { "Bulgarian", "bg" }, { "Burmese", "my" }, { "Byelorussian", "be" }, { "Catalan", "ca" }, { "Chewa", "ny" }, { "Chichewa", "ny" }, { "Chinese", "zh" }, { "Chinese, Simplified", "zh_CN" }, { "Chinese, Traditional", "zh_TW" }, { "Chinese, Tradtional", "zh_TW" }, { "Croatian", "hr" }, { "Czech", "cs" }, { "Danish", "da" }, { "Dutch", "nl" }, { "Dzongkha", "dz" }, { "English", "en" }, { "Esperanto", "eo" }, { "Estonian", "et" }, { "Faroese", "fo" }, { "Farsi", "fa" }, { "Finnish", "fi" }, { "Flemish", "nl_BE" }, { "French", "fr" }, { "Galician", "gl" }, { "Gallegan", "gl" }, { "Georgian", "ka" }, { "German", "de" }, { "Greek", "el" }, { "Greenlandic", "kl" }, { "Guarani", "gn" }, { "Gujarati", "gu" }, { "Hawaiian", "haw" }, /* Yes, "haw", not "cpe". */ { "Hebrew", "he" }, { "Hindi", "hi" }, { "Hungarian", "hu" }, { "Icelandic", "is" }, { "Indonesian", "id" }, { "Inuktitut", "iu" }, { "Irish", "ga" }, { "Italian", "it" }, { "Japanese", "ja" }, { "Javanese", "jv" }, { "Kalaallisut", "kl" }, { "Kannada", "kn" }, { "Kashmiri", "ks" }, { "Kazakh", "kk" }, { "Khmer", "km" }, { "Kinyarwanda", "rw" }, { "Kirghiz", "ky" }, { "Korean", "ko" }, { "Kurdish", "ku" }, { "Latin", "la" }, { "Latvian", "lv" }, { "Lithuanian", "lt" }, { "Macedonian", "mk" }, { "Malagasy", "mg" }, { "Malay", "ms" }, { "Malayalam", "ml" }, { "Maltese", "mt" }, { "Manx", "gv" }, { "Marathi", "mr" }, { "Moldavian", "mo" }, { "Mongolian", "mn" }, { "Nepali", "ne" }, { "Norwegian", "nb" }, /* Yes, "nb", not the obsolete "no". */ { "Nyanja", "ny" }, { "Nynorsk", "nn" }, { "Oriya", "or" }, { "Oromo", "om" }, { "Panjabi", "pa" }, { "Pashto", "ps" }, { "Persian", "fa" }, { "Polish", "pl" }, { "Portuguese", "pt" }, { "Portuguese, Brazilian", "pt_BR" }, { "Punjabi", "pa" }, { "Pushto", "ps" }, { "Quechua", "qu" }, { "Romanian", "ro" }, { "Ruanda", "rw" }, { "Rundi", "rn" }, { "Russian", "ru" }, { "Sami", "se_NO" }, /* Not just "se". */ { "Sanskrit", "sa" }, { "Scottish", "gd" }, { "Serbian", "sr" }, { "Simplified Chinese", "zh_CN" }, { "Sindhi", "sd" }, { "Sinhalese", "si" }, { "Slovak", "sk" }, { "Slovenian", "sl" }, { "Somali", "so" }, { "Spanish", "es" }, { "Sundanese", "su" }, { "Swahili", "sw" }, { "Swedish", "sv" }, { "Tagalog", "tl" }, { "Tajik", "tg" }, { "Tajiki", "tg" }, { "Tamil", "ta" }, { "Tatar", "tt" }, { "Telugu", "te" }, { "Thai", "th" }, { "Tibetan", "bo" }, { "Tigrinya", "ti" }, { "Tongan", "to" }, { "Traditional Chinese", "zh_TW" }, { "Turkish", "tr" }, { "Turkmen", "tk" }, { "Uighur", "ug" }, { "Ukrainian", "uk" }, { "Urdu", "ur" }, { "Uzbek", "uz" }, { "Vietnamese", "vi" }, { "Welsh", "cy" }, { "Yiddish", "yi" } }; /* Convert new-style locale names with language tags (ISO 639 and ISO 15924) to Unix (ISO 639 and ISO 3166) names. */ typedef struct { const char langtag[7+1]; const char unixy[12+1]; } langtag_entry; static const langtag_entry langtag_table[] = { /* MacOS X has "az-Arab", "az-Cyrl", "az-Latn". The default script for az on Unix is Latin. */ { "az-Latn", "az" }, /* MacOS X has "ga-dots". Does not yet exist on Unix. */ { "ga-dots", "ga" }, /* MacOS X has "kk-Cyrl". Does not yet exist on Unix. */ /* MacOS X has "mn-Cyrl", "mn-Mong". The default script for mn on Unix is Cyrillic. */ { "mn-Cyrl", "mn" }, /* MacOS X has "ms-Arab", "ms-Latn". The default script for ms on Unix is Latin. */ { "ms-Latn", "ms" }, /* MacOS X has "tg-Cyrl". The default script for tg on Unix is Cyrillic. */ { "tg-Cyrl", "tg" }, /* MacOS X has "tk-Cyrl". Does not yet exist on Unix. */ /* MacOS X has "tt-Cyrl". The default script for tt on Unix is Cyrillic. */ { "tt-Cyrl", "tt" }, /* MacOS X has "zh-Hans", "zh-Hant". Country codes are used to distinguish these on Unix. */ { "zh-Hans", "zh_CN" }, { "zh-Hant", "zh_TW" } }; /* Convert script names (ISO 15924) to Unix conventions. See http://www.unicode.org/iso15924/iso15924-codes.html */ typedef struct { const char script[4+1]; const char unixy[9+1]; } script_entry; static const script_entry script_table[] = { { "Arab", "arabic" }, { "Cyrl", "cyrillic" }, { "Mong", "mongolian" } }; /* Step 1: Convert using legacy_table. */ if (name[0] >= 'A' && name[0] <= 'Z') { unsigned int i1, i2; i1 = 0; i2 = sizeof (legacy_table) / sizeof (legacy_entry); while (i2 - i1 > 1) { /* At this point we know that if name occurs in legacy_table, its index must be >= i1 and < i2. */ unsigned int i = (i1 + i2) >> 1; const legacy_entry *p = &legacy_table[i]; if (strcmp (name, p->legacy) < 0) i2 = i; else i1 = i; } if (strcmp (name, legacy_table[i1].legacy) == 0) { strcpy (name, legacy_table[i1].unixy); return; } } /* Step 2: Convert using langtag_table and script_table. */ if (strlen (name) == 7 && name[2] == '-') { unsigned int i1, i2; i1 = 0; i2 = sizeof (langtag_table) / sizeof (langtag_entry); while (i2 - i1 > 1) { /* At this point we know that if name occurs in langtag_table, its index must be >= i1 and < i2. */ unsigned int i = (i1 + i2) >> 1; const langtag_entry *p = &langtag_table[i]; if (strcmp (name, p->langtag) < 0) i2 = i; else i1 = i; } if (strcmp (name, langtag_table[i1].langtag) == 0) { strcpy (name, langtag_table[i1].unixy); return; } i1 = 0; i2 = sizeof (script_table) / sizeof (script_entry); while (i2 - i1 > 1) { /* At this point we know that if (name + 3) occurs in script_table, its index must be >= i1 and < i2. */ unsigned int i = (i1 + i2) >> 1; const script_entry *p = &script_table[i]; if (strcmp (name + 3, p->script) < 0) i2 = i; else i1 = i; } if (strcmp (name + 3, script_table[i1].script) == 0) { name[2] = '@'; strcpy (name + 3, script_table[i1].unixy); return; } } /* Step 3: Convert new-style dash to Unix underscore. */ { char *p; for (p = name; *p != '\0'; p++) if (*p == '-') *p = '_'; } } #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. Neither do SUSV2 and ISO C 99. So we can use this feature only on selected systems (e.g. those using GNU C Library). */ #if defined _LIBC || (defined __GLIBC__ && __GLIBC__ >= 2) # define HAVE_LOCALE_NULL #endif /* Determine the current locale's name, and canonicalize it into XPG syntax language[_territory][.codeset][@modifier] The codeset part in the result is not reliable; the locale_charset() should be used for codeset information instead. The result must not be freed; it is statically allocated. */ const char * gl_locale_name_posix (int category, const char *categoryname) { /* Use 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 const char *retval; /* Setting of LC_ALL overrides 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; return NULL; #endif } const char * gl_locale_name_default (void) { /* POSIX:2001 says: "All implementations shall define a locale as the default locale, to be invoked when no environment variables are set, or set to the empty string. This default locale can be the POSIX locale or any other implementation-defined locale. Some implementations may provide facilities for local installation administrators to set the default locale, customizing it for each location. POSIX:2001 does not require such a facility. */ #if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined(WIN32_NATIVE)) /* The system does not have a way of setting the locale, other than the POSIX specified environment variables. We use C as default locale. */ return "C"; #else /* Return an XPG style locale name language[_territory][@modifier]. Don't even bother determining the codeset; it's not useful in this context, because message catalogs are not specific to a single codeset. */ # if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ { /* Cache the locale name, since CoreFoundation calls are expensive. */ static const char *cached_localename; if (cached_localename == NULL) { char namebuf[256]; # if HAVE_CFLOCALECOPYCURRENT /* MacOS X 10.3 or newer */ CFLocaleRef locale = CFLocaleCopyCurrent (); CFStringRef name = CFLocaleGetIdentifier (locale); if (CFStringGetCString (name, namebuf, sizeof(namebuf), kCFStringEncodingASCII)) { gl_locale_name_canonicalize (namebuf); cached_localename = strdup (namebuf); } CFRelease (locale); # elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ CFTypeRef value = CFPreferencesCopyAppValue (CFSTR ("AppleLocale"), kCFPreferencesCurrentApplication); if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID () && CFStringGetCString ((CFStringRef)value, namebuf, sizeof(namebuf), kCFStringEncodingASCII)) { gl_locale_name_canonicalize (namebuf); cached_localename = strdup (namebuf); } # endif if (cached_localename == NULL) cached_localename = "C"; } return cached_localename; } # endif # if defined(WIN32_NATIVE) /* WIN32, not Cygwin */ { LCID lcid; LANGID langid; int primary, sub; /* Use native Win32 API locale ID. */ lcid = GetThreadLocale (); /* Strip off the sorting rules, keep only the language part. */ langid = LANGIDFROMLCID (lcid); /* Split into language and territory part. */ primary = PRIMARYLANGID (langid); sub = SUBLANGID (langid); /* Dispatch on language. See also http://www.unicode.org/unicode/onlinedat/languages.html . For details about languages, see http://www.ethnologue.com/ . */ switch (primary) { case LANG_AFRIKAANS: return "af_ZA"; case LANG_ALBANIAN: return "sq_AL"; case LANG_AMHARIC: return "am_ET"; case LANG_ARABIC: switch (sub) { case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA"; case SUBLANG_ARABIC_IRAQ: return "ar_IQ"; case SUBLANG_ARABIC_EGYPT: return "ar_EG"; case SUBLANG_ARABIC_LIBYA: return "ar_LY"; case SUBLANG_ARABIC_ALGERIA: return "ar_DZ"; case SUBLANG_ARABIC_MOROCCO: return "ar_MA"; case SUBLANG_ARABIC_TUNISIA: return "ar_TN"; case SUBLANG_ARABIC_OMAN: return "ar_OM"; case SUBLANG_ARABIC_YEMEN: return "ar_YE"; case SUBLANG_ARABIC_SYRIA: return "ar_SY"; case SUBLANG_ARABIC_JORDAN: return "ar_JO"; case SUBLANG_ARABIC_LEBANON: return "ar_LB"; case SUBLANG_ARABIC_KUWAIT: return "ar_KW"; case SUBLANG_ARABIC_UAE: return "ar_AE"; case SUBLANG_ARABIC_BAHRAIN: return "ar_BH"; case SUBLANG_ARABIC_QATAR: return "ar_QA"; } return "ar"; case LANG_ARMENIAN: return "hy_AM"; case LANG_ASSAMESE: return "as_IN"; case LANG_AZERI: switch (sub) { /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */ case SUBLANG_AZERI_LATIN: return "az_AZ@latin"; case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic"; } return "az"; case LANG_BASQUE: switch (sub) { case SUBLANG_DEFAULT: return "eu_ES"; } return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */ case LANG_BELARUSIAN: return "be_BY"; case LANG_BENGALI: switch (sub) { case SUBLANG_BENGALI_INDIA: return "bn_IN"; case SUBLANG_BENGALI_BANGLADESH: return "bn_BD"; } return "bn"; case LANG_BULGARIAN: return "bg_BG"; case LANG_BURMESE: return "my_MM"; case LANG_CAMBODIAN: return "km_KH"; case LANG_CATALAN: return "ca_ES"; case LANG_CHEROKEE: return "chr_US"; case LANG_CHINESE: switch (sub) { case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW"; case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN"; case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; case SUBLANG_CHINESE_MACAU: return "zh_MO"; } return "zh"; case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN * What used to be called Serbo-Croatian * should really now be two separate * languages because of political reasons. * (Says tml, who knows nothing about Serbian * or Croatian.) * (I can feel those flames coming already.) */ switch (sub) { case SUBLANG_DEFAULT: return "hr_HR"; case SUBLANG_SERBIAN_LATIN: return "sr_CS"; case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic"; } return "hr"; case LANG_CZECH: return "cs_CZ"; case LANG_DANISH: return "da_DK"; case LANG_DIVEHI: return "dv_MV"; case LANG_DUTCH: switch (sub) { case SUBLANG_DUTCH: return "nl_NL"; case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE"; } return "nl"; case LANG_EDO: return "bin_NG"; case LANG_ENGLISH: switch (sub) { /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought * English was the language spoken in England. * Oh well. */ case SUBLANG_ENGLISH_US: return "en_US"; case SUBLANG_ENGLISH_UK: return "en_GB"; case SUBLANG_ENGLISH_AUS: return "en_AU"; case SUBLANG_ENGLISH_CAN: return "en_CA"; case SUBLANG_ENGLISH_NZ: return "en_NZ"; case SUBLANG_ENGLISH_EIRE: return "en_IE"; case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA"; case SUBLANG_ENGLISH_JAMAICA: return "en_JM"; case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */ case SUBLANG_ENGLISH_BELIZE: return "en_BZ"; case SUBLANG_ENGLISH_TRINIDAD: return "en_TT"; case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW"; case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH"; case SUBLANG_ENGLISH_INDONESIA: return "en_ID"; case SUBLANG_ENGLISH_HONGKONG: return "en_HK"; case SUBLANG_ENGLISH_INDIA: return "en_IN"; case SUBLANG_ENGLISH_MALAYSIA: return "en_MY"; case SUBLANG_ENGLISH_SINGAPORE: return "en_SG"; } return "en"; case LANG_ESTONIAN: return "et_EE"; case LANG_FAEROESE: return "fo_FO"; case LANG_FARSI: return "fa_IR"; case LANG_FINNISH: return "fi_FI"; case LANG_FRENCH: switch (sub) { case SUBLANG_FRENCH: return "fr_FR"; case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE"; case SUBLANG_FRENCH_CANADIAN: return "fr_CA"; case SUBLANG_FRENCH_SWISS: return "fr_CH"; case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU"; case SUBLANG_FRENCH_MONACO: return "fr_MC"; case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */ case SUBLANG_FRENCH_REUNION: return "fr_RE"; case SUBLANG_FRENCH_CONGO: return "fr_CG"; case SUBLANG_FRENCH_SENEGAL: return "fr_SN"; case SUBLANG_FRENCH_CAMEROON: return "fr_CM"; case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI"; case SUBLANG_FRENCH_MALI: return "fr_ML"; case SUBLANG_FRENCH_MOROCCO: return "fr_MA"; case SUBLANG_FRENCH_HAITI: return "fr_HT"; } return "fr"; case LANG_FRISIAN: return "fy_NL"; case LANG_FULFULDE: /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */ return "ff_NG"; case LANG_GAELIC: switch (sub) { case 0x01: /* SCOTTISH */ return "gd_GB"; case 0x02: /* IRISH */ return "ga_IE"; } return "C"; case LANG_GALICIAN: return "gl_ES"; case LANG_GEORGIAN: return "ka_GE"; case LANG_GERMAN: switch (sub) { case SUBLANG_GERMAN: return "de_DE"; case SUBLANG_GERMAN_SWISS: return "de_CH"; case SUBLANG_GERMAN_AUSTRIAN: return "de_AT"; case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU"; case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI"; } return "de"; case LANG_GREEK: return "el_GR"; case LANG_GUARANI: return "gn_PY"; case LANG_GUJARATI: return "gu_IN"; case LANG_HAUSA: return "ha_NG"; case LANG_HAWAIIAN: /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers) or Hawaii Creole English ("cpe_US", 600000 speakers)? */ return "cpe_US"; case LANG_HEBREW: return "he_IL"; case LANG_HINDI: return "hi_IN"; case LANG_HUNGARIAN: return "hu_HU"; case LANG_IBIBIO: return "nic_NG"; case LANG_ICELANDIC: return "is_IS"; case LANG_IGBO: return "ig_NG"; case LANG_INDONESIAN: return "id_ID"; case LANG_INUKTITUT: return "iu_CA"; case LANG_ITALIAN: switch (sub) { case SUBLANG_ITALIAN: return "it_IT"; case SUBLANG_ITALIAN_SWISS: return "it_CH"; } return "it"; case LANG_JAPANESE: return "ja_JP"; case LANG_KANNADA: return "kn_IN"; case LANG_KANURI: return "kr_NG"; case LANG_KASHMIRI: switch (sub) { case SUBLANG_DEFAULT: return "ks_PK"; case SUBLANG_KASHMIRI_INDIA: return "ks_IN"; } return "ks"; case LANG_KAZAK: return "kk_KZ"; case LANG_KONKANI: /* FIXME: Adjust this when such locales appear on Unix. */ return "kok_IN"; case LANG_KOREAN: return "ko_KR"; case LANG_KYRGYZ: return "ky_KG"; case LANG_LAO: return "lo_LA"; case LANG_LATIN: return "la_VA"; case LANG_LATVIAN: return "lv_LV"; case LANG_LITHUANIAN: return "lt_LT"; case LANG_MACEDONIAN: return "mk_MK"; case LANG_MALAY: switch (sub) { case SUBLANG_MALAY_MALAYSIA: return "ms_MY"; case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN"; } return "ms"; case LANG_MALAYALAM: return "ml_IN"; case LANG_MALTESE: return "mt_MT"; case LANG_MANIPURI: /* FIXME: Adjust this when such locales appear on Unix. */ return "mni_IN"; case LANG_MARATHI: return "mr_IN"; case LANG_MONGOLIAN: switch (sub) { case SUBLANG_DEFAULT: return "mn_MN"; } return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */ case LANG_NEPALI: switch (sub) { case SUBLANG_DEFAULT: return "ne_NP"; case SUBLANG_NEPALI_INDIA: return "ne_IN"; } return "ne"; case LANG_NORWEGIAN: switch (sub) { case SUBLANG_NORWEGIAN_BOKMAL: return "nb_NO"; case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO"; } return "no"; case LANG_ORIYA: return "or_IN"; case LANG_OROMO: return "om_ET"; case LANG_PAPIAMENTU: return "pap_AN"; case LANG_PASHTO: return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */ case LANG_POLISH: return "pl_PL"; case LANG_PORTUGUESE: switch (sub) { case SUBLANG_PORTUGUESE: return "pt_PT"; /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR"; } return "pt"; case LANG_PUNJABI: switch (sub) { case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */ case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */ } return "pa"; case LANG_RHAETO_ROMANCE: return "rm_CH"; case LANG_ROMANIAN: switch (sub) { case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO"; case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD"; } return "ro"; case LANG_RUSSIAN: switch (sub) { case SUBLANG_DEFAULT: return "ru_RU"; } return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */ case LANG_SAAMI: /* actually Northern Sami */ return "se_NO"; case LANG_SANSKRIT: return "sa_IN"; case LANG_SINDHI: switch (sub) { case SUBLANG_SINDHI_PAKISTAN: return "sd_PK"; case SUBLANG_SINDHI_AFGHANISTAN: return "sd_AF"; } return "sd"; case LANG_SINHALESE: return "si_LK"; case LANG_SLOVAK: return "sk_SK"; case LANG_SLOVENIAN: return "sl_SI"; case LANG_SOMALI: return "so_SO"; case LANG_SORBIAN: /* FIXME: Adjust this when such locales appear on Unix. */ return "wen_DE"; case LANG_SPANISH: switch (sub) { case SUBLANG_SPANISH: return "es_ES"; case SUBLANG_SPANISH_MEXICAN: return "es_MX"; case SUBLANG_SPANISH_MODERN: return "es_ES@modern"; /* not seen on Unix */ case SUBLANG_SPANISH_GUATEMALA: return "es_GT"; case SUBLANG_SPANISH_COSTA_RICA: return "es_CR"; case SUBLANG_SPANISH_PANAMA: return "es_PA"; case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO"; case SUBLANG_SPANISH_VENEZUELA: return "es_VE"; case SUBLANG_SPANISH_COLOMBIA: return "es_CO"; case SUBLANG_SPANISH_PERU: return "es_PE"; case SUBLANG_SPANISH_ARGENTINA: return "es_AR"; case SUBLANG_SPANISH_ECUADOR: return "es_EC"; case SUBLANG_SPANISH_CHILE: return "es_CL"; case SUBLANG_SPANISH_URUGUAY: return "es_UY"; case SUBLANG_SPANISH_PARAGUAY: return "es_PY"; case SUBLANG_SPANISH_BOLIVIA: return "es_BO"; case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV"; case SUBLANG_SPANISH_HONDURAS: return "es_HN"; case SUBLANG_SPANISH_NICARAGUA: return "es_NI"; case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR"; } return "es"; case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */ case LANG_SWAHILI: return "sw_KE"; case LANG_SWEDISH: switch (sub) { case SUBLANG_DEFAULT: return "sv_SE"; case SUBLANG_SWEDISH_FINLAND: return "sv_FI"; } return "sv"; case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */ case LANG_TAGALOG: return "tl_PH"; case LANG_TAJIK: return "tg_TJ"; case LANG_TAMAZIGHT: switch (sub) { /* FIXME: Adjust this when Tamazight locales appear on Unix. */ case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic"; case SUBLANG_TAMAZIGHT_ALGERIA_LATIN: return "ber_DZ@latin"; } return "ber_MA"; case LANG_TAMIL: switch (sub) { case SUBLANG_DEFAULT: return "ta_IN"; } return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */ case LANG_TATAR: return "tt_RU"; case LANG_TELUGU: return "te_IN"; case LANG_THAI: return "th_TH"; case LANG_TIBETAN: return "bo_CN"; case LANG_TIGRINYA: switch (sub) { case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET"; case SUBLANG_TIGRINYA_ERITREA: return "ti_ER"; } return "ti"; case LANG_TSONGA: return "ts_ZA"; case LANG_TSWANA: return "tn_BW"; case LANG_TURKISH: return "tr_TR"; case LANG_TURKMEN: return "tk_TM"; case LANG_UKRAINIAN: return "uk_UA"; case LANG_URDU: switch (sub) { case SUBLANG_URDU_PAKISTAN: return "ur_PK"; case SUBLANG_URDU_INDIA: return "ur_IN"; } return "ur"; case LANG_UZBEK: switch (sub) { case SUBLANG_UZBEK_LATIN: return "uz_UZ"; case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic"; } return "uz"; case LANG_VENDA: return "ve_ZA"; case LANG_VIETNAMESE: return "vi_VN"; case LANG_WELSH: return "cy_GB"; case LANG_XHOSA: return "xh_ZA"; case LANG_YI: return "sit_CN"; case LANG_YIDDISH: return "yi_IL"; case LANG_YORUBA: return "yo_NG"; case LANG_ZULU: return "zu_ZA"; default: return "C"; } } # endif #endif } const char * gl_locale_name (int category, const char *categoryname) { const char *retval; retval = gl_locale_name_posix (category, categoryname); if (retval != NULL) return retval; return gl_locale_name_default (); } sitecopy-0.16.6/intl/export.h0000644000076400007640000000023510271667241014235 0ustar joejoe #if @HAVE_VISIBILITY@ && BUILDING_LIBINTL #define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default"))) #else #define LIBINTL_DLL_EXPORTED #endif sitecopy-0.16.6/intl/dcngettext.c0000644000076400007640000000347410243450466015066 0ustar joejoe/* Implementation of the dcngettext(3) function. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.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 DCNGETTEXT __dcngettext # define DCIGETTEXT __dcigettext #else # define DCNGETTEXT libintl_dcngettext # define DCIGETTEXT libintl_dcigettext #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCNGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n, int category) { return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dcngettext, dcngettext); #endif sitecopy-0.16.6/intl/loadinfo.h0000644000076400007640000001211310432576264014510 0ustar joejoe/* Copyright (C) 1996-1999, 2000-2003, 2005-2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LOADINFO_H #define _LOADINFO_H 1 /* Declarations of locale dependent catalog lookup functions. Implemented in localealias.c Possibly replace a locale name by another. explodename.c Split a locale name into its various fields. l10nflist.c Generate a list of filenames of possible message catalogs. finddomain.c Find and open the relevant message catalogs. The main function _nl_find_domain() in finddomain.c is declared in gettextP.h. */ #ifndef internal_function # define internal_function #endif #ifndef LIBINTL_DLL_EXPORTED # define LIBINTL_DLL_EXPORTED #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif /* Separator in PATH like lists of pathnames. */ #if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define PATH_SEPARATOR ';' #else /* Unix */ # define PATH_SEPARATOR ':' #endif /* Encoding of locale name parts. */ #define XPG_NORM_CODESET 1 #define XPG_CODESET 2 #define XPG_TERRITORY 4 #define XPG_MODIFIER 8 struct loaded_l10nfile { const char *filename; int decided; const void *data; struct loaded_l10nfile *next; struct loaded_l10nfile *successor[1]; }; /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ extern const char *_nl_normalize_codeset (const char *codeset, size_t name_len); /* Lookup a locale dependent file. *L10NFILE_LIST denotes a pool of lookup results of locale dependent files of the same kind, sorted in decreasing order of ->filename. DIRLIST and DIRLIST_LEN are an argz list of directories in which to look, containing at least one directory (i.e. DIRLIST_LEN > 0). MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER are the pieces of the locale name, as produced by _nl_explode_name(). FILENAME is the filename suffix. The return value is the lookup result, either found in *L10NFILE_LIST, or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL. If the return value is non-NULL, it is added to *L10NFILE_LIST, and its ->next field denotes the chaining inside *L10NFILE_LIST, and furthermore its ->successor[] field contains a list of other lookup results from which this lookup result inherits. */ extern struct loaded_l10nfile * _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *filename, int do_allocate); /* Lookup the real locale name for a locale alias NAME, or NULL if NAME is not a locale alias (but possibly a real locale name). The return value is statically allocated and must not be freed. */ /* Part of the libintl ABI only for the sake of the gettext.m4 macro. */ extern LIBINTL_DLL_EXPORTED const char *_nl_expand_alias (const char *name); /* Split a locale name NAME into its pieces: language, modifier, territory, codeset. NAME gets destructively modified: NUL bytes are inserted here and there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY, *CODESET gets assigned either a pointer into the old NAME string, or NULL. *NORMALIZED_CODESET gets assigned the expanded *CODESET, if it is different from *CODESET; this one is dynamically allocated and has to be freed by the caller. The return value is a bitmask, where each bit corresponds to one filled-in value: XPG_MODIFIER for *MODIFIER, XPG_TERRITORY for *TERRITORY, XPG_CODESET for *CODESET, XPG_NORM_CODESET for *NORMALIZED_CODESET. */ extern int _nl_explode_name (char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset); #endif /* loadinfo.h */ sitecopy-0.16.6/intl/bindtextdom.c0000644000076400007640000002137210523627535015237 0ustar joejoe/* Implementation of the bindtextdomain(3) function Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include # define gl_rwlock_define __libc_rwlock_define # define gl_rwlock_wrlock __libc_rwlock_wrlock # define gl_rwlock_unlock __libc_rwlock_unlock #else # include "lock.h" #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ /* Lock variable to protect the global data in the gettext implementation. */ gl_rwlock_define (extern, _nl_state_lock attribute_hidden) /* 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 # define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define BINDTEXTDOMAIN libintl_bindtextdomain # define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset #endif /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP to be used for the DOMAINNAME message catalog. If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not modified, only the current value is returned. If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither modified nor returned. */ static void set_binding_values (const char *domainname, const char **dirnamep, const char **codesetp) { struct binding *binding; int modified; /* Some sanity checks. */ if (domainname == NULL || domainname[0] == '\0') { if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; return; } gl_rwlock_wrlock (_nl_state_lock); modified = 0; 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) { if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The current binding has be to returned. */ *dirnamep = binding->dirname; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->dirname; if (strcmp (dirname, result) != 0) { if (strcmp (dirname, _nl_default_dirname) == 0) result = (char *) _nl_default_dirname; else { #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, dirname, len); #endif } if (__builtin_expect (result != NULL, 1)) { if (binding->dirname != _nl_default_dirname) free (binding->dirname); binding->dirname = result; modified = 1; } } *dirnamep = result; } } if (codesetp) { const char *codeset = *codesetp; if (codeset == NULL) /* The current binding has be to returned. */ *codesetp = binding->codeset; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->codeset; if (result == NULL || strcmp (codeset, result) != 0) { #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, codeset, len); #endif if (__builtin_expect (result != NULL, 1)) { if (binding->codeset != NULL) free (binding->codeset); binding->codeset = result; modified = 1; } } *codesetp = result; } } } else if ((dirnamep == NULL || *dirnamep == NULL) && (codesetp == NULL || *codesetp == NULL)) { /* Simply return the default values. */ if (dirnamep) *dirnamep = _nl_default_dirname; if (codesetp) *codesetp = NULL; } else { /* We have to create a new binding. */ size_t len = strlen (domainname) + 1; struct binding *new_binding = (struct binding *) malloc (offsetof (struct binding, domainname) + len); if (__builtin_expect (new_binding == NULL, 0)) goto failed; memcpy (new_binding->domainname, domainname, len); if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The default value. */ dirname = _nl_default_dirname; else { if (strcmp (dirname, _nl_default_dirname) == 0) dirname = _nl_default_dirname; else { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; memcpy (result, dirname, len); #endif dirname = result; } } *dirnamep = dirname; new_binding->dirname = (char *) dirname; } else /* The default value. */ new_binding->dirname = (char *) _nl_default_dirname; if (codesetp) { const char *codeset = *codesetp; if (codeset != NULL) { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; memcpy (result, codeset, len); #endif codeset = result; } *codesetp = codeset; new_binding->codeset = (char *) codeset; } else new_binding->codeset = NULL; /* 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; } modified = 1; /* Here we deal with memory allocation failures. */ if (0) { failed_codeset: if (new_binding->dirname != _nl_default_dirname) free (new_binding->dirname); failed_dirname: free (new_binding); failed: if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; } } /* If we modified any binding, we flush the caches. */ if (modified) ++_nl_msg_cat_cntr; gl_rwlock_unlock (_nl_state_lock); } /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ char * BINDTEXTDOMAIN (const char *domainname, const char *dirname) { set_binding_values (domainname, &dirname, NULL); return (char *) dirname; } /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ char * BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset) { set_binding_values (domainname, NULL, &codeset); return (char *) codeset; } #ifdef _LIBC /* Aliases for function names in GNU C Library. */ weak_alias (__bindtextdomain, bindtextdomain); weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset); #endif sitecopy-0.16.6/intl/hash-string.h0000644000076400007640000000256610243450466015152 0ustar joejoe/* Description of GNU message catalog format: string hashing function. Copyright (C) 1995, 1997-1998, 2000-2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* @@ end of prolog @@ */ /* We assume to have `unsigned long int' value with at least 32 bits. */ #define HASHWORDBITS 32 #ifndef _LIBC # ifdef IN_LIBINTL # define __hash_string libintl_hash_string # else # define __hash_string hash_string # endif #endif /* 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.] */ extern unsigned long int __hash_string (const char *str_param); sitecopy-0.16.6/intl/osdep.c0000644000076400007640000000174110430721650014014 0ustar joejoe/* OS dependent parts of libintl. Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if defined __CYGWIN__ # include "intl-exports.c" #elif defined __EMX__ # include "os2compat.c" #else /* Avoid AIX compiler warning. */ typedef int dummy; #endif sitecopy-0.16.6/intl/os2compat.c0000644000076400007640000000550710243450466014623 0ustar joejoe/* OS/2 compatibility functions. Copyright (C) 2001-2002 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define OS2_AWARE #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* A version of getenv() that works from DLLs */ extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); char * _nl_getenv (const char *name) { unsigned char *value; if (DosScanEnv (name, &value)) return NULL; else return value; } /* A fixed size buffer. */ char libintl_nl_default_dirname[MAXPATHLEN+1]; char *_nlos2_libdir = NULL; char *_nlos2_localealiaspath = NULL; char *_nlos2_localedir = NULL; static __attribute__((constructor)) void nlos2_initialize () { char *root = getenv ("UNIXROOT"); char *gnulocaledir = getenv ("GNULOCALEDIR"); _nlos2_libdir = gnulocaledir; if (!_nlos2_libdir) { if (root) { size_t sl = strlen (root); _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); memcpy (_nlos2_libdir, root, sl); memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); } else _nlos2_libdir = LIBDIR; } _nlos2_localealiaspath = gnulocaledir; if (!_nlos2_localealiaspath) { if (root) { size_t sl = strlen (root); _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); memcpy (_nlos2_localealiaspath, root, sl); memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); } else _nlos2_localealiaspath = LOCALE_ALIAS_PATH; } _nlos2_localedir = gnulocaledir; if (!_nlos2_localedir) { if (root) { size_t sl = strlen (root); _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); memcpy (_nlos2_localedir, root, sl); memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); } else _nlos2_localedir = LOCALEDIR; } if (strlen (_nlos2_localedir) <= MAXPATHLEN) strcpy (libintl_nl_default_dirname, _nlos2_localedir); } sitecopy-0.16.6/intl/eval-plural.h0000644000076400007640000000534210704164714015142 0ustar joejoe/* Plural expression evaluation. Copyright (C) 2000-2003, 2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef STATIC #define STATIC static #endif /* Evaluate the plural expression and return an index value. */ STATIC unsigned long int internal_function plural_eval (const struct expression *pexp, unsigned long int n) { switch (pexp->nargs) { case 0: switch (pexp->operation) { case var: return n; case num: return pexp->val.num; default: break; } /* NOTREACHED */ break; case 1: { /* pexp->operation must be lnot. */ unsigned long int arg = plural_eval (pexp->val.args[0], n); return ! arg; } case 2: { unsigned long int leftarg = plural_eval (pexp->val.args[0], n); if (pexp->operation == lor) return leftarg || plural_eval (pexp->val.args[1], n); else if (pexp->operation == land) return leftarg && plural_eval (pexp->val.args[1], n); else { unsigned long int rightarg = plural_eval (pexp->val.args[1], n); switch (pexp->operation) { case mult: return leftarg * rightarg; case divide: #if !INTDIV0_RAISES_SIGFPE if (rightarg == 0) raise (SIGFPE); #endif return leftarg / rightarg; case module: #if !INTDIV0_RAISES_SIGFPE if (rightarg == 0) raise (SIGFPE); #endif return leftarg % rightarg; case plus: return leftarg + rightarg; case minus: return leftarg - rightarg; case less_than: return leftarg < rightarg; case greater_than: return leftarg > rightarg; case less_or_equal: return leftarg <= rightarg; case greater_or_equal: return leftarg >= rightarg; case equal: return leftarg == rightarg; case not_equal: return leftarg != rightarg; default: break; } } /* NOTREACHED */ break; } case 3: { /* pexp->operation must be qmop. */ unsigned long int boolarg = plural_eval (pexp->val.args[0], n); return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); } } /* NOTREACHED */ return 0; } sitecopy-0.16.6/intl/printf.c0000644000076400007640000002217310632644025014212 0ustar joejoe/* Formatted output to strings, using POSIX/XSI format strings with positions. Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #if !HAVE_POSIX_PRINTF #include #include #include #include /* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ #ifndef EOVERFLOW # define EOVERFLOW E2BIG #endif /* When building a DLL, we must export some functions. Note that because the functions are only defined for binary backward compatibility, we don't need to use __declspec(dllimport) in any case. */ #if defined _MSC_VER && BUILDING_DLL # define DLL_EXPORTED __declspec(dllexport) #else # define DLL_EXPORTED #endif #define STATIC static /* This needs to be consistent with libgnuintl.h.in. */ #if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__ /* Don't break __attribute__((format(printf,M,N))). This redefinition is only possible because the libc in NetBSD, Cygwin, mingw does not have a function __printf__. */ # define libintl_printf __printf__ #endif /* Define auxiliary functions declared in "printf-args.h". */ #include "printf-args.c" /* Define auxiliary functions declared in "printf-parse.h". */ #include "printf-parse.c" /* Define functions declared in "vasnprintf.h". */ #define vasnprintf libintl_vasnprintf #include "vasnprintf.c" #if 0 /* not needed */ #define asnprintf libintl_asnprintf #include "asnprintf.c" #endif DLL_EXPORTED int libintl_vfprintf (FILE *stream, const char *format, va_list args) { if (strchr (format, '$') == NULL) return vfprintf (stream, format, args); else { size_t length; char *result = libintl_vasnprintf (NULL, &length, format, args); int retval = -1; if (result != NULL) { size_t written = fwrite (result, 1, length, stream); free (result); if (written == length) { if (length > INT_MAX) errno = EOVERFLOW; else retval = length; } } return retval; } } DLL_EXPORTED int libintl_fprintf (FILE *stream, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vfprintf (stream, format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vprintf (const char *format, va_list args) { return libintl_vfprintf (stdout, format, args); } DLL_EXPORTED int libintl_printf (const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vprintf (format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vsprintf (char *resultbuf, const char *format, va_list args) { if (strchr (format, '$') == NULL) return vsprintf (resultbuf, format, args); else { size_t length = (size_t) ~0 / (4 * sizeof (char)); char *result = libintl_vasnprintf (resultbuf, &length, format, args); if (result != resultbuf) { free (result); return -1; } if (length > INT_MAX) { errno = EOVERFLOW; return -1; } else return length; } } DLL_EXPORTED int libintl_sprintf (char *resultbuf, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vsprintf (resultbuf, format, args); va_end (args); return retval; } #if HAVE_SNPRINTF # if HAVE_DECL__SNPRINTF /* Windows. */ # define system_vsnprintf _vsnprintf # else /* Unix. */ # define system_vsnprintf vsnprintf # endif DLL_EXPORTED int libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list args) { if (strchr (format, '$') == NULL) return system_vsnprintf (resultbuf, length, format, args); else { size_t maxlength = length; char *result = libintl_vasnprintf (resultbuf, &length, format, args); if (result != resultbuf) { if (maxlength > 0) { size_t pruned_length = (length < maxlength ? length : maxlength - 1); memcpy (resultbuf, result, pruned_length); resultbuf[pruned_length] = '\0'; } free (result); } if (length > INT_MAX) { errno = EOVERFLOW; return -1; } else return length; } } DLL_EXPORTED int libintl_snprintf (char *resultbuf, size_t length, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vsnprintf (resultbuf, length, format, args); va_end (args); return retval; } #endif #if HAVE_ASPRINTF DLL_EXPORTED int libintl_vasprintf (char **resultp, const char *format, va_list args) { size_t length; char *result = libintl_vasnprintf (NULL, &length, format, args); if (result == NULL) return -1; if (length > INT_MAX) { free (result); errno = EOVERFLOW; return -1; } *resultp = result; return length; } DLL_EXPORTED int libintl_asprintf (char **resultp, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vasprintf (resultp, format, args); va_end (args); return retval; } #endif #if HAVE_FWPRINTF #include #define WIDE_CHAR_VERSION 1 #include "wprintf-parse.h" /* Define auxiliary functions declared in "wprintf-parse.h". */ #define CHAR_T wchar_t #define DIRECTIVE wchar_t_directive #define DIRECTIVES wchar_t_directives #define PRINTF_PARSE wprintf_parse #include "printf-parse.c" /* Define functions declared in "vasnprintf.h". */ #define vasnwprintf libintl_vasnwprintf #include "vasnprintf.c" #if 0 /* not needed */ #define asnwprintf libintl_asnwprintf #include "asnprintf.c" #endif # if HAVE_DECL__SNWPRINTF /* Windows. */ # define system_vswprintf _vsnwprintf # else /* Unix. */ # define system_vswprintf vswprintf # endif DLL_EXPORTED int libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args) { if (wcschr (format, '$') == NULL) return vfwprintf (stream, format, args); else { size_t length; wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args); int retval = -1; if (result != NULL) { size_t i; for (i = 0; i < length; i++) if (fputwc (result[i], stream) == WEOF) break; free (result); if (i == length) { if (length > INT_MAX) errno = EOVERFLOW; else retval = length; } } return retval; } } DLL_EXPORTED int libintl_fwprintf (FILE *stream, const wchar_t *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vfwprintf (stream, format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vwprintf (const wchar_t *format, va_list args) { return libintl_vfwprintf (stdout, format, args); } DLL_EXPORTED int libintl_wprintf (const wchar_t *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vwprintf (format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_list args) { if (wcschr (format, '$') == NULL) return system_vswprintf (resultbuf, length, format, args); else { size_t maxlength = length; wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args); if (result != resultbuf) { if (maxlength > 0) { size_t pruned_length = (length < maxlength ? length : maxlength - 1); memcpy (resultbuf, result, pruned_length * sizeof (wchar_t)); resultbuf[pruned_length] = 0; } free (result); /* Unlike vsnprintf, which has to return the number of character that would have been produced if the resultbuf had been sufficiently large, the vswprintf function has to return a negative value if the resultbuf was not sufficiently large. */ if (length >= maxlength) return -1; } if (length > INT_MAX) { errno = EOVERFLOW; return -1; } else return length; } } DLL_EXPORTED int libintl_swprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vswprintf (resultbuf, length, format, args); va_end (args); return retval; } #endif #endif sitecopy-0.16.6/intl/gettext.c0000644000076400007640000000355410243450466014400 0ustar joejoe/* Implementation of gettext(3) function. Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.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 DCGETTEXT INTUSE(__dcgettext) #else # define GETTEXT libintl_gettext # define DCGETTEXT libintl_dcgettext #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 (const char *msgid) { return DCGETTEXT (NULL, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__gettext, gettext); #endif sitecopy-0.16.6/intl/wprintf-parse.h0000644000076400007640000000426310243450467015521 0ustar joejoe/* Parse printf format string. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WPRINTF_PARSE_H #define _WPRINTF_PARSE_H #include "printf-args.h" /* Flags */ #define FLAG_GROUP 1 /* ' flag */ #define FLAG_LEFT 2 /* - flag */ #define FLAG_SHOWSIGN 4 /* + flag */ #define FLAG_SPACE 8 /* space flag */ #define FLAG_ALT 16 /* # flag */ #define FLAG_ZERO 32 /* arg_index value indicating that no argument is consumed. */ #define ARG_NONE (~(size_t)0) /* A parsed directive. */ typedef struct { const wchar_t* dir_start; const wchar_t* dir_end; int flags; const wchar_t* width_start; const wchar_t* width_end; size_t width_arg_index; const wchar_t* precision_start; const wchar_t* precision_end; size_t precision_arg_index; wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */ size_t arg_index; } wchar_t_directive; /* A parsed format string. */ typedef struct { size_t count; wchar_t_directive *dir; size_t max_width_length; size_t max_precision_length; } wchar_t_directives; /* Parses the format string. Fills in the number N of directives, and fills in directives[0], ..., directives[N-1], and sets directives[N].dir_start to the end of the format string. Also fills in the arg_type fields of the arguments and the needed count of arguments. */ #ifdef STATIC STATIC #else extern #endif int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a); #endif /* _WPRINTF_PARSE_H */ sitecopy-0.16.6/intl/config.charset0000755000076400007640000004702610445477506015405 0ustar joejoe#! /bin/sh # Output a system dependent table of character encoding aliases. # # Copyright (C) 2000-2004, 2006 Free Software Foundation, Inc. # # This program 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, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. # # The table consists of lines of the form # ALIAS CANONICAL # # ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". # ALIAS is compared in a case sensitive way. # # CANONICAL is the GNU canonical name for this character encoding. # It must be an encoding supported by libiconv. Support by GNU libc is # also desirable. CANONICAL is case insensitive. Usually an upper case # MIME charset name is preferred. # The current list of GNU canonical charset names is as follows. # # name MIME? used by which systems # ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin # ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd darwin # ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd darwin # ISO-8859-3 Y glibc solaris # ISO-8859-4 Y osf solaris freebsd netbsd darwin # ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd darwin # ISO-8859-6 Y glibc aix hpux solaris # ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd darwin # ISO-8859-8 Y glibc aix hpux osf solaris # ISO-8859-9 Y glibc aix hpux irix osf solaris darwin # ISO-8859-13 glibc netbsd darwin # ISO-8859-14 glibc # ISO-8859-15 glibc aix osf solaris freebsd darwin # KOI8-R Y glibc solaris freebsd netbsd darwin # KOI8-U Y glibc freebsd netbsd darwin # KOI8-T glibc # CP437 dos # CP775 dos # CP850 aix osf dos # CP852 dos # CP855 dos # CP856 aix # CP857 dos # CP861 dos # CP862 dos # CP864 dos # CP865 dos # CP866 freebsd netbsd darwin dos # CP869 dos # CP874 woe32 dos # CP922 aix # CP932 aix woe32 dos # CP943 aix # CP949 osf woe32 dos # CP950 woe32 dos # CP1046 aix # CP1124 aix # CP1125 dos # CP1129 aix # CP1250 woe32 # CP1251 glibc solaris netbsd darwin woe32 # CP1252 aix woe32 # CP1253 woe32 # CP1254 woe32 # CP1255 glibc woe32 # CP1256 woe32 # CP1257 woe32 # GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin # EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin # EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin # EUC-TW glibc aix hpux irix osf solaris netbsd # BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin # BIG5-HKSCS glibc solaris # GBK glibc aix osf solaris woe32 dos # GB18030 glibc solaris netbsd # SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin # JOHAB glibc solaris woe32 # TIS-620 glibc aix hpux osf solaris # VISCII Y glibc # TCVN5712-1 glibc # GEORGIAN-PS glibc # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux # HP-HEBREW8 hpux # HP-TURKISH8 hpux # HP-KANA8 hpux # DEC-KANJI osf # DEC-HANYU osf # UTF-8 Y glibc aix hpux osf solaris netbsd darwin # # Note: Names which are not marked as being a MIME name should not be used in # Internet protocols for information interchange (mail, news, etc.). # # Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications # must understand both names and treat them as equivalent. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM host="$1" os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` echo "# This file contains a table of character encoding aliases," echo "# suitable for operating system '${os}'." echo "# It was automatically generated from config.charset." # List of references, updated during installation: echo "# Packages using this file: " case "$os" in linux-gnulibc1*) # Linux libc5 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "C ASCII" echo "POSIX ASCII" for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \ en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \ en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \ es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \ et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \ fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \ it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \ sv_FI sv_SE; do echo "$l ISO-8859-1" echo "$l.iso-8859-1 ISO-8859-1" echo "$l.iso-8859-15 ISO-8859-15" echo "$l.iso-8859-15@euro ISO-8859-15" echo "$l@euro ISO-8859-15" echo "$l.cp-437 CP437" echo "$l.cp-850 CP850" echo "$l.cp-1252 CP1252" echo "$l.cp-1252@euro CP1252" #echo "$l.atari-st ATARI-ST" # not a commonly used encoding echo "$l.utf-8 UTF-8" echo "$l.utf-8@euro UTF-8" done for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \ sl_SI sr sr_CS sr_YU; do echo "$l ISO-8859-2" echo "$l.iso-8859-2 ISO-8859-2" echo "$l.cp-852 CP852" echo "$l.cp-1250 CP1250" echo "$l.utf-8 UTF-8" done for l in mk mk_MK ru ru_RU; do echo "$l ISO-8859-5" echo "$l.iso-8859-5 ISO-8859-5" echo "$l.koi8-r KOI8-R" echo "$l.cp-866 CP866" echo "$l.cp-1251 CP1251" echo "$l.utf-8 UTF-8" done for l in ar ar_SA; do echo "$l ISO-8859-6" echo "$l.iso-8859-6 ISO-8859-6" echo "$l.cp-864 CP864" #echo "$l.cp-868 CP868" # not a commonly used encoding echo "$l.cp-1256 CP1256" echo "$l.utf-8 UTF-8" done for l in el el_GR gr gr_GR; do echo "$l ISO-8859-7" echo "$l.iso-8859-7 ISO-8859-7" echo "$l.cp-869 CP869" echo "$l.cp-1253 CP1253" echo "$l.cp-1253@euro CP1253" echo "$l.utf-8 UTF-8" echo "$l.utf-8@euro UTF-8" done for l in he he_IL iw iw_IL; do echo "$l ISO-8859-8" echo "$l.iso-8859-8 ISO-8859-8" echo "$l.cp-862 CP862" echo "$l.cp-1255 CP1255" echo "$l.utf-8 UTF-8" done for l in tr tr_TR; do echo "$l ISO-8859-9" echo "$l.iso-8859-9 ISO-8859-9" echo "$l.cp-857 CP857" echo "$l.cp-1254 CP1254" echo "$l.utf-8 UTF-8" done for l in lt lt_LT lv lv_LV; do #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name echo "$l ISO-8859-13" done for l in ru_UA uk uk_UA; do echo "$l KOI8-U" done for l in zh zh_CN; do #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name echo "$l GB2312" done for l in ja ja_JP ja_JP.EUC; do echo "$l EUC-JP" done for l in ko ko_KR; do echo "$l EUC-KR" done for l in th th_TH; do echo "$l TIS-620" done for l in fa fa_IR; do #echo "$l ISIRI-3342" # a broken encoding echo "$l.utf-8 UTF-8" done ;; linux* | *-gnu*) # With glibc-2.1 or newer, we don't need any canonicalization, # because glibc has iconv and both glibc and libiconv support all # GNU canonical names directly. Therefore, the Makefile does not # need to install the alias file at all. # The following applies only to glibc-2.0.x and older libcs. echo "ISO_646.IRV:1983 ASCII" ;; aix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "IBM-850 CP850" echo "IBM-856 CP856" echo "IBM-921 ISO-8859-13" echo "IBM-922 CP922" echo "IBM-932 CP932" echo "IBM-943 CP943" echo "IBM-1046 CP1046" echo "IBM-1124 CP1124" echo "IBM-1129 CP1129" echo "IBM-1252 CP1252" echo "IBM-eucCN GB2312" echo "IBM-eucJP EUC-JP" echo "IBM-eucKR EUC-KR" echo "IBM-eucTW EUC-TW" echo "big5 BIG5" echo "GBK GBK" echo "TIS-620 TIS-620" echo "UTF-8 UTF-8" ;; hpux*) echo "iso88591 ISO-8859-1" echo "iso88592 ISO-8859-2" echo "iso88595 ISO-8859-5" echo "iso88596 ISO-8859-6" echo "iso88597 ISO-8859-7" echo "iso88598 ISO-8859-8" echo "iso88599 ISO-8859-9" echo "iso885915 ISO-8859-15" echo "roman8 HP-ROMAN8" echo "arabic8 HP-ARABIC8" echo "greek8 HP-GREEK8" echo "hebrew8 HP-HEBREW8" echo "turkish8 HP-TURKISH8" echo "kana8 HP-KANA8" echo "tis620 TIS-620" echo "big5 BIG5" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "hp15CN GB2312" #echo "ccdc ?" # what is this? echo "SJIS SHIFT_JIS" echo "utf8 UTF-8" ;; irix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-9 ISO-8859-9" echo "eucCN GB2312" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" ;; osf*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "cp850 CP850" echo "big5 BIG5" echo "dechanyu DEC-HANYU" echo "dechanzi GB2312" echo "deckanji DEC-KANJI" echo "deckorean EUC-KR" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "GBK GBK" echo "KSC5601 CP949" echo "sdeckanji EUC-JP" echo "SJIS SHIFT_JIS" echo "TACTIS TIS-620" echo "UTF-8 UTF-8" ;; solaris*) echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-3 ISO-8859-3" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "koi8-r KOI8-R" echo "ansi-1251 CP1251" echo "BIG5 BIG5" echo "Big5-HKSCS BIG5-HKSCS" echo "gb2312 GB2312" echo "GBK GBK" echo "GB18030 GB18030" echo "cns11643 EUC-TW" echo "5601 EUC-KR" echo "ko_KR.johap92 JOHAB" echo "eucJP EUC-JP" echo "PCK SHIFT_JIS" echo "TIS620.2533 TIS-620" #echo "sun_eu_greek ?" # what is this? echo "UTF-8 UTF-8" ;; freebsd* | os2*) # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just # reuse FreeBSD's locale data for OS/2. echo "C ASCII" echo "US-ASCII ASCII" for l in la_LN lt_LN; do echo "$l.ASCII ASCII" done for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do echo "$l.ISO_8859-1 ISO-8859-1" echo "$l.DIS_8859-15 ISO-8859-15" done for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do echo "$l.ISO_8859-2 ISO-8859-2" done for l in la_LN lt_LT; do echo "$l.ISO_8859-4 ISO-8859-4" done for l in ru_RU ru_SU; do echo "$l.KOI8-R KOI8-R" echo "$l.ISO_8859-5 ISO-8859-5" echo "$l.CP866 CP866" done echo "uk_UA.KOI8-U KOI8-U" echo "zh_TW.BIG5 BIG5" echo "zh_TW.Big5 BIG5" echo "zh_CN.EUC GB2312" echo "ja_JP.EUC EUC-JP" echo "ja_JP.SJIS SHIFT_JIS" echo "ja_JP.Shift_JIS SHIFT_JIS" echo "ko_KR.EUC EUC-KR" ;; netbsd*) echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-13 ISO-8859-13" echo "ISO8859-15 ISO-8859-15" echo "eucCN GB2312" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "BIG5 BIG5" echo "SJIS SHIFT_JIS" ;; darwin[56]*) # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "C ASCII" for l in en_AU en_CA en_GB en_US la_LN; do echo "$l.US-ASCII ASCII" done for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \ nl_NL no_NO pt_PT sv_SE; do echo "$l ISO-8859-1" echo "$l.ISO8859-1 ISO-8859-1" echo "$l.ISO8859-15 ISO-8859-15" done for l in la_LN; do echo "$l.ISO8859-1 ISO-8859-1" echo "$l.ISO8859-15 ISO-8859-15" done for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do echo "$l.ISO8859-2 ISO-8859-2" done for l in la_LN lt_LT; do echo "$l.ISO8859-4 ISO-8859-4" done for l in ru_RU; do echo "$l.KOI8-R KOI8-R" echo "$l.ISO8859-5 ISO-8859-5" echo "$l.CP866 CP866" done for l in bg_BG; do echo "$l.CP1251 CP1251" done echo "uk_UA.KOI8-U KOI8-U" echo "zh_TW.BIG5 BIG5" echo "zh_TW.Big5 BIG5" echo "zh_CN.EUC GB2312" echo "ja_JP.EUC EUC-JP" echo "ja_JP.SJIS SHIFT_JIS" echo "ko_KR.EUC EUC-KR" ;; darwin*) # Darwin 7.5 has nl_langinfo(CODESET), but it is useless: # - It returns the empty string when LANG is set to a locale of the # form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8 # LC_CTYPE file. # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by # the system; nl_langinfo(CODESET) returns "US-ASCII" in this case. # - The documentation says: # "... all code that calls BSD system routines should ensure # that the const *char parameters of these routines are in UTF-8 # encoding. All BSD system functions expect their string # parameters to be in UTF-8 encoding and nothing else." # It also says # "An additional caveat is that string parameters for files, # paths, and other file-system entities must be in canonical # UTF-8. In a canonical UTF-8 Unicode string, all decomposable # characters are decomposed ..." # but this is not true: You can pass non-decomposed UTF-8 strings # to file system functions, and it is the OS which will convert # them to decomposed UTF-8 before accessing the file system. # - The Apple Terminal application displays UTF-8 by default. # - However, other applications are free to use different encodings: # - xterm uses ISO-8859-1 by default. # - TextEdit uses MacRoman by default. # We prefer UTF-8 over decomposed UTF-8-MAC because one should # minimize the use of decomposed Unicode. Unfortunately, through the # Darwin file system, decomposed UTF-8 strings are leaked into user # space nevertheless. echo "* UTF-8" ;; beos*) # BeOS has a single locale, and it has UTF-8 encoding. echo "* UTF-8" ;; msdosdjgpp*) # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "#" echo "# The encodings given here may not all be correct." echo "# If you find that the encoding given for your language and" echo "# country is not the one your DOS machine actually uses, just" echo "# correct it in this file, and send a mail to" echo "# Juan Manuel Guerrero " echo "# and Bruno Haible ." echo "#" echo "C ASCII" # ISO-8859-1 languages echo "ca CP850" echo "ca_ES CP850" echo "da CP865" # not CP850 ?? echo "da_DK CP865" # not CP850 ?? echo "de CP850" echo "de_AT CP850" echo "de_CH CP850" echo "de_DE CP850" echo "en CP850" echo "en_AU CP850" # not CP437 ?? echo "en_CA CP850" echo "en_GB CP850" echo "en_NZ CP437" echo "en_US CP437" echo "en_ZA CP850" # not CP437 ?? echo "es CP850" echo "es_AR CP850" echo "es_BO CP850" echo "es_CL CP850" echo "es_CO CP850" echo "es_CR CP850" echo "es_CU CP850" echo "es_DO CP850" echo "es_EC CP850" echo "es_ES CP850" echo "es_GT CP850" echo "es_HN CP850" echo "es_MX CP850" echo "es_NI CP850" echo "es_PA CP850" echo "es_PY CP850" echo "es_PE CP850" echo "es_SV CP850" echo "es_UY CP850" echo "es_VE CP850" echo "et CP850" echo "et_EE CP850" echo "eu CP850" echo "eu_ES CP850" echo "fi CP850" echo "fi_FI CP850" echo "fr CP850" echo "fr_BE CP850" echo "fr_CA CP850" echo "fr_CH CP850" echo "fr_FR CP850" echo "ga CP850" echo "ga_IE CP850" echo "gd CP850" echo "gd_GB CP850" echo "gl CP850" echo "gl_ES CP850" echo "id CP850" # not CP437 ?? echo "id_ID CP850" # not CP437 ?? echo "is CP861" # not CP850 ?? echo "is_IS CP861" # not CP850 ?? echo "it CP850" echo "it_CH CP850" echo "it_IT CP850" echo "lt CP775" echo "lt_LT CP775" echo "lv CP775" echo "lv_LV CP775" echo "nb CP865" # not CP850 ?? echo "nb_NO CP865" # not CP850 ?? echo "nl CP850" echo "nl_BE CP850" echo "nl_NL CP850" echo "nn CP865" # not CP850 ?? echo "nn_NO CP865" # not CP850 ?? echo "no CP865" # not CP850 ?? echo "no_NO CP865" # not CP850 ?? echo "pt CP850" echo "pt_BR CP850" echo "pt_PT CP850" echo "sv CP850" echo "sv_SE CP850" # ISO-8859-2 languages echo "cs CP852" echo "cs_CZ CP852" echo "hr CP852" echo "hr_HR CP852" echo "hu CP852" echo "hu_HU CP852" echo "pl CP852" echo "pl_PL CP852" echo "ro CP852" echo "ro_RO CP852" echo "sk CP852" echo "sk_SK CP852" echo "sl CP852" echo "sl_SI CP852" echo "sq CP852" echo "sq_AL CP852" echo "sr CP852" # CP852 or CP866 or CP855 ?? echo "sr_CS CP852" # CP852 or CP866 or CP855 ?? echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? # ISO-8859-3 languages echo "mt CP850" echo "mt_MT CP850" # ISO-8859-5 languages echo "be CP866" echo "be_BE CP866" echo "bg CP866" # not CP855 ?? echo "bg_BG CP866" # not CP855 ?? echo "mk CP866" # not CP855 ?? echo "mk_MK CP866" # not CP855 ?? echo "ru CP866" echo "ru_RU CP866" echo "uk CP1125" echo "uk_UA CP1125" # ISO-8859-6 languages echo "ar CP864" echo "ar_AE CP864" echo "ar_DZ CP864" echo "ar_EG CP864" echo "ar_IQ CP864" echo "ar_IR CP864" echo "ar_JO CP864" echo "ar_KW CP864" echo "ar_MA CP864" echo "ar_OM CP864" echo "ar_QA CP864" echo "ar_SA CP864" echo "ar_SY CP864" # ISO-8859-7 languages echo "el CP869" echo "el_GR CP869" # ISO-8859-8 languages echo "he CP862" echo "he_IL CP862" # ISO-8859-9 languages echo "tr CP857" echo "tr_TR CP857" # Japanese echo "ja CP932" echo "ja_JP CP932" # Chinese echo "zh_CN GBK" echo "zh_TW CP950" # not CP938 ?? # Korean echo "kr CP949" # not CP934 ?? echo "kr_KR CP949" # not CP934 ?? # Thai echo "th CP874" echo "th_TH CP874" # Other echo "eo CP850" echo "eo_EO CP850" ;; esac sitecopy-0.16.6/intl/printf-parse.c0000644000076400007640000003306010713057340015315 0ustar joejoe/* Formatted output to strings. Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file can be parametrized with the following macros: CHAR_T The element type of the format string. CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters in the format string are ASCII. DIRECTIVE Structure denoting a format directive. Depends on CHAR_T. DIRECTIVES Structure denoting the set of format directives of a format string. Depends on CHAR_T. PRINTF_PARSE Function that parses a format string. Depends on CHAR_T. STATIC Set to 'static' to declare the function static. ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */ #ifndef PRINTF_PARSE # include #endif /* Specification. */ #ifndef PRINTF_PARSE # include "printf-parse.h" #endif /* Default parameters. */ #ifndef PRINTF_PARSE # define PRINTF_PARSE printf_parse # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives #endif /* Get size_t, NULL. */ #include /* Get intmax_t. */ #if defined IN_LIBINTL || defined IN_LIBASPRINTF # if HAVE_STDINT_H_WITH_UINTMAX # include # endif # if HAVE_INTTYPES_H_WITH_UINTMAX # include # endif #else # include #endif /* malloc(), realloc(), free(). */ #include /* errno. */ #include /* Checked size_t computations. */ #include "xsize.h" #if CHAR_T_ONLY_ASCII /* c_isascii(). */ # include "c-ctype.h" #endif #ifdef STATIC STATIC #endif int PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) { const CHAR_T *cp = format; /* pointer into format */ size_t arg_posn = 0; /* number of regular arguments consumed */ size_t d_allocated; /* allocated elements of d->dir */ size_t a_allocated; /* allocated elements of a->arg */ size_t max_width_length = 0; size_t max_precision_length = 0; d->count = 0; d_allocated = 1; d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE)); if (d->dir == NULL) /* Out of memory. */ goto out_of_memory_1; a->count = 0; a_allocated = 0; a->arg = NULL; #define REGISTER_ARG(_index_,_type_) \ { \ size_t n = (_index_); \ if (n >= a_allocated) \ { \ size_t memory_size; \ argument *memory; \ \ a_allocated = xtimes (a_allocated, 2); \ if (a_allocated <= n) \ a_allocated = xsum (n, 1); \ memory_size = xtimes (a_allocated, sizeof (argument)); \ if (size_overflow_p (memory_size)) \ /* Overflow, would lead to out of memory. */ \ goto out_of_memory; \ memory = (argument *) (a->arg \ ? realloc (a->arg, memory_size) \ : malloc (memory_size)); \ if (memory == NULL) \ /* Out of memory. */ \ goto out_of_memory; \ a->arg = memory; \ } \ while (a->count <= n) \ a->arg[a->count++].type = TYPE_NONE; \ if (a->arg[n].type == TYPE_NONE) \ a->arg[n].type = (_type_); \ else if (a->arg[n].type != (_type_)) \ /* Ambiguous type for positional argument. */ \ goto error; \ } while (*cp != '\0') { CHAR_T c = *cp++; if (c == '%') { size_t arg_index = ARG_NONE; DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */ /* Initialize the next directive. */ dp->dir_start = cp - 1; dp->flags = 0; dp->width_start = NULL; dp->width_end = NULL; dp->width_arg_index = ARG_NONE; dp->precision_start = NULL; dp->precision_end = NULL; dp->precision_arg_index = ARG_NONE; dp->arg_index = ARG_NONE; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; arg_index = n - 1; cp = np + 1; } } /* Read the flags. */ for (;;) { if (*cp == '\'') { dp->flags |= FLAG_GROUP; cp++; } else if (*cp == '-') { dp->flags |= FLAG_LEFT; cp++; } else if (*cp == '+') { dp->flags |= FLAG_SHOWSIGN; cp++; } else if (*cp == ' ') { dp->flags |= FLAG_SPACE; cp++; } else if (*cp == '#') { dp->flags |= FLAG_ALT; cp++; } else if (*cp == '0') { dp->flags |= FLAG_ZERO; cp++; } else break; } /* Parse the field width. */ if (*cp == '*') { dp->width_start = cp; cp++; dp->width_end = cp; if (max_width_length < 1) max_width_length = 1; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->width_arg_index = n - 1; cp = np + 1; } } if (dp->width_arg_index == ARG_NONE) { dp->width_arg_index = arg_posn++; if (dp->width_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->width_arg_index, TYPE_INT); } else if (*cp >= '0' && *cp <= '9') { size_t width_length; dp->width_start = cp; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->width_end = cp; width_length = dp->width_end - dp->width_start; if (max_width_length < width_length) max_width_length = width_length; } /* Parse the precision. */ if (*cp == '.') { cp++; if (*cp == '*') { dp->precision_start = cp - 1; cp++; dp->precision_end = cp; if (max_precision_length < 2) max_precision_length = 2; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->precision_arg_index = n - 1; cp = np + 1; } } if (dp->precision_arg_index == ARG_NONE) { dp->precision_arg_index = arg_posn++; if (dp->precision_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->precision_arg_index, TYPE_INT); } else { size_t precision_length; dp->precision_start = cp - 1; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->precision_end = cp; precision_length = dp->precision_end - dp->precision_start; if (max_precision_length < precision_length) max_precision_length = precision_length; } } { arg_type type; /* Parse argument type/size specifiers. */ { int flags = 0; for (;;) { if (*cp == 'h') { flags |= (1 << (flags & 1)); cp++; } else if (*cp == 'L') { flags |= 4; cp++; } else if (*cp == 'l') { flags += 8; cp++; } else if (*cp == 'j') { if (sizeof (intmax_t) > sizeof (long)) { /* intmax_t = long long */ flags += 16; } else if (sizeof (intmax_t) > sizeof (int)) { /* intmax_t = long */ flags += 8; } cp++; } else if (*cp == 'z' || *cp == 'Z') { /* 'z' is standardized in ISO C 99, but glibc uses 'Z' because the warning facility in gcc-2.95.2 understands only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ if (sizeof (size_t) > sizeof (long)) { /* size_t = long long */ flags += 16; } else if (sizeof (size_t) > sizeof (int)) { /* size_t = long */ flags += 8; } cp++; } else if (*cp == 't') { if (sizeof (ptrdiff_t) > sizeof (long)) { /* ptrdiff_t = long long */ flags += 16; } else if (sizeof (ptrdiff_t) > sizeof (int)) { /* ptrdiff_t = long */ flags += 8; } cp++; } else break; } /* Read the conversion character. */ c = *cp++; switch (c) { case 'd': case 'i': #if HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; else #endif /* If 'long long' exists and is the same as 'long', we parse "lld" into TYPE_LONGINT. */ if (flags >= 8) type = TYPE_LONGINT; else if (flags & 2) type = TYPE_SCHAR; else if (flags & 1) type = TYPE_SHORT; else type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': #if HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; else #endif /* If 'unsigned long long' exists and is the same as 'unsigned long', we parse "llu" into TYPE_ULONGINT. */ if (flags >= 8) type = TYPE_ULONGINT; else if (flags & 2) type = TYPE_UCHAR; else if (flags & 1) type = TYPE_USHORT; else type = TYPE_UINT; break; case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': if (flags >= 16 || (flags & 4)) type = TYPE_LONGDOUBLE; else type = TYPE_DOUBLE; break; case 'c': if (flags >= 8) #if HAVE_WINT_T type = TYPE_WIDE_CHAR; #else goto error; #endif else type = TYPE_CHAR; break; #if HAVE_WINT_T case 'C': type = TYPE_WIDE_CHAR; c = 'c'; break; #endif case 's': if (flags >= 8) #if HAVE_WCHAR_T type = TYPE_WIDE_STRING; #else goto error; #endif else type = TYPE_STRING; break; #if HAVE_WCHAR_T case 'S': type = TYPE_WIDE_STRING; c = 's'; break; #endif case 'p': type = TYPE_POINTER; break; case 'n': #if HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; else #endif /* If 'long long' exists and is the same as 'long', we parse "lln" into TYPE_COUNT_LONGINT_POINTER. */ if (flags >= 8) type = TYPE_COUNT_LONGINT_POINTER; else if (flags & 2) type = TYPE_COUNT_SCHAR_POINTER; else if (flags & 1) type = TYPE_COUNT_SHORT_POINTER; else type = TYPE_COUNT_INT_POINTER; break; #if ENABLE_UNISTDIO /* The unistdio extensions. */ case 'U': if (flags >= 16) type = TYPE_U32_STRING; else if (flags >= 8) type = TYPE_U16_STRING; else type = TYPE_U8_STRING; break; #endif case '%': type = TYPE_NONE; break; default: /* Unknown conversion character. */ goto error; } } if (type != TYPE_NONE) { dp->arg_index = arg_index; if (dp->arg_index == ARG_NONE) { dp->arg_index = arg_posn++; if (dp->arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->arg_index, type); } dp->conversion = c; dp->dir_end = cp; } d->count++; if (d->count >= d_allocated) { size_t memory_size; DIRECTIVE *memory; d_allocated = xtimes (d_allocated, 2); memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); if (size_overflow_p (memory_size)) /* Overflow, would lead to out of memory. */ goto out_of_memory; memory = (DIRECTIVE *) realloc (d->dir, memory_size); if (memory == NULL) /* Out of memory. */ goto out_of_memory; d->dir = memory; } } #if CHAR_T_ONLY_ASCII else if (!c_isascii (c)) { /* Non-ASCII character. Not supported. */ goto error; } #endif } d->dir[d->count].dir_start = cp; d->max_width_length = max_width_length; d->max_precision_length = max_precision_length; return 0; error: if (a->arg) free (a->arg); if (d->dir) free (d->dir); errno = EINVAL; return -1; out_of_memory: if (a->arg) free (a->arg); if (d->dir) free (d->dir); out_of_memory_1: errno = ENOMEM; return -1; } #undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T_ONLY_ASCII #undef CHAR_T sitecopy-0.16.6/intl/relocatable.h0000644000076400007640000000543210271667672015205 0ustar joejoe/* Provide relocatable packages. Copyright (C) 2003, 2005 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _RELOCATABLE_H #define _RELOCATABLE_H #ifdef __cplusplus extern "C" { #endif /* This can be enabled through the configure --enable-relocatable option. */ #if ENABLE_RELOCATABLE /* When building a DLL, we must export some functions. Note that because this is a private .h file, we don't need to use __declspec(dllimport) in any case. */ #if HAVE_VISIBILITY && BUILDING_DLL # define RELOCATABLE_DLL_EXPORTED __attribute__((__visibility__("default"))) #elif defined _MSC_VER && BUILDING_DLL # define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) #else # define RELOCATABLE_DLL_EXPORTED #endif /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ extern RELOCATABLE_DLL_EXPORTED void set_relocation_prefix (const char *orig_prefix, const char *curr_prefix); /* Returns the pathname, relocated according to the current installation directory. */ extern const char * relocate (const char *pathname); /* Memory management: relocate() leaks memory, because it has to construct a fresh pathname. If this is a problem because your program calls relocate() frequently, think about caching the result. */ /* Convenience function: Computes the current installation prefix, based on the original installation prefix, the original installation directory of a particular file, and the current pathname of this file. Returns NULL upon failure. */ extern const char * compute_curr_prefix (const char *orig_installprefix, const char *orig_installdir, const char *curr_pathname); #else /* By default, we use the hardwired pathnames. */ #define relocate(pathname) (pathname) #endif #ifdef __cplusplus } #endif #endif /* _RELOCATABLE_H */ sitecopy-0.16.6/intl/ngettext.c0000644000076400007640000000367410243450466014561 0ustar joejoe/* Implementation of ngettext(3) function. Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include /* @@ 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 NGETTEXT __ngettext # define DCNGETTEXT __dcngettext #else # define NGETTEXT libintl_ngettext # define DCNGETTEXT libintl_dcngettext #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 * NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n) { return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__ngettext, ngettext); #endif sitecopy-0.16.6/intl/plural-exp.c0000644000076400007640000000773210704164630015004 0ustar joejoe/* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003, 2005-2007 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "plural-exp.h" #if (defined __GNUC__ && !(__APPLE_CC__ > 1) && !defined __cplusplus) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) /* These structs are the constant expression for the germanic plural form determination. It represents the expression "n != 1". */ static const struct expression plvar = { .nargs = 0, .operation = var, }; static const struct expression plone = { .nargs = 0, .operation = num, .val = { .num = 1 } }; struct expression GERMANIC_PLURAL = { .nargs = 2, .operation = not_equal, .val = { .args = { [0] = (struct expression *) &plvar, [1] = (struct expression *) &plone } } }; # define INIT_GERMANIC_PLURAL() #else /* For compilers without support for ISO C 99 struct/union initializers: Initialization at run-time. */ static struct expression plvar; static struct expression plone; struct expression GERMANIC_PLURAL; static void init_germanic_plural () { if (plone.val.num == 0) { plvar.nargs = 0; plvar.operation = var; plone.nargs = 0; plone.operation = num; plone.val.num = 1; GERMANIC_PLURAL.nargs = 2; GERMANIC_PLURAL.operation = not_equal; GERMANIC_PLURAL.val.args[0] = &plvar; GERMANIC_PLURAL.val.args[1] = &plone; } } # define INIT_GERMANIC_PLURAL() init_germanic_plural () #endif void internal_function EXTRACT_PLURAL_EXPRESSION (const char *nullentry, const struct expression **pluralp, unsigned long int *npluralsp) { if (nullentry != NULL) { const char *plural; const char *nplurals; plural = strstr (nullentry, "plural="); nplurals = strstr (nullentry, "nplurals="); if (plural == NULL || nplurals == NULL) goto no_plural; else { char *endp; unsigned long int n; struct parse_args args; /* First get the number. */ nplurals += 9; while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) ++nplurals; if (!(*nplurals >= '0' && *nplurals <= '9')) goto no_plural; #if defined HAVE_STRTOUL || defined _LIBC n = strtoul (nplurals, &endp, 10); #else for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++) n = n * 10 + (*endp - '0'); #endif if (nplurals == endp) goto no_plural; *npluralsp = n; /* Due to the restrictions bison imposes onto the interface of the scanner function we have to put the input string and the result passed up from the parser into the same structure which address is passed down to the parser. */ plural += 7; args.cp = plural; if (PLURAL_PARSE (&args) != 0) goto no_plural; *pluralp = args.res; } } else { /* By default we are using the Germanic form: singular form only for `one', the plural form otherwise. Yes, this is also what English is using since English is a Germanic language. */ no_plural: INIT_GERMANIC_PLURAL (); *pluralp = &GERMANIC_PLURAL; *npluralsp = 2; } } sitecopy-0.16.6/intl/gmo.h0000644000076400007640000001151210521642220013462 0ustar joejoe/* Description of GNU message catalog format: general file layout. Copyright (C) 1995, 1997, 2000-2002, 2004, 2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETTEXT_H #define _GETTEXT_H 1 #include /* @@ 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 #define MO_REVISION_NUMBER_WITH_SYSDEP_I 1 /* 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 as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work when cross-compiling. */ #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 following are only used in .mo files with major revision 0 or 1. */ /* 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 translated strings. */ nls_uint32 trans_tab_offset; /* Size of hash table. */ nls_uint32 hash_tab_size; /* Offset of first hash table entry. */ nls_uint32 hash_tab_offset; /* The following are only used in .mo files with minor revision >= 1. */ /* The number of system dependent segments. */ nls_uint32 n_sysdep_segments; /* Offset of table describing system dependent segments. */ nls_uint32 sysdep_segments_offset; /* The number of system dependent strings pairs. */ nls_uint32 n_sysdep_strings; /* Offset of table with start offsets of original sysdep strings. */ nls_uint32 orig_sysdep_tab_offset; /* Offset of table with start offsets of translated sysdep strings. */ nls_uint32 trans_sysdep_tab_offset; }; /* Descriptor for static string contained in the binary .mo file. */ struct string_desc { /* Length of addressed string, not including the trailing NUL. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* The following are only used in .mo files with minor revision >= 1. */ /* Descriptor for system dependent string segment. */ struct sysdep_segment { /* Length of addressed string, including the trailing NUL. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* Pair of a static and a system dependent segment, in struct sysdep_string. */ struct segment_pair { /* Size of static segment. */ nls_uint32 segsize; /* Reference to system dependent string segment, or ~0 at the end. */ nls_uint32 sysdepref; }; /* Descriptor for system dependent string. */ struct sysdep_string { /* Offset of static string segments in file. */ nls_uint32 offset; /* Alternating sequence of static and system dependent segments. The last segment is a static segment, including the trailing NUL. */ struct segment_pair segments[1]; }; /* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF, regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */ #define SEGMENTS_END ((nls_uint32) ~0) /* @@ begin of epilog @@ */ #endif /* gettext.h */ sitecopy-0.16.6/intl/dcigettext.c0000644000076400007640000013334510706716545015071 0ustar joejoe/* Implementation of the internal dcigettext function. Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif /* NL_LOCALE_NAME does not work in glibc-2.4. Ignore it. */ #undef HAVE_NL_LOCALE_NAME #include #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #ifndef errno extern int errno; #endif #ifndef __set_errno # define __set_errno(val) errno = (val) #endif #include #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include #ifdef _LIBC /* Guess whether integer division by zero raises signal SIGFPE. Set to 1 only if you know for sure. In case of doubt, set to 0. */ # if defined __alpha__ || defined __arm__ || defined __i386__ \ || defined __m68k__ || defined __s390__ # define INTDIV0_RAISES_SIGFPE 1 # else # define INTDIV0_RAISES_SIGFPE 0 # endif #endif #if !INTDIV0_RAISES_SIGFPE # include #endif #if defined HAVE_SYS_PARAM_H || defined _LIBC # include #endif #if !defined _LIBC # if HAVE_NL_LOCALE_NAME # include # endif # include "localcharset.h" #endif #include "gettextP.h" #include "plural-exp.h" #ifdef _LIBC # include #else # ifdef IN_LIBGLOCALE # include # endif # include "libgnuintl.h" #endif #include "hash-string.h" /* Handle multi-threaded applications. */ #ifdef _LIBC # include # define gl_rwlock_define_initialized __libc_rwlock_define_initialized # define gl_rwlock_rdlock __libc_rwlock_rdlock # define gl_rwlock_wrlock __libc_rwlock_wrlock # define gl_rwlock_unlock __libc_rwlock_unlock #else # include "lock.h" #endif /* Alignment of types. */ #if defined __GNUC__ && __GNUC__ >= 2 # define alignof(TYPE) __alignof__ (TYPE) #else # define alignof(TYPE) \ ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #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 getcwd __getcwd # ifndef stpcpy # define stpcpy __stpcpy # endif # define tfind __tfind #else # if !defined HAVE_GETCWD char *getwd (); # define getcwd(buf, max) getwd (buf) # else # if VMS # define getcwd(buf, max) (getcwd) (buf, max, 0) # else char *getcwd (); # endif # endif # ifndef HAVE_STPCPY static char *stpcpy (char *dest, const char *src); # endif # ifndef HAVE_MEMPCPY static void *mempcpy (void *dest, const void *src, size_t n); # endif #endif /* Use a replacement if the system does not provide the `tsearch' function family. */ #if HAVE_TSEARCH || defined _LIBC # include #else # define tsearch libintl_tsearch # define tfind libintl_tfind # define tdelete libintl_tdelete # define twalk libintl_twalk # include "tsearch.h" #endif #ifdef _LIBC # define tsearch __tsearch #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 /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) #endif /* Whether to support different locales in different threads. */ #if defined _LIBC || HAVE_NL_LOCALE_NAME || (HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS) || defined IN_LIBGLOCALE # define HAVE_PER_THREAD_LOCALE #endif /* This is the type used for the search tree where known translations are stored. */ struct known_translation_t { /* Domain in which to search. */ const char *domainname; /* The category. */ int category; #ifdef HAVE_PER_THREAD_LOCALE /* Name of the relevant locale category, or "" for the global locale. */ const char *localename; #endif #ifdef IN_LIBGLOCALE /* The character encoding. */ const char *encoding; #endif /* State of the catalog counter at the point the string was found. */ int counter; /* Catalog where the string was found. */ struct loaded_l10nfile *domain; /* And finally the translation. */ const char *translation; size_t translation_length; /* Pointer to the string in question. */ char msgid[ZERO]; }; gl_rwlock_define_initialized (static, tree_lock) /* Root of the search tree with known translations. */ static void *root; /* Function to compare two entries in the table of known translations. */ static int transcmp (const void *p1, const void *p2) { const struct known_translation_t *s1; const struct known_translation_t *s2; int result; s1 = (const struct known_translation_t *) p1; s2 = (const struct known_translation_t *) p2; result = strcmp (s1->msgid, s2->msgid); if (result == 0) { result = strcmp (s1->domainname, s2->domainname); if (result == 0) { #ifdef HAVE_PER_THREAD_LOCALE result = strcmp (s1->localename, s2->localename); if (result == 0) #endif { #ifdef IN_LIBGLOCALE result = strcmp (s1->encoding, s2->encoding); if (result == 0) #endif /* We compare the category last (though this is the cheapest operation) since it is hopefully always the same (namely LC_MESSAGES). */ result = s1->category - s2->category; } } } return result; } /* 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[] attribute_hidden = "messages"; #ifndef IN_LIBGLOCALE /* Value used as the default domain for gettext(3). */ const char *_nl_current_default_domain attribute_hidden = _nl_default_default_domain; #endif /* Contains the default location of the message catalogs. */ #if defined __EMX__ extern const char _nl_default_dirname[]; #else # ifdef _LIBC extern const char _nl_default_dirname[]; libc_hidden_proto (_nl_default_dirname) # endif const char _nl_default_dirname[] = LOCALEDIR; # ifdef _LIBC libc_hidden_data_def (_nl_default_dirname) # endif #endif #ifndef IN_LIBGLOCALE /* List with bindings of specific domains created by bindtextdomain() calls. */ struct binding *_nl_domain_bindings; #endif /* Prototypes for local functions. */ static char *plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, const char *translation, size_t translation_len) internal_function; #ifdef IN_LIBGLOCALE static const char *guess_category_value (int category, const char *categoryname, const char *localename) internal_function; #else static const char *guess_category_value (int category, const char *categoryname) internal_function; #endif #ifdef _LIBC # include "../locale/localeinfo.h" # define category_to_name(category) \ _nl_category_names.str + _nl_category_name_idxs[category] #else static const char *category_to_name (int category) internal_function; #endif #if (defined _LIBC || HAVE_ICONV) && !defined IN_LIBGLOCALE static const char *get_output_charset (struct binding *domainbinding) internal_function; #endif /* For those loosing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA /* Nothing has to be done. */ # define freea(p) /* nothing */ # define ADD_BLOCK(list, address) /* nothing */ # define FREE_BLOCKS(list) /* nothing */ #else struct block_list { void *address; struct block_list *next; }; # define ADD_BLOCK(list, addr) \ do { \ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ /* If we cannot get a free block we cannot add the new element to \ the list. */ \ if (newp != NULL) { \ newp->address = (addr); \ newp->next = (list); \ (list) = newp; \ } \ } while (0) # define FREE_BLOCKS(list) \ do { \ while (list != NULL) { \ struct block_list *old = list; \ list = list->next; \ free (old->address); \ free (old); \ } \ } while (0) # undef alloca # define alloca(size) (malloc (size)) # define freea(p) free (p) #endif /* have alloca */ #ifdef _LIBC /* List of blocks allocated for translations. */ typedef struct transmem_list { struct transmem_list *next; char data[ZERO]; } transmem_block_t; static struct transmem_list *transmem_list; #else typedef unsigned char transmem_block_t; #endif /* 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 DCIGETTEXT __dcigettext #else # define DCIGETTEXT libintl_dcigettext #endif /* Lock variable to protect the global data in the gettext implementation. */ gl_rwlock_define_initialized (, _nl_state_lock attribute_hidden) /* Checking whether the binaries runs SUID must be done and glibc provides easier methods therefore we make a difference here. */ #ifdef _LIBC # define ENABLE_SECURE __libc_enable_secure # define DETERMINE_SECURE #else # ifndef HAVE_GETUID # define getuid() 0 # endif # ifndef HAVE_GETGID # define getgid() 0 # endif # ifndef HAVE_GETEUID # define geteuid() getuid() # endif # ifndef HAVE_GETEGID # define getegid() getgid() # endif static int enable_secure; # define ENABLE_SECURE (enable_secure == 1) # define DETERMINE_SECURE \ if (enable_secure == 0) \ { \ if (getuid () != geteuid () || getgid () != getegid ()) \ enable_secure = 1; \ else \ enable_secure = -1; \ } #endif /* Get the function to evaluate the plural expression. */ #include "eval-plural.h" /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale and, if PLURAL is nonzero, search over string depending on the plural form determined by N. */ #ifdef IN_LIBGLOCALE char * gl_dcigettext (const char *domainname, const char *msgid1, const char *msgid2, int plural, unsigned long int n, int category, const char *localename, const char *encoding) #else char * DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, int plural, unsigned long int n, int category) #endif { #ifndef HAVE_ALLOCA struct block_list *block_list = NULL; #endif struct loaded_l10nfile *domain; struct binding *binding; const char *categoryname; const char *categoryvalue; const char *dirname; char *xdomainname; char *single_locale; char *retval; size_t retlen; int saved_errno; struct known_translation_t *search; struct known_translation_t **foundp = NULL; size_t msgid_len; #if defined HAVE_PER_THREAD_LOCALE && !defined IN_LIBGLOCALE const char *localename; #endif size_t domainname_len; /* If no real MSGID is given return NULL. */ if (msgid1 == NULL) return NULL; #ifdef _LIBC if (category < 0 || category >= __LC_LAST || category == LC_ALL) /* Bogus. */ return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); #endif /* Preserve the `errno' value. */ saved_errno = errno; gl_rwlock_rdlock (_nl_state_lock); /* 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 definition left this undefined. */ if (domainname == NULL) domainname = _nl_current_default_domain; /* OS/2 specific: backward compatibility with older libintl versions */ #ifdef LC_MESSAGES_COMPAT if (category == LC_MESSAGES_COMPAT) category = LC_MESSAGES; #endif msgid_len = strlen (msgid1) + 1; /* Try to find the translation among those which we found at some time. */ search = (struct known_translation_t *) alloca (offsetof (struct known_translation_t, msgid) + msgid_len); memcpy (search->msgid, msgid1, msgid_len); search->domainname = domainname; search->category = category; #ifdef HAVE_PER_THREAD_LOCALE # ifndef IN_LIBGLOCALE # ifdef _LIBC localename = __current_locale_name (category); # else # if HAVE_NL_LOCALE_NAME /* NL_LOCALE_NAME is public glibc API introduced in glibc-2.4. */ localename = nl_langinfo (NL_LOCALE_NAME (category)); # else # if HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS /* The __names field is not public glibc API and must therefore not be used in code that is installed in public locations. */ { locale_t thread_locale = uselocale (NULL); if (thread_locale != LC_GLOBAL_LOCALE) localename = thread_locale->__names[category]; else localename = ""; } # endif # endif # endif # endif search->localename = localename; # ifdef IN_LIBGLOCALE search->encoding = encoding; # endif /* Since tfind/tsearch manage a balanced tree, concurrent tfind and tsearch calls can be fatal. */ gl_rwlock_rdlock (tree_lock); foundp = (struct known_translation_t **) tfind (search, &root, transcmp); gl_rwlock_unlock (tree_lock); freea (search); if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr) { /* Now deal with plural. */ if (plural) retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation, (*foundp)->translation_length); else retval = (char *) (*foundp)->translation; gl_rwlock_unlock (_nl_state_lock); __set_errno (saved_errno); return retval; } #endif /* See whether this is a SUID binary or not. */ DETERMINE_SECURE; /* First find matching binding. */ #ifdef IN_LIBGLOCALE /* We can use a trivial binding, since _nl_find_msg will ignore it anyway, and _nl_load_domain and _nl_find_domain just pass it through. */ binding = NULL; dirname = bindtextdomain (domainname, NULL); #else 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 = _nl_default_dirname; else { dirname = binding->dirname; #endif if (!IS_ABSOLUTE_PATH (dirname)) { /* We have a relative path. Make it absolute now. */ size_t dirname_len = strlen (dirname) + 1; size_t path_max; char *resolved_dirname; char *ret; path_max = (unsigned int) PATH_MAX; path_max += 2; /* The getcwd docs say to do this. */ for (;;) { resolved_dirname = (char *) alloca (path_max + dirname_len); ADD_BLOCK (block_list, tmp_dirname); __set_errno (0); ret = getcwd (resolved_dirname, path_max); if (ret != NULL || errno != ERANGE) break; path_max += path_max / 2; path_max += PATH_INCR; } if (ret == NULL) /* We cannot get the current working directory. Don't signal an error but simply return the default string. */ goto return_untranslated; stpcpy (stpcpy (strchr (resolved_dirname, '\0'), "/"), dirname); dirname = resolved_dirname; } #ifndef IN_LIBGLOCALE } #endif /* Now determine the symbolic name of CATEGORY and its value. */ categoryname = category_to_name (category); #ifdef IN_LIBGLOCALE categoryvalue = guess_category_value (category, categoryname, localename); #else categoryvalue = guess_category_value (category, categoryname); #endif domainname_len = strlen (domainname); xdomainname = (char *) alloca (strlen (categoryname) + domainname_len + 5); ADD_BLOCK (block_list, xdomainname); stpcpy ((char *) mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), domainname, domainname_len), ".mo"); /* Creating working area. */ single_locale = (char *) alloca (strlen (categoryvalue) + 1); ADD_BLOCK (block_list, single_locale); /* Search for the given string. This is a loop because we perhaps got an ordered list of languages to consider for the 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 implicitly 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'; /* When this is a SUID binary we must not allow accessing files outside the dedicated directories. */ if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale)) /* Ingore this entry. */ continue; } /* 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) break; /* Find structure describing the message catalog matching the DOMAINNAME and CATEGORY. */ domain = _nl_find_domain (dirname, single_locale, xdomainname, binding); if (domain != NULL) { #if defined IN_LIBGLOCALE retval = _nl_find_msg (domain, binding, encoding, msgid1, &retlen); #else retval = _nl_find_msg (domain, binding, msgid1, 1, &retlen); #endif if (retval == NULL) { int cnt; for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) { #if defined IN_LIBGLOCALE retval = _nl_find_msg (domain->successor[cnt], binding, encoding, msgid1, &retlen); #else retval = _nl_find_msg (domain->successor[cnt], binding, msgid1, 1, &retlen); #endif if (retval != NULL) { domain = domain->successor[cnt]; break; } } } /* Returning -1 means that some resource problem exists (likely memory) and that the strings could not be converted. Return the original strings. */ if (__builtin_expect (retval == (char *) -1, 0)) break; if (retval != NULL) { /* Found the translation of MSGID1 in domain DOMAIN: starting at RETVAL, RETLEN bytes. */ FREE_BLOCKS (block_list); if (foundp == NULL) { /* Create a new entry and add it to the search tree. */ size_t size; struct known_translation_t *newp; size = offsetof (struct known_translation_t, msgid) + msgid_len + domainname_len + 1; #ifdef HAVE_PER_THREAD_LOCALE size += strlen (localename) + 1; #endif newp = (struct known_translation_t *) malloc (size); if (newp != NULL) { char *new_domainname; #ifdef HAVE_PER_THREAD_LOCALE char *new_localename; #endif new_domainname = (char *) mempcpy (newp->msgid, msgid1, msgid_len); memcpy (new_domainname, domainname, domainname_len + 1); #ifdef HAVE_PER_THREAD_LOCALE new_localename = new_domainname + domainname_len + 1; strcpy (new_localename, localename); #endif newp->domainname = new_domainname; newp->category = category; #ifdef HAVE_PER_THREAD_LOCALE newp->localename = new_localename; #endif #ifdef IN_LIBGLOCALE newp->encoding = encoding; #endif newp->counter = _nl_msg_cat_cntr; newp->domain = domain; newp->translation = retval; newp->translation_length = retlen; gl_rwlock_wrlock (tree_lock); /* Insert the entry in the search tree. */ foundp = (struct known_translation_t **) tsearch (newp, &root, transcmp); gl_rwlock_unlock (tree_lock); if (foundp == NULL || __builtin_expect (*foundp != newp, 0)) /* The insert failed. */ free (newp); } } else { /* We can update the existing entry. */ (*foundp)->counter = _nl_msg_cat_cntr; (*foundp)->domain = domain; (*foundp)->translation = retval; (*foundp)->translation_length = retlen; } __set_errno (saved_errno); /* Now deal with plural. */ if (plural) retval = plural_lookup (domain, n, retval, retlen); gl_rwlock_unlock (_nl_state_lock); return retval; } } } return_untranslated: /* Return the untranslated MSGID. */ FREE_BLOCKS (block_list); gl_rwlock_unlock (_nl_state_lock); #ifndef _LIBC if (!ENABLE_SECURE) { extern void _nl_log_untranslated (const char *logfilename, const char *domainname, const char *msgid1, const char *msgid2, int plural); const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED"); if (logfilename != NULL && logfilename[0] != '\0') _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural); } #endif __set_errno (saved_errno); return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); } /* Look up the translation of msgid within DOMAIN_FILE and DOMAINBINDING. Return it if found. Return NULL if not found or in case of a conversion failure (problem in the particular message catalog). Return (char *) -1 in case of a memory allocation failure during conversion (only if ENCODING != NULL resp. CONVERT == true). */ char * internal_function #ifdef IN_LIBGLOCALE _nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *encoding, const char *msgid, size_t *lengthp) #else _nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, int convert, size_t *lengthp) #endif { struct loaded_domain *domain; nls_uint32 nstrings; size_t act; char *result; size_t resultlen; if (domain_file->decided <= 0) _nl_load_domain (domain_file, domainbinding); if (domain_file->data == NULL) return NULL; domain = (struct loaded_domain *) domain_file->data; nstrings = domain->nstrings; /* Locate the MSGID and its translation. */ if (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)); while (1) { nls_uint32 nstr = W (domain->must_swap_hash_tab, domain->hash_tab[idx]); if (nstr == 0) /* Hash table entry is empty. */ return NULL; nstr--; /* Compare msgid with the original string at index nstr. We compare the lengths with >=, not ==, because plural entries are represented by strings with an embedded NUL. */ if (nstr < nstrings ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len && (strcmp (msgid, domain->data + W (domain->must_swap, domain->orig_tab[nstr].offset)) == 0) : domain->orig_sysdep_tab[nstr - nstrings].length > len && (strcmp (msgid, domain->orig_sysdep_tab[nstr - nstrings].pointer) == 0)) { act = nstr; goto found; } if (idx >= domain->hash_size - incr) idx -= domain->hash_size - incr; else idx += incr; } /* NOTREACHED */ } else { /* Try the default method: binary search in the sorted array of messages. */ size_t top, bottom; bottom = 0; top = 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 goto found; } /* No translation was found. */ return NULL; } found: /* The translation was found at index ACT. If we have to convert the string to use a different character set, this is the time. */ if (act < nstrings) { result = (char *) (domain->data + W (domain->must_swap, domain->trans_tab[act].offset)); resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1; } else { result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer; resultlen = domain->trans_sysdep_tab[act - nstrings].length; } #if defined _LIBC || HAVE_ICONV # ifdef IN_LIBGLOCALE if (encoding != NULL) # else if (convert) # endif { /* We are supposed to do a conversion. */ # ifndef IN_LIBGLOCALE const char *encoding = get_output_charset (domainbinding); # endif size_t nconversions; struct converted_domain *convd; size_t i; /* Protect against reallocation of the table. */ gl_rwlock_rdlock (domain->conversions_lock); /* Search whether a table with converted translations for this encoding has already been allocated. */ nconversions = domain->nconversions; convd = NULL; for (i = nconversions; i > 0; ) { i--; if (strcmp (domain->conversions[i].encoding, encoding) == 0) { convd = &domain->conversions[i]; break; } } gl_rwlock_unlock (domain->conversions_lock); if (convd == NULL) { /* We have to allocate a new conversions table. */ gl_rwlock_wrlock (domain->conversions_lock); /* Maybe in the meantime somebody added the translation. Recheck. */ for (i = nconversions; i > 0; ) { i--; if (strcmp (domain->conversions[i].encoding, encoding) == 0) { convd = &domain->conversions[i]; goto found_convd; } } { /* Allocate a table for the converted translations for this encoding. */ struct converted_domain *new_conversions = (struct converted_domain *) (domain->conversions != NULL ? realloc (domain->conversions, (nconversions + 1) * sizeof (struct converted_domain)) : malloc ((nconversions + 1) * sizeof (struct converted_domain))); if (__builtin_expect (new_conversions == NULL, 0)) { /* Nothing we can do, no more memory. We cannot use the translation because it might be encoded incorrectly. */ unlock_fail: gl_rwlock_unlock (domain->conversions_lock); return (char *) -1; } domain->conversions = new_conversions; /* Copy the 'encoding' string to permanent storage. */ encoding = strdup (encoding); if (__builtin_expect (encoding == NULL, 0)) /* Nothing we can do, no more memory. We cannot use the translation because it might be encoded incorrectly. */ goto unlock_fail; convd = &new_conversions[nconversions]; convd->encoding = encoding; /* Find out about the character set the file is encoded with. This can be found (in textual form) in the entry "". If this entry does not exist or if this does not contain the 'charset=' information, we will assume the charset matches the one the current locale and we don't have to perform any conversion. */ # ifdef _LIBC convd->conv = (__gconv_t) -1; # else # if HAVE_ICONV convd->conv = (iconv_t) -1; # endif # endif { char *nullentry; size_t nullentrylen; /* Get the header entry. This is a recursion, but it doesn't reallocate domain->conversions because we pass encoding = NULL or convert = 0, respectively. */ nullentry = # ifdef IN_LIBGLOCALE _nl_find_msg (domain_file, domainbinding, NULL, "", &nullentrylen); # else _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); # endif if (nullentry != NULL) { const char *charsetstr; charsetstr = strstr (nullentry, "charset="); if (charsetstr != NULL) { size_t len; char *charset; const char *outcharset; charsetstr += strlen ("charset="); len = strcspn (charsetstr, " \t\n"); charset = (char *) alloca (len + 1); # if defined _LIBC || HAVE_MEMPCPY *((char *) mempcpy (charset, charsetstr, len)) = '\0'; # else memcpy (charset, charsetstr, len); charset[len] = '\0'; # endif outcharset = encoding; # ifdef _LIBC /* We always want to use transliteration. */ outcharset = norm_add_slashes (outcharset, "TRANSLIT"); charset = norm_add_slashes (charset, ""); int r = __gconv_open (outcharset, charset, &convd->conv, GCONV_AVOID_NOCONV); if (__builtin_expect (r != __GCONV_OK, 0)) { /* If the output encoding is the same there is nothing to do. Otherwise do not use the translation at all. */ if (__builtin_expect (r != __GCONV_NULCONV, 1)) { gl_rwlock_unlock (domain->conversions_lock); free ((char *) encoding); return NULL; } convd->conv = (__gconv_t) -1; } # else # if HAVE_ICONV /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5, we want to use transliteration. */ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ || _LIBICONV_VERSION >= 0x0105 if (strchr (outcharset, '/') == NULL) { char *tmp; len = strlen (outcharset); tmp = (char *) alloca (len + 10 + 1); memcpy (tmp, outcharset, len); memcpy (tmp + len, "//TRANSLIT", 10 + 1); outcharset = tmp; convd->conv = iconv_open (outcharset, charset); freea (outcharset); } else # endif convd->conv = iconv_open (outcharset, charset); # endif # endif freea (charset); } } } convd->conv_tab = NULL; /* Here domain->conversions is still == new_conversions. */ domain->nconversions++; } found_convd: gl_rwlock_unlock (domain->conversions_lock); } if ( # ifdef _LIBC convd->conv != (__gconv_t) -1 # else # if HAVE_ICONV convd->conv != (iconv_t) -1 # endif # endif ) { /* We are supposed to do a conversion. First allocate an appropriate table with the same structure as the table of translations in the file, where we can put the pointers to the converted strings in. There is a slight complication with plural entries. They are represented by consecutive NUL terminated strings. We handle this case by converting RESULTLEN bytes, including NULs. */ if (convd->conv_tab == NULL && ((convd->conv_tab = (char **) calloc (nstrings + domain->n_sysdep_strings, sizeof (char *))) == NULL)) /* Mark that we didn't succeed allocating a table. */ convd->conv_tab = (char **) -1; if (__builtin_expect (convd->conv_tab == (char **) -1, 0)) /* Nothing we can do, no more memory. We cannot use the translation because it might be encoded incorrectly. */ return (char *) -1; if (convd->conv_tab[act] == NULL) { /* We haven't used this string so far, so it is not translated yet. Do this now. */ /* We use a bit more efficient memory handling. We allocate always larger blocks which get used over time. This is faster than many small allocations. */ __libc_lock_define_initialized (static, lock) # define INITIAL_BLOCK_SIZE 4080 static unsigned char *freemem; static size_t freemem_size; const unsigned char *inbuf; unsigned char *outbuf; int malloc_count; # ifndef _LIBC transmem_block_t *transmem_list = NULL; # endif __libc_lock_lock (lock); inbuf = (const unsigned char *) result; outbuf = freemem + sizeof (size_t); malloc_count = 0; while (1) { transmem_block_t *newmem; # ifdef _LIBC size_t non_reversible; int res; if (freemem_size < sizeof (size_t)) goto resize_freemem; res = __gconv (convd->conv, &inbuf, inbuf + resultlen, &outbuf, outbuf + freemem_size - sizeof (size_t), &non_reversible); if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT) break; if (res != __GCONV_FULL_OUTPUT) { /* We should not use the translation at all, it is incorrectly encoded. */ __libc_lock_unlock (lock); return NULL; } inbuf = (const unsigned char *) result; # else # if HAVE_ICONV const char *inptr = (const char *) inbuf; size_t inleft = resultlen; char *outptr = (char *) outbuf; size_t outleft; if (freemem_size < sizeof (size_t)) goto resize_freemem; outleft = freemem_size - sizeof (size_t); if (iconv (convd->conv, (ICONV_CONST char **) &inptr, &inleft, &outptr, &outleft) != (size_t) (-1)) { outbuf = (unsigned char *) outptr; break; } if (errno != E2BIG) { __libc_lock_unlock (lock); return NULL; } # endif # endif resize_freemem: /* We must allocate a new buffer or resize the old one. */ if (malloc_count > 0) { ++malloc_count; freemem_size = malloc_count * INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) realloc (transmem_list, freemem_size); # ifdef _LIBC if (newmem != NULL) transmem_list = transmem_list->next; else { struct transmem_list *old = transmem_list; transmem_list = transmem_list->next; free (old); } # endif } else { malloc_count = 1; freemem_size = INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) malloc (freemem_size); } if (__builtin_expect (newmem == NULL, 0)) { freemem = NULL; freemem_size = 0; __libc_lock_unlock (lock); return (char *) -1; } # ifdef _LIBC /* Add the block to the list of blocks we have to free at some point. */ newmem->next = transmem_list; transmem_list = newmem; freemem = (unsigned char *) newmem->data; freemem_size -= offsetof (struct transmem_list, data); # else transmem_list = newmem; freemem = newmem; # endif outbuf = freemem + sizeof (size_t); } /* We have now in our buffer a converted string. Put this into the table of conversions. */ *(size_t *) freemem = outbuf - freemem - sizeof (size_t); convd->conv_tab[act] = (char *) freemem; /* Shrink freemem, but keep it aligned. */ freemem_size -= outbuf - freemem; freemem = outbuf; freemem += freemem_size & (alignof (size_t) - 1); freemem_size = freemem_size & ~ (alignof (size_t) - 1); __libc_lock_unlock (lock); } /* Now convd->conv_tab[act] contains the translation of all the plural variants. */ result = convd->conv_tab[act] + sizeof (size_t); resultlen = *(size_t *) convd->conv_tab[act]; } } /* The result string is converted. */ #endif /* _LIBC || HAVE_ICONV */ *lengthp = resultlen; return result; } /* Look up a plural variant. */ static char * internal_function plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, const char *translation, size_t translation_len) { struct loaded_domain *domaindata = (struct loaded_domain *) domain->data; unsigned long int index; const char *p; index = plural_eval (domaindata->plural, n); if (index >= domaindata->nplurals) /* This should never happen. It means the plural expression and the given maximum value do not match. */ index = 0; /* Skip INDEX strings at TRANSLATION. */ p = translation; while (index-- > 0) { #ifdef _LIBC p = __rawmemchr (p, '\0'); #else p = strchr (p, '\0'); #endif /* And skip over the NUL byte. */ p++; if (p >= translation + translation_len) /* This should never happen. It means the plural expression evaluated to a value larger than the number of variants available for MSGID1. */ return (char *) translation; } return (char *) p; } #ifndef _LIBC /* Return string representation of locale CATEGORY. */ static const char * internal_function category_to_name (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; } #endif /* Guess value of current locale from value of the environment variables or system-dependent defaults. */ static const char * internal_function #ifdef IN_LIBGLOCALE guess_category_value (int category, const char *categoryname, const char *locale) #else guess_category_value (int category, const char *categoryname) #endif { const char *language; #ifndef IN_LIBGLOCALE const char *locale; # ifndef _LIBC const char *language_default; int locale_defaulted; # endif #endif /* We use the settings in the following order: 1. The value of the environment variable 'LANGUAGE'. This is a GNU extension. Its value can be a colon-separated list of locale names. 2. The value of the environment variable 'LC_ALL', 'LC_xxx', or 'LANG'. More precisely, the first among these that is set to a non-empty value. This is how POSIX specifies it. The value is a single locale name. 3. A system-dependent preference list of languages. Its value can be a colon-separated list of locale names. 4. A system-dependent default locale name. This way: - System-dependent settings can be overridden by environment variables. - If the system provides both a list of languages and a default locale, the former is used. */ #ifndef IN_LIBGLOCALE /* Fetch the locale name, through the POSIX method of looking to `LC_ALL', `LC_xxx', and `LANG'. On some systems this can be done by the `setlocale' function itself. */ # ifdef _LIBC locale = __current_locale_name (category); # else # if HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS /* The __names field is not public glibc API and must therefore not be used in code that is installed in public locations. */ locale_t thread_locale = uselocale (NULL); if (thread_locale != LC_GLOBAL_LOCALE) { locale = thread_locale->__names[category]; locale_defaulted = 0; } else # endif { locale = _nl_locale_name_posix (category, categoryname); locale_defaulted = 0; if (locale == NULL) { locale = _nl_locale_name_default (); locale_defaulted = 1; } } # endif #endif /* Ignore LANGUAGE and its system-dependent analogon if the locale is set to "C" because 1. "C" locale usually uses the ASCII encoding, and most international messages use non-ASCII characters. These characters get displayed as question marks (if using glibc's iconv()) or as invalid 8-bit characters (because other iconv()s refuse to convert most non-ASCII characters to ASCII). In any case, the output is ugly. 2. The precise output of some programs in the "C" locale is specified by POSIX and should not depend on environment variables like "LANGUAGE" or system-dependent information. We allow such programs to use gettext(). */ if (strcmp (locale, "C") == 0) return locale; /* The highest priority value is the value of the 'LANGUAGE' environment variable. */ language = getenv ("LANGUAGE"); if (language != NULL && language[0] != '\0') return language; #if !defined IN_LIBGLOCALE && !defined _LIBC /* The next priority value is the locale name, if not defaulted. */ if (locale_defaulted) { /* The next priority value is the default language preferences list. */ language_default = _nl_language_preferences_default (); if (language_default != NULL) return language_default; } /* The least priority value is the locale name, if defaulted. */ #endif return locale; } #if (defined _LIBC || HAVE_ICONV) && !defined IN_LIBGLOCALE /* Returns the output charset. */ static const char * internal_function get_output_charset (struct binding *domainbinding) { /* The output charset should normally be determined by the locale. But sometimes the locale is not used or not correctly set up, so we provide a possibility for the user to override this: the OUTPUT_CHARSET environment variable. Moreover, the value specified through bind_textdomain_codeset overrides both. */ if (domainbinding != NULL && domainbinding->codeset != NULL) return domainbinding->codeset; else { /* For speed reasons, we look at the value of OUTPUT_CHARSET only once. This is a user variable that is not supposed to change during a program run. */ static char *output_charset_cache; static int output_charset_cached; if (!output_charset_cached) { const char *value = getenv ("OUTPUT_CHARSET"); if (value != NULL && value[0] != '\0') { size_t len = strlen (value) + 1; char *value_copy = (char *) malloc (len); if (value_copy != NULL) memcpy (value_copy, value, len); output_charset_cache = value_copy; } output_charset_cached = 1; } if (output_charset_cache != NULL) return output_charset_cache; else { # ifdef _LIBC return _NL_CURRENT (LC_CTYPE, CODESET); # else # if HAVE_ICONV return locale_charset (); # endif # endif } } } #endif /* @@ 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 (char *dest, const char *src) { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif #if !_LIBC && !HAVE_MEMPCPY static void * mempcpy (void *dest, const void *src, size_t n) { return (void *) ((char *) memcpy (dest, src, n) + n); } #endif #if !_LIBC && !HAVE_TSEARCH # include "tsearch.c" #endif #ifdef _LIBC /* If we want to free all resources we have to do some work at program's end. */ libc_freeres_fn (free_mem) { void *old; while (_nl_domain_bindings != NULL) { struct binding *oldp = _nl_domain_bindings; _nl_domain_bindings = _nl_domain_bindings->next; if (oldp->dirname != _nl_default_dirname) /* Yes, this is a pointer comparison. */ free (oldp->dirname); free (oldp->codeset); free (oldp); } if (_nl_current_default_domain != _nl_default_default_domain) /* Yes, again a pointer comparison. */ free ((char *) _nl_current_default_domain); /* Remove the search tree with the known translations. */ __tdestroy (root, free); root = NULL; while (transmem_list != NULL) { old = transmem_list; transmem_list = transmem_list->next; free (old); } } #endif sitecopy-0.16.6/intl/locale.alias0000644000076400007640000000510610712466317015020 0ustar joejoe# Locale name alias data base. # Copyright (C) 1996-2001,2003,2007 Free Software Foundation, Inc. # # This program 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, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. # The format of this file is the same as for the corresponding file of # the X Window System, which normally can be found in # /usr/lib/X11/locale/locale.alias # A single line contains two fields: an alias and a substitution value. # All entries are case independent. # Note: This file is obsolete and is kept around for the time being for # backward compatibility. Nobody should rely on the names defined here. # Locales should always be specified by their full name. # Packages using this file: bokmal nb_NO.ISO-8859-1 bokml nb_NO.ISO-8859-1 catalan ca_ES.ISO-8859-1 croatian hr_HR.ISO-8859-2 czech cs_CZ.ISO-8859-2 danish da_DK.ISO-8859-1 dansk da_DK.ISO-8859-1 deutsch de_DE.ISO-8859-1 dutch nl_NL.ISO-8859-1 eesti et_EE.ISO-8859-1 estonian et_EE.ISO-8859-1 finnish fi_FI.ISO-8859-1 franais fr_FR.ISO-8859-1 french fr_FR.ISO-8859-1 galego gl_ES.ISO-8859-1 galician gl_ES.ISO-8859-1 german de_DE.ISO-8859-1 greek el_GR.ISO-8859-7 hebrew he_IL.ISO-8859-8 hrvatski hr_HR.ISO-8859-2 hungarian hu_HU.ISO-8859-2 icelandic is_IS.ISO-8859-1 italian it_IT.ISO-8859-1 japanese ja_JP.eucJP japanese.euc ja_JP.eucJP ja_JP ja_JP.eucJP ja_JP.ujis ja_JP.eucJP japanese.sjis ja_JP.SJIS korean ko_KR.eucKR korean.euc ko_KR.eucKR ko_KR ko_KR.eucKR lithuanian lt_LT.ISO-8859-13 no_NO nb_NO.ISO-8859-1 no_NO.ISO-8859-1 nb_NO.ISO-8859-1 norwegian nb_NO.ISO-8859-1 nynorsk nn_NO.ISO-8859-1 polish pl_PL.ISO-8859-2 portuguese pt_PT.ISO-8859-1 romanian ro_RO.ISO-8859-2 russian ru_RU.ISO-8859-5 slovak sk_SK.ISO-8859-2 slovene sl_SI.ISO-8859-2 slovenian sl_SI.ISO-8859-2 spanish es_ES.ISO-8859-1 swedish sv_SE.ISO-8859-1 thai th_TH.TIS-620 turkish tr_TR.ISO-8859-9 sitecopy-0.16.6/intl/vasnprintf.h0000644000076400007640000000544310624140346015106 0ustar joejoe/* vsprintf with automatic memory allocation. Copyright (C) 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _VASNPRINTF_H #define _VASNPRINTF_H /* Get va_list. */ #include /* Get size_t. */ #include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). You can pass a preallocated buffer for the result in RESULTBUF and its size in *LENGTHP; otherwise you pass RESULTBUF = NULL. If successful, return the address of the string (this may be = RESULTBUF if no dynamic memory allocation was necessary) and set *LENGTHP to the number of resulting bytes, excluding the trailing NUL. Upon error, set errno and return NULL. When dynamic memory allocation occurs, the preallocated buffer is left alone (with possibly modified contents). This makes it possible to use a statically allocated or stack-allocated buffer, like this: char buf[100]; size_t len = sizeof (buf); char *output = vasnprintf (buf, &len, format, args); if (output == NULL) ... error handling ...; else { ... use the output string ...; if (output != buf) free (output); } */ extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 3, 0))); #ifdef __cplusplus } #endif #endif /* _VASNPRINTF_H */ sitecopy-0.16.6/intl/plural.c0000644000076400007640000014212010556546654014220 0ustar joejoe/* A Bison parser, made by GNU Bison 2.3a. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3a" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse __gettextparse #define yylex __gettextlex #define yyerror __gettexterror #define yylval __gettextlval #define yychar __gettextchar #define yydebug __gettextdebug #define yynerrs __gettextnerrs /* Copy the first part of user declarations. */ /* Line 164 of yacc.c. */ #line 1 "plural.y" /* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* For bison < 2.0, the bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. This can go away once the AM_INTL_SUBDIR macro requires bison >= 2.0. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "plural-exp.h" /* The main function generated by the parser is called __gettextparse, but we want it to be called PLURAL_PARSE. */ #ifndef _LIBC # define __gettextparse PLURAL_PARSE #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { EQUOP2 = 258, CMPOP2 = 259, ADDOP2 = 260, MULOP2 = 261, NUMBER = 262 }; #endif /* Tokens. */ #define EQUOP2 258 #define CMPOP2 259 #define ADDOP2 260 #define MULOP2 261 #define NUMBER 262 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE {/* Line 191 of yacc.c. */ #line 51 "plural.y" unsigned long int num; enum expression_operator op; struct expression *exp; } /* Line 191 of yacc.c. */ #line 175 "plural.c" YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 221 of yacc.c. */ #line 57 "plural.y" /* Prototypes for local functions. */ static int yylex (YYSTYPE *lval, const char **pexp); static void yyerror (const char *str); /* Allocation of expressions. */ static struct expression * new_exp (int nargs, enum expression_operator op, struct expression * const *args) { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (enum expression_operator op) { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (enum expression_operator op, struct expression *right) { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (enum expression_operator op, struct expression *left, struct expression *right) { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (enum expression_operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch) { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } /* Line 221 of yacc.c. */ #line 265 "plural.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 9 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 54 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 16 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 3 /* YYNRULES -- Number of rules. */ #define YYNRULES 13 /* YYNRULES -- Number of states. */ #define YYNSTATES 27 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 262 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 2, 2, 2, 2, 5, 2, 14, 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 6, 7, 8, 9, 11 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 11, 15, 19, 23, 27, 31, 35, 38, 40, 42 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 17, 0, -1, 18, -1, 18, 3, 18, 12, 18, -1, 18, 4, 18, -1, 18, 5, 18, -1, 18, 6, 18, -1, 18, 7, 18, -1, 18, 8, 18, -1, 18, 9, 18, -1, 10, 18, -1, 13, -1, 11, -1, 14, 18, 15, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 154, 154, 162, 166, 170, 174, 178, 182, 186, 190, 194, 198, 203 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", "$accept", "start", "exp", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 63, 124, 38, 258, 259, 260, 261, 33, 262, 58, 110, 40, 41 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 5, 3, 3, 3, 3, 3, 3, 2, 1, 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 0, 12, 11, 0, 0, 2, 10, 0, 1, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 5, 6, 7, 8, 9, 0, 3 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 5, 6 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -10 static const yytype_int8 yypact[] = { -9, -9, -10, -10, -9, 8, 36, -10, 13, -10, -9, -9, -9, -9, -9, -9, -9, -10, 26, 41, 45, 18, -2, 14, -10, -9, 36 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -10, -10, -1 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { 7, 1, 2, 8, 3, 4, 15, 16, 9, 18, 19, 20, 21, 22, 23, 24, 10, 11, 12, 13, 14, 15, 16, 16, 26, 14, 15, 16, 17, 10, 11, 12, 13, 14, 15, 16, 0, 0, 25, 10, 11, 12, 13, 14, 15, 16, 12, 13, 14, 15, 16, 13, 14, 15, 16 }; static const yytype_int8 yycheck[] = { 1, 10, 11, 4, 13, 14, 8, 9, 0, 10, 11, 12, 13, 14, 15, 16, 3, 4, 5, 6, 7, 8, 9, 9, 25, 7, 8, 9, 15, 3, 4, 5, 6, 7, 8, 9, -1, -1, 12, 3, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, 8, 9 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 10, 11, 13, 14, 17, 18, 18, 18, 0, 3, 4, 5, 6, 7, 8, 9, 15, 18, 18, 18, 18, 18, 18, 18, 12, 18 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) #else # define YYLEX yylex (&yylval) #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; int yystate; int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss = yyssa; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* Line 1269 of yacc.c. */ #line 155 "plural.y" { if ((yyvsp[(1) - (1)].exp) == NULL) YYABORT; ((struct parse_args *) arg)->res = (yyvsp[(1) - (1)].exp); } break; case 3: /* Line 1269 of yacc.c. */ #line 163 "plural.y" { (yyval.exp) = new_exp_3 (qmop, (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp)); } break; case 4: /* Line 1269 of yacc.c. */ #line 167 "plural.y" { (yyval.exp) = new_exp_2 (lor, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 5: /* Line 1269 of yacc.c. */ #line 171 "plural.y" { (yyval.exp) = new_exp_2 (land, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 6: /* Line 1269 of yacc.c. */ #line 175 "plural.y" { (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 7: /* Line 1269 of yacc.c. */ #line 179 "plural.y" { (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 8: /* Line 1269 of yacc.c. */ #line 183 "plural.y" { (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 9: /* Line 1269 of yacc.c. */ #line 187 "plural.y" { (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); } break; case 10: /* Line 1269 of yacc.c. */ #line 191 "plural.y" { (yyval.exp) = new_exp_1 (lnot, (yyvsp[(2) - (2)].exp)); } break; case 11: /* Line 1269 of yacc.c. */ #line 195 "plural.y" { (yyval.exp) = new_exp_0 (var); } break; case 12: /* Line 1269 of yacc.c. */ #line 199 "plural.y" { if (((yyval.exp) = new_exp_0 (num)) != NULL) (yyval.exp)->val.num = (yyvsp[(1) - (1)].num); } break; case 13: /* Line 1269 of yacc.c. */ #line 204 "plural.y" { (yyval.exp) = (yyvsp[(2) - (3)].exp); } break; /* Line 1269 of yacc.c. */ #line 1572 "plural.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 1486 of yacc.c. */ #line 209 "plural.y" void internal_function FREE_EXPRESSION (struct expression *exp) { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (YYSTYPE *lval, const char **pexp) { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (const char *str) { /* Do nothing. We don't print error messages here. */ } sitecopy-0.16.6/intl/dngettext.c0000644000076400007640000000354610243450466014723 0ustar joejoe/* Implementation of the dngettext(3) function. Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #include #ifdef _LIBC # include #else # include "libgnuintl.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 DNGETTEXT __dngettext # define DCNGETTEXT __dcngettext #else # define DNGETTEXT libintl_dngettext # define DCNGETTEXT libintl_dcngettext #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale and skip message according to the plural form. */ char * DNGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n) { return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dngettext, dngettext); #endif sitecopy-0.16.6/intl/xsize.h0000644000076400007640000000672610243450467014070 0ustar joejoe/* xsize.h -- Checked size_t computations. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XSIZE_H #define _XSIZE_H /* Get size_t. */ #include /* Get SIZE_MAX. */ #include #if HAVE_STDINT_H # include #endif /* The size of memory objects is often computed through expressions of type size_t. Example: void* p = malloc (header_size + n * element_size). These computations can lead to overflow. When this happens, malloc() returns a piece of memory that is way too small, and the program then crashes while attempting to fill the memory. To avoid this, the functions and macros in this file check for overflow. The convention is that SIZE_MAX represents overflow. malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc implementation that uses mmap --, it's recommended to use size_overflow_p() or size_in_bounds_p() before invoking malloc(). The example thus becomes: size_t size = xsum (header_size, xtimes (n, element_size)); void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); */ /* Convert an arbitrary value >= 0 to type size_t. */ #define xcast_size_t(N) \ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) /* Sum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum (size_t size1, size_t size2) { size_t sum = size1 + size2; return (sum >= size1 ? sum : SIZE_MAX); } /* Sum of three sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum3 (size_t size1, size_t size2, size_t size3) { return xsum (xsum (size1, size2), size3); } /* Sum of four sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) { return xsum (xsum (xsum (size1, size2), size3), size4); } /* Maximum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xmax (size_t size1, size_t size2) { /* No explicit check is needed here, because for any n: max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ return (size1 >= size2 ? size1 : size2); } /* Multiplication of a count with an element size, with overflow check. The count must be >= 0 and the element size must be > 0. This is a macro, not an inline function, so that it works correctly even when N is of a wider tupe and N > SIZE_MAX. */ #define xtimes(N, ELSIZE) \ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) /* Check for overflow. */ #define size_overflow_p(SIZE) \ ((SIZE) == SIZE_MAX) /* Check against overflow. */ #define size_in_bounds_p(SIZE) \ ((SIZE) != SIZE_MAX) #endif /* _XSIZE_H */ sitecopy-0.16.6/intl/langprefs.c0000644000076400007640000000737510632060240014667 0ustar joejoe/* Determine the user's language preferences. Copyright (C) 2004-2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif #include #if HAVE_CFPREFERENCESCOPYAPPVALUE # include # include # include # include # include extern void _nl_locale_name_canonicalize (char *name); #endif /* Determine the user's language preferences, as a colon separated list of locale names in XPG syntax language[_territory][.codeset][@modifier] The result must not be freed; it is statically allocated. The LANGUAGE environment variable does not need to be considered; it is already taken into account by the caller. */ const char * _nl_language_preferences_default (void) { #if HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ { /* Cache the preferences list, since CoreFoundation calls are expensive. */ static const char *cached_languages; static int cache_initialized; if (!cache_initialized) { CFTypeRef preferences = CFPreferencesCopyAppValue (CFSTR ("AppleLanguages"), kCFPreferencesCurrentApplication); if (preferences != NULL && CFGetTypeID (preferences) == CFArrayGetTypeID ()) { CFArrayRef prefArray = (CFArrayRef)preferences; int n = CFArrayGetCount (prefArray); char buf[256]; size_t size = 0; int i; for (i = 0; i < n; i++) { CFTypeRef element = CFArrayGetValueAtIndex (prefArray, i); if (element != NULL && CFGetTypeID (element) == CFStringGetTypeID () && CFStringGetCString ((CFStringRef)element, buf, sizeof (buf), kCFStringEncodingASCII)) { _nl_locale_name_canonicalize (buf); size += strlen (buf) + 1; /* Most GNU programs use msgids in English and don't ship an en.mo message catalog. Therefore when we see "en" in the preferences list, arrange for gettext() to return the msgid, and ignore all further elements of the preferences list. */ if (strcmp (buf, "en") == 0) break; } else break; } if (size > 0) { char *languages = (char *) malloc (size); if (languages != NULL) { char *p = languages; for (i = 0; i < n; i++) { CFTypeRef element = CFArrayGetValueAtIndex (prefArray, i); if (element != NULL && CFGetTypeID (element) == CFStringGetTypeID () && CFStringGetCString ((CFStringRef)element, buf, sizeof (buf), kCFStringEncodingASCII)) { _nl_locale_name_canonicalize (buf); strcpy (p, buf); p += strlen (buf); *p++ = ':'; if (strcmp (buf, "en") == 0) break; } else break; } *--p = '\0'; cached_languages = languages; } } } cache_initialized = 1; } if (cached_languages != NULL) return cached_languages; } #endif return NULL; } sitecopy-0.16.6/intl/Makefile.in0000644000076400007640000005041310713433710014604 0ustar joejoe# Makefile for directory with message catalog handling library of GNU gettext # Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc. # # This program 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, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. # The VPATH variables allows builds with $builddir != $srcdir, assuming a # 'make' program that supports VPATH (such as GNU make). This line is removed # by autoconf automatically when "$(srcdir)" = ".". # In this directory, the VPATH handling is particular: # 1. If INTL_LIBTOOL_SUFFIX_PREFIX is 'l' (indicating a build with libtool), # the .c -> .lo rules carefully use $(srcdir), so that VPATH can be omitted. # 2. If PACKAGE = gettext-tools, VPATH _must_ be omitted, because otherwise # 'make' does the wrong thing if GNU gettext was configured with # "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la # files it finds in srcdir = ../../gettext-runtime/intl. VPATH = $(srcdir) prefix = @prefix@ exec_prefix = @exec_prefix@ transform = @program_transform_name@ libdir = @libdir@ includedir = @includedir@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/intl aliaspath = $(localedir) subdir = intl INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ l = @INTL_LIBTOOL_SUFFIX_PREFIX@ AR = ar CC = @CC@ LIBTOOL = @LIBTOOL@ RANLIB = @RANLIB@ YACC = @INTLBISON@ -y -d YFLAGS = --name-prefix=__gettext WINDRES = @WINDRES@ # -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro. # -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro. DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL \ -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ -Dset_relocation_prefix=libintl_set_relocation_prefix \ -Drelocate=libintl_relocate \ -DDEPENDS_ON_LIBICONV=1 @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ @CFLAG_VISIBILITY@ LDFLAGS = @LDFLAGS@ $(LDFLAGS_@WOE32DLL@) LDFLAGS_yes = -Wl,--export-all-symbols LDFLAGS_no = LIBS = @LIBS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) HEADERS = \ gmo.h \ gettextP.h \ hash-string.h \ loadinfo.h \ plural-exp.h \ eval-plural.h \ localcharset.h \ lock.h \ relocatable.h \ tsearch.h tsearch.c \ xsize.h \ printf-args.h printf-args.c \ printf-parse.h wprintf-parse.h printf-parse.c \ vasnprintf.h vasnwprintf.h vasnprintf.c \ os2compat.h \ libgnuintl.h.in SOURCES = \ bindtextdom.c \ dcgettext.c \ dgettext.c \ gettext.c \ finddomain.c \ hash-string.c \ loadmsgcat.c \ localealias.c \ textdomain.c \ l10nflist.c \ explodename.c \ dcigettext.c \ dcngettext.c \ dngettext.c \ ngettext.c \ plural.y \ plural-exp.c \ localcharset.c \ lock.c \ relocatable.c \ langprefs.c \ localename.c \ log.c \ printf.c \ version.c \ osdep.c \ os2compat.c \ intl-exports.c \ intl-compat.c OBJECTS = \ bindtextdom.$lo \ dcgettext.$lo \ dgettext.$lo \ gettext.$lo \ finddomain.$lo \ hash-string.$lo \ loadmsgcat.$lo \ localealias.$lo \ textdomain.$lo \ l10nflist.$lo \ explodename.$lo \ dcigettext.$lo \ dcngettext.$lo \ dngettext.$lo \ ngettext.$lo \ plural.$lo \ plural-exp.$lo \ localcharset.$lo \ lock.$lo \ relocatable.$lo \ langprefs.$lo \ localename.$lo \ log.$lo \ printf.$lo \ version.$lo \ osdep.$lo \ intl-compat.$lo OBJECTS_RES_yes = libintl.res OBJECTS_RES_no = DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin export.h libintl.rc \ $(HEADERS) $(SOURCES) DISTFILES.generated = plural.c DISTFILES.normal = VERSION DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc README.woe32 DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h \ libgnuintl.h_vms Makefile.vms libgnuintl.h.msvc-static \ libgnuintl.h.msvc-shared Makefile.msvc all: all-@USE_INCLUDED_LIBINTL@ all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed all-no: all-no-@BUILD_INCLUDED_LIBINTL@ all-no-yes: libgnuintl.$la all-no-no: libintl.a libgnuintl.a: $(OBJECTS) rm -f $@ $(AR) cru $@ $(OBJECTS) $(RANLIB) $@ libintl.la libgnuintl.la: $(OBJECTS) $(OBJECTS_RES_@WOE32@) $(LIBTOOL) --mode=link \ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ $(OBJECTS) @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(LIBS) @LTLIBTHREAD@ @LTLIBC@ \ $(OBJECTS_RES_@WOE32@) \ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ -rpath $(libdir) \ -no-undefined # Libtool's library version information for libintl. # Before making a gettext release, the gettext maintainer must change this # according to the libtool documentation, section "Library interface versions". # Maintainers of other packages that include the intl directory must *not* # change these values. LTV_CURRENT=8 LTV_REVISION=2 LTV_AGE=0 .SUFFIXES: .SUFFIXES: .c .y .o .lo .sin .sed .c.o: $(COMPILE) $< .y.c: $(YACC) $(YFLAGS) --output $@ $< rm -f $*.h bindtextdom.lo: $(srcdir)/bindtextdom.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c dcgettext.lo: $(srcdir)/dcgettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c dgettext.lo: $(srcdir)/dgettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c gettext.lo: $(srcdir)/gettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c finddomain.lo: $(srcdir)/finddomain.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c hash-string.lo: $(srcdir)/hash-string.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/hash-string.c loadmsgcat.lo: $(srcdir)/loadmsgcat.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c localealias.lo: $(srcdir)/localealias.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c textdomain.lo: $(srcdir)/textdomain.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c l10nflist.lo: $(srcdir)/l10nflist.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c explodename.lo: $(srcdir)/explodename.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c dcigettext.lo: $(srcdir)/dcigettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c dcngettext.lo: $(srcdir)/dcngettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c dngettext.lo: $(srcdir)/dngettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c ngettext.lo: $(srcdir)/ngettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c plural.lo: $(srcdir)/plural.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c plural-exp.lo: $(srcdir)/plural-exp.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c localcharset.lo: $(srcdir)/localcharset.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c lock.lo: $(srcdir)/lock.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/lock.c relocatable.lo: $(srcdir)/relocatable.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c langprefs.lo: $(srcdir)/langprefs.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/langprefs.c localename.lo: $(srcdir)/localename.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c log.lo: $(srcdir)/log.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c printf.lo: $(srcdir)/printf.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c version.lo: $(srcdir)/version.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/version.c osdep.lo: $(srcdir)/osdep.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c intl-compat.lo: $(srcdir)/intl-compat.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c # This rule is executed only on Woe32 systems. # The following sed expressions come from the windres-options script. They are # inlined here, so that they can be written in a Makefile without requiring a # temporary file. They must contain literal newlines rather than semicolons, # so that they work with the sed-3.02 that is shipped with MSYS. We can use # GNU bash's $'\n' syntax to obtain such a newline. libintl.res: $(srcdir)/libintl.rc nl=$$'\n'; \ sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \ $(WINDRES) \ "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \ "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \ "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \ -i $(srcdir)/libintl.rc -o libintl.res --output-format=coff ref-add.sed: $(srcdir)/ref-add.sin sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed mv t-ref-add.sed ref-add.sed ref-del.sed: $(srcdir)/ref-del.sin sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed mv t-ref-del.sed ref-del.sed INCLUDES = -I. -I$(srcdir) -I.. libgnuintl.h: $(srcdir)/libgnuintl.h.in sed -e '/IN_LIBGLOCALE/d' \ -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ < $(srcdir)/libgnuintl.h.in \ | if test '@WOE32DLL@' = yes; then \ sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \ else \ cat; \ fi \ | sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \ -e "/#define _LIBINTL_H/r $(srcdir)/export.h" \ | sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \ > libgnuintl.h libintl.h: $(srcdir)/libgnuintl.h.in sed -e '/IN_LIBGLOCALE/d' \ -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ < $(srcdir)/libgnuintl.h.in > libintl.h charset.alias: $(srcdir)/config.charset $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ mv t-$@ $@ check: all # We must not install the libintl.h/libintl.a files if we are on a # system which has the GNU gettext() function in its C library or in a # separate library. # If you want to use the one which comes with this version of the # package, you have to use `configure --with-included-gettext'. install: install-exec install-data install-exec: all if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=install \ $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ if test "@RELOCATABLE@" = yes; then \ dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \ if test -n "$$dependencies"; then \ rm -f $(DESTDIR)$(libdir)/libintl.la; \ fi; \ fi; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no \ && test @GLIBC2@ != no; then \ $(mkdir_p) $(DESTDIR)$(libdir); \ $(LIBTOOL) --mode=install \ $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \ $(LIBTOOL) --mode=uninstall \ rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ orig=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ if test @GLIBC21@ = no; then \ orig=charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ fi; \ fi; \ $(mkdir_p) $(DESTDIR)$(localedir); \ test -f $(DESTDIR)$(localedir)/locale.alias \ && orig=$(DESTDIR)$(localedir)/locale.alias \ || orig=$(srcdir)/locale.alias; \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ : ; \ fi install-data: all if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \ for file in $$dists; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ dists="$(DISTFILES.generated)"; \ for file in $$dists; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ $(INSTALL_DATA) $$dir/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ dists="$(DISTFILES.obsolete)"; \ for file in $$dists; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-strip: install install-dvi install-html install-info install-ps install-pdf: installdirs: if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no \ && test @GLIBC2@ != no; then \ $(mkdir_p) $(DESTDIR)$(libdir); \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \ $(mkdir_p) $(DESTDIR)$(localedir); \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ rm -f $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=uninstall \ rm -f $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no \ && test @GLIBC2@ != no; then \ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ if test -f $(DESTDIR)$(localedir)/locale.alias; then \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools"; then \ for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi info dvi ps pdf html: $(OBJECTS): ../config.h libgnuintl.h bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h hash-string.$lo dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h dcigettext.$lo: $(srcdir)/eval-plural.h localcharset.$lo: $(srcdir)/localcharset.h bindtextdom.$lo dcigettext.$lo finddomain.$lo loadmsgcat.$lo localealias.$lo lock.$lo log.$lo: $(srcdir)/lock.h localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c # A bison-2.1 generated plural.c includes if ENABLE_NLS. PLURAL_DEPS_yes = libintl.h PLURAL_DEPS_no = plural.$lo: $(PLURAL_DEPS_@USE_INCLUDED_LIBINTL@) tags: TAGS TAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES) id: ID ID: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) mostlyclean: rm -f *.a *.la *.o *.obj *.lo libintl.res core core.* rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed rm -f -r .libs _libs clean: mostlyclean distclean: clean rm -f Makefile ID TAGS if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \ rm -f ChangeLog.inst $(DISTFILES.normal); \ else \ : ; \ fi maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." # GNU gettext needs not contain the file `VERSION' but contains some # other files which should not be distributed in other packages. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: Makefile if test "$(PACKAGE)" = "gettext-tools"; then \ : ; \ else \ if test "$(PACKAGE)" = "gettext-runtime"; then \ additional="$(DISTFILES.gettext)"; \ else \ additional="$(DISTFILES.normal)"; \ fi; \ $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ cp -p $$dir/$$file $(distdir) || test $$file = Makefile.in || exit 1; \ done; \ fi Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status # This would be more efficient, but doesn't work any more with autoconf-2.57, # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used. # cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ # 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: sitecopy-0.16.6/intl/gettextP.h0000644000076400007640000002221410704167703014520 0ustar joejoe/* Header describing internals of libintl library. Copyright (C) 1995-1999, 2000-2007 Free 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 Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETTEXTP_H #define _GETTEXTP_H #include /* Get size_t. */ #ifdef _LIBC # include "../iconv/gconv_int.h" #else # if HAVE_ICONV # include # endif #endif /* Handle multi-threaded applications. */ #ifdef _LIBC # include # define gl_rwlock_define __libc_rwlock_define #else # include "lock.h" #endif #ifdef _LIBC extern char *__gettext (const char *__msgid); extern char *__dgettext (const char *__domainname, const char *__msgid); extern char *__dcgettext (const char *__domainname, const char *__msgid, int __category); extern char *__ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n); extern char *__dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int n); extern char *__dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category); extern char *__dcigettext (const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category); extern char *__textdomain (const char *__domainname); extern char *__bindtextdomain (const char *__domainname, const char *__dirname); extern char *__bind_textdomain_codeset (const char *__domainname, const char *__codeset); extern void _nl_finddomain_subfreeres (void) attribute_hidden; extern void _nl_unload_domain (struct loaded_domain *__domain) internal_function attribute_hidden; #else /* Declare the exported libintl_* functions, in a way that allows us to call them under their real name. */ # undef _INTL_REDIRECT_INLINE # undef _INTL_REDIRECT_MACROS # define _INTL_REDIRECT_MACROS # include "libgnuintl.h" # ifdef IN_LIBGLOCALE extern char *gl_dcigettext (const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category, const char *__localename, const char *__encoding); # else extern char *libintl_dcigettext (const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category); # endif #endif #include "loadinfo.h" #include "gmo.h" /* Get nls_uint32. */ /* @@ end of prolog @@ */ #ifndef internal_function # define internal_function #endif #ifndef attribute_hidden # define attribute_hidden #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif #ifndef W # define W(flag, data) ((flag) ? SWAP (data) : (data)) #endif #ifdef _LIBC # include # define SWAP(i) bswap_32 (i) #else static inline nls_uint32 # ifdef __cplusplus SWAP (nls_uint32 i) # else SWAP (i) nls_uint32 i; # endif { return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); } #endif /* In-memory representation of system dependent string. */ struct sysdep_string_desc { /* Length of addressed string, including the trailing NUL. */ size_t length; /* Pointer to addressed string. */ const char *pointer; }; /* Cache of translated strings after charset conversion. Note: The strings are converted to the target encoding only on an as-needed basis. */ struct converted_domain { /* The target encoding name. */ const char *encoding; /* The descriptor for conversion from the message catalog's encoding to this target encoding. */ #ifdef _LIBC __gconv_t conv; #else # if HAVE_ICONV iconv_t conv; # endif #endif /* The table of translated strings after charset conversion. */ char **conv_tab; }; /* The representation of an opened message catalog. */ struct loaded_domain { /* Pointer to memory containing the .mo file. */ const char *data; /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */ int use_mmap; /* Size of mmap()ed memory. */ size_t mmap_size; /* 1 if the .mo file uses a different endianness than this machine. */ int must_swap; /* Pointer to additional malloc()ed memory. */ void *malloced; /* Number of static strings pairs. */ nls_uint32 nstrings; /* Pointer to descriptors of original strings in the file. */ const struct string_desc *orig_tab; /* Pointer to descriptors of translated strings in the file. */ const struct string_desc *trans_tab; /* Number of system dependent strings pairs. */ nls_uint32 n_sysdep_strings; /* Pointer to descriptors of original sysdep strings. */ const struct sysdep_string_desc *orig_sysdep_tab; /* Pointer to descriptors of translated sysdep strings. */ const struct sysdep_string_desc *trans_sysdep_tab; /* Size of hash table. */ nls_uint32 hash_size; /* Pointer to hash table. */ const nls_uint32 *hash_tab; /* 1 if the hash table uses a different endianness than this machine. */ int must_swap_hash_tab; /* Cache of charset conversions of the translated strings. */ struct converted_domain *conversions; size_t nconversions; gl_rwlock_define (, conversions_lock) const struct expression *plural; unsigned long int nplurals; }; /* We want to allocate a string at the end of the struct. But ISO C doesn't allow zero sized arrays. */ #ifdef __GNUC__ # define ZERO 0 #else # define ZERO 1 #endif /* A set of settings bound to a message domain. Used to store settings from bindtextdomain() and bind_textdomain_codeset(). */ struct binding { struct binding *next; char *dirname; char *codeset; char domainname[ZERO]; }; /* A counter which is incremented each time some previous translations become invalid. This variable is part of the external ABI of the GNU libintl. */ #ifdef IN_LIBGLOCALE # include extern LIBGLOCALE_DLL_EXPORTED int _nl_msg_cat_cntr; #else extern LIBINTL_DLL_EXPORTED int _nl_msg_cat_cntr; #endif #ifndef _LIBC extern const char *_nl_language_preferences_default (void); # define gl_locale_name_canonicalize _nl_locale_name_canonicalize extern void _nl_locale_name_canonicalize (char *name); # define gl_locale_name_posix _nl_locale_name_posix extern const char *_nl_locale_name_posix (int category, const char *categoryname); # define gl_locale_name_default _nl_locale_name_default extern const char *_nl_locale_name_default (void); # define gl_locale_name _nl_locale_name extern const char *_nl_locale_name (int category, const char *categoryname); #endif struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale, const char *__domainname, struct binding *__domainbinding) internal_function; void _nl_load_domain (struct loaded_l10nfile *__domain, struct binding *__domainbinding) internal_function; #ifdef IN_LIBGLOCALE char *_nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *encoding, const char *msgid, size_t *lengthp) internal_function; #else char *_nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, int convert, size_t *lengthp) internal_function; #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_dirname libintl_nl_default_dirname # define _nl_domain_bindings libintl_nl_domain_bindings #endif /* Contains the default location of the message catalogs. */ extern const char _nl_default_dirname[]; #ifdef _LIBC libc_hidden_proto (_nl_default_dirname) #endif /* List with bindings of specific domains. */ extern struct binding *_nl_domain_bindings; /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_default_domain libintl_nl_default_default_domain # define _nl_current_default_domain libintl_nl_current_default_domain #endif /* Name of the default text domain. */ extern const char _nl_default_default_domain[] attribute_hidden; /* Default text domain in which entries for gettext(3) are to be found. */ extern const char *_nl_current_default_domain attribute_hidden; /* @@ begin of epilog @@ */ #endif /* gettextP.h */ sitecopy-0.16.6/intl/printf-args.c0000644000076400007640000001336310713434605015146 0ustar joejoe/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file can be parametrized with the following macros: ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. PRINTF_FETCHARGS Name of the function to be defined. STATIC Set to 'static' to declare the function static. */ #ifndef PRINTF_FETCHARGS # include #endif /* Specification. */ #ifndef PRINTF_FETCHARGS # include "printf-args.h" #endif #ifdef STATIC STATIC #endif int PRINTF_FETCHARGS (va_list args, arguments *a) { size_t i; argument *ap; for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) switch (ap->type) { case TYPE_SCHAR: ap->a.a_schar = va_arg (args, /*signed char*/ int); break; case TYPE_UCHAR: ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); break; case TYPE_SHORT: ap->a.a_short = va_arg (args, /*short*/ int); break; case TYPE_USHORT: ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); break; case TYPE_INT: ap->a.a_int = va_arg (args, int); break; case TYPE_UINT: ap->a.a_uint = va_arg (args, unsigned int); break; case TYPE_LONGINT: ap->a.a_longint = va_arg (args, long int); break; case TYPE_ULONGINT: ap->a.a_ulongint = va_arg (args, unsigned long int); break; #if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: ap->a.a_longlongint = va_arg (args, long long int); break; case TYPE_ULONGLONGINT: ap->a.a_ulonglongint = va_arg (args, unsigned long long int); break; #endif case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; case TYPE_LONGDOUBLE: ap->a.a_longdouble = va_arg (args, long double); break; case TYPE_CHAR: ap->a.a_char = va_arg (args, int); break; #if HAVE_WINT_T case TYPE_WIDE_CHAR: /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by default argument promotions", this is not the case in mingw32, where wint_t is 'unsigned short'. */ ap->a.a_wide_char = (sizeof (wint_t) < sizeof (int) ? va_arg (args, int) : va_arg (args, wint_t)); break; #endif case TYPE_STRING: ap->a.a_string = va_arg (args, const char *); /* A null pointer is an invalid argument for "%s", but in practice it occurs quite frequently in printf statements that produce debug output. Use a fallback in this case. */ if (ap->a.a_string == NULL) ap->a.a_string = "(NULL)"; break; #if HAVE_WCHAR_T case TYPE_WIDE_STRING: ap->a.a_wide_string = va_arg (args, const wchar_t *); /* A null pointer is an invalid argument for "%ls", but in practice it occurs quite frequently in printf statements that produce debug output. Use a fallback in this case. */ if (ap->a.a_wide_string == NULL) { static const wchar_t wide_null_string[] = { (wchar_t)'(', (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L', (wchar_t)')', (wchar_t)0 }; ap->a.a_wide_string = wide_null_string; } break; #endif case TYPE_POINTER: ap->a.a_pointer = va_arg (args, void *); break; case TYPE_COUNT_SCHAR_POINTER: ap->a.a_count_schar_pointer = va_arg (args, signed char *); break; case TYPE_COUNT_SHORT_POINTER: ap->a.a_count_short_pointer = va_arg (args, short *); break; case TYPE_COUNT_INT_POINTER: ap->a.a_count_int_pointer = va_arg (args, int *); break; case TYPE_COUNT_LONGINT_POINTER: ap->a.a_count_longint_pointer = va_arg (args, long int *); break; #if HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; #endif #if ENABLE_UNISTDIO /* The unistdio extensions. */ case TYPE_U8_STRING: ap->a.a_u8_string = va_arg (args, const uint8_t *); /* A null pointer is an invalid argument for "%U", but in practice it occurs quite frequently in printf statements that produce debug output. Use a fallback in this case. */ if (ap->a.a_u8_string == NULL) { static const uint8_t u8_null_string[] = { '(', 'N', 'U', 'L', 'L', ')', 0 }; ap->a.a_u8_string = u8_null_string; } break; case TYPE_U16_STRING: ap->a.a_u16_string = va_arg (args, const uint16_t *); /* A null pointer is an invalid argument for "%lU", but in practice it occurs quite frequently in printf statements that produce debug output. Use a fallback in this case. */ if (ap->a.a_u16_string == NULL) { static const uint16_t u16_null_string[] = { '(', 'N', 'U', 'L', 'L', ')', 0 }; ap->a.a_u16_string = u16_null_string; } break; case TYPE_U32_STRING: ap->a.a_u32_string = va_arg (args, const uint32_t *); /* A null pointer is an invalid argument for "%llU", but in practice it occurs quite frequently in printf statements that produce debug output. Use a fallback in this case. */ if (ap->a.a_u32_string == NULL) { static const uint32_t u32_null_string[] = { '(', 'N', 'U', 'L', 'L', ')', 0 }; ap->a.a_u32_string = u32_null_string; } break; #endif default: /* Unknown type. */ return -1; } return 0; } sitecopy-0.16.6/intl/hash-string.c0000644000076400007640000000315110244331600015121 0ustar joejoe/* Implements a string hashing function. Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "hash-string.h" /* 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.] */ unsigned long int __hash_string (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 char) *str++; g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); if (g != 0) { hval ^= g >> (HASHWORDBITS - 8); hval ^= g; } } return hval; } sitecopy-0.16.6/intl/localcharset.c0000644000076400007640000003031410515413171015344 0ustar joejoe/* Determine a canonical name for the current locale's character encoding. Copyright (C) 2000-2006 Free Software Foundation, Inc. This program 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible . */ #include /* Specification. */ #include "localcharset.h" #include #include #include #include #if defined _WIN32 || defined __WIN32__ # define WIN32_NATIVE #endif #if defined __EMX__ /* Assume EMX program runs on OS/2, even if compiled under DOS. */ # define OS2 #endif #if !defined WIN32_NATIVE # if HAVE_LANGINFO_CODESET # include # else # if 0 /* see comment below */ # include # endif # endif # ifdef __CYGWIN__ # define WIN32_LEAN_AND_MEAN # include # endif #elif defined WIN32_NATIVE # define WIN32_LEAN_AND_MEAN # include #endif #if defined OS2 # define INCL_DOS # include #endif #if ENABLE_RELOCATABLE # include "relocatable.h" #else # define relocate(pathname) (pathname) #endif /* Get LIBDIR. */ #ifndef LIBDIR # include "configmake.h" #endif #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Win32, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') #endif #ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' #endif #ifndef ISSLASH # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) #endif #if HAVE_DECL_GETC_UNLOCKED # undef getc # define getc getc_unlocked #endif /* The following static variable is declared 'volatile' to avoid a possible multithread problem in the function get_charset_aliases. If we are running in a threaded environment, and if two threads initialize 'charset_aliases' simultaneously, both will produce the same value, and everything will be ok if the two assignments to 'charset_aliases' are atomic. But I don't know what will happen if the two assignments mix. */ #if __STDC__ != 1 # define volatile /* empty */ #endif /* Pointer to the contents of the charset.alias file, if it has already been read, else NULL. Its format is: ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ static const char * volatile charset_aliases; /* Return a pointer to the contents of the charset.alias file. */ static const char * get_charset_aliases (void) { const char *cp; cp = charset_aliases; if (cp == NULL) { #if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) FILE *fp; const char *dir; const char *base = "charset.alias"; char *file_name; /* Make it possible to override the charset.alias location. This is necessary for running the testsuite before "make install". */ dir = getenv ("CHARSETALIASDIR"); if (dir == NULL || dir[0] == '\0') dir = relocate (LIBDIR); /* Concatenate dir and base into freshly allocated file_name. */ { size_t dir_len = strlen (dir); size_t base_len = strlen (base); int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); file_name = (char *) malloc (dir_len + add_slash + base_len + 1); if (file_name != NULL) { memcpy (file_name, dir, dir_len); if (add_slash) file_name[dir_len] = DIRECTORY_SEPARATOR; memcpy (file_name + dir_len + add_slash, base, base_len + 1); } } if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) /* Out of memory or file not found, treat it as empty. */ cp = ""; else { /* Parse the file's contents. */ char *res_ptr = NULL; size_t res_size = 0; for (;;) { int c; char buf1[50+1]; char buf2[50+1]; size_t l1, l2; char *old_res_ptr; c = getc (fp); if (c == EOF) break; if (c == '\n' || c == ' ' || c == '\t') continue; if (c == '#') { /* Skip comment, to end of line. */ do c = getc (fp); while (!(c == EOF || c == '\n')); if (c == EOF) break; continue; } ungetc (c, fp); if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) break; l1 = strlen (buf1); l2 = strlen (buf2); old_res_ptr = res_ptr; if (res_size == 0) { res_size = l1 + 1 + l2 + 1; res_ptr = (char *) malloc (res_size + 1); } else { res_size += l1 + 1 + l2 + 1; res_ptr = (char *) realloc (res_ptr, res_size + 1); } if (res_ptr == NULL) { /* Out of memory. */ res_size = 0; if (old_res_ptr != NULL) free (old_res_ptr); break; } strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); strcpy (res_ptr + res_size - (l2 + 1), buf2); } fclose (fp); if (res_size == 0) cp = ""; else { *(res_ptr + res_size) = '\0'; cp = res_ptr; } } if (file_name != NULL) free (file_name); #else # if defined VMS /* To avoid the troubles of an extra file charset.alias_vms in the sources of many GNU packages, simply inline the aliases here. */ /* The list of encodings is taken from the OpenVMS 7.3-1 documentation "Compaq C Run-Time Library Reference Manual for OpenVMS systems" section 10.7 "Handling Different Character Sets". */ cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" "ISO8859-2" "\0" "ISO-8859-2" "\0" "ISO8859-5" "\0" "ISO-8859-5" "\0" "ISO8859-7" "\0" "ISO-8859-7" "\0" "ISO8859-8" "\0" "ISO-8859-8" "\0" "ISO8859-9" "\0" "ISO-8859-9" "\0" /* Japanese */ "eucJP" "\0" "EUC-JP" "\0" "SJIS" "\0" "SHIFT_JIS" "\0" "DECKANJI" "\0" "DEC-KANJI" "\0" "SDECKANJI" "\0" "EUC-JP" "\0" /* Chinese */ "eucTW" "\0" "EUC-TW" "\0" "DECHANYU" "\0" "DEC-HANYU" "\0" "DECHANZI" "\0" "GB2312" "\0" /* Korean */ "DECKOREAN" "\0" "EUC-KR" "\0"; # endif # if defined WIN32_NATIVE || defined __CYGWIN__ /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ cp = "CP936" "\0" "GBK" "\0" "CP1361" "\0" "JOHAB" "\0" "CP20127" "\0" "ASCII" "\0" "CP20866" "\0" "KOI8-R" "\0" "CP20936" "\0" "GB2312" "\0" "CP21866" "\0" "KOI8-RU" "\0" "CP28591" "\0" "ISO-8859-1" "\0" "CP28592" "\0" "ISO-8859-2" "\0" "CP28593" "\0" "ISO-8859-3" "\0" "CP28594" "\0" "ISO-8859-4" "\0" "CP28595" "\0" "ISO-8859-5" "\0" "CP28596" "\0" "ISO-8859-6" "\0" "CP28597" "\0" "ISO-8859-7" "\0" "CP28598" "\0" "ISO-8859-8" "\0" "CP28599" "\0" "ISO-8859-9" "\0" "CP28605" "\0" "ISO-8859-15" "\0" "CP38598" "\0" "ISO-8859-8" "\0" "CP51932" "\0" "EUC-JP" "\0" "CP51936" "\0" "GB2312" "\0" "CP51949" "\0" "EUC-KR" "\0" "CP51950" "\0" "EUC-TW" "\0" "CP54936" "\0" "GB18030" "\0" "CP65001" "\0" "UTF-8" "\0"; # endif #endif charset_aliases = cp; } return cp; } /* Determine the current locale's character encoding, and canonicalize it into one of the canonical names listed in config.charset. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ #ifdef STATIC STATIC #endif const char * locale_charset (void) { const char *codeset; const char *aliases; #if !(defined WIN32_NATIVE || defined OS2) # if HAVE_LANGINFO_CODESET /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); # ifdef __CYGWIN__ /* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always returns "US-ASCII". As long as this is not fixed, return the suffix of the locale name from the environment variables (if present) or the codepage as a number. */ if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) { const char *locale; static char buf[2 + 10 + 1]; locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } if (locale != NULL && locale[0] != '\0') { /* If the locale name contains an encoding after the dot, return it. */ const char *dot = strchr (locale, '.'); if (dot != NULL) { const char *modifier; dot++; /* Look for the possible @... trailer and remove it, if any. */ modifier = strchr (dot, '@'); if (modifier == NULL) return dot; if (modifier - dot < sizeof (buf)) { memcpy (buf, dot, modifier - dot); buf [modifier - dot] = '\0'; return buf; } } } /* Woe32 has a function returning the locale's codepage as a number. */ sprintf (buf, "CP%u", GetACP ()); codeset = buf; } # endif # else /* On old systems which lack it, use setlocale or getenv. */ const char *locale = NULL; /* But most old systems don't have a complete set of locales. Some (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't use setlocale here; it would return "C" when it doesn't support the locale name the user has set. */ # if 0 locale = setlocale (LC_CTYPE, NULL); # endif if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } } /* On some old systems, one used to set locale = "iso8859_1". On others, you set it to "language_COUNTRY.charset". In any case, we resolve it through the charset.alias file. */ codeset = locale; # endif #elif defined WIN32_NATIVE static char buf[2 + 10 + 1]; /* Woe32 has a function returning the locale's codepage as a number. */ sprintf (buf, "CP%u", GetACP ()); codeset = buf; #elif defined OS2 const char *locale; static char buf[2 + 10 + 1]; ULONG cp[3]; ULONG cplen; /* Allow user to override the codeset, as set in the operating system, with standard language environment variables. */ locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } if (locale != NULL && locale[0] != '\0') { /* If the locale name contains an encoding after the dot, return it. */ const char *dot = strchr (locale, '.'); if (dot != NULL) { const char *modifier; dot++; /* Look for the possible @... trailer and remove it, if any. */ modifier = strchr (dot, '@'); if (modifier == NULL) return dot; if (modifier - dot < sizeof (buf)) { memcpy (buf, dot, modifier - dot); buf [modifier - dot] = '\0'; return buf; } } /* Resolve through the charset.alias file. */ codeset = locale; } else { /* OS/2 has a function returning the locale's codepage as a number. */ if (DosQueryCp (sizeof (cp), cp, &cplen)) codeset = ""; else { sprintf (buf, "CP%u", cp[0]); codeset = buf; } } #endif if (codeset == NULL) /* The canonical name cannot be determined. */ codeset = ""; /* Resolve alias. */ for (aliases = get_charset_aliases (); *aliases != '\0'; aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) if (strcmp (codeset, aliases) == 0 || (aliases[0] == '*' && aliases[1] == '\0')) { codeset = aliases + strlen (aliases) + 1; break; } /* Don't return an empty string. GNU libc and GNU libiconv interpret the empty string as denoting "the locale's character encoding", thus GNU libiconv would call this function a second time. */ if (codeset[0] == '\0') codeset = "ASCII"; return codeset; } sitecopy-0.16.6/intl/vasnwprintf.h0000644000076400007640000000330610243450467015276 0ustar joejoe/* vswprintf with automatic memory allocation. Copyright (C) 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _VASNWPRINTF_H #define _VASNWPRINTF_H /* Get va_list. */ #include /* Get wchar_t, size_t. */ #include #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). You can pass a preallocated buffer for the result in RESULTBUF and its size in *LENGTHP; otherwise you pass RESULTBUF = NULL. If successful, return the address of the string (this may be = RESULTBUF if no dynamic memory allocation was necessary) and set *LENGTHP to the number of resulting bytes, excluding the trailing NUL. Upon error, set errno and return NULL. */ extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...); extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args); #ifdef __cplusplus } #endif #endif /* _VASNWPRINTF_H */ sitecopy-0.16.6/TODO0000664000076400007640000001776310371115444012277 0ustar joejoe -*- text -*- Bugs: - "sitecopy foo bar" always process foo and bar in the order they are specified in the rcfile - review w.r.t djb's FTP interop notes, http://cr.yp.to/ftp.html - add support for MLST, latest draft: http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.txt - enable large file support by default when necessary. - Synch mode won't transfer in ASCII mode, nor maintain symlinks, nor correctly order file deletions. - Filename conflicts are not handled by update or synch mode: case: Directory exists remote called "foo". Delete locally, replace with file called "foo". Try an update. Bang. Another nice one is: mv foo tmp mv bar foo mv tmp bar Which, in renames mode, will be correctly discovered, but when we do an --update... bang. - "sitecopy --rcfile=/" should say the right thing - The man page does not make clear what "exclude" excludes *from*. The point that exclude will translate into deleting existing files from the remote site is important and confusing. Known Standards Compliance Problems: - RFC959: handle telnet control characters? - RFC2518: accept collection URI's in DAV:href without trailing slash - RFC2617: support 'domain' * anything with (FEAPI) after requires frontend API change, not including simple config options additions - Move use_this out of struct site, use proper data structures in console frontend to represent sites passed on cmd line. - Anything in the below list. - Do the hash table thang. Required Features for one-point-oh: - Verify mode, also a --force-overwrite to force updates... maybe --prompt-overwrite too. - Filename conflict resolution for update mode, as per bug... or at LEAST, conflict detection: can be done in file_set, not too hard probably. - Read HTTP proxy from HTTP_PROXY/http_proxy environment variable. - Document files list order dependancies. - Do default ports, netrc lookups for the proxy too - Report corrupt info files back to the user (FEAPI) - Check write return codes in site_writefiles, signal the error if the info file doesn't get written properly. - Get warning (i.e. non-fatal) messages to the user. - Check remote directory exists on initial connection in FTP (chdir/ls) - In davdriver.c:dir_remove, check whether the collection is empty before deleting it. - Because it's The Right Thing, add hash table indexing of files list. Hash using DJBs *33 hash algorithm. Open hash so we don't have worry about filling the table up. Size the hash table in the range 100kB-200kB to not give too much run-time bloat, but not to fill up with reasonable-sized sites too quickly. Maybe do a user survey to determine optimum hash-table size. - "include" option to mirror "exclude". "Would be Nice to Have But We Can Live Without" features: - "sftp" support; FTP-over-SSL - Console: don't read local site state in --fetch mode. - Support FTP proxying (how?): there are several different ways this is done... - Support for Content-MD5 header and allow server-side MD5'ing, rather than having to download, checksum and discard. (remote-checksum) - Symlink 'maintain' mode for FTP: can you create symlinks over FTP??? - Write complete documentation using GNU texinfo or DocBook, for a printed manual and info pages. Possible features, which need more consideration: - Per-site lockfiles (FEAPI) - Shortcircuit parm in file_set_* used for the FIRST site state read on a site, to make the file search always fail - guarantee to be true, since if we read local state before stored state, there is no stored state in the list when we read the local state. - Console: Some kind of 'first-time-use' option, `sitecopy --first-time' runs a wizard a la the GNOME fe's one. - Support for other better/faster checksumming algorithms: is SHA1 better/faster? (GPL implementation in GnuPG) - Backup info file on write_stored... optionally? Only implement in frontend? GNU-style $VERSION_CONTROL support? - Have 'preconnect' and 'postconnect' options which run user-specified programs before and after an update, synch etc. - Some kind of user-feedback for slow startup in checksumming mode. takes approx 1 sec to MD5 a 10mb file on a K5 166 -> okay for average-sized sites. (FEAPI)... - Abstract protocol drivers into a mc VFS-like 'open', 'read' etc. Abstract sites code so that "local" and "remote" can be handled by any of {file, http, ftp}. Then, update + synch could possibly merge, since an synch is an update with the remote and local sides switched (kindof). - Allow file->file sites (screem wants this)... as above, or simply by implementing another protocol driver. - consequently, read ls-laR.txt files and be more like 'mirror' - Add quota management, specify a per-site quota and only do update if the result means the site will stay under quota. -> problem: a directory uses up k's, but how many? - Abstract protocol drivers into a mc VFS-like 'open', 'read' etc. Abstract sites code so that "local" and "remote" can be handled by any of {file, http, ftp}. Allows file->file sites, which screem wants. - Read ls-laR.txt files and be more like 'mirror' Evaluation of sitecopy alternatives: weex - weex beats sitecopy hands-down in new user ease-of-use: you just run it. With sitecopy you have to do --fetch or --catchup first. This situation is slightly improved in 0.9, where on the first 'sitecopy newsite' invocation, you get told what to do next. - sitecopy could improve by doing: an interactive 'on first run for site', like the GNOME fe site creation wizard. This could create the .sitecopy directory with the correct permissions (but I am a bit dubious about this). - Another alternative is the --first-time option. This could do: mkdir .sitecopy with correct perms create .sitecopyrc with correct perms ? enter a complete site definition, and run --init, or --fetch, or catchup, as appropriate. This could either be run automagically if no .sitecopyrc file is found (don't let trigger by --rcfile= option), or, better, by a message telling you to run --first-time. --new-user might be better... Definitely Not-till-after-1.0 thinkings: The current "file list" is bad. It is pseudo-sorted by depth (probably). The GNOME fe wants a proper directory tree representation. To allow the possibility of doing the "spot moved directories" test, we might want a proper dirtree; but, this is a complex task, and might be achieved in another way. To get decent "checkmoved" operation, need better than O(n) lookup. O(1)-ish could be achieved using a a hash table. - Find operation on the files list is O(n), making state reads O(n^2). Hashing would be nice -> can use the MD5 csum. - Intelligent file movement detector, to spot whole moved directories: Possibly implement by checksumming relative filenames for EACH directory (fairly nasty overhead); so each directory has a children_checksum field. Need a clever checksumming algo; MD5 would require identical ordering, which would be a heavy constraint. - Make the protocol drivers and sites code thread-safe. Things You Might Like to Do On A Rainy Day: - Investigate any extra handling needed for servers which have case insensitive filenames - Native Windows port (e.g. reimplement socket.c using the Winsock API) - Convince the maintainer that it's more productive to spend time implementing features than carefully crafting a mile-long TODO list. XSitecopy TODO -------------- - Tooltip(s) for the site widgets; specifically safe mode. - Integrating resynch into the app. - View files using gnome mime types. - Transition from time-size to checksum. * Prefs Future releases: - Bring back optional 'slim' mode which will take up less desktop real estate. - Popup menus for the site/file tree. - Single file updates. - Update all. Longer term things: - Panel applet for easily updating sites in a couple of clicks. - Html based reports - integration into FE apps, and possible auto uploading to the remote site. (useful as a "recent changes" page) * Please send any suggestions you may have as to the format/design/type of reports that you might find useful. sitecopy-0.16.6/install-sh0000775000076400007640000001272110165765223013607 0ustar joejoe#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: 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 sitecopy-0.16.6/THANKS0000664000076400007640000000377310232763526012524 0ustar joejoeThanks to all the following contributors of code, ideas, bug reports, encouragement, translations, suggestions, etc (alphabetical order): A. Sinan Unur Aloril Andrey A. Chernov Andy Cowling Bob van der Poel Cristian Rigamonti David Gibbs David Massart David Knight Dobrica Pavlinusic Fabrice Noilhan Gal Goldschmidt Graham Todd H. Henning Vossieck Hans Meine James Youngman Jonathan Paisley Juergen Daubert Karl Ove Hufthammer Lee Mallabone Masayuki Hatta Michael Lindner Nathan Hand Niall Smart Nik Clayton Nobuyuki Tsuchimura Olaf Hering Olivier Calle David Madore Peter Moulder Petr Prazak Phil Davis Phillip Cole Rob Funk Ross Nicoll Shaun Steinhorst Steffen Siebert Sylvain 'Murdock' Glaize Thomas Schultz Volker Kuhlmann Yoram Last Thanks also to originators-of-stolen-code: Alain Magloire Eric S Raymond Gordon Matzigkeit Ulrich Drepper sitecopy owes a dept of thanks to all those who have contributed to neon, so see the THANKS file in neon too. And last but by no means least, for hosting everything: Greg Stein sitecopy-0.16.6/doc/0000775000076400007640000000000011037462323012337 5ustar joejoesitecopy-0.16.6/doc/sitecopy.fr.10000664000076400007640000006456310167757211014712 0ustar joejoe.\" Copyright 1999-2001 Joe Orton .\" Relecture Gérard Delafond .TH sitecopy 1 "June 2001" sitecopy "User Manuals" .SH NOM sitecopy \- Maintient à jour des copies distantes de sites web .SH SYNOPSIS .B sitecopy [options] [mode opératoire] .I nomdusite .B ... .SH DESCRIPTION .I sitecopy sert à copier des sites web stockés localement vers des serveurs web distants. Une simple commande va mettre à jour sur le serveur les fichiers modifiés localement, et supprimer du serveur les fichiers supprimés localement, maintenant ainsi le site distant à jour avec le site local. L'objectif est de supprimer l'étape très pénible de mise à jour et de suppression de fichiers individuels avec un client FTP. \fBsitecopy\fP peut également repérer les fichiers que vous avez déplacés localement pour les déplacer sur le site distant. FTP, WebDAV et autres serveurs de publication basés sur HTTP (comme par exemple AOLserver et Netscape Enterprise) sont également gérés. .SH POUR COMMENCER Cette section explique comment mettre en place la maintenance d'un site web à l'aide de \fBsitecopy\fP. Après avoir présenté les rudiments, on examinera deux situations\ : d'abord celle où vous avez déjà placé votre site sur le serveur distant, puis celle où vous ne l'avez pas encore fait. .SS Rudiments Si vous ne l'avez pas déjà fait, il vous faut créer un fichier de configuration qui contiendra les informations relatives aux sites que vous désirer administrer. Vous devez également créer un répertoire dans lequel \fBsitecopy\fP stockera l'état des fichiers de chacun des sites distants. Le fichier de configuration ainsi que le répertoire de stockage de l'état des fichiers doivent n'être accessibles que par vous-même -- sans quoi \fBsitecopy\fP refusera de démarrer. Pour créer le répertoire de stockage avec les permissions adéquates, utilisez la commande .br .B " mkdir -m 700 .sitecopy" .br depuis votre répertoire personnel. Pour créer le fichier de configuration, utilisez les commandes .br .B " touch .sitecopyrc" .br .B " chmod 600 .sitecopyrc" .br depuis votre répertoire personnel. Ceci fait, éditez le fichier de configuration pour ajouter les détails relatifs à votre site comme indiqué à la section CONFIGURATION. .SS Si le site distant existe déjà Si vous aviez déjà placé votre site sur le serveur distant, assurez-vous que vos fichiers locaux soient synchronisés avec les fichiers distants. Ensuite, lancez .br .B " sitecopy --catchup nomdusite" .br où nomdusite est le nom du site que vous avez indiqué après le mot-clé .B site dans le fichier de configuration. Si vous n'avez pas de copie locale du site distant, vous pouvez utiliser le .B mode récupération pour découvrir le contenu du site distant, et le .B mode synchronisation pour le télécharger. Le mode récupération marche bien avec les serveurs WebDAV, et peut marcher avec les serveurs FTP. Tapez .br .B " sitecopy --fetch nomdusite" .br pour récupérer les informations sur les fichiers du site\ ; en cas de succès, tapez .br .B " sitecopy --synch nomdusite" .br pour télécharger une copie locale. N'effectuez PAS ces opérations si vous avez déjà une copie locale de votre site. .SS Si le site distant n'existe pas encore Assurez-vous que l'administrateur ait bien créé la racine du site distant. Tapez .br .B " sitecopy --init nomdusite" .br où nomdusite est le nom du site que vous avez indiqué après le mot-clé .B site dans le fichier de configuration. .SS Maintenance du site Après avoir mis en place le site comme décrit dans une des deux sections ci-dessus, vous pouvez commencer à éditer vos fichiers locaux normalement. Lorsque vous en avez fini avec un ensemble de changements, et que vous voulez mettre à jour la copie distante de votre site, tapez .br .B " sitecopy --update nomdusite" .br et tous les fichiers modifiés seront remontés sur serveur. Tout fichier localement supprimé sera également suppprimé sur le serveur, à moins que l'option .B nodelete n'ait été spécifiée dans le fichier de configuration. Si vous déplacez un ou plusieurs fichiers entre deux répertoires, leurs copies distantes seront supprimées du serveur, puis remontées à nouveau, à moins que l'option .B checkmoved n'ait été spécifiée dans le fichier de configuration. À tout moment, si vous désirez voir la liste des changements effectués au site local depuis la dernière mise à jour, pour pouvez lancer .br .B " sitecopy nomdusite" .br qui affichera la liste des différences. .SS Problèmes de synchronisation Dans certaines circonstances, les fichiers qui constituent réellement le site distant diffèrent de ce que \fBsitecopy\fP .I pense qu'il y a sur le site. Cela peut arriver, par exemple, si la connexion au serveur est interrompue durant une mise à jour. Dans cette situation, vous devriez utiliser le .B mode récupération pour retrouver du serveur distant la liste des fichier qui constitue le site. .SH INVOCATION Pour une opération normale, spécifiez un .I simple mode opératoire, suivi par les options que vous avez choisies, puis un ou plusieurs nom de sites. Par exemple, .br .B " sitecopy --update --quiet siteprincipal autresite" .br mettra à jour silencieusement les sites appelés «\ siteprincipal\ » et «\ autresite\ ». .SH MODES OPÉRATOIRES .IP "-l, --list" .B Mode Liste \- produit une liste de toutes les différences entre les fichiers locaux et leur copie distante pour les sites spécifiés. .IP "-ll, --flatlist" .B Mode Liste plate \- similaire au mode liste, mais la sortie produite convient à une analyse ultérieure par un script externe ou un programme. Le script AWK fourni, .B changes.awk. produit par exemple une page HTML depuis une sortie produite par ce mode. .IP "-u, --update" .B Mode Mise à jour \- Met à jour la copie distante des sites spécifiés. .IP "-f, --fetch" .B Mode Récupération \- Récupère la liste des fichiers du serveur distant. Notez qu'en FTP le support de ce mode est limité -- le serveur doit accepter la commande .B MDTM , et utiliser un programme «\ ls\ » de type Unix comme implémentation de la commande LIST. .IP "-s, --synchronize" .B Mode Synchronisation \- Met à jour la copie .I locale du site à partir de la copie distante. .B AVERTISSEMENT\ : Ce mode écrase les fichiers locaux. À utiliser avec précaution. .IP "-i, --initialize" .B Mode Initialisation \- initialise les sites spécifiés, \fBsitecopy\fP pensant alors qu'il n'y a AUCUN fichier sur le serveur distant. .IP "\-c, \-\-catchup" .B Mode Rendre identique \- amène \fBsitecopy\fP à penser que les copies locale et distante du site sont identiques. .IP "-v, --view" .B Mode Voir configuration \- Affiche toutes les définitions de sites du fichier de configuration. .IP "-h, --help" Affiche un message d'aide. .IP "-V, --version" Affiche le numéro de version. .SH OPTIONS .IP "-y, --prompting" Valable seulement pour le .B Mode Mise à jour , demande à l'utilisateur de confirmer chaque mise à jour (i.e., création d'un répertoire, remontée d'un fichier sur le site distant, etc.). .IP "-r FICHIER, --rcfile=FICHIER" Spécifie un fichier de configuration alternatif pour l'exécution en cours. .IP "-p RÉPERTOIRE, --storepath=RÉPERTOIRE" Spécifie un chemin d'accès alternatif au répertoire contenant les informations sur les fichiers du site distant, pour l'exécution en cours. .IP "-q, --quiet" Sortie discrète - n'affiche que le nom du fichier pour chaque mise à jour effectuée. .IP "-qq, --silent" Sortie silencieuse - n'affiche aucune information lors des mises à jour. .IP "-o, --show-progress" Valable seulement pour le .B Mode Mise à jour , affiche la progression (sous forme de pourcentage effectué) du transfert de données. .IP "-k, --keep-going" Passe outre les erreurs en .B Mode Mise à jour ou en .B Mode Synchronisation .IP "-a, --allsites" Exécute l'opération donnée pour tous les sites - valable pour tous les modes, sauf le .B Mode Voir configuration , pour lequel cette option est sans effet. .IP "-d MASQUE, --debug=CLÉ[,CLÉ...]" Affiche des informations de débogage. Vous devez donner une liste de mots-clés séparés par une virgule. Chaque mot-clé peut être, au choix\ : .br socket Manipulation des sockets .br files Manipulation des fichiers .br rcfile Analyseur du fichier de configuration .br http Pilote HTTP .br httpbody Affiche le corps des réponses HTTP .br ftp Pilote FTP .br xml Informations d'analyse syntaxique XML .br xmlparse Informations d'analyse syntaxique XML de bas niveau .br httpauth Informations d'authentification HTTP .br cleartext Affiche les mots de passe en clair Les mots de passe seront masqués dans l'affichage de débogage, à moins que le mot-clé cleartext ne soit utilisé. Un exemple de l'utilisation des informations de débogage est de déboguer le mode récupération FTP\ : .br .B " sitecopy --debug=ftp,socket --fetch nomdusite" .br .SH CONCEPTS L' .B état stocké d'un site est un instantané de l'état du site, conservé dans le répertoire de stockage (~/.sitecopy/). Le .B fichier de stockage sert à conserver cet état entre deux invocations du programme. En mode mise à jour, \fBsitecopy\fP construit une .B liste de fichiers pour chaque site en parcourant le répertoire local, prend connaissance de l'état stocké et, en comparant les deux, détermine quels fichiers ont changé, lesquels ont été déplacés, et ainsi de suite. .SH CONFIGURATION La configuration est assurée par le fichier de configuration (fc). Ce fichier contient une ou plusieurs définitions de sites. Un nom unique est attribué à chaque définition de site\ ; c'est par ce nom qu'on se réfère à un site en ligne de commande. .PP Chaque définition de site contient les détails du serveur sur lequel est stocké le site, la manière dont on peut accéder à ce serveur, l'emplacement local et distant du site, ainsi que des options pour ce site si nécessaire. .SS Définition d'un site La définition d'un site est constituée d'une série de lignes\ : .BR "site " nom-du-site .br .BR " server " nom-du-serveur .br .BR " remote " répertoire-racine-distant .br .BR " local " répertoire-racine-local .br .br [ .BR port " numéro-de-port ]" .br [ .BR username " utilisateur ]" .br [ .BR password " mot-de-passse ]" [ .BR "proxy-server " nom-du-proxy .br .BR " proxy-port " "numero-port-proxy ]" [ .BR "url " "URL-du-site ]" .br [ .BR "protocol " "{ ftp | webdav } ]" .br [ .BR ftp " nopasv ]" .br [ .BR ftp " showquit ]" .br [ .BR ftp " { usecwd | nousecwd } ]" .br [ .BR http " expect ]" .br [ .BR http " secure ]" [ .BR safe " ]" .br [ .BR "state " "{ checksum | timesize } ]" [ .BR permissions " { ignore | exec | all } ]" [ .BR symlinks " { ignore | follow | maintain } ]" [ .BR nodelete " ]" [ .BR nooverwrite " ]" [ .BR checkmoved " [renames] ]" [ .BR tempupload " ]" [ .BR exclude " motif ]..." [ .BR ignore " motif ]..." [ .BR ascii " motif ]..." Tout ce qui suit le caractère # sur une ligne est considéré comme un commentaire et est ignoré. Les valeurs peuvent être entourées par des guillemets, et les caractères peuvent être échappés par une contre-oblique (\\). Par exemple, pour utiliser le motif d' .B exclusion *#, utilisez la ligne suivante: .br .BR " exclude " """*#""" .SS Options pour le serveur distant La clé .B server est utilisée pour spécifier le serveur distant sur lequel est stocké le site distant. Cela peut être un nom DNS ou une adresse IP. La connexion au serveur se fera sur le port par défaut pour le protocole utilisé, ou bien par le numéro indiqué par le mot-clé .B port. \fBsitecopy\fP gère les protocoles WebDAV ou FTP -- le mot-clé .B protocol spécifie lequel utiliser, en prenant comme valeur .B webdav ou .B ftp respectivement. Le protocole par défaut est FTP. Les mots-clés .B proxy-server et .B proxy-port peuvent être utilisés pour spécifier un serveur de proxy. Les serveurs de proxy ne sont gérés qu'avec le protocole webDAV. Si le serveur FTP ne gère pas le mode passif (PASV), utilisez l'option .B ftp nopasv. Pour afficher le message retourné par le serveur à la fermeture de la connexion, utilisez l'option .B ftp showquit. Si le serveur ne permet la remontée des fichiers que dans le répertoire courant, utilisez le mot-clé .B ftp usecwd (un symptôme possible est le message\ : "overwrite permission denied"). Notez que le répertoire racine distant (mot-clé .B remote\fP) doit être un chemin absolu (qui commence par '/'), sans quoi .B usecwd sera ignoré. Si le serveur WebDAV utilise correctement le message d'attente 100-continue, comme par exemple Apache version 1.3.9 et supérieure, utilisez le mot-clé .B http expect. Cela peut économiser de la bande passante ainsi que réduire le temps nécessaire à une mise à jour. Pour authentifier l'utilisateur sur le serveur, utilisez les mots-clés .B username et .B password. Si le mot de passe n'est pas spécifié, il sera recherché dans le fichier .B ~/.netrc s'il existe. Voyez ftp(1) pour la syntaxe de ce fichier. Pour le protocole WebDAV, l'authentification basique et par condensé (digest authentication) sont gérées. Notez que vous ne devriez pas utiliser l'authentification basique, à moins que vous ne considériez la connexion au serveur comme digne de confiance. Vous pouvez spécifier l'URL complète pour accéder au site avec le mot-clé .B url. Elle n'est utilisée qu'en mode liste plate, afin qu'elle puisse figurer dans les pages«\ Changements récents\ ». L'URL ne doit .I pas se terminer par une barre oblique (/)\ ; un exemple valide est .br .BR " url " http://www.site.com/monsite Si vous spécifiez l'option .B tempupload, les fichiers modifiés sont transmis au serveur distant avec un préfixe «\ .in.\ », puis renommés (par déplacement) en leur nom d'origine une fois remontés complètement. .SS État des fichiers L'état d'un fichier est conservé dans le fichier de stockage associé (dans ~/.sitecopy/*), et sert à déterminer quand le fichier a été modifié. Il y a deux méthodes possibles, qui peuvent être choisies via le mot-clé .B state , avec comme paramètre .B timesize (par défaut), ou .B checksum. .B timesize utilise la date de dernière modification et la taille du fichier pour détecter s'il a changé. .B checksum utilise une somme de contrôle MD5 pour détecter toute modification dans le contenu du fichier. Notez que calculer une somme de contrôle implique de lire le contenu entier du fichier\ ; et est plus lent que d'utiliser simplement la date de dernière modification et la taille. Cela peut être utile par exemple si vous utilisez un système de gestion de versions qui change la date de dernière modification des fichiers à chaque extraction d'une copie de travail («\ checkout\ »), alors que le contenu des fichiers n'est en réalité pas modifié. .SS Mode Sécurisé Vous pouvez passer en .B Mode Sécurisé grâce au mot-clé .B safe. Dans ce mode, chaque fois qu'un fichier est remonté sur le serveur, la date de modification du fichier .B telle qu'elle apparaît sur le serveur est conservée. Par la suite, lorsque le fichier a été changé localement et doit être à nouveau remonté sur le serveur, la date de modification actuellement conservée côté serveur est récupérée puis comparée avec la date locale. En cas de différence, cela signifie que la copie sur le serveur a été changée par une tierce partie\ ; un message d'avertissement est produit, et votre copie locale n'écrasera pas la copie distante, prévenant ainsi la suppression de toute modification. Le mode sécurisé peut être utilisé avec des serveurs FTP ou WebDAV, mais si Apache/mod_dav est utilisé, il faut une version de mod_dav au moins égale à 0.9.11. .B Note Le mode sécurisé ne peut être utilisé conjointement avec l'option .B nooverwrite (voir plus bas). .SS Emplacements de stockage des fichiers du site Le mot-clé .B remote spécifie le répertoire racine de la copie distante du site. Vous pouvez le donner sous la forme d'un chemin absolu, comme\ : .br .BR " remote " /www/monsite/ .br Si vous utilisez le protocole FTP, vous pouvez également spécifier le répertoire sous la forme d'un chemin relatif au répertoire de connexion\ ; il doit être dans ce cas préfixé par «\ ~/\ », comme par exemple\ : .br .BR " remote " ~/public_html/ .PP Le mot-clé .B local spécifie le répertoire qui sert localement de stockage aux fichiers du site. Cela peut être un chemin absolu ou relatif à votre répertoire personnel (donné par la variable d'environnement $HOME), encore une fois en usant du préfixe «\ ~/\ ». .br .BR " local " "~/html/lesite/" .br .BR " local " "/home/fred/html/lesite/" .br sont équivalents, si $HOME est fixé à «\ /home/fred\ ». Pour les deux mots-clés local et remote, le chemin spécifié peut se terminer par une barre oblique, mais ça n'est pas obligatoire. .SS Traitement des permissions des fichiers Le traitement des permissions des fichiers est contrôlé par le mot-clé .B permissions , qui peut prendre une de ces trois valeurs\ : .TP .B ignore pour ignorer complètement les permissions des fichiers, .TP .B exec pour propager les permissions des fichiers exécutables uniquement, .TP .B all pour propager les permissions de tous les fichiers. .PP Vous pouvez utiliser ce mot-clé par exemple pour vous assurer que les permissions de vos scripts CGI soient correctes. Cette option est pour le moment ignorée des serveurs WebDAV. Avec les serveurs FTP, un .B chmod est exécuté côté serveur pour modifier les permissions. .SS Traitement des liens symboliques Les liens symboliques trouvés sur le site local peuvent être au choix ignorés, suivis ou maintenus. En mode «\ follow\ », le fichier référencé par un lien symbolique sera remonté à l'emplacement du lien sur le site distant. En mode «\ maintain\ », le lien sera aussi créé sur le site distant (voir ci-dessous). Le mode utilisé pour chaque site est spécifié par le mot-clé .B symlinks , qui peut prendre la valeur .B ignore, .B follow ou .B maintain. Le mode par défaut est .B ignore, i.e. les liens symboliques trouvés sur la copie locale du site sont ignorés. .SS Maintenance des liens symboliques Ce mode est n'actuellement supporté que par les serveurs WebDAV implémentant WebDAV Advanced Collections, qui est en cours de développement. Dans ce mode, la cible du lien sur le serveur est littéralement copié à partir de la cible du lien symbolique. Astuce\ : vous pouvez utiliser des URL si vous le désirez\ : .br .B " ln -s" """http://www.quelquepart.org/""" quelquepart De cette façon , un ordre "302 Redirect" peut être facilement mis en place depuis le client, sans altérer la configuration du serveur. .SS Suppression et déplacememnt des fichiers distants Vous pouvez utiliser l'option .B nodelete pour empêcher les fichiers distants d'être jamais supprimés. Cela peut être utile si vous conservez de grosses quantités de données sur le serveur, dont vous ne voudriez pas pour autant conserver de copie locale. Si votre serveur ne permet pas l'écrasement de fichiers existants par ceux que vous remontez, utilisez l'option .B nooverwrite. Dans ce cas, avant de remonter un fichier, \fBsitecopy\fP supprimera au préalable la copie distante. Si vous utilisez l'option .B checkmoved, \fBsitecopy\fP cherchera si des fichiers ont été déplacés localement. Si c'est le cas, lors de la mise à jour du site, ces fichiers seront aussi déplacés sur le site distant. Avec l'option .B checkmoved renames, \fBsitecopy\fP cherchera si des fichiers ont été localement déplacés ou renommés. Cette option n'est utilisable qu'en conjonction avec l'option .B state checksum. .B AVERTISSEMENT Si vous n'utilisez pas de somme de contrôle MD5 pour déterminer l'état des fichiers (i.e. avec l'option .B state checksum ) N'UTILISEZ PAS non plus l'option .B checkmoved si vous avez tendance à mettre dans des répertoires différents des fichiers de même nom, taille et date de modification. Le risque d'écrasement est improbable, mais ne dites pas que vous n'aviez pas été prévenu. .SS Exclure des fichiers Certains fichiers peuvent être ignorés de \fBsitecopy\fP par l'emploi du mot-clé .B exclude, qui accepte des motifs d'expressions rationnelles à la manière du shell. Par exemple, utilisez .br .BR " exclude " "*.bak" .br .BR " exclude " *~ .br .BR " exclude " """#*#""" .br pour exclure tous les fichiers qui portent l'extension .bak, se terminent par un tilde (~) ou qui commencent et se terminent par un dièse. N'oubliez pas d'échapper ou d'entourer de guillemets le motif s'il inclut un dièse ! Pour exclure des fichiers d'un répertoire particulier, préfixez simplement le motif par le nom du répertoire -- en commençant par une barre oblique. Par exemple, .br .BR " exclude " "/docs/*.m4" .br .BR " exclude " "/files/*.gz" .br excluera tous les fichiers à l'extension .m4 dans le sous-répertoire «\ docs\ », et tous les fichiers à l'extension .gz dans le sous-répertoire «\ files\ ». Un répertoire entier peut également être exclu -- en omettant la barre oblique à la fin du nom du répertoire. Par exemple, .br .BR " exclude " "/quelque/part" .br .BR " exclude " "/autre/part" .br excluera les sous-répertoires du site «\ quelque/part\ » et «\ autre/part\ ». Les motifs d'exclusion sont examinés lorsque \fBsitecopy\fP parcourt le répertoire local. Un fichier qui correspond à n'importe lequel des motifs ne sera pas ajouté à la liste des fichiers. Cela signifie qu'un fichier déjà remonté sur le serveur qui correspond à un motif d'exclusion sera supprimé du serveur. .SS Ignorer les changements des fichiers locaux Utilisez l'option .B ignore pour indiquer à \fBsitecopy\fP qu'il doit ignorer les modifications locales apportées aux fichiers du site. Si un changement est fait au contenu d'un fichier ignoré, le fichier ne sera .B pas remonté sur le serveur en mode mise à jour. Les fichiers ignorés seront toutefois créés, déplacés et supprimés comme en temps normal. L'option .B ignore s'utilise de la même manière que l'option .B exclude. Notez que le mode synchronisation .B écrasera les changements apportés aux fichiers ignorés. .SS Mode de transfert par FTP Pour spécifier le mode de transfert des fichiers par FTP, utilisez le mot-clé .B ascii. Tout fichier transféré en utilisant le mode ASCII verra ses caractères de fin de ligne (CRLF/LF) interprétés de façon appropriée. Par exemple, utilisez .br .BR " ascii " "*.pl" .br pour remonter tous les fichiers à l'extension .pl comme des fichiers texte ASCII. Ce mot-clé est actuellement sans effet avec les serveurs WebDAV. .SH VALEURS DE RETOUR Les valeurs de retour possibles dépendent du mode opératoire. Si plusieurs sites sont spécifiés en ligne de commande, la valeur de retour correspondra aux opérations effectuées pour le dernier des sites spécifiés. .SS Pour le mode mise à jour -1 ... la mise à jour n'a pas pu démarrer - problème de configuration 0 ... la mise à jour s'est parfaitement effectuée. 1 ... il y a eu un problème pendant la mise à jour 2 ... impossible de se connecter ou s'authentifier auprès du serveur .SS Pour le mode liste (mode par défaut) -1 ... impossible de former la liste - problème de configuration 0 ... le site distant n'a pas besoin de mise à jour 1 ... le site distant nécessite une mise à jour .SH CONTENU DU FICHIER DE CONFIGURATION D'EXEMPLE .SS Serveur FTP, usage simple Le site de Fred est remonté sur un serveur FTP nommé «\ my.server.com\ » et maintenu dans le répertoire «\ public_html\ » situé dans le répertoire de connexion. Le site est conservé en local dans le répertoire /home/fred/html. site mysite server my.server.com url http://www.server.com/fred username fred password juniper local /home/fred/html/ remote ~/public_html/ .SS Serveur FTP, usage avancé Ici, le site de Freda est remonté sur un serveur FTP nommé «\ ftp.elsewhere.com\ » et maintenu dans le répertoire /www/freda. Le site est conservé en local dans le répertoire /home/freda/sites/elsewhere/ site anothersite server ftp\.elsewhere\.com username freda password blahblahblah local /home/freda/sites/elsewhere/ remote /www/freda/ # Freda veut ignorer les fichiers à l'extension .bak ou # se terminant par un ~: exclude *.bak exclude *~ .SS Serveur WebDAV, usage simple Cet exemple montre comment définir un site avec un serveur WebDAV. site supersite server dav.wow.com protocol webdav username pow password zap local /home/joe/www/super/ remote / .SH FICHIERS .I ~/.sitecopyrc Emplacement par défaut du fichier de configuration. .br .I ~/.sitecopy/ Répertoire de stockage des informations sur les fichiers du site distant. .br .I ~/.netrc Informations relatives aux comptes sur des serveurs distants. .br .SH BOGUES Problèmes connus\ : Les modes récupération et synchronisation ne sont PAS fiables avec le protocole FTP. Si vous avez besoin d'opérations atomiques de récupération d'informations et de synchronisation de fichiers, n'utilisez pas sitecopy\ ; essayez plutôt rsync. .PP Veuillez envoyer vos rapports d'anomalies et demandes d'améliorations à plutôt qu'à l'auteur lui-même, puisque la liste de diffusion archive ses messages et les vôtres pourraient être utiles à d'autres utilisateurs. .SH VOIR AUSSI rsync(1), ftp(1), mirror(1) .SH STANDARDS [Cités seulement pour référence, l'auteur ne revendique aucune conformité à aucun de ces standards.] .BR "RFC 959" " - File Transfer Protocol (FTP)" .br .BR "RFC 1521" " - Multipurpose Internet Mail Extensions Part One" .br .BR "RFC 1945" " - Hypertext Transfer Protocol -- HTTP/1.0" .br .BR "RFC 2396" " - Uniform Resource Identifiers: Generic Syntax" .br .BR "RFC 2518" " - HTTP Extensions for Distributed Authoring -- WEBDAV" .br .BR "RFC 2616" " - Hypertext Transfer Protocol -- HTTP/1.1" .br .BR "RFC 2617" " - HTTP Authentication" .br .BR "REC-XML" " - Extensible Markup Language (XML) 1.0" .br .BR "REC-XML-NAMES" " - Namespaces in XML" .SH ÉBAUCHES DE STANDARDS .BR "draft-ietf-ftpext-mlst-05.txt" " - Extensions to FTP" .br .BR "draft-ietf-webdav-collections-protocol-03.txt" " - WebDAV Advanced Collections Protocol" .SH AUTEURS Joe Orton et d'autres. .br e-mail: sitecopy@lyra.org .br www: http://www.lyra.org/sitecopy/ .SH TRADUCTION Nicolas Girard <\fIgirard_nicolas at yahoo.fr\fR>, 2004. .SH AVERTISSEMENT SUR LA TRADUCTION Il est possible que cette traduction soit imparfaite ou périmée. En cas de doute, veuillez vous reporter au document original en langue anglaise fourni avec le programme. sitecopy-0.16.6/doc/changes.awk0000664000076400007640000000623410165765223014466 0ustar joejoe# # This is a quick script to produce an HTML page from sitecopy -ll mode. # May be copied, redistributed, modified etc. under the terms # of the GNU GPL, see the COPYING file for full details. # Copyright (C) 1998-2002 Joe Orton # # To use it, run: # # sitecopy --flatlist sitename | gawk -f changes.awk > changes.html # # [mawk (v1.3.3) doesn't work: lacks strftime. Admittedly strftime # is used only for the "generated by sitecopy" message # at the end. Can replace with something like `date | getline now', # which should work for gawk and mawk but not e.g. Solaris awk. # It appears that there is no portable way of getting current time # in awk. However, see below BUGS list. # # Of course, what we really want is when sitecopy was run, # which needn't be the same as when this script is run. # # # BUGS: # # - Doesn't make any provision for strange filenames (containing # vertical bar (`|') or HTML-breaking things like `<', `&', `"' # etc.). # # (Could be addressed by doing HTML-encoding of filenames from within # sitecopy code, including encoding any `|' in filenames.) # # - Note that the timestamp in the output is when this awk script is # run, not when `sitecopy --flatlist' was run. (This isn't a # problem if you use the suggested pipe command, it's only relevant # if you run this script on previously-generated flatlist files.) # # (Could be addressed by adding date information to # `sitecopy --flatlist' output.) # BEGIN { # The field separator is the vertical bar FS = "|"; } # This is called to print an item. # hyperlink == 1 if the item should be hyperlinked, # else 0. function printitem( name ) { printf( "
  • " ); if( hyperlink ) printf( "", url, name ); printf( "%s", name ); if( hyperlink ) printf( "" ); printf( "\n" ); } # Called to print a MOVED item, with the new name of the # file and the old name function printmoved( name, oldname ) { printf( "
  • %s to %s\n", oldname, url, name, name ); } /^sitestart/ { print ""; print ""; print "Recent Changes"; print ""; print ""; print "

    Recent Changes

    "; url = $3 } /^siteend/ { if( $2 == "unchanged" ) { print "No changes have been recently made to the site."; } print "
    "; # Shameless plug. Remove it, go on, do it now. # Just comment out the next four lines with #'s like these ones. print "
    "; printf( "Generated %s by ", strftime() ); print "sitecopy" print "
    "; print ""; print ""; } /^sectstart/ { hyperlink = 1; if( $2 == "added" ) { print "

    Added Items

    "; } else if( $2 == "changed" ) { print "

    Changed Items

    "; } else if( $2 == "moved" ) { print "

    Moved Items

    "; } else if( $2 == "deleted" ) { print "

    Deleted Items

    "; hyperlink = false; } print "
      " } /^sectend/ { print "
    "; } /^item/ { if( $3 != "" ) { printmoved( $2, $3 ); } else { printitem( $2 ); } } sitecopy-0.16.6/doc/examplerc0000664000076400007640000000376410165765223014262 0ustar joejoe# # This document gives some example rcfile entries for sitecopy. # For more detailed documentation, see the man page, sitecopy.1 # (or run 'man sitecopy'). # # Fred's site is uploaded to the FTP server 'my.server.com' and held # in the directory 'public_html', which is in the login directory. The # site is stored locally in the directory /home/fred/html. site mysite server my.server.com url http://www.server.com/fred username fred password juniper local /home/fred/html/ remote ~/public_html/ # You can put more site definitions below. # Make the name of the site (i.e. 'mysite' above) easily # memorable, since you refer to sites by these names on # the command line, e.g.: # sitecopy --update mysite # to upload the recent changes to the above site. # You might want to use both the 'state checksum' and 'checkmoved # renames' options. This will mean that if you move or rename files # locally, they will be moved or renamed remotely, too. Using 'state # checksum' means that every file in your local site is read at # startup, which will cause a slower startup. # Here, Freda's site is uploaded to the FTP server 'elsewhere.com', # where it is held in the (absolute) directory /www/freda/. The local # site is stored in ~/sites/elsewhere/ (that is, $HOME/sites/elsewhere) site anothersite server elsewhere.com username freda password blahblah local ~/sites/elsewhere/ remote /www/freda/ # Use checksumming, and look for moved and renamed files state checksum checkmoved renames # Freda wants files with a .log extension to # excluded from the update exclude *.log # She also wants any changes to the file 'news.html' # in her site to be ignored ignore /news.html # Enough examples yet? # Here's one for WebDAV: site joehome server dav.wow.com protocol webdav username pow password zap local /home/joe/www/homepage/ remote /joe/ # That's enough. # # All server names and username/passwords given in this # file are fictitious. Please don't bother trying them. sitecopy-0.16.6/doc/update.sh0000775000076400007640000000074010165765223014167 0ustar joejoe#!/bin/sh # A sample script to create a 'Recent Changes' type file # for a site before each update. # (this file placed in the public domain) - Joe Orton #### Alter the following accordingly, else it won't work. #### html=~/sitedir/changes.html awkf=/usr/share/sitecopy/changes.awk sitename=mysite if sitecopy --list ${sitename} > /dev/null; then echo No changes to the site. exit fi sitecopy --flatlist ${sitename} | awk -f ${awkf} > ${html} sitecopy --update ${sitename} sitecopy-0.16.6/doc/xsitecopy.10000664000076400007640000000406310165765223014461 0ustar joejoe.TH xsitecopy "1" "September 2001" "Xsitecopy" sitecopy .SH NAME Xsitecopy \- manual page for sitecopy GNOME frontend .SH SYNOPSIS .B xsitecopy [\fIOPTION\fR...] .SH DESCRIPTION GNOME options .TP \fB\-\-disable\-sound\fR Disable sound server usage .TP \fB\-\-enable\-sound\fR Enable sound server usage .TP \fB\-\-espeaker\fR=\fIHOSTNAME\fR:PORT Host:port on which the sound server to use is running .HP \fB\-\-version\fR .PP Help options .TP -?, \fB\-\-help\fR Show this help message .TP \fB\-\-usage\fR Display brief usage message .PP GTK options .TP \fB\-\-gdk\-debug\fR=\fIFLAGS\fR Gdk debugging flags to set .TP \fB\-\-gdk\-no\-debug\fR=\fIFLAGS\fR Gdk debugging flags to unset .TP \fB\-\-display\fR=\fIDISPLAY\fR X display to use .TP \fB\-\-sync\fR Make X calls synchronous .TP \fB\-\-no\-xshm\fR Don't use X shared memory extension .TP \fB\-\-name\fR=\fINAME\fR Program name as used by the window manager .TP \fB\-\-class\fR=\fICLASS\fR Program class as used by the window manager .HP \fB\-\-gxid_host\fR=\fIHOST\fR .HP \fB\-\-gxid_port\fR=\fIPORT\fR .HP \fB\-\-xim\-preedit\fR=\fISTYLE\fR .HP \fB\-\-xim\-status\fR=\fISTYLE\fR .TP \fB\-\-gtk\-debug\fR=\fIFLAGS\fR Gtk+ debugging flags to set .TP \fB\-\-gtk\-no\-debug\fR=\fIFLAGS\fR Gtk+ debugging flags to unset .TP \fB\-\-g\-fatal\-warnings\fR Make all warnings fatal .TP \fB\-\-gtk\-module\fR=\fIMODULE\fR Load an additional Gtk module .PP GNOME GUI options .HP \fB\-\-disable\-crash\-dialog\fR .PP Session management options .TP \fB\-\-sm\-client\-id\fR=\fIID\fR Specify session management ID .TP \fB\-\-sm\-config\-prefix\fR=\fIPREFIX\fR Specify prefix of saved configuration .TP \fB\-\-sm\-disable\fR Disable connection to session manager .PP Sitecopy options .TP \fB\-d\fR, \fB\-\-debug\fR=\fILEVEL\fR Debugging level (sum of: 1=socket, 2=files, 4=rcfile, 8=WebDAV, 16=FTP, 32=XML, 64=GNOME ) .SH "SEE ALSO" The full documentation for .B Gnome is maintained as a Texinfo manual. If the .B info and .B Gnome programs are properly installed at your site, the command .IP .B info Gnome .PP should give you access to the complete manual. sitecopy-0.16.6/doc/sitecopy.10000664000076400007640000005405710506025207014267 0ustar joejoe.\" Copyright 1999-2001 Joe Orton .TH sitecopy 1 "June 2001" sitecopy "User Manuals" .SH NAME sitecopy \- maintain remote copies of web sites .SH SYNOPSIS .B sitecopy [options] [operation mode] .I sitename .B ... .SH DESCRIPTION .I sitecopy is for copying locally stored web sites to remote web servers. A single command will upload files to the server which have changed locally, and delete files from the server which have been removed locally, to keep the remote site synchronized with the local site. The aim is to remove the hassle of uploading and deleting individual files using an FTP client. sitecopy will also optionally try to spot files you move locally, and move them remotely. FTP, WebDAV and other HTTP-based authoring servers (for instance, AOLserver and Netscape Enterprise) are supported. .SH GETTING STARTED This section covers how to start maintaining a web site using sitecopy. After introducing the basics, two situations are covered: first, where you have already upload the site to the remote server; second, where you haven't. Lastly, normal site maintenance activities are explained. .SS Introducing the Basics If you have not already done so, you need to create an rcfile, which will store information about the sites you wish to administer. You also need to create a storage directory, which sitecopy uses to record the state of the files on each of the remote sites. The rcfile and storage directory must both be accessible only by you - sitecopy will not run otherwise. To create the storage directory with the correct permissions, use the command .br .B " mkdir -m 700 .sitecopy" .br from your home directory. To create the rcfile, use the commands .br .B " touch .sitecopyrc" .br .B " chmod 600 .sitecopyrc" .br from your home directory. Once this is done, edit the rcfile to enter your site details as shown in the CONFIGURATION section. .SS Existing Remote Site If you have already uploaded the site to the remote server, ensure your local files are synchronized with the remote files. Then, run .br .B " sitecopy --catchup sitename" .br where sitename is the name of the site you used after the .B site keyword in the rcfile. If you do not have a local copy of the remote site, then you can use .B fetch mode to discover what is on the remote site, and .B synchronize mode to download it. Fetch mode works well for WebDAV servers, and might work if you're lucky for FTP servers. Run .br .B " sitecopy --fetch sitename" .br to fetch the site - if this succeeds, then run .br .B " sitecopy --synch sitename" .br to download a local copy. Do NOT do this if you already have a local copy of your site. .SS New Remote Site Ensure that the root directory of the site has been created on the server by the server administrator. Run .br .B " sitecopy --init sitename" .br where sitename is the name of the site you used after the .B site keyword in the rcfile. .SS Site Maintenance After setting up the site as given in one of the two above sections, you can now start editing your local files as normal. When you have finished a set of changes, and you want to update the remote copy of the site, run: .br .B " sitecopy --update sitename" .br and all the changed files will be uploaded to the server. Any files you delete locally will be deleted remotely too, unless the .B nodelete option is specified in the rcfile. If you move any files between directories, the remote files will be deleted from the server then uploaded again unless you specify the .B checkmoved option in the rcfile. At any time, if you wish to see what changes you have made to the local site since the last update, you can run .br .B " sitecopy sitename" .br which will display the list of differences. .SS Synchronization Problems In some circumstances, the actual files which make up the remote site will be different from what sitecopy .I thinks is on the remote site. This can happen, for instance, if the connection to the server is broken during an update. When this situation arises, .B Fetch Mode should be used to fetch the list of files making up the site from the remote server. .SH INVOCATION In normal operation, specify a .I single operation mode, followed by any options you choose, then one or more site names. For instance, .br .B " sitecopy --update --quiet mainsite anothersite" .br will quietly update the sites named 'mainsite' and 'anothersite'. .SH OPERATION MODES .IP "-l, --list" .B List Mode \- produces a listing of all the differences between the local files and the remote copy for the specified sites. .IP "-ll, --flatlist" .B Flat list Mode \- like list mode, except the output produced is suitable for parsing by an external script or program. An AWK script, .B changes.awk. is provided which produces an HTML page from this mode. .IP "-u, --update" .B Update Mode \- updates the remote copy of the specified sites. .IP "-f, --fetch" .B Fetch Mode \- fetches the list of files from the remote server. Note that this mode has only limited support in FTP - the server must accept the .B MDTM command, and use a Unix-style 'ls' for LIST implementation. .IP "-s, --synchronize" .B Synchronize Mode \- updates the .I local site from the remote copy. .B WARNING: This mode overwrites local files. Use with care. .IP "-i, --initialize" .B Initialization Mode \- initializes the sites specified - making sitecopy think there are NO files on the remote server. .IP "\-c, \-\-catchup" .B Catchup Mode \- makes sitecopy think the local site is exactly the same as the remote copy. .IP "-v, --view" .B View Mode \- displays all the site definitions from the rcfile. .IP "-h, --help" Display help information. .IP "-V, --version" Display version information. .SH OPTIONS .IP "-y, --prompting" Applicable in .B Update Mode only, will prompt the user for confirmation for each update (i.e., creating a directory, uploading a file etc.). .IP "-r RCFILE, --rcfile=RCFILE" Specify an alternate run control file location. .IP "-p PATH, --storepath=PATH" Specify an alternate location to use for the remote site storage directory. .IP "-q, --quiet" Quiet output - display the filename only for each update performed. .IP "-qq, --silent" Very quiet output - display nothing for each update performed. .IP "-o, --show-progress" Applicable in .B Update Mode only, displays the progress (percentage complete) of data transfer. .IP "-k, --keep-going" Keep going past errors in .B Update Mode or .B Synch Mode .IP "-a, --allsites" Perform the given operation on all sites - applicable for all modes except .B View Mode, for which it has no effect. .IP "-d MASK, --debug=KEY[,KEY...]" Turns on debugging. A list of comma-separated keywords should be given. Each keyword may be one of: .br socket Socket handling .br files File handling .br rcfile rcfile parser .br http HTTP driver .br httpbody Display response bodies in HTTP .br ftp FTP driver .br xml XML parsing information .br xmlparse Low-level XML parsing information .br httpauth HTTP authentication information .br cleartext Display passwords in plain text Passwords will be obscured in the debug output unless the cleartext keyword is used. An example use of debugging is to debug FTP fetch mode: .br .B " sitecopy --debug=ftp,socket --fetch sitename" .br .SH CONCEPTS The .B stored state of a site is the snapshot of the state of the site saved into the storage directory (~/.sitecopy/). The .B storage file is used to record this state between invocations. In update mode, sitecopy builds up a .B files list for each site by scanning the local directory, reading in the stored state, and comparing the two - determining which files have changed, which have moved, and so on. .SH CONFIGURATION Configuration is performed via the run control file (rcfile). This file contains a set of site definitions. A unique name is assigned to every site definition, which is used on the command line to refer to the site. .PP Each site definition contains the details of the server the site is stored on, how the site may be accessed at that server, where the site is held locally and remotely, and any other options for the site. .SS Site Definition A site definition is made up of a series of lines: .BR "site " sitename .br .BR " server " server-name .br .BR " remote " remote-root-directory .br .BR " local " local-root-directory .br .br [ .BR port " port-number ]" .br [ .BR username " username ]" .br [ .BR password " password ]" [ .BR "proxy-server " proxy-name .br .BR " proxy-port " "port-number ]" [ .BR "url " "siteURL ]" .br [ .BR "protocol " "{ ftp | webdav } ]" .br [ .BR ftp " nopasv ]" .br [ .BR ftp " showquit ]" .br [ .BR ftp " { usecwd | nousecwd } ]" .br [ .BR http " expect ]" .br [ .BR http " secure ]" [ .BR safe " ]" .br [ .BR "state " "{ checksum | timesize } ]" [ .BR permissions " { ignore | exec | all | dir } ]" [ .BR symlinks " { ignore | follow | maintain } ]" [ .BR nodelete " ]" [ .BR nooverwrite " ]" [ .BR checkmoved " [renames] ]" [ .BR tempupload " ]" [ .BR exclude " pattern ]..." [ .BR ignore " pattern ]..." [ .BR ascii " pattern ]..." Anything after a hash (#) in a line is ignored as a comment. Values may be quoted and characters may be backslash-escaped. For example, to use the .B exclude pattern *#, use the following line: .br .BR " exclude " """*#""" .SS Remote Server Options The .B server key is used to specify the remote server the site is stored on. This may be either a DNS name or IP address. A connection is made to the default port for the protocol used, or that given by the .B port key. sitecopy supports the WebDAV or FTP protocols - the .B protocol key specifies which to use, taking the value of either .B webdav or .B ftp respectively. By default, FTP will be used. The .B proxy-server and .B proxy-port keys may be used to specify a proxy server to use. Proxy servers are currently only supported for WebDAV. If the FTP server does not support passive (PASV) mode, then the key .B ftp nopasv should be used. To display the message returned by the server on closing the connection, use the .B ftp showquit option. If the server only supports uploading files in the current working directory, use the key .B ftp usecwd (possible symptom: "overwrite permission denied"). Note that the remote-directory (keyword .B remote\fP) must be an absolute path (starting with '/'), or .B usecwd will be ignored. If the WebDAV server correctly supports the 100-continue expectation, e.g. Apache 1.3.9 and later, the key .B http expect should be used. Doing so can save some bandwidth and time in an update. If the WebDAV server supports access via SSL, the key .B http secure can be used. Doing so will cause the transfers between sitecopy and the host to be performed using an secure, encrypted link. The first time SSL is used to access the server, the user will be prompted to verify the SSL certificate, if it's not signed by a CA trusted in the system's CA root bundle. To authenticate the user with the server, the .B username and .B password keys are used. If it exists, the .B ~/.netrc will be searched for a password if one is not specified. See ftp(1) for the syntax of this file. Basic and digest authentication are supported for WebDAV. Note that basic authentication must not be used unless the connection is known to be secure. The full URL that is used to access the site can optionally be specified in the .B url key. This is used only in flat list mode, so the site URL can be inserted in 'Recent Changes' pages. The URL must .I not have a trailing slash; a valid example is .br .BR " url " http://www.site.com/mysite If the .B tempupload option is given, new or changed files are upload with a ".in." prefix, then moved to the true filename when the upload is complete. .SS File State File state is stored in the storage files (~/.sitecopy/*), and is used to discover when a file has been changed. Two methods are supported, and can be selected using the .B state option, with either parameter: .B timesize (the default), and .B checksum. .B timesize uses the last-modification date and the size of files to detect when they have changed. .B checksum uses an MD5 checksum to detect any changes to the file contents. Note that MD5 checksumming involves reading in the entire file, and is slower than simply using the last-modification date and size. It may be useful for instance if a versioning system is in use which updates the last-modification date on a 'checkout', but this doesn't actually change the file contents. .SS Safe Mode .B Safe Mode is enabled by using the .B safe key. When enabled, each time a file is uploaded to the server, the modification time of the file .B as on the server is recorded. Subsequently, whenever this file has been changed locally and is to be uploaded again, the current modification time of the file on the server is retrieved, and compared with the stored value. If these differ, then the remote copy of the file has been altered by a foreign party. A warning message is issued, and your local copy of the file will not be uploaded over it, to prevent losing any changes. Safe Mode can be used with FTP or WebDAV servers, but if Apache/mod_dav is used, mod_dav 0.9.11 or later is required. .B Note Safe mode cannot be used in conjunction with the .B nooverwrite option (see below). .SS File Storage Locations The .B remote key specifies the root directory of the remote copy of the site. It may be in the form of an absolute pathname, e.g. .br .BR " remote " /www/mysite/ .br For FTP, the directory may also be specified relative to the login directory, in which case it must be prefixed by "~/", for example: .br .BR " remote " ~/public_html/ .PP The .B local key specifies the directory in which the site is stored locally. This may be given relative to your home directory (as given by the environment variable $HOME), again using the "~/" prefix. .br .BR " local " "~/html/foosite/" .br .BR " local " "/home/fred/html/foosite/" .br are equivalent, if $HOME is set to "/home/fred". For both the local and remote keywords, a trailing slash may be used, but is not required. .SS File Permissions Handling File permissions handling is dictated by the .B permissions key, which may be given one of three values: .TP .B ignore to ignore file permissions completely (the default), .TP .B exec to mirror the permissions of executable files only, .TP .B all to mirror the permissions of all files. .PP This can be used, for instance, to ensure the permissions of CGI files are set. The option is currently ignored for WebDAV servers. For FTP servers, a .B chmod is performed remotely to set the permissions. To handle directory permissions, the key: .br .BR " permissions dir" .br may be used in addition to a .B permissions key of either .B exec, .B local or .B all. Note that .B permissions all does not imply .B permissions dir. .SS Symbolic Link Handling Symlinks found in the local site can be either ignored, followed, or maintained. In 'follow' mode, the files references by the symlinks will be uploaded in their place. In 'maintain' mode, the link will be created remotely as well, see below for more information. The mode used for each site is specified with the .B symlinks rcfile key, which may take the value of .B ignore, .B follow or .B maintain to select the mode as appropriate. The default mode is .B follow, i.e. symbolic links found in the local site are followed. .SS Symbolic link Maintain Mode This mode is currently only supported by the WebDAV driver, and will work only with servers which implement WebDAV Advanced Collections, which is a work-in-progress. The target of the link on the server is literally copied from the target of the symlink. Hint: you can use URL's if you like: .br .B " ln -s" """http://www.somewhere.org/""" somewherehome In this way, a "302 Redirect" can be easily set up from the client, without having to alter the server configuration. .SS Deleting and Moving Remote Files The .B nodelete option may be used to prevent remote files from ever being deleted. This may be useful if you keep large amounts of data on the remote server which you do not need to store locally as well. If your server does not allow you to upload changed files over existing files, then you can use the .B nooverwrite option. When this is used, before uploading a changed file, the remote file will be deleted. If the .B checkmoved option is used, sitecopy will look for any files which have been moved locally. If any are found, when the remote site is updated, the files will be moved remotely. If the .B checkmoved renames option is used, sitecopy will look for any files which have been moved or renamed locally. This option may only be used in conjunction with the .B state checksum option. .B WARNING If you are not using MD5 checksumming (i.e. the .B state checksum option) to determine file state, do NOT use the .B checkmoved option if you tend to hold files in different directories with identical sizes, modification times and names and ever move them about. This seems unlikely, but don't say you haven't been warned. .SS Excluding Files Files may be excluded from the files list by use of the .B exclude key, which accepts shell-style globbing patterns. For example, use .br .BR " exclude " "*.bak" .br .BR " exclude " *~ .br .BR " exclude " """#*#""" .br to exclude all files which have a .bak extension, end in a tilde (~) character, or which begin and end with a a hash. Don't forget to quote or escape the value if it includes a hash! To exclude certain files within an particular directory, simply prefix the pattern with the directory name - including a leading slash. For instance: .br .BR " exclude " "/docs/*.m4" .br .BR " exclude " "/files/*.gz" .br which will exclude all files with the .m4 extension in the 'docs' subdirectory of the site, and all files with the .gz extension in the files subdirectory. An entire directory can also be excluded - simply use the directory name with no trailing slash. For example .br .BR " exclude " "/foo/bar" .br .BR " exclude " "/where/else" .br to exclude the 'foo/bar' and 'where/else' subdirectories of the site. Exclude patterns are consulted when scanning the local directory, and when scanning the remote site during a --fetch. Any file which matches any exclude pattern is not added to the files list. This means that a file which has already been uploaded by sitecopy, and subsequently matches an exclude pattern will be deleted from the server. .SS Ignoring Local Changes to Files The .B ignore option is used to instruct sitecopy to ignore any local changes made to a file. If a change is made to the contents of an ignored file, this file will .B not be uploaded by update mode. Ignored files will be created, moved and deleted as normal. The .B ignore option is used in the same way as the .B exclude option. Note that synchronize mode .B will overwrite changes made to ignored files. .SS FTP Transfer Mode To specify the FTP transfer mode for files, use the .B ascii key. Any files which are transferred using ASCII mode have CRLF/LF translation performed appropriately. For example, use .br .BR " ascii " "*.pl" .br to upload all files with the .pl extension as ASCII text. This key has no effect with WebDAV (currently). .SH RETURN VALUES Return values are specified for different operation modes. If multiple sites are specified on the command line, the return value is in respect to the last site given. .SS Update Mode -1 ... update never even started - configuration problem 0 ... update was entirely successful. 1 ... update went wrong somewhere 2 ... could not connect or login to server .SS List Mode (default mode of operation) -1 ... could not form list - configuration problem 0 ... the remote site does not need updating 1 ... the remote site needs updating .SH EXAMPLE RCFILE CONTENTS .SS FTP Server, Simple Usage Fred's site is uploaded to the FTP server 'my.server.com' and held in the directory 'public_html', which is in the login directory. The site is stored locally in the directory /home/fred/html. site mysite server my.server.com url http://www.server.com/fred username fred password juniper local /home/fred/html/ remote ~/public_html/ .SS FTP Server, Complex Usage Here, Freda's site is uploaded to the FTP server \'ftp\.elsewhere\.com\', where it is held in the directory /www/freda/. The local site is stored in /home/freda/sites/elsewhere/ site anothersite server ftp\.elsewhere\.com username freda password blahblahblah local /home/freda/sites/elsewhere/ remote /www/freda/ # Freda wants files with a .bak extension or a # trailing ~ to be ignored: exclude *.bak exclude *~ .SS WebDAV Server, Simple Usage This example shows use of a WebDAV server. site supersite server dav.wow.com protocol webdav username pow password zap local /home/joe/www/super/ remote / .SH FILES .I ~/.sitecopyrc Default run control file location. .br .I ~/.sitecopy/ Remote site information storage directory .br .I ~/.netrc Remote server accounts information .br .SH BUGS Known problems: Fetch + synch modes are NOT reliable for FTP. If you need reliable operation of fetch or synch modes, you shouldn't be using sitecopy. Try rsync instead. .PP Please send bug reports and feature requests to rather than to the author, since the mailing list is archived and can be a useful resource for others. .SH SEE ALSO rsync(1), ftp(1), mirror(1) .SH STANDARDS [Listed for reference only, no claim of compliance to any of the below standards is made.] .BR "RFC 959" " - File Transfer Protocol (FTP)" .br .BR "RFC 1521" " - Multipurpose Internet Mail Extensions Part One" .br .BR "RFC 1945" " - Hypertext Transfer Protocol -- HTTP/1.0" .br .BR "RFC 2396" " - Uniform Resource Identifiers: Generic Syntax" .br .BR "RFC 2518" " - HTTP Extensions for Distributed Authoring -- WEBDAV" .br .BR "RFC 2616" " - Hypertext Transfer Protocol -- HTTP/1.1" .br .BR "RFC 2617" " - HTTP Authentication" .br .BR "REC-XML" " - Extensible Markup Language (XML) 1.0" .br .BR "REC-XML-NAMES" " - Namespaces in XML" .SH DRAFT STANDARDS .BR "draft-ietf-ftpext-mlst-05.txt" " - Extensions to FTP" .br .BR "draft-ietf-webdav-collections-protocol-03.txt" " - WebDAV Advanced Collections Protocol" .SH AUTHOR Joe Orton and others. .br e-mail: sitecopy@lyra.org .br www: http://www.lyra.org/sitecopy/ sitecopy-0.16.6/sitecopy.spec0000664000076400007640000000450011037462356014312 0ustar joejoe# Emacs, please be in spec-file-mode: -*- rpm-spec -*- Summary: Tool for easily maintaining remote web sites Name: sitecopy Version: 0.16.6 Release: 1 License: GPL Group: Applications/Internet Source0: http://www.lyra.org/sitecopy/sitecopy-%{version}.tar.gz URL: http://www.lyra.org/sitecopy/ BuildRoot: /var/tmp/sitecopy-%{version}-root BuildRequires: expat-devel %description sitecopy allows you to easily maintain remote Web sites. The program will upload files to the server which have changed locally, and delete files from the server which have been removed locally, to keep the remote site synchronized with the local site, with a single command. sitecopy will also optionally try to spot files you move locally, and move them remotely. FTP and WebDAV servers are supported. %prep %setup -q %build %configure --enable-debug --with-expat make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make install docdir=%{_datadir}/doc/sitecopy-%{version} DESTDIR=$RPM_BUILD_ROOT %find_lang %{name} %clean rm -rf $RPM_BUILD_ROOT %files -n sitecopy -f %{name}.lang %defattr(-, root, root) %{_bindir}/sitecopy %{_mandir}/man1/* %{_mandir}/*/man1/* %{_datadir}/sitecopy %doc COPYING ChangeLog INSTALL NEWS README* THANKS TODO %changelog * Sat Aug 13 2005 Joe Orton - remove xsitecopy subpackage - use find_lang - use %%configure - general clean up * Sun Jan 13 2002 Joe Orton - Use DESTDIR in make install. * Sun Jan 6 2002 Joe Orton - Add -q argument to %setup, better %description, minor cleanups. * Sun Oct 29 2000 Joe Orton - Fix man page location (Nobuyuki Tsuchimura). * Tue Jun 27 2000 Nobuyuki Tsuchimura - Include 'LC_MESSAGES/sitecopy.mo'. - Don't install in %build section. - Add more documents and '/usr/share/sitecopy/*'. - Correct URL. * Sat Apr 22 2000 Lee Mallabone - Bring up to date for latest xsitecopy stuff * Mon Jul 26 1999 Joe Orton - Enabled debugging for sitecopy and xsitecopy. * Fri May 28 1999 Dobrica Pavlinusic - integrated into GNU configure to automaticly pick up version number * Sat Apr 3 1999 Lee Mallabone - After a few tweaks, it now actually works. :) * Thu Apr 1 1999 Lee Mallabone - first attempt. sitecopy-0.16.6/Makefile.in0000664000076400007640000001545111034501301013630 0ustar joejoe# # sitecopy Makefile: generated from Makefile.in. # SHELL = @SHELL@ @SET_MAKE@ # Installation paths prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ man1dir = $(mandir)/man1 docdir = $(prefix)/doc/sitecopy localedir = $(datadir)/locale datadir = @datadir@ datarootdir = @datarootdir@ pkgdatadir = $(datadir)/sitecopy # Build paths. VPATH = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = . # Toolchain settings LDFLAGS = @LDFLAGS@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/lib CPPFLAGS = @CPPFLAGS@ @DEFS@ -DLOCALEDIR=\"$(localedir)\" CFLAGS = @CFLAGS@ ALL_CFLAGS = $(CPPFLAGS) $(INCLUDES) $(CFLAGS) LIBS = @NEON_LIBS@ @LIBINTL@ @LIBS@ CC = @CC@ # libintl must be built first. SUBDIRS = intl lib/neon EXPATDIR = lib/expat INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL = @INSTALL@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs ########################################################################## # Install paths and misc files required for a smooth Xsitecopy experience. ########################################################################## DESKTOP_DIR = $(prefix)/share/gnome/apps/Internet XSC_DESKTOP = $(top_srcdir)/gnome/share/xsitecopy.desktop GHELPDIR = $(prefix)/share/gnome/help/xsitecopy XSC_HELP = $(GHELPDIR)/C PNG_DIR = $(prefix)/share/pixmaps/xsitecopy GLADE_DIR = $(prefix)/share/xsitecopy XSC_GLADE = $(top_srcdir)/gnome/share/sitecopy-dialogs.glade # Target is the name of the executable TARGET = @TARGET@@EXEEXT@ OBJECTS = src/sites.o src/sitefiles.o src/sitestore.o \ src/rcfile.o src/common.o src/nulldriver.o src/lsparser.o \ @EXTRAOBJS@ GNOMEOBJS = gnome/changes.o gnome/minilist.o gnome/file_widgets.o \ gnome/gcommon.o gnome/init.o gnome/main.o gnome/misc.o \ gnome/new_site.o gnome/operations.o gnome/resynch.o \ gnome/site_widgets.o gnome/tree.o # The list of stuff which autoconf reckons we need to compile # since the native libc hasn't got it. LIBOBJS = lib/netrc.o lib/basename.o lib/dirname.o @LIBOBJS@ # Everything we want to compile into the target ALLOBJS = $(OBJECTS) $(LIBOBJS) DATAFILES = doc/examplerc doc/changes.awk DOCS = README NEWS THANKS doc/update.sh MANLANGS = fr all: $(TARGET) .PHONY: all again clean distclean reminders install-common \ install-sitecopy install-xsitecopy install-nls subdirs \ ChangeLog .SUFFIXES: .SUFFIXES: .c .o $(TARGET): subdirs $(ALLOBJS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) $(LIBOBJS) @echo @echo " Compilation complete. Run 'make install' to install sitecopy." @echo " (You may need to become root to do this)" @echo subdirs: $(SUBDIRS) @for d in $(SUBDIRS); do \ echo ">>> Entering $$d"; \ (cd $$d && $(MAKE) all) || exit 1; \ echo "<<< Leaving $$d"; \ done .c.o: $(CC) $(ALL_CFLAGS) -o $@ -c $< Makefile: Makefile.in ./config.status Makefile # Various tester utils which can also be built. # # RFC1123 date/time tester # netrc parser tester netrc: lib/netrc.c $(CC) $(ALL_CFLAGS) -DSTANDALONE -o $@ $^ # Dependencies: HEADERS = src/common.h src/frontend.h src/i18n.h src/protocol.h \ src/sites.h src/ftp.h src/lsparser.h src/rcfile.h src/sitesi.h \ lib/basename.h lib/dirname.h lib/fnmatch.h lib/getopt.h \ lib/netrc.h config.h src/common.o: src/common.c $(HEADERS) src/console_fe.o: src/console_fe.c $(HEADERS) src/davdriver.o: src/davdriver.c $(HEADERS) src/ftp.o: src/ftp.c $(HEADERS) src/ftpdriver.o: src/ftpdriver.c $(HEADERS) src/lsparser.o: src/lsparser.c $(HEADERS) src/nulldriver.o: src/nulldriver.c $(HEADERS) src/rcfile.o: src/rcfile.c $(HEADERS) src/rshdriver.o: src/rshdriver.c $(HEADERS) src/sitefiles.o: src/sitefiles.c $(HEADERS) src/sites.o: src/sites.c $(HEADERS) src/sitestore.o: src/sitestore.c $(HEADERS) lib/basename.o: lib/basename.c lib/basename.h config.h lib/dirname.o: lib/dirname.c lib/dirname.h config.h lib/netrc.o: lib/netrc.c lib/netrc.h config.h lib/rpmatch.o: lib/rpmatch.c config.h lib/yesno.o: lib/yesno.c config.h $(EXPATDIR)/xmltok/nametab.h: $(EXPATDIR)/gennmtab/gennmtab@EXEEXT@ rm -f $@ $(EXPATDIR)/gennmtab/gennmtab@EXEEXT@ >$@ $(EXPATDIR)/gennmtab/gennmtab@EXEEXT@: $(top_srcdir)/$(EXPATDIR)/gennmtab/gennmtab.c $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $(top_srcdir)/$(EXPATDIR)/gennmtab/gennmtab.c $(EXPATDIR)/xmltok/xmltok.o: $(EXPATDIR)/xmltok/xmltok.c $(EXPATDIR)/xmltok/xmltok.h $(EXPATDIR)/xmltok/nametab.h # The install goal is different for each front end, so # we have a separate goal for each and autoconf points the # main 'install' goal at the FE we're compiling for. install: $(TARGET) install-@TARGET@ install-nls install-nls: @cd po && $(MAKE) install install-common: $(TARGET) @echo "Creating directories..." $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(docdir) @echo "Installing $(TARGET) executable..." $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(bindir)/$(TARGET) @echo "Installing data files..." set -e; for f in $(DATAFILES); do \ $(INSTALL_DATA) $(top_srcdir)/$$f $(DESTDIR)$(pkgdatadir)/`echo $$f | sed 's/^doc\///'`; \ done @echo "Installing documentation..." set -e; for f in $(DOCS); do \ $(INSTALL_DATA) $(top_srcdir)/$$f $(DESTDIR)$(docdir)/`echo $$f | sed 's/^doc\///'`; \ done install-sitecopy: install-common @echo "Installing man page..." $(mkinstalldirs) $(DESTDIR)$(man1dir) $(INSTALL_DATA) $(top_srcdir)/doc/sitecopy.1 $(DESTDIR)$(man1dir)/sitecopy.1 for f in $(MANLANGS); do $(mkinstalldirs) $(DESTDIR)$(mandir)/$$f/man1; \ $(INSTALL_DATA) $(top_srcdir)/doc/sitecopy.$$f.1 \ $(DESTDIR)$(mandir)/$$f/man1/sitecopy.1; done @echo @echo "sitecopy installation finished." @echo install-xsitecopy: install-common @echo Installing additional GNOME requirements... @echo Creating directories... $(mkinstalldirs) $(DESTDIR)$(GHELPDIR) $(DESTDIR)$(XSC_HELP) $(DESTDIR)$(DESKTOP_DIR) $(DESTDIR)$(PNG_DIR) $(DESTDIR)$(GLADE_DIR) @echo Installing help files... set -e; cd $(top_srcdir)/gnome/doc && for f in *.html topic.dat; do \ $(INSTALL_DATA) $$f $(DESTDIR)$(XSC_HELP)/$$f; \ done @echo Installing images... set -e; cd $(top_srcdir)/gnome/share && for f in *.png; do \ $(INSTALL_DATA) $$f $(DESTDIR)$(PNG_DIR)/$$f; \ done @echo Installing user-interface components... $(INSTALL_DATA) $(XSC_GLADE) $(DESTDIR)$(GLADE_DIR)/sitecopy-dialogs.glade @echo Adding desktop shortcut... $(INSTALL_DATA) $(XSC_DESKTOP) $(DESTDIR)$(DESKTOP_DIR)/xsitecopy.desktop @echo @echo "XSitecopy installation finished." @echo clean: rm -f $(ALLOBJS) for d in $(SUBDIRS) po; do (cd $$d && $(MAKE) clean) || exit 1; done again: clean $(MAKE) $(TARGET) distclean: clean for d in intl lib/neon po; do \ if [ -f $$d/Makefile ]; then (cd $$d && $(MAKE) distclean); fi; \ done rm -f config.h config.cache config.log config.status Makefile stamp-h core rm -f `find $(top_srcdir) \( -name '*.orig' -o -name '*.rej' \ -o -name '#*#' -o -name '*~' \) -print` ChangeLog: svn log > $@ sitecopy-0.16.6/config.h.emx.in0000664000076400007640000000342010165765223014412 0ustar joejoe/* config.h for EMX. */ /* Define to enable WebDAV support */ #undef USE_DAV /* Define to enable debugging */ #define DEBUGGING 1 /* Define to empty if the keyword does not work. */ #define const const /* Define if you have fnmatch */ #define HAVE_SYS_FNMATCH 1 /* Define to be the package name */ #define PACKAGE "sitecopy" /* Define to be the current version number */ #define VERSION "@VERSION@" /* Define to be the type of the third argument to getsockname() */ #define ksize_t int /* Define as appropriate for C compiler */ #undef inline /* Define if you have getopt */ #define HAVE_GETOPT 1 #undef HAVE_GETOPT_LONG /* Define if you have strsignal */ #undef HAVE_STRSIGNAL /* Define if you have strcasecmp */ #define HAVE_STRCASECMP 1 /* Define if you have snprintf */ #define HAVE_SNPRINTF 1 /* Define if you have strdup */ #define HAVE_STRDUP 1 /* Define if you have strerror */ #define HAVE_STRERROR 1 /* Define if you have libexpat */ #undef HAVE_LIBEXPAT /* 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 if your locale.h file contains LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define if you have locale.h */ #undef HAVE_LOCALE_H /* Define if you want NLS */ #undef ENABLE_NLS /* Define if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define if you have unistd.h */ #define HAVE_UNISTD_H 1 /* Define if you have stdlib.h */ #define HAVE_STDLIB_H 1 /* Define if you have limits.h */ #define HAVE_LIMITS_H 1 /* Define if you have strings.h */ #undef HAVE_STRINGS_H /* Define if you have the sys/select.h */ #define HAVE_SYS_SELECT_H 1 /* Define if you have string.h */ #define HAVE_STRING_H 1