chemtool-1.6.14/0000755000175000001440000000000012202271077012626 5ustar martinuserschemtool-1.6.14/chemtool.spec0000644000175000001440000001310512202264673015320 0ustar martinusersSummary: Chemtool is a program for 2D drawing of organic molecules Summary(de): Chemtool ist ein Programm zum Zeichnen von Molekülformeln Summary(pl): Chemtool - program do rysowania 2-wymiarowych czsteczek organicznych. Name: chemtool Version: 1.6.14 Release: 1 License: GPL Group: Applications/Chemistry Source: http://ruby.chemie.uni-freiburg.de/~martin/chemtool/%{name}-%{version}.tar.gz URL: http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html Packager: Martin Kroeker Vendor: Thomas Volk & Martin Kroeker Prefix: /usr BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %define name0 cht %define docdir %{_docdir}/%{name}-%{version} %define exampledir %{_datadir}/%{name}-%{version}/examples %description Chemtool is a program for drawing organic molecules easily and store them in a variety of output formats including as a X bitmap, Xfig, SVG or EPS file. It runs under the X Window System using the GTK widget set. %description -l de Chemtool ist ein einfaches Zeichenprogramm für organische Moleküle. Lewisformeln können in einer ganzen Reihe von Ausgabeformaten gespeichert werden, u.a. als SVG- und EPS-Dateien oder auch im XFig-Format. Chemtool setzt X11 und die GTK-Grafikbibliothek voraus. %description -l pl Chemtool jest programem do rysowania czsteczek organicznych i zapisu ich jako pliki X-bitmap, Xfig lub EPS. Pracuje pod X Window uywajc bibliotek GTK. %prep rm -rf $RPM_BUILD_ROOT %setup %build ./configure --prefix=%{_prefix} make %install rm -rf $RPM_BUILD_ROOT make prefix=$RPM_BUILD_ROOT%{_prefix} bindir=$RPM_BUILD_ROOT%{_bindir} \ localstatedir=$RPM_BUILD_ROOT%{_localstatedir} \ datadir=$RPM_BUILD_ROOT%{_datadir} \ includedir=$RPM_BUILD_ROOT%{_includedir} \ mandir=$RPM_BUILD_ROOT%{_mandir} \ sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} install install -d $RPM_BUILD_ROOT%{docdir} install -d $RPM_BUILD_ROOT%{_datadir}/mimelnk/application install -d $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps install -d $RPM_BUILD_ROOT%{_datadir}/applications install -d $RPM_BUILD_ROOT%{_datadir}/pixmaps install -d $RPM_BUILD_ROOT%{exampledir} install -m 644 examples/* $RPM_BUILD_ROOT%{exampledir} install -m 644 {COPYING,TODO,README,ChangeLog,using_chemtool.html} $RPM_BUILD_ROOT%{docdir} install -m 644 kde/mimelnk/application/x-chemtool.desktop $RPM_BUILD_ROOT%{_datadir}/mimelnk/application install -m 644 gnome/gnome-application-%{name}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.png install -m 644 gnome/chemtool.desktop $RPM_BUILD_ROOT%{_datadir}/applications install -m 644 gnome/chemtool.png $RPM_BUILD_ROOT%{_datadir}/pixmaps %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-, root, root) %{_bindir} %{exampledir} %{_mandir} %{_datadir}/pixmaps %{_datadir}/applications %{_datadir}/mimelnk %{_datadir}/icons %{_datadir}/locale %doc %{docdir} %changelog * Mon Aug 12 2013 Martin Kroeker - Updated build system to autoconf-2.69, updated version number. * Wed Nov 11 2007 Martin Kroeker - Updated version number * Thu Jun 21 2007 Martin Kroeker - Moved installation of manpages into the Makefile * Thu Jun 8 2007 Martin Kroeker - Fixed creation of examples and man directories - Changed packager name to myself (instead of Radek Liboska who contributed the original spec file) * Mon May 28 2007 Martin Kroeker - Replaced most of the install target with a make install * Mon Apr 9 2007 Martin Kroeker - Updated version number - Renamed Copyright field to License * Tue Nov 21 2006 Martin Kroeker - Updated version number - Install a copy of the GPL license text (COPYING) with the other documentation * Thu Feb 23 2006 Martin Kroeker - Updated version number * Mon Jan 2 2006 Martin Kroeker - Removed rpm icon resource - Incorporated Polish translation of the descriptions from the old pld spec file, added German translation * Sun Jul 24 2005 Martin Kroeker - Add nl to the list of installable locale files * Fri Jun 17 2005 Martin Kroeker - updated Version * Sat Feb 12 2005 Martin Kroeker - updated Version * Mon Jan 31 2005 Martin Kroeker - updated Version, configure, configure.in * Sat Oct 16 2004 Martin Kroeker - updated Version, Makefile.in * Thu May 13 2004 Martin Kroeker - updated Version, configure, Makefile.in * Wed May 5 2004 Martin Kroeker - updated Version * Sat May 1 2004 Martin Kroeker - updated Version, added html copy of usage instructions * Sun Jul 27 2003 Radek Liboska - RedHat 9 KDE+GNOME desktop style adopted * Tue Jul 22 2003 Radek Liboska - default "_path" vars used instead of the fixed paths * Thu Nov 7 2002 Martin Kroeker - updated Version, URLs and program description * Wed Mar 14 2002 Radek Liboska - the icon stuff and gnome menu integration * Sat Mar 6 2002 Radek Liboska - spec file clean up * Fri Jul 27 2001 Radek Liboska - 1.4 See %prefix/doc/%{name}-%{version}/ChangeLog for change log chemtool-1.6.14/templates.hx0000644000175000001440000000240310715417303015165 0ustar martinusersstatic char *template_tip[25][5] ={ {_("Cyclopentadienyl"),_("Benzene"),_("Benzene"),_("Naphthalene"),_("Azulene")}, {_("Adamantane"),_("Cyclohexane"),_("Steroid backbone"),_("Cycloheptatriene"),_("Cyclooctatetraene")}, {_("Fluorene"),_("Spiro[4.5]decane"),_("Heptalene"),_("Fulvalene"),_("Dicyclopentadiene")}, {_("Indene"),_("Biphenyl"),_("Norbornane"),_("Binaphthyl"),_("Cyclohexane")}, {_("Coronene"),"","","",""}, /*sugar*/ {_("Pyranose core"),_("Furanose core"),_("Ribofuranose"),_("Fructose"),_("Galactose")}, {_("Glucose"),_("Mannose"),_("Fucose"),_("Xylose"),_("Neuraminic acid")}, {_("Sucrose"),_("Maltose"),_("Lactose"),"",""}, {"","","","",""}, {"","","","",""}, /*heterocycle*/ {_("Adenine"),_("Guanine"),_("Thymine"),_("Cytosine"),_("Uracil")}, {_("Porphine"),_("Caffeine"),_("Evans auxiliary"),_("SAMP auxiliary"),_("Imidazole")}, {_("Benzimidazole"),_("Pyrazole"),_("Diazole"),"",""}, {_("Morphine"),_("Morphine 3D"),"","",""}, {"","","","",""}, /*amino acids*/ {"Ala","Arg","Asn","Asp","Cys"}, {"Gln","Glu","His","Ile","Leu"}, {"Lys","Met","Phe","Pro","Ser"}, {"Thr","Trp","Tyr","Val",_("Backbone")}, {"","","","",""}, /*symbols*/ {_("p orbital"),_("plus"),_("minus"),_("rearrangement"),""}, {"","","","",""}, {"","","","",""}, {"","","","",""}, {"","","","",""} }; chemtool-1.6.14/gnome/0000755000175000001440000000000010715417303013734 5ustar martinuserschemtool-1.6.14/gnome/gnome-application-chemtool.png0000644000175000001440000000360710715417303021666 0ustar martinusersPNG  IHDR00WgAMA abKGD pHYs.#.#x?vtIME  #WIDATxKl]=ݞ{X06ۼl@F/d/>).HNlF9!qCDA""%DȻha%^1 %kl rU3g]{"Rկ}_U s09;L+BhǏpС- aB FG(--exx R@i|r8@uu5RJV(%pƟs5l h }v@k_R tZdpp}~3z`ѢEرcG0M![٦3Bfd ,XȊ+-c}}}=`llD"A2`b")9 @kׯ)_议."۶y1dj,K`` 0P?J*F#=gϞJ@>K*f۶m<>L" JL&@JĄD)͖+Gix! i,0m444`&i.DT*E>hY>wxT*'1!llƲ,X֭[w/] !H9|oyT!)%QRRBii)WD=\qB۶蠣>ڊmhii|9830ӴXf-Vʇ;D&  u33W^qBh W\`-WU(8r;vkRbll (* 8"ڵk\~P?B!Pm懙Vz@&--*Zӧ7عsT}z2ƯRJNu2+=>>GGGȈCCCիɓL^@kk.䊈/_걱Qޮ%V"Y7o'NQ0Z~}aÆ7qƀt,ӭl3|dBwdsS7^IENDB`chemtool-1.6.14/gnome/chemtool.desktop0000644000175000001440000000041710715417303017143 0ustar martinusers[Desktop Entry] Name=Chemtool Comment=Molecules 2D drawing Name[cs_CZ.ISO8859-2]=Chemtool Comment[cs_CZ.ISO8859-2]=Editor molekul Comment[de_DE.ISO8859-1]=Molekleditor Exec=chemtool Icon=/usr/share/icons/chemtool.xpm Terminal=false MultipleArgs=false Type=Application chemtool-1.6.14/gnome/chemtool.png0000644000175000001440000000401610715417303016255 0ustar martinusersPNG  IHDR00WbKGD pHYs  ~tIME+|IDATx՘OSk ʆpJA!JE Iy%_1s<1&8\$R ,\b[kz@ \6/i|XssoQ( Hof{yhEU%BYq| Gyo^'<o#cJ9g@Ow[8g7&%,.."ܿ_MLLl6n5F#%WX~qs = ;;Gͅ=GŪ%׻F;@UUE!""bG2 0 tEH 2}ϟ?#IoݻWUUUTVVm#8L⊢vnrrr w֭@(v`XV.kkk200ngbbdZlll]t277H0:maχdhhݎ'&&'ORSSCAAz~AVH$I&(044"##^0(wlQ:  E Y[[crrHMM NG{{;FRw$~5lZ100\t\GRz<^JJJʞ*"RUo߾3<O$dY JJJտKDX'( MMM yyyz~?j G!Bv؟ll,Ġ*tuuŋC`kKb4>?v)++l6L~FeYfyyTBoO!.h"##"8~`;OA+MBlh {_n>VZ[[$!!aWejj QΦ˗/syRRR -Ƿ ~||?n6 YZTTTPUUũSHLLD!zbEQ7ore***(--%== aUUؠ>… ={H$Q` ȉ'y&999dffb45Lv 8w\RђW#! DEEk*'ժt5^|ɇVPUGC|IENDB`chemtool-1.6.14/gnome/mime-types/0000755000175000001440000000000010715417303016025 5ustar martinuserschemtool-1.6.14/gnome/mime-types/chemtool.mime0000644000175000001440000000004710715417303020511 0ustar martinusersapplication/chemtool ext: cht chemtool-1.6.14/gnome/mime-types/chemtool.keys0000644000175000001440000000017310715417303020535 0ustar martinusersapplication/chemtool: open=chemtool %f icon-filename=/usr/share/pixmaps/mc/gnome-application-chemtool.png chemtool-1.6.14/mkinstalldirs0000755000175000001440000000672212202253333015436 0ustar martinusers#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: chemtool-1.6.14/COPYING0000644000175000001440000004313310715417303013666 0ustar martinusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. chemtool-1.6.14/pld/0000755000175000001440000000000010715417303013406 5ustar martinuserschemtool-1.6.14/pld/chemtool.desktop0000644000175000001440000000055510715417303016620 0ustar martinusers[Desktop Entry] Name=Chemtool Comment=Molecules 2D drawing program Name[cs_CZ.ISO8859-2]=Chemtool Comment[cs_CZ.ISO8859-2]=Editor molekul Comment[de_DE.ISO8859-1]=Molekleditor Comment[pl_PL.ISO8859-2]=Edytor molek Exec=chemtool Icon=chemtool.xpm Terminal=false MultipleArgs=false Type=Application MimeType=application/x-chemtool;Application InitialPreference=2 chemtool-1.6.14/pld/chemtool.spec.pld0000644000175000001440000000457710715417303016667 0ustar martinusers# $Revision: 1.1 $, $Date: 2002/05/11 23:01:49 $ Summary: Chemtool - program for 2D drawing organic molecules. Summary(pl): Chemtool - program do rysowania 2-wymiarowych czsteczek organicznych. Name: chemtool Version: 1.5 Release: 1 License: GPL Group: X11/Applications/Science Source0: http://www.uni-ulm.de/~s_tvolk/chemtool/src/%{name}-%{version}.tar.gz Source1: %{name}.desktop Patch0: %{name}-DESTDIR.patch URL: http://www.uni-ulm.de/~s_tvolk/chemtool.html BuildRequires: autoconf BuildRequires: gtk+-devel >= 1.2.7 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _prefix /usr/X11R6 %define _mandir %{_prefix}/man %description Chemtool is a program for drawing organic molecules easily and store them as a X bitmap, Xfig or EPS file. It runs under the X Window System using the GTK widget set. %description -l pl Chemtool jest programem do rysowania czsteczek organicznych i zapisu ich jako pliki X-bitmap, Xfig lub EPS. Pracuje pod X Window uywajc bibliotek GTK. %prep %setup -q %patch -p1 %build autoconf %configure %{__make} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_datadir}/{pixmaps/hicolor/32x32/mimetypes,mimelnk/application,mime-info} install -d $RPM_BUILD_ROOT%{_applnkdir}/Scientific %{__make} install DESTDIR=$RPM_BUILD_ROOT install kde/mimelnk/application/x-chemtool.desktop $RPM_BUILD_ROOT%{_datadir}/mimelnk/application install kde/icons/hicolor/32x32/mimetypes/chemtool.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/hicolor/32x32/mimetypes install gnome/mime-types/* $RPM_BUILD_ROOT%{_datadir}/mime-info install gnome/gnome-application-chemtool.png $RPM_BUILD_ROOT%{_datadir}/pixmaps install %{SOURCE1} $RPM_BUILD_ROOT%{_applnkdir}/Scientific install %{name}.xpm $RPM_BUILD_ROOT%{_datadir}/pixmaps gzip -9nf ChangeLog README TODO %clean rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %doc *.gz examples/* %attr(755,root,root) %{_bindir}/* %{_datadir}/mimelnk/application/* %{_datadir}/pixmaps/hicolor/32x32/mimetypes/*.png %{_datadir}/mime-info/* %{_datadir}/pixmaps/*.png %{_datadir}/pixmaps/*.xpm %{_applnkdir}/Scientific/*.desktop %define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`) %changelog * %{date} PLD Team All persons listed below can be reached at @pld.org.pl $Log: chemtool.spec,v $ Revision 1.1 2002/05/11 23:01:49 blues - initial revision program for 2D drawing organic molecules STBR chemtool-1.6.14/templates.h0000644000175000001440000166123710715417303015016 0ustar martinusersstatic char *template_tip[25][5] ={ {"Cyclopentadienyl","Benzene","Benzene","Naphthalene","Azulene"}, {"Adamantane","Cyclohexane","Steroid backbone","Cycloheptatriene","Cyclooctatetraene"}, {"Fluorene","Spiro[4.5]decane","Heptalene","Fulvalene","Dicyclopentadiene"}, {"Indene","Biphenyl","Norbornane","Binaphthyl","Cyclohexane"}, {"Coronene","","","",""}, /*sugar*/ {"Pyranose core","Furanose core","Ribofuranose","Fructose","Galactose"}, {"Glucose","Mannose","Fucose","Xylose","Neuraminic acid"}, {"Sucrose","Maltose","Lactose","",""}, {"","","","",""}, {"","","","",""}, /*heterocycle*/ {"Adenine","Guanine","Thymine","Cytosine","Uracil"}, {"Porphine","Caffeine","Evans auxiliary","SAMP auxiliary","Imidazole"}, {"Benzimidazole","Pyrazole","Diazole","",""}, {"Morphine","Morphine 3D","","",""}, {"","","","",""}, /*amino acids*/ {"Ala","Arg","Asn","Asp","Cys"}, {"Gln","Glu","His","Ile","Leu"}, {"Lys","Met","Phe","Pro","Ser"}, {"Thr","Trp","Tyr","Val","Backbone"}, {"","","","",""}, /*symbols*/ {"p orbital","plus","minus","rearrangement",""}, {"","","","",""}, {"","","","",""}, {"","","","",""}, {"","","","",""} }; static char *template_xpm[25][5][61] ={ {{ /* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "........................... ..............................", ".......................... . .............................", "......................... ... ............................", "........................ ..... ...........................", "....................... ....... ..........................", "...................... ......... .........................", "..................... ........... ........................", ".................... ............. .......................", "................... ............... ......................", ".................. ................. .....................", "................. ................... ....................", "................ ..................... ...................", "............... ....................... ..................", ".............. ......................... .................", "............. ........................... ................", "............ .............. .............. ...............", "........... .......... . .......... ..............", ".......... ......... ........... ......... .............", "......... ......... ............... ......... ............", "........ ......... ................. ......... ...........", "....... ......... ................... ......... ..........", "...... ......... ..................... ........ ..........", "...... ........ ....................... ...... ...........", "....... ....... ....................... ...... ...........", "....... ...... ......................... ..... ...........", "....... ...... ......................... .... ............", "....... ...... ......................... .... ............", "........ ..... ......................... .... ............", "........ ..... ......................... .... ............", "........ .... ........................... .. .............", "......... .... ......................... ... .............", "......... .... ......................... ... .............", "......... .... ......................... .. ..............", "......... .... ......................... .. ..............", ".......... ... ......................... .. ..............", ".......... .... ....................... .. ...............", ".......... .... ....................... .. ...............", "........... .... ..................... ... ...............", "........... ..... ................... ... ................", "........... ...... ................. .... ................", "........... ....... ............... ..... ................", "............ ....... ........... ..... .................", "............ ......... . ....... .................", "............ .............. ............ .................", "............. .......................... .................", "............. ......................... ..................", "............. ......................... ..................", "............. ......................... ..................", ".............. ....................... ...................", ".............. ....................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, { /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", ".......................... ...............................", "........................ . .............................", "...................... ..... ...........................", "..................... ......... ..........................", "................... .... ...... ........................", "................. .... ......... ......................", "............... .... ............. .....................", ".............. ..... ................ ...................", "............ .... ................... .................", ".......... .... ....................... ...............", "......... .... ........................... ..............", "....... .... .............................. ............", "..... .... ................................. ..........", ".... .... ..................................... .........", ".... ... ....................................... .........", ".... ........................................... .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................ .. .........", ".... ........................................... .........", ".... ... ....................................... .........", ".... .... ..................................... .........", "..... .... ................................. ..........", "....... .... .............................. ............", "......... ... .......................... ..............", "........... ... ...................... ................", "............. ... .................. ..................", "............... .... ................ ....................", "................ ... ............ .....................", ".................. ... ........ .......................", ".................... ... ..... .........................", "...................... ..... ...........................", "........................ . .............................", ".......................... ...............................", "..........................................................", "..........................................................", ".........................................................." }, { /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", ".......................... ...............................", "........................ . .............................", "...................... ..... ...........................", "..................... ......... ..........................", "................... ........... ........................", "................. ............... ......................", "............... ................... .....................", ".............. ...................... ...................", "............ ......................... .................", ".......... ............................. ...............", "......... ............. ............. ..............", "....... ........... ....... ........... ............", "..... ........... ............. ........... ..........", ".... ............ ................. ............ .........", ".... ........... ................... ........... .........", ".... .......... ..................... .......... .........", ".... ......... ....................... ......... .........", ".... ........ ......................... ........ .........", ".... ........ ......................... ........ .........", ".... ....... ........................... ....... .........", ".... ....... ........................... ....... .........", ".... ....... ........................... ....... .........", ".... ...... ............................. ...... .........", ".... ...... ............................. ...... .........", ".... ...... ............................. ...... .........", ".... ...... ............................. ...... .........", ".... ...... ............................. ...... .........", ".... ...... ............................. ...... .........", ".... ...... ............................. ...... .........", ".... ....... ........................... ....... .........", ".... ....... ........................... ....... .........", ".... ....... ........................... ....... .........", ".... ........ ......................... ........ .........", ".... ........ ......................... ........ .........", ".... ......... ....................... ......... .........", ".... .......... ..................... .......... .........", ".... ........... ................... ........... .........", ".... ............ ................. ............ .........", ".... ............. ............. ............. .........", ".... ............... ....... ............... .........", "..... ................ ................ ..........", "....... ................................... ............", "......... ............................... ..............", "........... ........................... ................", "............. ....................... ..................", "............... ..................... ....................", "................ ................. .....................", ".................. ............. .......................", ".................... ......... .........................", "...................... ..... ...........................", "........................ . .............................", ".......................... ...............................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "60 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .... ... ", " .. .. . .. ", " .. . .. .. . .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .. .. .. . .. .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " . .. .. .. .. ", ". . . ", ". . . . ", ". . . . ", ". . . . ", ". . . . ", ". . . . ", ". . . . ", ". . . . ", ". . . . ", ". . . . ", ". . . . ", ". . . . ", ". . . . ", ". . . ", ". . . ", " . .. .. . . ", " .. .. .. .. .. .. ", " ... .. .. .. .. .. ", " .. .. .. .. . .. ", " .. .. .. .. .. .. ", " .. .. .. .. .. .. ", " .. . .. ... . .. ", " .. .. .. .. ", " .. ... ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, { /* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ...... ", " .. ... ", " . . ... ", " .. . .... ", " .... . .. . ", " . ... .. . . ", " . . .... .. .. . . ", " . . .. .. . . . ", " . . ... . . . ", " . . . ... ", " . . . . . ", " . .. . . . ", " . . . . ", " . . . . . ", " . . . . . ", " .. . . . ", " .. . . ", " . . ", " . . . ", " . . . ", " .. . ", " . . . ", " . ... . . ", " . .. ... . ", " .. ... ... .. . ", " . .. ... . . ", " . ... . .. . ", " .. .. ... .. ", " . .... ... ", " .. .. ... ", " . .... ", " .... ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ........................ ", " .. . ", " ... . ", " .. . . ", " .. .. . ", " .. . . ", " .. . . ", " .. . . ", " .. .. . ", " .. . . ", " .. . . ", " ... . . ", " . .. . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . ... ", " . . ... ", " . . .... ", " . . .. .. ", " . . ... .. ", " . . .. ... ", " . . .. .... ", " . . .. ... ", " . . .. .... ", " . . .. .... ", " . . .. ..... ", " ........................ ..... ", " . . ..... ", " . . ..... ", " . ........................... ", " .. ............................. ", " . ............................. ", " . .............................. ", " .. .......... ", " .. ......... ", " . ........ ", " . ........ ", " . ...... ", " .. ..... ", " . .... ", " ..... ", " .... ", " . ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .. ", " ... ", " .... ", " .. .. ", " .. .. ", " .. ... ", " .. ... ", " .. ... ", " .. .... ", " ... .... ", " .. .... ", " ........................ ..... ", " . ..... ", " . ...... ", " .. ................ .......... ", " . ............................ ", " . ............................. ", " . .............................. ", " . ......... ", " .. ......... ", " . ........ ", " . ........ ", " . ...... ", " . ...... ", " .. .... ", " ..... ", " ... ", " . ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " },{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "................................. ........................", "................................ . .......................", "............................... ... ......................", ".............................. ..... ............. .......", "............................. ....... .......... . ......", "............................ ......... ....... .... .....", "........................... ........... .... ...... .....", ".......................... ............. . ......... ....", "......................... ............... ........... ....", "......................... ............... ............ ...", "......................... ............... ............ ...", "......................... ............... ............. ..", "......................... ............... ............. ..", "......................... ............... .............. .", "......................... ............... .............. .", "......................... ............... ............... ", "......................... ............... .............. .", "......................... ............... .............. .", "......................... ............... ............. ..", "......................... ............... ............. ..", "......................... ............... ............ ...", "......................... ............... ............ ...", "......... ............... ............... ........... ....", "........ . ............. . ............. . ......... ....", "....... ... ........... ... ........... .... ...... .....", "...... ..... ......... ..... ......... ....... .... .....", "..... ....... ....... ....... ....... .......... . ......", ".... ......... ..... ......... ..... ............. .......", "... ........... ... ........... ... ......................", ".. ............. . ............. . .......................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ". ............... ............... ........................", ".. ............. . ............. .........................", "... ........... ... ........... ..........................", ".... ......... ..... ......... ...........................", "..... ....... ....... ....... ............................", "...... ..... ......... ..... .............................", "....... ... ........... ... ..............................", "........ . ............. . ...............................", "......... ............... ................................", "..........................................................", ".........................................................." }, { /* columns rows colors chars-per-pixel */ "58 55 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "................... .................", ".................. ..................... ................", "................. ...................... ...............", "................ .... .. ..............", "............... .......................... .............", ".............. ............................ ............", "............. .............................. ...........", "............ ................................ ..........", "........... .................................. .........", ".......... .................................... ........", "......... ...................................... .......", "........ ........................................ ......", "....... .......................................... .....", "...... ............................................ ....", "..... .............................................. ....", "..... .. .......................................... .. ...", "..... . .......................................... .. ...", "...... .. ........................................ .. ....", "...... .. ........................................ .. ....", "....... . ........................................ .. ....", "....... . ........................................ . .....", "....... .. ...................................... .. .....", "....... .. ...................................... .. .....", "........ . ...................................... . ......", "........ .. .................................... .. ......", "........ .. .................................... .. ......", "......... . .................................... .. ......", "......... .. .................................. .. .......", "......... .. .................................. .. .......", ".......... . .................................. .. .......", ".......... . .................................. . ........", ".......... .. ................................ .. ........", ".......... .. ................................ .. ........", "........... .................................... .........", "........... ................................... .........", "............ ................................ ..........", ".............. ............................ ............", "................ ........................ ..............", ".................. ..................... ................", ".................... ................. .................", "...................... ............. ...................", "........................ ......... .....................", ".......................... ..... .......................", "............................ .........................", ".............................. ...........................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .................. ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " .................... ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "................. ..................... ..................", "................ . ................... . .................", "............... ... ................. ... ................", ".............. .. .. ............... .. .. ...............", "............. .. .... ............. .... .. ..............", "............ .. ...... ........... ...... .. .............", "........... .. ........ ........ .. ............", "........... . ....... . ......... . ....... . ............", "........... ......... . ......... . ......... ............", "........... ......... . ......... . ......... ............", "........... ......... . ......... . ......... ............", "........... ......... . ......... . ......... ............", "........... ......... . ......... . ......... ............", "........... ......... . ......... . ....... . ............", "........... .. ...... . ......... . ...... .. ............", "............ .. ...... ......... ...... .. .............", "............. .. .... .. ....... .. .... .. ..............", ".............. .. .. .... ..... .... .. .. ...............", "............... ... ...... ... ...... ... ................", "................ . ........ . ........ . .................", "................. .......... .......... ..................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, { "58 58 2 1", " c Gray0", ". c Gray100", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".......... .............. . ....................", "......... ........... .............. . ..................", "........ ............. ........... .. .. ................", "....... ............... ........... .. ... .............", "...... ................. ........ .. .. ..... ...........", "..... ................... ........ .. ......... ..........", ".... ..................... ..... .. ........... ..........", "... ....................... ..... ............. ..........", ".. ......................... .. ............... ..........", ". ........................... ................ ..........", " ............................. ............... ..........", ". ........................... . .............. ..........", ".. ......................... .. ............ ..........", "... ....................... .... .......... ..........", ".... ..................... ...... ........ ...........", "..... ................... ....... ...... ............", "...... ................. ......... .... .............", "....... ............... ........... .. ..............", "........ ............. ............. ...............", "......... ........... .............. ................", ".......... ................ .................", "..................................... ..................", "...................................... ...................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "............... ................. .................", "........... ..... ............... .... .............", "........ .......... ............. ......... ..........", "...... ....... ..... ........... ... ......... ........", "..... ...... ........ ......... ... ............ .......", ".... .... ............ ....... ... .......... ... ......", ".... .. ................ ..... .. ............ .. ......", "... ...................... ... .. ............... .. .....", "... ....................... .. ................ .. .....", ".. ......................... .. .................. .. ....", ".. ......................... ..................... .. ....", ". .......................... ...................... .. ...", ". .......................... ...................... .. ...", ". .......................... ....................... . ...", " ........................... .......................... ..", " ........................... .......................... ..", " .. ........................ .......................... ..", ". . ........................ ......................... ...", ". .. ....................... ......................... ...", ". .. ....................... ........................ ....", ".. .. ...................... ........................ ....", ".. .. ................... .. ....................... .....", "... .. ................. .. ...................... .....", "... .. ................ .. ... .................... ......", ".... .. .............. .. ..... ............... .. ......", ".... .. ............. .. ....... ........... ... .......", "..... .............. .. ......... ...... ...... .......", "...... ........... .. ........... ... ........ ........", "........ .......... ............. ......... ..........", "........... ..... ............... ..... .............", "............... ................. ................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "............ .............................................", "........... . ............................ ..............", ".......... .. ............................ . .............", "......... .... .......................... ... ............", "........ .. .. .......................... . .. ...........", "....... .. .... ........................ ... .. ..........", "...... .. ..... ........................ .... .. .........", "..... .. ....... ...................... ...... .. ........", ".... .. ........ ...................... ....... .. .......", "... .. .......... .................... ......... .. ......", "... . ........... .................... .......... .. .....", "... .............. .................. ............ . .....", "... .............. .................. .............. .....", "... ............... ................ ............... .....", "... ............... ................ ............... .....", "... ................ ................ .....", "... ................ .............. ................ .....", "... ................ ................ .....", "... ............... ................ ............... .....", "... ............... ................ ............... .....", "... .............. .................. .............. .....", "... . ............ .................. .............. .....", "... .. .......... .................... ........... . .....", ".... .. ......... .................... .......... .. .....", "..... .. ....... ...................... ........ .. ......", "...... .. ...... ...................... ....... .. .......", "....... .. .... ........................ ..... .. ........", "........ .. ... ........................ .... .. .........", "......... .. . .......................... .. .. ..........", ".......... ... .......................... .... ...........", "........... . ............................ .. ............", "............ ............................ . .............", "........................................... ..............", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "...................................... ...................", "................... ................. . ..................", ".................. . ............... .. .................", "................. ... ............. . ... ................", "................. . .. ........... .. .... ...............", "................ .. ... ......... .. ...... ..............", "............... .. ..... ....... ... ....... .............", "............... .. ...... ..... .... ........ ............", ".............. .. ........ ... .... .......... ...........", "............. .. .......... . ..... ........... ..........", "............. .. ........... ...... ............ .........", "............ .. ............ ..... ........... . .........", "........... .. ............. ..... ........... . .........", "........... .. ............. ..... ........... . .........", ".......... .. .............. .... ............ . .........", "......... .. ............... .... ............ . .........", "......... .. ............... .... ............ . .........", "........ .. ................ .... ............ . .........", "....... .. ................. ... ............. . .........", "........ ................... .... ............ . .........", "......... .................. .... ............ . .........", "......... .................. .... ............ . .........", ".......... ................. .... ............ . .........", "........... ................ ..... ........... . .........", "........... ................ ..... ........... . .........", "............ ............... ..... ............. .........", "............. .............. ...... ............ .........", "............. ............. . ..... ........... ..........", ".............. ........... ... .... .......... ...........", "............... ......... ..... .... ........ ............", "............... ........ ....... ... ....... .............", "................ ...... ......... .. ...... ..............", "................. .... ........... .. .... ...............", "................. ... ............. . ... ................", ".................. . ............... .. .................", "................... ................. . ..................", "...................................... ...................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .. ", " . .. ", " .. . .. . ", " .. .. . ... . ", " .. .. .. .... .. ", " . . .. ... .. ", " . .. ... .. ", " . . ... ", " . .. ... ", " . .. .. ", " . .. ... ", " . .. . . ", " . .. . ", " . .. . ", " . .. . ", " . .. . ", " . .. . ", " . .. . ", " . . . . ", " .... ..... .. ", " .... .. .... . ", " .... .. ... . ", " .... .. . ", " ... .. ", " .. ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/*XPM*/ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ......... .......... ", " . ....... . .. ...... . ", " .. .. . . ", " . . . . ", " . . . .. ", " . . . . ", " . . . .. ", " . .......... . ", " .. .. ... .. ", " ... .. .. .. ", " .. .. ... ... ", " .. .. .. .. ", " .. .. .. ... ", " .. .. .. .. ", " .. .. . . ", " ......... .......... ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " . ", " .. ", " . ", " .. ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " .. . ", " .. .. . ", " . . . ", " .. .. ", " .. . ", " .. . .. ", " . . . ", " .. . .. ", " .. . .. ", " .. . .. ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . .. . ", " . . . ", " . . . ", " . .. . ", " . .. .. . ", " . .. .. . ", " . .. .. . ", " . .. .. . ", " . .. .. . ", " . .. .. . ", " . ... ... . ", " . .. .. . ", " .... .... ", " .. .. ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " . . ", " . . . . ", " . . . . . ", " . . . . . . ", " . . . . . .. ", " . . . . . .. ", " . . . . ... ", " . . .. ... ", " . . ... ", " . . . ... ", " . . . ... ", " . . . ... ", " . . . ... ", " . . . ... ", " . . . ... ", " . . . ... ", " . . . . . .. ", " . . . . . .. . ", " . . . . . .. . ", " . . . . .. . ", " . . . . . ", " . . . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . . ", " . . . . ", " . . . . . ", " . . . . . . . ", " .. . . . . . . ", " .. . . . . . . ", " ... . . . . ", " ... . . . ", " ... . . . ", " ... . . . ", " ... . . . ", " ... . . . ", " ... . . . ", " ... . . . ", " ... . . . ", " ... . . . ", " ... . . . . . ", " .. . . . . . ", " .. . . . . . ", " . . . . . ", " . . . . ", " .. .. ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "............... ............................... .........", "............... . .......................... .........", ".............. ..... ..................... .. .........", ".............. ........ ................. ... ..........", "............. ........... ............ ..... ..........", "............. .............. ....... ....... ..........", "............ .................. .. ........ ...........", "............ ..................... .......... ...........", "........... .................................. ...........", "........... ................................. ............", ".......... .................................. ............", ".......... ............. ................. .............", "......... ........... ... ............... .............", "......... ........ ........ ............ .............", "........ ...... .............. ......... ..............", "........ ... ................... ....... ..............", "....... . ........................ .... ..............", "....... .............................. . ...............", "......................................... ...............", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "....................... ..........................", "...................... ......... .........................", "..................... ........... ........................", ".................... ............. .......................", "................... ............... ......................", ".................. ................. .....................", "................. .................. ....................", "............... ................. .. ..................", "............ ... ............... ..... ................", ".......... ....... ............. ........ ..............", ".......... ......... ........... ........... .............", ".......... .......... ......... ............ .............", "......... ............ ............. .............", "......... ............ ........ ............ .............", "........ ............ ......... ............ .............", "........ ............ .......... ........... .............", "....... ............ ........... ........... .............", "....... ............ ............ .......... .............", "........ .......... ............. .......... .............", "......... ......... ............. ......... ..............", ".......... ....... . ........... . ....... ...............", ".......... ...... ... ......... ... ..... ................", "........... ... ..... ..... ..... ... .................", "............ . ......... ... ........ . ..................", "............. ........... . .......... ...................", "............. ............ ........... ...................", "............. ............ ........... ...................", "............. ............ ........... ...................", "............. ............ ........... ...................", "............. ............ ........... ...................", "............. ............ ........... ...................", "............. ............ ........... ...................", "............. ............ ........... ...................", ".............. .......... . ......... ....................", "............... ........ ... ....... .....................", "................ ...... ..... .... ......................", "................. .... ........ .. .......................", ".................. .. .......... ........................", "................... .....................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "......................... ...............................", "........................ .. ..............................", "....................... .... .............................", "...................... ...... ............................", "..................... ........ ...........................", "....... ........... .......... ........... .............", "...... .. ........ ............ ........ .. ............", "..... ..... .... .............. .... ..... ...........", "..... ........ . ................ . ........ ...........", ".... ........... ................ ........... ..........", ".... ............. .............. .............. .........", "... .............. .............. .............. .........", "... ............... ............ ................ ........", ".. ................ ............ ................ ........", ".. ................. .......... .................. .......", "... ................ .......... .................. .......", "... ................. ................... .......", ".... ............... .......... ................. ........", ".... .............. ............ ................ ........", ".... .............. ............ ............... .........", "..... ............ .............. .............. .........", "..... ............ .............. ............. ..........", "...... .......... ................ ............ ..........", "....... ........ ................ ......... ...........", "......... ...... .................. ..... ..............", ".......... .. .................... . .................", "............. ..................... ....................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, /* SUGAR */ {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ... ", " . . ", " . . ", " ...................... . . ", " .. . . ", " .. ... ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " .. .. ", " . . ", " .. .. ", " .. .. ", " ... ... ", " .... .... ", " ..... ..... ", " ...... ...... ", " ....... ....... ", " ....... ....... ", " .................................... ", " .................................. ", " .................................. ", " ................................ ", " .............................. ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "........... ......................................", "................... .................... .................", "................... .................... .................", "................... ......... .......... .................", "................... ........ . ......... .................", "................... ..... . . . ...... .................", "................... .... ... . ... ..... .................", "................... .. ..... ..... ... .................", "................... ............... . .................", "................... ................... .................", "................... .................... .................", ".................... .................. .................", ".................... ................ ..................", "..................... ................ ...................", "..................... .............. ...................", "...................... ............ ....................", "...................... ............ ....................", "....................... .......... .....................", "....................... ......... ......................", "........................ ....... ......................", "........................ .......................", "......................... .......................", "......................... ........................", "......................... ....... ........................", "......................... ....... ........................", "......................... ....... ........................", "......................... ....... ........................", "......................... ....... ........................", "......................... ....... ........................", "......................... ....... ........................", "......................... ....... ........................", "......................... ....... ........................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "......................................... .. . ...........", "... . .. ............................... . . . ...........", "... . . . .............................. . . ...........", "... . . . ...................... . . . ...........", "... . . . ....... ....................... .. . ...........", "... . .. ........ ........... ............................", "................. .......... . .......... ................", "................. ....... . . . ....... ................", "................. ...... ... . ... ...... ................", "................. .... ..... ..... .... ................", "................. .. ............... .. ................", "................. . ................... . ................", "................. ..................... ................", "................. ....................... ................", ".................. ..................... .................", "................... ................... ..................", ".................... ................. ...................", "..................... ............... ....................", "...................... ............. .....................", "....................... ........... ......................", "....................... ......................", "....................... ........... ......................", "....................... ........... ......................", "....................... ........... ......................", "....................... ........... ......................", "....................... ........... ......................", "....................... ........... ......................", "....................... ........... ......................", "....................... ........... ......................", "....................... ........... ......................", "..........................................................", "....................... .. . ...... .. . .................", "...................... . . . ..... . . . .................", "...................... . . ..... . . .................", "...................... . . . ..... . . . .................", "....................... .. . ...... .. . .................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ... . ", " . . . ", " . .... ", " . . . ", " .. ", " . ", " . ", " . ", " . . ", " . .. . ", " . .. .. ..... ... . ... . ", " . .. . . ... .. . . .. . . .. . ", " . . . . .. . . ... .. .... ", " . .... . . .. . .. .. . ", " . . . . . ", " . . ... . ... ", " . ....... . . .... ", " . .... . ... . . . . ", " .. . . ... ..... ... . ", " . . . ", " . . ", " . ", " . ", " ... . . .. . ", " . .. . . .... ", " . .... . .. . ", " ... . . . . ", " ", " ", " ", " ", " ", " ", " ", " ", " ....... ", " . ", " . ", " .... . . . ", " . .. . . . ", " . . ..... . . ", " . . . . ", " . . . . ", " . . .... ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " . ", " . .. . ", " . .... ", " . .. . ", " . .. . . ... . ", " . . . .. . ", " . . . . .. .... ", " . ... . .... ... ", " . .. . . ", " . . . . . ", " ... . . .. ", " . .. ... . ", " . .. . .. . ", " .. . ", " . . . ", " . .. . . .. . ", " .... . . ... . .. . ", " . .. ... . ... . .. . ", " . ....... . ... ", " . ", " ... . . ", " . . . . ", " . .. . ", " . . . . ", " . .. . ", " . .... ", " . .. . ", " . ", " ", " ", " ", " ", " ", " ....... . ", " . . . ", " . . ", " . . ", " . . ", " . . ", " . ...... ...... . ", " . . . . . ", " . . . . . ", " . . . . . ", " ....... ........ ... ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .. . . . . . ", " . ... . .... ", " . . ... . .. . ", " .. . . . . . . ", " . . .. ", " . ... . . ", " . . . ", " . .. .. ", " . . . . . .. . ... ", " . .. . . . .. ... . ", " ..... . . ..... . ", " . . . . . ", " . . ", " . . . . . . ", " . .. . . .. . .. . ", " ..... . . . . . .. . ", " . . . ... . . .. . .. .. ", " . .. . . ", " . . ", " . . ", " . . . . ", " . .. . . ", " . .... . ", " . .. . . . . ", " . . . . .. . ", " . .... ", " . .. . ", " . . . ", " ", " ", " ", " ", " ..... . ", " . . . ", " . . ", " . . ", " . .... . ..... ", " . . . . . ", " . . . . ", " . . . . . ", " ..... .... ..... ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .. . . . . . . . . ", " . . . . .. . . .. . ", " . ...... .... . .... ", " .. . . . . . . . . . ", " ... . .. ", " . . . . ", " ..... . . . . ", " . . . .. .. .. . ... .. ", " . .. . . . ... .. .... . ", " .... . . .... ... . .. ", " . . . . .. . . ", " . . . . . . ", " . . . .. . . . . . . ", " . . . . . .... .. . . ... ", " ... . . . ... .... . . . . . ", " . . . .. . .... ... . .. ", " .... .. .... .. ", " ... .. ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " . . ", " .. .. ", " . . . . ", " . . . . ", " . . . . ", " . . . ..... .... ", " . . . . . . ", " . . . . . . ", " . . . . . . ", " . . . . . . ", " . . .... . . . ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* fucose */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .. ", " . .... ", " .. . ", " ", " . ", " . ", " . ", " .. .. .. ", " ... ... . .. . ", " .. . . . . . . ", " . . ... . ", " . . . ", " . .... . .. . ", " . ... . ... . ... ", " .... . .. .... .. ", " . . ", " . ", " ", " . ", " ..... .... ", " ..... ..... ", " ", " ", " ", " ", " ", " ", " ......... ", " . ", " . ", " . ", " . ", " . ", " ..... . . ...... ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . ...... ....... ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* xylose */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .. ", " . . . ", " . . .... . . ", " ... . . ... .. . . ", " . ... ... . . .... ", " . . ..... ", " ... . .. . . ", " ... . . .. . ... . . ", " .. ... ..... . ...... ", " . ", " ", " . ... ", " . ... ", " ", " ", " ", " ", " ", " ", " ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . . ", " . . . . . ", " . . . . . ", " . . .. . ", " . . . . ", " . . . ... ", " . ", " . ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* neuramin */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " . ... .. .. . ", " .... . . .. .... ", " .. . . ", " ... . ", " . ... . ... . . ", " ... . . ", " . .... . ", " .. .. .. . ...... . ", " .. . .. ..... ", " . . . .. . . ", " . .. . ..... ", " .. .. . . ..... ", " . ... . ..... . ", " .. .. . ... . ... . ", " ..... ... ", " . ", " . ", " ", " .. ", " . .... ", " . ", " ", " ", " ", " ", " . . ", " .. . ", " . . . ", " . . . ", " . . . ", " . . . .... . . ", " . . . . . . . ", " . . . . . . . ", " . . . ........ . . ", " . .. . . . ", " . . ...... .... .", " ", " ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* sucrose(saccharose)*/ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " . .. .... ", " . . .. ", " . . .... ", " ... . . . . ", " ... .. . ", " . . ", " .... . . . . . .. ", " . ... . . ", " . . .. ", " .... . . ", " .. . . . ... . ", " . . .. ", " . . ", " . . ", " .. . . ", " ........ . ", " . ", " . .... ", " . ", " ", " ... ", " ... ", " ", " ", " ..... . ", " . . . ", " . . ", " . . ", " . . ", " . . ", " . . .... ", " . .... .... .... . . .... . . ", " . . . . . . . . . . ... ", " . . . . . . . . . . ", " . . . . . . . . . . ", " . . . . . . . . . . . .. ", " ..... ...... .... .... . . ...... . .. ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* maltose */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " . .. ", " . ....... ", " . . ", " .. .. ", "... . . . . .. ", "... . . ", " ", " .... . . ... ", " .. .... ... ", " . . ", " . . .. ..... ", " .... . . ", " .. . .. ", " .. . . . . ", " . . .. . ", " . . .... ", " .... ... . ", " ... . . . .... . ", " ", " . ", " .... ", " ", " ", " ", " ", " ", " . . . ", " . . . . . . ", " . . . . . . ", " . . . . . ....... ", " . . . . . . ", " . . . . . ", " . . ...... . . ..... .... ", " . . . . . . . . . ", " . . . . . . . . .... ", " . . . . . . . . . ", " . . . . . . . . . ", " . . ..... . .. .. .... .... ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", ". c Gray100", " c Gray0", /* lactose */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "............. .........................................", "..........................................................", "............. .. ....................................", "............. . .. ..................................", ".............. . ... ..................................", "............... .... .. .................................", "........... . . ................................", "................ .... ... ................................", "..................... . ...... ....................", "............................ .. ... ..................", "......................... .. .....................", ".............................. ........ .... .............", "........................... . ..........", "............................... .... .. ...............", "..........................................................", "..................................... ..................", "..........................................................", "..........................................................", "..........................................................", "............................ .............................", "............................ .............................", "............................ .............................", "............................ .............................", "............................ .............................", "............................ ........... ....... .", "............................ .......... ...... ..... .....", "............................ .......... ...... ..... .....", "............................ .......... ...... ..... .....", "............................ .......... ...... ..... .....", "............................ .......... ...... ..... .....", "............................ ... . .... .", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, /* HETEROCYCLES*/ {{/* n_ade */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " . . . . ", " .. . . . ", " . .. ... .. ", " . . . . . ", " . ", " . ... ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " .. ", " . . ", " .. . .. ", " .. .. . ", " .. .. .. . . ", " .. .. .. .. . ", " . . .. .................... .. ", " .. . .. . . . ", " . .. . . . ", " . . . . . . ", " . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . ", " . . .... .. ", " . . . . . ", " . . .. .. .. ", " . . . . . . . .. ", " . .. . . . .. . . ", " . .. . .. ", " . . . . ", " ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " ", " ", " ", " " }, {/* n-gua */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ... ", " . . ", " . . ", " . . ", " . . ", " ... ", " ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " ... ", " . . ", " .. .. ", " .. . ", " .. .. . .", " .. .. .. .", " . . . . .................... ..", " . . .. . . . .", " .... . .. . . . ", " . . . . . . . . ", " . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . ", " . . . .... .. ", " . . . . . . ", " . . . .. .. .. ", " . . . . . . . . .. ", ". . . . . .. . . . .. . . ", ". . .. . . .. . .. ", ".... ... .. . . . . ", ". . .. . ", " . . ", " ... . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " ", " ", " ", " " }, {/* n-thy */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ... ", " . . ", " . . ", " . . ", " . . ", " ... ", " ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ... . . ", " . . . . . ", " ... . .... ..", " . . . ... . . .", " .. .. . .. ", " .. . . .", " .. .. . ...", " .. .. . ", " . . . . . ", " . . .. . . ", " .... . .. . . ", " . . . . . . ", " . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " .. . ", " .. .. .. ", " .. .. . . ", " .. .. . .. ", " .. .. . . . . ", " .. .. . .. . . ", " .. .. . .. ", " . . . . ", " . . . ", " .. . ", " . ", " . ", " . ", " . ", " . ", " . ", " ", " ", " ", " ", " ", " ", " " }, {/* n-cyt */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " . . . . ", " .. . . . ", " . .. ... .. ", " . . . . . ", " . ", " . ... ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " ... ", " . . ", " .. . .. ", " .. .. . ", " .. .. .. ", " .. .. .. ", " . . .. . ", " .. . .. . ", " . .. . . ", " . . . . ", " . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " .. . ", " .. .. .. ", " .. .. . . ", " .. .. . .. ", " .. .. . . . . ", " .. .. . .. . . ", " . . . .. ", " . . . . ", " .. . ", " . ", " . ", " . ", " . ", " . ", " . ", " . ", " ", " ", " ", " ", " ", " ", " " }, {/* n-ura */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ... ", " . . ", " . . ", " . . ", " . . ", " ... ", " ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " ... ", " . . ", " .. .. ", " .. . ", " .. .. ", " .. .. ", " . . . . . ", " . . .. . . ", " .... . .. . . ", " . . . . . . ", " . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " .. . ", " .. .. .. ", " .. .. . . ", " .. .. . .. ", " .. .. . . . . ", " .. .. . .. . . ", " .. .. . .. ", " . . . . ", " . . . ", " .. . ", " . ", " . ", " . ", " . ", " . ", " . ", " ", " ", " ", " ", " ", " ", " " }}, {{/* XPM */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", ".............................. ...........................", "............................ . .........................", "........ ............... .. .. .............. .......", "....... .. ......... ..... .. ........ .. ......", "....... .. .. ... .......... .. .. ..... . .....", "...... ..... .... .............. .. ......... . .....", "...... ....... ... ................. . ........... . ....", "..... .......... . ................... ........... . ....", ".... .............. ................... ............ . ...", "... .............. ................... ............ . ...", "... ............... ................... ............. . ..", "... .. ............ ................... ............. . ..", ".... .. ........... ................... .............. ...", ".... .. .......... .. ............... .. . .......... ...", "..... .. ......... . ............... . ... ..... ....", "...... . ......... . ............... . ..... .. .....", "...... . ...... .. ............... .. .. ..... ......", "....... ..... .............................. .. ......", "....... . .................................... .......", "........ ......................................... ......", "........ .......................................... ......", "........ ........................................... .....", "....... ............................................ .....", "...... .............................................. ....", "..... ............................................... ....", "..... ................................................ ...", ".... ................................................. ...", "... ................................................... ..", "... .. ............................................. .. ..", ".... .. ............................................ . ...", ".... ... .......................................... .. ...", "..... .. .......................................... . ....", "...... .. ........................................ . .....", "....... .. ...................................... .. .....", "....... ........................................... ......", "........ ......................................... .......", "........ ....... .. ............... .. ...... .......", "........ .. ... . ............... . .... .. ......", "........ ...... . ............... . ...... ......", "....... .......... .. ............... .. ........... .....", "...... ............ ................... ............. ....", "..... ............. ................... . ........... ....", "..... ............. ................... . ............ ...", ".... .............. ................... . ............. ..", "... .............. ................... . ........... . ..", "... . ............. ................... . .......... . ...", ".... . ............ ................... . .......... . ...", "..... . ........... ................... ........... . ....", "...... . .......... .. ................ ........... . ....", "....... . ........ ... .............. ........ . .....", "........ . .... .. ... ........... ... ...... .....", "......... .. ....... .. ....... ......... . ......", ".......... ............ ... ..... ............... ......", "......................... ..... ........................", "........................... . ..........................", "............................. ............................" }, /*caffeine*/ {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " .. ", " . . ", " . . ", " .. ", " .. . . ", " . . . ... ", " . . . . ... ", " . . .. . . . ", " . . . .. ", " . . .. . . . . ", " ... . . . . .. ", " . .... . . . ", " . . . .. . . . .. . ", " .. . . . . .. ", " . . . . . .. .... . ", " ... .. .. ... . ", " . .. . . ", " . . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . ", " .. . ... . ", " .. .. . . .. . . ", " . .. .. . . ... . ", " . . .. . . .. . .. ", " . . . .. . . . ", " . . .. ", " . . ", " . ", " . ", " . ", " ", " .. . . ", " . . . ", " . ... .. ", " .. . . . ", " .. ", " . ", " .. ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* evans aux */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "......................... ...............................", "........................ .. ..............................", "........................ .. ..............................", "........................ .. ..............................", "........................ .. ..............................", "......................... ...............................", "..........................................................", "........................ .. ..............................", "........................ .. ..............................", "........................ .. ..............................", "........................ .. ..............................", "........................ .. ..............................", "........................ .. ..............................", "........................ .. ..............................", "........................ .. ..............................", "......................... .................. ............", "........................ .. ................ .............", "....................... .... .............. ..............", "...................... ...... ............ ...............", ".................... ........ ......... ................", "............... .. ............ . .. .. .................", ".............. .. .............. .. . ..................", ".............. .. ................ . ....................", ".............. .. ................ . ....................", ".............. .. ................ .. ....................", "............... ................. .. ....................", "................. .................. .....................", "................. ................. ......................", ".................. ................ ......................", ".................. ............... .......................", ".................. ............... .......................", "................... ............. ........................", "................... ............. ........................", ".................... ........... .........................", ".................... ........................", "................................. .......................", "................................. ......................", ".................................. ......................", ".................................. .....................", "................................... ....................", "................................... ...................", ".................................... ....................", ".................................... .....................", ".................................... .....................", "................................... ......................", "................................... ......................", ".................................. .......................", "..........................................................", "................................ .. ....................", "................................ .. . ....................", "................................ .. ...................", "................................ .... . ..................", "................................ .... . ..................", "..........................................................", "..........................................................", ".........................................................." }, {/* samp */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* pixels */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "............. .................................", "............. .......... .................................", "............ ............ ................................", "............ ............ ................................", "........... .............. ...............................", "........... .............. ...............................", "........... .............. ...............................", ".......... ................ ................ .. ... .....", ".......... ................ ............... .. . . .. ..", "......... .................. .............. .. . . . . . .", "......... .................. .............. .. . . . . .", "........ .................... ............. .. . ... . ...", "......... .................. ........... .. . ... . . .", ".......... .............. .. ....... .. .. ... .. ..", "............ ............ ..... ..... ..................", "............. ........ ....... .. ...................", "............... . .. . .......... ....................", "................. .. ............. .....................", "................. . .............. ......................", "................. . .....................................", "................. .. .....................................", "................. .. .....................................", "..........................................................", "................... ......................................", "................... ......................................", "................... ......................................", "................... ......................................", "................... ......................................", "................... ......................................", "................... ......................................", "................. .. . .. ................................", "................. .. . .. ................................", "................. . . ................................", "................. . . .. .. .............................", "................. .. . .. . . ............................", "................. .. . .. ... ............................", "............................ .............................", "........................... ..............................", "........................... ............................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* imidazole */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c gray100", ". c black", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " . . ", " .. . ", " .. . .. ", " ... . .. ", " .... . ", " ... . . ", " . . . ", " . . . ", " . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . .. ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . ", " . . ", " .. . ", " .. .. ", " ... . ", " ... . . ", " . .. . ", " . .. ", " . . ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* benzimidazole */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c gray100", ". c black", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .. ", " . .. ", " ... . . . ", " . .. .. .. . ", " .. . . .. . .. ", " .. .. .. ... . . ", " .. . . .. . ", " . . . . . ", " . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . . . ", " . . . .. ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . ", " . . . . ", " . .. .... . ", " . .. . .. . . ", " . . .. .... .. . ", " . .. . . .. ", " .. .. .. . . ", " .. .. ", " .. ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* pyrazole */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c gray100", ". c black", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " .. ", " .. .. ", " ... .. ", " .... .. ", " ... . . ", " . . . ", " . . . ", " . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . .. . ", " . . . .. ", " . . . . ", " . . . ", " . . . ", " . . . ", " . . ", " . . ", " .. . ", " .. .. ", " ... . ", " ... . . ", " . .. . ", " . .. ", " . . ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* diazole */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c gray100", ". c black", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " . . ", " .. . ", " .. . .. ", " ... . .. ", " .... . ", " . ... . . ", " .. . . . ", " . .. . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . . . ", " . . .. ", " . . . ", " . . . ", " . . . ", " . . . ", " . . . ", " . . ", " . . ", " .. . ", " .. .. ", " ... . ", " ... . ", " .. . ", " .. ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* morphine */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c gray100", ". c black", /* pixels */ " ", " ", " ", " ", " ", " ", " . . ... . ", " ... . .. . . ", " . . ... . . . ", " . . . . ", " . . . ", " . . . ", " . . . . . . . ", " . . . . ... ", " . . . ... . . .. ", " . . . . .. ", " . . . . . . .. ", " . . .... ...... ", " . . . ..... . ", " . . . .. .... . ", " . . ... .. ", " . .. . .. ", " . . . .. ", " ... . .. .. ", " . . . .. . ", " ... . . .. ", " . . . . ", " . . . . ", " . . . . ", " . . .. . ", " . .. . .. ", " . . .. ", " . . ", " . ... ", " . . .. ", " . . .. ", " . . ", " . . ", " . . . ", " . . . ", " . . . . ", " . . ... . . .. ", " ... . . . . ", " . . ... . ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* morphine 3d */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c gray100", ". c black", /* pixels */ " ", " ", " ", " ", " ", " ", " ", " ... . . ", " . ... ", " ... . . . ", " . .. ", " . . ", " . ", " . . ", " ............ ", " ..... . . ", " .. . ", " .. . ", " .. . ", " . . ", " .. . ", " .. .. . ", " . .. . ", " . .. . ", " . . . ", " .. . . ", " . . . ... . . ", " . . . . ........ ... ", " . . . ...... . . . ", " . . . .. . .. ", " . . . . . ", " . . . . ", " . . . . ", " . . . . . ", " .. . . . . ", " . . .. . . . . ", " . . . .. .. . . . ", " . . . . . . . ", " . ... . . ", " . . . . . ", " . ... . . ", " . . ... . ", " ... . . . ", " . . ... . ", " ... . . ", " . . ... ", " ... . . ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, /* AMINOACIDS*/ {{/* Ala */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "......................................... ...............", "........................................ ................", "....................................... .................", "...................................... ..................", "..................................... ...................", ".................................... ....................", "................................... .....................", ".................................. ......................", "................................. .......................", "................................ ........................", "............................... .........................", ".............................. ..........................", "............................. ...........................", "............................ ............................", "........................... .............................", ".......................... ..............................", "......................... ...............................", "........................ ................................", "....................... .................................", "...................... ..................................", "..................... ...................................", ".................... ....................................", "................... .....................................", ".................. ......................................", "................. .......................................", "................ ........................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, /* XPM */ /* columns rows colors chars-per-pixel */ { "58 58 2 1", " c black", ". c white", /* Arg */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "............................... .. . .. ..................", "............................... . . .. ..................", "............................... . . .. ..................", "............................. . . . ..................", "............................ .. . . .. ...............", "..... .. .. .. ............ ... .. . .. .. ...............", "..... .. .. . ........... .............. ................", "..... .. .. . . .............. ...............", "..... .. . ......... .................................", "..... .. .. . . ................................", " .... .. .. .. ........... ...............................", "........................... ..............................", "..........................................................", "............................ .. ..........................", "............................ . ..........................", "............................ . ..........................", "............................ . ..........................", "............................ . ..........................", "............................ .. ..........................", "............................. ............................", "............................ .............................", "........................... ..............................", ".......................... ...............................", "......................... ................................", "........................ .................................", "....................... ..................................", "........................ .................................", "......................... ................................", ".......................... ...............................", "........................... ..............................", "............................ .............................", "............................. ............................", ".............................. ...........................", "............................. ............................", "............................ .............................", "........................... ..............................", ".......................... ...............................", "......................... ................................", "........................ .................................", "....................... ..................................", "........................ .................................", "......................... ................................", ".......................... ...............................", "........................... ..............................", "............................ .............................", "............................. ............................", ".............................. ...........................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Asn */ ".......... ......................................", "......... .. .....................................", "......... .... .....................................", "......... .... .....................................", "......... .. .....................................", ".......... ......................................", ".............. .....................................", "............... ....................................", "............... ....................................", "................ ...................................", "................ ...................................", "................. ..................................", "................. ..................................", ".................. .................................", "................... ................................", "................... ................................", ".................... .................. ... ........", ".................... .................. .. ........", "..................... .. . . ........", "..................... ................. .. ........", ".................... .................. ... ........", ".................... .................. ... ........", "................... ................................", ".................. .................................", ".................. .................................", "................. ..................................", "................. ..................................", "................ ...................................", "................ ...................................", "............... ....................................", "............... ....................................", ".............. .....................................", "............. ......................................", "............. ......................................", "............ .......................................", "............ .......................................", "............. ......................................", ".............. .....................................", ".............. .....................................", "............... ....................................", "............... ....................................", "................ ...................................", "................ ...................................", "................. ..................................", ".................. .................................", ".................. .................................", "................... ................................", "................... ................................", ".................... ...............................", "..................... ..............................", "..................... ..............................", "...................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Asp */ ".......... ......................................", "......... .. .....................................", "......... .... .....................................", "......... .... .....................................", "......... .. .....................................", ".......... ......................................", ".............. .....................................", "............... ....................................", "............... ....................................", "................ ...................................", "................ ...................................", "................. ..................................", "................. ..................................", ".................. .................................", "................... ................................", "................... ................................", ".................... ................... ........", ".................... .................. .. .......", "..................... .. .... .......", "..................... ................. .... .......", ".................... .................. .. .......", ".................... ................... ........", "................... ................................", ".................. .................................", ".................. .................................", "................. ..................................", "................. ..................................", "................ ...................................", "................ ...................................", "............... ....................................", "............... ....................................", ".............. .....................................", "............. ......................................", "............. ......................................", "............ .......................................", "............ .......................................", "............. ......................................", ".............. .....................................", ".............. .....................................", "............... ....................................", "............... ....................................", "................ ...................................", "................ ...................................", "................. ..................................", ".................. .................................", ".................. .................................", "................... ................................", "................... ................................", ".................... ...............................", "..................... ..............................", "..................... ..............................", "...................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Cys */ "....................................................", ".................. ............................", "................. ................................", "................. ..................................", ".................. ................................", "................... .............................", "..................... ............................", "....................... ............................", "...................... ............................", ".................. .............................", "....................................................", "....................................................", "........................ ...........................", "......................... ..........................", "......................... ..........................", ".......................... .........................", "........................... ........................", "........................... ........................", "............................ .......................", "............................ .......................", "............................. ......................", ".............................. .....................", ".............................. .....................", "............................... ....................", "............................... ....................", "................................ ...................", "................................ ...................", "................................. ..................", ".................................. .................", ".................................. .................", ".................................. .................", "................................. ..................", "................................ ...................", "................................ ...................", "............................... ....................", "............................... ....................", ".............................. .....................", "............................. ......................", "............................. ......................", "............................ .......................", "............................ .......................", "........................... ........................", "........................... ........................", ".......................... .........................", "......................... ..........................", "......................... ..........................", "........................ ...........................", "........................ ...........................", "....................... ............................", "...................... .............................", "...................... .............................", "...................................................." }}, {{ /* XPM */ /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Gln */ "....................................................", "................................... .. .............", "................................... . .............", "................................... . .............", "................................... .. .............", "................................... ................", ".................................. .................", ".................................. .................", "................................. ..................", "................................. ..................", "................................ ...................", "............................... ....................", ".............. .............. ....................", "............. ... ............ .....................", "............. ... . .....................", "............. ... ............ .....................", ".............. .............. ....................", "............................... ....................", "................................ ...................", "................................ ...................", "................................. ..................", "................................. ..................", ".................................. .................", "................................... ................", "................................... ................", ".................................... ...............", ".................................... ...............", "..................................... ..............", ".................................... ...............", ".................................... ...............", "................................... ................", "................................... ................", ".................................. .................", ".................................. .................", "................................. ..................", "................................. ..................", "................................ ...................", "............................... ....................", "............................... ....................", ".............................. .....................", ".............................. .....................", "............................... ....................", "................................ ...................", "................................ ...................", "................................. ..................", "................................. ..................", ".................................. .................", ".................................. .................", "................................... ................", ".................................... ...............", ".................................... ...............", "...................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Glu */ "....................................................", ".................................... .............", "................................... ... ............", "................................... ... ............", "................................... ... ............", ".................................... .............", ".................................. .................", ".................................. .................", "................................. ..................", "................................. ..................", "................................ ...................", "............................... ....................", ".............. .............. ....................", "............. ... ............ .....................", "............. ... . .....................", "............. ... ............ .....................", ".............. .............. ....................", "............................... ....................", "................................ ...................", "................................ ...................", "................................. ..................", "................................. ..................", ".................................. .................", "................................... ................", "................................... ................", ".................................... ...............", ".................................... ...............", "..................................... ..............", ".................................... ...............", ".................................... ...............", "................................... ................", "................................... ................", ".................................. .................", ".................................. .................", "................................. ..................", "................................. ..................", "................................ ...................", "............................... ....................", "............................... ....................", ".............................. .....................", ".............................. .....................", "............................... ....................", "................................ ...................", "................................ ...................", "................................. ..................", "................................. ..................", ".................................. .................", ".................................. .................", "................................... ................", ".................................... ...............", ".................................... ...............", "...................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* His */ "......................................................", "........................ .............................", "....................... . ..........................", "...................... ..... .......................", "...................... ........ ....................", "..................... ............ .................", ".................... ................ ...............", "................... .................. ...............", "................... .................. ...............", ".................. ................... ...............", "................. .................... ...............", "...................................... ...............", "............. ... .................... ...............", "............. .. .................... ...............", "............. . . .................... ...............", "............. .. .................... ...............", "............. ... .................... ...............", "................. .................... ...............", ".................. ...................................", "................... ................ ... .............", ".................... ............... .. .............", ".................... ............... . . .............", "..................... .......... . .. .............", "...................... ...... .... ... .............", "...................... ... .........................", "....................... ............................", "....................... ..............................", "...................... ...............................", "...................... ...............................", "..................... ................................", "..................... ................................", ".................... .................................", ".................... .................................", "................... ..................................", ".................. ...................................", ".................. ...................................", "................. ....................................", "................. ....................................", "................ .....................................", "................. ....................................", "................. ....................................", ".................. ...................................", ".................. ...................................", "................... ..................................", ".................... .................................", ".................... .................................", "..................... ................................", "..................... ................................", "...................... ...............................", "....................... ..............................", "....................... ..............................", "........................ ............................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Ile */ "......................................................", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "...................................... ...............", "..................................... ................", "..................................... ................", ".................................... .................", ".................................... .................", "................................... ..................", "................................... ..................", ".................................. ...................", "................................. ....................", "................................. ....................", "................................ .....................", "................................ .....................", "............................... ......................", "............................... ......................", ".............................. .......................", ".............................. .......................", ".......... ........................", ".............................. .......................", ".............................. .......................", "............................... ......................", "............................... ......................", "................................ .....................", "................................. ....................", "................................. ....................", ".................................. ...................", ".................................. ...................", "................................... ..................", ".................................... .................", ".................................... .................", "..................................... ................", "..................................... ................", "...................................... ...............", "......................................................" }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Leu */ "....................................................", "....................................................", "........... ........................................", "............ .......................................", "............ .......................................", "............. ......................................", ".............. .....................................", ".............. .....................................", "............... ....................................", "............... ....................................", "................ ...................................", "................ ...................................", "................. ..................................", ".................. .................................", ".................. .................................", "................... ................................", "................... ................................", ".................... ...............................", "..................... ............", ".................... ...............................", ".................... ...............................", "................... ................................", ".................. .................................", ".................. .................................", "................. ..................................", "................. ..................................", "................ ...................................", "................ ...................................", "............... ....................................", "............... ....................................", ".............. .....................................", "............. ......................................", "............. ......................................", "............ .......................................", "............ .......................................", "............ .......................................", "............. ......................................", ".............. .....................................", ".............. .....................................", "............... ....................................", "............... ....................................", "................ ...................................", "................. ..................................", "................. ..................................", ".................. .................................", ".................. .................................", "................... ................................", "................... ................................", ".................... ...............................", "..................... ..............................", "....................................................", "...................................................." }}, { /* XPM */ { /* columns rows colors chars-per-pixel */ "58 58 2 1", " c black", ". c white", /* Lys */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "...................... .. . .. ...........................", "...................... . . .. ...........................", "...................... . ...........................", "...................... . . .. . ........................", "...................... .. . .. .. .......................", "........................ ........ ........................", "......................... ...... .......................", ".......................... ...............................", "........................... ..............................", "............................ .............................", " ............................ ............................", "............................ .............................", "........................... ..............................", ".......................... ...............................", "......................... ................................", "........................ .................................", "........................ .................................", "......................... ................................", ".......................... ...............................", "........................... ..............................", "............................ .............................", "........................... ..............................", ".......................... ...............................", "......................... ................................", "........................ .................................", "....................... ..................................", "........................ .................................", "......................... ................................", ".......................... ...............................", "........................... ..............................", "............................ .............................", "............................. ............................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Met */ "....................................................", "........................... ........................", "........................... ........................", "........................... ........................", ".......................... .........................", ".......................... .........................", "......................... ..........................", "......................... ..........................", "........................ ...........................", "........................ ...........................", "....................... ............................", "....................................................", "..................... ............................", ".................... ...............................", "..................... .............................", "....................... ............................", ".................... ............................", "........................ ...........................", "........................ ...........................", "......................... ..........................", ".......................... .........................", ".......................... .........................", "........................... ........................", "............................ .......................", "............................ .......................", "............................. ......................", "............................. ......................", "............................. ......................", "............................. ......................", "............................ .......................", "............................ .......................", "........................... ........................", "........................... ........................", ".......................... .........................", ".......................... .........................", "......................... ..........................", "......................... ..........................", "........................ ...........................", "........................ ...........................", "....................... ............................", "........................ ...........................", "......................... ..........................", "......................... ..........................", ".......................... .........................", "........................... ........................", "........................... ........................", "............................ .......................", "............................. ......................", ".............................. .....................", ".............................. .....................", "............................... ....................", "...................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Phe */ "....................................................", ".................. ..................", ".................. .............. ..................", "................. ................ .................", "................. . ............. . ................", "................ . .............. . ................", "............... . ................ . ...............", "............... . ................. ...............", ".............. . .................. . ..............", ".............. . ................... . .............", "............. . .................... . .............", "............. ...................... . ............", "............ . ....................... ............", "........... . ........................ . ...........", "........... ............................ ...........", "............ .......................... ............", "............ .......................... ............", "............. ........................ .............", "............. ........................ .............", ".............. ...................... ..............", "............... ..................... ..............", "............... .................... ...............", "................ .................. ................", "................ .................. ................", "................. .. .. .................", "................. ................ .................", ".................. ..................", "................. ..................................", "................. ..................................", "................ ...................................", "................ ...................................", "............... ....................................", "............... ....................................", ".............. .....................................", "............. ......................................", "............. ......................................", "............ .......................................", "............ .......................................", "........... ........................................", "........... ........................................", "............ .......................................", "............ .......................................", "............. ......................................", ".............. .....................................", ".............. .....................................", "............... ....................................", "............... ....................................", "................ ...................................", "................. ..................................", "................. ..................................", ".................. .................................", "...................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Pro */ "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", ".................... ...............................", "................... . .............................", "................. .... ...........................", "................ ........ .........................", "............... ........... .......................", ".............. .............. ......................", "............. ................ ....................", "............ ................... ..................", "........... ...................... ................", ".......... ......................... ..............", "......... ............................ .............", "........ .............................. ...........", "....... ............................... ............", "...... ................................ ............", "..... ................................. ............", ".... .................................. ............", ".. ................................... ............", ". .................................... .............", ".. ................................... .............", "... .................................. .............", "... .................................. .............", ".... ................................. .............", ".... ................................. .............", "..... ............................... ..............", "..... ............................... ..............", "...... .............................. ..............", "...... .............................. ..............", "....... ............................. ..............", "....... ............................ ...............", ".................................... ...............", "................................... ...............", "........ ... .................. .. ..............", "........ ... ............ . ........ ...........", ".......... ......... . ...........................", "........ .... ... ....................... .........", "........... ................................ ......", "........ .. ......................................", "............ .................................. ...", "........ .... .................................... .", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "...................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Ser */ "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", ".................................... ... .... ...", "................................... ... .. .... ...", ".................................. ..... .. .... ...", ".............. .. ..... .. ...", ".............. ................... ..... .. .... ...", "............. ..................... ... .. .... ...", "............. ...................... ... .... ...", "............ .......................................", "........... ........................................", "........... ........................................", ".......... .........................................", ".......... .........................................", "......... ..........................................", "........ ...........................................", "........ ...........................................", "....... ............................................", "....... ............................................", "...... .............................................", "..... ..............................................", "..... ..............................................", ".... ...............................................", ".... ...............................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "...................................................." }}, /* XPM */ {{ /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Thr */ "....................................................", "....................................................", "....................................................", ". ..................................................", ". ..................................................", ".. .................................................", ".. .................................................", "... ................................................", ".... ...............................................", ".... ...............................................", "..... ..............................................", "..... ..............................................", "...... .............................................", "....... ............................................", "....... ............................................", "........ ...........................................", "........ ...........................................", "......... ..........................................", ".......... .........................................", ".......... .........................................", "........... ........................................", "........... ........................................", "............ ....................... .... ..... .", "............ ...................... ... ... ..... .", "............. .................... .... .. ..... .", ".............. ................... ...... .. ..... .", ".............. ...... .. .", ".............. ................... ...... .. ..... .", "............. .................... .... .. ..... .", "............. ..................... ... ... ..... .", "............ ....................... .... ..... .", "........... ........................................", "........... ........................................", ".......... .........................................", ".......... .........................................", "......... ..........................................", "........ ...........................................", "........ ...........................................", "....... ............................................", "....... ............................................", "...... .............................................", "..... ..............................................", "..... ..............................................", ".... ...............................................", ".... ...............................................", "... ................................................", ".. .................................................", ".. .................................................", ". ..................................................", ". ..................................................", "....................................................", "...................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "50 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Trp */ ".................. .................................", "............... . ................................", "............ ..... ...............................", "......... ......... ..............................", "...... ............. .............................", "..... ................. ...........................", ".... .................... ............... .. .......", ".... ..................... .............. . .......", ".... ...................... ........... . . .......", ".... ....................... . .. .. .......", ".... ........................ ........... .. .......", ".... ........................ ......................", "... ........................ ................ ......", "... ........................ ................ ......", "... ........................ ................. .....", "... ........................ ................. .....", "... ........................ .................. ....", ".. ......................... .................. ....", ".. ........................ .................... ...", "... ....................... .................... ...", ".... ...................... ..................... ..", "..... ..................... ........................", "...... .................... .................... ...", "....... ................... ................... ....", "........ ............... ................ .....", "......... ........... ..... ............. .......", ".......... ....... .......... .......... ........", "........... .. ............... ........ .........", "............. ................... ..... ..........", ".................................... .. ...........", "...................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ............", "....................................... ...........", "......................................... ..........", ".......................................... ........", "............................................ ......", ".............................................. ....", "................................................ ...", "................................................. .", "................................................... " }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Tyr */ "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "........................................... ... .. ", ".......................................... .. .. .. ", "..................... ................. .. .. ", "................... .... .............. .. ... .. ", "................. . .... ........... ............", "............... . ........ ....... .............", ".............. . ............ ... ...............", "............ . ................ . .................", "............ . .................. ..................", "........... .................... ..................", "........... .................... ..................", "........... .................... ..................", "........... .................... ..................", "........... .................... ..................", "........... .................... ..................", "........... .................... ..................", "........... .................... ..................", "........... .................... ..................", "........... .................... ..................", "........... .................... ..................", ".......... . ................ ..................", "......... ... . ............. ....................", "....... ...... . .......... .....................", "..... .......... . ...... .......................", ".... ............. . ... .........................", ".. ................ .. ...........................", ". .................... ............................", ". ..................................................", ". ..................................................", ". ..................................................", ". ..................................................", ". ..................................................", ". ..................................................", ". ..................................................", ". ..................................................", ". ..................................................", ". ..................................................", ". ..................................................", ". ..................................................", "....................................................", "....................................................", "....................................................", "....................................................", "....................................................", "...................................................." }, /* XPM */ { /* width height ncolors chars_per_pixel */ "52 52 2 1", /* colors */ " c #000000", ". c #FFFFFF", /* Val */ "....................................................", "....................................................", "....................................................", "....................................................", "............................................ .......", "............................................ .......", "........................................... ........", "........................................... ........", ".......................................... .........", ".......................................... .........", "......................................... ..........", "......................................... ..........", "........................................ ...........", "....................................... ............", "....................................... ............", "...................................... .............", "...................................... .............", "..................................... ..............", "..................................... ..............", ".................................... ...............", ".................................... ...............", "................................... ................", ".................................. .................", ".................................. .................", "................................. ..................", "................................. ..................", "..... ...................", "................................. ..................", ".................................. .................", ".................................. .................", "................................... ................", "................................... ................", ".................................... ...............", ".................................... ...............", "..................................... ..............", "...................................... .............", "...................................... .............", "....................................... ............", "....................................... ............", "........................................ ...........", "......................................... ..........", "......................................... ..........", ".......................................... .........", ".......................................... .........", "........................................... ........", "............................................ .......", "............................................ .......", "............................................. ......", "............................................. ......", "....................................................", "....................................................", "...................................................." }, /* XPM */ { /* columns rows colors chars-per-pixel */ "58 58 2 1", " c black", ". c white", /* Backbone */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..................................... ...................", ".................................... .. ..................", ".................................... .. ..................", ".................................... .. ..................", ".................................... .. ..................", "..................................... ...................", "........................ .. ..............................", "........................ . ........ . ...................", "........................ . ........ . ...................", "............. .......... . ........ . ...................", "............ . ......... . ........ . ...................", "........... ... ....... .. ....... ... ..................", ".......... ..... ..... ..... ..... ..... .................", "..... .. ....... ... ....... ... ....... ................", "..... . ......... . ......... . ......... ...............", "..... . ......... . .......... ........... ..............", "..... . ......... . .....................................", "..... . ......... . .....................................", "..... .. .................................................", ".................. ......................................", "................. .. .....................................", "................. .. .....................................", "................. .. .....................................", "................. .. .....................................", ".................. ......................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, /* SYMBOLS*/ {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray0", ". c Gray100", /* p orbital */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "....................... ...........................", "..................... ........ .........................", ".................... .......... ........................", "................... ............ .......................", ".................. ................ ......................", "................. ................ .....................", "................. .................. .....................", "................. .................. .....................", "................ .................. ....................", "................ .................... ....................", "................ .................... ....................", "................ .................... ....................", "................ .................. ....................", "................. .................. .....................", "................. ................ .....................", ".................. ................ ......................", ".................. .............. ......................", "................... ............ .......................", ".................... ............ ........................", ".................... .......... ........................", "..................... .......... .........................", "..................... ........ .........................", "...................... ...... ..........................", "....................... ...... ...........................", "....................... ...... ...........................", "....................... ...... ...........................", "....................... ...... ...........................", "...................... ...... ..........................", "..................... ........ .........................", "..................... .......... .........................", ".................... .......... ........................", ".................... ............ ........................", "................... ............ .......................", ".................. .............. ......................", ".................. ................ ......................", "................. ................ .....................", "................. .................. .....................", "................ .................. ....................", "................ .................... ....................", "................ .................... ....................", "................ .................... ....................", "................ .................. ....................", "................. .................. .....................", "................. .................. .....................", "................. ................ .....................", ".................. ................ ......................", "................... ............ .......................", ".................... .......... ........................", "..................... ........ .........................", "....................... ...........................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c black", ". c white", /* oplus */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "............................ .............................", "...................... .......................", "................... ...... ...... ....................", "................. ......... ......... ..................", "................ ........... ........... .................", ".............. ............ ............ ...............", "............. .............. .............. ..............", "............ ............... ............... .............", "........... ................ ................ ............", ".......... ................. ................. ...........", ".......... ................. ................. ...........", "......... .................. .................. ..........", "........ ................... ................... .........", "........ ................... ................... .........", "....... .................... .................... ........", "....... .................... .................... ........", "....... .................... .................... ........", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "..... ......", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "...... ..................... ..................... .......", "....... .................... .................... ........", "....... .................... .................... ........", "....... .................... .................... ........", "........ ................... ................... .........", "........ ................... ................... .........", "......... .................. .................. ..........", ".......... ................. ................. ...........", ".......... ................. ................. ...........", "........... ................ ................ ............", "............ ............... ............... .............", "............. .............. .............. ..............", ".............. ............ ............ ...............", "................ ........... ........... .................", "................. ......... ......... ..................", "................... ...... ...... ....................", "...................... .......................", "............................ .............................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c black", ". c white", /* ominus */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "............................ .............................", "...................... . .......................", "................... ............. ....................", "................. ................... ..................", "................ ....................... .................", ".............. ......................... ...............", "............. ............................. ..............", "............ ............................... .............", "........... ................................. ............", ".......... ................................... ...........", ".......... ................................... ...........", "......... ..................................... ..........", "........ ....................................... .........", "........ ....................................... .........", "....... ......................................... ........", "....... ......................................... ........", "....... ......................................... ........", "...... ........................................... .......", "...... ........................................... .......", "...... ........................................... .......", "...... ........................................... .......", "...... ........................................... .......", "...... ........................................... .......", "..... ......", "...... ........................................... .......", "...... ........................................... .......", "...... ........................................... .......", "...... ........................................... .......", "...... ........................................... .......", "...... ........................................... .......", "....... ......................................... ........", "....... ......................................... ........", "....... ......................................... ........", "........ ....................................... .........", "........ ....................................... .........", "......... ..................................... ..........", ".......... ................................... ...........", ".......... ................................... ...........", "........... ................................. ............", "............ ............................... .............", "............. ............................. ..............", ".............. ......................... ...............", "................ ....................... .................", "................. ................... ..................", "................... ............. ....................", "...................... . .......................", "............................ .............................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c black", ". c white", /* rearrangement arrow */ "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "......................... ..............................", "........................ ... .............................", "....................... ..... ............................", "....................... ..... ............................", "....................... ..... ............. ..............", "........................ ... .............. ............", "......................... ............... ..........", "......... .........", "........................................... ..........", "........................................... ............", "........................................... ..............", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", "..........................................................", ".........................................................." }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, {{/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }, {/* XPM */ /* columns rows colors chars-per-pixel */ "58 58 2 1", " c Gray100", ". c Gray0", /* empty pixels */ " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " }}, }; /*number of bonds in each template */ static int template_nb[25][5]={ {6,6,7,11,11}, {12,6,20,7,8}, {15,11,13,11,12}, {10,13,8,30,6}, {25,15,0,0,0}, /*sugar*/ {6,10,10,11,11}, {11,11,11,10,16}, {23,22,22,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*heterocycles*/ {12,13,10,9,9}, {28,15,9,8,5}, {10,5,5,0,0}, {26,26,0,0,0}, {0,0,0,0,0}, /*aminoacids*/ {1,7,4,4,2}, {5,5,7,4,4}, {5,4,8,4,2}, {3,12,9,3,8}, {0,0,0,0,0}, /*symbols*/ {0,3,2,2,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0} } ; /*number of labels in each template*/ static int template_nl[25][5]={ {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*sugar*/ {1,1,5,6,6}, {6,6,5,5,8}, {11,11,11,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*heterocycles*/ {5,6,5,4,4}, {4,9,4,3,2}, {2,2,2,0,0}, {6,6,0,0,0}, {0,0,0,0,0}, /*amino acids*/ {0,3,2,2,1}, {2,2,2,0,1}, {1,1,0,2,1}, {1,1,1,0,4}, {0,0,0,0,0}, /*symbols*/ {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0} } ; /*number of curves in each template*/ static int template_ncrv[25][5]={ {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*sugar*/ {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*heterocycles*/ {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*amino acids*/ {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*symbols*/ {2,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0} } ; static int template_refx[25][5]={ {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*sugar*/ {0,72,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*heterocycles*/ {363,363,271,271,271}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*amino acids*/ {193,223,223,223,200}, {223,223,223,223,223}, {341,283,223,333,193}, {221,328,223,223,494}, {0,0,0,0,0}, /*symbols*/ {2,79,79,273,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0} } ; static int template_refy[25][5]={ {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*sugar*/ {0,257,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*heterocycles*/ {352,352,273,273,273}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, /*amino acids*/ {144,421,291,291,200}, {291,291,291,291,291}, {345,316,291,288,144}, {290,187,291,291,322}, {0,0,0,0,0}, /*symbols*/ {2,55,55,193,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0} } ; /*first x coordinate of all lines, per template*/ static int template_x[25][5][30] = { {{185,236,287,268,205,236,14*0}, /*cyclopentadienyl*/ {52,107,162,162,107,52,14*0}, /*benzene*/ {52,107,162,162,107,52,107,13*0}, /*benzene with ring*/ {12,67,122,122,67,12,122,178,233,233,178,9*0}, /*naphthalene*/ {188,225,285,285,225,285,285,336,336,400,425,9*0}}, /*azulene*/ {{255,353,353,298,200,200,234,255,353,234,255,289,8*0}, /*adamantane*/ {230,328,328,273,175,175,14*0}, /* cyclohexane chair */ {17,17,72,127,127,72,127,182,237,237,182,182,182,237,292,292,292,352,389,352}, /*steroid*/ {294,357,294,249,402,268,327}, /*cycloheptatriene*/ {47,92,155,200,200,155,92,47,12*0}},/*cyclooctatetraene*/ {{228,279,331,386,441,441,386,331,117,172,227,227,172,117,227}, /*6-5-6*/ {497,497,523,585,599,497,465,400,370,402,466},/*spirodecane*/ {234,234,234,285,285,349,374,233,233,182,182,118,93,7*0},/*heptalene*/ {110,110,170,207,170,271,308,368,368,308,207,9*0}, {79,116,79,116,176,176,231,286,286,231,231,214,8*0}},/*dicyclopentadiene*/ {{194,249,304,304,249,194,304,364,401,364,10*0}, /*inden*/ {58,122,153,121,58,26,153,217,249,313,345,313,249,7*0}, /*biphenyl*/ {127,182,127,237,127,182,182,182,12*0},/*bicyclo[2.2.1]heptane*/ {218,273,273,218,163,162,328,383,328,273,273,383,218,273,383,328,328,218,218,163,383,328,273,359,328,328,218,218,383,383}, {174,174,204,235,265,296}}, {{210,229,292,311,260,292,311,371,401,384,229,329,192,226,209,192,129,112,260,260,202,152,260,319,364}, {273,323,303,240,221,384,426,406,344,323,197,136,117,159,240}, {20*0},{20*0},{20*0}}, /*sugars*/ {{230,328,296,232,200,328,14*0}, {171,276,206,136,136,276,241,171,276,136,10*0}, {200,235,340,340,270,200,200,340,305,235,9*0}, {88,148,28,28,185,125,185,185,148,88,28},/*fructose*/ {130,130,190,167,227,250,287,227,167,190,130}},/*galactose*/ {{130,130,190,167,227,250,287,227,167,130,190}, /*glucose*/ {402,402,462,439,499,522,439,402,462,559,499},/*mannose*/ {301,361,241,241,398,338,398,361,301,241,272}, /*fucose*/ {185,185,245,222,282,305,282,222,185,342}, /*xylose*/ {279,376,219,219,376,316,376,279,219,250,214,181,214,376,181,146}}, {{239,239,299,276,336,359,396,336,276,239,299,454,487,592,592,527,454,456,557,487 ,592,614,454},/*sucrose*/ {236,236,296,273,333,356,393,333,273,236,296,442,442,502,479,539,562,599,539, 479,442,502},/*maltose*/ {442,442,502,479,539,562,599,539,479,442,502,235,235,295,272,332,355,392, 332,272,295,235},/*lactose*/ {20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*heterocycles*/ {{308,308,253,198,198,253,253,308,363,418,418,363,8*0}, /*ade*/ {308,308,253,198,198,253,253,308,363,418,418,363,198,7*0}, /*gua*/ {216,216,216,271,326,326,271,271,216,326,10*0}, /*thy*/ {216,216,216,271,326,326,271,216,271,11*0}, /*cyt*/ {216,216,216,271,326,326,271,271,216,11*0}}, /*ura*/ { {457,457,402,512,512,572,609,572,572,604,572,572,609,572,512,512,457,402,402,402,342,305, 342,310,402,342,305,342}, /*porphine*/ {194,194,194,249,304,304,249,249,194,304,364,401,364,194,364},/*caffeine*/ {209,259,239,177,157,209,239,294,259},/*evans aux*/ {359,308,257,276,339,308,419,359}/*samp*/ ,{394,394,394,454,454}}, /* imidazole */ {{682,737,792,792,737,682,792,792,852,852}, {394,394,394,454,454}, {387,409,387,439,468}, {20*0},{20*0}}, {{100,155,210,210,155,101,155,155,210,210,156,101,101,101,65,210,264,264,155,216,227,264,210,100,101,294}, {350,350,350,334,334,281,247,266,266,319,406,406,406,452,452,452,435,435,408,408,441,441,476,439,439,406}, {20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*amino acids*/ {{193,20*0},{223,191,221,191,223,193,193,17*0},{223,191,221,221,18*0},{223,191,221,221,18*0},{200,232,20*0}}, {{223,191,221,189,189,20*0},{223,191,221,189,189,20*0},{223,191,221,185,222,282,282,20*0},{223,191,191,221,20*0},{223,191,221,221,20*0}}, {{341,311,345,314,347,20*0},{283,247,274,239,20*0},{223,191,221,191,223,286,318,286,20*0},{333,344,295,250,20*0},{193,225,20*0}}, {{221,253,253,20*0},{324,264,231,271,328,147,188,250,231,167,264,234,20*0},{223,191,221,191,223,286,318,286,286,20*0},{223,191,191,20*0},{221,221,276,276,331,386,440,440,20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*symbols*/ {{20*0},{79,71,79,17*0},{79,71,18*0},{273,335,18*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}} }; static int template_y[25][5][30]= { {{236,199,236,296,296,253,14*0}, {71,39,71,135,167,135,14*0}, {71,39,71,135,167,135,103,13*0}, {39,7,39,103,135,103,39,8,40,104,136,9*0}, {248,197,216,279,298,216,279,316,179,197,248,9*0}}, {{309,264,264,296,341,341,296,309,264,232,245,200,8*0}, {300,255,255,287,332,332,14*0}, {203,139,107,139,203,235,139,107,139,203,235,107,43,11,43,107,43,24,75,126}, {171,171,171,216,216,276,307}, {111,66,66,111,175,220,220,175,12*0}}, {{198,235,134,102,134,198,230,198,134,102,134,198,230,198,134,5*0}, {409,409,351,357,418,409,354,354,410,465,465}, {106,106,169,206,69,87,138,169,106,69,206,188,137,7*0}, {171,107,88,139,190,139,88,107,170,189,139,9*0}, {151,100,151,202,119,183,215,183,119,87,87,151,8*0}}, {{206,174,206,270,302,270,206,187,238,289,10*0}, {27,26,81,137,137,82,81,81,26,26,81,136,136,7*0}, {179,147,179,179,243,211,147,211,12*0}, {92,124,187,219,188,124,219,379,411,379,315,315,283,379,125,93,219,283,411,315,315,219,124,199,219,93,283,411,187,315}, {229,229,173,214,188,229}}, {{274,214,214,274,311,214,274,293,246,184,214,163,163,116,274,163,189,256,311,375,392,359,375,389,352}, {142,179,239,239,179,166,213,273,286,179,285,271,211,165,239} ,{20*0},{20*0},{20*0}}, /*sugars*/ {{300,255,210,210,255,255,14*0}, {369,321,291,321,257,321,369,369,321,321,10*0}, {240,290,240,240,210,240,176,240,290,290,9*0}, {105,124,124,124,73,92,73,73,124,105,124}, {152,152,171,203,184,152,203,184,203,171,152}}, {{152,152,171,203,184,152,203,184,203,152,171}, {103,103,122,154,135,103,154,103,122,154,135}, {91,110,110,110,59,78,59,110,91,110,54}, {156,156,175,207,188,156,188,207,156,207}, {185,153,204,204,153,172,153,185,204,148,160,141,160,153,141,157}}, {{124,124,143,175,156,124,175,156,175,124,143,199,249,199,199,165,199,157,249,249 ,199,242,199}, {150,150,169,201,182,150,201,182,201,150,169,232,232,251,283,264,232,283,264, 283,232,251}, {232,232,251,283,264,232,283,264,283,232,251,149,149,168,200,181,149,200, 181,200,168,149}, {20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*heterocycles*/ {{192,256,288,256,192,160,160,256,288,256,192,288,8*0}, {192,256,288,256,192,160,160,256,288,256,192,288,256,7*0}, {177,177,113,81,113,177,209,81,177,113,10*0}, {177,177,113,81,113,177,209,177,81,11*0}, {177,177,113,81,113,177,209,81,177,11*0}}, {{315,315,347,347,347,328,379,430,430,485,540,540,591,642,623,623,655,623,559, 623,642,591,540,485,411,430,379,328}, {206,206,142,110,142,206,238,110,206,142,123,174,225,142,123}, {173,210,270,270,210,173,270,302,210}, {189,226,189,130,129,226,208,189}, {225,225,288,307,207}}, /*imidazole*/ {{247,215,247,311,343,311,247,311,228,330}, {225,225,288,307,207}, {273,212,273,308,212}, {20*0},{20*0}}, {{117,85,117,181,213,183,213,277,309,373,403,371,307,307,244,309,277,213,277,264,210,277,309,117,371,186}, {411,411,411,388,388,406,447,473,473,453,399,399,399,395,395,395,343,343,454,454,503,503,489,290,290,319}, {20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*amino acids*/ {{144,20*0},{421,367,313,259,205,151,151,20*0},{291,237,183,183,20*0},{291,237,183,183,20*0},{200,146,20*0}}, {{291,237,183,128,128,20*0},{291,237,183,128,128,20*0},{291,237,183,133,82,101,163,20*0},{291,237,237,183,20*0},{291,237,183,183,20*0}}, {{345,290,235,181,128,20*0},{316,264,207,155,20*0},{291,237,183,129,75,75,129,184,20*0},{288,246,219,261,20*0},{144,90,20*0}}, {{290,236,236,20*0},{251,265,212,163,187,138,91,103,212,198,265,319,20*0},{291,237,183,129,75,75,129,184,75,20*0},{291,237,237,20*0},{290,290,322,322,290,322,290,290,20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*symbols*/ {{20*0},{55,55,48,17*0},{55,55,18*0},{193,187,18*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}} }; static int template_tx[25][5][30]= { {{236,287,268,205,185,236,14*0}, {107,162,162,107,52,52,14*0}, {107,162,162,107,52,52,107,13*0}, {67,122,122,67,12,12,178,233,233,178,122,9*0}, {225,285,285,225,188,336,336,402,400,425,402,9*0}}, {{323,319,298,234,234,259,234,255,353,289,289,353,8*0}, {298,294,273,209,209,234,14*0}, {17,72,127,127,72,17,182,237,237,182,127,182,237,292,292,237,352,389,352,292}, {357,402,249,268,383,327,383}, {92,155,200,200,155,92,47,47,12*0}}, {{279,330,386,441,441,386,331,331,172,227,227,172,117,117,331,5*0}, {523,544,585,599,544,465,400,370,402,466,497}, {234,285,285,351,349,374,351,182,182,116,118,93,116,7*0}, {110,170,207,170,110,308,368,368,308,271,271,9*0}, {116,176,116,176,176,231,286,286,231,176,214,231,8*0}}, {{249,304,304,249,194,194,364,401,364,304,10*0}, {122,153,121,58,26,58,217,249,313,345,313,249,217,7*0}, {182,237,127,237,182,237,221,221,12*0}, {273,273,218,163,162,218,328,328,273,273,328,383,273,218,383,383,383,163,163,163,328,273,328,360,383,383,163,163,411,406}, {235,204,265,296,326,326}}, {{229,292,311,260,209,329,371,401,384,329,192,292,226,292,149,129,112,149,260,202,152,149,319,364,371}, {323,303,240,221,273,426,406,344,303,384,136,117,159,221,197}, {20*0},{20*0},{20*0}}, /*sugars*/ {{298,296,232,200,234,294,14*0}, {241,206,136,136,72,276,241,171,241,171,10*0}, {235,305,270,305,200,200,136,340,305,235,11*0}, {148,185,59,88,125,59,186,219,190,73,28}, {167,190,250,227,287,287,286,236,117,167,132}}, {{167,190,250,227,287,287,286,236,117,97,167}, {439,462,522,499,559,559,389,369,411,597,499}, {361,398,272,301,338,272,399,403,286,241,217}, {222,245,305,282,342,342,291,172,152,397}, {339,339,250,279,316,250,407,265,180,214,181,146,231,385,182,119}}, {{276,299,359,336,396,396,396,345,226,206,276,487,557,527,557,454,456,431,556,486 ,614,664,396}, {273,296,356,333,393,393,392,342,223,203,273,479,502,562,539,599,599,650,548, 429,392,479}, {479,502,562,539,599,599,650,548,429,392,479,272,295,355,332,392,392,392,341, 222,272,237}, {20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*heterocycles*/ {{308,253,198,198,253,308,253,363,418,418,308,363,8*0}, {308,253,198,198,253,308,253,363,418,418,308,363,143,7*0}, {271,216,271,326,326,271,271,271,161,381,10*0}, {271,216,271,326,326,271,271,161,271,11*0}, {271,216,271,326,326,271,271,271,161,11*0}}, {{512,402,402,512,572,609,572,512,604,572,512,609,572,512,512,457,402,402,342, 342,305,342,310,342,342,305,342,402}, {249,194,249,304,304,249,249,249,139,364,401,364,304,139,383}, {259,239,177,157,209,209,294,275,287}, {308,257,276,339,359,308,474,419}, {394,454,454,491,491}}, /* imidazole */ {{737,792,792,737,682,682,852,852,889,889}, {394,454,454,491,491}, {409,468,439,489,489}, {20*0},{20*0}}, {{155,210,210,155,101,100,155,210,210,156,101,101,155,65,101,264,264,210,216,227,294,294,264,46,46,349}, {334,319,406,281,376,247,266,319,234,350,452,408,406,435,482,495,376,439,441,350,476,430,482,386,475,386}, {20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*amino acids*/ {{225,20*0},{191,221,191,223,193,130,223,20*0},{191,221,189,285,20*0},{191,221,189,285,20*0},{232,200,20*0}}, {{191,221,189,219,125,20*0},{191,221,189,219,125,20*0},{191,221,185,222,282,282,221,20*0},{191,221,127,221,20*0},{191,221,189,285,20*0}}, {{311,345,314,347,318,20*0},{247,274,239,266,20*0},{191,221,191,223,286,318,286,221,20*0},{344,295,250,273,20*0},{225,289,20*0}}, {{253,317,221,20*0},{264,231,271,328,324,188,250,271,167,147,234,266,20*0},{191,221,191,223,286,318,286,221,316,20*0},{191,221,127,20*0},{166,276,276,331,386,440,440,494,20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*symbols*/ {{20*0},{87,87,79,17*0},{87,87,18*0},{401,335,18*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}} }; static int template_ty[25][5][30]= { {{199,236,296,296,236,223,14*0}, {39,71,135,167,135,71,14*0}, {39,71,135,167,135,71,64,13*0}, {7,39,103,135,103,39,8,40,104,136,103,9*0}, {197,216,279,298,248,179,316,298,197,248,298,9*0}}, {{309,309,296,296,296,309,232,245,200,200,200,200,8*0}, {300,300,287,287,287,300,14*0}, {139,107,139,203,235,203,107,139,203,235,203,43,11,43,107,139,24,75,126,107}, {171,216,216,276,276,307,276}, {66,66,111,175,220,220,175,112,12*0}}, {{235,198,102,134,198,230,198,134,102,134,198,230,198,134,134,5*0}, {351,450,357,418,450,354,354,410,465,465,409}, {169,69,206,188,87,138,188,206,69,87,188,137,87,7*0}, {107,88,139,190,171,88,107,170,189,139,139,9*0}, {100,119,202,183,183,215,183,119,87,119,151,215,8*0}}, {{174,206,270,302,270,206,187,238,289,270,10*0}, {26,81,137,137,82,27,81,26,26,81,136,136,81,7*0}, {147,179,243,243,211,243,95,95,12*0}, {124,187,219,188,124,92,283,411,379,315,283,379,315,411,187,125,187,315,379,379,283,187,93,197,187,125,315,379,209,299}, {214,173,188,229,173,173}}, {{214,214,274,311,274,163,293,246,184,163,163,116,116,116,293,189,256,293,375,392,359,293,389,352,293}, {179,239,239,179,142,213,273,286,239,166,271,211,165,179,285}, {20*0},{20*0},{20*0}}, /*sugars*/ {{300,210,210,255,300,300,14*0}, {369,291,321,257,257,257,431,431,369,369,10*0}, {290,290,210,290,240,176,176,176,350,350,9*0}, {124,73,68,105,92,68,35,90,115,140,160}, {203,171,152,184,203,203,245,225,194,134,114}}, {{203,171,152,184,203,203,245,225,194,169,134}, {154,122,103,135,154,154,145,120,87,131,77}, {110,59,54,91,78,54,21,101,126,146,86}, {207,175,156,188,207,207,229,198,173,175}, {204,204,148,185,172,148,179,237,185,160,141,157,131,114,111,140}}, {{175,143,124,156,175,175,241,197,166,141,106,249,249,165,249,199,157,122,206,304 ,242,270,236}, {201,169,150,182,201,201,243,223,192,167,132,283,251,232,264,283,283,264,305, 274,244,214}, {283,251,232,264,283,283,264,305,274,244,214,200,168,149,181,200,200,244, 222,191,131,111}, {20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*heterocycles*/ {{256,288,256,192,160,192,96,288,256,192,192,352,8*0}, {256,288,256,192,160,192,96,288,256,192,192,352,288,7*0}, {209,113,81,113,177,209,273,17,209,81,10*0}, {209,113,81,113,177,209,273,209,17,11*0}, {209,113,81,113,177,209,273,17,209,11*0}}, {{347,347,411,411,328,379,430,411,485,540,559,591,642,623,559,655,623,559, 540,642,591,540,485,430,430,379,328,347}, {238,142,110,142,206,238,302,46,238,123,174,225,206,110,63}, {210,270,270,210,173,109,302,362,192}, {226,189,130,129,189,289,176,208} ,{288,207,307,256,256}}, {{215,247,311,343,311,247,228,330,279,279}, {288,207,307,256,256}, {212,212,308,270,270}, {20*0},{20*0}}, {{85,117,181,213,183,117,277,309,373,403,371,307,277,244,183,277,213,181,264,210,186,186,341,87,403,154}, {388,453,399,406,351,447,473,453,515,475,395,454,319,343,429,387,351,290,503,475,489,556,429,295,244,295}, {20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*amino acids*/ {{90,20*0},{367,313,259,205,151,151,97,20*0},{237,183,128,183,20*0},{237,183,128,183,20*0},{146,91,20*0}}, {{237,183,128,74,128,20*0},{237,183,128,74,128,20*0},{237,183,133,82,101,163,183,20*0},{237,183,237,120,20*0},{237,183,128,183,20*0}}, {{290,235,181,128,72,20*0},{264,207,155,97,20*0},{237,183,129,75,75,129,184,183,20*0},{246,219,261,304,20*0},{90,90,20*0}}, {{236,236,182,20*0},{265,212,163,187,251,91,103,163,198,138,319,374,20*0},{237,183,129,75,75,129,184,183,21,20*0},{237,183,237,20*0},{322,322,385,290,322,290,226,322,20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*symbols*/ {{20*0},{55,55,63,17*0},{55,55,18*0},{193,193,18*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}} }; /*bond type codes */ static int template_b[25][5][30]= { { {0,0,0,0,0,11,14*0}, {2,0,2,0,2,0,14*0}, {0,0,0,0,0,0,11,13*0}, {2,0,2,0,2,0,0,2,0,2,0,9*0}, {2,0,0,2,0,2,0,1,0,2,0,9*0}}, {{10,5,0,0,0,5,0,0,0,0,0,0,8*0}, {10,5,0,0,0,5,14*0}, {20*0}, {2,0,0,1,2,0,0}, {2,0,2,0,2,0,2,0,12*0}}, {{0,0,2,0,2,0,2,0,2,0,2,0,2,0,0,5*0}, {6,5,18*0}, {0,2,0,1,0,2,0,2,0,1,0,2,0,7*0}, {0,2,0,0,2,0,2,0,2,0,4,9*0}, {2,0,0,0,0,0,0,1,0,0,0,0,8*0}}, {{2,0,2,0,2,0,0,2,0,0,10*0}, {2,0,2,0,2,0,0,0,2,0,2,0,2,7*0}, {0,0,0,0,0,0,0,13,12*0}, {0,2,0,2,0,2,0,2,0,2,0,0,0,0,10,5,5,5,5,10,1,0,0,5,1,2,1,2,0,0}, {0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {20*0},{20*0},{20*0}}, /*sugars*/ {{10,0,0,0,5,5,14*0}, {10,0,0,0,0,0,0,13,5,5,10*0}, {20*0}, {20*0}, {20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0}, {0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*heterocycles*/ {{2,0,2,0,2,0,0,0,0,1,0,0,8*0}, {2,0,2,0,0,0,4,0,0,1,0,0,0,7*0}, {0,0,0,0,2,0,0,4,4,0,10*0}, {0,0,2,0,2,0,0,4,0,11*0}, {0,0,0,0,2,0,0,4,4,11*0}}, {{2,0,0,0,0,2,0,2,0,2,0,0,2,0,0,2,0,1,0,0,2,0,2,0,0,2,0,2}, {0,0,0,0,2,0,0,4,4,0,0,2,0,0,0,5*0}, {0,0,0,0,0,4,5,0,0}, {0,0,0,0,0,0,0,5} ,{1,0,0,0,2}}, {{2,0,2,0,2,0,0,0,2,0}, {1,0,0,0,2}, {2,0,0,0,2}, {20*0},{20*0}}, {{0,2,0,2,0,2,0,0,0,2,0,0,0,6,0,0,0,0,5,10,10,5,5,0,6,0}, {0,1,0,1,0,0,1,0,0,0,0,0,5,0,0,5,0,5,0,6,0,6,1,10,0,10}, {20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*amino acids*/ {{20*0},{0,0,0,0,0,4,0,20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{0,0,0,2,0,2,0,2,20*0},{20*0},{20*0}}, {{20*0},{20*0},{0,0,0,2,0,2,0,2,0,20*0},{20*0},{0,0,4,0,0,0,4,0,20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, /*symbols*/ {{20*0},{11,0,0,17*0},{11,0,18*0},{9,11,18*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}}, {{20*0},{20*0},{20*0},{20*0},{20*0}} }; static int template_lx[25][5][15]={ /*label X*/ {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, /*sugars*/ {{296,9*0},{206,9*0},{136,235,305,340,270,5*0}, {125,186,190,74,28,219,4*0},{250,286,236,117,167,132}}, {{250,286,236,97,117,167},{522,369,389,411,597,499}, {338,399,403,287,241}, {305,396,291,152,172}, {407,180,316,385,119,182,231,265}}, {{359,345,206,226,276,431,527,664,556,486,396}, {356,342,203,223,273,562,650,548,429,479,392}, {562,650,548,429,479,392,355,341,222,272,237}, {10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, /*heterocycles*/ {{253,363,418,198,253,5*0}, {253,363,418,253,198,143,4*0}, {271,161,216,271,381,5*0}, {161,271,216,271,6*0}, {271,161,216,271,6*0}}, {{402,512,512,402,6*0}, {249,139,249,364,364,194,139,249,383,0}, {157,259,209,275}, {308,474,308} ,{454,454}}, {{852,852}, {454,491}, {468,409}, {10*0},{10*0}}, {{46,46,65,294,264,349}, {350,439,495,475,234,430}, {10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{223,130,223,10*0},{189,285,10*0},{189,285,10*0},{200,10*0}}, {{125,219,10*0},{125,219,10*0},{185,282,10*0},{10*0},{10*0}}, {{318,10*0},{239,10*0},{10*0},{10*0},{289,10*0}}, {{317,10*0},{328,10*0},{316,10*0},{10*0},{166,276,331,440,10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}} }; static int template_ly[25][5][15]={ /*label Y*/ {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, /*sugars*/ {{210,9*0},{291,9*0},{176,350,350,176,210,5*0},{92,35,115,159,160,90,4*0},{152,245,225,194,134,114}}, {{152,245,225,169,194,134},{103,120,145,87,131,77}, {78,21,101,145,146}, {156,180,229,173,198}, {179,185,172,114,140,111,131,237}}, {{124,197,141,166,106,122,165,270,206,304,241}, {150,223,167,192,132,232,264,305,274,214,244}, {232,264,305,274,214,244,149,222,191,131,111}, {10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, /*heterocycles*/ {{288,288,192,192,96,5*0}, {288,288,192,96,192,288,4*0}, {17,209,113,209,81,5*0}, {209,209,113,17,6*0}, {17,209,113,209,6*0}}, {{411,411,559,559,6*0}, {46,238,238,123,225,142,110,302,63,0}, {210,210,109,362}, {226,176,289} ,{207,307}}, {{228,330}, {307,256}, {212,212}, {10*0},{10*0}}, {{87,403,244,186,341,154}, {475,290,387,244,515,556}, {10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{205,151,97,10*0},{128,183,10*0},{128,183,10*0},{91,10*0}}, {{128,74,10*0},{128,74,10*0},{133,163,10*0},{10*0},{10*0}}, {{72,10*0},{155,10*0},{10*0},{10*0},{90,10*0}}, {{236,10*0},{187,10*0},{21,10*0},{10*0},{322,385,290,226,10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}} }; static int template_lo[25][5][15]={ /*label orientation*/ {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, /*sugars*/ {{-1,9*0},{-1,9*0},{-2,0,0,0,-1,5*0}, {-1,9*0},{-1,0,0,-2,6*0}}, {{-1,0,0,-2,-2,0,4*0},{-1,-2,-2,0,0,0,4*0}, {-1,0,0,0,0}, {-1,0,0,-2,-2}, {0,-2,-1,0,-2,-2,-2,0}}, {{-1,0,-2,-2,0,-2,-1,0,-2,-2,0}, {-1,0,-2,-2,0,-1,0,0,-2,0,0}, {-1,0,0,-2,0,0,-1,0,-2,0,0}, {10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, /*heterocycles*/ {{-1,-1,-1,-1,0,5*0}, {-1,-1,-1,-1,-2,-2,4*0}, {-1,-2,-2,-1,0,5*0}, {-2,-1,-2,0,6*0}, {-1,-2,-2,-1,6*0}}, {{-1,-1,-1,-1,6*0}, {-1,-2,-1,-1,-1,-1,-2,0,0,0}, {-1,-1,-1,-1}, {-1,0,0},{0,0}}, {{0,0}, {0,-1}, {0,-1}, {10*0},{10*0}}, {{-2,-2,-1,-1,-1,0}, {-1,-1,-1,0,-2,0}, {10*0},{10*0},{10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}}, {{10*0},{-1,-2,0,10*0},{-1,-1,10*0},{-1,-1,10*0},{-2,10*0}}, {{-1,-1,10*0},{-1,-1,10*0},{-1,-1,10*0},{10*0},{10*0}}, {{0,10*0},{-1,10*0},{10*0},{10*0},{0,10*0}}, {{-1,10*0},{-1,10*0},{0,10*0},{10*0},{-1,-1,-1,-1,10*0}}, {{10*0},{10*0},{10*0},{10*0},{10*0}} }; static char *template_lt[25][5][15]={ /*label text*/ {{"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, {{"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, {{"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, {{"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, {{"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, /*sugars*/ {{"O","","","","","","","","",""}, {"O","","","","","","","","",""}, {"HO","OH","OH","OH","O","","","","",""}, {"O","OH","OH","OH","OH","CH_2OH","","","",""}, {"O","OH","OH","HO","CH_2OH","OH","","","",""}}, {{"O","OH","OH","HO","HO","CH_2OH","","","",""}, {"O","HO","HO","CH_2OH","OH","OH","","","",""}, {"O","OH","OH","OH","OH","","","","",""}, {"O","OH","OH","HO","HO","","","","",""}, {"OH","H_2N","O","COOH","HO","HO","HO","OH","",""}}, {{"O","OH","HO","HO","CH_2OH","HO","O","OH","HO","HO","O"}, {"O","OH","HO","HO","CH_2OH","O","OH","OH","HO","CH_2OH","O"}, {"O","OH","OH","HO","CH_2OH","O","O","OH","HO","CH_2OH","OH"}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, {{"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, {{"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, /*heterocycles*/ {{"N","N","N","N","NH_2","","","","",""}, {"N","N","N","O","HN","H_2N","","","",""}, {"O","O","HN","N","CH_3","","","","",""}, {"O","N","N","NH_2","","","","","",""}, {"O","O","HN","N","","","","","",""}}, {{"N","N","N","N","","","","","",""}, {"O","O","N","N","N","N","H_3C","CH_3","CH_3",""}, {"O","N","O","Ph","","","","","",""}, {"N","OMe","NH_2","","","","","","",""}, {"N","N","","","","","","","",""}}, {{"N","N","","","","","","","",""}, {"N","N","","","","","","","",""}, {"N","N","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, {{"HO","HO","O","N","H","CH_3"}, {"O","N","H","CH_3","HO","OH"}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, {{"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, /* AA*/ {{"","","","","","","","","",""}, {"N","HN","NH_2","","","","","","",""}, {"O","N","","","","","","","",""}, {"O","O","","","","","","","",""}, {"S","","","","","","","","",""}}, {{"O","N","","","","","","","",""}, {"O","O","","","","","","","",""}, {"N","N","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}}, {{"NH_2","","","","","","","","",""}, {"S","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"OH","","","","","","","","",""}}, {{"OH","","","","","","","","",""}, {"N","","","","","","","","",""}, {"OH","","","","","","","","",""}, {"","","","","","","","","",""}, {"N","O","N","O","","","","","",""}}, {{"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}, {"","","","","","","","","",""}} }; static int template_crv[25][5][2][9]={ {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{252,192,220,72,304,74,270,192,0},{252,189,220,309,304,307,270,189,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} }, {{{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}}, {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}} } }; chemtool-1.6.14/templ.c0000644000175000001440000001026110715417303014114 0ustar martinusers#include #include #include int main(int argc, char**argv) /* dumps a chemtool drawing file in the format used in templates.h */ { int d, nb,na,ns; int w,h; int x[50], y[50] , tx[50], ty[50], xl[50],yl[50],dl[50],b[50]; int xs1[50], ys1[50] , xs2[50], ys2[50], xs3[50],ys3[50],xs4[50],ys4[50],ts[50]; int xr,yr; char tl[50][50]; char str[255], str1[255]; int refx,refy; FILE *fpin,*fpout; char version[10]; char filename[100]; if (argc==2) strcpy(filename,argv[1]); if ((fpin = fopen (filename, "r")) == NULL) return (1); strcat(filename,".tmpl"); if ((fpout = fopen (filename, "w")) == NULL) return (1); fscanf (fpin, "%s %s %s", str, str1, version); if (strcmp (str, "Chemtool") || strcmp (str1, "Version")) exit(2); fprintf(stderr,"%s %s %s\n",str,str1,version); fscanf (fpin, "%s %i %i", str, &w,&h); fscanf (fpin, "%s %i", str, &nb); if (!strcmp (str, "bonds") || !strcmp (str, "bounds")) { /* typo in versions < 1.1.2 */ fprintf(stderr,"%d bonds\n",nb); fgetc(fpin); for (d = 0; d < nb; d++) { (void)fgets(str,80,fpin); sscanf (str, "%i %i %i %i %i", &x[d] , &y[d], &tx[d], &ty[d] , &b[d]); } } fprintf(stderr,"bonds ok\n"); fscanf (fpin, "%s %i", str, &na); if (!strcmp (str, "atoms")) { fprintf(stderr,"%d atoms\n",na); fgetc(fpin); for (d = 0; d < na; d++) { (void)fgets(str,80,fpin); sscanf (str, "%i %i %s %i", &xl[d], &yl[d], tl[d], &dl[d]); } } fprintf(stderr,"atoms ok\n"); fscanf (fpin, "%s %i", str, &ns); if (!strcmp (str, "splines")) { if (ns>0) fgetc(fpin); for (d = 0; d < ns; d++) { (void)fgets(str,80,fpin); sscanf (str, "%i %i %i %i %i %i %i %i %i", xs1[d], ys1[d], xs2[d], ys2[d],xs3[d],ys3[d],xs4[d],ys4[d],ts[d]); } } fscanf (fpin, "%s %i %i", str, &xr,&yr); if (!strcmp(str,"attach")){ refx=xr; refy=yr; } fclose (fpin); fprintf(fpout,"bonds:%d\n",nb); fprintf(fpout,"atoms:%d\n",na); fprintf(fpout,"splines:%d\n",ns); if (nb>0){ fprintf(fpout,"{"); for (d=0;d0){ fprintf(fpout,"{"); for (d=0;d0){ fprintf(fpout,"{"); for (d=0;d #endif #include #include #include "bitmap1.h" #include "templates.h" #include "chemcurs.h" #include "chemtool.xpm" #include #include #include #if 0 #include /* memmove*/ #endif #include #include #include #include #include "ct.h" #ifndef ENABLE_NLS #define _(Text) Text #else #include #define _(Text) gettext(Text) #endif GtkWidget *filew; GtkWidget *templates; GtkWidget *messagew, *message; GtkWidget *expw; GtkWidget *mainw; GtkWidget *window; GtkWidget *scrolled_window; GtkWidget *hexbutton, *pent1button, *pent2button, *octbutton, *ltextbutton, *ctextbutton, *rtextbutton, *bondbutton, *movebutton, *markbutton,*colorbutton, *rotatebutton, *hflipbutton, *vflipbutton, *copybutton, *addbutton, *tempbutton, *cleanbutton, *rescalebutton, *splinebutton,*fontbutton, *bgcolorbutton; #if 0 GtkWidget *fontsel,*fontselw; #endif GtkWidget *textlabel; GtkStyle *normalfontstyle,*seriffontstyle; GtkWidget *scale, *pscale; GtkWidget *bracketbutton, *rbracketbutton, *r2bracketbutton, *bracebutton, *box1button, *box2button, *box3button, *box4button, *boxbutton; GtkWidget *boxmenu,*penmenu; GtkWidget *drawing_area, *preview_area; #if (GTK_MINOR_VERSION >2) /* --- Widgets used by the Configurable Options dialog --- */ GtkWidget *printer_dialog; /* Widgets used for layout structure */ GtkWidget *master_vbox; GtkWidget *notebook; GtkWidget *table; /* Widgets that contain data and are accessed from elsewhere */ GtkWidget *color_button; GtkWidget *printer_name_entry; GtkWidget *print_scale_spin; GtkWidget *datadir_entry; GtkWidget *datamask_entry; GtkWidget *whiteout_check; GtkWidget *intl_check; GtkWidget *paper_size_combo; GtkWidget *orientation_combo; GtkWidget *print_cmd_combo; GtkWidget *eps_preview_combo; GtkWidget *bond_length_entry; GtkWidget *dbond_dist_spin; #else GtkWidget *papermenu, *papersizes, *orientmenu, *orientations, *printcmdmenu, *printcmds, *prqueue; GtkWidget *epsoptionmenu,*epsoptions,*whiteoutbutton,*intlbutton; GtkWidget *colorsel; GtkWidget *colorseldialog; GtkWidget *defaultdir, *defaultext,*base_bondlen,*doubledist; #endif GtkWidget *bondomenu, *bondmenu, *menuitem; GtkWidget *fontmenu,*fontsizes; GtkWidget *msgtext; GtkWidget *pdbhbox, *labbutton[5],*sdfhbox,*sdflabel,*sdfbutton[3]; GtkWidget *babelcmds,*babelcmdmenu; GtkWidget *babelexpcmds,*babelexpmenu; GdkCursor *cursor_pencil, *cursor_text, *cursor_bonds, *cursor_markTLC, *cursor_markBRC, *cursor_move, *cursor_rescale, *cursor_rotate, *cursor_busy; GdkBitmap *source, *mask; GtkWidget *oldpixmap; GdkColor fg = { 0, 0, 0, 0 }; /* Black */ GdkColor bg = { 0, 32767, 32767, 65535 }; /* Blue */ GdkColor wh = { 0, 65535, 65535, 65535 }; /* White */ GdkColor background={0,0xeeee,0x0000,0x0000}; #ifdef GTK2 GtkTextBuffer *msgtextbuffer; GtkTextIter iter; GtkAdjustment *msgadjustment; #endif char filename[512]; char expname[512]; static int loadsave = 1; static int expmode = 0; static int curbond = 0; static int ringtype = 0; int newpapersize = 0; int neworientation = 0; int newprintcommand = 0; int newepsoption = 0; int splinepoint = 0; int oldwhiteout = 0; int oldintlchars= 0; int textentry=-1; int pendown = 0; int batchmode = 0; struct { int x; int y; } spline[4]; static gint configure_event (GtkWidget * mainw, GdkEventConfigure * event) /* callback function to create an empty white drawing area on startup */ { if (picture) gdk_pixmap_unref (picture); picture = gdk_pixmap_new (mainw->window, mainw->allocation.width + 100, mainw->allocation.height + 100, -1); gdk_draw_rectangle (picture, mainw->style->white_gc, (gint) TRUE, 0, 0, (gint) mainw->allocation.width, (gint) mainw->allocation.height); Display_Mol (); return (gint) TRUE; } static gint configure_preview (GtkWidget * mainw, GdkEventConfigure * event) /* callback function to create an empty white drawing area on startup */ { if (preview) { gdk_pixmap_unref (preview); preview=NULL; } preview = gdk_pixmap_new (mainw->window, 200, 100, -1); gdk_draw_rectangle (preview, mainw->style->white_gc, (gint) TRUE, 0, 0, (gint) 200, (gint) 100); return (gint) TRUE; } static gint expose_event (GtkWidget * mainw, GdkEventExpose * event) /* callback function to redraw parts of the drawing area */ { gdk_draw_pixmap (mainw->window, mainw->style->fg_gc[GTK_WIDGET_STATE (mainw)], picture, event->area.x, event->area.y, event->area.x, event->area.y, (gint) event->area.width, (gint) event->area.height); return (gint) FALSE; } void yesnodialog (void (*YesFunc) (void)) /* Popup to show a warning message when unsaved changes are about to be destroyed by Load or Quit (Modal toplevel dialog) */ { GtkWidget *button, *label; GtkWidget *yesno_window; yesno_window = gtk_dialog_new (); (void)gtk_signal_connect_object (GTK_OBJECT (yesno_window), "destroy", GTK_SIGNAL_FUNC (gtk_grab_remove), GTK_OBJECT (yesno_window)); (void)gtk_signal_connect_object (GTK_OBJECT (yesno_window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (yesno_window)); gtk_container_border_width (GTK_CONTAINER (yesno_window), 5); label = gtk_label_new (_ ("The current drawing is not saved !\nDo you really wish to continue ?")); gtk_misc_set_padding (GTK_MISC (label), 10, 10); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (yesno_window)->vbox), label, TRUE, (gboolean) TRUE, 0); gtk_widget_show (label); button = gtk_button_new_with_label (_("Yes")); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_grab_remove), GTK_OBJECT (yesno_window)); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (YesFunc), GTK_OBJECT (yesno_window)); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (yesno_window)); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (yesno_window)->action_area), button, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (button); button = gtk_button_new_with_label (_("No")); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_grab_remove), GTK_OBJECT (yesno_window)); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (yesno_window)); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (yesno_window)->action_area), button, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (button); gtk_widget_realize (yesno_window); gtk_grab_add (yesno_window); #ifdef GTK2 gtk_window_set_transient_for (GTK_WINDOW (yesno_window), GTK_WINDOW(mainw)); #else gtk_window_set_transient_for (GTK_WINDOW (yesno_window), GTK_WINDOW (gtk_widget_get_toplevel (yesno_window))); #endif gtk_window_set_position (GTK_WINDOW (yesno_window), GTK_WIN_POS_MOUSE); gtk_widget_show (yesno_window); } void yesnodialog2 (void (*YesFunc) (void), char *somefile) /* Popup to show a warning message when unsaved changes are about to be destroyed by Load or Quit (Modal toplevel dialog) */ { GtkWidget *button, *label; GtkWidget *yesno_window; char tmpstr[512]; yesno_window = gtk_dialog_new (); (void)gtk_signal_connect_object (GTK_OBJECT (yesno_window), "destroy", GTK_SIGNAL_FUNC (gtk_grab_remove), GTK_OBJECT (yesno_window)); (void)gtk_signal_connect_object (GTK_OBJECT (yesno_window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (yesno_window)); gtk_container_border_width (GTK_CONTAINER (yesno_window), 5); snprintf (tmpstr,512, _("File\n%s\nalready exists !\nOverwrite it ?"), somefile); label = gtk_label_new (tmpstr); gtk_misc_set_padding (GTK_MISC (label), 10, 10); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (yesno_window)->vbox), label, TRUE, (gboolean) TRUE, 0); gtk_widget_show (label); button = gtk_button_new_with_label (_("Yes")); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_grab_remove), GTK_OBJECT (yesno_window)); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (YesFunc), GTK_OBJECT (yesno_window)); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (yesno_window)); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (yesno_window)->action_area), button, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (button); button = gtk_button_new_with_label (_("No")); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_grab_remove), GTK_OBJECT (yesno_window)); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (yesno_window)); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (yesno_window)->action_area), button, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (button); gtk_widget_realize (yesno_window); gtk_grab_add (yesno_window); #ifdef GTK2 gtk_window_set_transient_for (GTK_WINDOW (yesno_window), GTK_WINDOW(mainw)); #else gtk_window_set_transient_for (GTK_WINDOW (yesno_window), GTK_WINDOW (gtk_widget_get_toplevel (yesno_window))); #endif gtk_window_set_position (GTK_WINDOW (yesno_window), GTK_WIN_POS_MOUSE); gtk_widget_show (yesno_window); } static gint button_press_event (GtkWidget * mainw, GdkEventButton * event) /* Handle mouse button presses depending on current drawing mode */ { int event_x, event_y; int i, spt; char *tmpstr; mainw = mainw; /* Avoid gcc unused parameter warning */ draw_ok= 1; /* valid data, allow drawing */ if (event->button == 1 && picture != NULL) /* Button 1 actions: */ { event_x = (int) event->x; event_y = (int) event->y; switch (drawmode) { case 1: /* Text mode: Insert a label */ if (event->state & GDK_CONTROL_MASK) Add_number (event_x, event_y); else Add_atom (event_x, event_y); #ifdef LIBUNDO undo_snapshot (); #endif break; case 0: /* Line mode: show marker boxes around current position */ default: Set_vector (event_x, event_y, curbond); break; case 2: /* Bondtype mode: change bond at cursor to current default */ Set_bondtype (event_x, event_y, curbond); #ifdef LIBUNDO undo_snapshot (); #endif break; case 3: case 6: case 7: /* Move and rotate modes : initialize operation */ Set_pmove (event_x, event_y); break; case 4: /* Mark mode : Set corner of rectangle */ gdk_window_set_cursor (drawing_area->window, cursor_markBRC); Set_start_rec (event_x, event_y); break; case 8: spline[splinepoint].x = round_coord (event_x, size_factor); spline[splinepoint].y = round_coord (event_y, size_factor); splinepoint++; modify = 1; if (splinepoint < 4) { for (i = 1; i < splinepoint; i++) gdk_draw_line (picture, mygc[curpen], (gint) (spline[i - 1].x * size_factor), (gint) (spline[i - 1].y * size_factor), (gint) (spline[i].x * size_factor), (gint) (spline[i].y * size_factor)); CopyPlane (); } else { spt = 0; if (curbond == 8) spt = 1; if (curbond == 9) spt = 2; if (curbond == 10) spt = -1; if (curbond == 12) spt = -2; add_spline (spline[0].x, spline[0].y, spline[1].x, spline[1].y, spline[2].x, spline[2].y, spline[3].x, spline[3].y, spt, 0, curpen); splinepoint = 0; Display_Mol (); } break; ;; } } if (event->button == 2 && picture != NULL) /* Second (middle) button */ { event_x = (int) event->x; event_y = (int) event->y; if (drawmode == 2) { /* in bondtype mode, reverse direction of current bond */ Invert_vector (event_x, event_y); #ifdef LIBUNDO undo_snapshot (); #endif } else if (drawmode == 1){ if (event->state & GDK_CONTROL_MASK){ tmpstr=(char*)gtk_entry_get_text (GTK_ENTRY (textbox)); atnum=atoi(tmpstr); if (atnum>0)atnum--; } else Fetch_atom (event_x, event_y); } else { /* in all other modes, set bondtype of current bond to next in list */ Add_double (event_x, event_y); #ifdef LIBUNDO undo_snapshot (); #endif } } if (event->button == 3 && picture != NULL) /* Button 3 */ { event_x = (int) event->x; event_y = (int) event->y; switch (drawmode) { case 0: /* in line mode, delete bond at cursor */ if (event->state & GDK_CONTROL_MASK) Del_rec (); else Del_vector (event_x, event_y); #ifdef LIBUNDO undo_snapshot (); #endif break; case 1: if (event->state & GDK_CONTROL_MASK) atnum=0; else /* in text mode, deletes label at cursor */ Del_atom (event_x, event_y); #ifdef LIBUNDO undo_snapshot (); #endif break; case 4: #ifdef LIBUNDO undo_snapshot (); #endif Del_rec (); break; case 3: case 6: /* in move and rotate modes - abort operation */ #ifdef LIBUNDO do_undo(); #endif break; case 8: /* in spline mode, abort current spline */ splinepoint = 0; Display_Mol (); break; default: break; } } return (gint) TRUE; } static gint button_release_event (GtkWidget * mainw, GdkEventButton * event) /* completes drawing actions upon release of the mouse button */ { int event_x, event_y; mainw = mainw; /* Avoid gcc unused parameter warning */ draw_ok = 0; if (event->button == 1 && picture != NULL) /* release of the first (left) button */ { event_x = (int) event->x; event_y = (int) event->y; if (drawmode == 0) { /* in line mode, adds bond from previous to current position */ if (event->state & GDK_CONTROL_MASK) { Add_ring (draw_angle, curbond, ringtype); #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer,&iter, "\n", -1); gtk_adjustment_set_value(msgadjustment,gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, "\n", 1); #endif ringtype = 0; } else Add_vector (curbond); /* add bond, redisplay */ #ifdef LIBUNDO undo_snapshot (); #endif } else { if (drawmode == 4) { /* in mark mode, defines final position for opposite corner of rectangle */ if (event->state & GDK_CONTROL_MASK) { Mark_rec (1); } else { Mark_rec (0); } gdk_window_set_cursor (drawing_area->window, cursor_markTLC); FreePix (); CreatePix (); Display_Mol (); #if 0 Movemode(mainw); #endif } #ifdef LIBUNDO if (drawmode > 2) undo_snapshot (); #endif } } return (gint) TRUE; } static gint motion_notify_event (GtkWidget * widget, GdkEventMotion * event) /* handles mouse movement while a button is down */ { gint x, y; GdkModifierType state; if (event->is_hint != 0) (void) gdk_window_get_pointer (event->window, &x, &y, &state); else { x = (gint) event->x; y = (gint) event->y; state = event->state; } if (( (state & GDK_BUTTON1_MASK)|| pendown==1) && picture != NULL) { /* dragging with button 1 (usually left) down */ switch (drawmode) { case 0: /* in line mode, draw bond from last to current cursor position */ if (draw_ok) Put_vector (x, y); break; case 3: /* in move mode, shift marked fragment to current cursor position */ if (event->state & GDK_CONTROL_MASK) { Put_pmove (x, y, 1); } else if (event->state & GDK_SHIFT_MASK) { Put_pmove (x, y, 2); } else { Put_pmove (x, y, 0); } break; case 4: /* in mark mode, draw rectangle between initial and current position */ if (draw_ok) Put_rec (x, y); break; case 6: /* in rotate mode, rotate marked fragment by an amount proportional to the distance between initial and current cursor position */ if (event->state & GDK_CONTROL_MASK) { Put_protate (x, y, 1); } else { Put_protate (x, y, 0); } break; case 7: if (state & GDK_CONTROL_MASK) Put_pscale (x, y, 1); else Put_pscale (x, y, 0); break; default: break; } } return (gint) TRUE; } static gint key_press_event (GtkWidget * mainw, GdkEventKey * event) /* Handle key presses depending on current drawing mode */ { struct dc *hpc; static char label[MAXCL]; int direction=0; int dx=0; char errtext[101]; int x,y; #ifdef GTK2 if (gtk_widget_is_focus(textbox)) return FALSE; #endif if (event->state & GDK_CONTROL_MASK) { if (!isdigit ((int) event->keyval)) return ((gint) FALSE); ringtype = (int) (event->keyval - 48); if (ringtype < 3) ringtype += 10; snprintf (errtext, 100, _("\nNext ring drawn will have %d sides"), ringtype); #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value(msgadjustment, gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext, (gint) strlen (errtext)); #endif return ((gint) TRUE); } if (event->state & GDK_MOD1_MASK) /* ALT+Cursor shifts grid */ { if (gridtype == 0) return TRUE; /* nothing to do */ switch (event->keyval){ case GDK_Left: gridx--; if (gridx<-50) gridx=0; gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); break; case GDK_Right: gridx++; if (gridx>50) gridx=0; gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); break; case GDK_Up: gridy--; if (gridy<-50) gridy=0; gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); break; case GDK_Down: gridy++; if (gridy>50) gridy=0; gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); break; default: return (gint) FALSE; } Display_Mol (); return TRUE; } if (drawmode == 0 && picture != NULL) /* Button 1 actions: */ { if (textentry >-1){ /* label input in progress */ if (event->keyval == GDK_Return) { label[textentry] = '\0'; add_char (hp->tx, hp->ty, label, direction, 0, curpen,0,curfontsize); textentry=-1; Display_Mol (); return(TRUE); } else if (isprint((int)event->keyval)) { label[textentry++]=(char)event->keyval; gtk_entry_set_text(GTK_ENTRY(textbox),label); return(TRUE); } if (event->keyval == GDK_BackSpace) { label[--textentry]='\0'; gtk_entry_set_text(GTK_ENTRY(textbox),label); } } switch (event->keyval) { case 'c': case 'o': case 'n': case 's': case 'p': case 'h': case 'f': case 'i': case 'r': case 'b': case 'd': direction = Middle_Text; label[0] = toupper ((int) event->keyval); label[1] = '\0'; add_char (hp->tx, hp->ty, label, direction, 0,curpen,0,curfontsize); break; case 'l': direction = Left_Text; strcpy (label, "Cl"); add_char (hp->tx, hp->ty, label, direction, 0,curpen,0,curfontsize); break; case '1': direction = Left_Text; strcpy (label, "CH"); add_char (hp->tx, hp->ty, label, direction, 0, curpen,0,curfontsize); break; case '2': direction = Left_Text; strcpy (label, "CH_2"); add_char (hp->tx, hp->ty, label, direction, 0, curpen,0,curfontsize); break; case '3': direction = Left_Text; strcpy (label, "CH_3"); add_char (hp->tx, hp->ty, label, direction, 0, curpen,0,curfontsize); break; case '*': direction = Middle_Text; label[0] = '@'; label[1] = '\267'; label[2] = '\0'; add_char (hp->tx, hp->ty, label, direction, 0, curpen,0,curfontsize); break; case '+': direction = Middle_Text; label[0] = '@'; label[1] = '+'; label[2] = '\0'; add_char (hp->tx, hp->ty, label, direction, 0, curpen,0,curfontsize); break; case '-': direction = Middle_Text; label[0] = '@'; label[1] = '-'; label[2] = '\0'; add_char (hp->tx, hp->ty, label, direction, 0, curpen,0,curfontsize); break; case ' ': direction=Left_Text; /* fprintf(stderr,"start label entering\n");*/ memset(label,0,25); textentry=0; break; case GDK_KP_Left: case GDK_KP_4: hpc=select_char(hp->tx,hp->ty,1); if (hpc ) { dx =3*hpc->direct *(int)strlen(hpc->c); if (event->state & GDK_SHIFT_MASK) {/* dots */ add_char (hp->tx-15+dx,hp->ty-4,"@\267",Middle_Text,0,curpen,0,curfontsize); add_char (hp->tx-15+dx,hp->ty+4,"@\267",Middle_Text,0,curpen,0,curfontsize); }else{ add_struct(hp->tx-15+dx,hp->ty-12,hp->tx-15+dx,hp->ty+8,0,0,0,1,curpen); } } break; case GDK_KP_Up: case GDK_KP_8: hpc=select_char(hp->tx,hp->ty,1); if (hpc ) { dx =3*hpc->direct *(int)strlen(hpc->c); if (event->state & GDK_SHIFT_MASK) {/* dots */ add_char (hp->tx-4+dx,hp->ty-20,"@\267",Middle_Text,0,curpen,0,curfontsize); add_char (hp->tx+8+dx,hp->ty-20,"@\267",Middle_Text,0,curpen,0,curfontsize); }else{ add_struct(hp->tx-10+dx,hp->ty-20,hp->tx+10+dx,hp->ty-20,0,0,0,1,curpen); } } break; case GDK_KP_Right: case GDK_KP_6: hpc=select_char(hp->tx,hp->ty,1); if (hpc ) { dx =5 *((int)strlen(hpc->c)-1); if (event->state & GDK_SHIFT_MASK) {/* dots */ add_char (hp->tx+13+dx,hp->ty-4,"@\267",Middle_Text,0,curpen,0,curfontsize); add_char (hp->tx+13+dx,hp->ty+4,"@\267",Middle_Text,0,curpen,0,curfontsize); }else{ add_struct(hp->tx+15+dx,hp->ty-12,hp->tx+15+dx,hp->ty+8,0,0,0,1,curpen); } } break; case GDK_KP_Down: case GDK_KP_2: hpc=select_char(hp->tx,hp->ty,1); if (hpc ) { dx =3*hpc->direct *(int)strlen(hpc->c); if (event->state & GDK_SHIFT_MASK) {/* dots */ add_char (hp->tx-4+dx,hp->ty+15,"@\267",Middle_Text,0,curpen,0,curfontsize); add_char (hp->tx+8+dx,hp->ty+15,"@\267",Middle_Text,0,curpen,0,curfontsize); }else{ add_struct(hp->tx-10+dx,hp->ty+15,hp->tx+10+dx,hp->ty+15,0,0,0,1,curpen); } } break; case GDK_KP_Home: case GDK_KP_7: hpc=select_char(hp->tx,hp->ty,1); if (hpc ) { dx =3*hpc->direct *(int)strlen(hpc->c); if (event->state & GDK_SHIFT_MASK) {/* dots */ add_char (hp->tx-20+dx,hp->ty-10,"@\267",Middle_Text,0,curpen,0,curfontsize); add_char (hp->tx-5+dx,hp->ty-20,"@\267",Middle_Text,0,curpen,0,curfontsize); }else{ add_struct(hp->tx-20+dx,hp->ty-10,hp->tx-5+dx,hp->ty-20,0,0,0,1,curpen); } } break; case GDK_KP_Page_Up: case GDK_KP_9: hpc=select_char(hp->tx,hp->ty,1); if (hpc) { dx =5 *(int)strlen(hpc->c); if (event->state & GDK_SHIFT_MASK) {/* dots */ add_char (hp->tx+20+dx,hp->ty-10,"@\267",Middle_Text,0,curpen,0,curfontsize); add_char (hp->tx+5+dx,hp->ty-20,"@\267",Middle_Text,0,curpen,0,curfontsize); }else{ add_struct(hp->tx+20+dx,hp->ty-10,hp->tx+5+dx,hp->ty-20,0,0,0,1,curpen); } } break; case GDK_KP_End: case GDK_KP_1: hpc=select_char(hp->tx,hp->ty,1); if (hpc ) { dx =3*hpc->direct *(int)strlen(hpc->c); if (event->state & GDK_SHIFT_MASK) {/* dots */ add_char (hp->tx-20+dx,hp->ty+5,"@\267",Middle_Text,0,curpen,0,curfontsize); add_char (hp->tx-5+dx,hp->ty+15,"@\267",Middle_Text,0,curpen,0,curfontsize); }else{ add_struct(hp->tx-20+dx,hp->ty+5,hp->tx-5+dx,hp->ty+15,0,0,0,1,curpen); } } break; case GDK_KP_Page_Down: case GDK_KP_3: hpc=select_char(hp->tx,hp->ty,1); if (hpc ) { dx =5 *((int)strlen(hpc->c)-1); if (event->state & GDK_SHIFT_MASK) {/* dots */ add_char (hp->tx+20+dx,hp->ty+5,"@\267",Middle_Text,0,curpen,0,curfontsize); add_char (hp->tx+5+dx,hp->ty+15,"@\267",Middle_Text,0,curpen,0,curfontsize); }else{ add_struct(hp->tx+20+dx,hp->ty+5,hp->tx+5+dx,hp->ty+15,0,0,0,1,curpen); } } break; case GDK_Left: if (event->state & GDK_SHIFT_MASK){ pendown=1; draw_ok=1; XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,-1,0); (void)gdk_window_get_pointer(drawing_area->window,&x,&y,NULL); Put_vector(x,y); }else{ pendown=0; draw_ok=0; XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,-1,0); } gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); break; case GDK_Right: if (event->state & GDK_SHIFT_MASK){ pendown=1; draw_ok=1; XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,1,0); (void)gdk_window_get_pointer(drawing_area->window,&x,&y,NULL); Put_vector(x,y); }else{ pendown=0; draw_ok=0; } XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,1,0); gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); break; case GDK_Up: if (event->state & GDK_SHIFT_MASK){ pendown=1; draw_ok=1; XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,0,-1); (void)gdk_window_get_pointer(drawing_area->window,&x,&y,NULL); Put_vector(x,y); }else{ pendown=0; draw_ok=0; XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,0,-1); } gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); break; case GDK_Down: if (event->state & GDK_SHIFT_MASK){ pendown=1; draw_ok=1; (void)gdk_window_get_pointer(drawing_area->window,&x,&y,NULL); Put_vector(x,y); XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,0,1); } else { pendown=0; draw_ok=0; XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,0,1); } gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); break; case GDK_Return: (void)gdk_window_get_pointer(drawing_area->window,&x,&y,NULL); if (pendown==0){ Set_vector(x,y,curbond); }else{ draw_ok=1; Add_vector(curbond); pendown=0; Set_vector(x,y,curbond); } break; default: return (gint) FALSE; } Display_Mol (); #ifdef LIBUNDO undo_snapshot (); #endif } else if (drawmode == 3 && picture != NULL) { switch (event->keyval){ case GDK_Left: if (event->state & GDK_SHIFT_MASK) XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,-5,0); else XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,-1,0); gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); (void)gdk_window_get_pointer(drawing_area->window,&x,&y,NULL); Put_pmove(x,y,0); break; case GDK_Right: if (event->state & GDK_SHIFT_MASK) XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,5,0); else XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,1,0); gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); (void)gdk_window_get_pointer(drawing_area->window,&x,&y,NULL); Put_pmove(x,y,0); break; case GDK_Up: if (event->state & GDK_SHIFT_MASK) XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,0,-5); else XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,0,-1); gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); (void)gdk_window_get_pointer(drawing_area->window,&x,&y,NULL); Put_pmove(x,y,0); break; case GDK_Down: if (event->state & GDK_SHIFT_MASK) XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,0,5); else XWarpPointer(GDK_DISPLAY(),None,None,0,0,0,0,0,1); gtk_signal_emit_stop_by_name (GTK_OBJECT(mainw), "key_press_event"); (void)gdk_window_get_pointer(drawing_area->window,&x,&y,NULL); Put_pmove(x,y,0); break; case GDK_Return: Unmark_all(); break; default: return (gint) FALSE; } Display_Mol (); } else if (importflag != 0 && event->keyval == GDK_Return) { pdbstore (); gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, TRUE); snprintf (errtext, 100, _("\nImported %d bonds and %d labels"), hp->n, hp->nc); #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value (msgadjustment, gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext, (gint) strlen (errtext)); #endif } return (gint) TRUE; } #ifdef LIBUNDO void do_undo () { int d; struct data *hp_b; struct dc *hp_c; struct spline *hp_sp; if (undo_get_undo_count () < 1) return; undo_undo (); if (hp->n > 0) { hp_b = da_root.next; if (hp_b->prev != &da_root) { for (d = 0; d < hp->n; d++) { hp_b = hp_b->prev; if (hp_b->prev == &da_root) { da_root.next = hp_b; break; } da_root.next = hp_b; } } for (d = 0; d < hp->n; d++) hp_b = hp_b->next; new = hp_b; } else { new = da_root.next; new->prev = &da_root; } if (hp->nc > 0) { hp_c = dac_root.next; if (hp_c->prev != &dac_root) { for (d = 0; d < hp->nc; d++) { hp_c = hp_c->prev; if (hp_c->prev == &dac_root) { dac_root.next = hp_c; break; } dac_root.next = hp_c; } } for (d = 0; d < hp->nc; d++) hp_c = hp_c->next; new_c = hp_c; } else { new_c = dac_root.next; new_c->prev = &dac_root; } if (hp->nsp > 0) { hp_sp = sp_root.next; if (hp_sp->prev != &sp_root) { for (d = 0; d < hp->nsp; d++) { hp_sp = hp_sp->prev; if (hp_sp->prev == &sp_root) { sp_root.next = hp_sp; break; } sp_root.next = hp_sp; } } for (d = 0; d < hp->nsp; d++) hp_sp = hp_sp->next; sp_new = hp_sp; } else { sp_new = sp_root.next; sp_new->prev = &sp_root; } FreePix (); CreatePix (); Display_Mol (); } void do_redo () { int d; struct data *hp_b; struct dc *hp_c; struct spline *hp_sp; if (undo_get_redo_count () > 0) undo_redo (); if (hp->n > 0) { hp_b = da_root.next; if (hp_b->prev != &da_root) { for (d = 0; d < hp->n; d++) { hp_b = hp_b->prev; if (hp_b->prev == &da_root) { da_root.next = hp_b; break; } da_root.next = hp_b; } } for (d = 0; d < hp->n; d++) hp_b = hp_b->next; new = hp_b; } else { new = da_root.next; new->prev = &da_root; } if (hp->nc > 0) { hp_c = dac_root.next; if (hp_c->prev != &dac_root) { for (d = 0; d < hp->nc; d++) { hp_c = hp_c->prev; if (hp_c->prev == &dac_root) { dac_root.next = hp_c; break; } dac_root.next = hp_c; } } for (d = 0; d < hp->nc; d++) hp_c = hp_c->next; new_c = hp_c; } else { new_c = dac_root.next; new_c->prev = &dac_root; } if (hp->nsp > 0) { hp_sp = sp_root.next; if (hp_sp->prev != &sp_root) { for (d = 0; d < hp->nsp; d++) { hp_sp = hp_sp->prev; if (hp_sp->prev == &sp_root) { sp_root.next = hp_sp; break; } sp_root.next = hp_sp; } } for (d = 0; d < hp->nsp; d++) hp_sp = hp_sp->next; sp_new = hp_sp; } else { sp_new = sp_root.next; sp_new->prev = &sp_root; } FreePix (); CreatePix (); Display_Mol (); } #endif void Zoom (GtkWidget * mainw, gpointer inout) /* increase or decrease zoom scale (two steps to either side ) */ { if (inout && !strcmp ((char *) inout , "1")) { if (zoom_factor != 0) zoom_factor--; } else if (!strcmp( (char*)inout ,"0")) { if (zoom_factor < 4) zoom_factor++; } if (batchmode==1) return; gtk_option_menu_set_history(GTK_OPTION_MENU(fontmenu), (guint)zoom_factor+1); curfontsize=zoom_factor+1; FreePix (); CreatePix (); Display_Mol (); if (importflag != 0) pdbrotate (0, 0, 2); } void Grid (GtkWidget * mainw) /* show or hide grid */ { if (gridtype < 2) gridtype ++; else gridtype = 0; FreePix (); CreatePix (); Display_Mol (); if (importflag != 0) pdbrotate (0, 0, 2); } void change_color (GtkWidget * mainw, gpointer data) /* update current pencolor and color selection button */ { GdkPixmap *pixmap; GtkWidget *pixmapwid; GtkStyle *style=gtk_widget_get_style (mainw);; curpen=atoi(data); pixmap = gdk_pixmap_create_from_xpm_d (mainw->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_color[curpen]); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_remove (GTK_CONTAINER (colorbutton),oldpixmap); gtk_container_add (GTK_CONTAINER (colorbutton), pixmapwid); oldpixmap=pixmapwid; } void CheckAndClear () /* called by Clear button, pops up an "are you sure" dialog if the current drawing changed since last save, or calls real Clear function directly */ { if (modify == 0 || hp->n + hp->nc + hp->nsp == 0) { Clear (); } else { yesnodialog (Clear); } } void Clear () /* deletes all atoms and bonds from memory and reinitializes drawing area */ { char msgtmp[100]; clear_data (); modify = 0; atnum = 0; mark.x = 300; mark.y = 300; hp->n = 0; hp->nc = 0; hp->nsp = 0; hp->x = 200; hp->y = 200; hp->tx = 200; hp->ty = 200; if (pdbn) { free (pdbx); free (pdby); free (pdbz); free (bondfrom); free (bondto); free (bondtype); bondfrom = NULL; bondto = NULL; bondtype = NULL; pdbx = NULL; pdby = NULL; pdbz = NULL; free (atjust); atjust = NULL; free (atcode); atcode = NULL; pdbn = 0; } importflag = 0; addflag = 0; refx=refy=0; #ifdef LIBUNDO undo_snapshot (); new = da_root.next; new->prev = &da_root; #endif strcpy (filename, _("unnamed")); gtk_window_set_title (GTK_WINDOW (window), "Chemtool 1.6.14"); snprintf(msgtmp,99,_("\nReady")); #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer, &iter, msgtmp, -1); gtk_adjustment_set_value (msgadjustment, gtk_adjustment_get_value (msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, msgtmp, (gint)strlen(msgtmp)); #endif FreePix (); CreatePix (); Display_Mol (); } void do_fw () { int error; char errtext[255]; size_t msglen = 254; strcpy (formula, "program cht not available or unable to write to"); strcpy (weight, filename); strcat (weight, ".rad"); strcpy (eweight, " ?"); strcpy (compos, " ?"); error = export_fw (filename); if (error != 0) { snprintf (errtext, msglen, _("\nHelper process failed - %s %s %s %s!"), formula, weight, eweight, compos); } else { snprintf (errtext, msglen, _("\n%s %s %s %s"), formula, weight, eweight, compos); } #ifdef GTK2 gtk_text_buffer_insert(msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value(msgadjustment,gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext, (gint) strlen (errtext)); #endif } void print_ps () { char errtext[255]; size_t msglen = 254; if (hp->n + hp->nc + hp->nsp == 0) return; if (print_ps_pic() == 0) { snprintf(errtext,msglen,_("\nDrawing printed!")); } else { snprintf(errtext,msglen,_("\nFailed to print drawing !")); } #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value (msgadjustment, gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext,(gint)strlen(errtext)); #endif } #if (GTK_MINOR_VERSION >2) /* ************** Callback for Configurable Options Dialog ************** */ int options_dialog_ok (GtkWidget *widget, gpointer data) { int newint; GdkColor color; papersize = gtk_combo_box_get_active (GTK_COMBO_BOX (paper_size_combo)); orient = gtk_combo_box_get_active (GTK_COMBO_BOX (orientation_combo)); printcmd = gtk_combo_box_get_active (GTK_COMBO_BOX (print_cmd_combo)); epsoption = gtk_combo_box_get_active (GTK_COMBO_BOX (eps_preview_combo)); use_whiteout = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (whiteout_check)); use_intlchars = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (intl_check)); strcpy (queuename, gtk_entry_get_text (GTK_ENTRY (printer_name_entry))); printscale = gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (print_scale_spin)) / 100.0; strcpy (datadir, gtk_entry_get_text (GTK_ENTRY (datadir_entry))); strcpy (datamask, gtk_entry_get_text (GTK_ENTRY (datamask_entry))); newint = atof(gtk_entry_get_text (GTK_ENTRY (bond_length_entry))); if (newint != 0 && newint != bondlen_mm) { size_factor /= bondlen_mm/10.668; bondlen_mm = newint; size_factor *= bondlen_mm/10.668; } newint = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dbond_dist_spin)); if (newint >= 0 && db_dist != newint) { db_dist = newint; mb_dist = (int) ( ((float)db_dist) * 2.5); } gtk_color_button_get_color (GTK_COLOR_BUTTON (color_button), &color); gdk_colormap_alloc_color(gdk_colormap_get_system(), &color, FALSE, TRUE); gdk_gc_set_foreground(background_gc, &color); gdk_gc_set_background(background_gc, &color); snprintf(bghexcolor,10,"#%2.2x%2.2x%2.2x",(unsigned char)(color.red/256.),(unsigned char)(color.green/256.),(unsigned char)(color.blue/256.)); FreePix(); CreatePix(); Display_Mol(); gtk_widget_hide (printer_dialog); return TRUE; } void prepare_options_dialog () { char msgtmp[100]; gtk_color_button_set_color (GTK_COLOR_BUTTON (color_button), &background); if (use_whiteout == 1) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (whiteout_check), TRUE); } else { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (whiteout_check), FALSE); } if (use_intlchars == 1) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (intl_check), TRUE); } else { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (intl_check), FALSE); } gtk_entry_set_text (GTK_ENTRY (datadir_entry), datadir); gtk_entry_set_text (GTK_ENTRY (datamask_entry), datamask); gtk_combo_box_set_active (GTK_COMBO_BOX (eps_preview_combo), epsoption); snprintf (msgtmp, 100, "%6.4f", bondlen_mm); gtk_entry_set_text (GTK_ENTRY (bond_length_entry), msgtmp); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dbond_dist_spin), db_dist); gtk_combo_box_set_active (GTK_COMBO_BOX (print_cmd_combo), printcmd); gtk_entry_set_text (GTK_ENTRY (printer_name_entry), queuename); gtk_combo_box_set_active (GTK_COMBO_BOX (paper_size_combo), papersize); gtk_combo_box_set_active (GTK_COMBO_BOX (orientation_combo), orient); gtk_spin_button_set_value (GTK_SPIN_BUTTON (print_scale_spin), printscale * 100); } int print_setup_menu_activate (GtkWidget *widget, gpointer data) { prepare_options_dialog (); gtk_widget_show (printer_dialog); return TRUE; } #else void setup_printer (GtkWidget * mainw, gpointer change) { char tmpstr[10]; double bondlen_new; int doubledist_new; mainw = mainw; /* Avoid gcc unused parameter warning */ if (atoi (change) == 1) { papersize = newpapersize; orient = neworientation; printcmd = newprintcommand; epsoption = newepsoption; oldwhiteout = use_whiteout; oldintlchars = use_intlchars; printscale = gtk_spin_button_get_value_as_float ((GtkSpinButton *) pscale) / 100.; queuename = (char*)gtk_entry_get_text (GTK_ENTRY (prqueue)); strcpy (datadir, gtk_entry_get_text (GTK_ENTRY (defaultdir))); strcpy (datamask, gtk_entry_get_text (GTK_ENTRY (defaultext))); bondlen_new=atof(gtk_entry_get_text (GTK_ENTRY(base_bondlen))); if (bondlen_new != 0 && bondlen_mm != bondlen_new){ size_factor /= bondlen_mm/10.668; bondlen_mm = bondlen_new; size_factor *= bondlen_mm/10.668; } doubledist_new=atoi(gtk_entry_get_text (GTK_ENTRY(doubledist))); if (doubledist_new >= 0 && db_dist != doubledist_new){ db_dist = doubledist_new; mb_dist = (int) ( ((float)db_dist) * 2.5); } } else { gtk_option_menu_set_history (GTK_OPTION_MENU (papermenu), (guint)papersize); gtk_option_menu_set_history (GTK_OPTION_MENU (orientmenu), (guint)orient); gtk_spin_button_set_value ((GtkSpinButton *) pscale, printscale * 100.); gtk_option_menu_set_history (GTK_OPTION_MENU (epsoptionmenu), (guint)epsoption); gtk_option_menu_set_history (GTK_OPTION_MENU (printcmdmenu), (guint)printcmd); gtk_entry_set_text (GTK_ENTRY (prqueue), queuename); gtk_entry_set_text (GTK_ENTRY (defaultdir), datadir); gtk_entry_set_text (GTK_ENTRY (defaultext), datamask); snprintf(tmpstr,10,"%6.4f",bondlen_mm); gtk_entry_set_text (GTK_ENTRY (base_bondlen),tmpstr); snprintf(tmpstr,10,"%d",db_dist); gtk_entry_set_text (GTK_ENTRY (doubledist),tmpstr); if (oldwhiteout != use_whiteout) { /* toggle button triggers immediately, and resetting the button state fires another event, which we use here to actually reset the value */ if (use_whiteout == 1) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(whiteoutbutton),FALSE); else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(whiteoutbutton),TRUE); } if (oldintlchars != use_intlchars) { /* toggle button triggers immediately, and resetting the button state fires another event, which we use here to actually reset the value */ if (use_intlchars == 1) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(intlbutton),FALSE); else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(intlbutton),TRUE); } } } int newpaper (GtkWidget * mainw, gpointer newpaper) { int i; mainw = mainw; /* Avoid gcc unused parameter warning */ for (i = 0; i < 11; i++) { if (!strcmp (newpaper, paper[i])) { newpapersize = i; return TRUE; } } return TRUE; } int neworient (GtkWidget * mainw, gpointer newo) { mainw = mainw; /* Avoid gcc unused parameter warning */ neworientation = atoi (newo); return TRUE; } int newprcmd (GtkWidget * mainw, gpointer newc) { mainw = mainw; /* Avoid gcc unused parameter warning */ newprintcommand = atoi (newc); return TRUE; } int newepsopt (GtkWidget * mainw, gpointer newo) { mainw = mainw; /* Avoid gcc unused parameter warning */ newepsoption = atoi (newo); return TRUE; } int toggle_whiteout (GtkWidget *mainw, gpointer dummy) { mainw = mainw; /* Avoid gcc unused parameter warning */ if (use_whiteout==0) use_whiteout=1; else use_whiteout=0; return TRUE; } int toggle_intlchars (GtkWidget *mainw, gpointer dummy) { mainw = mainw; /* Avoid gcc unused parameter warning */ if (use_intlchars==0) use_intlchars=1; else use_intlchars=0; return TRUE; } static void set_bgcolor (GtkWidget * mainw, GtkColorSelection *colorsel) /* Handle color data provided by the standard GTK color selector widget */ { gdouble thecolor[4]; mainw = mainw; /* Avoid gcc unused parameter warning */ gtk_color_selection_get_color(colorsel,thecolor); bgred=(int)(thecolor[0]*65535); bggreen=(int)(thecolor[1]*65535); bgblue=(int)(thecolor[2]*65535); background.red=(gushort)bgred; background.green=(gushort)bggreen; background.blue=(gushort)bgblue; (void)gdk_color_alloc(gdk_colormap_get_system(),&background); gdk_gc_set_foreground(background_gc,&background); gdk_gc_set_background(background_gc,&background); snprintf(bghexcolor,10,"#%2.2x%2.2x%2.2x",(unsigned char)(bgred/256.),(unsigned char)(bggreen/256.),(unsigned char)(bgblue/256.)); #ifdef GTK2 gtk_label_set_text(GTK_LABEL(GTK_BIN(bgcolorbutton)->child),bghexcolor); #else gtk_label_set_text(GTK_LABEL(GTK_BUTTON(bgcolorbutton)->child),bghexcolor); #endif FreePix(); CreatePix(); Display_Mol(); } #endif static void set_fontsize (GtkWidget *mainw, gpointer newfont) { mainw = mainw; /* Avoid gcc unused parameter warning */ curfontsize=GPOINTER_TO_INT(newfont); } int babelcmd (GtkWidget *mainw, gpointer newc) { /*@ignore@ splint does not recognize strdup */ babel=strdup(newc); /*@end@*/ mainw = mainw; /* Avoid gcc unused parameter warning */ if (loadsave==7){ char expn[512]; int n,i; strcpy(expn,filename); n = (int) strlen (expn); for (i = 0; i < (int) strlen (expn); i++) { if (expn[i] == '.') n = i; if (expn[i] == '/') n = (int) strlen (expn); } expn[n] = '\0'; strcat(expn,"."); strcat(expn,babel); gtk_file_selection_set_filename (GTK_FILE_SELECTION (filew), expn); } return TRUE; } void Set_Textmode (GtkWidget * mainw, GdkEvent * the_event) /* callback to force (left-justified) textmode when the text entry widget acquires the focus in one of the drawing modes. This is necessary to prevent interpretation of the typed text as shortcuts */ { mainw = mainw; /* Avoid gcc unused parameter warning */ if (drawmode != 1) gtk_toggle_button_set_active ((GtkToggleButton *) ltextbutton, (gboolean) TRUE); } void Change_Font (GtkWidget * mainw) { mainw = mainw; /* Avoid gcc unused parameter warning */ if (serif_flag == 0) { serif_flag=1; gtk_widget_set_style(GTK_WIDGET(textlabel),seriffontstyle); } else { serif_flag=0; gtk_widget_set_style(GTK_WIDGET(textlabel),normalfontstyle); } } void Change_Text (GtkWidget * mainw, gpointer textdir) /* callback function for the (left, centered,right) text buttons, sets drawmode to text with appropriate justification mode and handles 'radio button' status of the toolbar line - this is rather messy, as we have to find out which button to deactivate */ { mainw = mainw; /* Avoid gcc unused parameter warning */ if (importflag != 0) return; if (drawmode == 3) { gtk_toggle_button_set_active ((GtkToggleButton *) movebutton, (gboolean) FALSE); } if (drawmode == 4) { gtk_toggle_button_set_active ((GtkToggleButton *) markbutton, (gboolean) FALSE); } if (drawmode == 6) { gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, (gboolean) FALSE); } if (drawmode == 7) { gtk_toggle_button_set_active ((GtkToggleButton *) rescalebutton, (gboolean) FALSE); } if (drawmode == 8) { gtk_toggle_button_set_active ((GtkToggleButton *) splinebutton, (gboolean) FALSE); } if (drawmode == 2) { gtk_toggle_button_set_active ((GtkToggleButton *) bondbutton, (gboolean) FALSE); } if (drawmode == 0) { switch (draw_angle) { case 1: gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, (gboolean) FALSE); break; case 2: gtk_toggle_button_set_active ((GtkToggleButton *) pent1button, (gboolean) FALSE); break; case 3: gtk_toggle_button_set_active ((GtkToggleButton *) pent2button, (gboolean) FALSE); break; case 4: gtk_toggle_button_set_active ((GtkToggleButton *) octbutton, (gboolean) FALSE); break; default: fprintf (stderr, _("invalid angle mode %d\n"), draw_angle); } } if (drawmode == 1) { switch (text_direct) { case 0: gtk_toggle_button_set_active ((GtkToggleButton *) ltextbutton, (gboolean) FALSE); break; case -1: gtk_toggle_button_set_active ((GtkToggleButton *) ctextbutton, (gboolean) FALSE); break; case -2: gtk_toggle_button_set_active ((GtkToggleButton *) rtextbutton, (gboolean) FALSE); break; default: fprintf (stderr, _("invalid text mode %d\n"), text_direct); } } drawmode = 1; text_direct = atoi (textdir); gdk_window_set_cursor (drawing_area->window, cursor_text); } void set_bond (GtkWidget * mainw, gpointer bondnum) { mainw = mainw; /* Avoid gcc unused parameter warning */ curbond = atoi (bondnum); } void Bondmode (GtkWidget * mainw) /* Callback to enter bondtype changing mode - handles 'radio button' status of the toolbar after checking which button to deactivate */ { mainw = mainw; /* Avoid gcc unused parameter warning */ if (importflag != 0) return; if (drawmode == 8) { gtk_toggle_button_set_active ((GtkToggleButton *) splinebutton, (gboolean) FALSE); } if (drawmode == 7) { gtk_toggle_button_set_active ((GtkToggleButton *) rescalebutton, (gboolean) FALSE); } if (drawmode == 6) { gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, (gboolean) FALSE); } if (drawmode == 3) { gtk_toggle_button_set_active ((GtkToggleButton *) movebutton, (gboolean) FALSE); } if (drawmode == 4) { gtk_toggle_button_set_active ((GtkToggleButton *) markbutton, (gboolean) FALSE); } if (drawmode == 0) { switch (draw_angle) { case 1: gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, (gboolean) FALSE); break; case 2: gtk_toggle_button_set_active ((GtkToggleButton *) pent1button, (gboolean) FALSE); break; case 3: gtk_toggle_button_set_active ((GtkToggleButton *) pent2button, (gboolean) FALSE); break; case 4: gtk_toggle_button_set_active ((GtkToggleButton *) octbutton, (gboolean) FALSE); } } if (drawmode == 1) { switch (text_direct) { case 0: gtk_toggle_button_set_active ((GtkToggleButton *) ltextbutton, (gboolean) FALSE); break; case -1: gtk_toggle_button_set_active ((GtkToggleButton *) ctextbutton, (gboolean) FALSE); break; case -2: gtk_toggle_button_set_active ((GtkToggleButton *) rtextbutton, (gboolean) FALSE); } } drawmode = 2; gdk_window_set_cursor (drawing_area->window, cursor_bonds); } void Movemode (GtkWidget * mainw) /* Callback function to enter 'move marked fragment' mode - checks and updates radio button status of the toolbar */ { mainw = mainw; /* Avoid gcc unused parameter warning */ if (importflag != 0) return; if (drawmode == 8) { gtk_toggle_button_set_active ((GtkToggleButton *) splinebutton, (gboolean) FALSE); } if (drawmode == 7) { gtk_toggle_button_set_active ((GtkToggleButton *) rescalebutton, (gboolean) FALSE); } if (drawmode == 6) { gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, (gboolean) FALSE); } if (drawmode == 4) { gtk_toggle_button_set_active ((GtkToggleButton *) markbutton, (gboolean) FALSE); } if (drawmode == 2) { gtk_toggle_button_set_active ((GtkToggleButton *) bondbutton, (gboolean) FALSE); } if (drawmode == 0) { switch (draw_angle) { case 1: gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, (gboolean) FALSE); break; case 2: gtk_toggle_button_set_active ((GtkToggleButton *) pent1button, (gboolean) FALSE); break; case 3: gtk_toggle_button_set_active ((GtkToggleButton *) pent2button, (gboolean) FALSE); break; case 4: gtk_toggle_button_set_active ((GtkToggleButton *) octbutton, (gboolean) FALSE); } } if (drawmode == 1) { switch (text_direct) { case 0: gtk_toggle_button_set_active ((GtkToggleButton *) ltextbutton, (gboolean) FALSE); break; case -1: gtk_toggle_button_set_active ((GtkToggleButton *) ctextbutton, (gboolean) FALSE); break; case -2: gtk_toggle_button_set_active ((GtkToggleButton *) rtextbutton, (gboolean) FALSE); } } drawmode = 3; gdk_window_set_cursor (drawing_area->window, cursor_move); Display_Mol (); } void Markmode (GtkWidget * mainw) /* Callback function to set 'mark fragment' mode, checks and updates radio button state of the toolbar */ { mainw = mainw; /* Avoid gcc unused parameter warning */ if (importflag != 0) return; if (drawmode == 8) { gtk_toggle_button_set_active ((GtkToggleButton *) splinebutton, (gboolean) FALSE); } if (drawmode == 7) { gtk_toggle_button_set_active ((GtkToggleButton *) rescalebutton, (gboolean) FALSE); } if (drawmode == 6) { gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, (gboolean) FALSE); } if (drawmode == 3) { gtk_toggle_button_set_active ((GtkToggleButton *) movebutton, (gboolean) FALSE); } if (drawmode == 2) { gtk_toggle_button_set_active ((GtkToggleButton *) bondbutton, (gboolean) FALSE); } if (drawmode == 0) { switch (draw_angle) { case 1: gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, (gboolean) FALSE); break; case 2: gtk_toggle_button_set_active ((GtkToggleButton *) pent1button, (gboolean) FALSE); break; case 3: gtk_toggle_button_set_active ((GtkToggleButton *) pent2button, (gboolean) FALSE); break; case 4: gtk_toggle_button_set_active ((GtkToggleButton *) octbutton, (gboolean) FALSE); } } if (drawmode == 1) { switch (text_direct) { case 0: gtk_toggle_button_set_active ((GtkToggleButton *) ltextbutton, (gboolean) FALSE); break; case -1: gtk_toggle_button_set_active ((GtkToggleButton *) ctextbutton, (gboolean) FALSE); break; case -2: gtk_toggle_button_set_active ((GtkToggleButton *) rtextbutton, (gboolean) FALSE); } } drawmode = 4; gdk_window_set_cursor (drawing_area->window, cursor_markTLC); } void Rotatemode (GtkWidget * mainw) /* Callback function to set 'rotate marked fragment' mode - checks and updates radio button state of the toolbar */ { mainw = mainw; /* Avoid gcc unused parameter warning */ if (drawmode == 8) { gtk_toggle_button_set_active ((GtkToggleButton *) splinebutton, (gboolean) FALSE); } if (drawmode == 7) { gtk_toggle_button_set_active ((GtkToggleButton *) rescalebutton, (gboolean) FALSE); } if (drawmode == 3) { gtk_toggle_button_set_active ((GtkToggleButton *) movebutton, (gboolean) FALSE); } if (drawmode == 4) { gtk_toggle_button_set_active ((GtkToggleButton *) markbutton, (gboolean) FALSE); } if (drawmode == 2) { gtk_toggle_button_set_active ((GtkToggleButton *) bondbutton, (gboolean) FALSE); } if (drawmode == 0) { switch (draw_angle) { case 1: gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, (gboolean) FALSE); break; case 2: gtk_toggle_button_set_active ((GtkToggleButton *) pent1button, (gboolean) FALSE); break; case 3: gtk_toggle_button_set_active ((GtkToggleButton *) pent2button, (gboolean) FALSE); break; case 4: gtk_toggle_button_set_active ((GtkToggleButton *) octbutton, (gboolean) FALSE); } } if (drawmode == 1) { switch (text_direct) { case 0: gtk_toggle_button_set_active ((GtkToggleButton *) ltextbutton, (gboolean) FALSE); break; case -1: gtk_toggle_button_set_active ((GtkToggleButton *) ctextbutton, (gboolean) FALSE); break; case -2: gtk_toggle_button_set_active ((GtkToggleButton *) rtextbutton, (gboolean) FALSE); } } drawmode = 6; gdk_window_set_cursor (drawing_area->window, cursor_rotate); } void Rescalemode (GtkWidget * mainw) /* Callback function to set 'rescale marked fragment' mode - checks and updates radio button state of the toolbar */ { mainw = mainw; /* Avoid gcc unused parameter warning */ if (importflag != 0) return; if (drawmode == 8) { gtk_toggle_button_set_active ((GtkToggleButton *) splinebutton, (gboolean) FALSE); } if (drawmode == 3) { gtk_toggle_button_set_active ((GtkToggleButton *) movebutton, (gboolean) FALSE); } if (drawmode == 4) { gtk_toggle_button_set_active ((GtkToggleButton *) markbutton, (gboolean) FALSE); } if (drawmode == 2) { gtk_toggle_button_set_active ((GtkToggleButton *) bondbutton, (gboolean) FALSE); } if (drawmode == 6) { gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, (gboolean) FALSE); } if (drawmode == 0) { switch (draw_angle) { case 1: gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, (gboolean) FALSE); break; case 2: gtk_toggle_button_set_active ((GtkToggleButton *) pent1button, (gboolean) FALSE); break; case 3: gtk_toggle_button_set_active ((GtkToggleButton *) pent2button, (gboolean) FALSE); break; case 4: gtk_toggle_button_set_active ((GtkToggleButton *) octbutton, (gboolean) FALSE); } } if (drawmode == 1) { switch (text_direct) { case 0: gtk_toggle_button_set_active ((GtkToggleButton *) ltextbutton, (gboolean) FALSE); break; case -1: gtk_toggle_button_set_active ((GtkToggleButton *) ctextbutton, (gboolean) FALSE); break; case -2: gtk_toggle_button_set_active ((GtkToggleButton *) rtextbutton, (gboolean) FALSE); } } drawmode = 7; gdk_window_set_cursor (drawing_area->window, cursor_rescale); } void Splinemode (GtkWidget * mainw) /* Callback function to set 'rescale marked fragment' mode - checks and updates radio button state of the toolbar */ { mainw = mainw; /* Avoid gcc unused parameter warning */ if (drawmode == 3) { gtk_toggle_button_set_active ((GtkToggleButton *) movebutton, (gboolean) FALSE); } if (drawmode == 4) { gtk_toggle_button_set_active ((GtkToggleButton *) markbutton, (gboolean) FALSE); } if (drawmode == 2) { gtk_toggle_button_set_active ((GtkToggleButton *) bondbutton, (gboolean) FALSE); } if (drawmode == 6) { gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, (gboolean) FALSE); } if (drawmode == 0) { switch (draw_angle) { case 1: gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, (gboolean) FALSE); break; case 2: gtk_toggle_button_set_active ((GtkToggleButton *) pent1button, (gboolean) FALSE); break; case 3: gtk_toggle_button_set_active ((GtkToggleButton *) pent2button, (gboolean) FALSE); break; case 4: gtk_toggle_button_set_active ((GtkToggleButton *) octbutton, (gboolean) FALSE); } } if (drawmode == 1) { switch (text_direct) { case 0: gtk_toggle_button_set_active ((GtkToggleButton *) ltextbutton, (gboolean) FALSE); break; case -1: gtk_toggle_button_set_active ((GtkToggleButton *) ctextbutton, (gboolean) FALSE); break; case -2: gtk_toggle_button_set_active ((GtkToggleButton *) rtextbutton, (gboolean) FALSE); } } drawmode = 8; gdk_window_set_cursor (drawing_area->window, cursor_pencil); } void Change_Angle (GtkWidget * mainw, gpointer newangle) /* Callback function to set 'line drawing' mode and appropriate grid definition - checks and updates radio button state of the toolbar */ { gboolean activate = (gboolean) FALSE; mainw = mainw; /* Avoid gcc unused parameter warning */ if (importflag != 0) return; if (drawmode == 3) { gtk_toggle_button_set_active ((GtkToggleButton *) movebutton, activate); } if (drawmode == 4) { gtk_toggle_button_set_active ((GtkToggleButton *) markbutton, activate); } if (drawmode == 6) { gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, activate); } if (drawmode == 7) { gtk_toggle_button_set_active ((GtkToggleButton *) rescalebutton, activate); } if (drawmode == 8) { gtk_toggle_button_set_active ((GtkToggleButton *) splinebutton, activate); } if (drawmode == 2) { gtk_toggle_button_set_active ((GtkToggleButton *) bondbutton, activate); } if (drawmode == 1) { gtk_toggle_button_set_active ((GtkToggleButton *) ltextbutton, activate); gtk_toggle_button_set_active ((GtkToggleButton *) ctextbutton, activate); gtk_toggle_button_set_active ((GtkToggleButton *) rtextbutton, activate); } drawmode = 0; gdk_window_set_cursor (drawing_area->window, cursor_pencil); switch (draw_angle) { case 1: gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, activate); break; case 2: gtk_toggle_button_set_active ((GtkToggleButton *) pent1button, activate); break; case 3: gtk_toggle_button_set_active ((GtkToggleButton *) pent2button, activate); break; case 4: gtk_toggle_button_set_active ((GtkToggleButton *) octbutton, activate); } draw_angle = atoi (newangle); } void CheckAndLoad () /* Callback function for 'Load' button - pops up an 'are you sure' dialog if unsaved changes exist, else calls real load function directly */ { if (modify == 0 || hp->n + hp->nc + hp->nsp == 0) { Load (); } else { yesnodialog (Load); } } void Load () /* called for loading drawings from file - sets i/o mode to loading and pops up the file selection widget, making it modal */ { loadsave = 1; gtk_window_set_title (GTK_WINDOW (filew), _("Load from file...")); savedpicture = gdk_pixmap_ref(picture); if (preview){ gdk_pixmap_unref (preview); preview=NULL; } preview = gdk_pixmap_new (filew->window, 200, 100, -1); gdk_draw_rectangle (preview, filew->style->white_gc, (gint) TRUE, 0, 0, (gint) 200, (gint) 100); picture = gdk_pixmap_ref(preview); gtk_widget_show (preview_area); gtk_widget_hide (pdbhbox); gtk_widget_hide (sdfhbox); if (babelin>-1) gtk_widget_hide (babelcmdmenu); if (babelout>-1) gtk_widget_hide (babelexpmenu); #ifndef GTK2 strcpy (datadir, gtk_entry_get_text (GTK_ENTRY (defaultdir))); if (datamask!=NULL && (int)strlen (datamask)) gtk_file_selection_complete (GTK_FILE_SELECTION (filew), strcat (datadir, datamask)); else gtk_file_selection_complete (GTK_FILE_SELECTION (filew), strcat (datadir, "*")); #endif gtk_widget_show (filew); gtk_window_set_modal (GTK_WINDOW (filew), (gboolean) TRUE); } void Import () /* called for loading ISIS drawings from file - sets i/o mode to loading and pops up the file selection widget, making it modal */ { #if (GTK_MINOR_VERSION >2) GtkFileFilter *mdlfilter; #endif loadsave = 4; savedpicture = gdk_pixmap_ref(picture); gtk_window_set_title (GTK_WINDOW (filew), _("Import MDL file...")); if (preview) { gdk_pixmap_unref (preview); preview=NULL; } preview = gdk_pixmap_new (filew->window, 200, 100, -1); gdk_draw_rectangle (preview, filew->style->white_gc, (gint)TRUE, 0, 0, (gint)200, (gint)100); picture = gdk_pixmap_ref(preview); gtk_widget_show (preview_area); gtk_widget_hide (pdbhbox); gtk_widget_show (sdfhbox); if (babelin >-1) gtk_widget_hide (babelcmdmenu); if (babelout>-1) gtk_widget_hide (babelexpmenu); #ifndef GTK2 strcpy (datadir, gtk_entry_get_text (GTK_ENTRY (defaultdir))); #endif #if (GTK_MINOR_VERSION >2) mdlfilter = gtk_file_filter_new(); gtk_file_filter_add_pattern(mdlfilter,"*.mol"); gtk_file_filter_add_pattern(mdlfilter,"*.mdl"); gtk_file_filter_add_pattern(mdlfilter,"*.MOL"); gtk_file_filter_add_pattern(mdlfilter,"*.MDL"); gtk_file_filter_add_pattern(mdlfilter,"*.sdf"); gtk_file_filter_add_pattern(mdlfilter,"*.SDF"); #else gtk_file_selection_complete (GTK_FILE_SELECTION (filew), strcat (datadir, "*.mol,*.mdl,*.sdf")); #endif gtk_widget_show (filew); gtk_window_set_modal (GTK_WINDOW (filew), (gboolean) TRUE); } void Import_Babel () /* called for BABEL-based import of foreign files - sets i/o mode and pops up the file selection widget, making it modal */ { loadsave = 6; savedpicture = gdk_pixmap_ref(picture); gtk_window_set_title (GTK_WINDOW (filew), _("Import via BABEL...")); gtk_widget_hide (preview_area); gtk_widget_hide (pdbhbox); gtk_widget_hide (sdfhbox); gtk_widget_hide (babelexpmenu); gtk_widget_show (babelcmdmenu); #ifndef GTK2 strcpy (datadir, gtk_entry_get_text (GTK_ENTRY (defaultdir))); gtk_file_selection_complete (GTK_FILE_SELECTION (filew), strcat (datadir, "*")); #endif gtk_widget_show (filew); gtk_window_set_modal (GTK_WINDOW (filew), (gboolean) TRUE); } void Export_Babel () /* called for BABEL-based export of foreign files - sets i/o mode and pops up the file selection widget, making it modal */ { loadsave = 7; savedpicture = gdk_pixmap_ref(picture); gtk_window_set_title (GTK_WINDOW (filew), _("Export via BABEL...")); gtk_widget_hide (preview_area); gtk_widget_hide (pdbhbox); gtk_widget_hide (sdfhbox); gtk_widget_hide (babelcmdmenu); gtk_widget_show (babelexpmenu); #ifndef GTK2 strcpy (datadir, gtk_entry_get_text (GTK_ENTRY (defaultdir))); gtk_file_selection_complete (GTK_FILE_SELECTION (filew), strcat (datadir, "*")); #endif gtk_widget_show (filew); gtk_window_set_modal (GTK_WINDOW (filew), (gboolean) TRUE); } void Import_PDB () /* called for loading drawings from file - sets i/o mode to loading and pops up the file selection widget, making it modal */ { loadsave = 5; savedpicture = gdk_pixmap_ref(picture); gtk_window_set_title (GTK_WINDOW (filew), _("Import PDB file...")); gtk_widget_hide (preview_area); if (babelin >-1) gtk_widget_hide (babelcmdmenu); if (babelout>-1) gtk_widget_hide (babelexpmenu); gtk_widget_show (pdbhbox); gtk_widget_hide (sdfhbox); #ifndef GTK2 strcpy (datadir, gtk_entry_get_text (GTK_ENTRY (defaultdir))); gtk_file_selection_complete (GTK_FILE_SELECTION (filew), strcat (datadir, "*.pdb,*.ent")); #endif gtk_widget_show (filew); gtk_window_set_modal (GTK_WINDOW (filew), (gboolean) TRUE); } void Add () /* called for inserting drawings at the currently marked position - sets i/o mode to adding and pops up the (modal) file selection dialog */ { if (addflag == 0) { refx = hp->tx; refy = hp->ty; } loadsave = 3; if(picture != NULL)savedpicture = gdk_pixmap_ref(picture); if (preview != NULL)picture = gdk_pixmap_ref(preview); if (picture) { gdk_pixmap_unref (picture); picture=NULL; } picture = gdk_pixmap_new (filew->window, 200, 100, -1); gdk_draw_rectangle (picture, filew->style->white_gc, (gint) TRUE, 0, 0, (gint) 200, (gint) 100); gtk_widget_show (preview_area); gtk_widget_hide (pdbhbox); gtk_widget_hide (sdfhbox); if (babelin >-1) gtk_widget_hide (babelcmdmenu); if (babelout>-1) gtk_widget_hide (babelexpmenu); gtk_window_set_title (GTK_WINDOW (filew), _("Add from file...")); #ifndef GTK2 strcpy (datadir, gtk_entry_get_text (GTK_ENTRY (defaultdir))); if (datamask!=NULL && (int)strlen (datamask)) gtk_file_selection_complete (GTK_FILE_SELECTION (filew), strcat (datadir, datamask)); else gtk_file_selection_complete (GTK_FILE_SELECTION (filew), strcat (datadir, "*")); #endif gtk_widget_show (filew); gtk_window_set_modal (GTK_WINDOW (filew), (gboolean) TRUE); } void show_or_raise (GtkWidget * thewidget) { if (!GTK_WIDGET_MAPPED (thewidget)) gtk_widget_show (thewidget); else gdk_window_raise (thewidget->window); } void Add_template (GtkWidget * mainw, gpointer template) { int i, j, n; int xdiff, ydiff; int x, y, tx, ty, b; int x1, y1, x2, y2; if (addflag == 0) { refx = hp->tx; refy = hp->ty; } Unmark_all(); xdiff = 0; ydiff = 0; xref = 0; yref = 0; i = GPOINTER_TO_INT(template) / 10; j = GPOINTER_TO_INT(template) - i * 10; if (template_refx[i][j] != 0 && template_refy[i][j]!=0) { xdiff = refx - template_refx[i][j]; ydiff = refy - template_refy[i][j]; } for (n = 0; n < template_nb[i][j]; n++) { x = template_x[i][j][n]; y = template_y[i][j][n]; tx = template_tx[i][j][n]; ty = template_ty[i][j][n]; b = template_b[i][j][n]; x = x + xdiff; y = y + ydiff; tx = tx + xdiff; ty = ty + ydiff; if (GPOINTER_TO_INT(template) <175) /* templates beyond the 4th page are decoration */ add_struct (x, y, tx, ty, b, 1, 1, 0,curpen); else add_struct (x, y, tx, ty, b, 1, 1, 1,curpen); } for (n = 0; n < template_nl[i][j]; n++) { x = template_lx[i][j][n] + xdiff; y = template_ly[i][j][n] + ydiff; add_char (x, y, template_lt[i][j][n], template_lo[i][j][n], 1,curpen,0,curfontsize); } for (n = 0; n < template_ncrv[i][j]; n++) { x = template_crv[i][j][n][0] + xdiff; y = template_crv[i][j][n][1] + ydiff; x1 = template_crv[i][j][n][2] + xdiff; y1 = template_crv[i][j][n][3] + ydiff; x2 = template_crv[i][j][n][4] + xdiff; y2 = template_crv[i][j][n][5] + ydiff; tx = template_crv[i][j][n][6] + xdiff; ty = template_crv[i][j][n][7] + ydiff; b = template_crv[i][j][n][8]; add_spline (x, y, x1, y1, x2, y2, tx, ty, b, 1,curpen); } #ifdef LIBUNDO undo_snapshot (); #endif mark.flag = 1; mark.x = refx; mark.y = refy; mark.w = 200; mark.h = 200; Movemode (mainw); gtk_toggle_button_set_active ((GtkToggleButton *) movebutton, (gboolean) TRUE); CreatePix (); Display_Mol (); } void SaveAs () /* Callback for saving a drawing to file - sets i/o mode to saving and pops up the (modal) file selection dialog with the current filename as the default */ { if (hp->n + hp->nc + hp->nsp == 0) return; loadsave = 2; savedpicture = gdk_pixmap_ref(picture); if (filename != NULL) gtk_file_selection_set_filename (GTK_FILE_SELECTION (filew), filename); gtk_window_set_title (GTK_WINDOW (filew), _("Save as...")); gtk_widget_hide (preview_area); gtk_widget_hide (pdbhbox); gtk_widget_hide (sdfhbox); if (babelin >-1) gtk_widget_hide (babelcmdmenu); if (babelout>-1) gtk_widget_hide (babelexpmenu); gtk_widget_show (filew); gtk_window_set_modal (GTK_WINDOW (filew), (gboolean) TRUE); } void Save () /* Callback for saving drawing to file - uses current filename */ { int error; char errtext[255]; if (hp->n + hp->nc + hp->nsp == 0) { snprintf(errtext,255,_("\nNothing to save") ); #ifdef GTK2 gtk_text_buffer_insert(msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value(msgadjustment, gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext, (gint) strlen (errtext)); #endif return; } if (strcmp (filename, _("unnamed")) != 0) { { FILE *fp; if ((fp = fopen (filename, "w")) == NULL) error = 1; else { error = save_mol (fp, 0); if (!error) fclose (fp); } } if (error != 0) { snprintf (errtext,255, _("\nWriting to %s failed !"), filename); } else { snprintf (errtext,255, _("\nDrawing saved in %s (%d bonds, %d labels)"), filename, hp->n, hp->nc); modify = 0; } #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value (msgadjustment, gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext, (gint) strlen (errtext)); #endif } else SaveAs (); return; } void Export () /* Callback for exporting a drawing to file - pops up the (modal) file selection dialog with the current filename as the default */ { char expn[512]; char *exten[10] = { ".fig", ".tex", ".eps", ".xbm", ".svg", ".mol",".emf",".sxd",".png",".asy"}; int i, n; if (hp->n + hp->nc + hp->nsp == 0) return; strcpy (expn, filename); n = (int) strlen (expn); for (i = 0; i < (int) strlen (expn); i++) { if (expn[i] == '.') n = i; if (expn[i] == '/') n = (int) strlen (expn); } expn[n] = '\0'; strcat (expn, exten[expmode]); gtk_file_selection_set_filename (GTK_FILE_SELECTION (expw), expn); gtk_widget_show (expw); gtk_window_set_modal (GTK_WINDOW (filew), (gboolean) TRUE); } void do_export (GtkWidget * mainw, GtkFileSelection * exp) /* initiates export of current drawing to the foreign format selected via the export popup - pops down export dialog, calls appropriate function and displays messagebox with file statistics or error message afterwards */ { struct stat stbuf; mainw = mainw; /* Avoid gcc unused parameter warning */ gtk_widget_hide (expw); if (hp->n + hp->nc + hp->nsp == 0) return; strcpy (expname, gtk_file_selection_get_filename (GTK_FILE_SELECTION (exp))); if (stat (expname, &stbuf) == 0) yesnodialog2 (really_export, expname); else really_export (); } void really_export () { size_t msglen = 255; float expscale; int error = 0; char errtext[255]; FILE *fp; expscale = gtk_spin_button_get_value_as_int ((GtkSpinButton *) scale) / 100.; switch (expmode) { case 0: error = export_xfig (expname); break; case 1: error = export_latex_pic (expname, expscale); break; case 2: error = export_ps_pic (expname, expscale); break; case 3: /* xbm output is slow - set 'busy' watch-shaped cursor */ /* gdk_window_set_cursor (drawing_area->window, cursor_busy);*/ /* while (g_main_iteration (FALSE));*/ /* allow gtk to redraw after the popup, which may have obscured parts of our molecule */ if (mark.flag == 1) { xbmflag = 1; FreePix (); CreatePix (); Display_Mol (); } error = export_bitmap (expname); if (mark.flag == 1) { xbmflag = 0; FreePix (); CreatePix (); Display_Mol (); } /* gdk_window_set_cursor (drawing_area->window, previous_cursor);*/ break; case 4: error = export_svg (expname); break; case 5: if (!(fp = fopen (expname,"w"))) { error = 1; break; } error = export_mdl_mol (fp,0); break; case 6: #ifdef EMF error = export_emf (expname); #else if (figversion >= 3) error = export_emf (expname); #endif break; case 7: error = export_sxd (expname); break; case 8: error = export_png_pic (expname, expscale); break; case 9: error = export_asy (expname); break; } if (error != 0) { snprintf (errtext, msglen, _("Writing to\n %s\nfailed !\n"), expname); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); } else { snprintf (errtext, msglen, _("\nDrawing exported as %s (%d bonds, %d labels)"), expname, hp->n, hp->nc); #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value (msgadjustment, gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext, (gint) strlen (errtext)); #endif } } void exp_mode (GtkWidget * mainw, gpointer mode) /* callback function to set export format selected in the export dialog */ { char expn[255]; char *exten[10] = { ".fig", ".tex", ".eps", ".xbm", ".svg", ".mol", ".emf", ".sxd", ".png", ".asy" }; int i, n; mainw = mainw; /* Avoid gcc unused parameter warning */ strcpy (expn, gtk_file_selection_get_filename (GTK_FILE_SELECTION (expw))); n = (int) strlen (expn); for (i = 0; i < (int) strlen (expn); i++) { if (expn[i] == '.') n = i; if (expn[i] == '/') n = (int) strlen (expn); } expn[n] = '\0'; expmode = atoi (mode); if (expmode < 0 || expmode > 9) expmode = 0; strcat (expn, exten[expmode]); gtk_file_selection_set_filename (GTK_FILE_SELECTION (expw), expn); } void pdb_mode (GtkWidget * mainw, gpointer mode) /* callback function to set pdb label handling */ { mainw = mainw; /* Avoid gcc unused parameter warning */ pdbmode = atoi (mode); if (pdbmode < 0 || pdbmode > 4) pdbmode = 0; } void sdf_mode (GtkWidget * mainw, gpointer mode) /* callback function to set current sdf index and update preview */ { char myfile[255]; char labeltext[40]; mainw = mainw; /* Avoid gcc unused parameter warning */ switch ( atoi (mode)) { case 0: default: sdfindex=0; break; case 1: sdfindex--; if (sdfindex <0 ) sdfindex = 0; break; case 2: sdfindex++; break; } if (picture) { gdk_pixmap_unref (picture); picture = NULL; } picture = gdk_pixmap_new (filew->window, 200, 100, -1); gdk_draw_rectangle (picture, filew->style->white_gc, (gint)TRUE, 0, 0, (gint)200, (gint)100); strcpy (myfile, gtk_file_selection_get_filename (GTK_FILE_SELECTION(filew))); preview_mdl_mol (myfile, sdfindex); snprintf (labeltext,39,_("SDF entry: %d"),sdfindex+1); gtk_label_set_text(GTK_LABEL(sdflabel),labeltext); } int CheckAndQuit () /* Callback function for the Quit button - pops up an 'are you sure' dialog if unsaved changes exist, or calls the real quit function directly */ { if (modify == 0 || hp->n + hp->nc + hp->nsp == 0) { Quit (); return ((int) FALSE); } else { yesnodialog (Quit); return ((int) TRUE); } } void Quit () /* close down gtk function processing and terminate program */ { gtk_main_quit (); } void file_ok_sel (GtkWidget * mainw, GtkFileSelection * fs) /* callback function for the Ok button of the file selection dialog - pops down the file dialog, gets the name of the selected file, initiates load or save operations as defined by the current i/o mode and displays error message dialog if necessary */ { int error; char errtext[255]; char oldname[512]; char *tempstr; struct stat stbuf; gtk_widget_hide (filew); gtk_grab_remove (filew); picture = gdk_pixmap_ref(savedpicture); strcpy (oldname, filename); strcpy (filename, gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); if (datadir == NULL || (int)strlen (datadir) == 0) { tempstr = strrchr (filename, '/'); strncpy (datadir, filename, strlen (filename) - strlen (tempstr) + 1); #if (GTK_MINOR_VERSION >2) gtk_entry_set_text (GTK_ENTRY (datadir_entry), datadir); #else gtk_entry_set_text (GTK_ENTRY (defaultdir), datadir); #endif } switch (loadsave) { case 1: error = load_mol (filename); switch (error) { case 0: modify = 0; mark.flag = 0; snprintf (errtext,255, "Chemtool %s (%s)", VERSION, filename); gtk_window_set_title (GTK_WINDOW (window), errtext); #ifdef LIBUNDO undo_snapshot (); #endif break; case 1: snprintf (errtext,255, _("Unable to open %s\n"), filename); strcpy (filename, oldname); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); break; case 2: snprintf (errtext,255, _("%s\n does not appear to be a Chemtool file\n"), filename); strcpy (filename, oldname); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); break; case 3: modify = 0; snprintf (errtext,255, _("%s was created by a newer version.\nSome features may be lost.\n"), filename); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); snprintf (errtext,255, "Chemtool %s (%s)", VERSION, filename); gtk_window_set_title (GTK_WINDOW (window), errtext); #ifdef LIBUNDO undo_snapshot (); #endif break; default: clear_data (); snprintf (errtext,255, _("Error loading %s \n"), filename); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); } CreatePix (); Display_Mol (); break; case 2: if (datamask!=NULL && (int)strlen (datamask)) { tempstr = strrchr (filename,'.'); if (!tempstr || strcmp(tempstr,datamask)) { strcat (filename,"."); strcat (filename,datamask); } } if (stat (filename, &stbuf) == 0) yesnodialog2 (reallysave, filename); else reallysave (); break; case 3: error = add_mol (filename); strcpy (filename, oldname); Movemode (mainw); gtk_toggle_button_set_active ((GtkToggleButton *) movebutton, (gboolean) TRUE); CreatePix (); Display_Mol (); break; case 4: error = import_mdl_mol (filename,sdfindex); switch (error) { case 0: modify = 0; if (strrchr (filename, '.') && strrchr (filename, '.') > strrchr (filename, '/')) filename[(int) (strrchr (filename, '.') - filename)] = '\0'; snprintf (errtext,255, "Chemtool %s (%s)", VERSION, filename); gtk_window_set_title (GTK_WINDOW (window), errtext); #ifdef LIBUNDO undo_snapshot (); #endif snprintf (errtext,255, _("\nChoose orientation (Ctrl-Mouse1 for z), press Enter when done")); #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value(msgadjustment, gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext, (gint)strlen (errtext)); #endif gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, TRUE); break; case 1: snprintf (errtext,255, _("Unable to open %s\n"), filename); strcpy (filename, oldname); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); break; case 2: snprintf (errtext,255, _("Problems converting %s\n"), filename); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); break; } break; case 5: error = import_pdb (filename); switch (error) { case 0: modify = 0; if (strrchr (filename, '.') && strrchr (filename, '.') > strrchr (filename, '/')) filename[(int) (strrchr (filename, '.') - filename)] = '\0'; snprintf (errtext, 255, "Chemtool %s (%s)", VERSION, filename); gtk_window_set_title (GTK_WINDOW (window), errtext); #ifdef LIBUNDO undo_snapshot (); #endif snprintf (errtext,255, _("\nChoose orientation (Ctrl-Mouse1 for z), press Enter when done")); #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value(msgadjustment, gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext, (gint)strlen (errtext)); #endif gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, TRUE); break; case 1: snprintf (errtext,255, _("Unable to open %s\n"), filename); strcpy (filename, oldname); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); break; } break; case 6: error = import_babel (filename); switch (error) { case 0: modify = 0; if (strrchr (filename, '.') && strrchr (filename, '.') > strrchr (filename, '/')) filename[(int) (strrchr (filename, '.') - filename)] = '\0'; snprintf (errtext,255, "Chemtool %s (%s)", VERSION, filename); gtk_window_set_title (GTK_WINDOW (window), errtext); #ifdef LIBUNDO undo_snapshot (); #endif snprintf (errtext,255, _ ("\nChoose orientation (Ctrl-Mouse1 for z), press Enter when done")); #ifdef GTK2 gtk_text_buffer_insert (msgtextbuffer, &iter, errtext, -1); gtk_adjustment_set_value(msgadjustment, gtk_adjustment_get_value(msgadjustment)+12.); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, errtext, (gint)strlen (errtext)); #endif gtk_toggle_button_set_active ((GtkToggleButton *) rotatebutton, TRUE); break; case 1: snprintf (errtext,255, _("Unable to open %s\n"), filename); strcpy (filename, oldname); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); break; case 2: snprintf (errtext,255, _("Problems converting %s\n"), filename); gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); break; } break; case 7: error = export_babel(filename); default: break; } } void reallysave () { int error; char errtext[255]; FILE *fp; if ((fp = fopen (filename, "w")) == NULL) error = 1; else { error = save_mol (fp, 0); if (!error) fclose (fp); } if (error != 0) { snprintf (errtext,255, _("Writing to\n %s\nfailed !\n"), filename); } else { snprintf (errtext,255, _("Drawing saved in\n %s\n (%d bonds, %d labels)\n"), filename, hp->n, hp->nc); modify = 0; } gtk_label_set_text (GTK_LABEL (message), errtext); gtk_widget_show (messagew); gtk_grab_add (messagew); snprintf (errtext,255, "Chemtool %s (%s)", VERSION, filename); gtk_window_set_title (GTK_WINDOW (window), errtext); } int main (int argc, char **argv) /* Main program - initializes widgets and data structures */ { int i, j; int tmplnum[125]; int error; char bondnums[BONDTYPES][3]; char bondcolors [BONDCOLORS][4]; char msgtmp[100]; const char *fontsizelabel[7]={"8","10","12","14","17","20","24"}; GtkWidget *aboutw,*helpw,*helptext; GtkWidget *vbox; GtkWidget *hbox; GtkWidget *button; GtkWidget *expbutton[10]; GtkWidget *tbutton[125]; #ifdef MENU GtkAccelGroup *accel_group; GtkWidget *menu_bar; GtkWidget *file, *file_menu; GtkWidget *new, *open, *add, *import, *imppdb, *impany,*export, *expany, *printps, *save, *saveas, *quit; GtkWidget *edit, *edit_menu; GtkWidget *print_setup, *save_setup; GtkWidget *copy, *fliph, *flipv; #ifdef LIBUNDO GtkWidget *undo, *redo; #endif GtkWidget *view, *view_menu; GtkWidget *zoomin, *zoomout, *center,*grid; GtkWidget *tools, *tools_menu; GtkWidget *templatem, *cht, *clean; GtkWidget *help, *help_menu; GtkWidget *about,*using; #else GtkWidget *loadbutton, *savebutton, *importbutton, *imppdbbutton, *exportbutton, *printbutton, *zoominbutton; GtkWidget *psetupbutton, *savesetupbutton; GtkWidget *centerbutton, *zoomoutbutton, *clearbutton, *fwbutton, *quitbutton, *aboutbutton; #endif GtkWidget *label; GdkPixmap *pixmap; GtkWidget *pixmapwid; GtkAdjustment *adj_scale; GSList *group; GtkStyle *style; GtkTooltips *tooltips, *temptips; GtkWidget *templatebook, *page, *tvbox, *pbox; GtkWidget *vscroll,*textscroll; #if (GTK_MINOR_VERSION <4) GtkAdjustment *adj_pscale; GtkWidget *printer_dialog, *papersizeitem[11], *orientationitem, *printcmditem; GtkWidget *epsoptitem; GtkWidget *pokbutton, *pcabutton; #endif GtkWidget *fontsizeitem[7]; GtkWidget *babelcmditem,*babelexpcmditem; GdkColor black={0,0x0000,0x0000,0x0000},blue={0,0x0000,0x0000,0xe000}, green={0,0x0000,0xd000,0x0000},cyan={0,0,0xffff,0xffff}, red={0,0xffff,0x0000,0x0000},magenta={0,0xffff,0x0000,0xffff}, yellow={0,0xffff,0xffff,0x0000},white={0,0xffff,0xffff,0xffff}; #ifdef GTK2 GtkTextBuffer *helptextbuffer; GtkTextIter ht_iter; #endif char *helpmessage = _("Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n\n" "For drawing labels, write them into the text box in the top right of the window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de"); #ifdef ENABLE_NLS (void) gtk_set_locale (); /* newer glibc requires this */ /* but we have to guard against locales that use a comma in numbers */ (void) setlocale (LC_NUMERIC, "C"); /*@ignore@*/ (void) bindtextdomain ("chemtool", LOCALEDIR); /*@end@*/ #ifdef GTK2 bind_textdomain_codeset ("chemtool", "UTF-8"); (void) setlocale (LC_NUMERIC, "C"); #endif (void) textdomain ("chemtool"); #endif #ifdef LIBUNDO undo_new ("chemtool"); undo_set_memory_limit (65536); #endif setup_data (); /*initialize chemtool structs */ #ifdef LIBUNDO undo_snapshot (); #endif check_fig2dev (); check_fig2sxd(); if ( (strstr(argv[0],"chemtoolbg") && argc <3) || (argc==2 && !strcmp(argv[1],"-bg"))) { fprintf(stderr,"Usage: chemtoolbg [outtype] [infile]\n"); fprintf(stderr," available outtypes: fig tex eps xbm svg mol emf sxd png asy\n"); fprintf(stderr," Use \"-\" instead of infile in pipes, e.g. someprogram|chemtoolbg svg -\n\n"); exit (1); } if (strstr(argv[0],"chemtoolbg") || (argc>1 && !strcmp(argv[1],"-bg"))) { char *mode[10] = { "fig", "tex", "eps", "xbm", "svg", "mol","emf","sxd","png","asy"}; int shift=0; static int k; if (!strcmp(argv[1],"-bg")) shift = 1; batchmode = 1; mark.flag = False; head.width = 2000; head.height = 5000; zoom_factor = 2; size_factor = 0.8; pdbx = pdby = pdbz = NULL; atcode = NULL; atjust = bondtype = NULL; bondfrom = bondto = NULL; hp->x = hp->y = 200; hp->tx = hp->ty = 200; tmpx=(int*)NULL; tmpy=(int*)NULL; gridtype=0; gridx=gridy = 0; atnum = 0; queuename = malloc (33 * sizeof (char)); bgred=bgblue=bggreen=65535; readrc(); Load_Font(); k=2+shift; if (k>=argc) exit(1); strcpy (filename, argv[k]); load_mol(filename); head.pix_width = 1600; head.pix_height = 1600; strcpy(expname,filename); if (!strcmp(expname,"-")) strcpy(expname,"chemtool"); fprintf(stderr,"chemtoolbg %s...\n",expname); char *dot=strrchr(expname,'.'); if (dot) *dot='\0'; j=-1; k=1+shift; if (k>=argc) exit(1); fprintf(stderr,"chemtoolbg mode %s...\n",argv[k]); for (i=0;i<10;i++) { if (!strcmp(mode[i],argv[k])) { j=i; break; } } if (j<0) exit(1); strcat (expname,"."); strcat (expname, mode[j]); fprintf(stderr,"chemtoolbg %s...\n",expname); gtk_init (&argc, &argv); /*initialize GTK environment */ switch(j) { case 0: drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 1600, 1600); export_xfig(expname); break; case 1: drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 1600, 1600); export_latex_pic(expname,1.); break; case 2: drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 1600, 1600); snprintf(bghexcolor,10,"#%2.2x%2.2x%2.2x",(unsigned char)(bgred/256.),(unsigned char)(bggreen/256.),(unsigned char)(bgblue/256.)); export_ps_pic(expname,1.); break; case 3: break; case 4: snprintf(bghexcolor,10,"#%2.2x%2.2x%2.2x",(unsigned char)(bgred/256.),(unsigned char)(bggreen/256.),(unsigned char)(bgblue/256.)); export_svg(expname); break; case 5: break; case 6: #ifndef EMF drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 1600, 1600); if (figversion>=3) #endif export_emf(expname); break; case 7: drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 1600, 1600); if (have_fig2sxd) export_sxd(expname); break; case 8: drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 1600, 1600); snprintf(bghexcolor,10,"#%2.2x%2.2x%2.2x",(unsigned char)(bgred/256.),(unsigned char)(bggreen/256.),(unsigned char)(bgblue/256.)); export_png_pic(expname,1.); break; case 9: drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 1600, 1600); snprintf(bghexcolor,10,"#%2.2x%2.2x%2.2x",(unsigned char)(bgred/256.),(unsigned char)(bggreen/256.),(unsigned char)(bgblue/256.)); export_asy(expname); break; default: break; } exit(0); } gtk_init (&argc, &argv); /*initialize GTK environment */ /* * Create the 'About' pop-up */ aboutw = gtk_dialog_new (); label = gtk_label_new (_ (" Chemtool Version 1.6.14\nby\nMartin Kroeker,\nRadek Liboska,\nMichael Banck\nand\nThomas Volk\n\nhttp://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html")); #ifdef GTK2 gtk_label_set_justify(GTK_LABEL(label),GTK_JUSTIFY_CENTER); #endif gtk_box_pack_start (GTK_BOX (GTK_DIALOG (aboutw)->vbox), label, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (label); button = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (aboutw)->action_area), button, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_hide), GTK_OBJECT (aboutw)); (void)gtk_signal_connect_object (GTK_OBJECT (aboutw), "delete_event", GTK_SIGNAL_FUNC (gtk_widget_hide), GTK_OBJECT (aboutw)); gtk_widget_show (button); helpw = gtk_dialog_new(); gtk_widget_set_usize(helpw,480,500); textscroll=gtk_scrolled_window_new(NULL,NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(textscroll), GTK_POLICY_NEVER,GTK_POLICY_ALWAYS); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (helpw)->vbox), textscroll, (gboolean) TRUE, (gboolean) TRUE, 0); #ifdef GTK2 helptext = gtk_text_view_new(); gtk_text_view_set_editable(GTK_TEXT_VIEW(helptext), FALSE); helptextbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(helptext)); gtk_text_buffer_get_iter_at_offset (helptextbuffer, &ht_iter, 0); #ifndef ENABLE_NLS gtk_text_buffer_insert (helptextbuffer, &ht_iter, helpmessage,-1); #else gtk_text_buffer_insert (helptextbuffer, &ht_iter, gettext(helpmessage),-1); #endif #else helptext = gtk_text_new(NULL,NULL); gtk_text_set_editable(GTK_TEXT(helptext), FALSE); gtk_text_freeze(GTK_TEXT(helptext)); #ifndef ENABLE_NLS gtk_text_insert(GTK_TEXT(helptext),NULL,NULL,NULL,helpmessage,(gint)strlen(helpmessage)); #else gtk_text_insert(GTK_TEXT(helptext),NULL,NULL,NULL,gettext(helpmessage),(gint)strlen(gettext(helpmessage))); #endif #endif gtk_widget_show(textscroll); gtk_container_add(GTK_CONTAINER(textscroll),helptext); button = gtk_button_new_with_label ("Ok"); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (helpw)->action_area), button, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_hide), GTK_OBJECT (helpw)); (void)gtk_signal_connect_object (GTK_OBJECT (helpw), "delete_event", GTK_SIGNAL_FUNC (gtk_widget_hide), GTK_OBJECT (helpw)); gtk_widget_show (button); gtk_widget_show (helptext); gtk_widget_realize(helpw); /* * Build the file selection pop-up */ filew = gtk_file_selection_new ("File selection"); (void)gtk_signal_connect (GTK_OBJECT (filew), "delete_event", (GtkSignalFunc) gtk_grab_remove, GTK_OBJECT (filew)); (void)gtk_signal_connect (GTK_OBJECT (filew), "delete_event", (GtkSignalFunc) gtk_widget_hide, GTK_OBJECT (filew)); (void)gtk_signal_connect (GTK_OBJECT (filew), "delete_event", restore_picture, NULL); (void)gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), "clicked", (GtkSignalFunc) file_ok_sel, filew); (void)gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), "clicked", (GtkSignalFunc) gtk_grab_remove, GTK_OBJECT (filew)); (void)gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), "clicked", restore_picture, NULL); (void)gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), "clicked", (GtkSignalFunc) gtk_widget_hide, GTK_OBJECT (filew)); #ifdef GTK2 (void)gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->file_list), "cursor_changed", (GtkSignalFunc) getpreview, (gpointer) filew); #else (void)gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->file_list), "select_row", (GtkSignalFunc) getpreview, (gpointer) filew); #endif preview_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (preview_area), 200, 100); gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (filew)->action_area), preview_area, (gboolean) TRUE, (gboolean) FALSE, 0); gtk_widget_show (preview_area); /* Signals used to handle backing pixmap */ (void)gtk_signal_connect (GTK_OBJECT (preview_area), "expose_event", (GtkSignalFunc) expose_event, NULL); (void)gtk_signal_connect (GTK_OBJECT (preview_area), "configure_event", (GtkSignalFunc) configure_preview, NULL); pdbhbox = gtk_hbox_new ((gboolean) FALSE, 0); label = gtk_label_new (_("PDB labels:")); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (pdbhbox), label, TRUE, TRUE, 0); labbutton[0] = gtk_radio_button_new_with_label (NULL, _("All")); gtk_box_pack_start (GTK_BOX (pdbhbox), labbutton[0], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (labbutton[0]), "clicked", GTK_SIGNAL_FUNC (pdb_mode), "0"); gtk_widget_show (labbutton[0]); group = gtk_radio_button_group (GTK_RADIO_BUTTON (labbutton[0])); labbutton[1] = gtk_radio_button_new_with_label (group, _("non-H")); gtk_box_pack_start (GTK_BOX (pdbhbox), labbutton[1], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (labbutton[1]), "clicked", GTK_SIGNAL_FUNC (pdb_mode), "1"); gtk_widget_show (labbutton[1]); labbutton[2] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (labbutton[0])), _("no numbers")); gtk_box_pack_start (GTK_BOX (pdbhbox), labbutton[2], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (labbutton[2]), "clicked", GTK_SIGNAL_FUNC (pdb_mode), "2"); gtk_widget_show (labbutton[2]); labbutton[3] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (labbutton[0])), _("non H,no numbers")); (void)gtk_signal_connect (GTK_OBJECT (labbutton[3]), "clicked", GTK_SIGNAL_FUNC (pdb_mode), "3"); gtk_box_pack_start (GTK_BOX (pdbhbox), labbutton[3], (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (labbutton[3]); labbutton[4] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (labbutton[0])), _("None")); gtk_box_pack_start (GTK_BOX (pdbhbox), labbutton[4], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (labbutton[4]), "clicked", GTK_SIGNAL_FUNC (pdb_mode), "4"); gtk_widget_show (labbutton[4]); gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (filew)->main_vbox), pdbhbox, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (pdbhbox); sdfhbox = gtk_hbox_new ((gboolean) FALSE, 0); sdflabel = gtk_label_new (_("SDF entry:")); gtk_widget_show (sdflabel); gtk_box_pack_start (GTK_BOX (sdfhbox), sdflabel, TRUE, TRUE, 0); sdfbutton[0] = gtk_button_new_with_label (_("First")); gtk_box_pack_start (GTK_BOX (sdfhbox), sdfbutton[0], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (sdfbutton[0]), "clicked", GTK_SIGNAL_FUNC (sdf_mode), "0"); gtk_widget_show (sdfbutton[0]); sdfbutton[1] = gtk_button_new_with_label (_("Previous")); gtk_box_pack_start (GTK_BOX (sdfhbox), sdfbutton[1], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (sdfbutton[1]), "clicked", GTK_SIGNAL_FUNC (sdf_mode), "1"); gtk_widget_show (sdfbutton[1]); sdfbutton[2] = gtk_button_new_with_label (_("Next")); gtk_box_pack_start (GTK_BOX (sdfhbox), sdfbutton[2], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (sdfbutton[2]), "clicked", GTK_SIGNAL_FUNC (sdf_mode), "2"); gtk_widget_show (sdfbutton[2]); gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (filew)->main_vbox), sdfhbox, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (sdfhbox); check_babel(); if (babelin>-1){ babelcmdmenu = gtk_option_menu_new (); babelcmds = gtk_menu_new (); for (i=0;i<=babelin;i++){ snprintf(msgtmp,100,"%s ( %s )",intype[i],inmode[i]); babelcmditem = gtk_menu_item_new_with_label (msgtmp); gtk_menu_append (GTK_MENU (babelcmds), babelcmditem); gtk_widget_show (babelcmditem); (void)gtk_signal_connect_object (GTK_OBJECT (babelcmditem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) babelcmditem); (void)gtk_signal_connect (GTK_OBJECT (babelcmditem), "activate", GTK_SIGNAL_FUNC (babelcmd), inmode[i]); } gtk_option_menu_set_menu (GTK_OPTION_MENU (babelcmdmenu), babelcmds); gtk_widget_show (babelcmdmenu); gtk_box_pack_start(GTK_BOX(GTK_FILE_SELECTION(filew)->main_vbox), babelcmdmenu, (gboolean)TRUE,(gboolean)TRUE,0); } if (babelout>-1){ babelexpmenu = gtk_option_menu_new (); babelexpcmds = gtk_menu_new (); for (i=0;i<=babelout;i++){ snprintf(msgtmp,100,"%s ( %s )",outtype[i],outmode[i]); babelexpcmditem = gtk_menu_item_new_with_label (msgtmp); gtk_menu_append (GTK_MENU (babelexpcmds), babelexpcmditem); gtk_widget_show (babelexpcmditem); (void)gtk_signal_connect_object (GTK_OBJECT (babelexpcmditem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) babelexpcmditem); (void)gtk_signal_connect (GTK_OBJECT (babelexpcmditem), "activate", GTK_SIGNAL_FUNC (babelcmd), outmode[i]); } gtk_option_menu_set_menu (GTK_OPTION_MENU (babelexpmenu), babelexpcmds); gtk_widget_show (babelexpmenu); gtk_box_pack_start(GTK_BOX(GTK_FILE_SELECTION(filew)->main_vbox), babelexpmenu, (gboolean)TRUE,(gboolean)TRUE,0); } gtk_widget_realize (filew); /* * Build the export pop-up */ expw = gtk_file_selection_new ("Export"); (void)gtk_signal_connect (GTK_OBJECT (expw), "delete_event", (GtkSignalFunc) gtk_grab_remove, GTK_OBJECT (expw)); (void)gtk_signal_connect (GTK_OBJECT (expw), "delete_event", (GtkSignalFunc) gtk_widget_hide, GTK_OBJECT (expw)); (void)gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (expw)->ok_button), "clicked", (GtkSignalFunc) do_export, expw); (void)gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (expw)->cancel_button), "clicked", (GtkSignalFunc) gtk_grab_remove, GTK_OBJECT (expw)); (void)gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (expw)->cancel_button), "clicked", (GtkSignalFunc) gtk_widget_hide, GTK_OBJECT (expw)); hbox = gtk_hbox_new (FALSE, 0); label = gtk_label_new (_("Latex / EPS scale factor :")); gtk_box_pack_start (GTK_BOX (hbox), label, (gboolean) TRUE, (gboolean) FALSE, 0); gtk_widget_show (label); adj_scale = (GtkAdjustment *) gtk_adjustment_new (100., 1., 200., 1., 10., 0.); scale = gtk_spin_button_new (adj_scale, 0., 0); gtk_box_pack_start (GTK_BOX (hbox), scale, (gboolean) FALSE, (gboolean) FALSE, 0); gtk_widget_show (scale); label = gtk_label_new ("%"); gtk_box_pack_start (GTK_BOX (hbox), label, (gboolean) FALSE, (gboolean) FALSE, 0); gtk_widget_show (label); label = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (hbox), label, (gboolean) TRUE, (gboolean) FALSE, 0); gtk_widget_show (label); gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (expw)->main_vbox), hbox, (gboolean) TRUE, (gboolean) TRUE, 0); hbox = gtk_hbox_new ((gboolean) FALSE, 0); expbutton[0] = gtk_radio_button_new_with_label (NULL, "XFig"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[0], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (expbutton[0]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "0"); gtk_widget_show (expbutton[0]); group = gtk_radio_button_group (GTK_RADIO_BUTTON (expbutton[0])); expbutton[1] = gtk_radio_button_new_with_label (group, "LaTeX"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[1], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (expbutton[1]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "1"); gtk_widget_show (expbutton[1]); expbutton[2] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (expbutton[0])), "EPS"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[2], (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (expbutton[2]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "2"); gtk_widget_show (expbutton[2]); expbutton[3] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (expbutton[0])), "X Bitmap"); (void)gtk_signal_connect (GTK_OBJECT (expbutton[3]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "3"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[3], (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (expbutton[3]); expbutton[4] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (expbutton[0])), "SVG"); (void)gtk_signal_connect (GTK_OBJECT (expbutton[4]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "4"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[4], (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (expbutton[4]); expbutton[5] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (expbutton[0])), "MOL"); (void)gtk_signal_connect (GTK_OBJECT (expbutton[5]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "5"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[5], (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (expbutton[5]); expbutton[6] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (expbutton[0])), "EMF"); (void)gtk_signal_connect (GTK_OBJECT (expbutton[6]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "6"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[6], (gboolean) TRUE, (gboolean) TRUE, 0); #ifdef EMF gtk_widget_show (expbutton[6]); #endif expbutton[7] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (expbutton[0])), "SXD"); (void)gtk_signal_connect (GTK_OBJECT (expbutton[7]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "7"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[7], (gboolean) TRUE, (gboolean) TRUE, 0); expbutton[8] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (expbutton[0])), "PNG"); (void)gtk_signal_connect (GTK_OBJECT (expbutton[8]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "8"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[8], (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (expbutton[8]); expbutton[9] = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (expbutton[0])), "ASY"); (void)gtk_signal_connect (GTK_OBJECT (expbutton[9]), "clicked", GTK_SIGNAL_FUNC (exp_mode), "9"); gtk_box_pack_start (GTK_BOX (hbox), expbutton[9], (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (expbutton[9]); gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (expw)->main_vbox), hbox, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (hbox); /********************************************************************/ /* * Build the (error) message pop-up */ messagew = gtk_dialog_new (); (void)gtk_signal_connect_object (GTK_OBJECT (messagew), "destroy", (GtkSignalFunc) gtk_grab_remove, GTK_OBJECT (messagew)); (void)gtk_signal_connect_object (GTK_OBJECT (messagew), "destroy", (GtkSignalFunc) gtk_widget_hide, GTK_OBJECT (messagew)); message = gtk_label_new (_("Unknown error")); gtk_misc_set_padding (GTK_MISC (message), 10, 10); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (messagew)->vbox), message, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (message); button = gtk_button_new_with_label ("OK"); /* Connect the ok_button */ (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_grab_remove, GTK_OBJECT (messagew)); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_widget_hide, GTK_OBJECT (messagew)); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (messagew)->action_area), button, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (button); /********************************************************************/ /* Configurable options dialog */ #if (GTK_MINOR_VERSION >2) printer_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (printer_dialog), _("Configurable options")); gtk_window_set_resizable (GTK_WINDOW (printer_dialog), FALSE); gtk_container_set_border_width (GTK_CONTAINER (printer_dialog), 12); master_vbox = gtk_vbox_new (FALSE, 12); gtk_container_add (GTK_CONTAINER (printer_dialog), master_vbox); hbox = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_END); gtk_box_set_spacing (GTK_BOX (hbox), 12); gtk_box_pack_end (GTK_BOX (master_vbox), hbox, FALSE, FALSE, 0); button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); gtk_container_add (GTK_CONTAINER (hbox), button); /* Thanks to using ...swapped, the callback_data gets passed as the first argument to the callback function, so when we click on the button, we hide the dialog, not the button. */ g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_hide), G_OBJECT (printer_dialog)); button = gtk_button_new_from_stock (GTK_STOCK_OK); gtk_container_add (GTK_CONTAINER (hbox), button); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (options_dialog_ok), NULL); notebook = gtk_notebook_new (); gtk_box_pack_end (GTK_BOX (master_vbox), notebook, TRUE, TRUE, 0); /* First page: General options */ table = gtk_table_new (10, 3, FALSE); gtk_container_set_border_width (GTK_CONTAINER (table), 12); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_General")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), table, label); /* Adjust the table spacing before section headings etc. */ gtk_table_set_col_spacing (GTK_TABLE (table), 1, 12); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_row_spacing (GTK_TABLE (table), 0, 12); gtk_table_set_row_spacing (GTK_TABLE (table), 3, 12); gtk_table_set_row_spacing (GTK_TABLE (table), 7, 12); gtk_table_set_row_spacing (GTK_TABLE (table), 2, 18); gtk_table_set_row_spacing (GTK_TABLE (table), 6, 18); /* Spacer label for left indent */ label = gtk_label_new (NULL); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, 0, 0, 6, 0); /* The section headings */ label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), _("Display")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 3, 0, 1, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), _("Saving and Exporting")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 3, 3, 4, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), _("Other")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 3, 8, 9, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); /* First section, "Display" */ hbox = gtk_hbox_new (FALSE, 12); gtk_table_attach (GTK_TABLE (table), hbox, 1, 3, 1, 2, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Background color:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); color_button = gtk_color_button_new (); gtk_box_pack_start (GTK_BOX (hbox), color_button, FALSE, FALSE, 0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), color_button); whiteout_check = gtk_check_button_new_with_mnemonic ( _("Add filled _white rectangle under labels")); gtk_table_attach (GTK_TABLE (table), whiteout_check, 1, 3, 2, 3, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); /* Second section, "Saving and exporting" */ datadir_entry = gtk_entry_new (); gtk_table_attach (GTK_TABLE (table), datadir_entry, 2, 3, 4, 5, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); datamask_entry = gtk_entry_new (); gtk_table_attach (GTK_TABLE (table), datamask_entry, 2, 3, 5, 6, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); eps_preview_combo = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (eps_preview_combo), _("None")); gtk_combo_box_append_text (GTK_COMBO_BOX (eps_preview_combo), _("EPSI")); gtk_combo_box_append_text (GTK_COMBO_BOX (eps_preview_combo), _("TIFF mono")); gtk_combo_box_append_text (GTK_COMBO_BOX (eps_preview_combo), _("TIFF color")); gtk_table_attach (GTK_TABLE (table), eps_preview_combo, 2, 3, 6, 7, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Data directory:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), datadir_entry); gtk_table_attach (GTK_TABLE (table), label, 1, 2, 4, 5, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("E_xtension:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), datamask_entry); gtk_table_attach (GTK_TABLE (table), label, 1, 2, 5, 6, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("Preview image to add to _EPS files:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), eps_preview_combo); gtk_table_attach (GTK_TABLE (table), label, 1, 2, 6, 7, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); intl_check = gtk_check_button_new_with_mnemonic ( _("Support national character sets in labels")); gtk_table_attach (GTK_TABLE (table), intl_check, 1, 3, 7, 8, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); /* Third section, "Other" */ bond_length_entry = gtk_entry_new (); gtk_table_attach (GTK_TABLE (table), bond_length_entry, 2, 3, 9, 10, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); hbox = gtk_hbox_new (FALSE, 6); gtk_table_attach (GTK_TABLE (table), hbox, 2, 3, 10, 11, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); dbond_dist_spin = gtk_spin_button_new_with_range (1, 100, 1); gtk_box_pack_start (GTK_BOX (hbox), dbond_dist_spin, FALSE, FALSE, 0); label = gtk_label_new ("px"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("Base bond _length:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), bond_length_entry); gtk_table_attach (GTK_TABLE (table), label, 1, 2, 9, 10, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("Double bond _separation:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), dbond_dist_spin); gtk_table_attach (GTK_TABLE (table), label, 1, 2, 10, 11, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); /* Second page, printing */ table = gtk_table_new (5, 2, FALSE); gtk_container_set_border_width (GTK_CONTAINER (table), 12); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Printing")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), table, label); /* Table spacings */ gtk_table_set_col_spacing (GTK_TABLE (table), 0, 12); gtk_table_set_row_spacings (GTK_TABLE (table), 6); /* No sections are necessary on this page */ print_cmd_combo = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (print_cmd_combo), "lpr"); gtk_combo_box_append_text (GTK_COMBO_BOX (print_cmd_combo), "lp"); gtk_combo_box_append_text (GTK_COMBO_BOX (print_cmd_combo), "kprinter"); gtk_combo_box_append_text (GTK_COMBO_BOX (print_cmd_combo), "gtklp"); gtk_table_attach (GTK_TABLE (table), print_cmd_combo, 1, 2, 0, 1, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); printer_name_entry = gtk_entry_new (); gtk_table_attach (GTK_TABLE (table), printer_name_entry, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); paper_size_combo = gtk_combo_box_new_text (); for (i = 0; i < 11; i++) { gtk_combo_box_append_text (GTK_COMBO_BOX (paper_size_combo), paper[i]); } gtk_table_attach (GTK_TABLE (table), paper_size_combo, 1, 2, 2, 3, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); orientation_combo = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (orientation_combo), _("Portrait")); gtk_combo_box_append_text (GTK_COMBO_BOX (orientation_combo), _("Landscape")); gtk_table_attach (GTK_TABLE (table), orientation_combo, 1, 2, 3, 4, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); hbox = gtk_hbox_new (FALSE, 6); gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 4, 5, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); print_scale_spin = gtk_spin_button_new_with_range (1, 200, 1); gtk_box_pack_start (GTK_BOX (hbox), print_scale_spin, FALSE, FALSE, 0); label = gtk_label_new ("%"); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("Print _command:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), print_cmd_combo); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("Printer _name:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), printer_name_entry); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("Paper si_ze:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), paper_size_combo); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Orientation:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), orientation_combo); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); label = gtk_label_new (NULL); gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("Print sc_ale factor:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_mnemonic_widget (GTK_LABEL (label), print_scale_spin); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show_all (GTK_WIDGET (master_vbox)); (void)gtk_signal_connect_object (GTK_OBJECT (printer_dialog), "delete_event", (GtkSignalFunc) gtk_widget_hide, GTK_OBJECT (printer_dialog)); #else /* old-style configuration menu for gtk1 builds */ /* Color selection dialog */ colorseldialog= gtk_color_selection_dialog_new(_("Select background color")); colorsel=GTK_COLOR_SELECTION_DIALOG(colorseldialog)->colorsel; (void)gtk_signal_connect(GTK_OBJECT(colorsel), "color_changed", (GtkSignalFunc)set_bgcolor,(gpointer)colorsel); (void)gtk_signal_connect_object(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(colorseldialog)->ok_button), "clicked", (GtkSignalFunc)gtk_widget_hide,GTK_OBJECT(colorseldialog)); (void)gtk_signal_connect_object(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(colorseldialog)->cancel_button), "clicked", (GtkSignalFunc)gtk_widget_hide,GTK_OBJECT(colorseldialog)); gtk_widget_hide(GTK_COLOR_SELECTION_DIALOG(colorseldialog)->help_button); gtk_widget_realize(colorseldialog); /********************************************************************/ /* Printer setup dialog */ printer_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (printer_dialog), _("Configurable options")); gtk_widget_realize (printer_dialog); vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (printer_dialog), vbox); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Paper size:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); papermenu = gtk_option_menu_new (); papersizes = gtk_menu_new (); for (i = 0; i < 11; i++) { papersizeitem[i] = gtk_menu_item_new_with_label (paper[i]); gtk_menu_append (GTK_MENU (papersizes), papersizeitem[i]); gtk_widget_show (papersizeitem[i]); (void)gtk_signal_connect_object (GTK_OBJECT (papersizeitem[i]), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) papersizeitem[i]); (void)gtk_signal_connect (GTK_OBJECT (papersizeitem[i]), "activate", GTK_SIGNAL_FUNC (newpaper), (gpointer) paper[i]); } gtk_option_menu_set_menu (GTK_OPTION_MENU (papermenu), papersizes); gtk_widget_show (papermenu); gtk_box_pack_start (GTK_BOX (hbox), papermenu, (gboolean) TRUE, (gboolean) TRUE, 0); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Orientation:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); orientmenu = gtk_option_menu_new (); orientations = gtk_menu_new (); orientationitem = gtk_menu_item_new_with_label (_("Portrait")); gtk_menu_append (GTK_MENU (orientations), orientationitem); gtk_widget_show (orientationitem); (void)gtk_signal_connect (GTK_OBJECT (orientationitem), "activate", GTK_SIGNAL_FUNC (neworient), "0"); orientationitem = gtk_menu_item_new_with_label (_("Landscape")); gtk_menu_append (GTK_MENU (orientations), orientationitem); gtk_widget_show (orientationitem); (void)gtk_signal_connect (GTK_OBJECT (orientationitem), "activate", GTK_SIGNAL_FUNC (neworient), "1"); gtk_option_menu_set_menu (GTK_OPTION_MENU (orientmenu), orientations); gtk_widget_show (orientmenu); gtk_box_pack_start (GTK_BOX (hbox), orientmenu, (gboolean) TRUE, (gboolean) TRUE, 0); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Print scale factor :")); gtk_box_pack_start (GTK_BOX (hbox), label, (gboolean) FALSE, (gboolean) FALSE, 0); gtk_widget_show (label); adj_pscale = (GtkAdjustment *) gtk_adjustment_new (70., 1., 200., 1., 10., 0.); pscale = gtk_spin_button_new (adj_pscale, 0., 0); gtk_box_pack_start (GTK_BOX (hbox), pscale, (gboolean) FALSE, (gboolean) FALSE, 0); gtk_widget_show (pscale); label = gtk_label_new ("%"); gtk_box_pack_start (GTK_BOX (hbox), label, (gboolean) FALSE, (gboolean) FALSE, 0); gtk_widget_show (label); label = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (hbox), label, (gboolean) TRUE, (gboolean) FALSE, 0); gtk_widget_show (label); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Print command:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); printcmdmenu = gtk_option_menu_new (); printcmds = gtk_menu_new (); printcmditem = gtk_menu_item_new_with_label ("lpr"); gtk_menu_append (GTK_MENU (printcmds), printcmditem); gtk_widget_show (printcmditem); (void)gtk_signal_connect_object (GTK_OBJECT (printcmditem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) printcmditem); (void)gtk_signal_connect (GTK_OBJECT (printcmditem), "activate", GTK_SIGNAL_FUNC (newprcmd), "0"); printcmditem = gtk_menu_item_new_with_label ("lp"); gtk_menu_append (GTK_MENU (printcmds), printcmditem); gtk_widget_show (printcmditem); (void)gtk_signal_connect_object (GTK_OBJECT (printcmditem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) printcmditem); (void)gtk_signal_connect (GTK_OBJECT (printcmditem), "activate", GTK_SIGNAL_FUNC (newprcmd), "1"); printcmditem = gtk_menu_item_new_with_label ("kprinter"); gtk_menu_append (GTK_MENU (printcmds), printcmditem); gtk_widget_show (printcmditem); (void)gtk_signal_connect_object (GTK_OBJECT (printcmditem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) printcmditem); (void)gtk_signal_connect (GTK_OBJECT (printcmditem), "activate", GTK_SIGNAL_FUNC (newprcmd), "2"); printcmditem = gtk_menu_item_new_with_label ("gtklp"); gtk_menu_append (GTK_MENU (printcmds), printcmditem); gtk_widget_show (printcmditem); (void)gtk_signal_connect_object (GTK_OBJECT (printcmditem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) printcmditem); (void)gtk_signal_connect (GTK_OBJECT (printcmditem), "activate", GTK_SIGNAL_FUNC (newprcmd), "3"); gtk_option_menu_set_menu (GTK_OPTION_MENU (printcmdmenu), printcmds); gtk_widget_show (printcmdmenu); gtk_box_pack_start (GTK_BOX (hbox), printcmdmenu, (gboolean) TRUE, (gboolean) TRUE, 0); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Preview image to add to eps files :")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); epsoptionmenu = gtk_option_menu_new (); epsoptions = gtk_menu_new (); epsoptitem = gtk_menu_item_new_with_label (_("None")); gtk_menu_append (GTK_MENU (epsoptions), epsoptitem); gtk_widget_show (epsoptitem); (void)gtk_signal_connect_object (GTK_OBJECT (epsoptitem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) epsoptitem); (void)gtk_signal_connect (GTK_OBJECT (epsoptitem), "activate", GTK_SIGNAL_FUNC (newepsopt), "0"); epsoptitem = gtk_menu_item_new_with_label (_("EPSI")); gtk_menu_append (GTK_MENU (epsoptions), epsoptitem); gtk_widget_show (epsoptitem); (void)gtk_signal_connect_object (GTK_OBJECT (epsoptitem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) epsoptitem); (void)gtk_signal_connect (GTK_OBJECT (epsoptitem), "activate", GTK_SIGNAL_FUNC (newepsopt), "1"); epsoptitem = gtk_menu_item_new_with_label (_("TIFF mono")); gtk_menu_append (GTK_MENU (epsoptions), epsoptitem); gtk_widget_show (epsoptitem); (void)gtk_signal_connect_object (GTK_OBJECT (epsoptitem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) epsoptitem); (void)gtk_signal_connect (GTK_OBJECT (epsoptitem), "activate", GTK_SIGNAL_FUNC (newepsopt), "2"); epsoptitem = gtk_menu_item_new_with_label (_("TIFF color")); gtk_menu_append (GTK_MENU (epsoptions), epsoptitem); gtk_widget_show (epsoptitem); (void)gtk_signal_connect_object (GTK_OBJECT (epsoptitem), "activate", GTK_SIGNAL_FUNC (gtk_menu_item_select), (gpointer) epsoptitem); (void)gtk_signal_connect (GTK_OBJECT (epsoptitem), "activate", GTK_SIGNAL_FUNC (newepsopt), "2"); gtk_option_menu_set_menu (GTK_OPTION_MENU (epsoptionmenu), epsoptions); gtk_widget_show (epsoptionmenu); gtk_box_pack_start (GTK_BOX (hbox), epsoptionmenu, (gboolean) TRUE, (gboolean) TRUE, 0); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Support national character sets in labels")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); intlbutton = gtk_check_button_new(); gtk_box_pack_start (GTK_BOX (hbox), intlbutton, FALSE, FALSE, 0); (void)gtk_signal_connect (GTK_OBJECT(intlbutton), "toggled", GTK_SIGNAL_FUNC(toggle_intlchars), NULL); gtk_widget_show (intlbutton); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); snprintf(bghexcolor,10,"#%2.2x%2.2x%2.2x",(unsigned char)(bgred/256.),(unsigned char)(bggreen/256.),(unsigned char)(bgblue/256.)); label = gtk_label_new (_("Background color :")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); bgcolorbutton = gtk_button_new_with_label(bghexcolor); gtk_box_pack_start (GTK_BOX (hbox), bgcolorbutton, FALSE, FALSE, 0); (void)gtk_signal_connect_object (GTK_OBJECT(bgcolorbutton), "clicked", GTK_SIGNAL_FUNC(gtk_widget_show), GTK_OBJECT(colorseldialog)); gtk_widget_show (bgcolorbutton); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Add filled white rectangle under labels")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); whiteoutbutton = gtk_check_button_new(); gtk_box_pack_start (GTK_BOX (hbox), whiteoutbutton, FALSE, FALSE, 0); (void)gtk_signal_connect (GTK_OBJECT(whiteoutbutton), "toggled", GTK_SIGNAL_FUNC(toggle_whiteout), NULL); gtk_widget_show (whiteoutbutton); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Printer name:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); prqueue = gtk_entry_new_with_max_length (32); gtk_widget_show (prqueue); gtk_box_pack_start (GTK_BOX (hbox), prqueue, (gboolean) TRUE, (gboolean) TRUE, 0); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Data directory:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); defaultdir = gtk_entry_new_with_max_length ((guint16)PATH_MAX); gtk_widget_show (defaultdir); gtk_box_pack_start (GTK_BOX (hbox), defaultdir, (gboolean) TRUE, (gboolean) TRUE, 0); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Extension:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); defaultext = gtk_entry_new_with_max_length (32); gtk_widget_show (defaultext); gtk_box_pack_start (GTK_BOX (hbox), defaultext, (gboolean) TRUE, (gboolean) TRUE, 0); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Base bondlength (10.668mm) :")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); base_bondlen = gtk_entry_new_with_max_length (32); snprintf(msgtmp,100,"%6.4f",bondlen_mm); gtk_entry_set_text (GTK_ENTRY (base_bondlen),msgtmp); gtk_widget_show (base_bondlen); gtk_box_pack_start (GTK_BOX (hbox), base_bondlen, (gboolean) TRUE, (gboolean) TRUE, 0); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); label = gtk_label_new (_("Doublebond separation (4 pixel) :")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); doubledist = gtk_entry_new_with_max_length (32); snprintf(msgtmp,100,"%d",db_dist); gtk_entry_set_text (GTK_ENTRY (doubledist),msgtmp); gtk_widget_show (doubledist); gtk_box_pack_start (GTK_BOX (hbox), doubledist, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (printer_dialog), "delete_event", (GtkSignalFunc) gtk_widget_hide, GTK_OBJECT (printer_dialog)); hbox = gtk_hbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); pokbutton = gtk_button_new_with_label (_("Ok")); gtk_box_pack_start (GTK_BOX (hbox), pokbutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (pokbutton), "clicked", GTK_SIGNAL_FUNC (gtk_widget_hide), GTK_OBJECT (printer_dialog)); (void)gtk_signal_connect (GTK_OBJECT (pokbutton), "clicked", GTK_SIGNAL_FUNC (setup_printer), "1"); gtk_widget_show (pokbutton); pcabutton = gtk_button_new_with_label (_("Cancel")); gtk_box_pack_start (GTK_BOX (hbox), pcabutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (pcabutton), "clicked", GTK_SIGNAL_FUNC (gtk_widget_hide), GTK_OBJECT (printer_dialog)); (void)gtk_signal_connect (GTK_OBJECT (pcabutton), "clicked", GTK_SIGNAL_FUNC (setup_printer), "0"); gtk_widget_show (pcabutton); #endif /****************************************************************/ /*************************************************************/ /* Popup to show a selection of templates to insert into the drawing */ templates = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (templates), _("Templates")); gtk_widget_realize (templates); tvbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (templates), tvbox); gtk_widget_show (tvbox); (void)gtk_signal_connect_object (GTK_OBJECT (templates), "delete_event", (GtkSignalFunc) gtk_widget_hide, GTK_OBJECT (templates)); temptips = gtk_tooltips_new (); templatebook = gtk_notebook_new (); gtk_notebook_set_tab_pos (GTK_NOTEBOOK (templatebook), GTK_POS_TOP); label = gtk_label_new (_("Carbocycles")); gtk_widget_show (label); page = gtk_frame_new (_("Carbocycles")); gtk_widget_show (page); gtk_notebook_append_page (GTK_NOTEBOOK (templatebook), page, label); pbox = gtk_table_new (5, 5, TRUE); gtk_widget_show (pbox); for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { tbutton[5 * i + j] = gtk_button_new (); style = gtk_widget_get_style (templates); pixmap = gdk_pixmap_create_from_xpm_d (templates->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) template_xpm[i][j]); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (tbutton[5 * i + j]), pixmapwid); gtk_widget_show (tbutton[5 * i + j]); gtk_table_attach_defaults (GTK_TABLE (pbox), tbutton[5 * i + j], (guint)j, (guint)j + 1, (guint)i, (guint)i + 1); tmplnum[5 * i + j] = 10 * i + j; (void)gtk_signal_connect (GTK_OBJECT (tbutton[5 * i + j]), "clicked", GTK_SIGNAL_FUNC (Add_template), GINT_TO_POINTER(tmplnum[5 * i + j]) ); if ((int)strlen(template_tip[i][j]) >0 ) { #ifndef ENABLE_NLS gtk_tooltips_set_tip (temptips, tbutton[5 * i + j], template_tip[i][j], NULL); #else gtk_tooltips_set_tip (temptips, tbutton[5 * i + j], gettext(template_tip[i][j]), NULL); #endif } } } gtk_container_add (GTK_CONTAINER (page), pbox); label = gtk_label_new (_("Sugars")); gtk_widget_show (label); page = gtk_frame_new (_("Sugars")); gtk_widget_show (page); gtk_notebook_append_page (GTK_NOTEBOOK (templatebook), page, label); pbox = gtk_table_new (5, 5, TRUE); gtk_widget_show (pbox); for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { tbutton[25 + 5 * i + j] = gtk_button_new (); style = gtk_widget_get_style (templates); pixmap = gdk_pixmap_create_from_xpm_d (templates->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) template_xpm[i + 5] [j]); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (tbutton[25 + 5 * i + j]), pixmapwid); gtk_widget_show (tbutton[25 + 5 * i + j]); gtk_table_attach_defaults (GTK_TABLE (pbox), tbutton[25 + 5 * i + j], (guint)j, (guint)j + 1, (guint)i, (guint)i + 1); tmplnum[25 + 5 * i + j] = 10 * (i + 5) + j; (void)gtk_signal_connect (GTK_OBJECT (tbutton[25 + 5 * i + j]), "clicked", GTK_SIGNAL_FUNC (Add_template), GINT_TO_POINTER(tmplnum[25 + 5 * i + j]) ); if ((int)strlen(template_tip[i+5][j]) >0 ) { #ifndef ENABLE_NLS gtk_tooltips_set_tip (temptips, tbutton[25 + 5 * i + j], template_tip[i + 5][j], NULL); #else gtk_tooltips_set_tip (temptips, tbutton[25 + 5 * i + j], gettext(template_tip[i + 5][j]), NULL); #endif } } } gtk_container_add (GTK_CONTAINER (page), pbox); label = gtk_label_new (_("Heterocycles")); gtk_widget_show (label); page = gtk_frame_new (_("Heterocycles")); gtk_widget_show (page); gtk_notebook_append_page (GTK_NOTEBOOK (templatebook), page, label); pbox = gtk_table_new (5, 5, TRUE); gtk_widget_show (pbox); for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { tbutton[50 + 5 * i + j] = gtk_button_new (); style = gtk_widget_get_style (templates); pixmap = gdk_pixmap_create_from_xpm_d (templates->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) template_xpm[i + 10] [j]); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (tbutton[50 + 5 * i + j]), pixmapwid); gtk_widget_show (tbutton[50 + 5 * i + j]); gtk_table_attach_defaults (GTK_TABLE (pbox), tbutton[50 + 5 * i + j], (guint)j, (guint)j + 1, (guint)i,(guint)i + 1); tmplnum[50 + 5 * i + j] = 10 * (i + 10) + j; (void)gtk_signal_connect (GTK_OBJECT (tbutton[50 + 5 * i + j]), "clicked", GTK_SIGNAL_FUNC (Add_template), GINT_TO_POINTER(tmplnum[50 + 5 * i + j]) ); if ((int)strlen(template_tip[i+10][j]) >0 ) { #ifndef ENABLE_NLS gtk_tooltips_set_tip (temptips, tbutton[50 + 5 * i + j], template_tip[i + 10][j], NULL); #else gtk_tooltips_set_tip (temptips, tbutton[50 + 5 * i + j], gettext(template_tip[i + 10][j]), NULL); #endif } } } gtk_container_add (GTK_CONTAINER (page), pbox); label = gtk_label_new (_("Amino Acids")); gtk_widget_show (label); page = gtk_frame_new (_("Amino Acids")); gtk_widget_show (page); gtk_notebook_append_page (GTK_NOTEBOOK (templatebook), page, label); pbox = gtk_table_new (5, 5, TRUE); gtk_widget_show (pbox); for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { tbutton[75 + 5 * i + j] = gtk_button_new (); style = gtk_widget_get_style (templates); pixmap = gdk_pixmap_create_from_xpm_d (templates->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) template_xpm[i + 15] [j]); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (tbutton[75 + 5 * i + j]), pixmapwid); gtk_widget_show (tbutton[75 + 5 * i + j]); gtk_table_attach_defaults (GTK_TABLE (pbox), tbutton[75 + 5 * i + j], (guint)j, (guint)j + 1, (guint)i, (guint)i + 1); tmplnum[75 + 5 * i + j] = 10 * (i + 15) + j; (void)gtk_signal_connect (GTK_OBJECT (tbutton[75 + 5 * i + j]), "clicked", GTK_SIGNAL_FUNC (Add_template), GINT_TO_POINTER(tmplnum[75 + 5 * i + j]) ); if ((int)strlen(template_tip[i+15][j]) >0 ) { #ifndef ENABLE_NLS gtk_tooltips_set_tip (temptips, tbutton[75 + 5 * i + j], template_tip[i + 15][j], NULL); #else gtk_tooltips_set_tip (temptips, tbutton[75 + 5 * i + j], gettext(template_tip[i + 15][j]), NULL); #endif } } } gtk_container_add (GTK_CONTAINER (page), pbox); label = gtk_label_new (_("Symbols")); gtk_widget_show (label); page = gtk_frame_new (_("Symbols")); gtk_widget_show (page); gtk_notebook_append_page (GTK_NOTEBOOK (templatebook), page, label); pbox = gtk_table_new (5, 5, TRUE); gtk_widget_show (pbox); for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { tbutton[100 + 5 * i + j] = gtk_button_new (); style = gtk_widget_get_style (templates); pixmap = gdk_pixmap_create_from_xpm_d (templates->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) template_xpm[i + 20] [j]); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (tbutton[100 + 5 * i + j]), pixmapwid); gtk_widget_show (tbutton[100 + 5 * i + j]); gtk_table_attach_defaults (GTK_TABLE (pbox), tbutton[100 + 5 * i + j], (guint)j, (guint)j + 1, (guint)i, (guint)i + 1); tmplnum[100 + 5 * i + j] = 10 * (i + 20) + j; (void)gtk_signal_connect (GTK_OBJECT (tbutton[100 + 5 * i + j]), "clicked", GTK_SIGNAL_FUNC (Add_template), GINT_TO_POINTER(tmplnum[100 + 5 * i + j]) ); if ((int)strlen(template_tip[i+20][j]) >0 ) { #ifndef ENABLE_NLS gtk_tooltips_set_tip (temptips, tbutton[100 + 5 * i + j], template_tip[i + 20][j], NULL); #else gtk_tooltips_set_tip (temptips, tbutton[100 + 5 * i + j], gettext(template_tip[i + 20][j]), NULL); #endif } } } gtk_container_add (GTK_CONTAINER (page), pbox); gtk_widget_show (templatebook); gtk_box_pack_start (GTK_BOX (tvbox), templatebook, (gboolean) TRUE, (gboolean) TRUE, 0); button = gtk_button_new_with_label (_("Close")); gtk_widget_show (button); gtk_box_pack_start (GTK_BOX (tvbox), button, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_hide), GTK_OBJECT (templates)); /**************************************************************/ /* * Create the main window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_name (window, "Chemtool"); gtk_window_set_title (GTK_WINDOW (window), "Chemtool 1.6.14"); /* all pop-ups should appear topmost and at the current cursor position, that is, near their respective toolbar buttons */ gtk_window_set_transient_for (GTK_WINDOW (filew), GTK_WINDOW (window)); gtk_window_set_position (GTK_WINDOW (filew), GTK_WIN_POS_MOUSE); gtk_window_set_transient_for (GTK_WINDOW (expw), GTK_WINDOW (window)); gtk_window_set_position (GTK_WINDOW (expw), GTK_WIN_POS_MOUSE); gtk_window_set_transient_for (GTK_WINDOW (messagew), GTK_WINDOW (window)); gtk_window_set_position (GTK_WINDOW (messagew), GTK_WIN_POS_MOUSE); tooltips = gtk_tooltips_new (); /* initialize tool-tip message boxes */ /* initialize vertical stacking of button rows and drawing area */ vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_widget_show (vbox); (void)gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (CheckAndQuit), NULL); #ifdef MENU /* build the menubar */ accel_group = gtk_accel_group_new (); /* the menuitems of the file-menu */ file = gtk_menu_new (); new = gtk_menu_item_new_with_label (_("New")); gtk_menu_append (GTK_MENU (file), new); (void)gtk_signal_connect_object (GTK_OBJECT (new), "activate", GTK_SIGNAL_FUNC (CheckAndClear), NULL); gtk_widget_add_accelerator (new, "activate", accel_group, GDK_N, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (new); open = gtk_menu_item_new_with_label (_("Open")); gtk_menu_append (GTK_MENU (file), open); (void)gtk_signal_connect_object (GTK_OBJECT (open), "activate", GTK_SIGNAL_FUNC (CheckAndLoad), NULL); gtk_widget_add_accelerator (open, "activate", accel_group, GDK_O, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (open); add = gtk_menu_item_new_with_label (_("Add")); gtk_menu_append (GTK_MENU (file), add); (void)gtk_signal_connect_object (GTK_OBJECT (add), "activate", GTK_SIGNAL_FUNC (Add), NULL); gtk_widget_add_accelerator (add, "activate", accel_group, GDK_A, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (add); import = gtk_menu_item_new_with_label (_("Import MOL")); gtk_menu_append (GTK_MENU (file), import); (void)gtk_signal_connect_object (GTK_OBJECT (import), "activate", GTK_SIGNAL_FUNC (Import), NULL); gtk_widget_add_accelerator (import, "activate", accel_group, GDK_I, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (import); imppdb = gtk_menu_item_new_with_label (_("Import PDB")); gtk_menu_append (GTK_MENU (file), imppdb); (void)gtk_signal_connect_object (GTK_OBJECT (imppdb), "activate", GTK_SIGNAL_FUNC (Import_PDB), NULL); gtk_widget_add_accelerator (imppdb, "activate", accel_group, GDK_P, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (imppdb); impany = gtk_menu_item_new_with_label (_("Import (Babel)")); gtk_menu_append (GTK_MENU (file), impany); (void)gtk_signal_connect_object (GTK_OBJECT (impany), "activate", GTK_SIGNAL_FUNC (Import_Babel), NULL); gtk_widget_add_accelerator (impany, "activate", accel_group, GDK_B, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (impany); if (babelin<0) gtk_widget_set_sensitive(impany,FALSE); export = gtk_menu_item_new_with_label (_("Export...")); gtk_menu_append (GTK_MENU (file), export); (void)gtk_signal_connect_object (GTK_OBJECT (export), "activate", GTK_SIGNAL_FUNC (Export), NULL); gtk_widget_add_accelerator (export, "activate", accel_group, GDK_E, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (export); expany = gtk_menu_item_new_with_label (_("Export (Babel)")); gtk_menu_append (GTK_MENU (file), expany); (void)gtk_signal_connect_object (GTK_OBJECT (expany), "activate", GTK_SIGNAL_FUNC (Export_Babel), NULL); gtk_widget_add_accelerator (expany, "activate", accel_group, GDK_X, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (expany); if (babelout<0) gtk_widget_set_sensitive(expany,FALSE); printps = gtk_menu_item_new_with_label (_("Print")); gtk_menu_append (GTK_MENU (file), printps); (void)gtk_signal_connect_object (GTK_OBJECT (printps), "activate", GTK_SIGNAL_FUNC (print_ps), NULL); gtk_widget_add_accelerator (printps, "activate", accel_group, GDK_P, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (printps); print_setup = gtk_menu_item_new_with_label (_("Setup Defaults")); gtk_menu_append (GTK_MENU (file), print_setup); #if (GTK_MINOR_VERSION >2) (void)gtk_signal_connect_object (GTK_OBJECT (print_setup), "activate", GTK_SIGNAL_FUNC (print_setup_menu_activate), NULL); #else (void)gtk_signal_connect_object (GTK_OBJECT (print_setup), "activate", GTK_SIGNAL_FUNC (gtk_widget_show), GTK_OBJECT (printer_dialog)); #endif gtk_widget_add_accelerator (print_setup, "activate", accel_group, GDK_D, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (print_setup); save_setup = gtk_menu_item_new_with_label (_("Save Config")); gtk_menu_append (GTK_MENU (file), save_setup); (void)gtk_signal_connect_object (GTK_OBJECT (save_setup), "activate", GTK_SIGNAL_FUNC (writerc), NULL); gtk_widget_add_accelerator (save_setup, "activate", accel_group, GDK_numbersign, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (save_setup); save = gtk_menu_item_new_with_label (_("Save")); gtk_menu_append (GTK_MENU (file), save); (void)gtk_signal_connect_object (GTK_OBJECT (save), "activate", GTK_SIGNAL_FUNC (Save), NULL); gtk_widget_add_accelerator (save, "activate", accel_group, GDK_S, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (save); saveas = gtk_menu_item_new_with_label (_("Save As...")); gtk_menu_append (GTK_MENU (file), saveas); (void)gtk_signal_connect_object (GTK_OBJECT (saveas), "activate", GTK_SIGNAL_FUNC (SaveAs), NULL); /* gtk_widget_add_accelerator (saveas, "activate", accel_group, GDK_F4, 0, GTK_ACCEL_VISIBLE); */ gtk_widget_show (saveas); quit = gtk_menu_item_new_with_label (_("Quit")); gtk_menu_append (GTK_MENU (file), quit); (void)gtk_signal_connect_object (GTK_OBJECT (quit), "activate", GTK_SIGNAL_FUNC (CheckAndQuit), NULL); gtk_widget_add_accelerator (quit, "activate", accel_group, GDK_Q, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (quit); file_menu = gtk_menu_item_new_with_label (_("File")); gtk_menu_item_set_submenu (GTK_MENU_ITEM (file_menu), file); gtk_widget_show (file_menu); /* the menuitems of the edit-menu */ edit = gtk_menu_new (); copy = gtk_menu_item_new_with_label (_("Copy")); gtk_menu_append (GTK_MENU (edit), copy); (void)gtk_signal_connect (GTK_OBJECT (copy), "activate", GTK_SIGNAL_FUNC (copy_obj), GTK_OBJECT (window)); /* (void)gtk_signal_connect (GTK_OBJECT (copy), "activate", GTK_SIGNAL_FUNC (gtk_toggle_button_set_active), GTK_OBJECT (movebutton));*/ gtk_widget_add_accelerator (copy, "activate", accel_group, GDK_V, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (copy); fliph = gtk_menu_item_new_with_label (_("Flip horizontally")); gtk_menu_append (GTK_MENU (edit), fliph); (void)gtk_signal_connect (GTK_OBJECT (fliph), "activate", GTK_SIGNAL_FUNC (flip_horiz), GTK_OBJECT (window)); gtk_widget_show (fliph); flipv = gtk_menu_item_new_with_label (_("Flip vertically")); gtk_menu_append (GTK_MENU (edit), flipv); (void)gtk_signal_connect (GTK_OBJECT (flipv), "activate", GTK_SIGNAL_FUNC (flip_vert), GTK_OBJECT (window)); gtk_widget_show (flipv); #ifdef LIBUNDO undo = gtk_menu_item_new_with_label (_("Undo")); gtk_menu_append (GTK_MENU (edit), undo); (void)gtk_signal_connect (GTK_OBJECT (undo), "activate", GTK_SIGNAL_FUNC (do_undo), GTK_OBJECT (window)); gtk_widget_add_accelerator (undo, "activate", accel_group, GDK_U, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (undo); redo = gtk_menu_item_new_with_label (_("Redo")); gtk_menu_append (GTK_MENU (edit), redo); (void)gtk_signal_connect (GTK_OBJECT (redo), "activate", GTK_SIGNAL_FUNC (do_redo), GTK_OBJECT (window)); gtk_widget_add_accelerator (redo, "activate", accel_group, GDK_R, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (redo); #endif edit_menu = gtk_menu_item_new_with_label (_("Edit")); gtk_menu_item_set_submenu (GTK_MENU_ITEM (edit_menu), edit); gtk_widget_show (edit_menu); /* the menuitems of the view-menu */ view = gtk_menu_new (); zoomin = gtk_menu_item_new_with_label (_("Zoom in")); gtk_menu_append (GTK_MENU (view), zoomin); (void)gtk_signal_connect (GTK_OBJECT (zoomin), "activate", GTK_SIGNAL_FUNC (Zoom), "0"); gtk_widget_show (zoomin); zoomout = gtk_menu_item_new_with_label (_("Zoom out")); gtk_menu_append (GTK_MENU (view), zoomout); (void)gtk_signal_connect (GTK_OBJECT (zoomout), "activate", GTK_SIGNAL_FUNC (Zoom), "1"); gtk_widget_show (zoomout); gtk_widget_add_accelerator (zoomin, "activate", accel_group, GDK_equal, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_add_accelerator (zoomout, "activate", accel_group, GDK_minus, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); center = gtk_menu_item_new_with_label (_("Center")); gtk_menu_append (GTK_MENU (view), center); (void)gtk_signal_connect (GTK_OBJECT (center), "activate", GTK_SIGNAL_FUNC (Center), GTK_OBJECT (window)); gtk_widget_add_accelerator (center, "activate", accel_group, GDK_C, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (center); grid = gtk_menu_item_new_with_label (_("Grid rect/rhomb/off")); gtk_menu_append (GTK_MENU (view), grid); (void)gtk_signal_connect (GTK_OBJECT (grid), "activate", GTK_SIGNAL_FUNC (Grid), GTK_OBJECT (window)); gtk_widget_show (grid); view_menu = gtk_menu_item_new_with_label (_("View")); gtk_menu_item_set_submenu (GTK_MENU_ITEM (view_menu), view); gtk_widget_show (view_menu); /* the menuitems of the tools-menu */ tools = gtk_menu_new (); templatem = gtk_menu_item_new_with_label (_("Templates...")); gtk_menu_append (GTK_MENU (tools), templatem); (void)gtk_signal_connect_object (GTK_OBJECT (templatem), "activate", GTK_SIGNAL_FUNC (show_or_raise), GTK_OBJECT (templates)); gtk_widget_add_accelerator (templatem, "activate", accel_group, GDK_T, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (templatem); cht = gtk_menu_item_new_with_label (_("Calculate Formula Weight")); gtk_menu_append (GTK_MENU (tools), cht); (void)gtk_signal_connect (GTK_OBJECT (cht), "activate", GTK_SIGNAL_FUNC (do_fw), NULL); gtk_widget_add_accelerator (cht, "activate", accel_group, GDK_F, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_widget_show (cht); clean = gtk_menu_item_new_with_label (_("Clean up drawing")); gtk_menu_append (GTK_MENU (tools), clean); (void)gtk_signal_connect (GTK_OBJECT (clean), "activate", GTK_SIGNAL_FUNC (tidy_mol), NULL); gtk_widget_show (clean); tools_menu = gtk_menu_item_new_with_label (_("Tools")); gtk_menu_item_set_submenu (GTK_MENU_ITEM (tools_menu), tools); gtk_widget_show (tools_menu); /* the menuitems of the help-menu */ help = gtk_menu_new (); about = gtk_menu_item_new_with_label (_("About")); gtk_menu_append (GTK_MENU (help), about); (void)gtk_signal_connect_object (GTK_OBJECT (about), "activate", GTK_SIGNAL_FUNC (gtk_widget_show), GTK_OBJECT (aboutw)); /* gtk_widget_add_accelerator (about, "activate", accel_group, GDK_F1, 0, GTK_ACCEL_VISIBLE);*/ gtk_widget_show (about); using = gtk_menu_item_new_with_label (_("Help")); gtk_menu_append (GTK_MENU (help), using); (void)gtk_signal_connect_object (GTK_OBJECT (using), "activate", GTK_SIGNAL_FUNC (gtk_widget_show), GTK_OBJECT (helpw)); gtk_widget_add_accelerator (using, "activate", accel_group, GDK_F1, 0, GTK_ACCEL_VISIBLE); gtk_widget_show (using); help_menu = gtk_menu_item_new_with_label (_("Help")); gtk_menu_item_set_submenu (GTK_MENU_ITEM (help_menu), help); gtk_widget_show (help_menu); /* build the menubar */ menu_bar = gtk_menu_bar_new (); gtk_box_pack_start (GTK_BOX (vbox), menu_bar, (gboolean) FALSE, (gboolean) FALSE, 2); gtk_widget_show (menu_bar); gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), file_menu); gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), edit_menu); gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), view_menu); gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), tools_menu); gtk_menu_item_right_justify (GTK_MENU_ITEM (help_menu)); gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), help_menu); gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); #else /* initialize horizontal packing of the first row of buttons */ /* define the first row of buttons, with label,callback and tooltip text */ /* Load | Add | Save | Import | Export | ZoomIn | Center | ZoomOut | Clear | Quit | About */ hbox = gtk_hbox_new (TRUE, 0); loadbutton = gtk_button_new_with_label (_("Load")); gtk_box_pack_start (GTK_BOX (hbox), loadbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (loadbutton), "clicked", GTK_SIGNAL_FUNC (CheckAndLoad), NULL); gtk_tooltips_set_tip (tooltips, loadbutton, _("Load a chemtool sketch"), NULL); gtk_widget_show (loadbutton); addbutton = gtk_button_new_with_label (_("Add")); gtk_box_pack_start (GTK_BOX (hbox), addbutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (addbutton), "clicked", GTK_SIGNAL_FUNC (Add), NULL); gtk_tooltips_set_tip (tooltips, addbutton, _("Add fragment from file"), NULL); gtk_widget_show (addbutton); tempbutton = gtk_button_new_with_label (_("Templates")); gtk_box_pack_start (GTK_BOX (hbox), tempbutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (tempbutton), "clicked", GTK_SIGNAL_FUNC (show_or_raise), GTK_OBJECT (templates)); gtk_tooltips_set_tip (tooltips, tempbutton, _("Add template structure"), NULL); gtk_widget_show (tempbutton); savebutton = gtk_button_new_with_label (_("Save")); gtk_box_pack_start (GTK_BOX (hbox), savebutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (savebutton), "clicked", GTK_SIGNAL_FUNC (Save), NULL); gtk_tooltips_set_tip (tooltips, savebutton, _("Save sketch to file"), NULL); gtk_widget_show (savebutton); exportbutton = gtk_button_new_with_label (_("Export")); gtk_box_pack_start (GTK_BOX (hbox), exportbutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (exportbutton), "clicked", GTK_SIGNAL_FUNC (Export), NULL); (void)gtk_signal_connect (GTK_OBJECT (exportbutton), "clicked", GTK_SIGNAL_FUNC (gtk_file_selection_set_filename), GTK_OBJECT (expw)); gtk_tooltips_set_tip (tooltips, exportbutton, _("Create EPS, XFig, PicTeX or XBM file"), NULL); gtk_widget_show (exportbutton); printbutton = gtk_button_new_with_label (_("Print")); gtk_box_pack_start (GTK_BOX (hbox), printbutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (printbutton), "clicked", GTK_SIGNAL_FUNC (print_ps), NULL); gtk_tooltips_set_tip (tooltips, printbutton, _("Print file to a postscript printer"), NULL); gtk_widget_show (printbutton); psetupbutton = gtk_button_new_with_label (_("Setup")); gtk_box_pack_start (GTK_BOX (hbox), psetupbutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (psetupbutton), "clicked", GTK_SIGNAL_FUNC (gtk_widget_show), GTK_OBJECT (printer_dialog)); gtk_tooltips_set_tip (tooltips, psetupbutton, _("Setup default options"), NULL); gtk_widget_show (psetupbutton); savesetupbutton = gtk_button_new_with_label (_("Save Config")); gtk_box_pack_start (GTK_BOX (hbox), savesetupbutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (savesetupbutton), "clicked", GTK_SIGNAL_FUNC (writerc), NULL); gtk_tooltips_set_tip (tooltips, savesetupbutton, _("Save default options"), NULL); gtk_widget_show (savesetupbutton); importbutton = gtk_button_new_with_label (_("Import")); gtk_box_pack_start (GTK_BOX (hbox), importbutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (importbutton), "clicked", GTK_SIGNAL_FUNC (Import), NULL); gtk_tooltips_set_tip (tooltips, importbutton, _("Read a file written in MDL/molfile format"), NULL); gtk_widget_show (importbutton); imppdbbutton = gtk_button_new_with_label (_("ImportPDB")); gtk_box_pack_start (GTK_BOX (hbox), imppdbbutton, (gboolean) TRUE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (imppdbbutton), "clicked", GTK_SIGNAL_FUNC (Import_PDB), NULL); gtk_tooltips_set_tip (tooltips, imppdbbutton, _("Read a file written in PDB format"), NULL); gtk_widget_show (imppdbbutton); zoominbutton = gtk_button_new_with_label (_("Zoom In")); gtk_box_pack_start (GTK_BOX (hbox), zoominbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (zoominbutton), "clicked", GTK_SIGNAL_FUNC (Zoom), "0"); gtk_tooltips_set_tip (tooltips, zoominbutton, _("Increase zoom scale"), NULL); gtk_widget_show (zoominbutton); centerbutton = gtk_button_new_with_label (_("Center")); gtk_box_pack_start (GTK_BOX (hbox), centerbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (centerbutton), "clicked", GTK_SIGNAL_FUNC (Center), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, centerbutton, _("Center molecule in drawing area"), NULL); gtk_widget_show (centerbutton); zoomoutbutton = gtk_button_new_with_label (_("Zoom Out")); gtk_box_pack_start (GTK_BOX (hbox), zoomoutbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (zoomoutbutton), "clicked", GTK_SIGNAL_FUNC (Zoom), "1"); gtk_tooltips_set_tip (tooltips, zoomoutbutton, _("Decrease zoom scale"), NULL); gtk_widget_show (zoomoutbutton); clearbutton = gtk_button_new_with_label (_("Clear")); gtk_box_pack_start (GTK_BOX (hbox), clearbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (clearbutton), "clicked", GTK_SIGNAL_FUNC (CheckAndClear), NULL); gtk_tooltips_set_tip (tooltips, clearbutton, _("Remove molecule"), NULL); gtk_widget_show (clearbutton); fwbutton = gtk_button_new_with_label (_("FW")); gtk_box_pack_start (GTK_BOX (hbox), fwbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (fwbutton), "clicked", GTK_SIGNAL_FUNC (do_fw), NULL); gtk_tooltips_set_tip (tooltips, fwbutton, _("Calculate Formula Mass"), NULL); gtk_widget_show (fwbutton); quitbutton = gtk_button_new_with_label (_("Quit")); gtk_box_pack_start (GTK_BOX (hbox), quitbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (quitbutton), "clicked", GTK_SIGNAL_FUNC (CheckAndQuit), NULL); gtk_tooltips_set_tip (tooltips, quitbutton, _("Exit Chemtool"), NULL); gtk_widget_show (quitbutton); aboutbutton = gtk_button_new_with_label (_("About")); gtk_box_pack_end (GTK_BOX (hbox), aboutbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (aboutbutton), "clicked", GTK_SIGNAL_FUNC (gtk_widget_show), GTK_OBJECT (aboutw)); gtk_tooltips_set_tip (tooltips, aboutbutton, _("About Chemtool"), NULL); gtk_widget_show (aboutbutton); gtk_box_pack_start (GTK_BOX (vbox), hbox, (gboolean) FALSE, (gboolean) FALSE, 0); gtk_widget_show (hbox); #endif /* menubar or button row */ /* end top row */ /* initialize horizontal packing of second row of buttons */ #ifdef GTK2 hbox = gtk_hbox_new (FALSE, 4); #else hbox = gtk_hbox_new (FALSE, 5); #endif gtk_widget_realize (window); /* complete setup of base window, but do not show it yet - we just need a pointer to it and its color settings for the button pixmaps */ /* Second row has pixmap icons for line drawing on hexagonal, pentagonal (two orientations) and octagonal grid; left-justfied,centered and right-justified text; bondtype, move, mark and rotate mode; vertical and horizontal flipping; copying; and a text entry box */ style = gtk_widget_get_style (window); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_hex); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); hexbutton = gtk_toggle_button_new (); gtk_container_add (GTK_CONTAINER (hexbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), hexbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (hexbutton), "clicked", GTK_SIGNAL_FUNC (Change_Angle), "1"); gtk_tooltips_set_tip (tooltips, hexbutton, _("Draw at 0/30/60/90 degree angles"), NULL); gtk_widget_show (hexbutton); pent1button = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_pent1); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (pent1button), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), pent1button, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (pent1button), "clicked", GTK_SIGNAL_FUNC (Change_Angle), "2"); gtk_tooltips_set_tip (tooltips, pent1button, _("Draw at 0/36/72/... degree angles"), NULL); #ifdef MENU gtk_widget_add_accelerator (pent1button, "clicked", accel_group, GDK_F5, 0, GTK_ACCEL_VISIBLE); #endif gtk_widget_show (pent1button); pent2button = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_pent2); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (pent2button), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), pent2button, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (pent2button), "clicked", GTK_SIGNAL_FUNC (Change_Angle), "3"); gtk_tooltips_set_tip (tooltips, pent2button, _("Draw at 18/54/90/... degree angles"), NULL); gtk_widget_show (pent2button); octbutton = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_octa); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (octbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), octbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (octbutton), "clicked", GTK_SIGNAL_FUNC (Change_Angle), "4"); gtk_tooltips_set_tip (tooltips, octbutton, _("Draw at 0/45/90... degree angles"), NULL); gtk_widget_show (octbutton); splinebutton = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_spline); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (splinebutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), splinebutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (splinebutton), "clicked", GTK_SIGNAL_FUNC (Splinemode), NULL); gtk_tooltips_set_tip (tooltips, splinebutton, _("Draw curves based on 4 control points"), NULL); gtk_widget_show (splinebutton); ltextbutton = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_ltext); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (ltextbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), ltextbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (ltextbutton), "clicked", GTK_SIGNAL_FUNC (Change_Text), "0"); gtk_tooltips_set_tip (tooltips, ltextbutton, _("Draw left-justified text"), NULL); gtk_widget_show (ltextbutton); ctextbutton = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_mtext); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (ctextbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), ctextbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (ctextbutton), "clicked", GTK_SIGNAL_FUNC (Change_Text), "-1"); gtk_tooltips_set_tip (tooltips, ctextbutton, _("Draw centered text"), NULL); gtk_widget_show (ctextbutton); rtextbutton = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_rtext); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (rtextbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), rtextbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (rtextbutton), "clicked", GTK_SIGNAL_FUNC (Change_Text), "-2"); gtk_tooltips_set_tip (tooltips, rtextbutton, _("Draw right-justified text"), NULL); gtk_widget_show (rtextbutton); fontbutton = gtk_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_font); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); #if 0 fontselw=gtk_window_new(GTK_WINDOW_TOPLEVEL); fontsel=gtk_font_selection_new(); gtk_widget_show(fontsel); gtk_container_add(GTK_CONTAINER(fontselw),fontsel); gtk_widget_realize(fontselw); #endif gtk_container_add (GTK_CONTAINER (fontbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), fontbutton, (gboolean) FALSE, (gboolean) TRUE, 0); #if 0 (void)gtk_signal_connect_object (GTK_OBJECT (fontbutton), "clicked", GTK_SIGNAL_FUNC(gtk_widget_show), GTK_OBJECT(fontselw)); #else (void)gtk_signal_connect (GTK_OBJECT (fontbutton), "clicked", GTK_SIGNAL_FUNC (Change_Font), NULL); #endif gtk_tooltips_set_tip (tooltips, fontbutton, _("Set current textfont"), NULL); gtk_widget_show (fontbutton); bondomenu = gtk_option_menu_new (); bondmenu = gtk_menu_new (); group = NULL; for (i = 0; i < BONDTYPES; i++) { int ii = i; menuitem = gtk_menu_item_new(); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_bond[i]); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (menuitem), pixmapwid); gtk_container_set_border_width (GTK_CONTAINER (menuitem), 0); gtk_menu_append (GTK_MENU (bondmenu), menuitem); gtk_widget_show (menuitem); snprintf (bondnums[i],3, "%d", ii); (void)gtk_signal_connect (GTK_OBJECT (menuitem), "activate", GTK_SIGNAL_FUNC (set_bond), bondnums[i]); } gtk_option_menu_set_menu (GTK_OPTION_MENU (bondomenu), bondmenu); gtk_box_pack_start (GTK_BOX (hbox), bondomenu, (gboolean) FALSE, (gboolean) TRUE, 0); gtk_tooltips_set_tip (tooltips, bondomenu, _("Choose default bond type"), NULL); gtk_widget_show (bondomenu); penmenu = gtk_menu_new (); group = NULL; for (i = 0; i < BONDCOLORS; i++) { int ii = i; menuitem = gtk_menu_item_new(); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_color[i]); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (menuitem), pixmapwid); gtk_container_set_border_width (GTK_CONTAINER (menuitem), 0); gtk_menu_append (GTK_MENU (penmenu), menuitem); gtk_widget_show (menuitem); snprintf (bondcolors[i],3, "%d", ii); (void)gtk_signal_connect (GTK_OBJECT (menuitem), "activate", GTK_SIGNAL_FUNC (change_color), bondcolors[i]); } colorbutton= gtk_button_new(); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_color); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (colorbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), colorbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (colorbutton), "clicked", GTK_SIGNAL_FUNC (show_penmenu), NULL); gtk_tooltips_set_tip (tooltips, colorbutton, _("Select pen color"), NULL); oldpixmap=pixmapwid; gtk_widget_show (colorbutton); bondbutton = gtk_toggle_button_new_with_label (_("Bonds")); gtk_box_pack_start (GTK_BOX (hbox), bondbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (bondbutton), "clicked", GTK_SIGNAL_FUNC (Bondmode), NULL); gtk_tooltips_set_tip (tooltips, bondbutton, _("Toggle bond types"), NULL); gtk_widget_show (bondbutton); markbutton = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_mark); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (markbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), markbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (markbutton), "clicked", GTK_SIGNAL_FUNC (Markmode), NULL); gtk_tooltips_set_tip (tooltips, markbutton, _("Mark objects for moving, rotating or deleting"), NULL); gtk_widget_show (markbutton); movebutton = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_mov); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (movebutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), movebutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (movebutton), "clicked", GTK_SIGNAL_FUNC (Movemode), NULL); gtk_tooltips_set_tip (tooltips, movebutton, _("Move marked object"), NULL); gtk_widget_show (movebutton); rotatebutton = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_rot); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (rotatebutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), rotatebutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (rotatebutton), "clicked", GTK_SIGNAL_FUNC (Rotatemode), NULL); gtk_tooltips_set_tip (tooltips, rotatebutton, _("Rotate marked object"), NULL); gtk_widget_show (rotatebutton); hflipbutton = gtk_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_horiz); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (hflipbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), hflipbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (hflipbutton), "clicked", GTK_SIGNAL_FUNC (flip_horiz), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, hflipbutton, _("Flip object horizontally"), NULL); gtk_widget_show (hflipbutton); vflipbutton = gtk_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_vert); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (vflipbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), vflipbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (vflipbutton), "clicked", GTK_SIGNAL_FUNC (flip_vert), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, vflipbutton, _("Flip object vertically"), NULL); gtk_widget_show (vflipbutton); copybutton = gtk_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_copy); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (copybutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), copybutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (copybutton), "clicked", GTK_SIGNAL_FUNC (copy_obj), GTK_OBJECT (window)); (void)gtk_signal_connect_object (GTK_OBJECT (copybutton), "clicked", GTK_SIGNAL_FUNC (gtk_toggle_button_set_active), GTK_OBJECT (movebutton)); #ifdef MENU (void)gtk_signal_connect_object (GTK_OBJECT (copy), "activate", GTK_SIGNAL_FUNC (gtk_toggle_button_set_active), GTK_OBJECT (movebutton)); #endif gtk_tooltips_set_tip (tooltips, copybutton, _("Copy marked object"), NULL); gtk_widget_show (copybutton); rescalebutton = gtk_toggle_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_scale); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (rescalebutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), rescalebutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (rescalebutton), "clicked", GTK_SIGNAL_FUNC (Rescalemode), NULL); gtk_tooltips_set_tip (tooltips, rescalebutton, _("Rescale marked object"), NULL); gtk_widget_show (rescalebutton); boxmenu = gtk_menu_new (); bracketbutton = gtk_menu_item_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_bracket); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (bracketbutton), pixmapwid); gtk_menu_append (GTK_MENU (boxmenu), bracketbutton); (void)gtk_signal_connect_object (GTK_OBJECT (bracketbutton), "activate", GTK_SIGNAL_FUNC (add_bracket), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, bracketbutton, _("Draw brackets around object"), NULL); gtk_widget_show (bracketbutton); rbracketbutton = gtk_menu_item_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_r_bracket); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (rbracketbutton), pixmapwid); gtk_menu_append (GTK_MENU (boxmenu), rbracketbutton); (void)gtk_signal_connect_object (GTK_OBJECT (rbracketbutton), "activate", GTK_SIGNAL_FUNC (add_r_bracket), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, rbracketbutton, _("Draw rounded brackets around object"), NULL); gtk_widget_show (rbracketbutton); r2bracketbutton = gtk_menu_item_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_r2_bracket); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (r2bracketbutton), pixmapwid); gtk_menu_append (GTK_MENU (boxmenu), r2bracketbutton); (void)gtk_signal_connect_object (GTK_OBJECT (r2bracketbutton), "activate", GTK_SIGNAL_FUNC (add_r2_bracket), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, r2bracketbutton, _("Draw round brackets around object"), NULL); gtk_widget_show (r2bracketbutton); bracebutton = gtk_menu_item_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_brace); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (bracebutton), pixmapwid); gtk_menu_append (GTK_MENU (boxmenu), bracebutton); (void)gtk_signal_connect_object (GTK_OBJECT (bracebutton), "activate", GTK_SIGNAL_FUNC (add_brace), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, bracebutton, _("Draw braces around object"), NULL); gtk_widget_show (bracebutton); box1button = gtk_menu_item_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_box1); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (box1button), pixmapwid); gtk_menu_append (GTK_MENU (boxmenu), box1button); (void)gtk_signal_connect_object (GTK_OBJECT (box1button), "activate", GTK_SIGNAL_FUNC (add_box1), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, box1button, _("Draw simple box around object"), NULL); gtk_widget_show (box1button); box2button = gtk_menu_item_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_box2); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (box2button), pixmapwid); gtk_menu_append (GTK_MENU (boxmenu), box2button); (void)gtk_signal_connect_object (GTK_OBJECT (box2button), "activate", GTK_SIGNAL_FUNC (add_box2), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, box2button, _("Draw shaded box around object"), NULL); gtk_widget_show (box2button); box3button = gtk_menu_item_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_box3); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (box3button), pixmapwid); gtk_menu_append (GTK_MENU (boxmenu), box3button); (void)gtk_signal_connect_object (GTK_OBJECT (box3button), "activate", GTK_SIGNAL_FUNC (add_box3), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, box3button, _("Draw fancy box around object"), NULL); gtk_widget_show (box3button); box4button = gtk_menu_item_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_box4); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (box4button), pixmapwid); gtk_menu_append (GTK_MENU (boxmenu), box4button); (void)gtk_signal_connect_object (GTK_OBJECT (box4button), "activate", GTK_SIGNAL_FUNC (add_box4), GTK_OBJECT (window)); gtk_tooltips_set_tip (tooltips, box4button, _("Draw rounded box around object"), NULL); gtk_widget_show (box4button); gtk_widget_realize (boxmenu); boxbutton = gtk_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_bracket); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (boxbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), boxbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect_object (GTK_OBJECT (boxbutton), "clicked", GTK_SIGNAL_FUNC (show_boxmenu), NULL); gtk_tooltips_set_tip (tooltips, boxbutton, _("Draw brackets and boxes around object"), NULL); gtk_widget_show (boxbutton); cleanbutton = gtk_button_new (); pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) xpm_clean); pixmapwid = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwid); gdk_pixmap_unref (pixmap); gtk_container_add (GTK_CONTAINER (cleanbutton), pixmapwid); gtk_box_pack_start (GTK_BOX (hbox), cleanbutton, (gboolean) FALSE, (gboolean) TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (cleanbutton), "clicked", GTK_SIGNAL_FUNC (tidy_mol), NULL); gtk_tooltips_set_tip (tooltips, cleanbutton, _("Removes duplicate bonds, etc."), NULL); gtk_widget_show (cleanbutton); gtk_box_pack_start (GTK_BOX (vbox), hbox, (gboolean) FALSE, (gboolean) TRUE, 0); gtk_widget_show (hbox); /*end second row */ hbox=gtk_hbox_new(FALSE,0); normalfontstyle=gtk_style_copy(gtk_widget_get_default_style()); seriffontstyle=gtk_style_copy(gtk_widget_get_default_style()); #ifdef GTK2 pango_font_description_free(normalfontstyle->font_desc); normalfontstyle->font_desc=pango_font_description_from_string("Helvetica Bold 12"); pango_font_description_free(seriffontstyle->font_desc); seriffontstyle->font_desc=pango_font_description_from_string("Times Medium 12"); #else gdk_font_unref(normalfontstyle->font); normalfontstyle->font=gdk_font_load("*-helvetica-bold-r-normal--12-*"); gdk_font_unref(seriffontstyle->font); seriffontstyle->font=gdk_font_load("*-times-medium-r-normal--12-*"); if (!normalfontstyle->font) normalfontstyle=gtk_style_copy(gtk_widget_get_default_style()); if (!seriffontstyle->font) seriffontstyle=gtk_style_copy(gtk_widget_get_default_style()); #endif textlabel = gtk_label_new(_("Text :")); gtk_widget_set_style(GTK_WIDGET(textlabel),normalfontstyle); gtk_widget_show(textlabel); gtk_box_pack_start (GTK_BOX (hbox), textlabel, (gboolean) FALSE, (gboolean) TRUE, 0); textbox = gtk_entry_new_with_max_length (100); gtk_widget_set_usize(textbox,700,20); gtk_box_pack_start (GTK_BOX (hbox), textbox, (gboolean) FALSE, (gboolean) FALSE, 0); (void)gtk_signal_connect (GTK_OBJECT (textbox), "focus_in_event", (GtkSignalFunc) Set_Textmode, NULL); gtk_tooltips_set_tip (tooltips, textbox, _ ("Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0"), NULL); gtk_widget_show (textbox); fontmenu = gtk_option_menu_new (); gtk_tooltips_set_tip (tooltips, fontmenu, _("Select current text size"), NULL); fontsizes = gtk_menu_new (); for (i = 0; i < 7; i++) { fontsizeitem[i] = gtk_menu_item_new_with_label (fontsizelabel[i]); gtk_menu_append (GTK_MENU (fontsizes), fontsizeitem[i]); gtk_widget_show (fontsizeitem[i]); (void)gtk_signal_connect (GTK_OBJECT (fontsizeitem[i]), "activate", GTK_SIGNAL_FUNC (set_fontsize), GINT_TO_POINTER(i)); } gtk_option_menu_set_menu (GTK_OPTION_MENU (fontmenu), fontsizes); gtk_widget_show (fontmenu); gtk_option_menu_set_history(GTK_OPTION_MENU(fontmenu), (guint)3); gtk_box_pack_start (GTK_BOX (hbox), fontmenu, (gboolean) FALSE, (gboolean) FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, (gboolean) FALSE, (gboolean) FALSE, 0); gtk_widget_show (hbox); /* drawing area */ /***********************the canvas pixmap ***********************/ scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 10); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS); gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, (gboolean) TRUE, (gboolean) TRUE, 0); gtk_widget_show (scrolled_window); /*fprintf(stderr,"screen dimensions %d x %d\n",gdk_screen_width(),gdk_screen_height() );*/ int canvash=600; if (gdk_screen_height() < 600) canvash= 460; gtk_widget_set_usize (window, 800, canvash-20); if (!picture) picture = gdk_pixmap_new (window->window, 800, canvash, -1); drawing_area = gtk_drawing_area_new (); gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 1600, 1600); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), drawing_area); gtk_widget_show (drawing_area); mygc[0]=gdk_gc_new(window->window); (void)gdk_color_alloc(gdk_colormap_get_system(),&black); gdk_gc_set_foreground(mygc[0],&black); mygc[1]=gdk_gc_new(window->window); (void)gdk_color_alloc(gdk_colormap_get_system(),&blue); gdk_gc_set_foreground(mygc[1],&blue); mygc[2]=gdk_gc_new(window->window); (void)gdk_color_alloc(gdk_colormap_get_system(),&green); gdk_gc_set_foreground(mygc[2],&green); mygc[3]=gdk_gc_new(window->window); (void)gdk_color_alloc(gdk_colormap_get_system(),&cyan); gdk_gc_set_foreground(mygc[3],&cyan); mygc[4]=gdk_gc_new(window->window); (void)gdk_color_alloc(gdk_colormap_get_system(),&red); gdk_gc_set_foreground(mygc[4],&red); mygc[5]=gdk_gc_new(window->window); (void)gdk_color_alloc(gdk_colormap_get_system(),&magenta); gdk_gc_set_foreground(mygc[5],&magenta); mygc[6]=gdk_gc_new(window->window); (void)gdk_color_alloc(gdk_colormap_get_system(),&yellow); gdk_gc_set_foreground(mygc[6],&yellow); mygc[7]=gdk_gc_new(window->window); (void)gdk_color_alloc(gdk_colormap_get_system(),&white); gdk_gc_set_foreground(mygc[7],&white); /* highlighting for mark/move/copy */ hlgc=gdk_gc_new(window->window); gdk_gc_set_foreground(hlgc,&blue); gdk_gc_set_line_attributes(hlgc, 3,GDK_LINE_SOLID,GDK_CAP_BUTT,GDK_JOIN_MITER); /* Signals used to handle backing pixmap */ (void)gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event", (GtkSignalFunc) expose_event, NULL); (void)gtk_signal_connect (GTK_OBJECT (drawing_area), "configure_event", (GtkSignalFunc) configure_event, NULL); (void)gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event", (GtkSignalFunc) motion_notify_event, NULL); (void)gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event", (GtkSignalFunc) button_press_event, NULL); (void)gtk_signal_connect (GTK_OBJECT (drawing_area), "button_release_event", (GtkSignalFunc) button_release_event, NULL); (void)gtk_signal_connect (GTK_OBJECT (window), "key_press_event", (GtkSignalFunc) key_press_event, NULL); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); /*status line - used for cht output*/ hbox = gtk_hbox_new (FALSE, 5); gtk_widget_set_usize (hbox, 800, 20); #ifdef GTK2 msgtext = gtk_text_view_new(); gtk_text_view_set_editable(GTK_TEXT_VIEW(msgtext), (gboolean) FALSE); msgtextbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (msgtext)); #else msgtext = gtk_text_new (NULL, NULL); gtk_text_set_editable (GTK_TEXT (msgtext), (gboolean) FALSE); gtk_box_pack_start (GTK_BOX (hbox), msgtext, (gboolean) TRUE, (gboolean) TRUE, 0); #endif #ifdef GTK2 vscroll = gtk_scrolled_window_new(NULL,NULL); msgadjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(vscroll)); gtk_widget_set_usize(vscroll,790,12); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(vscroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_container_add(GTK_CONTAINER(vscroll),msgtext); #else vscroll = gtk_vscrollbar_new (GTK_TEXT (msgtext)->vadj); #endif gtk_box_pack_start (GTK_BOX (hbox), vscroll, (gboolean) FALSE, (gboolean) FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, (gboolean) FALSE, (gboolean) FALSE, 0); snprintf(msgtmp,99,_("Ready")); #ifdef GTK2 gtk_text_buffer_get_iter_at_offset (msgtextbuffer, &iter, 0); gtk_text_buffer_insert (msgtextbuffer, &iter, msgtmp, -1); #else gtk_text_insert (GTK_TEXT (msgtext), NULL, NULL, NULL, msgtmp,(gint)strlen(msgtmp)); #endif gtk_widget_show (msgtext); gtk_widget_show (vscroll); gtk_widget_show (hbox); gtk_widget_show (window); set_icon(window); /* initialize cursor shapes */ source = gdk_bitmap_create_from_data (NULL, (gchar *) pencil_bits, pencil_width, pencil_height); mask = gdk_bitmap_create_from_data (NULL, (gchar *) pencil_mask_bits, pencil_width, pencil_height); cursor_pencil = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, pencil_x_hot, pencil_y_hot); gdk_pixmap_unref (source); gdk_pixmap_unref (mask); source = gdk_bitmap_create_from_data (NULL, (gchar *) text_bits, text_width, text_height); mask = gdk_bitmap_create_from_data (NULL, (gchar *) text_mask_bits, text_width, text_height); cursor_text = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, text_x_hot, text_y_hot); gdk_pixmap_unref (source); gdk_pixmap_unref (mask); source = gdk_bitmap_create_from_data (NULL, (gchar *) bonds_bits, bonds_width, bonds_height); mask = gdk_bitmap_create_from_data (NULL, (gchar *) bonds_mask_bits, bonds_width, bonds_height); cursor_bonds = gdk_cursor_new_from_pixmap (source, mask, &fg, &wh, bonds_x_hot, bonds_y_hot); gdk_pixmap_unref (source); gdk_pixmap_unref (mask); cursor_markTLC = gdk_cursor_new (GDK_TOP_LEFT_CORNER); cursor_markBRC = gdk_cursor_new (GDK_BOTTOM_RIGHT_CORNER); cursor_move = gdk_cursor_new (GDK_FLEUR); cursor_rescale = gdk_cursor_new (GDK_SIZING); cursor_rotate = gdk_cursor_new (GDK_EXCHANGE); /* cursor_busy = gdk_cursor_new (GDK_WATCH); */ /*@ignore@ splint does not know all signal names */ (void) signal (SIGSEGV, ct_crash); (void) signal (SIGFPE, ct_crash); (void) signal (SIGBUS, ct_crash); (void) signal (SIGHUP, ct_crash); (void) signal (SIGPIPE, SIG_IGN); /*@end@*/ if (!Load_Font() ) { fprintf (stderr, _("chemtool: can't load any font\n")); exit (1); } gtk_toggle_button_set_active ((GtkToggleButton *) hexbutton, TRUE); /* default to linedrawing at hexagonal angles */ text_direct = -1; /* and centered text */ expmode = 0; /*default to xfig export */ orient = 0; printcmd = 0; epsoption = 0; use_whiteout = 0; use_intlchars = 0; strcpy (filename, _("unnamed")); gtk_file_selection_set_filename (GTK_FILE_SELECTION (expw), filename); printscale = 0.7; papersize = 0; queuename = getenv ("PRINTER"); if (queuename == (char *) NULL) { queuename = malloc (33 * sizeof (char)); strcpy (queuename, "lp"); } if (figversion ==0) { #ifdef MENU gtk_widget_set_sensitive(printps,FALSE); #else gtk_widget_set_sensitive(printbutton,FALSE); #endif gtk_widget_set_sensitive(expbutton[0],FALSE); gtk_widget_set_sensitive(expbutton[1],FALSE); gtk_widget_set_sensitive(expbutton[2],FALSE); gtk_widget_set_sensitive(expbutton[8],FALSE); } #ifndef EMF if (figversion >=3 )gtk_widget_show (expbutton[6]); #endif if (have_fig2sxd) gtk_widget_show(expbutton[7]); bgred=bgblue=bggreen=65535; readrc (); background.red=(gushort)bgred; background.green=(gushort)bggreen; background.blue=(gushort)bgblue; background_gc=gdk_gc_new(window->window); (void)gdk_color_alloc(gdk_colormap_get_system(),&background); gdk_gc_set_foreground(background_gc,&background); gdk_gc_set_background(background_gc,&background); snprintf(bghexcolor,10,"#%2.2x%2.2x%2.2x",(unsigned char)(bgred/256.),(unsigned char)(bggreen/256.),(unsigned char)(bgblue/256.)); #ifndef GTK2 gtk_label_set_text(GTK_LABEL(GTK_BUTTON(bgcolorbutton)->child),bghexcolor); gtk_entry_set_text (GTK_ENTRY (prqueue), queuename); gtk_option_menu_set_history (GTK_OPTION_MENU (papermenu), (guint)papersize); gtk_option_menu_set_history (GTK_OPTION_MENU (printcmdmenu), (guint)printcmd); gtk_option_menu_set_history (GTK_OPTION_MENU (epsoptionmenu), (guint) epsoption); gtk_spin_button_set_value ((GtkSpinButton *) pscale, printscale * 100.); if (use_whiteout==1) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(whiteoutbutton),TRUE); if (use_intlchars==1) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(intlbutton),TRUE); snprintf(msgtmp,100,"%6.4f",bondlen_mm); gtk_entry_set_text (GTK_ENTRY (base_bondlen),msgtmp); if (datadir && (int)strlen (datadir) > 1) { gtk_entry_set_text (GTK_ENTRY (defaultdir), datadir); gtk_entry_set_text (GTK_ENTRY (defaultext), datamask); gtk_file_selection_complete (GTK_FILE_SELECTION (filew), strcat (datadir, datamask)); strcpy (datadir, gtk_entry_get_text (GTK_ENTRY (defaultdir))); } #else if (datadir != NULL && (int)strlen (datadir) > 1) { char dir_mask[PATH_MAX]; strcpy (dir_mask, datadir); strcat (dir_mask, datamask); gtk_file_selection_complete (GTK_FILE_SELECTION (filew), dir_mask); } #endif mark.flag = False; head.width = 2000; head.height = 5000; zoom_factor = 2; pdbx = pdby = pdbz = NULL; atcode = NULL; atjust = bondtype = NULL; bondfrom = bondto = NULL; hp->x = hp->y = 200; hp->tx = hp->ty = 200; tmpx=(int*)NULL; tmpy=(int*)NULL; gridtype=0; gridx=gridy = 0; atnum = 0; if (argc == 2) { strcpy (filename, argv[1]); if (strstr(argv[0],"chemtoolsvg")) { load_mol(filename); strcpy(expname,filename); char *dot=strrchr(expname,'.'); if (dot) *dot='\0'; strcat(expname,".svg"); export_svg(expname); exit(0); } #if 0 if(strrchr(filename,'/')) { /* change working directory to obtain absolute path */ char dirname[256]; strcpy(dirname,filename); /* and strip path from filename - gtkfilesel may */ char *start= strrchr(dirname,'/'); *start='\0'; /* get confused by relative paths, stripping off */ start++; chdir(dirname); /* a level with every invocation of the file dialog */ memmove(filename,start,strlen(start)+1); } #endif error = load_mol (filename); switch (error) { case 0: modify = 0; mark.flag = 0; snprintf (msgtmp,99, "Chemtool %s (%s)", VERSION, filename); gtk_window_set_title (GTK_WINDOW (window), msgtmp); #ifdef LIBUNDO undo_snapshot (); #endif break; case 1: snprintf (msgtmp,99, _("Unable to open %s\n"), filename); strcpy (filename, ""); gtk_label_set_text (GTK_LABEL (message), msgtmp); gtk_widget_show (messagew); gtk_grab_add (messagew); break; case 2: snprintf (msgtmp,99, _("%s\n does not appear to be a Chemtool file\n"), filename); strcpy (filename, ""); gtk_label_set_text (GTK_LABEL (message), msgtmp); gtk_widget_show (messagew); gtk_grab_add (messagew); break; case 3: modify = 0; snprintf (msgtmp,99, _("%s was created by a newer version.\nSome features may be lost.\n"), filename); gtk_label_set_text (GTK_LABEL (message), msgtmp); gtk_widget_show (messagew); gtk_grab_add (messagew); snprintf (msgtmp,100, "Chemtool %s (%s)", VERSION, filename); gtk_window_set_title (GTK_WINDOW (window), msgtmp); #ifdef LIBUNDO undo_snapshot (); #endif break; default: clear_data (); snprintf (msgtmp,100, _("Error loading %s \n"), filename); gtk_label_set_text (GTK_LABEL (message), msgtmp); gtk_widget_show (messagew); gtk_grab_add (messagew); } } FreePix (); CreatePix (); Display_Mol (); gtk_main (); /* enter the gtk eventloop */ return 0; } void show_boxmenu () { gtk_menu_popup (GTK_MENU (boxmenu), NULL, NULL, NULL, NULL, 0, 0); } void show_penmenu () { gtk_menu_popup (GTK_MENU (penmenu), NULL, NULL, NULL, NULL, 0, 0); } void ct_crash (signal) int signal; { FILE *fp; fp = fopen ("crashdump.cht", "w"); save_mol (fp, 0); switch (signal) { case SIGSEGV: fprintf (stderr, _("Memory allocation problem (SIGSEGV) -")); break; case SIGFPE: fprintf (stderr, _("Invalid math somewhere (SIGFPE) -")); break; case SIGBUS: fprintf (stderr, _("Memory access problem (SIGBUS) -")); break; case SIGHUP: fprintf (stderr, _("Ordered to quit (SIGHUP) - ")); } fprintf (stderr, _(" dumping current drawing to file crashdump.cht\n")); fclose (fp); exit (1); } void restore_picture () { if (savedpicture) picture = gdk_pixmap_ref(savedpicture); } void getpreview (GtkWidget * w, gint row, gint column, GdkEventButton * bevent, gpointer data) { char myfile[255]; if (bevent && bevent->type == GDK_2BUTTON_PRESS) return; if (loadsave != 1 && loadsave != 3 && loadsave != 4) return; strcpy (myfile, gtk_file_selection_get_filename (GTK_FILE_SELECTION (filew))); if (picture){ gdk_pixmap_unref (picture); picture=NULL; } picture = gdk_pixmap_new (filew->window, 200, 100, -1); gdk_draw_rectangle (picture, filew->style->white_gc, (gint) TRUE, 0, 0, (gint) 200, (gint) 100); if (loadsave == 4) { sdfindex = 0; preview_mdl_mol(myfile,sdfindex); } else load_preview (myfile); } void set_icon(GtkWidget *w) { /* Set icon for the main chemtool window */ GdkWindow *win; GdkPixmap *icon; GdkBitmap *iconmask; gtk_widget_realize(w); win = w->window; if (!win) return; icon = gdk_pixmap_create_from_xpm_d(win, &iconmask, NULL, chemtool_xpm); gdk_window_set_icon(win, NULL, icon, iconmask); } chemtool-1.6.14/kde/0000755000175000001440000000000010715417303013372 5ustar martinuserschemtool-1.6.14/kde/mimelnk/0000755000175000001440000000000010715417303015026 5ustar martinuserschemtool-1.6.14/kde/mimelnk/application/0000755000175000001440000000000010715417303017331 5ustar martinuserschemtool-1.6.14/kde/mimelnk/application/x-chemtool.desktop0000644000175000001440000000021610715417303023002 0ustar martinusers[Desktop Entry] Comment=Chemtool Molecule Drawing Hidden=false Icon=chemtool.png MimeType=application/x-chemtool Patterns=*.cht Type=MimeType chemtool-1.6.14/kde/icons/0000755000175000001440000000000010715417303014505 5ustar martinuserschemtool-1.6.14/kde/icons/hicolor/0000755000175000001440000000000010715417303016144 5ustar martinuserschemtool-1.6.14/kde/icons/hicolor/32x32/0000755000175000001440000000000010715417303016725 5ustar martinuserschemtool-1.6.14/kde/icons/hicolor/32x32/mimetypes/0000755000175000001440000000000010715417303020741 5ustar martinuserschemtool-1.6.14/kde/icons/hicolor/32x32/mimetypes/chemtool.png0000644000175000001440000000360710715417303023267 0ustar martinusersPNG  IHDR00WgAMA abKGD pHYs.#.#x?vtIME  #WIDATxKl]=ݞ{X06ۼl@F/d/>).HNlF9!qCDA""%DȻha%^1 %kl rU3g]{"Rկ}_U s09;L+BhǏpС- aB FG(--exx R@i|r8@uu5RJV(%pƟs5l h }v@k_R tZdpp}~3z`ѢEرcG0M![٦3Bfd ,XȊ+-c}}}=`llD"A2`b")9 @kׯ)_议."۶y1dj,K`` 0P?J*F#=gϞJ@>K*f۶m<>L" JL&@JĄD)͖+Gix! i,0m444`&i.DT*E>hY>wxT*'1!llƲ,X֭[w/] !H9|oyT!)%QRRBii)WD=\qB۶蠣>ڊmhii|9830ӴXf-Vʇ;D&  u33W^qBh W\`-WU(8r;vkRbll (* 8"ڵk\~P?B!Pm懙Vz@&--*Zӧ7عsT}z2ƯRJNu2+=>>GGGȈCCCիɓL^@kk.䊈/_걱Qޮ%V"Y7o'NQ0Z~}aÆ7qƀt,ӭl3|dBwdsS7^IENDB`chemtool-1.6.14/kde/applnk/0000755000175000001440000000000010715417303014657 5ustar martinuserschemtool-1.6.14/kde/applnk/Graphics/0000755000175000001440000000000010715417303016417 5ustar martinuserschemtool-1.6.14/kde/applnk/Graphics/chemtool.desktop0000644000175000001440000000032510715417303021624 0ustar martinusers[Desktop Entry] Comment=Molecule Drawing Program Exec=chemtool Icon=graphics_section.xpm InitialPreference=2 MimeType=application/x-chemtool;Application Name=Chemtool ServiceTypes= Terminal=false Type=Application chemtool-1.6.14/INSTALL0000644000175000001440000001244710715417303013670 0ustar martinusersThis version contains a configure script that should generate an appropriate Makefile for your system. Simply enter ./configure to run it. On some systems it may be necessary to pass one or more options to it, e.g. to help it locate required libraries or header files, or to force a GTK1 version even if you also have GTK2 installed. Entering ./configure --help will provide a list of recognized options. Specifically for building chemtool in the CYGWIN environment under Windows, one reportedly needs to run configure as ./configure --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib \ --with-gtk-prefix=/usr/local --with-gtk-exec-prefix=/usr/local \ --with-x (the two gtk-related options may need to be adjusted to your setup, or may not be necessary). In case the configure script does not work for some reason (please let us know), or if you simply prefer the conventional method, copy the supplied Makefile.std (or the appropriate Makefile.sgi if you have an Irix box) to Makefile. To build Chemtool check the definitions at the top of the Makefile, especially the directory where the program will be installed, this defaults to /usr/local/bin. Then enter make make install All versions later than 1.1.8 require the GTK widget library and its companion Glib, both available from www.gtk.org. If you do not want to build them yourself from the sourcecode available there, there is a good chance of finding prebuilt packages for your system in most Linux distributions or the freeware archives of your commercial unix vendor (e.g. freeware.sgi.com), respectively. When building with version 1.2.x of GTK, the stock GTK functions that provide menues and fileselection dialogs are overridden by enhanced counterparts included in chemtool. If your system does not allow a binary to use the names of library functions for its internal functions, you will get error messages (perhaps even panic messages from the GTK code about NULL pointers to menues) when you try to open one of the menues in chemtool. In this case, run configure with the "--enable-stockgtk" option (or remove all references to gtkmenu and gtkfilesel from the SRCS and OBJS lines in the Makefile) and recompile. Though you will loose some nice features in chemtool (e.g. no filename masks in the Load menu, the Babel input menu may extend beyond the screen), the program should then function normally. As this problem has been observed for AIX and CYGWIN, configure on these systems selects the stock GTK code in any case. All output functions except xfig, xbm, sxd and svg depend on the transfig package, version 3.2.0 or later, available from www-epb.lbl.gov/xfig or www.xfig.org. Brian Smith's XFig drawing package is highly recommended - it supports all the things that are missing in Chemtool like general drawing functions and image import. For creation of drawings in the .sxd format used by OpenOffice, the fig2sxd program (fig2sxd.sourceforge.net) is required - chemtool will automatically detect its availability on startup and will present an SXD option in the Export menu window. Chemtool 1.6 and later can detect the presence of the program BABEL - both Pat Walters' original version, which is probably still available at the eyesopen.com website, or the more recent OpenBabel effort hosted at openbabel.sourceforge.net. When either version is available, chemtool provides another import menu for all foreign file formats supported by it (through an intermediate MDL molfile). If neither version of babel is installed, chemtool will still be able to import foreign data from PDB or MDL molfile type files. If you prefer the old user interface of chemtool-1.3 (two rows of buttons) to the new menubar, simply remove the -DMENU from the CFLAGS line in the Makefile. Recent versions provide rudimentary support for localization, with message catalogs for Czech, French, German, Netherlands, Polish, Portuguese, and Russian in addition to the English defaults. If your system does not support Gnu-style national language support (i.e. if you do not have a /usr/share/locale hierarchy), you may have to comment out or remove the LOCALEDIR entry at the top of the Makefile. (Normally, the configure script should take care of this for you.) If you want to provide national language support for another language, simply copy the chemtool.pot file in the "po" directory to YOURLANGUAGE.po, fill in the empty 'msgstr' fields with the appropriate translations of the messages in the 'msgid' fields, and then run 'msgfmt -o chemtool.mo YOURLANGUAGE.po'. (For non-(western)-european languages, it may be necessary to run 'iconv -f YOURISO -t UTF-8 -o YOURLANGUAGE.utf YOURLANGUGE.po' first (where YOURISO stands for your native encoding, something similar to ISO-8859-1) and feeding the .utf file to msgfmt.) Radek Liboskas program CHT - to determine the sum formula and molecular weight of a molecule in a regular chemtool file - is included in the src-cht subdirectory. Both the original pascal source and a (partly automatic) C translation are provided, but the Makefile uses the C version. cht needs to be compiled separately (cd src-cht; make) and copied somewhere in your regular search path (e.g. to /usr/local/bin) for chemtool to find it. The top-level Makefile should normally take care of that. Please report any bugs you may find to martin@ruby.chemie.uni-freiburg.de chemtool-1.6.14/gtkmenu.h0000644000175000001440000001323110715417303014452 0ustar martinusers/*@ignore@*/ /* splint should not check this file */ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * 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. */ /* * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #ifndef __GTK_MENU_H__ #define __GTK_MENU_H__ #include #include #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define GTK_TYPE_MENU (gtk_menu_get_type ()) #define GTK_MENU(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MENU, GtkMenu)) #define GTK_MENU_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU, GtkMenuClass)) #define GTK_IS_MENU(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_MENU)) #define GTK_IS_MENU_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU)) typedef struct _GtkMenu GtkMenu; typedef struct _GtkMenuClass GtkMenuClass; typedef void (*GtkMenuPositionFunc) (GtkMenu *menu, gint *x, gint *y, gpointer user_data); typedef void (*GtkMenuDetachFunc) (GtkWidget *attach_widget, GtkMenu *menu); struct _GtkMenu { GtkMenuShell menu_shell; GtkWidget *parent_menu_item; GtkWidget *old_active_menu_item; GtkAccelGroup *accel_group; GtkMenuPositionFunc position_func; gpointer position_func_data; /* Do _not_ touch these widgets directly. We hide the reference * count from the toplevel to the menu, so it must be restored * before operating on these widgets */ GtkWidget *toplevel; GtkWidget *tearoff_window; guint torn_off : 1; /* Internal information used for the scroll arrow handling */ gint first_scroll_child; gint last_scroll_child; gboolean top_scroll_arrow_lit; gboolean bottom_scroll_arrow_lit; guint scroll_up_source_tag; guint scroll_down_source_tag; }; struct _GtkMenuClass { GtkMenuShellClass parent_class; }; GtkType gtk_menu_get_type (void); GtkWidget* gtk_menu_new (void); /* Wrappers for the Menu Shell operations */ void gtk_menu_append (GtkMenu *menu, GtkWidget *child); void gtk_menu_prepend (GtkMenu *menu, GtkWidget *child); void gtk_menu_insert (GtkMenu *menu, GtkWidget *child, gint position); /* Display the menu onscreen */ void gtk_menu_popup (GtkMenu *menu, GtkWidget *parent_menu_shell, GtkWidget *parent_menu_item, GtkMenuPositionFunc func, gpointer data, guint button, guint32 activate_time); /* Position the menu according to its position function. Called * from gtkmenuitem.c when a menu-item changes its allocation */ void gtk_menu_reposition (GtkMenu *menu); void gtk_menu_popdown (GtkMenu *menu); /* Keep track of the last menu item selected. (For the purposes * of the option menu */ GtkWidget* gtk_menu_get_active (GtkMenu *menu); void gtk_menu_set_active (GtkMenu *menu, guint index); /* set/get the acclerator group that holds global accelerators (should * be added to the corresponding toplevel with gtk_window_add_accel_group(). */ void gtk_menu_set_accel_group (GtkMenu *menu, GtkAccelGroup *accel_group); GtkAccelGroup* gtk_menu_get_accel_group (GtkMenu *menu); /* get the accelerator group that is used internally by the menu for * underline accelerators while the menu is popped up. */ GtkAccelGroup* gtk_menu_get_uline_accel_group (GtkMenu *menu); GtkAccelGroup* gtk_menu_ensure_uline_accel_group (GtkMenu *menu); /* A reference count is kept for a widget when it is attached to * a particular widget. This is typically a menu item; it may also * be a widget with a popup menu - for instance, the Notebook widget. */ void gtk_menu_attach_to_widget (GtkMenu *menu, GtkWidget *attach_widget, GtkMenuDetachFunc detacher); void gtk_menu_detach (GtkMenu *menu); /* This should be dumped in favor of data set when the menu is popped * up - that is currently in the ItemFactory code, but should be * in the Menu code. */ GtkWidget* gtk_menu_get_attach_widget (GtkMenu *menu); void gtk_menu_set_tearoff_state (GtkMenu *menu, gboolean torn_off); /* This sets the window manager title for the window that * appears when a menu is torn off */ void gtk_menu_set_title (GtkMenu *menu, const gchar *title); void gtk_menu_reorder_child (GtkMenu *menu, GtkWidget *child, gint position); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __GTK_MENU_H__ */ /*@end@*/ chemtool-1.6.14/cht.10000644000175000001440000000401211675353463013500 0ustar martinusers.TH "CHT" "1" "June 17, 2001" "1.6.13" "User commands" .SH NAME cht \- chemtool drawings analyzer .SH SYNOPSIS .B cht .RB [ options ] .I filename.cht .SH DESCRIPTION .B cht is a commandline tool to derive the sum formula and molecular mass of the molecule depicted in a .B chemtool drawing file. It is also available from within \fBchemtool\fR to calculate these data for the current structure or a marked fragment of it. .PP .B cht currently recognizes the element symbols C, H, O, N, P, S, Si, B, Br, Cl, F, I, Al, As, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, In, K, Li, Mg, Mn, Na, Ni, Pb, Rb, Sb, Sc, Se, Sn, Sr, Te, Ti, Tl, V, Zn (that is, all main group elements except the noble gases, and the first row of transition metals) and the abbreviations Ac, Ade, Bn, Bu, iBu, tBu, Bz, BOC, Cyt, CE, DBAM, DMAM, DMTr, Et, Gua, Me, Ms, MOC, MOM, MMTr, Ph, Pr, iPr, Tf, Thy, Tol, Tr, Ts, TBDMS, TBDPS, TMS, TMTr, Ura, Z. .PP It can handle two levels of parentheses; e.g. P[OCH(CH_3)_2]_3. .PP When .B cht detects any duplicate (overlapping) bonds in the drawing file, it will prepend an exclamation mark to the calculated (and likely wrong) sum formula. .SH OPTIONS .B cht understands the following options: .TP .B \-h, \-\-help Displays brief help and list of options. .TP .B \-e, \-\-exact Calculate exact mass for MS. .TP .B \-v, \-\-verbose Be verbose. .TP .B \-d, \-\-debug Be extremely verbose. .SH BUGS .B cht can misinterpret molecules that contain the 'aromatic ring' symbol, as it uses a fixed search radius to identify the aromatic system that it denotes. It also does not handle the 'partial double bond', so you should avoid these two in drawings that you intend to use with \fBcht\fR. .PP A label that is offset from the corresponding bond end by more than five pixels is not recognized, so that the default CH2 or CH3 group enters the calculation in its place. .PP In general, one should check the plausibility of the generated sum formula wherever possible. .SH SEE ALSO .BR chemtool (1) .SH AUTHOR \fBRadek Liboska\fR chemtool-1.6.14/NEWS0000644000175000001440000002403712202270042013322 0ustar martinusersFixes and enhancements in chemtool 1.6.14 - Updated configure script to support ARM64. - Fixed potential crash during EPS output. - Fixed detection of openbabel 2.3.x Fixes and enhancements in chemtool 1.6.13 - New export option "ASY" for Asymptote files (http://asymptote.sourceforge.net) - Added support for Unicode symbol characters inserted e.g. by cut-and-paste from LibreOffice - Fixed build with newer linkers that do not resolve indirect requirements automatically - Rewritten logic for choosing to include national language support during build - Fixed crash on startup due to errors in menu icon setup - Batch mode could crash due to incomplete initialisation of color arrays - Undo/redo in "move fragment"-mode did not work as intended - Default extension is now appended to the save filename as needed - Fixed exporting to files or directories containing spaces in their names Fixes and enhancements in chemtool 1.6.12 - Batch mode operation - call chemtool as chemtoolbg or chemtool -bg If inputfile is "-", chemtool reads from stdin (typically in a pipe) and writes to chemtool. - The main window now automatically resizes to fit on small (netbook) screens - Improved clipping of bonds between labels (e.g. CH2-CH2-) - Proper escaping of special characters <,>,& in SVG output - MDL molfile output is no longer upsided down - Allow drawing of bonds in white - Pencolor button now presents a color menu - Background color is now actually written to png, (e)ps and svg files - Bulgarian translation (contributed by Svetoslav Stefanov) - Updated Polish translation (contributed by Micha Smoczyk) Fixes and enhancements in chemtool 1.6.11 - The build system was updated for easier (re)generation of localized message catalogs - Key sequences @+ and @- now generate "circle" variants of plus and minus signs - Bond length and zoom factor are now saved in chemtool files and restored on loading - Corrected length calculation for labels without sub- or superscripts (thereby fixing truncation of labels near the edges of a drawing) - Corrected positioning and inter-character spacing of labels with sub- or superscripts - Changed OpenOffice output to avoid LaTeX formatting (that fig2sxd does not support) - Improved clipping of double and triple bonds around labels in the screen view - Improved the preview function to cope with older (pre-1.6) chemtool files - The "gtklp" frontend for CUPS is now available from the "print command" menu - Updated documentation - Added a translation file for European Portuguese (contributed by Nuno Azoia) Fixes and enhancements in chemtool 1.6.10 - Added a "round parentheses" option to the bracket tool. - Added export to PNG (through fig2dev/gs). - Added template entries for morphine and several diazoles. - Improved truncation of bonds around labels in the screen view. - Redesigned Configuration dialogs. - XFig and related export modes now support text in non-western european character sets ("Times" font only) through fig2dev's "international" option. - The KDE "kprinter" frontend is now available from the "print command" configuration dialog - Cleanup no longer removes drop shadows from boxes - Fixed a potential crash with non-ascii characters in labels (including electron-pair dots) and gtk2. - Fixed menu shortcuts getting intercepted by the labeling shortcut mechanism. - Fixed width of arrowheads in ps/eps. - Fixed superscript position, national characters and arrowhead size in SVG. - Fixed a bug in SVG export that could truncate labels in subsequent save or export actions. Fixes and enhancements in chemtool 1.6.9 - Fixed placement of right-justified labels containing sub- and/or superscripts on screen and in all XFig-based export modes. - Worked around a bug in fig2dev that prevented creation of EMF files - Improved spacing of sub/superscripted labels in GTK2 builds - Corrected line spacing of triple and quadruple bonds. Fixes and enhancements in chemtool 1.6.8 - Fixed an ugly bug that could crash the program on startup, especially if it was compiled with gcc 4.0.x - Chemtool now recognizes OpenBabel 2.0 - Added a new Export function for exporting through openbabel - Modified sub/superscript text in SVG export to work around limitations in the current vesions of firefox and konqueror. Fixes and enhancements in chemtool 1.6.7 - Fixed several serious bugs related to label rendering and printing that occured when chemtool was built with GTK 2 instead of GTK 1.2 (see ChangeLog for details) - SVG export now adds a namespace header as required by current builds of the firefox browser - SVG export now uses color values instead of color names for better SVGT compatibility - The separation between the lines of multiple bonds is configurable - The keys of the numeric keypad now create two dots instead of a line for free electron pairs when the Shift key is pressed - Two new bond types for drawing filled and unfilled p orbital lobes - chemtool now checks for fig2sxd (sourceforge.net) and offers to export to OpenOffice Draw format when it is present. - rpm packages did not install the dutch locale file. Fixes and enhancements in chemtool 1.6.6 - Fixed bug in molfile preview that caused an immediate crash in 1.6.5 - Made drawing of wiggly bonds work again Fixes and enhancements in chemtool 1.6.5 - Added a Dutch translation (Myckel Habets) - Added import ability of V3000 molfiles - Added SDF file browsing/import support and molfile preview - Fixed atom name justification in the builtin MDL molfile export function and added proper translations for XH_3, XH_2, XH labels. - Fixed the builtin molfile import function to tolerate optional property blocks - Made building without locale (national language) support work again - Made building with the old, menuless user interface work again - Fixed non-portable syntax in the configure script Fixes and enhancements in chemtool 1.6.4 - Aminoacid sidechain and backbone templates. - Arrowheads of curved arrows no longer grow out of proportion. - Improved positioning of sub- and superscripts to match the screen display - xfig compound and optional whiteout box now cover sub- and superscripts - Corrected placement of non-subscripted left-justified labels - Latex symbol translations for degree, plusminus and copyright sign. - Cleaned up X11 font dependencies to be either 75 or 100dpi, not both. - Added KDE directory install targets to the Makefile to allow installation to a temporary directory (Debian-like installations mainly). - chemtool now compiles with GTK 2.x if it is available (this offers the potential for non-western localisations). Fixes and enhancements in chemtool 1.6.3 - Chemtool should now build and run cleanly on 64 bit systems and OS X - Sum formula/molecular weight program now handles the second and third row of transition elements. Fixes and enhancements in chemtool 1.6.2 - Right justified labels are no longer offset by one character position when the drawing is exported. - It is now possible to move bonds by dragging them in 'Move' mode without first having to mark them as a fragment. - configure now searches for KDE in /opt/kde3 and /opt/kde2 as well. Fixes and enhancements in chemtool 1.6.1 - chemtool should now work equally well with either the 75dpi or 100dpi XFree86 raster fonts (1.6 absolutely required the 75dpi fonts) - improvements to bond pruning underneath labels - better positioning of right-justified labels, better clipping limits around labels - better formatting of labels containing parentheses - syntax fixes (missing $s) for greek/special characters, and proper escaping of isolated percent and dollar characters in Latex export. - various improvements in the SVG export - support for direct entering of labels in the bond drawing modes, and improved updating of label properties - translated messages were truncated in some cases in 1.6 - portability fix (undo memory handling) for some SGI Irix variants - Updated French and Brazilian translations - Updated documentation New features in chemtool 1.6 - universal import mode based on BABEL (both openbabel and babel supported) - Formula weight calculator now handles all main group elements and the first row of transition elements, and accepts greek phi as phenyl substituent. - Movable hexagonal or square grid backdrop - Improved SVG export, optional preview bitmaps in EPS export, optional EMF export - Cursor key support for pixel-precise drawing and moving - The cleanup function now corrects bonds that deviate from ideal horizontal or vertical orientation by a single pixel - Color support (bonds and text can be red,green,blue,cyan,magenta or yellow). - Default bond length now configurable, additional grid positions at two and three times this length added - Added a brief help text to accompany the 'About' window in the 'Help' menu. - Added alternate text font (Times Roman) - An attachment site can be marked before saving a molecule or fragment, which act as reference point for adding this fragment to other molecules (previously, this had to be the first atom in a file). Attachment sites are marked in the preview window by a small x. - Background color can now be chosen for screen display and EPS export, and drawing whiteout boxes under labels is now an option ( off by default !). - Text at 8,10,12,14,17,20 and 24pt can now coexist in a drawing. - Increased allowed label length to 100. - Improved rendering of dashed wedge and dotted lines - Improved text kerning in xfig-based print and export. - It is now possible to place an auto-incrementing counter at the cursor position for numbering sites. - Changed double bond drawing code to no longer switch sides depending on drawing (or rotation) angle. (As a result of this, some older drawings will need fixing) - Rescaling a molecule now also scales its labels. Downscaling beyond zero size (causing strange inversions) is no longer possible. - Renamed the "Orbitals" template menu to "Symbols" and added "plus", "minus" and a rearrangement arrow to it. - Added two new bond types, a triple bond with all three lines equal, and a quadruple bond. chemtool-1.6.14/config.sub0000755000175000001440000010316712202253333014614 0ustar martinusers#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-11-20' # 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 GNU 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. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # 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, 2006, 2007, 2008 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* | \ kopensolaris*-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 | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -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 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | 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 \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # 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-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | 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-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | 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-* | tile-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # 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 ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; 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 ;; cr16) basic_machine=cr16-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 ;; dicos) basic_machine=i686-pc os=-dicos ;; 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 ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; 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 ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; 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 ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; 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 ;; z80-*-coff) basic_machine=z80-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[24]aeb | 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. -auroraux) os=-auroraux ;; -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* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -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* | -cegcc* \ | -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* | -es*) # 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 ;; -dicos*) os=-dicos ;; -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 ;; -cnk*|-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: chemtool-1.6.14/intl/0000755000175000001440000000000010715417303013575 5ustar martinuserschemtool-1.6.14/intl/vasnprintf.c0000644000175000001440000005304410715417303016141 0ustar martinusers/* vsprintf with automatic memory allocation. 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Tell glibc's to provide a prototype for snprintf(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #ifndef IN_LIBINTL # include #endif /* Specification. */ #if WIDE_CHAR_VERSION # include "vasnwprintf.h" #else # include "vasnprintf.h" #endif #include /* snprintf(), sprintf() */ #include /* abort(), malloc(), realloc(), free() */ #include /* memcpy(), strlen() */ #include /* errno */ #include /* CHAR_BIT */ #include /* DBL_MAX_EXP, LDBL_MAX_EXP */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Checked size_t computations. */ #include "xsize.h" #ifdef HAVE_WCHAR_T # ifdef HAVE_WCSLEN # define local_wcslen wcslen # else /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid a dependency towards this library, here is a local substitute. Define this substitute only once, even if this file is included twice in the same compilation unit. */ # ifndef local_wcslen_defined # define local_wcslen_defined 1 static size_t local_wcslen (const wchar_t *s) { const wchar_t *ptr; for (ptr = s; *ptr != (wchar_t) 0; ptr++) ; return ptr - s; } # endif # endif #endif #if WIDE_CHAR_VERSION # define VASNPRINTF vasnwprintf # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives # define PRINTF_PARSE wprintf_parse # define USE_SNPRINTF 1 # if HAVE_DECL__SNWPRINTF /* On Windows, the function swprintf() has a different signature than on Unix; we use the _snwprintf() function instead. */ # define SNPRINTF _snwprintf # else /* Unix. */ # define SNPRINTF swprintf # endif #else # define VASNPRINTF vasnprintf # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives # define PRINTF_PARSE printf_parse # define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) # if HAVE_DECL__SNPRINTF /* Windows. */ # define SNPRINTF _snprintf # else /* Unix. */ # define SNPRINTF snprintf # endif #endif CHAR_T * VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args) { DIRECTIVES d; arguments a; if (PRINTF_PARSE (format, &d, &a) < 0) { errno = EINVAL; return NULL; } #define CLEANUP() \ free (d.dir); \ if (a.arg) \ free (a.arg); if (printf_fetchargs (args, &a) < 0) { CLEANUP (); errno = EINVAL; return NULL; } { size_t buf_neededlength; CHAR_T *buf; CHAR_T *buf_malloced; const CHAR_T *cp; size_t i; DIRECTIVE *dp; /* Output string accumulator. */ CHAR_T *result; size_t allocated; size_t length; /* Allocate a small buffer that will hold a directive passed to sprintf or snprintf. */ buf_neededlength = xsum4 (7, d.max_width_length, d.max_precision_length, 6); #if HAVE_ALLOCA if (buf_neededlength < 4000 / sizeof (CHAR_T)) { buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T)); buf_malloced = NULL; } else #endif { size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T)); if (size_overflow_p (buf_memsize)) goto out_of_memory_1; buf = (CHAR_T *) malloc (buf_memsize); if (buf == NULL) goto out_of_memory_1; buf_malloced = buf; } if (resultbuf != NULL) { result = resultbuf; allocated = *lengthp; } else { result = NULL; allocated = 0; } length = 0; /* Invariants: result is either == resultbuf or == NULL or malloc-allocated. If length > 0, then result != NULL. */ /* Ensures that allocated >= needed. Aborts through a jump to out_of_memory if needed is SIZE_MAX or otherwise too big. */ #define ENSURE_ALLOCATION(needed) \ if ((needed) > allocated) \ { \ size_t memory_size; \ CHAR_T *memory; \ \ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ if ((needed) > allocated) \ allocated = (needed); \ memory_size = xtimes (allocated, sizeof (CHAR_T)); \ if (size_overflow_p (memory_size)) \ goto out_of_memory; \ if (result == resultbuf || result == NULL) \ memory = (CHAR_T *) malloc (memory_size); \ else \ memory = (CHAR_T *) realloc (result, memory_size); \ if (memory == NULL) \ goto out_of_memory; \ if (result == resultbuf && length > 0) \ memcpy (memory, result, length * sizeof (CHAR_T)); \ result = memory; \ } for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) { if (cp != dp->dir_start) { size_t n = dp->dir_start - cp; size_t augmented_length = xsum (length, n); ENSURE_ALLOCATION (augmented_length); memcpy (result + length, cp, n * sizeof (CHAR_T)); length = augmented_length; } if (i == d.count) break; /* Execute a single directive. */ if (dp->conversion == '%') { size_t augmented_length; if (!(dp->arg_index == ARG_NONE)) abort (); augmented_length = xsum (length, 1); ENSURE_ALLOCATION (augmented_length); result[length] = '%'; length = augmented_length; } else { if (!(dp->arg_index != ARG_NONE)) abort (); if (dp->conversion == 'n') { switch (a.arg[dp->arg_index].type) { case TYPE_COUNT_SCHAR_POINTER: *a.arg[dp->arg_index].a.a_count_schar_pointer = length; break; case TYPE_COUNT_SHORT_POINTER: *a.arg[dp->arg_index].a.a_count_short_pointer = length; break; case TYPE_COUNT_INT_POINTER: *a.arg[dp->arg_index].a.a_count_int_pointer = length; break; case TYPE_COUNT_LONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longint_pointer = length; break; #ifdef HAVE_LONG_LONG case TYPE_COUNT_LONGLONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; break; #endif default: abort (); } } else { arg_type type = a.arg[dp->arg_index].type; CHAR_T *p; unsigned int prefix_count; int prefixes[2]; #if !USE_SNPRINTF size_t tmp_length; CHAR_T tmpbuf[700]; CHAR_T *tmp; /* Allocate a temporary buffer of sufficient size for calling sprintf. */ { size_t width; size_t precision; width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->width_arg_index].a.a_int; width = (arg < 0 ? (unsigned int) (-arg) : arg); } else { const CHAR_T *digitp = dp->width_start; do width = xsum (xtimes (width, 10), *digitp++ - '0'); while (digitp != dp->width_end); } } precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->precision_arg_index].a.a_int; precision = (arg < 0 ? 0 : arg); } else { const CHAR_T *digitp = dp->precision_start + 1; precision = 0; do precision = xsum (xtimes (precision, 10), *digitp++ - '0'); while (digitp != dp->precision_end); } } switch (dp->conversion) { case 'd': case 'i': case 'u': # ifdef HAVE_LONG_LONG if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ break; case 'o': # ifdef HAVE_LONG_LONG if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ break; case 'x': case 'X': # ifdef HAVE_LONG_LONG if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading sign or alternate form */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading sign or alternate form */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading sign or alternate form */ break; case 'f': case 'F': # ifdef HAVE_LONG_DOUBLE if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ else # endif tmp_length = (unsigned int) (DBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ tmp_length = xsum (tmp_length, precision); break; case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': tmp_length = 12; /* sign, decimal point, exponent etc. */ tmp_length = xsum (tmp_length, precision); break; case 'c': # if defined HAVE_WINT_T && !WIDE_CHAR_VERSION if (type == TYPE_WIDE_CHAR) tmp_length = MB_CUR_MAX; else # endif tmp_length = 1; break; case 's': # ifdef HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { tmp_length = local_wcslen (a.arg[dp->arg_index].a.a_wide_string); # if !WIDE_CHAR_VERSION tmp_length = xtimes (tmp_length, MB_CUR_MAX); # endif } else # endif tmp_length = strlen (a.arg[dp->arg_index].a.a_string); break; case 'p': tmp_length = (unsigned int) (sizeof (void *) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading 0x */ break; default: abort (); } if (tmp_length < width) tmp_length = width; tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ } if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T)) tmp = tmpbuf; else { size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); if (size_overflow_p (tmp_memsize)) /* Overflow, would lead to out of memory. */ goto out_of_memory; tmp = (CHAR_T *) malloc (tmp_memsize); if (tmp == NULL) /* Out of memory. */ goto out_of_memory; } #endif /* Construct the format string for calling snprintf or sprintf. */ p = buf; *p++ = '%'; if (dp->flags & FLAG_GROUP) *p++ = '\''; if (dp->flags & FLAG_LEFT) *p++ = '-'; if (dp->flags & FLAG_SHOWSIGN) *p++ = '+'; if (dp->flags & FLAG_SPACE) *p++ = ' '; if (dp->flags & FLAG_ALT) *p++ = '#'; if (dp->flags & FLAG_ZERO) *p++ = '0'; if (dp->width_start != dp->width_end) { size_t n = dp->width_end - dp->width_start; memcpy (p, dp->width_start, n * sizeof (CHAR_T)); p += n; } if (dp->precision_start != dp->precision_end) { size_t n = dp->precision_end - dp->precision_start; memcpy (p, dp->precision_start, n * sizeof (CHAR_T)); p += n; } switch (type) { #ifdef HAVE_LONG_LONG case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: *p++ = 'l'; /*FALLTHROUGH*/ #endif case TYPE_LONGINT: case TYPE_ULONGINT: #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: #endif #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: #endif *p++ = 'l'; break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: *p++ = 'L'; break; #endif default: break; } *p = dp->conversion; #if USE_SNPRINTF p[1] = '%'; p[2] = 'n'; p[3] = '\0'; #else p[1] = '\0'; #endif /* Construct the arguments for calling snprintf or sprintf. */ prefix_count = 0; if (dp->width_arg_index != ARG_NONE) { if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; } if (dp->precision_arg_index != ARG_NONE) { if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; } #if USE_SNPRINTF /* Prepare checking whether snprintf returns the count via %n. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; #endif for (;;) { size_t maxlen; int count; int retcount; maxlen = allocated - length; count = -1; retcount = 0; #if USE_SNPRINTF # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ retcount = SNPRINTF (result + length, maxlen, buf, \ arg, &count); \ break; \ case 1: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], arg, &count); \ break; \ case 2: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], prefixes[1], arg, \ &count); \ break; \ default: \ abort (); \ } #else # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ count = sprintf (tmp, buf, arg); \ break; \ case 1: \ count = sprintf (tmp, buf, prefixes[0], arg); \ break; \ case 2: \ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ arg); \ break; \ default: \ abort (); \ } #endif switch (type) { case TYPE_SCHAR: { int arg = a.arg[dp->arg_index].a.a_schar; SNPRINTF_BUF (arg); } break; case TYPE_UCHAR: { unsigned int arg = a.arg[dp->arg_index].a.a_uchar; SNPRINTF_BUF (arg); } break; case TYPE_SHORT: { int arg = a.arg[dp->arg_index].a.a_short; SNPRINTF_BUF (arg); } break; case TYPE_USHORT: { unsigned int arg = a.arg[dp->arg_index].a.a_ushort; SNPRINTF_BUF (arg); } break; case TYPE_INT: { int arg = a.arg[dp->arg_index].a.a_int; SNPRINTF_BUF (arg); } break; case TYPE_UINT: { unsigned int arg = a.arg[dp->arg_index].a.a_uint; SNPRINTF_BUF (arg); } break; case TYPE_LONGINT: { long int arg = a.arg[dp->arg_index].a.a_longint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGINT: { unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_LONG case TYPE_LONGLONGINT: { long long int arg = a.arg[dp->arg_index].a.a_longlongint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGLONGINT: { unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; SNPRINTF_BUF (arg); } break; #endif case TYPE_DOUBLE: { double arg = a.arg[dp->arg_index].a.a_double; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: { long double arg = a.arg[dp->arg_index].a.a_longdouble; SNPRINTF_BUF (arg); } break; #endif case TYPE_CHAR: { int arg = a.arg[dp->arg_index].a.a_char; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: { wint_t arg = a.arg[dp->arg_index].a.a_wide_char; SNPRINTF_BUF (arg); } break; #endif case TYPE_STRING: { const char *arg = a.arg[dp->arg_index].a.a_string; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: { const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; SNPRINTF_BUF (arg); } break; #endif case TYPE_POINTER: { void *arg = a.arg[dp->arg_index].a.a_pointer; SNPRINTF_BUF (arg); } break; default: abort (); } #if USE_SNPRINTF /* Portability: Not all implementations of snprintf() are ISO C 99 compliant. Determine the number of bytes that snprintf() has produced or would have produced. */ if (count >= 0) { /* Verify that snprintf() has NUL-terminated its result. */ if (count < maxlen && result[length + count] != '\0') abort (); /* Portability hack. */ if (retcount > count) count = retcount; } else { /* snprintf() doesn't understand the '%n' directive. */ if (p[1] != '\0') { /* Don't use the '%n' directive; instead, look at the snprintf() return value. */ p[1] = '\0'; continue; } else { /* Look at the snprintf() return value. */ if (retcount < 0) { /* HP-UX 10.20 snprintf() is doubly deficient: It doesn't understand the '%n' directive, *and* it returns -1 (rather than the length that would have been required) when the buffer is too small. */ size_t bigger_need = xsum (xtimes (allocated, 2), 12); ENSURE_ALLOCATION (bigger_need); continue; } else count = retcount; } } #endif /* Attempt to handle failure. */ if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EINVAL; return NULL; } #if !USE_SNPRINTF if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); #endif /* Make room for the result. */ if (count >= maxlen) { /* Need at least count bytes. But allocate proportionally, to avoid looping eternally if snprintf() reports a too small count. */ size_t n = xmax (xsum (length, count), xtimes (allocated, 2)); ENSURE_ALLOCATION (n); #if USE_SNPRINTF continue; #endif } #if USE_SNPRINTF /* The snprintf() result did fit. */ #else /* Append the sprintf() result. */ memcpy (result + length, tmp, count * sizeof (CHAR_T)); if (tmp != tmpbuf) free (tmp); #endif length += count; break; } } } } /* Add the final NUL. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; if (result != resultbuf && length + 1 < allocated) { /* Shrink the allocated memory if possible. */ CHAR_T *memory; memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T)); if (memory != NULL) result = memory; } if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); *lengthp = length; return result; out_of_memory: if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); out_of_memory_1: CLEANUP (); errno = ENOMEM; return NULL; } } #undef SNPRINTF #undef USE_SNPRINTF #undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef VASNPRINTF chemtool-1.6.14/intl/localcharset.c0000644000175000001440000002435710715417303016420 0ustar martinusers/* Determine a canonical name for the current locale's character encoding. Copyright (C) 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "localcharset.h" #if HAVE_STDDEF_H # include #endif #include #if HAVE_STRING_H # include #else # include #endif #if HAVE_STDLIB_H # include #endif #if defined _WIN32 || defined __WIN32__ # undef WIN32 /* avoid warning on mingw32 */ # define WIN32 #endif #if defined __EMX__ /* Assume EMX program runs on OS/2, even if compiled under DOS. */ # define OS2 #endif #if !defined WIN32 # if HAVE_LANGINFO_CODESET # include # else # if HAVE_SETLOCALE # include # endif # endif #elif defined WIN32 # 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 #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, 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 () { const char *cp; cp = charset_aliases; if (cp == NULL) { #if !(defined VMS || defined WIN32) FILE *fp; const char *dir = relocate (LIBDIR); const char *base = "charset.alias"; char *file_name; /* 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. */ int c; char buf1[50+1]; char buf2[50+1]; char *res_ptr = NULL; size_t res_size = 0; size_t l1, l2; for (;;) { 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); 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; 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 /* 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" "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"; # 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 () { const char *codeset; const char *aliases; #if !(defined WIN32 || defined OS2) # if HAVE_LANGINFO_CODESET /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); # 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 HAVE_SETLOCALE && 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 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; } chemtool-1.6.14/intl/loadmsgcat.c0000644000175000001440000010723710715417303016071 0ustar martinusers/* Load needed message catalogs. Copyright (C) 1995-1999, 2000-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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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" #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 __open # define close __close # define read __read # define mmap __mmap # define munmap __munmap #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; } /* Initialize the codeset dependent parts of an opened message catalog. Return the header entry. */ const char * internal_function _nl_init_domain_conv (struct loaded_l10nfile *domain_file, struct loaded_domain *domain, struct binding *domainbinding) { /* 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. */ char *nullentry; size_t nullentrylen; /* Preinitialize fields, to avoid recursion during _nl_find_msg. */ domain->codeset_cntr = (domainbinding != NULL ? domainbinding->codeset_cntr : 0); #ifdef _LIBC domain->conv = (__gconv_t) -1; #else # if HAVE_ICONV domain->conv = (iconv_t) -1; # endif #endif domain->conv_tab = NULL; /* Get the header entry. */ nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen); if (nullentry != NULL) { #if defined _LIBC || HAVE_ICONV 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 /* 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. Moreover, the value specified through bind_textdomain_codeset overrides both. */ if (domainbinding != NULL && domainbinding->codeset != NULL) outcharset = domainbinding->codeset; else { outcharset = getenv ("OUTPUT_CHARSET"); if (outcharset == NULL || outcharset[0] == '\0') { # ifdef _LIBC outcharset = _NL_CURRENT (LC_CTYPE, CODESET); # else # if HAVE_ICONV extern const char *locale_charset (void); outcharset = locale_charset (); # endif # endif } } # ifdef _LIBC /* We always want to use transliteration. */ outcharset = norm_add_slashes (outcharset, "TRANSLIT"); charset = norm_add_slashes (charset, NULL); if (__gconv_open (outcharset, charset, &domain->conv, GCONV_AVOID_NOCONV) != __GCONV_OK) domain->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; domain->conv = iconv_open (outcharset, charset); freea (outcharset); } else # endif domain->conv = iconv_open (outcharset, charset); # endif # endif freea (charset); } #endif /* _LIBC || HAVE_ICONV */ } return nullentry; } /* Frees the codeset dependent parts of an opened message catalog. */ void internal_function _nl_free_domain_conv (struct loaded_domain *domain) { if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1) free (domain->conv_tab); #ifdef _LIBC if (domain->conv != (__gconv_t) -1) __gconv_close (domain->conv); #else # if HAVE_ICONV if (domain->conv != (iconv_t) -1) iconv_close (domain->conv); # endif #endif } /* 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) { int fd; 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; 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) return; /* Try to open the addressed file. */ fd = open (domain_file->filename, O_RDONLY | O_BINARY); if (fd == -1) return; /* 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. */ close (fd); return; } #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); 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) return; 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 close (fd); return; } read_ptr += nb; to_read -= nb; } while (to_read > 0); close (fd); } /* Using the magic number we can test whether it really is a message catalog file. */ if (__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); return; } domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain)); if (domain == NULL) return; 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 = 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; return; } /* Now initialize the character set converter from the character set the file is encoded with (found in the header entry) to the domain's specified character set or the locale's character set. */ nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding); /* Also look for a plural specification. */ EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); } #ifdef _LIBC void internal_function _nl_unload_domain (struct loaded_domain *domain) { if (domain->plural != &__gettext_germanic_plural) __gettext_free_exp (domain->plural); _nl_free_domain_conv (domain); 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 chemtool-1.6.14/intl/gmo.h0000644000175000001440000001134510715417303014534 0ustar martinusers/* Description of GNU message catalog format: general file layout. Copyright (C) 1995, 1997, 2000-2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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; }; /* 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 { /* Size of static segment. */ nls_uint32 segsize; /* Reference to system dependent string segment, or ~0 at the end. */ nls_uint32 sysdepref; } 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 */ chemtool-1.6.14/intl/dgettext.c0000644000175000001440000000336510715417303015600 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 chemtool-1.6.14/intl/xsize.h0000644000175000001440000000672210715417303015117 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 */ chemtool-1.6.14/intl/config.charset0000755000175000001440000004340610715417303016427 0ustar martinusers#! /bin/sh # Output a system dependent table of character encoding aliases. # # Copyright (C) 2000-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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # 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 darwin # ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd darwin # ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd darwin # ISO-8859-3 Y glibc solaris # ISO-8859-4 Y osf solaris freebsd darwin # ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd darwin # ISO-8859-6 Y glibc aix hpux solaris # ISO-8859-7 Y glibc aix hpux irix osf solaris # ISO-8859-8 Y glibc aix hpux osf solaris # ISO-8859-9 Y glibc aix hpux irix osf solaris # ISO-8859-13 glibc # ISO-8859-14 glibc # ISO-8859-15 glibc aix osf solaris freebsd # KOI8-R Y glibc solaris freebsd darwin # KOI8-U Y glibc freebsd 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 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 darwin woe32 # CP1252 aix woe32 # CP1253 woe32 # CP1254 woe32 # CP1255 glibc woe32 # CP1256 woe32 # CP1257 woe32 # GB2312 Y glibc aix hpux irix solaris freebsd darwin # EUC-JP Y glibc aix hpux irix osf solaris freebsd darwin # EUC-KR Y glibc aix hpux irix osf solaris freebsd darwin # EUC-TW glibc aix hpux irix osf solaris # BIG5 Y glibc aix hpux osf solaris freebsd darwin # BIG5-HKSCS glibc solaris # GBK glibc aix osf solaris woe32 dos # GB18030 glibc solaris # SHIFT_JIS Y hpux osf solaris freebsd 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 # # 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-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*) # 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" ;; 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 chemtool-1.6.14/intl/Makefile.in0000644000175000001440000003762610715417303015660 0ustar martinusers# Makefile for directory with message catalog handling library of GNU gettext # Copyright (C) 1995-1998, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. VPATH = $(srcdir) prefix = @prefix@ exec_prefix = @exec_prefix@ transform = @program_transform_name@ libdir = @libdir@ includedir = @includedir@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/intl aliaspath = $(localedir) subdir = intl INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) l = @INTL_LIBTOOL_SUFFIX_PREFIX@ AR = ar CC = @CC@ LIBTOOL = @LIBTOOL@ RANLIB = @RANLIB@ YACC = @INTLBISON@ -y -d YFLAGS = --name-prefix=__gettext DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ -DLIBDIR=\"$(libdir)\" -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@ LDFLAGS = @LDFLAGS@ 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 \ relocatable.h \ 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 \ 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 \ relocatable.c \ localename.c \ log.c \ printf.c \ osdep.c \ os2compat.c \ intl-compat.c OBJECTS = \ bindtextdom.$lo \ dcgettext.$lo \ dgettext.$lo \ gettext.$lo \ finddomain.$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 \ relocatable.$lo \ localename.$lo \ log.$lo \ printf.$lo \ osdep.$lo \ intl-compat.$lo DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) DISTFILES.generated = plural.c DISTFILES.normal = VERSION DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \ libgnuintl.h_vms Makefile.vms \ libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc 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 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) $(LIBTOOL) --mode=link \ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \ -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=7 LTV_REVISION=0 LTV_AGE=4 .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 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 relocatable.lo: $(srcdir)/relocatable.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.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 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 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 '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 > libgnuintl.h libintl.h: libgnuintl.h cp libgnuintl.h 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 \ $(mkinstalldirs) $(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; then \ $(mkinstalldirs) $(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 || $(mkinstalldirs) $(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; \ $(mkinstalldirs) $(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 \ $(mkinstalldirs) $(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 installdirs: if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no; then \ $(mkinstalldirs) $(DESTDIR)$(libdir); \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ $(mkinstalldirs) $(DESTDIR)$(localedir); \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(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; 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 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 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 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 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); \ 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) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: chemtool-1.6.14/intl/dcgettext.c0000644000175000001440000000341510715417303015737 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 chemtool-1.6.14/intl/localename.c0000644000175000001440000007413510715417303016053 0ustar martinusers/* Determine the current selected locale. Copyright (C) 1995-1999, 2000-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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Ulrich Drepper , 1995. */ /* Win32 code written by Tor Lillqvist . */ #ifdef HAVE_CONFIG_H # include #endif #include #include #if defined _WIN32 || defined __WIN32__ # undef WIN32 /* avoid warning on mingw32 */ # define WIN32 #endif #ifdef WIN32 # 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 0x00 # endif # ifndef SUBLANG_BENGALI_BANGLADESH # define SUBLANG_BENGALI_BANGLADESH 0x01 # 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 0x00 # endif # ifndef SUBLANG_PUNJABI_PAKISTAN # define SUBLANG_PUNJABI_PAKISTAN 0x01 # endif # ifndef SUBLANG_ROMANIAN_ROMANIA # define SUBLANG_ROMANIAN_ROMANIA 0x00 # endif # ifndef SUBLANG_ROMANIAN_MOLDOVA # define SUBLANG_ROMANIAN_MOLDOVA 0x01 # endif # ifndef SUBLANG_SERBIAN_LATIN # define SUBLANG_SERBIAN_LATIN 0x02 # endif # ifndef SUBLANG_SERBIAN_CYRILLIC # define SUBLANG_SERBIAN_CYRILLIC 0x03 # endif # ifndef SUBLANG_SINDHI_INDIA # define SUBLANG_SINDHI_INDIA 0x00 # endif # ifndef SUBLANG_SINDHI_PAKISTAN # define SUBLANG_SINDHI_PAKISTAN 0x01 # 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_LATIN # define SUBLANG_TAMAZIGHT_LATIN 0x02 # endif # ifndef SUBLANG_TIGRINYA_ETHIOPIA # define SUBLANG_TIGRINYA_ETHIOPIA 0x00 # endif # ifndef SUBLANG_TIGRINYA_ERITREA # define SUBLANG_TIGRINYA_ERITREA 0x01 # 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 /* 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 __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 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 * _nl_locale_name (int category, const char *categoryname) { const char *retval; #ifndef WIN32 /* 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 retval = setlocale (category, NULL); # else /* Setting of LC_ALL overwrites all other. */ retval = getenv ("LC_ALL"); if (retval == NULL || retval[0] == '\0') { /* Next comes the name of the desired category. */ retval = getenv (categoryname); if (retval == NULL || retval[0] == '\0') { /* Last possibility is the LANG environment variable. */ retval = getenv ("LANG"); if (retval == NULL || retval[0] == '\0') /* We use C as the default domain. POSIX says this is implementation defined. */ retval = "C"; } } # endif return retval; #else /* WIN32 */ /* 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. */ LCID lcid; LANGID langid; int primary, sub; /* Let the user override the system settings through environment variables, as on POSIX systems. */ retval = getenv ("LC_ALL"); if (retval != NULL && retval[0] != '\0') return retval; retval = getenv (categoryname); if (retval != NULL && retval[0] != '\0') return retval; retval = getenv ("LANG"); if (retval != NULL && retval[0] != '\0') return retval; /* 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: 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: 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 "no_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: 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_INDIA: return "sd_IN"; case SUBLANG_SINDHI_PAKISTAN: return "sd_PK"; } 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_LATIN: return "ber_MA@latin"; } return "ber_MA"; case LANG_TAMIL: 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 } chemtool-1.6.14/intl/ref-add.sin0000644000175000001440000000210110715417303015604 0ustar martinusers# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # 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:/ } chemtool-1.6.14/intl/relocatable.h0000644000175000001440000000523510715417303016230 0ustar martinusers/* Provide relocatable packages. Copyright (C) 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 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 */ chemtool-1.6.14/intl/vasnwprintf.h0000644000175000001440000000330210715417303016325 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 */ chemtool-1.6.14/intl/localcharset.h0000644000175000001440000000255710715417303016423 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 */ chemtool-1.6.14/intl/locale.alias0000644000175000001440000000512210715417303016047 0ustar martinusers# Locale name alias data base. # Copyright (C) 1996-2001,2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # 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 far from being complete. If you have a value for # your own site which you think might be useful for others too, share # it with the rest of us. Send it using the `glibcbug' script to # bugs@gnu.org. # 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 chemtool-1.6.14/intl/eval-plural.h0000644000175000001440000000532210715417303016174 0ustar martinusers/* Plural expression evaluation. Copyright (C) 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef STATIC #define STATIC static #endif /* Evaluate the plural expression and return an index value. */ STATIC unsigned long int internal_function plural_eval (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; } chemtool-1.6.14/intl/osdep.c0000644000175000001440000000164310715417303015057 0ustar martinusers/* OS dependent parts of libintl. 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if defined __EMX__ # include "os2compat.c" #else /* Avoid AIX compiler warning. */ typedef int dummy; #endif chemtool-1.6.14/intl/plural-exp.h0000644000175000001440000000773310715417303016051 0ustar martinusers/* Expression parsing and evaluation for plural form selection. Copyright (C) 2000-2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _PLURAL_EXP_H #define _PLURAL_EXP_H #ifndef internal_function # define internal_function #endif #ifndef attribute_hidden # define attribute_hidden #endif /* This is the representation of the expressions to determine the plural form. */ struct expression { int nargs; /* Number of arguments. */ enum 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. */ } 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, struct expression **pluralp, unsigned long int *npluralsp) internal_function; #if !defined (_LIBC) && !defined (IN_LIBINTL) extern unsigned long int plural_eval (struct expression *pexp, unsigned long int n); #endif #endif /* _PLURAL_EXP_H */ chemtool-1.6.14/intl/printf-parse.c0000644000175000001440000002733310715417303016363 0ustar martinusers/* Formatted output to strings. Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Get size_t, NULL. */ #include /* Get intmax_t. */ #if HAVE_STDINT_H_WITH_UINTMAX # include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX # include #endif /* malloc(), realloc(), free(). */ #include /* Checked size_t computations. */ #include "xsize.h" #if WIDE_CHAR_VERSION # define PRINTF_PARSE wprintf_parse # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives #else # define PRINTF_PARSE printf_parse # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives #endif #ifdef STATIC STATIC #endif int PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) { const CHAR_T *cp = format; /* pointer into format */ size_t arg_posn = 0; /* number of regular arguments consumed */ size_t d_allocated; /* allocated elements of d->dir */ size_t a_allocated; /* allocated elements of a->arg */ size_t max_width_length = 0; size_t max_precision_length = 0; d->count = 0; d_allocated = 1; d->dir = malloc (d_allocated * sizeof (DIRECTIVE)); if (d->dir == NULL) /* Out of memory. */ return -1; a->count = 0; a_allocated = 0; a->arg = NULL; #define REGISTER_ARG(_index_,_type_) \ { \ size_t n = (_index_); \ if (n >= a_allocated) \ { \ size_t memory_size; \ argument *memory; \ \ a_allocated = xtimes (a_allocated, 2); \ if (a_allocated <= n) \ a_allocated = xsum (n, 1); \ memory_size = xtimes (a_allocated, sizeof (argument)); \ if (size_overflow_p (memory_size)) \ /* Overflow, would lead to out of memory. */ \ goto error; \ memory = (a->arg \ ? realloc (a->arg, memory_size) \ : malloc (memory_size)); \ if (memory == NULL) \ /* Out of memory. */ \ goto error; \ a->arg = memory; \ } \ while (a->count <= n) \ a->arg[a->count++].type = TYPE_NONE; \ if (a->arg[n].type == TYPE_NONE) \ a->arg[n].type = (_type_); \ else if (a->arg[n].type != (_type_)) \ /* Ambiguous type for positional argument. */ \ goto error; \ } while (*cp != '\0') { CHAR_T c = *cp++; if (c == '%') { size_t arg_index = ARG_NONE; DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */ /* Initialize the next directive. */ dp->dir_start = cp - 1; dp->flags = 0; dp->width_start = NULL; dp->width_end = NULL; dp->width_arg_index = ARG_NONE; dp->precision_start = NULL; dp->precision_end = NULL; dp->precision_arg_index = ARG_NONE; dp->arg_index = ARG_NONE; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; arg_index = n - 1; cp = np + 1; } } /* Read the flags. */ for (;;) { if (*cp == '\'') { dp->flags |= FLAG_GROUP; cp++; } else if (*cp == '-') { dp->flags |= FLAG_LEFT; cp++; } else if (*cp == '+') { dp->flags |= FLAG_SHOWSIGN; cp++; } else if (*cp == ' ') { dp->flags |= FLAG_SPACE; cp++; } else if (*cp == '#') { dp->flags |= FLAG_ALT; cp++; } else if (*cp == '0') { dp->flags |= FLAG_ZERO; cp++; } else break; } /* Parse the field width. */ if (*cp == '*') { dp->width_start = cp; cp++; dp->width_end = cp; if (max_width_length < 1) max_width_length = 1; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->width_arg_index = n - 1; cp = np + 1; } } if (dp->width_arg_index == ARG_NONE) { dp->width_arg_index = arg_posn++; if (dp->width_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->width_arg_index, TYPE_INT); } else if (*cp >= '0' && *cp <= '9') { size_t width_length; dp->width_start = cp; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->width_end = cp; width_length = dp->width_end - dp->width_start; if (max_width_length < width_length) max_width_length = width_length; } /* Parse the precision. */ if (*cp == '.') { cp++; if (*cp == '*') { dp->precision_start = cp - 1; cp++; dp->precision_end = cp; if (max_precision_length < 2) max_precision_length = 2; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->precision_arg_index = n - 1; cp = np + 1; } } if (dp->precision_arg_index == ARG_NONE) { dp->precision_arg_index = arg_posn++; if (dp->precision_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->precision_arg_index, TYPE_INT); } else { size_t precision_length; dp->precision_start = cp - 1; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->precision_end = cp; precision_length = dp->precision_end - dp->precision_start; if (max_precision_length < precision_length) max_precision_length = precision_length; } } { arg_type type; /* Parse argument type/size specifiers. */ { int flags = 0; for (;;) { if (*cp == 'h') { flags |= (1 << (flags & 1)); cp++; } else if (*cp == 'L') { flags |= 4; cp++; } else if (*cp == 'l') { flags += 8; cp++; } #ifdef HAVE_INTMAX_T else if (*cp == 'j') { if (sizeof (intmax_t) > sizeof (long)) { /* intmax_t = long long */ flags += 16; } else if (sizeof (intmax_t) > sizeof (int)) { /* intmax_t = long */ flags += 8; } cp++; } #endif else if (*cp == 'z' || *cp == 'Z') { /* 'z' is standardized in ISO C 99, but glibc uses 'Z' because the warning facility in gcc-2.95.2 understands only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ if (sizeof (size_t) > sizeof (long)) { /* size_t = long long */ flags += 16; } else if (sizeof (size_t) > sizeof (int)) { /* size_t = long */ flags += 8; } cp++; } else if (*cp == 't') { if (sizeof (ptrdiff_t) > sizeof (long)) { /* ptrdiff_t = long long */ flags += 16; } else if (sizeof (ptrdiff_t) > sizeof (int)) { /* ptrdiff_t = long */ flags += 8; } cp++; } else break; } /* Read the conversion character. */ c = *cp++; switch (c) { case 'd': case 'i': #ifdef HAVE_LONG_LONG if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; else #endif if (flags >= 8) type = TYPE_LONGINT; else if (flags & 2) type = TYPE_SCHAR; else if (flags & 1) type = TYPE_SHORT; else type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': #ifdef HAVE_LONG_LONG if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; else #endif if (flags >= 8) type = TYPE_ULONGINT; else if (flags & 2) type = TYPE_UCHAR; else if (flags & 1) type = TYPE_USHORT; else type = TYPE_UINT; break; case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': #ifdef HAVE_LONG_DOUBLE if (flags >= 16 || (flags & 4)) type = TYPE_LONGDOUBLE; else #endif type = TYPE_DOUBLE; break; case 'c': if (flags >= 8) #ifdef HAVE_WINT_T type = TYPE_WIDE_CHAR; #else goto error; #endif else type = TYPE_CHAR; break; #ifdef HAVE_WINT_T case 'C': type = TYPE_WIDE_CHAR; c = 'c'; break; #endif case 's': if (flags >= 8) #ifdef HAVE_WCHAR_T type = TYPE_WIDE_STRING; #else goto error; #endif else type = TYPE_STRING; break; #ifdef HAVE_WCHAR_T case 'S': type = TYPE_WIDE_STRING; c = 's'; break; #endif case 'p': type = TYPE_POINTER; break; case 'n': #ifdef HAVE_LONG_LONG if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; else #endif if (flags >= 8) type = TYPE_COUNT_LONGINT_POINTER; else if (flags & 2) type = TYPE_COUNT_SCHAR_POINTER; else if (flags & 1) type = TYPE_COUNT_SHORT_POINTER; else type = TYPE_COUNT_INT_POINTER; break; case '%': type = TYPE_NONE; break; default: /* Unknown conversion character. */ goto error; } } if (type != TYPE_NONE) { dp->arg_index = arg_index; if (dp->arg_index == ARG_NONE) { dp->arg_index = arg_posn++; if (dp->arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->arg_index, type); } dp->conversion = c; dp->dir_end = cp; } d->count++; if (d->count >= d_allocated) { size_t memory_size; DIRECTIVE *memory; d_allocated = xtimes (d_allocated, 2); memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); if (size_overflow_p (memory_size)) /* Overflow, would lead to out of memory. */ goto error; memory = realloc (d->dir, memory_size); if (memory == NULL) /* Out of memory. */ goto error; d->dir = memory; } } } d->dir[d->count].dir_start = cp; d->max_width_length = max_width_length; d->max_precision_length = max_precision_length; return 0; error: if (a->arg) free (a->arg); if (d->dir) free (d->dir); return -1; } #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef PRINTF_PARSE chemtool-1.6.14/intl/log.c0000644000175000001440000000530310715417303014523 0ustar martinusers/* Log file output. 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include /* 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); } /* 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) { static char *last_logfilename = NULL; static FILE *last_logfile = NULL; 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); } chemtool-1.6.14/intl/relocatable.c0000644000175000001440000003136010715417303016221 0ustar martinusers/* Provide relocatable packages. Copyright (C) 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 #ifdef HAVE_CONFIG_H # include "config.h" #endif /* 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__ # 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 __EMX__ || defined __DJGPP__ /* Win32, 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 FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) # define FILESYSTEM_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 + FILESYSTEM_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 + FILESYSTEM_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; } #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, 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__ /* 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; shared_library_fullname = strdup (location); } return TRUE; } #else /* Unix */ 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 / Unix */ /* Return the full pathname of the current shared library. Return NULL if unknown. Guaranteed to work only on Linux and Woe32. */ static char * get_shared_library_fullname () { #if !(defined _WIN32 || defined __WIN32__) 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 chemtool-1.6.14/intl/printf-args.h0000644000175000001440000000550210715417303016204 0ustar martinusers/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _PRINTF_ARGS_H #define _PRINTF_ARGS_H /* Get size_t. */ #include /* Get wchar_t. */ #ifdef HAVE_WCHAR_T # include #endif /* Get wint_t. */ #ifdef HAVE_WINT_T # include #endif /* Get va_list. */ #include /* Argument types */ typedef enum { TYPE_NONE, TYPE_SCHAR, TYPE_UCHAR, TYPE_SHORT, TYPE_USHORT, TYPE_INT, TYPE_UINT, TYPE_LONGINT, TYPE_ULONGINT, #ifdef HAVE_LONG_LONG TYPE_LONGLONGINT, TYPE_ULONGLONGINT, #endif TYPE_DOUBLE, #ifdef HAVE_LONG_DOUBLE TYPE_LONGDOUBLE, #endif TYPE_CHAR, #ifdef HAVE_WINT_T TYPE_WIDE_CHAR, #endif TYPE_STRING, #ifdef HAVE_WCHAR_T TYPE_WIDE_STRING, #endif TYPE_POINTER, TYPE_COUNT_SCHAR_POINTER, TYPE_COUNT_SHORT_POINTER, TYPE_COUNT_INT_POINTER, TYPE_COUNT_LONGINT_POINTER #ifdef HAVE_LONG_LONG , TYPE_COUNT_LONGLONGINT_POINTER #endif } arg_type; /* Polymorphic argument */ typedef struct { arg_type type; union { signed char a_schar; unsigned char a_uchar; short a_short; unsigned short a_ushort; int a_int; unsigned int a_uint; long int a_longint; unsigned long int a_ulongint; #ifdef HAVE_LONG_LONG long long int a_longlongint; unsigned long long int a_ulonglongint; #endif float a_float; double a_double; #ifdef HAVE_LONG_DOUBLE long double a_longdouble; #endif int a_char; #ifdef HAVE_WINT_T wint_t a_wide_char; #endif const char* a_string; #ifdef HAVE_WCHAR_T const wchar_t* a_wide_string; #endif void* a_pointer; signed char * a_count_schar_pointer; short * a_count_short_pointer; int * a_count_int_pointer; long int * a_count_longint_pointer; #ifdef HAVE_LONG_LONG long long int * a_count_longlongint_pointer; #endif } a; } argument; typedef struct { size_t count; argument *arg; } arguments; /* Fetch the arguments, putting them into a. */ #ifdef STATIC STATIC #else extern #endif int printf_fetchargs (va_list args, arguments *a); #endif /* _PRINTF_ARGS_H */ chemtool-1.6.14/intl/loadinfo.h0000644000175000001440000001332210715417303015542 0ustar martinusers/* Copyright (C) 1996-1999, 2000-2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 /* 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 __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define PATH_SEPARATOR ';' #else /* Unix */ # define PATH_SEPARATOR ':' #endif /* Encoding of locale name parts. */ #define CEN_REVISION 1 #define CEN_SPONSOR 2 #define CEN_SPECIAL 4 #define XPG_NORM_CODESET 8 #define XPG_CODESET 16 #define TERRITORY 32 #define CEN_AUDIENCE 64 #define XPG_MODIFIER 128 #define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) #define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER) 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, SPECIAL, SPONSOR, REVISION 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 *special, const char *sponsor, const char *revision, 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. */ extern const char *_nl_expand_alias (const char *name); /* Split a locale name NAME into its pieces: language, modifier, territory, codeset, special, sponsor, revision. NAME gets destructively modified: NUL bytes are inserted here and there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY, *CODESET, *SPECIAL, *SPONSOR, *REVISION 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, CEN_AUDIENCE for *MODIFIER, TERRITORY for *TERRITORY, XPG_CODESET for *CODESET, XPG_NORM_CODESET for *NORMALIZED_CODESET, CEN_SPECIAL for *SPECIAL, CEN_SPONSOR for *SPONSOR, CEN_REVISION for *REVISION. */ extern int _nl_explode_name (char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset, const char **special, const char **sponsor, const char **revision); /* 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. */ extern char *_nl_find_language (const char *name); #endif /* loadinfo.h */ chemtool-1.6.14/intl/os2compat.h0000644000175000001440000000302210715417303015652 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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) chemtool-1.6.14/intl/hash-string.h0000644000175000001440000000314110715417303016174 0ustar martinusers/* Description of GNU message catalog format: string hashing function. Copyright (C) 1995, 1997-1998, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* @@ end of prolog @@ */ /* We assume to have `unsigned long int' value with at least 32 bits. */ #define HASHWORDBITS 32 /* Defines the so called `hashpjw' function by P.J. Weinberger [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 1986, 1987 Bell Telephone Laboratories, Inc.] */ static inline 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; } chemtool-1.6.14/intl/VERSION0000644000175000001440000000005010715417303014640 0ustar martinusersGNU gettext library from gettext-0.14.1 chemtool-1.6.14/intl/finddomain.c0000644000175000001440000001274310715417303016060 0ustar martinusers/* Handle list of needed message catalogs Copyright (C) 1995-1999, 2000-2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 /* @@ 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 *special; const char *sponsor; const char *revision; const char *alias_value; int mask; /* LOCALE can consist of up to four recognized parts for the XPG syntax: language[_territory[.codeset]][@modifier] and six parts for the CEN syntax: language[_territory][+audience][+special][,[sponsor][_revision]] Beside the first 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) revision (2) sponsor (3) special (4) codeset (5) normalized codeset (6) territory (7) audience/modifier */ /* If we have already tested for this locale entry there has to be one data set in the list of loaded domains. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, 0, locale, NULL, NULL, NULL, NULL, NULL, NULL, NULL, domainname, 0); if (retval != NULL) { /* We know something about this locale. */ int cnt; if (retval->decided == 0) _nl_load_domain (retval, 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 cnt >= 0 ? retval : NULL; /* NOTREACHED */ } /* See whether the locale value is an alias. If yes its value *overwrites* the alias name. No test for the original value is done. */ alias_value = _nl_expand_alias (locale); if (alias_value != NULL) { #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 `@' if we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ mask = _nl_explode_name (locale, &language, &modifier, &territory, &codeset, &normalized_codeset, &special, &sponsor, &revision); /* 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, special, sponsor, revision, domainname, 1); if (retval == NULL) /* This means we are out of core. */ return NULL; if (retval->decided == 0) _nl_load_domain (retval, 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); /* The space for normalized_codeset is dynamically allocated. Free it. */ if (mask & XPG_NORM_CODESET) free ((void *) normalized_codeset); return retval; } #ifdef _LIBC libc_freeres_fn (free_mem) { 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 chemtool-1.6.14/intl/printf-parse.h0000644000175000001440000000420710715417303016363 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 */ chemtool-1.6.14/intl/explodename.c0000644000175000001440000001064310715417303016246 0ustar martinusers/* Copyright (C) 1995-1998, 2000-2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 @@ */ char * _nl_find_language (const char *name) { while (name[0] != '\0' && name[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, const char **special, const char **sponsor, const char **revision) { enum { undecided, xpg, cen } syntax; char *cp; int mask; *modifier = NULL; *territory = NULL; *codeset = NULL; *normalized_codeset = NULL; *special = NULL; *sponsor = NULL; *revision = NULL; /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_' and `@' if we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ mask = 0; syntax = undecided; *language = cp = 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[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= TERRITORY; if (cp[0] == '.') { /* Next is the codeset. */ syntax = xpg; cp[0] = '\0'; *codeset = ++cp; while (cp[0] != '\0' && cp[0] != '@') ++cp; mask |= XPG_CODESET; if (*codeset != cp && (*codeset)[0] != '\0') { *normalized_codeset = _nl_normalize_codeset (*codeset, cp - *codeset); if (strcmp (*codeset, *normalized_codeset) == 0) free ((char *) *normalized_codeset); else mask |= XPG_NORM_CODESET; } } } if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) { /* Next is the modifier. */ syntax = cp[0] == '@' ? xpg : cen; cp[0] = '\0'; *modifier = ++cp; while (syntax == cen && cp[0] != '\0' && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= XPG_MODIFIER | CEN_AUDIENCE; } if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) { syntax = cen; if (cp[0] == '+') { /* Next is special application (CEN syntax). */ cp[0] = '\0'; *special = ++cp; while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= CEN_SPECIAL; } if (cp[0] == ',') { /* Next is sponsor (CEN syntax). */ cp[0] = '\0'; *sponsor = ++cp; while (cp[0] != '\0' && cp[0] != '_') ++cp; mask |= CEN_SPONSOR; } if (cp[0] == '_') { /* Next is revision (CEN syntax). */ cp[0] = '\0'; *revision = ++cp; mask |= CEN_REVISION; } } /* For CEN syntax values it might be important to have the separator character in the file name, not for XPG syntax. */ if (syntax == xpg) { if (*territory != NULL && (*territory)[0] == '\0') mask &= ~TERRITORY; if (*codeset != NULL && (*codeset)[0] == '\0') mask &= ~XPG_CODESET; if (*modifier != NULL && (*modifier)[0] == '\0') mask &= ~XPG_MODIFIER; } return mask; } chemtool-1.6.14/intl/textdomain.c0000644000175000001440000001066010715417303016120 0ustar martinusers/* Implementation of the textdomain(3) function. Copyright (C) 1995-1998, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "gettextP.h" #ifdef _LIBC /* We have to handle multi-threaded applications. */ # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_rwlock_define(CLASS, NAME) # define __libc_rwlock_wrlock(NAME) # define __libc_rwlock_unlock(NAME) #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_default_domain libintl_nl_default_default_domain # define _nl_current_default_domain libintl_nl_current_default_domain #endif /* @@ end of prolog @@ */ /* 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; /* 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. */ __libc_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; __libc_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); } __libc_rwlock_unlock (_nl_state_lock); return new_domain; } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__textdomain, textdomain); #endif chemtool-1.6.14/intl/ref-del.sin0000644000175000001440000000202410715417303015624 0ustar martinusers# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # # Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// s/ @PACKAGE@ / / s/^/# Packages using this file:/ } chemtool-1.6.14/intl/gettextP.h0000644000175000001440000001453010715417303015555 0ustar martinusers/* Header describing internals of libintl library. Copyright (C) 1995-1999, 2000-2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 #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 SWAP (i) nls_uint32 i; { 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; }; /* 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; int codeset_cntr; #ifdef _LIBC __gconv_t conv; #else # if HAVE_ICONV iconv_t conv; # endif #endif char **conv_tab; 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; int codeset_cntr; /* Incremented each time codeset changes. */ 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. */ extern int _nl_msg_cat_cntr; #ifndef _LIBC 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; void _nl_unload_domain (struct loaded_domain *__domain) internal_function; const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file, struct loaded_domain *__domain, struct binding *__domainbinding) internal_function; void _nl_free_domain_conv (struct loaded_domain *__domain) internal_function; char *_nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, size_t *lengthp) internal_function; #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); #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" extern char *libintl_dcigettext (const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category); #endif /* @@ begin of epilog @@ */ #endif /* gettextP.h */ chemtool-1.6.14/intl/wprintf-parse.h0000644000175000001440000000425710715417303016557 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 */ chemtool-1.6.14/intl/l10nflist.c0000644000175000001440000002733010715417303015562 0ustar martinusers/* Copyright (C) 1995-1999, 2000-2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 __EMX__ || defined __DJGPP__ /* Win32, 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. */ #if !defined _LIBC && !defined HAVE___ARGZ_COUNT /* 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) #else # ifdef _LIBC # define __argz_count(argz, len) INTUSE(__argz_count) (argz, len) # endif #endif /* !_LIBC && !HAVE___ARGZ_COUNT */ #if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY /* 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) #else # ifdef _LIBC # define __argz_stringify(argz, len, sep) \ INTUSE(__argz_stringify) (argz, len, sep) # endif #endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ #if !defined _LIBC && !defined HAVE___ARGZ_NEXT 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 *special, const char *sponsor, const char *revision, 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 & 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 || (mask & CEN_AUDIENCE) != 0) ? strlen (modifier) + 1 : 0) + ((mask & CEN_SPECIAL) != 0 ? strlen (special) + 1 : 0) + (((mask & CEN_SPONSOR) != 0 || (mask & CEN_REVISION) != 0) ? (1 + ((mask & CEN_SPONSOR) != 0 ? strlen (sponsor) : 0) + ((mask & CEN_REVISION) != 0 ? strlen (revision) + 1 : 0)) : 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 & 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 | CEN_AUDIENCE)) != 0) { /* This component can be part of both syntaces but has different leading characters. For CEN we use `+', else `@'. */ *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; cp = stpcpy (cp, modifier); } if ((mask & CEN_SPECIAL) != 0) { *cp++ = '+'; cp = stpcpy (cp, special); } if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0) { *cp++ = ','; if ((mask & CEN_SPONSOR) != 0) cp = stpcpy (cp, sponsor); if ((mask & CEN_REVISION) != 0) { *cp++ = '_'; cp = stpcpy (cp, revision); } } *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) 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 & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 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, special, sponsor, revision, filename, 1); } else retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, cnt, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, 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 chemtool-1.6.14/intl/plural.y0000644000175000001440000001627110715417303015275 0ustar martinusers%{ /* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* 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. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #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 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 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 operator op) { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (enum 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 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 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. */ } chemtool-1.6.14/intl/plural.c0000644000175000001440000011065110715417303015244 0ustar martinusers/* A Bison parser, made from plural.y by GNU bison 1.35. */ #define YYBISON 1 /* Identify Bison output. */ #define yyparse __gettextparse #define yylex __gettextlex #define yyerror __gettexterror #define yylval __gettextlval #define yychar __gettextchar #define yydebug __gettextdebug #define yynerrs __gettextnerrs # define EQUOP2 257 # define CMPOP2 258 # define ADDOP2 259 # define MULOP2 260 # define NUMBER 261 #line 1 "plural.y" /* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* 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. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #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 #line 49 "plural.y" #ifndef YYSTYPE typedef union { unsigned long int num; enum operator op; struct expression *exp; } yystype; # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif #line 55 "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 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 operator op) { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (enum 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 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 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); } #ifndef YYDEBUG # define YYDEBUG 0 #endif #define YYFINAL 27 #define YYFLAG -32768 #define YYNTBASE 16 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ static const char 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, 6, 7, 8, 9, 11 }; #if YYDEBUG static const short yyprhs[] = { 0, 0, 2, 8, 12, 16, 20, 24, 28, 32, 35, 37, 39 }; static const short yyrhs[] = { 17, 0, 17, 3, 17, 12, 17, 0, 17, 4, 17, 0, 17, 5, 17, 0, 17, 6, 17, 0, 17, 7, 17, 0, 17, 8, 17, 0, 17, 9, 17, 0, 10, 17, 0, 13, 0, 11, 0, 14, 17, 15, 0 }; #endif #if YYDEBUG /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { 0, 150, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 199 }; #endif #if (YYDEBUG) || defined YYERROR_VERBOSE /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ static const char *const yytname[] = { "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", "start", "exp", 0 }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const short yyr1[] = { 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const short yyr2[] = { 0, 1, 5, 3, 3, 3, 3, 3, 3, 2, 1, 1, 3 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const short yydefact[] = { 0, 0, 11, 10, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 3, 4, 5, 6, 7, 8, 0, 2, 0, 0, 0 }; static const short yydefgoto[] = { 25, 5 }; static const short yypact[] = { -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16, 26, -3,-32768, -9, 34, 21, 53,-32768 }; static const short yypgoto[] = { -32768, -1 }; #define YYLAST 53 static const short yytable[] = { 6, 1, 2, 7, 3, 4, 14, 16, 17, 18, 19, 20, 21, 22, 8, 9, 10, 11, 12, 13, 14, 26, 24, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 13, 14, 23, 8, 9, 10, 11, 12, 13, 14, 10, 11, 12, 13, 14, 11, 12, 13, 14, 27 }; static const short yycheck[] = { 1, 10, 11, 4, 13, 14, 9, 8, 9, 10, 11, 12, 13, 14, 3, 4, 5, 6, 7, 8, 9, 0, 23, 7, 8, 9, 15, 3, 4, 5, 6, 7, 8, 9, 8, 9, 12, 3, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, 8, 9, 0 }; #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/local/share/bison/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990, 2000, 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 General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ /* 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. */ #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; # if YYLSP_NEEDED YYLTYPE yyls; # endif }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # if YYLSP_NEEDED # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAX) # else # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX) # endif /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (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_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #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 yyerrlab1 /* 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); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). When YYLLOC_DEFAULT is run, CURRENT is set the location of the first token. By default, to implement support for ranges, extend its range to the last symbol. */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #if YYPURE # if YYLSP_NEEDED # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) # else # define YYLEX yylex (&yylval, &yylloc) # endif # else /* !YYLSP_NEEDED */ # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) # else # define YYLEX yylex (&yylval) # endif # endif /* !YYLSP_NEEDED */ #else /* !YYPURE */ # define YYLEX yylex () #endif /* !YYPURE */ /* 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 (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) #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 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #ifdef YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # 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. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif #line 315 "/usr/local/share/bison/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL # else # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL #endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ # ifdef YYPARSE_PARAM int yyparse (void *); # else int yyparse (void); # endif #endif /* YY_DECL_VARIABLES -- depending whether we use a pure parser, variables are global, or local to YYPARSE. */ #define YY_DECL_NON_LSP_VARIABLES \ /* The lookahead symbol. */ \ int yychar; \ \ /* The semantic value of the lookahead symbol. */ \ YYSTYPE yylval; \ \ /* Number of parse errors so far. */ \ int yynerrs; #if YYLSP_NEEDED # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES \ \ /* Location data for the lookahead symbol. */ \ YYLTYPE yylloc; #else # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES #endif /* If nonreentrant, generate the variables here. */ #if !YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { /* If reentrant, generate the variables here. */ #if YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yychar1 = 0; /* 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. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #if YYLSP_NEEDED /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #endif #if YYLSP_NEEDED # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else # define YYPOPSTACK (yyvsp--, yyssp--) #endif YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYLSP_NEEDED YYLTYPE yyloc; #endif /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; 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; #if YYLSP_NEEDED yylsp = yyls; #endif 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 (yyssp >= yyss + yystacksize - 1) { /* 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; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ # if YYLSP_NEEDED YYLTYPE *yyls1 = yyls; /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; # else yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); # endif yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # if YYLSP_NEEDED YYSTACK_RELOCATE (yyls); # endif # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; #if YYLSP_NEEDED yylsp = yyls + yysize - 1; #endif YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 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. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yychar1 = YYTRANSLATE (yychar); #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { YYFPRINTF (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ # ifdef YYPRINT YYPRINT (stderr, yychar, yylval); # endif YYFPRINTF (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; 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 the semantic value of the lookahead token. 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]; #if YYLSP_NEEDED /* Similarly for the default location. Let the user run additional commands if for instance locations are ranges. */ yyloc = yylsp[1-yylen]; YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); #endif #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { int yyi; YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 151 "plural.y" { if (yyvsp[0].exp == NULL) YYABORT; ((struct parse_args *) arg)->res = yyvsp[0].exp; } break; case 2: #line 159 "plural.y" { yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp); } break; case 3: #line 163 "plural.y" { yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp); } break; case 4: #line 167 "plural.y" { yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp); } break; case 5: #line 171 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 6: #line 175 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 7: #line 179 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 8: #line 183 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 9: #line 187 "plural.y" { yyval.exp = new_exp_1 (lnot, yyvsp[0].exp); } break; case 10: #line 191 "plural.y" { yyval.exp = new_exp_0 (var); } break; case 11: #line 195 "plural.y" { if ((yyval.exp = new_exp_0 (num)) != NULL) yyval.exp->val.num = yyvsp[0].num; } break; case 12: #line 200 "plural.y" { yyval.exp = yyvsp[-1].exp; } break; } #line 705 "/usr/local/share/bison/bison.simple" yyvsp -= yylen; yyssp -= yylen; #if YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; #if YYLSP_NEEDED *++yylsp = yyloc; #endif /* 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 - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { YYSIZE_T yysize = 0; char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("parse error, unexpected ") + 1; yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "parse error, unexpected "); yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("parse error; also virtual memory exhausted"); } else #endif /* defined (YYERROR_VERBOSE) */ yyerror ("parse error"); } goto yyerrlab1; /*--------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action | `--------------------------------------------------*/ yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; /*-------------------------------------------------------------------. | yyerrdefault -- current state does not do anything special for the | | error token. | `-------------------------------------------------------------------*/ yyerrdefault: #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ /* If its default is to accept any token, ok. Otherwise pop it. */ yyn = yydefact[yystate]; if (yyn) goto yydefault; #endif /*---------------------------------------------------------------. | yyerrpop -- pop the current state because it cannot handle the | | error token | `---------------------------------------------------------------*/ yyerrpop: if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #if YYLSP_NEEDED yylsp--; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "Error: state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif /*--------------. | yyerrhandle. | `--------------*/ yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; /*---------------------------------------------. | yyoverflowab -- parser overflow comes here. | `---------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 205 "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. */ } chemtool-1.6.14/intl/localealias.c0000644000175000001440000002334010715417303016214 0ustar martinusers/* Handle aliases for locale names. Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 /* We need locking here since we can be called from different places. */ # include __libc_lock_define_initialized (static, lock); #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 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; #ifdef _LIBC __libc_lock_lock (lock); #endif 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); #ifdef _LIBC __libc_lock_unlock (lock); #endif 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 fp = fopen (relocate (full_fname), "r"); 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; if (FGETS (buf, sizeof buf, fp) == NULL) /* EOF reached. */ break; 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') { size_t alias_len; size_t value_len; 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'; if (nmap >= maxmap) if (__builtin_expect (extend_alias_table (), 0)) return added; 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) return added; 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 = memcpy (&string_space[string_space_act], alias, alias_len); string_space_act += alias_len; map[nmap].value = 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. */ while (strchr (buf, '\n') == NULL) 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; } /* 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 } chemtool-1.6.14/intl/printf.c0000644000175000001440000001717710715417303015260 0ustar martinusers/* Formatted output to strings, using POSIX/XSI format strings with positions. Copyright (C) 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 /* 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 /* 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) { if (fwrite (result, 1, length, stream) == length) retval = length; free (result); } 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; } 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) { if (length < maxlength) abort (); memcpy (resultbuf, result, maxlength - 1); resultbuf[maxlength - 1] = '\0'; } free (result); 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; *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 /* Define auxiliary functions declared in "wprintf-parse.h". */ #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; if (i == length) retval = length; free (result); } 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) { if (length < maxlength) abort (); memcpy (resultbuf, result, (maxlength - 1) * sizeof (wchar_t)); resultbuf[maxlength - 1] = 0; } free (result); 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 chemtool-1.6.14/intl/ChangeLog0000644000175000001440000000011110715417303015340 0ustar martinusers2004-01-29 GNU * Version 0.14.1 released. chemtool-1.6.14/intl/dcngettext.c0000644000175000001440000000347010715417303016116 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 chemtool-1.6.14/intl/os2compat.c0000644000175000001440000000550310715417303015653 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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); } chemtool-1.6.14/intl/plural-exp.c0000644000175000001440000000765110715417303016043 0ustar martinusers/* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "plural-exp.h" #if (defined __GNUC__ && !defined __APPLE_CC__) \ || (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, 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; } } chemtool-1.6.14/intl/libgnuintl.h.in0000644000175000001440000003114610715417303016527 0ustar martinusers/* Message catalogs for internationalization. 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 ? 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 /* 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 && !defined __APPLE_CC__ && !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 /* 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); 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); #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); 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); #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); 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); #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); 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); #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); 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); #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); 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); #endif /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ #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 /* 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 #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 */ chemtool-1.6.14/intl/ngettext.c0000644000175000001440000000367010715417303015611 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 chemtool-1.6.14/intl/intl-compat.c0000644000175000001440000000644310715417303016177 0ustar martinusers/* intl-compat.c - Stub functions to call gettext functions from GNU gettext Library. Copyright (C) 1995, 2000-2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 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); } chemtool-1.6.14/intl/gettext.c0000644000175000001440000000355010715417303015430 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 chemtool-1.6.14/intl/dcigettext.c0000644000175000001440000010125310715417303016107 0ustar martinusers/* Implementation of the internal dcigettext 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 #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 #include "gettextP.h" #include "plural-exp.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "hash-string.h" /* Thread safetyness. */ #ifdef _LIBC # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_lock_define_initialized(CLASS, NAME) # define __libc_lock_lock(NAME) # define __libc_lock_unlock(NAME) # define __libc_rwlock_define_initialized(CLASS, NAME) # define __libc_rwlock_rdlock(NAME) # define __libc_rwlock_unlock(NAME) #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 /* 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 # define _nl_default_dirname libintl_nl_default_dirname # define _nl_domain_bindings libintl_nl_domain_bindings #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 /* 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 __EMX__ || defined __DJGPP__ /* Win32, 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 /* This is the type used for the search tree where known translations are stored. */ struct known_translation_t { /* Domain in which to search. */ char *domainname; /* The category. */ int category; /* 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]; }; /* Root of the search tree with known translations. We can use this only if the system provides the `tsearch' function family. */ #if defined HAVE_TSEARCH || defined _LIBC # include static void *root; # ifdef _LIBC # define tsearch __tsearch # endif /* 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) /* 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; } #endif #ifndef INTVARDEF # define INTVARDEF(name) #endif #ifndef INTUSE # define INTUSE(name) name #endif /* Name of the default domain used for gettext(3) prior any call to textdomain(3). The default value for this is "messages". */ const char _nl_default_default_domain[] attribute_hidden = "messages"; /* Value used as the default domain for gettext(3). */ const char *_nl_current_default_domain attribute_hidden = _nl_default_default_domain; /* Contains the default location of the message catalogs. */ #if defined __EMX__ extern const char _nl_default_dirname[]; #else const char _nl_default_dirname[] = LOCALEDIR; INTVARDEF (_nl_default_dirname) #endif /* List with bindings of specific domains created by bindtextdomain() calls. */ struct binding *_nl_domain_bindings; /* 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; static const char *guess_category_value (int category, const char *categoryname) internal_function; #ifdef _LIBC # include "../locale/localeinfo.h" # define category_to_name(category) _nl_category_names[category] #else static const char *category_to_name (int category) 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. */ #ifdef _LIBC __libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden) #endif /* 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. */ char * DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, int plural, unsigned long int n, int category) { #ifndef HAVE_ALLOCA struct block_list *block_list = NULL; #endif struct loaded_l10nfile *domain; struct binding *binding; const char *categoryname; const char *categoryvalue; char *dirname, *xdomainname; char *single_locale; char *retval; size_t retlen; int saved_errno; #if defined HAVE_TSEARCH || defined _LIBC struct known_translation_t *search; struct known_translation_t **foundp = NULL; size_t msgid_len; #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 __libc_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 #if defined HAVE_TSEARCH || defined _LIBC 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 = (char *) domainname; search->category = category; foundp = (struct known_translation_t **) tfind (search, &root, transcmp); 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; __libc_rwlock_unlock (_nl_state_lock); return retval; } #endif /* Preserve the `errno' value. */ saved_errno = errno; /* See whether this is a SUID binary or not. */ DETERMINE_SECURE; /* First find matching binding. */ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding == NULL) dirname = (char *) INTUSE(_nl_default_dirname); else if (IS_ABSOLUTE_PATH (binding->dirname)) dirname = binding->dirname; else { /* We have a relative path. Make it absolute now. */ size_t dirname_len = strlen (binding->dirname) + 1; size_t path_max; char *ret; path_max = (unsigned int) PATH_MAX; path_max += 2; /* The getcwd docs say to do this. */ for (;;) { dirname = (char *) alloca (path_max + dirname_len); ADD_BLOCK (block_list, dirname); __set_errno (0); ret = getcwd (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 (dirname, '\0'), "/"), binding->dirname); } /* Now determine the symbolic name of CATEGORY and its value. */ categoryname = category_to_name (category); categoryvalue = guess_category_value (category, categoryname); domainname_len = strlen (domainname); xdomainname = (char *) alloca (strlen (categoryname) + domainname_len + 5); ADD_BLOCK (block_list, xdomainname); stpcpy (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) { retval = _nl_find_msg (domain, binding, msgid1, &retlen); if (retval == NULL) { int cnt; for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) { retval = _nl_find_msg (domain->successor[cnt], binding, msgid1, &retlen); if (retval != NULL) { domain = domain->successor[cnt]; break; } } } if (retval != NULL) { /* Found the translation of MSGID1 in domain DOMAIN: starting at RETVAL, RETLEN bytes. */ FREE_BLOCKS (block_list); #if defined HAVE_TSEARCH || defined _LIBC if (foundp == NULL) { /* Create a new entry and add it to the search tree. */ struct known_translation_t *newp; newp = (struct known_translation_t *) malloc (offsetof (struct known_translation_t, msgid) + msgid_len + domainname_len + 1); if (newp != NULL) { newp->domainname = mempcpy (newp->msgid, msgid1, msgid_len); memcpy (newp->domainname, domainname, domainname_len + 1); newp->category = category; newp->counter = _nl_msg_cat_cntr; newp->domain = domain; newp->translation = retval; newp->translation_length = retlen; /* Insert the entry in the search tree. */ foundp = (struct known_translation_t **) tsearch (newp, &root, transcmp); 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; } #endif __set_errno (saved_errno); /* Now deal with plural. */ if (plural) retval = plural_lookup (domain, n, retval, retlen); __libc_rwlock_unlock (_nl_state_lock); return retval; } } } return_untranslated: /* Return the untranslated MSGID. */ FREE_BLOCKS (block_list); __libc_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); } char * internal_function _nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, size_t *lengthp) { 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 if (domain->codeset_cntr != (domainbinding != NULL ? domainbinding->codeset_cntr : 0)) { /* The domain's codeset has changed through bind_textdomain_codeset() since the message catalog was initialized or last accessed. We have to reinitialize the converter. */ _nl_free_domain_conv (domain); _nl_init_domain_conv (domain_file, domain, domainbinding); } if ( # ifdef _LIBC domain->conv != (__gconv_t) -1 # else # if HAVE_ICONV domain->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 (domain->conv_tab == NULL && ((domain->conv_tab = (char **) calloc (nstrings + domain->n_sysdep_strings, sizeof (char *))) == NULL)) /* Mark that we didn't succeed allocating a table. */ domain->conv_tab = (char **) -1; if (__builtin_expect (domain->conv_tab == (char **) -1, 0)) /* Nothing we can do, no more memory. */ goto converted; if (domain->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 (domain->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) { __libc_lock_unlock (lock); goto converted; } inbuf = 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 (domain->conv, (ICONV_CONST char **) &inptr, &inleft, &outptr, &outleft) != (size_t) (-1)) { outbuf = (unsigned char *) outptr; break; } if (errno != E2BIG) { __libc_lock_unlock (lock); goto converted; } # 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); goto converted; } # 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 = 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); domain->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 domain->conv_tab[act] contains the translation of all the plural variants. */ result = domain->conv_tab[act] + sizeof (size_t); resultlen = *(size_t *) domain->conv_tab[act]; } converted: /* 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. */ static const char * internal_function guess_category_value (int category, const char *categoryname) { const char *language; const char *retval; /* The highest priority value is the `LANGUAGE' environment variable. But we don't use the value if the currently selected locale is the C locale. This is a GNU extension. */ language = getenv ("LANGUAGE"); if (language != NULL && language[0] == '\0') language = NULL; /* We have to proceed with the POSIX methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some systems this can be done by the `setlocale' function itself. */ #ifdef _LIBC retval = __current_locale_name (category); #else retval = _nl_locale_name (category, categoryname); #endif /* Ignore LANGUAGE 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". We allow such programs to use gettext(). */ return language != NULL && strcmp (retval, "C") != 0 ? language : 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 #if !_LIBC && !HAVE_MEMPCPY static void * mempcpy (void *dest, const void *src, size_t n) { return (void *) ((char *) memcpy (dest, src, n) + n); } #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 != INTUSE(_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 chemtool-1.6.14/intl/printf-args.c0000644000175000001440000000625310715417303016203 0ustar martinusers/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "printf-args.h" #ifdef STATIC STATIC #endif int printf_fetchargs (va_list args, arguments *a) { size_t i; argument *ap; for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) switch (ap->type) { case TYPE_SCHAR: ap->a.a_schar = va_arg (args, /*signed char*/ int); break; case TYPE_UCHAR: ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); break; case TYPE_SHORT: ap->a.a_short = va_arg (args, /*short*/ int); break; case TYPE_USHORT: ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); break; case TYPE_INT: ap->a.a_int = va_arg (args, int); break; case TYPE_UINT: ap->a.a_uint = va_arg (args, unsigned int); break; case TYPE_LONGINT: ap->a.a_longint = va_arg (args, long int); break; case TYPE_ULONGINT: ap->a.a_ulongint = va_arg (args, unsigned long int); break; #ifdef HAVE_LONG_LONG case TYPE_LONGLONGINT: ap->a.a_longlongint = va_arg (args, long long int); break; case TYPE_ULONGLONGINT: ap->a.a_ulonglongint = va_arg (args, unsigned long long int); break; #endif case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: ap->a.a_longdouble = va_arg (args, long double); break; #endif case TYPE_CHAR: ap->a.a_char = va_arg (args, int); break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: ap->a.a_wide_char = va_arg (args, wint_t); break; #endif case TYPE_STRING: ap->a.a_string = va_arg (args, const char *); break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: ap->a.a_wide_string = va_arg (args, const wchar_t *); break; #endif case TYPE_POINTER: ap->a.a_pointer = va_arg (args, void *); break; case TYPE_COUNT_SCHAR_POINTER: ap->a.a_count_schar_pointer = va_arg (args, signed char *); break; case TYPE_COUNT_SHORT_POINTER: ap->a.a_count_short_pointer = va_arg (args, short *); break; case TYPE_COUNT_INT_POINTER: ap->a.a_count_int_pointer = va_arg (args, int *); break; case TYPE_COUNT_LONGINT_POINTER: ap->a.a_count_longint_pointer = va_arg (args, long int *); break; #ifdef HAVE_LONG_LONG case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; #endif default: /* Unknown type. */ return -1; } return 0; } chemtool-1.6.14/intl/bindtextdom.c0000644000175000001440000002312010715417303016260 0ustar martinusers/* Implementation of the bindtextdomain(3) function Copyright (C) 1995-1998, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "gettextP.h" #ifdef _LIBC /* We have to handle multi-threaded applications. */ # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_rwlock_define(CLASS, NAME) # define __libc_rwlock_wrlock(NAME) # define __libc_rwlock_unlock(NAME) #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 /* 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 @@ */ /* Contains the default location of the message catalogs. */ extern const char _nl_default_dirname[]; #ifdef _LIBC extern const char _nl_default_dirname_internal[] attribute_hidden; #else # define INTUSE(name) name #endif /* List with bindings of specific domains. */ extern struct binding *_nl_domain_bindings; /* Lock variable to protect the global data in the gettext implementation. */ __libc_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; } __libc_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, INTUSE(_nl_default_dirname)) == 0) result = (char *) INTUSE(_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 != INTUSE(_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; binding->codeset_cntr++; modified = 1; } } *codesetp = result; } } } else if ((dirnamep == NULL || *dirnamep == NULL) && (codesetp == NULL || *codesetp == NULL)) { /* Simply return the default values. */ if (dirnamep) *dirnamep = INTUSE(_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 = INTUSE(_nl_default_dirname); else { if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) dirname = INTUSE(_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 *) INTUSE(_nl_default_dirname); new_binding->codeset_cntr = 0; 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; new_binding->codeset_cntr++; } *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 != INTUSE(_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; __libc_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 chemtool-1.6.14/intl/vasnprintf.h0000644000175000001440000000436010715417303016143 0ustar martinusers/* vsprintf with automatic memory allocation. Copyright (C) 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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. */ 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 */ chemtool-1.6.14/intl/dngettext.c0000644000175000001440000000354210715417303015753 0ustar martinusers/* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 chemtool-1.6.14/Makefile.in0000666000175000001440000007460312202253333014704 0ustar martinusers# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Example for use of GNU gettext. # Copyright (C) 2003 Free Software Foundation, Inc. # This file is in the public domain. # # Makefile configuration - processed by automake. VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = chemtool$(EXEEXT) src-cht/cht$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(top_srcdir)/configure \ $(top_srcdir)/src-cht/Makefile.in ABOUT-NLS COPYING ChangeLog \ INSTALL NEWS TODO config.guess config.rpath config.sub \ install-sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = src-cht/Makefile CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_chemtool_OBJECTS = main.$(OBJEXT) draw.$(OBJEXT) graph.$(OBJEXT) \ chemproc.$(OBJEXT) undo.$(OBJEXT) inout.$(OBJEXT) chemtool_OBJECTS = $(am_chemtool_OBJECTS) chemtool_LDADD = $(LDADD) chemtool_DEPENDENCIES = src_cht_cht_SOURCES = src-cht/cht.c src_cht_cht_OBJECTS = cht.$(OBJEXT) src_cht_cht_LDADD = $(LDADD) src_cht_cht_DEPENDENCIES = am__dirstamp = $(am__leading_dot)dirstamp DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(chemtool_SOURCES) src-cht/cht.c DIST_SOURCES = $(chemtool_SOURCES) src-cht/cht.c RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMFLIBS = @EMFLIBS@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MYGTKOBJS = @MYGTKOBJS@ MYGTKSRCS = @MYGTKSRCS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ RM = @RM@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gnomemimedir = @gnomemimedir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ kdemimedir = @kdemimedir@ libdir = @libdir@ libexecdir = @libexecdir@ # Define a C macro LOCALEDIR indicating where catalogs will be installed. localedir = $(datadir)/locale localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # General automake options. AUTOMAKE_OPTIONS = foreign no-dependencies ACLOCAL_AMFLAGS = -I m4 # The list of subdirectories containing Makefiles. SUBDIRS = m4 po src-cht # The source files of the 'chemtool' program. chemtool_SOURCES = main.c draw.c graph.c chemproc.c undo.c inout.c templates.h gettext.h # Make sure the gettext.h include file is found. AM_CPPFLAGS = -I. -I$(srcdir) @GTK_CFLAGS@ # Link time dependencies. LDADD = @LIBINTL@ @GTK_LIBS@ @EMFLIBS@ # Additional files to be distributed. EXTRA_DIST = autogen.sh autoclean.sh # Manual files dist_man_MANS = chemtool.1 cht.1 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 src-cht/Makefile: $(top_builddir)/config.status $(top_srcdir)/src-cht/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) chemtool$(EXEEXT): $(chemtool_OBJECTS) $(chemtool_DEPENDENCIES) @rm -f chemtool$(EXEEXT) $(LINK) $(chemtool_OBJECTS) $(chemtool_LDADD) $(LIBS) src-cht/$(am__dirstamp): @$(MKDIR_P) src-cht @: > src-cht/$(am__dirstamp) src-cht/cht$(EXEEXT): $(src_cht_cht_OBJECTS) $(src_cht_cht_DEPENDENCIES) src-cht/$(am__dirstamp) @rm -f src-cht/cht$(EXEEXT) $(LINK) $(src_cht_cht_OBJECTS) $(src_cht_cht_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` cht.o: src-cht/cht.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cht.o `test -f 'src-cht/cht.c' || echo '$(srcdir)/'`src-cht/cht.c cht.obj: src-cht/cht.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cht.obj `if test -f 'src-cht/cht.c'; then $(CYGPATH_W) 'src-cht/cht.c'; else $(CYGPATH_W) '$(srcdir)/src-cht/cht.c'; fi` install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f src-cht/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-exec-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 # Softlink installed program to batch version install-exec-hook: cd $(DESTDIR)$(bindir) && \ $(LN_S) chemtool chemtoolbg # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: chemtool-1.6.14/draw.c0000644000175000001440000006131411675153204013740 0ustar martinusers/* * draw functions inside the pixmap */ #include #include "ct1.h" void Add_atom (int event_x, int event_y) /* reads the string from the text entry box and inserts it at the current cursor position in the current justification */ { struct xy_co *coord; struct dc *hpc; gchar *name; int x, y; int i; name = (char*)gtk_entry_get_text (GTK_ENTRY (textbox)); if (strlen (name)) { x = round_coord (event_x, size_factor); y = round_coord (event_y, size_factor); coord = position (x, y, x, y, No_angle); for (i = 0; i < (int)strlen (name); i++) { if (name[i] == ' ') name[i] = '\\'; if (name[i] == '*' && i > 0) { /* convert @* to @+dotsymbol */ if (name[i - 1] == '@') name[i] = '\267'; } } del_char (select_char (event_x, event_y, size_factor)); add_char (coord->x, coord->y, name, text_direct, 0, curpen, serif_flag, curfontsize); modify = True; Display_Mol (); } else { hpc = select_char (event_x, event_y, size_factor); if (hpc) { hpc->direct=text_direct; hpc->color=curpen; hpc->font=serif_flag; hpc->size=curfontsize; modify = True; Display_Mol (); } } } void Fetch_atom (int event_x, int event_y) /* loads a label from the current cursor position into the text entry box */ { struct dc *hpc; hpc = select_char (event_x, event_y, size_factor); if (hpc) gtk_entry_set_text (GTK_ENTRY (textbox), hpc->c); } void Del_atom (int event_x, int event_y) /* deletes the label at the current cursor position */ { del_char (select_char (event_x, event_y, size_factor)); modify = True; Display_Mol (); } void Set_vector (int event_x, int event_y, int curbond) /* draws a circle of transient marker boxes corresponding to the current grid angles around the cursor position */ { int angle_count[] = { 0, 12, 10, 10, 8 }; int d, dmax; struct xy_co *coord; hp->x = round_coord (event_x, size_factor); hp->y = round_coord (event_y, size_factor); if (curbond != 8){ /* snap to close bonds unless half arrow is drawn */ coord = position (hp->x, hp->y, hp->x, hp->y, draw_angle); hp->x = coord->x; hp->y = coord->y; } hp->tx = hp->x; hp->ty = hp->y; dmax = angle_count[draw_angle]; for (d = 0; d < dmax; d++) { coord = calc_angle (hp->x, hp->y, draw_angle, d, 1); gdk_draw_rectangle (picture, drawing_area->style->black_gc, TRUE, coord->x * size_factor - 2, coord->y * size_factor - 2, 4, 4); #if 0 /* draw a second ring of markers farther out */ gdk_draw_rectangle (picture, drawing_area->style->black_gc, TRUE, (2*coord->x-hp->x)* size_factor - 2, (2*coord->y-hp->y)*size_factor - 2, 4, 4); gdk_draw_rectangle (picture, drawing_area->style->black_gc, TRUE, (3*coord->x-2*hp->x)* size_factor - 2, (3*coord->y-2*hp->y)*size_factor - 2, 4, 4); #endif } CopyPlane (); } void Add_vector (int cbond) /* adds a bond vector from the previous to the current cursor position */ { if ((hp->x - hp->tx) || (hp->y - hp->ty)) { add_struct (hp->x, hp->y, hp->tx, hp->ty, cbond, 0, 0, 0,curpen); modify = True; } Display_Mol (); } void Add_ring (int draw_angle, int curbond, int ringtype) /* adds a polygon clockwise around the previous and current position */ { double length; /* length of the drawn bond */ double radius; /* the radius of the polygon */ int type; /* type of ring */ int i; /* dummy */ double angle; /* absolute angle on drawing surface */ double o_angle; /* outside angle of the polygon */ double i_angle; /* inside angle of the polygon */ double a; /* temp angle used for aromates */ double mx, my; /* center point */ int aromatic = 0; /* logical: draw aromate? */ float percent = 0.7; /* percentage of ring radius/polygon radius */ int x0, y0, x1, y1; /* start and end points of the drawn side of the polygon */ /* fprintf(stderr, "Begin: %d, %d, %d, %d\n", hp->x, hp->tx, hp->y, hp->ty);*/ Unmark_all (); if (ringtype > 0) { type = ringtype; ringtype = 0; } else { switch (draw_angle) { case 1: /* Hexagon */ default: type = 6; break; ;; case 2: /* Pentagon */ case 3: type = 5; break; ;; case 4: /* Octagon */ type = 8; break; ;; } } /* calculate the parameters of the polygon */ o_angle = 2.0 * M_PI / type; i_angle = M_PI - o_angle; length = sqrt ((double)((hp->tx - hp->x) * (hp->tx - hp->x) + (hp->ty - hp->y) * (hp->ty - hp->y))); /* 'radius' is one cathete of a triangle between one half of a side of the * polygon and the line between one point and the center */ radius = 0.5 * length / cos (0.5 * i_angle); /* fprintf(stderr, "o_angle: %f, i_angle: %f, length: %f, radius: %f\n", * o_angle, i_angle, length, radius);*/ /* check the bondstyle, treat rings specially */ switch (curbond) { case 1: /* use only one type of kekule for uneven pointed rings * otherwise, we'd wind up with one excess double bond */ if (type % 2) { aromatic = 2; } else { aromatic = 1; } curbond = 0; break; ;; case 2: aromatic = 2; curbond = 0; break; case 11: /* circle bond */ aromatic = 3; curbond = 0; break; ;; default: aromatic = 0; break; ;; } if ((hp->x - hp->tx) || (hp->y - hp->ty)) { /* if angle > 180, subtract from 2pi */ if (hp->ty > hp->y) { /* first we calculate the angle of the given bond * relative to the drawing surface */ angle = (2 * M_PI - acos ((hp->tx - hp->x) / length)); } else { angle = (acos ((hp->tx - hp->x) / length)); } /* cos() is the angle between two points on the polygon * and the line from one of those points to the center * 'angle' is used to compensate for arbitrary bonds drawn * by the user */ mx = hp->x + cos (angle - (0.5 * i_angle)) * radius; my = hp->y - sin (angle - (0.5 * i_angle)) * radius; /* fprintf(stderr, "mx: %f, my: %f, angle: %f\n", mx, my, angle);*/ /* draw the polygon */ for (i = 0; i < type; i++) { x0 = (int) rint (mx + radius * sin (i * o_angle + (3 * M_PI / type - angle))); y0 = (int) rint (my - radius * cos (i * o_angle + (3 * M_PI / type - angle))); x1 = (int) rint (mx + radius * sin ((i + 1) * o_angle + (3 * M_PI / type - angle))); y1 = (int) rint (my - radius * cos ((i + 1) * o_angle + (3 * M_PI / type - angle))); /* if conjugated double bonds are selected, * draw kekule style rings * draw every second bond as double bond */ if ((aromatic == 1 && (i + 1) % 2) || (aromatic == 2 && i % 2)) { /* get the angle of the current bond to the canvas */ if (y1 > y0) { a = (2 * M_PI - acos ((x1 - x0) / length)); } else { a = (acos ((x1 - x0) / length)); } add_struct (x0, y0, x1, y1, 2, 1, 1, 0, curpen); } else { add_struct (x0, y0, x1, y1, curbond, 1, 1, 0, curpen); } } /* draw a benzene ring into the polygon if curbond is ring */ if (aromatic == 3) { /* get the middle of the drawn bond */ x0 = (hp->tx + hp->x) / 2; y0 = (hp->ty + hp->y) / 2; /* get the point on the line from the center 70% to the * point above */ x0 = (int)((x0 + percent * mx) / (1.0 + percent)); y0 = (int)((y0 + percent * my) / (1.0 + percent)); add_struct ((int)mx, (int)my, x0, y0, 11, 1, 1, 0,curpen); } } mark.flag = 1; Display_Mol (); modify = True; } void Put_vector (int event_x, int event_y) /* draws the transient line from the previous to the current cursor position */ { int x, y; struct xy_co *coord; x = round_coord (event_x, size_factor); y = round_coord (event_y, size_factor); coord = position (x, y, hp->x, hp->y, draw_angle); x = coord->x; y = coord->y; if (x != hp->x || y != hp->y) { if (hp->x > 0) gdk_draw_line (picture, background_gc, hp->x * size_factor, hp->y * size_factor, hp->tx * size_factor, hp->ty * size_factor); hp->tx = x; hp->ty = y; if (hp->x > 0) gdk_draw_line (picture, drawing_area->style->black_gc, hp->x * size_factor, hp->y * size_factor, hp->tx * size_factor, hp->ty * size_factor); CopyPlane (); } } void Del_vector (int event_x, int event_y) /* deletes the bond vector closest to the current cursor position */ { del_struct (select_vector (event_x, event_y, size_factor)); modify = True; Display_Mol (); } void Invert_vector (int event_x, int event_y) /* exchanges start and endpoint coordinates of a bond (to change direction of a wedge or arrow ) */ { struct data *hdc; int tmp_x, tmp_y; hdc = select_vector (event_x, event_y, size_factor); if (!hdc) return; tmp_x = hdc->x; tmp_y = hdc->y; hdc->x = hdc->tx; hdc->y = hdc->ty; hdc->tx = tmp_x; hdc->ty = tmp_y; modify = True; Display_Mol (); } void Add_double (int event_x, int event_y) /* Changes bondtype : 0 - single 1 - leftdouble 2 - rightdouble 3 - triple 4 - middouble 5 - wedge 6 - dashed wedge 7 - wiggly 8 - single arrow 9 - half arrow 10 - wide single 11 - circle 12 - dotted line 13 - crossing single line 14 - left partial double 15 - right partial double 16 - dashed bond 17 - curved half arrow (shortcut) 18 - uniform triple 19 - quadruple 20 - orbital 21 - filled orbital */ { struct data *hdc; int dx, dy; hdc = select_vector (event_x, event_y, size_factor); if (hdc) { dx = hdc->x - hdc->tx; dy = hdc->y - hdc->ty; if (hdc->bond >= 19) hdc->bond = 0; else ++hdc->bond; if (hdc->bond==17) hdc->bond++; /* no bond can become a curved arrow */ if (hdc->bond>19) hdc->bond = 0; /* nor can it turn into an orbital */ modify = True; } Display_Mol (); } void Set_bondtype (int event_x, int event_y, int curbond) { struct data *hdc; struct spline *hsp; struct xy_co *coord; int d; if (curbond == 17 || curbond > 19) return; /* cannot change anything to 3-point spline */ hdc = select_vector (event_x, event_y, size_factor); if (hdc) { hdc->bond = curbond; hdc->color = curpen; modify = True; } else { if (hp->nsp) { event_x = round_coord (event_x, size_factor); event_y = round_coord (event_y, size_factor); coord = position (event_x, event_y, event_x, event_y, No_angle); hsp = sp_root.next; for (d = 0; d < hp->nsp; d++) { /* fprintf(stderr,"event %d:%d, spline0 %d:%d ,spline3 %d:%d\n", coord->x,coord->y,hsp->x0, hsp->y0, hsp->x3, hsp->y3); */ if ((hsp->x0 == coord->x && hsp->y0 == coord->y) || (hsp->x3 == coord->x && hsp->y3 == coord->y)) { switch (curbond) { case 0: hsp->type = 0; break; case 8: hsp->type = 1; break; case 9: hsp->type = 2; break; case 10: hsp->type = -1; break; case 12: hsp->type = -2; break; default: break; } hsp->color = curpen; modify = True; } hsp = hsp->next; } } } Display_Mol (); } void Set_start_rec (int event_x, int event_y) /* defines first corner of the selection rectangle in mark mode */ { hp->x = event_x; hp->y = event_y; hp->tx = event_x; hp->ty = event_y; hp->startx = event_x; hp->starty= event_y; } void Put_rec (int event_x, int event_y) /* draws the rubberband rectangle in mark mode */ { gdk_draw_rectangle (picture, background_gc, FALSE, hp->x, hp->y, hp->tx - hp->x, hp->ty - hp->y); if (event_x > hp->x) /* motion right */ { if (event_x >= hp->startx) /* right of startpoint */ { hp->tx = event_x; hp->x = hp->startx; /* in case of too fast motion */ } else { hp->x = event_x; /* left of startpoint */ hp->tx = hp->startx; } } else /* motion left */ { if (event_x > hp->startx) /* right of startpoint */ { hp->tx = event_x; hp->x = hp->startx; } else { hp->x = event_x; /* left of startpoint */ hp->tx = hp->startx; } } if (event_y > hp->y) /* motion down */ { if (event_y > hp->starty) /* below startpoint */ { hp->ty = event_y; hp->y = hp->starty; } else /* above startpoint */ { hp->y = event_y; hp->ty = hp->starty; } } else /* upward motion */ { if (event_y > hp->starty) /* below startpoint */ { hp->ty = event_y; hp->y = hp->starty; } else /* above startpoint */ { hp->y = event_y; hp->ty = hp->starty; } } gdk_draw_rectangle (picture, drawing_area->style->black_gc, FALSE, hp->x, hp->y, hp->tx - hp->x, hp->ty - hp->y); CopyPlane (); } void Del_rec () /* deletes the marked fragment inside the rectangle */ { if (hp->n + hp->nc + hp->nsp == 0) /* is anything there at all ? */ return; if (!mark.flag) return; /* if nothing marked, nothing to do */ modify = partial_delete(); /* modify = partial_delete (round_coord (hp->x, size_factor), round_coord (hp->y, size_factor), round_coord (hp->tx, size_factor), round_coord (hp->ty, size_factor)); */ if (modify == True) mark.flag = False; } void Mark_rec (int control_pressed) /* mark all bonds and labels inside the rectangular selection area */ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int hn; int d; int marks = 0; if (hp->tx < hp->x) hp->tx = hp->x; if (hp->ty < hp->y) hp->ty = hp->y; gdk_draw_rectangle (picture, drawing_area->style->black_gc, FALSE, hp->x, hp->y, hp->tx - hp->x, hp->ty - hp->y); #ifdef LIBUNDO undo_snapshot (); #endif CopyPlane (); if (hp->tx == hp->x && hp->ty == hp->y && !control_pressed) { mark.flag = False; Mark_atom(hp->x,hp->y); return; } else { mark.x = round_coord (hp->x, size_factor); mark.y = round_coord (hp->y, size_factor); mark.w = round_coord (hp->tx - hp->x, size_factor); mark.h = round_coord (hp->ty - hp->y, size_factor); mark.flag = True; hp_atom = dac_root.next; hn = hp->nc; for (d = 0; d < hn; d++) { if (check_pos_rec (hp_atom->x, hp_atom->y, mark.x, mark.y, mark.x + mark.w, mark.y + mark.h)) { hp_atom->marked = 1; marks++; } else { if (!control_pressed) { hp_atom->marked = 0; } } hp_atom = hp_atom->next; } hp_bond = da_root.next; hn = hp->n; for (d = 0; d < hn; d++) { if (check_pos_rec (hp_bond->x, hp_bond->y, mark.x, mark.y, mark.x + mark.w, mark.y + mark.h)) { hp_bond->smarked = 1; marks++; } else { if (!control_pressed) { hp_bond->smarked = 0; } } if (check_pos_rec (hp_bond->tx, hp_bond->ty, mark.x, mark.y, mark.x + mark.w, mark.y + mark.h)) { hp_bond->tmarked = 1; marks++; } else { if (!control_pressed) { hp_bond->tmarked = 0; } } hp_bond = hp_bond->next; } hp_spline = sp_root.next; hn = hp->nsp; for (d = 0; d < hn; d++) { if (check_pos_rec (hp_spline->x0, hp_spline->y0, mark.x, mark.y, mark.x + mark.w, mark.y + mark.h) || check_pos_rec (hp_spline->x1, hp_spline->y1, mark.x, mark.y, mark.x + mark.w, mark.y + mark.h) || check_pos_rec (hp_spline->x2, hp_spline->y2, mark.x, mark.y, mark.x + mark.w, mark.y + mark.h) || check_pos_rec (hp_spline->x3, hp_spline->y3, mark.x, mark.y, mark.x + mark.w, mark.y + mark.h)) { hp_spline->marked = 1; marks++; } else { if (!control_pressed) { hp_spline->marked = 0; } } hp_spline = hp_spline->next; } } if (addflag ==1) /* check if marker is within region */ if (check_pos_rec (refx, refy, mark.x, mark.y, mark.x + mark.w, mark.y + mark.h)) refmark=1; /*reset mark.flag, if we did not find anything to mark */ /*fprintf(stderr,"marks %d\n",marks);*/ if (marks == 0) mark.flag = False; /* if (marks == 1) { Unmark_all(); Mark_atom(hp->x,hp->y); } */ } void Unmark_all () /* remove all marks*/ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int hn; int d; #ifdef LIBUNDO undo_snapshot (); #endif mark.flag = False; hp_atom = dac_root.next; hn = hp->nc; for (d = 0; d < hn; d++) { hp_atom->marked = 0; hp_atom = hp_atom->next; } hp_bond = da_root.next; hn = hp->n; for (d = 0; d < hn; d++) { hp_bond->smarked = 0; hp_bond->tmarked = 0; hp_bond = hp_bond->next; } hp_spline = sp_root.next; hn = hp->nsp; for (d = 0; d < hn; d++) { hp_spline->marked = 0; hp_spline = hp_spline->next; } if (addflag==1) refmark=0; } void Mark_atom (int t_x, int t_y) /* marks a single position (for addition of fragments) */ { struct data *hdc; int d, dt,hn,n; refx=-1; refy=-1; t_x=round_coord(t_x,size_factor); t_y=round_coord(t_y,size_factor); hdc = da_root.next; hn = hp->n; for (n = 0; n < hn; n++) { d = calc_vector(abs(hdc->x-t_x),abs(hdc->y-t_y)); dt = calc_vector(abs(hdc->tx-t_x),abs(hdc->ty-t_y)); if (d <10*size_factor) { refx = hdc->x; refy = hdc->y; }else if (dt <10*size_factor) { refx = hdc->tx; refy = hdc->ty; } hdc=hdc->next; } if (refx<0 || refy<0) { /* fprintf(stderr,"no match found for %d %d\n",t_x,t_y);*/ addflag=0; return; } addflag = 1; Display_Mol (); } void Center () /* callback function to center the molecule in the drawing area */ { FreePix (); CreatePix (); center_mol (); Display_Mol (); modify = True; } void Set_pmove (int event_x, int event_y) /* sets the reference position for moving/rotating the selected fragment */ { struct xy_co *coord; struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int x, y; int d, dtmp; draw_ok=1; x = round_coord (event_x, size_factor); y = round_coord (event_y, size_factor); coord = position (x, y, x, y, No_angle); hp->x = coord->x; hp->y = coord->y; /* xcent = hp->x; ycent = hp->y;*/ get_center_marked (&xcent, &ycent); dtmp = 0; /* if (tmpx) { free (tmpx); tmpx = NULL; } if (tmpy) { free (tmpy); tmpy = NULL; }*/ tmpx = realloc (tmpx,(2 * hp->n + hp->nc + 4 * hp->nsp +1) * sizeof (int)); tmpy = realloc (tmpy,(2 * hp->n + hp->nc + 4 * hp->nsp +1) * sizeof (int)); hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_bond->smarked == 1) { tmpx[dtmp] = hp_bond->x - xcent; tmpy[dtmp++] = hp_bond->y - ycent; } if (hp_bond->tmarked == 1) { tmpx[dtmp] = hp_bond->tx - xcent; tmpy[dtmp++] = hp_bond->ty - ycent; } hp_bond = hp_bond->next; } hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { if (hp_atom->marked == 1) { tmpx[dtmp] = hp_atom->x - xcent; tmpy[dtmp++] = hp_atom->y - ycent; } hp_atom = hp_atom->next; } hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->marked == 1) { tmpx[dtmp] = hp_spline->x0 - xcent; tmpy[dtmp++] = hp_spline->y0 - ycent; tmpx[dtmp] = hp_spline->x1 - xcent; tmpy[dtmp++] = hp_spline->y1 - ycent; tmpx[dtmp] = hp_spline->x2 - xcent; tmpy[dtmp++] = hp_spline->y2 - ycent; tmpx[dtmp] = hp_spline->x3 - xcent; tmpy[dtmp++] = hp_spline->y3 - ycent; } hp_spline = hp_spline->next; } if (addflag==1 && refmark==1){ tmpx[dtmp] = refx - xcent; tmpy[dtmp++] = refy - ycent; } } void Put_pmove (int event_x, int event_y, int axis) /* updates the position of the marked fragment as the mouse is dragged */ { int x, y; int dx, dy; x = round_coord (event_x, size_factor); y = round_coord (event_y, size_factor); if (importflag != 0) return; if (!draw_ok) return; if (mark.flag) { dx = x - hp->x; dy = y - hp->y; if (axis == 1) dy = 0; if (axis == 2) dx = 0; if (partial_move (dx, dy)) modify = True; mark.x = mark.x + dx; mark.y = mark.y + dy; hp->x = x; hp->y = y; Display_Mol (); } else { if (move_pos (hp->x, hp->y, x, y)) { hp->x = x; hp->y = y; Display_Mol (); modify = True; } #if 0 /* automatically switch to rubberband rectangle if nothing selected */ else { Set_start_rec(event_x,event_y); drawmode = 4; } #endif } } void Put_protate (int event_x, int event_y, int control_pressed) /* updates the position of the marked fragment as it pivots around the reference position proportional to the x movement of the mouse */ { int x, y; int dx; static float angle; int i; static float ang = 0.; double rotsin = 0.; double rotcos = 0.; if (!draw_ok) return; x = round_coord (event_x, size_factor); y = round_coord (event_y, size_factor); if (importflag != 0) { pdbrotate (x, y, control_pressed); return; } if (!mark.flag) return; /* rotation only makes sense for blocks */ mark.x = 0; mark.y = 0; mark.w = 800; mark.h = 800; dx = x - hp->x; ang += (float) dx / 2.; if (ang < -360.) ang = ang + 360.; if (ang > 360.) ang = ang - 360.; switch (draw_angle) { case 1: angle = 30.0; break; case 2: case 3: angle = 18.0; break; case 4: angle = 45.0; break; } for (i = 0; i < 30; i++) { if (fabs ((angle + (angle * (float) i)) - fabs(ang)) < 4.0 && control_pressed) { rotsin = sin ((angle + (angle * (float) i)) * M_PI / 180.); rotcos = cos ((angle + (angle * (float) i)) * M_PI / 180.); i = 30; /* break loop */ } else { rotsin = sin (ang * M_PI / 180.); rotcos = cos (ang * M_PI / 180.); } } if (partial_rotate (/*xcent, ycent,*/ rotsin, rotcos)) modify = True; hp->x = x; hp->y = y; Display_Mol (); } void Set_pscale (int event_x, int event_y) /* sets the reference position for moving/rotating the selected fragment */ { struct xy_co *coord; struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int x, y; int d, dtmp; draw_ok=1; x = round_coord (event_x, size_factor); y = round_coord (event_y, size_factor); coord = position (x, y, x, y, No_angle); hp->x = coord->x; hp->y = coord->y; if (tmpx) { free (tmpx); tmpx = NULL; } if (tmpy) { free (tmpy); tmpy = NULL; } tmpx = malloc ((2 * hp->n + hp->nc + 4 * hp->nsp) * sizeof (int)); tmpy = malloc ((2 * hp->n + hp->nc + 4 * hp->nsp) * sizeof (int)); get_center_marked (&xcent, &ycent); dtmp = 0; hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_bond->smarked == 1) { tmpx[dtmp] = hp_bond->x - xcent; tmpy[dtmp++] = hp_bond->y - ycent; } if (hp_bond->tmarked == 1) { tmpx[dtmp] = hp_bond->tx - xcent; tmpy[dtmp++] = hp_bond->ty - ycent; } hp_bond = hp_bond->next; } hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { if (hp_atom->marked == 1) { tmpx[dtmp] = hp_atom->x - xcent; tmpy[dtmp++] = hp_atom->y - ycent; } hp_atom = hp_atom->next; } hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->marked == 1) { tmpx[dtmp] = hp_spline->x0 - xcent; tmpy[dtmp++] = hp_spline->y0 - ycent; tmpx[dtmp++] = hp_spline->x1 - xcent; tmpy[dtmp++] = hp_spline->y1 - ycent; tmpx[dtmp++] = hp_spline->x2 - xcent; tmpy[dtmp++] = hp_spline->y2 - ycent; tmpx[dtmp++] = hp_spline->x3 - xcent; tmpy[dtmp++] = hp_spline->y3 - ycent; } hp_spline = hp_spline->next; } } void Put_pscale (int event_x, int event_y, int aniso) /* updates the position of the marked fragment as the mouse is dragged */ { int x; int dx; if (!draw_ok) return; x = round_coord (event_x, size_factor); if (mark.flag) { dx = x - hp->x; if (partial_rescale (dx, aniso)) modify = True; Display_Mol (); } } void Add_number (int event_x, int event_y) /* insert an automatically incremented atom number at the current cursor position*/ { struct xy_co *coord; gchar name[10]; int x, y; snprintf(name,9,"%d",++atnum); if (strlen (name)) { x = round_coord (event_x, size_factor); y = round_coord (event_y, size_factor); coord = position (x, y, x, y, No_angle); del_char (select_char (event_x, event_y, size_factor)); /* add_char (coord->x, coord->y, name, text_direct, 0, curpen, serif_flag, curfontsize);*/ add_char (x, y, name, Middle_Text, 0, curpen, serif_flag, 0); modify = True; Display_Mol (); } } chemtool-1.6.14/autogen.sh0000755000175000001440000000105110715417303014625 0ustar martinusers#!/bin/sh # Example for use of GNU gettext. # Copyright (C) 2003 Free Software Foundation, Inc. # This file is in the public domain. # # Script for regenerating all autogenerated files. autopoint -f # was: gettextize -f -c rm po/Makevars.template rm po/Rules-quot rm po/boldquot.sed rm po/en@boldquot.header rm po/en@quot.header rm po/insert-header.sin rm po/quot.sed aclocal -I m4 autoconf automake -a -c cd po for f in *.po; do if test -r "$f"; then lang=`echo $f | sed -e 's,\.po$,,'` msgfmt -c -o $lang.gmo $lang.po fi done cd .. chemtool-1.6.14/gtkintl.h0000644000175000001440000000105311664245674014471 0ustar martinusers#ifndef __GTKINTL_H__ #define __GTKINTL_H__ #ifdef ENABLE_NLS #include #if !defined _ #define _(String) dgettext("gtk+",String) #endif #ifdef gettext_noop #define N_(String) gettext_noop(String) #else #define N_(String) (String) #endif #else /* NLS is disabled */ #define _(String) (String) #define N_(String) (String) #define textdomain(String) (String) #define gettext(String) (String) #define dgettext(Domain,String) (String) #define dcgettext(Domain,String,Type) (String) #define bindtextdomain(Domain,Directory) (Domain) #endif #endif chemtool-1.6.14/gtkfilesel.h0000644000175000001440000002470110715417303015135 0ustar martinusers/*@ignore@ splint should look away - we know things are redefined here */ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * 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. */ /* * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #ifndef __GTK_FILESEL_H__ #define __GTK_FILESEL_H__ #include #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define GTK_TYPE_FILE_SELECTION (gtk_file_selection_get_type ()) #define GTK_FILE_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelection)) #define GTK_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass)) #define GTK_IS_FILE_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FILE_SELECTION)) #define GTK_IS_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SELECTION)) typedef struct _GtkFileSelection GtkFileSelection; typedef struct _GtkFileSelectionClass GtkFileSelectionClass; struct _GtkFileSelection { GtkWindow window; GtkWidget *dir_list; GtkWidget *file_list; GtkWidget *selection_entry; GtkWidget *selection_text; GtkWidget *main_vbox; GtkWidget *ok_button; GtkWidget *cancel_button; GtkWidget *help_button; /* These are not used. Just fillers in the class structure */ GtkWidget *history_pulldown; GtkWidget *history_menu; GList *history_list; /* ***************** */ GtkWidget *fileop_dialog; GtkWidget *fileop_entry; gchar *fileop_file; gpointer cmpl_state; GtkWidget *fileop_c_dir; GtkWidget *fileop_del_file; GtkWidget *fileop_ren_file; GtkWidget *button_area; GtkWidget *action_area; GtkWidget *history_combo; GList *prev_history; GList *next_history; GtkWidget *mask_entry; gchar *mask; gchar *saved_entry; }; struct _GtkFileSelectionClass { GtkWindowClass parent_class; }; GtkType gtk_file_selection_get_type (void); GtkWidget* gtk_file_selection_new (const gchar *title); void gtk_file_selection_set_filename (GtkFileSelection *filesel, const gchar *filename); gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel); void gtk_file_selection_complete (GtkFileSelection *filesel, const gchar *pattern); void gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel); void gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel); #if 0 static char *filesel_forward_pixmap[] = { /* columns rows colors chars-per-pixel */ "16 16 2 1", " c Gray0", ". c none", /* pixels */ "................", "................", "....... ........", "....... .......", "....... ......", "....... ....", "....... . ...", ". .. ..", ". ... .", ". .. ..", "....... . ...", "....... ....", "....... ......", "....... .......", "....... ........", "................" }; static char *filesel_back_pixmap[] = { /* columns rows colors chars-per-pixel */ "16 16 2 1", " c Gray0", ". c none", /* pixels */ "................", "........ .......", "....... .......", "...... .......", ".... .......", "... . .......", ".. .. .", ". ... .", ".. .. .", "... . .......", ".... .......", "...... .......", "....... .......", "........ .......", "................", "................" }; static char *filesel_up_pixmap[] = { /* columns rows colors chars-per-pixel */ "16 16 2 1", " c Gray0", ". c none", /* pixels */ "................", "........ .......", "....... ......", "...... .....", "..... ....", "..... . ....", ".... ... ...", "... ..... ..", ".. .", "....... ......", "....... ......", "....... ......", "....... ......", "....... ......", "....... ......", "................" }; static char *filesel_home_pixmap[] = { /* columns rows colors chars-per-pixel */ "16 16 2 1", " c Gray0", ". c none", /* pixels */ "................", "................", "........ .. ....", "....... . . ....", "...... ... ....", "..... ..... ....", ".... ....... ...", "... ..", ".. . . .", ".... ....... ...", ".... . . . ...", ".... . . . ...", ".... .... . ...", ".... ...", "................", "................" }; static char *filesel_reload_pixmap[] = { /* columns rows colors chars-per-pixel */ "16 16 2 1", " c Gray0", ". c none", /* pixels */ "................", "................", "................", "...... . ....", ".... .... ....", "... .... ....", "... ............", ".. ......... ..", ".. .......... ..", ".. ......... ..", "..... ... ...", "..... ... ....", "..... . ......", "................", "................", "................" }; #endif static char *filesel_back_pixmap[] = { /* columns rows colors chars-per-pixel */ "18 18 31 1", " c #000000", ". c #0a0a0a", "X c #0e160c", "o c #333632", "O c #373937", "+ c #383b37", "@ c #2f402b", "# c #425e3c", "$ c #44613d", "% c #476440", "& c #759b6c", "* c #7ba172", "= c #82a778", "- c #83a879", "; c #a9afa8", ": c #aeb2ac", "> c #b4b9b3", ", c #abc1a6", "< c #afc6aa", "1 c #b1c7aa", "2 c #b3c9ad", "3 c #b6cbb0", "4 c #baceb5", "5 c #dfe8dd", "6 c #e6ece4", "7 c #e9efe7", "8 c #eaefe8", "9 c #ecf1eb", "0 c #f0f4ef", "q c #f1f5f1", "w c None", "wwwwwwwwwwwwwwwwww", "wwwwwwwwwwwwwwwwww", "wwwwwwwwwwwwwwwwww", "wwwwwwwwwwwww www", "wwwwwwwwwww +; www", "wwwwwwwww O:97 www", "wwwwwww o:99q9 www", "wwwww o:q999q9 www", "www +>95699909 www", "www@,<<2224443.www", "www X#&----=-* www", "wwwww X%&--=-* www", "wwwwwww X#&--* www", "wwwwwwwww X#&* www", "wwwwwwwwwww X$ www", "wwwwwwwwwwwww www", "wwwwwwwwwwwwwwwwww", "wwwwwwwwwwwwwwwwww" }; static char *filesel_forward_pixmap[] = { /* columns rows colors chars-per-pixel */ "18 18 33 1", " c #000000", ". c #0a0a0a", "X c #0e160c", "o c #333632", "O c #373937", "+ c #383b37", "@ c #414c3e", "# c #425e3c", "$ c #45623e", "% c #749a6b", "& c #82a778", "* c #84a87a", "= c #8bae81", "- c #91b286", "; c #a0a99e", ": c #a5ada3", "> c #a7bea2", ", c #b0b4af", "< c #b0c7aa", "1 c #b2c8ac", "2 c #b9ceb4", "3 c #c1d3bb", "4 c #dde6db", "5 c #dfe8dd", "6 c #e5ece3", "7 c #e8eee6", "8 c #edf2ec", "9 c #f0f4ef", "0 c #f1f5f1", "q c #f7f9f6", "w c #f8faf7", "e c #f8faf8", "r c None", /* pixels */ "rrrrrrrrrrrrrrrrrr", "rrrrrrrrrrrrrrrrrr", "rrrrrrrrrrrrrrrrrr", "rrr rrrrrrrrrrrrr", "rrr ,+ rrrrrrrrrrr", "rrr q7:O rrrrrrrrr", "rrr w086:o rrrrrrr", "rrr w00886;o rrrrr", "rrr w8887654:+ rrr", "rrr.322221111>@rrr", "rrr -&*&&*&%#X rrr", "rrr -*&*&%$X rrrrr", "rrr =*&%#X rrrrrrr", "rrr *%#X rrrrrrrrr", "rrr $X rrrrrrrrrrr", "rrr rrrrrrrrrrrrr", "rrrrrrrrrrrrrrrrrr", "rrrrrrrrrrrrrrrrrr" }; static char *filesel_home_pixmap[] = { /* columns rows colors chars-per-pixel */ "18 18 36 1", " c #000000", ". c #181b16", "X c #20241e", "o c #292c27", "O c #323431", "+ c #363d31", "@ c #3f3f3f", "# c #495044", "$ c #53584f", "% c #676a65", "& c #696b67", "* c #737472", "= c #7f7f7f", "- c #7a8771", "; c #7f8b76", ": c #81887b", "> c #899580", ", c #919d8a", "< c #95a08e", "1 c #9aa593", "2 c #9ea897", "3 c #a2a59f", "4 c #a1ac99", "5 c #afb9a8", "6 c #b5bfb0", "7 c #bfc7ba", "8 c #c2cabe", "9 c #c7cec3", "0 c #c8cfc4", "q c #c9d0c5", "w c #ccd2c8", "e c #d0d6cc", "r c #e9ece7", "t c #edefeb", "y c #eff1ee", "u c None", /* pixels */ "uuuuuuuuuuuuuuuuuu", "uuuuuuuuu uuuuuuuu", "uuuuuuuu@ou@%Ouuuu", "uuuuuuu@y4X%q$uuuu", "uuuuuu@rq84%q$uuuu", "uuuuu@r00q846$uuuu", "uuuu@r0000084#uuuu", "uuu@y00000qq81.uuu", "uu@yw000q0q9982.uu", "u *3w00000q888:+ ", "uuu=e0000089q5+uuu", "uuu=e0<421q095+uuu", "uuu=wq40819995+uuu", "uuu=e048w1qq95+uuu", "uuu=e82wq<7775+uuu", "uuu*,>;,,->>>>+uuu", "uuu uuu", "uuuuuuuuuuuuuuuuuu" }; static char *filesel_reload_pixmap[] = { /* columns rows colors chars-per-pixel */ "18 18 23 1", " c #000000", ". c #0e0e0e", "X c #0d110a", "o c #11150d", "O c #141a10", "+ c #1c1f19", "@ c #1b2215", "# c #1e2618", "$ c #26301e", "% c #2a3421", "& c #2f3c25", "* c #37452b", "= c #38472c", "- c #3b4a2e", "; c #3e4d30", ": c #415233", "> c #4a5d3a", ", c #4c603c", "< c #50643f", "1 c #526740", "2 c #546942", "3 c #586d44", "4 c None", /* pixels */ "444444444444444444", "444444444 44444444", "44444444O 44444444", "4444444O,o 444444", "444444O321>&# 4444", "4444 4 :2=$:>;X444", "444 44 ; 4.+%* 44", "44 4444 444 %@44", "44@ 4444444444X@44", "44@@4444 44444 X44", "44X*X.44 O4444 44", "44 %;&& o2O44 444", "444 #::,123O444444", "44444 o$=1: 444444", "44444444 - 4444444", "44444444 44444444", "444444444444444444", "444444444444444444" }; /* XPM */ static char *filesel_up_pixmap[] = { /* columns rows colors chars-per-pixel */ "18 18 31 1", " c #000000", ". c #0a0a0a", "X c #0e160c", "o c #333632", "O c #373937", "+ c #383b37", "@ c #2f402b", "# c #425e3c", "$ c #44613d", "% c #476440", "& c #759b6c", "* c #7ba172", "= c #82a778", "- c #83a879", "; c #a9afa8", ": c #aeb2ac", "> c #b4b9b3", ", c #abc1a6", "< c #afc6aa", "1 c #b1c7aa", "2 c #b3c9ad", "3 c #b6cbb0", "4 c #baceb5", "5 c #dfe8dd", "6 c #e6ece4", "7 c #e9efe7", "8 c #eaefe8", "9 c #ecf1eb", "0 c #f0f4ef", "q c #f1f5f1", "w c None", /* pixels */ "wwwwwwwwwwwwwwwwww", "wwwwwwwwwwwwwwwwww", "wwwwwwwwwwwwwwwwww", "wwwwwww @ wwwwwwww", "wwwwwwwX,+wwwwwwww", "wwwwww #<> wwwwwww", "wwwwwwX&19owwwwwww", "wwwww %-25: wwwwww", "wwwwwX&-26qowwwwww", "wwww #=-299: wwwww", "wwwwX&=-4999+wwwww", "www #-==49q9: wwww", "wwwX&---49qq9Owwww", "ww $****29997; www", "ww . www", "wwwwwwwwwwwwwwwwww", "wwwwwwwwwwwwwwwwww", "wwwwwwwwwwwwwwwwww" }; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __GTK_FILESEL_H__ */ /*@end@*/ chemtool-1.6.14/gettext.h0000644000175000001440000000575110715417303014474 0ustar martinusers/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((const char *) (Msgid)) # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String #endif /* _LIBGETTEXT_H */ chemtool-1.6.14/chemtool.desktop0000644000175000001440000000043710715417303016040 0ustar martinusers[Desktop Entry] Encoding=UTF-8 Name=Chemtool Comment=The molecules drawing program (2D) Comment[cs]=Kreslení chemických vzorců Comment[de]=Moleküleditor Exec=chemtool Icon=chemtool.png Terminal=false Type=Application MimeType=application/x-chemtool Categories=Application;Chemistry chemtool-1.6.14/chemtool.10000644000175000001440000004437111675353451014545 0ustar martinusers.\" Copyright 1999 Thomas Volk .\" Copyright 1999-2006 Dr. Martin Kroeker .\" Most of this was copied from the README file. Do not restrict distribution. .\" May be distributed under the GNU General Public License .TH "CHEMTOOL" "1" "23 Dec 2011" "1.6.13" "User commands" .SH NAME chemtool \- chemical structures editor .SH SYNOPSIS .HP 10 .B chemtool .RI [ filename ] .SH DESCRIPTION .PP .B chemtool is a program for drawing organic molecules and exporting them as a X bitmap, PNG, PicTeX, Xfig, SVG, SXD, MDL or EPS file. It runs under the X Window System using the GTK widget set. .PP The program offers essentially unlimited undo/redo, two text fonts plus symbols, seven colors, drawing at several zoom scales, and square and hexagonal backdrop grids for easier alignment. .SH EXAMPLES .PP In all drawing and editing modes, mouse button one (usually the left button) is used to mark or draw objects, while button three (the right button) can be used to delete objects of the current type. The middle button is mainly used in the bond drawing modes where it allows fast changing of bondtypes. Starting with version 1.5, the default storage directory for datafiles, and the filename extension to use, can be saved via a configuration dialog. .SS Drawing of bonds: .PP Bonds can be drawn in 4 different angle settings (hexagon with 30\(de intervals, two pentagons with 72\(de intervals (different orientation), and a 45\(de i octagon). (Intermediate angles are possible in all of these modes as well - just ignore the marker points in this case). .PP The bond style chooser in the center of the button bar determines the type of bond that is drawn - initially, this is a single bond. If you want to change the type of a bond later, either click on it with the middle button of your mouse to advance to the next type(s), or select the appropriate type in the chooser and then switch to bondtype mode and pick all bonds that you want to change over to the new type. (The color used for the bond is updated at the same time if necessary.) Pressing the middle mousebutton on a bond when in 'Bondtype' mode reverses the direction of that bond. .PP Using the third (usually the right) mouse button deletes the bond next to the cursor position. .PP The available bond types are: .PP .RS 8 .IP \(bu 2 single bond .IP \(bu 2 double bond .IP \(bu 2 double bond (shorter line on the other side) .IP \(bu 2 centered double bond .IP \(bu 2 triple bond (flanking lines shorter than central) .IP \(bu 2 triple bond (with equal line lengths) .IP \(bu 2 quadruple bond .IP \(bu 2 wedge-shaped bond .IP \(bu 2 dashed wedge-shaped bond .IP \(bu 2 wavy line .IP \(bu 2 half arrow .IP \(bu 2 regular arrow .IP \(bu 2 wide bond .IP \(bu 2 circle .IP \(bu 2 dotted line .IP \(bu 2 overlapping single bond (which cuts out a segment from any bond it crosses) .IP \(bu 2 light pi orbital lobe .IP \(bu 2 dark pi orbital lobe .RE .SS Semiautomatic drawing of rings: .PP Rings of 3 to 12 members can be drawn easily by holding down the Ctrl key while drawing a line. This line will then become the first segment of a ring that is automatically drawn in clockwise direction. The size of the ring defaults to that appropriate for the selected drawing mode (i.e. 5, 6 or 8 sides), but it can be set on a per-ring basis by pressing Ctlr- before drawing the ring, where numbers 3-9 correspond to 3 to 9-membered rings, while 0 to 2 select 10, 11 and 12-membered rings, respectively. .PP Newly drawn rings can be deleted by pressing Ctrl and mouse button 3 together. .SS Drawing of curved lines: .PP Curved lines for objects like arrows or orbital lobes can be drawn in spline curve mode by specifying four control points that form a bounding polygon (startpoint, two points on either side of the peak, endpoint). Of the regular bondtypes available in the Style menu, the 'single line', 'semiarrow', arrow and 'dashed line' retain their usual function, while the 'wide line' type is used to denote a filled polygon. The control points are only visible in .I Move mode, where they can be dragged around to change the form of a curve after it is drawn. .SS Setting bond style .PP In bond style mode, clicking on any bond in the diagram changes its representation to the type selected in the pull-down menu next to the .I Type button. The additional bond type available in the pulldown menu, .RS curved arrow .RE is only available for drawing. It is actually a shortcut for one of the curve drawing functions described above, with the second and third control points automatically generated. As such, it can not be converted to or from any of the conventional bond types. (One can, however, convert it to any of the other curve types, e.g. to change the type of arrowhead). The shape of the arrow will usually need to be adjusted by shifting the control point that appears alongside it in 'Move' mode. .SS Inserting text .PP Text written into the text box can be positioned with the cursor and may appear left, middle or right-aligned in the drawing. Text size and color is selectable from a fixed list of choices. There are two special characters to be used for sub- and superscripting the following character: .RS 8 \(aq^\(aq to shift up (e.g. N^+) \(aq_\(aq to shift down (e.g. CH_3) .RE .PP The control character '|' is used to italicise the following character, as in |t-Bu. .PP A bold fonttype, typically used for numbering compounds, can be selected by preceding the character with a '#'. .PP The special character '@' switches to symbol mode, which uses the standard X11 symbol font. All alphabetic keys produce the corresponding Greek characters in this mode, and several other symbols are available if their standard Latin1 equivalents are already mapped onto the keyboard: .RS 8 yen -> infinity hyphen -> uparrow macron -> downarrow .RE .PP The symbols 'plusminus' and 'registered' (trademark) are already in the standard font, although they are not normally available on the keyboard. Use the following commands (or add the declarations to your \fI.xmodmaprc\fR ) to make them available via + (+): .RS 8 xmodmap \-e 'keysym r = r R registered' \\ \-e 'keysym o = o O yen' \\ \-e 'keysym p = p P plusminus' \\ \-e 'keysym u = u U hyphen' \\ \-e 'keysym d = d D macron' .RE (this leads to AltGr-P = plusminus, AltGr-R = registered in normal mode and AltGr-O = infinity, AltGr-U = uparrow, AltGr-D = downarrow in symbol font). .PP For 'dots-and-crosses' diagrams, the following mappings to the symbol font might be useful: acute -> cross (e.g. keysym x = x X acute) middle dot -> filled dot (e.g. keysym d = d D periodcentered) (using the degree sign for the open dot). .PP Circled versions of the plus and minus signs for denoting ionic charge are available as @+ and @- . .PP When you want to use symbols as sub- or superscripts, place the sub- or superscripting character before the '@' character, e.g. K_@a . .PP In text mode, the right mouse button deletes the label at the cursor position. Changing the size, font or color of a label can be done by left-clicking on it after choosing the desired combination of settings. When the text entry box above the drawing area is empty, only the settings are updated without changing the contents of the label, otherwise the label text is replaced as well. If you want to copy the text of an existing label to the text entry box, click on it with the middle mouse button. .SS Labeling shortcuts .PP In all bond drawing modes, several keyboard shortcuts are available to add atom symbols without having to leave drawing mode. The label is placed at the current drawing position (the endpoint of the last line drawn, or the spot last clicked on). .PP The keys 'c','h','n','o','s','p' and 'r' insert the corresponding capital letter, 'l' (lowercase L) inserts 'Cl', while '1', '2', '3' insert CH,CH_2 and CH_3, respectively. The asterisk key (*) inserts a filled circle. .PP Pressing the space bar once allows you to enter arbitrary labels, which will be placed at the current position when you press the Return key. .SS Drawing electron pairs .PP The keys of the numeric keypad can be used to draw short 'electron pair' lines next to an element symbol - if one imagines the element symbol to be sitting on the central '5' key, each key draws the appropriate electron pair for its position. When used together with the Shift key, two dots are drawn instead of a line - simply delete one of the dots again if you need an odd number of electrons. .SS Numbering atoms .PP For quick numbering of the atoms in a molecule, switch to one of the text modes, hold down the Control key and pick each atom in succession with the left mouse button. Numbering starts at 1, and the sequence can be reset at any time by clicking the right mouse button. If you need to use your own numbering scheme, clicking the middle button (while still holding down the Control key) makes it pick up whatever number is in the text entry field. .SS Centering .PP If there is not enough space for your molecule you can put it in the middle of the sheet with the center button. .SS Exporting to foreign formats: .PP You can export your molecules as an X bitmap, a PNG or EMF image, an encapsulated postscript file, an input file for Brian Smith' \fBxfig\fR(1) program, an MDL ver. 2000 molfile for data exchange with commercial packages, an SVG file for XHTML web pages, or in the PicTeX format for direct inclusion in LaTeX documents. The PicTeX, PNG, EMF and Postscript output functions rely on the \fBfig2dev\fR81) program from the \fBtransfig\fR(1) package and are only available when this program was detected on startup. If the \fBfig2sxd\fR(1) program is installed, an additional export option is available for OpenOffice SXD format. Likewise, if the (open)babel program is installed, an additional Export menu providing access to all filetypes supported by this tool becomes available. .PP You can create the outputs in different sizes according to the current zoom scale. Postscript and PicTeX files can also be created at arbitrary scales selectable on the export file menu. .PP An option in the configuration menu can be set to call \fBfig2dev\fR in international language mode, which will automatically render any text written in the alternate (Times) font using the postscript font appropriate for the current locale (currently Croatian, Cyrillic, Czech, Hungarian, Japanese, Korean, Polish). See the \fBfig2dev\fR documentation for details. .PP To include the PicTeX-file in your LaTeX document, you will need the pictex macro package. Depending on the versions you use, you might also have to load the 'color' package in the preamble of your LaTeX file. If you experience 'TeX capacity exceeded' error messages, increase the extra_mem_bot parameter in your \fItexmf.cnf\fR file (usually in \fI/usr/share/texmf/web2c\fR, \fI/usr/local/texmf\fR or \fI/etc/texmf\fR). Pictex is known for its unusual (by tex standards) memory requirements, and the standard settings do not account for this (although you may find a comment a la 'change this if you use pictex' in the \fItexmf.cnf\fR file). Something like extra_mem_bot=400000 should not hurt on any moderately modern system. .SS Printing drawings .PP Since version 1.5, direct printing of diagrams to a Postscript-capable printing device (or more typically a print queue running ghostscript) is possible. The paper size, magnification, printer name and the print command to use (currently either \fBlp\fR(1), \fBlpr\fR(1) or \fBkprinter\fR(1)) can be stored in the Configuration Dialog. .SS Selecting all or parts of a drawing for transformations: .PP Using the 'Mark' button, you can easily select parts of the current drawing by enclosing them with a 'rubberband' rectangle. .PP If you need to add atoms outside of the rectangular area to your selection, simply draw another rubberband around them while holding down the Ctrl key. .PP The selected parts will appear highlighted in blue and are immediately available for .TP 12 .I moving simply drag the fragment to the desired position with the mouse while holding down the left mouse button. (If you only need to move individual atoms or bonds, you can simply pick and drag them in 'Move' mode without having to mark them first). .TP 12 .I rotating horizontal movement of the mouse translates to smooth rotation around the pivot point selected when pressing the mouse button .TP 12 .I flipping (mirroring) the fragment about a horizontal or vertical mirror plane through its center: this is performed by clicking on the appropriate menu button .TP 12 .I copying clicking on the 'Copy' menu button creates an exact copy of the selected fragment slightly offset to the original. The mark is automatically transferred to the new copy. .TP 12 .I rescaling horizontal mouse movement is translated into a smooth increase or decrease of size of the marked fragment .TP 12 .I deleting to delete the marked fragment, simply click the third (usually the right) mouse button after it is highlighted. .TP 12 .I framing choosing one of the icons from the drop-down list of frame and bracket styles draws the corresponding object, e.g. a pair of round parentheses, around the highlighted fragment. .TP 12 .I optimizing clicking on the 'bucket and broom' symbol invokes a function that removes overlapping (duplicate) bonds and labels from the drawing and straightens lines that are almost horizontal or vertical. .SS Adding previously saved figures: .PP To add another molecule from a previously saved chemtool drawing, select it in the file selection window that comes up when you press the 'Add' button. Single clicking on any filename in the list displays a small preview of the molecule to aid in selection. The newly added molecule is automatically made active so that it can be repositioned as desired. .PP If you want to add it to a predefined position on another molecule, you can mark that attachment site by left-clicking on it instead of dragging the marker rectangle. A small green dot will appear at what is now the reference position for the new part. If you save molecules with such a marker set, it will in turn define their attachment site when they are added to another drawing. .SS Adding one of the predefined templates: .PP Selecting 'Templates' from the 'Tools' menu opens a second window with a small collection of predefined structures. Simply click on the image of the desired molecule to add it to your drawing. The Template window can be kept open throughout a chemtool session - if it is hidden by another window, you can move it to the front by selecting the 'Template' menu in chemtool again. .PP The data in the template system differ from normal chemtool drawings only by the fact that they are stored within the program, and in a slightly awkward format (x and y coordinates listed separately in the source file templates.h). These are meant to provide a convenient basis set available to all users, but not individually extendable (you can use the 'Add' function for your own structures). Please let us know if you want specific molecules added to the templates - their name or ideally a regular chemtool drawing file is all we need. (send email to martin@ruby.chemie.uni-freiburg.de) .SS Importing foreign file formats: .PP Chemtool provides functions for importing files in both the PDB format used by the Protein Database (and by most molecular modeling packages) and the proprietary MDL molfile format used by ISISdraw and understood by other structure drawing packages and database frontends. .PP As both are 3D file formats, while chemtool only handles 2D projections, imported molecules are read into a temporary storage at first and displayed in blue on the canvas. This 3D representation can then be rotated using the mouse. Only after pressing the Return key on the keyboard is it converted into the final 2D projection that can be edited. While such a 3d import is in progress, all normal drawing and editing functions are disabled. .PP With MDL molfile import, the carbon atom labels are automatically discarded. For PDB import, the amount of labeling can be chosen in the file selection dialog, which offers retention of either all labels, only those of non-hydrogen atoms, or only the non-numeric part of the labels. .PP If the program babel is installed - either the original version written by Pat Walters or the more recent OpenBabel effort - chemtool will automatically offer a menu option for importing from any of the file formats this supports. .SS Determining sum formula and molecular weight: .PP The distribution contains a helper program, \fBcht\fR(1), by Radek Liboska (Prague) to calculate sum formula and (exact) molecular weight from a chemtool drawing file. It is also available from within chemtool to calculate these data for the current structure or a marked fragment of it. \fBcht\fR can be misled by duplicate bonds ( chemtool does not remove overlapping bonds, such as they might result from fusing ring systems, automatically) and by the 'aromatic ring' symbol, so you should avoid these and check the plausibility of the generated sum formula where possible. .SS Drawing functions not available within Chemtool: .PP For features not currently supported by chemtool, like general line-drawing functions, getting Brian Smith's XFig drawing package \fBxfig\fR is highly recommended. About the only thing it does not offer is support for 'chemical' linetypes and drawing angles - which is why chemtool was written as a sort of companion program. (There will probably be more of the most sorely needed drawing options added to chemtool over time, but duplicating the more general-purpose features of \fBxfig\fR seems rather pointless.) .SH LICENSE .PP \fBchemtool\fR and its companion program \fBcht\fR are available under the terms of the GNU General Public License (see the file 'COPYING' in the package). This software comes with ABSOLUTELY NO WARRANTY. .SH AUTHORS .TP .B Thomas Volk Original author and maintainer up to 1.1.1. .TP .BR "Dr. Martin Kroeker " <\&martin@ruby.chemie.uni-freiburg.de\&> Maintainer and primary author since 1.1.2. .PP .BR "Radek Liboska, PhD " <\&liboska@uochb.cas.cz\&> .PP .BR "Michael Banck " <\&mbanck@gmx.net\&> .PP and many others. .SH SEE ALSO .BR babel (1), .BR cht (1), .BR fig2dev (1), .BR fig2sxd (1), .BR transfig (1), .BR xfig (1) .PP Homepage: .br .I \%http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html chemtool-1.6.14/inout.c~0000644000175000001440000057076512202267604014353 0ustar martinusers/* * functions for in and output */ #include "ct1.h" #include "inout.h" #include #include #include #include #include #include "gdk/gdkprivate.h" #include #ifdef EMF #include #endif #ifndef ENABLE_NLS #define _(Text) Text #else #include #define _(Text) gettext(Text) #endif #ifdef GTK2 extern PangoFontDescription *font[7], *smallfont[7], *symbfont[7], *ssymbfont[7], *slfont[7], *boldfont[7], *textfont[7]; #else extern GdkFont *font[7],*smallfont[7],*symbfont[7],*boldfont[7],*slfont[7]; #endif static char babeloutp[4]; int save_mol (FILE * fp, int partial) /* saves the current structure to a file in native chemtool format */ { int d; int w, h; struct data *hp_b; struct dc *hp_a; struct spline *hp_sp; int mbonds = 0, mlabels = 0, msplines = 0; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif /* get true extents of drawing*/ w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (partial == 1 && hp_b->smarked == 0 && hp_b->tmarked == 0) { hp_b = hp_b->next; } else { if (partial) mbonds++; w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); hp_b = hp_b->next; } } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (partial && !hp_a->marked) { hp_a = hp_a->next; } else { if (partial) mlabels++; w = MAX (w, hp_a->x); h = MAX (h, hp_a->y); hp_a = hp_a->next; } } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (partial && !hp_sp->marked) { hp_sp = hp_sp->next; } else { if (partial) msplines++; w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); hp_sp = hp_sp->next; } } w = (int) (w * 1.1); h = (int) (h * 1.1); fprintf (fp, "Chemtool Version " VERSION "\n"); fprintf (fp, "geometry %i %i\n", w, h); hp_b = da_root.next; if (partial) fprintf (fp, "bonds %i\n", mbonds); else fprintf (fp, "bonds %i\n", hp->n); for (d = 0; d < hp->n; d++) { if (partial && !hp_b->smarked && !hp_b->tmarked) { hp_b = hp_b->next; } else { /* if (hp_b->decoration == 1) {*/ fprintf (fp, "%i %i %i %i %i %i %i\n", hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, hp_b->bond, hp_b->decoration,hp_b->color); /* }else{ fprintf (fp, "%i %i %i %i %i\n", hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, hp_b->bond); }*/ hp_b = hp_b->next; } } hp_a = dac_root.next; if (partial) fprintf (fp, "atoms %i\n", mlabels); else fprintf (fp, "atoms %i\n", hp->nc); for (d = 0; d < hp->nc; d++) { if (partial && !hp_a->marked) { hp_a = hp_a->next; } else { fprintf (fp, "%i %i %s %i %i %i %i\n", hp_a->x, hp_a->y, hp_a->c, hp_a->direct, hp_a->color,hp_a->font,hp_a->size); hp_a = hp_a->next; } } hp_sp = sp_root.next; if (partial) fprintf (fp, "splines %i\n", msplines); else fprintf (fp, "splines %i\n", hp->nsp); for (d = 0; d < hp->nsp; d++) { if (partial && !hp_sp->marked) { hp_sp = hp_sp->next; } else { fprintf (fp, "%i %i %i %i %i %i %i %i %i %i\n", hp_sp->x0, hp_sp->y0, hp_sp->x1, hp_sp->y1, hp_sp->x2, hp_sp->y2, hp_sp->x3, hp_sp->y3, hp_sp->type,hp_sp->color); hp_sp = hp_sp->next; } } if (addflag==1) { fprintf (fp,"attach %i %i\n",refx,refy); } fprintf(fp,"scalefactors %f %d\n",bondlen_mm,zoom_factor); /* fclose (fp);*/ return (0); } int load_mol (char *filename) /* loads a chemtool file, checking for correct header */ { int d, n, i; int x, y, tx, ty, x2, y2, x3, y3, b, deco, col, fnt, siz; int res; char str[255], str1[255]; FILE *fp; char version[10]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if (!strcmp(filename,"-")) fp=fdopen(0,"r"); else if ((fp = fopen (filename, "r")) == NULL) return (1); res = fscanf (fp, "%s %s %s", str, str1, version); if (res != 3) { fclose (fp); return (2); } if (strcmp (str, "Chemtool") || strcmp (str1, "Version")) { fclose (fp); return (2); } clear_data (); res = fscanf (fp, "%s %i %i", str, &x, &y); if (res == 3 && !strcmp (str, "geometry")) { head.width = MAX (head.width, x); head.height = MAX (head.height, y); } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && (!strcmp (str, "bonds") || !strcmp (str, "bounds"))) { /* typo in versions < 1.1.2 */ res = fgetc(fp); if (res == EOF) { fclose (fp); return (2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)) { fclose (fp); return (2); } i=sscanf (str, "%i %i %i %i %i %i %i", &x, &y, &tx, &ty, &b, &deco, &col); if (i == 7) add_struct (x, y, tx, ty, b, 0, 0, deco, col); else if (i == 6) add_struct (x, y, tx, ty, b, 0, 0, deco, 0); else add_struct (x, y, tx, ty, b, 0, 0, 0, 0); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "atoms")) { res = fgetc(fp); if (res == EOF) { fclose (fp); return (2); } for (d = 0; d < n; d++) { if (!fgets(str,33+MAXCL,fp)){ fclose (fp); return (2); } i=sscanf (str, "%i %i %s %i %i %i %i", &x, &y, str, &b, &col, &fnt, &siz); if (i==7) add_char (x, y, str, b, 0, col, fnt, siz); else if (i == 6) add_char (x, y, str, b, 0, col, fnt, 3); else if (i<5) add_char (x, y, str, b, 0, 0, 0, 3); else add_char (x, y, str, b, 0, col, 0, 3); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "splines")) { if (n > 0) { res = fgetc(fp); if (res == EOF) { fclose (fp); return (2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)){ fclose (fp); return (2); } i=sscanf (str, "%i %i %i %i %i %i %i %i %i %i", &x, &y, &tx, &ty, &x2, &y2, &x3, &y3, &b,&col); if (i<10) add_spline (x, y, tx, ty, x2, y2, x3, y3, b, 0, 0); else add_spline (x, y, tx, ty, x2, y2, x3, y3, b, 0, col); } } } res = fscanf (fp, "%s %s %i", str, str1,&y); if (res == 3 && !strcmp(str,"attach")){ refx=atoi(str1); refy=y; addflag=1; } else if (res == 3 && !strcmp(str,"scalefactors")){ double bondlen_new = atof(str1); if (fabs(bondlen_mm - bondlen_new)>1.e-3){ size_factor *= bondlen_new/bondlen_mm; bondlen_mm = bondlen_new; } zoom_factor=y; Zoom(NULL,"2"); } res = fscanf (fp, "%s %s %d", str, str1, &y); if (res == 3 && !strcmp(str,"scalefactors")){ double bondlen_new = atof(str1); if (fabs(bondlen_mm - bondlen_new)>1.e-3){ size_factor *= bondlen_new/bondlen_mm; bondlen_mm = bondlen_new; } zoom_factor=y; Zoom(NULL,"2"); } fclose (fp); if (atof (version) > atof (VERSION)) return (3); return (0); } int load_preview (char *filename) /* loads a chemtool file, checking for correct header */ { int d, n; int x, y, tx, ty, x2, y2, x3, y3, b, col, fnt; int res; float savedfactor; char str[255], str1[255]; FILE *fp; char version[10]; GdkRectangle update_rect; int fontsize; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); savedfactor = size_factor; res = fscanf (fp, "%s %s %s", str, str1, version); if (res != 3) { fclose (fp); return (2); } if (strcmp (str, "Chemtool") || strcmp (str1, "Version")) { fclose (fp); return (2); } res = fscanf (fp, "%s %i %i", str, &x, &y); if (res != 3) { fclose (fp); return (2); } size_factor = MIN (200. / x, 100. / y); res = fscanf (fp, "%s %i", str, &n); if (res == 2 && (!strcmp (str, "bonds") || !strcmp (str, "bounds"))) { /* typo in versions < 1.1.2 */ res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)) { fclose(fp); return(2); } res = sscanf (str, "%i %i %i %i %i %i", &x, &y, &tx, &ty, &b, &col); if (res >= 5) draw_preview_bonds (x, y, tx, ty, b); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "atoms")) { if (size_factor < 0.15) fontsize=0; else fontsize=1; res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,33+MAXCL,fp)){ fclose(fp); return(2); } res = sscanf (str, "%i %i %s %i %i %i", &x, &y, str, &b, &col,&fnt); if (res >= 4) Drawstring (x, y, str, b, 0,0,0,1,fontsize); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "splines")) { if (n>0) { res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)){ fclose(fp); return(2); } res = sscanf (str, "%i %i %i %i %i %i %i %i %i %i", &x, &y, &tx, &ty, &x2, &y2, &x3, &y3, &b,&col); if (res >= 9) Drawspline (x, y, tx, ty, x2, y2, x3, y3, b, 0,0); } } } res = fscanf (fp, "%s %i %i", str, &xref,&yref); if (res == 3 && !strcmp(str,"attach")){ draw_preview_bonds(xref-4,yref-4,xref+4,yref+4,0); draw_preview_bonds(xref-4,yref+4,xref+4,yref-4,0); } gdk_draw_pixmap (preview_area->window, drawing_area->style-> fg_gc[GTK_WIDGET_STATE (drawing_area)], picture, 0, 0, 0, 0, 200, 100); update_rect.x = 0; update_rect.y = 0; update_rect.width = 200; update_rect.height = 100; gtk_widget_draw ((GtkWidget *) preview_area, &update_rect); size_factor = savedfactor; fclose (fp); return (0); } int add_mol (char *filename) /* loads a chemtool file and adds its contents at a given position */ { int d, n, i; int x, y, tx, ty, x2, y2, x3, y3, b, deco, col, fnt, siz; int res; int xdiff = 0, ydiff = 0; char str[255]; FILE *fp; char version[10]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); res = fscanf (fp, "%s %s %s", str, str, version); if (res != 3 || atof (version) > atof (VERSION)) { fclose (fp); return (2); } Unmark_all(); res = fscanf (fp, "%s %i %i", str, &x, &y); if (res == 3 && !strcmp (str, "geometry")) { head.width += x; mark.w = x; head.height += y; mark.h = y; mark.flag = 1; } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && (!strcmp (str, "bonds") || !strcmp (str, "bounds"))) { res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)){ fclose(fp); return(2); } i= sscanf (str, "%i %i %i %i %i %i %i", &x, &y, &tx, &ty, &b, &deco, &col); if (i == 7) add_struct (x, y, tx, ty, b, 1, 1, deco, col); else if (i == 6) add_struct (x, y, tx, ty, b, 1, 1, deco, 0); else add_struct (x, y, tx, ty, b, 1, 1, 0, 0); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "atoms")) { res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,33+MAXCL,fp)) { fclose(fp); return(2); } i=sscanf (str, "%i %i %s %i %i %i %i", &x, &y, str, &b, &col, &fnt, &siz); x = x + xdiff; y = y + ydiff; if (i==7) add_char (x, y, str, b, 1, col, fnt, siz); else if (i==6) add_char (x, y, str, b, 1, col, fnt, 3); else if (i<5) add_char (x, y, str, b, 1, 0, 0, 3); else add_char (x, y, str, b, 1, col, 0, 3); } } res = fscanf (fp, "%s %i ", str, &n); if (res == 2 && !strcmp (str, "splines")) { if (n>0) { res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)) { fclose(fp); return(2); } i=sscanf (str, "%i %i %i %i %i %i %i %i %i %i", &x, &y, &tx, &ty, &x2, &y2, &x3, &y3, &b,&col); if (i<10) add_spline (x, y, tx, ty, x2, y2, x3, y3, b, 0,0); else add_spline (x, y, tx, ty, x2, y2, x3, y3, b, 0,col); } } } res = fscanf (fp, "%s %i %i", str, &xref,&yref); if (res == 3 && !strcmp (str, "attach")) { xref=refx-xref; yref=refy-yref; partial_move (xref,yref); } fclose(fp); return (0); } int import_pdb (char *filename) { char line[255]; int i, j,m; int res; int connect = 0; double dist; double pdbxmin = 100000., pdbxmax = -100000., pdbymin = 1000000., pdbymax = -100000., pdbzmin = 100000., pdbzmax = -100000.; char code[8]; float pdbfactor = 50.; int pdboffset = 500; int at0, con[6]; FILE *fp; int *atnum=NULL; int found=0; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); /* skip to the first atom or heteroatom record */ for (i = 0;; i++) { if (fgets (line, (int)sizeof (line), fp) == NULL) { fclose (fp); return (1); } if (!strncmp (line, "END", 3) || feof (fp)) { /*premature end */ fclose (fp); return (1); } if (!strncmp (line, "ATOM", 4) || !strncmp (line, "HETATM", 6)) break; } clear_data (); FreePix(); i = -1; /* read in atom block data */ while (!feof (fp)) { if (!strncmp (line, "ATOM", 4) || !strncmp (line, "HETATM", 6)) { i++; pdbx = realloc (pdbx, (i + 1) * sizeof (double)); pdby = realloc (pdby, (i + 1) * sizeof (double)); pdbz = realloc (pdbz, (i + 1) * sizeof (double)); atjust = realloc (atjust, (i + 1) * sizeof (short)); atcode = realloc (atcode, (i + 1) * sizeof (char *)); atnum = realloc (atnum,(i+1)*sizeof(int)); atcode[i] = malloc (9 * sizeof (char)); atjust[i] = 0; res = sscanf (line, "%s %d %s %*6c %*6c %lf %lf %lf", code, &atnum[i],atcode[i], &pdbx[i], &pdby[i], &pdbz[i]); if (res < 6) { fclose (fp); return (1); } pdbxmin = MIN (pdbxmin, pdbx[i]); pdbxmax = MAX (pdbxmax, pdbx[i]); pdbymin = MIN (pdbymin, pdby[i]); pdbymax = MAX (pdbymax, pdby[i]); pdbzmin = MIN (pdbzmin, pdbz[i]); pdbzmax = MAX (pdbzmax, pdbz[i]); } else break; if (!fgets (line, (int)sizeof (line), fp)) break; } pdbn = i; nbonds = -1; while (!feof (fp)) { if (!strncmp (line, "CONECT", 6)) { connect = 1; con[0] = con[1] = con[2] = con[3] = con[4] = con[5] = 0; res = sscanf (line, "%*s %d %d %d %d %d %d %d", &at0, &con[0], &con[1], &con[2], &con[3],&con[4],&con[5]); for (i = 0; i < res; i++) { if (con[i] > 0) { found=0; for (m=0;m<=pdbn;m++){ if (atnum[m]==at0) { at0=m+1; found=1; break; } } for (m=0;m<=pdbn;m++){ if (atnum[m]==con[i]) { con[i]=m+1; found++; break; } } if (found==2){ nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = at0 - 1; bondto[nbonds] = con[i] - 1; bondtype[nbonds] = 0; dist = (pdbx[at0 - 1] - pdbx[con[i] - 1]) * (pdbx[at0 - 1] - pdbx[con[i] - 1]) + (pdby[at0 - 1] - pdby[con[i] - 1]) * (pdby[at0 - 1] - pdby[con[i] - 1]) + (pdbz[at0 - 1] - pdbz[con[i] - 1]) * (pdbz[at0 - 1] - pdbz[con[i] - 1]); if (dist < 1.45 * 1.45) { if (!strncmp (atcode[at0 - 1], "C", 1) && !strncmp (atcode[con[i] - 1], "C", 1)) bondtype[nbonds] = 4; } /* fprintf(stderr,"CONECTED %d %d (%f)\n",at0,con[i],dist);*/ /* Drawline ((int) (pdbx[at0 - 1] * pdbfactor + pdboffset), (int) (pdby[at0 - 1] * pdbfactor + pdboffset), (int) (pdbx[con[i] - 1] * pdbfactor + pdboffset), (int) (pdby[con[i] - 1] * pdbfactor + pdboffset), 1);*/ } } } } else { break; } (void)fgets (line, (int)sizeof (line), fp); } fclose (fp); free (atnum); atnum=NULL; pdbxcent = (pdbxmax + pdbxmin) / 2.; pdbycent = (pdbymax + pdbymin) / 2.; pdbzcent = (pdbzmax + pdbzmin) / 2.; for (i = 0; i <= pdbn; i++) { pdbx[i] = pdbx[i] - pdbxcent; pdby[i] = pdby[i] - pdbycent; pdbz[i] = pdbz[i] - pdbzcent; } if (connect == 0) { /* if no bonds exist, i.e. there were no CONECTs */ for (i = 0; i <= pdbn; i++) { for (j = i + 1; j <= pdbn; j++) { dist = (pdbx[i] - pdbx[j]) * (pdbx[i] - pdbx[j]) + (pdby[i] - pdby[j]) * (pdby[i] - pdby[j]) + (pdbz[i] - pdbz[j]) * (pdbz[i] - pdbz[j]); if (dist < 1.58 * 1.58) { nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = i; bondto[nbonds] = j; bondtype[nbonds] = 0; if (dist < 1.45 * 1.45) { if (!strncmp (atcode[i], "C", 1) && !strncmp (atcode[j], "C", 1)) bondtype[nbonds] = 4; } /* Drawline ((int) (pdbx[i] * pdbfactor + pdboffset), (int) (pdby[i] * pdbfactor + pdboffset), (int) (pdbx[j] * pdbfactor + pdboffset), (int) (pdby[j] * pdbfactor + pdboffset), 1);*/ } } } } /* CopyPlane ();*/ importflag = 1; importfactor = pdbfactor; importoffset = pdboffset; pdbrotate(0,0,0); return (0); } void pdbrotate (int nx, int ny, int nz) { double l, r, s, t, u, v, w, a, b, c, d, e, f, g, h, i; int ii, j; double x[3], xx, yy, zz; int dx, dy; double ang = 0.; GdkRectangle update_rect; if (nz != 2) { dy = nx - hp->x; dx = ny - hp->y; hp->x = nx; hp->y = ny; x[0] = (dx != 0 ? 1. : 0.); x[1] = (dy != 0 ? 1. : 0.); x[2] = (nz != 0 ? 1. : 0.); if (abs (dx) < abs (dy)) { dx = dy; x[0] = 0.; x[1] = 1.; } else { x[0] = 1.; x[1] = 0.; } ang = (float) dx / 2.; if (ang < -360.) ang = ang + 360.; if (ang > 360.) ang = ang - 360.; if (x[2] == 1) { x[0] = 0.; x[1] = 0.; } /*fprintf(stderr,"rotate %f %f %f : %f\n",x[0],x[1],x[2],ang);*/ l = sqrt (x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); r = x[0] / l; s = x[1] / l; t = x[2] / l; v = sin (ang * M_PI / 180.); u = cos (ang * M_PI / 180.); w = 1.0 - u; a = u + w * r * r; b = t * v + w * r * s; c = -s * v + w * r * t; d = -t * v + w * s * r; e = u + w * s * s; f = r * v + w * s * t; g = s * v + w * t * r; h = -r * v + w * t * s; i = u + w * t * t; for (j = 0; j <= pdbn; j++) { xx = pdbx[j]; yy = pdby[j]; zz = pdbz[j]; pdbx[j] = a * xx + b * yy + c * zz; pdby[j] = d * xx + e * yy + f * zz; pdbz[j] = g * xx + h * yy + i * zz; } } FreePix (); for (ii = 0; ii <= nbonds; ii++) Drawline ((int) (pdbx[bondfrom[ii]] * importfactor + importoffset), (int) (pdby[bondfrom[ii]] * importfactor + importoffset), (int) (pdbx[bondto[ii]] * importfactor + importoffset), (int) (pdby[bondto[ii]] * importfactor + importoffset), 1, 0); gdk_draw_pixmap (drawing_area->window, drawing_area->style-> fg_gc[GTK_WIDGET_STATE (drawing_area)], picture, 0, 0, 0, 0, (gint)drawing_area->allocation.width, (gint)drawing_area->allocation.height); update_rect.x = 0; update_rect.y = 0; update_rect.width = drawing_area->allocation.width; update_rect.height = drawing_area->allocation.height; gtk_widget_draw ((GtkWidget *) drawing_area, &update_rect); } void pdbstore () { int i, j; char tmpstr[10]; for (i = 0; i <= pdbn; i++) { /* pdbx[i] = (pdbx[i] + pdbxcent) * importfactor + importoffset; pdby[i] = (pdby[i] + pdbycent) * importfactor + importoffset; pdbz[i] = (pdbz[i] + pdbzcent) * importfactor + importoffset; */ pdbx[i] = pdbx[i] * importfactor + importoffset; pdby[i] = pdby[i] * importfactor + importoffset; pdbz[i] = pdbz[i] * importfactor + importoffset; if (importflag == 1) { switch (pdbmode) { case 0: /* add all labels */ add_char ((int) (pdbx[i]), (int) (pdby[i]), atcode[i], atjust[i], 0, 0, 0, zoom_factor); break; case 1: /* add all non-H labels */ if (strncmp (atcode[i], "H", 1)) add_char ((int) (pdbx[i]), (int) (pdby[i]), atcode[i], atjust[i], 0, 0, 0, zoom_factor); break; case 3: /* only non-H without numeric identifiers */ if (!strncmp (atcode[i], "H", 1)) break; /* fall through to case 2 otherwise */ case 2: /* all labels, without the numeric part */ j = (int) strcspn (atcode[i], "1234567890"); strncpy (tmpstr, atcode[i], (size_t)j); tmpstr[j] = '\0'; add_char ((int) (pdbx[i]), (int) (pdby[i]), tmpstr, atjust[i], 0, 0, 0, zoom_factor); break; case 4: /* no labels */ default: break; } } else { /* in MDL import, add all non-C labels */ if (strncmp (atcode[i], "C", 1)) add_char ((int) (pdbx[i]), (int) (pdby[i]), atcode[i], atjust[i], 0,0,0, zoom_factor); } } for (i = 0; i <= nbonds; i++) add_struct ((int) (pdbx[bondfrom[i]]), (int) (pdby[bondfrom[i]]), (int) (pdbx[bondto[i]]), (int) (pdby[bondto[i]]), (int) bondtype[i], 0, 0, 0, 0); free (pdbx); free (pdby); free (pdbz); free (bondfrom); free (bondto); free (bondtype); free (atjust); for (i = 0; i <= pdbn; i++) free (atcode[i]); free (atcode); pdbx = NULL; pdby = NULL; pdbz = NULL; bondfrom = NULL; bondto = NULL; bondtype = NULL; atjust = NULL; atcode = NULL; importflag = 0; pdbn = 0; FreePix (); Display_Mol (); } int import_mdl_mol (char *filename, int skip) /* imports a MDL Molfile structure */ { /* int x, y, tx, ty;*/ /* the coordinates */ /* int bond = 0; */ /* Chemtool bondstyle */ float mdlfactor = 60.0; /* conversion factor .cht <-> .mol */ int mdloffset = 200; int text_direct = 0; /* Chemtool text direction */ int d, e; /* dummy variables */ int v3=0; char line[255]; char prop[41],*cfg; double pdbxmin = 100000., pdbxmax = -100000., pdbymin = 1000000., pdbymax = -100000., pdbzmin = 100000., pdbzmax = -100000.; /* the counts line, see ctfile.pdf for more information */ int a; /* number of atoms */ int b; /* number of bonds */ /* not parsed right now: */ int l; /* number of atoms list */ int f; /* obsolete */ int c; /* chiral flag, 0=not chiral, 1=chiral */ int s; /* number of stext entries */ int x_; /* number of reaction components + 1 */ int r; /* number of reactants */ int p; /* number of products */ int i; /* number of intermediates */ int m; /* number of additional properties, no longer supported and set to 999 */ char v[6]; /* ctab version, 'v2000' or 'v3000' */ /* end of counts line */ /* the atom block */ /*float xxx, yyy, zzz; */ /* the coordinates of the atom */ char aaa[3]; /* the atomic symbol */ /* not parsed right now: */ int dd; /* mass difference for isotopes */ int ccc; /* charge */ int sss; /* atom stereo parity */ int hhh; /* hydrogen count+1 */ int bbb; /* stereo care box */ int vvv; /* valence */ int HHH; /* H designator, redundant */ int rrr; /* reaction component type */ int iii; /* reaction component number */ int mmm; /* atom-atom mapping number */ int nnn; /* inversion/retention flag */ int eee; /* exact change flag */ /* end atom block */ /* the bond block */ int atom1; /* first atom number */ int atom2; /* second atom number */ int tt; /* bond type */ int ss; /* bond stereo */ int xx; /* not used */ int rr; /* bond topology, 0=eighter, 1=ring, 2=chain */ int cc; /* reaction center status */ /* end bond block */ char label[20]; /* a label defined in the .mol-file */ char aa[4],bb[4]; int res; FILE *fp; /*struct dc *hp_a; */ #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); if (skip >0 ) { d = 0; while ( d 100000 || b > 100000) { fclose(fp); return (1); } } clear_data (); pdbn = -1; /* read in atom block data */ for (d = 0; d < a; d++) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } pdbn++; pdbx = realloc (pdbx, (pdbn + 1) * sizeof (double)); pdby = realloc (pdby, (pdbn + 1) * sizeof (double)); pdbz = realloc (pdbz, (pdbn + 1) * sizeof (double)); atjust = realloc (atjust, (pdbn + 1) * sizeof (short)); atcode = realloc (atcode, (pdbn + 1) * sizeof (char *)); atcode[pdbn] = malloc (9 * sizeof (char)); if (v3==0) res = sscanf (line, "%lf %lf %lf %s %i %i %i %i %i %i %i %i %i %i %i %i", &pdbx[pdbn], &pdby[pdbn], &pdbz[pdbn], atcode[pdbn], &dd, &ccc, &sss, &hhh, &bbb, &vvv, &HHH, &rrr, &iii, &mmm, &nnn, &eee); else res = sscanf (line, "M V30 %*d %s %lf %lf %lf", atcode[pdbn],&pdbx[pdbn], &pdby[pdbn], &pdbz[pdbn]); if (res <3 ) { fclose(fp); return(1); } pdbxmin = MIN (pdbxmin, pdbx[d]); pdbxmax = MAX (pdbxmax, pdbx[d]); pdbymin = MIN (pdbymin, pdby[d]); pdbymax = MAX (pdbymax, pdby[d]); pdbzmin = MIN (pdbzmin, pdbz[d]); pdbzmax = MAX (pdbzmax, pdbz[d]); atjust[pdbn] = -1; /*default to centered labels */ } if (v3==1) { if (!fgets(line,(int)sizeof(line),fp)) { fclose(fp); return(1); } if (strncmp(line,"M V30 END ATOM",14)) { fclose(fp); return(1); } if (!fgets(line,(int)sizeof(line),fp)) { fclose(fp); return(1); } if (strncmp(line,"M V30 BEGIN BOND",16)) { fclose(fp); return(1); } } nbonds = -1; /* read in bond block data */ for (d = 0; d < b; d++) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } if (v3==1) { memset(prop,0,40); res = sscanf (line, "M V30 %*d %i %i %i %40c", &tt,&atom1,&atom2,prop); if (res <2) { fclose(fp); return(1); } ss = 0; if ( (cfg=strstr(prop,"CFG=")) != NULL) { res = sscanf(cfg,"CFG=%d",&ss); if (ss == 3) ss = 6; } }else{ res = sscanf (line, "%c%c%c%c%c%c %i %i %i %i %i", &aa[0],&aa[1],&aa[2], &bb[0], &bb[1], &bb[2], &tt, &ss, &xx, &rr, &cc); res = sscanf(aa,"%i",&atom1); res = sscanf(bb,"%i",&atom2); } nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = atom1 - 1; bondto[nbonds] = atom2 - 1; switch (tt) { case 1: /* single */ bondtype[nbonds] = 0; if (ss == 1) /* stereo up */ bondtype[nbonds] = 5; if (ss == 2 || ss == 4) /* either */ bondtype[nbonds] = 7; if (ss == 6) /* down */ bondtype[nbonds] = 6; break; case 2: /* double */ bondtype[nbonds] = 1; break; case 3: bondtype[nbonds] = 3; break; default: bondtype[nbonds] = 0; } } if (v3 == 1) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } } else { /* check for additional labels */ res = fscanf (fp, "%s %s", aaa, line); while (res >0 && !strcmp (aaa, "A")) { atom1 = atoi (line); res = fscanf (fp, "%s", label); if (res == 0) break; /* found a label "label" at atom "atom1" */ /* check for numbers, interpret as indices: */ text_direct = 0; f = (int)strlen (label); if (f == 1) text_direct = -1; /*center label if only one character */ for (e = 0; label[e] != '\0'; e++) { if (isdigit (label[e])) { /* If there's a number at the beginning, assume right- * justified text: */ if (e == 0) text_direct = -2; /* copy already processed string in auxiliary string 'line': */ strncpy (line, label, (size_t)e); /* append a '_', the number and a NULL-string: */ line[e] = '_'; line[e + 1] = label[e]; line[e + 2] = '\0'; /* append the rest of the label-string to 'line': */ strcat (line, strrchr (label, label[e + 1])); /* copy 'line' back to 'label' and add a NULL-string at the end: */ strcpy (label, line); e++; label[++f] = '\0'; } } strcpy (atcode[atom1 - 1], label); atjust[atom1 - 1] = (short)text_direct; res = fscanf (fp, "%s %s", aaa, line); } } /* check last line for "M END" */ if (strcmp(line,"END") && strcmp(line,"$$$$") ) { do { if (!fgets (line,80,fp)){ fprintf(stderr,"EOF\n"); break; } } while (strncmp (line, "M END",6) && strncmp(line,"$$$$",4) ); if (strncmp (line, "M END",6) && strncmp (line,"$$$$",4) ) { fprintf(stderr,"endless molfile???: %s\n",line); clear_data (); fclose (fp); return (2); } } fclose (fp); pdbxcent = (pdbxmax + pdbxmin) / 2.; pdbycent = (pdbymax + pdbymin) / 2.; pdbzcent = (pdbzmax + pdbzmin) / 2.; for (i = 0; i <= pdbn; i++) { pdbx[i] = pdbx[i] - pdbxcent; pdby[i] = pdby[i] - 2. * (pdby[i] - pdbycent); pdbz[i] = pdbz[i] - pdbzcent; } /* try to normalize bond lengths based on first bond */ mdlfactor = mdlfactor / sqrt ((pdbx[bondfrom[0]] - pdbx[bondto[0]]) * (pdbx[bondfrom[0]] - pdbx[bondto[0]]) + (pdby[bondfrom[0]] - pdby[bondto[0]]) * (pdby[bondfrom[0]] - pdby[bondto[0]]) + (pdbz[bondfrom[0]] - pdbz[bondto[0]]) * (pdbz[bondfrom[0]] - pdbz[bondto[0]])); for (i = 0; i <= nbonds; i++) Drawline ((int) (pdbx[bondfrom[i]] * mdlfactor + mdloffset), (int) (pdby[bondfrom[i]] * mdlfactor + mdloffset), (int) (pdbx[bondto[i]] * mdlfactor + mdloffset), (int) (pdby[bondto[i]] * mdlfactor + mdloffset), 1, 0); CopyPlane (); importflag = 2; importfactor = mdlfactor; importoffset = mdloffset; return (0); } int preview_mdl_mol (char *filename, int skip) /* imports a MDL Molfile structure into the preview widget*/ { /* int x, y, tx, ty;*/ /* the coordinates */ /* int bond = 0; */ /* Chemtool bondstyle */ float mdlfactor = 60.0; /* conversion factor .cht <-> .mol */ float previewscale; int text_direct = 0; /* Chemtool text direction */ int d, e; /* dummy variables */ GdkRectangle update_rect; int v3=0; char prop[41],*cfg; char line[255]; double pdbxmin = 100000., pdbxmax = -100000., pdbymin = 1000000., pdbymax = -100000.; /* the counts line, see ctfile.pdf for more information */ int a; /* number of atoms */ int b; /* number of bonds */ /* not parsed right now: */ int l; /* number of atoms list */ int f; /* obsolete */ int c; /* chiral flag, 0=not chiral, 1=chiral */ int s; /* number of stext entries */ int x_; /* number of reaction components + 1 */ int r; /* number of reactants */ int p; /* number of products */ int i; /* number of intermediates */ int m; /* number of additional properties, no longer supported and set to 999 */ char v[6]; /* ctab version, 'v2000' or 'v3000' */ /* end of counts line */ /* the atom block */ /*float xxx, yyy, zzz; */ /* the coordinates of the atom */ char aaa[3]; /* the atomic symbol */ /* not parsed right now: */ int dd; /* mass difference for isotopes */ int ccc; /* charge */ int sss; /* atom stereo parity */ int hhh; /* hydrogen count+1 */ int bbb; /* stereo care box */ int vvv; /* valence */ int HHH; /* H designator, redundant */ int rrr; /* reaction component type */ int iii; /* reaction component number */ int mmm; /* atom-atom mapping number */ int nnn; /* inversion/retention flag */ int eee; /* exact change flag */ /* end atom block */ /* the bond block */ int atom1; /* first atom number */ int atom2; /* second atom number */ int tt; /* bond type */ int ss; /* bond stereo */ int xx; /* not used */ int rr; /* bond topology, 0=eighter, 1=ring, 2=chain */ int cc; /* reaction center status */ /* end bond block */ char label[20]; /* a label defined in the .mol-file */ char aa[4],bb[4]; int res; FILE *fp; /*struct dc *hp_a; */ #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); if (skip >0 ) { d = 0; while ( d 100000 || b > 100000) { fclose(fp); return (1); } } clear_data (); pdbn = -1; /* read in atom block data */ for (d = 0; d < a; d++) { if (!fgets (line, (int)sizeof (line), fp)){ fclose(fp); return(1); } pdbn++; pdbx = realloc (pdbx, (pdbn + 1) * sizeof (double)); pdby = realloc (pdby, (pdbn + 1) * sizeof (double)); atjust = realloc (atjust, (pdbn + 1) * sizeof (short)); atcode = realloc (atcode, (pdbn + 1) * sizeof (char *)); atcode[pdbn] = malloc (9 * sizeof (char)); if (v3==0) res = sscanf (line, "%lf %lf %*f %s %i %i %i %i %i %i %i %i %i %i %i %i", &pdbx[pdbn], &pdby[pdbn], atcode[pdbn], &dd, &ccc, &sss, &hhh, &bbb, &vvv, &HHH, &rrr, &iii, &mmm, &nnn, &eee); else res= sscanf (line, "M V30 %*d %s %lf %lf", atcode[pdbn],&pdbx[pdbn], &pdby[pdbn]); if (res <3) { fclose(fp); return(1); } atjust[pdbn] = -1; /*default to centered labels */ } if (v3==1) { if (!fgets(line,(int)sizeof(line),fp)) { fclose(fp); return(1); } if (strncmp(line,"M V30 END ATOM",14)) { fclose(fp); return(1); } if (!fgets(line,(int)sizeof(line),fp)) { fclose(fp); return(1); } if (strncmp(line,"M V30 BEGIN BOND",16)) { fclose(fp); return(1); } } nbonds = -1; /* read in bond block data */ for (d = 0; d < b; d++) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } if (v3==1) { memset(prop,0,40); res = sscanf (line, "M V30 %*d %i %i %i %40c", &tt,&atom1,&atom2,prop); ss = 0; if ( (cfg=strstr(prop,"CFG=")) != NULL) { res = sscanf(cfg,"CFG=%d",&ss); if (ss == 3) ss = 6; } }else{ res = sscanf (line, "%c%c%c%c%c%c %i %i %i %i %i", &aa[0],&aa[1],&aa[2], &bb[0], &bb[1], &bb[2], &tt, &ss, &xx, &rr, &cc); res = sscanf(aa,"%i",&atom1); res = sscanf(bb,"%i",&atom2); } nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = atom1 - 1; bondto[nbonds] = atom2 - 1; switch (tt) { case 1: /* single */ bondtype[nbonds] = 0; if (ss == 1) /* stereo up */ bondtype[nbonds] = 5; if (ss == 2 || ss == 4) /* either */ bondtype[nbonds] = 7; if (ss == 6) /* down */ bondtype[nbonds] = 6; break; case 2: bondtype[nbonds] = 1; break; case 3: bondtype[nbonds] = 3; break; default: bondtype[nbonds] = 0; } } if (v3 == 1) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } } else { /* check for additional labels */ res = fscanf (fp, "%s %s", aaa, line); while (res >0 && !strcmp (aaa, "A")) { atom1 = atoi (line); res = fscanf (fp, "%s", label); if (res == 0) break; /* found a label "label" at atom "atom1" */ /* check for numbers, interpret as indices: */ text_direct = 0; f = (int)strlen (label); if (f == 1) text_direct = -1; /*center label if only one character */ for (e = 0; label[e] != '\0'; e++) { if (isdigit (label[e])) { /* If there's a number at the beginning, assume right- * justified text: */ if (e == 0) text_direct = -2; /* copy already processed string in auxiliary string 'line': */ strncpy (line, label, (size_t)e); /* append a '_', the number and a NULL-string: */ line[e] = '_'; line[e + 1] = label[e]; line[e + 2] = '\0'; /* append the rest of the label-string to 'line': */ strcat (line, strrchr (label, label[e + 1])); /* copy 'line' back to 'label' and add a NULL-string at the end: */ strcpy (label, line); e++; label[++f] = '\0'; } } strcpy (atcode[atom1 - 1], label); atjust[atom1 - 1] = (short)text_direct; res = fscanf (fp, "%s %s", aaa, line); } } /* check last line for "M END" */ if (strcmp(line,"END") && strcmp(line,"$$$$") ) { do { if (!fgets (line,80,fp)){ fprintf(stderr,"EOF\n"); break; } } while (strncmp (line, "M END",6) && strncmp(line,"$$$$",4) ); if (strncmp (line, "M END",6) && strncmp (line,"$$$$",4) ) { fprintf(stderr,"endless molfile???: %s\n",line); clear_data (); fclose (fp); return (2); } } fclose (fp); /* try to normalize bond lengths based on first bond */ mdlfactor = mdlfactor / sqrt ((pdbx[bondfrom[0]] - pdbx[bondto[0]]) * (pdbx[bondfrom[0]] - pdbx[bondto[0]]) + (pdby[bondfrom[0]] - pdby[bondto[0]]) * (pdby[bondfrom[0]] - pdby[bondto[0]]) ); pdbxmin=10000.; pdbymin=10000.; pdbxmax=-10000.; pdbymax=-10000.; for (i = 0; i <= pdbn; i++) { pdbx[i] = pdbx[i]*mdlfactor; pdby[i] = pdby[i]*mdlfactor; pdbxmin = MIN (pdbxmin, pdbx[i]); pdbxmax = MAX (pdbxmax, pdbx[i]); pdbymin = MIN (pdbymin, pdby[i]); pdbymax = MAX (pdbymax, pdby[i]); } /* center molecule and scale it to fit into the effective drawing area (300x150 plus small border) */ pdbxcent = (pdbxmax + pdbxmin) / 2.; pdbycent = (pdbymax + pdbymin) / 2.; previewscale = MIN(280./(pdbxmax-pdbxmin),140./(pdbymax-pdbymin)); for (i = 0; i <= pdbn; i++) { pdbx[i] = (pdbx[i]- pdbxcent)*previewscale+140.; pdby[i] = (pdby[i]- 2. * pdby[i] + pdbycent)*previewscale+75.; } for (i = 0; i <= nbonds; i++) draw_preview_bonds ((int) pdbx[bondfrom[i]], (int) pdby[bondfrom[i]], (int) pdbx[bondto[i]], (int) pdby[bondto[i]], 0); for (i = 0; i <= pdbn; i++) if (strcmp(atcode[i],"C") && strcmp(atcode[i],"H")) Drawstring ((int)pdbx[i], (int)pdby[i], atcode[i], atjust[i], 0,0,0,1, 1); gdk_draw_pixmap (preview_area->window, drawing_area->style-> fg_gc[GTK_WIDGET_STATE (drawing_area)], picture, 0, 0, 0, 0, 200, 100); update_rect.x = 0; update_rect.y = 0; update_rect.width = 200; update_rect.height = 100; gtk_widget_draw ((GtkWidget *) preview_area, &update_rect); return (0); } int import_babel (char *filename) /* imports a foreign file via BABEL as a MDL Molfile structure */ { /* int x, y, tx, ty;*/ /* the coordinates */ /* int bond = 0; */ /* Chemtool bondstyle */ float mdlfactor = 60.0; /* conversion factor .cht <-> .mol */ int mdloffset = 200; int text_direct = 0; /* Chemtool text direction */ int d, e; /* dummy variables */ char line[255]; double pdbxmin = 100000., pdbxmax = -100000., pdbymin = 1000000., pdbymax = -100000., pdbzmin = 100000., pdbzmax = -100000.; /* the counts line, see ctfile.pdf for more information */ int a; /* number of atoms */ int b; /* number of bonds */ /* not parsed right now: */ int l; /* number of atoms list */ int f; /* obsolete */ int c; /* chiral flag, 0=not chiral, 1=chiral */ int s; /* number of stext entries */ int x_; /* number of reaction components + 1 */ int r; /* number of reactants */ int p; /* number of products */ int i; /* number of intermediates */ int m; /* number of additional properties, no longer supported and set to 999 */ char v[6]; /* ctab version, 'v2000' or 'v3000' */ /* end of counts line */ /* the atom block */ /*float xxx, yyy, zzz; */ /* the coordinates of the atom */ char aaa[3]; /* the atomic symbol */ /* not parsed right now: */ int dd; /* mass difference for isotopes */ int ccc; /* charge */ int sss; /* atom stereo parity */ int hhh; /* hydrogen count+1 */ int bbb; /* stereo care box */ int vvv; /* valence */ int HHH; /* H designator, redundant */ int rrr; /* reaction component type */ int iii; /* reaction component number */ int mmm; /* atom-atom mapping number */ int nnn; /* inversion/retention flag */ int eee; /* exact change flag */ /* end atom block */ /* the bond block */ int atom1; /* first atom number */ int atom2; /* second atom number */ int tt; /* bond type */ int ss; /* bond stereo */ int xx; /* not used */ int rr; /* bond topology, 0=eighter, 1=ring, 2=chain */ int cc; /* reaction center status */ /* end bond block */ int res; char label[20]; /* a label defined in the .mol-file */ char aa[4],bb[4]; FILE *fp; /*struct dc *hp_a; */ #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif if (!filename || !babel ) return (1); /* no filename or no input mode */ snprintf(line,255,"babel -i%s %s -omdl %s",babel,filename,babeloutp); /* fprintf(stderr,"%s\n",line);*/ /*@ignore@ splint does not recognize popen */ if ((fp = popen (line, "r")) == NULL) /*@end@*/ return (1); /* skip the first three lines (header) */ for (d = 0; d < 3; d++) { if (!fgets (line, (int)sizeof (line), fp)) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } } /* parse the counts-line */ if (!fgets (line, (int)sizeof (line), fp)) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } d = sscanf (line, "%c%c%c%c%c%c %i %i %i %i %i %i %i %i %i %s", &aa[0],&aa[1],&aa[2], &bb[0], &bb[1], &bb[2], &l, &f, &c, &s, &x_, &r, &p, &i, &m, v); aa[3]=bb[3]='\0'; sscanf(aa,"%i",&a); sscanf(bb,"%i",&b); if (d == 0 || a <= 0 || b < 0 || a > 100000 || b > 100000) { /*@ignore@*/ pclose(fp); /*@end@*/ return (1); } fprintf(stderr, "expecting na %d nb %d\n",a,b); clear_data (); pdbn = -1; /* read in atom block data */ for (d = 0; d < a; d++) { if (!fgets (line, (int)sizeof (line), fp)) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } pdbn++; pdbx = realloc (pdbx, (pdbn + 1) * sizeof (double)); pdby = realloc (pdby, (pdbn + 1) * sizeof (double)); pdbz = realloc (pdbz, (pdbn + 1) * sizeof (double)); atjust = realloc (atjust, (pdbn + 1) * sizeof (short)); atcode = realloc (atcode, (pdbn + 1) * sizeof (char *)); atcode[pdbn] = malloc (9 * sizeof (char)); res = sscanf (line, "%lf %lf %lf %s %i %i %i %i %i %i %i %i %i %i %i %i", &pdbx[pdbn], &pdby[pdbn], &pdbz[pdbn], atcode[pdbn], &dd, &ccc, &sss, &hhh, &bbb, &vvv, &HHH, &rrr, &iii, &mmm, &nnn, &eee); if (res <3) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } pdbxmin = MIN (pdbxmin, pdbx[d]); pdbxmax = MAX (pdbxmax, pdbx[d]); pdbymin = MIN (pdbymin, pdby[d]); pdbymax = MAX (pdbymax, pdby[d]); pdbzmin = MIN (pdbzmin, pdbz[d]); pdbzmax = MAX (pdbzmax, pdbz[d]); atjust[pdbn] = -1; /*default to centered labels */ } nbonds = -1; /* read in bond block data */ for (d = 0; d < b; d++) { if (!fgets (line, (int)sizeof (line), fp)) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } res = sscanf (line, "%c%c%c%c%c%c %i %i %i %i %i", &aa[0],&aa[1],&aa[2],&bb[0],&bb[1],&bb[2], &tt, &ss, &xx, &rr, &cc); res = sscanf(aa,"%i",&atom1); res = sscanf(bb,"%i",&atom2); nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = atom1 - 1; bondto[nbonds] = atom2 - 1; switch (tt) { case 1: bondtype[nbonds] = 0; if (ss == 1) bondtype[nbonds] = 5; if (ss == 6) bondtype[nbonds] = 6; break; case 2: bondtype[nbonds] = 1; break; case 3: bondtype[nbonds] = 3; break; default: bondtype[nbonds] = 0; } } /* check for additional labels */ res = fscanf (fp, "%s %s", aaa, line); while (res >0 && !strcmp (aaa, "A")) { atom1 = atoi (line); res = fscanf (fp, "%s", label); if (res <1) break; /* found a label "label" at atom "atom1" */ /* check for numbers, interpret as indices: */ text_direct = 0; f = (int)strlen (label); if (f == 1) text_direct = -1; /*center label if only one character */ for (e = 0; label[e] != '\0'; e++) { if (isdigit (label[e])) { /* If there's a number at the beginning, assume right- * justified text: */ if (e == 0) text_direct = -2; /* copy already processed string in auxiliary string 'line': */ strncpy (line, label, (size_t)e); /* append a '_', the number and a NULL-string: */ line[e] = '_'; line[e + 1] = label[e]; line[e + 2] = '\0'; /* append the rest of the label-string to 'line': */ strcat (line, strrchr (label, label[e + 1])); /* copy 'line' back to 'label' and add a NULL-string at the end: */ strcpy (label, line); e++; label[++f] = '\0'; } } strcpy (atcode[atom1 - 1], label); atjust[atom1 - 1] = (short)text_direct; res = fscanf (fp, "%s %s", aaa, line); } /* check last line for "M END" */ while (strcmp (line, "END")) { if (fscanf (fp, "%s", line) == EOF) break; if (fscanf (fp, "%s %s", aaa, line) == EOF) break; } if (strcmp (aaa, "M") || strcmp (line, "END")) { clear_data (); /*@ignore@ splint does not know pclose */ pclose (fp); /*@end@*/ return (2); } pclose (fp); pdbxcent = (pdbxmax + pdbxmin) / 2.; pdbycent = (pdbymax + pdbymin) / 2.; pdbzcent = (pdbzmax + pdbzmin) / 2.; if (pdbn <=0) return (1); /* complain if no atoms */ for (i = 0; i <= pdbn; i++) { pdbx[i] = pdbx[i] - pdbxcent; pdby[i] = pdby[i] - 2. * (pdby[i] - pdbycent); pdbz[i] = pdbz[i] - pdbzcent; } /* try to normalize bond lengths based on first bond */ mdlfactor = mdlfactor / sqrt ((pdbx[bondfrom[0]] - pdbx[bondto[0]]) * (pdbx[bondfrom[0]] - pdbx[bondto[0]]) + (pdby[bondfrom[0]] - pdby[bondto[0]]) * (pdby[bondfrom[0]] - pdby[bondto[0]]) + (pdbz[bondfrom[0]] - pdbz[bondto[0]]) * (pdbz[bondfrom[0]] - pdbz[bondto[0]])); for (i = 0; i <= nbonds; i++) Drawline ((int) (pdbx[bondfrom[i]] * mdlfactor + mdloffset), (int) (pdby[bondfrom[i]] * mdlfactor + mdloffset), (int) (pdbx[bondto[i]] * mdlfactor + mdloffset), (int) (pdby[bondto[i]] * mdlfactor + mdloffset), 1, 0); CopyPlane (); importflag = 2; importfactor = mdlfactor; importoffset = mdloffset; return (0); } int export_mdl_mol (FILE *fp, int topipe) /* exports a MDL Molfile structure */ { float factor = 76.0; /* conversion factor .cht <-> .mol */ int d, e, f; /* dummy variables */ char aaa[3]; /* the atomic symbol */ int atom1 = 0; /* first atom number */ int atom2 = 0; /* second atom number */ int tt; /* bond type */ int ss; /* bond stereo */ struct dc *hp_a; struct data *hp_b; int atoms[999][2]; /* coordinates of unique labels */ int start_already_there; int end_already_there; int is_label; int labelcount; /* number of unique atoms/labels */ int omit; /* number of decorative lines (boxes etc) */ int hcount=0; /* for explicit CH_3, CH_2, CH */ #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif /* FIXME: Write some sane stuff in the header */ fprintf (fp, "Molecule exported from chemtool\n"); fprintf (fp, "\n"); fprintf (fp, "\n"); labelcount = 0; omit = 0; atoms[0][0]=atoms[0][1]=0; /* Get coordinates of all unique bond-delimiters * and, more importantly, the number of unique atoms, * chemtool only knows the number of bonds and the * number of non-carbon atoms :( */ hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (!(mark.flag && (hp_b->smarked + hp_b->tmarked) == 0)) { if (hp_b->decoration == 1) omit++; else { /* Check for already parsed atoms on same coordinates */ start_already_there = 0; end_already_there = 0; for (f = 0; f <= labelcount; f++) { if (hp_b->x == atoms[f][0] && hp_b->y == atoms[f][1]) { start_already_there = 1; } if (hp_b->tx == atoms[f][0] && hp_b->ty == atoms[f][1]) { end_already_there = 1; } } if (!start_already_there) { atoms[labelcount][0] = hp_b->x; atoms[labelcount][1] = hp_b->y; labelcount++; } if (!end_already_there) { atoms[labelcount][0] = hp_b->tx; atoms[labelcount][1] = hp_b->ty; labelcount++; } } } hp_b = hp_b->next; } /* The counts line: */ fprintf (fp, "%3i%3i 0 0 0 0 0 0 0 0999 V2000\n", labelcount, hp->n-omit); /* Now write down the labels. * start all over */ for (d = 0; d < labelcount; d++) { /* Check for label on same position */ hp_a = dac_root.next; is_label = 0; for (e = 0; e < hp->nc; e++) { if (atoms[d][0] == hp_a->x && atoms[d][1] == hp_a->y) { is_label = 1; break; } hp_a = hp_a->next; } if (is_label) { hcount = 0; if (!strcmp(hp_a->c,"CH") || !strcmp(hp_a->c,"HC") ) { hcount=1; strcpy (aaa, "C"); } else if (!strcmp(hp_a->c,"OH") || !strcmp(hp_a->c,"HO") ) { hcount=1; strcpy (aaa, "O"); } else if (!strcmp(hp_a->c,"NH") || !strcmp(hp_a->c,"HN") ) { hcount=1; strcpy (aaa, "N"); } else if (!strcmp(hp_a->c,"SH") || !strcmp(hp_a->c,"HS") ) { hcount=1; strcpy (aaa, "S"); } else if (!strcmp(hp_a->c,"PH") || !strcmp(hp_a->c,"HP") ) { hcount=1; strcpy (aaa, "P"); } else if ((int)strlen (hp_a->c) < 4) { strcpy (aaa, hp_a->c); } else if (!strncmp(hp_a->c,"CH_3",4) || !strncmp(hp_a->c,"H_3C",4)) { hcount = 3; strcpy (aaa, "C"); } else if ( !strncmp(hp_a->c,"CH_2",4) || !strncmp(hp_a->c,"H2_C",4)) { hcount = 2; strcpy (aaa, "C"); } else if (!strncmp(hp_a->c,"NH_3",4) || !strncmp(hp_a->c,"H_3N",4)) { hcount = 3; strcpy (aaa, "N"); } else if ( !strncmp(hp_a->c,"NH_2",4) || !strncmp(hp_a->c,"H2_N",4)) { hcount = 2; strcpy (aaa, "N"); } else { fprintf(stderr,"untranslatable label %s\n",hp_a->c); strcpy (aaa, "X"); } } else { strcpy (aaa, "C"); } fprintf (fp, "%10.4f%10.4f%10.4f %-3s 0 0 0 %1d 0 0 0 0 0 0 0 0\n", (double) atoms[d][0] / factor, (double) (500.-atoms[d][1]) / factor, 0.0, aaa, hcount); } /* Now for the bonds */ hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_b->decoration == 0 && (!(mark.flag && (hp_b->smarked + hp_b->tmarked) == 0))) { atom1 = 0; atom2 = 0; for (e = 0; e < labelcount; e++) { if (atoms[e][0] == hp_b->x && atoms[e][1] == hp_b->y) { atom1 = e + 1; } if (atoms[e][0] == hp_b->tx && atoms[e][1] == hp_b->ty) { atom2 = e + 1; } } } /* parse the bond type */ tt = 1; ss = 0; switch (hp_b->bond) { case 1: case 2: tt = 2; /*double*/ /* 7=double or aromatic */ break; case 4: tt = 2; /* double */ break; case 3: case 18: case 19: /* FIXME: does MOL handle quadruple bonds at all ?*/ tt = 3; /* triple */ break; case 5: case 10: ss = 1; /* stereo up */ break; case 6: case 16: ss = 6; /* stereo down */ break; case 7: ss = 4; /* stereo either */ break; case 8: case 9: case 11: /* case 12: */ /* bond or not? */ case 17: tt = 0; /* assume no chemical bond */ break; case 14: case 15: tt = 1; /* 6 = single or aromatic */ break; default: tt = 1; /* single */ break; } if (tt) { fprintf (fp, "%3i%3i%3i%3i 0 0 0\n", atom1, atom2, tt, ss); } hp_b = hp_b->next; } fprintf (fp, "M END\n"); if (!topipe) fclose (fp); return 0; } int export_svg (char *filename) /* exports the current drawing to a Scaled Vector Graphics file */ { FILE *fp; int x, y, tx, ty, w, h; int x1,y1,x2,y2; float area; float factor; struct data *hp_b,*hp_bx; struct dc *hp_a; struct spline *hp_sp; struct xy_co *coord; int d, dd, i; int dy; int xbase, ybase, xside, yside, xend, yend, xlen, ylen; int shifted = 0; int unicodechar; int bond_already_tuned=0; static char svgcolor[7][8]={"#000000","#0000ff","#00ff00","#00ffff","#ff0000","#ff00ff", "#ffff00"}; #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "w")) == NULL) return (1); fprintf (fp, "\n"); fprintf (fp, "\n"); if (mark.flag && mark.w != 0 && mark.h != 0) { w = mark.w * size_factor - 6; h = mark.h * size_factor - 6; } else { /* get true extents of drawing*/ w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { w = MAX (w, hp_a->x); if (hp_a->direct > -2) w = MAX (w, hp_a->x + (int)strlen (hp_a->c) * (6 + 2 * size_factor)); h = MAX (h, hp_a->y + 8); hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); hp_sp = hp_sp->next; } w = (int) (w * 1.1) ; h = (int) (h * 1.1) ; } fprintf (fp, "\n", w, h,bghexcolor); fprintf (fp, "\nCreated with Chemtool %s from file %s \n\n", VERSION, filename); fprintf (fp, "\n"); hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (mark.flag && (hp_b->smarked + hp_b->tmarked) == 0) { } else { coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 12); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; if ( !use_whiteout) { int siz,j; float lfactor=((float)calc_vector(abs(tx-x),abs(ty-y))/(832.*size_factor)); if (lfactor >1.) lfactor=1.; /* short bonds should not shrink as much, they might vanish completely */ /* extra long bonds, however, need not leave more space around labels */ i=has_label(hp_b->x,hp_b->y); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0&& hp_a->direct ==0) { if (tx>x) { int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if (strl>1) x+=strl*(siz+1); } // else // x-=(strlen(hp_a->c)-1)*fzoom*(siz+1); } int ox=x; x += (lfactor*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); y += (lfactor*(siz+1)/calc_vector(abs(tx-ox),abs(ty-y))) *(ty-y); } i=has_label(hp_b->tx,hp_b->ty); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0 ){ int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if ( hp_a->direct<-1) { if (tx>x) tx-=(strl-1)*(siz+1); // else // tx+=(strlen(hp_a->c)-1)*(siz+1); } else if ( hp_a->direct==0) { // if (tx>x) // tx-=(strlen(hp_a->c)-1)*fzoom*(siz+1); // else if (txbond) { fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 5) { bond_already_tuned = 0; x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); factor=1.; hp_bx=da_root.next; for (dd = 0; dd < hp->n; dd++) { if (hp_bx->bond == 10) { if ( (abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) || (abs (hp_bx->tx * factor - tx) < 3 && abs (hp_bx->ty * factor - ty) < 3)) { coord = center_double_bond (hp_bx->x, hp_bx->y, hp_bx->tx, hp_bx->ty, db_dist); if (abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) { x1 = coord->x * factor; y1 = coord->y * factor; coord++; x2 = coord->x * factor; y2 = coord->y * factor; } else { x1 = coord->tx * factor; y1 = coord->ty * factor; coord++; x2 = coord->tx * factor; y2 = coord->ty * factor; } area = (0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1))); if (fabs (area) < 76. * factor) { x1 = tx - (int) (0.05 * (float) (ty - y)); y1 = ty + (int) (0.05 * (float) (tx - x)); x2 = tx + (int) (0.05 * (float) (ty - y)); y2 = ty - (int) (0.05 * (float) (tx - x)); } else bond_already_tuned = 1; } /* if connected to wide end of this wedge */ } /* if adjoining bond is wide */ if (hp_bx->bond == 0 && !bond_already_tuned) { if ((abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) ||(abs (hp_bx->tx * factor - tx) < 3 && abs (hp_bx->ty * factor - ty) < 3)) /* let the wedge join smoothly alongside another bond */ { coord = intersect(x,y,x1,y1,hp_bx->x*factor,hp_bx->y*factor, hp_bx->tx*factor,hp_bx->ty*factor); coord->tx = coord->x; coord->ty = coord->y; coord = intersect(x,y,x2,y2,hp_bx->x*factor,hp_bx->y*factor, hp_bx->tx*factor,hp_bx->ty*factor); x1 = coord->tx; y1 = coord->ty; x2 = coord->x; y2 = coord->y; area = 0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1)); if (fabs (area) > 3300. * factor || fabs(area) < 1750. * factor) { x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); } } /* if connected to wide end of this wedge */ } /* if adjoining bond is single, and not already adjusted */ hp_bx = hp_bx->next; } /* for dd */ fprintf (fp, "color],svgcolor[hp_b->color]); fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", x, y, x1,y1,x2,y2); /* fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", x, y, (int) (tx - 0.08 * (ty - y)), (int) (ty + 0.08 * (tx - x)), (int) (tx + 0.08 * (ty - y)), (int) (ty - 0.08 * (tx - x))); */ } if (hp_b->bond == 6) { for (i = 0; i < 8; i++) { fprintf (fp, "\n",svgcolor[hp_b->color]); } } if (hp_b->bond == 7) { i=MAX(abs(tx-x),abs(ty-y))/10; fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 8) { fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "color],svgcolor[hp_b->color]); fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", (int) (x + 0.8 * (tx - x)), (int) (y + 0.8 * (ty - y)), (int) (x + 0.8 * (tx - x) + 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) - 0.1 * (tx - x)), tx, ty); } if (hp_b->bond == 9) { int xlen = tx - x; int ylen = ty - y; float veclen = sqrt ((double)(xlen * xlen + ylen * ylen)); float scalefact=64./veclen; /* keep arrowhead size constant (64=std length)*/ int xbase = (int) (tx - 0.2 *xlen*scalefact); int ybase = (int) (ty - 0.2 *ylen*scalefact); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "color],svgcolor[hp_b->color]); fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", tx, ty,(int)(xbase + 0.1 * ylen*scalefact), (int)(ybase - 0.1 * xlen*scalefact) , (int)(xbase - 0.1 * ylen*scalefact), (int)(ybase + 0.1 * xlen*scalefact) ); /*(int) (x + 0.8 * (tx - x) + 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) - 0.1 * (tx - x)), (int) (x + 0.8 * (tx - x) - 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) + 0.1 * (tx - x)));*/ } if (hp_b->bond == 11) { fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 10) { fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 12) { fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 13) { fprintf (fp, "\n"); fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 4) { coord = center_double_bond (x, y, tx, ty, db_dist); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord++; fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 1 || hp_b->bond == 3) { coord = multi_bonds (x, y, tx, ty, mb_dist); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 2 || hp_b->bond == 3) { coord = multi_bonds (tx, ty, x, y, mb_dist); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 14) { coord = multi_bonds (x, y, tx, ty, mb_dist); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke-dasharray:4,1; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 15) { coord = multi_bonds (tx, ty, x, y, mb_dist); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke-dasharray:4,1; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 16) { coord = center_double_bond (x, y, tx, ty, db_dist); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; coord++; for (i = 0; i < 10; i++) { fprintf (fp, "x + 0.1 * i * (coord->tx - coord->x)), (int) (coord->y + 0.1 * i * (coord->ty - coord->y))); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } } if (hp_b->bond == 18) { fprintf (fp, "\n",svgcolor[hp_b->color]); coord = center_double_bond (x, y, tx, ty, db_dist+1); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord++; fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 19) { int tmpx1,tmpx2,tmpy1,tmpy2,tmptx1,tmptx2,tmpty1,tmpty2; coord = center_double_bond (x, y, tx, ty, db_dist+1); tmpx1=coord->x; tmpy1=coord->y; tmptx1=coord->tx; tmpty1=coord->ty; coord++; tmpx2=coord->x; tmpy2=coord->y; tmptx2=coord->tx; tmpty2=coord->ty; coord = center_double_bond (tmpx1, tmpy1, tmptx1, tmpty1, db_dist-1); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord++; fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord = center_double_bond (tmpx2, tmpy2, tmptx2, tmpty2, db_dist-1); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord++; fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } } hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (mark.flag && hp_a->marked == 0) { } else { if (hp_a->font == 0 ) { switch (hp_a->direct) { case Middle_Text: fprintf (fp, "x - 2, hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:middle;\" > \n\n"); break; case Left_Text: fprintf (fp, "x - 8 , hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:start;\" > \n\n"); break; case Right_Text: fprintf (fp, "x + 6, hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:end;\" > \n\n"); break; default: fprintf (stderr, "undefined text direction in svg output\n"); ;; } } else { switch (hp_a->direct) { case Middle_Text: fprintf (fp, "x - 2, hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:middle;\" > \n\n"); break; case Left_Text: fprintf (fp, "x - 8 , hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:start;\" > \n\n"); break; case Right_Text: fprintf (fp, "x + 6, hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:end;\" > \n\n"); break; default: fprintf (stderr, "undefined text direction in svg output\n"); ;; } } for (i = 0; i < (int)strlen (hp_a->c); ++i) { if (hp_a->c[i] == '\\') hp_a->c[i] = ' '; if (hp_a->c[i] == '@') { unicodechar=848+hp_a->c[++i]; switch (unicodechar){ /* catch sequence mismatches with X Symbol font*/ case 915: /*C*/ case 947: /*c*/ unicodechar+=20; break; case 918: case 950: /*f*/ unicodechar+=16; break; case 919: case 951: /*g*/ unicodechar-=4; break; case 920: case 952: /*h*/ unicodechar-=1; break; case 922: /*J is vartheta*/ unicodechar=977; break; case 954: /*j is varphi*/ unicodechar=981; break; case 923: case 924: case 925: case 955: case 956: case 957: unicodechar-=1; break; case 926: /*N*/ unicodechar=78; break; case 958: /*n*/ unicodechar=118; break; case 929: /*Q*/ unicodechar=920; break; case 961: /*p*/ unicodechar=952; break; case 962: unicodechar-=1; break; case 966:/*v*/ unicodechar=982; break; case 967: /*w*/ unicodechar=969; break; case 968: unicodechar=958; break; case 969: unicodechar-=1; break; case 970: unicodechar=950; break; case 930: /*R*/ unicodechar-=1; break; case 934: /*V*/ unicodechar=962; break; case 935: /*W*/ unicodechar+=2; break; case 936: /*X*/ unicodechar=926; break; case 937: /*Y*/ unicodechar-=1; break; case 938: unicodechar=90; break; case 1031: case 775: /* bullet */ unicodechar=8226; break; case 891: //oplus unicodechar=8853; break; case 893: //ominus unicodechar=8854; break; default: break; } fprintf (fp, "&#%04d;", unicodechar); /*FIXME: unicode greek does not always map to X11 Symbol, e.g. F is Z not Phi */ } else if (hp_a->c[i] == '#') { fprintf (fp, "\n"); fprintf (fp, "%c", hp_a->c[++i]); fprintf (fp, "\n"); } else if (hp_a->c[i] == '|') { fprintf (fp, "\n"); fprintf (fp, "%c", hp_a->c[++i]); fprintf (fp, "\n"); } else if (hp_a->c[i] == '_') { dy=5+hp_a->size; fprintf (fp, "\n", dy, 8+hp_a->size*2); if (hp_a->c[i + 1] && hp_a->c[i + 1] == '{') { shifted = 1; i++; } if (shifted == 1) { while (hp_a->c[i + 1] && hp_a->c[i + 1] != '}') fprintf (fp, "%c", hp_a->c[++i]); shifted = 0; i++; } else { fprintf (fp, "%c", hp_a->c[++i]); } fprintf (fp, "\n\n", -dy); } else if (hp_a->c[i] == '^') { dy=-2 * (2 + hp_a->size); /* BUG FIX 1 */ fprintf (fp, "\n", dy, 8+hp_a->size*2); if (hp_a->c[i + 1] && hp_a->c[i + 1] == '{') { shifted = 1; i++; } if (shifted == 1) { while (hp_a->c[i + 1] && hp_a->c[i + 1] != '}') fprintf (fp, "%c", hp_a->c[++i]); shifted = 0; i++; } else { fprintf (fp, "%c", hp_a->c[++i]); } fprintf (fp, "\n\n", -dy); } else { #ifndef GTK2 if ((unsigned char)hp_a->c[i] >128) fprintf (fp, "&#%03d;",(unsigned char)hp_a->c[i]); else #endif if (hp_a->c[i] == '<') fprintf (fp, "<"); else if (hp_a->c[i] == '>') fprintf (fp, ">"); else if (hp_a->c[i] == '&') fprintf (fp, "&"); else fprintf (fp, "%c", hp_a->c[i]); } if (hp_a->c[i]==' ') /* protect blanks again after output */ hp_a->c[i]='\\'; } fprintf (fp, "\n\n"); } hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (mark.flag == 1 && hp_sp->marked == 0) { } else { fprintf (fp, "x0, hp_sp->y0); fprintf (fp, "C %d,%d %d,%d %d,%d\"\n", hp_sp->x1, hp_sp->y1, hp_sp->x2, hp_sp->y2, hp_sp->x3, hp_sp->y3); switch (hp_sp->type) { case 0: case 1: case 2: fprintf (fp, "style=\"stroke-width:2; stroke:%s; fill:none\">\n",svgcolor[hp_sp->color]); break; ;; case -2: fprintf (fp, "style=\"stroke-width:2; stroke-dasharray:4,1; stroke:%s fill:none\">\n",svgcolor[hp_sp->color]); break; ;; case -1: fprintf (fp, "style=\"stroke-width:2; stroke:%s; fill:solid\">\n",svgcolor[hp_sp->color]); } fprintf (fp, "\n"); if (hp_sp->type > 0) { xbase = (int) (0.7 * 0.7 * 0.7 * (double) hp_sp->x3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->x2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->x1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->x0); ybase = (int) (0.7 * 0.7 * 0.7 * (double) hp_sp->y3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->y2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->y1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->y0); xlen = hp_sp->x3 - xbase; ylen = hp_sp->y3 - ybase; if (xlen != 0) xlen = (int) copysign (50., (double)xlen); if (ylen != 0) ylen = (int) copysign (50., (double)ylen); xside = (int) (xbase + 0.15 * ylen); yside = (int) (ybase - 0.15 * xlen); if (hp_sp->type == 1) { xend = (int) (xbase - 0.15 * ylen); yend = (int) (ybase + 0.15 * xlen); x = (xside - hp_sp->x0) * (xside - hp_sp->x0) + (yside - hp_sp->y0) * (yside - hp_sp->y0); tx = (xend - hp_sp->x0) * (xend - hp_sp->x0) + (yend - hp_sp->y0) * (yend - hp_sp->y0); if (tx > x) { xside = xend; yside = yend; } xend = xbase; /*on baseline */ yend = ybase; } else { xend = (int) (xbase - 0.15 * ylen); yend = (int) (ybase + 0.15 * xlen); } fprintf (fp, "color],svgcolor[hp_sp->color]); fprintf (fp, " points=\"%d,%d %d,%d, %d,%d\" />\n", hp_sp->x3, hp_sp->y3, xside, yside, xend, yend); } } hp_sp = hp_sp->next; } fprintf (fp, "\n\n"); fclose (fp); return (0); } int export_emf (char *filename) /* exports the current drawing to an ECMA Enhanced Metafile */ #ifndef EMF { char com[255]; FILE *xfile; int rval; #if 1 char tmpfile[512]; FILE *fp; int fd; #endif #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif if (figversion == 0) return (1); /* cannot export without fig2dev */ if ((int)strlen (filename)) { #if 0 snprintf (com,255, "fig2dev -L emf > %s", filename); xfile = popen (com, "w"); #else strcpy (tmpfile, "/tmp/chtXXXXXX"); /*@ignore@ splint does not recognize mkstemp */ fd = mkstemp (tmpfile); /*@end@*/ if (fd == -1) return (1); fp = fdopen (fd, "w"); rval = exfig (fp, 0); if (rval != 0) return(rval); if (fclose (fp) != 0) return(1); snprintf (com,255, "fig2dev -L emf %s> \"%s\"", tmpfile, filename); xfile = popen (com, "w"); #endif if (pclose (xfile) != 0) return (1); return (rval); } else return (1); } #else { int x, y, tx, ty, w, h; struct data *hp_b; struct dc *hp_a; struct spline *hp_sp; struct xy_co *coord; int d, i; int xbase, ybase, xside, yside, xend, yend, xlen, ylen; int shifted = 0; int ha,fzoom,xpos,chl,nsub,nsup,rval,l; int csize,fontsize,offset,savedpos; LPPOINT dummy={0}; POINT points[4]; char description[30]; HWND desktop = GetDesktopWindow(); HDC dc= GetDC(desktop); // PCSTR description = "Created by\0chemtool 1.6.13\0"; char *tmpstring=malloc(80*sizeof(char)); HENHMETAFILE mfh; HDC metaDC ; HPEN nopen=CreatePen(PS_SOLID,0,RGB(0xff,0xff,0xff)); HPEN pen=CreatePen(PS_SOLID,1,RGB(0x00,0x00,0x00)); HPEN widepen=CreatePen(PS_SOLID,5,RGB(0x00,0x00,0x00)); HPEN dashedpen=CreatePen(PS_DASH,1,RGB(0x00,0x00,0x00)); HPEN dottedpen=CreatePen(PS_DOT,1,RGB(0x00,0x00,0x00)); HPEN whitepen=CreatePen(PS_SOLID,5,RGB(0xff,0xff,0xff)); HBRUSH fill=CreateSolidBrush(RGB(0x00,0x00,0x00)); HFONT normalfont=CreateFontA(-11,0,0,0,FW_MEDIUM,0,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_CHARACTER_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT smallfont=CreateFontA(-8,0,0,0,FW_MEDIUM,0,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT italicfont=CreateFontA(11,0,12,0,FW_MEDIUM,1,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT smallitalicfont=CreateFontA(8,0,8,0,FW_MEDIUM,1,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT boldfont=CreateFontA(11,0,12,0,FW_BOLD,0,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT smallboldfont=CreateFontA(8,0,8,0,FW_BOLD,0,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT symbolfont=CreateFontA(11,0,12,0,FW_MEDIUM,0,0,0,SYMBOL_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT smallsymbolfont=CreateFontA(8,0,8,0,FW_MEDIUM,0,0,0,SYMBOL_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); savedpos = 0; switch (zoom_factor) { case 0: fontsize = 8; /*8 */ fzoom = 6; /*6,4 */ break; case 1: fontsize = 10; /*6? */ fzoom = 7; /*5? */ break; case 2: fontsize = 12; /*9? */ fzoom = 8; /*7? */ break; case 3: fontsize = 16; /*12? */ fzoom = 9; /*12,10? */ break; case 4: fontsize = 18; fzoom = 10; break; default: fprintf (stderr, "no emf font parameters for zoom factor %d\n", zoom_factor); rval = 2; } fzoom=size_factor; if (mark.flag && mark.w != 0 && mark.h != 0) { x = mark.x * size_factor + 3; y = mark.y * size_factor + 3; w = mark.w * size_factor - 6; h = mark.h * size_factor - 6; } else { /* get true extents of drawing*/ x = 10000; y = 10000; w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); x = MIN (x, hp_b->x); x = MIN (x, hp_b->tx); y = MIN (y, hp_b->y); y = MIN (y, hp_b->ty); hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { w = MAX (w, hp_a->x); if (hp_a->direct > -2) w = MAX (w, (hp_a->x + (int)strlen (hp_a->c) * 30)); h = MAX (h, hp_a->y + 12); x = MIN (x, hp_a->x); if (hp_a->direct < 0) x = MIN (x, (hp_a->x - (int)strlen (hp_a->c) * 30)); y = MIN (y, hp_a->y - 12); hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); x = MIN (x, hp_sp->x0); y = MIN (y, hp_sp->y0); x = MIN (x, hp_sp->x1); y = MIN (y, hp_sp->y1); x = MIN (x, hp_sp->x2); y = MIN (y, hp_sp->y2); x = MIN (x, hp_sp->x3); y = MIN (y, hp_sp->y3); hp_sp = hp_sp->next; } x = x * size_factor/2 * 0.8; y = y * size_factor/2 * 0.8; w = (w-x) * size_factor/2 * 1.1 ; h = (h-y) * size_factor/2 * 1.1 ; } #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif snprintf(description,30,"Created by\0chemtool %s\0",VERSION); metaDC = CreateEnhMetaFile (dc, filename, NULL, description); SetMapMode (dc, MM_ANISOTROPIC); SetViewportExtEx(dc,10,-10,NULL); /* invisible box for image sizing */ SelectObject(metaDC,nopen); MoveToEx(metaDC,x,h,NULL); LineTo(metaDC,w,h); LineTo(metaDC,w,y); LineTo(metaDC,x,y); LineTo(metaDC,x,h); /* now do the actual drawing */ SelectObject(metaDC,pen); SelectObject(metaDC,fill); SetTextColor(metaDC,RGB(0x00,0x00,0x00)); SetTextAlign(metaDC,TA_LEFT+TA_BASELINE); SetBkColor(metaDC,RGB(0xff,0xff,0xff)); SetBkMode(metaDC,OPAQUE); hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (mark.flag && (hp_b->smarked + hp_b->tmarked) == 0) { } else { coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 15); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; if (!hp_b->bond) { MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); } if (hp_b->bond == 5) { points[0].x=x*size_factor/2; points[0].y=y*size_factor/2; points[1].x=(int) (tx - 0.1 * (ty - y))*size_factor/2; points[1].y=(int) (ty + 0.1 * (tx - x))*size_factor/2; points[2].x=(int) (tx + 0.1 * (ty - y))*size_factor/2; points[2].y=(int) (ty - 0.1 * (tx - x))*size_factor/2; Polygon(metaDC,points,3); } if (hp_b->bond == 6) { for (i = 0; i < 10; i++) { MoveToEx(metaDC, (int) ((x + 0.1 * i * (tx - x) - 0.01 * (ty - y) * i)*size_factor/2), (int) ((y + 0.1 * i * (ty - y) + 0.01 * (tx - x) * i)*size_factor/2),dummy); LineTo(metaDC, (int) ((x + 0.1 * i * (tx - x) + 0.01 * (ty - y) * i)*size_factor/2), (int) ((y + 0.1 * i * (ty - y) - 0.01 * (tx - x) * i)*size_factor/2)); } } if (hp_b->bond == 7) { coord = multi_bonds (x, y, tx, ty, 2*mb_dist); Arc(metaDC,(int)(coord->x*size_factor/2),(int)(coord->ty*size_factor/2), (int)((x+0.25*(tx-x))*size_factor/2), (int)((y+0.25*(ty-y))*size_factor/2), (int)(coord->x*size_factor/2),(int)(coord->y*size_factor/2), (int)((x+0.25*(tx-x))*size_factor/2), (int)((y+0.25*(ty-y))*size_factor/2)); coord = multi_bonds (tx, ty, x, y, 2*mb_dist); Arc(metaDC,(int)(coord->x*size_factor/2),(int)(coord->ty*size_factor/2), (int)((x+0.5*(tx-x))*size_factor/2), (int)((y+0.5*(ty-y))*size_factor/2), (int)(coord->x*size_factor/2),(int)(coord->y*size_factor/2), (int)((x+0.5*(tx-x))*size_factor/2), (int)((y+0.5*(ty-y))*size_factor/2)); coord = multi_bonds (x, y, tx, ty, 2*mb_dist); Arc(metaDC,(int)(coord->x*size_factor/2),(int)(coord->ty*size_factor/2), (int)((x+0.75*(tx-x))*size_factor/2), (int)((y+0.75*(ty-y))*size_factor/2), (int)(coord->x*size_factor/2),(int)(coord->y*size_factor/2), (int)((x+0.75*(tx-x))*size_factor/2), (int)((y+0.75*(ty-y))*size_factor/2)); coord = multi_bonds (tx, ty, x, y, 2*mb_dist); Arc(metaDC,(int)(coord->x*size_factor/2),(int)(coord->ty*size_factor/2), (int)((x+1.*(tx-x))*size_factor/2), (int)((y+1.*(ty-y))*size_factor/2), (int)(coord->x*size_factor/2),(int)(coord->y*size_factor/2), (int)((x+1.*(tx-x))*size_factor/2), (int)((y+1.*(ty-y))*size_factor/2)); } if (hp_b->bond == 8) { MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); points[0].x=(int) (x + 0.8 * (tx - x))*size_factor/2; points[0].y=(int) (y + 0.8 * (ty - y))*size_factor/2; points[1].x=(int) (x + 0.8 * (tx - x) + 0.1 * (ty - y))*size_factor/2; points[1].y=(int) (y + 0.8 * (ty - y) - 0.1 * (tx - x))*size_factor/2; points[2].x=(int) (tx*size_factor/2); points[2].y=(int) (ty*size_factor/2); Polygon(metaDC,points,3); } if (hp_b->bond == 9) { MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); points[0].x= (int) (tx*size_factor/2); points[0].y= (int) (ty*size_factor/2); points[1].x= (int) ((x + 0.8 * (tx - x) + 0.1 * (ty - y))*size_factor/2); points[1].y= (int) ((y + 0.8 * (ty - y) - 0.1 * (tx - x))*size_factor/2); points[2].x= (int) ((x + 0.8 * (tx - x) - 0.1 * (ty - y))*size_factor/2); points[2].y= (int) ((y + 0.8 * (ty - y) + 0.1 * (tx - x))*size_factor/2); Polygon(metaDC,points,3); } if (hp_b->bond == 11) { w=calc_vector(x-tx,y-ty); Ellipse(metaDC, (x-w)*size_factor/2, (y-w)*size_factor/2, (x+w)*size_factor/2, (y+w)*size_factor/2); } if (hp_b->bond == 10) { SelectObject(metaDC,widepen); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,pen); } if (hp_b->bond == 12) { SelectObject(metaDC,dottedpen); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,pen); } if (hp_b->bond == 13) { SelectObject(metaDC,whitepen); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,pen); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); } if (hp_b->bond == 4) { coord = center_double_bond (x, y, tx, ty, db_dist); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); coord++; MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); } if (hp_b->bond == 1 || hp_b->bond == 3) { coord = multi_bonds (x, y, tx, ty, mb_dist); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); } if (hp_b->bond == 2 || hp_b->bond == 3) { coord = multi_bonds (tx, ty, x, y, mb_dist); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); } if (hp_b->bond == 14) { coord = multi_bonds (x, y, tx, ty, mb_dist); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,dashedpen); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); SelectObject(metaDC,pen); } if (hp_b->bond == 15) { coord = multi_bonds (tx, ty, x, y, mb_dist); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,dashedpen); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); SelectObject(metaDC,pen); } if (hp_b->bond == 16) { coord = center_double_bond (x, y, tx, ty, db_dist); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; coord++; for (i = 0; i < 10; i++){ MoveToEx (metaDC,(int) (x+0.1*i*(tx-x)*size_factor/2), (int)(y+0.1*i*(ty-y)*size_factor/2),dummy); LineTo(metaDC, (int)(coord->x+0.1*i*(coord->tx-coord->x)*size_factor/2), (int)(coord->y+0.1*i*(coord->ty-coord->y)*size_factor/2)); } } } hp_b = hp_b->next; } ha = 9 * fzoom; ha = 9 *size_factor; hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (mark.flag && hp_a->marked == 0) { } else { switch (hp_a->direct) { case Middle_Text: chl = 0; SetTextAlign(metaDC,TA_CENTER+TA_BOTTOM); break; case Left_Text: chl = 9 * fzoom; SetTextAlign(metaDC,TA_LEFT+TA_BOTTOM); break; case Right_Text: chl = -9 * fzoom; SetTextAlign(metaDC,TA_RIGHT+TA_BOTTOM); break; default: fprintf (stderr, "undefined text direction in emf output\n"); rval = 3; chl=0; ;; } nsub = 0; nsup = 0; for (i = 0; i < (int)strlen (hp_a->c); ++i) if (hp_a->c[i] == '\\') hp_a->c[i] = ' '; if (!strpbrk (hp_a->c, "@_^|#")) { /*no sub- or superscripts */ xpos = hp_a->x * fzoom; csize = fontsize * fzoom * 1.4; SelectObject(metaDC,normalfont); TextOutA(metaDC,(int)((hp_a->x)*size_factor/2),(int)((hp_a->y+25)*size_factor/2), hp_a->c,(int)strlen(hp_a->c)); } else { /* special formatting needed, every character becomes a separate entity */ l = (int)strlen (hp_a->c); l = 0; for (i = 0; i < (int)strlen (hp_a->c); i++) { switch (hp_a->c[i]) { case '@': break; case '_': case '^': /* l -= .5; ??*/ break; default: l++; } } fzoom=size_factor; xpos = hp_a->x * size_factor - chl; if (hp_a->direct == Right_Text) xpos=xpos-12*(l-2); csize = fontsize * size_factor * 1.4; shifted=0; for (i = 0; i < (int)strlen (hp_a->c); i++) { offset = 0; SelectObject(metaDC,normalfont); csize = fontsize * fzoom * 1.4; if (shifted != 0) { if (hp_a->c[i] == '}') { shifted = 0; i++; if (i >= (int)strlen (hp_a->c)) break; } else { offset = shifted; } } if (hp_a->c[i] == '_') { if (chl >= 0) csize = csize / 2; offset = ha / 2; nsub = nsub + 1; if (nsub == 1) { if (nsup > 0) xpos = savedpos; else savedpos = xpos; } nsup = 0; } if (hp_a->c[i] == '^') { offset = -ha / 2; nsup = nsup + 1; if (nsup == 1) { if (nsub > 0) xpos = savedpos; else savedpos = xpos; } nsub = 0; } if (offset != 0) { SelectObject(metaDC,smallfont); /* if (chl < 0) xpos = xpos - csize / 2; else xpos = xpos - 20;*/ if (hp_a->direct==Right_Text) xpos=xpos-10; if (shifted == 0) { i++; if (hp_a->c[i] == '{') { shifted = offset; i++; } } if (i >= (int)strlen (hp_a->c)) break; if (hp_a->c[i] != '-' && hp_a->c[i] != '+') offset = offset * 2; } else { /*reset sub- and superscript counters */ nsub = 0; nsup = 0; } if (hp_a->c[i] == '@') { SelectObject(metaDC,symbolfont); if (offset !=0) SelectObject(metaDC,smallsymbolfont); i++; } if (hp_a->c[i] == '|') { SelectObject(metaDC,italicfont); if (offset!=0) SelectObject(metaDC,smallitalicfont); /* csize = csize / 2; */ i++; } if (hp_a->c[i] == '#') { SelectObject(metaDC,boldfont); if (offset!=0) SelectObject(metaDC,smallboldfont); i++; } sprintf(tmpstring,"%c",hp_a->c[i]); TextOutA(metaDC,(int)((xpos-10+abs(offset/2))/2), (int)((hp_a->y+25)*size_factor/2), tmpstring,(int)strlen(tmpstring)); xpos = xpos + 20; if (zoom_factor < 2) xpos = xpos + 10; } /*for i */ } /* normal or special formatting */ for (i = 0; i < (int)strlen (hp_a->c); ++i) if (hp_a->c[i] == ' ') hp_a->c[i] = '\\'; } /* if within current set*/ hp_a = hp_a->next; } /* for all labels */ hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (mark.flag == 1 && hp_sp->marked == 0) { } else { points[0].x=hp_sp->x0 *size_factor/2; points[0].y=hp_sp->y0 *size_factor/2; points[1].x=hp_sp->x1 *size_factor/2; points[1].y=hp_sp->y1 *size_factor/2; points[2].x=hp_sp->x2 *size_factor/2; points[2].y=hp_sp->y2 *size_factor/2; points[3].x=hp_sp->x3 *size_factor/2; points[3].y=hp_sp->y3 *size_factor/2; switch (hp_sp->type) { case 0: case 1: case 2: PolyBezier(metaDC,points,4); break; ;; case -2: SelectObject(metaDC,dashedpen); PolyBezier(metaDC,points,4); SelectObject(metaDC,pen); break; ;; case -1: SelectObject(metaDC,fill); PolyBezier(metaDC,points,4); SelectObject(metaDC,pen); } if (hp_sp->type > 0) { xbase = 0.7 * 0.7 * 0.7 * (double) hp_sp->x3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->x2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->x1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->x0; ybase = 0.7 * 0.7 * 0.7 * (double) hp_sp->y3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->y2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->y1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->y0; xlen = hp_sp->x3 - xbase; ylen = hp_sp->y3 - ybase; if (xlen != 0) xlen = (int) copysign (50., xlen); if (ylen != 0) ylen = (int) copysign (50., ylen); xside = xbase + 0.15 * ylen; yside = ybase - 0.15 * xlen; if (hp_sp->type == 1) { xend = xbase - 0.15 * ylen; yend = ybase + 0.15 * xlen; x = (xside - hp_sp->x0) * (xside - hp_sp->x0) + (yside - hp_sp->y0) * (yside - hp_sp->y0); tx = (xend - hp_sp->x0) * (xend - hp_sp->x0) + (yend - hp_sp->y0) * (yend - hp_sp->y0); if (tx > x) { xside = xend; yside = yend; } xend = xbase; /*on baseline */ yend = ybase; } else { xend = xbase - 0.15 * ylen; yend = ybase + 0.15 * xlen; } SelectObject(metaDC,fill); points[0].x=hp_sp->x3*size_factor/2; points[0].y=hp_sp->y3*size_factor/2; points[1].x=xside*size_factor/2; points[1].y=yside*size_factor/2; points[2].x=xend*size_factor/2; points[2].y=yend*size_factor/2; Polygon(metaDC,points,3); SelectObject(metaDC,pen); } } hp_sp = hp_sp->next; } mfh=CloseEnhMetaFile(metaDC); DeleteEnhMetaFile(mfh); DeleteDC(metaDC); return (0); } #endif int export_bitmap (char *filename) /* exports the current drawing to an X11 bitmap file */ { int x, y, w, h; struct data *hp_b; struct dc *hp_a; struct spline *hp_sp; int d; int retval; char xfile[512]; Pixmap buffer; GdkPixmap *bitmap; GdkGC *bitmapgc; if (mark.flag && mark.w != 0 && mark.h != 0) { fprintf (stderr, "marked x %d y %d w %d h %d\n",mark.x,mark.y,mark.w,mark.h); x = mark.x * size_factor + 3; y = mark.y * size_factor + 3; w = mark.w * size_factor - 6; h = mark.h * size_factor - 6; } else { /* get true extents of drawing*/ x = 10000; y = 10000; w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); x = MIN (x, hp_b->x); x = MIN (x, hp_b->tx); y = MIN (y, hp_b->y); y = MIN (y, hp_b->ty); hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { w = MAX (w, hp_a->x); if (hp_a->direct > -2) w = MAX (w, hp_a->x + (int)strlen (hp_a->c) * (6 + 2 * size_factor)); h = MAX (h, hp_a->y + 8); x = MIN (x, hp_a->x); if (hp_a->direct < 0) x = MIN (x, hp_a->x - (int)strlen (hp_a->c) * (6 + 2 * size_factor)); y = MIN (y, hp_a->y - 8); hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); x = MIN (x, hp_sp->x0); y = MIN (y, hp_sp->y0); x = MIN (x, hp_sp->x1); y = MIN (y, hp_sp->y1); x = MIN (x, hp_sp->x2); y = MIN (y, hp_sp->y2); x = MIN (x, hp_sp->x3); y = MIN (y, hp_sp->y3); hp_sp = hp_sp->next; } x = (int) (x * size_factor * 0.9); y = (int) (y * size_factor * 0.9); w = (int) (w * size_factor * 1.1 - x); h = (int) (h * size_factor * 1.1 - y); if (x < 0) x = 0; if (y < 0) y = 0; } bitmap = gdk_pixmap_new (drawing_area->window, 1, 1, 1); bitmapgc = gdk_gc_new (bitmap); buffer = XCreatePixmap (GDK_WINDOW_XDISPLAY(picture), GDK_WINDOW_XWINDOW(picture), (unsigned int)w, (unsigned int)h, 1); XCopyPlane (GDK_WINDOW_XDISPLAY(picture), GDK_WINDOW_XWINDOW(picture), buffer, GDK_GC_XGC(bitmapgc), x, y, (unsigned int)w, (unsigned int)h, 0, 0, 1); if ((int)strlen (filename)) { snprintf (xfile,512, "%s", filename); retval = XWriteBitmapFile (GDK_DISPLAY (), xfile, buffer, (unsigned int)w, (unsigned int)h, -1, -1); gdk_pixmap_unref (bitmap); gdk_gc_unref (bitmapgc); XFreePixmap (GDK_DISPLAY (), buffer); return (retval); } return (0); } void xfig_line (FILE * fp, int x, int y, int tx, int ty) /* writes a single line bond in XFig notation */ { fprintf (fp, "%i %i %i %i %i %i %i %i %i %.3f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints); fprintf (fp, "%i %i %i %i\n", x, y, tx, ty); } void xfig_wedge (FILE * fp, int x, int y, int tx, int ty, int factor, int latex) /* writes a wedge definition in XFig notation */ { struct data *hpc; struct xy_co *coord; int d, x1, y1, x2, y2; int bond_already_tuned; float area; x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); hpc = da_root.next; bond_already_tuned = 0; for (d = 0; d < hp->n; d++) { if (hpc->bond == 10) { if ( (abs (hpc->x * factor - tx) < 3 && abs (hpc->y * factor - ty) < 3) || (abs (hpc->tx * factor - tx) < 3 && abs (hpc->ty * factor - ty) < 3)) { coord = center_double_bond (hpc->x, hpc->y, hpc->tx, hpc->ty, db_dist); if (abs (hpc->x * factor - tx) < 3 && abs (hpc->y * factor - ty) < 3) { x1 = coord->x * factor; y1 = coord->y * factor; coord++; x2 = coord->x * factor; y2 = coord->y * factor; } else { x1 = coord->tx * factor; y1 = coord->ty * factor; coord++; x2 = coord->tx * factor; y2 = coord->ty * factor; } area = 0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1)); if (fabs (area) < 76. * factor) { x1 = tx - (int) (0.05 * (float) (ty - y)); y1 = ty + (int) (0.05 * (float) (tx - x)); x2 = tx + (int) (0.05 * (float) (ty - y)); y2 = ty - (int) (0.05 * (float) (tx - x)); } else bond_already_tuned = 1; } } if (hpc->bond == 0 && !bond_already_tuned) { if ((abs (hpc->x * factor - tx) < 3 && abs (hpc->y * factor - ty) < 3) ||(abs (hpc->tx * factor - tx) < 3 && abs (hpc->ty * factor - ty) < 3)) /* let the wedge smooth along a another bond */ { coord = intersect(x,y,x1,y1,hpc->x*factor,hpc->y*factor, hpc->tx*factor,hpc->ty*factor); coord->tx = coord->x; coord->ty = coord->y; coord = intersect(x,y,x2,y2,hpc->x*factor,hpc->y*factor, hpc->tx*factor,hpc->ty*factor); x1 = coord->tx; y1 = coord->ty; x2 = coord->x; y2 = coord->y; area = 0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1)); if (fabs (area) > 3300. * factor || fabs(area) < 1750. * factor) { x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); } } } hpc = hpc->next; } if (!latex) { fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill + 21, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints + 1); fprintf (fp, "%i %i %i %i %i %i\n", x, y, x1, y1, x2, y2); } else { for (d = 0; d < 10; d++) xfig_line (fp, x, y, x1 + d * (x2 - x1) / 10, y1 + d * (y2 - y1) / 10); } } void xfig_wiggly (FILE * fp, int x, int y, int tx, int ty) /* writes a wavy bond in XFig notation */ { int arccode = 5; int arctype = 1; int direction = 1; float xlen, ylen, veclen, boxlen; int boxcorx, boxcory; int i; float center_x, center_y; int xstart, ystart, xmid, ymid, xend, yend; xlen = (float)(tx - x); ylen = (float)(ty - y); veclen = (float)calc_vector (abs (tx - x), abs (ty - y)); boxlen = 0.2 * veclen; boxcorx = (int) ((1. - xlen / veclen) * boxlen / 2); boxcory = (int) ((1. - ylen / veclen) * boxlen / 2); for (i = 0; i < 5; i++) { direction = abs (direction - 1); center_x = x + (0.2 * i + .1) * xlen; center_y = y + (0.2 * i + .1) * ylen; xstart = (int) (x + 0.2 * i * xlen); ystart = (int) (y + 0.2 * i * ylen); xmid = (int) (center_x - boxcorx * pow (-1, (double)i)); ymid = (int) (center_y - boxcory * pow (-1, (double)i)); if (x > tx) { xmid = (int) (center_x + boxcorx * pow (-1, (double)i)); ymid = (int) (center_y + boxcory * pow (-1, (double)i)); } xend = (int) (x + 0.2 * (i + 1) * xlen); yend = (int) (y + 0.2 * (i + 1) * ylen); fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %f %f %i %i %i %i %i %i\n", arccode, arctype, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.cap_style, direction, figline.forward_arrow, figline.backward_arrow, center_x, center_y, xstart, ystart, xmid, ymid, xend, yend); } } void xfig_arrow (FILE * fp, int x, int y, int tx, int ty, int type, int latex) /* writes an arrow in XFig notation */ { float xlen, ylen; float headfact; int xbase, ybase, xside, yside, xend, yend; int i; float veclen; xlen = (float)(tx - x); ylen = (float)(ty - y); headfact = 0.8; xbase = x + headfact * xlen; ybase = y + headfact * ylen; if (select_char (tx,ty,1) != NULL){ veclen = (float)calc_vector(tx-x,ty-y); xbase = x+headfact*xlen-10*xlen/veclen; ybase = y+headfact*ylen-10*ylen/veclen; } xside = (int) (xbase + 0.05 * ylen); yside = (int) (ybase - 0.05 * xlen); xend = (int) (xbase - type * (0.05 * ylen)); /*type=0 (half arrow) ends on baseline, */ yend = (int) (ybase + type * (0.05 * xlen)); /*type=1 is a symmetrical arrowhead */ if (type == 1) { /* symmetrical arrow */ fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow + 1, figline.backward_arrow, figline.npoints); fprintf (fp, "%i %i %f %f %f\n", /* arrow attributes */ 1, /* arrow_type (triangle, as before) */ 1, /* arrow_style (1 == filled) */ 2.00, /* arrow_thickness (1/80inch) */ 72.00, /* arrow_width (fig units (?) ) */ 114.00 /* arrow_height (fig units) */ ); fprintf (fp, "%i %i %i %i\n", x, y, tx, ty); } else { /* half arrow */ /* the line */ fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints); fprintf (fp, "%i %i %i %i\n", x, y, tx, ty); /* and the arrowhead - a filled polyline */ if (!latex) { fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill + 21, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints + 1); fprintf (fp, "%i %i %i %i %i %i\n", tx, ty, xside, yside, xend, yend); } else { for (i = 0; i < 10; i++) xfig_line (fp, tx, ty, xend + i * (xside - xend) / 10, yend + i * (yside - yend) / 10); } } } void xfig_circle (FILE * fp, int x, int y, int tx, int ty) { int radius; float start_ang = 0.; int direction = 1; radius = calc_vector (abs (tx - x), abs (ty - y)); fprintf (fp, "1 3 %i %i %i %i %i %i %i %.4f %i %.4f %i %i %i %i %i %i %i %i\n", figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, direction, start_ang, x, y, radius, radius, tx, ty, tx, ty); } void xfig_spline (FILE * fp, int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int type, int latex) /* draws a spline curve, optionally with full of half arrowhead */ { int xlen, ylen, xbase, ybase, flag; double px0, py0, px1, py1; int i; double t; double dist; int xside, yside, xend, yend; figline.npoints = 21; if (type == -2) { figline.line_style = 2; figline.style_val = 4; } if (type == -1) { figline.area_fill = 20; } /* if (type == 1)*/ /* figline.npoints = 15;*/ /* the line */ fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints); fprintf (fp, "%i %i\n", x0, y0); px0 = (double)x0; py0 = (double)y0; xbase = 0; ybase = 0; flag = 0; for (i = 0; i < figline.npoints -1 ; i++) { t = (float) i / (figline.npoints -2 ); px1 = t * t * t * (double) x3 + 3. * t * t * (1. - t) * (double) x2 + 3. * t * (1. - t) * (1. - t) * (double) x1 + (1. - t) * (1. - t) * (1. - t) * px0; py1 = t * t * t * (double) y3 + 3. * t * t * (1. - t) * (double) y2 + 3. * t * (1. - t) * (1. - t) * (double) y1 + (1. - t) * (1. - t) * (1. - t) * py0; fprintf (fp, "%i %i\n", (int) px1, (int) py1); if (type >= 0) { dist = (x3-px1) * (x3-px1) + (y3-py1) * (y3-py1) ; if (( flag == 0) && ( i == 18 || (i >= 15 && dist < 30000.) ) ) { xbase = (int)px1; ybase = (int)py1; if (dist >30000.) { xbase += (x3-xbase)/2; ybase += (y3-ybase)/2; } flag = 1; } } } figline.line_style = 0; figline.style_val = 0; figline.area_fill = -1; figline.npoints = 2; if (type <= 0) return; xlen = x3 - xbase; ylen = y3 - ybase; if (xlen != 0) xlen = (int) copysign (50., (double)xlen); if (ylen != 0) ylen = (int) copysign (50., (double)ylen); xside = (int) (xbase + 0.5 * ylen); yside = (int) (ybase - 0.5 * xlen); if (type == 1) { xend = (int) (xbase - 0.5 * ylen); yend = (int) (ybase + 0.5 * xlen); px0 = (double)((xside - x0) * (xside - x0) + (yside - y0) * (yside - y0)); px1 = (double)((xend - x0) * (xend - x0) + (yend - y0) * (yend - y0)); if (px1 > px0) { xside = xend; yside = yend; } xend = xbase; /*on baseline */ yend = ybase; } else { xend = (int) (xbase - 0.5 * ylen); yend = (int) (ybase + 0.5 * xlen); } /* add the arrowhead - a filled polyline */ if (!latex) { fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill + 21, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints + 1); fprintf (fp, "%i %i %i %i %i %i\n", (int) x3, (int) y3, xside, yside, xend, yend); } else { for (i = 0; i < 10; i++) xfig_line (fp, x3, y3, xend + i * (xside - xend) / 10, yend + i * (yside - yend) / 10); } } int exfig (FILE * fp, int latex_flag) /* export the current molecule in the format of Brian Smith' XFig program */ { struct data *hp_b; struct dc *hp_a; struct spline *hp_sp; struct xy_co *coord; int i; float l; int d, x, y, tx, ty; int n; gchar *hpacc,*hpacc_p=NULL; #ifdef GTK2 int tw; static PangoLayout *thelayout; gchar hp_ac; gchar *ccx=malloc(10*sizeof(gchar)); #endif int ulx, uly, lrx, lry; int ha, chl = 0; int fontsize = 12, fzoom = 10; int xpos, offset, fontshrink; int shifted = 0; int nsub, nsup, savedpos; float csize; char symbol[30]; int rval = 0; float charscale; /* scale textlength, width according to zoom factor */ int len; float step; // const int myfontheight[7]={8,8,9,14,12,14,24}; const int myfontheight[7]={8,8,9,14,16,14,24}; #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif savedpos = 0; charscale = 1.05; fzoom=16.; fzoom *= size_factor; if (!fprintf (fp, "#FIG 3.2\n")) return (1); fprintf (fp, "Portrait\n"); fprintf (fp, "Center\n"); fprintf (fp, "Metric\n"); fprintf (fp, "A4\n"); fprintf (fp, "100.00\n"); fprintf (fp, "Single\n"); fprintf (fp, "0\n"); fprintf (fp, "# generated by Chemtool " VERSION "\n"); fprintf (fp, "1200 2\n"); figline.object = 2; figline.sub_type = 1; figline.line_style = 0; figline.thickness = 2; figline.pen_color = 0; figline.fill_color = 7; figline.depth = 100; figline.pen_style = 0; figline.area_fill = -1; figline.style_val = 0.000; figline.join_style = 0; figline.cap_style = 0; figline.radius = -1; figline.forward_arrow = 0; figline.backward_arrow = 0; figline.npoints = 2; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (mark.flag && (hp_b->smarked + hp_b->tmarked) == 0) { } else { figline.pen_color = hp_b->color; figline.fill_color = hp_b->color; coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 12); if(hp_b->bond==11) coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 0); #if 0 if(hp_b->bond==5 || hp_b->bond==6) coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 15); #endif x = coord->x * fzoom; y = coord->y * fzoom; tx = coord->tx * fzoom; ty = coord->ty * fzoom; if ( !use_whiteout) { int siz,j; float lfactor=((float)calc_vector(abs(tx-x),abs(ty-y))/(832.*size_factor)); if (lfactor >1.) lfactor=1.; /* short bonds should not shrink as much, they might vanish completely */ /* extra long bonds, however, need not leave more space around labels */ i=has_label(hp_b->x,hp_b->y); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (zoom_factor <2) siz-= 2-zoom_factor; if (zoom_factor >2) siz+= zoom_factor-2; if (siz <0) siz=0; if (siz >6) siz=6; if (y-ty==0&& hp_a->direct ==0) { if (tx>x) { int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if (strl>1) x+=(strl+1)*fzoom*(siz+1); if (hp_a->c[strlen(hp_a->c)-2]=='_') { x-=fzoom/2*(siz+1); } if (hp_a->c[strlen(hp_a->c)-1]=='}') x-=fzoom/2*(siz+1); } // else // x-=(strlen(hp_a->c)-1)*fzoom*(siz+1); } int ox=x; // fprintf(stderr,"size_factor=%f bondl %d lfactor %f\n",size_factor,calc_vector(abs(tx-x),abs(ty-y)),lfactor); x += (lfactor*fzoom*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); y += (lfactor*fzoom*(siz+1)/calc_vector(abs(tx-ox),abs(ty-y))) *(ty-y); } i=has_label(hp_b->tx,hp_b->ty); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0 ){ if ( hp_a->direct<-1) { if (tx>x) tx-=(strlen(hp_a->c)-1)*fzoom*(siz+1); // else // tx+=(strlen(hp_a->c)-1)*fzoom*(siz+1); } else if ( hp_a->direct==0) { // if (tx>x) // tx-=(strlen(hp_a->c)-1)*fzoom*(siz+1); // else if (txc)-1)*fzoom*(siz+1); } } int otx=tx; tx -= (lfactor*fzoom*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); ty -= (lfactor*fzoom*(siz+1)/calc_vector(abs(otx-x),abs(ty-y))) *(ty-y); } } if (!hp_b->bond) xfig_line (fp, x, y, tx, ty); if (hp_b->bond == 5) { xfig_wedge (fp, x, y, tx, ty, fzoom, latex_flag); } if (hp_b->bond == 6) { len=(int) (calc_vector(abs(tx-x),abs(ty-y))/(8.*fzoom)); if (len <8 ) len=8; step=1./len; for (i = 1; i < len; i=i+1) xfig_line (fp, (int) (x + step * i * (tx - x) - 0.01 * (ty - y) * i), (int) (y + step * i * (ty - y) + 0.01 * (tx - x) * i), (int) (x + step * i * (tx - x) + 0.01 * (ty - y) * i), (int) (y + step * i * (ty - y) - 0.01 * (tx - x) * i)); } if (hp_b->bond == 7) xfig_wiggly (fp, x, y, tx, ty); if (hp_b->bond == 8) xfig_arrow (fp, x, y, tx, ty, 0, latex_flag); if (hp_b->bond == 9) xfig_arrow (fp, x, y, tx, ty, 1, latex_flag); if (hp_b->bond == 11) xfig_circle (fp, x, y, tx, ty); if (hp_b->bond == 10) { figline.thickness = 6; /* 4 ? */ xfig_line (fp, x, y, tx, ty); figline.thickness = 2; /* 1 ? */ } if (hp_b->bond == 12) { figline.line_style = 2; figline.style_val = 4; xfig_line (fp, x, y, tx, ty); figline.line_style = 0; figline.style_val = 0; } if (hp_b->bond == 13) { figline.thickness = 6; figline.pen_color = 7; figline.depth = 85; xfig_line (fp, x + (tx - x) / 8., y + (ty - y) / 8., tx - (tx - x) / 8., ty - (ty - y) / 8.); figline.thickness = 2; figline.pen_color = 0; figline.depth = 80; xfig_line (fp, x, y, tx, ty); figline.depth = 100; } if (hp_b->bond == 4) { coord = center_double_bond (x, y, tx, ty, db_dist * fzoom); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord++; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } if (hp_b->bond == 1 || hp_b->bond == 3) { coord = multi_bonds (x, y, tx, ty, mb_dist * fzoom); xfig_line (fp, x, y, tx, ty); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } if (hp_b->bond == 2 || hp_b->bond == 3) { coord = multi_bonds (tx, ty, x, y, mb_dist * fzoom); xfig_line (fp, x, y, tx, ty); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } if (hp_b->bond == 14) { coord = multi_bonds (x, y, tx, ty, mb_dist * fzoom); xfig_line (fp, x, y, tx, ty); figline.line_style = 1; figline.style_val = 2.; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); figline.line_style = 0; figline.style_val = 0.; } if (hp_b->bond == 15) { coord = multi_bonds (tx, ty, x, y, mb_dist * fzoom); xfig_line (fp, x, y, tx, ty); figline.line_style = 1; figline.style_val = 2.; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); figline.line_style = 0; figline.style_val = 0.; } if (hp_b->bond == 16) { coord = center_double_bond (x, y, tx, ty, db_dist * fzoom); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; coord++; for (i = 0; i < 10; i++) xfig_line (fp, (int) (x + 0.1 * i * (tx - x)), (int) (y + 0.1 * i * (ty - y)), (int) (coord->x + 0.1 * i * (coord->tx - coord->x)), (int) (coord->y + 0.1 * i * (coord->ty - coord->y))); } if (hp_b->bond == 18) { xfig_line (fp, x, y, tx, ty); coord = center_double_bond (x, y, tx, ty, (db_dist+1) * fzoom); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord++; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } if (hp_b->bond == 19) { int tmpx1,tmpx2,tmpy1,tmpy2,tmptx1,tmptx2,tmpty1,tmpty2; coord = center_double_bond (x, y, tx, ty, (db_dist+2) * fzoom); tmpx1=coord->x; tmpy1=coord->y; tmptx1=coord->tx; tmpty1=coord->ty; coord++; tmpx2=coord->x; tmpy2=coord->y; tmptx2=coord->tx; tmpty2=coord->ty; coord = center_double_bond (tmpx1,tmpy1,tmptx1,tmpty1,(db_dist-1)*fzoom); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord++; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord = center_double_bond (tmpx2,tmpy2,tmptx2,tmpty2,(db_dist-1)*fzoom); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord++; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } /* hp_b = hp_b->next;*/ } hp_b = hp_b->next; } figtext.object = 4; figtext.sub_type = 0; figtext.color = 0; figtext.depth = 90; figtext.pen_style = 0; figtext.font = 16; /*16=helvetica*,12=courier */ figtext.font_size = 10; figtext.angle = 0.000; if (!latex_flag) figtext.font_flags = 4; else figtext.font_flags = 6; figtext.height = 180. *charscale; figtext.length = 170. *charscale; hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (mark.flag && hp_a->marked == 0) { } else { fontsize=hp_a->size; if (zoom_factor <2) fontsize-= 2-zoom_factor; if (zoom_factor >2) fontsize+= zoom_factor-2; if (fontsize <0) fontsize=0; if (fontsize >6) fontsize=6; switch (fontsize) { case 0: figtext.font_size = 8; /*8 */ charscale=1.3; break; case 1: figtext.font_size = 10; /*6? */ charscale = 1.25; break; case 2: figtext.font_size = 12; /*9? */ charscale = 0.6; break; case 3: figtext.font_size = 16; /*12? */ charscale = 0.75; break; case 4: figtext.font_size = 18; charscale = 0.6; break; case 5: figtext.font_size = 20; charscale = 0.4; break; case 6: figtext.font_size = 24; charscale = 0.2; break; default: fprintf (stderr, "no figfont parameters for fontsize %d\n", fontsize); rval = 2; } switch (zoom_factor) { case 0: charscale=0.95; break; case 1: charscale = 0.80; break; case 2: charscale = 0.95; break; case 3: charscale = 0.85; break; case 4: charscale = 0.80; break; } /* fzoom = size_factor * 16. ;*/ /* 75dpi screen to 1200dpi FIG */ float cfzoom = fzoom * charscale / size_factor; #ifdef GTK2 if (!thelayout) thelayout = gtk_widget_create_pango_layout(drawing_area,"X"); pango_layout_set_text(thelayout, "X", -1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); pango_layout_get_pixel_size(thelayout, NULL, &ha); //fprintf(stderr,"gtk pixel height %d\n",ha); figtext.height=8*ha; ha = ha/100 *fzoom; #else ha=fzoom * gdk_char_height(font[fontsize],(gchar)'X'); figtext.height=8*ha; #endif int hax=0; #ifdef GTK2 pango_layout_get_pixel_size(thelayout, NULL, &hax); #endif ha=(int)(fzoom/2. * myfontheight[fontsize]); // fprintf(stderr,"fixed ha=%d, calculated %d\n",ha,hax); // figtext.height = 180. *charscale; // figtext.length = 170. *charscale; figtext.color = hp_a->color; if (hp_a->font == 0) figtext.font = 16; /* Helvetica */ else figtext.font = 0; /* Times */ figtext.sub_type = abs (hp_a->direct); switch (hp_a->direct) { case Middle_Text: chl = 0; break; case Left_Text: chl = 9 * fzoom; break; case Right_Text: chl = -9 * fzoom; break; default: fprintf (stderr, "undefined text direction in xfig output\n"); rval = 3; ;; } hpacc=strdup(hp_a->c); nsub = 0; nsup = 0; if ( (int)strlen(hpacc) != g_utf8_strlen(hpacc,-1) ) { gchar *q = g_strdup(hpacc); gchar *c,*cc; gchar *t = g_strdup(hpacc); gsize pos,out; long symb; c=g_convert(hpacc,-1,"ISO8859-1","UTF-8",&pos,&out,NULL); if (!c) { q[0]='\0'; do { c=g_convert(t,-1,"ISO8859-1","UTF-8",&pos,&out,NULL); if (!c) { cc=t+(long)pos; symb=g_utf8_get_char(cc); *cc='\0'; strcat(q,t); switch(symb) { case 923: strcat(q,"@L"); break; case 915: strcat(q,"@G"); break; case 916: case 8710: strcat(q,"@D"); break; case 945: strcat(q,"@a"); break; case 946: strcat(q,"@b"); break; case 947: strcat(q,"@g"); break; case 948: strcat(q,"@d"); break; case 949: strcat(q,"@e"); case 966: strcat(q,"@f"); break; case 967: strcat(q,"@g"); break; case 954: strcat(q,"@k"); break; case 955: strcat(q,"@l"); break; case 956: strcat(q,"@m"); break; case 957: strcat(q,"@n"); break; case 960: strcat(q,"@p"); break; case 961: strcat(q,"@r"); break; case 963: strcat(q,"@s"); break; case 964: strcat(q,"@t"); break; case 8853: strcat(q,"@+"); break; case 8854: strcat(q,"@-"); break; case 8901: strcat(q,"@*"); break; default: break; } *cc=' '; t=g_utf8_find_next_char(cc,NULL); } } while(!c); strcat(q,t); strcpy(hpacc,q); } } for (i = 0; i < (int)strlen (hpacc); ++i) if (hpacc[i] == '\\') hpacc[i] = ' '; if (!strpbrk (hpacc, "@_^|#")) { /* no sub- or superscripts - can write entire label in one go */ /* calculate start position depending on justification */ xpos = hp_a->x * fzoom; csize = (fontsize * fzoom /* * 1.4*/); if (chl < 0) xpos -= (int)strlen (hpacc) * csize; if (chl == 0) xpos -= (int)strlen (hpacc) * csize / 2; ulx = xpos; if (chl > 0) ulx = xpos - csize / 2; /* if (chl == 0) ulx = xpos+ csize/2; */ if (chl < 0) ulx = xpos + csize; uly = hp_a->y * fzoom - ha; lrx = xpos + (int)strlen (hpacc) * csize - csize / 2; if (chl == 0) lrx += csize/2; if (chl < 0) lrx = lrx + csize; lry = hp_a->y * fzoom + ha; /* draw compound object with white box under the text if desired */ if (use_whiteout == 1) fprintf (fp, " 6 %i %i %i %i\n", ulx, uly, lrx, lry); if (use_whiteout == 1 && !latex_flag) { fprintf (fp, " 2 2 0 1 7 7 95 0 20 1 0 0 5 0 0 5\n"); fprintf (fp, "%i %i\n", ulx, uly); fprintf (fp, "%i %i\n", lrx, uly); fprintf (fp, "%i %i\n", lrx, lry); fprintf (fp, "%i %i\n", ulx, lry); fprintf (fp, "%i %i\n", ulx, uly); } if (latex_flag) /* convert special shortcut characters to LaTeX commands */ { int ii,jj; char latexstr[255]; jj=0; for (ii=0;ii<(int)strlen(hpacc);ii++){ if (hpacc[ii] == '' ){ latexstr[jj++]='\0'; strcat(latexstr,"$^{\\\\circ}$"); jj += 10; continue; } if (hpacc[ii] == (char)169 ){ latexstr[jj++]='\0'; strcat(latexstr,"$\\\\copyright$"); jj += 12; continue; } if (hpacc[ii] == (char)174 ){ latexstr[jj++]='\0'; strcat(latexstr,"$\\\\textregistered$"); jj += 17; continue; } if (hpacc[ii] == (char)177 ){ latexstr[jj++]='\0'; strcat(latexstr,"$\\\\pm$"); jj += 5; continue; } if (hpacc[ii]=='%' || hpacc[ii]=='$') { latexstr[jj++]='\\'; latexstr[jj++]='\\'; } latexstr[jj++]=hpacc[ii]; } latexstr[jj]='\0'; fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %f %f %i %i %s\\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size, figtext.angle, figtext.font_flags, figtext.height, figtext.length * (int)strlen (latexstr), hp_a->x * fzoom - chl, hp_a->y * fzoom + ha, latexstr); } else { //{ float tlen=0.; int cw; #ifdef GTK2 gchar *c,*t; gsize pos,out; c=g_convert(hpacc,-1,"ISO8859-1","UTF-8",&pos,&out,NULL); if (!c) { t=hpacc+(long)pos; c=g_convert_with_fallback(hpacc,-1,"ISO8859-1","UTF-8","?",NULL,NULL,NULL); } #else char *c = strdup(hpacc); #endif #ifdef GTK2 gchar *cx; cx=g_locale_to_utf8(hpacc,-1,NULL,NULL,NULL); if (!cx) cx = g_convert(hpacc,-1,"UTF-8","ISO8859-1",NULL,NULL,NULL); if (!cx) { fprintf(stderr,"invalid character cx in chemtool file\n"); return 1; } if (!thelayout) thelayout = gtk_widget_create_pango_layout(drawing_area,cx); pango_layout_set_text(thelayout, cx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &cw, NULL); tlen =cw; #else for (k=0;k<(int)strlen(hpacc);k++){ cw=gdk_char_width(font[fontsize],(gchar)hpacc[k]); tlen+=1.3*cw; if (hpacc[k]==' ') tlen+=1.2*cw; } #endif fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %.2f %.2f %i %i %s\\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size, figtext.angle, figtext.font_flags, figtext.height, // figtext.length * (int)strlen (hp_a->c), 11.4*tlen, (int)(hp_a->x * fzoom - chl ), hp_a->y * fzoom + ha, c); } if (use_whiteout==1) fprintf (fp, "-6\n"); /* close block (around whiteout and label) */ } else { /* special formatting needed, every character becomes a separate entity */ figtext.sub_type = 1; /* have xfig center characters at the calculated position */ l = 0; #ifdef GTK2 if (!thelayout) thelayout = gtk_widget_create_pango_layout(drawing_area,hpacc); pango_layout_set_font_description(thelayout,font[fontsize]); n = (int) g_utf8_strlen(hpacc,-1); #else n = (int)strlen (hpacc); #endif hpacc_p=hpacc; /* first loop - determine approximate length of label after processing */ /* for sizing the compound box and optional white rectangle under text */ for (i = 0; i < n; i++) { #ifdef GTK2 if (i>0) hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; g_utf8_strncpy(&hp_ac,hpacc,1); #else hp_ac= hpacc[i]; #endif switch (hp_ac) { case '@': i++; if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #ifdef GTK2 if (i>0) hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+= tw*cfzoom; #else l+=gdk_char_width(symbfont[fontsize],hpacc[i])*fzoom; #endif break; case '#': i++; if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #ifdef GTK2 if (i>0) hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,boldfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+= tw/2.*cfzoom; #else l+=gdk_char_width(boldfont[fontsize],hpacc[i])*fzoom; #endif break; case '|': i++; #if !defined GTK2 if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #else hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); if (hp_ac=='}'|| hp_ac == '{') { i++; hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); } #endif #ifdef GTK2 g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,slfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+=tw/2.*cfzoom; #else l+=gdk_char_width(slfont[fontsize],hpacc[i])*fzoom; #endif break; case '}': case '{': break; case '_': nsub=1; i++; #if !defined GTK2 if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #else hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); if (hp_ac=='}'|| hp_ac == '{') { i++; hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); } #endif #ifdef GTK2 g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+=tw*cfzoom; #else l+=gdk_char_width(smallfont[fontsize],hpacc[i])*fzoom; #endif break; case '^': nsup=1; i++; if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+=tw*cfzoom; #else l+=gdk_char_width(smallfont[fontsize],hpacc[i])*fzoom; #endif break; default: #ifdef GTK2 g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+=tw*cfzoom; #else l+=gdk_char_width(font[fontsize],hpacc[i])*fzoom; #endif } } xpos = hp_a->x * fzoom ; #ifdef GTK2 g_utf8_strncpy(ccx,hpacc_p,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+tw *cfzoom; #else csize = gdk_char_width(font[fontsize],hpacc[0])*fzoom*2; #endif if (chl < 0) { xpos = hp_a->x * fzoom - (l-csize); } if (chl == 0) xpos = hp_a->x * fzoom - l / 2; /* glue text into compound for easier editing in xfig */ ulx = xpos -csize/2; uly = hp_a->y * fzoom - ha; lrx = xpos + l ; if (chl < 0) lrx = xpos + (l - 1); lry = hp_a->y * fzoom + ha; if (nsup != 0) uly -= ha; /* height adjustment for */ if (nsub != 0) lry += ha; /* sub- and superscript */ fprintf (fp, " 6 %i %i %i %i\n", ulx, uly, lrx, lry); /*whiteout box*/ if (use_whiteout == 1 && !latex_flag) { fprintf (fp, " 2 2 0 1 7 7 95 0 20 1 0 0 5 0 0 5\n"); fprintf (fp, "%i %i\n", ulx, uly); fprintf (fp, "%i %i\n", lrx, uly); fprintf (fp, "%i %i\n", lrx, lry); fprintf (fp, "%i %i\n", ulx, lry); fprintf (fp, "%i %i\n", ulx, uly); } /* second loop - for each character, determine its width, draw it and advance the text position */ nsub=nsup=0; hpacc=hpacc_p; for (i = 0; i < n; i++) { csize=0.; offset = 0; fontshrink = 0; if (hp_a->font == 0) figtext.font = 16; /*Helvetica */ else figtext.font = 0; /* Times */ /*default: regular character */ #ifdef GTK2 g_utf8_strncpy(&hp_ac,hpacc,1); #else hp_ac= hpacc[i]; #endif #ifdef GTK2 if (i>0) hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) {fprintf(stderr,"eos1\n"); break; } hp_ac= g_utf8_get_char(hpacc); if (!hp_ac) {fprintf(stderr,"eos2\n"); break; } g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; /* convert from screen font width to xfig character size */ #else csize = (1+gdk_char_width(font[fontsize],hp_ac)) * cfzoom; #endif if (shifted != 0) /* if sub- or superscripting already in progress */ { if (hp_ac == '}') /* end of sub/superscript, reset flag and treat next character as normal */ { shifted = 0; offset = 0; i++; if (i >= n) break; #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(font[fontsize],hp_ac)) * fzoom; #endif } else /* still sub- or superscripting */ { offset = shifted; #ifdef GTK2 g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(smallfont[fontsize],hp_ac)) * fzoom; #endif } } if (hp_ac == '_') { #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(smallfont[fontsize],hpacc[i+1])) * fzoom; #endif offset = ha / 2; nsub = nsub + 1; if (nsub == 1) { if (nsup > 0) xpos = savedpos; else savedpos = xpos; } nsup = 0; } if (hp_ac == '^') { offset = -ha; /* offset = -ha / 2;*/ #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(smallfont[fontsize],hpacc[i+1])) * fzoom; #endif nsup = nsup + 1; if (nsup == 1) { if (nsub > 0) xpos = savedpos; else savedpos = xpos; } nsub = 0; } if (offset != 0) { if (shifted == 0) { i++; if (hp_ac == '{') { shifted = offset; i++; #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(smallfont[fontsize],hp_ac)) * fzoom; #endif } } if (i >= n) break; if (hp_ac != '-' && hp_ac != '+') fontshrink = 4; offset = offset * 2; /* xpos -= csize*.75;*/ #if !defined(GTK2) xpos -= csize*.35; #endif } else { /*reset sub- and superscript counters */ nsub = 0; nsup = 0; } if (hp_ac == '@') { figtext.font = 32; #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(symbfont[fontsize],hpacc[i+1])) * fzoom; i++; #endif } if (hp_ac == '|') { if (figtext.font <16) figtext.font = 1; /* Times Italic */ else figtext.font = 17; /* Helvetica Oblique */ #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,slfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+2*gdk_char_width(slfont[fontsize],hpacc[i+1])) * fzoom; #endif if (chl > 0) xpos-= csize; i++; } if (hp_ac == '#') { if (figtext.font < 16) figtext.font = 2 ; /* Times Bold */ else figtext.font = 18; /* Helvetica Bold */ #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,boldfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(boldfont[fontsize],hpacc[i+1])) * fzoom; #endif if (chl > 0) xpos-= csize; i++; } if (i>0)xpos += csize/2.; //advance to center of this character if (latex_flag) { #ifdef GTK2 if (figtext.font == 32 /* use TeX names for symbols */ || (unsigned char) hp_ac > 128 || hp_ac=='%' || hp_ac =='$' || hp_ac=='+' || hp_ac=='-') #else if (figtext.font == 32 /* use TeX names for symbols */ || (unsigned char) hpacc[i] > 128 || hpacc[i]=='%' || hpacc[i]=='$' || hpacc[i]=='+' || hpacc[i]=='-') #endif { #ifdef GTK2 switch ((unsigned char)hp_ac) #else switch ((unsigned char) hpacc[i]) #endif { case 'a': strcpy (symbol, "$\\\\alpha$"); break; case 'b': strcpy (symbol, "$\\\\beta$"); break; case 'c': strcpy (symbol, "$\\\\chi$"); break; case 'd': strcpy (symbol, "$\\\\delta$"); break; case 'e': strcpy (symbol, "$\\\\varepsilon$"); break; case 'f': strcpy (symbol, "$\\\\phi$"); break; case 'g': strcpy (symbol, "$\\\\gamma$"); break; case 'h': strcpy (symbol, "$\\\\eta$"); break; case 'i': strcpy (symbol, "$\\\\iota$"); break; case 'j': strcpy (symbol, "$\\\\varphi$"); break; case 'k': strcpy (symbol, "$\\\\kappa$"); break; case 'l': strcpy (symbol, "$\\\\lambda$"); break; case 'm': strcpy (symbol, "$\\\\mu$"); break; case 'n': strcpy (symbol, "$\\\\nu$"); break; case 'p': strcpy (symbol, "$\\\\pi$"); break; case 'q': strcpy (symbol, "$\\\\theta$"); break; case 'r': strcpy (symbol, "$\\\\rho$"); break; case 's': strcpy (symbol, "$\\\\sigma$"); break; case 't': strcpy (symbol, "$\\\\tau$"); break; case 'u': strcpy (symbol, "$\\\\upsilon$"); break; case 'v': strcpy (symbol, "$\\\\varpi$"); break; case 'w': strcpy (symbol, "$\\\\omega$"); break; case 'x': strcpy (symbol, "$\\\\xi$"); break; case 'y': strcpy (symbol, "$\\\\psi$"); break; case 'z': strcpy (symbol, "$\\\\zeta$"); break; case 'C': strcpy (symbol, "X"); break; case 'D': strcpy (symbol, "$\\\\Delta$"); break; case 'F': strcpy (symbol, "$\\\\Phi$"); break; case 'G': strcpy (symbol, "$\\\\Gamma$"); break; case 'J': strcpy (symbol, "$\\\\vartheta$"); break; case 'L': strcpy (symbol, "$\\\\Lambda$"); break; case 'P': strcpy (symbol, "$\\\\Pi$"); break; case 'Q': strcpy (symbol, "$\\\\Theta$"); break; case 'R': strcpy (symbol, "P"); break; case 'S': strcpy (symbol, "$\\\\Sigma$"); break; case 'U': strcpy (symbol, "$\\\\Upsilon$"); break; case 'V': strcpy (symbol, "$\\\\varsigma$"); break; case 'W': strcpy (symbol, "$\\\\Omega$"); break; case 'X': strcpy (symbol, "$\\\\Xi$"); break; case 'Y': strcpy (symbol, "$\\\\Psi$"); break; case (unsigned char) 173: strcpy (symbol, "$\\\\uparrow$"); break; case (unsigned char) 175: strcpy (symbol, "$\\\\downarrow$"); break; case (unsigned char) 174: strcpy (symbol,"$\\\\textregistered$"); break; case '%': strcpy (symbol, "\\\\%"); break; case '$': strcpy (symbol, "\\\\$"); break; case (unsigned char) 176: strcpy(symbol, "$^{\\\\circ}$"); break; case (unsigned char) 177: strcpy(symbol, "$\\\\pm$"); break; case (unsigned char) 169: strcpy(symbol, "$\\\\copyright$"); break; case '+': strcpy(symbol,"$\\oplus$"); break; case '-': strcpy(symbol,"$\\ominus$"); break; default: fprintf (stderr, "no translation for %d\n", (unsigned char) hpacc[i]); symbol[0] = hpacc[i]; symbol[1] = '\0'; break; } fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %f %f %i %i %s \\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size - fontshrink, figtext.angle, figtext.font_flags, figtext.height, figtext.length, xpos, hp_a->y * fzoom + ha + offset, symbol); } else { fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %f %f %i %i %c\\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size - fontshrink, figtext.angle, figtext.font_flags, figtext.height, figtext.length, xpos, hp_a->y * fzoom + ha + offset, hpacc[i]); } } else { /* not in LaTeX mode */ fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %f %f %i %i %c\\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size - fontshrink, figtext.angle, figtext.font_flags, figtext.height, (double)csize, xpos, hp_a->y * fzoom + ha + offset, hp_ac); if ((hp_ac=='+' || hp_ac=='-') && figtext.font == 32) //ionic charge symbol: add its circle fprintf(fp,"1 3 0 2 0 7 50 -1 -1 0.000 1 0.0000 %i %i %i %i %i %i %i %i\n", xpos,hp_a->y*fzoom+ha/2-2+offset, (figtext.font_size-fontshrink)*6, (figtext.font_size-fontshrink)*6,xpos,hp_a->y*fzoom+ha/2-2+offset, xpos+((figtext.font_size-fontshrink)*6), hp_a->y*fzoom+ha/2-2+offset); } xpos += csize/2.; //advance from center to end of character box } /*for i */ fprintf (fp, "-6\n"); /* close this compound */ } #ifdef GTK2 n = (int) g_utf8_strlen(hpacc,-1); #else n = (int)strlen (hpacc); #endif for (i = 0; i < n; ++i) if (hpacc[i] == ' ') hpacc[i] = '\\'; } if (hpacc_p) { free(hpacc_p); hpacc_p=NULL; } hp_a = hp_a->next; } free(ccx); figline.pen_color = 0; /* reset after linedrawing */ hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (mark.flag == 1 && hp_sp->marked == 0) { } else { figline.pen_color=hp_sp->color; figline.fill_color=hp_sp->color; xfig_spline (fp, hp_sp->x0 * fzoom, hp_sp->y0 * fzoom, hp_sp->x1 * fzoom, hp_sp->y1 * fzoom, hp_sp->x2 * fzoom, hp_sp->y2 * fzoom, hp_sp->x3 * fzoom, hp_sp->y3 * fzoom, hp_sp->type, latex_flag); } hp_sp = hp_sp->next; } return (rval); } int export_xfig (char *filename) /* initiate exporting of the current molecule in plain XFig format */ { FILE *xfile; int rval; if ((int)strlen (filename)) { xfile = fopen (filename, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (fclose (xfile) != 0) { perror ("could not close fig file"); return (1); } return (rval); } return (1); } int export_latex_pic (char *filename, float scale) /* export molecule as a pictex file by writing a temporary XFig file and postprocessing that with fig2dev */ { char com[255]; FILE *xfile; int rval; if (figversion == 0) return (1); /* cannot export without fig2dev */ if ((int)strlen (filename)) { snprintf (com,255, "fig2dev -Lpictex -m %f > \"%s\"", scale, filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 1); if (pclose (xfile) != 0) return (1); return (rval); } else return (1); } int export_ps_pic (char *filename, float scale) /* export molecule as a postscript file by writing a temporary XFig file and postprocessing that with fig2dev */ { char com[255]; FILE *xfile; int rval; char *epso[4] = {" ","-A","-T","-C"}; char intl[3]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if (figversion == 0) return (1); /* cannot export without fig2dev */ if (use_intlchars) strcpy(intl,"-j"); else strcpy(intl,""); if ((int)strlen (filename)) { if (figversion == 1) snprintf (com,255, "fig2dev %s -Lps -m %f > \"%s\"", intl, scale, filename); else if (figversion == 2) snprintf (com,255, "fig2dev %s -L eps -m %f > \"%s\"", intl, scale, filename); else snprintf (com,255, "fig2dev %s -L eps %s -m %f -g \\%s> \"%s\"", intl,epso[epsoption], scale, bghexcolor, filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (rval != 0) return (rval); rval=pclose(xfile); if (rval != 0) return (1); else return (rval); } else return (1); } int export_png_pic (char *filename, float scale) /* export molecule as a png file by writing a temporary XFig file and postprocessing that with fig2dev */ { char com[255]; FILE *xfile; int rval; char intl[3]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if (figversion == 0) return (1); /* cannot export without fig2dev */ if (use_intlchars) strcpy(intl,"-j"); else strcpy(intl,""); if ((int)strlen (filename)) { if (figversion == 1) snprintf (com,255, "fig2dev %s -Lpng -m %f > \"%s\"", intl, scale, filename); else if (figversion == 2) snprintf (com,255, "fig2dev %s -L png -S 4 -F -m %f > \"%s\"", intl, scale, filename); else snprintf (com,255, "fig2dev %s -L png -g \\%s -S 4 -F -m %f > \"%s\"", intl, bghexcolor, scale, filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (rval != 0) return (rval); rval=pclose(xfile); if (rval != 0) return (1); else return (rval); } else return (1); } int print_ps_pic () /* Print molecule to a postscript printer by creating an XFig datastream and postprocessing that with fig2dev */ { char com[255]; int rval; FILE *xfile; char intl[3]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if (figversion == 0) return (1); /* cannot print without fig2dev */ if (use_intlchars) strcpy(intl,"-j"); else strcpy(intl,""); if (figversion == 1) snprintf (com,255, "fig2dev %s -L ps -z %s -P %s -e -m %f | %s%s", intl,paper[papersize], orientation[orient], printscale, printcommand[printcmd], queuename); else if (figversion == 2) snprintf (com,255, "fig2dev %s -L ps -z %s %s -e -m %f | %s%s", intl,paper[papersize], orientation[orient], printscale, printcommand[printcmd], queuename); else snprintf (com,255, "fig2dev %s -L ps -g \\%s -z %s %s -e -m %f | %s%s", intl,bghexcolor,paper[papersize], orientation[orient], printscale, printcommand[printcmd], queuename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (rval != 0) return (rval); rval=pclose(xfile); if (rval != 0) return (1); else return (rval); } int export_fw (char *filename) /* save file and postprocess it with cht */ { char com[255]; char xfile[512]; int rval; FILE *chtpipe; FILE *fp; int fd; if ((int)strlen (filename)) { strcpy (xfile, "/tmp/chtXXXXXX"); /*@ignore@ splint does not recognize mkstemp */ fd = mkstemp (xfile); /*@end@*/ if (fd == -1) return 1; snprintf (com,255, "cht %s", xfile); fp = fdopen (fd, "w"); save_mol (fp, mark.flag); fclose (fp); chtpipe = popen (com, "r"); if (!chtpipe) return (1); rval = fscanf (chtpipe, "%20s %20s %20s %64s", formula, weight, eweight, compos); rval = pclose (chtpipe); unlink (xfile); return (rval); } else return (1); } int readrc () { FILE *fp; int i; char key[20], value[100]; char line[80]; gchar *filename; char *epso[4] = { "None","EPSI","TIFFm","TIFFc" }; filename = g_malloc (PATH_MAX + 1); filename = strncat (strncpy (filename, g_get_home_dir (), PATH_MAX), "/.chemtoolrc", PATH_MAX); fp = fopen (filename, "r"); if (!fp) { g_free (filename); return 1; } else { while (!feof (fp)) { if (fgets (line, (int)sizeof (line), fp)) { i = sscanf (line, "%s %s", key, value); if (i < 2) continue; if (!strcmp (key, "orientation")) { if (!strcmp (value, "portrait")) orient = 0; else orient = 1; } if (!strcmp (key, "papersize")) { for (i = 0; i < 11; i++) if (!strcmp (value, paper[i])) papersize = i; } if (!strcmp (key, "printcommand")) { for (i = 0; i < (int)strlen (value); i++) if (value[i] == '\\') value[i] = ' '; for (i = 0; i < 3; i++) if (!strcmp (value, printcommand[i])) printcmd = i; } if (!strcmp (key, "printer")) strcpy (queuename, value); if (!strcmp (key, "printscale")) printscale = atof (value); if (!strcmp (key, "epsoption")) for (i = 0; i < 4; i++) { if (!strcmp (value, epso[i])) epsoption = i; } if (!strcmp (key, "whiteout")) use_whiteout = atoi (value); if (!strcmp (key, "intlchars")) use_intlchars = atoi (value); if (!strcmp (key, "datadir")) strcpy (datadir, value); if (!strcmp (key, "extension")) strcpy (datamask, value); if (!strcmp (key, "bondlength")){ bondlen_mm= atof(value); if (bondlen_mm != 0 && bondlen_mm != 10.668) size_factor*=bondlen_mm/10.668; } if (!strcmp (key, "double_separation")){ db_dist = atoi(value); if (db_dist <= 0 || db_dist >100) db_dist=4; mb_dist = (int) ( ( (float)db_dist )* 2.5 ); } if (!strcmp (key, "background")){ i=sscanf(value,"(%d,%d,%d)",&bgred,&bggreen,&bgblue); if (i<3) bgred=bggreen=bgblue=65535; } } } fclose (fp); g_free (filename); return 0; } } int writerc () { FILE *fp; char *pcomm[4] = { "lpr\\-P", "lp\\-d", "kprinter -d","gtklp -d"}; char *ori[2] = { "portrait", "landscape" }; char *epso[4] = { "None","EPSI","TIFFm","TIFFc" }; gchar *filename; filename = g_malloc (PATH_MAX + 1); filename = strncat (strncpy (filename, g_get_home_dir (), PATH_MAX), "/.chemtoolrc", PATH_MAX); fp = fopen (filename, "w"); if (!fp) { g_free (filename); return 1; } else { fprintf (fp, "datadir %s\n", datadir); fprintf (fp, "extension %s\n", datamask); fprintf (fp, "papersize %s\n", paper[papersize]); fprintf (fp, "orientation %s\n", ori[orient]); fprintf (fp, "printscale %f\n", printscale); fprintf (fp, "printcommand %s\n", pcomm[printcmd]); fprintf (fp, "printer %s\n", queuename); fprintf (fp, "bondlength %6.4f\n", bondlen_mm); fprintf (fp, "double_separation %d\n", db_dist); fprintf (fp, "epsoption %s\n", epso[epsoption]); fprintf (fp, "whiteout %d\n", use_whiteout); fprintf (fp, "intlchars %d\n", use_intlchars); fprintf (fp, "background (%d,%d,%d)\n", bgred,bggreen,bgblue); fclose (fp); g_free (filename); return 0; } } void check_fig2dev () { char cmd[20]; FILE *xfile; float version; float ref=3.2; int pl; int rval; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif snprintf (cmd,20, "fig2dev -V"); xfile = popen (cmd, "r"); rval = fscanf (xfile, "%*s %*s %f %*s %d", &version, &pl); rval = pclose (xfile); if (rval != 0) figversion = 0; /* fig2dev not found */ else { if (version < ref || (version == ref && pl < 3)) figversion = 1; /* "old" fig2dev, needs -Lps */ else figversion = 2; /* new fig2dev, knows -L eps */ if (version > ref || (version == ref && pl >3)) figversion = 3; /* 3.2.4 can generate previews in eps file */ } } void check_babel () { char cmd[20]; char data[80]; FILE *xfile; /* float version;*/ int rval; int start=0; int obmajor=0,obminor=0,obrel=0; babelin=-1; babelout=-1; memset(data,'\0',80); snprintf (cmd,20, "babel 2>/dev/null"); xfile = popen (cmd, "r"); if (!xfile)return; if (!fgets (data,80,xfile)){ pclose(xfile); return; } if (!strncmp(data,"Open",4)) { /* OpenBabel 1.x */ strcpy(babeloutp,"--"); sscanf(data,"%*s %*s %d.%d.%d",&obmajor,&obminor,&obrel); if (obmajor*10000+obminor*10+obrel >= 11001) { rval=pclose(xfile); snprintf(cmd,20,"babel -H"); xfile = popen (cmd, "r"); } } else if (!strncmp(data,"No output",9)) { /* OpenBabel 2.x */ strcpy(babeloutp,"--"); rval=pclose(xfile); snprintf(cmd,20,"babel -H"); xfile = popen (cmd, "r"); } else /* original babel 1.6 */ strcpy(babeloutp,"CON"); while (!feof(xfile)) { if (fgets (data,80,xfile)) { if (!strncmp(data,"Currently",9)|| !strncmp(data,"The following",13)) { start=1; break; } } } if (start == 0) { rval = pclose(xfile); snprintf(cmd,20,"babel -L formats"); xfile = popen (cmd, "r"); start = 1; } babelin=-1; inmode=NULL; intype=NULL; babelout=-1; outmode=NULL; outtype=NULL; if (start==1){ while (!feof(xfile)){ (void)fgets (data, 80, xfile); if (feof(xfile)) break; if (!strncmp(data,"Currently",9)|| !strncmp(data,"See further",11)) { stop=1; babelin--; babelout--; break; }else if (strstr(data,"Write-only")==NULL) { babelin++; inmode = realloc (inmode, (babelin + 1) * sizeof (char *)); inmode[babelin] = malloc (9 * sizeof (char)); intype = realloc (intype, (babelin + 1) * sizeof (char *)); intype[babelin] = malloc (39 * sizeof (char)); sscanf(data,"%s -- %36[a-zA-Z0-9 -]",inmode[babelin],intype[babelin]); } if (strstr(data,"Read-only")==NULL) { babelout++; outmode = realloc (outmode, (babelout + 1) * sizeof (char *)); outmode[babelout] = malloc (10 * sizeof (char)); outtype = realloc (outtype, (babelout + 1) * sizeof (char *)); outtype[babelout] = malloc (39 * sizeof (char)); sscanf(data,"%s -- %36[a-zA-Z0-9 -]",outmode[babelout],outtype[babelout]); } } } rval = pclose (xfile); if (rval != 0 && babelin <=0 ) fprintf(stderr,_("Consider installing Babel/OpenBabel for file format conversions...\n")); #if 0 else { for (start=0;start<=babelin;start++) fprintf(stderr,"BABEL input %s : %s\n",inmode[start],intype[start]); for (start=0;start<=babelout;start++) fprintf(stderr,"BABEL output %s : %s\n",outmode[start],outtype[start]); } #endif } int export_sxd (char *filename) /* export molecule as a pictex file by writing a temporary XFig file and postprocessing that with fig2sxd */ { char com[255]; FILE *xfile; int rval; if (have_fig2sxd == 0) return (1); /* cannot export without fig2sxd */ if ((int)strlen (filename)) { snprintf (com,255, "fig2sxd - \"%s\"", filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (pclose (xfile) < 0) return (1); return (rval); } else return (1); } void check_fig2sxd () { char cmd[20]; FILE *xfile; char myname[10]; have_fig2sxd = 0; snprintf (cmd,20, "fig2sxd 2>&1"); xfile = popen (cmd, "r"); if (!xfile) return; fscanf (xfile, "%s", myname); pclose (xfile); if (!strncmp(myname,"fig2sxd",7)) have_fig2sxd = 1; } int export_babel (char *filename) /* export molecule by writing a temporary molfile and postprocessing that with (open)babel, adding explicit hydrogens if necessary */ { char com[255]; FILE *xfile; int rval; if ((int)strlen (filename)) { snprintf (com,255, "babel -h -imol %s -o%s \"%s\"", babeloutp, babel, filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = export_mdl_mol (xfile, 1); if (pclose (xfile) < 0) return (1); return (rval); } else return (1); } int export_asy (char *filename) /* exports the current drawing to an input file for Asymptote */ { FILE *fp; int x, y, tx, ty, w, h; int x1,y1,x2,y2; float area; float factor; struct data *hp_b,*hp_bx; struct dc *hp_a; struct spline *hp_sp; struct xy_co *coord; int d, i, dd; int xbase, ybase, xside, yside, xend, yend, xlen, ylen; int unicodechar; int bond_already_tuned=0; static char asycolor[7][8]={"black","blue","green","cyan","red","magenta", "yellow"}; #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "w")) == NULL) return (1); if (mark.flag && mark.w != 0 && mark.h != 0) { w = mark.w * size_factor - 6; h = mark.h * size_factor - 6; } else { /* get true extents of drawing*/ w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { w = MAX (w, hp_a->x); if (hp_a->direct > -2) w = MAX (w, hp_a->x + (int)strlen (hp_a->c) * (6 + 2 * size_factor)); h = MAX (h, hp_a->y + 8); hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); hp_sp = hp_sp->next; } w = (int) (w * 1.1) ; h = (int) (h * 1.1) ; } // fprintf (fp, "size (%d,%d)\n\n",w,h); fprintf(fp,"import fontsize;\n"); fprintf(fp,"defaultpen(Helvetica());\n"); fprintf(fp,"picture pic;\n"); fprintf(fp,"unitsize(pic,mm);\n"); //fprintf(fp,"size (%d,0);\n",w/2); hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (mark.flag && (hp_b->smarked + hp_b->tmarked) == 0) { } else { coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 12); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; if ( !use_whiteout) { int siz,j; float lfactor=((float)calc_vector(abs(tx-x),abs(ty-y))/(832.*size_factor)); if (lfactor >1.) lfactor=1.; /* short bonds should not shrink as much, they might vanish completely */ /* extra long bonds, however, need not leave more space around labels */ i=has_label(hp_b->x,hp_b->y); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0&& hp_a->direct ==0) { if (tx>x) { int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if (strl>1) x+=strl*(siz+1); } // else // x-=(strlen(hp_a->c)-1)*fzoom*(siz+1); } int ox=x; x += (lfactor*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); y += (lfactor*(siz+1)/calc_vector(abs(tx-ox),abs(ty-y))) *(ty-y); } i=has_label(hp_b->tx,hp_b->ty); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0 ){ int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if ( hp_a->direct<-1) { if (tx>x) tx-=(strl-1)*(siz+1); // else // tx+=(strlen(hp_a->c)-1)*(siz+1); } else if ( hp_a->direct==0) { // if (tx>x) // tx-=(strlen(hp_a->c)-1)*fzoom*(siz+1); // else if (txbond) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, tx, h-ty,asycolor[hp_b->color]); } if (hp_b->bond == 5) { bond_already_tuned = 0; x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); factor=1.; hp_bx=da_root.next; for (dd = 0; dd < hp->n; dd++) { if (hp_bx->bond == 10) { if ( (abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) || (abs (hp_bx->tx * factor - tx) < 3 && abs (hp_bx->ty * factor - ty) < 3)) { coord = center_double_bond (hp_bx->x, hp_bx->y, hp_bx->tx, hp_bx->ty, db_dist); if (abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) { x1 = coord->x * factor; y1 = coord->y * factor; coord++; x2 = coord->x * factor; y2 = coord->y * factor; } else { x1 = coord->tx * factor; y1 = coord->ty * factor; coord++; x2 = coord->tx * factor; y2 = coord->ty * factor; } area = (0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1))); if (fabs (area) < 76. * factor) { x1 = tx - (int) (0.05 * (float) (ty - y)); y1 = ty + (int) (0.05 * (float) (tx - x)); x2 = tx + (int) (0.05 * (float) (ty - y)); y2 = ty - (int) (0.05 * (float) (tx - x)); } else bond_already_tuned = 1; } /* if connected to wide end of this wedge */ } /* if adjoining bond is wide */ if (hp_bx->bond == 0 && !bond_already_tuned) { if ((abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) ||(abs (hp_bx->tx * factor - tx) < 3 && abs (hp_bx->ty * factor - ty) < 3)) /* let the wedge join smoothly alongside another bond */ { coord = intersect(x,y,x1,y1,hp_bx->x*factor,hp_bx->y*factor, hp_bx->tx*factor,hp_bx->ty*factor); coord->tx = coord->x; coord->ty = coord->y; coord = intersect(x,y,x2,y2,hp_bx->x*factor,hp_bx->y*factor, hp_bx->tx*factor,hp_bx->ty*factor); x1 = coord->tx; y1 = coord->ty; x2 = coord->x; y2 = coord->y; area = 0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1)); if (fabs (area) > 3300. * factor || fabs(area) < 1750. * factor) { x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); } } /* if connected to wide end of this wedge */ } /* if adjoining bond is single, and not already adjusted */ hp_bx = hp_bx->next; } /* for dd */ fprintf (fp, "fill(pic, (%d,%d)--(%d,%d)--(%d,%d)--cycle,%s);\n", x, h-y, x1,h-y1,x2,h-y2,asycolor[hp_b->color]); /* fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", x, y, (int) (tx - 0.08 * (ty - y)), (int) (ty + 0.08 * (tx - x)), (int) (tx + 0.08 * (ty - y)), (int) (ty - 0.08 * (tx - x))); */ } if (hp_b->bond == 6) { for (i = 0; i < 8; i++) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", (int) (x + 0.125 * i * (tx - x) - 0.01 * (ty - y) * i), (int) (h-(y + 0.125 * i * (ty - y) + 0.01 * (tx - x) * i)), (int) (x + 0.125 * i * (tx - x) + 0.01 * (ty - y) * i), (int) (h-(y + 0.125 * i * (ty - y) - 0.01 * (tx - x) * i)), asycolor[hp_b->color]); } } if (hp_b->bond == 7) { fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),false),%s);\n", x+(tx-x)/10,h-(y+(ty-y)/10), x,h-y, x+(tx-x)/5,h-(y+(ty-y)/5), asycolor[hp_b->color]); fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),true),%s);\n", x+3*(tx-x)/10,h-(y+3*(ty-y)/10), x+(tx-x)/5,h-(y+(ty-y)/5), x+2*(tx-x)/5,h-(y+2*(ty-y)/5), asycolor[hp_b->color]); fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),false),%s);\n", x+5*(tx-x)/10,h-(y+5*(ty-y)/10), x+2*(tx-x)/5,h-(y+2*(ty-y)/5), x+3*(tx-x)/5,h-(y+3*(ty-y)/5),asycolor[hp_b->color]); fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),true),%s);\n", x+7*(tx-x)/10,h-(y+7*(ty-y)/10),x+3*(tx-x)/5,h-(y+3*(ty-y)/5), x+4*(tx-x)/5,h-(y+4*(ty-y)/5), asycolor[hp_b->color]); fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),false),%s);\n", x+9*(tx-x)/10,h-(y+9*(ty-y)/10),x+4*(tx-x)/5,h-(y+4*(ty-y)/5), tx,h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 8) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, (int)(x+0.8*(tx-x)), (int)(h-(y+0.8*(ty-y))),asycolor[hp_b->color]); fprintf (fp, "fill(pic, (%d,%d)--(%d,%d)--(%d,%d)--cycle,%s);\n", (int) (x + 0.8 * (tx - x)), (int) (h-(y + 0.8 * (ty - y))), (int) (x + 0.8 * (tx - x) + 0.1 * (ty - y)), (int) (h-(y + 0.8 * (ty - y) - 0.1 * (tx - x))), tx, h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 9) { int xlen = tx - x; int ylen = ty - y; float veclen = sqrt ((double)(xlen * xlen + ylen * ylen)); float scalefact=64./veclen; /* keep arrowhead size constant (64=std length)*/ int xbase = (int) (tx - 0.2 *xlen*scalefact); int ybase = (int) (ty - 0.2 *ylen*scalefact); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, xbase, h-ybase, asycolor[hp_b->color]); fprintf (fp, "fill(pic, (%d,%d)--(%d,%d)--(%d,%d)--cycle,%s);\n", tx, h-ty,(int)(xbase + 0.1 * ylen*scalefact), (int)(h-(ybase - 0.1 * xlen*scalefact)) , (int)(xbase - 0.1 * ylen*scalefact), (int)(h-(ybase + 0.1 * xlen*scalefact)), asycolor[hp_b->color] ); /*(int) (x + 0.8 * (tx - x) + 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) - 0.1 * (tx - x)), (int) (x + 0.8 * (tx - x) - 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) + 0.1 * (tx - x)));*/ } if (hp_b->bond == 11) { fprintf (fp, "draw(pic,circle((%d,%d),%d.),%s);\n", x, h-y, calc_vector (x - tx, y - ty),asycolor[hp_b->color]); } if (hp_b->bond == 10) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s+squarecap+linewidth(10));\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 12) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s+dotted);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 13) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),rgb(%.3f,%.3f,%.3f)+squarecap+linewidth(3));\n", x + (tx - x) / 4, h-(y + (ty - y) / 4), tx - (tx - x) / 4, h-(ty - (ty - y) / 4), bgred/65535.,bggreen/65535.,bgblue/65535.); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 4) { coord = center_double_bond (x, y, tx, ty, db_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord++; fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 1 || hp_b->bond == 3) { coord = multi_bonds (x, y, tx, ty, mb_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 2 || hp_b->bond == 3) { coord = multi_bonds (tx, ty, x, y, mb_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty,asycolor[hp_b->color]); } if (hp_b->bond == 14) { coord = multi_bonds (x, y, tx, ty, mb_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s+longdashed);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 15) { coord = multi_bonds (tx, ty, x, y, mb_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s+longdashed);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 16) { coord = center_double_bond (x, y, tx, ty, db_dist); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; coord++; for (i = 0; i < 10; i++) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", (int) (x + 0.1 * i * (tx - x)), (int) (h-(y + 0.1 * i * (ty - y))), (int) (coord->x + 0.1 * i * (coord->tx - coord->x)), (int) (h-(coord->y + 0.1 * i * (coord->ty - coord->y))), asycolor[hp_b->color]); } } if (hp_b->bond == 18) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); coord = center_double_bond (x, y, tx, ty, db_dist+1); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord++; fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 19) { int tmpx1,tmpx2,tmpy1,tmpy2,tmptx1,tmptx2,tmpty1,tmpty2; coord = center_double_bond (x, y, tx, ty, db_dist+1); tmpx1=coord->x; tmpy1=coord->y; tmptx1=coord->tx; tmpty1=coord->ty; coord++; tmpx2=coord->x; tmpy2=coord->y; tmptx2=coord->tx; tmpty2=coord->ty; coord = center_double_bond (tmpx1, tmpy1, tmptx1, tmpty1, db_dist-1); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord++; fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord = center_double_bond (tmpx2, tmpy2, tmptx2, tmpty2, db_dist-1); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord++; fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } } hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (mark.flag && hp_a->marked == 0) { } else { fprintf(fp,"frame f;\n"); fprintf (fp,"label(f,\"$\\mathrm{"); for (i = 0; i < (int)strlen (hp_a->c); ++i) { if (hp_a->c[i] == '\\') hp_a->c[i] = ' '; if (hp_a->c[i] == '@') { unicodechar=848+hp_a->c[++i]; switch (unicodechar){ /* catch sequence mismatches with X Symbol font*/ case 915: /*C*/ case 947: /*c*/ unicodechar+=20; break; case 918: case 950: /*f*/ unicodechar+=16; break; case 919: case 951: /*g*/ unicodechar-=4; break; case 920: case 952: /*h*/ unicodechar-=1; break; case 922: /*J is vartheta*/ unicodechar=977; break; case 954: /*j is varphi*/ unicodechar=981; break; case 923: case 924: case 925: case 955: case 956: case 957: unicodechar-=1; break; case 926: /*N*/ unicodechar=78; break; case 958: /*n*/ unicodechar=118; break; case 929: /*Q*/ unicodechar=920; break; case 961: /*p*/ unicodechar=952; break; case 962: unicodechar-=1; break; case 966:/*v*/ unicodechar=982; break; case 967: /*w*/ unicodechar=969; break; case 968: unicodechar=958; break; case 969: unicodechar-=1; break; case 970: unicodechar=950; break; case 930: /*R*/ unicodechar-=1; break; case 934: /*V*/ unicodechar=962; break; case 935: /*W*/ unicodechar+=2; break; case 936: /*X*/ unicodechar=926; break; case 937: /*Y*/ unicodechar-=1; break; case 938: unicodechar=90; break; case 1031: case 775: /* bullet */ unicodechar=8226; break; case 891: //oplus unicodechar=8853; break; case 893: //ominus unicodechar=8854; break; default: break; } fprintf (fp, "&#%04d;", unicodechar); /*FIXME: unicode greek does not always map to X11 Symbol, e.g. F is Z not Phi */ } else if (hp_a->c[i] == '#') { fprintf (fp, "{\\bf "); fprintf (fp, "%c", hp_a->c[++i]); fprintf (fp, "}"); } else if (hp_a->c[i] == '|') { fprintf (fp, "{\\it"); fprintf (fp, "%c", hp_a->c[++i]); fprintf (fp, "}"); } else fprintf (fp, "%c", hp_a->c[i]); } if (hp_a->c[i]==' ') /* protect blanks again after output */ hp_a->c[i]='\\'; } fprintf( fp,"}$\",NoAlign,%s);\n",asycolor[hp_a->color]); switch (hp_a->direct) { case 0: fprintf (fp, "add(pic,f,(%d%s,%d));\n",hp_a->x,"+(max(f).x-min(f).x)/2.5",h-hp_a->y); break; case -1: fprintf (fp, "add(pic,f,(%d,%d));\n",hp_a->x,h-hp_a->y); break; case -2: fprintf (fp, "add(pic,f,(%d%s,%d));\n",hp_a->x,"-(max(f).x-min(f).x)/4",h-hp_a->y); break; } hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (mark.flag == 1 && hp_sp->marked == 0) { } else { if (hp_sp->type == -1) fprintf (fp, "fill (pic, (%d,%d)..", hp_sp->x0, h-hp_sp->y0); else fprintf (fp, "draw (pic, (%d,%d)..", hp_sp->x0, h-hp_sp->y0); fprintf (fp, "controls (%d,%d) and (%d,%d)..(%d,%d)", hp_sp->x1, h-hp_sp->y1, hp_sp->x2, h-hp_sp->y2, hp_sp->x3, h-hp_sp->y3); /* fprintf (fp, "x0, h-hp_sp->y0); fprintf (fp, "C %d,%d %d,%d %d,%d\"\n", hp_sp->x1, h-hp_sp->y1, hp_sp->x2, h-hp_sp->y2, hp_sp->x3, h-hp_sp->y3); */ switch (hp_sp->type) { case 0: case 1: case 2: fprintf (fp, ",%s);\n",asycolor[hp_sp->color]); break; ;; case -2: fprintf (fp, ",%s+longdashed);\n",asycolor[hp_sp->color]); break; ;; case -1: fprintf (fp, "--cycle,%s);\n",asycolor[hp_sp->color]); } if (hp_sp->type > 0) { xbase = (int) (0.7 * 0.7 * 0.7 * (double) hp_sp->x3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->x2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->x1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->x0); ybase = (int) (0.7 * 0.7 * 0.7 * (double) hp_sp->y3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->y2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->y1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->y0); xlen = hp_sp->x3 - xbase; ylen = hp_sp->y3 - ybase; if (xlen != 0) xlen = (int) copysign (50., (double)xlen); if (ylen != 0) ylen = (int) copysign (50., (double)ylen); xside = (int) (xbase + 0.15 * ylen); yside = (int) (ybase - 0.15 * xlen); if (hp_sp->type == 1) { xend = (int) (xbase - 0.15 * ylen); yend = (int) (ybase + 0.15 * xlen); x = (xside - hp_sp->x0) * (xside - hp_sp->x0) + (yside - hp_sp->y0) * (yside - hp_sp->y0); tx = (xend - hp_sp->x0) * (xend - hp_sp->x0) + (yend - hp_sp->y0) * (yend - hp_sp->y0); if (tx > x) { xside = xend; yside = yend; } xend = xbase; /*on baseline */ yend = ybase; } else { xend = (int) (xbase - 0.15 * ylen); yend = (int) (ybase + 0.15 * xlen); } fprintf (fp, "fill (pic, (%d,%d)--(%d,%d)--(%d,%d)--cycle,%s);\n", hp_sp->x3, h-hp_sp->y3, xside, h-yside, xend, h-yend, asycolor[hp_sp->color]); } } hp_sp = hp_sp->next; } fprintf(fp,"add(pic);\n"); if (strcmp(bghexcolor,"#ffffff")) fprintf(fp,"shipout(bbox(pic,2mm,Fill(rgb %.3f,%.3f,%.3f)));\n",bgred/65535.,bggreen/65535.,bgblue/65535.); fclose (fp); return (0); } chemtool-1.6.14/using_chemtool.html0000644000175000001440000005233310715417303016542 0ustar martinusers Using Chemtool

Using Chemtool

1.6.11

Chemtool is a program for drawing organic molecules. It runs under the X Window System using the GTK widget set.

Most operations in chemtool can be accomplished using the mouse - the first (usually the left) button is used to select or place things, the middle button modifies properties (e.g. reverses the direction of a bond), and the right button is used to delete objects.

The program offers essentially unlimited undo/redo, two text fonts plus symbols, seven colors, drawing at several zoom scales, and square and hexagonal backdrop grids for easier alignment.

Drawing of bonds:

Bonds can be drawn in 4 different angle settings - hexagon with 30 degree intervals, two pentagons with 72 degree intervals (in different orientations), and a 45 degree octagon). Intermediate angles are possible in all of these modes as well - just ignore the marker points in this case.

Pressing the first (left) mouse button sets the starting point of a bond and also displays a set of markers at the appropriate angular positions. Dragging the mouse while holding down the button draws a line in the desired direction.

The bond style chooser in the center of the button bar determines the type of bond that is drawn - initially, this is a single bond. If you want to change the type of a bond later, either click on it with the middle button of your mouse to advance to the next type(s), or select the appropriate type in the chooser and then switch to bondtype mode and pick all bonds that you want to change over to the new type. Pressing the middle mousebutton on a bond when in 'Bondtype' mode reverses the direction of that bond.

The bond types available in chemtool are

  • a single bond
  • a double bond (with one line shorter than the other)
  • a double bond (having the shorter line on the opposite side)
  • a centered double bond
  • a triple bond (with the flanking lines shorter than the center)
  • a wedge-shaped bond
  • a dashed wedge-shaped bond
  • a wavy line
  • a dashed wide line
  • a half arrow
  • an arrow
  • a wide bond
  • a circle
  • a dotted line
  • a single bond that 'cuts out' a segment from any bond it crosses
  • a triple bond (with equal line lengths)
  • a quadruple bond
  • a light (unfilled) pi orbital lobe
  • a dark pi orbital lobe
The additional bond type available in the pulldown menu,
  • a curved arrow
is special insofar as no other bond type can be converted to or from this type. (it is actually a shortcut for one of the curve-drawing functions described below).

Pressing the third (usually the right) mouse button deletes the bond next to the cursor position.

Semiautomatic drawing of rings:

Rings of 3 to 12 members can be drawn easily by holding down the Ctrl key while drawing a line. This line will then become the first segment of a ring that is automatically drawn in clockwise direction. The size of the ring defaults to that appropriate for the selected drawing mode (i.e. 5, 6 or 8 sides), but it can be set on a per-ring basis by pressing Ctlr- before drawing the ring, where numbers 3-9 correspond to 3 to 9-membered rings, while 0 to 2 select 10, 11 and 12-membered rings, respectively. Newly drawn rings can be deleted by pressing Ctrl and mouse button 3 together.

Drawing of curved lines:

Curved lines for objects like arrows or orbital lobes can be drawn in spline curve mode by specifing four control points that form a bounding polygon (startpoint, two points on either side of the peak, endpoint). Of the regular bondtypes available in the Style menu, the 'single line', 'semiarrow', arrow and 'dashed line' retain their usual function, while the 'wide line' type is used to denote a filled polygon. The control points are only visible in 'Move' mode, where they can be dragged around to change the form of a curve after it is drawn.

For drawing curved arrows, there is also a predefined function in the bond style chooser. This is actually a shortcut for one of the curve drawing functions described above, with the second and third control points automatically generated. As such, it can not be converted to or from any of the conventional bond types.
(One can, however, convert it to any of the other curve types, e.g. to change the type of arrowhead). The shape of the arrow will usually need to be adjusted by shifting the control point that appears alongside it in 'Move' mode.

Inserting text:

Text written into the text box can be positioned with the cursor and may appear left, middle or right-aligned in the drawing. The font size can be selected from the chooser to the right of the text entry field, while the 't/T' button next to the text-alignment buttons lets you switch between two fonts - Helvetica for regular labels, and Times Roman for descriptions. Like the line drawings, text can be in any of the colors available on the color selector. If you want to change the color, font or alignment of a label afterwards, just choose the appropriate combination of settings and then select the desired label with the left mouse button. When the text entry area is empty, this will just update the properties without changing the text itself. When the text entry area is not empty, its contents will also replace the text of the label. Copying the text of a label to the entry area is done with the middle mouse button, while the right mouse button deletes the selected label.

There are two special characters to be used for sub- and superscripting the following character:

  '^'  to shift up (e.g. N^+ for N+)
  '_'  to shift down (e.g. CH_3 for CH3)

Curly braces {} can be used to mark sequences of characters for sub- or superscripting, e.g. C_{10}H_{22}.

The control character '|' is used to itializise the following character, as in |t-Bu (t-Bu), while the '#' character boldfaces it.

The special character '@' switches to symbol mode, which uses the standard X11 symbol font. All alphabetic keys produce the corresponding greek characters in this mode, and several other symbols are available if their standard latin1 equivalents are already mapped onto the keyboard:

    latin 1 symbol character
    yen sign  infinity
    hyphen up arrow
    macron down arrow

    The symbols 'plusminus' and 'registered' (trademark) are already in the standard font, although they are not normally available on the keyboard. Use the following commands (or add the declarations to your .xmodmaprc ) to make them available via <AltGr>+<Key> (<RightAlt>+<Key>):

     
             xmodmap -e 'keysym r = r R registered'  \
             -e 'keysym o = o O yen' \
             -e 'keysym p = p P plusminus' \
             -e 'keysym u = u U hyphen' \
             -e 'keysym d = d D macron'
    

    For 'dots-and-crosses' diagrams, the following mappings to the symbol font might be useful:
    acute -> cross (e.g. keysym x = x X acute)
    middle dot -gt; filled dot (e.g. keysym d = d D periodcentered) (using the degree sign for the open dot).

    The key sequences @+ and @- can be used to denote positive and negative ionic charges - as the conventional X11 symbol character set does not contain circled plus and minus characters, these are actually composed from the corresponding simple character and a circle of appropriate diameter.

    When you want to use symbols as sub- or superscripts, place the sub- or superscripting character before the '@' character, e.g. K_@a .

    Labeling shortcuts:

    In all bond drawing modes, several keyboard shortcuts are available to add atom symbols without having to leave drawing mode. The label is placed at the current drawing position (the endpoint of the last line drawn, or the spot last clicked on).

    The keys 'c','h','n','o','s','p' and 'r' insert the corresponding capital letter, 'l' (lowercase L) inserts 'Cl', while '1', '2', '3' insert CH,CH_2 and CH_3, respectively. The asterisk key (*) inserts a filled circle.

    Pressing the space bar once allows you to enter arbitrary labels, which will be placed at the current position when you press the Return key.

    The keys of the numeric keypad can be used to draw short 'electron pair' lines next to an element symbol - if one imagines the element symbol to be sitting on the central '5' key, each key draws the appropriate electron pair for its position. When used in combination with the Shift key, two dots are drawn instead of a line. (Simply delete one of them if you actually need an odd number of electrons.)

    For quick numbering of the atoms in a molecule, switch to one of the text modes, hold down the Control key and pick each atom in succession with the left mouse button. Numbering starts at 1, and the sequence can be reset at any time by clicking the right mouse button. If you need to use your own numbering scheme, clicking the middle button (while still holding down the Control key) makes it pick up whatever number is in the text entry field.

    Moving, rotating, flipping or scaling objects

    Using the 'Mark' button, you can easily select parts of the current drawing by enclosing them with a 'rubberband' rectangle. If you need to add atoms outside of the rectangular area to your selection, simply draw another rubberband around them while holding down the Ctrl key.

    The selected parts will appear highlighted in blue and are immediately available for

    • moving: simply drag the fragment to the desired position with the mouse while holding down the left mouse button. Pressing the Ctrl key limits movement to the horizontal, while pressing the Shift key selects vertical-only movement.
      Note: If you only want to move individual atoms or bonds, you can simply pick and drag them in 'Move' mode without having to mark them first.
    • rotating: horizontal movement of the mouse translates to smooth rotation around the pivot point selected when pressing the mouse button. Pressing the Ctrl key switches to stepwise rotation according to the angular intervals of the current drawing mode.
    • flipping (mirroring) the fragment about a horizontal or vertical mirror plane through its center: this is performed by clicking on the appropraite the menu button
    • copying : clicking on the 'Copy' menu button creates an exact copy of the selected fragment slightly offset to the original. The mark is automatically transfered to the new copy.
    • rescaling: horizontal mouse movement is translated into a smooth increase or decrease of size of the marked fragment
    • deleting : to delete the marked fragment, simply click the third (usually the right) mouse button after it is highlighted.
    • optimizing: clicking on the 'bucket and broom' symbol invokes a function that removes overlapping (duplicate) bonds and labels from the drawing and tries to straighten bonds that are almost horizontal or vertical.
    • bracketing and framing: clicking on the bracket button invokes a pop-up menu offering a choice of brackets and various boxes. The chosen item is drawn in the size and position determined by the marker box that was drawn by the user.

    Centering the drawing:

    If there is not enough space for your molecule you can put it in the middle of the sheet with the center button.

    Exporting to foreign formats:

    You can export your molecules as

    • X bitmap,
    • encapsulated PostScript (with optional preview image included)
    • SVG,
    • XFig,
    • MDL molfile,
    • PicTeX,
    • PNG,
    • EMF metafile,
    • OpenOffice SXD drawing
    • any chemical file format supported by OpenBabel (if that is installed)

    The PicTeX, EMF, PNG and Postscript output functions rely on the fig2dev program from the transfig package, while SXD output relies on fig2sxd and the chemistry-related formats (except MDL molfile) are supported through openbabel.

    You can create the outputs in different sizes according to the current zoom scale. The PicTeX and Postscript modes additionally allow scaling to an arbitrary percentage selectable on the export menu .

    To include the PicTeX-file in your LaTeX document, you will need the pictex macro package. Depending on the versions you use, you might also have to load the 'color' package in the preamble of your LaTeX file.
    If you experience 'TeX capacity exceeded' error messages, increase the extra_mem_bot parameter in your texmf.cnf file (usually located in /usr/share/texmf/web2c, /usr/local/texmf or /etc/texmf).
    Pictex is known for its unusual (by tex standards) memory requirements, and the standard settings often do not account for this (although you may find a comment a la 'change this if you use pictex' in the texmf.cnf file).
    Something like extra_mem_bot=400000 should not hurt on any moderately modern system.

    Printing:

    Since version 1.5, direct printing of diagrams to a Postscript-capable printing device (or more typically a print queue running ghostscript) is possible.

    The paper size, magnification, printer name and the print command to use (currently either lp,lpr or kprinter) can be stored in the Configuration Dialog.

    Adding previously saved figures:

    To add another molecule from a previously saved chemtool drawing, select its filename in the dialog window that comes up when you press the 'Add' button. Marking a file in the dialog automatically displays its contents in a small preview window.

    The newly added molecule is automatically made active so that it can be repositioned as desired. If you want to add it to a predefined position on another molecule, you can mark that attachment site by left-clicking on it instead of dragging the marker rectangle. A small green dot will appear at what is now the reference position for the new part. If you save molecules with such a marker set, it will in turn define their attachment site when they are added to another drawing.

    Adding one of the predefined templates:

    Choosing 'Templates' from the 'Tools' menu opens a second window with a small collection of predefined structures.

    Simply click on the image of the desired molecule to add it to your drawing. The Template window can be kept open throughout a chemtool session - if it is hidden by another window, you can move it to the front by clicking the 'Template' button in chemtool again.

    The data in the template system differ from normal chemtool drawings only by the fact that they are stored within the program, and in a slightly awkward format (x and y coordinates listed separately in the source file templates.h). These are meant to provide a convenient basis set available to all users, but not individually extendable (you can use the 'Add' function for your own structures). Please let us know if you want specific molecules added to the templates - their name or ideally a regular chemtool drawing file is all we need. (send email to martin@ruby.chemie.uni-freiburg.de)

    Importing from foreign file formats:

    Chemtool is able to import files written either in the PDB format originally used by the Protein Databank (which is now also written by most modeling packages), or in the molfile (V2000) format developed by MDL Inc. for their ISIS products.

    As both formats can contain 3D information, while chemtool at least currently does 2D drawing only, the molecule is imported as a temporary 3D image first, which can be rotated using the mouse (with Z-axis rotation initiated by pressing the Ctrl key simultaneously with the (left) mouse button 1). After pressing the Return key, the current orientation is stored as a 2D projection that can be further edited. All editing commands except zooming are disabled in 3d mode.

    The PDB import offers a choice which of the atom symbols to import - you can either import all labels, only those of non-hydrogen atoms, optionally omitting any trailing sequence numbers, or no labels at all. Bonds are read from CONECT records, if present, or guessed from the interatomic distances. In MDL import mode, C atom labels are automatically suppressed, and bond types are preserved where possible.

    If you have a version of the BABEL program installed - either the original Babel written by Pat Walters or the current OpenBabel effort - chemtool will automatically offer a menu option for importing from any of the wide range of chemical and crystallographic data formats this program supports.

    Determining sum formula and molecular weight:

    The distribution contains a helper program, cht, by Radek Liboska (Prague) to calculate sum formula and (exact) molecular weight from a chemtool drawing file. It is also available from within chemtool to calculate these data for the current structure or a marked fragment of it. Cht can be misled by duplicate bonds ( chemtool does not remove overlapping bonds, such as they might result from fusing ring systems, automatically), by reaction arrows and by the 'aromatic ring' symbol, so you should avoid these and check the plausibility of the generated sum formula where possible.

    cht recognizes the following commonly used abbreviations:

    Ac C2 H3 OAcetyl
    Ade C5 H4 N5 Adeninyl
    Bn C7 H7 Benzyl
    Bu C4 H9 Butyl
    Bz C7 H5 O Benzoyl
    BOC C5 H9 O2 Butyloxycarbonyl
    CE C3 H4 N Cyanoethyl
    Cyt C4 H4 N3 O Cytosinyl
    DBAM C9 H19 N Dibutylaminomethylene, biradical
    DMAM C3 H7 N Dimethylaminomethylen, biradical
    DMTr C21 H19 O2 Dimethoxytrityl
    Et C2 H5 Ethyl
    Gua C5 H4 N5 O Guaninyl
    iBu C4 H9 iso-Butyl
    iPr C3 H7 iso-Propyl
    Me C H3 Methyl
    Ms C H3 S O2 Mesyl
    MOC C2 H3 O2 Methoxycarbonyl
    MOM C2 H5 O Methoxymethyl
    MMTr C20 H16 O Monomethoxytrityl
    Ph C6 H5 Phenyl
    @F(greek phi) C6 H5 Phenyl
    Pr C3 H7 Propyl
    TBDMS C6 H15 Si tert-Butyldimethylsilyl
    TBDPS C16 H19 Si tert-Butyldiphenylsilyl
    tBu C4 H9 tert-Butyl
    Tf C F3 S O2 Triflyl
    Thy C5 H5 N2 O2 Thyminyl
    TMS C3 H9 Si Trimethylsilyl
    TMTr C22 H22 O3 Dimethoxytrityl
    Tol C8 H7 O Tolyl
    Tr C19 H15 Trityl
    Ts C7 H7 S O2 Tosyl
    Ura C4 H3 N2 O2 Uracilyl
    Z C8 H7 O2 Benzyloxycarbonyl

    Drawing functions not available within Chemtool:

    For features not currently supported by chemtool, like patterns or general line-drawing functions, getting Brian Smith's XFig drawing package from xfig.org is highly recommended. About the only thing it does not offer is support for 'chemical' linetypes and drawing angles - which is why chemtool was written as a sort of companion program. (There will probably be more of the most sorely needed drawing options added to chemtool over time, but duplicating the more general-purpose features of xfig seems rather pointless.)

    Licensing :

    For license information see the file 'COPYING' in this package, i.e. the GNU General Public License. This software comes with ABSOLUTELY NO WARRANTY.

    chemtool-1.6.14/Makefile.std0000644000175000001440000000164511675350474015101 0ustar martinusersPREFIX=/usr/local LOCALEDIR=/usr/share/locale UNDO=-DLIBUNDO ifdef LOCALEDIR CFLAGS=-O2 `gtk-config --cflags` -DMENU -DENABLE_NLS -DLOCALEDIR=\"${LOCALEDIR}\" ${UNDO} else CFLAGS=-O2 `gtk-config --cflags` -DMENU ${UNDO} endif CC=gcc CP=/bin/cp RM=/bin/rm -f MAKE=make SRCS = main.c chemproc.c graph.c draw.c inout.c gtkfilesel.c OBJS = main.o chemproc.o graph.o draw.o inout.o gtkfilesel.o ifdef UNDO OBJS += undo.o endif SYS_LIBRARIES = `gtk-config --libs` -lm all: chemtool cht default: all chemtool: ${OBJS} ${CC} ${OBJS} ${SYS_LIBRARIES} -o chemtool cht: src-cht/cht-2.5.c cd src-cht;${MAKE} install: chemtool src-cht/cht ${CP} chemtool src-cht/cht ${PREFIX}/bin ${CP} chemtool.1 ${PREFIX}/man/man1 ${CP} cht.1 ${PREFIX}/man/man1 ifdef LOCALEDIR for L in `ls locales`; do ${CP} locales/$$L/chemtool.mo ${LOCALEDIR}/$$L/LC_MESSAGES;done endif clean: ${RM} *.o *~ src-cht/*.o src-cht/*~ chemtool src-cht/cht chemtool-1.6.14/Makefile.sgi320000644000175000001440000000177611675350611015234 0ustar martinusersPREFIX=/usr/local LOCALEDIR=/usr/share/locale GTKCONFIGFLAGS=-I/usr/freeware/include/gtk-1.2 \ -I/usr/freeware/include/glib-1.2 \ -I/usr/freeware/lib32/glib/include CFLAGS=-mabi=n32 -fno-builtin -O2 -Wall -Wunused ${GTKCONFIGFLAGS} \ -DMENU -DENABLE_NLS CC=gcc CP=/bin/cp RM=/bin/rm -f MAKE=gmake SRCS = main.c chemproc.c graph.c draw.c inout.c OBJS = main.o chemproc.o graph.o draw.o inout.o GTKCONFIGLIBS=-mabi=n32 -L/usr/freeware/lib32 \ -lgtk -lgdk -lgmodule -lglib \ -lXi -lXext -lX11 -lm SYS_LIBRARIES = ${GTKCONFIGLIBS} -lm all: chemtool cht default: all chemtool: ${OBJS} ${CC} ${OBJS} ${SYS_LIBRARIES} -o chemtool cht: src-cht/cht-2.5.c cd src-cht;${MAKE} #.c.o: # ${CC} ${CFLAGS} ${EXTRA_INCLUDES} -c ${SRCS} install: chemtool src-cht/cht ${CP} chemtool src-cht/cht ${PREFIX}/bin ${CP} chemtool.1 ${PREFIX}/man/man1 for L in `ls locales`; do ${CP} locales/$$L/chemtool.mo \ ${LOCALEDIR}/$$L/LC_MESSAGES;done clean: ${RM} *.o *~ src-cht/*.o src-cht/*~ chemtool src-cht/cht chemtool-1.6.14/config.rpath0000755000175000001440000003521310715417303015143 0ustar martinusers#! /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-2003 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. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux*) case $CC in icc|ecc) wl='-Wl,' ;; ccc) wl='-Wl,' ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; sco3.2v5*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) wl='-Wl,' ;; sysv4*MP*) ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi4*) ;; 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*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then hardcode_direct=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10* | hpux11*) if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' case "$host_os" in aix3*) ;; aix4* | aix5*) ;; amigaos*) ;; beos*) ;; bsdi4*) ;; cygwin* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) shrext=.dylib ;; dgux*) ;; freebsd1*) ;; freebsd*) ;; gnu*) ;; hpux9* | hpux10* | hpux11*) case "$host_cpu" in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac ;; irix5* | irix6* | nonstopux*) case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux*) ;; netbsd*) ;; newsos6) ;; nto-qnx) ;; openbsd*) ;; os2*) libname_spec='$name' shrext=.dll ;; osf3* | osf4* | osf5*) ;; sco3.2v5*) ;; solaris*) ;; sunos4*) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ;; sysv4*MP*) ;; uts4*) ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < and include a 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. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 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, 2006, 2007, 2008 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 case "${UNAME_MACHINE}" in i?86) test -z "$VENDOR" && VENDOR=pc ;; *) test -z "$VENDOR" && VENDOR=unknown ;; esac test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse # 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 -q __ELF__ 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}-${VENDOR}-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-${VENDOR}-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-${VENDOR}-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-${VENDOR}-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-${VENDOR}-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-${VENDOR}-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 ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-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-${VENDOR}-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:*:[456]) 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 -q __LP64__ 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}-${VENDOR}-osf1mk else echo ${UNAME_MACHINE}-${VENDOR}-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-${VENDOR}-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-${VENDOR}-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*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-${VENDOR}-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-${VENDOR}-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-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-${VENDOR}-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-${VENDOR}-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-${VENDOR}-`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 ;; 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 -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu else echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-${VENDOR}-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-${VENDOR}-linux-gnu exit ;; padre:Linux:*:*) echo sparc-${VENDOR}-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-${VENDOR}-linux-gnu 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-${VENDOR}-linux-gnu ;; PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;; *) echo hppa-${VENDOR}-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-${VENDOR}-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-${VENDOR}-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-${VENDOR}-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu 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}-${VENDOR}-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-${VENDOR}-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-${VENDOR}-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}-${VENDOR}-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 i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-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-${VENDOR}-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; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' 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; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-${VENDOR}-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-${VENDOR}-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 ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku 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 i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; 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}-${VENDOR}-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-${VENDOR}-tops10 exit ;; *:TENEX:*:*) echo pdp10-${VENDOR}-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-${VENDOR}-tops20 exit ;; *:ITS:*:*) echo pdp10-${VENDOR}-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-${VENDOR}-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 ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros 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: chemtool-1.6.14/TODO0000644000175000001440000000064511675140052013324 0ustar martinusers - more demo structures / templates - better documentation - combining mark and move modes without losing functionality - grouping (conceptually similar to xfig's compound objects) and automatic alignment - add option for drawing "background" rectangle if format does not support setting the background color) - support user-defined colors - rewrite on-screen sub/superscript text rendering using pango markup chemtool-1.6.14/bitmap1.h0000644000175000001440000006610411571247500014345 0ustar martinusersstatic char *xpm_font[] = { " 5 24 2 1", " c None", "# c Black", " ", " ", "#####", " # ", " # ", " # ", " # ", " # ", " # ", " ", " ", " #", " ### ", "# ", " ", " ####", "# # ", " # ", " # ", " # ", " # ", " # ", " ", " " }; static char *xpm_color[8][27] = { { " 3 24 2 1", " c None", "# c Black", " ", " ", " ", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", " ", " " }, { " 3 24 2 1", " c None", "# c Blue", " ", " ", " ", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", " ", " " }, { " 3 24 2 1", " c None", "# c Green", " ", " ", " ", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", " ", " " }, { " 3 24 2 1", " c None", "# c Cyan", " ", " ", " ", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", " ", " " }, { " 3 24 2 1", " c None", "# c Red", " ", " ", " ", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", " ", " " }, { " 3 24 2 1", " c None", "# c Magenta", " ", " ", " ", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", " ", " " }, { " 3 24 2 1", " c None", "# c Yellow", " ", " ", " ", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", "###", " ", " " }, { " 3 24 2 1", " c None", "# c Black", " ", " ", " ", "###", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "# #", "###", " ", " " } }; static char *xpm_mark[] = { "24 24 3 1", " c None", "# c #0000A0", ". c #505000", " ", " ", " ", " ... ... ... ... ", " . . ", " . # . ", " # # ", " # # ", " . # #. ", " . # .# ", " . # .# ", " # # ", " # # ", " # # ", " . # .# ", " . # #. ", " . # # . ", " # # ", " # ", " . . ", " . . ", " ... ... ... ... ", " ", " " }; static char *xpm_rot[] = { "24 24 2 1", " c None", "# c #0000A0", " ", " ", " ", " ##### ", " ## ## ", " ## ## ", " # # ", " # # ", " # # ", " # # # ", " # # # ", " # ### ", " # ## ", " # ## ", " # # ", " # ", " # ", " ## ", " ## ", " #### ", " ", " ", " ", " " }; static char *xpm_mov[] = { "24 24 3 1", " c None", ". c #505000", "# c #0000A0", " ", " ", " ", " .. ", " .. .. ", " . . . . ", " . . ", " . . ", " . . ", " . ###### . ", " .... # # .... ", " . # # . ", " . # # . ", " .... # # .... ", " . ###### . ", " . . ", " . . ", " . . ", " . . . . ", " .. .. ", " .. ", " ", " ", " " }; static char *xpm_copy[] = { "24 24 3 1", ". c #505000", "# c #0000A0", " c None", " ", " ", " ", " . ", " . . ", " . . ", " . . . ", " . . . ", " . . . ", " . .. ", " . . # ", " . . . # # ", " . . . # ", " . # . . # ", " # . . # ", " # .. # ", " # .... # ", " # # ", " # # ", " # # ", " # ", " ", " ", " " }; static char *xpm_scale[] = { "24 24 3 1", ". c #505000", "# c #0000A0", " c None", " ", " . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . # ", " . # # ", " # # ", " # # ", " # # ", " # # ", " # # ", " # # ", " # # ", " # # ", " # ", " ", " ", " " }; static char *xpm_clean[] = { "24 24 3 1", " c None", "# c #0000A0", ". c #505000", " ", " ", " ", " ", " # ", " # ", " # ", " # ", " # ", " # ", " # ", " # .... ", " # ######....## ", " # # .....# ", " # # ..... ", " # # .... ", " ######### # ...# ", " # # # # # # # ", "# # # # # # ###### ", " ", " ", " ", " ", " " }; static char *xpm_horiz[] = { "24 24 3 1", " c None", ". c #505000", "# c #0000A0", " ", " ", " ", " .. ", " ", " .. ", " ## ## ", " ## .. ## ", " # # ", " # # .. # # ", " ## ## ", " ## # .. # ## ", " ### ### ", " ## .. ## ", " # # ", " .. ", " ", " .. ", " ", " .. ", " ", " .. ", " ", " " }; static char *xpm_vert[] = { "24 24 3 1", " c None", "# c #0000A0", ". c #505000", " ", " ", " ", " ###### ", " #### ", " # # ", " # # ", " # ", " # ", " # ", " # ", " . . . . . . . . . . ", " . . . . . . . . . . ", " # ", " # ", " # ", " # ", " # # ", " # # ", " #### ", " ###### ", " ", " ", " " }; static char *xpm_bracket[] = { "24 24 3 1", " c None", ". c #0000A0", "# c #505000", " ", " ", " #### #### ", " # .. # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # .. # ", " # # ", " # # ", " #### #### ", " ", " " }; static char *xpm_r_bracket[] = { "24 24 3 1", " c None", ". c #0000A0", "# c #505000", " ", " ", " ## ## ", " # .. # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # .. # ", " # # ", " # # ", " ## ## ", " ", " " }; static char *xpm_r2_bracket[] = { "24 24 3 1", " c None", ". c #0000A0", "# c #505000", " ", " ", " ## ## ", " # .. # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # .. # ", " # # ", " ## ## ", " ", " ", " " }; static char *xpm_brace[] = { "24 24 3 1", " c None", ". c #0000A0", "# c #505000", " ", " ", " ## ## ", " # .. # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", "# . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # .. # ", " # # ", " # # ", " ## ## ", " ", " " }; static char *xpm_box1[] = { "24 24 3 1", " c None", ". c #0000A0", "# c #505000", " ", " ", " ################## ", " # .. # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # .. # ", " # # ", " # # ", " ################## ", " ", " " }; static char *xpm_box2[] = { "24 24 3 1", " c None", ". c #0000A0", "# c #505000", " ", " ", " ################## ", " # .. # ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # . . ## ", " # .. ## ", " # ## ", " # ## ", " ################### ", " ################# ", " " }; static char *xpm_box3[] = { "24 24 3 1", " c None", ". c #0000A0", "# c #505000", " ", " ", " ################## ", " # .. ## ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # . . ### ", " # .. ### ", " # ### ", " # ### ", " #################### ", " ################### ", " ################# " }; static char *xpm_box4[] = { "24 24 3 1", " c None", ". c #0000A0", "# c #505000", " ", " ", " ############## ", " # .. # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # . . # ", " # .. # ", " # # ", " # # ", " ############## ", " ", " " }; static const char * xpm_hex[] = { "24 24 2 1", " c None", ". c #505000", " ", " . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . ", " ", " ", " ", " ", " "}; static const char * xpm_pent1[] = { "24 24 2 1", " c None", ". c #505000", " ", " ", " . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . ", " ", " ", " ", " ", " "}; static const char * xpm_pent2[] = { "24 24 2 1", " c None", ". c #505000", " ", " . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " ......... ", " ", " ", " ", " ", " ", " ", " "}; /* static const char * xpm_hept[] = { "24 24 2 1", " c None", ". c #505000", " ", " ", " . ", " .. .. ", " .. .. ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " ....... ", " ", " ", " ", " ", " ", " ", " "}; */ static const char * xpm_octa[] = { "24 24 2 1", " c None", ". c #505000", " ", " ", " ", " ....... ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " . . ", " ....... ", " ", " ", " ", " ", " ", " ", " "}; static const char * xpm_spline[] = { "24 24 2 1", " c None", ". c #505000", " ", " ", " .. ", " .. ", " ... ", " .. .. . ", " ... . ", " . . ", " . . ", " . . ", " . ... ", " ... .. ", " .. ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; static const char * xpm_ltext[] = { "24 24 3 1", " c None", ". c #505000", "X c #FFFFFFFFFFFF", " ", " ", " ............ ", " ", " ....... ", " ", " ......... ", " ", " ............ ", " ", " ...... ", " ", " ............... ", " ", " ........ ", " ", " .... ", " ", " ", " ", " ", " ", " ", " "}; static const char * xpm_mtext[] = { "24 24 2 1", " c None", ". c #505000", " ", " ", " ............ ", " ", " ...... ", " ", " .............. ", " ", " ........... ", " ", " .... ", " ", " .............. ", " ", " ...... ", " ", " .... ", " ", " ", " ", " ", " ", " ", " "}; static const char * xpm_rtext[] = { "24 24 2 1", " c None", ". c #505000", " ", " ", " ............ ", " ", " ....... ", " ", " ......... ", " ", " ............ ", " ", " ..... ", " ", " ............... ", " ", " ......... ", " ", " .... ", " ", " ", " ", " ", " ", " ", " "}; static const char * xpm_bond[22][12] = { { "24 9 2 1", " c None", ". c #505000", " ", " ", " ", " ", " .................. ", " ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " ", " ............ ", " ", " .................. ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " ", " .................. ", " ", " ............ ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " ............ ", " ", " .................. ", " ", " ............ ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " ", " .................. ", " ", " .................. ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " .... ", " ........ ", " ............. ", " .................. ", " ............. ", " ........ ", " .... ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " .. ", " .. .. ", " .. .. .. ", " .. .. .. .. .. ", " .. .. .. ", " .. .. ", " .. ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " .... ", " .. .. ", " .. .. .. ", " .. .. ", " .... ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " .. ", " ... ", " .................. ", " ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " .. ", " ... ", " .................. ", " ... ", " .. ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " ", " .................. ", " .................. ", " .................. ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ..... ", " .. .. ", " .. .. ", " . . ", " .. .. ", " .. .. ", " ..... ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " ", " .. .. .. .. .. ", " .. .. .. .. .. ", " .. .. .. .. .. ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " . ", " . ", " ", " ................. ", " ", " . ", " . ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " ", " ... .. ... ", " ", " .................. ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " ", " .................. ", " ", " ... .. ... ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " .. .. .. .. ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ........ ", " . . ", " . ... ", " . .. ", " . . ", " ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " ", " .................. ", " ", " .................. ", " ", " .................. ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " .................. ", " ", " .................. ", " ", " .................. ", " ", " .................. ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " .......... ", " .. . ", " .. . ", " .. . ", " .. . ", " .......... ", " ", " " },{ "24 9 2 1", " c None", ". c #505000", " ", " .......... ", " .............. ", " ................. ", " ................. ", " .............. ", " .......... ", " ", " " }}; chemtool-1.6.14/acinclude.m40000644000175000001440000002014010715417303015015 0ustar martinusers# Configure paths for GTK+ # Owen Taylor 97-11-3 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS dnl AC_DEFUN([AM_PATH_GTK], [dnl dnl Get the cflags and libraries from the gtk-config script dnl AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], gtk_config_prefix="$withval", gtk_config_prefix="") AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], , enable_gtktest=yes) for module in . $4 do case "$module" in gthread) gtk_config_args="$gtk_config_args gthread" ;; esac done if test x$gtk_config_exec_prefix != x ; then gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config fi fi if test x$gtk_config_prefix != x ; then gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_prefix/bin/gtk-config fi fi AC_PATH_PROG(GTK_CONFIG, gtk-config, no) min_gtk_version=ifelse([$1], ,0.99.7,$1) AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes else GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl dnl Now check if the installed GTK is sufficiently new. (Also sanity dnl checks the results of gtk-config to some extent dnl rm -f conf.gtktest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If gtk-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } #endif /* defined (GTK_MAJOR_VERSION) ... */ else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); printf("*** correct copy of gtk-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$GTK_CONFIG" = "no" ; then echo "*** The gtk-config script installed by GTK could not be found" echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GTK_CONFIG environment variable to the" echo "*** full path to gtk-config." else if test -f conf.gtktest ; then : else echo "*** Could not run GTK test program, checking why..." CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ #include #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" echo "*** version of GTK. If it is not finding GTK, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK was incorrectly installed" echo "*** or that you have moved GTK since it was installed. In the latter case, you" echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) chemtool-1.6.14/gtkmenu.c0000644000175000001440000016021410715417303014451 0ustar martinusers/* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * 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. */ /* * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #include #include #include #include #include #include "gtkmenu.h" #include #include #include #define MENU_ITEM_CLASS(w) GTK_MENU_ITEM_CLASS (GTK_OBJECT (w)->klass) #define MENU_NEEDS_RESIZE(m) GTK_MENU_SHELL (m)->menu_flag #define SUBMENU_NAV_REGION_PADDING 2 #define SUBMENU_NAV_HYSTERESIS_TIMEOUT 333 #define MENU_SCROLL_ARROW_HEIGHT 16 #define MENU_SCROLL_TIMEOUT 200 typedef struct _GtkMenuAttachData GtkMenuAttachData; struct _GtkMenuAttachData { GtkWidget *attach_widget; GtkMenuDetachFunc detacher; }; static void gtk_menu_class_init (GtkMenuClass *klass); static void gtk_menu_init (GtkMenu *menu); static void gtk_menu_destroy (GtkObject *object); static void gtk_menu_realize (GtkWidget *widget); static void gtk_menu_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_menu_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void gtk_menu_paint (GtkWidget *widget); static void gtk_menu_draw (GtkWidget *widget, GdkRectangle *area); static gboolean gtk_menu_expose (GtkWidget *widget, GdkEventExpose *event); static gboolean gtk_menu_key_press (GtkWidget *widget, GdkEventKey *event); static gboolean gtk_menu_motion_notify (GtkWidget *widget, GdkEventMotion *event); static gboolean gtk_menu_enter_notify (GtkWidget *widget, GdkEventCrossing *event); static gboolean gtk_menu_leave_notify (GtkWidget *widget, GdkEventCrossing *event); static void gtk_menu_stop_navigating_submenu (GtkMenu *menu); static gboolean gtk_menu_stop_navigating_submenu_cb (gpointer user_data); static gboolean gtk_menu_navigating_submenu (GtkMenu *menu, gint event_x, gint event_y); static void gtk_menu_set_submenu_navigation_region (GtkMenu *menu, GtkMenuItem *menu_item, GdkEventCrossing *event); static GdkRegion *gtk_menu_get_navigation_region (GtkMenu *menu); static void gtk_menu_set_navigation_region (GtkMenu *menu, GdkRegion *region); static guint gtk_menu_get_navigation_timeout (GtkMenu *menu); static void gtk_menu_set_navigation_timeout (GtkMenu *menu, guint timeout); static void gtk_menu_deactivate (GtkMenuShell *menu_shell); static void gtk_menu_show_all (GtkWidget *widget); static void gtk_menu_hide_all (GtkWidget *widget); static void gtk_menu_position (GtkMenu *menu); static void gtk_menu_top_position (GtkMenu *menu, gint x, gint y, gint width, gint height); static void gtk_menu_reparent (GtkMenu *menu, GtkWidget *new_parent, gboolean unrealize); static void gtk_menu_set_scrolling (GtkMenu *menu, gboolean scroll_up, gboolean scroll_down); static gboolean gtk_menu_scroll_up (GtkMenu *menu, guint scroll_count); static gboolean gtk_menu_scroll_down (GtkMenu *menu, guint scroll_count); static gboolean gtk_menu_timeout_up (gpointer data); static gboolean gtk_menu_timeout_down (gpointer data); static void gtk_menu_remove (GtkContainer *menu, GtkWidget *widget); static GtkMenuShellClass *parent_class = NULL; static const gchar *attach_data_key = "gtk-menu-attach-data"; static GQuark quark_uline_accel_group = 0; static const gchar *navigation_region_key = "gtk-menu-navigation_region"; static GQuark navigation_region_key_id = 0; static const gchar *navigation_timeout_key = "gtk-menu-navigation_timeout"; static GQuark navigation_timeout_key_id = 0; GtkType gtk_menu_get_type (void) { static GtkType menu_type = 0; if (!menu_type) { static const GtkTypeInfo menu_info = { "GtkMenu", (guint)sizeof (GtkMenu), (guint)sizeof (GtkMenuClass), (GtkClassInitFunc) gtk_menu_class_init, (GtkObjectInitFunc) gtk_menu_init, /* reserved_1 */ NULL, /* reserved_2 */ NULL, (GtkClassInitFunc) NULL, }; menu_type = gtk_type_unique (gtk_menu_shell_get_type (), &menu_info); } return menu_type; } static void gtk_menu_class_init (GtkMenuClass *class) { GtkObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; GtkMenuShellClass *menu_shell_class; GtkBindingSet *binding_set; object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; container_class = (GtkContainerClass*) class; menu_shell_class = (GtkMenuShellClass*) class; parent_class = gtk_type_class (gtk_menu_shell_get_type ()); object_class->destroy = gtk_menu_destroy; widget_class->realize = gtk_menu_realize; widget_class->draw = gtk_menu_draw; widget_class->size_request = gtk_menu_size_request; widget_class->size_allocate = gtk_menu_size_allocate; widget_class->expose_event = gtk_menu_expose; widget_class->key_press_event = gtk_menu_key_press; widget_class->motion_notify_event = gtk_menu_motion_notify; widget_class->show_all = gtk_menu_show_all; widget_class->hide_all = gtk_menu_hide_all; widget_class->enter_notify_event = gtk_menu_enter_notify; widget_class->leave_notify_event = gtk_menu_leave_notify; container_class->remove = gtk_menu_remove; menu_shell_class->submenu_placement = GTK_LEFT_RIGHT; menu_shell_class->deactivate = gtk_menu_deactivate; binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal (binding_set, GDK_Up, 0, "move_current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PREV); gtk_binding_entry_add_signal (binding_set, GDK_Down, 0, "move_current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_NEXT); gtk_binding_entry_add_signal (binding_set, GDK_Left, 0, "move_current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PARENT); gtk_binding_entry_add_signal (binding_set, GDK_Right, 0, "move_current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_CHILD); } static gboolean gtk_menu_window_event (GtkWidget *window, GdkEvent *event, GtkWidget *menu) { gboolean handled = FALSE; gtk_widget_ref (window); gtk_widget_ref (menu); switch (event->type) { case GDK_KEY_PRESS: case GDK_KEY_RELEASE: (void)gtk_widget_event (menu, event); handled = TRUE; break; default: break; } gtk_widget_unref (window); gtk_widget_unref (menu); return handled; } static void gtk_menu_init (GtkMenu *menu) { menu->parent_menu_item = NULL; menu->old_active_menu_item = NULL; menu->accel_group = NULL; menu->position_func = NULL; menu->position_func_data = NULL; menu->first_scroll_child = -1; menu->last_scroll_child = -1; menu->top_scroll_arrow_lit = FALSE; menu->bottom_scroll_arrow_lit = FALSE; menu->scroll_up_source_tag = 0; menu->scroll_down_source_tag = 0; menu->toplevel = gtk_window_new (GTK_WINDOW_POPUP); (void)gtk_signal_connect (GTK_OBJECT (menu->toplevel), "event", GTK_SIGNAL_FUNC (gtk_menu_window_event), GTK_OBJECT (menu)); gtk_window_set_policy (GTK_WINDOW (menu->toplevel), FALSE, FALSE, TRUE); gtk_container_add (GTK_CONTAINER (menu->toplevel), GTK_WIDGET (menu)); /* Refloat the menu, so that reference counting for the menu isn't * affected by it being a child of the toplevel */ GTK_WIDGET_SET_FLAGS (menu, GTK_FLOATING); menu->tearoff_window = NULL; menu->torn_off = FALSE; MENU_NEEDS_RESIZE (menu) = TRUE; } static void gtk_menu_destroy (GtkObject *object) { GtkMenu *menu; GtkMenuAttachData *data; g_return_if_fail (object != NULL); g_return_if_fail (GTK_IS_MENU (object)); menu = GTK_MENU (object); gtk_object_ref (object); data = gtk_object_get_data (object, attach_data_key); if (data) gtk_menu_detach (menu); gtk_menu_stop_navigating_submenu (menu); gtk_menu_set_accel_group (menu, NULL); if (menu->old_active_menu_item) { gtk_widget_unref (menu->old_active_menu_item); menu->old_active_menu_item = NULL; } /* Add back the reference count for being a child */ gtk_object_ref (object); gtk_widget_destroy (menu->toplevel); if (menu->tearoff_window) gtk_widget_destroy (menu->tearoff_window); if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); gtk_object_unref (object); } void gtk_menu_attach_to_widget (GtkMenu *menu, GtkWidget *attach_widget, GtkMenuDetachFunc detacher) { GtkMenuAttachData *data; g_return_if_fail (menu != NULL); g_return_if_fail (GTK_IS_MENU (menu)); g_return_if_fail (attach_widget != NULL); g_return_if_fail (GTK_IS_WIDGET (attach_widget)); g_return_if_fail (detacher != NULL); /* keep this function in sync with gtk_widget_set_parent() */ data = gtk_object_get_data (GTK_OBJECT (menu), attach_data_key); if (data) { g_warning ("gtk_menu_attach_to_widget(): menu already attached to %s", gtk_type_name (GTK_OBJECT_TYPE (data->attach_widget))); return; } gtk_object_ref (GTK_OBJECT (menu)); gtk_object_sink (GTK_OBJECT (menu)); data = g_new (GtkMenuAttachData, 1); data->attach_widget = attach_widget; data->detacher = detacher; gtk_object_set_data (GTK_OBJECT (menu), attach_data_key, data); if (GTK_WIDGET_STATE (menu) != GTK_STATE_NORMAL) gtk_widget_set_state (GTK_WIDGET (menu), GTK_STATE_NORMAL); /* we don't need to set the style here, since * we are a toplevel widget. */ } GtkWidget* gtk_menu_get_attach_widget (GtkMenu *menu) { GtkMenuAttachData *data; g_return_val_if_fail (menu != NULL, NULL); g_return_val_if_fail (GTK_IS_MENU (menu), NULL); data = gtk_object_get_data (GTK_OBJECT (menu), attach_data_key); if (data) return data->attach_widget; return NULL; } void gtk_menu_detach (GtkMenu *menu) { GtkMenuAttachData *data; g_return_if_fail (menu != NULL); g_return_if_fail (GTK_IS_MENU (menu)); /* keep this function in sync with gtk_widget_unparent() */ data = gtk_object_get_data (GTK_OBJECT (menu), attach_data_key); if (!data) { g_warning ("gtk_menu_detach(): menu is not attached"); return; } gtk_object_remove_data (GTK_OBJECT (menu), attach_data_key); data->detacher (data->attach_widget, menu); if (GTK_WIDGET_REALIZED (menu)) gtk_widget_unrealize (GTK_WIDGET (menu)); g_free (data); gtk_widget_unref (GTK_WIDGET (menu)); } GtkWidget* gtk_menu_new (void) { return GTK_WIDGET (gtk_type_new (gtk_menu_get_type ())); } void gtk_menu_append (GtkMenu *menu, GtkWidget *child) { gtk_menu_shell_append (GTK_MENU_SHELL (menu), child); } void gtk_menu_prepend (GtkMenu *menu, GtkWidget *child) { gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), child); } void gtk_menu_insert (GtkMenu *menu, GtkWidget *child, gint position) { gtk_menu_shell_insert (GTK_MENU_SHELL (menu), child, position); } void gtk_menu_remove(GtkContainer *container, GtkWidget *widget) { GtkMenu *menu; g_return_if_fail (GTK_IS_MENU (container)); g_return_if_fail (GTK_IS_MENU_ITEM (widget)); menu = GTK_MENU (container); /* Clear out old_active_menu_item if it matches the item we are removing */ if (menu->old_active_menu_item == widget) { gtk_widget_unref (menu->old_active_menu_item); menu->old_active_menu_item = NULL; } GTK_CONTAINER_CLASS (parent_class)->remove (container, widget); } static void gtk_menu_tearoff_bg_copy (GtkMenu *menu) { GtkWidget *widget; widget = GTK_WIDGET (menu); if (menu->torn_off) { GdkPixmap *pixmap; GdkGC *gc; GdkGCValues gc_values; gc_values.subwindow_mode = GDK_INCLUDE_INFERIORS; gc = gdk_gc_new_with_values (widget->window, &gc_values, GDK_GC_SUBWINDOW); pixmap = gdk_pixmap_new (widget->window, widget->requisition.width, widget->requisition.height, -1); gdk_draw_pixmap (pixmap, gc, widget->window, 0, 0, 0, 0, -1, -1); gdk_gc_unref (gc); gtk_widget_set_usize (menu->tearoff_window, widget->requisition.width, widget->requisition.height); gdk_window_set_back_pixmap (menu->tearoff_window->window, pixmap, FALSE); gdk_pixmap_unref (pixmap); } } void gtk_menu_popup (GtkMenu *menu, GtkWidget *parent_menu_shell, GtkWidget *parent_menu_item, GtkMenuPositionFunc func, gpointer data, guint button, guint32 activate_time) { GtkWidget *widget; GtkWidget *xgrab_shell; GtkWidget *parent; GdkEvent *current_event; GtkMenuShell *menu_shell; g_return_if_fail (menu != NULL); g_return_if_fail (GTK_IS_MENU (menu)); widget = GTK_WIDGET (menu); menu_shell = GTK_MENU_SHELL (menu); menu->top_scroll_arrow_lit = FALSE; menu->bottom_scroll_arrow_lit = FALSE; menu_shell->parent_menu_shell = parent_menu_shell; menu_shell->active = TRUE; menu_shell->button = button; /* If we are popping up the menu from something other than, a button * press then, as a heuristic, we ignore enter events for the menu * until we get a MOTION_NOTIFY. */ current_event = gtk_get_current_event(); if (current_event) { if ((current_event->type != GDK_BUTTON_PRESS) && (current_event->type != GDK_ENTER_NOTIFY)) menu_shell->ignore_enter = TRUE; gdk_event_free (current_event); } if (menu->torn_off) { gtk_menu_tearoff_bg_copy (menu); /* We force an unrealize here so that we don't trigger redrawing/ * clearing code - we just want to reveal our backing pixmap. */ gtk_menu_reparent (menu, menu->toplevel, TRUE); } menu->parent_menu_item = parent_menu_item; menu->position_func = func; menu->position_func_data = data; menu_shell->activate_time = activate_time; gtk_menu_position (menu); /* We need to show the menu _here_ because code expects to be * able to tell if the menu is onscreen by looking at the * GTK_WIDGET_VISIBLE (menu) */ gtk_widget_show (GTK_WIDGET (menu)); gtk_widget_show (menu->toplevel); /* Find the last viewable ancestor, and make an X grab on it */ parent = GTK_WIDGET (menu); xgrab_shell = NULL; while (parent) { gboolean viewable = TRUE; GtkWidget *tmp = parent; while (tmp) { if (!GTK_WIDGET_MAPPED (tmp)) { viewable = FALSE; break; } tmp = tmp->parent; } if (viewable) xgrab_shell = parent; parent = GTK_MENU_SHELL (parent)->parent_menu_shell; } if (xgrab_shell && (!GTK_MENU_SHELL (xgrab_shell)->have_xgrab)) { if ((gdk_pointer_grab (xgrab_shell->window, TRUE, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK, NULL, NULL, activate_time) == 0)) { if (gdk_keyboard_grab (xgrab_shell->window, TRUE, activate_time) == 0) GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE; else { gdk_pointer_ungrab (activate_time); } } } gtk_grab_add (GTK_WIDGET (menu)); } void gtk_menu_popdown (GtkMenu *menu) { GtkMenuShell *menu_shell; g_return_if_fail (menu != NULL); g_return_if_fail (GTK_IS_MENU (menu)); menu_shell = GTK_MENU_SHELL (menu); menu_shell->parent_menu_shell = NULL; menu_shell->active = FALSE; menu_shell->ignore_enter = FALSE; gtk_menu_stop_navigating_submenu (menu); if (menu_shell->active_menu_item) { if (menu->old_active_menu_item) gtk_widget_unref (menu->old_active_menu_item); menu->old_active_menu_item = menu_shell->active_menu_item; gtk_widget_ref (menu->old_active_menu_item); } gtk_menu_shell_deselect (menu_shell); gtk_menu_set_scrolling (menu, FALSE, FALSE); /* The X Grab, if present, will automatically be removed when we hide * the window */ gtk_widget_hide (menu->toplevel); if (menu->torn_off) { if (GTK_BIN (menu->toplevel)->child) { gtk_menu_reparent (menu, menu->tearoff_window, FALSE); } else { /* We popped up the menu from the tearoff, so we need to * release the grab - we aren't actually hiding the menu. */ if (menu_shell->have_xgrab) { gdk_pointer_ungrab (GDK_CURRENT_TIME); gdk_keyboard_ungrab (GDK_CURRENT_TIME); } } } else gtk_widget_hide (GTK_WIDGET (menu)); menu_shell->have_xgrab = FALSE; gtk_grab_remove (GTK_WIDGET (menu)); } GtkWidget* gtk_menu_get_active (GtkMenu *menu) { GtkWidget *child; GList *children; g_return_val_if_fail (menu != NULL, NULL); g_return_val_if_fail (GTK_IS_MENU (menu), NULL); if (!menu->old_active_menu_item) { child = NULL; children = GTK_MENU_SHELL (menu)->children; while (children) { child = children->data; children = children->next; if (GTK_BIN (child)->child) break; child = NULL; } menu->old_active_menu_item = child; if (menu->old_active_menu_item) gtk_widget_ref (menu->old_active_menu_item); } return menu->old_active_menu_item; } void gtk_menu_set_active (GtkMenu *menu, guint index) { GtkWidget *child; GList *tmp_list; g_return_if_fail (menu != NULL); g_return_if_fail (GTK_IS_MENU (menu)); tmp_list = g_list_nth (GTK_MENU_SHELL (menu)->children, index); if (tmp_list) { child = tmp_list->data; if (GTK_BIN (child)->child) { if (menu->old_active_menu_item) gtk_widget_unref (menu->old_active_menu_item); menu->old_active_menu_item = child; gtk_widget_ref (menu->old_active_menu_item); } } } void gtk_menu_set_accel_group (GtkMenu *menu, GtkAccelGroup *accel_group) { g_return_if_fail (GTK_IS_MENU (menu)); if (menu->accel_group != accel_group) { if (menu->accel_group) gtk_accel_group_unref (menu->accel_group); menu->accel_group = accel_group; if (menu->accel_group) (void)gtk_accel_group_ref (menu->accel_group); } } GtkAccelGroup* gtk_menu_get_accel_group (GtkMenu *menu) { g_return_val_if_fail (GTK_IS_MENU (menu), NULL); return menu->accel_group; } GtkAccelGroup* gtk_menu_ensure_uline_accel_group (GtkMenu *menu) { GtkAccelGroup *accel_group; g_return_val_if_fail (GTK_IS_MENU (menu), NULL); if (!quark_uline_accel_group) quark_uline_accel_group = g_quark_from_static_string ("GtkMenu-uline-accel-group"); accel_group = gtk_object_get_data_by_id (GTK_OBJECT (menu), quark_uline_accel_group); if (!accel_group) { accel_group = gtk_accel_group_new (); gtk_accel_group_attach (accel_group, GTK_OBJECT (menu)); gtk_object_set_data_by_id_full (GTK_OBJECT (menu), quark_uline_accel_group, accel_group, (GtkDestroyNotify) gtk_accel_group_unref); } return accel_group; } GtkAccelGroup* gtk_menu_get_uline_accel_group (GtkMenu *menu) { g_return_val_if_fail (GTK_IS_MENU (menu), NULL); return gtk_object_get_data_by_id (GTK_OBJECT (menu), quark_uline_accel_group); } void gtk_menu_reposition (GtkMenu *menu) { g_return_if_fail (menu != NULL); g_return_if_fail (GTK_IS_MENU (menu)); if (GTK_WIDGET_DRAWABLE (menu) && !menu->torn_off) gtk_menu_position (menu); } void gtk_menu_set_tearoff_state (GtkMenu *menu, gboolean torn_off) { g_return_if_fail (menu != NULL); g_return_if_fail (GTK_IS_MENU (menu)); if (menu->torn_off != (guint)torn_off) { menu->torn_off = (guint)torn_off; if (menu->torn_off) { if (GTK_WIDGET_VISIBLE (menu)) gtk_menu_popdown (menu); if (!menu->tearoff_window) { GtkWidget *attach_widget; gchar *title; menu->tearoff_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_app_paintable (menu->tearoff_window, TRUE); (void)gtk_signal_connect (GTK_OBJECT (menu->tearoff_window), "event", GTK_SIGNAL_FUNC (gtk_menu_window_event), GTK_OBJECT (menu)); gtk_widget_realize (menu->tearoff_window); title = gtk_object_get_data (GTK_OBJECT (menu), "gtk-menu-title"); if (!title) { attach_widget = gtk_menu_get_attach_widget (menu); if (GTK_IS_MENU_ITEM (attach_widget)) { GtkWidget *child = GTK_BIN (attach_widget)->child; if (GTK_IS_LABEL (child)) gtk_label_get (GTK_LABEL (child), &title); } } if (title) gdk_window_set_title (menu->tearoff_window->window, title); gdk_window_set_decorations (menu->tearoff_window->window, GDK_DECOR_ALL | GDK_DECOR_RESIZEH | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE); gtk_window_set_policy (GTK_WINDOW (menu->tearoff_window), FALSE, FALSE, TRUE); } gtk_menu_reparent (menu, menu->tearoff_window, FALSE); gtk_menu_position (menu); gtk_widget_show (GTK_WIDGET (menu)); gtk_widget_show (menu->tearoff_window); } else { gtk_widget_hide (menu->tearoff_window); gtk_menu_reparent (menu, menu->toplevel, FALSE); } } } void gtk_menu_set_title (GtkMenu *menu, const gchar *title) { g_return_if_fail (menu != NULL); g_return_if_fail (GTK_IS_MENU (menu)); gtk_object_set_data_full (GTK_OBJECT (menu), "gtk-menu-title", g_strdup (title), (GtkDestroyNotify) g_free); } void gtk_menu_reorder_child (GtkMenu *menu, GtkWidget *child, gint position) { GtkMenuShell *menu_shell; g_return_if_fail (GTK_IS_MENU (menu)); g_return_if_fail (GTK_IS_MENU_ITEM (child)); menu_shell = GTK_MENU_SHELL (menu); if (g_list_find (menu_shell->children, child)) { menu_shell->children = g_list_remove (menu_shell->children, child); menu_shell->children = g_list_insert (menu_shell->children, child, position); if (GTK_WIDGET_VISIBLE (menu_shell)) gtk_widget_queue_resize (GTK_WIDGET (menu_shell)); } } static void gtk_menu_realize (GtkWidget *widget) { GdkWindowAttr attributes; gint attributes_mask; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_MENU (widget)); GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = (gint16)widget->allocation.width; attributes.height = (gint16)widget->allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); attributes.colormap = gtk_widget_get_colormap (widget); attributes.event_mask = gtk_widget_get_events (widget); attributes.event_mask |= (GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK); attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gdk_window_set_user_data (widget->window, widget); widget->style = gtk_style_attach (widget->style, widget->window); gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); gtk_menu_paint(widget); } static void gtk_menu_size_request (GtkWidget *widget, GtkRequisition *requisition) { GtkMenu *menu; GtkMenuShell *menu_shell; GtkWidget *child; GList *children; guint max_toggle_size; guint max_accel_width; GtkRequisition child_requisition; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_MENU (widget)); g_return_if_fail (requisition != NULL); menu = GTK_MENU (widget); menu_shell = GTK_MENU_SHELL (widget); requisition->width = 0; requisition->height = 0; max_toggle_size = 0; max_accel_width = 0; children = menu_shell->children; while (children) { child = children->data; children = children->next; if (GTK_WIDGET_VISIBLE (child)) { GTK_MENU_ITEM (child)->show_submenu_indicator = TRUE; gtk_widget_size_request (child, &child_requisition); requisition->width = MAX (requisition->width, child_requisition.width); requisition->height += child_requisition.height; max_toggle_size = MAX (max_toggle_size, MENU_ITEM_CLASS (child)->toggle_size); max_accel_width = MAX (max_accel_width, GTK_MENU_ITEM (child)->accelerator_width); } } requisition->width += max_toggle_size + max_accel_width; requisition->width += (GTK_CONTAINER (menu)->border_width + widget->style->klass->xthickness) * 2; requisition->height += (GTK_CONTAINER (menu)->border_width + widget->style->klass->ythickness) * 2; children = menu_shell->children; while (children) { child = children->data; children = children->next; GTK_MENU_ITEM (child)->toggle_size = (guint16)max_toggle_size; } } static void gtk_menu_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkMenu *menu; GtkMenuShell *menu_shell; GtkWidget *child; GtkAllocation child_allocation; GList *children; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_MENU (widget)); g_return_if_fail (allocation != NULL); menu = GTK_MENU (widget); menu_shell = GTK_MENU_SHELL (widget); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED (widget)) gdk_window_move_resize (widget->window, allocation->x, allocation->y, (gint)allocation->width, (gint)allocation->height); if (menu_shell->children) { gint child_num; child_allocation.x = (gint16) (GTK_CONTAINER (menu)->border_width + GTK_WIDGET (menu)->style->klass->xthickness); child_allocation.y = (gint16) (GTK_CONTAINER (menu)->border_width + GTK_WIDGET (menu)->style->klass->ythickness); child_allocation.width = (guint16)MAX (1, (gint)allocation->width - child_allocation.x * 2); if (menu->first_scroll_child != -1) child_allocation.y += MENU_SCROLL_ARROW_HEIGHT; child_num = 0; children = menu_shell->children; while (children) { child = children->data; children = children->next; if (GTK_WIDGET_VISIBLE (child)) { GtkRequisition child_requisition; gtk_widget_get_child_requisition (child, &child_requisition); if (child_num < menu->first_scroll_child || (child_num > menu->last_scroll_child && menu->last_scroll_child != -1)) { GtkAllocation outside_allocation; outside_allocation.x = -child_requisition.width; outside_allocation.y = -child_requisition.height; outside_allocation.width = (guint16)child_requisition.width; outside_allocation.height = (guint16)child_requisition.height; gtk_widget_size_allocate (child, &outside_allocation); } else { child_allocation.height = (guint16)child_requisition.height; gtk_widget_size_allocate (child, &child_allocation); gtk_widget_queue_draw (child); child_allocation.y += child_allocation.height; } } child_num++; } } } static void gtk_menu_paint (GtkWidget *widget) { g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_MENU (widget)); if (GTK_WIDGET_DRAWABLE (widget)) { gint border; gint width, height; border = (gint) (GTK_CONTAINER (widget)->border_width + widget->style->klass->ythickness + 1); gdk_window_get_size (widget->window, &width, &height); gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, widget, "menu", 0, 0, -1, -1); if (GTK_MENU (widget)->first_scroll_child != -1) { gtk_paint_arrow (widget->style, widget->window, GTK_MENU (widget)->top_scroll_arrow_lit ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, widget, "menu", GTK_ARROW_UP, TRUE, width / 2 - MENU_SCROLL_ARROW_HEIGHT / 2 + 1, border, MENU_SCROLL_ARROW_HEIGHT - 2, MENU_SCROLL_ARROW_HEIGHT - 2); } if (GTK_MENU (widget)->last_scroll_child != -1) { gtk_paint_arrow (widget->style, widget->window, GTK_MENU (widget)->bottom_scroll_arrow_lit ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, widget, "menu", GTK_ARROW_DOWN, TRUE, width / 2 - MENU_SCROLL_ARROW_HEIGHT / 2 + 1, height - border - MENU_SCROLL_ARROW_HEIGHT + 2, MENU_SCROLL_ARROW_HEIGHT - 2, MENU_SCROLL_ARROW_HEIGHT - 2); } } } static void gtk_menu_draw (GtkWidget *widget, GdkRectangle *area) { GtkMenuShell *menu_shell; GtkWidget *child; GdkRectangle child_area; GList *children; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_MENU (widget)); g_return_if_fail (area != NULL); if (GTK_WIDGET_DRAWABLE (widget)) { gtk_menu_paint (widget); menu_shell = GTK_MENU_SHELL (widget); children = menu_shell->children; while (children) { child = children->data; children = children->next; if (gtk_widget_intersect (child, area, &child_area)) gtk_widget_draw (child, &child_area); } } } static gboolean gtk_menu_expose (GtkWidget *widget, GdkEventExpose *event) { GtkMenuShell *menu_shell; GtkWidget *child; GdkEventExpose child_event; GList *children; GtkMenu *menu; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_MENU (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); menu_shell = GTK_MENU_SHELL (widget); menu = GTK_MENU (widget); if (GTK_WIDGET_DRAWABLE (widget)) { gtk_menu_paint (widget); child_event = *event; children = menu_shell->children; while (children) { child = children->data; children = children->next; if (GTK_WIDGET_NO_WINDOW (child) && gtk_widget_intersect (child, &event->area, &child_event.area)) (void)gtk_widget_event (child, (GdkEvent*) &child_event); } } return FALSE; } static gboolean gtk_menu_key_press (GtkWidget *widget, GdkEventKey *event) { GtkMenuShell *menu_shell; gboolean delete = FALSE; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_MENU (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); menu_shell = GTK_MENU_SHELL (widget); gtk_menu_stop_navigating_submenu (GTK_MENU (widget)); if (GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event)) return TRUE; switch (event->keyval) { case GDK_Delete: case GDK_KP_Delete: case GDK_BackSpace: delete = TRUE; break; default: break; } /* Modify the accelerators */ if (menu_shell->active_menu_item && GTK_BIN (menu_shell->active_menu_item)->child && GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu == NULL && !gtk_widget_accelerators_locked (menu_shell->active_menu_item) && (delete || (gtk_accelerator_valid (event->keyval, event->state) && (event->state || !gtk_menu_get_uline_accel_group (GTK_MENU (menu_shell)) || (event->keyval >= GDK_F1 && event->keyval <= GDK_F35))))) { GtkMenuItem *menu_item; GtkAccelGroup *accel_group; menu_item = GTK_MENU_ITEM (menu_shell->active_menu_item); if (!GTK_MENU (widget)->accel_group) accel_group = gtk_accel_group_get_default (); else accel_group = GTK_MENU (widget)->accel_group; gtk_widget_remove_accelerators (GTK_WIDGET (menu_item), gtk_signal_name (menu_item->accelerator_signal), TRUE); if (!delete && 0 == gtk_widget_accelerator_signal (GTK_WIDGET (menu_item), accel_group, event->keyval, event->state)) { GSList *slist; slist = gtk_accel_group_entries_from_object (GTK_OBJECT (menu_item)); while (slist) { GtkAccelEntry *ac_entry; ac_entry = slist->data; if (ac_entry->signal_id == menu_item->accelerator_signal) break; slist = slist->next; } if (!slist) gtk_widget_add_accelerator (GTK_WIDGET (menu_item), gtk_signal_name (menu_item->accelerator_signal), accel_group, event->keyval, event->state, GTK_ACCEL_VISIBLE); } } return TRUE; } static gboolean gtk_menu_motion_notify (GtkWidget *widget, GdkEventMotion *event) { GtkWidget *menu_item; GtkMenu *menu; GdkRegion *navigation_region; GtkMenuShell *menu_shell; gboolean need_enter; gboolean old_top_lit,old_bottom_lit; gboolean scroll_up,scroll_down; gint width,height; gint menuwidth,menuheight; gint menuposx,menuposy; guint border; gboolean in_window; /* We received the event for one of two reasons: * * a) We are the active menu, and did gtk_grab_add() * b) The widget is a child of ours, and the event was propagated * * Since for computation of navigation regions, we want the menu which * is the parent of the menu item, for a), we need to find that menu, * which may be different from 'widget'. */ menu_item = gtk_get_event_widget ((GdkEvent*) event); if (!menu_item || !GTK_IS_MENU_ITEM (menu_item) || !GTK_WIDGET_IS_SENSITIVE (menu_item) || !GTK_IS_MENU (menu_item->parent)) return FALSE; menu_shell = GTK_MENU_SHELL (menu_item->parent); menu = GTK_MENU (menu_shell); navigation_region = gtk_menu_get_navigation_region (menu); need_enter = (navigation_region != NULL || menu_shell->ignore_enter); /* Check to see if we are within an active submenu's navigation region */ if (gtk_menu_navigating_submenu (menu, (gint)event->x_root,(gint)event->y_root)) return TRUE; in_window=FALSE; gdk_window_get_size (event->window, &width, &height); gdk_window_get_size(menu_item->parent->window, &menuwidth,&menuheight); gdk_window_get_root_origin(menu_item->parent->window,&menuposx,&menuposy); if ((gint)event->x >= 0 && (gint)event->x < width && (gint)event->y >= 0 && (gint)event->y < height) in_window=TRUE; border =GTK_CONTAINER(widget)->border_width + widget->style->klass->ythickness; #if 1 if (need_enter) { /* The menu is now sensitive to enter events on its items, but * was previously sensitive. So we fake an enter event. */ menu_shell->ignore_enter = FALSE; if(in_window){ GdkEvent send_event; send_event.crossing.type = GDK_ENTER_NOTIFY; send_event.crossing.window = event->window; send_event.crossing.time = event->time; send_event.crossing.send_event = TRUE; send_event.crossing.x_root = event->x_root; send_event.crossing.y_root = event->y_root; send_event.crossing.x = event->x; send_event.crossing.y = event->y; /* We send the event to 'widget', the currently active menu, * instead of 'menu', the menu that the pointer is in. This * will ensure that the event will be ignored unless the * menuitem is a child of the active menu or some parent * menu of the active menu. */ return gtk_widget_event (widget, &send_event); } } #endif old_top_lit = GTK_MENU (widget)->top_scroll_arrow_lit; old_bottom_lit = GTK_MENU (widget)->bottom_scroll_arrow_lit; GTK_MENU (widget)->top_scroll_arrow_lit = FALSE; GTK_MENU (widget)->bottom_scroll_arrow_lit = FALSE; scroll_up = FALSE; scroll_down = FALSE; if (/*event->window == widget->window &&*/ event->y <= (double) (border + MENU_SCROLL_ARROW_HEIGHT) && (gint)event->y_root < menuheight/6+menuposy && GTK_MENU (widget)->first_scroll_child != -1) { if (in_window) GTK_MENU (widget)->top_scroll_arrow_lit = TRUE; if (GTK_MENU_SHELL (widget)->button) { scroll_up = TRUE; GTK_MENU (widget)->top_scroll_arrow_lit = TRUE; } } if (/*event->window == widget->window &&*/ event->y >= (double) (height - border - MENU_SCROLL_ARROW_HEIGHT) && (gint)event->y_root > menuheight*5/6+menuposy && GTK_MENU (widget)->last_scroll_child != -1) { if (in_window) GTK_MENU (widget)->bottom_scroll_arrow_lit = TRUE; if (GTK_MENU_SHELL (widget)->button) { scroll_down = TRUE; GTK_MENU (widget)->bottom_scroll_arrow_lit = TRUE; } } gtk_menu_set_scrolling (GTK_MENU (widget), scroll_up, scroll_down); if (GTK_MENU (widget)->top_scroll_arrow_lit != old_top_lit || GTK_MENU (widget)->bottom_scroll_arrow_lit != old_bottom_lit) gtk_menu_paint (widget); return FALSE; } static gboolean gtk_menu_enter_notify (GtkWidget *widget, GdkEventCrossing *event) { GtkWidget *menu_item; /* If this is a faked enter (see gtk_menu_motion_notify), 'widget' * will not correspond to the event widget's parent. Check to see * if we are in the parent's navigation region. */ menu_item = gtk_get_event_widget ((GdkEvent*) event); if (menu_item && GTK_IS_MENU_ITEM (menu_item) && GTK_IS_MENU (menu_item->parent) && gtk_menu_navigating_submenu (GTK_MENU (menu_item->parent), (gint)event->x_root, (gint)event->y_root)) return TRUE; return GTK_WIDGET_CLASS (parent_class)->enter_notify_event (widget, event); } static gboolean gtk_menu_leave_notify (GtkWidget *widget, GdkEventCrossing *event) { GtkMenuShell *menu_shell; GtkMenu *menu; GtkMenuItem *menu_item; GtkWidget *event_widget; menu = GTK_MENU (widget); menu_shell = GTK_MENU_SHELL (widget); if (gtk_menu_navigating_submenu (menu, (gint)event->x_root, (gint)event->y_root)) return TRUE; event_widget = gtk_get_event_widget ((GdkEvent*) event); if (!event_widget || !GTK_IS_MENU_ITEM (event_widget)) return TRUE; menu_item = GTK_MENU_ITEM (event_widget); /* Here we check to see if we're leaving an active menu item with a submenu, * in which case we enter submenu navigation mode. */ if (menu_shell->active_menu_item != NULL && menu_item->submenu != NULL && menu_item->submenu_placement == GTK_LEFT_RIGHT) { if (menu_item->submenu->window != NULL) { gtk_menu_set_submenu_navigation_region (menu, menu_item, event); return TRUE; } } return GTK_WIDGET_CLASS (parent_class)->leave_notify_event (widget, event); } static void gtk_menu_stop_navigating_submenu (GtkMenu *menu) { GdkRegion *navigation_region; guint navigation_timeout; navigation_region = gtk_menu_get_navigation_region (menu); navigation_timeout = gtk_menu_get_navigation_timeout (menu); if (navigation_region) { gdk_region_destroy (navigation_region); gtk_menu_set_navigation_region (menu, NULL); } if (navigation_timeout) { gtk_timeout_remove (navigation_timeout); gtk_menu_set_navigation_timeout (menu, 0); } } /* When the timeout is elapsed, the navigation region is destroyed * and the menuitem under the pointer (if any) is selected. */ static gboolean gtk_menu_stop_navigating_submenu_cb (gpointer user_data) { GdkEventCrossing send_event; GtkMenu *menu = user_data; GdkWindow *child_window; gtk_menu_stop_navigating_submenu (menu); if (GTK_WIDGET_REALIZED (menu)) { child_window = gdk_window_get_pointer (GTK_WIDGET (menu)->window, NULL, NULL, NULL); if (child_window) { send_event.window = child_window; send_event.type = GDK_ENTER_NOTIFY; send_event.time = GDK_CURRENT_TIME; /* Bogus */ send_event.send_event = TRUE; (void)GTK_WIDGET_CLASS (parent_class)->enter_notify_event (GTK_WIDGET (menu), &send_event); } } return FALSE; } static gboolean gtk_menu_navigating_submenu (GtkMenu *menu, gint event_x, gint event_y) { GdkRegion *navigation_region; navigation_region = gtk_menu_get_navigation_region (menu); if (navigation_region) { if (gdk_region_point_in (navigation_region, event_x, event_y)) return TRUE; else { gtk_menu_stop_navigating_submenu (menu); return FALSE; } } return FALSE; } static void gtk_menu_set_submenu_navigation_region (GtkMenu *menu, GtkMenuItem *menu_item, GdkEventCrossing *event) { gint submenu_left = 0; gint submenu_right = 0; gint submenu_top = 0; gint submenu_bottom = 0; gint width = 0; gint height = 0; GdkPoint point[3]; GtkWidget *event_widget; GdkRegion *navigation_region; guint navigation_timeout; g_return_if_fail (menu_item->submenu != NULL); g_return_if_fail (event != NULL); event_widget = gtk_get_event_widget ((GdkEvent*) event); (void)gdk_window_get_origin (menu_item->submenu->window, &submenu_left, &submenu_top); gdk_window_get_size (menu_item->submenu->window, &width, &height); submenu_right = submenu_left + width; submenu_bottom = submenu_top + height; gdk_window_get_size (event_widget->window, &width, &height); if (event->x >= 0 && (gint)event->x < width) { /* Set navigation region */ /* We fudge/give a little padding in case the user * ``misses the vertex'' of the triangle/is off by a pixel or two. */ if (menu_item->submenu_direction == GTK_DIRECTION_RIGHT) point[0].x = (gint16) (event->x_root - SUBMENU_NAV_REGION_PADDING); else point[0].x = (gint16) (event->x_root + SUBMENU_NAV_REGION_PADDING); /* Exiting the top or bottom? */ if (event->y < 0) { /* top */ point[0].y = (gint16)(event->y_root + SUBMENU_NAV_REGION_PADDING); point[1].y = (gint16)submenu_top; if (point[0].y <= point[1].y) return; } else { /* bottom */ point[0].y = (gint16) (event->y_root - SUBMENU_NAV_REGION_PADDING); point[1].y = (gint16)submenu_bottom; if (point[0].y >= point[1].y) return; } /* Submenu is to the left or right? */ if (menu_item->submenu_direction == GTK_DIRECTION_RIGHT) point[1].x = (gint16)submenu_left; /* right */ else point[1].x = (gint16)submenu_right; /* left */ point[2].x = point[1].x; point[2].y = point[0].y; gtk_menu_stop_navigating_submenu (menu); navigation_region = gdk_region_polygon (point, 3, GDK_WINDING_RULE); gtk_menu_set_navigation_region (menu, navigation_region); navigation_timeout = gtk_timeout_add (SUBMENU_NAV_HYSTERESIS_TIMEOUT, gtk_menu_stop_navigating_submenu_cb, menu); gtk_menu_set_navigation_timeout (menu, navigation_timeout); } } static GdkRegion * gtk_menu_get_navigation_region (GtkMenu *menu) { GdkRegion *region; g_return_val_if_fail (GTK_IS_MENU (menu), NULL); if (!navigation_region_key_id) navigation_region_key_id = g_quark_from_static_string (navigation_region_key); region = gtk_object_get_data_by_id (GTK_OBJECT (menu), navigation_region_key_id); return region; } static void gtk_menu_set_navigation_region (GtkMenu *menu, GdkRegion *region) { g_return_if_fail (GTK_IS_MENU (menu)); if (!navigation_region_key_id) navigation_region_key_id = g_quark_from_static_string (navigation_region_key); gtk_object_set_data_by_id (GTK_OBJECT (menu), navigation_region_key_id, region); } static guint gtk_menu_get_navigation_timeout (GtkMenu *menu) { gpointer data; g_return_val_if_fail (GTK_IS_MENU (menu), 0); if (!navigation_timeout_key_id) navigation_timeout_key_id = g_quark_from_static_string (navigation_timeout_key); data = gtk_object_get_data_by_id (GTK_OBJECT (menu), navigation_timeout_key_id); return GPOINTER_TO_UINT (data); } static void gtk_menu_set_navigation_timeout (GtkMenu *menu, guint timeout) { gpointer data; g_return_if_fail (GTK_IS_MENU (menu)); if (!navigation_timeout_key_id) navigation_timeout_key_id = g_quark_from_static_string (navigation_timeout_key); data = GUINT_TO_POINTER (timeout); gtk_object_set_data_by_id (GTK_OBJECT (menu), navigation_timeout_key_id, data); } static void gtk_menu_deactivate (GtkMenuShell *menu_shell) { GtkWidget *parent; g_return_if_fail (menu_shell != NULL); g_return_if_fail (GTK_IS_MENU (menu_shell)); parent = menu_shell->parent_menu_shell; menu_shell->activate_time = 0; gtk_menu_popdown (GTK_MENU (menu_shell)); if (parent) gtk_menu_shell_deactivate (GTK_MENU_SHELL (parent)); } static void gtk_menu_position (GtkMenu *menu) { GtkWidget *widget; GtkRequisition requisition; gint x, y; g_return_if_fail (menu != NULL); g_return_if_fail (GTK_IS_MENU (menu)); widget = GTK_WIDGET (menu); (void)gdk_window_get_pointer (NULL, &x, &y, NULL); /* We need the requisition to figure out the right place to * popup the menu. In fact, we always need to ask here, since * if one a size_request was queued while we weren't popped up, * the requisition won't have been recomputed yet. */ gtk_widget_size_request (widget, &requisition); if (menu->position_func) (* menu->position_func) (menu, &x, &y, menu->position_func_data); else { gint screen_width; gint screen_height; screen_width = gdk_screen_width (); screen_height = gdk_screen_height (); x = CLAMP (x - 2, 0, MAX (0, screen_width - requisition.width)); y = CLAMP (y - 2, 0, MAX (0, screen_height - requisition.height)); } /* FIXME: The MAX() here is because gtk_widget_set_uposition * is broken. Once we provide an alternate interface that * allows negative values, then we can remove them. */ /* gtk_widget_set_uposition (GTK_MENU_SHELL (menu)->active ? menu->toplevel : menu->tearoff_window, MAX (x, 0), MAX (y, 0)); */ gtk_menu_top_position( menu, x, y, requisition.width, requisition.height); } /* Reparent the menu, taking care of the refcounting */ static void gtk_menu_reparent (GtkMenu *menu, GtkWidget *new_parent, gboolean unrealize) { GtkObject *object = GTK_OBJECT (menu); GtkWidget *widget = GTK_WIDGET (menu); gboolean was_floating = GTK_OBJECT_FLOATING (object); gtk_object_ref (object); gtk_object_sink (object); if (unrealize) { gtk_object_ref (object); gtk_container_remove (GTK_CONTAINER (widget->parent), widget); gtk_container_add (GTK_CONTAINER (new_parent), widget); gtk_object_unref (object); } else gtk_widget_reparent (GTK_WIDGET (menu), new_parent); gtk_widget_set_usize (new_parent, -1, -1); if (was_floating) GTK_OBJECT_SET_FLAGS (object, GTK_FLOATING); else gtk_object_unref (object); } static void gtk_menu_show_all (GtkWidget *widget) { g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_MENU (widget)); /* Show children, but not self. */ gtk_container_foreach (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_show_all, NULL); } static void gtk_menu_hide_all (GtkWidget *widget) { g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_MENU (widget)); /* Hide children, but not self. */ gtk_container_foreach (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_hide_all, NULL); } /* Set the actual position of the toplevel window. Also, if part of the * toplevel window would fall offscreen, truncate the window and note that * we will use scroll arrows. */ static void gtk_menu_top_position (GtkMenu *menu, gint x, gint y, gint width, gint height) { gint border_height; border_height = (gint) (GTK_CONTAINER (menu)->border_width + GTK_WIDGET (menu)->style->klass->ythickness); if (GTK_MENU_SHELL (menu)->active) { GList *child_list; gint screen_height; gint on_line; child_list = GTK_MENU_SHELL (menu)->children; screen_height = gdk_screen_height (); on_line = y + border_height; if (y < 0) { guint offset; offset = 0; menu->first_scroll_child = 0; while (on_line < MENU_SCROLL_ARROW_HEIGHT + border_height && child_list) { GtkWidget *child; child = GTK_WIDGET (child_list->data); if (GTK_WIDGET_VISIBLE (child)) { gtk_widget_size_request (child, &child->requisition); height -= child->requisition.height; on_line += child->requisition.height; y += child->requisition.height; } child_list = child_list->next; menu->first_scroll_child++; } y -= MENU_SCROLL_ARROW_HEIGHT; height += MENU_SCROLL_ARROW_HEIGHT; } else menu->first_scroll_child = -1; if (y + height >= screen_height) { menu->last_scroll_child = menu->first_scroll_child; if (menu->last_scroll_child == -1) menu->last_scroll_child = 0; while (on_line + MENU_SCROLL_ARROW_HEIGHT + border_height < screen_height && child_list) { GtkWidget *child; child = GTK_WIDGET (child_list->data); if (GTK_WIDGET_VISIBLE (child)) { gtk_widget_size_request (child, &child->requisition); height = on_line + MENU_SCROLL_ARROW_HEIGHT + border_height - y; on_line += child->requisition.height; } child_list = child_list->next; menu->last_scroll_child++; } menu->last_scroll_child -= 2; if(menu->last_scroll_child < 0) menu->last_scroll_child = menu->first_scroll_child; } else menu->last_scroll_child = -1; gtk_widget_set_uposition (menu->toplevel, x, y); gtk_widget_set_usize (menu->toplevel, width, height); } else { gtk_widget_set_uposition (menu->tearoff_window, x, y); } } /* Set the scrolling state of the menu. It is harmless to call this * if there is no change in scrolling state. (That is, it won't interrupt * or reset the scrolling timers if the scrolling settings are the same). */ static void gtk_menu_set_scrolling (GtkMenu *menu, gboolean scroll_up, gboolean scroll_down) { if (!scroll_up && menu->scroll_up_source_tag) { (void)g_source_remove (menu->scroll_up_source_tag); menu->scroll_up_source_tag = 0; } if (!scroll_down && menu->scroll_down_source_tag) { (void)g_source_remove (menu->scroll_down_source_tag); menu->scroll_down_source_tag = 0; } if(scroll_up && !menu->scroll_up_source_tag) { if (gtk_menu_scroll_up (menu, 1)) menu->scroll_up_source_tag = g_timeout_add (MENU_SCROLL_TIMEOUT, gtk_menu_timeout_up, menu); } if(scroll_down && !menu->scroll_down_source_tag) { if (gtk_menu_scroll_down (menu, 1)) menu->scroll_down_source_tag = g_timeout_add (MENU_SCROLL_TIMEOUT, gtk_menu_timeout_down, menu); } } static gboolean gtk_menu_scroll_up (GtkMenu *menu, guint scroll_count) { gboolean return_value; gint x, y, width, height; gint screen_height; gint on_line; gint last_line; gint on_child; gint border; GList *child; GtkAllocation allocation; return_value = TRUE; gdk_window_get_geometry (menu->toplevel->window, &x, &y, &width, &height, NULL); screen_height = gdk_screen_height (); border = (gint) (GTK_CONTAINER (menu)->border_width + GTK_WIDGET (menu)->style->klass->ythickness); menu->first_scroll_child--; if (menu->first_scroll_child <= 0) { menu->first_scroll_child = -1; return_value = FALSE; } on_line = y + border; last_line = on_line; if (menu->first_scroll_child != -1) on_line += MENU_SCROLL_ARROW_HEIGHT; on_child = 0; child = GTK_MENU_SHELL (menu)->children; while (child && on_line + border + MENU_SCROLL_ARROW_HEIGHT < screen_height) { GtkWidget *widget; widget = GTK_WIDGET (child->data); if (on_child >= menu->first_scroll_child && GTK_WIDGET_VISIBLE (widget)) { last_line = on_line; on_line += widget->allocation.height; } on_child++; child = child->next; } if (child) { on_line = last_line; on_child--; } if (child) { menu->last_scroll_child = on_child - 1; if (menu->last_scroll_child < menu->first_scroll_child) menu->last_scroll_child = menu->first_scroll_child; on_line += MENU_SCROLL_ARROW_HEIGHT + border; } else { menu->last_scroll_child = -1; on_line += border; } gdk_window_move_resize (menu->toplevel->window, x, y, width, on_line - y); allocation.x = 0; allocation.y = 0; allocation.width = (guint16)width; allocation.height = (guint16)(on_line - y); gtk_widget_size_allocate (GTK_WIDGET (menu), &allocation); return return_value; } static gboolean gtk_menu_scroll_down (GtkMenu *menu, guint scroll_count) { gboolean return_value; gint x, y, width, height; gint screen_height; gint on_line; gint last_line; gint new_height; gint on_child; gint border; GList *children_copy; GList *child; GtkAllocation allocation; return_value = TRUE; gdk_window_get_geometry (menu->toplevel->window, &x, &y, &width, &height, NULL); screen_height = gdk_screen_height (); border = (gint) (GTK_CONTAINER (menu)->border_width + GTK_WIDGET (menu)->style->klass->ythickness); menu->last_scroll_child++; if (menu->last_scroll_child >= (gint)g_list_length (GTK_MENU_SHELL (menu)->children)) { menu->last_scroll_child = -1; return_value = FALSE; } on_line = y + height - border; last_line = on_line; if (menu->last_scroll_child != -1) on_line -= MENU_SCROLL_ARROW_HEIGHT; on_child = (gint) (g_list_length (GTK_MENU_SHELL (menu)->children) - 1); children_copy = g_list_copy (GTK_MENU_SHELL (menu)->children); children_copy = g_list_reverse(children_copy); child = GTK_MENU_SHELL (menu)->children; while (child && on_line - border - MENU_SCROLL_ARROW_HEIGHT >= 0) { GtkWidget *widget; widget = GTK_WIDGET (child->data); if ((on_child <= menu->last_scroll_child || menu->last_scroll_child == -1) && GTK_WIDGET_VISIBLE (widget)) { last_line = on_line; on_line -= widget->allocation.height; } on_child--; child = child->next; } if (child) { on_line = last_line; on_child++; } if (child) { menu->first_scroll_child = on_child + 1; if (menu->first_scroll_child > menu->last_scroll_child && menu->last_scroll_child != -1) menu->first_scroll_child = menu->last_scroll_child; on_line -= MENU_SCROLL_ARROW_HEIGHT + border; } else { menu->first_scroll_child = -1; on_line -= border; } new_height = y + height - on_line; gdk_window_move_resize (menu->toplevel->window, x, on_line, width, new_height); allocation.x = 0; allocation.y = 0; allocation.width = (guint16)width; allocation.height = (guint16)new_height; gtk_widget_size_allocate (GTK_WIDGET (menu), &allocation); g_list_free(children_copy); return return_value; } static gboolean gtk_menu_timeout_up (gpointer data) { GtkMenu *menu; menu = GTK_MENU (data); if (gtk_menu_scroll_up (menu, 1)) return TRUE; else { menu->scroll_up_source_tag = 0; return FALSE; } } static gboolean gtk_menu_timeout_down (gpointer data) { GtkMenu *menu; menu = GTK_MENU (data); if (gtk_menu_scroll_down (menu, 1)) return TRUE; else { menu->scroll_down_source_tag = 0; return FALSE; } } chemtool-1.6.14/inout.c0000644000175000001440000057075312202271077014151 0ustar martinusers/* * functions for in and output */ #include "ct1.h" #include "inout.h" #include #include #include #include #include #include "gdk/gdkprivate.h" #include #ifdef EMF #include #endif #ifndef ENABLE_NLS #define _(Text) Text #else #include #define _(Text) gettext(Text) #endif #ifdef GTK2 extern PangoFontDescription *font[7], *smallfont[7], *symbfont[7], *ssymbfont[7], *slfont[7], *boldfont[7], *textfont[7]; #else extern GdkFont *font[7],*smallfont[7],*symbfont[7],*boldfont[7],*slfont[7]; #endif static char babeloutp[4]; int save_mol (FILE * fp, int partial) /* saves the current structure to a file in native chemtool format */ { int d; int w, h; struct data *hp_b; struct dc *hp_a; struct spline *hp_sp; int mbonds = 0, mlabels = 0, msplines = 0; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif /* get true extents of drawing*/ w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (partial == 1 && hp_b->smarked == 0 && hp_b->tmarked == 0) { hp_b = hp_b->next; } else { if (partial) mbonds++; w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); hp_b = hp_b->next; } } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (partial && !hp_a->marked) { hp_a = hp_a->next; } else { if (partial) mlabels++; w = MAX (w, hp_a->x); h = MAX (h, hp_a->y); hp_a = hp_a->next; } } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (partial && !hp_sp->marked) { hp_sp = hp_sp->next; } else { if (partial) msplines++; w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); hp_sp = hp_sp->next; } } w = (int) (w * 1.1); h = (int) (h * 1.1); fprintf (fp, "Chemtool Version " VERSION "\n"); fprintf (fp, "geometry %i %i\n", w, h); hp_b = da_root.next; if (partial) fprintf (fp, "bonds %i\n", mbonds); else fprintf (fp, "bonds %i\n", hp->n); for (d = 0; d < hp->n; d++) { if (partial && !hp_b->smarked && !hp_b->tmarked) { hp_b = hp_b->next; } else { /* if (hp_b->decoration == 1) {*/ fprintf (fp, "%i %i %i %i %i %i %i\n", hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, hp_b->bond, hp_b->decoration,hp_b->color); /* }else{ fprintf (fp, "%i %i %i %i %i\n", hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, hp_b->bond); }*/ hp_b = hp_b->next; } } hp_a = dac_root.next; if (partial) fprintf (fp, "atoms %i\n", mlabels); else fprintf (fp, "atoms %i\n", hp->nc); for (d = 0; d < hp->nc; d++) { if (partial && !hp_a->marked) { hp_a = hp_a->next; } else { fprintf (fp, "%i %i %s %i %i %i %i\n", hp_a->x, hp_a->y, hp_a->c, hp_a->direct, hp_a->color,hp_a->font,hp_a->size); hp_a = hp_a->next; } } hp_sp = sp_root.next; if (partial) fprintf (fp, "splines %i\n", msplines); else fprintf (fp, "splines %i\n", hp->nsp); for (d = 0; d < hp->nsp; d++) { if (partial && !hp_sp->marked) { hp_sp = hp_sp->next; } else { fprintf (fp, "%i %i %i %i %i %i %i %i %i %i\n", hp_sp->x0, hp_sp->y0, hp_sp->x1, hp_sp->y1, hp_sp->x2, hp_sp->y2, hp_sp->x3, hp_sp->y3, hp_sp->type,hp_sp->color); hp_sp = hp_sp->next; } } if (addflag==1) { fprintf (fp,"attach %i %i\n",refx,refy); } fprintf(fp,"scalefactors %f %d\n",bondlen_mm,zoom_factor); /* fclose (fp);*/ return (0); } int load_mol (char *filename) /* loads a chemtool file, checking for correct header */ { int d, n, i; int x, y, tx, ty, x2, y2, x3, y3, b, deco, col, fnt, siz; int res; char str[255], str1[255]; FILE *fp; char version[10]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if (!strcmp(filename,"-")) fp=fdopen(0,"r"); else if ((fp = fopen (filename, "r")) == NULL) return (1); res = fscanf (fp, "%s %s %s", str, str1, version); if (res != 3) { fclose (fp); return (2); } if (strcmp (str, "Chemtool") || strcmp (str1, "Version")) { fclose (fp); return (2); } clear_data (); res = fscanf (fp, "%s %i %i", str, &x, &y); if (res == 3 && !strcmp (str, "geometry")) { head.width = MAX (head.width, x); head.height = MAX (head.height, y); } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && (!strcmp (str, "bonds") || !strcmp (str, "bounds"))) { /* typo in versions < 1.1.2 */ res = fgetc(fp); if (res == EOF) { fclose (fp); return (2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)) { fclose (fp); return (2); } i=sscanf (str, "%i %i %i %i %i %i %i", &x, &y, &tx, &ty, &b, &deco, &col); if (i == 7) add_struct (x, y, tx, ty, b, 0, 0, deco, col); else if (i == 6) add_struct (x, y, tx, ty, b, 0, 0, deco, 0); else add_struct (x, y, tx, ty, b, 0, 0, 0, 0); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "atoms")) { res = fgetc(fp); if (res == EOF) { fclose (fp); return (2); } for (d = 0; d < n; d++) { if (!fgets(str,33+MAXCL,fp)){ fclose (fp); return (2); } i=sscanf (str, "%i %i %s %i %i %i %i", &x, &y, str, &b, &col, &fnt, &siz); if (i==7) add_char (x, y, str, b, 0, col, fnt, siz); else if (i == 6) add_char (x, y, str, b, 0, col, fnt, 3); else if (i<5) add_char (x, y, str, b, 0, 0, 0, 3); else add_char (x, y, str, b, 0, col, 0, 3); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "splines")) { if (n > 0) { res = fgetc(fp); if (res == EOF) { fclose (fp); return (2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)){ fclose (fp); return (2); } i=sscanf (str, "%i %i %i %i %i %i %i %i %i %i", &x, &y, &tx, &ty, &x2, &y2, &x3, &y3, &b,&col); if (i<10) add_spline (x, y, tx, ty, x2, y2, x3, y3, b, 0, 0); else add_spline (x, y, tx, ty, x2, y2, x3, y3, b, 0, col); } } } res = fscanf (fp, "%s %s %i", str, str1,&y); if (res == 3 && !strcmp(str,"attach")){ refx=atoi(str1); refy=y; addflag=1; } else if (res == 3 && !strcmp(str,"scalefactors")){ double bondlen_new = atof(str1); if (fabs(bondlen_mm - bondlen_new)>1.e-3){ size_factor *= bondlen_new/bondlen_mm; bondlen_mm = bondlen_new; } zoom_factor=y; Zoom(NULL,"2"); } res = fscanf (fp, "%s %s %d", str, str1, &y); if (res == 3 && !strcmp(str,"scalefactors")){ double bondlen_new = atof(str1); if (fabs(bondlen_mm - bondlen_new)>1.e-3){ size_factor *= bondlen_new/bondlen_mm; bondlen_mm = bondlen_new; } zoom_factor=y; Zoom(NULL,"2"); } fclose (fp); if (atof (version) > atof (VERSION)) return (3); return (0); } int load_preview (char *filename) /* loads a chemtool file, checking for correct header */ { int d, n; int x, y, tx, ty, x2, y2, x3, y3, b, col, fnt; int res; float savedfactor; char str[255], str1[255]; FILE *fp; char version[10]; GdkRectangle update_rect; int fontsize; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); savedfactor = size_factor; res = fscanf (fp, "%s %s %s", str, str1, version); if (res != 3) { fclose (fp); return (2); } if (strcmp (str, "Chemtool") || strcmp (str1, "Version")) { fclose (fp); return (2); } res = fscanf (fp, "%s %i %i", str, &x, &y); if (res != 3) { fclose (fp); return (2); } size_factor = MIN (200. / x, 100. / y); res = fscanf (fp, "%s %i", str, &n); if (res == 2 && (!strcmp (str, "bonds") || !strcmp (str, "bounds"))) { /* typo in versions < 1.1.2 */ res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)) { fclose(fp); return(2); } res = sscanf (str, "%i %i %i %i %i %i", &x, &y, &tx, &ty, &b, &col); if (res >= 5) draw_preview_bonds (x, y, tx, ty, b); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "atoms")) { if (size_factor < 0.15) fontsize=0; else fontsize=1; res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,33+MAXCL,fp)){ fclose(fp); return(2); } res = sscanf (str, "%i %i %s %i %i %i", &x, &y, str, &b, &col,&fnt); if (res >= 4) Drawstring (x, y, str, b, 0,0,0,1,fontsize); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "splines")) { if (n>0) { res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)){ fclose(fp); return(2); } res = sscanf (str, "%i %i %i %i %i %i %i %i %i %i", &x, &y, &tx, &ty, &x2, &y2, &x3, &y3, &b,&col); if (res >= 9) Drawspline (x, y, tx, ty, x2, y2, x3, y3, b, 0,0); } } } res = fscanf (fp, "%s %i %i", str, &xref,&yref); if (res == 3 && !strcmp(str,"attach")){ draw_preview_bonds(xref-4,yref-4,xref+4,yref+4,0); draw_preview_bonds(xref-4,yref+4,xref+4,yref-4,0); } gdk_draw_pixmap (preview_area->window, drawing_area->style-> fg_gc[GTK_WIDGET_STATE (drawing_area)], picture, 0, 0, 0, 0, 200, 100); update_rect.x = 0; update_rect.y = 0; update_rect.width = 200; update_rect.height = 100; gtk_widget_draw ((GtkWidget *) preview_area, &update_rect); size_factor = savedfactor; fclose (fp); return (0); } int add_mol (char *filename) /* loads a chemtool file and adds its contents at a given position */ { int d, n, i; int x, y, tx, ty, x2, y2, x3, y3, b, deco, col, fnt, siz; int res; int xdiff = 0, ydiff = 0; char str[255]; FILE *fp; char version[10]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); res = fscanf (fp, "%s %s %s", str, str, version); if (res != 3 || atof (version) > atof (VERSION)) { fclose (fp); return (2); } Unmark_all(); res = fscanf (fp, "%s %i %i", str, &x, &y); if (res == 3 && !strcmp (str, "geometry")) { head.width += x; mark.w = x; head.height += y; mark.h = y; mark.flag = 1; } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && (!strcmp (str, "bonds") || !strcmp (str, "bounds"))) { res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)){ fclose(fp); return(2); } i= sscanf (str, "%i %i %i %i %i %i %i", &x, &y, &tx, &ty, &b, &deco, &col); if (i == 7) add_struct (x, y, tx, ty, b, 1, 1, deco, col); else if (i == 6) add_struct (x, y, tx, ty, b, 1, 1, deco, 0); else add_struct (x, y, tx, ty, b, 1, 1, 0, 0); } } res = fscanf (fp, "%s %i", str, &n); if (res == 2 && !strcmp (str, "atoms")) { res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,33+MAXCL,fp)) { fclose(fp); return(2); } i=sscanf (str, "%i %i %s %i %i %i %i", &x, &y, str, &b, &col, &fnt, &siz); x = x + xdiff; y = y + ydiff; if (i==7) add_char (x, y, str, b, 1, col, fnt, siz); else if (i==6) add_char (x, y, str, b, 1, col, fnt, 3); else if (i<5) add_char (x, y, str, b, 1, 0, 0, 3); else add_char (x, y, str, b, 1, col, 0, 3); } } res = fscanf (fp, "%s %i ", str, &n); if (res == 2 && !strcmp (str, "splines")) { if (n>0) { res = fgetc(fp); if (res == EOF) { fclose(fp); return(2); } for (d = 0; d < n; d++) { if (!fgets(str,80,fp)) { fclose(fp); return(2); } i=sscanf (str, "%i %i %i %i %i %i %i %i %i %i", &x, &y, &tx, &ty, &x2, &y2, &x3, &y3, &b,&col); if (i<10) add_spline (x, y, tx, ty, x2, y2, x3, y3, b, 0,0); else add_spline (x, y, tx, ty, x2, y2, x3, y3, b, 0,col); } } } res = fscanf (fp, "%s %i %i", str, &xref,&yref); if (res == 3 && !strcmp (str, "attach")) { xref=refx-xref; yref=refy-yref; partial_move (xref,yref); } fclose(fp); return (0); } int import_pdb (char *filename) { char line[255]; int i, j,m; int res; int connect = 0; double dist; double pdbxmin = 100000., pdbxmax = -100000., pdbymin = 1000000., pdbymax = -100000., pdbzmin = 100000., pdbzmax = -100000.; char code[8]; float pdbfactor = 50.; int pdboffset = 500; int at0, con[6]; FILE *fp; int *atnum=NULL; int found=0; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); /* skip to the first atom or heteroatom record */ for (i = 0;; i++) { if (fgets (line, (int)sizeof (line), fp) == NULL) { fclose (fp); return (1); } if (!strncmp (line, "END", 3) || feof (fp)) { /*premature end */ fclose (fp); return (1); } if (!strncmp (line, "ATOM", 4) || !strncmp (line, "HETATM", 6)) break; } clear_data (); FreePix(); i = -1; /* read in atom block data */ while (!feof (fp)) { if (!strncmp (line, "ATOM", 4) || !strncmp (line, "HETATM", 6)) { i++; pdbx = realloc (pdbx, (i + 1) * sizeof (double)); pdby = realloc (pdby, (i + 1) * sizeof (double)); pdbz = realloc (pdbz, (i + 1) * sizeof (double)); atjust = realloc (atjust, (i + 1) * sizeof (short)); atcode = realloc (atcode, (i + 1) * sizeof (char *)); atnum = realloc (atnum,(i+1)*sizeof(int)); atcode[i] = malloc (9 * sizeof (char)); atjust[i] = 0; res = sscanf (line, "%s %d %s %*6c %*6c %lf %lf %lf", code, &atnum[i],atcode[i], &pdbx[i], &pdby[i], &pdbz[i]); if (res < 6) { fclose (fp); return (1); } pdbxmin = MIN (pdbxmin, pdbx[i]); pdbxmax = MAX (pdbxmax, pdbx[i]); pdbymin = MIN (pdbymin, pdby[i]); pdbymax = MAX (pdbymax, pdby[i]); pdbzmin = MIN (pdbzmin, pdbz[i]); pdbzmax = MAX (pdbzmax, pdbz[i]); } else break; if (!fgets (line, (int)sizeof (line), fp)) break; } pdbn = i; nbonds = -1; while (!feof (fp)) { if (!strncmp (line, "CONECT", 6)) { connect = 1; con[0] = con[1] = con[2] = con[3] = con[4] = con[5] = 0; res = sscanf (line, "%*s %d %d %d %d %d %d %d", &at0, &con[0], &con[1], &con[2], &con[3],&con[4],&con[5]); for (i = 0; i < res; i++) { if (con[i] > 0) { found=0; for (m=0;m<=pdbn;m++){ if (atnum[m]==at0) { at0=m+1; found=1; break; } } for (m=0;m<=pdbn;m++){ if (atnum[m]==con[i]) { con[i]=m+1; found++; break; } } if (found==2){ nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = at0 - 1; bondto[nbonds] = con[i] - 1; bondtype[nbonds] = 0; dist = (pdbx[at0 - 1] - pdbx[con[i] - 1]) * (pdbx[at0 - 1] - pdbx[con[i] - 1]) + (pdby[at0 - 1] - pdby[con[i] - 1]) * (pdby[at0 - 1] - pdby[con[i] - 1]) + (pdbz[at0 - 1] - pdbz[con[i] - 1]) * (pdbz[at0 - 1] - pdbz[con[i] - 1]); if (dist < 1.45 * 1.45) { if (!strncmp (atcode[at0 - 1], "C", 1) && !strncmp (atcode[con[i] - 1], "C", 1)) bondtype[nbonds] = 4; } /* fprintf(stderr,"CONECTED %d %d (%f)\n",at0,con[i],dist);*/ /* Drawline ((int) (pdbx[at0 - 1] * pdbfactor + pdboffset), (int) (pdby[at0 - 1] * pdbfactor + pdboffset), (int) (pdbx[con[i] - 1] * pdbfactor + pdboffset), (int) (pdby[con[i] - 1] * pdbfactor + pdboffset), 1);*/ } } } } else { break; } (void)fgets (line, (int)sizeof (line), fp); } fclose (fp); free (atnum); atnum=NULL; pdbxcent = (pdbxmax + pdbxmin) / 2.; pdbycent = (pdbymax + pdbymin) / 2.; pdbzcent = (pdbzmax + pdbzmin) / 2.; for (i = 0; i <= pdbn; i++) { pdbx[i] = pdbx[i] - pdbxcent; pdby[i] = pdby[i] - pdbycent; pdbz[i] = pdbz[i] - pdbzcent; } if (connect == 0) { /* if no bonds exist, i.e. there were no CONECTs */ for (i = 0; i <= pdbn; i++) { for (j = i + 1; j <= pdbn; j++) { dist = (pdbx[i] - pdbx[j]) * (pdbx[i] - pdbx[j]) + (pdby[i] - pdby[j]) * (pdby[i] - pdby[j]) + (pdbz[i] - pdbz[j]) * (pdbz[i] - pdbz[j]); if (dist < 1.58 * 1.58) { nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = i; bondto[nbonds] = j; bondtype[nbonds] = 0; if (dist < 1.45 * 1.45) { if (!strncmp (atcode[i], "C", 1) && !strncmp (atcode[j], "C", 1)) bondtype[nbonds] = 4; } /* Drawline ((int) (pdbx[i] * pdbfactor + pdboffset), (int) (pdby[i] * pdbfactor + pdboffset), (int) (pdbx[j] * pdbfactor + pdboffset), (int) (pdby[j] * pdbfactor + pdboffset), 1);*/ } } } } /* CopyPlane ();*/ importflag = 1; importfactor = pdbfactor; importoffset = pdboffset; pdbrotate(0,0,0); return (0); } void pdbrotate (int nx, int ny, int nz) { double l, r, s, t, u, v, w, a, b, c, d, e, f, g, h, i; int ii, j; double x[3], xx, yy, zz; int dx, dy; double ang = 0.; GdkRectangle update_rect; if (nz != 2) { dy = nx - hp->x; dx = ny - hp->y; hp->x = nx; hp->y = ny; x[0] = (dx != 0 ? 1. : 0.); x[1] = (dy != 0 ? 1. : 0.); x[2] = (nz != 0 ? 1. : 0.); if (abs (dx) < abs (dy)) { dx = dy; x[0] = 0.; x[1] = 1.; } else { x[0] = 1.; x[1] = 0.; } ang = (float) dx / 2.; if (ang < -360.) ang = ang + 360.; if (ang > 360.) ang = ang - 360.; if (x[2] == 1) { x[0] = 0.; x[1] = 0.; } /*fprintf(stderr,"rotate %f %f %f : %f\n",x[0],x[1],x[2],ang);*/ l = sqrt (x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); r = x[0] / l; s = x[1] / l; t = x[2] / l; v = sin (ang * M_PI / 180.); u = cos (ang * M_PI / 180.); w = 1.0 - u; a = u + w * r * r; b = t * v + w * r * s; c = -s * v + w * r * t; d = -t * v + w * s * r; e = u + w * s * s; f = r * v + w * s * t; g = s * v + w * t * r; h = -r * v + w * t * s; i = u + w * t * t; for (j = 0; j <= pdbn; j++) { xx = pdbx[j]; yy = pdby[j]; zz = pdbz[j]; pdbx[j] = a * xx + b * yy + c * zz; pdby[j] = d * xx + e * yy + f * zz; pdbz[j] = g * xx + h * yy + i * zz; } } FreePix (); for (ii = 0; ii <= nbonds; ii++) Drawline ((int) (pdbx[bondfrom[ii]] * importfactor + importoffset), (int) (pdby[bondfrom[ii]] * importfactor + importoffset), (int) (pdbx[bondto[ii]] * importfactor + importoffset), (int) (pdby[bondto[ii]] * importfactor + importoffset), 1, 0); gdk_draw_pixmap (drawing_area->window, drawing_area->style-> fg_gc[GTK_WIDGET_STATE (drawing_area)], picture, 0, 0, 0, 0, (gint)drawing_area->allocation.width, (gint)drawing_area->allocation.height); update_rect.x = 0; update_rect.y = 0; update_rect.width = drawing_area->allocation.width; update_rect.height = drawing_area->allocation.height; gtk_widget_draw ((GtkWidget *) drawing_area, &update_rect); } void pdbstore () { int i, j; char tmpstr[10]; for (i = 0; i <= pdbn; i++) { /* pdbx[i] = (pdbx[i] + pdbxcent) * importfactor + importoffset; pdby[i] = (pdby[i] + pdbycent) * importfactor + importoffset; pdbz[i] = (pdbz[i] + pdbzcent) * importfactor + importoffset; */ pdbx[i] = pdbx[i] * importfactor + importoffset; pdby[i] = pdby[i] * importfactor + importoffset; pdbz[i] = pdbz[i] * importfactor + importoffset; if (importflag == 1) { switch (pdbmode) { case 0: /* add all labels */ add_char ((int) (pdbx[i]), (int) (pdby[i]), atcode[i], atjust[i], 0, 0, 0, zoom_factor); break; case 1: /* add all non-H labels */ if (strncmp (atcode[i], "H", 1)) add_char ((int) (pdbx[i]), (int) (pdby[i]), atcode[i], atjust[i], 0, 0, 0, zoom_factor); break; case 3: /* only non-H without numeric identifiers */ if (!strncmp (atcode[i], "H", 1)) break; /* fall through to case 2 otherwise */ case 2: /* all labels, without the numeric part */ j = (int) strcspn (atcode[i], "1234567890"); strncpy (tmpstr, atcode[i], (size_t)j); tmpstr[j] = '\0'; add_char ((int) (pdbx[i]), (int) (pdby[i]), tmpstr, atjust[i], 0, 0, 0, zoom_factor); break; case 4: /* no labels */ default: break; } } else { /* in MDL import, add all non-C labels */ if (strncmp (atcode[i], "C", 1)) add_char ((int) (pdbx[i]), (int) (pdby[i]), atcode[i], atjust[i], 0,0,0, zoom_factor); } } for (i = 0; i <= nbonds; i++) add_struct ((int) (pdbx[bondfrom[i]]), (int) (pdby[bondfrom[i]]), (int) (pdbx[bondto[i]]), (int) (pdby[bondto[i]]), (int) bondtype[i], 0, 0, 0, 0); free (pdbx); free (pdby); free (pdbz); free (bondfrom); free (bondto); free (bondtype); free (atjust); for (i = 0; i <= pdbn; i++) free (atcode[i]); free (atcode); pdbx = NULL; pdby = NULL; pdbz = NULL; bondfrom = NULL; bondto = NULL; bondtype = NULL; atjust = NULL; atcode = NULL; importflag = 0; pdbn = 0; FreePix (); Display_Mol (); } int import_mdl_mol (char *filename, int skip) /* imports a MDL Molfile structure */ { /* int x, y, tx, ty;*/ /* the coordinates */ /* int bond = 0; */ /* Chemtool bondstyle */ float mdlfactor = 60.0; /* conversion factor .cht <-> .mol */ int mdloffset = 200; int text_direct = 0; /* Chemtool text direction */ int d, e; /* dummy variables */ int v3=0; char line[255]; char prop[41],*cfg; double pdbxmin = 100000., pdbxmax = -100000., pdbymin = 1000000., pdbymax = -100000., pdbzmin = 100000., pdbzmax = -100000.; /* the counts line, see ctfile.pdf for more information */ int a; /* number of atoms */ int b; /* number of bonds */ /* not parsed right now: */ int l; /* number of atoms list */ int f; /* obsolete */ int c; /* chiral flag, 0=not chiral, 1=chiral */ int s; /* number of stext entries */ int x_; /* number of reaction components + 1 */ int r; /* number of reactants */ int p; /* number of products */ int i; /* number of intermediates */ int m; /* number of additional properties, no longer supported and set to 999 */ char v[6]; /* ctab version, 'v2000' or 'v3000' */ /* end of counts line */ /* the atom block */ /*float xxx, yyy, zzz; */ /* the coordinates of the atom */ char aaa[3]; /* the atomic symbol */ /* not parsed right now: */ int dd; /* mass difference for isotopes */ int ccc; /* charge */ int sss; /* atom stereo parity */ int hhh; /* hydrogen count+1 */ int bbb; /* stereo care box */ int vvv; /* valence */ int HHH; /* H designator, redundant */ int rrr; /* reaction component type */ int iii; /* reaction component number */ int mmm; /* atom-atom mapping number */ int nnn; /* inversion/retention flag */ int eee; /* exact change flag */ /* end atom block */ /* the bond block */ int atom1; /* first atom number */ int atom2; /* second atom number */ int tt; /* bond type */ int ss; /* bond stereo */ int xx; /* not used */ int rr; /* bond topology, 0=eighter, 1=ring, 2=chain */ int cc; /* reaction center status */ /* end bond block */ char label[20]; /* a label defined in the .mol-file */ char aa[4],bb[4]; int res; FILE *fp; /*struct dc *hp_a; */ #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); if (skip >0 ) { d = 0; while ( d 100000 || b > 100000) { fclose(fp); return (1); } } clear_data (); pdbn = -1; /* read in atom block data */ for (d = 0; d < a; d++) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } pdbn++; pdbx = realloc (pdbx, (pdbn + 1) * sizeof (double)); pdby = realloc (pdby, (pdbn + 1) * sizeof (double)); pdbz = realloc (pdbz, (pdbn + 1) * sizeof (double)); atjust = realloc (atjust, (pdbn + 1) * sizeof (short)); atcode = realloc (atcode, (pdbn + 1) * sizeof (char *)); atcode[pdbn] = malloc (9 * sizeof (char)); if (v3==0) res = sscanf (line, "%lf %lf %lf %s %i %i %i %i %i %i %i %i %i %i %i %i", &pdbx[pdbn], &pdby[pdbn], &pdbz[pdbn], atcode[pdbn], &dd, &ccc, &sss, &hhh, &bbb, &vvv, &HHH, &rrr, &iii, &mmm, &nnn, &eee); else res = sscanf (line, "M V30 %*d %s %lf %lf %lf", atcode[pdbn],&pdbx[pdbn], &pdby[pdbn], &pdbz[pdbn]); if (res <3 ) { fclose(fp); return(1); } pdbxmin = MIN (pdbxmin, pdbx[d]); pdbxmax = MAX (pdbxmax, pdbx[d]); pdbymin = MIN (pdbymin, pdby[d]); pdbymax = MAX (pdbymax, pdby[d]); pdbzmin = MIN (pdbzmin, pdbz[d]); pdbzmax = MAX (pdbzmax, pdbz[d]); atjust[pdbn] = -1; /*default to centered labels */ } if (v3==1) { if (!fgets(line,(int)sizeof(line),fp)) { fclose(fp); return(1); } if (strncmp(line,"M V30 END ATOM",14)) { fclose(fp); return(1); } if (!fgets(line,(int)sizeof(line),fp)) { fclose(fp); return(1); } if (strncmp(line,"M V30 BEGIN BOND",16)) { fclose(fp); return(1); } } nbonds = -1; /* read in bond block data */ for (d = 0; d < b; d++) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } if (v3==1) { memset(prop,0,40); res = sscanf (line, "M V30 %*d %i %i %i %40c", &tt,&atom1,&atom2,prop); if (res <2) { fclose(fp); return(1); } ss = 0; if ( (cfg=strstr(prop,"CFG=")) != NULL) { res = sscanf(cfg,"CFG=%d",&ss); if (ss == 3) ss = 6; } }else{ res = sscanf (line, "%c%c%c%c%c%c %i %i %i %i %i", &aa[0],&aa[1],&aa[2], &bb[0], &bb[1], &bb[2], &tt, &ss, &xx, &rr, &cc); res = sscanf(aa,"%i",&atom1); res = sscanf(bb,"%i",&atom2); } nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = atom1 - 1; bondto[nbonds] = atom2 - 1; switch (tt) { case 1: /* single */ bondtype[nbonds] = 0; if (ss == 1) /* stereo up */ bondtype[nbonds] = 5; if (ss == 2 || ss == 4) /* either */ bondtype[nbonds] = 7; if (ss == 6) /* down */ bondtype[nbonds] = 6; break; case 2: /* double */ bondtype[nbonds] = 1; break; case 3: bondtype[nbonds] = 3; break; default: bondtype[nbonds] = 0; } } if (v3 == 1) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } } else { /* check for additional labels */ res = fscanf (fp, "%s %s", aaa, line); while (res >0 && !strcmp (aaa, "A")) { atom1 = atoi (line); res = fscanf (fp, "%s", label); if (res == 0) break; /* found a label "label" at atom "atom1" */ /* check for numbers, interpret as indices: */ text_direct = 0; f = (int)strlen (label); if (f == 1) text_direct = -1; /*center label if only one character */ for (e = 0; label[e] != '\0'; e++) { if (isdigit (label[e])) { /* If there's a number at the beginning, assume right- * justified text: */ if (e == 0) text_direct = -2; /* copy already processed string in auxiliary string 'line': */ strncpy (line, label, (size_t)e); /* append a '_', the number and a NULL-string: */ line[e] = '_'; line[e + 1] = label[e]; line[e + 2] = '\0'; /* append the rest of the label-string to 'line': */ strcat (line, strrchr (label, label[e + 1])); /* copy 'line' back to 'label' and add a NULL-string at the end: */ strcpy (label, line); e++; label[++f] = '\0'; } } strcpy (atcode[atom1 - 1], label); atjust[atom1 - 1] = (short)text_direct; res = fscanf (fp, "%s %s", aaa, line); } } /* check last line for "M END" */ if (strcmp(line,"END") && strcmp(line,"$$$$") ) { do { if (!fgets (line,80,fp)){ fprintf(stderr,"EOF\n"); break; } } while (strncmp (line, "M END",6) && strncmp(line,"$$$$",4) ); if (strncmp (line, "M END",6) && strncmp (line,"$$$$",4) ) { fprintf(stderr,"endless molfile???: %s\n",line); clear_data (); fclose (fp); return (2); } } fclose (fp); pdbxcent = (pdbxmax + pdbxmin) / 2.; pdbycent = (pdbymax + pdbymin) / 2.; pdbzcent = (pdbzmax + pdbzmin) / 2.; for (i = 0; i <= pdbn; i++) { pdbx[i] = pdbx[i] - pdbxcent; pdby[i] = pdby[i] - 2. * (pdby[i] - pdbycent); pdbz[i] = pdbz[i] - pdbzcent; } /* try to normalize bond lengths based on first bond */ mdlfactor = mdlfactor / sqrt ((pdbx[bondfrom[0]] - pdbx[bondto[0]]) * (pdbx[bondfrom[0]] - pdbx[bondto[0]]) + (pdby[bondfrom[0]] - pdby[bondto[0]]) * (pdby[bondfrom[0]] - pdby[bondto[0]]) + (pdbz[bondfrom[0]] - pdbz[bondto[0]]) * (pdbz[bondfrom[0]] - pdbz[bondto[0]])); for (i = 0; i <= nbonds; i++) Drawline ((int) (pdbx[bondfrom[i]] * mdlfactor + mdloffset), (int) (pdby[bondfrom[i]] * mdlfactor + mdloffset), (int) (pdbx[bondto[i]] * mdlfactor + mdloffset), (int) (pdby[bondto[i]] * mdlfactor + mdloffset), 1, 0); CopyPlane (); importflag = 2; importfactor = mdlfactor; importoffset = mdloffset; return (0); } int preview_mdl_mol (char *filename, int skip) /* imports a MDL Molfile structure into the preview widget*/ { /* int x, y, tx, ty;*/ /* the coordinates */ /* int bond = 0; */ /* Chemtool bondstyle */ float mdlfactor = 60.0; /* conversion factor .cht <-> .mol */ float previewscale; int text_direct = 0; /* Chemtool text direction */ int d, e; /* dummy variables */ GdkRectangle update_rect; int v3=0; char prop[41],*cfg; char line[255]; double pdbxmin = 100000., pdbxmax = -100000., pdbymin = 1000000., pdbymax = -100000.; /* the counts line, see ctfile.pdf for more information */ int a; /* number of atoms */ int b; /* number of bonds */ /* not parsed right now: */ int l; /* number of atoms list */ int f; /* obsolete */ int c; /* chiral flag, 0=not chiral, 1=chiral */ int s; /* number of stext entries */ int x_; /* number of reaction components + 1 */ int r; /* number of reactants */ int p; /* number of products */ int i; /* number of intermediates */ int m; /* number of additional properties, no longer supported and set to 999 */ char v[6]; /* ctab version, 'v2000' or 'v3000' */ /* end of counts line */ /* the atom block */ /*float xxx, yyy, zzz; */ /* the coordinates of the atom */ char aaa[3]; /* the atomic symbol */ /* not parsed right now: */ int dd; /* mass difference for isotopes */ int ccc; /* charge */ int sss; /* atom stereo parity */ int hhh; /* hydrogen count+1 */ int bbb; /* stereo care box */ int vvv; /* valence */ int HHH; /* H designator, redundant */ int rrr; /* reaction component type */ int iii; /* reaction component number */ int mmm; /* atom-atom mapping number */ int nnn; /* inversion/retention flag */ int eee; /* exact change flag */ /* end atom block */ /* the bond block */ int atom1; /* first atom number */ int atom2; /* second atom number */ int tt; /* bond type */ int ss; /* bond stereo */ int xx; /* not used */ int rr; /* bond topology, 0=eighter, 1=ring, 2=chain */ int cc; /* reaction center status */ /* end bond block */ char label[20]; /* a label defined in the .mol-file */ char aa[4],bb[4]; int res; FILE *fp; /*struct dc *hp_a; */ #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "r")) == NULL) return (1); if (skip >0 ) { d = 0; while ( d 100000 || b > 100000) { fclose(fp); return (1); } } clear_data (); pdbn = -1; /* read in atom block data */ for (d = 0; d < a; d++) { if (!fgets (line, (int)sizeof (line), fp)){ fclose(fp); return(1); } pdbn++; pdbx = realloc (pdbx, (pdbn + 1) * sizeof (double)); pdby = realloc (pdby, (pdbn + 1) * sizeof (double)); atjust = realloc (atjust, (pdbn + 1) * sizeof (short)); atcode = realloc (atcode, (pdbn + 1) * sizeof (char *)); atcode[pdbn] = malloc (9 * sizeof (char)); if (v3==0) res = sscanf (line, "%lf %lf %*f %s %i %i %i %i %i %i %i %i %i %i %i %i", &pdbx[pdbn], &pdby[pdbn], atcode[pdbn], &dd, &ccc, &sss, &hhh, &bbb, &vvv, &HHH, &rrr, &iii, &mmm, &nnn, &eee); else res= sscanf (line, "M V30 %*d %s %lf %lf", atcode[pdbn],&pdbx[pdbn], &pdby[pdbn]); if (res <3) { fclose(fp); return(1); } atjust[pdbn] = -1; /*default to centered labels */ } if (v3==1) { if (!fgets(line,(int)sizeof(line),fp)) { fclose(fp); return(1); } if (strncmp(line,"M V30 END ATOM",14)) { fclose(fp); return(1); } if (!fgets(line,(int)sizeof(line),fp)) { fclose(fp); return(1); } if (strncmp(line,"M V30 BEGIN BOND",16)) { fclose(fp); return(1); } } nbonds = -1; /* read in bond block data */ for (d = 0; d < b; d++) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } if (v3==1) { memset(prop,0,40); res = sscanf (line, "M V30 %*d %i %i %i %40c", &tt,&atom1,&atom2,prop); ss = 0; if ( (cfg=strstr(prop,"CFG=")) != NULL) { res = sscanf(cfg,"CFG=%d",&ss); if (ss == 3) ss = 6; } }else{ res = sscanf (line, "%c%c%c%c%c%c %i %i %i %i %i", &aa[0],&aa[1],&aa[2], &bb[0], &bb[1], &bb[2], &tt, &ss, &xx, &rr, &cc); res = sscanf(aa,"%i",&atom1); res = sscanf(bb,"%i",&atom2); } nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = atom1 - 1; bondto[nbonds] = atom2 - 1; switch (tt) { case 1: /* single */ bondtype[nbonds] = 0; if (ss == 1) /* stereo up */ bondtype[nbonds] = 5; if (ss == 2 || ss == 4) /* either */ bondtype[nbonds] = 7; if (ss == 6) /* down */ bondtype[nbonds] = 6; break; case 2: bondtype[nbonds] = 1; break; case 3: bondtype[nbonds] = 3; break; default: bondtype[nbonds] = 0; } } if (v3 == 1) { if (!fgets (line, (int)sizeof (line), fp)) { fclose(fp); return(1); } } else { /* check for additional labels */ res = fscanf (fp, "%s %s", aaa, line); while (res >0 && !strcmp (aaa, "A")) { atom1 = atoi (line); res = fscanf (fp, "%s", label); if (res == 0) break; /* found a label "label" at atom "atom1" */ /* check for numbers, interpret as indices: */ text_direct = 0; f = (int)strlen (label); if (f == 1) text_direct = -1; /*center label if only one character */ for (e = 0; label[e] != '\0'; e++) { if (isdigit (label[e])) { /* If there's a number at the beginning, assume right- * justified text: */ if (e == 0) text_direct = -2; /* copy already processed string in auxiliary string 'line': */ strncpy (line, label, (size_t)e); /* append a '_', the number and a NULL-string: */ line[e] = '_'; line[e + 1] = label[e]; line[e + 2] = '\0'; /* append the rest of the label-string to 'line': */ strcat (line, strrchr (label, label[e + 1])); /* copy 'line' back to 'label' and add a NULL-string at the end: */ strcpy (label, line); e++; label[++f] = '\0'; } } strcpy (atcode[atom1 - 1], label); atjust[atom1 - 1] = (short)text_direct; res = fscanf (fp, "%s %s", aaa, line); } } /* check last line for "M END" */ if (strcmp(line,"END") && strcmp(line,"$$$$") ) { do { if (!fgets (line,80,fp)){ fprintf(stderr,"EOF\n"); break; } } while (strncmp (line, "M END",6) && strncmp(line,"$$$$",4) ); if (strncmp (line, "M END",6) && strncmp (line,"$$$$",4) ) { fprintf(stderr,"endless molfile???: %s\n",line); clear_data (); fclose (fp); return (2); } } fclose (fp); /* try to normalize bond lengths based on first bond */ mdlfactor = mdlfactor / sqrt ((pdbx[bondfrom[0]] - pdbx[bondto[0]]) * (pdbx[bondfrom[0]] - pdbx[bondto[0]]) + (pdby[bondfrom[0]] - pdby[bondto[0]]) * (pdby[bondfrom[0]] - pdby[bondto[0]]) ); pdbxmin=10000.; pdbymin=10000.; pdbxmax=-10000.; pdbymax=-10000.; for (i = 0; i <= pdbn; i++) { pdbx[i] = pdbx[i]*mdlfactor; pdby[i] = pdby[i]*mdlfactor; pdbxmin = MIN (pdbxmin, pdbx[i]); pdbxmax = MAX (pdbxmax, pdbx[i]); pdbymin = MIN (pdbymin, pdby[i]); pdbymax = MAX (pdbymax, pdby[i]); } /* center molecule and scale it to fit into the effective drawing area (300x150 plus small border) */ pdbxcent = (pdbxmax + pdbxmin) / 2.; pdbycent = (pdbymax + pdbymin) / 2.; previewscale = MIN(280./(pdbxmax-pdbxmin),140./(pdbymax-pdbymin)); for (i = 0; i <= pdbn; i++) { pdbx[i] = (pdbx[i]- pdbxcent)*previewscale+140.; pdby[i] = (pdby[i]- 2. * pdby[i] + pdbycent)*previewscale+75.; } for (i = 0; i <= nbonds; i++) draw_preview_bonds ((int) pdbx[bondfrom[i]], (int) pdby[bondfrom[i]], (int) pdbx[bondto[i]], (int) pdby[bondto[i]], 0); for (i = 0; i <= pdbn; i++) if (strcmp(atcode[i],"C") && strcmp(atcode[i],"H")) Drawstring ((int)pdbx[i], (int)pdby[i], atcode[i], atjust[i], 0,0,0,1, 1); gdk_draw_pixmap (preview_area->window, drawing_area->style-> fg_gc[GTK_WIDGET_STATE (drawing_area)], picture, 0, 0, 0, 0, 200, 100); update_rect.x = 0; update_rect.y = 0; update_rect.width = 200; update_rect.height = 100; gtk_widget_draw ((GtkWidget *) preview_area, &update_rect); return (0); } int import_babel (char *filename) /* imports a foreign file via BABEL as a MDL Molfile structure */ { /* int x, y, tx, ty;*/ /* the coordinates */ /* int bond = 0; */ /* Chemtool bondstyle */ float mdlfactor = 60.0; /* conversion factor .cht <-> .mol */ int mdloffset = 200; int text_direct = 0; /* Chemtool text direction */ int d, e; /* dummy variables */ char line[255]; double pdbxmin = 100000., pdbxmax = -100000., pdbymin = 1000000., pdbymax = -100000., pdbzmin = 100000., pdbzmax = -100000.; /* the counts line, see ctfile.pdf for more information */ int a; /* number of atoms */ int b; /* number of bonds */ /* not parsed right now: */ int l; /* number of atoms list */ int f; /* obsolete */ int c; /* chiral flag, 0=not chiral, 1=chiral */ int s; /* number of stext entries */ int x_; /* number of reaction components + 1 */ int r; /* number of reactants */ int p; /* number of products */ int i; /* number of intermediates */ int m; /* number of additional properties, no longer supported and set to 999 */ char v[6]; /* ctab version, 'v2000' or 'v3000' */ /* end of counts line */ /* the atom block */ /*float xxx, yyy, zzz; */ /* the coordinates of the atom */ char aaa[3]; /* the atomic symbol */ /* not parsed right now: */ int dd; /* mass difference for isotopes */ int ccc; /* charge */ int sss; /* atom stereo parity */ int hhh; /* hydrogen count+1 */ int bbb; /* stereo care box */ int vvv; /* valence */ int HHH; /* H designator, redundant */ int rrr; /* reaction component type */ int iii; /* reaction component number */ int mmm; /* atom-atom mapping number */ int nnn; /* inversion/retention flag */ int eee; /* exact change flag */ /* end atom block */ /* the bond block */ int atom1; /* first atom number */ int atom2; /* second atom number */ int tt; /* bond type */ int ss; /* bond stereo */ int xx; /* not used */ int rr; /* bond topology, 0=eighter, 1=ring, 2=chain */ int cc; /* reaction center status */ /* end bond block */ int res; char label[20]; /* a label defined in the .mol-file */ char aa[4],bb[4]; FILE *fp; /*struct dc *hp_a; */ #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif if (!filename || !babel ) return (1); /* no filename or no input mode */ snprintf(line,255,"babel -i%s %s -omdl %s",babel,filename,babeloutp); /* fprintf(stderr,"%s\n",line);*/ /*@ignore@ splint does not recognize popen */ if ((fp = popen (line, "r")) == NULL) /*@end@*/ return (1); /* skip the first three lines (header) */ for (d = 0; d < 3; d++) { if (!fgets (line, (int)sizeof (line), fp)) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } } /* parse the counts-line */ if (!fgets (line, (int)sizeof (line), fp)) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } d = sscanf (line, "%c%c%c%c%c%c %i %i %i %i %i %i %i %i %i %s", &aa[0],&aa[1],&aa[2], &bb[0], &bb[1], &bb[2], &l, &f, &c, &s, &x_, &r, &p, &i, &m, v); aa[3]=bb[3]='\0'; sscanf(aa,"%i",&a); sscanf(bb,"%i",&b); if (d == 0 || a <= 0 || b < 0 || a > 100000 || b > 100000) { /*@ignore@*/ pclose(fp); /*@end@*/ return (1); } fprintf(stderr, "expecting na %d nb %d\n",a,b); clear_data (); pdbn = -1; /* read in atom block data */ for (d = 0; d < a; d++) { if (!fgets (line, (int)sizeof (line), fp)) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } pdbn++; pdbx = realloc (pdbx, (pdbn + 1) * sizeof (double)); pdby = realloc (pdby, (pdbn + 1) * sizeof (double)); pdbz = realloc (pdbz, (pdbn + 1) * sizeof (double)); atjust = realloc (atjust, (pdbn + 1) * sizeof (short)); atcode = realloc (atcode, (pdbn + 1) * sizeof (char *)); atcode[pdbn] = malloc (9 * sizeof (char)); res = sscanf (line, "%lf %lf %lf %s %i %i %i %i %i %i %i %i %i %i %i %i", &pdbx[pdbn], &pdby[pdbn], &pdbz[pdbn], atcode[pdbn], &dd, &ccc, &sss, &hhh, &bbb, &vvv, &HHH, &rrr, &iii, &mmm, &nnn, &eee); if (res <3) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } pdbxmin = MIN (pdbxmin, pdbx[d]); pdbxmax = MAX (pdbxmax, pdbx[d]); pdbymin = MIN (pdbymin, pdby[d]); pdbymax = MAX (pdbymax, pdby[d]); pdbzmin = MIN (pdbzmin, pdbz[d]); pdbzmax = MAX (pdbzmax, pdbz[d]); atjust[pdbn] = -1; /*default to centered labels */ } nbonds = -1; /* read in bond block data */ for (d = 0; d < b; d++) { if (!fgets (line, (int)sizeof (line), fp)) { /*@ignore@*/ pclose(fp); /*@end@*/ return(1); } res = sscanf (line, "%c%c%c%c%c%c %i %i %i %i %i", &aa[0],&aa[1],&aa[2],&bb[0],&bb[1],&bb[2], &tt, &ss, &xx, &rr, &cc); res = sscanf(aa,"%i",&atom1); res = sscanf(bb,"%i",&atom2); nbonds++; bondfrom = realloc (bondfrom, (nbonds + 1) * sizeof (int)); bondto = realloc (bondto, (nbonds + 1) * sizeof (int)); bondtype = realloc (bondtype, (nbonds + 1) * sizeof (short)); bondfrom[nbonds] = atom1 - 1; bondto[nbonds] = atom2 - 1; switch (tt) { case 1: bondtype[nbonds] = 0; if (ss == 1) bondtype[nbonds] = 5; if (ss == 6) bondtype[nbonds] = 6; break; case 2: bondtype[nbonds] = 1; break; case 3: bondtype[nbonds] = 3; break; default: bondtype[nbonds] = 0; } } /* check for additional labels */ res = fscanf (fp, "%s %s", aaa, line); while (res >0 && !strcmp (aaa, "A")) { atom1 = atoi (line); res = fscanf (fp, "%s", label); if (res <1) break; /* found a label "label" at atom "atom1" */ /* check for numbers, interpret as indices: */ text_direct = 0; f = (int)strlen (label); if (f == 1) text_direct = -1; /*center label if only one character */ for (e = 0; label[e] != '\0'; e++) { if (isdigit (label[e])) { /* If there's a number at the beginning, assume right- * justified text: */ if (e == 0) text_direct = -2; /* copy already processed string in auxiliary string 'line': */ strncpy (line, label, (size_t)e); /* append a '_', the number and a NULL-string: */ line[e] = '_'; line[e + 1] = label[e]; line[e + 2] = '\0'; /* append the rest of the label-string to 'line': */ strcat (line, strrchr (label, label[e + 1])); /* copy 'line' back to 'label' and add a NULL-string at the end: */ strcpy (label, line); e++; label[++f] = '\0'; } } strcpy (atcode[atom1 - 1], label); atjust[atom1 - 1] = (short)text_direct; res = fscanf (fp, "%s %s", aaa, line); } /* check last line for "M END" */ while (strcmp (line, "END")) { if (fscanf (fp, "%s", line) == EOF) break; if (fscanf (fp, "%s %s", aaa, line) == EOF) break; } if (strcmp (aaa, "M") || strcmp (line, "END")) { clear_data (); /*@ignore@ splint does not know pclose */ pclose (fp); /*@end@*/ return (2); } pclose (fp); pdbxcent = (pdbxmax + pdbxmin) / 2.; pdbycent = (pdbymax + pdbymin) / 2.; pdbzcent = (pdbzmax + pdbzmin) / 2.; if (pdbn <=0) return (1); /* complain if no atoms */ for (i = 0; i <= pdbn; i++) { pdbx[i] = pdbx[i] - pdbxcent; pdby[i] = pdby[i] - 2. * (pdby[i] - pdbycent); pdbz[i] = pdbz[i] - pdbzcent; } /* try to normalize bond lengths based on first bond */ mdlfactor = mdlfactor / sqrt ((pdbx[bondfrom[0]] - pdbx[bondto[0]]) * (pdbx[bondfrom[0]] - pdbx[bondto[0]]) + (pdby[bondfrom[0]] - pdby[bondto[0]]) * (pdby[bondfrom[0]] - pdby[bondto[0]]) + (pdbz[bondfrom[0]] - pdbz[bondto[0]]) * (pdbz[bondfrom[0]] - pdbz[bondto[0]])); for (i = 0; i <= nbonds; i++) Drawline ((int) (pdbx[bondfrom[i]] * mdlfactor + mdloffset), (int) (pdby[bondfrom[i]] * mdlfactor + mdloffset), (int) (pdbx[bondto[i]] * mdlfactor + mdloffset), (int) (pdby[bondto[i]] * mdlfactor + mdloffset), 1, 0); CopyPlane (); importflag = 2; importfactor = mdlfactor; importoffset = mdloffset; return (0); } int export_mdl_mol (FILE *fp, int topipe) /* exports a MDL Molfile structure */ { float factor = 76.0; /* conversion factor .cht <-> .mol */ int d, e, f; /* dummy variables */ char aaa[3]; /* the atomic symbol */ int atom1 = 0; /* first atom number */ int atom2 = 0; /* second atom number */ int tt; /* bond type */ int ss; /* bond stereo */ struct dc *hp_a; struct data *hp_b; int atoms[999][2]; /* coordinates of unique labels */ int start_already_there; int end_already_there; int is_label; int labelcount; /* number of unique atoms/labels */ int omit; /* number of decorative lines (boxes etc) */ int hcount=0; /* for explicit CH_3, CH_2, CH */ #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif /* FIXME: Write some sane stuff in the header */ fprintf (fp, "Molecule exported from chemtool\n"); fprintf (fp, "\n"); fprintf (fp, "\n"); labelcount = 0; omit = 0; atoms[0][0]=atoms[0][1]=0; /* Get coordinates of all unique bond-delimiters * and, more importantly, the number of unique atoms, * chemtool only knows the number of bonds and the * number of non-carbon atoms :( */ hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (!(mark.flag && (hp_b->smarked + hp_b->tmarked) == 0)) { if (hp_b->decoration == 1) omit++; else { /* Check for already parsed atoms on same coordinates */ start_already_there = 0; end_already_there = 0; for (f = 0; f <= labelcount; f++) { if (hp_b->x == atoms[f][0] && hp_b->y == atoms[f][1]) { start_already_there = 1; } if (hp_b->tx == atoms[f][0] && hp_b->ty == atoms[f][1]) { end_already_there = 1; } } if (!start_already_there) { atoms[labelcount][0] = hp_b->x; atoms[labelcount][1] = hp_b->y; labelcount++; } if (!end_already_there) { atoms[labelcount][0] = hp_b->tx; atoms[labelcount][1] = hp_b->ty; labelcount++; } } } hp_b = hp_b->next; } /* The counts line: */ fprintf (fp, "%3i%3i 0 0 0 0 0 0 0 0999 V2000\n", labelcount, hp->n-omit); /* Now write down the labels. * start all over */ for (d = 0; d < labelcount; d++) { /* Check for label on same position */ hp_a = dac_root.next; is_label = 0; for (e = 0; e < hp->nc; e++) { if (atoms[d][0] == hp_a->x && atoms[d][1] == hp_a->y) { is_label = 1; break; } hp_a = hp_a->next; } if (is_label) { hcount = 0; if (!strcmp(hp_a->c,"CH") || !strcmp(hp_a->c,"HC") ) { hcount=1; strcpy (aaa, "C"); } else if (!strcmp(hp_a->c,"OH") || !strcmp(hp_a->c,"HO") ) { hcount=1; strcpy (aaa, "O"); } else if (!strcmp(hp_a->c,"NH") || !strcmp(hp_a->c,"HN") ) { hcount=1; strcpy (aaa, "N"); } else if (!strcmp(hp_a->c,"SH") || !strcmp(hp_a->c,"HS") ) { hcount=1; strcpy (aaa, "S"); } else if (!strcmp(hp_a->c,"PH") || !strcmp(hp_a->c,"HP") ) { hcount=1; strcpy (aaa, "P"); } else if ((int)strlen (hp_a->c) < 4) { strcpy (aaa, hp_a->c); } else if (!strncmp(hp_a->c,"CH_3",4) || !strncmp(hp_a->c,"H_3C",4)) { hcount = 3; strcpy (aaa, "C"); } else if ( !strncmp(hp_a->c,"CH_2",4) || !strncmp(hp_a->c,"H2_C",4)) { hcount = 2; strcpy (aaa, "C"); } else if (!strncmp(hp_a->c,"NH_3",4) || !strncmp(hp_a->c,"H_3N",4)) { hcount = 3; strcpy (aaa, "N"); } else if ( !strncmp(hp_a->c,"NH_2",4) || !strncmp(hp_a->c,"H2_N",4)) { hcount = 2; strcpy (aaa, "N"); } else { fprintf(stderr,"untranslatable label %s\n",hp_a->c); strcpy (aaa, "X"); } } else { strcpy (aaa, "C"); } fprintf (fp, "%10.4f%10.4f%10.4f %-3s 0 0 0 %1d 0 0 0 0 0 0 0 0\n", (double) atoms[d][0] / factor, (double) (500.-atoms[d][1]) / factor, 0.0, aaa, hcount); } /* Now for the bonds */ hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_b->decoration == 0 && (!(mark.flag && (hp_b->smarked + hp_b->tmarked) == 0))) { atom1 = 0; atom2 = 0; for (e = 0; e < labelcount; e++) { if (atoms[e][0] == hp_b->x && atoms[e][1] == hp_b->y) { atom1 = e + 1; } if (atoms[e][0] == hp_b->tx && atoms[e][1] == hp_b->ty) { atom2 = e + 1; } } } /* parse the bond type */ tt = 1; ss = 0; switch (hp_b->bond) { case 1: case 2: tt = 2; /*double*/ /* 7=double or aromatic */ break; case 4: tt = 2; /* double */ break; case 3: case 18: case 19: /* FIXME: does MOL handle quadruple bonds at all ?*/ tt = 3; /* triple */ break; case 5: case 10: ss = 1; /* stereo up */ break; case 6: case 16: ss = 6; /* stereo down */ break; case 7: ss = 4; /* stereo either */ break; case 8: case 9: case 11: /* case 12: */ /* bond or not? */ case 17: tt = 0; /* assume no chemical bond */ break; case 14: case 15: tt = 1; /* 6 = single or aromatic */ break; default: tt = 1; /* single */ break; } if (tt) { fprintf (fp, "%3i%3i%3i%3i 0 0 0\n", atom1, atom2, tt, ss); } hp_b = hp_b->next; } fprintf (fp, "M END\n"); if (!topipe) fclose (fp); return 0; } int export_svg (char *filename) /* exports the current drawing to a Scaled Vector Graphics file */ { FILE *fp; int x, y, tx, ty, w, h; int x1,y1,x2,y2; float area; float factor; struct data *hp_b,*hp_bx; struct dc *hp_a; struct spline *hp_sp; struct xy_co *coord; int d, dd, i; int dy; int xbase, ybase, xside, yside, xend, yend, xlen, ylen; int shifted = 0; int unicodechar; int bond_already_tuned=0; static char svgcolor[7][8]={"#000000","#0000ff","#00ff00","#00ffff","#ff0000","#ff00ff", "#ffff00"}; #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "w")) == NULL) return (1); fprintf (fp, "\n"); fprintf (fp, "\n"); if (mark.flag && mark.w != 0 && mark.h != 0) { w = mark.w * size_factor - 6; h = mark.h * size_factor - 6; } else { /* get true extents of drawing*/ w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { w = MAX (w, hp_a->x); if (hp_a->direct > -2) w = MAX (w, hp_a->x + (int)strlen (hp_a->c) * (6 + 2 * size_factor)); h = MAX (h, hp_a->y + 8); hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); hp_sp = hp_sp->next; } w = (int) (w * 1.1) ; h = (int) (h * 1.1) ; } fprintf (fp, "\n", w, h,bghexcolor); fprintf (fp, "\nCreated with Chemtool %s from file %s \n\n", VERSION, filename); fprintf (fp, "\n"); hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (mark.flag && (hp_b->smarked + hp_b->tmarked) == 0) { } else { coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 12); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; if ( !use_whiteout) { int siz,j; float lfactor=((float)calc_vector(abs(tx-x),abs(ty-y))/(832.*size_factor)); if (lfactor >1.) lfactor=1.; /* short bonds should not shrink as much, they might vanish completely */ /* extra long bonds, however, need not leave more space around labels */ i=has_label(hp_b->x,hp_b->y); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0&& hp_a->direct ==0) { if (tx>x) { int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if (strl>1) x+=strl*(siz+1); } // else // x-=(strlen(hp_a->c)-1)*fzoom*(siz+1); } int ox=x; x += (lfactor*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); y += (lfactor*(siz+1)/calc_vector(abs(tx-ox),abs(ty-y))) *(ty-y); } i=has_label(hp_b->tx,hp_b->ty); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0 ){ int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if ( hp_a->direct<-1) { if (tx>x) tx-=(strl-1)*(siz+1); // else // tx+=(strlen(hp_a->c)-1)*(siz+1); } else if ( hp_a->direct==0) { // if (tx>x) // tx-=(strlen(hp_a->c)-1)*fzoom*(siz+1); // else if (txbond) { fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 5) { bond_already_tuned = 0; x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); factor=1.; hp_bx=da_root.next; for (dd = 0; dd < hp->n; dd++) { if (hp_bx->bond == 10) { if ( (abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) || (abs (hp_bx->tx * factor - tx) < 3 && abs (hp_bx->ty * factor - ty) < 3)) { coord = center_double_bond (hp_bx->x, hp_bx->y, hp_bx->tx, hp_bx->ty, db_dist); if (abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) { x1 = coord->x * factor; y1 = coord->y * factor; coord++; x2 = coord->x * factor; y2 = coord->y * factor; } else { x1 = coord->tx * factor; y1 = coord->ty * factor; coord++; x2 = coord->tx * factor; y2 = coord->ty * factor; } area = (0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1))); if (fabs (area) < 76. * factor) { x1 = tx - (int) (0.05 * (float) (ty - y)); y1 = ty + (int) (0.05 * (float) (tx - x)); x2 = tx + (int) (0.05 * (float) (ty - y)); y2 = ty - (int) (0.05 * (float) (tx - x)); } else bond_already_tuned = 1; } /* if connected to wide end of this wedge */ } /* if adjoining bond is wide */ if (hp_bx->bond == 0 && !bond_already_tuned) { if ((abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) ||(abs (hp_bx->tx * factor - tx) < 3 && abs (hp_bx->ty * factor - ty) < 3)) /* let the wedge join smoothly alongside another bond */ { coord = intersect(x,y,x1,y1,hp_bx->x*factor,hp_bx->y*factor, hp_bx->tx*factor,hp_bx->ty*factor); coord->tx = coord->x; coord->ty = coord->y; coord = intersect(x,y,x2,y2,hp_bx->x*factor,hp_bx->y*factor, hp_bx->tx*factor,hp_bx->ty*factor); x1 = coord->tx; y1 = coord->ty; x2 = coord->x; y2 = coord->y; area = 0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1)); if (fabs (area) > 3300. * factor || fabs(area) < 1750. * factor) { x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); } } /* if connected to wide end of this wedge */ } /* if adjoining bond is single, and not already adjusted */ hp_bx = hp_bx->next; } /* for dd */ fprintf (fp, "color],svgcolor[hp_b->color]); fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", x, y, x1,y1,x2,y2); /* fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", x, y, (int) (tx - 0.08 * (ty - y)), (int) (ty + 0.08 * (tx - x)), (int) (tx + 0.08 * (ty - y)), (int) (ty - 0.08 * (tx - x))); */ } if (hp_b->bond == 6) { for (i = 0; i < 8; i++) { fprintf (fp, "\n",svgcolor[hp_b->color]); } } if (hp_b->bond == 7) { i=MAX(abs(tx-x),abs(ty-y))/10; fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 8) { fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "color],svgcolor[hp_b->color]); fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", (int) (x + 0.8 * (tx - x)), (int) (y + 0.8 * (ty - y)), (int) (x + 0.8 * (tx - x) + 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) - 0.1 * (tx - x)), tx, ty); } if (hp_b->bond == 9) { int xlen = tx - x; int ylen = ty - y; float veclen = sqrt ((double)(xlen * xlen + ylen * ylen)); float scalefact=64./veclen; /* keep arrowhead size constant (64=std length)*/ int xbase = (int) (tx - 0.2 *xlen*scalefact); int ybase = (int) (ty - 0.2 *ylen*scalefact); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "color],svgcolor[hp_b->color]); fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", tx, ty,(int)(xbase + 0.1 * ylen*scalefact), (int)(ybase - 0.1 * xlen*scalefact) , (int)(xbase - 0.1 * ylen*scalefact), (int)(ybase + 0.1 * xlen*scalefact) ); /*(int) (x + 0.8 * (tx - x) + 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) - 0.1 * (tx - x)), (int) (x + 0.8 * (tx - x) - 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) + 0.1 * (tx - x)));*/ } if (hp_b->bond == 11) { fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 10) { fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 12) { fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 13) { fprintf (fp, "\n"); fprintf (fp, "\n",svgcolor[hp_b->color]); } if (hp_b->bond == 4) { coord = center_double_bond (x, y, tx, ty, db_dist); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord++; fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 1 || hp_b->bond == 3) { coord = multi_bonds (x, y, tx, ty, mb_dist); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 2 || hp_b->bond == 3) { coord = multi_bonds (tx, ty, x, y, mb_dist); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 14) { coord = multi_bonds (x, y, tx, ty, mb_dist); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke-dasharray:4,1; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 15) { coord = multi_bonds (tx, ty, x, y, mb_dist); fprintf (fp, "\n",svgcolor[hp_b->color]); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke-dasharray:4,1; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 16) { coord = center_double_bond (x, y, tx, ty, db_dist); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; coord++; for (i = 0; i < 10; i++) { fprintf (fp, "x + 0.1 * i * (coord->tx - coord->x)), (int) (coord->y + 0.1 * i * (coord->ty - coord->y))); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } } if (hp_b->bond == 18) { fprintf (fp, "\n",svgcolor[hp_b->color]); coord = center_double_bond (x, y, tx, ty, db_dist+1); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord++; fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } if (hp_b->bond == 19) { int tmpx1,tmpx2,tmpy1,tmpy2,tmptx1,tmptx2,tmpty1,tmpty2; coord = center_double_bond (x, y, tx, ty, db_dist+1); tmpx1=coord->x; tmpy1=coord->y; tmptx1=coord->tx; tmpty1=coord->ty; coord++; tmpx2=coord->x; tmpy2=coord->y; tmptx2=coord->tx; tmpty2=coord->ty; coord = center_double_bond (tmpx1, tmpy1, tmptx1, tmpty1, db_dist-1); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord++; fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord = center_double_bond (tmpx2, tmpy2, tmptx2, tmpty2, db_dist-1); fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); coord++; fprintf (fp, "x, coord->y, coord->tx, coord->ty); fprintf (fp, "style=\"stroke-width:2; stroke:%s\" />\n",svgcolor[hp_b->color]); } } hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (mark.flag && hp_a->marked == 0) { } else { if (hp_a->font == 0 ) { switch (hp_a->direct) { case Middle_Text: fprintf (fp, "x - 2, hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:middle;\" > \n\n"); break; case Left_Text: fprintf (fp, "x - 8 , hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:start;\" > \n\n"); break; case Right_Text: fprintf (fp, "x + 6, hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:end;\" > \n\n"); break; default: fprintf (stderr, "undefined text direction in svg output\n"); ;; } } else { switch (hp_a->direct) { case Middle_Text: fprintf (fp, "x - 2, hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:middle;\" > \n\n"); break; case Left_Text: fprintf (fp, "x - 8 , hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:start;\" > \n\n"); break; case Right_Text: fprintf (fp, "x + 6, hp_a->y + 8,12+hp_a->size*2,svgcolor[hp_a->color]); fprintf (fp, "text-anchor:end;\" > \n\n"); break; default: fprintf (stderr, "undefined text direction in svg output\n"); ;; } } for (i = 0; i < (int)strlen (hp_a->c); ++i) { if (hp_a->c[i] == '\\') hp_a->c[i] = ' '; if (hp_a->c[i] == '@') { unicodechar=848+hp_a->c[++i]; switch (unicodechar){ /* catch sequence mismatches with X Symbol font*/ case 915: /*C*/ case 947: /*c*/ unicodechar+=20; break; case 918: case 950: /*f*/ unicodechar+=16; break; case 919: case 951: /*g*/ unicodechar-=4; break; case 920: case 952: /*h*/ unicodechar-=1; break; case 922: /*J is vartheta*/ unicodechar=977; break; case 954: /*j is varphi*/ unicodechar=981; break; case 923: case 924: case 925: case 955: case 956: case 957: unicodechar-=1; break; case 926: /*N*/ unicodechar=78; break; case 958: /*n*/ unicodechar=118; break; case 929: /*Q*/ unicodechar=920; break; case 961: /*p*/ unicodechar=952; break; case 962: unicodechar-=1; break; case 966:/*v*/ unicodechar=982; break; case 967: /*w*/ unicodechar=969; break; case 968: unicodechar=958; break; case 969: unicodechar-=1; break; case 970: unicodechar=950; break; case 930: /*R*/ unicodechar-=1; break; case 934: /*V*/ unicodechar=962; break; case 935: /*W*/ unicodechar+=2; break; case 936: /*X*/ unicodechar=926; break; case 937: /*Y*/ unicodechar-=1; break; case 938: unicodechar=90; break; case 1031: case 775: /* bullet */ unicodechar=8226; break; case 891: //oplus unicodechar=8853; break; case 893: //ominus unicodechar=8854; break; default: break; } fprintf (fp, "&#%04d;", unicodechar); /*FIXME: unicode greek does not always map to X11 Symbol, e.g. F is Z not Phi */ } else if (hp_a->c[i] == '#') { fprintf (fp, "\n"); fprintf (fp, "%c", hp_a->c[++i]); fprintf (fp, "\n"); } else if (hp_a->c[i] == '|') { fprintf (fp, "\n"); fprintf (fp, "%c", hp_a->c[++i]); fprintf (fp, "\n"); } else if (hp_a->c[i] == '_') { dy=5+hp_a->size; fprintf (fp, "\n", dy, 8+hp_a->size*2); if (hp_a->c[i + 1] && hp_a->c[i + 1] == '{') { shifted = 1; i++; } if (shifted == 1) { while (hp_a->c[i + 1] && hp_a->c[i + 1] != '}') fprintf (fp, "%c", hp_a->c[++i]); shifted = 0; i++; } else { fprintf (fp, "%c", hp_a->c[++i]); } fprintf (fp, "\n\n", -dy); } else if (hp_a->c[i] == '^') { dy=-2 * (2 + hp_a->size); /* BUG FIX 1 */ fprintf (fp, "\n", dy, 8+hp_a->size*2); if (hp_a->c[i + 1] && hp_a->c[i + 1] == '{') { shifted = 1; i++; } if (shifted == 1) { while (hp_a->c[i + 1] && hp_a->c[i + 1] != '}') fprintf (fp, "%c", hp_a->c[++i]); shifted = 0; i++; } else { fprintf (fp, "%c", hp_a->c[++i]); } fprintf (fp, "\n\n", -dy); } else { #ifndef GTK2 if ((unsigned char)hp_a->c[i] >128) fprintf (fp, "&#%03d;",(unsigned char)hp_a->c[i]); else #endif if (hp_a->c[i] == '<') fprintf (fp, "<"); else if (hp_a->c[i] == '>') fprintf (fp, ">"); else if (hp_a->c[i] == '&') fprintf (fp, "&"); else fprintf (fp, "%c", hp_a->c[i]); } if (hp_a->c[i]==' ') /* protect blanks again after output */ hp_a->c[i]='\\'; } fprintf (fp, "\n\n"); } hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (mark.flag == 1 && hp_sp->marked == 0) { } else { fprintf (fp, "x0, hp_sp->y0); fprintf (fp, "C %d,%d %d,%d %d,%d\"\n", hp_sp->x1, hp_sp->y1, hp_sp->x2, hp_sp->y2, hp_sp->x3, hp_sp->y3); switch (hp_sp->type) { case 0: case 1: case 2: fprintf (fp, "style=\"stroke-width:2; stroke:%s; fill:none\">\n",svgcolor[hp_sp->color]); break; ;; case -2: fprintf (fp, "style=\"stroke-width:2; stroke-dasharray:4,1; stroke:%s fill:none\">\n",svgcolor[hp_sp->color]); break; ;; case -1: fprintf (fp, "style=\"stroke-width:2; stroke:%s; fill:solid\">\n",svgcolor[hp_sp->color]); } fprintf (fp, "\n"); if (hp_sp->type > 0) { xbase = (int) (0.7 * 0.7 * 0.7 * (double) hp_sp->x3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->x2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->x1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->x0); ybase = (int) (0.7 * 0.7 * 0.7 * (double) hp_sp->y3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->y2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->y1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->y0); xlen = hp_sp->x3 - xbase; ylen = hp_sp->y3 - ybase; if (xlen != 0) xlen = (int) copysign (50., (double)xlen); if (ylen != 0) ylen = (int) copysign (50., (double)ylen); xside = (int) (xbase + 0.15 * ylen); yside = (int) (ybase - 0.15 * xlen); if (hp_sp->type == 1) { xend = (int) (xbase - 0.15 * ylen); yend = (int) (ybase + 0.15 * xlen); x = (xside - hp_sp->x0) * (xside - hp_sp->x0) + (yside - hp_sp->y0) * (yside - hp_sp->y0); tx = (xend - hp_sp->x0) * (xend - hp_sp->x0) + (yend - hp_sp->y0) * (yend - hp_sp->y0); if (tx > x) { xside = xend; yside = yend; } xend = xbase; /*on baseline */ yend = ybase; } else { xend = (int) (xbase - 0.15 * ylen); yend = (int) (ybase + 0.15 * xlen); } fprintf (fp, "color],svgcolor[hp_sp->color]); fprintf (fp, " points=\"%d,%d %d,%d, %d,%d\" />\n", hp_sp->x3, hp_sp->y3, xside, yside, xend, yend); } } hp_sp = hp_sp->next; } fprintf (fp, "\n\n"); fclose (fp); return (0); } int export_emf (char *filename) /* exports the current drawing to an ECMA Enhanced Metafile */ #ifndef EMF { char com[255]; FILE *xfile; int rval; #if 1 char tmpfile[512]; FILE *fp; int fd; #endif #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif if (figversion == 0) return (1); /* cannot export without fig2dev */ if ((int)strlen (filename)) { #if 0 snprintf (com,255, "fig2dev -L emf > %s", filename); xfile = popen (com, "w"); #else strcpy (tmpfile, "/tmp/chtXXXXXX"); /*@ignore@ splint does not recognize mkstemp */ fd = mkstemp (tmpfile); /*@end@*/ if (fd == -1) return (1); fp = fdopen (fd, "w"); rval = exfig (fp, 0); if (rval != 0) return(rval); if (fclose (fp) != 0) return(1); snprintf (com,255, "fig2dev -L emf %s> \"%s\"", tmpfile, filename); xfile = popen (com, "w"); #endif if (pclose (xfile) != 0) return (1); return (rval); } else return (1); } #else { int x, y, tx, ty, w, h; struct data *hp_b; struct dc *hp_a; struct spline *hp_sp; struct xy_co *coord; int d, i; int xbase, ybase, xside, yside, xend, yend, xlen, ylen; int shifted = 0; int ha,fzoom,xpos,chl,nsub,nsup,rval,l; int csize,fontsize,offset,savedpos; LPPOINT dummy={0}; POINT points[4]; char description[30]; HWND desktop = GetDesktopWindow(); HDC dc= GetDC(desktop); // PCSTR description = "Created by\0chemtool 1.6.13\0"; char *tmpstring=malloc(80*sizeof(char)); HENHMETAFILE mfh; HDC metaDC ; HPEN nopen=CreatePen(PS_SOLID,0,RGB(0xff,0xff,0xff)); HPEN pen=CreatePen(PS_SOLID,1,RGB(0x00,0x00,0x00)); HPEN widepen=CreatePen(PS_SOLID,5,RGB(0x00,0x00,0x00)); HPEN dashedpen=CreatePen(PS_DASH,1,RGB(0x00,0x00,0x00)); HPEN dottedpen=CreatePen(PS_DOT,1,RGB(0x00,0x00,0x00)); HPEN whitepen=CreatePen(PS_SOLID,5,RGB(0xff,0xff,0xff)); HBRUSH fill=CreateSolidBrush(RGB(0x00,0x00,0x00)); HFONT normalfont=CreateFontA(-11,0,0,0,FW_MEDIUM,0,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_CHARACTER_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT smallfont=CreateFontA(-8,0,0,0,FW_MEDIUM,0,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT italicfont=CreateFontA(11,0,12,0,FW_MEDIUM,1,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT smallitalicfont=CreateFontA(8,0,8,0,FW_MEDIUM,1,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT boldfont=CreateFontA(11,0,12,0,FW_BOLD,0,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT smallboldfont=CreateFontA(8,0,8,0,FW_BOLD,0,0,0,ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT symbolfont=CreateFontA(11,0,12,0,FW_MEDIUM,0,0,0,SYMBOL_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); HFONT smallsymbolfont=CreateFontA(8,0,8,0,FW_MEDIUM,0,0,0,SYMBOL_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH| FF_DONTCARE, "Helvetica"); savedpos = 0; switch (zoom_factor) { case 0: fontsize = 8; /*8 */ fzoom = 6; /*6,4 */ break; case 1: fontsize = 10; /*6? */ fzoom = 7; /*5? */ break; case 2: fontsize = 12; /*9? */ fzoom = 8; /*7? */ break; case 3: fontsize = 16; /*12? */ fzoom = 9; /*12,10? */ break; case 4: fontsize = 18; fzoom = 10; break; default: fprintf (stderr, "no emf font parameters for zoom factor %d\n", zoom_factor); rval = 2; } fzoom=size_factor; if (mark.flag && mark.w != 0 && mark.h != 0) { x = mark.x * size_factor + 3; y = mark.y * size_factor + 3; w = mark.w * size_factor - 6; h = mark.h * size_factor - 6; } else { /* get true extents of drawing*/ x = 10000; y = 10000; w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); x = MIN (x, hp_b->x); x = MIN (x, hp_b->tx); y = MIN (y, hp_b->y); y = MIN (y, hp_b->ty); hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { w = MAX (w, hp_a->x); if (hp_a->direct > -2) w = MAX (w, (hp_a->x + (int)strlen (hp_a->c) * 30)); h = MAX (h, hp_a->y + 12); x = MIN (x, hp_a->x); if (hp_a->direct < 0) x = MIN (x, (hp_a->x - (int)strlen (hp_a->c) * 30)); y = MIN (y, hp_a->y - 12); hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); x = MIN (x, hp_sp->x0); y = MIN (y, hp_sp->y0); x = MIN (x, hp_sp->x1); y = MIN (y, hp_sp->y1); x = MIN (x, hp_sp->x2); y = MIN (y, hp_sp->y2); x = MIN (x, hp_sp->x3); y = MIN (y, hp_sp->y3); hp_sp = hp_sp->next; } x = x * size_factor/2 * 0.8; y = y * size_factor/2 * 0.8; w = (w-x) * size_factor/2 * 1.1 ; h = (h-y) * size_factor/2 * 1.1 ; } #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif snprintf(description,30,"Created by\0chemtool %s\0",VERSION); metaDC = CreateEnhMetaFile (dc, filename, NULL, description); SetMapMode (dc, MM_ANISOTROPIC); SetViewportExtEx(dc,10,-10,NULL); /* invisible box for image sizing */ SelectObject(metaDC,nopen); MoveToEx(metaDC,x,h,NULL); LineTo(metaDC,w,h); LineTo(metaDC,w,y); LineTo(metaDC,x,y); LineTo(metaDC,x,h); /* now do the actual drawing */ SelectObject(metaDC,pen); SelectObject(metaDC,fill); SetTextColor(metaDC,RGB(0x00,0x00,0x00)); SetTextAlign(metaDC,TA_LEFT+TA_BASELINE); SetBkColor(metaDC,RGB(0xff,0xff,0xff)); SetBkMode(metaDC,OPAQUE); hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (mark.flag && (hp_b->smarked + hp_b->tmarked) == 0) { } else { coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 15); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; if (!hp_b->bond) { MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); } if (hp_b->bond == 5) { points[0].x=x*size_factor/2; points[0].y=y*size_factor/2; points[1].x=(int) (tx - 0.1 * (ty - y))*size_factor/2; points[1].y=(int) (ty + 0.1 * (tx - x))*size_factor/2; points[2].x=(int) (tx + 0.1 * (ty - y))*size_factor/2; points[2].y=(int) (ty - 0.1 * (tx - x))*size_factor/2; Polygon(metaDC,points,3); } if (hp_b->bond == 6) { for (i = 0; i < 10; i++) { MoveToEx(metaDC, (int) ((x + 0.1 * i * (tx - x) - 0.01 * (ty - y) * i)*size_factor/2), (int) ((y + 0.1 * i * (ty - y) + 0.01 * (tx - x) * i)*size_factor/2),dummy); LineTo(metaDC, (int) ((x + 0.1 * i * (tx - x) + 0.01 * (ty - y) * i)*size_factor/2), (int) ((y + 0.1 * i * (ty - y) - 0.01 * (tx - x) * i)*size_factor/2)); } } if (hp_b->bond == 7) { coord = multi_bonds (x, y, tx, ty, 2*mb_dist); Arc(metaDC,(int)(coord->x*size_factor/2),(int)(coord->ty*size_factor/2), (int)((x+0.25*(tx-x))*size_factor/2), (int)((y+0.25*(ty-y))*size_factor/2), (int)(coord->x*size_factor/2),(int)(coord->y*size_factor/2), (int)((x+0.25*(tx-x))*size_factor/2), (int)((y+0.25*(ty-y))*size_factor/2)); coord = multi_bonds (tx, ty, x, y, 2*mb_dist); Arc(metaDC,(int)(coord->x*size_factor/2),(int)(coord->ty*size_factor/2), (int)((x+0.5*(tx-x))*size_factor/2), (int)((y+0.5*(ty-y))*size_factor/2), (int)(coord->x*size_factor/2),(int)(coord->y*size_factor/2), (int)((x+0.5*(tx-x))*size_factor/2), (int)((y+0.5*(ty-y))*size_factor/2)); coord = multi_bonds (x, y, tx, ty, 2*mb_dist); Arc(metaDC,(int)(coord->x*size_factor/2),(int)(coord->ty*size_factor/2), (int)((x+0.75*(tx-x))*size_factor/2), (int)((y+0.75*(ty-y))*size_factor/2), (int)(coord->x*size_factor/2),(int)(coord->y*size_factor/2), (int)((x+0.75*(tx-x))*size_factor/2), (int)((y+0.75*(ty-y))*size_factor/2)); coord = multi_bonds (tx, ty, x, y, 2*mb_dist); Arc(metaDC,(int)(coord->x*size_factor/2),(int)(coord->ty*size_factor/2), (int)((x+1.*(tx-x))*size_factor/2), (int)((y+1.*(ty-y))*size_factor/2), (int)(coord->x*size_factor/2),(int)(coord->y*size_factor/2), (int)((x+1.*(tx-x))*size_factor/2), (int)((y+1.*(ty-y))*size_factor/2)); } if (hp_b->bond == 8) { MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); points[0].x=(int) (x + 0.8 * (tx - x))*size_factor/2; points[0].y=(int) (y + 0.8 * (ty - y))*size_factor/2; points[1].x=(int) (x + 0.8 * (tx - x) + 0.1 * (ty - y))*size_factor/2; points[1].y=(int) (y + 0.8 * (ty - y) - 0.1 * (tx - x))*size_factor/2; points[2].x=(int) (tx*size_factor/2); points[2].y=(int) (ty*size_factor/2); Polygon(metaDC,points,3); } if (hp_b->bond == 9) { MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); points[0].x= (int) (tx*size_factor/2); points[0].y= (int) (ty*size_factor/2); points[1].x= (int) ((x + 0.8 * (tx - x) + 0.1 * (ty - y))*size_factor/2); points[1].y= (int) ((y + 0.8 * (ty - y) - 0.1 * (tx - x))*size_factor/2); points[2].x= (int) ((x + 0.8 * (tx - x) - 0.1 * (ty - y))*size_factor/2); points[2].y= (int) ((y + 0.8 * (ty - y) + 0.1 * (tx - x))*size_factor/2); Polygon(metaDC,points,3); } if (hp_b->bond == 11) { w=calc_vector(x-tx,y-ty); Ellipse(metaDC, (x-w)*size_factor/2, (y-w)*size_factor/2, (x+w)*size_factor/2, (y+w)*size_factor/2); } if (hp_b->bond == 10) { SelectObject(metaDC,widepen); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,pen); } if (hp_b->bond == 12) { SelectObject(metaDC,dottedpen); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,pen); } if (hp_b->bond == 13) { SelectObject(metaDC,whitepen); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,pen); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); } if (hp_b->bond == 4) { coord = center_double_bond (x, y, tx, ty, db_dist); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); coord++; MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); } if (hp_b->bond == 1 || hp_b->bond == 3) { coord = multi_bonds (x, y, tx, ty, mb_dist); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); } if (hp_b->bond == 2 || hp_b->bond == 3) { coord = multi_bonds (tx, ty, x, y, mb_dist); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); } if (hp_b->bond == 14) { coord = multi_bonds (x, y, tx, ty, mb_dist); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,dashedpen); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); SelectObject(metaDC,pen); } if (hp_b->bond == 15) { coord = multi_bonds (tx, ty, x, y, mb_dist); MoveToEx (metaDC, x*size_factor/2,y*size_factor/2,dummy); LineTo(metaDC,tx*size_factor/2,ty*size_factor/2); SelectObject(metaDC,dashedpen); MoveToEx (metaDC, coord->x*size_factor/2,coord->y*size_factor/2,dummy); LineTo(metaDC,coord->tx*size_factor/2,coord->ty*size_factor/2); SelectObject(metaDC,pen); } if (hp_b->bond == 16) { coord = center_double_bond (x, y, tx, ty, db_dist); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; coord++; for (i = 0; i < 10; i++){ MoveToEx (metaDC,(int) (x+0.1*i*(tx-x)*size_factor/2), (int)(y+0.1*i*(ty-y)*size_factor/2),dummy); LineTo(metaDC, (int)(coord->x+0.1*i*(coord->tx-coord->x)*size_factor/2), (int)(coord->y+0.1*i*(coord->ty-coord->y)*size_factor/2)); } } } hp_b = hp_b->next; } ha = 9 * fzoom; ha = 9 *size_factor; hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (mark.flag && hp_a->marked == 0) { } else { switch (hp_a->direct) { case Middle_Text: chl = 0; SetTextAlign(metaDC,TA_CENTER+TA_BOTTOM); break; case Left_Text: chl = 9 * fzoom; SetTextAlign(metaDC,TA_LEFT+TA_BOTTOM); break; case Right_Text: chl = -9 * fzoom; SetTextAlign(metaDC,TA_RIGHT+TA_BOTTOM); break; default: fprintf (stderr, "undefined text direction in emf output\n"); rval = 3; chl=0; ;; } nsub = 0; nsup = 0; for (i = 0; i < (int)strlen (hp_a->c); ++i) if (hp_a->c[i] == '\\') hp_a->c[i] = ' '; if (!strpbrk (hp_a->c, "@_^|#")) { /*no sub- or superscripts */ xpos = hp_a->x * fzoom; csize = fontsize * fzoom * 1.4; SelectObject(metaDC,normalfont); TextOutA(metaDC,(int)((hp_a->x)*size_factor/2),(int)((hp_a->y+25)*size_factor/2), hp_a->c,(int)strlen(hp_a->c)); } else { /* special formatting needed, every character becomes a separate entity */ l = (int)strlen (hp_a->c); l = 0; for (i = 0; i < (int)strlen (hp_a->c); i++) { switch (hp_a->c[i]) { case '@': break; case '_': case '^': /* l -= .5; ??*/ break; default: l++; } } fzoom=size_factor; xpos = hp_a->x * size_factor - chl; if (hp_a->direct == Right_Text) xpos=xpos-12*(l-2); csize = fontsize * size_factor * 1.4; shifted=0; for (i = 0; i < (int)strlen (hp_a->c); i++) { offset = 0; SelectObject(metaDC,normalfont); csize = fontsize * fzoom * 1.4; if (shifted != 0) { if (hp_a->c[i] == '}') { shifted = 0; i++; if (i >= (int)strlen (hp_a->c)) break; } else { offset = shifted; } } if (hp_a->c[i] == '_') { if (chl >= 0) csize = csize / 2; offset = ha / 2; nsub = nsub + 1; if (nsub == 1) { if (nsup > 0) xpos = savedpos; else savedpos = xpos; } nsup = 0; } if (hp_a->c[i] == '^') { offset = -ha / 2; nsup = nsup + 1; if (nsup == 1) { if (nsub > 0) xpos = savedpos; else savedpos = xpos; } nsub = 0; } if (offset != 0) { SelectObject(metaDC,smallfont); /* if (chl < 0) xpos = xpos - csize / 2; else xpos = xpos - 20;*/ if (hp_a->direct==Right_Text) xpos=xpos-10; if (shifted == 0) { i++; if (hp_a->c[i] == '{') { shifted = offset; i++; } } if (i >= (int)strlen (hp_a->c)) break; if (hp_a->c[i] != '-' && hp_a->c[i] != '+') offset = offset * 2; } else { /*reset sub- and superscript counters */ nsub = 0; nsup = 0; } if (hp_a->c[i] == '@') { SelectObject(metaDC,symbolfont); if (offset !=0) SelectObject(metaDC,smallsymbolfont); i++; } if (hp_a->c[i] == '|') { SelectObject(metaDC,italicfont); if (offset!=0) SelectObject(metaDC,smallitalicfont); /* csize = csize / 2; */ i++; } if (hp_a->c[i] == '#') { SelectObject(metaDC,boldfont); if (offset!=0) SelectObject(metaDC,smallboldfont); i++; } sprintf(tmpstring,"%c",hp_a->c[i]); TextOutA(metaDC,(int)((xpos-10+abs(offset/2))/2), (int)((hp_a->y+25)*size_factor/2), tmpstring,(int)strlen(tmpstring)); xpos = xpos + 20; if (zoom_factor < 2) xpos = xpos + 10; } /*for i */ } /* normal or special formatting */ for (i = 0; i < (int)strlen (hp_a->c); ++i) if (hp_a->c[i] == ' ') hp_a->c[i] = '\\'; } /* if within current set*/ hp_a = hp_a->next; } /* for all labels */ hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (mark.flag == 1 && hp_sp->marked == 0) { } else { points[0].x=hp_sp->x0 *size_factor/2; points[0].y=hp_sp->y0 *size_factor/2; points[1].x=hp_sp->x1 *size_factor/2; points[1].y=hp_sp->y1 *size_factor/2; points[2].x=hp_sp->x2 *size_factor/2; points[2].y=hp_sp->y2 *size_factor/2; points[3].x=hp_sp->x3 *size_factor/2; points[3].y=hp_sp->y3 *size_factor/2; switch (hp_sp->type) { case 0: case 1: case 2: PolyBezier(metaDC,points,4); break; ;; case -2: SelectObject(metaDC,dashedpen); PolyBezier(metaDC,points,4); SelectObject(metaDC,pen); break; ;; case -1: SelectObject(metaDC,fill); PolyBezier(metaDC,points,4); SelectObject(metaDC,pen); } if (hp_sp->type > 0) { xbase = 0.7 * 0.7 * 0.7 * (double) hp_sp->x3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->x2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->x1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->x0; ybase = 0.7 * 0.7 * 0.7 * (double) hp_sp->y3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->y2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->y1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->y0; xlen = hp_sp->x3 - xbase; ylen = hp_sp->y3 - ybase; if (xlen != 0) xlen = (int) copysign (50., xlen); if (ylen != 0) ylen = (int) copysign (50., ylen); xside = xbase + 0.15 * ylen; yside = ybase - 0.15 * xlen; if (hp_sp->type == 1) { xend = xbase - 0.15 * ylen; yend = ybase + 0.15 * xlen; x = (xside - hp_sp->x0) * (xside - hp_sp->x0) + (yside - hp_sp->y0) * (yside - hp_sp->y0); tx = (xend - hp_sp->x0) * (xend - hp_sp->x0) + (yend - hp_sp->y0) * (yend - hp_sp->y0); if (tx > x) { xside = xend; yside = yend; } xend = xbase; /*on baseline */ yend = ybase; } else { xend = xbase - 0.15 * ylen; yend = ybase + 0.15 * xlen; } SelectObject(metaDC,fill); points[0].x=hp_sp->x3*size_factor/2; points[0].y=hp_sp->y3*size_factor/2; points[1].x=xside*size_factor/2; points[1].y=yside*size_factor/2; points[2].x=xend*size_factor/2; points[2].y=yend*size_factor/2; Polygon(metaDC,points,3); SelectObject(metaDC,pen); } } hp_sp = hp_sp->next; } mfh=CloseEnhMetaFile(metaDC); DeleteEnhMetaFile(mfh); DeleteDC(metaDC); return (0); } #endif int export_bitmap (char *filename) /* exports the current drawing to an X11 bitmap file */ { int x, y, w, h; struct data *hp_b; struct dc *hp_a; struct spline *hp_sp; int d; int retval; char xfile[512]; Pixmap buffer; GdkPixmap *bitmap; GdkGC *bitmapgc; if (mark.flag && mark.w != 0 && mark.h != 0) { fprintf (stderr, "marked x %d y %d w %d h %d\n",mark.x,mark.y,mark.w,mark.h); x = mark.x * size_factor + 3; y = mark.y * size_factor + 3; w = mark.w * size_factor - 6; h = mark.h * size_factor - 6; } else { /* get true extents of drawing*/ x = 10000; y = 10000; w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); x = MIN (x, hp_b->x); x = MIN (x, hp_b->tx); y = MIN (y, hp_b->y); y = MIN (y, hp_b->ty); hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { w = MAX (w, hp_a->x); if (hp_a->direct > -2) w = MAX (w, hp_a->x + (int)strlen (hp_a->c) * (6 + 2 * size_factor)); h = MAX (h, hp_a->y + 8); x = MIN (x, hp_a->x); if (hp_a->direct < 0) x = MIN (x, hp_a->x - (int)strlen (hp_a->c) * (6 + 2 * size_factor)); y = MIN (y, hp_a->y - 8); hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); x = MIN (x, hp_sp->x0); y = MIN (y, hp_sp->y0); x = MIN (x, hp_sp->x1); y = MIN (y, hp_sp->y1); x = MIN (x, hp_sp->x2); y = MIN (y, hp_sp->y2); x = MIN (x, hp_sp->x3); y = MIN (y, hp_sp->y3); hp_sp = hp_sp->next; } x = (int) (x * size_factor * 0.9); y = (int) (y * size_factor * 0.9); w = (int) (w * size_factor * 1.1 - x); h = (int) (h * size_factor * 1.1 - y); if (x < 0) x = 0; if (y < 0) y = 0; } bitmap = gdk_pixmap_new (drawing_area->window, 1, 1, 1); bitmapgc = gdk_gc_new (bitmap); buffer = XCreatePixmap (GDK_WINDOW_XDISPLAY(picture), GDK_WINDOW_XWINDOW(picture), (unsigned int)w, (unsigned int)h, 1); XCopyPlane (GDK_WINDOW_XDISPLAY(picture), GDK_WINDOW_XWINDOW(picture), buffer, GDK_GC_XGC(bitmapgc), x, y, (unsigned int)w, (unsigned int)h, 0, 0, 1); if ((int)strlen (filename)) { snprintf (xfile,512, "%s", filename); retval = XWriteBitmapFile (GDK_DISPLAY (), xfile, buffer, (unsigned int)w, (unsigned int)h, -1, -1); gdk_pixmap_unref (bitmap); gdk_gc_unref (bitmapgc); XFreePixmap (GDK_DISPLAY (), buffer); return (retval); } return (0); } void xfig_line (FILE * fp, int x, int y, int tx, int ty) /* writes a single line bond in XFig notation */ { fprintf (fp, "%i %i %i %i %i %i %i %i %i %.3f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints); fprintf (fp, "%i %i %i %i\n", x, y, tx, ty); } void xfig_wedge (FILE * fp, int x, int y, int tx, int ty, int factor, int latex) /* writes a wedge definition in XFig notation */ { struct data *hpc; struct xy_co *coord; int d, x1, y1, x2, y2; int bond_already_tuned; float area; x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); hpc = da_root.next; bond_already_tuned = 0; for (d = 0; d < hp->n; d++) { if (hpc->bond == 10) { if ( (abs (hpc->x * factor - tx) < 3 && abs (hpc->y * factor - ty) < 3) || (abs (hpc->tx * factor - tx) < 3 && abs (hpc->ty * factor - ty) < 3)) { coord = center_double_bond (hpc->x, hpc->y, hpc->tx, hpc->ty, db_dist); if (abs (hpc->x * factor - tx) < 3 && abs (hpc->y * factor - ty) < 3) { x1 = coord->x * factor; y1 = coord->y * factor; coord++; x2 = coord->x * factor; y2 = coord->y * factor; } else { x1 = coord->tx * factor; y1 = coord->ty * factor; coord++; x2 = coord->tx * factor; y2 = coord->ty * factor; } area = 0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1)); if (fabs (area) < 76. * factor) { x1 = tx - (int) (0.05 * (float) (ty - y)); y1 = ty + (int) (0.05 * (float) (tx - x)); x2 = tx + (int) (0.05 * (float) (ty - y)); y2 = ty - (int) (0.05 * (float) (tx - x)); } else bond_already_tuned = 1; } } if (hpc->bond == 0 && !bond_already_tuned) { if ((abs (hpc->x * factor - tx) < 3 && abs (hpc->y * factor - ty) < 3) ||(abs (hpc->tx * factor - tx) < 3 && abs (hpc->ty * factor - ty) < 3)) /* let the wedge smooth along a another bond */ { coord = intersect(x,y,x1,y1,hpc->x*factor,hpc->y*factor, hpc->tx*factor,hpc->ty*factor); coord->tx = coord->x; coord->ty = coord->y; coord = intersect(x,y,x2,y2,hpc->x*factor,hpc->y*factor, hpc->tx*factor,hpc->ty*factor); x1 = coord->tx; y1 = coord->ty; x2 = coord->x; y2 = coord->y; area = 0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1)); if (fabs (area) > 3300. * factor || fabs(area) < 1750. * factor) { x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); } } } hpc = hpc->next; } if (!latex) { fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill + 21, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints + 1); fprintf (fp, "%i %i %i %i %i %i\n", x, y, x1, y1, x2, y2); } else { for (d = 0; d < 10; d++) xfig_line (fp, x, y, x1 + d * (x2 - x1) / 10, y1 + d * (y2 - y1) / 10); } } void xfig_wiggly (FILE * fp, int x, int y, int tx, int ty) /* writes a wavy bond in XFig notation */ { int arccode = 5; int arctype = 1; int direction = 1; float xlen, ylen, veclen, boxlen; int boxcorx, boxcory; int i; float center_x, center_y; int xstart, ystart, xmid, ymid, xend, yend; xlen = (float)(tx - x); ylen = (float)(ty - y); veclen = (float)calc_vector (abs (tx - x), abs (ty - y)); boxlen = 0.2 * veclen; boxcorx = (int) ((1. - xlen / veclen) * boxlen / 2); boxcory = (int) ((1. - ylen / veclen) * boxlen / 2); for (i = 0; i < 5; i++) { direction = abs (direction - 1); center_x = x + (0.2 * i + .1) * xlen; center_y = y + (0.2 * i + .1) * ylen; xstart = (int) (x + 0.2 * i * xlen); ystart = (int) (y + 0.2 * i * ylen); xmid = (int) (center_x - boxcorx * pow (-1, (double)i)); ymid = (int) (center_y - boxcory * pow (-1, (double)i)); if (x > tx) { xmid = (int) (center_x + boxcorx * pow (-1, (double)i)); ymid = (int) (center_y + boxcory * pow (-1, (double)i)); } xend = (int) (x + 0.2 * (i + 1) * xlen); yend = (int) (y + 0.2 * (i + 1) * ylen); fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %f %f %i %i %i %i %i %i\n", arccode, arctype, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.cap_style, direction, figline.forward_arrow, figline.backward_arrow, center_x, center_y, xstart, ystart, xmid, ymid, xend, yend); } } void xfig_arrow (FILE * fp, int x, int y, int tx, int ty, int type, int latex) /* writes an arrow in XFig notation */ { float xlen, ylen; float headfact; int xbase, ybase, xside, yside, xend, yend; int i; float veclen; xlen = (float)(tx - x); ylen = (float)(ty - y); headfact = 0.8; xbase = x + headfact * xlen; ybase = y + headfact * ylen; if (select_char (tx,ty,1) != NULL){ veclen = (float)calc_vector(tx-x,ty-y); xbase = x+headfact*xlen-10*xlen/veclen; ybase = y+headfact*ylen-10*ylen/veclen; } xside = (int) (xbase + 0.05 * ylen); yside = (int) (ybase - 0.05 * xlen); xend = (int) (xbase - type * (0.05 * ylen)); /*type=0 (half arrow) ends on baseline, */ yend = (int) (ybase + type * (0.05 * xlen)); /*type=1 is a symmetrical arrowhead */ if (type == 1) { /* symmetrical arrow */ fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow + 1, figline.backward_arrow, figline.npoints); fprintf (fp, "%i %i %f %f %f\n", /* arrow attributes */ 1, /* arrow_type (triangle, as before) */ 1, /* arrow_style (1 == filled) */ 2.00, /* arrow_thickness (1/80inch) */ 72.00, /* arrow_width (fig units (?) ) */ 114.00 /* arrow_height (fig units) */ ); fprintf (fp, "%i %i %i %i\n", x, y, tx, ty); } else { /* half arrow */ /* the line */ fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints); fprintf (fp, "%i %i %i %i\n", x, y, tx, ty); /* and the arrowhead - a filled polyline */ if (!latex) { fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill + 21, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints + 1); fprintf (fp, "%i %i %i %i %i %i\n", tx, ty, xside, yside, xend, yend); } else { for (i = 0; i < 10; i++) xfig_line (fp, tx, ty, xend + i * (xside - xend) / 10, yend + i * (yside - yend) / 10); } } } void xfig_circle (FILE * fp, int x, int y, int tx, int ty) { int radius; float start_ang = 0.; int direction = 1; radius = calc_vector (abs (tx - x), abs (ty - y)); fprintf (fp, "1 3 %i %i %i %i %i %i %i %.4f %i %.4f %i %i %i %i %i %i %i %i\n", figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, direction, start_ang, x, y, radius, radius, tx, ty, tx, ty); } void xfig_spline (FILE * fp, int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int type, int latex) /* draws a spline curve, optionally with full of half arrowhead */ { int xlen, ylen, xbase, ybase, flag; double px0, py0, px1, py1; int i; double t; double dist; int xside, yside, xend, yend; figline.npoints = 21; if (type == -2) { figline.line_style = 2; figline.style_val = 4; } if (type == -1) { figline.area_fill = 20; } /* if (type == 1)*/ /* figline.npoints = 15;*/ /* the line */ fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints); fprintf (fp, "%i %i\n", x0, y0); px0 = (double)x0; py0 = (double)y0; xbase = 0; ybase = 0; flag = 0; for (i = 0; i < figline.npoints -1 ; i++) { t = (float) i / (figline.npoints -2 ); px1 = t * t * t * (double) x3 + 3. * t * t * (1. - t) * (double) x2 + 3. * t * (1. - t) * (1. - t) * (double) x1 + (1. - t) * (1. - t) * (1. - t) * px0; py1 = t * t * t * (double) y3 + 3. * t * t * (1. - t) * (double) y2 + 3. * t * (1. - t) * (1. - t) * (double) y1 + (1. - t) * (1. - t) * (1. - t) * py0; fprintf (fp, "%i %i\n", (int) px1, (int) py1); if (type >= 0) { dist = (x3-px1) * (x3-px1) + (y3-py1) * (y3-py1) ; if (( flag == 0) && ( i == 18 || (i >= 15 && dist < 30000.) ) ) { xbase = (int)px1; ybase = (int)py1; if (dist >30000.) { xbase += (x3-xbase)/2; ybase += (y3-ybase)/2; } flag = 1; } } } figline.line_style = 0; figline.style_val = 0; figline.area_fill = -1; figline.npoints = 2; if (type <= 0) return; xlen = x3 - xbase; ylen = y3 - ybase; if (xlen != 0) xlen = (int) copysign (50., (double)xlen); if (ylen != 0) ylen = (int) copysign (50., (double)ylen); xside = (int) (xbase + 0.5 * ylen); yside = (int) (ybase - 0.5 * xlen); if (type == 1) { xend = (int) (xbase - 0.5 * ylen); yend = (int) (ybase + 0.5 * xlen); px0 = (double)((xside - x0) * (xside - x0) + (yside - y0) * (yside - y0)); px1 = (double)((xend - x0) * (xend - x0) + (yend - y0) * (yend - y0)); if (px1 > px0) { xside = xend; yside = yend; } xend = xbase; /*on baseline */ yend = ybase; } else { xend = (int) (xbase - 0.5 * ylen); yend = (int) (ybase + 0.5 * xlen); } /* add the arrowhead - a filled polyline */ if (!latex) { fprintf (fp, "%i %i %i %i %i %i %i %i %i %f %i %i %i %i %i %i\n", figline.object, figline.sub_type, figline.line_style, figline.thickness, figline.pen_color, figline.fill_color, figline.depth, figline.pen_style, figline.area_fill + 21, figline.style_val, figline.join_style, figline.cap_style, figline.radius, figline.forward_arrow, figline.backward_arrow, figline.npoints + 1); fprintf (fp, "%i %i %i %i %i %i\n", (int) x3, (int) y3, xside, yside, xend, yend); } else { for (i = 0; i < 10; i++) xfig_line (fp, x3, y3, xend + i * (xside - xend) / 10, yend + i * (yside - yend) / 10); } } int exfig (FILE * fp, int latex_flag) /* export the current molecule in the format of Brian Smith' XFig program */ { struct data *hp_b; struct dc *hp_a; struct spline *hp_sp; struct xy_co *coord; int i; float l; int d, x, y, tx, ty; int n; gchar *hpacc,*hpacc_p=NULL; #ifdef GTK2 int tw; static PangoLayout *thelayout; gchar hp_ac; gchar *ccx=malloc(10*sizeof(gchar)); #endif int ulx, uly, lrx, lry; int ha, chl = 0; int fontsize = 12, fzoom = 10; int xpos, offset, fontshrink; int shifted = 0; int nsub, nsup, savedpos; float csize; char symbol[30]; int rval = 0; float charscale; /* scale textlength, width according to zoom factor */ int len; float step; // const int myfontheight[7]={8,8,9,14,12,14,24}; const int myfontheight[7]={8,8,9,14,16,14,24}; #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif savedpos = 0; charscale = 1.05; fzoom=16.; fzoom *= size_factor; if (!fprintf (fp, "#FIG 3.2\n")) return (1); fprintf (fp, "Portrait\n"); fprintf (fp, "Center\n"); fprintf (fp, "Metric\n"); fprintf (fp, "A4\n"); fprintf (fp, "100.00\n"); fprintf (fp, "Single\n"); fprintf (fp, "0\n"); fprintf (fp, "# generated by Chemtool " VERSION "\n"); fprintf (fp, "1200 2\n"); figline.object = 2; figline.sub_type = 1; figline.line_style = 0; figline.thickness = 2; figline.pen_color = 0; figline.fill_color = 7; figline.depth = 100; figline.pen_style = 0; figline.area_fill = -1; figline.style_val = 0.000; figline.join_style = 0; figline.cap_style = 0; figline.radius = -1; figline.forward_arrow = 0; figline.backward_arrow = 0; figline.npoints = 2; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (mark.flag && (hp_b->smarked + hp_b->tmarked) == 0) { } else { figline.pen_color = hp_b->color; figline.fill_color = hp_b->color; coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 12); if(hp_b->bond==11) coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 0); #if 0 if(hp_b->bond==5 || hp_b->bond==6) coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 15); #endif x = coord->x * fzoom; y = coord->y * fzoom; tx = coord->tx * fzoom; ty = coord->ty * fzoom; if ( !use_whiteout) { int siz,j; float lfactor=((float)calc_vector(abs(tx-x),abs(ty-y))/(832.*size_factor)); if (lfactor >1.) lfactor=1.; /* short bonds should not shrink as much, they might vanish completely */ /* extra long bonds, however, need not leave more space around labels */ i=has_label(hp_b->x,hp_b->y); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (zoom_factor <2) siz-= 2-zoom_factor; if (zoom_factor >2) siz+= zoom_factor-2; if (siz <0) siz=0; if (siz >6) siz=6; if (y-ty==0&& hp_a->direct ==0) { if (tx>x) { int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if (strl>1) x+=(strl+1)*fzoom*(siz+1); if (hp_a->c[strlen(hp_a->c)-2]=='_') { x-=fzoom/2*(siz+1); } if (hp_a->c[strlen(hp_a->c)-1]=='}') x-=fzoom/2*(siz+1); } // else // x-=(strlen(hp_a->c)-1)*fzoom*(siz+1); } int ox=x; // fprintf(stderr,"size_factor=%f bondl %d lfactor %f\n",size_factor,calc_vector(abs(tx-x),abs(ty-y)),lfactor); x += (lfactor*fzoom*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); y += (lfactor*fzoom*(siz+1)/calc_vector(abs(tx-ox),abs(ty-y))) *(ty-y); } i=has_label(hp_b->tx,hp_b->ty); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0 ){ if ( hp_a->direct<-1) { if (tx>x) tx-=(strlen(hp_a->c)-1)*fzoom*(siz+1); // else // tx+=(strlen(hp_a->c)-1)*fzoom*(siz+1); } else if ( hp_a->direct==0) { // if (tx>x) // tx-=(strlen(hp_a->c)-1)*fzoom*(siz+1); // else if (txc)-1)*fzoom*(siz+1); } } int otx=tx; tx -= (lfactor*fzoom*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); ty -= (lfactor*fzoom*(siz+1)/calc_vector(abs(otx-x),abs(ty-y))) *(ty-y); } } if (!hp_b->bond) xfig_line (fp, x, y, tx, ty); if (hp_b->bond == 5) { xfig_wedge (fp, x, y, tx, ty, fzoom, latex_flag); } if (hp_b->bond == 6) { len=(int) (calc_vector(abs(tx-x),abs(ty-y))/(8.*fzoom)); if (len <8 ) len=8; step=1./len; for (i = 1; i < len; i=i+1) xfig_line (fp, (int) (x + step * i * (tx - x) - 0.01 * (ty - y) * i), (int) (y + step * i * (ty - y) + 0.01 * (tx - x) * i), (int) (x + step * i * (tx - x) + 0.01 * (ty - y) * i), (int) (y + step * i * (ty - y) - 0.01 * (tx - x) * i)); } if (hp_b->bond == 7) xfig_wiggly (fp, x, y, tx, ty); if (hp_b->bond == 8) xfig_arrow (fp, x, y, tx, ty, 0, latex_flag); if (hp_b->bond == 9) xfig_arrow (fp, x, y, tx, ty, 1, latex_flag); if (hp_b->bond == 11) xfig_circle (fp, x, y, tx, ty); if (hp_b->bond == 10) { figline.thickness = 6; /* 4 ? */ xfig_line (fp, x, y, tx, ty); figline.thickness = 2; /* 1 ? */ } if (hp_b->bond == 12) { figline.line_style = 2; figline.style_val = 4; xfig_line (fp, x, y, tx, ty); figline.line_style = 0; figline.style_val = 0; } if (hp_b->bond == 13) { figline.thickness = 6; figline.pen_color = 7; figline.depth = 85; xfig_line (fp, x + (tx - x) / 8., y + (ty - y) / 8., tx - (tx - x) / 8., ty - (ty - y) / 8.); figline.thickness = 2; figline.pen_color = 0; figline.depth = 80; xfig_line (fp, x, y, tx, ty); figline.depth = 100; } if (hp_b->bond == 4) { coord = center_double_bond (x, y, tx, ty, db_dist * fzoom); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord++; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } if (hp_b->bond == 1 || hp_b->bond == 3) { coord = multi_bonds (x, y, tx, ty, mb_dist * fzoom); xfig_line (fp, x, y, tx, ty); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } if (hp_b->bond == 2 || hp_b->bond == 3) { coord = multi_bonds (tx, ty, x, y, mb_dist * fzoom); xfig_line (fp, x, y, tx, ty); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } if (hp_b->bond == 14) { coord = multi_bonds (x, y, tx, ty, mb_dist * fzoom); xfig_line (fp, x, y, tx, ty); figline.line_style = 1; figline.style_val = 2.; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); figline.line_style = 0; figline.style_val = 0.; } if (hp_b->bond == 15) { coord = multi_bonds (tx, ty, x, y, mb_dist * fzoom); xfig_line (fp, x, y, tx, ty); figline.line_style = 1; figline.style_val = 2.; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); figline.line_style = 0; figline.style_val = 0.; } if (hp_b->bond == 16) { coord = center_double_bond (x, y, tx, ty, db_dist * fzoom); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; coord++; for (i = 0; i < 10; i++) xfig_line (fp, (int) (x + 0.1 * i * (tx - x)), (int) (y + 0.1 * i * (ty - y)), (int) (coord->x + 0.1 * i * (coord->tx - coord->x)), (int) (coord->y + 0.1 * i * (coord->ty - coord->y))); } if (hp_b->bond == 18) { xfig_line (fp, x, y, tx, ty); coord = center_double_bond (x, y, tx, ty, (db_dist+1) * fzoom); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord++; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } if (hp_b->bond == 19) { int tmpx1,tmpx2,tmpy1,tmpy2,tmptx1,tmptx2,tmpty1,tmpty2; coord = center_double_bond (x, y, tx, ty, (db_dist+2) * fzoom); tmpx1=coord->x; tmpy1=coord->y; tmptx1=coord->tx; tmpty1=coord->ty; coord++; tmpx2=coord->x; tmpy2=coord->y; tmptx2=coord->tx; tmpty2=coord->ty; coord = center_double_bond (tmpx1,tmpy1,tmptx1,tmpty1,(db_dist-1)*fzoom); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord++; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord = center_double_bond (tmpx2,tmpy2,tmptx2,tmpty2,(db_dist-1)*fzoom); xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); coord++; xfig_line (fp, coord->x, coord->y, coord->tx, coord->ty); } /* hp_b = hp_b->next;*/ } hp_b = hp_b->next; } figtext.object = 4; figtext.sub_type = 0; figtext.color = 0; figtext.depth = 90; figtext.pen_style = 0; figtext.font = 16; /*16=helvetica*,12=courier */ figtext.font_size = 10; figtext.angle = 0.000; if (!latex_flag) figtext.font_flags = 4; else figtext.font_flags = 6; figtext.height = 180. *charscale; figtext.length = 170. *charscale; hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (mark.flag && hp_a->marked == 0) { } else { fontsize=hp_a->size; if (zoom_factor <2) fontsize-= 2-zoom_factor; if (zoom_factor >2) fontsize+= zoom_factor-2; if (fontsize <0) fontsize=0; if (fontsize >6) fontsize=6; switch (fontsize) { case 0: figtext.font_size = 8; /*8 */ charscale=1.3; break; case 1: figtext.font_size = 10; /*6? */ charscale = 1.25; break; case 2: figtext.font_size = 12; /*9? */ charscale = 0.6; break; case 3: figtext.font_size = 16; /*12? */ charscale = 0.75; break; case 4: figtext.font_size = 18; charscale = 0.6; break; case 5: figtext.font_size = 20; charscale = 0.4; break; case 6: figtext.font_size = 24; charscale = 0.2; break; default: fprintf (stderr, "no figfont parameters for fontsize %d\n", fontsize); rval = 2; } switch (zoom_factor) { case 0: charscale=0.95; break; case 1: charscale = 0.80; break; case 2: charscale = 0.95; break; case 3: charscale = 0.85; break; case 4: charscale = 0.80; break; } /* fzoom = size_factor * 16. ;*/ /* 75dpi screen to 1200dpi FIG */ float cfzoom = fzoom * charscale / size_factor; #ifdef GTK2 if (!thelayout) thelayout = gtk_widget_create_pango_layout(drawing_area,"X"); pango_layout_set_text(thelayout, "X", -1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); pango_layout_get_pixel_size(thelayout, NULL, &ha); //fprintf(stderr,"gtk pixel height %d\n",ha); figtext.height=8*ha; ha = ha/100 *fzoom; #else ha=fzoom * gdk_char_height(font[fontsize],(gchar)'X'); figtext.height=8*ha; #endif int hax=0; #ifdef GTK2 pango_layout_get_pixel_size(thelayout, NULL, &hax); #endif ha=(int)(fzoom/2. * myfontheight[fontsize]); // fprintf(stderr,"fixed ha=%d, calculated %d\n",ha,hax); // figtext.height = 180. *charscale; // figtext.length = 170. *charscale; figtext.color = hp_a->color; if (hp_a->font == 0) figtext.font = 16; /* Helvetica */ else figtext.font = 0; /* Times */ figtext.sub_type = abs (hp_a->direct); switch (hp_a->direct) { case Middle_Text: chl = 0; break; case Left_Text: chl = 9 * fzoom; break; case Right_Text: chl = -9 * fzoom; break; default: fprintf (stderr, "undefined text direction in xfig output\n"); rval = 3; ;; } hpacc=strdup(hp_a->c); nsub = 0; nsup = 0; if ( (int)strlen(hpacc) != g_utf8_strlen(hpacc,-1) ) { gchar *q = g_strdup(hpacc); gchar *c,*cc; gchar *t = g_strdup(hpacc); gsize pos,out; long symb; c=g_convert(hpacc,-1,"ISO8859-1","UTF-8",&pos,&out,NULL); if (!c) { q[0]='\0'; do { c=g_convert(t,-1,"ISO8859-1","UTF-8",&pos,&out,NULL); if (!c) { cc=t+(long)pos; symb=g_utf8_get_char(cc); *cc='\0'; strcat(q,t); switch(symb) { case 923: strcat(q,"@L"); break; case 915: strcat(q,"@G"); break; case 916: case 8710: strcat(q,"@D"); break; case 945: strcat(q,"@a"); break; case 946: strcat(q,"@b"); break; case 947: strcat(q,"@g"); break; case 948: strcat(q,"@d"); break; case 949: strcat(q,"@e"); case 966: strcat(q,"@f"); break; case 967: strcat(q,"@g"); break; case 954: strcat(q,"@k"); break; case 955: strcat(q,"@l"); break; case 956: strcat(q,"@m"); break; case 957: strcat(q,"@n"); break; case 960: strcat(q,"@p"); break; case 961: strcat(q,"@r"); break; case 963: strcat(q,"@s"); break; case 964: strcat(q,"@t"); break; case 8853: strcat(q,"@+"); break; case 8854: strcat(q,"@-"); break; case 8901: strcat(q,"@*"); break; default: break; } *cc=' '; t=g_utf8_find_next_char(cc,NULL); } } while(!c); strcat(q,t); strcpy(hpacc,q); } } for (i = 0; i < (int)strlen (hpacc); ++i) if (hpacc[i] == '\\') hpacc[i] = ' '; if (!strpbrk (hpacc, "@_^|#")) { /* no sub- or superscripts - can write entire label in one go */ /* calculate start position depending on justification */ xpos = hp_a->x * fzoom; csize = (fontsize * fzoom /* * 1.4*/); if (chl < 0) xpos -= (int)strlen (hpacc) * csize; if (chl == 0) xpos -= (int)strlen (hpacc) * csize / 2; ulx = xpos; if (chl > 0) ulx = xpos - csize / 2; /* if (chl == 0) ulx = xpos+ csize/2; */ if (chl < 0) ulx = xpos + csize; uly = hp_a->y * fzoom - ha; lrx = xpos + (int)strlen (hpacc) * csize - csize / 2; if (chl == 0) lrx += csize/2; if (chl < 0) lrx = lrx + csize; lry = hp_a->y * fzoom + ha; /* draw compound object with white box under the text if desired */ if (use_whiteout == 1) fprintf (fp, " 6 %i %i %i %i\n", ulx, uly, lrx, lry); if (use_whiteout == 1 && !latex_flag) { fprintf (fp, " 2 2 0 1 7 7 95 0 20 1 0 0 5 0 0 5\n"); fprintf (fp, "%i %i\n", ulx, uly); fprintf (fp, "%i %i\n", lrx, uly); fprintf (fp, "%i %i\n", lrx, lry); fprintf (fp, "%i %i\n", ulx, lry); fprintf (fp, "%i %i\n", ulx, uly); } if (latex_flag) /* convert special shortcut characters to LaTeX commands */ { int ii,jj; char latexstr[255]; jj=0; for (ii=0;ii<(int)strlen(hpacc);ii++){ if (hpacc[ii] == '' ){ latexstr[jj++]='\0'; strcat(latexstr,"$^{\\\\circ}$"); jj += 10; continue; } if (hpacc[ii] == (char)169 ){ latexstr[jj++]='\0'; strcat(latexstr,"$\\\\copyright$"); jj += 12; continue; } if (hpacc[ii] == (char)174 ){ latexstr[jj++]='\0'; strcat(latexstr,"$\\\\textregistered$"); jj += 17; continue; } if (hpacc[ii] == (char)177 ){ latexstr[jj++]='\0'; strcat(latexstr,"$\\\\pm$"); jj += 5; continue; } if (hpacc[ii]=='%' || hpacc[ii]=='$') { latexstr[jj++]='\\'; latexstr[jj++]='\\'; } latexstr[jj++]=hpacc[ii]; } latexstr[jj]='\0'; fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %f %f %i %i %s\\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size, figtext.angle, figtext.font_flags, figtext.height, figtext.length * (int)strlen (latexstr), hp_a->x * fzoom - chl, hp_a->y * fzoom + ha, latexstr); } else { //{ float tlen=0.; int cw; #ifdef GTK2 gchar *c,*t; gsize pos,out; c=g_convert(hpacc,-1,"ISO8859-1","UTF-8",&pos,&out,NULL); if (!c) { t=hpacc+(long)pos; c=g_convert_with_fallback(hpacc,-1,"ISO8859-1","UTF-8","?",NULL,NULL,NULL); } #else char *c = strdup(hpacc); #endif #ifdef GTK2 gchar *cx; cx=g_locale_to_utf8(hpacc,-1,NULL,NULL,NULL); if (!cx) cx = g_convert(hpacc,-1,"UTF-8","ISO8859-1",NULL,NULL,NULL); if (!cx) { fprintf(stderr,"invalid character cx in chemtool file\n"); return 1; } if (!thelayout) thelayout = gtk_widget_create_pango_layout(drawing_area,cx); pango_layout_set_text(thelayout, cx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &cw, NULL); tlen =cw; #else for (k=0;k<(int)strlen(hpacc);k++){ cw=gdk_char_width(font[fontsize],(gchar)hpacc[k]); tlen+=1.3*cw; if (hpacc[k]==' ') tlen+=1.2*cw; } #endif fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %.2f %.2f %i %i %s\\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size, figtext.angle, figtext.font_flags, figtext.height, // figtext.length * (int)strlen (hp_a->c), 11.4*tlen, (int)(hp_a->x * fzoom - chl ), hp_a->y * fzoom + ha, c); } if (use_whiteout==1) fprintf (fp, "-6\n"); /* close block (around whiteout and label) */ } else { /* special formatting needed, every character becomes a separate entity */ figtext.sub_type = 1; /* have xfig center characters at the calculated position */ l = 0; #ifdef GTK2 if (!thelayout) thelayout = gtk_widget_create_pango_layout(drawing_area,hpacc); pango_layout_set_font_description(thelayout,font[fontsize]); n = (int) g_utf8_strlen(hpacc,-1); #else n = (int)strlen (hpacc); #endif hpacc_p=hpacc; /* first loop - determine approximate length of label after processing */ /* for sizing the compound box and optional white rectangle under text */ for (i = 0; i < n; i++) { #ifdef GTK2 if (i>0) hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; g_utf8_strncpy(&hp_ac,hpacc,1); #else hp_ac= hpacc[i]; #endif switch (hp_ac) { case '@': i++; if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #ifdef GTK2 if (i>0) hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+= tw*cfzoom; #else l+=gdk_char_width(symbfont[fontsize],hpacc[i])*fzoom; #endif break; case '#': i++; if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #ifdef GTK2 if (i>0) hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,boldfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+= tw/2.*cfzoom; #else l+=gdk_char_width(boldfont[fontsize],hpacc[i])*fzoom; #endif break; case '|': i++; #if !defined GTK2 if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #else hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); if (hp_ac=='}'|| hp_ac == '{') { i++; hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); } #endif #ifdef GTK2 g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,slfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+=tw/2.*cfzoom; #else l+=gdk_char_width(slfont[fontsize],hpacc[i])*fzoom; #endif break; case '}': case '{': break; case '_': nsub=1; i++; #if !defined GTK2 if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #else hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); if (hp_ac=='}'|| hp_ac == '{') { i++; hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); } #endif #ifdef GTK2 g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+=tw*cfzoom; #else l+=gdk_char_width(smallfont[fontsize],hpacc[i])*fzoom; #endif break; case '^': nsup=1; i++; if (hpacc[i]=='}' || hpacc[i]=='{' ) i++; #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) break; hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+=tw*cfzoom; #else l+=gdk_char_width(smallfont[fontsize],hpacc[i])*fzoom; #endif break; default: #ifdef GTK2 g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); l+=tw*cfzoom; #else l+=gdk_char_width(font[fontsize],hpacc[i])*fzoom; #endif } } xpos = hp_a->x * fzoom ; #ifdef GTK2 g_utf8_strncpy(ccx,hpacc_p,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+tw *cfzoom; #else csize = gdk_char_width(font[fontsize],hpacc[0])*fzoom*2; #endif if (chl < 0) { xpos = hp_a->x * fzoom - (l-csize); } if (chl == 0) xpos = hp_a->x * fzoom - l / 2; /* glue text into compound for easier editing in xfig */ ulx = xpos -csize/2; uly = hp_a->y * fzoom - ha; lrx = xpos + l ; if (chl < 0) lrx = xpos + (l - 1); lry = hp_a->y * fzoom + ha; if (nsup != 0) uly -= ha; /* height adjustment for */ if (nsub != 0) lry += ha; /* sub- and superscript */ fprintf (fp, " 6 %i %i %i %i\n", ulx, uly, lrx, lry); /*whiteout box*/ if (use_whiteout == 1 && !latex_flag) { fprintf (fp, " 2 2 0 1 7 7 95 0 20 1 0 0 5 0 0 5\n"); fprintf (fp, "%i %i\n", ulx, uly); fprintf (fp, "%i %i\n", lrx, uly); fprintf (fp, "%i %i\n", lrx, lry); fprintf (fp, "%i %i\n", ulx, lry); fprintf (fp, "%i %i\n", ulx, uly); } /* second loop - for each character, determine its width, draw it and advance the text position */ nsub=nsup=0; hpacc=hpacc_p; for (i = 0; i < n; i++) { csize=0.; offset = 0; fontshrink = 0; if (hp_a->font == 0) figtext.font = 16; /*Helvetica */ else figtext.font = 0; /* Times */ /*default: regular character */ #ifdef GTK2 g_utf8_strncpy(&hp_ac,hpacc,1); #else hp_ac= hpacc[i]; #endif #ifdef GTK2 if (i>0) hpacc=g_utf8_find_next_char(hpacc,NULL); if (!hpacc) {fprintf(stderr,"eos1\n"); break; } hp_ac= g_utf8_get_char(hpacc); if (!hp_ac) {fprintf(stderr,"eos2\n"); break; } g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; /* convert from screen font width to xfig character size */ #else csize = (1+gdk_char_width(font[fontsize],hp_ac)) * cfzoom; #endif if (shifted != 0) /* if sub- or superscripting already in progress */ { if (hp_ac == '}') /* end of sub/superscript, reset flag and treat next character as normal */ { shifted = 0; offset = 0; i++; if (i >= n) break; #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(font[fontsize],hp_ac)) * fzoom; #endif } else /* still sub- or superscripting */ { offset = shifted; #ifdef GTK2 g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(smallfont[fontsize],hp_ac)) * fzoom; #endif } } if (hp_ac == '_') { #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(smallfont[fontsize],hpacc[i+1])) * fzoom; #endif offset = ha / 2; nsub = nsub + 1; if (nsub == 1) { if (nsup > 0) xpos = savedpos; else savedpos = xpos; } nsup = 0; } if (hp_ac == '^') { offset = -ha; /* offset = -ha / 2;*/ #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(smallfont[fontsize],hpacc[i+1])) * fzoom; #endif nsup = nsup + 1; if (nsup == 1) { if (nsub > 0) xpos = savedpos; else savedpos = xpos; } nsub = 0; } if (offset != 0) { if (shifted == 0) { i++; if (hp_ac == '{') { shifted = offset; i++; #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(smallfont[fontsize],hp_ac)) * fzoom; #endif } } if (i >= n) break; if (hp_ac != '-' && hp_ac != '+') fontshrink = 4; offset = offset * 2; /* xpos -= csize*.75;*/ #if !defined(GTK2) xpos -= csize*.35; #endif } else { /*reset sub- and superscript counters */ nsub = 0; nsup = 0; } if (hp_ac == '@') { figtext.font = 32; #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(symbfont[fontsize],hpacc[i+1])) * fzoom; i++; #endif } if (hp_ac == '|') { if (figtext.font <16) figtext.font = 1; /* Times Italic */ else figtext.font = 17; /* Helvetica Oblique */ #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,slfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+2*gdk_char_width(slfont[fontsize],hpacc[i+1])) * fzoom; #endif if (chl > 0) xpos-= csize; i++; } if (hp_ac == '#') { if (figtext.font < 16) figtext.font = 2 ; /* Times Bold */ else figtext.font = 18; /* Helvetica Bold */ #ifdef GTK2 hpacc=g_utf8_find_next_char(hpacc,NULL); hp_ac= g_utf8_get_char(hpacc); g_utf8_strncpy(ccx,hpacc,1); pango_layout_set_text(thelayout, ccx, -1); pango_layout_set_font_description(thelayout,boldfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, NULL); csize= 1+ tw *cfzoom; #else csize = (1+gdk_char_width(boldfont[fontsize],hpacc[i+1])) * fzoom; #endif if (chl > 0) xpos-= csize; i++; } if (i>0)xpos += csize/2.; //advance to center of this character if (latex_flag) { #ifdef GTK2 if (figtext.font == 32 /* use TeX names for symbols */ || (unsigned char) hp_ac > 128 || hp_ac=='%' || hp_ac =='$' || hp_ac=='+' || hp_ac=='-') #else if (figtext.font == 32 /* use TeX names for symbols */ || (unsigned char) hpacc[i] > 128 || hpacc[i]=='%' || hpacc[i]=='$' || hpacc[i]=='+' || hpacc[i]=='-') #endif { #ifdef GTK2 switch ((unsigned char)hp_ac) #else switch ((unsigned char) hpacc[i]) #endif { case 'a': strcpy (symbol, "$\\\\alpha$"); break; case 'b': strcpy (symbol, "$\\\\beta$"); break; case 'c': strcpy (symbol, "$\\\\chi$"); break; case 'd': strcpy (symbol, "$\\\\delta$"); break; case 'e': strcpy (symbol, "$\\\\varepsilon$"); break; case 'f': strcpy (symbol, "$\\\\phi$"); break; case 'g': strcpy (symbol, "$\\\\gamma$"); break; case 'h': strcpy (symbol, "$\\\\eta$"); break; case 'i': strcpy (symbol, "$\\\\iota$"); break; case 'j': strcpy (symbol, "$\\\\varphi$"); break; case 'k': strcpy (symbol, "$\\\\kappa$"); break; case 'l': strcpy (symbol, "$\\\\lambda$"); break; case 'm': strcpy (symbol, "$\\\\mu$"); break; case 'n': strcpy (symbol, "$\\\\nu$"); break; case 'p': strcpy (symbol, "$\\\\pi$"); break; case 'q': strcpy (symbol, "$\\\\theta$"); break; case 'r': strcpy (symbol, "$\\\\rho$"); break; case 's': strcpy (symbol, "$\\\\sigma$"); break; case 't': strcpy (symbol, "$\\\\tau$"); break; case 'u': strcpy (symbol, "$\\\\upsilon$"); break; case 'v': strcpy (symbol, "$\\\\varpi$"); break; case 'w': strcpy (symbol, "$\\\\omega$"); break; case 'x': strcpy (symbol, "$\\\\xi$"); break; case 'y': strcpy (symbol, "$\\\\psi$"); break; case 'z': strcpy (symbol, "$\\\\zeta$"); break; case 'C': strcpy (symbol, "X"); break; case 'D': strcpy (symbol, "$\\\\Delta$"); break; case 'F': strcpy (symbol, "$\\\\Phi$"); break; case 'G': strcpy (symbol, "$\\\\Gamma$"); break; case 'J': strcpy (symbol, "$\\\\vartheta$"); break; case 'L': strcpy (symbol, "$\\\\Lambda$"); break; case 'P': strcpy (symbol, "$\\\\Pi$"); break; case 'Q': strcpy (symbol, "$\\\\Theta$"); break; case 'R': strcpy (symbol, "P"); break; case 'S': strcpy (symbol, "$\\\\Sigma$"); break; case 'U': strcpy (symbol, "$\\\\Upsilon$"); break; case 'V': strcpy (symbol, "$\\\\varsigma$"); break; case 'W': strcpy (symbol, "$\\\\Omega$"); break; case 'X': strcpy (symbol, "$\\\\Xi$"); break; case 'Y': strcpy (symbol, "$\\\\Psi$"); break; case (unsigned char) 173: strcpy (symbol, "$\\\\uparrow$"); break; case (unsigned char) 175: strcpy (symbol, "$\\\\downarrow$"); break; case (unsigned char) 174: strcpy (symbol,"$\\\\textregistered$"); break; case '%': strcpy (symbol, "\\\\%"); break; case '$': strcpy (symbol, "\\\\$"); break; case (unsigned char) 176: strcpy(symbol, "$^{\\\\circ}$"); break; case (unsigned char) 177: strcpy(symbol, "$\\\\pm$"); break; case (unsigned char) 169: strcpy(symbol, "$\\\\copyright$"); break; case '+': strcpy(symbol,"$\\oplus$"); break; case '-': strcpy(symbol,"$\\ominus$"); break; default: fprintf (stderr, "no translation for %d\n", (unsigned char) hpacc[i]); symbol[0] = hpacc[i]; symbol[1] = '\0'; break; } fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %f %f %i %i %s \\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size - fontshrink, figtext.angle, figtext.font_flags, figtext.height, figtext.length, xpos, hp_a->y * fzoom + ha + offset, symbol); } else { fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %f %f %i %i %c\\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size - fontshrink, figtext.angle, figtext.font_flags, figtext.height, figtext.length, xpos, hp_a->y * fzoom + ha + offset, hpacc[i]); } } else { /* not in LaTeX mode */ fprintf (fp, "%i %i %i %i %i %i %d %.4f %i %f %f %i %i %c\\001\n", figtext.object, figtext.sub_type, figtext.color, figtext.depth, figtext.pen_style, figtext.font, figtext.font_size - fontshrink, figtext.angle, figtext.font_flags, figtext.height, (double)csize, xpos, hp_a->y * fzoom + ha + offset, hp_ac); if ((hp_ac=='+' || hp_ac=='-') && figtext.font == 32) //ionic charge symbol: add its circle fprintf(fp,"1 3 0 2 0 7 50 -1 -1 0.000 1 0.0000 %i %i %i %i %i %i %i %i\n", xpos,hp_a->y*fzoom+ha/2-2+offset, (figtext.font_size-fontshrink)*6, (figtext.font_size-fontshrink)*6,xpos,hp_a->y*fzoom+ha/2-2+offset, xpos+((figtext.font_size-fontshrink)*6), hp_a->y*fzoom+ha/2-2+offset); } xpos += csize/2.; //advance from center to end of character box } /*for i */ fprintf (fp, "-6\n"); /* close this compound */ } #ifdef GTK2 n = (int) g_utf8_strlen(hpacc,-1); #else n = (int)strlen (hpacc); #endif for (i = 0; i < n; ++i) if (hpacc[i] == ' ') hpacc[i] = '\\'; } if (hpacc_p) { free(hpacc_p); hpacc_p=NULL; } hp_a = hp_a->next; } free(ccx); figline.pen_color = 0; /* reset after linedrawing */ hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (mark.flag == 1 && hp_sp->marked == 0) { } else { figline.pen_color=hp_sp->color; figline.fill_color=hp_sp->color; xfig_spline (fp, hp_sp->x0 * fzoom, hp_sp->y0 * fzoom, hp_sp->x1 * fzoom, hp_sp->y1 * fzoom, hp_sp->x2 * fzoom, hp_sp->y2 * fzoom, hp_sp->x3 * fzoom, hp_sp->y3 * fzoom, hp_sp->type, latex_flag); } hp_sp = hp_sp->next; } return (rval); } int export_xfig (char *filename) /* initiate exporting of the current molecule in plain XFig format */ { FILE *xfile; int rval; if ((int)strlen (filename)) { xfile = fopen (filename, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (fclose (xfile) != 0) { perror ("could not close fig file"); return (1); } return (rval); } return (1); } int export_latex_pic (char *filename, float scale) /* export molecule as a pictex file by writing a temporary XFig file and postprocessing that with fig2dev */ { char com[255]; FILE *xfile; int rval; if (figversion == 0) return (1); /* cannot export without fig2dev */ if ((int)strlen (filename)) { snprintf (com,255, "fig2dev -Lpictex -m %f > \"%s\"", scale, filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 1); if (pclose (xfile) != 0) return (1); return (rval); } else return (1); } int export_ps_pic (char *filename, float scale) /* export molecule as a postscript file by writing a temporary XFig file and postprocessing that with fig2dev */ { char com[255]; FILE *xfile; int rval; char *epso[4] = {" ","-A","-T","-C"}; char intl[3]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if (figversion == 0) return (1); /* cannot export without fig2dev */ if (use_intlchars) strcpy(intl,"-j"); else strcpy(intl,""); if ((int)strlen (filename)) { if (figversion == 1) snprintf (com,255, "fig2dev %s -Lps -m %f > \"%s\"", intl, scale, filename); else if (figversion == 2) snprintf (com,255, "fig2dev %s -L eps -m %f > \"%s\"", intl, scale, filename); else snprintf (com,255, "fig2dev %s -L eps %s -m %f -g \\%s> \"%s\"", intl,epso[epsoption], scale, bghexcolor, filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (rval != 0) return (rval); rval=pclose(xfile); if (rval != 0) return (1); else return (rval); } else return (1); } int export_png_pic (char *filename, float scale) /* export molecule as a png file by writing a temporary XFig file and postprocessing that with fig2dev */ { char com[255]; FILE *xfile; int rval; char intl[3]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if (figversion == 0) return (1); /* cannot export without fig2dev */ if (use_intlchars) strcpy(intl,"-j"); else strcpy(intl,""); if ((int)strlen (filename)) { if (figversion == 1) snprintf (com,255, "fig2dev %s -Lpng -m %f > \"%s\"", intl, scale, filename); else if (figversion == 2) snprintf (com,255, "fig2dev %s -L png -S 4 -F -m %f > \"%s\"", intl, scale, filename); else snprintf (com,255, "fig2dev %s -L png -g \\%s -S 4 -F -m %f > \"%s\"", intl, bghexcolor, scale, filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (rval != 0) return (rval); rval=pclose(xfile); if (rval != 0) return (1); else return (rval); } else return (1); } int print_ps_pic () /* Print molecule to a postscript printer by creating an XFig datastream and postprocessing that with fig2dev */ { char com[255]; int rval; FILE *xfile; char intl[3]; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif if (figversion == 0) return (1); /* cannot print without fig2dev */ if (use_intlchars) strcpy(intl,"-j"); else strcpy(intl,""); if (figversion == 1) snprintf (com,255, "fig2dev %s -L ps -z %s -P %s -e -m %f | %s%s", intl,paper[papersize], orientation[orient], printscale, printcommand[printcmd], queuename); else if (figversion == 2) snprintf (com,255, "fig2dev %s -L ps -z %s %s -e -m %f | %s%s", intl,paper[papersize], orientation[orient], printscale, printcommand[printcmd], queuename); else snprintf (com,255, "fig2dev %s -L ps -g \\%s -z %s %s -e -m %f | %s%s", intl,bghexcolor,paper[papersize], orientation[orient], printscale, printcommand[printcmd], queuename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (rval != 0) return (rval); rval=pclose(xfile); if (rval != 0) return (1); else return (rval); } int export_fw (char *filename) /* save file and postprocess it with cht */ { char com[255]; char xfile[512]; int rval; FILE *chtpipe; FILE *fp; int fd; if ((int)strlen (filename)) { strcpy (xfile, "/tmp/chtXXXXXX"); /*@ignore@ splint does not recognize mkstemp */ fd = mkstemp (xfile); /*@end@*/ if (fd == -1) return 1; snprintf (com,255, "cht %s", xfile); fp = fdopen (fd, "w"); save_mol (fp, mark.flag); fclose (fp); chtpipe = popen (com, "r"); if (!chtpipe) return (1); rval = fscanf (chtpipe, "%20s %20s %20s %64s", formula, weight, eweight, compos); rval = pclose (chtpipe); unlink (xfile); return (rval); } else return (1); } int readrc () { FILE *fp; int i; char key[20], value[100]; char line[80]; gchar *filename; char *epso[4] = { "None","EPSI","TIFFm","TIFFc" }; filename = g_malloc (PATH_MAX + 1); filename = strncat (strncpy (filename, g_get_home_dir (), PATH_MAX), "/.chemtoolrc", PATH_MAX); fp = fopen (filename, "r"); if (!fp) { g_free (filename); return 1; } else { while (!feof (fp)) { if (fgets (line, (int)sizeof (line), fp)) { i = sscanf (line, "%s %s", key, value); if (i < 2) continue; if (!strcmp (key, "orientation")) { if (!strcmp (value, "portrait")) orient = 0; else orient = 1; } if (!strcmp (key, "papersize")) { for (i = 0; i < 11; i++) if (!strcmp (value, paper[i])) papersize = i; } if (!strcmp (key, "printcommand")) { for (i = 0; i < (int)strlen (value); i++) if (value[i] == '\\') value[i] = ' '; for (i = 0; i < 3; i++) if (!strcmp (value, printcommand[i])) printcmd = i; } if (!strcmp (key, "printer")) strcpy (queuename, value); if (!strcmp (key, "printscale")) printscale = atof (value); if (!strcmp (key, "epsoption")) for (i = 0; i < 4; i++) { if (!strcmp (value, epso[i])) epsoption = i; } if (!strcmp (key, "whiteout")) use_whiteout = atoi (value); if (!strcmp (key, "intlchars")) use_intlchars = atoi (value); if (!strcmp (key, "datadir")) strcpy (datadir, value); if (!strcmp (key, "extension")) strcpy (datamask, value); if (!strcmp (key, "bondlength")){ bondlen_mm= atof(value); if (bondlen_mm != 0 && bondlen_mm != 10.668) size_factor*=bondlen_mm/10.668; } if (!strcmp (key, "double_separation")){ db_dist = atoi(value); if (db_dist <= 0 || db_dist >100) db_dist=4; mb_dist = (int) ( ( (float)db_dist )* 2.5 ); } if (!strcmp (key, "background")){ i=sscanf(value,"(%d,%d,%d)",&bgred,&bggreen,&bgblue); if (i<3) bgred=bggreen=bgblue=65535; } } } fclose (fp); g_free (filename); return 0; } } int writerc () { FILE *fp; char *pcomm[4] = { "lpr\\-P", "lp\\-d", "kprinter -d","gtklp -d"}; char *ori[2] = { "portrait", "landscape" }; char *epso[4] = { "None","EPSI","TIFFm","TIFFc" }; gchar *filename; filename = g_malloc (PATH_MAX + 1); filename = strncat (strncpy (filename, g_get_home_dir (), PATH_MAX), "/.chemtoolrc", PATH_MAX); fp = fopen (filename, "w"); if (!fp) { g_free (filename); return 1; } else { fprintf (fp, "datadir %s\n", datadir); fprintf (fp, "extension %s\n", datamask); fprintf (fp, "papersize %s\n", paper[papersize]); fprintf (fp, "orientation %s\n", ori[orient]); fprintf (fp, "printscale %f\n", printscale); fprintf (fp, "printcommand %s\n", pcomm[printcmd]); fprintf (fp, "printer %s\n", queuename); fprintf (fp, "bondlength %6.4f\n", bondlen_mm); fprintf (fp, "double_separation %d\n", db_dist); fprintf (fp, "epsoption %s\n", epso[epsoption]); fprintf (fp, "whiteout %d\n", use_whiteout); fprintf (fp, "intlchars %d\n", use_intlchars); fprintf (fp, "background (%d,%d,%d)\n", bgred,bggreen,bgblue); fclose (fp); g_free (filename); return 0; } } void check_fig2dev () { char cmd[20]; FILE *xfile; float version; float ref=3.2; int pl; int rval; #ifdef GTK2 setlocale (LC_NUMERIC,"C"); #endif snprintf (cmd,20, "fig2dev -V"); xfile = popen (cmd, "r"); rval = fscanf (xfile, "%*s %*s %f %*s %d", &version, &pl); rval = pclose (xfile); if (rval != 0) figversion = 0; /* fig2dev not found */ else { if (version < ref || (version == ref && pl < 3)) figversion = 1; /* "old" fig2dev, needs -Lps */ else figversion = 2; /* new fig2dev, knows -L eps */ if (version > ref || (version == ref && pl >3)) figversion = 3; /* 3.2.4 can generate previews in eps file */ } } void check_babel () { char cmd[20]; char data[80]; FILE *xfile; /* float version;*/ int rval; int start=0; int obmajor=0,obminor=0,obrel=0; babelin=-1; babelout=-1; memset(data,'\0',80); snprintf (cmd,20, "babel 2>/dev/null"); xfile = popen (cmd, "r"); if (!xfile)return; if (!fgets (data,80,xfile)){ pclose(xfile); return; } if (!strncmp(data,"Open",4)) { /* OpenBabel 1.x */ strcpy(babeloutp,"--"); sscanf(data,"%*s %*s %d.%d.%d",&obmajor,&obminor,&obrel); if (obmajor*10000+obminor*10+obrel >= 11001) { rval=pclose(xfile); snprintf(cmd,20,"babel -H"); xfile = popen (cmd, "r"); } } else if (!strncmp(data,"No output",9)) { /* OpenBabel 2.x */ strcpy(babeloutp,"--"); rval=pclose(xfile); snprintf(cmd,20,"babel -H"); xfile = popen (cmd, "r"); } else /* original babel 1.6 */ strcpy(babeloutp,"CON"); while (!feof(xfile)) { if (fgets (data,80,xfile)) { if (!strncmp(data,"Currently",9)|| !strncmp(data,"The following",13)) { start=1; break; } } } if (start == 0) { rval = pclose(xfile); snprintf(cmd,20,"babel -L formats"); xfile = popen (cmd, "r"); start = 1; } babelin=-1; inmode=NULL; intype=NULL; babelout=-1; outmode=NULL; outtype=NULL; if (start==1){ while (!feof(xfile)){ (void)fgets (data, 80, xfile); if (feof(xfile)) break; if (!strncmp(data,"Currently",9)|| !strncmp(data,"See further",11)) { babelin--; babelout--; break; }else if (strstr(data,"Write-only")==NULL) { babelin++; inmode = realloc (inmode, (babelin + 1) * sizeof (char *)); inmode[babelin] = malloc (9 * sizeof (char)); intype = realloc (intype, (babelin + 1) * sizeof (char *)); intype[babelin] = malloc (39 * sizeof (char)); sscanf(data,"%s -- %36[a-zA-Z0-9 -]",inmode[babelin],intype[babelin]); } if (strstr(data,"Read-only")==NULL) { babelout++; outmode = realloc (outmode, (babelout + 1) * sizeof (char *)); outmode[babelout] = malloc (10 * sizeof (char)); outtype = realloc (outtype, (babelout + 1) * sizeof (char *)); outtype[babelout] = malloc (39 * sizeof (char)); sscanf(data,"%s -- %36[a-zA-Z0-9 -]",outmode[babelout],outtype[babelout]); } } } rval = pclose (xfile); if (rval != 0 && babelin <=0 ) fprintf(stderr,_("Consider installing Babel/OpenBabel for file format conversions...\n")); #if 0 else { for (start=0;start<=babelin;start++) fprintf(stderr,"BABEL input %s : %s\n",inmode[start],intype[start]); for (start=0;start<=babelout;start++) fprintf(stderr,"BABEL output %s : %s\n",outmode[start],outtype[start]); } #endif } int export_sxd (char *filename) /* export molecule as a pictex file by writing a temporary XFig file and postprocessing that with fig2sxd */ { char com[255]; FILE *xfile; int rval; if (have_fig2sxd == 0) return (1); /* cannot export without fig2sxd */ if ((int)strlen (filename)) { snprintf (com,255, "fig2sxd - \"%s\"", filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = exfig (xfile, 0); if (pclose (xfile) < 0) return (1); return (rval); } else return (1); } void check_fig2sxd () { char cmd[20]; FILE *xfile; char myname[10]; have_fig2sxd = 0; snprintf (cmd,20, "fig2sxd 2>&1"); xfile = popen (cmd, "r"); if (!xfile) return; fscanf (xfile, "%s", myname); pclose (xfile); if (!strncmp(myname,"fig2sxd",7)) have_fig2sxd = 1; } int export_babel (char *filename) /* export molecule by writing a temporary molfile and postprocessing that with (open)babel, adding explicit hydrogens if necessary */ { char com[255]; FILE *xfile; int rval; if ((int)strlen (filename)) { snprintf (com,255, "babel -h -imol %s -o%s \"%s\"", babeloutp, babel, filename); xfile = popen (com, "w"); if (!xfile) return (1); rval = export_mdl_mol (xfile, 1); if (pclose (xfile) < 0) return (1); return (rval); } else return (1); } int export_asy (char *filename) /* exports the current drawing to an input file for Asymptote */ { FILE *fp; int x, y, tx, ty, w, h; int x1,y1,x2,y2; float area; float factor; struct data *hp_b,*hp_bx; struct dc *hp_a; struct spline *hp_sp; struct xy_co *coord; int d, i, dd; int xbase, ybase, xside, yside, xend, yend, xlen, ylen; int unicodechar; int bond_already_tuned=0; static char asycolor[7][8]={"black","blue","green","cyan","red","magenta", "yellow"}; #ifdef GTK2 setlocale(LC_NUMERIC,"C"); #endif if ((fp = fopen (filename, "w")) == NULL) return (1); if (mark.flag && mark.w != 0 && mark.h != 0) { w = mark.w * size_factor - 6; h = mark.h * size_factor - 6; } else { /* get true extents of drawing*/ w = 0; h = 0; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { w = MAX (w, hp_b->x); w = MAX (w, hp_b->tx); h = MAX (h, hp_b->y); h = MAX (h, hp_b->ty); hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { w = MAX (w, hp_a->x); if (hp_a->direct > -2) w = MAX (w, hp_a->x + (int)strlen (hp_a->c) * (6 + 2 * size_factor)); h = MAX (h, hp_a->y + 8); hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { w = MAX (w, hp_sp->x0); h = MAX (h, hp_sp->y0); w = MAX (w, hp_sp->x1); h = MAX (h, hp_sp->y1); w = MAX (w, hp_sp->x2); h = MAX (h, hp_sp->y2); w = MAX (w, hp_sp->x3); h = MAX (h, hp_sp->y3); hp_sp = hp_sp->next; } w = (int) (w * 1.1) ; h = (int) (h * 1.1) ; } // fprintf (fp, "size (%d,%d)\n\n",w,h); fprintf(fp,"import fontsize;\n"); fprintf(fp,"defaultpen(Helvetica());\n"); fprintf(fp,"picture pic;\n"); fprintf(fp,"unitsize(pic,mm);\n"); //fprintf(fp,"size (%d,0);\n",w/2); hp_b = da_root.next; for (d = 0; d < hp->n; d++) { if (mark.flag && (hp_b->smarked + hp_b->tmarked) == 0) { } else { coord = bond_cut (hp_b->x, hp_b->y, hp_b->tx, hp_b->ty, 12); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; if ( !use_whiteout) { int siz,j; float lfactor=((float)calc_vector(abs(tx-x),abs(ty-y))/(832.*size_factor)); if (lfactor >1.) lfactor=1.; /* short bonds should not shrink as much, they might vanish completely */ /* extra long bonds, however, need not leave more space around labels */ i=has_label(hp_b->x,hp_b->y); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0&& hp_a->direct ==0) { if (tx>x) { int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if (strl>1) x+=strl*(siz+1); } // else // x-=(strlen(hp_a->c)-1)*fzoom*(siz+1); } int ox=x; x += (lfactor*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); y += (lfactor*(siz+1)/calc_vector(abs(tx-ox),abs(ty-y))) *(ty-y); } i=has_label(hp_b->tx,hp_b->ty); if (i>=0) { hp_a = dac_root.next; for (j = 0; j < i; j++)hp_a=hp_a->next; siz=2*hp_a->size; if (y-ty==0 ){ int strl=0; for (i=0;i<(int)strlen(hp_a->c);i++) { if(hp_a->c[i] != '_' && hp_a->c[i] != '^' && hp_a->c[i] != '{' && hp_a->c[i] != '{') strl++; } if ( hp_a->direct<-1) { if (tx>x) tx-=(strl-1)*(siz+1); // else // tx+=(strlen(hp_a->c)-1)*(siz+1); } else if ( hp_a->direct==0) { // if (tx>x) // tx-=(strlen(hp_a->c)-1)*fzoom*(siz+1); // else if (txbond) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, tx, h-ty,asycolor[hp_b->color]); } if (hp_b->bond == 5) { bond_already_tuned = 0; x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); factor=1.; hp_bx=da_root.next; for (dd = 0; dd < hp->n; dd++) { if (hp_bx->bond == 10) { if ( (abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) || (abs (hp_bx->tx * factor - tx) < 3 && abs (hp_bx->ty * factor - ty) < 3)) { coord = center_double_bond (hp_bx->x, hp_bx->y, hp_bx->tx, hp_bx->ty, db_dist); if (abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) { x1 = coord->x * factor; y1 = coord->y * factor; coord++; x2 = coord->x * factor; y2 = coord->y * factor; } else { x1 = coord->tx * factor; y1 = coord->ty * factor; coord++; x2 = coord->tx * factor; y2 = coord->ty * factor; } area = (0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1))); if (fabs (area) < 76. * factor) { x1 = tx - (int) (0.05 * (float) (ty - y)); y1 = ty + (int) (0.05 * (float) (tx - x)); x2 = tx + (int) (0.05 * (float) (ty - y)); y2 = ty - (int) (0.05 * (float) (tx - x)); } else bond_already_tuned = 1; } /* if connected to wide end of this wedge */ } /* if adjoining bond is wide */ if (hp_bx->bond == 0 && !bond_already_tuned) { if ((abs (hp_bx->x * factor - tx) < 3 && abs (hp_bx->y * factor - ty) < 3) ||(abs (hp_bx->tx * factor - tx) < 3 && abs (hp_bx->ty * factor - ty) < 3)) /* let the wedge join smoothly alongside another bond */ { coord = intersect(x,y,x1,y1,hp_bx->x*factor,hp_bx->y*factor, hp_bx->tx*factor,hp_bx->ty*factor); coord->tx = coord->x; coord->ty = coord->y; coord = intersect(x,y,x2,y2,hp_bx->x*factor,hp_bx->y*factor, hp_bx->tx*factor,hp_bx->ty*factor); x1 = coord->tx; y1 = coord->ty; x2 = coord->x; y2 = coord->y; area = 0.5 * abs (x * (y1 - y2) + x1 * (y2 - y) + x2 * (y - y1)); if (fabs (area) > 3300. * factor || fabs(area) < 1750. * factor) { x1 = tx - (int) (0.1 * (float) (ty - y)); y1 = ty + (int) (0.1 * (float) (tx - x)); x2 = tx + (int) (0.1 * (float) (ty - y)); y2 = ty - (int) (0.1 * (float) (tx - x)); } } /* if connected to wide end of this wedge */ } /* if adjoining bond is single, and not already adjusted */ hp_bx = hp_bx->next; } /* for dd */ fprintf (fp, "fill(pic, (%d,%d)--(%d,%d)--(%d,%d)--cycle,%s);\n", x, h-y, x1,h-y1,x2,h-y2,asycolor[hp_b->color]); /* fprintf (fp, " points=\"%d,%d %d,%d %d,%d\" />\n", x, y, (int) (tx - 0.08 * (ty - y)), (int) (ty + 0.08 * (tx - x)), (int) (tx + 0.08 * (ty - y)), (int) (ty - 0.08 * (tx - x))); */ } if (hp_b->bond == 6) { for (i = 0; i < 8; i++) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", (int) (x + 0.125 * i * (tx - x) - 0.01 * (ty - y) * i), (int) (h-(y + 0.125 * i * (ty - y) + 0.01 * (tx - x) * i)), (int) (x + 0.125 * i * (tx - x) + 0.01 * (ty - y) * i), (int) (h-(y + 0.125 * i * (ty - y) - 0.01 * (tx - x) * i)), asycolor[hp_b->color]); } } if (hp_b->bond == 7) { fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),false),%s);\n", x+(tx-x)/10,h-(y+(ty-y)/10), x,h-y, x+(tx-x)/5,h-(y+(ty-y)/5), asycolor[hp_b->color]); fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),true),%s);\n", x+3*(tx-x)/10,h-(y+3*(ty-y)/10), x+(tx-x)/5,h-(y+(ty-y)/5), x+2*(tx-x)/5,h-(y+2*(ty-y)/5), asycolor[hp_b->color]); fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),false),%s);\n", x+5*(tx-x)/10,h-(y+5*(ty-y)/10), x+2*(tx-x)/5,h-(y+2*(ty-y)/5), x+3*(tx-x)/5,h-(y+3*(ty-y)/5),asycolor[hp_b->color]); fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),true),%s);\n", x+7*(tx-x)/10,h-(y+7*(ty-y)/10),x+3*(tx-x)/5,h-(y+3*(ty-y)/5), x+4*(tx-x)/5,h-(y+4*(ty-y)/5), asycolor[hp_b->color]); fprintf(fp, "draw (pic, arc((%d,%d),(%d,%d),(%d,%d),false),%s);\n", x+9*(tx-x)/10,h-(y+9*(ty-y)/10),x+4*(tx-x)/5,h-(y+4*(ty-y)/5), tx,h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 8) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, (int)(x+0.8*(tx-x)), (int)(h-(y+0.8*(ty-y))),asycolor[hp_b->color]); fprintf (fp, "fill(pic, (%d,%d)--(%d,%d)--(%d,%d)--cycle,%s);\n", (int) (x + 0.8 * (tx - x)), (int) (h-(y + 0.8 * (ty - y))), (int) (x + 0.8 * (tx - x) + 0.1 * (ty - y)), (int) (h-(y + 0.8 * (ty - y) - 0.1 * (tx - x))), tx, h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 9) { int xlen = tx - x; int ylen = ty - y; float veclen = sqrt ((double)(xlen * xlen + ylen * ylen)); float scalefact=64./veclen; /* keep arrowhead size constant (64=std length)*/ int xbase = (int) (tx - 0.2 *xlen*scalefact); int ybase = (int) (ty - 0.2 *ylen*scalefact); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, xbase, h-ybase, asycolor[hp_b->color]); fprintf (fp, "fill(pic, (%d,%d)--(%d,%d)--(%d,%d)--cycle,%s);\n", tx, h-ty,(int)(xbase + 0.1 * ylen*scalefact), (int)(h-(ybase - 0.1 * xlen*scalefact)) , (int)(xbase - 0.1 * ylen*scalefact), (int)(h-(ybase + 0.1 * xlen*scalefact)), asycolor[hp_b->color] ); /*(int) (x + 0.8 * (tx - x) + 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) - 0.1 * (tx - x)), (int) (x + 0.8 * (tx - x) - 0.1 * (ty - y)), (int) (y + 0.8 * (ty - y) + 0.1 * (tx - x)));*/ } if (hp_b->bond == 11) { fprintf (fp, "draw(pic,circle((%d,%d),%d.),%s);\n", x, h-y, calc_vector (x - tx, y - ty),asycolor[hp_b->color]); } if (hp_b->bond == 10) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s+squarecap+linewidth(10));\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 12) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s+dotted);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 13) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),rgb(%.3f,%.3f,%.3f)+squarecap+linewidth(3));\n", x + (tx - x) / 4, h-(y + (ty - y) / 4), tx - (tx - x) / 4, h-(ty - (ty - y) / 4), bgred/65535.,bggreen/65535.,bgblue/65535.); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); } if (hp_b->bond == 4) { coord = center_double_bond (x, y, tx, ty, db_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord++; fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 1 || hp_b->bond == 3) { coord = multi_bonds (x, y, tx, ty, mb_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d),%s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 2 || hp_b->bond == 3) { coord = multi_bonds (tx, ty, x, y, mb_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty,asycolor[hp_b->color]); } if (hp_b->bond == 14) { coord = multi_bonds (x, y, tx, ty, mb_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s+longdashed);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 15) { coord = multi_bonds (tx, ty, x, y, mb_dist); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s+longdashed);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 16) { coord = center_double_bond (x, y, tx, ty, db_dist); x = coord->x; y = coord->y; tx = coord->tx; ty = coord->ty; coord++; for (i = 0; i < 10; i++) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", (int) (x + 0.1 * i * (tx - x)), (int) (h-(y + 0.1 * i * (ty - y))), (int) (coord->x + 0.1 * i * (coord->tx - coord->x)), (int) (h-(coord->y + 0.1 * i * (coord->ty - coord->y))), asycolor[hp_b->color]); } } if (hp_b->bond == 18) { fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", x, h-y, tx, h-ty, asycolor[hp_b->color]); coord = center_double_bond (x, y, tx, ty, db_dist+1); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord++; fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } if (hp_b->bond == 19) { int tmpx1,tmpx2,tmpy1,tmpy2,tmptx1,tmptx2,tmpty1,tmpty2; coord = center_double_bond (x, y, tx, ty, db_dist+1); tmpx1=coord->x; tmpy1=coord->y; tmptx1=coord->tx; tmpty1=coord->ty; coord++; tmpx2=coord->x; tmpy2=coord->y; tmptx2=coord->tx; tmpty2=coord->ty; coord = center_double_bond (tmpx1, tmpy1, tmptx1, tmpty1, db_dist-1); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord++; fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord = center_double_bond (tmpx2, tmpy2, tmptx2, tmpty2, db_dist-1); fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); coord++; fprintf (fp, "draw(pic, (%d,%d)--(%d,%d), %s);\n", coord->x, h-coord->y, coord->tx, h-coord->ty, asycolor[hp_b->color]); } } hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { if (mark.flag && hp_a->marked == 0) { } else { fprintf(fp,"frame f;\n"); fprintf (fp,"label(f,\"$\\mathrm{"); for (i = 0; i < (int)strlen (hp_a->c); ++i) { if (hp_a->c[i] == '\\') hp_a->c[i] = ' '; if (hp_a->c[i] == '@') { unicodechar=848+hp_a->c[++i]; switch (unicodechar){ /* catch sequence mismatches with X Symbol font*/ case 915: /*C*/ case 947: /*c*/ unicodechar+=20; break; case 918: case 950: /*f*/ unicodechar+=16; break; case 919: case 951: /*g*/ unicodechar-=4; break; case 920: case 952: /*h*/ unicodechar-=1; break; case 922: /*J is vartheta*/ unicodechar=977; break; case 954: /*j is varphi*/ unicodechar=981; break; case 923: case 924: case 925: case 955: case 956: case 957: unicodechar-=1; break; case 926: /*N*/ unicodechar=78; break; case 958: /*n*/ unicodechar=118; break; case 929: /*Q*/ unicodechar=920; break; case 961: /*p*/ unicodechar=952; break; case 962: unicodechar-=1; break; case 966:/*v*/ unicodechar=982; break; case 967: /*w*/ unicodechar=969; break; case 968: unicodechar=958; break; case 969: unicodechar-=1; break; case 970: unicodechar=950; break; case 930: /*R*/ unicodechar-=1; break; case 934: /*V*/ unicodechar=962; break; case 935: /*W*/ unicodechar+=2; break; case 936: /*X*/ unicodechar=926; break; case 937: /*Y*/ unicodechar-=1; break; case 938: unicodechar=90; break; case 1031: case 775: /* bullet */ unicodechar=8226; break; case 891: //oplus unicodechar=8853; break; case 893: //ominus unicodechar=8854; break; default: break; } fprintf (fp, "&#%04d;", unicodechar); /*FIXME: unicode greek does not always map to X11 Symbol, e.g. F is Z not Phi */ } else if (hp_a->c[i] == '#') { fprintf (fp, "{\\bf "); fprintf (fp, "%c", hp_a->c[++i]); fprintf (fp, "}"); } else if (hp_a->c[i] == '|') { fprintf (fp, "{\\it"); fprintf (fp, "%c", hp_a->c[++i]); fprintf (fp, "}"); } else fprintf (fp, "%c", hp_a->c[i]); } if (hp_a->c[i]==' ') /* protect blanks again after output */ hp_a->c[i]='\\'; } fprintf( fp,"}$\",NoAlign,%s);\n",asycolor[hp_a->color]); switch (hp_a->direct) { case 0: fprintf (fp, "add(pic,f,(%d%s,%d));\n",hp_a->x,"+(max(f).x-min(f).x)/2.5",h-hp_a->y); break; case -1: fprintf (fp, "add(pic,f,(%d,%d));\n",hp_a->x,h-hp_a->y); break; case -2: fprintf (fp, "add(pic,f,(%d%s,%d));\n",hp_a->x,"-(max(f).x-min(f).x)/4",h-hp_a->y); break; } hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (mark.flag == 1 && hp_sp->marked == 0) { } else { if (hp_sp->type == -1) fprintf (fp, "fill (pic, (%d,%d)..", hp_sp->x0, h-hp_sp->y0); else fprintf (fp, "draw (pic, (%d,%d)..", hp_sp->x0, h-hp_sp->y0); fprintf (fp, "controls (%d,%d) and (%d,%d)..(%d,%d)", hp_sp->x1, h-hp_sp->y1, hp_sp->x2, h-hp_sp->y2, hp_sp->x3, h-hp_sp->y3); /* fprintf (fp, "x0, h-hp_sp->y0); fprintf (fp, "C %d,%d %d,%d %d,%d\"\n", hp_sp->x1, h-hp_sp->y1, hp_sp->x2, h-hp_sp->y2, hp_sp->x3, h-hp_sp->y3); */ switch (hp_sp->type) { case 0: case 1: case 2: fprintf (fp, ",%s);\n",asycolor[hp_sp->color]); break; ;; case -2: fprintf (fp, ",%s+longdashed);\n",asycolor[hp_sp->color]); break; ;; case -1: fprintf (fp, "--cycle,%s);\n",asycolor[hp_sp->color]); } if (hp_sp->type > 0) { xbase = (int) (0.7 * 0.7 * 0.7 * (double) hp_sp->x3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->x2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->x1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->x0); ybase = (int) (0.7 * 0.7 * 0.7 * (double) hp_sp->y3 + 3. * 0.7 * 0.7 * (1. - 0.7) * (double) hp_sp->y2 + 3. * 0.7 * (1. - 0.7) * (1. - 0.7) * (double) hp_sp->y1 + (1. - 0.7) * (1. - 0.7) * (1. - 0.7) * hp_sp->y0); xlen = hp_sp->x3 - xbase; ylen = hp_sp->y3 - ybase; if (xlen != 0) xlen = (int) copysign (50., (double)xlen); if (ylen != 0) ylen = (int) copysign (50., (double)ylen); xside = (int) (xbase + 0.15 * ylen); yside = (int) (ybase - 0.15 * xlen); if (hp_sp->type == 1) { xend = (int) (xbase - 0.15 * ylen); yend = (int) (ybase + 0.15 * xlen); x = (xside - hp_sp->x0) * (xside - hp_sp->x0) + (yside - hp_sp->y0) * (yside - hp_sp->y0); tx = (xend - hp_sp->x0) * (xend - hp_sp->x0) + (yend - hp_sp->y0) * (yend - hp_sp->y0); if (tx > x) { xside = xend; yside = yend; } xend = xbase; /*on baseline */ yend = ybase; } else { xend = (int) (xbase - 0.15 * ylen); yend = (int) (ybase + 0.15 * xlen); } fprintf (fp, "fill (pic, (%d,%d)--(%d,%d)--(%d,%d)--cycle,%s);\n", hp_sp->x3, h-hp_sp->y3, xside, h-yside, xend, h-yend, asycolor[hp_sp->color]); } } hp_sp = hp_sp->next; } fprintf(fp,"add(pic);\n"); if (strcmp(bghexcolor,"#ffffff")) fprintf(fp,"shipout(bbox(pic,2mm,Fill(rgb %.3f,%.3f,%.3f)));\n",bgred/65535.,bggreen/65535.,bgblue/65535.); fclose (fp); return (0); } chemtool-1.6.14/inout.h0000644000175000001440000000501210715417303014134 0ustar martinusers struct xfig_line { int object; /* (always 2) */ int sub_type; /* (1: polyline */ /* 2: box */ /* 3: polygon */ /* 4: arc-box) */ /* 5: imported-picture bounding-box) */ int line_style; /* (enumeration type) */ int thickness; /* (1/80 inch) */ int pen_color; /* (enumeration type, pen color) */ int fill_color; /* (enumeration type, fill color) */ int depth; /* (enumeration type) */ int pen_style; /* (pen style, not used) */ int area_fill; /* (enumeration type, -1 = no fill) */ float style_val; /* (1/80 inch) */ int join_style; /* (enumeration type) */ int cap_style; /* (enumeration type, only used for POLYLINE) */ int radius; /* (1/80 inch, radius of arc-boxes) */ int forward_arrow; /* (0: off, 1: on) */ int backward_arrow; /* (0: off, 1: on) */ int npoints; /* (number of points in line) */ } figline; struct xfig_text { int object; /* (always 4) */ int sub_type; /* (0: Left justified */ /* 1: Center justified */ /* 2: Right justified) */ int color; /* (enumeration type) */ int depth; /* (enumeration type) */ int pen_style; /* (enumeration , not used) */ int font; /* (enumeration type) */ int font_size; /* (font size in points) */ float angle; /* (radians, the angle of the text) */ int font_flags; /* (bit vector) */ float height; /* (Fig units) */ float length; /* (Fig units) */ } figtext; struct xfig_ellipse { int object_code; /* (always 1) */ int sub_type; /* (1: ellipse defined by radiuses */ /* 2: ellipse defined by diameters */ /* 3: circle defined by radius */ /* 4: circle defined by diameter) */ int line_style; /* (enumeration type) */ int thickness; /* (1/80 inch) */ int pen_color; /* (enumeration type, pen color) */ int fill_color; /* (enumeration type, fill color) */ int depth; /* (enumeration type) */ int pen_style; /* (pen style, not used) */ int area_fill; /* (enumeration type, -1 = no fill) */ float style_val; /* (1/80 inch) */ int direction; /* (always 1) */ float angle; /* (radians, the angle of the x-axis) */ int center_x, center_y; /* (Fig units) */ int radius_x, radius_y; /* (Fig units) */ int start_x, start_y; /* (Fig units; the 1st point entered) */ int end_x, end_y; /* (Fig units;the last point entered) */ } figellipse; #ifdef HAVE_CONFIG_H #include #endif #include #include double pdbxcent,pdbycent,pdbzcent; extern struct xy_co *bond_cut(int x, int y, int tx, int ty, int r); extern int has_label (int, int); chemtool-1.6.14/configure.ac0000644000175000001440000001415711675350245015134 0ustar martinusersdnl Process this file with autoconf to produce a configure script. AC_INIT(Chemtool,1.6.13,martin@ruby.chemie.uni-freiburg.de,chemtool) AC_CONFIG_SRCDIR(main.c) AM_INIT_AUTOMAKE(chemtool, 1.6.13) AC_CONFIG_HEADER(config.h) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION(0.14.1) dnl Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_LN_S AC_PATH_PROG(CP,cp) AC_PATH_PROG(RM,rm) dnl Checks for libraries. dnl Replace `main' with a function in -libs: AC_CHECK_LIB(ibs, main) dnl Replace `main' with a function in -lm: AC_CHECK_LIB(m, acos) AC_DEFINE([LIBUNDO],1,[Define if you want to use the built-in undo functionality]) AC_DEFINE([MENU],1,[Define if you want to use pull-down menus instead of button bars]) AC_ARG_ENABLE(enable_gtk1, [ --enable-gtk1 Use GTK+-1.x even if GTK+-2.x is available [no]],enable_gtk1=no) AC_PATH_PROG(PKG_CONFIG, pkg-config, no) AC_MSG_CHECKING([for GTK version and compile options ]) if test x$PKG_CONFIG = xno -o x$enable_gtk1 = xyes ; then AM_PATH_GTK(1.0.2, , exit 1) else if $PKG_CONFIG gtk+-2.0 --cflags ; then GTK_CFLAGS="-DGTK2 `$PKG_CONFIG gtk+-2.0 --cflags` " GTK_LIBS=`$PKG_CONFIG gtk+-2.0 --libs` dnl use_gtk2=yes AC_DEFINE([GTK2], [1], [the GTK2 library]) enable_stockgtk=yes else if $PKG_CONFIG --cflags gtk+ ; then GTK_CFLAGS=`$PKG_CONFIG gtk+ --cflags` GTK_LIBS=`$PKG_CONFIG gtk+ --libs` dnl use_gtk2=no fi fi fi dnl AC_MSG_RESULT using GTK2 : $use_gtk2 dnl Checks for header files. AC_PATH_XTRA AC_HEADER_DIRENT AC_HEADER_STDC LDFLAGS="$X_LIBS" AC_CHECK_LIB([X11],[XOpenDisplay]) dnl just an ugly hack to work around the more aggressive header checks dnl in recent autoconf. Not sure if we should really rely on include dnl paths being provided in CPPFLAGS, not CFLAGS, or if a nested set dnl of tests encompassing all dependent headers would be in order. dnl dnl saved_CPPFLAGS=$CPPFLAGS dnl CPPFLAGS="$CFLAGS $CPPFLAGS" AC_CHECK_HEADERS(strings.h unistd.h libintl.h) dnl CPPFLAGS=$saved_CPPFLAGS dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_STRUCT_TM dnl Checks for library functions. AC_FUNC_FNMATCH AC_FUNC_MEMCMP AC_FUNC_MMAP AC_CHECK_FUNCS(getcwd getwd mkdir strtod strtol) dnl Optional stuff AC_ARG_WITH(localedir, [ --with-localedir=DIR Set locale directory=DIR [DATADIR/locale]], localedir=$withval, [localedir=$datadir/locale]) dnl AC_DEFINE_UNQUOTED(LOCALEDIR=$withval), dnl [AC_DEFINE_UNQUOTED(LOCALEDIR="\"\$datadir/locale"\")]) dnl " dnl Optional stuff AC_ARG_WITH(kdedir, [ --with-kdedir=DIR Set KDE directory=DIR [/opt/kde3,/opt/kde2,/opt/kde]], kdedir=$withval, [kdedir="/opt/kde3 /opt/kde2 /opt/kde"]) AC_MSG_CHECKING([for KDE ]) for the_kdedir in $kdedir; do if test -d $the_kdedir/share/mimelnk ; then kdemimedir=$the_kdedir AC_MSG_RESULT([apparently in $kdemimedir]) break; else KDEMIMEDIR=$KDEDIR if test -d $KDEMIMEDIR/share/mimelnk; then AC_MSG_RESULT([apparently in $KDEMIMEDIR]) kdemimedir=$KDEMIMEDIR fi fi done if test "x$kdemimedir" = "x" ; then AC_MSG_RESULT([no]) fi dnl AC_DEFINE_UNQUOTED(KDEDIR=$withval), dnl [AC_DEFINE_UNQUOTED(KDEDIR="\"\/opt/kde"\")]) dnl " dnl Optional stuff AC_ARG_WITH(gnomedir, [ --with-gnomedir=DIR Set GNOME directory=DIR [/usr]], gnomedir=$withval, [gnomedir=/usr]) AC_MSG_CHECKING([for GNOME ]) if test -d $gnomedir/share/mime-info ; then gnomemimedir=$gnomedir AC_MSG_RESULT([apparently in $gnomemimedir]) else GNOMEMIMEDIR=$GNOMEDIR if test -d $GNOMEMIMEDIR/share/mime-info; then AC_MSG_RESULT([apparently in $GNOMEMIMEDIR]) gnomemimedir=$GNOMEMIMEDIR fi fi if test "x$GNOMEMIMEDIR" = "x" ; then AC_MSG_RESULT([no]) fi dnl AC_DEFINE_UNQUOTED(GNOMEMIMEDIR=$withval), dnl [AC_DEFINE_UNQUOTED(GNOMEMIMEDIR="\"\/usr"\")]) dnl " dnl AC_MSG_CHECKING(whether to enable locales) dnl AC_ARG_ENABLE(locales, dnl [ --enable-locales Support localised messages [yes]],,enable_locales=yes) dnl if test x$enable_locales = xyes; then dnl if test "$ac_cv_header_libintl_h" = "yes" dnl then dnl AC_MSG_RESULT(yes) dnl AC_DEFINE_UNQUOTED([LOCALEDIR=\"\$datadir/locale\"],[],[]) dnl else dnl AC_MSG_RESULT(no) dnl AC_DEFINE([DISABLE_NLS],[1],[]) dnl fi dnl else dnl AC_MSG_RESULT(no) dnl AC_DEFINE([DISABLE_NLS],[1],[]) dnl fi AC_MSG_CHECKING(whether to enable libundo) AC_ARG_ENABLE(undo, [ --enable-undo Build with libundo [yes]],,enable_undo=yes) if test x$enable_undo = xyes; then AC_MSG_RESULT(yes) AC_DEFINE([LIBUNDO],[1],[the undo library is available]) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(whether to use pull-down menus) AC_ARG_ENABLE(menu, [ --enable-menu Enable new style pull-down-menu [yes]],,enable_menu=yes) if test x$enable_menu = xyes; then AC_MSG_RESULT(yes) AC_DEFINE([MENU],[1],[]) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(whether to enable emf output) AC_ARG_ENABLE(emf, [ --enable-emf Enable enhanced metafile output via libEMF [no]],,enable_emf=no) if test x$enable_emf = xyes; then AC_MSG_RESULT(yes) AC_DEFINE([EMF], [1], [use optional libEMF instead of fig2dev for EMF output]) EMFLIBS="-lEMF -lstdc++" else AC_MSG_RESULT(no) EMFLIBS="" fi AC_MSG_CHECKING(whether standard GTK dialogs should be used instead of our own) AC_ARG_ENABLE(stockgtk, [ --enable-stockgtk use standard GTK menu and fileselection widgets [no]],,enable_stockgtk=no) if test x$enable_stockgtk = xyes; then AC_MSG_RESULT(yes) MYGTKSRCS="" MYGTKOBJS="" else AC_MSG_RESULT(no) ac_sys_system=`uname -s` if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "CYGWIN"; then AC_MSG_RESULT([ sorry, overriding library functions is impossible on your system, enforcing "yes"]) MYGTKSRCS="" MYGTKOBJS="" else MYGTKSRCS="gtkmenu.c gtkfilesel.c" MYGTKOBJS="gtkmenu.o gtkfilesel.o" if test "$ac_sys_system" = "Darwin" ; then LDFLAGS="-force_flat_namespace ${LDFLAGS}" fi fi fi dnl X_LIBS="$X_PRE_LIBS $X_LIBS $XLIB" AC_SUBST(localedir) AC_SUBST(localedir) AC_SUBST(kdemimedir) AC_SUBST(gnomemimedir) AC_SUBST(EMFLIBS) AC_SUBST(MYGTKSRCS) AC_SUBST(MYGTKOBJS) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) dnl AC_SUBST(X_LIBS) AC_OUTPUT(Makefile src-cht/Makefile m4/Makefile po/Makefile.in po/Makefile ) chemtool-1.6.14/src-cht/0000755000175000001440000000000012202262405014164 5ustar martinuserschemtool-1.6.14/src-cht/cht-2.6.c0000644000175000001440000026613410715417303015433 0ustar martinusers/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */ /* From input file "cht-1.7.pp" */ #ifdef HAVE_CONFIG_H #include #endif #ifndef P2C_H #define P2C_H /* Header file for code generated by "p2c", the Pascal-to-C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version 1.21alpha-07.Dec.93. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #include #include #define DOUBLE double /* If the following heuristic fails, compile -DBSD=0 for non-BSD systems, or -DBSD=1 for BSD systems. */ #ifdef M_XENIX # define BSD 0 #endif #ifdef vms # define BSD 0 # ifndef __STDC__ # define __STDC__ 1 # endif #endif #ifdef __TURBOC__ # define MSDOS 1 #endif #ifdef MSDOS # define BSD 0 #endif #ifdef FILE /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */ # ifndef BSD /* (a convenient, but horrible kludge!) */ # define BSD 1 # endif #endif #ifdef BSD # if !BSD # undef BSD # endif #endif #if (defined(__STDC__) && !defined(M_XENIX)) || defined(__TURBOC__) # include # include # define HAS_STDLIB # if defined(vms) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #else # ifndef BSD # ifndef __TURBOC__ # include # endif # endif # ifdef hpux # ifdef _INCLUDE__STDC__ # include # include # define HAS_STDLIB # endif # endif # include # if !defined(MSDOS) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #endif #if defined(NON_ANSI_CAT) && !defined(ANSI_CAT) # ifdef NON_ANSI_CAT_ALTERNATE # define __CAT__(a,b)a/**/b # else # define __ID__(a)a # define __CAT__(a,b)__ID__(a)b # endif #else # define __CAT__(a,b)a##b #endif #ifdef BSD # include # define memcpy(a,b,n) (bcopy(b,a,n),a) # define memcmp(a,b,n) bcmp(a,b,n) # define strchr(s,c) index(s,c) # define strrchr(s,c) rindex(s,c) #else # include #endif #include #include #include #include #ifndef NO_LACK #ifdef vms #define LACK_LABS #define LACK_MEMMOVE #define LACK_MEMCPY #else #define LACK_LABS /* Undefine these if your library has these */ #define LACK_MEMMOVE #endif #endif typedef struct __p2c_jmp_buf { struct __p2c_jmp_buf *next; jmp_buf jbuf; } __p2c_jmp_buf; /* Warning: The following will not work if setjmp is used simultaneously. This also violates the ANSI restriction about using vars after longjmp, but a typical implementation of longjmp will get it right anyway. */ #ifndef FAKE_TRY # define TRY(x) do { __p2c_jmp_buf __try_jb; \ __try_jb.next = __top_jb; \ if (!setjmp((__top_jb = &__try_jb)->jbuf)) { # define RECOVER(x) __top_jb = __try_jb.next; } else { # define RECOVER2(x,L) __top_jb = __try_jb.next; } else { \ if (0) { L: __top_jb = __try_jb.next; } # define ENDTRY(x) } } while (0) #else # define TRY(x) if (1) { # define RECOVER(x) } else do { # define RECOVER2(x,L) } else do { L: ; # define ENDTRY(x) } while (0) #endif #ifdef M_XENIX /* avoid compiler bug */ # define SHORT_MAX (32767) # define SHORT_MIN (-32768) #endif /* The following definitions work only on twos-complement machines */ #ifndef SHORT_MAX # define SHORT_MAX ((short)(((unsigned short) -1) >> 1)) # define SHORT_MIN (~SHORT_MAX) #endif #ifndef INT_MAX # define INT_MAX ((int)(((unsigned int) -1) >> 1)) # define INT_MIN (~INT_MAX) #endif #ifndef LONG_MAX # define LONG_MAX ((long)(((unsigned long) -1) >> 1)) # define LONG_MIN (~LONG_MAX) #endif #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 #endif #ifndef EXIT_SUCCESS # ifdef vms # define EXIT_SUCCESS 1 # define EXIT_FAILURE (02000000000L) # else # define EXIT_SUCCESS 0 # define EXIT_FAILURE 1 # endif #endif #define SETBITS 32 #if defined(__STDC__) || defined(__TURBOC__) # if !defined(vms) && !defined(M_LINT) # define Signed signed # else # define Signed # endif # define Void void /* Void f() = procedure */ # ifndef Const # define Const const # endif # ifndef Volatile # define Volatile volatile # endif # ifdef M_LINT # define PP(x) () # define PV() () typedef char *Anyptr; # else # define PP(x) x /* function prototype */ # define PV() (void) /* null function prototype */ typedef void *Anyptr; # endif #else # define Signed # define Void void # ifndef Const # define Const # endif # ifndef Volatile # define Volatile # endif # define PP(x) () # define PV() () typedef char *Anyptr; #endif #ifdef __GNUC__ # define Inline inline #else # define Inline #endif #define Register register /* Register variables */ #define Char char /* Characters (not bytes) */ #ifndef Static # define Static static /* Private global funcs and vars */ #endif #ifndef Local # define Local static /* Nested functions */ #endif typedef Signed char schar; typedef unsigned char uchar; typedef unsigned char boolean; #ifndef NO_DECLARE_ALFA typedef Char alfa[10]; #endif #ifndef true # define true 1 # define false 0 #endif #ifndef TRUE # define TRUE 1 # define FALSE 0 #endif typedef struct { Anyptr proc, link; } _PROCEDURE; #ifndef _FNSIZE # define _FNSIZE 120 #endif extern Void PASCAL_MAIN PP( (int, Char **) ); extern Char **P_argv; extern int P_argc; extern short P_escapecode; extern int P_ioresult; extern __p2c_jmp_buf *__top_jb; #ifdef P2C_H_PROTO /* if you have Ansi C but non-prototyped header files */ extern Char *strcat PP( (Char *, Const Char *) ); extern Char *strchr PP( (Const Char *, int) ); extern int strcmp PP( (Const Char *, Const Char *) ); extern Char *strcpy PP( (Char *, Const Char *) ); extern size_t strlen PP( (Const Char *) ); extern Char *strncat PP( (Char *, Const Char *, size_t) ); extern int strncmp PP( (Const Char *, Const Char *, size_t) ); extern Char *strncpy PP( (Char *, Const Char *, size_t) ); extern Char *strrchr PP( (Const Char *, int) ); extern Anyptr memchr PP( (Const Anyptr, int, size_t) ); extern Anyptr memmove PP( (Anyptr, Const Anyptr, size_t) ); extern Anyptr memset PP( (Anyptr, int, size_t) ); #ifndef memcpy extern Anyptr memcpy PP( (Anyptr, Const Anyptr, size_t) ); extern int memcmp PP( (Const Anyptr, Const Anyptr, size_t) ); #endif extern int atoi PP( (Const Char *) ); extern double atof PP( (Const Char *) ); extern long atol PP( (Const Char *) ); extern double strtod PP( (Const Char *, Char **) ); extern long strtol PP( (Const Char *, Char **, int) ); #endif /*P2C_H_PROTO*/ #ifndef HAS_STDLIB #ifndef NO_DECLARE_MALLOC extern Anyptr malloc PP( (size_t) ); extern Void free PP( (Anyptr) ); #endif #endif extern int _OutMem PV(); extern int _CaseCheck PV(); extern int _NilCheck PV(); extern int _Escape PP( (int) ); extern int _EscIO PP( (int) ); extern int _EscIO2 PP( (int, Char *) ); extern long ipow PP( (long, long) ); extern long P_imax PP( (long, long) ); extern long P_imin PP( (long, long) ); extern double P_rmax PP( (double, double) ); extern double P_rmin PP( (double, double) ); extern Char *strsub PP( (Char *, Char *, int, int) ); extern Char *strltrim PP( (Char *) ); extern Char *strrtrim PP( (Char *) ); extern Char *strrpt PP( (Char *, Char *, int) ); extern Char *strpad PP( (Char *, Char *, int, int) ); extern int strpos2 PP( (Char *, Char *, int) ); extern long memavail PV(); extern int P_peek PP( (FILE *) ); extern int P_eof PP( (FILE *) ); extern int P_eoln PP( (FILE *) ); extern Void P_readpaoc PP( (FILE *, Char *, int) ); extern Void P_readlnpaoc PP( (FILE *, Char *, int) ); extern long P_maxpos PP( (FILE *) ); extern Char *P_trimname PP( (Char *, int) ); extern long *P_setunion PP( (long *, long *, long *) ); extern long *P_setint PP( (long *, long *, long *) ); extern long *P_setdiff PP( (long *, long *, long *) ); extern long *P_setxor PP( (long *, long *, long *) ); extern int P_inset PP( (unsigned, long *) ); extern int P_setequal PP( (long *, long *) ); extern int P_subset PP( (long *, long *) ); extern long *P_addset PP( (long *, unsigned) ); extern long *P_addsetr PP( (long *, unsigned, unsigned) ); extern long *P_remset PP( (long *, unsigned) ); extern long *P_setcpy PP( (long *, long *) ); extern long *P_expset PP( (long *, long) ); extern long P_packset PP( (long *) ); extern FILE *_skipspaces PP( (FILE *) ); extern FILE *_skipnlspaces PP( (FILE *) ); /* I/O error handling */ #define _CHKIO(cond,ior,val,def) ((cond) ? P_ioresult=0,(val) \ : P_ioresult=(ior),(def)) #define _SETIO(cond,ior) (P_ioresult = (cond) ? 0 : (ior)) /* Following defines are suitable for the HP Pascal operating system */ #define FileNotFound 10 #define FileNotOpen 13 #define FileWriteError 38 #define BadInputFormat 14 #define EndOfFile 30 #define FILENOTFOUND 10 #define FILENOTOPEN 13 #define FILEWRITEERROR 38 #define BADINPUTFORMAT 14 #define ENDOFFILE 30 /* Creating temporary files */ #if (defined(BSD) || defined(NO_TMPFILE)) && !defined(HAVE_TMPFILE) # define tmpfile() (fopen(tmpnam(NULL), "w+")) #endif /* File buffers */ #define FILEBUF(f,sc,type) sc int __CAT__(f,_BFLAGS); \ sc type __CAT__(f,_BUFFER) #define FILEBUFNC(f,type) int __CAT__(f,_BFLAGS); \ type __CAT__(f,_BUFFER) #define RESETBUF(f,type) (__CAT__(f,_BFLAGS) = 1) #define SETUPBUF(f,type) (__CAT__(f,_BFLAGS) = 0) #define GETFBUF(f,type) (*((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(&__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ &__CAT__(f,_BUFFER))) #define AGETFBUF(f,type) ((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ __CAT__(f,_BUFFER)) #define PUTFBUF(f,type,v) (GETFBUF(f,type) = (v)) #define CPUTFBUF(f,v) (PUTFBUF(f,char,v)) #define APUTFBUF(f,type,v) (memcpy(AGETFBUF(f,type), (v), \ sizeof(__CAT__(f,_BUFFER)))) #define GET(f,type) (__CAT__(f,_BFLAGS) == 1 ? \ fread(&__CAT__(f,_BUFFER),sizeof(type),1,(f)) : \ (__CAT__(f,_BFLAGS) = 1)) #define PUT(f,type) (fwrite(&__CAT__(f,_BUFFER),sizeof(type),1,(f)), \ (__CAT__(f,_BFLAGS) = 0)) #define CPUT(f) (PUT(f,char)) #define BUFEOF(f) (__CAT__(f,_BFLAGS) != 2 && P_eof(f)) #define BUFFPOS(f) (ftell(f) - (__CAT__(f,_BFLAGS) == 2)) typedef struct { FILE *f; int f_BFLAGS; /* FILEBUFNC(f,Char); */ Char f_BUFFER; Char name[_FNSIZE]; } _TEXT; /* Memory allocation */ #ifdef __GCC__ # define Malloc(n) (malloc(n) ?: (Anyptr)_OutMem()) #else extern Anyptr __MallocTemp__; # define Malloc(n) ((__MallocTemp__ = malloc(n)) ? __MallocTemp__ : (Anyptr)_OutMem()) #endif #define FreeR(p) (free((Anyptr)(p))) /* used if arg is an rvalue */ #define Free(p) (free((Anyptr)(p)), (p)=NULL) /* sign extension */ #define SEXT(x,n) ((x) | -(((x) & (1L<<((n)-1))) << 1)) /* packed arrays */ /* BEWARE: these are untested! */ #define P_getbits_UB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] >> \ (((~(i))&((1<<(L)-(n))-1)) << (n)) & \ (1<<(1<<(n)))-1)) #define P_getbits_SB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] << \ (16 - ((((~(i))&((1<<(L)-(n))-1))+1) <<\ (n)) >> (16-(1<<(n)))))) #define P_putbits_UB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ (x) << (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_putbits_SB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ ((x) & (1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_clrbits_B(a,i,n,L) ((a)[(i)>>(L)-(n)] &= \ ~( ((1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) ) /* small packed arrays */ #define P_getbits_US(v,i,n) ((int)((v) >> ((i)<<(n)) & (1<<(1<<(n)))-1)) #define P_getbits_SS(v,i,n) ((int)((long)(v) << (SETBITS - (((i)+1) << (n))) >> (SETBITS-(1<<(n))))) #define P_putbits_US(v,i,x,n) ((v) |= (x) << ((i) << (n))) #define P_putbits_SS(v,i,x,n) ((v) |= ((x) & (1<<(1<<(n)))-1) << ((i)<<(n))) #define P_clrbits_S(v,i,n) ((v) &= ~( ((1<<(1<<(n)))-1) << ((i)<<(n)) )) #define P_max(a,b) ((a) > (b) ? (a) : (b)) #define P_min(a,b) ((a) < (b) ? (a) : (b)) /* Fix ANSI-isms */ #ifdef LACK_LABS # ifndef labs # define labs my_labs extern long my_labs PP( (long) ); # endif #endif #ifdef LACK_MEMMOVE # ifndef memmove # define memmove my_memmove extern Anyptr my_memmove PP( (Anyptr, Const Anyptr, size_t) ); # endif #endif #ifdef LACK_MEMCPY # ifndef memcpy # define memcpy my_memcpy extern Anyptr my_memcpy PP( (Anyptr, Const Anyptr, size_t) ); # endif # ifndef memcmp # define memcmp my_memcmp extern int my_memcmp PP( (Const Anyptr, Const Anyptr, size_t) ); # endif # ifndef memset # define memset my_memset extern Anyptr my_memset PP( (Anyptr, int, size_t) ); # endif #endif /* Fix toupper/tolower on Suns and other stupid BSD systems */ #ifdef toupper # undef toupper # undef tolower # define toupper(c) my_toupper(c) # define tolower(c) my_tolower(c) #endif #ifndef _toupper # if 'A' == 65 && 'a' == 97 # define _toupper(c) ((c)-'a'+'A') # define _tolower(c) ((c)-'A'+'a') # else # ifdef toupper # undef toupper /* hope these are shadowing real functions, */ # undef tolower /* because my_toupper calls _toupper! */ # endif # define _toupper(c) toupper(c) # define _tolower(c) tolower(c) # endif #endif #endif /* P2C_H */ /* End. */ /* Run-time library for use with "p2c", the Pascal to C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version --VERSION--. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #ifndef NO_TIME # include #endif #define Isspace(c) isspace(c) /* or "((c) == ' ')" if preferred */ int P_argc; char **P_argv; short P_escapecode; int P_ioresult; long EXCP_LINE; /* Used by Pascal workstation system */ Anyptr __MallocTemp__; __p2c_jmp_buf *__top_jb; void PASCAL_MAIN(argc, argv) int argc; char **argv; { P_argc = argc; P_argv = argv; __top_jb = NULL; #ifdef LOCAL_INIT LOCAL_INIT(); #endif } /* In case your system lacks these... */ long my_labs(x) long x; { return((x > 0) ? x : -x); } #ifdef __STDC__ Anyptr my_memcpy(Anyptr d, Const Anyptr s, size_t n) #else Anyptr my_memcpy(d, s, n) Anyptr d, s; register int n; #endif { register char *ss = (char *)s, *dd = (char *)d; while (n-- > 0) *dd++ = *ss++; return d; } #ifdef __STDC__ Anyptr my_memmove(Anyptr d, Const Anyptr s, size_t n) #else Anyptr my_memmove(d, s, n) Anyptr d, s; register int n; #endif { register char *dd = (char *)d, *ss = (char *)s; if (dd < ss || dd - ss >= (int)n) { #if defined(bcopy) && defined(memcpy) my_memcpy(dd, ss, n); #else memcpy(dd, ss, (size_t)n); #endif } else if (n > 0) { dd += n; ss += n; while (n-- > 0) *--dd = *--ss; } return d; } #ifdef __STDC__ int my_memcmp(Const Anyptr s1, Const Anyptr s2, size_t n) #else int my_memcmp(s1, s2, n) Anyptr s1, s2; register int n; #endif { register char *a = (char *)s1, *b = (char *)s2; register int i; while (n-- > 0) if ((i = (*a++) - (*b++)) != 0) return i; return 0; } #ifdef __STDC__ Anyptr my_memset(Anyptr d, int c, size_t n) #else Anyptr my_memset(d, c, n) Anyptr d; register int c; register int n; #endif { register char *dd = (char *)d; while (n-- > 0) *dd++ = c; return d; } int my_toupper(c) int c; { if (islower(c)) return _toupper(c); else return c; } int my_tolower(c) int c; { if (isupper(c)) return _tolower(c); else return c; } long ipow(a, b) long a, b; { long v; if (a == 0 || a == 1) return a; if (a == -1) return (b & 1) ? -1 : 1; if (b < 0) return 0; if (a == 2) return 1L << b; v = (b & 1) ? a : 1; while ((b >>= 1) > 0) { a *= a; if (b & 1) v *= a; } return v; } long P_imax(a, b) long a, b; { if (a > b) return a; else return b; } long P_imin(a, b) long a, b; { if (a < b) return a; else return b; } double P_rmax(a, b) double a, b; { if (a > b) return a; else return b; } double P_rmin(a, b) double a, b; { if (a < b) return a; else return b; } /* Common string functions: */ /* Store in "ret" the substring of length "len" starting from "pos" (1-based). Store a shorter or null string if out-of-range. Return "ret". */ char *strsub(ret, s, pos, len) register char *ret, *s; register int pos, len; { register char *s2; if (--pos < 0 || len <= 0) { *ret = 0; return ret; } while (pos > 0) { if (!*s++) { *ret = 0; return ret; } pos--; } s2 = ret; while (--len >= 0) { if (!(*s2++ = *s++)) return ret; } *s2 = 0; return ret; } /* Return the index of the first occurrence of "pat" as a substring of "s", starting at index "pos" (1-based). Result is 1-based, 0 if not found. */ int strpos2(s, pat, pos) char *s; register char *pat; register int pos; { register char *cp, ch; register int slen; if (--pos < 0) return 0; slen = (int)strlen(s) - pos; cp = s + pos; if (!(ch = *pat++)) return 0; pos = (int)strlen(pat); slen -= pos; while (--slen >= 0) { if (*cp++ == ch && !strncmp(cp, pat, (size_t)pos)) return cp - s; } return 0; } /* Case-insensitive version of strcmp. */ int strcicmp(s1, s2) register char *s1, *s2; { register unsigned char c1, c2; while (*s1) { if (*s1++ != *s2++) { if (!s2[-1]) return 1; c1 = (unsigned char)toupper(s1[-1]); c2 = (unsigned char)toupper(s2[-1]); if (c1 != c2) return c1 - c2; } } if (*s2) return -1; return 0; } /* HP and Turbo Pascal string functions: */ /* Trim blanks at left end of string. */ char *strltrim(s) register char *s; { while (Isspace(*s++)) ; return s - 1; } /* Trim blanks at right end of string. */ char *strrtrim(s) register char *s; { register char *s2 = s; if (!*s) return s; while (*++s2) ; while (s2 > s && Isspace(*--s2)) *s2 = 0; return s; } /* Store in "ret" "num" copies of string "s". Return "ret". */ char *strrpt(ret, s, num) char *ret; register char *s; register int num; { register char *s2 = ret; register char *s1; while (--num >= 0) { s1 = s; while ((*s2++ = *s1++)) ; s2--; } return ret; } /* Store in "ret" string "s" with enough pad chars added to reach "size". */ char *strpad(ret, s, padchar, num) char *ret; register char *s; register int padchar, num; { register char *d = ret; if (s == d) { while (*d++) ; } else { while ((*d++ = *s++)) ; } num -= (--d - ret); while (--num >= 0) *d++ = padchar; *d = 0; return ret; } /* Copy the substring of length "len" from index "spos" of "s" (1-based) to index "dpos" of "d", lengthening "d" if necessary. Length and indices must be in-range. */ void strmove(len, s, spos, d, dpos) register char *s, *d; register int len, spos, dpos; { s += spos - 1; d += dpos - 1; while (*d && --len >= 0) *d++ = *s++; if (len > 0) { while (--len >= 0) *d++ = *s++; *d = 0; } } /* Delete the substring of length "len" at index "pos" from "s". Delete less if out-of-range. */ void strdelete(s, pos, len) register char *s; register int pos, len; { register int slen; if (--pos < 0) return; slen = (int)strlen(s) - pos; if (slen <= 0) return; s += pos; if (slen <= len) { *s = 0; return; } while ((*s = s[len])) s++; } /* Insert string "src" at index "pos" of "dst". */ void strinsert(src, dst, pos) register char *src, *dst; register int pos; { register int slen, dlen; if (--pos < 0) return; dlen = (int)strlen(dst); dst += dlen; dlen -= pos; if (dlen <= 0) { strcpy(dst, src); return; } slen = (int)strlen(src); do { dst[slen] = *dst; --dst; } while (--dlen >= 0); dst++; while (--slen >= 0) *dst++ = *src++; } /* File functions */ /* Peek at next character of input stream; return EOF at end-of-file. */ int P_peek(f) FILE *f; { int ch; ch = getc(f); if (ch == EOF) return EOF; ungetc(ch, f); return (ch == '\n') ? ' ' : ch; } /* Check if at end of file, using Pascal "eof" semantics. End-of-file for stdin is broken; remove the special case for it to be broken in a different way. */ int P_eof(f) FILE *f; { register int ch; if (feof(f)) return 1; #ifdef HAVE_ISATTY if (isatty(fileno(f))) #else if (f == stdin) #endif return 0; /* not safe to look-ahead on the keyboard! */ ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return 0; } /* Check if at end of line (or end of entire file). */ int P_eoln(f) FILE *f; { register int ch; ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return (ch == '\n'); } /* Skip whitespace (including newlines) in a file. */ FILE *_skipnlspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t' || ch == '\n'); if (ch != EOF) ungetc(ch, f); return f; } /* Skip whitespace (not including newlines) in a file. */ FILE *_skipspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t'); if (ch != EOF) ungetc(ch, f); return f; } /* Read a packed array of characters from a file. */ Void P_readpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { if (len <= 0) return; ch = getc(f); if (ch == EOF || ch == '\n') break; *s++ = ch; --len; } while (--len >= 0) *s++ = ' '; if (ch != EOF) ungetc(ch, f); } Void P_readlnpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { ch = getc(f); if (ch == EOF || ch == '\n') break; if (len > 0) { *s++ = ch; --len; } } while (--len >= 0) *s++ = ' '; } /* Compute maximum legal "seek" index in file (0-based). */ long P_maxpos(f) FILE *f; { long savepos = ftell(f); long val; if (fseek(f, 0L, SEEK_END)) return -1; val = ftell(f); if (fseek(f, savepos, SEEK_SET)) return -1; return val; } /* Use packed array of char for a file name. */ Char *P_trimname(fn, len) register Char *fn; register int len; { static Char fnbuf[256]; register Char *cp = fnbuf; while (--len >= 0 && *fn && !isspace(*fn)) *cp++ = *fn++; *cp = 0; return fnbuf; } /* Pascal's "memavail" doesn't make much sense in Unix with virtual memory. We fix memory size as 10Meg as a reasonable compromise. */ long memavail() { return 10000000; /* worry about this later! */ } long maxavail() { return memavail(); } /* Sets are stored as an array of longs. S[0] is the size of the set; S[N] is the N'th 32-bit chunk of the set. S[0] equals the maximum I such that S[I] is nonzero. S[0] is zero for an empty set. Within each long, bits are packed from lsb to msb. The first bit of the set is the element with ordinal value 0. (Thus, for a "set of 5..99", the lowest five bits of the first long are unused and always zero.) */ /* (Sets with 32 or fewer elements are normally stored as plain longs.) */ long *P_setunion(d, s1, s2) /* d := s1 + s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ | *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; *dbase = d - dbase - 1; return dbase; } long *P_setint(d, s1, s2) /* d := s1 * s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setdiff(d, s1, s2) /* d := s1 - s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & ~*s2++; if (sz1 >= 0) { while (sz1-- >= 0) *d++ = *s1++; } while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setxor(d, s1, s2) /* d := s1 / s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ ^ *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } int P_inset(val, s) /* val IN s */ register unsigned val; register long *s; { register int bit; bit = (int) (val % SETBITS); val /= SETBITS; if ((long)val < *s++ && ((1L<(unsigned) size) { s += size; while (val > (unsigned)size) *++s = 0, size++; *sbase = size; } else s += val; *s |= 1L< (int)v2) return sbase; b1 = (int) (v1 % SETBITS); v1 /= SETBITS; b2 = (int) (v2 % SETBITS); v2 /= SETBITS; size = *s; v1++; if (++v2 > (unsigned)size) { while (v2 > (unsigned)size) s[++size] = 0; s[v2] = 0; *s = (long)v2; } s += v1; if (v1 == v2) { *s |= (~((-2L)<<(b2-b1))) << b1; } else { *s++ |= (-1L) << b1; while (++v1 < v2) *s++ = -1; *s |= ~((-2L) << b2); } return sbase; } long *P_remset(s, val) /* s := s - [val] */ register long *s; register unsigned val; { register int bit; bit = (int) (val % SETBITS); val /= SETBITS; if ((long)++val <= *s) { if (!(s[val] &= ~(1L<= 0) { if (*s1++ != *s2++) return 0; } return 1; } int P_subset(s1, s2) /* s1 <= s2 */ register long *s1, *s2; { register int sz1 = *s1++, sz2 = *s2++; if (sz1 > sz2) return 0; while (--sz1 >= 0) { if (*s1++ & ~*s2++) return 0; } return 1; } long *P_setcpy(d, s) /* d := s */ register long *d, *s; { register long *save_d = d; #ifdef SETCPY_MEMCPY memcpy(d, s, (*s + 1) * sizeof(long)); #else register int i = *s + 1; while (--i >= 0) *d++ = *s++; #endif return save_d; } /* s is a "smallset", i.e., a 32-bit or less set stored directly in a long. */ long *P_expset(d, s) /* d := s */ register long *d; register long s; { if (s) { d[1] = s; *d = 1; } else *d = 0; return d; } long P_packset(s) /* convert s to a small-set */ register long *s; { if (*s++) return *s; else return 0; } int _OutMem() { return _Escape(-2); } int _CaseCheck() { return _Escape(-9); } int _NilCheck() { return _Escape(-3); } /* The following is suitable for the HP Pascal operating system. It might want to be revised when emulating another system. */ char *_ShowEscape(buf, code, ior, prefix) char *buf, *prefix; int code, ior; { char *bufp; if (prefix && *prefix) { strcpy(buf, prefix); strcat(buf, ": "); bufp = buf + strlen(buf); } else { bufp = buf; } if (code == -10) { snprintf(bufp,80, "Pascal system I/O error %d", ior); switch (ior) { case 3: strcat(buf, " (illegal I/O request)"); break; case 7: strcat(buf, " (bad file name)"); break; case FileNotFound: /*10*/ strcat(buf, " (file not found)"); break; case FileNotOpen: /*13*/ strcat(buf, " (file not open)"); break; case BadInputFormat: /*14*/ strcat(buf, " (bad input format)"); break; case 24: strcat(buf, " (not open for reading)"); break; case 25: strcat(buf, " (not open for writing)"); break; case 26: strcat(buf, " (not open for direct access)"); break; case 28: strcat(buf, " (string subscript out of range)"); break; case EndOfFile: /*30*/ strcat(buf, " (end-of-file)"); break; case FileWriteError: /*38*/ strcat(buf, " (file write error)"); break; } } else { snprintf(bufp,80, "Pascal system error %d", code); switch (code) { case -2: strcat(buf, " (out of memory)"); break; case -3: strcat(buf, " (reference to NIL pointer)"); break; case -4: strcat(buf, " (integer overflow)"); break; case -5: strcat(buf, " (divide by zero)"); break; case -6: strcat(buf, " (real math overflow)"); break; case -8: strcat(buf, " (value range error)"); break; case -9: strcat(buf, " (CASE value range error)"); break; case -12: strcat(buf, " (bus error)"); break; case -20: strcat(buf, " (stopped by user)"); break; } } return buf; } int _Escape(code) int code; { char buf[100]; P_escapecode = code; if (__top_jb) { __p2c_jmp_buf *jb = __top_jb; __top_jb = jb->next; longjmp(jb->jbuf, 1); } if (code == 0) exit(EXIT_SUCCESS); if (code == -1) exit(EXIT_FAILURE); fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } int _EscIO(code) int code; { P_ioresult = code; return _Escape(-10); } int _EscIO2(code, name) int code; char *name; { P_ioresult = code; if (!__top_jb && name && *name) { char buf[100]; fprintf(stderr, "%s: %s\n", name, _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } return _Escape(-10); } /* End. */ typedef struct TPoint { long X, Y, C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, Ag, As,Au, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, Hf, Hg, In, Ir, Li, Lu, Mg, Mn, Mo, Na, Nb, Ni, Os, K, Pb, Pd, Pt, Rb, Re, Rh, Ru, Sb, Sc, Se, Sn, Sr, Ta, Te, Ti, Tl, V, W, Ytt, Zn, Zr, RecCount; struct TPoint *Last; } TPoint; typedef struct TBond { long X1, Y1, X2, Y2, RecCount; struct TBond *Last; } TBond; Static long C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, Ag, As, Au, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, Hf, Hg, In, Ir, Li, Lu, Mg, Mn, Mo, Na, Nb, Ni, Os, K, Pb, Pd, Pt, Rb, Re, Rh, Ru, Sb, Sc, Se, Sn, Sr, Ta, Te, Ti, Tl, V, W, Ytt, Zn, Zr, X1, X2, Y1, Y2, T, D; Static FILE *IFile; Static TPoint *Point, *Last, *Current; Static TBond *Bond, *LastB, *CurrentB; Static Char sss[256], A[256], subs[256], Alert[256]; Static Char sssb[7]; Static double M, Me; Static Char separator; Static long Count, code, atoms, rep, range, bonds; Static boolean Abandon, debug, verbose, fa, nobonds; Static long Sensi = 5; /*bonds and labels joint precision sensitivity*/ Static Char IFile_NAME[_FNSIZE]; Static Void doBonds() { do { if (!fgets(sss,256,IFile)) return; sscanf(sss, "%ld%ld%ld%ld%ld%ld%*[^\n]", &X1, &Y1, &X2, &Y2, &T, &D); /*getc(IFile);*/ bonds--; if (debug) printf("%ld; %ld; %ld; %ld; %ld; %ld\n", X1, Y1, X2, Y2, T, D); if (D == 1 || T == 8){ if (debug) printf("skipped\n"); continue; } if (debug) printf("parsed\n"); if (T == 11) range = ((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2)) * 4; LastB = Bond; Bond = (TBond *)malloc(sizeof(TBond)); if (Bond == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Bond->X1 = X1; Bond->X2 = X2; Bond->Y1 = Y1; Bond->Y2 = Y2; Bond->Last = LastB; CurrentB = Bond; Bond = Bond->Last; while (Bond->Last != NULL) { if ((labs(Bond->X1 - X1) < Sensi && labs(Bond->Y1 - Y1) < Sensi && labs(Bond->X2 - X2) < Sensi && labs(Bond->Y2 - Y2) < Sensi) || (labs(Bond->X2 - X1) < Sensi && labs(Bond->Y2 - Y1) < Sensi && labs(Bond->X1 - X2) < Sensi && labs(Bond->Y1 - Y2) < Sensi)) { if (debug) printf(" ! Bond overlap\n"); strcat(Alert, "!"); } Bond = Bond->Last; } Bond = CurrentB; Abandon = false; Current = Point; while (Point->Last != NULL) { if (T == 11) { Abandon = true; if ((Point->X - X1) * (Point->X - X1) + (Point->Y - Y1) * (Point->Y - Y1) < range) { if (Point->H > 0) Point->H--; if (debug) printf("Ring --> stripped one H from %ld %ld\n", Point->X, Point->Y); } } else { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X1, Y1); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X1; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y1; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } if (T != 11) { Abandon = false; Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X2) < Sensi && labs(Point->Y - Y2) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X2, Y2); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X2; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y2; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } } } while (bonds != 0); } Static Void doLabels() { long mul, gmul, gmpos, ggmul, ggmpos; boolean stripped; Char STR2[256]; long FORLIM; Char *TEMP; if (debug) printf("---- and now parse the labels ---------\n"); if (verbose) printf("HeteroAtoms: %ld\n", atoms); FORLIM = atoms; for (rep = 1; rep <= FORLIM; rep++) { if (fscanf(IFile, "%ld%ld%c", &X1, &Y1, &separator)<2) return; if (!fgets(sss, 256, IFile))return; TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; snprintf(A,256, "%.*s", strpos2(sss, "\t", 1) - 1, sss); if (debug) printf("Atom %s X=%ld Y=%ld sss: %s\n", A, X1, Y1, sss); if (nobonds) { /*initialize the Point structure if no bonds, only labels, defined*/ Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X1; Point->Y = Y1; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; Point->Last = Last; } Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" [%ld]\n", Point->RecCount); Point->C = 0; /*we substitute -CH_x(-) by -R(-)*/ Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; mul = 1; gmul = 1; ggmul = 1; while (*A != '\0') { stripped = false; if ((int)strlen(A) >= 5) { snprintf(subs,256, "%.5s", A); if ((int)strlen(A) > 6) { if (A[5] == '_') { if (A[6]!= '{') { snprintf(STR2,256, "%c", A[6]); if (A[7]=='_') snprintf(STR2,256, "%c%c", A[6],A[8]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=7; while(A[mul]!='}'){STR2[mul-7]=A[mul]; mul++ ; } STR2[mul-6]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "TBDMS")) { /*Tert-butyldimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 15; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (!strcmp(subs, "TBDPS")) { /*Tert-butyldiphenylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 16; Point->H += mul * 19; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (A[0] == '[') { ggmpos = strpos2(A, "]", 1); if (ggmpos != 0) { if (A[ggmpos] == '_') { if (A[ggmpos+1]!= '{') { snprintf(STR2,256, "%c", A[ggmpos+1]); if (A[ggmpos+2]=='_') snprintf(STR2,256, "%c%c", A[ggmpos+1],A[ggmpos+3]); code = (sscanf(STR2, "%ld", &ggmul) == 0); }else{ ggmul=ggmpos+2; while(A[ggmul]!='}'){STR2[ggmul-ggmpos-2]=A[ggmul]; ggmul++ ; } STR2[ggmul-ggmpos-1]='\0'; code = (sscanf(STR2, "%ld", &ggmul) == 0); } } else ggmul = 1; } } if (A[0] == '(') { gmpos = strpos2(A, ")", 1); if (gmpos != 0) { if (A[gmpos] == '_') { if (A[gmpos+1]!= '{') { snprintf(STR2,256, "%c", A[gmpos+1]); if (A[gmpos+2]=='_') snprintf(STR2,256, "%c%c", A[gmpos+1],A[gmpos+3]); code = (sscanf(STR2, "%ld", &gmul) == 0); }else{ gmul=gmpos+2; while(A[gmul]!='}'){STR2[gmul-gmpos-2]=A[gmul]; gmul++ ; } STR2[gmul-gmpos-1]='\0'; code = (sscanf(STR2, "%ld", &gmul) == 0); } } else gmul = 1; } } } if ((int)strlen(A) >= 4 && !stripped) { snprintf(subs,256, "%.4s", A); if ((int)strlen(A) > 5) { if (A[4] == '_') { if (A[5]!= '{') { snprintf(STR2,256, "%c", A[5]); if (A[6]=='_') snprintf(STR2,256, "%c%c", A[5],A[7]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=6; while(A[mul]!='}'){STR2[mul-6]=A[mul]; mul++ ; } STR2[mul-5]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "DBAM")) { /*dibutylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 9; Point->H += mul * 19; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMAM")) { /*dimethylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMTr")) { /*dimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 21; Point->H += mul * 19; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "MMTr")) { /*monomethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 20; Point->H += mul * 16; Point->O += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "TMTr")) { /*trimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 22; Point->H += mul * 22; Point->O += mul * 3; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } } if ((int)strlen(A) >= 3 && !stripped) { snprintf(subs,256, "%.3s", A); if ((int)strlen(A) > 4) { if (A[3] == '_') { if (A[4]!= '{') { snprintf(STR2,256, "%c", A[4]); if (A[5]=='_') snprintf(STR2,256, "%c%c", A[4],A[6]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=5; while(A[mul]!='}'){STR2[mul-5]=A[mul]; mul++ ; } STR2[mul-4]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ade")) { /*Adeninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "BOC")) { /*Butyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 9; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Cyt")) { /*Cytosinyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 4; Point->N += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Gua")) { /*Guaninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iBu")) { /*iso-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iPr")) { /*2-Propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOC")) { /*Methoxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOM")) { /*Methoxymethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "tBu")) { /*t-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Thy")) { /*Thyminyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 5; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "TMS")) { /*Trimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 9; Point->Si += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Tol")) { /*tolyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Ura")) { /*Uracilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 3; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } } if ((int)strlen(A) >= 2 && !stripped) { snprintf(subs,256, "%.2s", A); if ((int)strlen(A) > 3) { if (A[2] == '_') { if (A[3]!= '{') { snprintf(STR2,256, "%c", A[3]); if (A[4]=='_') snprintf(STR2,256, "%c%c", A[3],A[5]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=4; while(A[mul]!='}'){STR2[mul-4]=A[mul]; mul++ ; } STR2[mul-3]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ac")) { /*acetyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Al")) { /*alumin(i)um*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Al += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ag")) { /*silver*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ag += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "As")) { /*arsenic*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->As += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Au")) { /*gold*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Au += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ba")) { /*barium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ba += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Be")) { /*beryllium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Be += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bi")) { /*bismuth*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Bi += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bn")) { /*benzyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Br")) { /*bromine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Br += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bu")) { /*butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bz")) { /*benzoyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "CE")) { /*cyanoethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 4; Point->N += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cl")) { /*chlorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ca")) { /*calcium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ca += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cd")) { /*cadmium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cd += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Co")) { /*cobalt*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Co += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cr")) { /*chromium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cs")) { /*cesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cs += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cu")) { /*copper*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cu += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Et")) { /*ethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Fe")) { /*iron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Fe += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ga")) { /*gallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ga += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ge")) { /*germanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ge += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Hf")) { /*hafnium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Hf += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Hg")) { /*mercury*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Hg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "In")) { /*indium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->In += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ir")) { /*iridium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ir += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Li")) { /*lithium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Li += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Lu")) { /*lutetium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Lu += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Me")) { /*methyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ms")) { /*methanesulfonyl, mesyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mg")) { /*magnesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mn")) { /*manganese*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mo")) { /*molybdenum*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mo += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Na")) { /*sodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Na += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Nb")) { /*niobium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Nb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ni")) { /*nickel*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ni += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Os")) { /*osmium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Os += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pb")) { /*lead*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pd")) { /*palladium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pd += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ph")|| !strcmp(subs,"@F")) { /*phenyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pr")) { /*propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pt")) { /*platinum*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pt += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Rb")) { /*rubidium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Rb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Re")) { /*rhenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Re += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Rh")) { /*rhodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Rh += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ru")) { /*ruthenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ru += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sb")) { /*antimony*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sc")) { /*scandium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sc += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Se")) { /*selenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Se += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sn")) { /*tin*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sr")) { /*strontium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ta")) { /*tantal*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ta += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Te")) { /*tellurium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Te += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ti")) { /*titanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ti += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tf")) { /*trifluoromethanesulfonyl, triflyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->F += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tl")) { /*thallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Tl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tr")) { /*trityl, triphenylmethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 19; Point->H += mul * 15; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ts")) { /*toluenesulfonyl, tosyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Si")) { /*silicon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Si += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Zn")) { /*zinc*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Zn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Zr")) { /*zirconium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Zr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } } if ((int)strlen(A) < 1 || stripped) continue; snprintf(subs,256, "%.1s", A); if ((int)strlen(A) > 2) { if (A[1] == '_') { if (A[2]!= '{') { snprintf(STR2,256, "%c", A[2]); if (A[3]=='_') snprintf(STR2,256, "%c%c", A[2],A[4]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=3; while(A[mul]!='}'){STR2[mul-3]=A[mul]; mul++ ; } STR2[mul-2]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "B")) { /*boron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->B += mul; } if (!strcmp(subs, "C")) { /*carbon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; } if (!strcmp(subs, "F")) { /*fluorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->F += mul; } if (!strcmp(subs, "H")) { /*hydrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->H += mul; } if (!strcmp(subs, "I")) { /*iodine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->I += mul; } if (!strcmp(subs, "K")) { /*potassium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->K += mul; } if (!strcmp(subs, "N")) { /*nitrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->N += mul; } if (!strcmp(subs, "O")) { /*oxygen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->O += mul; } if (!strcmp(subs, "P")) { /*phosphorus*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->P += mul; } if (!strcmp(subs, "S")) { /*sulfur*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->S += mul; } if (!strcmp(subs, "V")) { /*vanadium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->V += mul; } if (!strcmp(subs, "W")) { /*tungsten*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->W += mul; } if (!strcmp(subs, "Y")) { /*yttrium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ytt += mul; } if (!strcmp(subs, "Z")) { /*"Z", Benzyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul * 2; } if (!strcmp(subs, ")")) /*reset gmul*/ gmul = 1; if (!strcmp(subs, "]")) { /*reset gmul,ggmul*/ gmul = 1; ggmul = 1; } if (true) strcpy(A, strsub(STR2, A, 2, (int)(strlen(A) - 1))); } } Point = Point->Last; } Point = Current; } } int main(argc, argv) int argc; Char *argv[]; { Char STR1[256], STR2[256]; Char *TEMP; boolean interactive=false; PASCAL_MAIN(argc, argv); IFile = NULL; if (P_argc == 1) { printf("enter \"cht -h\" for help\n"); _Escape(0); } C = 0; H = 0; N = 0; O = 0; P = 0; S = 0; Si = 0; B = 0; Br = 0; I = 0; Cl = 0; F = 0; Al = 0; Ag = 0; As = 0; Au = 0; Ba = 0; Be = 0; Bi = 0; Ca = 0; Cd = 0; Co = 0; Cr = 0; Cs = 0; Cu = 0; Fe = 0; Ga = 0; Ge = 0; Hf = 0; Hg = 0; In = 0; Ir = 0; Li = 0; Lu = 0; Mg = 0; Mn = 0; Mo = 0; Na = 0; Nb = 0; Ni = 0; Os = 0; K = 0; Pb = 0; Pd = 0; Pt = 0; Rb = 0; Re = 0; Rh = 0; Ru = 0; Sb = 0; Sc = 0; Se = 0; Sn = 0; Sr = 0; Ta = 0; Te = 0; Ti = 0; Tl = 0; V = 0; W = 0; Ytt = 0; Zn = 0; Zr = 0; verbose = false; debug = false; fa = false; /*no file assigned*/ Count = 0; *Alert = '\0'; for (rep = 1; rep < P_argc; rep++) { if (!strcmp(strcpy(STR2, P_argv[rep]), "-v") || !strcmp(strcpy(STR1, P_argv[rep]), "--verbose")) verbose = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-d") || !strcmp(strcpy(STR1, P_argv[rep]), "--debug")) debug = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-i") || !strcmp(strcpy(STR1, P_argv[rep]), "--interpret")) interactive = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-h") || !strcmp(strcpy(STR1, P_argv[rep]), "--help")) { printf("The Chemtool drawings analyzer 1.7\n"); printf("*** Gizmo Head Software ***\n"); printf(" Radek Liboska (c) 2001\n\n"); printf("syntax: cht [-options] \n\n"); printf("Recognizes C,H,O,N,P,S,Si,B,Br,I,Cl,F,Al,Ag,As,Au,Ba,Be,Bi,Ca,Cd,Co,Cr,Cs,Cu,\nFe,Ga,Ge,Hf,Hg,In,Ir,Li,Lu,Mg,Mn,Mo,Na,Nb,Ni,Os,K,Pb,Pd,Pt,Rb,Re,Rh,Ru,Sb,Sc,Se,Sn,Sr,\nTa,Te,Ti,Tl,V,W,Y,Zn,Zr\n"); printf( " Ac,Ade,Bn,Bu,Bz,BOC,Cyt,CE,DBAM,DMAM,DMTr,Et,Gua,iBu,iPr,Me,Ms,MOC,\n"); printf( " MOM,MMTr,Ph,Pr,tBu,Tf,Thy,Tol,Tr,Ts,TBDMS,TBDPS,TMS,TMTr,Ura,Z\n"); printf("Can handle two levels of parentheses; e.g. P[OCH(CH_3)_2]_3\n\n"); printf("options:\n"); printf(" -h or --help : this help\n"); printf(" -v or --verbose : be verbose\n"); printf(" -d or --debug : be more verbose\n\n"); _Escape(0); } if (strcpy(STR2, P_argv[rep])[0] != '-') { strcpy(STR1, P_argv[rep]); strcpy(IFile_NAME, STR1); fa = true; } } if (!fa && !interactive) { printf("No file defined, enter \"cht -h\" for help\n"); _Escape(1); } if (!interactive){ if (IFile != NULL) IFile = freopen(IFile_NAME, "r", IFile); else IFile = fopen(IFile_NAME, "r"); if (IFile == NULL) _EscIO2(FileNotFound, IFile_NAME); }else { if (IFile)fclose(IFile); IFile=tmpfile(); fprintf(IFile,"Chemtool Version 1.0\ngeometry 100 100\n\bonds 0\natoms 1\n0 0 %s 0\n",IFile_NAME); rewind(IFile); } Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = 0; Point->Y = 0; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; Point->Last = NULL; Bond = (TBond *)malloc(sizeof(TBond)); if (Bond == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Bond->X1 = 0; Bond->Y1 = 0; Bond->X2 = 0; Bond->Y2 = 0; Bond->RecCount = Count; Bond->Last = NULL; if (!fgets(sss, 256, IFile))exit(2); TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; snprintf(sss,256, "%.18s", strcpy(STR1, sss)); if (strcmp(sss, "Chemtool Version 1")) { printf("Not a chemtool 1.x file, enter \"cht -h\" for help\n"); printf("file starts: %s\n",sss); _Escape(2); } if (fscanf(IFile, "%*[^\n]") == EOF) exit(2); getc(IFile); if (!fgets(sssb, 7, IFile))exit(2); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } if (fscanf(IFile, "%ld%*[^\n]", &bonds) == EOF) bonds = 0; getc(IFile); if (bonds == 0) nobonds = true; if (!strcmp(sssb, "bonds ")) { if (bonds > 0) doBonds(); } if (!fgets(sssb, 7, IFile))exit(2); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } if (fscanf(IFile, "%ld%*[^\n]", &atoms) == EOF) atoms = 0; getc(IFile); if (!strcmp(sssb, "atoms ")) { if (atoms > 0) doLabels(); } if (IFile != NULL) fclose(IFile); IFile = NULL; if (verbose) printf("---------------------- Summary -------------------------\n"); while (Point->Last != NULL) { if (verbose) printf( "RecCount: %ld X=%ld Y=%ld C%ld H%ld N%ld O%ld P%ld S%ld Si%ld B%ld\nBr%ld Cl%ld F%ld I%ld Al%ld Ag%ld As%ld Au%ld Ba%ld Be%ld Bi%ld Ca%ld Cd%ld Co%ld\nCr%ld Cs%ld Cu%ld Fe%ld Ga%ld Ge%ld Hf%ld Hg%ld In%ld Ir%ld Li%ld Lu%ld Mg%ld Mn%ld\n Mo%ld Na%ld Nb%ld Ni%ld Os%ld K%ld Pb%ld Pd%ld Pt%ld Rb%ld Re%ld Rh%ld Ru%ld Sb%ld\n Sc%ld Se%ld Sn%ld Sr%ld Ta%ld Te%ld Ti%ld Tl%ld V%ld W%ld Y%ld Zn%ld Zr%ld\n", Point->RecCount, Point->X, Point->Y, Point->C, Point->H, Point->N, Point->O, Point->P, Point->S, Point->Si, Point->B, Point->Br, Point->Cl, Point->F, Point->I, Point->Al, Point->Ag, Point->As, Point->Au, Point->Ba, Point->Be,Point->Bi, Point->Ca, Point->Cd, Point->Co, Point->Cr, Point->Cs,Point->Cu,Point->Fe,Point->Ga,Point->Ge,Point->Hf,Point->Hg, Point->In, Point->Ir, Point->Li,Point->Lu,Point->Mg, Point->Mn, Point->Mo, Point->Na, Point->Nb,Point->Ni, Point->Os,Point->K,Point->Pb,Point->Pd, Point->Pt, Point->Rb, Point->Re, Point->Rh, Point->Ru, Point->Sb,Point->Sc,Point->Se,Point->Sn,Point->Sr,Point->Ta, Point->Te,Point->Ti,Point->Tl,Point->V,Point->W,Point->Ytt,Point->Zn,Point->Zr); C += Point->C; H += Point->H; N += Point->N; O += Point->O; P += Point->P; S += Point->S; Si += Point->Si; B += Point->B; Br += Point->Br; Cl += Point->Cl; F += Point->F; I += Point->I; Al += Point->Al; Ag += Point->Ag; As += Point->As; Au += Point->Au; Ba += Point->Ba; Be += Point->Be; Bi += Point->Bi; Ca += Point->Ca; Cd += Point->Cd; Co += Point->Co; Cr += Point->Cr; Cs += Point->Cs; Cu += Point->Cu; Fe += Point->Fe; Ga += Point->Ga; Ge += Point->Ge; Hf += Point->Hf; Hg += Point->Hg; In += Point->In; Ir += Point->Ir; Li += Point->Li; Lu += Point->Lu; Mg += Point->Mg; Mn += Point->Mn; Mo += Point->Mo; Na += Point->Na; Nb += Point->Nb; Ni += Point->Ni; Os += Point->Os; K += Point->K; Pb += Point->Pb; Pd += Point->Pd; Pt += Point->Pt; Rb += Point->Rb; Re += Point->Re; Rh += Point->Rh; Ru += Point->Ru; Sb += Point->Sb; Sc += Point->Sc; Se += Point->Se; Sn += Point->Sn; Sr += Point->Sr; Ta += Point->Ta; Te += Point->Te; Ti += Point->Ti; Tl += Point->Tl; V += Point->V; W += Point->W; Ytt += Point->Ytt; Zn += Point->Zn; Zr += Point->Zr; Point = Point->Last; } if (H < 0) /*overlapped bonds*/ H = 0; M = (double)C * 12.011 + (double)H * 1.0079 + (double)N * 14.0067 + (double)O * 15.9994 + (double)P * 30.97376 + (double)S * 32.064 + (double)Si * 28.086 + (double)B * 10.81 + (double)Br * 79.904 + (double)Cl * 35.453 + (double)F * 18.9984 + (double)I * 126.9045 + (double)Mg * 24.305 + (double)Na * 22.98977 + (double)K * 39.098 + (double)Ca * 40.08 + (double)Cd * 112.41 + (double)Co * 58.933 + (double)Cr * 51.996 + (double)Cu * 63.546 + (double)Fe * 55.847 + (double)Li * 6.941 + (double)Mn * 54.938 + (double)Ni * 58.69 + (double)Al * 26.981539 + (double)Ba * 137.327 + (double)Cs * 132.90543 + (double)As * 74.92159 + (double)Be *9.012182 + (double)Ga * 69.723 + (double)Ge * 72.61 + (double)Sb * 121.75 + (double)Sc * 44.95591 + (double)Se * 78.96 + (double)Sn * 118.710 + (double)Sr * 87.62 + (double)Rb * 85.4678 + (double)Te * 127.60 + (double)Ti * 47.88 + (double)V * 50.9415 + (double)Zn * 65.39 + (double)In * 114.82 + (double)Bi * 208.98037 + (double)Pb *207.2 + (double)Tl * 204.3833 + (double)Zr *91.224 + (double)Nb * 92.906 + (double)Mo*95.94 + (double)Ru * 101.07 + (double)Rh *102.9055 + (double)Re * 186.207 + (double)Pd *106.42 + (double)Ag *107.868 + (double)Pt *195.078 + (double)Ir * 192.217 + (double)Hg * 200.59 + (double)Os *190.2 + (double)W * 183.84 + (double)Au * 196.966 + (double)Ta *180.948 + (double)Hf * 178.49 + (double)Ytt * 88.906 + (double)Lu *174.967; Me = (double)C * 12. + (double)H * 1.007825037 + (double)N * 14.003074008 + (double)O * 15.99491464 + (double)P * 30.9737634 + (double)S * 31.9720718 + (double)Si * 27.9769284 + (double)B * 11.0093053 + (double)Br * 78.9183361 + (double)Cl * 34.968852729 + (double)F * 18.99840325 + (double)I * 126.904477 + (double)Mg * 23.9850450 + (double)Na * 22.9897697 + (double)K * 38.9637079 + (double)Ca * 39.9626 + (double)Cd * 113.9034 + (double)Co * 58.9332 + (double)Cr * 51.9405 + (double)Cu * 62.9296 + (double)Fe * 55.9349 +(double)Li * 7.0160 + (double)Mn * 54.93805 + (double)Ni * 57.9353 + (double)Al * 26.981539 + (double)Ba * 137.9052 + (double)Cs * 132.90543 + (double)As * 74.92159 + (double)Be * 9.012182 + (double)Ga * 68.9256 + (double)Ge * 73.9212 + (double)Sb * 120.9038 + (double)Sc * 44.95591 + (double)Se *79.9165 + (double)Sn * 119.9022 + (double)Sr * 87.9056 + (double)Rb * 84.9118 + (double)Te * 129.9062 + (double)Ti * 47.9479 + (double)V * 50.9440 + (double)Zn * 63.9291 + (double)In * 114.9039 + (double)Bi * 208.98037 + (double)Pb * 207.9766 + (double)Tl * 204.9744 + (double)Zr * 89.9047 + (double)Nb *92.9064 + (double)Mo * 97.9054 + (double)Ru * 101.9043 + (double)Rh * 102.9055 + (double)Re * 186.9558 + (double)Pd * 105.9035 +(double)Ag * 106.9051 + (double)Pt * 194.9648 + (double)Ir * 192.9629 + (double)Hg * 201.9706 +(double)Os * 191.9615 + (double)W * 183.9510 + (double)Au * 196.9666 + (double)Ta * 180.9480 + (double)Hf * 179.9466 + (double)Ytt * 88.9059 + (double)Lu * 174.9408; if (Me > 0 && *Alert == '\0') { if (C > 1) printf("C%ld", C); if (C == 1) putchar('C'); if (H > 1) printf("H%ld", H); if (H == 1) putchar('H'); if (N > 1) printf("N%ld", N); if (N == 1) putchar('N'); if (O > 1) printf("O%ld", O); if (O == 1) putchar('O'); if (P > 1) printf("P%ld", P); if (P == 1) putchar('P'); if (S > 1) printf("S%ld", S); if (S == 1) putchar('S'); if (Si > 1) printf("Si%ld", Si); if (Si == 1) printf("Si"); if (B > 1) printf("B%ld", B); if (B == 1) putchar('B'); if (Br > 1) printf("Br%ld", Br); if (Br == 1) printf("Br"); if (Cl > 1) printf("Cl%ld", Cl); if (Cl == 1) printf("Cl"); if (F > 1) printf("F%ld", F); if (F == 1) putchar('F'); if (I > 1) printf("I%ld", I); if (I == 1) putchar('I'); if (Ag > 1) printf("Ag%ld", Ag); if (Ag == 1) printf("Ag"); if (Al > 1) printf("Al%ld", Al); if (Al == 1) printf("Al"); if (As > 1) printf("As%ld", As); if (As == 1) printf("As"); if (Au > 1) printf("Au%ld", Au); if (Au == 1) printf("Au"); if (Ba > 1) printf("Ba%ld", Ba); if (Ba == 1) printf("Ba"); if (Be > 1) printf("Be%ld", Be); if (Be == 1) printf("Be"); if (Bi > 1) printf("Bi%ld", Bi); if (Bi == 1) printf("Bi"); if (Ca > 1) printf("Ca%ld", Ca); if (Ca == 1) printf("Ca"); if (Cd > 1) printf("Cd%ld", Cd); if (Cd == 1) printf("Cd"); if (Co > 1) printf("Co%ld", Co); if (Co == 1) printf("Co"); if (Cr > 1) printf("Cr%ld", Cr); if (Cr == 1) printf("Cr"); if (Cs > 1) printf("Cs%ld", Cs); if (Cs == 1) printf("Cs"); if (Cu > 1) printf("Cu%ld", Cu); if (Cu == 1) printf("Cu"); if (Fe > 1) printf("Fe%ld", Fe); if (Fe == 1) printf("Fe"); if (Ga > 1) printf("Ga%ld", Ga); if (Ga == 1) printf("Ga"); if (Ge > 1) printf("Ge%ld", Ge); if (Ge == 1) printf("Ge"); if (Hf > 1) printf("Hf%ld", Hf); if (Hf == 1) printf("Hf"); if (Hg > 1) printf("Hg%ld", Hg); if (Hg == 1) printf("Hg"); if (In > 1) printf("In%ld", In); if (In == 1) printf("In"); if (Ir > 1) printf("Ir%ld", Ir); if (Ir == 1) printf("Ir"); if (K > 1) printf("K%ld", K); if (K == 1) putchar('K'); if (Li > 1) printf("Li%ld", Li); if (Li == 1) printf("Li"); if (Lu > 1) printf("Lu%ld", Lu); if (Lu == 1) printf("Lu"); if (Mg > 1) printf("Mg%ld", Mg); if (Mg == 1) printf("Mg"); if (Mn > 1) printf("Mn%ld", Mn); if (Mn == 1) printf("Mn"); if (Mo > 1) printf("Mo%ld", Mo); if (Mo == 1) printf("Mo"); if (Na > 1) printf("Na%ld", Na); if (Na == 1) printf("Na"); if (Nb > 1) printf("Nb%ld", Nb); if (Nb == 1) printf("Nb"); if (Ni > 1) printf("Ni%ld", Ni); if (Ni == 1) printf("Ni"); if (Os > 1) printf("Os%ld", Os); if (Os == 1) printf("Os"); if (Pb > 1) printf("Pb%ld", Pb); if (Pb == 1) printf("Pb"); if (Pd > 1) printf("Pd%ld", Pd); if (Pd == 1) printf("Pd"); if (Pt > 1) printf("Pt%ld", Pt); if (Pt == 1) printf("Pt"); if (Rb > 1) printf("Rb%ld", Rb); if (Rb == 1) printf("Rb"); if (Re > 1) printf("Re%ld", Re); if (Re == 1) printf("Re"); if (Rh > 1) printf("Rh%ld", Rh); if (Rh == 1) printf("Rh"); if (Ru > 1) printf("Rb%ld", Ru); if (Ru == 1) printf("Ru"); if (Sb > 1) printf("Sb%ld", Sb); if (Sb == 1) printf("Sb"); if (Sc > 1) printf("Sc%ld", Sc); if (Sc == 1) printf("Sc"); if (Se > 1) printf("Se%ld", Se); if (Se == 1) printf("Se"); if (Sn > 1) printf("Sn%ld", Sn); if (Sn == 1) printf("Sn"); if (Sr > 1) printf("Sr%ld", Sr); if (Sr == 1) printf("Sr"); if (Ta > 1) printf("Ta%ld", Ta); if (Ta == 1) printf("Ta"); if (Te > 1) printf("Te%ld", Te); if (Te == 1) printf("Te"); if (Ti > 1) printf("Ti%ld", Ti); if (Ti == 1) printf("Ti"); if (Tl > 1) printf("Tl%ld", Tl); if (Tl == 1) printf("Tl"); if (V > 1) printf("V%ld", V); if (V == 1) printf("V"); if (W > 1) printf("W%ld", W); if (W == 1) printf("W"); if (Ytt > 1) printf("Y%ld", Ytt); if (Ytt == 1) printf("Y"); if (Zn > 1) printf("Zn%ld", Zn); if (Zn == 1) printf("Zn"); if (Zr > 1) printf("Zr%ld", Zr); if (Zr == 1) printf("Zr"); printf(" [%2.3f]", M); printf(" Me=%2.10f ", Me); if (C > 0) printf("%4.2f%%C;", (double)C * 12.011 * 100 / M); if (H > 0) printf("%4.2f%%H;", (double)H * 1.0079 * 100 / M); if (B > 0) printf("%4.2f%%B;", (double)B * 10.81 * 100 / M); if (N > 0) printf("%4.2f%%N;", (double)N * 14.0067 * 100 / M); if (O > 0) printf("%4.2f%%O;", (double)O * 15.9994 * 100 / M); if (P > 0) printf("%4.2f%%P;", (double)P * 30.97376 * 100 / M); if (S > 0) printf("%4.2f%%S;", (double)S * 32.0640 * 100 / M); if (K > 0) printf("%4.2f%%K;", (double)K * 39.098 * 100 / M); if (Mg > 0) printf("%4.2f%%Mg;", (double)Mg * 24.305 * 100 / M); if (Na > 0) printf("%4.2f%%Na;", (double)Na * 22.98977 * 100 / M); if (Si > 0) printf("%4.2f%%Si;", (double)Si * 28.086 * 100 / M); if (Br > 0) printf("%4.2f%%Br;", (double)Br * 79.904 * 100 / M); if (Cl > 0) printf("%4.2f%%Cl;", (double)Cl * 35.453 * 100 / M); if (F > 0) printf("%4.2f%%F;", (double)F * 18.9984 * 100 / M); if (I > 0) printf("%4.2f%%I;", (double)I * 126.9045 * 100 / M); if (Ag >0) printf("%4.2f%%Ag;", (double)Ag * 107.868 * 100 / M); if (Al >0) printf("%4.2f%%Al;", (double)Al * 26.981539 * 100 / M); if (As >0) printf("%4.2f%%As;", (double)As * 74.92159 * 100 / M); if (Au >0) printf("%4.2f%%Au;", (double)Au * 196.966 * 100 / M); if (Ba >0) printf("%4.2f%%Ba;", (double)Ba * 137.327 * 100 / M); if (Be >0) printf("%4.2f%%Be;", (double)Be * 9.012182 * 100 / M); if (Bi >0) printf("%4.2f%%Bi;", (double)Bi * 208.98037 * 100 / M); if (Ca >0) printf("%4.2f%%Ca;", (double)Ca * 40.08 * 100 / M); if (Cd >0) printf("%4.2f%%Cd;", (double)Cd * 112.41 * 100 / M); if (Co >0) printf("%4.2f%%Co;", (double)Co * 58.993 * 100 / M); if (Cr >0) printf("%4.2f%%Cr;", (double)Cr * 51.996 * 100 / M); if (Cs >0) printf("%4.2f%%Cs;", (double)Cs * 132.90543 * 100 / M); if (Cu >0) printf("%4.2f%%Cu;", (double)Cu * 63.546 * 100 / M); if (Fe >0) printf("%4.2f%%Fe;", (double)Fe * 55.847 * 100 / M); if (Ga >0) printf("%4.2f%%Ga;", (double)Ga * 69.723 * 100 / M); if (Ge >0) printf("%4.2f%%Ge;", (double)Ge * 72.61 * 100 / M); if (Hf >0) printf("%4.2f%%Hf;", (double)Hf * 178.49 * 100 / M); if (Hg >0) printf("%4.2f%%Hg;", (double)Hg * 200.59 * 100 / M); if (In >0) printf("%4.2f%%In;", (double)In * 114.82 * 100 / M); if (Ir >0) printf("%4.2f%%Ir;", (double)Ir * 192.217 * 100 / M); if (Li >0) printf("%4.2f%%Li;", (double)Li * 6.941 * 100 / M); if (Lu >0) printf("%4.2f%%Lu;", (double)Lu * 174.967 * 100 / M); if (Mn >0) printf("%4.2f%%Mn;", (double)Mn * 54.938 * 100 / M); if (Mo >0) printf("%4.2f%%Mo;", (double)Mo * 95.94 * 100 / M); if (Nb >0) printf("%4.2f%%Nb;", (double)Nb * 92.906 *100 / M); if (Ni >0) printf("%4.2f%%Ni;", (double)Ni * 58.69 *100 / M); if (Os >0) printf("%4.2f%%Os;", (double)Os * 190.2 *100 / M); if (Pb >0) printf("%4.2f%%Pb;", (double)Pb * 207.2 *100 / M); if (Pd >0) printf("%4.2f%%Pd;", (double)Pd * 106.42 *100 / M); if (Pt >0) printf("%4.2f%%Pt;", (double)Pt * 195.078 *100 / M); if (Rb >0) printf("%4.2f%%Rb;", (double)Rb * 85.4678 *100 / M); if (Re >0) printf("%4.2f%%Re;", (double)Re * 186.207 *100 / M); if (Rh >0) printf("%4.2f%%Rh;", (double)Rh * 102.9055 *100 / M); if (Ru >0) printf("%4.2f%%Ru;", (double)Ru * 101.07 *100 / M); if (Sb >0) printf("%4.2f%%Sb;", (double)Sb * 121.75 *100 / M); if (Sc >0) printf("%4.2f%%Sc;", (double)Sc * 44.95591 *100 / M); if (Se >0) printf("%4.2f%%Se;", (double)Se * 78.96 *100 / M); if (Sn >0) printf("%4.2f%%Sn;", (double)Sn * 118.71 *100 / M); if (Sr >0) printf("%4.2f%%Sr;", (double)Sr * 87.62 *100 / M); if (Ta >0) printf("%4.2f%%Ta;", (double)Ta * 180.948 *100 / M); if (Te >0) printf("%4.2f%%Te;", (double)Te * 127.60 *100 / M); if (Ti >0) printf("%4.2f%%Ti;", (double)Ti * 47.88 *100 / M); if (Tl >0) printf("%4.2f%%Tl;", (double)Tl * 204.3833 *100 / M); if (V >0) printf("%4.2f%%V;", (double)V * 50.9415 *100 / M); if (W >0) printf("%4.2f%%W;", (double)W * 183.84 *100 / M); if (Ytt >0) printf("%4.2f%%Y;", (double)Ytt * 88.906 *100 / M); if (Zn >0) printf("%4.2f%%Zn;", (double)Zn * 65.39 *100. / M); if (Zr >0) printf("%4.2f%%Zr;", (double)Zr * 91.224 *100. / M); } else { if (*Alert != '\0') printf("%s overlapped bonds !", Alert); else printf("C0H0 [0.00] Me=0.0000000000 0.00%%C;0.00%%H"); } putchar('\n'); exit(EXIT_SUCCESS); } /* End. */ chemtool-1.6.14/src-cht/cht-1.7.c0000644000175000001440000017232310715417303015427 0ustar martinusers/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */ /* From input file "cht-1.7.pp" */ #ifndef P2C_H #define P2C_H /* Header file for code generated by "p2c", the Pascal-to-C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version 1.21alpha-07.Dec.93. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #include #define DOUBLE double /* If the following heuristic fails, compile -DBSD=0 for non-BSD systems, or -DBSD=1 for BSD systems. */ #ifdef M_XENIX # define BSD 0 #endif #ifdef vms # define BSD 0 # ifndef __STDC__ # define __STDC__ 1 # endif #endif #ifdef __TURBOC__ # define MSDOS 1 #endif #ifdef MSDOS # define BSD 0 #endif #ifdef FILE /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */ # ifndef BSD /* (a convenient, but horrible kludge!) */ # define BSD 1 # endif #endif #ifdef BSD # if !BSD # undef BSD # endif #endif #if (defined(__STDC__) && !defined(M_XENIX)) || defined(__TURBOC__) # include # include # define HAS_STDLIB # if defined(vms) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #else # ifndef BSD # ifndef __TURBOC__ # include # endif # endif # ifdef hpux # ifdef _INCLUDE__STDC__ # include # include # define HAS_STDLIB # endif # endif # include # if !defined(MSDOS) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #endif #if defined(NON_ANSI_CAT) && !defined(ANSI_CAT) # ifdef NON_ANSI_CAT_ALTERNATE # define __CAT__(a,b)a/**/b # else # define __ID__(a)a # define __CAT__(a,b)__ID__(a)b # endif #else # define __CAT__(a,b)a##b #endif #ifdef BSD # include # define memcpy(a,b,n) (bcopy(b,a,n),a) # define memcmp(a,b,n) bcmp(a,b,n) # define strchr(s,c) index(s,c) # define strrchr(s,c) rindex(s,c) #else # include #endif #include #include #include #include #ifndef NO_LACK #ifdef vms #define LACK_LABS #define LACK_MEMMOVE #define LACK_MEMCPY #else #define LACK_LABS /* Undefine these if your library has these */ #define LACK_MEMMOVE #endif #endif typedef struct __p2c_jmp_buf { struct __p2c_jmp_buf *next; jmp_buf jbuf; } __p2c_jmp_buf; /* Warning: The following will not work if setjmp is used simultaneously. This also violates the ANSI restriction about using vars after longjmp, but a typical implementation of longjmp will get it right anyway. */ #ifndef FAKE_TRY # define TRY(x) do { __p2c_jmp_buf __try_jb; \ __try_jb.next = __top_jb; \ if (!setjmp((__top_jb = &__try_jb)->jbuf)) { # define RECOVER(x) __top_jb = __try_jb.next; } else { # define RECOVER2(x,L) __top_jb = __try_jb.next; } else { \ if (0) { L: __top_jb = __try_jb.next; } # define ENDTRY(x) } } while (0) #else # define TRY(x) if (1) { # define RECOVER(x) } else do { # define RECOVER2(x,L) } else do { L: ; # define ENDTRY(x) } while (0) #endif #ifdef M_XENIX /* avoid compiler bug */ # define SHORT_MAX (32767) # define SHORT_MIN (-32768) #endif /* The following definitions work only on twos-complement machines */ #ifndef SHORT_MAX # define SHORT_MAX ((short)(((unsigned short) -1) >> 1)) # define SHORT_MIN (~SHORT_MAX) #endif #ifndef INT_MAX # define INT_MAX ((int)(((unsigned int) -1) >> 1)) # define INT_MIN (~INT_MAX) #endif #ifndef LONG_MAX # define LONG_MAX ((long)(((unsigned long) -1) >> 1)) # define LONG_MIN (~LONG_MAX) #endif #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 #endif #ifndef EXIT_SUCCESS # ifdef vms # define EXIT_SUCCESS 1 # define EXIT_FAILURE (02000000000L) # else # define EXIT_SUCCESS 0 # define EXIT_FAILURE 1 # endif #endif #define SETBITS 32 #if defined(__STDC__) || defined(__TURBOC__) # if !defined(vms) && !defined(M_LINT) # define Signed signed # else # define Signed # endif # define Void void /* Void f() = procedure */ # ifndef Const # define Const const # endif # ifndef Volatile # define Volatile volatile # endif # ifdef M_LINT # define PP(x) () # define PV() () typedef char *Anyptr; # else # define PP(x) x /* function prototype */ # define PV() (void) /* null function prototype */ typedef void *Anyptr; # endif #else # define Signed # define Void void # ifndef Const # define Const # endif # ifndef Volatile # define Volatile # endif # define PP(x) () # define PV() () typedef char *Anyptr; #endif #ifdef __GNUC__ # define Inline inline #else # define Inline #endif #define Register register /* Register variables */ #define Char char /* Characters (not bytes) */ #ifndef Static # define Static static /* Private global funcs and vars */ #endif #ifndef Local # define Local static /* Nested functions */ #endif typedef Signed char schar; typedef unsigned char uchar; typedef unsigned char boolean; #ifndef NO_DECLARE_ALFA typedef Char alfa[10]; #endif #ifndef true # define true 1 # define false 0 #endif #ifndef TRUE # define TRUE 1 # define FALSE 0 #endif typedef struct { Anyptr proc, link; } _PROCEDURE; #ifndef _FNSIZE # define _FNSIZE 120 #endif extern Void PASCAL_MAIN PP( (int, Char **) ); extern Char **P_argv; extern int P_argc; extern short P_escapecode; extern int P_ioresult; extern __p2c_jmp_buf *__top_jb; #ifdef P2C_H_PROTO /* if you have Ansi C but non-prototyped header files */ extern Char *strcat PP( (Char *, Const Char *) ); extern Char *strchr PP( (Const Char *, int) ); extern int strcmp PP( (Const Char *, Const Char *) ); extern Char *strcpy PP( (Char *, Const Char *) ); extern size_t strlen PP( (Const Char *) ); extern Char *strncat PP( (Char *, Const Char *, size_t) ); extern int strncmp PP( (Const Char *, Const Char *, size_t) ); extern Char *strncpy PP( (Char *, Const Char *, size_t) ); extern Char *strrchr PP( (Const Char *, int) ); extern Anyptr memchr PP( (Const Anyptr, int, size_t) ); extern Anyptr memmove PP( (Anyptr, Const Anyptr, size_t) ); extern Anyptr memset PP( (Anyptr, int, size_t) ); #ifndef memcpy extern Anyptr memcpy PP( (Anyptr, Const Anyptr, size_t) ); extern int memcmp PP( (Const Anyptr, Const Anyptr, size_t) ); #endif extern int atoi PP( (Const Char *) ); extern double atof PP( (Const Char *) ); extern long atol PP( (Const Char *) ); extern double strtod PP( (Const Char *, Char **) ); extern long strtol PP( (Const Char *, Char **, int) ); #endif /*P2C_H_PROTO*/ #ifndef HAS_STDLIB #ifndef NO_DECLARE_MALLOC extern Anyptr malloc PP( (size_t) ); extern Void free PP( (Anyptr) ); #endif #endif extern int _OutMem PV(); extern int _CaseCheck PV(); extern int _NilCheck PV(); extern int _Escape PP( (int) ); extern int _EscIO PP( (int) ); extern int _EscIO2 PP( (int, Char *) ); extern long ipow PP( (long, long) ); extern long P_imax PP( (long, long) ); extern long P_imin PP( (long, long) ); extern double P_rmax PP( (double, double) ); extern double P_rmin PP( (double, double) ); extern Char *strsub PP( (Char *, Char *, int, int) ); extern Char *strltrim PP( (Char *) ); extern Char *strrtrim PP( (Char *) ); extern Char *strrpt PP( (Char *, Char *, int) ); extern Char *strpad PP( (Char *, Char *, int, int) ); extern int strpos2 PP( (Char *, Char *, int) ); extern long memavail PV(); extern int P_peek PP( (FILE *) ); extern int P_eof PP( (FILE *) ); extern int P_eoln PP( (FILE *) ); extern Void P_readpaoc PP( (FILE *, Char *, int) ); extern Void P_readlnpaoc PP( (FILE *, Char *, int) ); extern long P_maxpos PP( (FILE *) ); extern Char *P_trimname PP( (Char *, int) ); extern long *P_setunion PP( (long *, long *, long *) ); extern long *P_setint PP( (long *, long *, long *) ); extern long *P_setdiff PP( (long *, long *, long *) ); extern long *P_setxor PP( (long *, long *, long *) ); extern int P_inset PP( (unsigned, long *) ); extern int P_setequal PP( (long *, long *) ); extern int P_subset PP( (long *, long *) ); extern long *P_addset PP( (long *, unsigned) ); extern long *P_addsetr PP( (long *, unsigned, unsigned) ); extern long *P_remset PP( (long *, unsigned) ); extern long *P_setcpy PP( (long *, long *) ); extern long *P_expset PP( (long *, long) ); extern long P_packset PP( (long *) ); extern int P_getcmdline PP( (int, int, Char *) ); extern Void TimeStamp PP( (int *, int *, int *, int *, int *, int *) ); extern Void P_sun_argv PP( (char *, int, int) ); extern FILE *_skipspaces PP( (FILE *) ); extern FILE *_skipnlspaces PP( (FILE *) ); /* I/O error handling */ #define _CHKIO(cond,ior,val,def) ((cond) ? P_ioresult=0,(val) \ : P_ioresult=(ior),(def)) #define _SETIO(cond,ior) (P_ioresult = (cond) ? 0 : (ior)) /* Following defines are suitable for the HP Pascal operating system */ #define FileNotFound 10 #define FileNotOpen 13 #define FileWriteError 38 #define BadInputFormat 14 #define EndOfFile 30 #define FILENOTFOUND 10 #define FILENOTOPEN 13 #define FILEWRITEERROR 38 #define BADINPUTFORMAT 14 #define ENDOFFILE 30 /* Creating temporary files */ #if (defined(BSD) || defined(NO_TMPFILE)) && !defined(HAVE_TMPFILE) # define tmpfile() (fopen(tmpnam(NULL), "w+")) #endif /* File buffers */ #define FILEBUF(f,sc,type) sc int __CAT__(f,_BFLAGS); \ sc type __CAT__(f,_BUFFER) #define FILEBUFNC(f,type) int __CAT__(f,_BFLAGS); \ type __CAT__(f,_BUFFER) #define RESETBUF(f,type) (__CAT__(f,_BFLAGS) = 1) #define SETUPBUF(f,type) (__CAT__(f,_BFLAGS) = 0) #define GETFBUF(f,type) (*((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(&__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ &__CAT__(f,_BUFFER))) #define AGETFBUF(f,type) ((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ __CAT__(f,_BUFFER)) #define PUTFBUF(f,type,v) (GETFBUF(f,type) = (v)) #define CPUTFBUF(f,v) (PUTFBUF(f,char,v)) #define APUTFBUF(f,type,v) (memcpy(AGETFBUF(f,type), (v), \ sizeof(__CAT__(f,_BUFFER)))) #define GET(f,type) (__CAT__(f,_BFLAGS) == 1 ? \ fread(&__CAT__(f,_BUFFER),sizeof(type),1,(f)) : \ (__CAT__(f,_BFLAGS) = 1)) #define PUT(f,type) (fwrite(&__CAT__(f,_BUFFER),sizeof(type),1,(f)), \ (__CAT__(f,_BFLAGS) = 0)) #define CPUT(f) (PUT(f,char)) #define BUFEOF(f) (__CAT__(f,_BFLAGS) != 2 && P_eof(f)) #define BUFFPOS(f) (ftell(f) - (__CAT__(f,_BFLAGS) == 2)) typedef struct { FILE *f; int f_BFLAGS; /* FILEBUFNC(f,Char); */ Char f_BUFFER; Char name[_FNSIZE]; } _TEXT; /* Memory allocation */ #ifdef __GCC__ # define Malloc(n) (malloc(n) ?: (Anyptr)_OutMem()) #else extern Anyptr __MallocTemp__; # define Malloc(n) ((__MallocTemp__ = malloc(n)) ? __MallocTemp__ : (Anyptr)_OutMem()) #endif #define FreeR(p) (free((Anyptr)(p))) /* used if arg is an rvalue */ #define Free(p) (free((Anyptr)(p)), (p)=NULL) /* sign extension */ #define SEXT(x,n) ((x) | -(((x) & (1L<<((n)-1))) << 1)) /* packed arrays */ /* BEWARE: these are untested! */ #define P_getbits_UB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] >> \ (((~(i))&((1<<(L)-(n))-1)) << (n)) & \ (1<<(1<<(n)))-1)) #define P_getbits_SB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] << \ (16 - ((((~(i))&((1<<(L)-(n))-1))+1) <<\ (n)) >> (16-(1<<(n)))))) #define P_putbits_UB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ (x) << (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_putbits_SB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ ((x) & (1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_clrbits_B(a,i,n,L) ((a)[(i)>>(L)-(n)] &= \ ~( ((1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) ) /* small packed arrays */ #define P_getbits_US(v,i,n) ((int)((v) >> ((i)<<(n)) & (1<<(1<<(n)))-1)) #define P_getbits_SS(v,i,n) ((int)((long)(v) << (SETBITS - (((i)+1) << (n))) >> (SETBITS-(1<<(n))))) #define P_putbits_US(v,i,x,n) ((v) |= (x) << ((i) << (n))) #define P_putbits_SS(v,i,x,n) ((v) |= ((x) & (1<<(1<<(n)))-1) << ((i)<<(n))) #define P_clrbits_S(v,i,n) ((v) &= ~( ((1<<(1<<(n)))-1) << ((i)<<(n)) )) #define P_max(a,b) ((a) > (b) ? (a) : (b)) #define P_min(a,b) ((a) < (b) ? (a) : (b)) /* Fix ANSI-isms */ #ifdef LACK_LABS # ifndef labs # define labs my_labs extern long my_labs PP( (long) ); # endif #endif #ifdef LACK_MEMMOVE # ifndef memmove # define memmove my_memmove extern Anyptr my_memmove PP( (Anyptr, Const Anyptr, size_t) ); # endif #endif #ifdef LACK_MEMCPY # ifndef memcpy # define memcpy my_memcpy extern Anyptr my_memcpy PP( (Anyptr, Const Anyptr, size_t) ); # endif # ifndef memcmp # define memcmp my_memcmp extern int my_memcmp PP( (Const Anyptr, Const Anyptr, size_t) ); # endif # ifndef memset # define memset my_memset extern Anyptr my_memset PP( (Anyptr, int, size_t) ); # endif #endif /* Fix toupper/tolower on Suns and other stupid BSD systems */ #ifdef toupper # undef toupper # undef tolower # define toupper(c) my_toupper(c) # define tolower(c) my_tolower(c) #endif #ifndef _toupper # if 'A' == 65 && 'a' == 97 # define _toupper(c) ((c)-'a'+'A') # define _tolower(c) ((c)-'A'+'a') # else # ifdef toupper # undef toupper /* hope these are shadowing real functions, */ # undef tolower /* because my_toupper calls _toupper! */ # endif # define _toupper(c) toupper(c) # define _tolower(c) tolower(c) # endif #endif #endif /* P2C_H */ /* End. */ /* Run-time library for use with "p2c", the Pascal to C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version --VERSION--. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #ifndef NO_TIME # include #endif #define Isspace(c) isspace(c) /* or "((c) == ' ')" if preferred */ int P_argc; char **P_argv; short P_escapecode; int P_ioresult; long EXCP_LINE; /* Used by Pascal workstation system */ Anyptr __MallocTemp__; __p2c_jmp_buf *__top_jb; void PASCAL_MAIN(argc, argv) int argc; char **argv; { P_argc = argc; P_argv = argv; __top_jb = NULL; #ifdef LOCAL_INIT LOCAL_INIT(); #endif } /* In case your system lacks these... */ long my_labs(x) long x; { return((x > 0) ? x : -x); } #ifdef __STDC__ Anyptr my_memmove(Anyptr d, Const Anyptr s, size_t n) #else Anyptr my_memmove(d, s, n) Anyptr d, s; register int n; #endif { register char *dd = (char *)d, *ss = (char *)s; if (dd < ss || dd - ss >= n) { #if defined(bcopy) && defined(memcpy) my_memcpy(dd, ss, n); #else memcpy(dd, ss, n); #endif } else if (n > 0) { dd += n; ss += n; while (n-- > 0) *--dd = *--ss; } return d; } #ifdef __STDC__ Anyptr my_memcpy(Anyptr d, Const Anyptr s, size_t n) #else Anyptr my_memcpy(d, s, n) Anyptr d, s; register int n; #endif { register char *ss = (char *)s, *dd = (char *)d; while (n-- > 0) *dd++ = *ss++; return d; } #ifdef __STDC__ int my_memcmp(Const Anyptr s1, Const Anyptr s2, size_t n) #else int my_memcmp(s1, s2, n) Anyptr s1, s2; register int n; #endif { register char *a = (char *)s1, *b = (char *)s2; register int i; while (n-- > 0) if ((i = (*a++) - (*b++)) != 0) return i; return 0; } #ifdef __STDC__ Anyptr my_memset(Anyptr d, int c, size_t n) #else Anyptr my_memset(d, c, n) Anyptr d; register int c; register int n; #endif { register char *dd = (char *)d; while (n-- > 0) *dd++ = c; return d; } int my_toupper(c) int c; { if (islower(c)) return _toupper(c); else return c; } int my_tolower(c) int c; { if (isupper(c)) return _tolower(c); else return c; } long ipow(a, b) long a, b; { long v; if (a == 0 || a == 1) return a; if (a == -1) return (b & 1) ? -1 : 1; if (b < 0) return 0; if (a == 2) return 1L << b; v = (b & 1) ? a : 1; while ((b >>= 1) > 0) { a *= a; if (b & 1) v *= a; } return v; } long P_imax(a, b) long a, b; { if (a > b) return a; else return b; } long P_imin(a, b) long a, b; { if (a < b) return a; else return b; } double P_rmax(a, b) double a, b; { if (a > b) return a; else return b; } double P_rmin(a, b) double a, b; { if (a < b) return a; else return b; } /* Common string functions: */ /* Store in "ret" the substring of length "len" starting from "pos" (1-based). Store a shorter or null string if out-of-range. Return "ret". */ char *strsub(ret, s, pos, len) register char *ret, *s; register int pos, len; { register char *s2; if (--pos < 0 || len <= 0) { *ret = 0; return ret; } while (pos > 0) { if (!*s++) { *ret = 0; return ret; } pos--; } s2 = ret; while (--len >= 0) { if (!(*s2++ = *s++)) return ret; } *s2 = 0; return ret; } /* Return the index of the first occurrence of "pat" as a substring of "s", starting at index "pos" (1-based). Result is 1-based, 0 if not found. */ int strpos2(s, pat, pos) char *s; register char *pat; register int pos; { register char *cp, ch; register int slen; if (--pos < 0) return 0; slen = strlen(s) - pos; cp = s + pos; if (!(ch = *pat++)) return 0; pos = strlen(pat); slen -= pos; while (--slen >= 0) { if (*cp++ == ch && !strncmp(cp, pat, pos)) return cp - s; } return 0; } /* Case-insensitive version of strcmp. */ int strcicmp(s1, s2) register char *s1, *s2; { register unsigned char c1, c2; while (*s1) { if (*s1++ != *s2++) { if (!s2[-1]) return 1; c1 = toupper(s1[-1]); c2 = toupper(s2[-1]); if (c1 != c2) return c1 - c2; } } if (*s2) return -1; return 0; } /* HP and Turbo Pascal string functions: */ /* Trim blanks at left end of string. */ char *strltrim(s) register char *s; { while (Isspace(*s++)) ; return s - 1; } /* Trim blanks at right end of string. */ char *strrtrim(s) register char *s; { register char *s2 = s; if (!*s) return s; while (*++s2) ; while (s2 > s && Isspace(*--s2)) *s2 = 0; return s; } /* Store in "ret" "num" copies of string "s". Return "ret". */ char *strrpt(ret, s, num) char *ret; register char *s; register int num; { register char *s2 = ret; register char *s1; while (--num >= 0) { s1 = s; while ((*s2++ = *s1++)) ; s2--; } return ret; } /* Store in "ret" string "s" with enough pad chars added to reach "size". */ char *strpad(ret, s, padchar, num) char *ret; register char *s; register int padchar, num; { register char *d = ret; if (s == d) { while (*d++) ; } else { while ((*d++ = *s++)) ; } num -= (--d - ret); while (--num >= 0) *d++ = padchar; *d = 0; return ret; } /* Copy the substring of length "len" from index "spos" of "s" (1-based) to index "dpos" of "d", lengthening "d" if necessary. Length and indices must be in-range. */ void strmove(len, s, spos, d, dpos) register char *s, *d; register int len, spos, dpos; { s += spos - 1; d += dpos - 1; while (*d && --len >= 0) *d++ = *s++; if (len > 0) { while (--len >= 0) *d++ = *s++; *d = 0; } } /* Delete the substring of length "len" at index "pos" from "s". Delete less if out-of-range. */ void strdelete(s, pos, len) register char *s; register int pos, len; { register int slen; if (--pos < 0) return; slen = strlen(s) - pos; if (slen <= 0) return; s += pos; if (slen <= len) { *s = 0; return; } while ((*s = s[len])) s++; } /* Insert string "src" at index "pos" of "dst". */ void strinsert(src, dst, pos) register char *src, *dst; register int pos; { register int slen, dlen; if (--pos < 0) return; dlen = strlen(dst); dst += dlen; dlen -= pos; if (dlen <= 0) { strcpy(dst, src); return; } slen = strlen(src); do { dst[slen] = *dst; --dst; } while (--dlen >= 0); dst++; while (--slen >= 0) *dst++ = *src++; } /* File functions */ /* Peek at next character of input stream; return EOF at end-of-file. */ int P_peek(f) FILE *f; { int ch; ch = getc(f); if (ch == EOF) return EOF; ungetc(ch, f); return (ch == '\n') ? ' ' : ch; } /* Check if at end of file, using Pascal "eof" semantics. End-of-file for stdin is broken; remove the special case for it to be broken in a different way. */ int P_eof(f) FILE *f; { register int ch; if (feof(f)) return 1; #ifdef HAVE_ISATTY if (isatty(fileno(f))) #else if (f == stdin) #endif return 0; /* not safe to look-ahead on the keyboard! */ ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return 0; } /* Check if at end of line (or end of entire file). */ int P_eoln(f) FILE *f; { register int ch; ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return (ch == '\n'); } /* Skip whitespace (including newlines) in a file. */ FILE *_skipnlspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t' || ch == '\n'); if (ch != EOF) ungetc(ch, f); return f; } /* Skip whitespace (not including newlines) in a file. */ FILE *_skipspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t'); if (ch != EOF) ungetc(ch, f); return f; } /* Read a packed array of characters from a file. */ Void P_readpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { if (len <= 0) return; ch = getc(f); if (ch == EOF || ch == '\n') break; *s++ = ch; --len; } while (--len >= 0) *s++ = ' '; if (ch != EOF) ungetc(ch, f); } Void P_readlnpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { ch = getc(f); if (ch == EOF || ch == '\n') break; if (len > 0) { *s++ = ch; --len; } } while (--len >= 0) *s++ = ' '; } /* Compute maximum legal "seek" index in file (0-based). */ long P_maxpos(f) FILE *f; { long savepos = ftell(f); long val; if (fseek(f, 0L, SEEK_END)) return -1; val = ftell(f); if (fseek(f, savepos, SEEK_SET)) return -1; return val; } /* Use packed array of char for a file name. */ Char *P_trimname(fn, len) register Char *fn; register int len; { static Char fnbuf[256]; register Char *cp = fnbuf; while (--len >= 0 && *fn && !isspace(*fn)) *cp++ = *fn++; *cp = 0; return fnbuf; } /* Pascal's "memavail" doesn't make much sense in Unix with virtual memory. We fix memory size as 10Meg as a reasonable compromise. */ long memavail() { return 10000000; /* worry about this later! */ } long maxavail() { return memavail(); } /* Sets are stored as an array of longs. S[0] is the size of the set; S[N] is the N'th 32-bit chunk of the set. S[0] equals the maximum I such that S[I] is nonzero. S[0] is zero for an empty set. Within each long, bits are packed from lsb to msb. The first bit of the set is the element with ordinal value 0. (Thus, for a "set of 5..99", the lowest five bits of the first long are unused and always zero.) */ /* (Sets with 32 or fewer elements are normally stored as plain longs.) */ long *P_setunion(d, s1, s2) /* d := s1 + s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ | *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; *dbase = d - dbase - 1; return dbase; } long *P_setint(d, s1, s2) /* d := s1 * s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setdiff(d, s1, s2) /* d := s1 - s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & ~*s2++; if (sz1 >= 0) { while (sz1-- >= 0) *d++ = *s1++; } while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setxor(d, s1, s2) /* d := s1 / s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ ^ *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } int P_inset(val, s) /* val IN s */ register unsigned val; register long *s; { register int bit; bit = val % SETBITS; val /= SETBITS; if (val < *s++ && ((1L< size) { s += size; while (val > size) *++s = 0, size++; *sbase = size; } else s += val; *s |= 1L< (int)v2) return sbase; b1 = v1 % SETBITS; v1 /= SETBITS; b2 = v2 % SETBITS; v2 /= SETBITS; size = *s; v1++; if (++v2 > size) { while (v2 > size) s[++size] = 0; s[v2] = 0; *s = v2; } s += v1; if (v1 == v2) { *s |= (~((-2L)<<(b2-b1))) << b1; } else { *s++ |= (-1L) << b1; while (++v1 < v2) *s++ = -1; *s |= ~((-2L) << b2); } return sbase; } long *P_remset(s, val) /* s := s - [val] */ register long *s; register unsigned val; { register int bit; bit = val % SETBITS; val /= SETBITS; if (++val <= *s) { if (!(s[val] &= ~(1L<= 0) { if (*s1++ != *s2++) return 0; } return 1; } int P_subset(s1, s2) /* s1 <= s2 */ register long *s1, *s2; { register int sz1 = *s1++, sz2 = *s2++; if (sz1 > sz2) return 0; while (--sz1 >= 0) { if (*s1++ & ~*s2++) return 0; } return 1; } long *P_setcpy(d, s) /* d := s */ register long *d, *s; { register long *save_d = d; #ifdef SETCPY_MEMCPY memcpy(d, s, (*s + 1) * sizeof(long)); #else register int i = *s + 1; while (--i >= 0) *d++ = *s++; #endif return save_d; } /* s is a "smallset", i.e., a 32-bit or less set stored directly in a long. */ long *P_expset(d, s) /* d := s */ register long *d; register long s; { if (s) { d[1] = s; *d = 1; } else *d = 0; return d; } long P_packset(s) /* convert s to a small-set */ register long *s; { if (*s++) return *s; else return 0; } /* Oregon Software Pascal extensions, courtesy of William Bader */ int P_getcmdline(l, h, line) int l, h; Char *line; { int i, len; char *s; h = h - l + 1; len = 0; for(i = 1; i < P_argc; i++) { s = P_argv[i]; while (*s) { if (len >= h) return len; line[len++] = *s++; } if (len >= h) return len; line[len++] = ' '; } return len; } Void TimeStamp(Day, Month, Year, Hour, Min, Sec) int *Day, *Month, *Year, *Hour, *Min, *Sec; { #ifndef NO_TIME struct tm *tm; long clock; time(&clock); tm = localtime(&clock); *Day = tm->tm_mday; *Month = tm->tm_mon + 1; /* Jan = 0 */ *Year = tm->tm_year; if (*Year < 1900) *Year += 1900; /* year since 1900 */ *Hour = tm->tm_hour; *Min = tm->tm_min; *Sec = tm->tm_sec; #endif } Void VAXdate(s) char *s; { long clock; char *c; int i; static int where[] = {8, 9, 0, 4, 5, 6, 0, 20, 21, 22, 23}; time(&clock); c = ctime(&clock); for (i = 0; i < 11; i++) s[i] = my_toupper(c[where[i]]); s[2] = '-'; s[6] = '-'; } Void VAXtime(s) char *s; { long clock; char *c; int i; time(&clock); c = ctime(&clock); for (i = 0; i < 8; i++) s[i] = c[i+11]; s[8] = '.'; s[9] = '0'; s[10] = '0'; } /* SUN Berkeley Pascal extensions */ Void P_sun_argv(s, len, n) register char *s; register int len, n; { register char *cp; if ((unsigned)n < P_argc) cp = P_argv[n]; else cp = ""; while (*cp && --len >= 0) *s++ = *cp++; while (--len >= 0) *s++ = ' '; } int _OutMem() { return _Escape(-2); } int _CaseCheck() { return _Escape(-9); } int _NilCheck() { return _Escape(-3); } /* The following is suitable for the HP Pascal operating system. It might want to be revised when emulating another system. */ char *_ShowEscape(buf, code, ior, prefix) char *buf, *prefix; int code, ior; { char *bufp; if (prefix && *prefix) { strcpy(buf, prefix); strcat(buf, ": "); bufp = buf + strlen(buf); } else { bufp = buf; } if (code == -10) { sprintf(bufp, "Pascal system I/O error %d", ior); switch (ior) { case 3: strcat(buf, " (illegal I/O request)"); break; case 7: strcat(buf, " (bad file name)"); break; case FileNotFound: /*10*/ strcat(buf, " (file not found)"); break; case FileNotOpen: /*13*/ strcat(buf, " (file not open)"); break; case BadInputFormat: /*14*/ strcat(buf, " (bad input format)"); break; case 24: strcat(buf, " (not open for reading)"); break; case 25: strcat(buf, " (not open for writing)"); break; case 26: strcat(buf, " (not open for direct access)"); break; case 28: strcat(buf, " (string subscript out of range)"); break; case EndOfFile: /*30*/ strcat(buf, " (end-of-file)"); break; case FileWriteError: /*38*/ strcat(buf, " (file write error)"); break; } } else { sprintf(bufp, "Pascal system error %d", code); switch (code) { case -2: strcat(buf, " (out of memory)"); break; case -3: strcat(buf, " (reference to NIL pointer)"); break; case -4: strcat(buf, " (integer overflow)"); break; case -5: strcat(buf, " (divide by zero)"); break; case -6: strcat(buf, " (real math overflow)"); break; case -8: strcat(buf, " (value range error)"); break; case -9: strcat(buf, " (CASE value range error)"); break; case -12: strcat(buf, " (bus error)"); break; case -20: strcat(buf, " (stopped by user)"); break; } } return buf; } int _Escape(code) int code; { char buf[100]; P_escapecode = code; if (__top_jb) { __p2c_jmp_buf *jb = __top_jb; __top_jb = jb->next; longjmp(jb->jbuf, 1); } if (code == 0) exit(EXIT_SUCCESS); if (code == -1) exit(EXIT_FAILURE); fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } int _EscIO(code) int code; { P_ioresult = code; return _Escape(-10); } int _EscIO2(code, name) int code; char *name; { P_ioresult = code; if (!__top_jb && name && *name) { char buf[100]; fprintf(stderr, "%s: %s\n", name, _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } return _Escape(-10); } /* End. */ typedef struct TPoint { long X, Y, C, H, N, O, P, S, Si, B, Br, Cl, F, I, Mg, Na, K, RecCount; struct TPoint *Last; } TPoint; typedef struct TBond { long X1, Y1, X2, Y2, RecCount; struct TBond *Last; } TBond; Static long C, H, N, O, P, S, Si, B, Br, Cl, F, I, Mg, Na, K, X1, X2, Y1, Y2, T; Static FILE *IFile; Static TPoint *Point, *Last, *Current; Static TBond *Bond, *LastB, *CurrentB; Static Char sss[256], A[256], subs[256], Alert[256]; Static Char sssb[7]; Static double M, Me; Static Char separator; Static long Count, code, atoms, rep, range, bonds; Static boolean Abandon, debug, verbose, fa, nobonds; Static long Sensi = 5; /*bonds and labels joint precision sensitivity*/ Static Char IFile_NAME[_FNSIZE]; Static Void doBonds() { do { fscanf(IFile, "%ld%ld%ld%ld%ld%*[^\n]", &X1, &Y1, &X2, &Y2, &T); getc(IFile); bonds--; if (debug) printf("%ld; %ld; %ld; %ld; %ld\n", X1, Y1, X2, Y2, T); if (T == 11) range = ((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2)) * 4; LastB = Bond; Bond = (TBond *)Malloc(sizeof(TBond)); Bond->X1 = X1; Bond->X2 = X2; Bond->Y1 = Y1; Bond->Y2 = Y2; Bond->Last = LastB; CurrentB = Bond; Bond = Bond->Last; while (Bond->Last != NULL) { if ((labs(Bond->X1 - X1) < Sensi && labs(Bond->Y1 - Y1) < Sensi && labs(Bond->X2 - X2) < Sensi && labs(Bond->Y2 - Y2) < Sensi) || (labs(Bond->X2 - X1) < Sensi && labs(Bond->Y2 - Y1) < Sensi && labs(Bond->X1 - X2) < Sensi && labs(Bond->Y1 - Y2) < Sensi)) { if (debug) printf(" ! Bond overlap\n"); strcat(Alert, "!"); } Bond = Bond->Last; } Bond = CurrentB; Abandon = false; Current = Point; while (Point->Last != NULL) { if (T == 11) { Abandon = true; if ((Point->X - X1) * (Point->X - X1) + (Point->Y - Y1) * (Point->Y - Y1) < range) { if (Point->H > 0) Point->H--; if (debug) printf("Ring --> stripped one H from %ld %ld\n", Point->X, Point->Y); } } else { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X1, Y1); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)Malloc(sizeof(TPoint)); Point->X = X1; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y1; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Na = 0; Point->Mg = 0; Point->K = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } if (T != 11) { Abandon = false; Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X2) < Sensi && labs(Point->Y - Y2) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X2, Y2); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)Malloc(sizeof(TPoint)); Point->X = X2; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y2; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Mg = 0; Point->Na = 0; Point->K = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } } } while (bonds != 0); } Static Void doLabels() { long mul, gmul, gmpos, ggmul, ggmpos; boolean stripped; Char STR2[256]; long FORLIM; Char *TEMP; if (debug) printf("---- and now parse the labels ---------\n"); if (verbose) printf("HeteroAtoms: %ld\n", atoms); FORLIM = atoms; for (rep = 1; rep <= FORLIM; rep++) { fscanf(IFile, "%ld%ld%c", &X1, &Y1, &separator); fgets(sss, 256, IFile); TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; sprintf(A, "%.*s", strpos2(sss, "\t", 1) - 1, sss); if (debug) printf("Atom %s X=%ld Y=%ld sss: %s\n", A, X1, Y1, sss); if (nobonds) { /*initialize the Point structure if no bonds, only labels, defined*/ Count++; Last = Point; Point = (TPoint *)Malloc(sizeof(TPoint)); Point->X = X1; Point->Y = Y1; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Mg = 0; Point->Na = 0; Point->K = 0; Point->RecCount = Count; Point->Last = Last; } Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" [%ld]\n", Point->RecCount); Point->C = 0; /*we substitute -CH_x(-) by -R(-)*/ Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Mg = 0; Point->Na = 0; Point->K = 0; mul = 1; gmul = 1; ggmul = 1; while (*A != '\0') { stripped = false; if (strlen(A) >= 5) { sprintf(subs, "%.5s", A); if (strlen(A) > 6) { if (A[5] == '_') { sprintf(STR2, "%c", A[6]); code = (sscanf(STR2, "%ld", &mul) == 0); } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "TBDMS")) { /*Tert-butyldimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 15; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (!strcmp(subs, "TBDPS")) { /*Tert-butyldiphenylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 16; Point->H += mul * 19; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (A[0] == '[') { ggmpos = strpos2(A, "]", 1); if (ggmpos != 0) { if (A[ggmpos] == '_') { sprintf(STR2, "%c", A[ggmpos+1]); code = (sscanf(STR2, "%ld", &ggmul) == 0); } else ggmul = 1; } } if (A[0] == '(') { gmpos = strpos2(A, ")", 1); if (gmpos != 0) { if (A[gmpos] == '_') { sprintf(STR2, "%c", A[gmpos+1]); code = (sscanf(STR2, "%ld", &gmul) == 0); } else gmul = 1; } } } if (strlen(A) >= 4 && !stripped) { sprintf(subs, "%.4s", A); if (strlen(A) > 5) { if (A[4] == '_') { sprintf(STR2, "%c", A[5]); code = (sscanf(STR2, "%ld", &mul) == 0); } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "DBAM")) { /*dibutylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 9; Point->H += mul * 19; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMAM")) { /*dimethylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMTr")) { /*dimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 21; Point->H += mul * 19; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "MMTr")) { /*monomethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 20; Point->H += mul * 16; Point->O += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "TMTr")) { /*trimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 22; Point->H += mul * 22; Point->O += mul * 3; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } } if (strlen(A) >= 3 && !stripped) { sprintf(subs, "%.3s", A); if (strlen(A) > 4) { if (A[3] == '_') { sprintf(STR2, "%c", A[4]); code = (sscanf(STR2, "%ld", &mul) == 0); } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ade")) { /*Adeninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "BOC")) { /*Butyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 9; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Cyt")) { /*Cytosinyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 4; Point->N += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Gua")) { /*Guaninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iBu")) { /*iso-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iPr")) { /*2-Propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOC")) { /*Methoxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOM")) { /*Methoxymethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "tBu")) { /*t-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Thy")) { /*Thyminyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 5; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "TMS")) { /*Trimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 9; Point->Si += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Tol")) { /*tolyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Ura")) { /*Uracilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 3; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } } if (strlen(A) >= 2 && !stripped) { sprintf(subs, "%.2s", A); if (strlen(A) > 3) { if (A[2] == '_') { sprintf(STR2, "%c", A[3]); code = (sscanf(STR2, "%ld", &mul) == 0); } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ac")) { /*acetyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bn")) { /*benzyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Br")) { /*bromine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Br += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bu")) { /*butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bz")) { /*benzoyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "CE")) { /*cyanoethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 4; Point->N += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cl")) { /*chlorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Et")) { /*ethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Me")) { /*methyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ms")) { /*methanesulfonyl, mesyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mg")) { /*magnesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Na")) { /*sodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Na += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ph")) { /*phenyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pr")) { /*propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tf")) { /*trifluoromethanesulfonyl, triflyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->F += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tr")) { /*trityl, triphenylmethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 19; Point->H += mul * 15; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ts")) { /*toluenesulfonyl, tosyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Si")) { /*silicon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Si += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } } if (strlen(A) < 1 || stripped) continue; sprintf(subs, "%.1s", A); if (strlen(A) > 2) { if (A[1] == '_') { sprintf(STR2, "%c", A[2]); code = (sscanf(STR2, "%ld", &mul) == 0); } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "B")) { /*boron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->B += mul; } if (!strcmp(subs, "C")) { /*carbon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; } if (!strcmp(subs, "F")) { /*fluorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->F += mul; } if (!strcmp(subs, "H")) { /*hydrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->H += mul; } if (!strcmp(subs, "I")) { /*iodine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->I += mul; } if (!strcmp(subs, "K")) { /*potassium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->K += mul; } if (!strcmp(subs, "N")) { /*nitrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->N += mul; } if (!strcmp(subs, "O")) { /*oxygen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->O += mul; } if (!strcmp(subs, "P")) { /*phosphorus*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->P += mul; } if (!strcmp(subs, "S")) { /*sulfur*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->S += mul; } if (!strcmp(subs, "Z")) { /*"Z", Benzyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul * 2; } if (!strcmp(subs, ")")) /*reset gmul*/ gmul = 1; if (!strcmp(subs, "]")) { /*reset gmul,ggmul*/ gmul = 1; ggmul = 1; } if (true) strcpy(A, strsub(STR2, A, 2, (int)(strlen(A) - 1))); } } Point = Point->Last; } Point = Current; } } main(argc, argv) int argc; Char *argv[]; { Char STR1[256], STR2[256]; Char *TEMP; PASCAL_MAIN(argc, argv); IFile = NULL; if (P_argc == 1) { printf("enter \"cht -h\" for help\n"); _Escape(0); } C = 0; H = 0; N = 0; O = 0; P = 0; S = 0; Si = 0; B = 0; Br = 0; I = 0; Cl = 0; F = 0; Mg = 0; Na = 0; K = 0; verbose = false; debug = false; fa = false; /*no file assigned*/ Count = 0; *Alert = '\0'; for (rep = 1; rep < P_argc; rep++) { if (!strcmp(strcpy(STR2, P_argv[rep]), "-v") || !strcmp(strcpy(STR1, P_argv[rep]), "--verbose")) verbose = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-d") || !strcmp(strcpy(STR1, P_argv[rep]), "--debug")) debug = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-h") || !strcmp(strcpy(STR1, P_argv[rep]), "--help")) { printf("The Chemtool drawings analyzer 1.7\n"); printf("*** Gizmo Head Software ***\n"); printf(" Radek Liboska (c) 2001\n\n"); printf("syntax: cht [-options] \n\n"); printf("Recognizes C,H,O,N,P,S,Si,B,Br,I,Cl,F,Mg,Na,K,\n"); printf( " Ac,Ade,Bn,Bu,Bz,BOC,Cyt,CE,DBAM,DMAM,DMTr,Et,Gua,iBu,iPr,Me,Ms,MOC,\n"); printf( " MOM,MMTr,Ph,Pr,tBu,Tf,Thy,Tol,Tr,Ts,TBDMS,TBDPS,TMS,TMTr,Ura,Z\n"); printf("Can handle two levels of patentheses; e.g. P[OCH(CH_3)_2]_3\n\n"); printf("options:\n"); printf(" -h or --help : this help\n"); printf(" -v or --verbose : be verbose\n"); printf(" -d or --debug : be more verbose\n\n"); _Escape(0); } if (strcpy(STR2, P_argv[rep])[0] != '-') { strcpy(STR1, P_argv[rep]); strcpy(IFile_NAME, STR1); fa = true; } } if (!fa) { printf("No file defined, enter \"cht -h\" for help\n"); _Escape(1); } if (IFile != NULL) IFile = freopen(IFile_NAME, "r", IFile); else IFile = fopen(IFile_NAME, "r"); if (IFile == NULL) _EscIO2(FileNotFound, IFile_NAME); Point = (TPoint *)Malloc(sizeof(TPoint)); Point->X = 0; Point->Y = 0; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Mg = 0; Point->Na = 0; Point->K = 0; Point->RecCount = Count; Point->Last = NULL; Bond = (TBond *)Malloc(sizeof(TBond)); Bond->X1 = 0; Bond->Y1 = 0; Bond->X2 = 0; Bond->Y2 = 0; Bond->RecCount = Count; Bond->Last = NULL; fgets(sss, 256, IFile); TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; sprintf(sss, "%.18s", strcpy(STR1, sss)); if (strcmp(sss, "Chemtool Version 1")) { printf("Not a chemtool 1.x file, enter \"cht -h\" for help\n"); _Escape(2); } fscanf(IFile, "%*[^\n]"); getc(IFile); fgets(sssb, 7, IFile); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } fscanf(IFile, "%ld%*[^\n]", &bonds); getc(IFile); if (bonds == 0) nobonds = true; if (!strcmp(sssb, "bonds ")) { if (bonds > 0) doBonds(); } fgets(sssb, 7, IFile); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } fscanf(IFile, "%ld%*[^\n]", &atoms); getc(IFile); if (!strcmp(sssb, "atoms ")) { if (atoms > 0) doLabels(); } if (IFile != NULL) fclose(IFile); IFile = NULL; if (verbose) printf("---------------------- Summary -------------------------\n"); while (Point->Last != NULL) { if (verbose) printf( "RecCount: %ld X=%ld Y=%ld C%ld H%ld N%ld O%ld P%ld S%ld Si%ld B%ld Br%ld Cl%ld F%ld I%ld Mg%ld Na%ld K%ld\n", Point->RecCount, Point->X, Point->Y, Point->C, Point->H, Point->N, Point->O, Point->P, Point->S, Point->Si, Point->B, Point->Br, Point->Cl, Point->F, Point->I, Point->Mg, Point->Na, Point->K); C += Point->C; H += Point->H; N += Point->N; O += Point->O; P += Point->P; S += Point->S; Si += Point->Si; B += Point->B; Br += Point->Br; Cl += Point->Cl; F += Point->F; I += Point->I; Mg += Point->Mg; Na += Point->Na; K += Point->K; Point = Point->Last; } if (H < 0) /*overlapped bonds*/ H = 0; M = C * 12.011 + H * 1.0079 + N * 14.0067 + O * 15.9994 + P * 30.97376 + S * 32.064 + Si * 28.086 + B * 10.81 + Br * 79.904 + Cl * 35.453 + F * 18.9984 + I * 126.9045 + Mg * 24.305 + Na * 22.98977 + K * 39.098; Me = C * 12 + H * 1.007825037 + N * 14.003074008 + O * 15.99491464 + P * 30.9737634 + S * 31.9720718 + Si * 27.9769284 + B * 11.0093053 + Br * 78.9183361 + Cl * 34.968852729 + F * 18.99840325 + I * 126.904477 + Mg * 23.9850450 + Na * 22.9897697 + K * 38.9637079; if (Me > 0 && *Alert == '\0') { if (C > 1) printf("C%ld", C); if (C == 1) putchar('C'); if (H > 1) printf("H%ld", H); if (H == 1) putchar('H'); if (N > 1) printf("N%ld", N); if (N == 1) putchar('N'); if (O > 1) printf("O%ld", O); if (O == 1) putchar('O'); if (P > 1) printf("P%ld", P); if (P == 1) putchar('P'); if (S > 1) printf("S%ld", S); if (S == 1) putchar('S'); if (Si > 1) printf("Si%ld", Si); if (Si == 1) printf("Si"); if (B > 1) printf("B%ld", B); if (B == 1) putchar('B'); if (Br > 1) printf("Br%ld", Br); if (Br == 1) printf("Br"); if (Cl > 1) printf("Cl%ld", Cl); if (Cl == 1) printf("Cl"); if (F > 1) printf("F%ld", F); if (F == 1) putchar('F'); if (I > 1) printf("I%ld", I); if (I == 1) putchar('I'); if (Mg > 1) printf("Mg%ld", Mg); if (Mg == 1) printf("Mg"); if (Na > 1) printf("Na%ld", Na); if (Na == 1) printf("Na"); if (K > 1) printf("K%ld", K); if (K == 1) putchar('K'); printf(" [%2.3f]", M); printf(" Me=%2.10f ", Me); if (C > 0) printf("%4.2f%%C;", C * 12.011 * 100 / M); if (H > 0) printf("%4.2f%%H;", H * 1.0079 * 100 / M); if (B > 0) printf("%4.2f%%B;", B * 10.81 * 100 / M); if (N > 0) printf("%4.2f%%N;", N * 14.0067 * 100 / M); if (O > 0) printf("%4.2f%%O;", O * 15.9994 * 100 / M); if (P > 0) printf("%4.2f%%P;", P * 30.97376 * 100 / M); if (S > 0) printf("%4.2f%%S;", S * 32.0640 * 100 / M); if (K > 0) printf("%4.2f%%K;", K * 39.098 * 100 / M); if (Mg > 0) printf("%4.2f%%Mg;", Mg * 24.305 * 100 / M); if (Na > 0) printf("%4.2f%%Na;", Na * 22.98977 * 100 / M); if (Si > 0) printf("%4.2f%%Si;", Si * 28.086 * 100 / M); if (Br > 0) printf("%4.2f%%Br;", Br * 79.904 * 100 / M); if (Cl > 0) printf("%4.2f%%Cl;", Cl * 35.453 * 100 / M); if (F > 0) printf("%4.2f%%F;", F * 18.9984 * 100 / M); if (I > 0) printf("%4.2f%%I;", I * 126.9045 * 100 / M); } else { if (*Alert != '\0') printf("%s overlapped bonds !", Alert); else printf("C0H0 [0.00] Me=0.0000000000 0.00%%C;0.00%%H"); } putchar('\n'); exit(EXIT_SUCCESS); } /* End. */ chemtool-1.6.14/src-cht/cht-2.7.c0000644000175000001440000026110710767765761015454 0ustar martinusers/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */ /* From input file "cht-1.7.pp" */ #ifdef HAVE_CONFIG_H #include #endif #ifndef P2C_H #define P2C_H /* Header file for code generated by "p2c", the Pascal-to-C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version 1.21alpha-07.Dec.93. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #include #include #define DOUBLE double /* If the following heuristic fails, compile -DBSD=0 for non-BSD systems, or -DBSD=1 for BSD systems. */ #ifdef M_XENIX # define BSD 0 #endif #ifdef vms # define BSD 0 # ifndef __STDC__ # define __STDC__ 1 # endif #endif #ifdef __TURBOC__ # define MSDOS 1 #endif #ifdef MSDOS # define BSD 0 #endif #ifdef FILE /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */ # ifndef BSD /* (a convenient, but horrible kludge!) */ # define BSD 1 # endif #endif #ifdef BSD # if !BSD # undef BSD # endif #endif #if (defined(__STDC__) && !defined(M_XENIX)) || defined(__TURBOC__) # include # include # define HAS_STDLIB # if defined(vms) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #else # ifndef BSD # ifndef __TURBOC__ # include # endif # endif # ifdef hpux # ifdef _INCLUDE__STDC__ # include # include # define HAS_STDLIB # endif # endif # include # if !defined(MSDOS) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #endif #if defined(NON_ANSI_CAT) && !defined(ANSI_CAT) # ifdef NON_ANSI_CAT_ALTERNATE # define __CAT__(a,b)a/**/b # else # define __ID__(a)a # define __CAT__(a,b)__ID__(a)b # endif #else # define __CAT__(a,b)a##b #endif #ifdef BSD # include # define strchr(s,c) index(s,c) # define strrchr(s,c) rindex(s,c) #else # include #endif #include #include #include #include #ifndef NO_LACK #ifdef vms #define LACK_LABS #define LACK_MEMMOVE #define LACK_MEMCPY #else #define LACK_LABS /* Undefine these if your library has these */ #define LACK_MEMMOVE #endif #endif typedef struct __p2c_jmp_buf { struct __p2c_jmp_buf *next; jmp_buf jbuf; } __p2c_jmp_buf; /* Warning: The following will not work if setjmp is used simultaneously. This also violates the ANSI restriction about using vars after longjmp, but a typical implementation of longjmp will get it right anyway. */ #ifndef FAKE_TRY # define TRY(x) do { __p2c_jmp_buf __try_jb; \ __try_jb.next = __top_jb; \ if (!setjmp((__top_jb = &__try_jb)->jbuf)) { # define RECOVER(x) __top_jb = __try_jb.next; } else { # define RECOVER2(x,L) __top_jb = __try_jb.next; } else { \ if (0) { L: __top_jb = __try_jb.next; } # define ENDTRY(x) } } while (0) #else # define TRY(x) if (1) { # define RECOVER(x) } else do { # define RECOVER2(x,L) } else do { L: ; # define ENDTRY(x) } while (0) #endif #ifdef M_XENIX /* avoid compiler bug */ # define SHORT_MAX (32767) # define SHORT_MIN (-32768) #endif /* The following definitions work only on twos-complement machines */ #ifndef SHORT_MAX # define SHORT_MAX ((short)(((unsigned short) -1) >> 1)) # define SHORT_MIN (~SHORT_MAX) #endif #ifndef INT_MAX # define INT_MAX ((int)(((unsigned int) -1) >> 1)) # define INT_MIN (~INT_MAX) #endif #ifndef LONG_MAX # define LONG_MAX ((long)(((unsigned long) -1) >> 1)) # define LONG_MIN (~LONG_MAX) #endif #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 #endif #ifndef EXIT_SUCCESS # ifdef vms # define EXIT_SUCCESS 1 # define EXIT_FAILURE (02000000000L) # else # define EXIT_SUCCESS 0 # define EXIT_FAILURE 1 # endif #endif #define SETBITS 32 #if defined(__STDC__) || defined(__TURBOC__) # if !defined(vms) && !defined(M_LINT) # define Signed signed # else # define Signed # endif # define Void void /* Void f() = procedure */ # ifndef Const # define Const const # endif # ifndef Volatile # define Volatile volatile # endif # ifdef M_LINT # define PP(x) () # define PV() () typedef char *Anyptr; # else # define PP(x) x /* function prototype */ # define PV() (void) /* null function prototype */ typedef void *Anyptr; # endif #else # define Signed # define Void void # ifndef Const # define Const # endif # ifndef Volatile # define Volatile # endif # define PP(x) () # define PV() () typedef char *Anyptr; #endif #ifdef __GNUC__ # define Inline inline #else # define Inline #endif #define Register register /* Register variables */ #define Char char /* Characters (not bytes) */ #ifndef Static # define Static static /* Private global funcs and vars */ #endif #ifndef Local # define Local static /* Nested functions */ #endif typedef Signed char schar; typedef unsigned char uchar; typedef unsigned char boolean; #ifndef NO_DECLARE_ALFA typedef Char alfa[10]; #endif #ifndef true # define true 1 # define false 0 #endif #ifndef TRUE # define TRUE 1 # define FALSE 0 #endif typedef struct { Anyptr proc, link; } _PROCEDURE; #ifndef _FNSIZE # define _FNSIZE 120 #endif extern Void PASCAL_MAIN PP( (int, Char **) ); extern Char **P_argv; extern int P_argc; extern short P_escapecode; extern int P_ioresult; extern __p2c_jmp_buf *__top_jb; #ifdef P2C_H_PROTO /* if you have Ansi C but non-prototyped header files */ extern Char *strcat PP( (Char *, Const Char *) ); extern Char *strchr PP( (Const Char *, int) ); extern int strcmp PP( (Const Char *, Const Char *) ); extern Char *strcpy PP( (Char *, Const Char *) ); extern size_t strlen PP( (Const Char *) ); extern Char *strncat PP( (Char *, Const Char *, size_t) ); extern int strncmp PP( (Const Char *, Const Char *, size_t) ); extern Char *strncpy PP( (Char *, Const Char *, size_t) ); extern Char *strrchr PP( (Const Char *, int) ); extern int atoi PP( (Const Char *) ); extern double atof PP( (Const Char *) ); extern long atol PP( (Const Char *) ); extern double strtod PP( (Const Char *, Char **) ); extern long strtol PP( (Const Char *, Char **, int) ); #endif /*P2C_H_PROTO*/ #ifndef HAS_STDLIB #ifndef NO_DECLARE_MALLOC extern Anyptr malloc PP( (size_t) ); extern Void free PP( (Anyptr) ); #endif #endif extern int _OutMem PV(); extern int _CaseCheck PV(); extern int _NilCheck PV(); extern int _Escape PP( (int) ); extern int _EscIO PP( (int) ); extern int _EscIO2 PP( (int, Char *) ); extern long ipow PP( (long, long) ); extern long P_imax PP( (long, long) ); extern long P_imin PP( (long, long) ); extern double P_rmax PP( (double, double) ); extern double P_rmin PP( (double, double) ); extern Char *strsub PP( (Char *, Char *, int, int) ); extern Char *strltrim PP( (Char *) ); extern Char *strrtrim PP( (Char *) ); extern Char *strrpt PP( (Char *, Char *, int) ); extern Char *strpad PP( (Char *, Char *, int, int) ); extern int strpos2 PP( (Char *, Char *, int) ); extern long memavail PV(); extern int P_peek PP( (FILE *) ); extern int P_eof PP( (FILE *) ); extern int P_eoln PP( (FILE *) ); extern Void P_readpaoc PP( (FILE *, Char *, int) ); extern Void P_readlnpaoc PP( (FILE *, Char *, int) ); extern long P_maxpos PP( (FILE *) ); extern Char *P_trimname PP( (Char *, int) ); extern long *P_setunion PP( (long *, long *, long *) ); extern long *P_setint PP( (long *, long *, long *) ); extern long *P_setdiff PP( (long *, long *, long *) ); extern long *P_setxor PP( (long *, long *, long *) ); extern int P_inset PP( (unsigned, long *) ); extern int P_setequal PP( (long *, long *) ); extern int P_subset PP( (long *, long *) ); extern long *P_addset PP( (long *, unsigned) ); extern long *P_addsetr PP( (long *, unsigned, unsigned) ); extern long *P_remset PP( (long *, unsigned) ); extern long *P_expset PP( (long *, long) ); extern long P_packset PP( (long *) ); extern FILE *_skipspaces PP( (FILE *) ); extern FILE *_skipnlspaces PP( (FILE *) ); /* I/O error handling */ #define _CHKIO(cond,ior,val,def) ((cond) ? P_ioresult=0,(val) \ : P_ioresult=(ior),(def)) #define _SETIO(cond,ior) (P_ioresult = (cond) ? 0 : (ior)) /* Following defines are suitable for the HP Pascal operating system */ #define FileNotFound 10 #define FileNotOpen 13 #define FileWriteError 38 #define BadInputFormat 14 #define EndOfFile 30 #define FILENOTFOUND 10 #define FILENOTOPEN 13 #define FILEWRITEERROR 38 #define BADINPUTFORMAT 14 #define ENDOFFILE 30 /* Creating temporary files */ #if (defined(BSD) || defined(NO_TMPFILE)) && !defined(HAVE_TMPFILE) # define tmpfile() (fopen(tmpnam(NULL), "w+")) #endif /* File buffers */ #define FILEBUF(f,sc,type) sc int __CAT__(f,_BFLAGS); \ sc type __CAT__(f,_BUFFER) #define FILEBUFNC(f,type) int __CAT__(f,_BFLAGS); \ type __CAT__(f,_BUFFER) #define RESETBUF(f,type) (__CAT__(f,_BFLAGS) = 1) #define SETUPBUF(f,type) (__CAT__(f,_BFLAGS) = 0) #define GETFBUF(f,type) (*((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(&__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ &__CAT__(f,_BUFFER))) #define AGETFBUF(f,type) ((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ __CAT__(f,_BUFFER)) #define PUTFBUF(f,type,v) (GETFBUF(f,type) = (v)) #define CPUTFBUF(f,v) (PUTFBUF(f,char,v)) #define GET(f,type) (__CAT__(f,_BFLAGS) == 1 ? \ fread(&__CAT__(f,_BUFFER),sizeof(type),1,(f)) : \ (__CAT__(f,_BFLAGS) = 1)) #define PUT(f,type) (fwrite(&__CAT__(f,_BUFFER),sizeof(type),1,(f)), \ (__CAT__(f,_BFLAGS) = 0)) #define CPUT(f) (PUT(f,char)) #define BUFEOF(f) (__CAT__(f,_BFLAGS) != 2 && P_eof(f)) #define BUFFPOS(f) (ftell(f) - (__CAT__(f,_BFLAGS) == 2)) typedef struct { FILE *f; int f_BFLAGS; /* FILEBUFNC(f,Char); */ Char f_BUFFER; Char name[_FNSIZE]; } _TEXT; /* Memory allocation */ #ifdef __GCC__ # define Malloc(n) (malloc(n) ?: (Anyptr)_OutMem()) #else extern Anyptr __MallocTemp__; # define Malloc(n) ((__MallocTemp__ = malloc(n)) ? __MallocTemp__ : (Anyptr)_OutMem()) #endif #define FreeR(p) (free((Anyptr)(p))) /* used if arg is an rvalue */ #define Free(p) (free((Anyptr)(p)), (p)=NULL) /* sign extension */ #define SEXT(x,n) ((x) | -(((x) & (1L<<((n)-1))) << 1)) /* packed arrays */ /* BEWARE: these are untested! */ #define P_getbits_UB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] >> \ (((~(i))&((1<<(L)-(n))-1)) << (n)) & \ (1<<(1<<(n)))-1)) #define P_getbits_SB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] << \ (16 - ((((~(i))&((1<<(L)-(n))-1))+1) <<\ (n)) >> (16-(1<<(n)))))) #define P_putbits_UB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ (x) << (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_putbits_SB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ ((x) & (1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_clrbits_B(a,i,n,L) ((a)[(i)>>(L)-(n)] &= \ ~( ((1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) ) /* small packed arrays */ #define P_getbits_US(v,i,n) ((int)((v) >> ((i)<<(n)) & (1<<(1<<(n)))-1)) #define P_getbits_SS(v,i,n) ((int)((long)(v) << (SETBITS - (((i)+1) << (n))) >> (SETBITS-(1<<(n))))) #define P_putbits_US(v,i,x,n) ((v) |= (x) << ((i) << (n))) #define P_putbits_SS(v,i,x,n) ((v) |= ((x) & (1<<(1<<(n)))-1) << ((i)<<(n))) #define P_clrbits_S(v,i,n) ((v) &= ~( ((1<<(1<<(n)))-1) << ((i)<<(n)) )) #define P_max(a,b) ((a) > (b) ? (a) : (b)) #define P_min(a,b) ((a) < (b) ? (a) : (b)) /* Fix ANSI-isms */ #ifdef LACK_LABS # ifndef labs # define labs my_labs extern long my_labs PP( (long) ); # endif #endif /* Fix toupper/tolower on Suns and other stupid BSD systems */ #ifdef toupper # undef toupper # undef tolower # define toupper(c) my_toupper(c) # define tolower(c) my_tolower(c) #endif #ifndef _toupper # if 'A' == 65 && 'a' == 97 # define _toupper(c) ((c)-'a'+'A') # define _tolower(c) ((c)-'A'+'a') # else # ifdef toupper # undef toupper /* hope these are shadowing real functions, */ # undef tolower /* because my_toupper calls _toupper! */ # endif # define _toupper(c) toupper(c) # define _tolower(c) tolower(c) # endif #endif #endif /* P2C_H */ /* End. */ /* Run-time library for use with "p2c", the Pascal to C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version --VERSION--. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #ifndef NO_TIME # include #endif #define Isspace(c) isspace(c) /* or "((c) == ' ')" if preferred */ int P_argc; char **P_argv; short P_escapecode; int P_ioresult; long EXCP_LINE; /* Used by Pascal workstation system */ Anyptr __MallocTemp__; __p2c_jmp_buf *__top_jb; void PASCAL_MAIN(argc, argv) int argc; char **argv; { P_argc = argc; P_argv = argv; __top_jb = NULL; #ifdef LOCAL_INIT LOCAL_INIT(); #endif } /* In case your system lacks these... */ long my_labs(x) long x; { return((x > 0) ? x : -x); } int my_toupper(c) int c; { if (islower(c)) return _toupper(c); else return c; } int my_tolower(c) int c; { if (isupper(c)) return _tolower(c); else return c; } long ipow(a, b) long a, b; { long v; if (a == 0 || a == 1) return a; if (a == -1) return (b & 1) ? -1 : 1; if (b < 0) return 0; if (a == 2) return 1L << b; v = (b & 1) ? a : 1; while ((b >>= 1) > 0) { a *= a; if (b & 1) v *= a; } return v; } long P_imax(a, b) long a, b; { if (a > b) return a; else return b; } long P_imin(a, b) long a, b; { if (a < b) return a; else return b; } double P_rmax(a, b) double a, b; { if (a > b) return a; else return b; } double P_rmin(a, b) double a, b; { if (a < b) return a; else return b; } /* Common string functions: */ /* Store in "ret" the substring of length "len" starting from "pos" (1-based). Store a shorter or null string if out-of-range. Return "ret". */ char *strsub(ret, s, pos, len) register char *ret, *s; register int pos, len; { register char *s2; if (--pos < 0 || len <= 0) { *ret = 0; return ret; } while (pos > 0) { if (!*s++) { *ret = 0; return ret; } pos--; } s2 = ret; while (--len >= 0) { if (!(*s2++ = *s++)) return ret; } *s2 = 0; return ret; } /* Return the index of the first occurrence of "pat" as a substring of "s", starting at index "pos" (1-based). Result is 1-based, 0 if not found. */ int strpos2(s, pat, pos) char *s; register char *pat; register int pos; { register char *cp, ch; register int slen; if (--pos < 0) return 0; slen = (int)strlen(s) - pos; cp = s + pos; if (!(ch = *pat++)) return 0; pos = (int)strlen(pat); slen -= pos; while (--slen >= 0) { if (*cp++ == ch && !strncmp(cp, pat, (size_t)pos)) return cp - s; } return 0; } /* Case-insensitive version of strcmp. */ int strcicmp(s1, s2) register char *s1, *s2; { register unsigned char c1, c2; while (*s1) { if (*s1++ != *s2++) { if (!s2[-1]) return 1; c1 = (unsigned char)toupper(s1[-1]); c2 = (unsigned char)toupper(s2[-1]); if (c1 != c2) return c1 - c2; } } if (*s2) return -1; return 0; } /* HP and Turbo Pascal string functions: */ /* Trim blanks at left end of string. */ char *strltrim(s) register char *s; { while (Isspace(*s++)) ; return s - 1; } /* Trim blanks at right end of string. */ char *strrtrim(s) register char *s; { register char *s2 = s; if (!*s) return s; while (*++s2) ; while (s2 > s && Isspace(*--s2)) *s2 = 0; return s; } /* Store in "ret" "num" copies of string "s". Return "ret". */ char *strrpt(ret, s, num) char *ret; register char *s; register int num; { register char *s2 = ret; register char *s1; while (--num >= 0) { s1 = s; while ((*s2++ = *s1++)) ; s2--; } return ret; } /* Store in "ret" string "s" with enough pad chars added to reach "size". */ char *strpad(ret, s, padchar, num) char *ret; register char *s; register int padchar, num; { register char *d = ret; if (s == d) { while (*d++) ; } else { while ((*d++ = *s++)) ; } num -= (--d - ret); while (--num >= 0) *d++ = padchar; *d = 0; return ret; } /* Copy the substring of length "len" from index "spos" of "s" (1-based) to index "dpos" of "d", lengthening "d" if necessary. Length and indices must be in-range. */ void strmove(len, s, spos, d, dpos) register char *s, *d; register int len, spos, dpos; { s += spos - 1; d += dpos - 1; while (*d && --len >= 0) *d++ = *s++; if (len > 0) { while (--len >= 0) *d++ = *s++; *d = 0; } } /* Delete the substring of length "len" at index "pos" from "s". Delete less if out-of-range. */ void strdelete(s, pos, len) register char *s; register int pos, len; { register int slen; if (--pos < 0) return; slen = (int)strlen(s) - pos; if (slen <= 0) return; s += pos; if (slen <= len) { *s = 0; return; } while ((*s = s[len])) s++; } /* Insert string "src" at index "pos" of "dst". */ void strinsert(src, dst, pos) register char *src, *dst; register int pos; { register int slen, dlen; if (--pos < 0) return; dlen = (int)strlen(dst); dst += dlen; dlen -= pos; if (dlen <= 0) { strcpy(dst, src); return; } slen = (int)strlen(src); do { dst[slen] = *dst; --dst; } while (--dlen >= 0); dst++; while (--slen >= 0) *dst++ = *src++; } /* File functions */ /* Peek at next character of input stream; return EOF at end-of-file. */ int P_peek(f) FILE *f; { int ch; ch = getc(f); if (ch == EOF) return EOF; ungetc(ch, f); return (ch == '\n') ? ' ' : ch; } /* Check if at end of file, using Pascal "eof" semantics. End-of-file for stdin is broken; remove the special case for it to be broken in a different way. */ int P_eof(f) FILE *f; { register int ch; if (feof(f)) return 1; #ifdef HAVE_ISATTY if (isatty(fileno(f))) #else if (f == stdin) #endif return 0; /* not safe to look-ahead on the keyboard! */ ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return 0; } /* Check if at end of line (or end of entire file). */ int P_eoln(f) FILE *f; { register int ch; ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return (ch == '\n'); } /* Skip whitespace (including newlines) in a file. */ FILE *_skipnlspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t' || ch == '\n'); if (ch != EOF) ungetc(ch, f); return f; } /* Skip whitespace (not including newlines) in a file. */ FILE *_skipspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t'); if (ch != EOF) ungetc(ch, f); return f; } /* Read a packed array of characters from a file. */ Void P_readpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { if (len <= 0) return; ch = getc(f); if (ch == EOF || ch == '\n') break; *s++ = ch; --len; } while (--len >= 0) *s++ = ' '; if (ch != EOF) ungetc(ch, f); } Void P_readlnpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { ch = getc(f); if (ch == EOF || ch == '\n') break; if (len > 0) { *s++ = ch; --len; } } while (--len >= 0) *s++ = ' '; } /* Compute maximum legal "seek" index in file (0-based). */ long P_maxpos(f) FILE *f; { long savepos = ftell(f); long val; if (fseek(f, 0L, SEEK_END)) return -1; val = ftell(f); if (fseek(f, savepos, SEEK_SET)) return -1; return val; } /* Use packed array of char for a file name. */ Char *P_trimname(fn, len) register Char *fn; register int len; { static Char fnbuf[256]; register Char *cp = fnbuf; while (--len >= 0 && *fn && !isspace(*fn)) *cp++ = *fn++; *cp = 0; return fnbuf; } /* Pascal's "memavail" doesn't make much sense in Unix with virtual memory. We fix memory size as 10Meg as a reasonable compromise. */ long memavail() { return 10000000; /* worry about this later! */ } long maxavail() { return memavail(); } /* Sets are stored as an array of longs. S[0] is the size of the set; S[N] is the N'th 32-bit chunk of the set. S[0] equals the maximum I such that S[I] is nonzero. S[0] is zero for an empty set. Within each long, bits are packed from lsb to msb. The first bit of the set is the element with ordinal value 0. (Thus, for a "set of 5..99", the lowest five bits of the first long are unused and always zero.) */ /* (Sets with 32 or fewer elements are normally stored as plain longs.) */ long *P_setunion(d, s1, s2) /* d := s1 + s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ | *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; *dbase = d - dbase - 1; return dbase; } long *P_setint(d, s1, s2) /* d := s1 * s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setdiff(d, s1, s2) /* d := s1 - s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & ~*s2++; if (sz1 >= 0) { while (sz1-- >= 0) *d++ = *s1++; } while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setxor(d, s1, s2) /* d := s1 / s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ ^ *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } int P_inset(val, s) /* val IN s */ register unsigned val; register long *s; { register int bit; bit = (int) (val % SETBITS); val /= SETBITS; if ((long)val < *s++ && ((1L<(unsigned) size) { s += size; while (val > (unsigned)size) *++s = 0, size++; *sbase = size; } else s += val; *s |= 1L< (int)v2) return sbase; b1 = (int) (v1 % SETBITS); v1 /= SETBITS; b2 = (int) (v2 % SETBITS); v2 /= SETBITS; size = *s; v1++; if (++v2 > (unsigned)size) { while (v2 > (unsigned)size) s[++size] = 0; s[v2] = 0; *s = (long)v2; } s += v1; if (v1 == v2) { *s |= (~((-2L)<<(b2-b1))) << b1; } else { *s++ |= (-1L) << b1; while (++v1 < v2) *s++ = -1; *s |= ~((-2L) << b2); } return sbase; } long *P_remset(s, val) /* s := s - [val] */ register long *s; register unsigned val; { register int bit; bit = (int) (val % SETBITS); val /= SETBITS; if ((long)++val <= *s) { if (!(s[val] &= ~(1L<= 0) { if (*s1++ != *s2++) return 0; } return 1; } int P_subset(s1, s2) /* s1 <= s2 */ register long *s1, *s2; { register int sz1 = *s1++, sz2 = *s2++; if (sz1 > sz2) return 0; while (--sz1 >= 0) { if (*s1++ & ~*s2++) return 0; } return 1; } /* s is a "smallset", i.e., a 32-bit or less set stored directly in a long. */ long *P_expset(d, s) /* d := s */ register long *d; register long s; { if (s) { d[1] = s; *d = 1; } else *d = 0; return d; } long P_packset(s) /* convert s to a small-set */ register long *s; { if (*s++) return *s; else return 0; } int _OutMem() { return _Escape(-2); } int _CaseCheck() { return _Escape(-9); } int _NilCheck() { return _Escape(-3); } /* The following is suitable for the HP Pascal operating system. It might want to be revised when emulating another system. */ char *_ShowEscape(buf, code, ior, prefix) char *buf, *prefix; int code, ior; { char *bufp; if (prefix && *prefix) { strcpy(buf, prefix); strcat(buf, ": "); bufp = buf + strlen(buf); } else { bufp = buf; } if (code == -10) { snprintf(bufp,80, "Pascal system I/O error %d", ior); switch (ior) { case 3: strcat(buf, " (illegal I/O request)"); break; case 7: strcat(buf, " (bad file name)"); break; case FileNotFound: /*10*/ strcat(buf, " (file not found)"); break; case FileNotOpen: /*13*/ strcat(buf, " (file not open)"); break; case BadInputFormat: /*14*/ strcat(buf, " (bad input format)"); break; case 24: strcat(buf, " (not open for reading)"); break; case 25: strcat(buf, " (not open for writing)"); break; case 26: strcat(buf, " (not open for direct access)"); break; case 28: strcat(buf, " (string subscript out of range)"); break; case EndOfFile: /*30*/ strcat(buf, " (end-of-file)"); break; case FileWriteError: /*38*/ strcat(buf, " (file write error)"); break; } } else { snprintf(bufp,80, "Pascal system error %d", code); switch (code) { case -2: strcat(buf, " (out of memory)"); break; case -3: strcat(buf, " (reference to NIL pointer)"); break; case -4: strcat(buf, " (integer overflow)"); break; case -5: strcat(buf, " (divide by zero)"); break; case -6: strcat(buf, " (real math overflow)"); break; case -8: strcat(buf, " (value range error)"); break; case -9: strcat(buf, " (CASE value range error)"); break; case -12: strcat(buf, " (bus error)"); break; case -20: strcat(buf, " (stopped by user)"); break; } } return buf; } int _Escape(code) int code; { char buf[100]; P_escapecode = code; if (__top_jb) { __p2c_jmp_buf *jb = __top_jb; __top_jb = jb->next; longjmp(jb->jbuf, 1); } if (code == 0) exit(EXIT_SUCCESS); if (code == -1) exit(EXIT_FAILURE); fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } int _EscIO(code) int code; { P_ioresult = code; return _Escape(-10); } int _EscIO2(code, name) int code; char *name; { P_ioresult = code; if (!__top_jb && name && *name) { char buf[100]; fprintf(stderr, "%s: %s\n", name, _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } return _Escape(-10); } /* End. */ typedef struct TPoint { long X, Y, C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, Ag, As,Au, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, Hf, Hg, In, Ir, Li, Lu, Mg, Mn, Mo, Na, Nb, Ni, Os, K, Pb, Pd, Pt, Rb, Re, Rh, Ru, Sb, Sc, Se, Sn, Sr, Ta, Te, Ti, Tl, V, W, Ytt, Zn, Zr, RecCount; struct TPoint *Last; } TPoint; typedef struct TBond { long X1, Y1, X2, Y2, RecCount; struct TBond *Last; } TBond; Static long C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, Ag, As, Au, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, Hf, Hg, In, Ir, Li, Lu, Mg, Mn, Mo, Na, Nb, Ni, Os, K, Pb, Pd, Pt, Rb, Re, Rh, Ru, Sb, Sc, Se, Sn, Sr, Ta, Te, Ti, Tl, V, W, Ytt, Zn, Zr, X1, X2, Y1, Y2, T, D; Static FILE *IFile; Static TPoint *Point, *Last, *Current; Static TBond *Bond, *LastB, *CurrentB; Static Char sss[256], A[256], subs[256], Alert[256]; Static Char sssb[7]; Static double M, Me; Static Char separator; Static long Count, code, atoms, rep, range, bonds; Static boolean Abandon, debug, verbose, fa, nobonds; Static long Sensi = 5; /*bonds and labels joint precision sensitivity*/ Static Char IFile_NAME[_FNSIZE]; Static Void doBonds() { do { if (!fgets(sss,256,IFile)) return; sscanf(sss, "%ld%ld%ld%ld%ld%ld%*[^\n]", &X1, &Y1, &X2, &Y2, &T, &D); /*getc(IFile);*/ bonds--; if (debug) printf("%ld; %ld; %ld; %ld; %ld; %ld\n", X1, Y1, X2, Y2, T, D); if (D == 1 || T == 8){ if (debug) printf("skipped\n"); continue; } if (debug) printf("parsed\n"); if (T == 11) range = ((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2)) * 4; LastB = Bond; Bond = (TBond *)malloc(sizeof(TBond)); if (Bond == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Bond->X1 = X1; Bond->X2 = X2; Bond->Y1 = Y1; Bond->Y2 = Y2; Bond->Last = LastB; CurrentB = Bond; Bond = Bond->Last; while (Bond->Last != NULL) { if ((labs(Bond->X1 - X1) < Sensi && labs(Bond->Y1 - Y1) < Sensi && labs(Bond->X2 - X2) < Sensi && labs(Bond->Y2 - Y2) < Sensi) || (labs(Bond->X2 - X1) < Sensi && labs(Bond->Y2 - Y1) < Sensi && labs(Bond->X1 - X2) < Sensi && labs(Bond->Y1 - Y2) < Sensi)) { if (debug) printf(" ! Bond overlap\n"); strcat(Alert, "!"); } Bond = Bond->Last; } Bond = CurrentB; Abandon = false; Current = Point; while (Point->Last != NULL) { if (T == 11) { Abandon = true; if ((Point->X - X1) * (Point->X - X1) + (Point->Y - Y1) * (Point->Y - Y1) < range) { if (Point->H > 0) Point->H--; if (debug) printf("Ring --> stripped one H from %ld %ld\n", Point->X, Point->Y); } } else { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X1, Y1); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X1; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y1; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } if (T != 11) { Abandon = false; Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X2) < Sensi && labs(Point->Y - Y2) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X2, Y2); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X2; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y2; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } } } while (bonds != 0); } Static Void doLabels() { long mul, gmul, gmpos, ggmul, ggmpos; boolean stripped; Char STR2[256]; long FORLIM; Char *TEMP; if (debug) printf("---- and now parse the labels ---------\n"); if (verbose) printf("HeteroAtoms: %ld\n", atoms); FORLIM = atoms; for (rep = 1; rep <= FORLIM; rep++) { if (fscanf(IFile, "%ld%ld%c", &X1, &Y1, &separator)<2) return; if (!fgets(sss, 256, IFile))return; TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; snprintf(A,256, "%.*s", strpos2(sss, "\t", 1) - 1, sss); if (debug) printf("Atom %s X=%ld Y=%ld sss: %s\n", A, X1, Y1, sss); if (nobonds) { /*initialize the Point structure if no bonds, only labels, defined*/ Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X1; Point->Y = Y1; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; Point->Last = Last; } Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" [%ld]\n", Point->RecCount); Point->C = 0; /*we substitute -CH_x(-) by -R(-)*/ Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; mul = 1; gmul = 1; ggmul = 1; while (*A != '\0') { stripped = false; if ((int)strlen(A) >= 5) { snprintf(subs,256, "%.5s", A); if ((int)strlen(A) > 6) { if (A[5] == '_') { if (A[6]!= '{') { snprintf(STR2,256, "%c", A[6]); if (A[7]=='_') snprintf(STR2,256, "%c%c", A[6],A[8]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=7; while(A[mul]!='}'){STR2[mul-7]=A[mul]; mul++ ; } STR2[mul-6]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "TBDMS")) { /*Tert-butyldimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 15; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (!strcmp(subs, "TBDPS")) { /*Tert-butyldiphenylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 16; Point->H += mul * 19; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (A[0] == '[') { ggmpos = strpos2(A, "]", 1); if (ggmpos != 0) { if (A[ggmpos] == '_') { if (A[ggmpos+1]!= '{') { snprintf(STR2,256, "%c", A[ggmpos+1]); if (A[ggmpos+2]=='_') snprintf(STR2,256, "%c%c", A[ggmpos+1],A[ggmpos+3]); code = (sscanf(STR2, "%ld", &ggmul) == 0); }else{ ggmul=ggmpos+2; while(A[ggmul]!='}'){STR2[ggmul-ggmpos-2]=A[ggmul]; ggmul++ ; } STR2[ggmul-ggmpos-1]='\0'; code = (sscanf(STR2, "%ld", &ggmul) == 0); } } else ggmul = 1; } } if (A[0] == '(') { gmpos = strpos2(A, ")", 1); if (gmpos != 0) { if (A[gmpos] == '_') { if (A[gmpos+1]!= '{') { snprintf(STR2,256, "%c", A[gmpos+1]); if (A[gmpos+2]=='_') snprintf(STR2,256, "%c%c", A[gmpos+1],A[gmpos+3]); code = (sscanf(STR2, "%ld", &gmul) == 0); }else{ gmul=gmpos+2; while(A[gmul]!='}'){STR2[gmul-gmpos-2]=A[gmul]; gmul++ ; } STR2[gmul-gmpos-1]='\0'; code = (sscanf(STR2, "%ld", &gmul) == 0); } } else gmul = 1; } } } if ((int)strlen(A) >= 4 && !stripped) { snprintf(subs,256, "%.4s", A); if ((int)strlen(A) > 5) { if (A[4] == '_') { if (A[5]!= '{') { snprintf(STR2,256, "%c", A[5]); if (A[6]=='_') snprintf(STR2,256, "%c%c", A[5],A[7]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=6; while(A[mul]!='}'){STR2[mul-6]=A[mul]; mul++ ; } STR2[mul-5]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "DBAM")) { /*dibutylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 9; Point->H += mul * 19; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMAM")) { /*dimethylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMTr")) { /*dimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 21; Point->H += mul * 19; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "MMTr")) { /*monomethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 20; Point->H += mul * 16; Point->O += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "TMTr")) { /*trimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 22; Point->H += mul * 22; Point->O += mul * 3; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } } if ((int)strlen(A) >= 3 && !stripped) { snprintf(subs,256, "%.3s", A); if ((int)strlen(A) > 4) { if (A[3] == '_') { if (A[4]!= '{') { snprintf(STR2,256, "%c", A[4]); if (A[5]=='_') snprintf(STR2,256, "%c%c", A[4],A[6]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=5; while(A[mul]!='}'){STR2[mul-5]=A[mul]; mul++ ; } STR2[mul-4]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ade")) { /*Adeninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "BOC")) { /*Butyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 9; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Cyt")) { /*Cytosinyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 4; Point->N += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Gua")) { /*Guaninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iBu")) { /*iso-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iPr")) { /*2-Propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOC")) { /*Methoxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOM")) { /*Methoxymethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "tBu")) { /*t-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Thy")) { /*Thyminyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 5; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "TMS")) { /*Trimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 9; Point->Si += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Tol")) { /*tolyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Ura")) { /*Uracilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 3; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } } if ((int)strlen(A) >= 2 && !stripped) { snprintf(subs,256, "%.2s", A); if ((int)strlen(A) > 3) { if (A[2] == '_') { if (A[3]!= '{') { snprintf(STR2,256, "%c", A[3]); if (A[4]=='_') snprintf(STR2,256, "%c%c", A[3],A[5]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=4; while(A[mul]!='}'){STR2[mul-4]=A[mul]; mul++ ; } STR2[mul-3]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ac")) { /*acetyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Al")) { /*alumin(i)um*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Al += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ag")) { /*silver*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ag += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "As")) { /*arsenic*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->As += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Au")) { /*gold*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Au += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ba")) { /*barium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ba += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Be")) { /*beryllium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Be += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bi")) { /*bismuth*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Bi += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bn")) { /*benzyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Br")) { /*bromine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Br += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bu")) { /*butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bz")) { /*benzoyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "CE")) { /*cyanoethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 4; Point->N += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cl")) { /*chlorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ca")) { /*calcium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ca += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cd")) { /*cadmium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cd += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Co")) { /*cobalt*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Co += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cr")) { /*chromium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cs")) { /*cesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cs += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cu")) { /*copper*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cu += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Et")) { /*ethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Fe")) { /*iron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Fe += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ga")) { /*gallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ga += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ge")) { /*germanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ge += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Hf")) { /*hafnium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Hf += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Hg")) { /*mercury*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Hg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "In")) { /*indium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->In += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ir")) { /*iridium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ir += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Li")) { /*lithium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Li += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Lu")) { /*lutetium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Lu += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Me")) { /*methyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ms")) { /*methanesulfonyl, mesyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mg")) { /*magnesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mn")) { /*manganese*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mo")) { /*molybdenum*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mo += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Na")) { /*sodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Na += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Nb")) { /*niobium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Nb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ni")) { /*nickel*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ni += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Os")) { /*osmium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Os += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pb")) { /*lead*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pd")) { /*palladium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pd += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ph")|| !strcmp(subs,"@F")) { /*phenyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pr")) { /*propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pt")) { /*platinum*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pt += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Rb")) { /*rubidium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Rb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Re")) { /*rhenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Re += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Rh")) { /*rhodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Rh += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ru")) { /*ruthenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ru += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sb")) { /*antimony*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sc")) { /*scandium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sc += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Se")) { /*selenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Se += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sn")) { /*tin*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sr")) { /*strontium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ta")) { /*tantal*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ta += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Te")) { /*tellurium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Te += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ti")) { /*titanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ti += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tf")) { /*trifluoromethanesulfonyl, triflyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->F += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tl")) { /*thallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Tl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tr")) { /*trityl, triphenylmethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 19; Point->H += mul * 15; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ts")) { /*toluenesulfonyl, tosyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Si")) { /*silicon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Si += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Zn")) { /*zinc*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Zn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Zr")) { /*zirconium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Zr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } } if ((int)strlen(A) < 1 || stripped) continue; snprintf(subs,256, "%.1s", A); if ((int)strlen(A) > 2) { if (A[1] == '_') { if (A[2]!= '{') { snprintf(STR2,256, "%c", A[2]); if (A[3]=='_') snprintf(STR2,256, "%c%c", A[2],A[4]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=3; while(A[mul]!='}'){STR2[mul-3]=A[mul]; mul++ ; } STR2[mul-2]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "B")) { /*boron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->B += mul; } if (!strcmp(subs, "C")) { /*carbon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; } if (!strcmp(subs, "F")) { /*fluorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->F += mul; } if (!strcmp(subs, "H")) { /*hydrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->H += mul; } if (!strcmp(subs, "I")) { /*iodine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->I += mul; } if (!strcmp(subs, "K")) { /*potassium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->K += mul; } if (!strcmp(subs, "N")) { /*nitrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->N += mul; } if (!strcmp(subs, "O")) { /*oxygen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->O += mul; } if (!strcmp(subs, "P")) { /*phosphorus*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->P += mul; } if (!strcmp(subs, "S")) { /*sulfur*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->S += mul; } if (!strcmp(subs, "V")) { /*vanadium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->V += mul; } if (!strcmp(subs, "W")) { /*tungsten*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->W += mul; } if (!strcmp(subs, "Y")) { /*yttrium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ytt += mul; } if (!strcmp(subs, "Z")) { /*"Z", Benzyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul * 2; } if (!strcmp(subs, ")")) /*reset gmul*/ gmul = 1; if (!strcmp(subs, "]")) { /*reset gmul,ggmul*/ gmul = 1; ggmul = 1; } if (true) strcpy(A, strsub(STR2, A, 2, (int)(strlen(A) - 1))); } } Point = Point->Last; } Point = Current; } } int main(argc, argv) int argc; Char *argv[]; { Char STR1[256], STR2[256]; Char *TEMP; boolean interactive=false; PASCAL_MAIN(argc, argv); IFile = NULL; if (P_argc == 1) { printf("enter \"cht -h\" for help\n"); _Escape(0); } C = 0; H = 0; N = 0; O = 0; P = 0; S = 0; Si = 0; B = 0; Br = 0; I = 0; Cl = 0; F = 0; Al = 0; Ag = 0; As = 0; Au = 0; Ba = 0; Be = 0; Bi = 0; Ca = 0; Cd = 0; Co = 0; Cr = 0; Cs = 0; Cu = 0; Fe = 0; Ga = 0; Ge = 0; Hf = 0; Hg = 0; In = 0; Ir = 0; Li = 0; Lu = 0; Mg = 0; Mn = 0; Mo = 0; Na = 0; Nb = 0; Ni = 0; Os = 0; K = 0; Pb = 0; Pd = 0; Pt = 0; Rb = 0; Re = 0; Rh = 0; Ru = 0; Sb = 0; Sc = 0; Se = 0; Sn = 0; Sr = 0; Ta = 0; Te = 0; Ti = 0; Tl = 0; V = 0; W = 0; Ytt = 0; Zn = 0; Zr = 0; verbose = false; debug = false; fa = false; /*no file assigned*/ Count = 0; *Alert = '\0'; for (rep = 1; rep < P_argc; rep++) { if (!strcmp(strcpy(STR2, P_argv[rep]), "-v") || !strcmp(strcpy(STR1, P_argv[rep]), "--verbose")) verbose = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-d") || !strcmp(strcpy(STR1, P_argv[rep]), "--debug")) debug = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-i") || !strcmp(strcpy(STR1, P_argv[rep]), "--interpret")) interactive = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-h") || !strcmp(strcpy(STR1, P_argv[rep]), "--help")) { printf("The Chemtool drawings analyzer 1.7\n"); printf("*** Gizmo Head Software ***\n"); printf(" Radek Liboska (c) 2001\n\n"); printf("syntax: cht [-options] \n\n"); printf("Recognizes C,H,O,N,P,S,Si,B,Br,I,Cl,F,Al,Ag,As,Au,Ba,Be,Bi,Ca,Cd,Co,Cr,Cs,Cu,\nFe,Ga,Ge,Hf,Hg,In,Ir,Li,Lu,Mg,Mn,Mo,Na,Nb,Ni,Os,K,Pb,Pd,Pt,Rb,Re,Rh,Ru,Sb,Sc,Se,Sn,Sr,\nTa,Te,Ti,Tl,V,W,Y,Zn,Zr\n"); printf( " Ac,Ade,Bn,Bu,Bz,BOC,Cyt,CE,DBAM,DMAM,DMTr,Et,Gua,iBu,iPr,Me,Ms,MOC,\n"); printf( " MOM,MMTr,Ph,Pr,tBu,Tf,Thy,Tol,Tr,Ts,TBDMS,TBDPS,TMS,TMTr,Ura,Z\n"); printf("Can handle two levels of parentheses; e.g. P[OCH(CH_3)_2]_3\n\n"); printf("options:\n"); printf(" -h or --help : this help\n"); printf(" -v or --verbose : be verbose\n"); printf(" -d or --debug : be more verbose\n\n"); _Escape(0); } if (strcpy(STR2, P_argv[rep])[0] != '-') { strcpy(STR1, P_argv[rep]); strcpy(IFile_NAME, STR1); fa = true; } } if (!fa && !interactive) { printf("No file defined, enter \"cht -h\" for help\n"); _Escape(1); } if (!interactive){ if (IFile != NULL) IFile = freopen(IFile_NAME, "r", IFile); else IFile = fopen(IFile_NAME, "r"); if (IFile == NULL) _EscIO2(FileNotFound, IFile_NAME); }else { if (IFile)fclose(IFile); IFile=tmpfile(); fprintf(IFile,"Chemtool Version 1.0\ngeometry 100 100\n\bonds 0\natoms 1\n0 0 %s 0\n",IFile_NAME); rewind(IFile); } Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = 0; Point->Y = 0; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; Point->Last = NULL; Bond = (TBond *)malloc(sizeof(TBond)); if (Bond == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Bond->X1 = 0; Bond->Y1 = 0; Bond->X2 = 0; Bond->Y2 = 0; Bond->RecCount = Count; Bond->Last = NULL; if (!fgets(sss, 256, IFile))exit(2); TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; snprintf(sss,256, "%.18s", strcpy(STR1, sss)); if (strcmp(sss, "Chemtool Version 1")) { printf("Not a chemtool 1.x file, enter \"cht -h\" for help\n"); printf("file starts: %s\n",sss); _Escape(2); } if (fscanf(IFile, "%*[^\n]") == EOF) exit(2); getc(IFile); if (!fgets(sssb, 7, IFile))exit(2); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } if (fscanf(IFile, "%ld%*[^\n]", &bonds) == EOF) bonds = 0; getc(IFile); if (bonds == 0) nobonds = true; if (!strcmp(sssb, "bonds ")) { if (bonds > 0) doBonds(); } if (!fgets(sssb, 7, IFile))exit(2); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } if (fscanf(IFile, "%ld%*[^\n]", &atoms) == EOF) atoms = 0; getc(IFile); if (!strcmp(sssb, "atoms ")) { if (atoms > 0) doLabels(); } if (IFile != NULL) fclose(IFile); IFile = NULL; if (verbose) printf("---------------------- Summary -------------------------\n"); while (Point->Last != NULL) { if (verbose) printf( "RecCount: %ld X=%ld Y=%ld C%ld H%ld N%ld O%ld P%ld S%ld Si%ld B%ld\nBr%ld Cl%ld F%ld I%ld Al%ld Ag%ld As%ld Au%ld Ba%ld Be%ld Bi%ld Ca%ld Cd%ld Co%ld\nCr%ld Cs%ld Cu%ld Fe%ld Ga%ld Ge%ld Hf%ld Hg%ld In%ld Ir%ld Li%ld Lu%ld Mg%ld Mn%ld\n Mo%ld Na%ld Nb%ld Ni%ld Os%ld K%ld Pb%ld Pd%ld Pt%ld Rb%ld Re%ld Rh%ld Ru%ld Sb%ld\n Sc%ld Se%ld Sn%ld Sr%ld Ta%ld Te%ld Ti%ld Tl%ld V%ld W%ld Y%ld Zn%ld Zr%ld\n", Point->RecCount, Point->X, Point->Y, Point->C, Point->H, Point->N, Point->O, Point->P, Point->S, Point->Si, Point->B, Point->Br, Point->Cl, Point->F, Point->I, Point->Al, Point->Ag, Point->As, Point->Au, Point->Ba, Point->Be,Point->Bi, Point->Ca, Point->Cd, Point->Co, Point->Cr, Point->Cs,Point->Cu,Point->Fe,Point->Ga,Point->Ge,Point->Hf,Point->Hg, Point->In, Point->Ir, Point->Li,Point->Lu,Point->Mg, Point->Mn, Point->Mo, Point->Na, Point->Nb,Point->Ni, Point->Os,Point->K,Point->Pb,Point->Pd, Point->Pt, Point->Rb, Point->Re, Point->Rh, Point->Ru, Point->Sb,Point->Sc,Point->Se,Point->Sn,Point->Sr,Point->Ta, Point->Te,Point->Ti,Point->Tl,Point->V,Point->W,Point->Ytt,Point->Zn,Point->Zr); C += Point->C; H += Point->H; N += Point->N; O += Point->O; P += Point->P; S += Point->S; Si += Point->Si; B += Point->B; Br += Point->Br; Cl += Point->Cl; F += Point->F; I += Point->I; Al += Point->Al; Ag += Point->Ag; As += Point->As; Au += Point->Au; Ba += Point->Ba; Be += Point->Be; Bi += Point->Bi; Ca += Point->Ca; Cd += Point->Cd; Co += Point->Co; Cr += Point->Cr; Cs += Point->Cs; Cu += Point->Cu; Fe += Point->Fe; Ga += Point->Ga; Ge += Point->Ge; Hf += Point->Hf; Hg += Point->Hg; In += Point->In; Ir += Point->Ir; Li += Point->Li; Lu += Point->Lu; Mg += Point->Mg; Mn += Point->Mn; Mo += Point->Mo; Na += Point->Na; Nb += Point->Nb; Ni += Point->Ni; Os += Point->Os; K += Point->K; Pb += Point->Pb; Pd += Point->Pd; Pt += Point->Pt; Rb += Point->Rb; Re += Point->Re; Rh += Point->Rh; Ru += Point->Ru; Sb += Point->Sb; Sc += Point->Sc; Se += Point->Se; Sn += Point->Sn; Sr += Point->Sr; Ta += Point->Ta; Te += Point->Te; Ti += Point->Ti; Tl += Point->Tl; V += Point->V; W += Point->W; Ytt += Point->Ytt; Zn += Point->Zn; Zr += Point->Zr; Point = Point->Last; } if (H < 0) /*overlapped bonds*/ H = 0; M = (double)C * 12.011 + (double)H * 1.0079 + (double)N * 14.0067 + (double)O * 15.9994 + (double)P * 30.97376 + (double)S * 32.064 + (double)Si * 28.086 + (double)B * 10.81 + (double)Br * 79.904 + (double)Cl * 35.453 + (double)F * 18.9984 + (double)I * 126.9045 + (double)Mg * 24.305 + (double)Na * 22.98977 + (double)K * 39.098 + (double)Ca * 40.08 + (double)Cd * 112.41 + (double)Co * 58.933 + (double)Cr * 51.996 + (double)Cu * 63.546 + (double)Fe * 55.847 + (double)Li * 6.941 + (double)Mn * 54.938 + (double)Ni * 58.69 + (double)Al * 26.981539 + (double)Ba * 137.327 + (double)Cs * 132.90543 + (double)As * 74.92159 + (double)Be *9.012182 + (double)Ga * 69.723 + (double)Ge * 72.61 + (double)Sb * 121.75 + (double)Sc * 44.95591 + (double)Se * 78.96 + (double)Sn * 118.710 + (double)Sr * 87.62 + (double)Rb * 85.4678 + (double)Te * 127.60 + (double)Ti * 47.88 + (double)V * 50.9415 + (double)Zn * 65.39 + (double)In * 114.82 + (double)Bi * 208.98037 + (double)Pb *207.2 + (double)Tl * 204.3833 + (double)Zr *91.224 + (double)Nb * 92.906 + (double)Mo*95.94 + (double)Ru * 101.07 + (double)Rh *102.9055 + (double)Re * 186.207 + (double)Pd *106.42 + (double)Ag *107.868 + (double)Pt *195.078 + (double)Ir * 192.217 + (double)Hg * 200.59 + (double)Os *190.2 + (double)W * 183.84 + (double)Au * 196.966 + (double)Ta *180.948 + (double)Hf * 178.49 + (double)Ytt * 88.906 + (double)Lu *174.967; Me = (double)C * 12. + (double)H * 1.007825037 + (double)N * 14.003074008 + (double)O * 15.99491464 + (double)P * 30.9737634 + (double)S * 31.9720718 + (double)Si * 27.9769284 + (double)B * 11.0093053 + (double)Br * 78.9183361 + (double)Cl * 34.968852729 + (double)F * 18.99840325 + (double)I * 126.904477 + (double)Mg * 23.9850450 + (double)Na * 22.9897697 + (double)K * 38.9637079 + (double)Ca * 39.9626 + (double)Cd * 113.9034 + (double)Co * 58.9332 + (double)Cr * 51.9405 + (double)Cu * 62.9296 + (double)Fe * 55.9349 +(double)Li * 7.0160 + (double)Mn * 54.93805 + (double)Ni * 57.9353 + (double)Al * 26.981539 + (double)Ba * 137.9052 + (double)Cs * 132.90543 + (double)As * 74.92159 + (double)Be * 9.012182 + (double)Ga * 68.9256 + (double)Ge * 73.9212 + (double)Sb * 120.9038 + (double)Sc * 44.95591 + (double)Se *79.9165 + (double)Sn * 119.9022 + (double)Sr * 87.9056 + (double)Rb * 84.9118 + (double)Te * 129.9062 + (double)Ti * 47.9479 + (double)V * 50.9440 + (double)Zn * 63.9291 + (double)In * 114.9039 + (double)Bi * 208.98037 + (double)Pb * 207.9766 + (double)Tl * 204.9744 + (double)Zr * 89.9047 + (double)Nb *92.9064 + (double)Mo * 97.9054 + (double)Ru * 101.9043 + (double)Rh * 102.9055 + (double)Re * 186.9558 + (double)Pd * 105.9035 +(double)Ag * 106.9051 + (double)Pt * 194.9648 + (double)Ir * 192.9629 + (double)Hg * 201.9706 +(double)Os * 191.9615 + (double)W * 183.9510 + (double)Au * 196.9666 + (double)Ta * 180.9480 + (double)Hf * 179.9466 + (double)Ytt * 88.9059 + (double)Lu * 174.9408; if (Me > 0 && *Alert == '\0') { if (C > 1) printf("C%ld", C); if (C == 1) putchar('C'); if (H > 1) printf("H%ld", H); if (H == 1) putchar('H'); if (N > 1) printf("N%ld", N); if (N == 1) putchar('N'); if (O > 1) printf("O%ld", O); if (O == 1) putchar('O'); if (P > 1) printf("P%ld", P); if (P == 1) putchar('P'); if (S > 1) printf("S%ld", S); if (S == 1) putchar('S'); if (Si > 1) printf("Si%ld", Si); if (Si == 1) printf("Si"); if (B > 1) printf("B%ld", B); if (B == 1) putchar('B'); if (Br > 1) printf("Br%ld", Br); if (Br == 1) printf("Br"); if (Cl > 1) printf("Cl%ld", Cl); if (Cl == 1) printf("Cl"); if (F > 1) printf("F%ld", F); if (F == 1) putchar('F'); if (I > 1) printf("I%ld", I); if (I == 1) putchar('I'); if (Ag > 1) printf("Ag%ld", Ag); if (Ag == 1) printf("Ag"); if (Al > 1) printf("Al%ld", Al); if (Al == 1) printf("Al"); if (As > 1) printf("As%ld", As); if (As == 1) printf("As"); if (Au > 1) printf("Au%ld", Au); if (Au == 1) printf("Au"); if (Ba > 1) printf("Ba%ld", Ba); if (Ba == 1) printf("Ba"); if (Be > 1) printf("Be%ld", Be); if (Be == 1) printf("Be"); if (Bi > 1) printf("Bi%ld", Bi); if (Bi == 1) printf("Bi"); if (Ca > 1) printf("Ca%ld", Ca); if (Ca == 1) printf("Ca"); if (Cd > 1) printf("Cd%ld", Cd); if (Cd == 1) printf("Cd"); if (Co > 1) printf("Co%ld", Co); if (Co == 1) printf("Co"); if (Cr > 1) printf("Cr%ld", Cr); if (Cr == 1) printf("Cr"); if (Cs > 1) printf("Cs%ld", Cs); if (Cs == 1) printf("Cs"); if (Cu > 1) printf("Cu%ld", Cu); if (Cu == 1) printf("Cu"); if (Fe > 1) printf("Fe%ld", Fe); if (Fe == 1) printf("Fe"); if (Ga > 1) printf("Ga%ld", Ga); if (Ga == 1) printf("Ga"); if (Ge > 1) printf("Ge%ld", Ge); if (Ge == 1) printf("Ge"); if (Hf > 1) printf("Hf%ld", Hf); if (Hf == 1) printf("Hf"); if (Hg > 1) printf("Hg%ld", Hg); if (Hg == 1) printf("Hg"); if (In > 1) printf("In%ld", In); if (In == 1) printf("In"); if (Ir > 1) printf("Ir%ld", Ir); if (Ir == 1) printf("Ir"); if (K > 1) printf("K%ld", K); if (K == 1) putchar('K'); if (Li > 1) printf("Li%ld", Li); if (Li == 1) printf("Li"); if (Lu > 1) printf("Lu%ld", Lu); if (Lu == 1) printf("Lu"); if (Mg > 1) printf("Mg%ld", Mg); if (Mg == 1) printf("Mg"); if (Mn > 1) printf("Mn%ld", Mn); if (Mn == 1) printf("Mn"); if (Mo > 1) printf("Mo%ld", Mo); if (Mo == 1) printf("Mo"); if (Na > 1) printf("Na%ld", Na); if (Na == 1) printf("Na"); if (Nb > 1) printf("Nb%ld", Nb); if (Nb == 1) printf("Nb"); if (Ni > 1) printf("Ni%ld", Ni); if (Ni == 1) printf("Ni"); if (Os > 1) printf("Os%ld", Os); if (Os == 1) printf("Os"); if (Pb > 1) printf("Pb%ld", Pb); if (Pb == 1) printf("Pb"); if (Pd > 1) printf("Pd%ld", Pd); if (Pd == 1) printf("Pd"); if (Pt > 1) printf("Pt%ld", Pt); if (Pt == 1) printf("Pt"); if (Rb > 1) printf("Rb%ld", Rb); if (Rb == 1) printf("Rb"); if (Re > 1) printf("Re%ld", Re); if (Re == 1) printf("Re"); if (Rh > 1) printf("Rh%ld", Rh); if (Rh == 1) printf("Rh"); if (Ru > 1) printf("Rb%ld", Ru); if (Ru == 1) printf("Ru"); if (Sb > 1) printf("Sb%ld", Sb); if (Sb == 1) printf("Sb"); if (Sc > 1) printf("Sc%ld", Sc); if (Sc == 1) printf("Sc"); if (Se > 1) printf("Se%ld", Se); if (Se == 1) printf("Se"); if (Sn > 1) printf("Sn%ld", Sn); if (Sn == 1) printf("Sn"); if (Sr > 1) printf("Sr%ld", Sr); if (Sr == 1) printf("Sr"); if (Ta > 1) printf("Ta%ld", Ta); if (Ta == 1) printf("Ta"); if (Te > 1) printf("Te%ld", Te); if (Te == 1) printf("Te"); if (Ti > 1) printf("Ti%ld", Ti); if (Ti == 1) printf("Ti"); if (Tl > 1) printf("Tl%ld", Tl); if (Tl == 1) printf("Tl"); if (V > 1) printf("V%ld", V); if (V == 1) printf("V"); if (W > 1) printf("W%ld", W); if (W == 1) printf("W"); if (Ytt > 1) printf("Y%ld", Ytt); if (Ytt == 1) printf("Y"); if (Zn > 1) printf("Zn%ld", Zn); if (Zn == 1) printf("Zn"); if (Zr > 1) printf("Zr%ld", Zr); if (Zr == 1) printf("Zr"); printf(" [%2.3f]", M); printf(" Me=%2.10f ", Me); if (C > 0) printf("%4.2f%%C;", (double)C * 12.011 * 100 / M); if (H > 0) printf("%4.2f%%H;", (double)H * 1.0079 * 100 / M); if (B > 0) printf("%4.2f%%B;", (double)B * 10.81 * 100 / M); if (N > 0) printf("%4.2f%%N;", (double)N * 14.0067 * 100 / M); if (O > 0) printf("%4.2f%%O;", (double)O * 15.9994 * 100 / M); if (P > 0) printf("%4.2f%%P;", (double)P * 30.97376 * 100 / M); if (S > 0) printf("%4.2f%%S;", (double)S * 32.0640 * 100 / M); if (K > 0) printf("%4.2f%%K;", (double)K * 39.098 * 100 / M); if (Mg > 0) printf("%4.2f%%Mg;", (double)Mg * 24.305 * 100 / M); if (Na > 0) printf("%4.2f%%Na;", (double)Na * 22.98977 * 100 / M); if (Si > 0) printf("%4.2f%%Si;", (double)Si * 28.086 * 100 / M); if (Br > 0) printf("%4.2f%%Br;", (double)Br * 79.904 * 100 / M); if (Cl > 0) printf("%4.2f%%Cl;", (double)Cl * 35.453 * 100 / M); if (F > 0) printf("%4.2f%%F;", (double)F * 18.9984 * 100 / M); if (I > 0) printf("%4.2f%%I;", (double)I * 126.9045 * 100 / M); if (Ag >0) printf("%4.2f%%Ag;", (double)Ag * 107.868 * 100 / M); if (Al >0) printf("%4.2f%%Al;", (double)Al * 26.981539 * 100 / M); if (As >0) printf("%4.2f%%As;", (double)As * 74.92159 * 100 / M); if (Au >0) printf("%4.2f%%Au;", (double)Au * 196.966 * 100 / M); if (Ba >0) printf("%4.2f%%Ba;", (double)Ba * 137.327 * 100 / M); if (Be >0) printf("%4.2f%%Be;", (double)Be * 9.012182 * 100 / M); if (Bi >0) printf("%4.2f%%Bi;", (double)Bi * 208.98037 * 100 / M); if (Ca >0) printf("%4.2f%%Ca;", (double)Ca * 40.08 * 100 / M); if (Cd >0) printf("%4.2f%%Cd;", (double)Cd * 112.41 * 100 / M); if (Co >0) printf("%4.2f%%Co;", (double)Co * 58.993 * 100 / M); if (Cr >0) printf("%4.2f%%Cr;", (double)Cr * 51.996 * 100 / M); if (Cs >0) printf("%4.2f%%Cs;", (double)Cs * 132.90543 * 100 / M); if (Cu >0) printf("%4.2f%%Cu;", (double)Cu * 63.546 * 100 / M); if (Fe >0) printf("%4.2f%%Fe;", (double)Fe * 55.847 * 100 / M); if (Ga >0) printf("%4.2f%%Ga;", (double)Ga * 69.723 * 100 / M); if (Ge >0) printf("%4.2f%%Ge;", (double)Ge * 72.61 * 100 / M); if (Hf >0) printf("%4.2f%%Hf;", (double)Hf * 178.49 * 100 / M); if (Hg >0) printf("%4.2f%%Hg;", (double)Hg * 200.59 * 100 / M); if (In >0) printf("%4.2f%%In;", (double)In * 114.82 * 100 / M); if (Ir >0) printf("%4.2f%%Ir;", (double)Ir * 192.217 * 100 / M); if (Li >0) printf("%4.2f%%Li;", (double)Li * 6.941 * 100 / M); if (Lu >0) printf("%4.2f%%Lu;", (double)Lu * 174.967 * 100 / M); if (Mn >0) printf("%4.2f%%Mn;", (double)Mn * 54.938 * 100 / M); if (Mo >0) printf("%4.2f%%Mo;", (double)Mo * 95.94 * 100 / M); if (Nb >0) printf("%4.2f%%Nb;", (double)Nb * 92.906 *100 / M); if (Ni >0) printf("%4.2f%%Ni;", (double)Ni * 58.69 *100 / M); if (Os >0) printf("%4.2f%%Os;", (double)Os * 190.2 *100 / M); if (Pb >0) printf("%4.2f%%Pb;", (double)Pb * 207.2 *100 / M); if (Pd >0) printf("%4.2f%%Pd;", (double)Pd * 106.42 *100 / M); if (Pt >0) printf("%4.2f%%Pt;", (double)Pt * 195.078 *100 / M); if (Rb >0) printf("%4.2f%%Rb;", (double)Rb * 85.4678 *100 / M); if (Re >0) printf("%4.2f%%Re;", (double)Re * 186.207 *100 / M); if (Rh >0) printf("%4.2f%%Rh;", (double)Rh * 102.9055 *100 / M); if (Ru >0) printf("%4.2f%%Ru;", (double)Ru * 101.07 *100 / M); if (Sb >0) printf("%4.2f%%Sb;", (double)Sb * 121.75 *100 / M); if (Sc >0) printf("%4.2f%%Sc;", (double)Sc * 44.95591 *100 / M); if (Se >0) printf("%4.2f%%Se;", (double)Se * 78.96 *100 / M); if (Sn >0) printf("%4.2f%%Sn;", (double)Sn * 118.71 *100 / M); if (Sr >0) printf("%4.2f%%Sr;", (double)Sr * 87.62 *100 / M); if (Ta >0) printf("%4.2f%%Ta;", (double)Ta * 180.948 *100 / M); if (Te >0) printf("%4.2f%%Te;", (double)Te * 127.60 *100 / M); if (Ti >0) printf("%4.2f%%Ti;", (double)Ti * 47.88 *100 / M); if (Tl >0) printf("%4.2f%%Tl;", (double)Tl * 204.3833 *100 / M); if (V >0) printf("%4.2f%%V;", (double)V * 50.9415 *100 / M); if (W >0) printf("%4.2f%%W;", (double)W * 183.84 *100 / M); if (Ytt >0) printf("%4.2f%%Y;", (double)Ytt * 88.906 *100 / M); if (Zn >0) printf("%4.2f%%Zn;", (double)Zn * 65.39 *100. / M); if (Zr >0) printf("%4.2f%%Zr;", (double)Zr * 91.224 *100. / M); } else { if (*Alert != '\0') printf("%s overlapped bonds !", Alert); else printf("C0H0 [0.00] Me=0.0000000000 0.00%%C;0.00%%H"); } putchar('\n'); exit(EXIT_SUCCESS); } /* End. */ chemtool-1.6.14/src-cht/Makefile.in0000644000175000001440000000033210767766077016263 0ustar martinusersCC=@CC@ CFLAGS=@CFLAGS@ default: cht all: cht cht: cht.c $(CC) $(CFLAGS) cht.c -o cht lint: cht.c splint -weak +posixlib cht.c >splint.log clean: rm -f cht cht.o distclean: rm -f cht cht.o Makefile install: chemtool-1.6.14/src-cht/Makefile.std0000644000175000001440000000006610715417303016425 0ustar martinusersdefault: cht cht: cht-2.5.c gcc -O cht-2.5.c -o cht chemtool-1.6.14/src-cht/Changelog0000644000175000001440000000533010767766156016031 0ustar martinusersChange-log for cht 2.7 (mk) - Removed unused declaration of mem* functions 2.6 (mk) - Reordered p2c portability functions to make gcc411/glibc255 happy 2.5 (mk) - Code changes to make splint happy. - Added Ag,Au,Hf,Hg,Ir,Lu,Mo,Nb,Os,Pd,Pt,Rh,Re,Ru,Ta,W,Y,Zr 2.4 (mk) - Modified Makefile.in to actually use the CC and CFLAGS information propagated by configure. - Removed a few unused functions (from the builtin copy of p2c.h) that might cause portability problems. 2.3 (mk) - supplied exact masses for the elements added in 2.2, added Al,As,Ba,Be,Bi,Li,Cs,In,Ga,Ge,Pb,Rb,Sb,Sc,Se,Sn,Sr,Te,Ti,Tl,V,Zn added greek Phi (@F) as alternative symbol for Ph Changed Makefile.in to build version 2.3 2.2 (mk) - added Ca,Cd,Co,Cr,Cu,Fe,Mn,Ni 2.1 (mk) - regular arrows are no longer counted as C2 fragments 2.0 (mk) - added support for 1.5a25 'decoration' flag to ignore 'electron pairs', boxes and brackets - the 'half arrow' bond type is now ignored * TODO : _isolated_ regular arrows should be ignored as well 1.9 (mk) - added support for latex-like brace syntax in subscripts (e.g. C_{10}H_{22}) - added support for two-digit subscripts (C_1_0 was interpreted as C_1) 1.8 (mk) - interactive mode added, one can now call cht with '-i' followed by a sum formula in chemtool notation, e.g. 'cht -i C_6H_5_NH_2' or 'cht -i C_1_2H_2_5OH' 1.7 - Mg added - small changes in output formatting 1.6 - a nasty bug in the label parsing routine was removed (that which was fetched in during the code cleanup in version 1.4) 1.5 - wrong mass for B. All values checked with tabular ones. - composition is calculated (format: 00.00%C;00.00%H;00.00%N; ... ) 1.4 - added test for bonds overlap. If some bonds are overlapped (within the interval gave by "Sensi" parameter; 5 points by default) then the exclamation mark precede the summary formula (one "!" for each such overlap) - only the "top label" of overlapped labels is taken into calculation 1.1 to 1.3: - added support for bond type 11 (aromatic ring), Martin's patch. - Ac is CH_3CO, not CH_3 (uff!) - removed bug in the label parser (labels XxxYyy were interpreted as XxxY, e.g. --C(Me_2BuSiO)_3 were interpreted as --C_20H_48O_3S_3 - note S instead of Si) - removed bug in the label parser (labels XXXXX??? bring cht into infinite loop, e.g. "Guo" instead of "Gua", NE instead of NEt) - Readln(file,X1,X2,Y1,Y2 ...) used, instead of Readln(file,string); no Val(Copy(Pos........))) construction needed. - Now the mass of the label(s) is calculated, even if no bond has been drawn (however when some bonds have been drawn, then the labels which are not con- nected to the structure are ignored - it is good for the caption(s) not to be involved into calculation) chemtool-1.6.14/src-cht/cht-1.7.pp0000644000175000001440000006716710715417303015635 0ustar martinusersprogram cht; type PointPtr=^TPoint; TPoint=record X:longint; Y:longint; C,H,N,O,P,S,Si,B,Br,Cl,F,I,Mg,Na,K:longint; RecCount:longint; Last:PointPtr; end; BondPtr=^TBond; TBond=record X1:longint; Y1:longint; X2:longint; Y2:longint; RecCount:longint; Last:BondPtr; end; var C,H,N,O,P,S,Si,B,Br,Cl,F,I,Mg,Na,K,X1,X2,Y1,Y2,T:longint; IFile:text; Point,Last,Current:PointPtr; Bond,LastB,CurrentB:BondPtr; sss,A,subs,Alert:string; sssb:string[6]; M,Me:real; separator:char; Count,code,atoms,rep,range,bonds:longint; Abandon,debug,verbose,fa,nobonds:boolean; const Sensi:longint=5; {bonds and labels joint precision sensitivity} Procedure doBonds; begin Repeat Readln(IFile,X1,Y1,X2,Y2,T); Dec(bonds); If debug then Writeln(X1,'; ',Y1,'; ',X2,'; ',Y2,'; ',T); If T=11 then range:=4*((X1-X2)*(X1-X2)+(Y1-Y2)*(Y1-Y2)); LastB:=Bond; New(Bond); Bond^.X1:=X1; Bond^.X2:=X2; Bond^.Y1:=Y1; Bond^.Y2:=Y2; Bond^.Last:=LastB; CurrentB:=Bond; Bond:=Bond^.Last; While Bond^.Last<>nil do begin If (((ABS(Bond^.X1-X1)nil do begin If T=11 then begin Abandon:=true; If ((Point^.X-X1)*(Point^.X-X1)+(Point^.Y-Y1)*(Point^.Y-Y1)) < range then begin If Point^.H > 0 then Point^.H:=Point^.H-1; If debug then Writeln('Ring --> stripped one H from ',Point^.X,' ',Point^.Y); end; end else If ((ABS(Point^.X-X1) Joined at ',X1,' ',Y1); If (T=0) OR (T=5) OR (T=6) OR (T=7) OR (T=10) OR (T=12) OR (T=13) then Point^.H:=Point^.H-1; If (T=1) OR (T=2) OR (T=4) then Point^.H:=Point^.H-2; If (T=3) then Point^.H:=Point^.H-3; Abandon:=true; end; Point:=Point^.Last; end; Point:=Current; If NOT Abandon then begin Inc(Count); Last:=Point; New(Point); Point^.X:=X1; If debug then Write(' Point^.X=',Point^.X); Point^.Y:=Y1; If debug then Write(' Point^.Y=',Point^.Y); If T<>11 then Point^.C:=1 else Point^.C:=0; If debug then Write(' Point^.C=',Point^.C); If (T=0) OR (T=5) OR (T=6) OR (T=7) OR (T=10) OR (T=12) OR (T=13) then Point^.H:=3; If (T=1) OR (T=2) OR (T=4) then Point^.H:=2; If (T=3) then Point^.H:=1; If debug then Write(' Point^.H=',Point^.H); Point^.N:=0; Point^.O:=0; Point^.P:=0; Point^.S:=0; Point^.Si:=0; Point^.B:=0; Point^.Br:=0; Point^.Cl:=0; Point^.F:=0; Point^.I:=0; Point^.Na:=0; Point^.Mg:=0; Point^.K:=0; Point^.RecCount:=Count; If debug then Writeln(' Point^.RecCount=',Point^.RecCount); Point^.Last:=Last; end; If (T<>11) then begin Abandon:=false; Current:=Point; While Point^.Last<>nil do begin If ((ABS(Point^.X-X2) Joined at ',X2,' ',Y2); If (T=0) OR (T=5) OR (T=6) OR (T=7) OR (T=10) OR (T=12) OR (T=13) then Point^.H:=Point^.H-1; If (T=1) OR (T=2) OR (T=4) then Point^.H:=Point^.H-2; If (T=3) then Point^.H:=Point^.H-3; Abandon:=true; end; Point:=Point^.Last; end; Point:=Current; If NOT Abandon then begin Inc(Count); Last:=Point; New(Point); Point^.X:=X2; If debug then Write(' Point^.X=',Point^.X); Point^.Y:=Y2; If debug then Write(' Point^.Y=',Point^.Y); If T<>11 then Point^.C:=1 else Point^.C:=0; If debug then Write(' Point^.C=',Point^.C); If (T=0) OR (T=5) OR (T=6) OR (T=7) OR (T=10) OR (T=12) OR (T=13) then Point^.H:=3; If (T=1) OR (T=2) OR (T=4) then Point^.H:=2; If (T=3) then Point^.H:=1; If debug then Write(' Point^.H=',Point^.H); Point^.N:=0; Point^.O:=0; Point^.P:=0; Point^.S:=0; Point^.Si:=0; Point^.B:=0; Point^.Br:=0; Point^.Cl:=0; Point^.F:=0; Point^.I:=0; Point^.Mg:=0; Point^.Na:=0; Point^.K:=0; Point^.RecCount:=Count; If debug then Writeln(' Point^.RecCount=',Point^.RecCount); Point^.Last:=Last; end; end; Until (Bonds=0); end; Procedure doLabels; var mul,gmul,gmpos,ggmul,ggmpos:longint; stripped:boolean; begin If debug then Writeln('---- and now parse the labels ---------'); If verbose then Writeln ('HeteroAtoms: ',atoms); For rep:= 1 to atoms do begin Readln(IFile,X1,Y1,separator,sss); A:=Copy(sss,1,Pos(#09,sss)-1); If debug then Writeln('Atom ',A, ' X=',X1,' Y=',Y1,' sss: ',sss); If nobonds then {initialize the Point structure if no bonds, only labels, defined} begin Inc(Count); Last:=Point; New(Point); Point^.X:=X1; Point^.Y:=Y1; Point^.C:=0; Point^.H:=0; Point^.N:=0; Point^.O:=0; Point^.P:=0; Point^.S:=0; Point^.Si:=0; Point^.B:=0; Point^.Br:=0; Point^.Cl:=0; Point^.F:=0; Point^.I:=0; Point^.Mg:=0; Point^.Na:=0; Point^.K:=0; Point^.RecCount:=Count; Point^.Last:=Last; end; Current:=Point; While Point^.Last<>nil do begin If ((ABS(Point^.X-X1)'' do begin stripped:=false; If Length(A) >= 5 then begin subs:=Copy(A,1,5); If Length(A)>6 then If A[6]='_' then Val(A[7],mul,code) else mul:=1; mul:=mul*gmul*ggmul; If subs='TBDMS' then begin {Tert-butyldimethylsilyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+6*mul; Point^.H:=Point^.H+15*mul; Point^.Si:=Point^.Si+1*mul; A:=Copy(A,6,Length(A)-5); stripped:=true; end; If subs='TBDPS' then begin {Tert-butyldiphenylsilyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+16*mul; Point^.H:=Point^.H+19*mul; Point^.Si:=Point^.Si+1*mul; A:=Copy(A,6,Length(A)-5); stripped:=true; end; If A[1]='[' then begin ggmpos:=Pos(']',A); If ggmpos <> 0 then If A[ggmpos+1] = '_' then Val(A[ggmpos+2],ggmul,code) else ggmul:=1; end; If A[1]='(' then begin gmpos:=Pos(')',A); If gmpos <> 0 then If A[gmpos+1] = '_' then Val(A[gmpos+2],gmul,code) else gmul:=1; end; end; If ((Length(A) >= 4) AND NOT stripped) then begin subs:=Copy(A,1,4); If Length(A)>5 then If A[5]='_' then Val(A[6],mul,code) else mul:=1; mul:=mul*gmul*ggmul; If subs='DBAM' then begin {dibutylaminomethylene; =R, used as the N prot.} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+9*mul; Point^.H:=Point^.H+19*mul; Point^.N:=Point^.N+1*mul; A:=Copy(A,5,Length(A)-4); stripped:=true; end; If subs='DMAM' then begin {dimethylaminomethylene; =R, used as the N prot.} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+3*mul; Point^.H:=Point^.H+7*mul; Point^.N:=Point^.N+1*mul; A:=Copy(A,5,Length(A)-4); stripped:=true; end; If subs='DMTr' then begin {dimethoxytrityl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+21*mul; Point^.H:=Point^.H+19*mul; Point^.O:=Point^.O+2*mul; A:=Copy(A,5,Length(A)-4); stripped:=true; end; If subs='MMTr' then begin {monomethoxytrityl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+20*mul; Point^.H:=Point^.H+16*mul; Point^.O:=Point^.O+1*mul; A:=Copy(A,5,Length(A)-4); stripped:=true; end; If subs='TMTr' then begin {trimethoxytrityl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+22*mul; Point^.H:=Point^.H+22*mul; Point^.O:=Point^.O+3*mul; A:=Copy(A,5,Length(A)-4); stripped:=true; end; end; If ((Length(A) >= 3) AND NOT stripped) then begin subs:=Copy(A,1,3); If Length(A)>4 then If A[4]='_' then Val(A[5],mul,code) else mul:=1; mul:=mul*gmul*ggmul; If subs='Ade' then begin {Adeninyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+5*mul; Point^.H:=Point^.H+4*mul; Point^.N:=Point^.N+5*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='BOC' then begin {Butyloxycarbonyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+5*mul; Point^.H:=Point^.H+9*mul; Point^.O:=Point^.O+2*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='Cyt' then begin {Cytosinyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+4*mul; Point^.H:=Point^.H+4*mul; Point^.N:=Point^.N+3*mul; Point^.O:=Point^.O+1*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='Gua' then begin {Guaninyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+5*mul; Point^.H:=Point^.H+4*mul; Point^.N:=Point^.N+5*mul; Point^.O:=Point^.O+1*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='iBu' then begin {iso-Butyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+4*mul; Point^.H:=Point^.H+9*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='iPr' then begin {2-Propyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+3*mul; Point^.H:=Point^.H+7*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='MOC' then begin {Methoxycarbonyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+2*mul; Point^.H:=Point^.H+3*mul; Point^.O:=Point^.O+2*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='MOM' then begin {Methoxymethyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+2*mul; Point^.H:=Point^.H+5*mul; Point^.O:=Point^.O+1*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='tBu' then begin {t-Butyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+4*mul; Point^.H:=Point^.H+9*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='Thy' then begin {Thyminyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+5*mul; Point^.H:=Point^.H+5*mul; Point^.N:=Point^.N+2*mul; Point^.O:=Point^.O+2*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='TMS' then begin {Trimethylsilyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+3*mul; Point^.H:=Point^.H+9*mul; Point^.Si:=Point^.Si+1*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='Tol' then begin {tolyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+8*mul; Point^.H:=Point^.H+7*mul; Point^.O:=Point^.O+1*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; If subs='Ura' then begin {Uracilyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+4*mul; Point^.H:=Point^.H+3*mul; Point^.N:=Point^.N+2*mul; Point^.O:=Point^.O+2*mul; A:=Copy(A,4,Length(A)-3); stripped:=true; end; end; If ((Length(A) >= 2) AND NOT stripped) then begin subs:=Copy(A,1,2); If Length(A)>3 then If A[3]='_' then Val(A[4],mul,code) else mul:=1; mul:=mul*gmul*ggmul; If subs='Ac' then begin {acetyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+2*mul; Point^.H:=Point^.H+3*mul; Point^.O:=Point^.O+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Bn' then begin {benzyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+7*mul; Point^.H:=Point^.H+7*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Br' then begin {bromine} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.Br:=Point^.Br+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Bu' then begin {butyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+4*mul; Point^.H:=Point^.H+9*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Bz' then begin {benzoyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+7*mul; Point^.H:=Point^.H+5*mul; Point^.O:=Point^.O+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='CE' then begin {cyanoethyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+3*mul; Point^.H:=Point^.H+4*mul; Point^.N:=Point^.N+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Cl' then begin {chlorine} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.Cl:=Point^.Cl+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Et' then begin {ethyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+2*mul; Point^.H:=Point^.H+5*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Me' then begin {methyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+1*mul; Point^.H:=Point^.H+3*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Ms' then begin {methanesulfonyl, mesyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+1*mul; Point^.H:=Point^.H+3*mul; Point^.O:=Point^.O+2*mul; Point^.S:=Point^.S+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Mg' then begin {magnesium} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.Mg:=Point^.Mg+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Na' then begin {sodium} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.Na:=Point^.Na+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Ph' then begin {phenyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+6*mul; Point^.H:=Point^.H+5*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Pr' then begin {propyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+3*mul; Point^.H:=Point^.H+7*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Tf' then begin {trifluoromethanesulfonyl, triflyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+1*mul; Point^.F:=Point^.F+3*mul; Point^.O:=Point^.O+2*mul; Point^.S:=Point^.S+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Tr' then begin {trityl, triphenylmethyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+19*mul; Point^.H:=Point^.H+15*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Ts' then begin {toluenesulfonyl, tosyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+7*mul; Point^.H:=Point^.H+7*mul; Point^.O:=Point^.O+2*mul; Point^.S:=Point^.S+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; If subs='Si' then begin {silicon} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.Si:=Point^.Si+1*mul; A:=Copy(A,3,Length(A)-2); stripped:=true; end; end; If ((Length(A) >= 1) AND NOT stripped) then begin subs:=Copy(A,1,1); If Length(A)>2 then If A[2]='_' then Val(A[3],mul,code) else mul:=1; mul:=mul*gmul*ggmul; If subs='B' then begin {boron} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.B:=Point^.B+1*mul; end; If subs='C' then begin {carbon} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+1*mul; end; If subs='F' then begin {fluorine} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.F:=Point^.F+1*mul; end; If subs='H' then begin {hydrogen} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.H:=Point^.H+1*mul; end; If subs='I' then begin {iodine} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.I:=Point^.I+1*mul; end; If subs='K' then begin {potassium} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.K:=Point^.K+1*mul; end; If subs='N' then begin {nitrogen} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.N:=Point^.N+1*mul; end; If subs='O' then begin {oxygen} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.O:=Point^.O+1*mul; end; If subs='P' then begin {phosphorus} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.P:=Point^.P+1*mul; end; If subs='S' then begin {sulfur} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.S:=Point^.S+1*mul; end; If subs='Z' then begin {"Z", Benzyloxycarbonyl} If debug then Writeln(' ',subs,'*',mul,' (',gmul,',',ggmul,')'); Point^.C:=Point^.C+8*mul; Point^.H:=Point^.H+7*mul; Point^.O:=Point^.O+2*mul; end; If subs=')' then begin {reset gmul} gmul:=1; end; If subs=']' then begin {reset gmul,ggmul} gmul:=1; ggmul:=1; end; If NOT stripped then A:=Copy(A,2,Length(A)-1); end; end; end; Point:=Point^.Last; end; Point:=Current; end; end; begin If (Paramcount=0) then begin Writeln('enter "cht -h" for help'); Halt(0); end; C:=0;H:=0;N:=0;O:=0;P:=0;S:=0;Si:=0;B:=0;Br:=0;I:=0;Cl:=0;F:=0;Mg:=0;Na:=0;K:=0; verbose:=false; debug:=false; fa:=false;{no file assigned} Count:=0; Alert:=''; For rep:= 1 to Paramcount do begin If (Paramstr(rep)='-v') OR (Paramstr(rep)='--verbose') then verbose:=true; If (Paramstr(rep)='-d') OR (Paramstr(rep)='--debug') then debug:=true; If (Paramstr(rep)='-h') OR (Paramstr(rep)='--help') then begin Writeln('The Chemtool drawings analyzer 1.7'); Writeln('*** Gizmo Head Software ***'); Writeln(' Radek Liboska (c) 2001'); Writeln; Writeln('syntax: cht [-options] '); Writeln; Writeln('Recognizes C,H,O,N,P,S,Si,B,Br,I,Cl,F,Mg,Na,K,'); Writeln(' Ac,Ade,Bn,Bu,Bz,BOC,Cyt,CE,DBAM,DMAM,DMTr,Et,Gua,iBu,iPr,Me,Ms,MOC,'); Writeln(' MOM,MMTr,Ph,Pr,tBu,Tf,Thy,Tol,Tr,Ts,TBDMS,TBDPS,TMS,TMTr,Ura,Z'); Writeln('Can handle two levels of patentheses; e.g. P[OCH(CH_3)_2]_3'); Writeln; Writeln('options:'); Writeln(' -h or --help : this help'); Writeln(' -v or --verbose : be verbose'); Writeln(' -d or --debug : be more verbose'); Writeln; Halt(0); end; If Paramstr(rep)[1]<>'-' then begin Assign(IFile,Paramstr(rep)); fa:=true; end; end; If NOT fa then begin Writeln('No file defined, enter "cht -h" for help'); Halt(1); end; Reset(IFile); New(Point); Point^.X:=0; Point^.Y:=0; Point^.C:=0; Point^.H:=0; Point^.N:=0; Point^.O:=0; Point^.P:=0; Point^.S:=0; Point^.Si:=0; Point^.B:=0; Point^.Br:=0; Point^.Cl:=0; Point^.F:=0; Point^.I:=0; Point^.Mg:=0; Point^.Na:=0; Point^.K:=0; Point^.RecCount:=Count; Point^.Last:=nil; New(Bond); Bond^.X1:=0; Bond^.Y1:=0; Bond^.X2:=0; Bond^.Y2:=0; Bond^.RecCount:=Count; Bond^.Last:=nil; Readln(IFile,sss); sss:=Copy(sss,1,18); If NOT (sss='Chemtool Version 1') then begin Writeln('Not a chemtool 1.x file, enter "cht -h" for help'); Halt(2); end; Readln(IFile); Readln(IFile,sssb,bonds); If bonds=0 then nobonds:=true; If sssb='bonds ' then If bonds > 0 then doBonds; Readln(IFile,sssb,atoms); If sssb='atoms ' then If atoms > 0 then doLabels; Close(IFile); If verbose then Writeln('---------------------- Summary -------------------------'); While Point^.Last<>nil do begin If verbose then Writeln('RecCount: ',Point^.RecCount,' X=',Point^.X,' Y=',Point^.Y,' C',Point^.C,' H',Point^.H,' N',Point^.N,' O',Point^.O,' P',Point^.P,' S',Point^.S,' Si',Point^.Si,' B',Point^.B,' Br',Point^.Br,' Cl',Point^.Cl,' F',Point^.F,' I',Point^.I,' Mg',Point^.Mg,' Na',Point^.Na,' K',Point^.K); C:=C+Point^.C; H:=H+Point^.H; N:=N+Point^.N; O:=O+Point^.O; P:=P+Point^.P; S:=S+Point^.S; Si:=Si+Point^.Si; B:=B+Point^.B; Br:=Br+Point^.Br; Cl:=Cl+Point^.Cl; F:=F+Point^.F; I:=I+Point^.I; Mg:=Mg+Point^.Mg; Na:=Na+Point^.Na; K:=K+Point^.K; Point:=Point^.Last; end; If H<0 then H:=0; {overlapped bonds} M:=C*12.011+H*1.0079+N*14.0067+O*15.9994+P*30.97376+S*32.064+Si*28.086+B*10.81+Br*79.904+Cl*35.453+F*18.9984+I*126.9045+Mg*24.305+Na*22.98977+K*39.098; Me:=C*12+H*1.007825037+N*14.003074008+O*15.99491464+P*30.9737634+S*31.9720718+Si*27.9769284+B*11.0093053+Br*78.9183361+Cl*34.968852729+F*18.99840325+I*126.904477+Mg*23.9850450+Na*22.9897697+K*38.9637079; If ((Me>0) AND (Alert='')) then begin If C>1 then Write('C',C);If C=1 then Write('C'); If H>1 then Write('H',H);If H=1 then Write('H'); If N>1 then Write('N',N);If N=1 then Write('N'); If O>1 then Write('O',O);If O=1 then Write('O'); If P>1 then Write('P',P);If P=1 then Write('P'); If S>1 then Write('S',S);If S=1 then Write('S'); If Si>1 then Write('Si',Si);If Si=1 then Write('Si'); If B>1 then Write('B',B);If B=1 then Write('B'); If Br>1 then Write('Br',Br);If Br=1 then Write('Br'); If Cl>1 then Write('Cl',Cl);If Cl=1 then Write('Cl'); If F>1 then Write('F',F);If F=1 then Write('F'); If I>1 then Write('I',I);If I=1 then Write('I'); If Mg>1 then Write('Mg',Mg);If Mg=1 then Write('Mg'); If Na>1 then Write('Na',Na);If Na=1 then Write('Na'); If K>1 then Write('K',K);If K=1 then Write('K'); Write(' [',M:2:3,']'); Write(' Me=',Me:2:10,' '); If C > 0 then Write(C*12.011*100/M:4:2,'%C;'); If H > 0 then Write(H*1.0079*100/M:4:2,'%H;'); If B > 0 then Write(B*10.81*100/M:4:2,'%B;'); If N > 0 then Write(N*14.0067*100/M:4:2,'%N;'); If O > 0 then Write(O*15.9994*100/M:4:2,'%O;'); If P > 0 then Write(P*30.97376*100/M:4:2,'%P;'); If S > 0 then Write(S*32.0640*100/M:4:2,'%S;'); If K > 0 then Write(K*39.098*100/M:4:2,'%K;'); If Mg > 0 then Write(Mg*24.305*100/M:4:2,'%Mg;'); If Na > 0 then Write(Na*22.98977*100/M:4:2,'%Na;'); If Si > 0 then Write(Si*28.086*100/M:4:2,'%Si;'); If Br > 0 then Write(Br*79.904*100/M:4:2,'%Br;'); If Cl > 0 then Write(Cl*35.453*100/M:4:2,'%Cl;'); If F > 0 then Write(F*18.9984*100/M:4:2,'%F;'); If I > 0 then Write(I*126.9045*100/M:4:2,'%I;'); end else If Alert<>'' then Write(Alert,' overlapped bonds !') else Write('C0H0 [0.00] Me=0.0000000000 0.00%C;0.00%H'); Writeln; end. chemtool-1.6.14/src-cht/cht.c0000644000175000001440000026110710767766042015141 0ustar martinusers/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */ /* From input file "cht-1.7.pp" */ #ifdef HAVE_CONFIG_H #include #endif #ifndef P2C_H #define P2C_H /* Header file for code generated by "p2c", the Pascal-to-C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version 1.21alpha-07.Dec.93. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #include #include #define DOUBLE double /* If the following heuristic fails, compile -DBSD=0 for non-BSD systems, or -DBSD=1 for BSD systems. */ #ifdef M_XENIX # define BSD 0 #endif #ifdef vms # define BSD 0 # ifndef __STDC__ # define __STDC__ 1 # endif #endif #ifdef __TURBOC__ # define MSDOS 1 #endif #ifdef MSDOS # define BSD 0 #endif #ifdef FILE /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */ # ifndef BSD /* (a convenient, but horrible kludge!) */ # define BSD 1 # endif #endif #ifdef BSD # if !BSD # undef BSD # endif #endif #if (defined(__STDC__) && !defined(M_XENIX)) || defined(__TURBOC__) # include # include # define HAS_STDLIB # if defined(vms) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #else # ifndef BSD # ifndef __TURBOC__ # include # endif # endif # ifdef hpux # ifdef _INCLUDE__STDC__ # include # include # define HAS_STDLIB # endif # endif # include # if !defined(MSDOS) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #endif #if defined(NON_ANSI_CAT) && !defined(ANSI_CAT) # ifdef NON_ANSI_CAT_ALTERNATE # define __CAT__(a,b)a/**/b # else # define __ID__(a)a # define __CAT__(a,b)__ID__(a)b # endif #else # define __CAT__(a,b)a##b #endif #ifdef BSD # include # define strchr(s,c) index(s,c) # define strrchr(s,c) rindex(s,c) #else # include #endif #include #include #include #include #ifndef NO_LACK #ifdef vms #define LACK_LABS #define LACK_MEMMOVE #define LACK_MEMCPY #else #define LACK_LABS /* Undefine these if your library has these */ #define LACK_MEMMOVE #endif #endif typedef struct __p2c_jmp_buf { struct __p2c_jmp_buf *next; jmp_buf jbuf; } __p2c_jmp_buf; /* Warning: The following will not work if setjmp is used simultaneously. This also violates the ANSI restriction about using vars after longjmp, but a typical implementation of longjmp will get it right anyway. */ #ifndef FAKE_TRY # define TRY(x) do { __p2c_jmp_buf __try_jb; \ __try_jb.next = __top_jb; \ if (!setjmp((__top_jb = &__try_jb)->jbuf)) { # define RECOVER(x) __top_jb = __try_jb.next; } else { # define RECOVER2(x,L) __top_jb = __try_jb.next; } else { \ if (0) { L: __top_jb = __try_jb.next; } # define ENDTRY(x) } } while (0) #else # define TRY(x) if (1) { # define RECOVER(x) } else do { # define RECOVER2(x,L) } else do { L: ; # define ENDTRY(x) } while (0) #endif #ifdef M_XENIX /* avoid compiler bug */ # define SHORT_MAX (32767) # define SHORT_MIN (-32768) #endif /* The following definitions work only on twos-complement machines */ #ifndef SHORT_MAX # define SHORT_MAX ((short)(((unsigned short) -1) >> 1)) # define SHORT_MIN (~SHORT_MAX) #endif #ifndef INT_MAX # define INT_MAX ((int)(((unsigned int) -1) >> 1)) # define INT_MIN (~INT_MAX) #endif #ifndef LONG_MAX # define LONG_MAX ((long)(((unsigned long) -1) >> 1)) # define LONG_MIN (~LONG_MAX) #endif #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 #endif #ifndef EXIT_SUCCESS # ifdef vms # define EXIT_SUCCESS 1 # define EXIT_FAILURE (02000000000L) # else # define EXIT_SUCCESS 0 # define EXIT_FAILURE 1 # endif #endif #define SETBITS 32 #if defined(__STDC__) || defined(__TURBOC__) # if !defined(vms) && !defined(M_LINT) # define Signed signed # else # define Signed # endif # define Void void /* Void f() = procedure */ # ifndef Const # define Const const # endif # ifndef Volatile # define Volatile volatile # endif # ifdef M_LINT # define PP(x) () # define PV() () typedef char *Anyptr; # else # define PP(x) x /* function prototype */ # define PV() (void) /* null function prototype */ typedef void *Anyptr; # endif #else # define Signed # define Void void # ifndef Const # define Const # endif # ifndef Volatile # define Volatile # endif # define PP(x) () # define PV() () typedef char *Anyptr; #endif #ifdef __GNUC__ # define Inline inline #else # define Inline #endif #define Register register /* Register variables */ #define Char char /* Characters (not bytes) */ #ifndef Static # define Static static /* Private global funcs and vars */ #endif #ifndef Local # define Local static /* Nested functions */ #endif typedef Signed char schar; typedef unsigned char uchar; typedef unsigned char boolean; #ifndef NO_DECLARE_ALFA typedef Char alfa[10]; #endif #ifndef true # define true 1 # define false 0 #endif #ifndef TRUE # define TRUE 1 # define FALSE 0 #endif typedef struct { Anyptr proc, link; } _PROCEDURE; #ifndef _FNSIZE # define _FNSIZE 120 #endif extern Void PASCAL_MAIN PP( (int, Char **) ); extern Char **P_argv; extern int P_argc; extern short P_escapecode; extern int P_ioresult; extern __p2c_jmp_buf *__top_jb; #ifdef P2C_H_PROTO /* if you have Ansi C but non-prototyped header files */ extern Char *strcat PP( (Char *, Const Char *) ); extern Char *strchr PP( (Const Char *, int) ); extern int strcmp PP( (Const Char *, Const Char *) ); extern Char *strcpy PP( (Char *, Const Char *) ); extern size_t strlen PP( (Const Char *) ); extern Char *strncat PP( (Char *, Const Char *, size_t) ); extern int strncmp PP( (Const Char *, Const Char *, size_t) ); extern Char *strncpy PP( (Char *, Const Char *, size_t) ); extern Char *strrchr PP( (Const Char *, int) ); extern int atoi PP( (Const Char *) ); extern double atof PP( (Const Char *) ); extern long atol PP( (Const Char *) ); extern double strtod PP( (Const Char *, Char **) ); extern long strtol PP( (Const Char *, Char **, int) ); #endif /*P2C_H_PROTO*/ #ifndef HAS_STDLIB #ifndef NO_DECLARE_MALLOC extern Anyptr malloc PP( (size_t) ); extern Void free PP( (Anyptr) ); #endif #endif extern int _OutMem PV(); extern int _CaseCheck PV(); extern int _NilCheck PV(); extern int _Escape PP( (int) ); extern int _EscIO PP( (int) ); extern int _EscIO2 PP( (int, Char *) ); extern long ipow PP( (long, long) ); extern long P_imax PP( (long, long) ); extern long P_imin PP( (long, long) ); extern double P_rmax PP( (double, double) ); extern double P_rmin PP( (double, double) ); extern Char *strsub PP( (Char *, Char *, int, int) ); extern Char *strltrim PP( (Char *) ); extern Char *strrtrim PP( (Char *) ); extern Char *strrpt PP( (Char *, Char *, int) ); extern Char *strpad PP( (Char *, Char *, int, int) ); extern int strpos2 PP( (Char *, Char *, int) ); extern long memavail PV(); extern int P_peek PP( (FILE *) ); extern int P_eof PP( (FILE *) ); extern int P_eoln PP( (FILE *) ); extern Void P_readpaoc PP( (FILE *, Char *, int) ); extern Void P_readlnpaoc PP( (FILE *, Char *, int) ); extern long P_maxpos PP( (FILE *) ); extern Char *P_trimname PP( (Char *, int) ); extern long *P_setunion PP( (long *, long *, long *) ); extern long *P_setint PP( (long *, long *, long *) ); extern long *P_setdiff PP( (long *, long *, long *) ); extern long *P_setxor PP( (long *, long *, long *) ); extern int P_inset PP( (unsigned, long *) ); extern int P_setequal PP( (long *, long *) ); extern int P_subset PP( (long *, long *) ); extern long *P_addset PP( (long *, unsigned) ); extern long *P_addsetr PP( (long *, unsigned, unsigned) ); extern long *P_remset PP( (long *, unsigned) ); extern long *P_expset PP( (long *, long) ); extern long P_packset PP( (long *) ); extern FILE *_skipspaces PP( (FILE *) ); extern FILE *_skipnlspaces PP( (FILE *) ); /* I/O error handling */ #define _CHKIO(cond,ior,val,def) ((cond) ? P_ioresult=0,(val) \ : P_ioresult=(ior),(def)) #define _SETIO(cond,ior) (P_ioresult = (cond) ? 0 : (ior)) /* Following defines are suitable for the HP Pascal operating system */ #define FileNotFound 10 #define FileNotOpen 13 #define FileWriteError 38 #define BadInputFormat 14 #define EndOfFile 30 #define FILENOTFOUND 10 #define FILENOTOPEN 13 #define FILEWRITEERROR 38 #define BADINPUTFORMAT 14 #define ENDOFFILE 30 /* Creating temporary files */ #if (defined(BSD) || defined(NO_TMPFILE)) && !defined(HAVE_TMPFILE) # define tmpfile() (fopen(tmpnam(NULL), "w+")) #endif /* File buffers */ #define FILEBUF(f,sc,type) sc int __CAT__(f,_BFLAGS); \ sc type __CAT__(f,_BUFFER) #define FILEBUFNC(f,type) int __CAT__(f,_BFLAGS); \ type __CAT__(f,_BUFFER) #define RESETBUF(f,type) (__CAT__(f,_BFLAGS) = 1) #define SETUPBUF(f,type) (__CAT__(f,_BFLAGS) = 0) #define GETFBUF(f,type) (*((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(&__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ &__CAT__(f,_BUFFER))) #define AGETFBUF(f,type) ((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ __CAT__(f,_BUFFER)) #define PUTFBUF(f,type,v) (GETFBUF(f,type) = (v)) #define CPUTFBUF(f,v) (PUTFBUF(f,char,v)) #define GET(f,type) (__CAT__(f,_BFLAGS) == 1 ? \ fread(&__CAT__(f,_BUFFER),sizeof(type),1,(f)) : \ (__CAT__(f,_BFLAGS) = 1)) #define PUT(f,type) (fwrite(&__CAT__(f,_BUFFER),sizeof(type),1,(f)), \ (__CAT__(f,_BFLAGS) = 0)) #define CPUT(f) (PUT(f,char)) #define BUFEOF(f) (__CAT__(f,_BFLAGS) != 2 && P_eof(f)) #define BUFFPOS(f) (ftell(f) - (__CAT__(f,_BFLAGS) == 2)) typedef struct { FILE *f; int f_BFLAGS; /* FILEBUFNC(f,Char); */ Char f_BUFFER; Char name[_FNSIZE]; } _TEXT; /* Memory allocation */ #ifdef __GCC__ # define Malloc(n) (malloc(n) ?: (Anyptr)_OutMem()) #else extern Anyptr __MallocTemp__; # define Malloc(n) ((__MallocTemp__ = malloc(n)) ? __MallocTemp__ : (Anyptr)_OutMem()) #endif #define FreeR(p) (free((Anyptr)(p))) /* used if arg is an rvalue */ #define Free(p) (free((Anyptr)(p)), (p)=NULL) /* sign extension */ #define SEXT(x,n) ((x) | -(((x) & (1L<<((n)-1))) << 1)) /* packed arrays */ /* BEWARE: these are untested! */ #define P_getbits_UB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] >> \ (((~(i))&((1<<(L)-(n))-1)) << (n)) & \ (1<<(1<<(n)))-1)) #define P_getbits_SB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] << \ (16 - ((((~(i))&((1<<(L)-(n))-1))+1) <<\ (n)) >> (16-(1<<(n)))))) #define P_putbits_UB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ (x) << (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_putbits_SB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ ((x) & (1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_clrbits_B(a,i,n,L) ((a)[(i)>>(L)-(n)] &= \ ~( ((1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) ) /* small packed arrays */ #define P_getbits_US(v,i,n) ((int)((v) >> ((i)<<(n)) & (1<<(1<<(n)))-1)) #define P_getbits_SS(v,i,n) ((int)((long)(v) << (SETBITS - (((i)+1) << (n))) >> (SETBITS-(1<<(n))))) #define P_putbits_US(v,i,x,n) ((v) |= (x) << ((i) << (n))) #define P_putbits_SS(v,i,x,n) ((v) |= ((x) & (1<<(1<<(n)))-1) << ((i)<<(n))) #define P_clrbits_S(v,i,n) ((v) &= ~( ((1<<(1<<(n)))-1) << ((i)<<(n)) )) #define P_max(a,b) ((a) > (b) ? (a) : (b)) #define P_min(a,b) ((a) < (b) ? (a) : (b)) /* Fix ANSI-isms */ #ifdef LACK_LABS # ifndef labs # define labs my_labs extern long my_labs PP( (long) ); # endif #endif /* Fix toupper/tolower on Suns and other stupid BSD systems */ #ifdef toupper # undef toupper # undef tolower # define toupper(c) my_toupper(c) # define tolower(c) my_tolower(c) #endif #ifndef _toupper # if 'A' == 65 && 'a' == 97 # define _toupper(c) ((c)-'a'+'A') # define _tolower(c) ((c)-'A'+'a') # else # ifdef toupper # undef toupper /* hope these are shadowing real functions, */ # undef tolower /* because my_toupper calls _toupper! */ # endif # define _toupper(c) toupper(c) # define _tolower(c) tolower(c) # endif #endif #endif /* P2C_H */ /* End. */ /* Run-time library for use with "p2c", the Pascal to C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version --VERSION--. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #ifndef NO_TIME # include #endif #define Isspace(c) isspace(c) /* or "((c) == ' ')" if preferred */ int P_argc; char **P_argv; short P_escapecode; int P_ioresult; long EXCP_LINE; /* Used by Pascal workstation system */ Anyptr __MallocTemp__; __p2c_jmp_buf *__top_jb; void PASCAL_MAIN(argc, argv) int argc; char **argv; { P_argc = argc; P_argv = argv; __top_jb = NULL; #ifdef LOCAL_INIT LOCAL_INIT(); #endif } /* In case your system lacks these... */ long my_labs(x) long x; { return((x > 0) ? x : -x); } int my_toupper(c) int c; { if (islower(c)) return _toupper(c); else return c; } int my_tolower(c) int c; { if (isupper(c)) return _tolower(c); else return c; } long ipow(a, b) long a, b; { long v; if (a == 0 || a == 1) return a; if (a == -1) return (b & 1) ? -1 : 1; if (b < 0) return 0; if (a == 2) return 1L << b; v = (b & 1) ? a : 1; while ((b >>= 1) > 0) { a *= a; if (b & 1) v *= a; } return v; } long P_imax(a, b) long a, b; { if (a > b) return a; else return b; } long P_imin(a, b) long a, b; { if (a < b) return a; else return b; } double P_rmax(a, b) double a, b; { if (a > b) return a; else return b; } double P_rmin(a, b) double a, b; { if (a < b) return a; else return b; } /* Common string functions: */ /* Store in "ret" the substring of length "len" starting from "pos" (1-based). Store a shorter or null string if out-of-range. Return "ret". */ char *strsub(ret, s, pos, len) register char *ret, *s; register int pos, len; { register char *s2; if (--pos < 0 || len <= 0) { *ret = 0; return ret; } while (pos > 0) { if (!*s++) { *ret = 0; return ret; } pos--; } s2 = ret; while (--len >= 0) { if (!(*s2++ = *s++)) return ret; } *s2 = 0; return ret; } /* Return the index of the first occurrence of "pat" as a substring of "s", starting at index "pos" (1-based). Result is 1-based, 0 if not found. */ int strpos2(s, pat, pos) char *s; register char *pat; register int pos; { register char *cp, ch; register int slen; if (--pos < 0) return 0; slen = (int)strlen(s) - pos; cp = s + pos; if (!(ch = *pat++)) return 0; pos = (int)strlen(pat); slen -= pos; while (--slen >= 0) { if (*cp++ == ch && !strncmp(cp, pat, (size_t)pos)) return cp - s; } return 0; } /* Case-insensitive version of strcmp. */ int strcicmp(s1, s2) register char *s1, *s2; { register unsigned char c1, c2; while (*s1) { if (*s1++ != *s2++) { if (!s2[-1]) return 1; c1 = (unsigned char)toupper(s1[-1]); c2 = (unsigned char)toupper(s2[-1]); if (c1 != c2) return c1 - c2; } } if (*s2) return -1; return 0; } /* HP and Turbo Pascal string functions: */ /* Trim blanks at left end of string. */ char *strltrim(s) register char *s; { while (Isspace(*s++)) ; return s - 1; } /* Trim blanks at right end of string. */ char *strrtrim(s) register char *s; { register char *s2 = s; if (!*s) return s; while (*++s2) ; while (s2 > s && Isspace(*--s2)) *s2 = 0; return s; } /* Store in "ret" "num" copies of string "s". Return "ret". */ char *strrpt(ret, s, num) char *ret; register char *s; register int num; { register char *s2 = ret; register char *s1; while (--num >= 0) { s1 = s; while ((*s2++ = *s1++)) ; s2--; } return ret; } /* Store in "ret" string "s" with enough pad chars added to reach "size". */ char *strpad(ret, s, padchar, num) char *ret; register char *s; register int padchar, num; { register char *d = ret; if (s == d) { while (*d++) ; } else { while ((*d++ = *s++)) ; } num -= (--d - ret); while (--num >= 0) *d++ = padchar; *d = 0; return ret; } /* Copy the substring of length "len" from index "spos" of "s" (1-based) to index "dpos" of "d", lengthening "d" if necessary. Length and indices must be in-range. */ void strmove(len, s, spos, d, dpos) register char *s, *d; register int len, spos, dpos; { s += spos - 1; d += dpos - 1; while (*d && --len >= 0) *d++ = *s++; if (len > 0) { while (--len >= 0) *d++ = *s++; *d = 0; } } /* Delete the substring of length "len" at index "pos" from "s". Delete less if out-of-range. */ void strdelete(s, pos, len) register char *s; register int pos, len; { register int slen; if (--pos < 0) return; slen = (int)strlen(s) - pos; if (slen <= 0) return; s += pos; if (slen <= len) { *s = 0; return; } while ((*s = s[len])) s++; } /* Insert string "src" at index "pos" of "dst". */ void strinsert(src, dst, pos) register char *src, *dst; register int pos; { register int slen, dlen; if (--pos < 0) return; dlen = (int)strlen(dst); dst += dlen; dlen -= pos; if (dlen <= 0) { strcpy(dst, src); return; } slen = (int)strlen(src); do { dst[slen] = *dst; --dst; } while (--dlen >= 0); dst++; while (--slen >= 0) *dst++ = *src++; } /* File functions */ /* Peek at next character of input stream; return EOF at end-of-file. */ int P_peek(f) FILE *f; { int ch; ch = getc(f); if (ch == EOF) return EOF; ungetc(ch, f); return (ch == '\n') ? ' ' : ch; } /* Check if at end of file, using Pascal "eof" semantics. End-of-file for stdin is broken; remove the special case for it to be broken in a different way. */ int P_eof(f) FILE *f; { register int ch; if (feof(f)) return 1; #ifdef HAVE_ISATTY if (isatty(fileno(f))) #else if (f == stdin) #endif return 0; /* not safe to look-ahead on the keyboard! */ ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return 0; } /* Check if at end of line (or end of entire file). */ int P_eoln(f) FILE *f; { register int ch; ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return (ch == '\n'); } /* Skip whitespace (including newlines) in a file. */ FILE *_skipnlspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t' || ch == '\n'); if (ch != EOF) ungetc(ch, f); return f; } /* Skip whitespace (not including newlines) in a file. */ FILE *_skipspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t'); if (ch != EOF) ungetc(ch, f); return f; } /* Read a packed array of characters from a file. */ Void P_readpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { if (len <= 0) return; ch = getc(f); if (ch == EOF || ch == '\n') break; *s++ = ch; --len; } while (--len >= 0) *s++ = ' '; if (ch != EOF) ungetc(ch, f); } Void P_readlnpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { ch = getc(f); if (ch == EOF || ch == '\n') break; if (len > 0) { *s++ = ch; --len; } } while (--len >= 0) *s++ = ' '; } /* Compute maximum legal "seek" index in file (0-based). */ long P_maxpos(f) FILE *f; { long savepos = ftell(f); long val; if (fseek(f, 0L, SEEK_END)) return -1; val = ftell(f); if (fseek(f, savepos, SEEK_SET)) return -1; return val; } /* Use packed array of char for a file name. */ Char *P_trimname(fn, len) register Char *fn; register int len; { static Char fnbuf[256]; register Char *cp = fnbuf; while (--len >= 0 && *fn && !isspace(*fn)) *cp++ = *fn++; *cp = 0; return fnbuf; } /* Pascal's "memavail" doesn't make much sense in Unix with virtual memory. We fix memory size as 10Meg as a reasonable compromise. */ long memavail() { return 10000000; /* worry about this later! */ } long maxavail() { return memavail(); } /* Sets are stored as an array of longs. S[0] is the size of the set; S[N] is the N'th 32-bit chunk of the set. S[0] equals the maximum I such that S[I] is nonzero. S[0] is zero for an empty set. Within each long, bits are packed from lsb to msb. The first bit of the set is the element with ordinal value 0. (Thus, for a "set of 5..99", the lowest five bits of the first long are unused and always zero.) */ /* (Sets with 32 or fewer elements are normally stored as plain longs.) */ long *P_setunion(d, s1, s2) /* d := s1 + s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ | *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; *dbase = d - dbase - 1; return dbase; } long *P_setint(d, s1, s2) /* d := s1 * s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setdiff(d, s1, s2) /* d := s1 - s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & ~*s2++; if (sz1 >= 0) { while (sz1-- >= 0) *d++ = *s1++; } while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setxor(d, s1, s2) /* d := s1 / s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ ^ *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } int P_inset(val, s) /* val IN s */ register unsigned val; register long *s; { register int bit; bit = (int) (val % SETBITS); val /= SETBITS; if ((long)val < *s++ && ((1L<(unsigned) size) { s += size; while (val > (unsigned)size) *++s = 0, size++; *sbase = size; } else s += val; *s |= 1L< (int)v2) return sbase; b1 = (int) (v1 % SETBITS); v1 /= SETBITS; b2 = (int) (v2 % SETBITS); v2 /= SETBITS; size = *s; v1++; if (++v2 > (unsigned)size) { while (v2 > (unsigned)size) s[++size] = 0; s[v2] = 0; *s = (long)v2; } s += v1; if (v1 == v2) { *s |= (~((-2L)<<(b2-b1))) << b1; } else { *s++ |= (-1L) << b1; while (++v1 < v2) *s++ = -1; *s |= ~((-2L) << b2); } return sbase; } long *P_remset(s, val) /* s := s - [val] */ register long *s; register unsigned val; { register int bit; bit = (int) (val % SETBITS); val /= SETBITS; if ((long)++val <= *s) { if (!(s[val] &= ~(1L<= 0) { if (*s1++ != *s2++) return 0; } return 1; } int P_subset(s1, s2) /* s1 <= s2 */ register long *s1, *s2; { register int sz1 = *s1++, sz2 = *s2++; if (sz1 > sz2) return 0; while (--sz1 >= 0) { if (*s1++ & ~*s2++) return 0; } return 1; } /* s is a "smallset", i.e., a 32-bit or less set stored directly in a long. */ long *P_expset(d, s) /* d := s */ register long *d; register long s; { if (s) { d[1] = s; *d = 1; } else *d = 0; return d; } long P_packset(s) /* convert s to a small-set */ register long *s; { if (*s++) return *s; else return 0; } int _OutMem() { return _Escape(-2); } int _CaseCheck() { return _Escape(-9); } int _NilCheck() { return _Escape(-3); } /* The following is suitable for the HP Pascal operating system. It might want to be revised when emulating another system. */ char *_ShowEscape(buf, code, ior, prefix) char *buf, *prefix; int code, ior; { char *bufp; if (prefix && *prefix) { strcpy(buf, prefix); strcat(buf, ": "); bufp = buf + strlen(buf); } else { bufp = buf; } if (code == -10) { snprintf(bufp,80, "Pascal system I/O error %d", ior); switch (ior) { case 3: strcat(buf, " (illegal I/O request)"); break; case 7: strcat(buf, " (bad file name)"); break; case FileNotFound: /*10*/ strcat(buf, " (file not found)"); break; case FileNotOpen: /*13*/ strcat(buf, " (file not open)"); break; case BadInputFormat: /*14*/ strcat(buf, " (bad input format)"); break; case 24: strcat(buf, " (not open for reading)"); break; case 25: strcat(buf, " (not open for writing)"); break; case 26: strcat(buf, " (not open for direct access)"); break; case 28: strcat(buf, " (string subscript out of range)"); break; case EndOfFile: /*30*/ strcat(buf, " (end-of-file)"); break; case FileWriteError: /*38*/ strcat(buf, " (file write error)"); break; } } else { snprintf(bufp,80, "Pascal system error %d", code); switch (code) { case -2: strcat(buf, " (out of memory)"); break; case -3: strcat(buf, " (reference to NIL pointer)"); break; case -4: strcat(buf, " (integer overflow)"); break; case -5: strcat(buf, " (divide by zero)"); break; case -6: strcat(buf, " (real math overflow)"); break; case -8: strcat(buf, " (value range error)"); break; case -9: strcat(buf, " (CASE value range error)"); break; case -12: strcat(buf, " (bus error)"); break; case -20: strcat(buf, " (stopped by user)"); break; } } return buf; } int _Escape(code) int code; { char buf[100]; P_escapecode = code; if (__top_jb) { __p2c_jmp_buf *jb = __top_jb; __top_jb = jb->next; longjmp(jb->jbuf, 1); } if (code == 0) exit(EXIT_SUCCESS); if (code == -1) exit(EXIT_FAILURE); fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } int _EscIO(code) int code; { P_ioresult = code; return _Escape(-10); } int _EscIO2(code, name) int code; char *name; { P_ioresult = code; if (!__top_jb && name && *name) { char buf[100]; fprintf(stderr, "%s: %s\n", name, _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } return _Escape(-10); } /* End. */ typedef struct TPoint { long X, Y, C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, Ag, As,Au, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, Hf, Hg, In, Ir, Li, Lu, Mg, Mn, Mo, Na, Nb, Ni, Os, K, Pb, Pd, Pt, Rb, Re, Rh, Ru, Sb, Sc, Se, Sn, Sr, Ta, Te, Ti, Tl, V, W, Ytt, Zn, Zr, RecCount; struct TPoint *Last; } TPoint; typedef struct TBond { long X1, Y1, X2, Y2, RecCount; struct TBond *Last; } TBond; Static long C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, Ag, As, Au, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, Hf, Hg, In, Ir, Li, Lu, Mg, Mn, Mo, Na, Nb, Ni, Os, K, Pb, Pd, Pt, Rb, Re, Rh, Ru, Sb, Sc, Se, Sn, Sr, Ta, Te, Ti, Tl, V, W, Ytt, Zn, Zr, X1, X2, Y1, Y2, T, D; Static FILE *IFile; Static TPoint *Point, *Last, *Current; Static TBond *Bond, *LastB, *CurrentB; Static Char sss[256], A[256], subs[256], Alert[256]; Static Char sssb[7]; Static double M, Me; Static Char separator; Static long Count, code, atoms, rep, range, bonds; Static boolean Abandon, debug, verbose, fa, nobonds; Static long Sensi = 5; /*bonds and labels joint precision sensitivity*/ Static Char IFile_NAME[_FNSIZE]; Static Void doBonds() { do { if (!fgets(sss,256,IFile)) return; sscanf(sss, "%ld%ld%ld%ld%ld%ld%*[^\n]", &X1, &Y1, &X2, &Y2, &T, &D); /*getc(IFile);*/ bonds--; if (debug) printf("%ld; %ld; %ld; %ld; %ld; %ld\n", X1, Y1, X2, Y2, T, D); if (D == 1 || T == 8){ if (debug) printf("skipped\n"); continue; } if (debug) printf("parsed\n"); if (T == 11) range = ((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2)) * 4; LastB = Bond; Bond = (TBond *)malloc(sizeof(TBond)); if (Bond == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Bond->X1 = X1; Bond->X2 = X2; Bond->Y1 = Y1; Bond->Y2 = Y2; Bond->Last = LastB; CurrentB = Bond; Bond = Bond->Last; while (Bond->Last != NULL) { if ((labs(Bond->X1 - X1) < Sensi && labs(Bond->Y1 - Y1) < Sensi && labs(Bond->X2 - X2) < Sensi && labs(Bond->Y2 - Y2) < Sensi) || (labs(Bond->X2 - X1) < Sensi && labs(Bond->Y2 - Y1) < Sensi && labs(Bond->X1 - X2) < Sensi && labs(Bond->Y1 - Y2) < Sensi)) { if (debug) printf(" ! Bond overlap\n"); strcat(Alert, "!"); } Bond = Bond->Last; } Bond = CurrentB; Abandon = false; Current = Point; while (Point->Last != NULL) { if (T == 11) { Abandon = true; if ((Point->X - X1) * (Point->X - X1) + (Point->Y - Y1) * (Point->Y - Y1) < range) { if (Point->H > 0) Point->H--; if (debug) printf("Ring --> stripped one H from %ld %ld\n", Point->X, Point->Y); } } else { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X1, Y1); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X1; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y1; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } if (T != 11) { Abandon = false; Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X2) < Sensi && labs(Point->Y - Y2) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X2, Y2); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X2; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y2; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } } } while (bonds != 0); } Static Void doLabels() { long mul, gmul, gmpos, ggmul, ggmpos; boolean stripped; Char STR2[256]; long FORLIM; Char *TEMP; if (debug) printf("---- and now parse the labels ---------\n"); if (verbose) printf("HeteroAtoms: %ld\n", atoms); FORLIM = atoms; for (rep = 1; rep <= FORLIM; rep++) { if (fscanf(IFile, "%ld%ld%c", &X1, &Y1, &separator)<2) return; if (!fgets(sss, 256, IFile))return; TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; snprintf(A,256, "%.*s", strpos2(sss, "\t", 1) - 1, sss); if (debug) printf("Atom %s X=%ld Y=%ld sss: %s\n", A, X1, Y1, sss); if (nobonds) { /*initialize the Point structure if no bonds, only labels, defined*/ Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X1; Point->Y = Y1; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; Point->Last = Last; } Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" [%ld]\n", Point->RecCount); Point->C = 0; /*we substitute -CH_x(-) by -R(-)*/ Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; mul = 1; gmul = 1; ggmul = 1; while (*A != '\0') { stripped = false; if ((int)strlen(A) >= 5) { snprintf(subs,256, "%.5s", A); if ((int)strlen(A) > 6) { if (A[5] == '_') { if (A[6]!= '{') { snprintf(STR2,256, "%c", A[6]); if (A[7]=='_') snprintf(STR2,256, "%c%c", A[6],A[8]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=7; while(A[mul]!='}'){STR2[mul-7]=A[mul]; mul++ ; } STR2[mul-6]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "TBDMS")) { /*Tert-butyldimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 15; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (!strcmp(subs, "TBDPS")) { /*Tert-butyldiphenylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 16; Point->H += mul * 19; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (A[0] == '[') { ggmpos = strpos2(A, "]", 1); if (ggmpos != 0) { if (A[ggmpos] == '_') { if (A[ggmpos+1]!= '{') { snprintf(STR2,256, "%c", A[ggmpos+1]); if (A[ggmpos+2]=='_') snprintf(STR2,256, "%c%c", A[ggmpos+1],A[ggmpos+3]); code = (sscanf(STR2, "%ld", &ggmul) == 0); }else{ ggmul=ggmpos+2; while(A[ggmul]!='}'){STR2[ggmul-ggmpos-2]=A[ggmul]; ggmul++ ; } STR2[ggmul-ggmpos-1]='\0'; code = (sscanf(STR2, "%ld", &ggmul) == 0); } } else ggmul = 1; } } if (A[0] == '(') { gmpos = strpos2(A, ")", 1); if (gmpos != 0) { if (A[gmpos] == '_') { if (A[gmpos+1]!= '{') { snprintf(STR2,256, "%c", A[gmpos+1]); if (A[gmpos+2]=='_') snprintf(STR2,256, "%c%c", A[gmpos+1],A[gmpos+3]); code = (sscanf(STR2, "%ld", &gmul) == 0); }else{ gmul=gmpos+2; while(A[gmul]!='}'){STR2[gmul-gmpos-2]=A[gmul]; gmul++ ; } STR2[gmul-gmpos-1]='\0'; code = (sscanf(STR2, "%ld", &gmul) == 0); } } else gmul = 1; } } } if ((int)strlen(A) >= 4 && !stripped) { snprintf(subs,256, "%.4s", A); if ((int)strlen(A) > 5) { if (A[4] == '_') { if (A[5]!= '{') { snprintf(STR2,256, "%c", A[5]); if (A[6]=='_') snprintf(STR2,256, "%c%c", A[5],A[7]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=6; while(A[mul]!='}'){STR2[mul-6]=A[mul]; mul++ ; } STR2[mul-5]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "DBAM")) { /*dibutylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 9; Point->H += mul * 19; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMAM")) { /*dimethylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMTr")) { /*dimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 21; Point->H += mul * 19; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "MMTr")) { /*monomethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 20; Point->H += mul * 16; Point->O += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "TMTr")) { /*trimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 22; Point->H += mul * 22; Point->O += mul * 3; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } } if ((int)strlen(A) >= 3 && !stripped) { snprintf(subs,256, "%.3s", A); if ((int)strlen(A) > 4) { if (A[3] == '_') { if (A[4]!= '{') { snprintf(STR2,256, "%c", A[4]); if (A[5]=='_') snprintf(STR2,256, "%c%c", A[4],A[6]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=5; while(A[mul]!='}'){STR2[mul-5]=A[mul]; mul++ ; } STR2[mul-4]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ade")) { /*Adeninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "BOC")) { /*Butyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 9; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Cyt")) { /*Cytosinyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 4; Point->N += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Gua")) { /*Guaninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iBu")) { /*iso-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iPr")) { /*2-Propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOC")) { /*Methoxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOM")) { /*Methoxymethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "tBu")) { /*t-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Thy")) { /*Thyminyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 5; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "TMS")) { /*Trimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 9; Point->Si += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Tol")) { /*tolyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Ura")) { /*Uracilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 3; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } } if ((int)strlen(A) >= 2 && !stripped) { snprintf(subs,256, "%.2s", A); if ((int)strlen(A) > 3) { if (A[2] == '_') { if (A[3]!= '{') { snprintf(STR2,256, "%c", A[3]); if (A[4]=='_') snprintf(STR2,256, "%c%c", A[3],A[5]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=4; while(A[mul]!='}'){STR2[mul-4]=A[mul]; mul++ ; } STR2[mul-3]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ac")) { /*acetyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Al")) { /*alumin(i)um*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Al += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ag")) { /*silver*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ag += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "As")) { /*arsenic*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->As += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Au")) { /*gold*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Au += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ba")) { /*barium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ba += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Be")) { /*beryllium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Be += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bi")) { /*bismuth*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Bi += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bn")) { /*benzyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Br")) { /*bromine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Br += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bu")) { /*butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bz")) { /*benzoyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "CE")) { /*cyanoethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 4; Point->N += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cl")) { /*chlorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ca")) { /*calcium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ca += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cd")) { /*cadmium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cd += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Co")) { /*cobalt*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Co += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cr")) { /*chromium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cs")) { /*cesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cs += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cu")) { /*copper*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cu += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Et")) { /*ethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Fe")) { /*iron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Fe += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ga")) { /*gallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ga += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ge")) { /*germanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ge += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Hf")) { /*hafnium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Hf += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Hg")) { /*mercury*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Hg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "In")) { /*indium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->In += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ir")) { /*iridium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ir += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Li")) { /*lithium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Li += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Lu")) { /*lutetium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Lu += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Me")) { /*methyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ms")) { /*methanesulfonyl, mesyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mg")) { /*magnesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mn")) { /*manganese*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mo")) { /*molybdenum*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mo += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Na")) { /*sodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Na += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Nb")) { /*niobium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Nb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ni")) { /*nickel*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ni += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Os")) { /*osmium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Os += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pb")) { /*lead*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pd")) { /*palladium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pd += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ph")|| !strcmp(subs,"@F")) { /*phenyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pr")) { /*propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pt")) { /*platinum*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pt += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Rb")) { /*rubidium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Rb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Re")) { /*rhenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Re += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Rh")) { /*rhodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Rh += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ru")) { /*ruthenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ru += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sb")) { /*antimony*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sc")) { /*scandium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sc += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Se")) { /*selenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Se += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sn")) { /*tin*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sr")) { /*strontium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ta")) { /*tantal*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ta += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Te")) { /*tellurium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Te += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ti")) { /*titanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ti += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tf")) { /*trifluoromethanesulfonyl, triflyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->F += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tl")) { /*thallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Tl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tr")) { /*trityl, triphenylmethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 19; Point->H += mul * 15; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ts")) { /*toluenesulfonyl, tosyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Si")) { /*silicon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Si += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Zn")) { /*zinc*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Zn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Zr")) { /*zirconium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Zr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } } if ((int)strlen(A) < 1 || stripped) continue; snprintf(subs,256, "%.1s", A); if ((int)strlen(A) > 2) { if (A[1] == '_') { if (A[2]!= '{') { snprintf(STR2,256, "%c", A[2]); if (A[3]=='_') snprintf(STR2,256, "%c%c", A[2],A[4]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=3; while(A[mul]!='}'){STR2[mul-3]=A[mul]; mul++ ; } STR2[mul-2]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "B")) { /*boron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->B += mul; } if (!strcmp(subs, "C")) { /*carbon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; } if (!strcmp(subs, "F")) { /*fluorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->F += mul; } if (!strcmp(subs, "H")) { /*hydrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->H += mul; } if (!strcmp(subs, "I")) { /*iodine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->I += mul; } if (!strcmp(subs, "K")) { /*potassium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->K += mul; } if (!strcmp(subs, "N")) { /*nitrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->N += mul; } if (!strcmp(subs, "O")) { /*oxygen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->O += mul; } if (!strcmp(subs, "P")) { /*phosphorus*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->P += mul; } if (!strcmp(subs, "S")) { /*sulfur*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->S += mul; } if (!strcmp(subs, "V")) { /*vanadium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->V += mul; } if (!strcmp(subs, "W")) { /*tungsten*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->W += mul; } if (!strcmp(subs, "Y")) { /*yttrium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ytt += mul; } if (!strcmp(subs, "Z")) { /*"Z", Benzyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul * 2; } if (!strcmp(subs, ")")) /*reset gmul*/ gmul = 1; if (!strcmp(subs, "]")) { /*reset gmul,ggmul*/ gmul = 1; ggmul = 1; } if (true) strcpy(A, strsub(STR2, A, 2, (int)(strlen(A) - 1))); } } Point = Point->Last; } Point = Current; } } int main(argc, argv) int argc; Char *argv[]; { Char STR1[256], STR2[256]; Char *TEMP; boolean interactive=false; PASCAL_MAIN(argc, argv); IFile = NULL; if (P_argc == 1) { printf("enter \"cht -h\" for help\n"); _Escape(0); } C = 0; H = 0; N = 0; O = 0; P = 0; S = 0; Si = 0; B = 0; Br = 0; I = 0; Cl = 0; F = 0; Al = 0; Ag = 0; As = 0; Au = 0; Ba = 0; Be = 0; Bi = 0; Ca = 0; Cd = 0; Co = 0; Cr = 0; Cs = 0; Cu = 0; Fe = 0; Ga = 0; Ge = 0; Hf = 0; Hg = 0; In = 0; Ir = 0; Li = 0; Lu = 0; Mg = 0; Mn = 0; Mo = 0; Na = 0; Nb = 0; Ni = 0; Os = 0; K = 0; Pb = 0; Pd = 0; Pt = 0; Rb = 0; Re = 0; Rh = 0; Ru = 0; Sb = 0; Sc = 0; Se = 0; Sn = 0; Sr = 0; Ta = 0; Te = 0; Ti = 0; Tl = 0; V = 0; W = 0; Ytt = 0; Zn = 0; Zr = 0; verbose = false; debug = false; fa = false; /*no file assigned*/ Count = 0; *Alert = '\0'; for (rep = 1; rep < P_argc; rep++) { if (!strcmp(strcpy(STR2, P_argv[rep]), "-v") || !strcmp(strcpy(STR1, P_argv[rep]), "--verbose")) verbose = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-d") || !strcmp(strcpy(STR1, P_argv[rep]), "--debug")) debug = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-i") || !strcmp(strcpy(STR1, P_argv[rep]), "--interpret")) interactive = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-h") || !strcmp(strcpy(STR1, P_argv[rep]), "--help")) { printf("The Chemtool drawings analyzer 1.7\n"); printf("*** Gizmo Head Software ***\n"); printf(" Radek Liboska (c) 2001\n\n"); printf("syntax: cht [-options] \n\n"); printf("Recognizes C,H,O,N,P,S,Si,B,Br,I,Cl,F,Al,Ag,As,Au,Ba,Be,Bi,Ca,Cd,Co,Cr,Cs,Cu,\nFe,Ga,Ge,Hf,Hg,In,Ir,Li,Lu,Mg,Mn,Mo,Na,Nb,Ni,Os,K,Pb,Pd,Pt,Rb,Re,Rh,Ru,Sb,Sc,Se,Sn,Sr,\nTa,Te,Ti,Tl,V,W,Y,Zn,Zr\n"); printf( " Ac,Ade,Bn,Bu,Bz,BOC,Cyt,CE,DBAM,DMAM,DMTr,Et,Gua,iBu,iPr,Me,Ms,MOC,\n"); printf( " MOM,MMTr,Ph,Pr,tBu,Tf,Thy,Tol,Tr,Ts,TBDMS,TBDPS,TMS,TMTr,Ura,Z\n"); printf("Can handle two levels of parentheses; e.g. P[OCH(CH_3)_2]_3\n\n"); printf("options:\n"); printf(" -h or --help : this help\n"); printf(" -v or --verbose : be verbose\n"); printf(" -d or --debug : be more verbose\n\n"); _Escape(0); } if (strcpy(STR2, P_argv[rep])[0] != '-') { strcpy(STR1, P_argv[rep]); strcpy(IFile_NAME, STR1); fa = true; } } if (!fa && !interactive) { printf("No file defined, enter \"cht -h\" for help\n"); _Escape(1); } if (!interactive){ if (IFile != NULL) IFile = freopen(IFile_NAME, "r", IFile); else IFile = fopen(IFile_NAME, "r"); if (IFile == NULL) _EscIO2(FileNotFound, IFile_NAME); }else { if (IFile)fclose(IFile); IFile=tmpfile(); fprintf(IFile,"Chemtool Version 1.0\ngeometry 100 100\n\bonds 0\natoms 1\n0 0 %s 0\n",IFile_NAME); rewind(IFile); } Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = 0; Point->Y = 0; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; Point->Last = NULL; Bond = (TBond *)malloc(sizeof(TBond)); if (Bond == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Bond->X1 = 0; Bond->Y1 = 0; Bond->X2 = 0; Bond->Y2 = 0; Bond->RecCount = Count; Bond->Last = NULL; if (!fgets(sss, 256, IFile))exit(2); TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; snprintf(sss,256, "%.18s", strcpy(STR1, sss)); if (strcmp(sss, "Chemtool Version 1")) { printf("Not a chemtool 1.x file, enter \"cht -h\" for help\n"); printf("file starts: %s\n",sss); _Escape(2); } if (fscanf(IFile, "%*[^\n]") == EOF) exit(2); getc(IFile); if (!fgets(sssb, 7, IFile))exit(2); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } if (fscanf(IFile, "%ld%*[^\n]", &bonds) == EOF) bonds = 0; getc(IFile); if (bonds == 0) nobonds = true; if (!strcmp(sssb, "bonds ")) { if (bonds > 0) doBonds(); } if (!fgets(sssb, 7, IFile))exit(2); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } if (fscanf(IFile, "%ld%*[^\n]", &atoms) == EOF) atoms = 0; getc(IFile); if (!strcmp(sssb, "atoms ")) { if (atoms > 0) doLabels(); } if (IFile != NULL) fclose(IFile); IFile = NULL; if (verbose) printf("---------------------- Summary -------------------------\n"); while (Point->Last != NULL) { if (verbose) printf( "RecCount: %ld X=%ld Y=%ld C%ld H%ld N%ld O%ld P%ld S%ld Si%ld B%ld\nBr%ld Cl%ld F%ld I%ld Al%ld Ag%ld As%ld Au%ld Ba%ld Be%ld Bi%ld Ca%ld Cd%ld Co%ld\nCr%ld Cs%ld Cu%ld Fe%ld Ga%ld Ge%ld Hf%ld Hg%ld In%ld Ir%ld Li%ld Lu%ld Mg%ld Mn%ld\n Mo%ld Na%ld Nb%ld Ni%ld Os%ld K%ld Pb%ld Pd%ld Pt%ld Rb%ld Re%ld Rh%ld Ru%ld Sb%ld\n Sc%ld Se%ld Sn%ld Sr%ld Ta%ld Te%ld Ti%ld Tl%ld V%ld W%ld Y%ld Zn%ld Zr%ld\n", Point->RecCount, Point->X, Point->Y, Point->C, Point->H, Point->N, Point->O, Point->P, Point->S, Point->Si, Point->B, Point->Br, Point->Cl, Point->F, Point->I, Point->Al, Point->Ag, Point->As, Point->Au, Point->Ba, Point->Be,Point->Bi, Point->Ca, Point->Cd, Point->Co, Point->Cr, Point->Cs,Point->Cu,Point->Fe,Point->Ga,Point->Ge,Point->Hf,Point->Hg, Point->In, Point->Ir, Point->Li,Point->Lu,Point->Mg, Point->Mn, Point->Mo, Point->Na, Point->Nb,Point->Ni, Point->Os,Point->K,Point->Pb,Point->Pd, Point->Pt, Point->Rb, Point->Re, Point->Rh, Point->Ru, Point->Sb,Point->Sc,Point->Se,Point->Sn,Point->Sr,Point->Ta, Point->Te,Point->Ti,Point->Tl,Point->V,Point->W,Point->Ytt,Point->Zn,Point->Zr); C += Point->C; H += Point->H; N += Point->N; O += Point->O; P += Point->P; S += Point->S; Si += Point->Si; B += Point->B; Br += Point->Br; Cl += Point->Cl; F += Point->F; I += Point->I; Al += Point->Al; Ag += Point->Ag; As += Point->As; Au += Point->Au; Ba += Point->Ba; Be += Point->Be; Bi += Point->Bi; Ca += Point->Ca; Cd += Point->Cd; Co += Point->Co; Cr += Point->Cr; Cs += Point->Cs; Cu += Point->Cu; Fe += Point->Fe; Ga += Point->Ga; Ge += Point->Ge; Hf += Point->Hf; Hg += Point->Hg; In += Point->In; Ir += Point->Ir; Li += Point->Li; Lu += Point->Lu; Mg += Point->Mg; Mn += Point->Mn; Mo += Point->Mo; Na += Point->Na; Nb += Point->Nb; Ni += Point->Ni; Os += Point->Os; K += Point->K; Pb += Point->Pb; Pd += Point->Pd; Pt += Point->Pt; Rb += Point->Rb; Re += Point->Re; Rh += Point->Rh; Ru += Point->Ru; Sb += Point->Sb; Sc += Point->Sc; Se += Point->Se; Sn += Point->Sn; Sr += Point->Sr; Ta += Point->Ta; Te += Point->Te; Ti += Point->Ti; Tl += Point->Tl; V += Point->V; W += Point->W; Ytt += Point->Ytt; Zn += Point->Zn; Zr += Point->Zr; Point = Point->Last; } if (H < 0) /*overlapped bonds*/ H = 0; M = (double)C * 12.011 + (double)H * 1.0079 + (double)N * 14.0067 + (double)O * 15.9994 + (double)P * 30.97376 + (double)S * 32.064 + (double)Si * 28.086 + (double)B * 10.81 + (double)Br * 79.904 + (double)Cl * 35.453 + (double)F * 18.9984 + (double)I * 126.9045 + (double)Mg * 24.305 + (double)Na * 22.98977 + (double)K * 39.098 + (double)Ca * 40.08 + (double)Cd * 112.41 + (double)Co * 58.933 + (double)Cr * 51.996 + (double)Cu * 63.546 + (double)Fe * 55.847 + (double)Li * 6.941 + (double)Mn * 54.938 + (double)Ni * 58.69 + (double)Al * 26.981539 + (double)Ba * 137.327 + (double)Cs * 132.90543 + (double)As * 74.92159 + (double)Be *9.012182 + (double)Ga * 69.723 + (double)Ge * 72.61 + (double)Sb * 121.75 + (double)Sc * 44.95591 + (double)Se * 78.96 + (double)Sn * 118.710 + (double)Sr * 87.62 + (double)Rb * 85.4678 + (double)Te * 127.60 + (double)Ti * 47.88 + (double)V * 50.9415 + (double)Zn * 65.39 + (double)In * 114.82 + (double)Bi * 208.98037 + (double)Pb *207.2 + (double)Tl * 204.3833 + (double)Zr *91.224 + (double)Nb * 92.906 + (double)Mo*95.94 + (double)Ru * 101.07 + (double)Rh *102.9055 + (double)Re * 186.207 + (double)Pd *106.42 + (double)Ag *107.868 + (double)Pt *195.078 + (double)Ir * 192.217 + (double)Hg * 200.59 + (double)Os *190.2 + (double)W * 183.84 + (double)Au * 196.966 + (double)Ta *180.948 + (double)Hf * 178.49 + (double)Ytt * 88.906 + (double)Lu *174.967; Me = (double)C * 12. + (double)H * 1.007825037 + (double)N * 14.003074008 + (double)O * 15.99491464 + (double)P * 30.9737634 + (double)S * 31.9720718 + (double)Si * 27.9769284 + (double)B * 11.0093053 + (double)Br * 78.9183361 + (double)Cl * 34.968852729 + (double)F * 18.99840325 + (double)I * 126.904477 + (double)Mg * 23.9850450 + (double)Na * 22.9897697 + (double)K * 38.9637079 + (double)Ca * 39.9626 + (double)Cd * 113.9034 + (double)Co * 58.9332 + (double)Cr * 51.9405 + (double)Cu * 62.9296 + (double)Fe * 55.9349 +(double)Li * 7.0160 + (double)Mn * 54.93805 + (double)Ni * 57.9353 + (double)Al * 26.981539 + (double)Ba * 137.9052 + (double)Cs * 132.90543 + (double)As * 74.92159 + (double)Be * 9.012182 + (double)Ga * 68.9256 + (double)Ge * 73.9212 + (double)Sb * 120.9038 + (double)Sc * 44.95591 + (double)Se *79.9165 + (double)Sn * 119.9022 + (double)Sr * 87.9056 + (double)Rb * 84.9118 + (double)Te * 129.9062 + (double)Ti * 47.9479 + (double)V * 50.9440 + (double)Zn * 63.9291 + (double)In * 114.9039 + (double)Bi * 208.98037 + (double)Pb * 207.9766 + (double)Tl * 204.9744 + (double)Zr * 89.9047 + (double)Nb *92.9064 + (double)Mo * 97.9054 + (double)Ru * 101.9043 + (double)Rh * 102.9055 + (double)Re * 186.9558 + (double)Pd * 105.9035 +(double)Ag * 106.9051 + (double)Pt * 194.9648 + (double)Ir * 192.9629 + (double)Hg * 201.9706 +(double)Os * 191.9615 + (double)W * 183.9510 + (double)Au * 196.9666 + (double)Ta * 180.9480 + (double)Hf * 179.9466 + (double)Ytt * 88.9059 + (double)Lu * 174.9408; if (Me > 0 && *Alert == '\0') { if (C > 1) printf("C%ld", C); if (C == 1) putchar('C'); if (H > 1) printf("H%ld", H); if (H == 1) putchar('H'); if (N > 1) printf("N%ld", N); if (N == 1) putchar('N'); if (O > 1) printf("O%ld", O); if (O == 1) putchar('O'); if (P > 1) printf("P%ld", P); if (P == 1) putchar('P'); if (S > 1) printf("S%ld", S); if (S == 1) putchar('S'); if (Si > 1) printf("Si%ld", Si); if (Si == 1) printf("Si"); if (B > 1) printf("B%ld", B); if (B == 1) putchar('B'); if (Br > 1) printf("Br%ld", Br); if (Br == 1) printf("Br"); if (Cl > 1) printf("Cl%ld", Cl); if (Cl == 1) printf("Cl"); if (F > 1) printf("F%ld", F); if (F == 1) putchar('F'); if (I > 1) printf("I%ld", I); if (I == 1) putchar('I'); if (Ag > 1) printf("Ag%ld", Ag); if (Ag == 1) printf("Ag"); if (Al > 1) printf("Al%ld", Al); if (Al == 1) printf("Al"); if (As > 1) printf("As%ld", As); if (As == 1) printf("As"); if (Au > 1) printf("Au%ld", Au); if (Au == 1) printf("Au"); if (Ba > 1) printf("Ba%ld", Ba); if (Ba == 1) printf("Ba"); if (Be > 1) printf("Be%ld", Be); if (Be == 1) printf("Be"); if (Bi > 1) printf("Bi%ld", Bi); if (Bi == 1) printf("Bi"); if (Ca > 1) printf("Ca%ld", Ca); if (Ca == 1) printf("Ca"); if (Cd > 1) printf("Cd%ld", Cd); if (Cd == 1) printf("Cd"); if (Co > 1) printf("Co%ld", Co); if (Co == 1) printf("Co"); if (Cr > 1) printf("Cr%ld", Cr); if (Cr == 1) printf("Cr"); if (Cs > 1) printf("Cs%ld", Cs); if (Cs == 1) printf("Cs"); if (Cu > 1) printf("Cu%ld", Cu); if (Cu == 1) printf("Cu"); if (Fe > 1) printf("Fe%ld", Fe); if (Fe == 1) printf("Fe"); if (Ga > 1) printf("Ga%ld", Ga); if (Ga == 1) printf("Ga"); if (Ge > 1) printf("Ge%ld", Ge); if (Ge == 1) printf("Ge"); if (Hf > 1) printf("Hf%ld", Hf); if (Hf == 1) printf("Hf"); if (Hg > 1) printf("Hg%ld", Hg); if (Hg == 1) printf("Hg"); if (In > 1) printf("In%ld", In); if (In == 1) printf("In"); if (Ir > 1) printf("Ir%ld", Ir); if (Ir == 1) printf("Ir"); if (K > 1) printf("K%ld", K); if (K == 1) putchar('K'); if (Li > 1) printf("Li%ld", Li); if (Li == 1) printf("Li"); if (Lu > 1) printf("Lu%ld", Lu); if (Lu == 1) printf("Lu"); if (Mg > 1) printf("Mg%ld", Mg); if (Mg == 1) printf("Mg"); if (Mn > 1) printf("Mn%ld", Mn); if (Mn == 1) printf("Mn"); if (Mo > 1) printf("Mo%ld", Mo); if (Mo == 1) printf("Mo"); if (Na > 1) printf("Na%ld", Na); if (Na == 1) printf("Na"); if (Nb > 1) printf("Nb%ld", Nb); if (Nb == 1) printf("Nb"); if (Ni > 1) printf("Ni%ld", Ni); if (Ni == 1) printf("Ni"); if (Os > 1) printf("Os%ld", Os); if (Os == 1) printf("Os"); if (Pb > 1) printf("Pb%ld", Pb); if (Pb == 1) printf("Pb"); if (Pd > 1) printf("Pd%ld", Pd); if (Pd == 1) printf("Pd"); if (Pt > 1) printf("Pt%ld", Pt); if (Pt == 1) printf("Pt"); if (Rb > 1) printf("Rb%ld", Rb); if (Rb == 1) printf("Rb"); if (Re > 1) printf("Re%ld", Re); if (Re == 1) printf("Re"); if (Rh > 1) printf("Rh%ld", Rh); if (Rh == 1) printf("Rh"); if (Ru > 1) printf("Rb%ld", Ru); if (Ru == 1) printf("Ru"); if (Sb > 1) printf("Sb%ld", Sb); if (Sb == 1) printf("Sb"); if (Sc > 1) printf("Sc%ld", Sc); if (Sc == 1) printf("Sc"); if (Se > 1) printf("Se%ld", Se); if (Se == 1) printf("Se"); if (Sn > 1) printf("Sn%ld", Sn); if (Sn == 1) printf("Sn"); if (Sr > 1) printf("Sr%ld", Sr); if (Sr == 1) printf("Sr"); if (Ta > 1) printf("Ta%ld", Ta); if (Ta == 1) printf("Ta"); if (Te > 1) printf("Te%ld", Te); if (Te == 1) printf("Te"); if (Ti > 1) printf("Ti%ld", Ti); if (Ti == 1) printf("Ti"); if (Tl > 1) printf("Tl%ld", Tl); if (Tl == 1) printf("Tl"); if (V > 1) printf("V%ld", V); if (V == 1) printf("V"); if (W > 1) printf("W%ld", W); if (W == 1) printf("W"); if (Ytt > 1) printf("Y%ld", Ytt); if (Ytt == 1) printf("Y"); if (Zn > 1) printf("Zn%ld", Zn); if (Zn == 1) printf("Zn"); if (Zr > 1) printf("Zr%ld", Zr); if (Zr == 1) printf("Zr"); printf(" [%2.3f]", M); printf(" Me=%2.10f ", Me); if (C > 0) printf("%4.2f%%C;", (double)C * 12.011 * 100 / M); if (H > 0) printf("%4.2f%%H;", (double)H * 1.0079 * 100 / M); if (B > 0) printf("%4.2f%%B;", (double)B * 10.81 * 100 / M); if (N > 0) printf("%4.2f%%N;", (double)N * 14.0067 * 100 / M); if (O > 0) printf("%4.2f%%O;", (double)O * 15.9994 * 100 / M); if (P > 0) printf("%4.2f%%P;", (double)P * 30.97376 * 100 / M); if (S > 0) printf("%4.2f%%S;", (double)S * 32.0640 * 100 / M); if (K > 0) printf("%4.2f%%K;", (double)K * 39.098 * 100 / M); if (Mg > 0) printf("%4.2f%%Mg;", (double)Mg * 24.305 * 100 / M); if (Na > 0) printf("%4.2f%%Na;", (double)Na * 22.98977 * 100 / M); if (Si > 0) printf("%4.2f%%Si;", (double)Si * 28.086 * 100 / M); if (Br > 0) printf("%4.2f%%Br;", (double)Br * 79.904 * 100 / M); if (Cl > 0) printf("%4.2f%%Cl;", (double)Cl * 35.453 * 100 / M); if (F > 0) printf("%4.2f%%F;", (double)F * 18.9984 * 100 / M); if (I > 0) printf("%4.2f%%I;", (double)I * 126.9045 * 100 / M); if (Ag >0) printf("%4.2f%%Ag;", (double)Ag * 107.868 * 100 / M); if (Al >0) printf("%4.2f%%Al;", (double)Al * 26.981539 * 100 / M); if (As >0) printf("%4.2f%%As;", (double)As * 74.92159 * 100 / M); if (Au >0) printf("%4.2f%%Au;", (double)Au * 196.966 * 100 / M); if (Ba >0) printf("%4.2f%%Ba;", (double)Ba * 137.327 * 100 / M); if (Be >0) printf("%4.2f%%Be;", (double)Be * 9.012182 * 100 / M); if (Bi >0) printf("%4.2f%%Bi;", (double)Bi * 208.98037 * 100 / M); if (Ca >0) printf("%4.2f%%Ca;", (double)Ca * 40.08 * 100 / M); if (Cd >0) printf("%4.2f%%Cd;", (double)Cd * 112.41 * 100 / M); if (Co >0) printf("%4.2f%%Co;", (double)Co * 58.993 * 100 / M); if (Cr >0) printf("%4.2f%%Cr;", (double)Cr * 51.996 * 100 / M); if (Cs >0) printf("%4.2f%%Cs;", (double)Cs * 132.90543 * 100 / M); if (Cu >0) printf("%4.2f%%Cu;", (double)Cu * 63.546 * 100 / M); if (Fe >0) printf("%4.2f%%Fe;", (double)Fe * 55.847 * 100 / M); if (Ga >0) printf("%4.2f%%Ga;", (double)Ga * 69.723 * 100 / M); if (Ge >0) printf("%4.2f%%Ge;", (double)Ge * 72.61 * 100 / M); if (Hf >0) printf("%4.2f%%Hf;", (double)Hf * 178.49 * 100 / M); if (Hg >0) printf("%4.2f%%Hg;", (double)Hg * 200.59 * 100 / M); if (In >0) printf("%4.2f%%In;", (double)In * 114.82 * 100 / M); if (Ir >0) printf("%4.2f%%Ir;", (double)Ir * 192.217 * 100 / M); if (Li >0) printf("%4.2f%%Li;", (double)Li * 6.941 * 100 / M); if (Lu >0) printf("%4.2f%%Lu;", (double)Lu * 174.967 * 100 / M); if (Mn >0) printf("%4.2f%%Mn;", (double)Mn * 54.938 * 100 / M); if (Mo >0) printf("%4.2f%%Mo;", (double)Mo * 95.94 * 100 / M); if (Nb >0) printf("%4.2f%%Nb;", (double)Nb * 92.906 *100 / M); if (Ni >0) printf("%4.2f%%Ni;", (double)Ni * 58.69 *100 / M); if (Os >0) printf("%4.2f%%Os;", (double)Os * 190.2 *100 / M); if (Pb >0) printf("%4.2f%%Pb;", (double)Pb * 207.2 *100 / M); if (Pd >0) printf("%4.2f%%Pd;", (double)Pd * 106.42 *100 / M); if (Pt >0) printf("%4.2f%%Pt;", (double)Pt * 195.078 *100 / M); if (Rb >0) printf("%4.2f%%Rb;", (double)Rb * 85.4678 *100 / M); if (Re >0) printf("%4.2f%%Re;", (double)Re * 186.207 *100 / M); if (Rh >0) printf("%4.2f%%Rh;", (double)Rh * 102.9055 *100 / M); if (Ru >0) printf("%4.2f%%Ru;", (double)Ru * 101.07 *100 / M); if (Sb >0) printf("%4.2f%%Sb;", (double)Sb * 121.75 *100 / M); if (Sc >0) printf("%4.2f%%Sc;", (double)Sc * 44.95591 *100 / M); if (Se >0) printf("%4.2f%%Se;", (double)Se * 78.96 *100 / M); if (Sn >0) printf("%4.2f%%Sn;", (double)Sn * 118.71 *100 / M); if (Sr >0) printf("%4.2f%%Sr;", (double)Sr * 87.62 *100 / M); if (Ta >0) printf("%4.2f%%Ta;", (double)Ta * 180.948 *100 / M); if (Te >0) printf("%4.2f%%Te;", (double)Te * 127.60 *100 / M); if (Ti >0) printf("%4.2f%%Ti;", (double)Ti * 47.88 *100 / M); if (Tl >0) printf("%4.2f%%Tl;", (double)Tl * 204.3833 *100 / M); if (V >0) printf("%4.2f%%V;", (double)V * 50.9415 *100 / M); if (W >0) printf("%4.2f%%W;", (double)W * 183.84 *100 / M); if (Ytt >0) printf("%4.2f%%Y;", (double)Ytt * 88.906 *100 / M); if (Zn >0) printf("%4.2f%%Zn;", (double)Zn * 65.39 *100. / M); if (Zr >0) printf("%4.2f%%Zr;", (double)Zr * 91.224 *100. / M); } else { if (*Alert != '\0') printf("%s overlapped bonds !", Alert); else printf("C0H0 [0.00] Me=0.0000000000 0.00%%C;0.00%%H"); } putchar('\n'); exit(EXIT_SUCCESS); } /* End. */ chemtool-1.6.14/src-cht/abbrev.txt0000644000175000001440000000304110715417303016172 0ustar martinusersAc C2 H3 O # Acetyl Ade C5 H4 N5 # Adeninyl Bn C7 H7 # Benzyl Bu C4 H9 # Butyl Bz C7 H5 O # Benzoyl BOC C5 H9 O2 # Butyloxycarbonyl CE C3 H4 N # Cyanoethyl Cyt C4 H4 N3 O # Cytosinyl DBAM C9 H19 N # Dibutylaminomethylene, biradical DMAM C3 H7 N # Dimethylaminomethylen, biradical DMTr C21 H19 O2 # Dimethoxytrityl Et C2 H5 # Ethyl Gua C5 H4 N5 O # Guaninyl iBu C4 H9 # iso-Butyl iPr C3 H7 # iso-Propyl Me C H3 # Methyl Ms C H3 S O2 # Mesyl MOC C2 H3 O2 # Methoxycarbonyl MOM C2 H5 O # Methoxymethyl MMTr C20 H16 O # Monomethoxytrityl Ph C6 H5 # Phenyl @F C6 H5 # Phenyl Pr C3 H7 # Propyl TBDMS C6 H15 Si # tert-Butyldimethylsilyl TBDPS C16 H19 Si # tert-Butyldiphenylsilyl tBu C4 H9 # tert-Butyl Tf C F3 S O2 # Triflyl Thy C5 H5 N2 O2 # Thyminyl TMS C3 H9 Si # Trimethylsilyl TMTr C22 H22 O3 # Dimethoxytrityl Tol C8 H7 O # Tolyl Tr C19 H15 # Trityl Ts C7 H7 S O2 # Tosyl Ura C4 H3 N2 O2 # Uracilyl Z C8 H7 O2 # Benzyloxycarbonyl chemtool-1.6.14/src-cht/cht-2.5.c0000644000175000001440000026574710715417303015443 0ustar martinusers/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */ /* From input file "cht-1.7.pp" */ #ifdef HAVE_CONFIG_H #include #endif #ifndef P2C_H #define P2C_H /* Header file for code generated by "p2c", the Pascal-to-C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version 1.21alpha-07.Dec.93. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #include #include #define DOUBLE double /* If the following heuristic fails, compile -DBSD=0 for non-BSD systems, or -DBSD=1 for BSD systems. */ #ifdef M_XENIX # define BSD 0 #endif #ifdef vms # define BSD 0 # ifndef __STDC__ # define __STDC__ 1 # endif #endif #ifdef __TURBOC__ # define MSDOS 1 #endif #ifdef MSDOS # define BSD 0 #endif #ifdef FILE /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */ # ifndef BSD /* (a convenient, but horrible kludge!) */ # define BSD 1 # endif #endif #ifdef BSD # if !BSD # undef BSD # endif #endif #if (defined(__STDC__) && !defined(M_XENIX)) || defined(__TURBOC__) # include # include # define HAS_STDLIB # if defined(vms) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #else # ifndef BSD # ifndef __TURBOC__ # include # endif # endif # ifdef hpux # ifdef _INCLUDE__STDC__ # include # include # define HAS_STDLIB # endif # endif # include # if !defined(MSDOS) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #endif #if defined(NON_ANSI_CAT) && !defined(ANSI_CAT) # ifdef NON_ANSI_CAT_ALTERNATE # define __CAT__(a,b)a/**/b # else # define __ID__(a)a # define __CAT__(a,b)__ID__(a)b # endif #else # define __CAT__(a,b)a##b #endif #ifdef BSD # include # define memcpy(a,b,n) (bcopy(b,a,n),a) # define memcmp(a,b,n) bcmp(a,b,n) # define strchr(s,c) index(s,c) # define strrchr(s,c) rindex(s,c) #else # include #endif #include #include #include #include #ifndef NO_LACK #ifdef vms #define LACK_LABS #define LACK_MEMMOVE #define LACK_MEMCPY #else #define LACK_LABS /* Undefine these if your library has these */ #define LACK_MEMMOVE #endif #endif typedef struct __p2c_jmp_buf { struct __p2c_jmp_buf *next; jmp_buf jbuf; } __p2c_jmp_buf; /* Warning: The following will not work if setjmp is used simultaneously. This also violates the ANSI restriction about using vars after longjmp, but a typical implementation of longjmp will get it right anyway. */ #ifndef FAKE_TRY # define TRY(x) do { __p2c_jmp_buf __try_jb; \ __try_jb.next = __top_jb; \ if (!setjmp((__top_jb = &__try_jb)->jbuf)) { # define RECOVER(x) __top_jb = __try_jb.next; } else { # define RECOVER2(x,L) __top_jb = __try_jb.next; } else { \ if (0) { L: __top_jb = __try_jb.next; } # define ENDTRY(x) } } while (0) #else # define TRY(x) if (1) { # define RECOVER(x) } else do { # define RECOVER2(x,L) } else do { L: ; # define ENDTRY(x) } while (0) #endif #ifdef M_XENIX /* avoid compiler bug */ # define SHORT_MAX (32767) # define SHORT_MIN (-32768) #endif /* The following definitions work only on twos-complement machines */ #ifndef SHORT_MAX # define SHORT_MAX ((short)(((unsigned short) -1) >> 1)) # define SHORT_MIN (~SHORT_MAX) #endif #ifndef INT_MAX # define INT_MAX ((int)(((unsigned int) -1) >> 1)) # define INT_MIN (~INT_MAX) #endif #ifndef LONG_MAX # define LONG_MAX ((long)(((unsigned long) -1) >> 1)) # define LONG_MIN (~LONG_MAX) #endif #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 #endif #ifndef EXIT_SUCCESS # ifdef vms # define EXIT_SUCCESS 1 # define EXIT_FAILURE (02000000000L) # else # define EXIT_SUCCESS 0 # define EXIT_FAILURE 1 # endif #endif #define SETBITS 32 #if defined(__STDC__) || defined(__TURBOC__) # if !defined(vms) && !defined(M_LINT) # define Signed signed # else # define Signed # endif # define Void void /* Void f() = procedure */ # ifndef Const # define Const const # endif # ifndef Volatile # define Volatile volatile # endif # ifdef M_LINT # define PP(x) () # define PV() () typedef char *Anyptr; # else # define PP(x) x /* function prototype */ # define PV() (void) /* null function prototype */ typedef void *Anyptr; # endif #else # define Signed # define Void void # ifndef Const # define Const # endif # ifndef Volatile # define Volatile # endif # define PP(x) () # define PV() () typedef char *Anyptr; #endif #ifdef __GNUC__ # define Inline inline #else # define Inline #endif #define Register register /* Register variables */ #define Char char /* Characters (not bytes) */ #ifndef Static # define Static static /* Private global funcs and vars */ #endif #ifndef Local # define Local static /* Nested functions */ #endif typedef Signed char schar; typedef unsigned char uchar; typedef unsigned char boolean; #ifndef NO_DECLARE_ALFA typedef Char alfa[10]; #endif #ifndef true # define true 1 # define false 0 #endif #ifndef TRUE # define TRUE 1 # define FALSE 0 #endif typedef struct { Anyptr proc, link; } _PROCEDURE; #ifndef _FNSIZE # define _FNSIZE 120 #endif extern Void PASCAL_MAIN PP( (int, Char **) ); extern Char **P_argv; extern int P_argc; extern short P_escapecode; extern int P_ioresult; extern __p2c_jmp_buf *__top_jb; #ifdef P2C_H_PROTO /* if you have Ansi C but non-prototyped header files */ extern Char *strcat PP( (Char *, Const Char *) ); extern Char *strchr PP( (Const Char *, int) ); extern int strcmp PP( (Const Char *, Const Char *) ); extern Char *strcpy PP( (Char *, Const Char *) ); extern size_t strlen PP( (Const Char *) ); extern Char *strncat PP( (Char *, Const Char *, size_t) ); extern int strncmp PP( (Const Char *, Const Char *, size_t) ); extern Char *strncpy PP( (Char *, Const Char *, size_t) ); extern Char *strrchr PP( (Const Char *, int) ); extern Anyptr memchr PP( (Const Anyptr, int, size_t) ); extern Anyptr memmove PP( (Anyptr, Const Anyptr, size_t) ); extern Anyptr memset PP( (Anyptr, int, size_t) ); #ifndef memcpy extern Anyptr memcpy PP( (Anyptr, Const Anyptr, size_t) ); extern int memcmp PP( (Const Anyptr, Const Anyptr, size_t) ); #endif extern int atoi PP( (Const Char *) ); extern double atof PP( (Const Char *) ); extern long atol PP( (Const Char *) ); extern double strtod PP( (Const Char *, Char **) ); extern long strtol PP( (Const Char *, Char **, int) ); #endif /*P2C_H_PROTO*/ #ifndef HAS_STDLIB #ifndef NO_DECLARE_MALLOC extern Anyptr malloc PP( (size_t) ); extern Void free PP( (Anyptr) ); #endif #endif extern int _OutMem PV(); extern int _CaseCheck PV(); extern int _NilCheck PV(); extern int _Escape PP( (int) ); extern int _EscIO PP( (int) ); extern int _EscIO2 PP( (int, Char *) ); extern long ipow PP( (long, long) ); extern long P_imax PP( (long, long) ); extern long P_imin PP( (long, long) ); extern double P_rmax PP( (double, double) ); extern double P_rmin PP( (double, double) ); extern Char *strsub PP( (Char *, Char *, int, int) ); extern Char *strltrim PP( (Char *) ); extern Char *strrtrim PP( (Char *) ); extern Char *strrpt PP( (Char *, Char *, int) ); extern Char *strpad PP( (Char *, Char *, int, int) ); extern int strpos2 PP( (Char *, Char *, int) ); extern long memavail PV(); extern int P_peek PP( (FILE *) ); extern int P_eof PP( (FILE *) ); extern int P_eoln PP( (FILE *) ); extern Void P_readpaoc PP( (FILE *, Char *, int) ); extern Void P_readlnpaoc PP( (FILE *, Char *, int) ); extern long P_maxpos PP( (FILE *) ); extern Char *P_trimname PP( (Char *, int) ); extern long *P_setunion PP( (long *, long *, long *) ); extern long *P_setint PP( (long *, long *, long *) ); extern long *P_setdiff PP( (long *, long *, long *) ); extern long *P_setxor PP( (long *, long *, long *) ); extern int P_inset PP( (unsigned, long *) ); extern int P_setequal PP( (long *, long *) ); extern int P_subset PP( (long *, long *) ); extern long *P_addset PP( (long *, unsigned) ); extern long *P_addsetr PP( (long *, unsigned, unsigned) ); extern long *P_remset PP( (long *, unsigned) ); extern long *P_setcpy PP( (long *, long *) ); extern long *P_expset PP( (long *, long) ); extern long P_packset PP( (long *) ); extern FILE *_skipspaces PP( (FILE *) ); extern FILE *_skipnlspaces PP( (FILE *) ); /* I/O error handling */ #define _CHKIO(cond,ior,val,def) ((cond) ? P_ioresult=0,(val) \ : P_ioresult=(ior),(def)) #define _SETIO(cond,ior) (P_ioresult = (cond) ? 0 : (ior)) /* Following defines are suitable for the HP Pascal operating system */ #define FileNotFound 10 #define FileNotOpen 13 #define FileWriteError 38 #define BadInputFormat 14 #define EndOfFile 30 #define FILENOTFOUND 10 #define FILENOTOPEN 13 #define FILEWRITEERROR 38 #define BADINPUTFORMAT 14 #define ENDOFFILE 30 /* Creating temporary files */ #if (defined(BSD) || defined(NO_TMPFILE)) && !defined(HAVE_TMPFILE) # define tmpfile() (fopen(tmpnam(NULL), "w+")) #endif /* File buffers */ #define FILEBUF(f,sc,type) sc int __CAT__(f,_BFLAGS); \ sc type __CAT__(f,_BUFFER) #define FILEBUFNC(f,type) int __CAT__(f,_BFLAGS); \ type __CAT__(f,_BUFFER) #define RESETBUF(f,type) (__CAT__(f,_BFLAGS) = 1) #define SETUPBUF(f,type) (__CAT__(f,_BFLAGS) = 0) #define GETFBUF(f,type) (*((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(&__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ &__CAT__(f,_BUFFER))) #define AGETFBUF(f,type) ((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ __CAT__(f,_BUFFER)) #define PUTFBUF(f,type,v) (GETFBUF(f,type) = (v)) #define CPUTFBUF(f,v) (PUTFBUF(f,char,v)) #define APUTFBUF(f,type,v) (memcpy(AGETFBUF(f,type), (v), \ sizeof(__CAT__(f,_BUFFER)))) #define GET(f,type) (__CAT__(f,_BFLAGS) == 1 ? \ fread(&__CAT__(f,_BUFFER),sizeof(type),1,(f)) : \ (__CAT__(f,_BFLAGS) = 1)) #define PUT(f,type) (fwrite(&__CAT__(f,_BUFFER),sizeof(type),1,(f)), \ (__CAT__(f,_BFLAGS) = 0)) #define CPUT(f) (PUT(f,char)) #define BUFEOF(f) (__CAT__(f,_BFLAGS) != 2 && P_eof(f)) #define BUFFPOS(f) (ftell(f) - (__CAT__(f,_BFLAGS) == 2)) typedef struct { FILE *f; int f_BFLAGS; /* FILEBUFNC(f,Char); */ Char f_BUFFER; Char name[_FNSIZE]; } _TEXT; /* Memory allocation */ #ifdef __GCC__ # define Malloc(n) (malloc(n) ?: (Anyptr)_OutMem()) #else extern Anyptr __MallocTemp__; # define Malloc(n) ((__MallocTemp__ = malloc(n)) ? __MallocTemp__ : (Anyptr)_OutMem()) #endif #define FreeR(p) (free((Anyptr)(p))) /* used if arg is an rvalue */ #define Free(p) (free((Anyptr)(p)), (p)=NULL) /* sign extension */ #define SEXT(x,n) ((x) | -(((x) & (1L<<((n)-1))) << 1)) /* packed arrays */ /* BEWARE: these are untested! */ #define P_getbits_UB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] >> \ (((~(i))&((1<<(L)-(n))-1)) << (n)) & \ (1<<(1<<(n)))-1)) #define P_getbits_SB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] << \ (16 - ((((~(i))&((1<<(L)-(n))-1))+1) <<\ (n)) >> (16-(1<<(n)))))) #define P_putbits_UB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ (x) << (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_putbits_SB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ ((x) & (1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_clrbits_B(a,i,n,L) ((a)[(i)>>(L)-(n)] &= \ ~( ((1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) ) /* small packed arrays */ #define P_getbits_US(v,i,n) ((int)((v) >> ((i)<<(n)) & (1<<(1<<(n)))-1)) #define P_getbits_SS(v,i,n) ((int)((long)(v) << (SETBITS - (((i)+1) << (n))) >> (SETBITS-(1<<(n))))) #define P_putbits_US(v,i,x,n) ((v) |= (x) << ((i) << (n))) #define P_putbits_SS(v,i,x,n) ((v) |= ((x) & (1<<(1<<(n)))-1) << ((i)<<(n))) #define P_clrbits_S(v,i,n) ((v) &= ~( ((1<<(1<<(n)))-1) << ((i)<<(n)) )) #define P_max(a,b) ((a) > (b) ? (a) : (b)) #define P_min(a,b) ((a) < (b) ? (a) : (b)) /* Fix ANSI-isms */ #ifdef LACK_LABS # ifndef labs # define labs my_labs extern long my_labs PP( (long) ); # endif #endif #ifdef LACK_MEMMOVE # ifndef memmove # define memmove my_memmove extern Anyptr my_memmove PP( (Anyptr, Const Anyptr, size_t) ); # endif #endif #ifdef LACK_MEMCPY # ifndef memcpy # define memcpy my_memcpy extern Anyptr my_memcpy PP( (Anyptr, Const Anyptr, size_t) ); # endif # ifndef memcmp # define memcmp my_memcmp extern int my_memcmp PP( (Const Anyptr, Const Anyptr, size_t) ); # endif # ifndef memset # define memset my_memset extern Anyptr my_memset PP( (Anyptr, int, size_t) ); # endif #endif /* Fix toupper/tolower on Suns and other stupid BSD systems */ #ifdef toupper # undef toupper # undef tolower # define toupper(c) my_toupper(c) # define tolower(c) my_tolower(c) #endif #ifndef _toupper # if 'A' == 65 && 'a' == 97 # define _toupper(c) ((c)-'a'+'A') # define _tolower(c) ((c)-'A'+'a') # else # ifdef toupper # undef toupper /* hope these are shadowing real functions, */ # undef tolower /* because my_toupper calls _toupper! */ # endif # define _toupper(c) toupper(c) # define _tolower(c) tolower(c) # endif #endif #endif /* P2C_H */ /* End. */ /* Run-time library for use with "p2c", the Pascal to C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version --VERSION--. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #ifndef NO_TIME # include #endif #define Isspace(c) isspace(c) /* or "((c) == ' ')" if preferred */ int P_argc; char **P_argv; short P_escapecode; int P_ioresult; long EXCP_LINE; /* Used by Pascal workstation system */ Anyptr __MallocTemp__; __p2c_jmp_buf *__top_jb; void PASCAL_MAIN(argc, argv) int argc; char **argv; { P_argc = argc; P_argv = argv; __top_jb = NULL; #ifdef LOCAL_INIT LOCAL_INIT(); #endif } /* In case your system lacks these... */ long my_labs(x) long x; { return((x > 0) ? x : -x); } #ifdef __STDC__ Anyptr my_memmove(Anyptr d, Const Anyptr s, size_t n) #else Anyptr my_memmove(d, s, n) Anyptr d, s; register int n; #endif { register char *dd = (char *)d, *ss = (char *)s; if (dd < ss || dd - ss >= (int)n) { #if defined(bcopy) && defined(memcpy) my_memcpy(dd, ss, n); #else memcpy(dd, ss, (size_t)n); #endif } else if (n > 0) { dd += n; ss += n; while (n-- > 0) *--dd = *--ss; } return d; } #ifdef __STDC__ Anyptr my_memcpy(Anyptr d, Const Anyptr s, size_t n) #else Anyptr my_memcpy(d, s, n) Anyptr d, s; register int n; #endif { register char *ss = (char *)s, *dd = (char *)d; while (n-- > 0) *dd++ = *ss++; return d; } #ifdef __STDC__ int my_memcmp(Const Anyptr s1, Const Anyptr s2, size_t n) #else int my_memcmp(s1, s2, n) Anyptr s1, s2; register int n; #endif { register char *a = (char *)s1, *b = (char *)s2; register int i; while (n-- > 0) if ((i = (*a++) - (*b++)) != 0) return i; return 0; } #ifdef __STDC__ Anyptr my_memset(Anyptr d, int c, size_t n) #else Anyptr my_memset(d, c, n) Anyptr d; register int c; register int n; #endif { register char *dd = (char *)d; while (n-- > 0) *dd++ = c; return d; } int my_toupper(c) int c; { if (islower(c)) return _toupper(c); else return c; } int my_tolower(c) int c; { if (isupper(c)) return _tolower(c); else return c; } long ipow(a, b) long a, b; { long v; if (a == 0 || a == 1) return a; if (a == -1) return (b & 1) ? -1 : 1; if (b < 0) return 0; if (a == 2) return 1L << b; v = (b & 1) ? a : 1; while ((b >>= 1) > 0) { a *= a; if (b & 1) v *= a; } return v; } long P_imax(a, b) long a, b; { if (a > b) return a; else return b; } long P_imin(a, b) long a, b; { if (a < b) return a; else return b; } double P_rmax(a, b) double a, b; { if (a > b) return a; else return b; } double P_rmin(a, b) double a, b; { if (a < b) return a; else return b; } /* Common string functions: */ /* Store in "ret" the substring of length "len" starting from "pos" (1-based). Store a shorter or null string if out-of-range. Return "ret". */ char *strsub(ret, s, pos, len) register char *ret, *s; register int pos, len; { register char *s2; if (--pos < 0 || len <= 0) { *ret = 0; return ret; } while (pos > 0) { if (!*s++) { *ret = 0; return ret; } pos--; } s2 = ret; while (--len >= 0) { if (!(*s2++ = *s++)) return ret; } *s2 = 0; return ret; } /* Return the index of the first occurrence of "pat" as a substring of "s", starting at index "pos" (1-based). Result is 1-based, 0 if not found. */ int strpos2(s, pat, pos) char *s; register char *pat; register int pos; { register char *cp, ch; register int slen; if (--pos < 0) return 0; slen = (int)strlen(s) - pos; cp = s + pos; if (!(ch = *pat++)) return 0; pos = (int)strlen(pat); slen -= pos; while (--slen >= 0) { if (*cp++ == ch && !strncmp(cp, pat, (size_t)pos)) return cp - s; } return 0; } /* Case-insensitive version of strcmp. */ int strcicmp(s1, s2) register char *s1, *s2; { register unsigned char c1, c2; while (*s1) { if (*s1++ != *s2++) { if (!s2[-1]) return 1; c1 = (unsigned char)toupper(s1[-1]); c2 = (unsigned char)toupper(s2[-1]); if (c1 != c2) return c1 - c2; } } if (*s2) return -1; return 0; } /* HP and Turbo Pascal string functions: */ /* Trim blanks at left end of string. */ char *strltrim(s) register char *s; { while (Isspace(*s++)) ; return s - 1; } /* Trim blanks at right end of string. */ char *strrtrim(s) register char *s; { register char *s2 = s; if (!*s) return s; while (*++s2) ; while (s2 > s && Isspace(*--s2)) *s2 = 0; return s; } /* Store in "ret" "num" copies of string "s". Return "ret". */ char *strrpt(ret, s, num) char *ret; register char *s; register int num; { register char *s2 = ret; register char *s1; while (--num >= 0) { s1 = s; while ((*s2++ = *s1++)) ; s2--; } return ret; } /* Store in "ret" string "s" with enough pad chars added to reach "size". */ char *strpad(ret, s, padchar, num) char *ret; register char *s; register int padchar, num; { register char *d = ret; if (s == d) { while (*d++) ; } else { while ((*d++ = *s++)) ; } num -= (--d - ret); while (--num >= 0) *d++ = padchar; *d = 0; return ret; } /* Copy the substring of length "len" from index "spos" of "s" (1-based) to index "dpos" of "d", lengthening "d" if necessary. Length and indices must be in-range. */ void strmove(len, s, spos, d, dpos) register char *s, *d; register int len, spos, dpos; { s += spos - 1; d += dpos - 1; while (*d && --len >= 0) *d++ = *s++; if (len > 0) { while (--len >= 0) *d++ = *s++; *d = 0; } } /* Delete the substring of length "len" at index "pos" from "s". Delete less if out-of-range. */ void strdelete(s, pos, len) register char *s; register int pos, len; { register int slen; if (--pos < 0) return; slen = (int)strlen(s) - pos; if (slen <= 0) return; s += pos; if (slen <= len) { *s = 0; return; } while ((*s = s[len])) s++; } /* Insert string "src" at index "pos" of "dst". */ void strinsert(src, dst, pos) register char *src, *dst; register int pos; { register int slen, dlen; if (--pos < 0) return; dlen = (int)strlen(dst); dst += dlen; dlen -= pos; if (dlen <= 0) { strcpy(dst, src); return; } slen = (int)strlen(src); do { dst[slen] = *dst; --dst; } while (--dlen >= 0); dst++; while (--slen >= 0) *dst++ = *src++; } /* File functions */ /* Peek at next character of input stream; return EOF at end-of-file. */ int P_peek(f) FILE *f; { int ch; ch = getc(f); if (ch == EOF) return EOF; ungetc(ch, f); return (ch == '\n') ? ' ' : ch; } /* Check if at end of file, using Pascal "eof" semantics. End-of-file for stdin is broken; remove the special case for it to be broken in a different way. */ int P_eof(f) FILE *f; { register int ch; if (feof(f)) return 1; #ifdef HAVE_ISATTY if (isatty(fileno(f))) #else if (f == stdin) #endif return 0; /* not safe to look-ahead on the keyboard! */ ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return 0; } /* Check if at end of line (or end of entire file). */ int P_eoln(f) FILE *f; { register int ch; ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return (ch == '\n'); } /* Skip whitespace (including newlines) in a file. */ FILE *_skipnlspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t' || ch == '\n'); if (ch != EOF) ungetc(ch, f); return f; } /* Skip whitespace (not including newlines) in a file. */ FILE *_skipspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t'); if (ch != EOF) ungetc(ch, f); return f; } /* Read a packed array of characters from a file. */ Void P_readpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { if (len <= 0) return; ch = getc(f); if (ch == EOF || ch == '\n') break; *s++ = ch; --len; } while (--len >= 0) *s++ = ' '; if (ch != EOF) ungetc(ch, f); } Void P_readlnpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { ch = getc(f); if (ch == EOF || ch == '\n') break; if (len > 0) { *s++ = ch; --len; } } while (--len >= 0) *s++ = ' '; } /* Compute maximum legal "seek" index in file (0-based). */ long P_maxpos(f) FILE *f; { long savepos = ftell(f); long val; if (fseek(f, 0L, SEEK_END)) return -1; val = ftell(f); if (fseek(f, savepos, SEEK_SET)) return -1; return val; } /* Use packed array of char for a file name. */ Char *P_trimname(fn, len) register Char *fn; register int len; { static Char fnbuf[256]; register Char *cp = fnbuf; while (--len >= 0 && *fn && !isspace(*fn)) *cp++ = *fn++; *cp = 0; return fnbuf; } /* Pascal's "memavail" doesn't make much sense in Unix with virtual memory. We fix memory size as 10Meg as a reasonable compromise. */ long memavail() { return 10000000; /* worry about this later! */ } long maxavail() { return memavail(); } /* Sets are stored as an array of longs. S[0] is the size of the set; S[N] is the N'th 32-bit chunk of the set. S[0] equals the maximum I such that S[I] is nonzero. S[0] is zero for an empty set. Within each long, bits are packed from lsb to msb. The first bit of the set is the element with ordinal value 0. (Thus, for a "set of 5..99", the lowest five bits of the first long are unused and always zero.) */ /* (Sets with 32 or fewer elements are normally stored as plain longs.) */ long *P_setunion(d, s1, s2) /* d := s1 + s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ | *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; *dbase = d - dbase - 1; return dbase; } long *P_setint(d, s1, s2) /* d := s1 * s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setdiff(d, s1, s2) /* d := s1 - s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & ~*s2++; if (sz1 >= 0) { while (sz1-- >= 0) *d++ = *s1++; } while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setxor(d, s1, s2) /* d := s1 / s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ ^ *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } int P_inset(val, s) /* val IN s */ register unsigned val; register long *s; { register int bit; bit = (int) (val % SETBITS); val /= SETBITS; if ((long)val < *s++ && ((1L<(unsigned) size) { s += size; while (val > (unsigned)size) *++s = 0, size++; *sbase = size; } else s += val; *s |= 1L< (int)v2) return sbase; b1 = (int) (v1 % SETBITS); v1 /= SETBITS; b2 = (int) (v2 % SETBITS); v2 /= SETBITS; size = *s; v1++; if (++v2 > (unsigned)size) { while (v2 > (unsigned)size) s[++size] = 0; s[v2] = 0; *s = (long)v2; } s += v1; if (v1 == v2) { *s |= (~((-2L)<<(b2-b1))) << b1; } else { *s++ |= (-1L) << b1; while (++v1 < v2) *s++ = -1; *s |= ~((-2L) << b2); } return sbase; } long *P_remset(s, val) /* s := s - [val] */ register long *s; register unsigned val; { register int bit; bit = (int) (val % SETBITS); val /= SETBITS; if ((long)++val <= *s) { if (!(s[val] &= ~(1L<= 0) { if (*s1++ != *s2++) return 0; } return 1; } int P_subset(s1, s2) /* s1 <= s2 */ register long *s1, *s2; { register int sz1 = *s1++, sz2 = *s2++; if (sz1 > sz2) return 0; while (--sz1 >= 0) { if (*s1++ & ~*s2++) return 0; } return 1; } long *P_setcpy(d, s) /* d := s */ register long *d, *s; { register long *save_d = d; #ifdef SETCPY_MEMCPY memcpy(d, s, (*s + 1) * sizeof(long)); #else register int i = *s + 1; while (--i >= 0) *d++ = *s++; #endif return save_d; } /* s is a "smallset", i.e., a 32-bit or less set stored directly in a long. */ long *P_expset(d, s) /* d := s */ register long *d; register long s; { if (s) { d[1] = s; *d = 1; } else *d = 0; return d; } long P_packset(s) /* convert s to a small-set */ register long *s; { if (*s++) return *s; else return 0; } int _OutMem() { return _Escape(-2); } int _CaseCheck() { return _Escape(-9); } int _NilCheck() { return _Escape(-3); } /* The following is suitable for the HP Pascal operating system. It might want to be revised when emulating another system. */ char *_ShowEscape(buf, code, ior, prefix) char *buf, *prefix; int code, ior; { char *bufp; if (prefix && *prefix) { strcpy(buf, prefix); strcat(buf, ": "); bufp = buf + strlen(buf); } else { bufp = buf; } if (code == -10) { snprintf(bufp,80, "Pascal system I/O error %d", ior); switch (ior) { case 3: strcat(buf, " (illegal I/O request)"); break; case 7: strcat(buf, " (bad file name)"); break; case FileNotFound: /*10*/ strcat(buf, " (file not found)"); break; case FileNotOpen: /*13*/ strcat(buf, " (file not open)"); break; case BadInputFormat: /*14*/ strcat(buf, " (bad input format)"); break; case 24: strcat(buf, " (not open for reading)"); break; case 25: strcat(buf, " (not open for writing)"); break; case 26: strcat(buf, " (not open for direct access)"); break; case 28: strcat(buf, " (string subscript out of range)"); break; case EndOfFile: /*30*/ strcat(buf, " (end-of-file)"); break; case FileWriteError: /*38*/ strcat(buf, " (file write error)"); break; } } else { snprintf(bufp,80, "Pascal system error %d", code); switch (code) { case -2: strcat(buf, " (out of memory)"); break; case -3: strcat(buf, " (reference to NIL pointer)"); break; case -4: strcat(buf, " (integer overflow)"); break; case -5: strcat(buf, " (divide by zero)"); break; case -6: strcat(buf, " (real math overflow)"); break; case -8: strcat(buf, " (value range error)"); break; case -9: strcat(buf, " (CASE value range error)"); break; case -12: strcat(buf, " (bus error)"); break; case -20: strcat(buf, " (stopped by user)"); break; } } return buf; } int _Escape(code) int code; { char buf[100]; P_escapecode = code; if (__top_jb) { __p2c_jmp_buf *jb = __top_jb; __top_jb = jb->next; longjmp(jb->jbuf, 1); } if (code == 0) exit(EXIT_SUCCESS); if (code == -1) exit(EXIT_FAILURE); fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } int _EscIO(code) int code; { P_ioresult = code; return _Escape(-10); } int _EscIO2(code, name) int code; char *name; { P_ioresult = code; if (!__top_jb && name && *name) { char buf[100]; fprintf(stderr, "%s: %s\n", name, _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } return _Escape(-10); } /* End. */ typedef struct TPoint { long X, Y, C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, Ag, As,Au, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, Hf, Hg, In, Ir, Li, Lu, Mg, Mn, Mo, Na, Nb, Ni, Os, K, Pb, Pd, Pt, Rb, Re, Rh, Ru, Sb, Sc, Se, Sn, Sr, Ta, Te, Ti, Tl, V, W, Ytt, Zn, Zr, RecCount; struct TPoint *Last; } TPoint; typedef struct TBond { long X1, Y1, X2, Y2, RecCount; struct TBond *Last; } TBond; Static long C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, Ag, As, Au, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, Hf, Hg, In, Ir, Li, Lu, Mg, Mn, Mo, Na, Nb, Ni, Os, K, Pb, Pd, Pt, Rb, Re, Rh, Ru, Sb, Sc, Se, Sn, Sr, Ta, Te, Ti, Tl, V, W, Ytt, Zn, Zr, X1, X2, Y1, Y2, T, D; Static FILE *IFile; Static TPoint *Point, *Last, *Current; Static TBond *Bond, *LastB, *CurrentB; Static Char sss[256], A[256], subs[256], Alert[256]; Static Char sssb[7]; Static double M, Me; Static Char separator; Static long Count, code, atoms, rep, range, bonds; Static boolean Abandon, debug, verbose, fa, nobonds; Static long Sensi = 5; /*bonds and labels joint precision sensitivity*/ Static Char IFile_NAME[_FNSIZE]; Static Void doBonds() { do { (void)fgets(sss,256,IFile); sscanf(sss, "%ld%ld%ld%ld%ld%ld%*[^\n]", &X1, &Y1, &X2, &Y2, &T, &D); /*getc(IFile);*/ bonds--; if (debug) printf("%ld; %ld; %ld; %ld; %ld; %ld\n", X1, Y1, X2, Y2, T, D); if (D == 1 || T == 8){ if (debug) printf("skipped\n"); continue; } if (debug) printf("parsed\n"); if (T == 11) range = ((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2)) * 4; LastB = Bond; Bond = (TBond *)malloc(sizeof(TBond)); if (Bond == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Bond->X1 = X1; Bond->X2 = X2; Bond->Y1 = Y1; Bond->Y2 = Y2; Bond->Last = LastB; CurrentB = Bond; Bond = Bond->Last; while (Bond->Last != NULL) { if ((labs(Bond->X1 - X1) < Sensi && labs(Bond->Y1 - Y1) < Sensi && labs(Bond->X2 - X2) < Sensi && labs(Bond->Y2 - Y2) < Sensi) || (labs(Bond->X2 - X1) < Sensi && labs(Bond->Y2 - Y1) < Sensi && labs(Bond->X1 - X2) < Sensi && labs(Bond->Y1 - Y2) < Sensi)) { if (debug) printf(" ! Bond overlap\n"); strcat(Alert, "!"); } Bond = Bond->Last; } Bond = CurrentB; Abandon = false; Current = Point; while (Point->Last != NULL) { if (T == 11) { Abandon = true; if ((Point->X - X1) * (Point->X - X1) + (Point->Y - Y1) * (Point->Y - Y1) < range) { if (Point->H > 0) Point->H--; if (debug) printf("Ring --> stripped one H from %ld %ld\n", Point->X, Point->Y); } } else { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X1, Y1); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X1; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y1; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } if (T != 11) { Abandon = false; Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X2) < Sensi && labs(Point->Y - Y2) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X2, Y2); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X2; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y2; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } } } while (bonds != 0); } Static Void doLabels() { long mul, gmul, gmpos, ggmul, ggmpos; boolean stripped; Char STR2[256]; long FORLIM; Char *TEMP; if (debug) printf("---- and now parse the labels ---------\n"); if (verbose) printf("HeteroAtoms: %ld\n", atoms); FORLIM = atoms; for (rep = 1; rep <= FORLIM; rep++) { fscanf(IFile, "%ld%ld%c", &X1, &Y1, &separator); (void)fgets(sss, 256, IFile); TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; snprintf(A,256, "%.*s", strpos2(sss, "\t", 1) - 1, sss); if (debug) printf("Atom %s X=%ld Y=%ld sss: %s\n", A, X1, Y1, sss); if (nobonds) { /*initialize the Point structure if no bonds, only labels, defined*/ Count++; Last = Point; Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = X1; Point->Y = Y1; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; Point->Last = Last; } Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" [%ld]\n", Point->RecCount); Point->C = 0; /*we substitute -CH_x(-) by -R(-)*/ Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->Ag = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; mul = 1; gmul = 1; ggmul = 1; while (*A != '\0') { stripped = false; if ((int)strlen(A) >= 5) { snprintf(subs,256, "%.5s", A); if ((int)strlen(A) > 6) { if (A[5] == '_') { if (A[6]!= '{') { snprintf(STR2,256, "%c", A[6]); if (A[7]=='_') snprintf(STR2,256, "%c%c", A[6],A[8]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=7; while(A[mul]!='}'){STR2[mul-7]=A[mul]; mul++ ; } STR2[mul-6]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "TBDMS")) { /*Tert-butyldimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 15; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (!strcmp(subs, "TBDPS")) { /*Tert-butyldiphenylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 16; Point->H += mul * 19; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (A[0] == '[') { ggmpos = strpos2(A, "]", 1); if (ggmpos != 0) { if (A[ggmpos] == '_') { if (A[ggmpos+1]!= '{') { snprintf(STR2,256, "%c", A[ggmpos+1]); if (A[ggmpos+2]=='_') snprintf(STR2,256, "%c%c", A[ggmpos+1],A[ggmpos+3]); code = (sscanf(STR2, "%ld", &ggmul) == 0); }else{ ggmul=ggmpos+2; while(A[ggmul]!='}'){STR2[ggmul-ggmpos-2]=A[ggmul]; ggmul++ ; } STR2[ggmul-ggmpos-1]='\0'; code = (sscanf(STR2, "%ld", &ggmul) == 0); } } else ggmul = 1; } } if (A[0] == '(') { gmpos = strpos2(A, ")", 1); if (gmpos != 0) { if (A[gmpos] == '_') { if (A[gmpos+1]!= '{') { snprintf(STR2,256, "%c", A[gmpos+1]); if (A[gmpos+2]=='_') snprintf(STR2,256, "%c%c", A[gmpos+1],A[gmpos+3]); code = (sscanf(STR2, "%ld", &gmul) == 0); }else{ gmul=gmpos+2; while(A[gmul]!='}'){STR2[gmul-gmpos-2]=A[gmul]; gmul++ ; } STR2[gmul-gmpos-1]='\0'; code = (sscanf(STR2, "%ld", &gmul) == 0); } } else gmul = 1; } } } if ((int)strlen(A) >= 4 && !stripped) { snprintf(subs,256, "%.4s", A); if ((int)strlen(A) > 5) { if (A[4] == '_') { if (A[5]!= '{') { snprintf(STR2,256, "%c", A[5]); if (A[6]=='_') snprintf(STR2,256, "%c%c", A[5],A[7]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=6; while(A[mul]!='}'){STR2[mul-6]=A[mul]; mul++ ; } STR2[mul-5]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "DBAM")) { /*dibutylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 9; Point->H += mul * 19; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMAM")) { /*dimethylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMTr")) { /*dimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 21; Point->H += mul * 19; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "MMTr")) { /*monomethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 20; Point->H += mul * 16; Point->O += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "TMTr")) { /*trimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 22; Point->H += mul * 22; Point->O += mul * 3; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } } if ((int)strlen(A) >= 3 && !stripped) { snprintf(subs,256, "%.3s", A); if ((int)strlen(A) > 4) { if (A[3] == '_') { if (A[4]!= '{') { snprintf(STR2,256, "%c", A[4]); if (A[5]=='_') snprintf(STR2,256, "%c%c", A[4],A[6]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=5; while(A[mul]!='}'){STR2[mul-5]=A[mul]; mul++ ; } STR2[mul-4]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ade")) { /*Adeninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "BOC")) { /*Butyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 9; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Cyt")) { /*Cytosinyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 4; Point->N += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Gua")) { /*Guaninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iBu")) { /*iso-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iPr")) { /*2-Propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOC")) { /*Methoxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOM")) { /*Methoxymethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "tBu")) { /*t-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Thy")) { /*Thyminyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 5; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "TMS")) { /*Trimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 9; Point->Si += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Tol")) { /*tolyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Ura")) { /*Uracilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 3; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } } if ((int)strlen(A) >= 2 && !stripped) { snprintf(subs,256, "%.2s", A); if ((int)strlen(A) > 3) { if (A[2] == '_') { if (A[3]!= '{') { snprintf(STR2,256, "%c", A[3]); if (A[4]=='_') snprintf(STR2,256, "%c%c", A[3],A[5]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=4; while(A[mul]!='}'){STR2[mul-4]=A[mul]; mul++ ; } STR2[mul-3]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ac")) { /*acetyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Al")) { /*alumin(i)um*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Al += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ag")) { /*silver*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ag += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "As")) { /*arsenic*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->As += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Au")) { /*gold*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Au += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ba")) { /*barium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ba += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Be")) { /*beryllium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Be += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bi")) { /*bismuth*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Bi += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bn")) { /*benzyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Br")) { /*bromine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Br += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bu")) { /*butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bz")) { /*benzoyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "CE")) { /*cyanoethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 4; Point->N += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cl")) { /*chlorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ca")) { /*calcium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ca += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cd")) { /*cadmium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cd += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Co")) { /*cobalt*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Co += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cr")) { /*chromium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cs")) { /*cesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cs += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cu")) { /*copper*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cu += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Et")) { /*ethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Fe")) { /*iron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Fe += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ga")) { /*gallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ga += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ge")) { /*germanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ge += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Hf")) { /*hafnium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Hf += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Hg")) { /*mercury*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Hg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "In")) { /*indium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->In += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ir")) { /*iridium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ir += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Li")) { /*lithium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Li += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Lu")) { /*lutetium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Lu += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Me")) { /*methyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ms")) { /*methanesulfonyl, mesyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mg")) { /*magnesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mn")) { /*manganese*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mo")) { /*molybdenum*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mo += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Na")) { /*sodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Na += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Nb")) { /*niobium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Nb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ni")) { /*nickel*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ni += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Os")) { /*osmium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Os += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pb")) { /*lead*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pd")) { /*palladium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pd += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ph")|| !strcmp(subs,"@F")) { /*phenyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pr")) { /*propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pt")) { /*platinum*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pt += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Rb")) { /*rubidium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Rb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Re")) { /*rhenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Re += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Rh")) { /*rhodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Rh += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ru")) { /*ruthenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ru += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sb")) { /*antimony*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sc")) { /*scandium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sc += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Se")) { /*selenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Se += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sn")) { /*tin*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sr")) { /*strontium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ta")) { /*tantal*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ta += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Te")) { /*tellurium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Te += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ti")) { /*titanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ti += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tf")) { /*trifluoromethanesulfonyl, triflyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->F += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tl")) { /*thallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Tl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tr")) { /*trityl, triphenylmethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 19; Point->H += mul * 15; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ts")) { /*toluenesulfonyl, tosyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Si")) { /*silicon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Si += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Zn")) { /*zinc*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Zn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Zr")) { /*zirconium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Zr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } } if ((int)strlen(A) < 1 || stripped) continue; snprintf(subs,256, "%.1s", A); if ((int)strlen(A) > 2) { if (A[1] == '_') { if (A[2]!= '{') { snprintf(STR2,256, "%c", A[2]); if (A[3]=='_') snprintf(STR2,256, "%c%c", A[2],A[4]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=3; while(A[mul]!='}'){STR2[mul-3]=A[mul]; mul++ ; } STR2[mul-2]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "B")) { /*boron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->B += mul; } if (!strcmp(subs, "C")) { /*carbon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; } if (!strcmp(subs, "F")) { /*fluorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->F += mul; } if (!strcmp(subs, "H")) { /*hydrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->H += mul; } if (!strcmp(subs, "I")) { /*iodine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->I += mul; } if (!strcmp(subs, "K")) { /*potassium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->K += mul; } if (!strcmp(subs, "N")) { /*nitrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->N += mul; } if (!strcmp(subs, "O")) { /*oxygen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->O += mul; } if (!strcmp(subs, "P")) { /*phosphorus*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->P += mul; } if (!strcmp(subs, "S")) { /*sulfur*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->S += mul; } if (!strcmp(subs, "V")) { /*vanadium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->V += mul; } if (!strcmp(subs, "W")) { /*tungsten*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->W += mul; } if (!strcmp(subs, "Y")) { /*yttrium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ytt += mul; } if (!strcmp(subs, "Z")) { /*"Z", Benzyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul * 2; } if (!strcmp(subs, ")")) /*reset gmul*/ gmul = 1; if (!strcmp(subs, "]")) { /*reset gmul,ggmul*/ gmul = 1; ggmul = 1; } if (true) strcpy(A, strsub(STR2, A, 2, (int)(strlen(A) - 1))); } } Point = Point->Last; } Point = Current; } } main(argc, argv) int argc; Char *argv[]; { Char STR1[256], STR2[256]; Char *TEMP; boolean interactive=false; PASCAL_MAIN(argc, argv); IFile = NULL; if (P_argc == 1) { printf("enter \"cht -h\" for help\n"); _Escape(0); } C = 0; H = 0; N = 0; O = 0; P = 0; S = 0; Si = 0; B = 0; Br = 0; I = 0; Cl = 0; F = 0; Al = 0; Ag = 0; As = 0; Au = 0; Ba = 0; Be = 0; Bi = 0; Ca = 0; Cd = 0; Co = 0; Cr = 0; Cs = 0; Cu = 0; Fe = 0; Ga = 0; Ge = 0; Hf = 0; Hg = 0; In = 0; Ir = 0; Li = 0; Lu = 0; Mg = 0; Mn = 0; Mo = 0; Na = 0; Nb = 0; Ni = 0; Os = 0; K = 0; Pb = 0; Pd = 0; Pt = 0; Rb = 0; Re = 0; Rh = 0; Ru = 0; Sb = 0; Sc = 0; Se = 0; Sn = 0; Sr = 0; Ta = 0; Te = 0; Ti = 0; Tl = 0; V = 0; W = 0; Ytt = 0; Zn = 0; Zr = 0; verbose = false; debug = false; fa = false; /*no file assigned*/ Count = 0; *Alert = '\0'; for (rep = 1; rep < P_argc; rep++) { if (!strcmp(strcpy(STR2, P_argv[rep]), "-v") || !strcmp(strcpy(STR1, P_argv[rep]), "--verbose")) verbose = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-d") || !strcmp(strcpy(STR1, P_argv[rep]), "--debug")) debug = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-i") || !strcmp(strcpy(STR1, P_argv[rep]), "--interpret")) interactive = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-h") || !strcmp(strcpy(STR1, P_argv[rep]), "--help")) { printf("The Chemtool drawings analyzer 1.7\n"); printf("*** Gizmo Head Software ***\n"); printf(" Radek Liboska (c) 2001\n\n"); printf("syntax: cht [-options] \n\n"); printf("Recognizes C,H,O,N,P,S,Si,B,Br,I,Cl,F,Al,Ag,As,Au,Ba,Be,Bi,Ca,Cd,Co,Cr,Cs,Cu,\nFe,Ga,Ge,Hf,Hg,In,Ir,Li,Lu,Mg,Mn,Mo,Na,Nb,Ni,Os,K,Pb,Pd,Pt,Rb,Re,Rh,Ru,Sb,Sc,Se,Sn,Sr,\nTa,Te,Ti,Tl,V,W,Y,Zn,Zr\n"); printf( " Ac,Ade,Bn,Bu,Bz,BOC,Cyt,CE,DBAM,DMAM,DMTr,Et,Gua,iBu,iPr,Me,Ms,MOC,\n"); printf( " MOM,MMTr,Ph,Pr,tBu,Tf,Thy,Tol,Tr,Ts,TBDMS,TBDPS,TMS,TMTr,Ura,Z\n"); printf("Can handle two levels of parentheses; e.g. P[OCH(CH_3)_2]_3\n\n"); printf("options:\n"); printf(" -h or --help : this help\n"); printf(" -v or --verbose : be verbose\n"); printf(" -d or --debug : be more verbose\n\n"); _Escape(0); } if (strcpy(STR2, P_argv[rep])[0] != '-') { strcpy(STR1, P_argv[rep]); strcpy(IFile_NAME, STR1); fa = true; } } if (!fa && !interactive) { printf("No file defined, enter \"cht -h\" for help\n"); _Escape(1); } if (!interactive){ if (IFile != NULL) IFile = freopen(IFile_NAME, "r", IFile); else IFile = fopen(IFile_NAME, "r"); if (IFile == NULL) _EscIO2(FileNotFound, IFile_NAME); }else { if (IFile)fclose(IFile); IFile=tmpfile(); fprintf(IFile,"Chemtool Version 1.0\ngeometry 100 100\n\bonds 0\natoms 1\n0 0 %s 0\n",IFile_NAME); rewind(IFile); } Point = (TPoint *)malloc(sizeof(TPoint)); if (Point == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Point->X = 0; Point->Y = 0; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->As = 0; Point->Au = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->Hf = 0; Point->Hg = 0; Point->In = 0; Point->Ir = 0; Point->Li = 0; Point->Lu = 0; Point->Mg = 0; Point->Mn = 0; Point->Mo = 0; Point->Na = 0; Point->Nb = 0; Point->Ni = 0; Point->Os = 0; Point->K = 0; Point->Pb = 0; Point->Pd = 0; Point->Pt = 0; Point->Rb = 0; Point->Re = 0; Point->Rh = 0; Point->Ru = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Ta = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->W = 0; Point->Ytt = 0; Point->Zn = 0; Point->Zr = 0; Point->RecCount = Count; Point->Last = NULL; Bond = (TBond *)malloc(sizeof(TBond)); if (Bond == NULL) { fprintf(stderr,"Could not allocate memory\n"); exit(1); } Bond->X1 = 0; Bond->Y1 = 0; Bond->X2 = 0; Bond->Y2 = 0; Bond->RecCount = Count; Bond->Last = NULL; (void)fgets(sss, 256, IFile); TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; snprintf(sss,256, "%.18s", strcpy(STR1, sss)); if (strcmp(sss, "Chemtool Version 1")) { printf("Not a chemtool 1.x file, enter \"cht -h\" for help\n"); printf("file starts: %s\n",sss); _Escape(2); } fscanf(IFile, "%*[^\n]"); getc(IFile); (void)fgets(sssb, 7, IFile); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } fscanf(IFile, "%ld%*[^\n]", &bonds); getc(IFile); if (bonds == 0) nobonds = true; if (!strcmp(sssb, "bonds ")) { if (bonds > 0) doBonds(); } (void)fgets(sssb, 7, IFile); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } fscanf(IFile, "%ld%*[^\n]", &atoms); getc(IFile); if (!strcmp(sssb, "atoms ")) { if (atoms > 0) doLabels(); } if (IFile != NULL) fclose(IFile); IFile = NULL; if (verbose) printf("---------------------- Summary -------------------------\n"); while (Point->Last != NULL) { if (verbose) printf( "RecCount: %ld X=%ld Y=%ld C%ld H%ld N%ld O%ld P%ld S%ld Si%ld B%ld\nBr%ld Cl%ld F%ld I%ld Al%ld Ag%ld As%ld Au%ld Ba%ld Be%ld Bi%ld Ca%ld Cd%ld Co%ld\nCr%ld Cs%ld Cu%ld Fe%ld Ga%ld Ge%ld Hf%ld Hg%ld In%ld Ir%ld Li%ld Lu%ld Mg%ld Mn%ld\n Mo%ld Na%ld Nb%ld Ni%ld Os%ld K%ld Pb%ld Pd%ld Pt%ld Rb%ld Re%ld Rh%ld Ru%ld Sb%ld\n Sc%ld Se%ld Sn%ld Sr%ld Ta%ld Te%ld Ti%ld Tl%ld V%ld W%ld Y%ld Zn%ld Zr%ld\n", Point->RecCount, Point->X, Point->Y, Point->C, Point->H, Point->N, Point->O, Point->P, Point->S, Point->Si, Point->B, Point->Br, Point->Cl, Point->F, Point->I, Point->Al, Point->Ag, Point->As, Point->Au, Point->Ba, Point->Be,Point->Bi, Point->Ca, Point->Cd, Point->Co, Point->Cr, Point->Cs,Point->Cu,Point->Fe,Point->Ga,Point->Ge,Point->Hf,Point->Hg, Point->In, Point->Ir, Point->Li,Point->Lu,Point->Mg, Point->Mn, Point->Mo, Point->Na, Point->Nb,Point->Ni, Point->Os,Point->K,Point->Pb,Point->Pd, Point->Pt, Point->Rb, Point->Re, Point->Rh, Point->Ru, Point->Sb,Point->Sc,Point->Se,Point->Sn,Point->Sr,Point->Ta, Point->Te,Point->Ti,Point->Tl,Point->V,Point->W,Point->Ytt,Point->Zn,Point->Zr); C += Point->C; H += Point->H; N += Point->N; O += Point->O; P += Point->P; S += Point->S; Si += Point->Si; B += Point->B; Br += Point->Br; Cl += Point->Cl; F += Point->F; I += Point->I; Al += Point->Al; Ag += Point->Ag; As += Point->As; Au += Point->Au; Ba += Point->Ba; Be += Point->Be; Bi += Point->Bi; Ca += Point->Ca; Cd += Point->Cd; Co += Point->Co; Cr += Point->Cr; Cs += Point->Cs; Cu += Point->Cu; Fe += Point->Fe; Ga += Point->Ga; Ge += Point->Ge; Hf += Point->Hf; Hg += Point->Hg; In += Point->In; Ir += Point->Ir; Li += Point->Li; Lu += Point->Lu; Mg += Point->Mg; Mn += Point->Mn; Mo += Point->Mo; Na += Point->Na; Nb += Point->Nb; Ni += Point->Ni; Os += Point->Os; K += Point->K; Pb += Point->Pb; Pd += Point->Pd; Pt += Point->Pt; Rb += Point->Rb; Re += Point->Re; Rh += Point->Rh; Ru += Point->Ru; Sb += Point->Sb; Sc += Point->Sc; Se += Point->Se; Sn += Point->Sn; Sr += Point->Sr; Ta += Point->Ta; Te += Point->Te; Ti += Point->Ti; Tl += Point->Tl; V += Point->V; W += Point->W; Ytt += Point->Ytt; Zn += Point->Zn; Zr += Point->Zr; Point = Point->Last; } if (H < 0) /*overlapped bonds*/ H = 0; M = (double)C * 12.011 + (double)H * 1.0079 + (double)N * 14.0067 + (double)O * 15.9994 + (double)P * 30.97376 + (double)S * 32.064 + (double)Si * 28.086 + (double)B * 10.81 + (double)Br * 79.904 + (double)Cl * 35.453 + (double)F * 18.9984 + (double)I * 126.9045 + (double)Mg * 24.305 + (double)Na * 22.98977 + (double)K * 39.098 + (double)Ca * 40.08 + (double)Cd * 112.41 + (double)Co * 58.933 + (double)Cr * 51.996 + (double)Cu * 63.546 + (double)Fe * 55.847 + (double)Li * 6.941 + (double)Mn * 54.938 + (double)Ni * 58.69 + (double)Al * 26.981539 + (double)Ba * 137.327 + (double)Cs * 132.90543 + (double)As * 74.92159 + (double)Be *9.012182 + (double)Ga * 69.723 + (double)Ge * 72.61 + (double)Sb * 121.75 + (double)Sc * 44.95591 + (double)Se * 78.96 + (double)Sn * 118.710 + (double)Sr * 87.62 + (double)Rb * 85.4678 + (double)Te * 127.60 + (double)Ti * 47.88 + (double)V * 50.9415 + (double)Zn * 65.39 + (double)In * 114.82 + (double)Bi * 208.98037 + (double)Pb *207.2 + (double)Tl * 204.3833 + (double)Zr *91.224 + (double)Nb * 92.906 + (double)Mo*95.94 + (double)Ru * 101.07 + (double)Rh *102.9055 + (double)Re * 186.207 + (double)Pd *106.42 + (double)Ag *107.868 + (double)Pt *195.078 + (double)Ir * 192.217 + (double)Hg * 200.59 + (double)Os *190.2 + (double)W * 183.84 + (double)Au * 196.966 + (double)Ta *180.948 + (double)Hf * 178.49 + (double)Ytt * 88.906 + (double)Lu *174.967; Me = (double)C * 12. + (double)H * 1.007825037 + (double)N * 14.003074008 + (double)O * 15.99491464 + (double)P * 30.9737634 + (double)S * 31.9720718 + (double)Si * 27.9769284 + (double)B * 11.0093053 + (double)Br * 78.9183361 + (double)Cl * 34.968852729 + (double)F * 18.99840325 + (double)I * 126.904477 + (double)Mg * 23.9850450 + (double)Na * 22.9897697 + (double)K * 38.9637079 + (double)Ca * 39.9626 + (double)Cd * 113.9034 + (double)Co * 58.9332 + (double)Cr * 51.9405 + (double)Cu * 62.9296 + (double)Fe * 55.9349 +(double)Li * 7.0160 + (double)Mn * 54.93805 + (double)Ni * 57.9353 + (double)Al * 26.981539 + (double)Ba * 137.9052 + (double)Cs * 132.90543 + (double)As * 74.92159 + (double)Be * 9.012182 + (double)Ga * 68.9256 + (double)Ge * 73.9212 + (double)Sb * 120.9038 + (double)Sc * 44.95591 + (double)Se *79.9165 + (double)Sn * 119.9022 + (double)Sr * 87.9056 + (double)Rb * 84.9118 + (double)Te * 129.9062 + (double)Ti * 47.9479 + (double)V * 50.9440 + (double)Zn * 63.9291 + (double)In * 114.9039 + (double)Bi * 208.98037 + (double)Pb * 207.9766 + (double)Tl * 204.9744 + (double)Zr * 89.9047 + (double)Nb *92.9064 + (double)Mo * 97.9054 + (double)Ru * 101.9043 + (double)Rh * 102.9055 + (double)Re * 186.9558 + (double)Pd * 105.9035 +(double)Ag * 106.9051 + (double)Pt * 194.9648 + (double)Ir * 192.9629 + (double)Hg * 201.9706 +(double)Os * 191.9615 + (double)W * 183.9510 + (double)Au * 196.9666 + (double)Ta * 180.9480 + (double)Hf * 179.9466 + (double)Ytt * 88.9059 + (double)Lu * 174.9408; if (Me > 0 && *Alert == '\0') { if (C > 1) printf("C%ld", C); if (C == 1) putchar('C'); if (H > 1) printf("H%ld", H); if (H == 1) putchar('H'); if (N > 1) printf("N%ld", N); if (N == 1) putchar('N'); if (O > 1) printf("O%ld", O); if (O == 1) putchar('O'); if (P > 1) printf("P%ld", P); if (P == 1) putchar('P'); if (S > 1) printf("S%ld", S); if (S == 1) putchar('S'); if (Si > 1) printf("Si%ld", Si); if (Si == 1) printf("Si"); if (B > 1) printf("B%ld", B); if (B == 1) putchar('B'); if (Br > 1) printf("Br%ld", Br); if (Br == 1) printf("Br"); if (Cl > 1) printf("Cl%ld", Cl); if (Cl == 1) printf("Cl"); if (F > 1) printf("F%ld", F); if (F == 1) putchar('F'); if (I > 1) printf("I%ld", I); if (I == 1) putchar('I'); if (Ag > 1) printf("Ag%ld", Ag); if (Ag == 1) printf("Ag"); if (Al > 1) printf("Al%ld", Al); if (Al == 1) printf("Al"); if (As > 1) printf("As%ld", As); if (As == 1) printf("As"); if (Au > 1) printf("Au%ld", Au); if (Au == 1) printf("Au"); if (Ba > 1) printf("Ba%ld", Ba); if (Ba == 1) printf("Ba"); if (Be > 1) printf("Be%ld", Be); if (Be == 1) printf("Be"); if (Bi > 1) printf("Bi%ld", Bi); if (Bi == 1) printf("Bi"); if (Ca > 1) printf("Ca%ld", Ca); if (Ca == 1) printf("Ca"); if (Cd > 1) printf("Cd%ld", Cd); if (Cd == 1) printf("Cd"); if (Co > 1) printf("Co%ld", Co); if (Co == 1) printf("Co"); if (Cr > 1) printf("Cr%ld", Cr); if (Cr == 1) printf("Cr"); if (Cs > 1) printf("Cs%ld", Cs); if (Cs == 1) printf("Cs"); if (Cu > 1) printf("Cu%ld", Cu); if (Cu == 1) printf("Cu"); if (Fe > 1) printf("Fe%ld", Fe); if (Fe == 1) printf("Fe"); if (Ga > 1) printf("Ga%ld", Ga); if (Ga == 1) printf("Ga"); if (Ge > 1) printf("Ge%ld", Ge); if (Ge == 1) printf("Ge"); if (Hf > 1) printf("Hf%ld", Hf); if (Hf == 1) printf("Hf"); if (Hg > 1) printf("Hg%ld", Hg); if (Hg == 1) printf("Hg"); if (In > 1) printf("In%ld", In); if (In == 1) printf("In"); if (Ir > 1) printf("Ir%ld", Ir); if (Ir == 1) printf("Ir"); if (K > 1) printf("K%ld", K); if (K == 1) putchar('K'); if (Li > 1) printf("Li%ld", Li); if (Li == 1) printf("Li"); if (Lu > 1) printf("Lu%ld", Lu); if (Lu == 1) printf("Lu"); if (Mg > 1) printf("Mg%ld", Mg); if (Mg == 1) printf("Mg"); if (Mn > 1) printf("Mn%ld", Mn); if (Mn == 1) printf("Mn"); if (Mo > 1) printf("Mo%ld", Mo); if (Mo == 1) printf("Mo"); if (Na > 1) printf("Na%ld", Na); if (Na == 1) printf("Na"); if (Nb > 1) printf("Nb%ld", Nb); if (Nb == 1) printf("Nb"); if (Ni > 1) printf("Ni%ld", Ni); if (Ni == 1) printf("Ni"); if (Os > 1) printf("Os%ld", Os); if (Os == 1) printf("Os"); if (Pb > 1) printf("Pb%ld", Pb); if (Pb == 1) printf("Pb"); if (Pd > 1) printf("Pd%ld", Pd); if (Pd == 1) printf("Pd"); if (Pt > 1) printf("Pt%ld", Pt); if (Pt == 1) printf("Pt"); if (Rb > 1) printf("Rb%ld", Rb); if (Rb == 1) printf("Rb"); if (Re > 1) printf("Re%ld", Re); if (Re == 1) printf("Re"); if (Rh > 1) printf("Rh%ld", Rh); if (Rh == 1) printf("Rh"); if (Ru > 1) printf("Rb%ld", Ru); if (Ru == 1) printf("Ru"); if (Sb > 1) printf("Sb%ld", Sb); if (Sb == 1) printf("Sb"); if (Sc > 1) printf("Sc%ld", Sc); if (Sc == 1) printf("Sc"); if (Se > 1) printf("Se%ld", Se); if (Se == 1) printf("Se"); if (Sn > 1) printf("Sn%ld", Sn); if (Sn == 1) printf("Sn"); if (Sr > 1) printf("Sr%ld", Sr); if (Sr == 1) printf("Sr"); if (Ta > 1) printf("Ta%ld", Ta); if (Ta == 1) printf("Ta"); if (Te > 1) printf("Te%ld", Te); if (Te == 1) printf("Te"); if (Ti > 1) printf("Ti%ld", Ti); if (Ti == 1) printf("Ti"); if (Tl > 1) printf("Tl%ld", Tl); if (Tl == 1) printf("Tl"); if (V > 1) printf("V%ld", V); if (V == 1) printf("V"); if (W > 1) printf("W%ld", W); if (W == 1) printf("W"); if (Ytt > 1) printf("Y%ld", Ytt); if (Ytt == 1) printf("Y"); if (Zn > 1) printf("Zn%ld", Zn); if (Zn == 1) printf("Zn"); if (Zr > 1) printf("Zr%ld", Zr); if (Zr == 1) printf("Zr"); printf(" [%2.3f]", M); printf(" Me=%2.10f ", Me); if (C > 0) printf("%4.2f%%C;", (double)C * 12.011 * 100 / M); if (H > 0) printf("%4.2f%%H;", (double)H * 1.0079 * 100 / M); if (B > 0) printf("%4.2f%%B;", (double)B * 10.81 * 100 / M); if (N > 0) printf("%4.2f%%N;", (double)N * 14.0067 * 100 / M); if (O > 0) printf("%4.2f%%O;", (double)O * 15.9994 * 100 / M); if (P > 0) printf("%4.2f%%P;", (double)P * 30.97376 * 100 / M); if (S > 0) printf("%4.2f%%S;", (double)S * 32.0640 * 100 / M); if (K > 0) printf("%4.2f%%K;", (double)K * 39.098 * 100 / M); if (Mg > 0) printf("%4.2f%%Mg;", (double)Mg * 24.305 * 100 / M); if (Na > 0) printf("%4.2f%%Na;", (double)Na * 22.98977 * 100 / M); if (Si > 0) printf("%4.2f%%Si;", (double)Si * 28.086 * 100 / M); if (Br > 0) printf("%4.2f%%Br;", (double)Br * 79.904 * 100 / M); if (Cl > 0) printf("%4.2f%%Cl;", (double)Cl * 35.453 * 100 / M); if (F > 0) printf("%4.2f%%F;", (double)F * 18.9984 * 100 / M); if (I > 0) printf("%4.2f%%I;", (double)I * 126.9045 * 100 / M); if (Ag >0) printf("%4.2f%%Ag;", (double)Ag * 107.868 * 100 / M); if (Al >0) printf("%4.2f%%Al;", (double)Al * 26.981539 * 100 / M); if (As >0) printf("%4.2f%%As;", (double)As * 74.92159 * 100 / M); if (Au >0) printf("%4.2f%%Au;", (double)Au * 196.966 * 100 / M); if (Ba >0) printf("%4.2f%%Ba;", (double)Ba * 137.327 * 100 / M); if (Be >0) printf("%4.2f%%Be;", (double)Be * 9.012182 * 100 / M); if (Bi >0) printf("%4.2f%%Bi;", (double)Bi * 208.98037 * 100 / M); if (Ca >0) printf("%4.2f%%Ca;", (double)Ca * 40.08 * 100 / M); if (Cd >0) printf("%4.2f%%Cd;", (double)Cd * 112.41 * 100 / M); if (Co >0) printf("%4.2f%%Co;", (double)Co * 58.993 * 100 / M); if (Cr >0) printf("%4.2f%%Cr;", (double)Cr * 51.996 * 100 / M); if (Cs >0) printf("%4.2f%%Cs;", (double)Cs * 132.90543 * 100 / M); if (Cu >0) printf("%4.2f%%Cu;", (double)Cu * 63.546 * 100 / M); if (Fe >0) printf("%4.2f%%Fe;", (double)Fe * 55.847 * 100 / M); if (Ga >0) printf("%4.2f%%Ga;", (double)Ga * 69.723 * 100 / M); if (Ge >0) printf("%4.2f%%Ge;", (double)Ge * 72.61 * 100 / M); if (Hf >0) printf("%4.2f%%Hf;", (double)Hf * 178.49 * 100 / M); if (Hg >0) printf("%4.2f%%Hg;", (double)Hg * 200.59 * 100 / M); if (In >0) printf("%4.2f%%In;", (double)In * 114.82 * 100 / M); if (Ir >0) printf("%4.2f%%Ir;", (double)Ir * 192.217 * 100 / M); if (Li >0) printf("%4.2f%%Li;", (double)Li * 6.941 * 100 / M); if (Lu >0) printf("%4.2f%%Lu;", (double)Lu * 174.967 * 100 / M); if (Mn >0) printf("%4.2f%%Mn;", (double)Mn * 54.938 * 100 / M); if (Mo >0) printf("%4.2f%%Mo;", (double)Mo * 95.94 * 100 / M); if (Nb >0) printf("%4.2f%%Nb;", (double)Nb * 92.906 *100 / M); if (Ni >0) printf("%4.2f%%Ni;", (double)Ni * 58.69 *100 / M); if (Os >0) printf("%4.2f%%Os;", (double)Os * 190.2 *100 / M); if (Pb >0) printf("%4.2f%%Pb;", (double)Pb * 207.2 *100 / M); if (Pd >0) printf("%4.2f%%Pd;", (double)Pd * 106.42 *100 / M); if (Pt >0) printf("%4.2f%%Pt;", (double)Pt * 195.078 *100 / M); if (Rb >0) printf("%4.2f%%Rb;", (double)Rb * 85.4678 *100 / M); if (Re >0) printf("%4.2f%%Re;", (double)Re * 186.207 *100 / M); if (Rh >0) printf("%4.2f%%Rh;", (double)Rh * 102.9055 *100 / M); if (Ru >0) printf("%4.2f%%Ru;", (double)Ru * 101.07 *100 / M); if (Sb >0) printf("%4.2f%%Sb;", (double)Sb * 121.75 *100 / M); if (Sc >0) printf("%4.2f%%Sc;", (double)Sc * 44.95591 *100 / M); if (Se >0) printf("%4.2f%%Se;", (double)Se * 78.96 *100 / M); if (Sn >0) printf("%4.2f%%Sn;", (double)Sn * 118.71 *100 / M); if (Sr >0) printf("%4.2f%%Sr;", (double)Sr * 87.62 *100 / M); if (Ta >0) printf("%4.2f%%Ta;", (double)Ta * 180.948 *100 / M); if (Te >0) printf("%4.2f%%Te;", (double)Te * 127.60 *100 / M); if (Ti >0) printf("%4.2f%%Ti;", (double)Ti * 47.88 *100 / M); if (Tl >0) printf("%4.2f%%Tl;", (double)Tl * 204.3833 *100 / M); if (V >0) printf("%4.2f%%V;", (double)V * 50.9415 *100 / M); if (W >0) printf("%4.2f%%W;", (double)W * 183.84 *100 / M); if (Ytt >0) printf("%4.2f%%Y;", (double)Ytt * 88.906 *100 / M); if (Zn >0) printf("%4.2f%%Zn;", (double)Zn * 65.39 *100. / M); if (Zr >0) printf("%4.2f%%Zr;", (double)Zr * 91.224 *100. / M); } else { if (*Alert != '\0') printf("%s overlapped bonds !", Alert); else printf("C0H0 [0.00] Me=0.0000000000 0.00%%C;0.00%%H"); } putchar('\n'); exit(EXIT_SUCCESS); } /* End. */ chemtool-1.6.14/src-cht/cht-2.4.c0000644000175000001440000023511210715417303015421 0ustar martinusers/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */ /* From input file "cht-1.7.pp" */ #ifdef HAVE_CONFIG_H #include #endif #ifndef P2C_H #define P2C_H /* Header file for code generated by "p2c", the Pascal-to-C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version 1.21alpha-07.Dec.93. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #include #include #define DOUBLE double /* If the following heuristic fails, compile -DBSD=0 for non-BSD systems, or -DBSD=1 for BSD systems. */ #ifdef M_XENIX # define BSD 0 #endif #ifdef vms # define BSD 0 # ifndef __STDC__ # define __STDC__ 1 # endif #endif #ifdef __TURBOC__ # define MSDOS 1 #endif #ifdef MSDOS # define BSD 0 #endif #ifdef FILE /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */ # ifndef BSD /* (a convenient, but horrible kludge!) */ # define BSD 1 # endif #endif #ifdef BSD # if !BSD # undef BSD # endif #endif #if (defined(__STDC__) && !defined(M_XENIX)) || defined(__TURBOC__) # include # include # define HAS_STDLIB # if defined(vms) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #else # ifndef BSD # ifndef __TURBOC__ # include # endif # endif # ifdef hpux # ifdef _INCLUDE__STDC__ # include # include # define HAS_STDLIB # endif # endif # include # if !defined(MSDOS) || defined(__TURBOC__) # define NON_ANSI_CAT # endif #endif #if defined(NON_ANSI_CAT) && !defined(ANSI_CAT) # ifdef NON_ANSI_CAT_ALTERNATE # define __CAT__(a,b)a/**/b # else # define __ID__(a)a # define __CAT__(a,b)__ID__(a)b # endif #else # define __CAT__(a,b)a##b #endif #ifdef BSD # include # define memcpy(a,b,n) (bcopy(b,a,n),a) # define memcmp(a,b,n) bcmp(a,b,n) # define strchr(s,c) index(s,c) # define strrchr(s,c) rindex(s,c) #else # include #endif #include #include #include #include #ifndef NO_LACK #ifdef vms #define LACK_LABS #define LACK_MEMMOVE #define LACK_MEMCPY #else #define LACK_LABS /* Undefine these if your library has these */ #define LACK_MEMMOVE #endif #endif typedef struct __p2c_jmp_buf { struct __p2c_jmp_buf *next; jmp_buf jbuf; } __p2c_jmp_buf; /* Warning: The following will not work if setjmp is used simultaneously. This also violates the ANSI restriction about using vars after longjmp, but a typical implementation of longjmp will get it right anyway. */ #ifndef FAKE_TRY # define TRY(x) do { __p2c_jmp_buf __try_jb; \ __try_jb.next = __top_jb; \ if (!setjmp((__top_jb = &__try_jb)->jbuf)) { # define RECOVER(x) __top_jb = __try_jb.next; } else { # define RECOVER2(x,L) __top_jb = __try_jb.next; } else { \ if (0) { L: __top_jb = __try_jb.next; } # define ENDTRY(x) } } while (0) #else # define TRY(x) if (1) { # define RECOVER(x) } else do { # define RECOVER2(x,L) } else do { L: ; # define ENDTRY(x) } while (0) #endif #ifdef M_XENIX /* avoid compiler bug */ # define SHORT_MAX (32767) # define SHORT_MIN (-32768) #endif /* The following definitions work only on twos-complement machines */ #ifndef SHORT_MAX # define SHORT_MAX ((short)(((unsigned short) -1) >> 1)) # define SHORT_MIN (~SHORT_MAX) #endif #ifndef INT_MAX # define INT_MAX ((int)(((unsigned int) -1) >> 1)) # define INT_MIN (~INT_MAX) #endif #ifndef LONG_MAX # define LONG_MAX ((long)(((unsigned long) -1) >> 1)) # define LONG_MIN (~LONG_MAX) #endif #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 #endif #ifndef EXIT_SUCCESS # ifdef vms # define EXIT_SUCCESS 1 # define EXIT_FAILURE (02000000000L) # else # define EXIT_SUCCESS 0 # define EXIT_FAILURE 1 # endif #endif #define SETBITS 32 #if defined(__STDC__) || defined(__TURBOC__) # if !defined(vms) && !defined(M_LINT) # define Signed signed # else # define Signed # endif # define Void void /* Void f() = procedure */ # ifndef Const # define Const const # endif # ifndef Volatile # define Volatile volatile # endif # ifdef M_LINT # define PP(x) () # define PV() () typedef char *Anyptr; # else # define PP(x) x /* function prototype */ # define PV() (void) /* null function prototype */ typedef void *Anyptr; # endif #else # define Signed # define Void void # ifndef Const # define Const # endif # ifndef Volatile # define Volatile # endif # define PP(x) () # define PV() () typedef char *Anyptr; #endif #ifdef __GNUC__ # define Inline inline #else # define Inline #endif #define Register register /* Register variables */ #define Char char /* Characters (not bytes) */ #ifndef Static # define Static static /* Private global funcs and vars */ #endif #ifndef Local # define Local static /* Nested functions */ #endif typedef Signed char schar; typedef unsigned char uchar; typedef unsigned char boolean; #ifndef NO_DECLARE_ALFA typedef Char alfa[10]; #endif #ifndef true # define true 1 # define false 0 #endif #ifndef TRUE # define TRUE 1 # define FALSE 0 #endif typedef struct { Anyptr proc, link; } _PROCEDURE; #ifndef _FNSIZE # define _FNSIZE 120 #endif extern Void PASCAL_MAIN PP( (int, Char **) ); extern Char **P_argv; extern int P_argc; extern short P_escapecode; extern int P_ioresult; extern __p2c_jmp_buf *__top_jb; #ifdef P2C_H_PROTO /* if you have Ansi C but non-prototyped header files */ extern Char *strcat PP( (Char *, Const Char *) ); extern Char *strchr PP( (Const Char *, int) ); extern int strcmp PP( (Const Char *, Const Char *) ); extern Char *strcpy PP( (Char *, Const Char *) ); extern size_t strlen PP( (Const Char *) ); extern Char *strncat PP( (Char *, Const Char *, size_t) ); extern int strncmp PP( (Const Char *, Const Char *, size_t) ); extern Char *strncpy PP( (Char *, Const Char *, size_t) ); extern Char *strrchr PP( (Const Char *, int) ); extern Anyptr memchr PP( (Const Anyptr, int, size_t) ); extern Anyptr memmove PP( (Anyptr, Const Anyptr, size_t) ); extern Anyptr memset PP( (Anyptr, int, size_t) ); #ifndef memcpy extern Anyptr memcpy PP( (Anyptr, Const Anyptr, size_t) ); extern int memcmp PP( (Const Anyptr, Const Anyptr, size_t) ); #endif extern int atoi PP( (Const Char *) ); extern double atof PP( (Const Char *) ); extern long atol PP( (Const Char *) ); extern double strtod PP( (Const Char *, Char **) ); extern long strtol PP( (Const Char *, Char **, int) ); #endif /*P2C_H_PROTO*/ #ifndef HAS_STDLIB #ifndef NO_DECLARE_MALLOC extern Anyptr malloc PP( (size_t) ); extern Void free PP( (Anyptr) ); #endif #endif extern int _OutMem PV(); extern int _CaseCheck PV(); extern int _NilCheck PV(); extern int _Escape PP( (int) ); extern int _EscIO PP( (int) ); extern int _EscIO2 PP( (int, Char *) ); extern long ipow PP( (long, long) ); extern long P_imax PP( (long, long) ); extern long P_imin PP( (long, long) ); extern double P_rmax PP( (double, double) ); extern double P_rmin PP( (double, double) ); extern Char *strsub PP( (Char *, Char *, int, int) ); extern Char *strltrim PP( (Char *) ); extern Char *strrtrim PP( (Char *) ); extern Char *strrpt PP( (Char *, Char *, int) ); extern Char *strpad PP( (Char *, Char *, int, int) ); extern int strpos2 PP( (Char *, Char *, int) ); extern long memavail PV(); extern int P_peek PP( (FILE *) ); extern int P_eof PP( (FILE *) ); extern int P_eoln PP( (FILE *) ); extern Void P_readpaoc PP( (FILE *, Char *, int) ); extern Void P_readlnpaoc PP( (FILE *, Char *, int) ); extern long P_maxpos PP( (FILE *) ); extern Char *P_trimname PP( (Char *, int) ); extern long *P_setunion PP( (long *, long *, long *) ); extern long *P_setint PP( (long *, long *, long *) ); extern long *P_setdiff PP( (long *, long *, long *) ); extern long *P_setxor PP( (long *, long *, long *) ); extern int P_inset PP( (unsigned, long *) ); extern int P_setequal PP( (long *, long *) ); extern int P_subset PP( (long *, long *) ); extern long *P_addset PP( (long *, unsigned) ); extern long *P_addsetr PP( (long *, unsigned, unsigned) ); extern long *P_remset PP( (long *, unsigned) ); extern long *P_setcpy PP( (long *, long *) ); extern long *P_expset PP( (long *, long) ); extern long P_packset PP( (long *) ); extern FILE *_skipspaces PP( (FILE *) ); extern FILE *_skipnlspaces PP( (FILE *) ); /* I/O error handling */ #define _CHKIO(cond,ior,val,def) ((cond) ? P_ioresult=0,(val) \ : P_ioresult=(ior),(def)) #define _SETIO(cond,ior) (P_ioresult = (cond) ? 0 : (ior)) /* Following defines are suitable for the HP Pascal operating system */ #define FileNotFound 10 #define FileNotOpen 13 #define FileWriteError 38 #define BadInputFormat 14 #define EndOfFile 30 #define FILENOTFOUND 10 #define FILENOTOPEN 13 #define FILEWRITEERROR 38 #define BADINPUTFORMAT 14 #define ENDOFFILE 30 /* Creating temporary files */ #if (defined(BSD) || defined(NO_TMPFILE)) && !defined(HAVE_TMPFILE) # define tmpfile() (fopen(tmpnam(NULL), "w+")) #endif /* File buffers */ #define FILEBUF(f,sc,type) sc int __CAT__(f,_BFLAGS); \ sc type __CAT__(f,_BUFFER) #define FILEBUFNC(f,type) int __CAT__(f,_BFLAGS); \ type __CAT__(f,_BUFFER) #define RESETBUF(f,type) (__CAT__(f,_BFLAGS) = 1) #define SETUPBUF(f,type) (__CAT__(f,_BFLAGS) = 0) #define GETFBUF(f,type) (*((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(&__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ &__CAT__(f,_BUFFER))) #define AGETFBUF(f,type) ((__CAT__(f,_BFLAGS) == 1 && \ ((__CAT__(f,_BFLAGS) = 2), \ fread(__CAT__(f,_BUFFER), \ sizeof(type),1,(f)))),\ __CAT__(f,_BUFFER)) #define PUTFBUF(f,type,v) (GETFBUF(f,type) = (v)) #define CPUTFBUF(f,v) (PUTFBUF(f,char,v)) #define APUTFBUF(f,type,v) (memcpy(AGETFBUF(f,type), (v), \ sizeof(__CAT__(f,_BUFFER)))) #define GET(f,type) (__CAT__(f,_BFLAGS) == 1 ? \ fread(&__CAT__(f,_BUFFER),sizeof(type),1,(f)) : \ (__CAT__(f,_BFLAGS) = 1)) #define PUT(f,type) (fwrite(&__CAT__(f,_BUFFER),sizeof(type),1,(f)), \ (__CAT__(f,_BFLAGS) = 0)) #define CPUT(f) (PUT(f,char)) #define BUFEOF(f) (__CAT__(f,_BFLAGS) != 2 && P_eof(f)) #define BUFFPOS(f) (ftell(f) - (__CAT__(f,_BFLAGS) == 2)) typedef struct { FILE *f; int f_BFLAGS; /* FILEBUFNC(f,Char); */ Char f_BUFFER; Char name[_FNSIZE]; } _TEXT; /* Memory allocation */ #ifdef __GCC__ # define Malloc(n) (malloc(n) ?: (Anyptr)_OutMem()) #else extern Anyptr __MallocTemp__; # define Malloc(n) ((__MallocTemp__ = malloc(n)) ? __MallocTemp__ : (Anyptr)_OutMem()) #endif #define FreeR(p) (free((Anyptr)(p))) /* used if arg is an rvalue */ #define Free(p) (free((Anyptr)(p)), (p)=NULL) /* sign extension */ #define SEXT(x,n) ((x) | -(((x) & (1L<<((n)-1))) << 1)) /* packed arrays */ /* BEWARE: these are untested! */ #define P_getbits_UB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] >> \ (((~(i))&((1<<(L)-(n))-1)) << (n)) & \ (1<<(1<<(n)))-1)) #define P_getbits_SB(a,i,n,L) ((int)((a)[(i)>>(L)-(n)] << \ (16 - ((((~(i))&((1<<(L)-(n))-1))+1) <<\ (n)) >> (16-(1<<(n)))))) #define P_putbits_UB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ (x) << (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_putbits_SB(a,i,x,n,L) ((a)[(i)>>(L)-(n)] |= \ ((x) & (1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) #define P_clrbits_B(a,i,n,L) ((a)[(i)>>(L)-(n)] &= \ ~( ((1<<(1<<(n)))-1) << \ (((~(i))&((1<<(L)-(n))-1)) << (n))) ) /* small packed arrays */ #define P_getbits_US(v,i,n) ((int)((v) >> ((i)<<(n)) & (1<<(1<<(n)))-1)) #define P_getbits_SS(v,i,n) ((int)((long)(v) << (SETBITS - (((i)+1) << (n))) >> (SETBITS-(1<<(n))))) #define P_putbits_US(v,i,x,n) ((v) |= (x) << ((i) << (n))) #define P_putbits_SS(v,i,x,n) ((v) |= ((x) & (1<<(1<<(n)))-1) << ((i)<<(n))) #define P_clrbits_S(v,i,n) ((v) &= ~( ((1<<(1<<(n)))-1) << ((i)<<(n)) )) #define P_max(a,b) ((a) > (b) ? (a) : (b)) #define P_min(a,b) ((a) < (b) ? (a) : (b)) /* Fix ANSI-isms */ #ifdef LACK_LABS # ifndef labs # define labs my_labs extern long my_labs PP( (long) ); # endif #endif #ifdef LACK_MEMMOVE # ifndef memmove # define memmove my_memmove extern Anyptr my_memmove PP( (Anyptr, Const Anyptr, size_t) ); # endif #endif #ifdef LACK_MEMCPY # ifndef memcpy # define memcpy my_memcpy extern Anyptr my_memcpy PP( (Anyptr, Const Anyptr, size_t) ); # endif # ifndef memcmp # define memcmp my_memcmp extern int my_memcmp PP( (Const Anyptr, Const Anyptr, size_t) ); # endif # ifndef memset # define memset my_memset extern Anyptr my_memset PP( (Anyptr, int, size_t) ); # endif #endif /* Fix toupper/tolower on Suns and other stupid BSD systems */ #ifdef toupper # undef toupper # undef tolower # define toupper(c) my_toupper(c) # define tolower(c) my_tolower(c) #endif #ifndef _toupper # if 'A' == 65 && 'a' == 97 # define _toupper(c) ((c)-'a'+'A') # define _tolower(c) ((c)-'A'+'a') # else # ifdef toupper # undef toupper /* hope these are shadowing real functions, */ # undef tolower /* because my_toupper calls _toupper! */ # endif # define _toupper(c) toupper(c) # define _tolower(c) tolower(c) # endif #endif #endif /* P2C_H */ /* End. */ /* Run-time library for use with "p2c", the Pascal to C translator */ /* "p2c" Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation. * By Dave Gillespie, daveg@synaptics.com. Version --VERSION--. * This file may be copied, modified, etc. in any way. It is not restricted * by the licence agreement accompanying p2c itself. */ #ifndef NO_TIME # include #endif #define Isspace(c) isspace(c) /* or "((c) == ' ')" if preferred */ int P_argc; char **P_argv; short P_escapecode; int P_ioresult; long EXCP_LINE; /* Used by Pascal workstation system */ Anyptr __MallocTemp__; __p2c_jmp_buf *__top_jb; void PASCAL_MAIN(argc, argv) int argc; char **argv; { P_argc = argc; P_argv = argv; __top_jb = NULL; #ifdef LOCAL_INIT LOCAL_INIT(); #endif } /* In case your system lacks these... */ long my_labs(x) long x; { return((x > 0) ? x : -x); } #ifdef __STDC__ Anyptr my_memmove(Anyptr d, Const Anyptr s, size_t n) #else Anyptr my_memmove(d, s, n) Anyptr d, s; register int n; #endif { register char *dd = (char *)d, *ss = (char *)s; if (dd < ss || dd - ss >= n) { #if defined(bcopy) && defined(memcpy) my_memcpy(dd, ss, n); #else memcpy(dd, ss, n); #endif } else if (n > 0) { dd += n; ss += n; while (n-- > 0) *--dd = *--ss; } return d; } #ifdef __STDC__ Anyptr my_memcpy(Anyptr d, Const Anyptr s, size_t n) #else Anyptr my_memcpy(d, s, n) Anyptr d, s; register int n; #endif { register char *ss = (char *)s, *dd = (char *)d; while (n-- > 0) *dd++ = *ss++; return d; } #ifdef __STDC__ int my_memcmp(Const Anyptr s1, Const Anyptr s2, size_t n) #else int my_memcmp(s1, s2, n) Anyptr s1, s2; register int n; #endif { register char *a = (char *)s1, *b = (char *)s2; register int i; while (n-- > 0) if ((i = (*a++) - (*b++)) != 0) return i; return 0; } #ifdef __STDC__ Anyptr my_memset(Anyptr d, int c, size_t n) #else Anyptr my_memset(d, c, n) Anyptr d; register int c; register int n; #endif { register char *dd = (char *)d; while (n-- > 0) *dd++ = c; return d; } int my_toupper(c) int c; { if (islower(c)) return _toupper(c); else return c; } int my_tolower(c) int c; { if (isupper(c)) return _tolower(c); else return c; } long ipow(a, b) long a, b; { long v; if (a == 0 || a == 1) return a; if (a == -1) return (b & 1) ? -1 : 1; if (b < 0) return 0; if (a == 2) return 1L << b; v = (b & 1) ? a : 1; while ((b >>= 1) > 0) { a *= a; if (b & 1) v *= a; } return v; } long P_imax(a, b) long a, b; { if (a > b) return a; else return b; } long P_imin(a, b) long a, b; { if (a < b) return a; else return b; } double P_rmax(a, b) double a, b; { if (a > b) return a; else return b; } double P_rmin(a, b) double a, b; { if (a < b) return a; else return b; } /* Common string functions: */ /* Store in "ret" the substring of length "len" starting from "pos" (1-based). Store a shorter or null string if out-of-range. Return "ret". */ char *strsub(ret, s, pos, len) register char *ret, *s; register int pos, len; { register char *s2; if (--pos < 0 || len <= 0) { *ret = 0; return ret; } while (pos > 0) { if (!*s++) { *ret = 0; return ret; } pos--; } s2 = ret; while (--len >= 0) { if (!(*s2++ = *s++)) return ret; } *s2 = 0; return ret; } /* Return the index of the first occurrence of "pat" as a substring of "s", starting at index "pos" (1-based). Result is 1-based, 0 if not found. */ int strpos2(s, pat, pos) char *s; register char *pat; register int pos; { register char *cp, ch; register int slen; if (--pos < 0) return 0; slen = strlen(s) - pos; cp = s + pos; if (!(ch = *pat++)) return 0; pos = strlen(pat); slen -= pos; while (--slen >= 0) { if (*cp++ == ch && !strncmp(cp, pat, pos)) return cp - s; } return 0; } /* Case-insensitive version of strcmp. */ int strcicmp(s1, s2) register char *s1, *s2; { register unsigned char c1, c2; while (*s1) { if (*s1++ != *s2++) { if (!s2[-1]) return 1; c1 = toupper(s1[-1]); c2 = toupper(s2[-1]); if (c1 != c2) return c1 - c2; } } if (*s2) return -1; return 0; } /* HP and Turbo Pascal string functions: */ /* Trim blanks at left end of string. */ char *strltrim(s) register char *s; { while (Isspace(*s++)) ; return s - 1; } /* Trim blanks at right end of string. */ char *strrtrim(s) register char *s; { register char *s2 = s; if (!*s) return s; while (*++s2) ; while (s2 > s && Isspace(*--s2)) *s2 = 0; return s; } /* Store in "ret" "num" copies of string "s". Return "ret". */ char *strrpt(ret, s, num) char *ret; register char *s; register int num; { register char *s2 = ret; register char *s1; while (--num >= 0) { s1 = s; while ((*s2++ = *s1++)) ; s2--; } return ret; } /* Store in "ret" string "s" with enough pad chars added to reach "size". */ char *strpad(ret, s, padchar, num) char *ret; register char *s; register int padchar, num; { register char *d = ret; if (s == d) { while (*d++) ; } else { while ((*d++ = *s++)) ; } num -= (--d - ret); while (--num >= 0) *d++ = padchar; *d = 0; return ret; } /* Copy the substring of length "len" from index "spos" of "s" (1-based) to index "dpos" of "d", lengthening "d" if necessary. Length and indices must be in-range. */ void strmove(len, s, spos, d, dpos) register char *s, *d; register int len, spos, dpos; { s += spos - 1; d += dpos - 1; while (*d && --len >= 0) *d++ = *s++; if (len > 0) { while (--len >= 0) *d++ = *s++; *d = 0; } } /* Delete the substring of length "len" at index "pos" from "s". Delete less if out-of-range. */ void strdelete(s, pos, len) register char *s; register int pos, len; { register int slen; if (--pos < 0) return; slen = strlen(s) - pos; if (slen <= 0) return; s += pos; if (slen <= len) { *s = 0; return; } while ((*s = s[len])) s++; } /* Insert string "src" at index "pos" of "dst". */ void strinsert(src, dst, pos) register char *src, *dst; register int pos; { register int slen, dlen; if (--pos < 0) return; dlen = strlen(dst); dst += dlen; dlen -= pos; if (dlen <= 0) { strcpy(dst, src); return; } slen = strlen(src); do { dst[slen] = *dst; --dst; } while (--dlen >= 0); dst++; while (--slen >= 0) *dst++ = *src++; } /* File functions */ /* Peek at next character of input stream; return EOF at end-of-file. */ int P_peek(f) FILE *f; { int ch; ch = getc(f); if (ch == EOF) return EOF; ungetc(ch, f); return (ch == '\n') ? ' ' : ch; } /* Check if at end of file, using Pascal "eof" semantics. End-of-file for stdin is broken; remove the special case for it to be broken in a different way. */ int P_eof(f) FILE *f; { register int ch; if (feof(f)) return 1; #ifdef HAVE_ISATTY if (isatty(fileno(f))) #else if (f == stdin) #endif return 0; /* not safe to look-ahead on the keyboard! */ ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return 0; } /* Check if at end of line (or end of entire file). */ int P_eoln(f) FILE *f; { register int ch; ch = getc(f); if (ch == EOF) return 1; ungetc(ch, f); return (ch == '\n'); } /* Skip whitespace (including newlines) in a file. */ FILE *_skipnlspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t' || ch == '\n'); if (ch != EOF) ungetc(ch, f); return f; } /* Skip whitespace (not including newlines) in a file. */ FILE *_skipspaces(f) FILE *f; { register int ch; do { ch = getc(f); } while (ch == ' ' || ch == '\t'); if (ch != EOF) ungetc(ch, f); return f; } /* Read a packed array of characters from a file. */ Void P_readpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { if (len <= 0) return; ch = getc(f); if (ch == EOF || ch == '\n') break; *s++ = ch; --len; } while (--len >= 0) *s++ = ' '; if (ch != EOF) ungetc(ch, f); } Void P_readlnpaoc(f, s, len) FILE *f; char *s; int len; { int ch; for (;;) { ch = getc(f); if (ch == EOF || ch == '\n') break; if (len > 0) { *s++ = ch; --len; } } while (--len >= 0) *s++ = ' '; } /* Compute maximum legal "seek" index in file (0-based). */ long P_maxpos(f) FILE *f; { long savepos = ftell(f); long val; if (fseek(f, 0L, SEEK_END)) return -1; val = ftell(f); if (fseek(f, savepos, SEEK_SET)) return -1; return val; } /* Use packed array of char for a file name. */ Char *P_trimname(fn, len) register Char *fn; register int len; { static Char fnbuf[256]; register Char *cp = fnbuf; while (--len >= 0 && *fn && !isspace(*fn)) *cp++ = *fn++; *cp = 0; return fnbuf; } /* Pascal's "memavail" doesn't make much sense in Unix with virtual memory. We fix memory size as 10Meg as a reasonable compromise. */ long memavail() { return 10000000; /* worry about this later! */ } long maxavail() { return memavail(); } /* Sets are stored as an array of longs. S[0] is the size of the set; S[N] is the N'th 32-bit chunk of the set. S[0] equals the maximum I such that S[I] is nonzero. S[0] is zero for an empty set. Within each long, bits are packed from lsb to msb. The first bit of the set is the element with ordinal value 0. (Thus, for a "set of 5..99", the lowest five bits of the first long are unused and always zero.) */ /* (Sets with 32 or fewer elements are normally stored as plain longs.) */ long *P_setunion(d, s1, s2) /* d := s1 + s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ | *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; *dbase = d - dbase - 1; return dbase; } long *P_setint(d, s1, s2) /* d := s1 * s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setdiff(d, s1, s2) /* d := s1 - s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (--sz1 >= 0 && --sz2 >= 0) *d++ = *s1++ & ~*s2++; if (sz1 >= 0) { while (sz1-- >= 0) *d++ = *s1++; } while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } long *P_setxor(d, s1, s2) /* d := s1 / s2 */ register long *d, *s1, *s2; { long *dbase = d++; register int sz1 = *s1++, sz2 = *s2++; while (sz1 > 0 && sz2 > 0) { *d++ = *s1++ ^ *s2++; sz1--, sz2--; } while (--sz1 >= 0) *d++ = *s1++; while (--sz2 >= 0) *d++ = *s2++; while (--d > dbase && !*d) ; *dbase = d - dbase; return dbase; } int P_inset(val, s) /* val IN s */ register unsigned val; register long *s; { register int bit; bit = val % SETBITS; val /= SETBITS; if (val < *s++ && ((1L< size) { s += size; while (val > size) *++s = 0, size++; *sbase = size; } else s += val; *s |= 1L< (int)v2) return sbase; b1 = v1 % SETBITS; v1 /= SETBITS; b2 = v2 % SETBITS; v2 /= SETBITS; size = *s; v1++; if (++v2 > size) { while (v2 > size) s[++size] = 0; s[v2] = 0; *s = v2; } s += v1; if (v1 == v2) { *s |= (~((-2L)<<(b2-b1))) << b1; } else { *s++ |= (-1L) << b1; while (++v1 < v2) *s++ = -1; *s |= ~((-2L) << b2); } return sbase; } long *P_remset(s, val) /* s := s - [val] */ register long *s; register unsigned val; { register int bit; bit = val % SETBITS; val /= SETBITS; if (++val <= *s) { if (!(s[val] &= ~(1L<= 0) { if (*s1++ != *s2++) return 0; } return 1; } int P_subset(s1, s2) /* s1 <= s2 */ register long *s1, *s2; { register int sz1 = *s1++, sz2 = *s2++; if (sz1 > sz2) return 0; while (--sz1 >= 0) { if (*s1++ & ~*s2++) return 0; } return 1; } long *P_setcpy(d, s) /* d := s */ register long *d, *s; { register long *save_d = d; #ifdef SETCPY_MEMCPY memcpy(d, s, (*s + 1) * sizeof(long)); #else register int i = *s + 1; while (--i >= 0) *d++ = *s++; #endif return save_d; } /* s is a "smallset", i.e., a 32-bit or less set stored directly in a long. */ long *P_expset(d, s) /* d := s */ register long *d; register long s; { if (s) { d[1] = s; *d = 1; } else *d = 0; return d; } long P_packset(s) /* convert s to a small-set */ register long *s; { if (*s++) return *s; else return 0; } int _OutMem() { return _Escape(-2); } int _CaseCheck() { return _Escape(-9); } int _NilCheck() { return _Escape(-3); } /* The following is suitable for the HP Pascal operating system. It might want to be revised when emulating another system. */ char *_ShowEscape(buf, code, ior, prefix) char *buf, *prefix; int code, ior; { char *bufp; if (prefix && *prefix) { strcpy(buf, prefix); strcat(buf, ": "); bufp = buf + strlen(buf); } else { bufp = buf; } if (code == -10) { sprintf(bufp, "Pascal system I/O error %d", ior); switch (ior) { case 3: strcat(buf, " (illegal I/O request)"); break; case 7: strcat(buf, " (bad file name)"); break; case FileNotFound: /*10*/ strcat(buf, " (file not found)"); break; case FileNotOpen: /*13*/ strcat(buf, " (file not open)"); break; case BadInputFormat: /*14*/ strcat(buf, " (bad input format)"); break; case 24: strcat(buf, " (not open for reading)"); break; case 25: strcat(buf, " (not open for writing)"); break; case 26: strcat(buf, " (not open for direct access)"); break; case 28: strcat(buf, " (string subscript out of range)"); break; case EndOfFile: /*30*/ strcat(buf, " (end-of-file)"); break; case FileWriteError: /*38*/ strcat(buf, " (file write error)"); break; } } else { sprintf(bufp, "Pascal system error %d", code); switch (code) { case -2: strcat(buf, " (out of memory)"); break; case -3: strcat(buf, " (reference to NIL pointer)"); break; case -4: strcat(buf, " (integer overflow)"); break; case -5: strcat(buf, " (divide by zero)"); break; case -6: strcat(buf, " (real math overflow)"); break; case -8: strcat(buf, " (value range error)"); break; case -9: strcat(buf, " (CASE value range error)"); break; case -12: strcat(buf, " (bus error)"); break; case -20: strcat(buf, " (stopped by user)"); break; } } return buf; } int _Escape(code) int code; { char buf[100]; P_escapecode = code; if (__top_jb) { __p2c_jmp_buf *jb = __top_jb; __top_jb = jb->next; longjmp(jb->jbuf, 1); } if (code == 0) exit(EXIT_SUCCESS); if (code == -1) exit(EXIT_FAILURE); fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } int _EscIO(code) int code; { P_ioresult = code; return _Escape(-10); } int _EscIO2(code, name) int code; char *name; { P_ioresult = code; if (!__top_jb && name && *name) { char buf[100]; fprintf(stderr, "%s: %s\n", name, _ShowEscape(buf, P_escapecode, P_ioresult, "")); exit(EXIT_FAILURE); } return _Escape(-10); } /* End. */ typedef struct TPoint { long X, Y, C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, As, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, In, Li, Mg, Mn, Na, Ni, K, Pb, Rb, Sb, Sc, Se, Sn, Sr, Te, Ti, Tl, V, Zn, RecCount; struct TPoint *Last; } TPoint; typedef struct TBond { long X1, Y1, X2, Y2, RecCount; struct TBond *Last; } TBond; Static long C, H, N, O, P, S, Si, B, Br, Cl, F, I, Al, As, Ba, Be, Bi, Ca, Cd, Co, Cr, Cs, Cu, Fe, Ga, Ge, In, Li, Mg, Mn, Na, Ni, K, Pb, Rb, Sb, Sc, Se, Sn, Sr, Te, Ti, Tl, V, Zn, X1, X2, Y1, Y2, T, D; Static FILE *IFile; Static TPoint *Point, *Last, *Current; Static TBond *Bond, *LastB, *CurrentB; Static Char sss[256], A[256], subs[256], Alert[256]; Static Char sssb[7]; Static double M, Me; Static Char separator; Static long Count, code, atoms, rep, range, bonds; Static boolean Abandon, debug, verbose, fa, nobonds; Static long Sensi = 5; /*bonds and labels joint precision sensitivity*/ Static Char IFile_NAME[_FNSIZE]; Static Void doBonds() { do { fgets(sss,256,IFile); sscanf(sss, "%ld%ld%ld%ld%ld%ld%*[^\n]", &X1, &Y1, &X2, &Y2, &T, &D); /*getc(IFile);*/ bonds--; if (debug) printf("%ld; %ld; %ld; %ld; %ld; %ld\n", X1, Y1, X2, Y2, T, D); if (D == 1 || T == 8){ if (debug) printf("skipped\n"); continue; } if (debug) printf("parsed\n"); if (T == 11) range = ((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2)) * 4; LastB = Bond; Bond = (TBond *)Malloc(sizeof(TBond)); Bond->X1 = X1; Bond->X2 = X2; Bond->Y1 = Y1; Bond->Y2 = Y2; Bond->Last = LastB; CurrentB = Bond; Bond = Bond->Last; while (Bond->Last != NULL) { if ((labs(Bond->X1 - X1) < Sensi && labs(Bond->Y1 - Y1) < Sensi && labs(Bond->X2 - X2) < Sensi && labs(Bond->Y2 - Y2) < Sensi) || (labs(Bond->X2 - X1) < Sensi && labs(Bond->Y2 - Y1) < Sensi && labs(Bond->X1 - X2) < Sensi && labs(Bond->Y1 - Y2) < Sensi)) { if (debug) printf(" ! Bond overlap\n"); strcat(Alert, "!"); } Bond = Bond->Last; } Bond = CurrentB; Abandon = false; Current = Point; while (Point->Last != NULL) { if (T == 11) { Abandon = true; if ((Point->X - X1) * (Point->X - X1) + (Point->Y - Y1) * (Point->Y - Y1) < range) { if (Point->H > 0) Point->H--; if (debug) printf("Ring --> stripped one H from %ld %ld\n", Point->X, Point->Y); } } else { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X1, Y1); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)Malloc(sizeof(TPoint)); Point->X = X1; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y1; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->As = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->In = 0; Point->Li = 0; Point->Na = 0; Point->Ni = 0; Point->Mg = 0; Point->Mn = 0; Point->K = 0; Point->Pb = 0; Point->Rb = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->Zn = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } if (T != 11) { Abandon = false; Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X2) < Sensi && labs(Point->Y - Y2) < Sensi) { if (debug) printf(" %ld --> Joined at %ld %ld\n", Point->RecCount, X2, Y2); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H--; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15) Point->H -= 2; if (T == 3) Point->H -= 3; if (Point->H < 0) { if (debug) printf("Point^.X=%ld, Point^.Y=%ld has H count <0 !\n",Point->X,Point->Y); Point->H = 0; } Abandon = true; } Point = Point->Last; } Point = Current; if (!Abandon) { Count++; Last = Point; Point = (TPoint *)Malloc(sizeof(TPoint)); Point->X = X2; if (debug) printf(" Point^.X=%ld", Point->X); Point->Y = Y2; if (debug) printf(" Point^.Y=%ld", Point->Y); if (T != 11 && T != 9) Point->C = 1; else Point->C = 0; if (debug) printf(" Point^.C=%ld", Point->C); if (T == 0 || T == 5 || T == 6 || T == 7 || T == 10 || T == 12 || T == 13) Point->H = 3; if (T == 1 || T == 2 || T == 4 || T == 14 || T == 15 ) Point->H = 2; if (T == 3) Point->H = 1; if (debug) printf(" Point^.H=%ld", Point->H); Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->As = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->In = 0; Point->Li = 0; Point->Mg = 0; Point->Mn = 0; Point->Na = 0; Point->Ni = 0; Point->K = 0; Point->Pb = 0; Point->Rb = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->Zn = 0; Point->RecCount = Count; if (debug) printf(" Point^.RecCount=%ld\n", Point->RecCount); Point->Last = Last; } } } while (bonds != 0); } Static Void doLabels() { long mul, gmul, gmpos, ggmul, ggmpos; boolean stripped; Char STR2[256]; long FORLIM; Char *TEMP; if (debug) printf("---- and now parse the labels ---------\n"); if (verbose) printf("HeteroAtoms: %ld\n", atoms); FORLIM = atoms; for (rep = 1; rep <= FORLIM; rep++) { fscanf(IFile, "%ld%ld%c", &X1, &Y1, &separator); fgets(sss, 256, IFile); TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; sprintf(A, "%.*s", strpos2(sss, "\t", 1) - 1, sss); if (debug) printf("Atom %s X=%ld Y=%ld sss: %s\n", A, X1, Y1, sss); if (nobonds) { /*initialize the Point structure if no bonds, only labels, defined*/ Count++; Last = Point; Point = (TPoint *)Malloc(sizeof(TPoint)); Point->X = X1; Point->Y = Y1; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->As = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->In = 0; Point->Li = 0; Point->Mg = 0; Point->Mn = 0; Point->Na = 0; Point->Ni = 0; Point->K = 0; Point->Pb = 0; Point->Rb = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->Zn = 0; Point->RecCount = Count; Point->Last = Last; } Current = Point; while (Point->Last != NULL) { if (labs(Point->X - X1) < Sensi && labs(Point->Y - Y1) < Sensi) { if (debug) printf(" [%ld]\n", Point->RecCount); Point->C = 0; /*we substitute -CH_x(-) by -R(-)*/ Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->As = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->In = 0; Point->Li = 0; Point->Mg = 0; Point->Mn = 0; Point->Na = 0; Point->Ni = 0; Point->K = 0; Point->Pb = 0; Point->Rb = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->Zn = 0; mul = 1; gmul = 1; ggmul = 1; while (*A != '\0') { stripped = false; if (strlen(A) >= 5) { sprintf(subs, "%.5s", A); if (strlen(A) > 6) { if (A[5] == '_') { if (A[6]!= '{') { sprintf(STR2, "%c", A[6]); if (A[7]=='_') sprintf(STR2, "%c%c", A[6],A[8]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=7; while(A[mul]!='}'){STR2[mul-7]=A[mul]; mul++ ; } STR2[mul-6]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "TBDMS")) { /*Tert-butyldimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 15; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (!strcmp(subs, "TBDPS")) { /*Tert-butyldiphenylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 16; Point->H += mul * 19; Point->Si += mul; strcpy(A, strsub(STR2, A, 6, (int)(strlen(A) - 5))); stripped = true; } if (A[0] == '[') { ggmpos = strpos2(A, "]", 1); if (ggmpos != 0) { if (A[ggmpos] == '_') { if (A[ggmpos+1]!= '{') { sprintf(STR2, "%c", A[ggmpos+1]); if (A[ggmpos+2]=='_') sprintf(STR2, "%c%c", A[ggmpos+1],A[ggmpos+3]); code = (sscanf(STR2, "%ld", &ggmul) == 0); }else{ ggmul=ggmpos+2; while(A[ggmul]!='}'){STR2[ggmul-ggmpos-2]=A[ggmul]; ggmul++ ; } STR2[ggmul-ggmpos-1]='\0'; code = (sscanf(STR2, "%ld", &ggmul) == 0); } } else ggmul = 1; } } if (A[0] == '(') { gmpos = strpos2(A, ")", 1); if (gmpos != 0) { if (A[gmpos] == '_') { if (A[gmpos+1]!= '{') { sprintf(STR2, "%c", A[gmpos+1]); if (A[gmpos+2]=='_') sprintf(STR2, "%c%c", A[gmpos+1],A[gmpos+3]); code = (sscanf(STR2, "%ld", &gmul) == 0); }else{ gmul=gmpos+2; while(A[gmul]!='}'){STR2[gmul-gmpos-2]=A[gmul]; gmul++ ; } STR2[gmul-gmpos-1]='\0'; code = (sscanf(STR2, "%ld", &gmul) == 0); } } else gmul = 1; } } } if (strlen(A) >= 4 && !stripped) { sprintf(subs, "%.4s", A); if (strlen(A) > 5) { if (A[4] == '_') { if (A[5]!= '{') { sprintf(STR2, "%c", A[5]); if (A[6]=='_') sprintf(STR2, "%c%c", A[5],A[7]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=6; while(A[mul]!='}'){STR2[mul-6]=A[mul]; mul++ ; } STR2[mul-5]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "DBAM")) { /*dibutylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 9; Point->H += mul * 19; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMAM")) { /*dimethylaminomethylene; =R, used as the N prot.*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; Point->N += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "DMTr")) { /*dimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 21; Point->H += mul * 19; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "MMTr")) { /*monomethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 20; Point->H += mul * 16; Point->O += mul; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } if (!strcmp(subs, "TMTr")) { /*trimethoxytrityl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 22; Point->H += mul * 22; Point->O += mul * 3; strcpy(A, strsub(STR2, A, 5, (int)(strlen(A) - 4))); stripped = true; } } if (strlen(A) >= 3 && !stripped) { sprintf(subs, "%.3s", A); if (strlen(A) > 4) { if (A[3] == '_') { if (A[4]!= '{') { sprintf(STR2, "%c", A[4]); if (A[5]=='_') sprintf(STR2, "%c%c", A[4],A[6]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=5; while(A[mul]!='}'){STR2[mul-5]=A[mul]; mul++ ; } STR2[mul-4]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ade")) { /*Adeninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "BOC")) { /*Butyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 9; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Cyt")) { /*Cytosinyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 4; Point->N += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Gua")) { /*Guaninyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 4; Point->N += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iBu")) { /*iso-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "iPr")) { /*2-Propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOC")) { /*Methoxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "MOM")) { /*Methoxymethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "tBu")) { /*t-Butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Thy")) { /*Thyminyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 5; Point->H += mul * 5; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "TMS")) { /*Trimethylsilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 9; Point->Si += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Tol")) { /*tolyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } if (!strcmp(subs, "Ura")) { /*Uracilyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 3; Point->N += mul * 2; Point->O += mul * 2; strcpy(A, strsub(STR2, A, 4, (int)(strlen(A) - 3))); stripped = true; } } if (strlen(A) >= 2 && !stripped) { sprintf(subs, "%.2s", A); if (strlen(A) > 3) { if (A[2] == '_') { if (A[3]!= '{') { sprintf(STR2, "%c", A[3]); if (A[4]=='_') sprintf(STR2, "%c%c", A[3],A[5]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=4; while(A[mul]!='}'){STR2[mul-4]=A[mul]; mul++ ; } STR2[mul-3]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "Ac")) { /*acetyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 3; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Al")) { /*alumin(i)um*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Al += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "As")) { /*arsenic*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->As += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ba")) { /*barium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ba += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Be")) { /*beryllium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Be += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bi")) { /*bismuth*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Bi += mul ; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bn")) { /*benzyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Br")) { /*bromine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Br += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bu")) { /*butyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 4; Point->H += mul * 9; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Bz")) { /*benzoyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 5; Point->O += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "CE")) { /*cyanoethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 4; Point->N += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cl")) { /*chlorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ca")) { /*calcium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ca += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cd")) { /*cadmium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cd += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Co")) { /*cobalt*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Co += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cr")) { /*chromium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cs")) { /*cesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cs += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Cu")) { /*copper*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Cu += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Et")) { /*ethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 2; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Fe")) { /*iron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Fe += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ga")) { /*gallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ga += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ge")) { /*germanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ge += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "In")) { /*indium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->In += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Li")) { /*lithium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Li += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Me")) { /*methyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ms")) { /*methanesulfonyl, mesyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->H += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mg")) { /*magnesium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mg += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Mn")) { /*manganese*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Mn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Na")) { /*sodium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Na += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ni")) { /*nickel*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ni += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pb")) { /*lead*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Pb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ph")|| !strcmp(subs,"@F")) { /*phenyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 6; Point->H += mul * 5; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Pr")) { /*propyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 3; Point->H += mul * 7; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Rb")) { /*rubidium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Rb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sb")) { /*antimony*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sb += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sc")) { /*scandium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sc += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Se")) { /*selenium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Se += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sn")) { /*tin*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Sr")) { /*strontium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Sr += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Te")) { /*tellurium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Te += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ti")) { /*titanium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Ti += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tf")) { /*trifluoromethanesulfonyl, triflyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; Point->F += mul * 3; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tl")) { /*thallium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Tl += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Tr")) { /*trityl, triphenylmethyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 19; Point->H += mul * 15; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Ts")) { /*toluenesulfonyl, tosyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 7; Point->H += mul * 7; Point->O += mul * 2; Point->S += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Si")) { /*silicon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Si += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } if (!strcmp(subs, "Zn")) { /*zinc*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->Zn += mul; strcpy(A, strsub(STR2, A, 3, (int)(strlen(A) - 2))); stripped = true; } } if (strlen(A) < 1 || stripped) continue; sprintf(subs, "%.1s", A); if (strlen(A) > 2) { if (A[1] == '_') { if (A[2]!= '{') { sprintf(STR2, "%c", A[2]); if (A[3]=='_') sprintf(STR2, "%c%c", A[2],A[4]); code = (sscanf(STR2, "%ld", &mul) == 0); }else{ mul=3; while(A[mul]!='}'){STR2[mul-3]=A[mul]; mul++ ; } STR2[mul-2]='\0'; code = (sscanf(STR2, "%ld", &mul) == 0); } } else mul = 1; } mul *= gmul * ggmul; if (!strcmp(subs, "B")) { /*boron*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->B += mul; } if (!strcmp(subs, "C")) { /*carbon*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul; } if (!strcmp(subs, "F")) { /*fluorine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->F += mul; } if (!strcmp(subs, "H")) { /*hydrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->H += mul; } if (!strcmp(subs, "I")) { /*iodine*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->I += mul; } if (!strcmp(subs, "K")) { /*potassium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->K += mul; } if (!strcmp(subs, "N")) { /*nitrogen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->N += mul; } if (!strcmp(subs, "O")) { /*oxygen*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->O += mul; } if (!strcmp(subs, "P")) { /*phosphorus*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->P += mul; } if (!strcmp(subs, "S")) { /*sulfur*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->S += mul; } if (!strcmp(subs, "V")) { /*vanadium*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->V += mul; } if (!strcmp(subs, "Z")) { /*"Z", Benzyloxycarbonyl*/ if (debug) printf(" %s*%ld (%ld,%ld)\n", subs, mul, gmul, ggmul); Point->C += mul * 8; Point->H += mul * 7; Point->O += mul * 2; } if (!strcmp(subs, ")")) /*reset gmul*/ gmul = 1; if (!strcmp(subs, "]")) { /*reset gmul,ggmul*/ gmul = 1; ggmul = 1; } if (true) strcpy(A, strsub(STR2, A, 2, (int)(strlen(A) - 1))); } } Point = Point->Last; } Point = Current; } } main(argc, argv) int argc; Char *argv[]; { Char STR1[256], STR2[256]; Char *TEMP; boolean interactive=false; PASCAL_MAIN(argc, argv); IFile = NULL; if (P_argc == 1) { printf("enter \"cht -h\" for help\n"); _Escape(0); } C = 0; H = 0; N = 0; O = 0; P = 0; S = 0; Si = 0; B = 0; Br = 0; I = 0; Cl = 0; F = 0; Al = 0; As = 0; Ba = 0; Be = 0; Bi = 0; Ca = 0; Cd = 0; Co = 0; Cr = 0; Cs = 0; Cu = 0; Fe = 0; Ga = 0; Ge = 0; In = 0; Li = 0; Mg = 0; Mn = 0; Na = 0; Ni = 0; K = 0; Pb = 0; Rb = 0; Sb = 0; Sc = 0; Se = 0; Sn = 0; Sr = 0; Te = 0; Ti = 0; Tl = 0; V = 0; Zn = 0; verbose = false; debug = false; fa = false; /*no file assigned*/ Count = 0; *Alert = '\0'; for (rep = 1; rep < P_argc; rep++) { if (!strcmp(strcpy(STR2, P_argv[rep]), "-v") || !strcmp(strcpy(STR1, P_argv[rep]), "--verbose")) verbose = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-d") || !strcmp(strcpy(STR1, P_argv[rep]), "--debug")) debug = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-i") || !strcmp(strcpy(STR1, P_argv[rep]), "--interpret")) interactive = true; if (!strcmp(strcpy(STR2, P_argv[rep]), "-h") || !strcmp(strcpy(STR1, P_argv[rep]), "--help")) { printf("The Chemtool drawings analyzer 1.7\n"); printf("*** Gizmo Head Software ***\n"); printf(" Radek Liboska (c) 2001\n\n"); printf("syntax: cht [-options] \n\n"); printf("Recognizes C,H,O,N,P,S,Si,B,Br,I,Cl,F,Al,As,Ba,Be,Bi,Ca,Cd,Co,Cr,Cs,Cu,\nFe,Ga,Ge,In,Li,Mg,Mn,Na,Ni,K,Pb,Rb,Sb,Sc,Se,Sn,Sr,\nTe,Ti,Tl,V,Zn\n"); printf( " Ac,Ade,Bn,Bu,Bz,BOC,Cyt,CE,DBAM,DMAM,DMTr,Et,Gua,iBu,iPr,Me,Ms,MOC,\n"); printf( " MOM,MMTr,Ph,Pr,tBu,Tf,Thy,Tol,Tr,Ts,TBDMS,TBDPS,TMS,TMTr,Ura,Z\n"); printf("Can handle two levels of parentheses; e.g. P[OCH(CH_3)_2]_3\n\n"); printf("options:\n"); printf(" -h or --help : this help\n"); printf(" -v or --verbose : be verbose\n"); printf(" -d or --debug : be more verbose\n\n"); _Escape(0); } if (strcpy(STR2, P_argv[rep])[0] != '-') { strcpy(STR1, P_argv[rep]); strcpy(IFile_NAME, STR1); fa = true; } } if (!fa && !interactive) { printf("No file defined, enter \"cht -h\" for help\n"); _Escape(1); } if (!interactive){ if (IFile != NULL) IFile = freopen(IFile_NAME, "r", IFile); else IFile = fopen(IFile_NAME, "r"); if (IFile == NULL) _EscIO2(FileNotFound, IFile_NAME); }else { if (IFile)fclose(IFile); IFile=tmpfile(); fprintf(IFile,"Chemtool Version 1.0\ngeometry 100 100\n\bonds 0\natoms 1\n0 0 %s 0\n",IFile_NAME); rewind(IFile); } Point = (TPoint *)Malloc(sizeof(TPoint)); Point->X = 0; Point->Y = 0; Point->C = 0; Point->H = 0; Point->N = 0; Point->O = 0; Point->P = 0; Point->S = 0; Point->Si = 0; Point->B = 0; Point->Br = 0; Point->Cl = 0; Point->F = 0; Point->I = 0; Point->Al = 0; Point->As = 0; Point->Ba = 0; Point->Be = 0; Point->Bi = 0; Point->Ca = 0; Point->Cd = 0; Point->Co = 0; Point->Cr = 0; Point->Cs = 0; Point->Cu = 0; Point->Fe = 0; Point->Ga = 0; Point->Ge = 0; Point->In = 0; Point->Li = 0; Point->Mg = 0; Point->Mn = 0; Point->Na = 0; Point->Ni = 0; Point->K = 0; Point->Pb = 0; Point->Rb = 0; Point->Sb = 0; Point->Sc = 0; Point->Se = 0; Point->Sn = 0; Point->Sr = 0; Point->Te = 0; Point->Ti = 0; Point->Tl = 0; Point->V = 0; Point->Zn = 0; Point->RecCount = Count; Point->Last = NULL; Bond = (TBond *)Malloc(sizeof(TBond)); Bond->X1 = 0; Bond->Y1 = 0; Bond->X2 = 0; Bond->Y2 = 0; Bond->RecCount = Count; Bond->Last = NULL; fgets(sss, 256, IFile); TEMP = strchr(sss, '\n'); if (TEMP != NULL) *TEMP = 0; sprintf(sss, "%.18s", strcpy(STR1, sss)); if (strcmp(sss, "Chemtool Version 1")) { printf("Not a chemtool 1.x file, enter \"cht -h\" for help\n"); printf("file starts: %s\n",sss); _Escape(2); } fscanf(IFile, "%*[^\n]"); getc(IFile); fgets(sssb, 7, IFile); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } fscanf(IFile, "%ld%*[^\n]", &bonds); getc(IFile); if (bonds == 0) nobonds = true; if (!strcmp(sssb, "bonds ")) { if (bonds > 0) doBonds(); } fgets(sssb, 7, IFile); TEMP = strchr(sssb, '\n'); if (TEMP != NULL) { *TEMP = 0; ungetc('\n', IFile); } fscanf(IFile, "%ld%*[^\n]", &atoms); getc(IFile); if (!strcmp(sssb, "atoms ")) { if (atoms > 0) doLabels(); } if (IFile != NULL) fclose(IFile); IFile = NULL; if (verbose) printf("---------------------- Summary -------------------------\n"); while (Point->Last != NULL) { if (verbose) printf( "RecCount: %ld X=%ld Y=%ld C%ld H%ld N%ld O%ld P%ld S%ld Si%ld B%ld\nBr%ld Cl%ld F%ld I%ld Al%ld As%ld Ba%ld Be%ld Bi%ld Ca%ld Cd%ld Co%ld\nCr%ld Cs%ld Cu%ld Fe%ld Ga%ld Ge%ld In%ld Li%ld Mg%ld Mn%ld\nNa%ld Ni%ld K%ld Pb %ld Rb%ld Sb%ld Sc%ld Se%ld Sn%ld Sr%ld Te%ld Ti%ld Tl%ld V%ld Zn%ld\n", Point->RecCount, Point->X, Point->Y, Point->C, Point->H, Point->N, Point->O, Point->P, Point->S, Point->Si, Point->B, Point->Br, Point->Cl, Point->F, Point->I, Point->Al, Point->As, Point->Ba, Point->Be,Point->Bi, Point->Ca, Point->Cd, Point->Co, Point->Cr, Point->Cs,Point->Cu,Point->Fe,Point->Ga,Point->Ge, Point->In,Point->Li,Point->Mg, Point->Mn, Point->Na, Point->Ni, Point->K,Point->Pb,Point->Rb, Point->Sb,Point->Sc,Point->Se,Point->Sn,Point->Sr, Point->Te,Point->Ti,Point->Tl,Point->V,Point->Zn); C += Point->C; H += Point->H; N += Point->N; O += Point->O; P += Point->P; S += Point->S; Si += Point->Si; B += Point->B; Br += Point->Br; Cl += Point->Cl; F += Point->F; I += Point->I; Al += Point->Al; As += Point->As; Ba += Point->Ba; Be += Point->Be; Bi += Point->Bi; Ca += Point->Ca; Cd += Point->Cd; Co += Point->Co; Cr += Point->Cr; Cs += Point->Cs; Cu += Point->Cu; Fe += Point->Fe; Ga += Point->Ga; Ge += Point->Ge; In += Point->In; Li += Point->Li; Mg += Point->Mg; Mn += Point->Mn; Na += Point->Na; Ni += Point->Ni; K += Point->K; Pb += Point->Pb; Rb += Point->Rb; Sb += Point->Sb; Sc += Point->Sc; Se += Point->Se; Sn += Point->Sn; Sr += Point->Sr; Te += Point->Te; Ti += Point->Ti; Tl += Point->Tl; V += Point->V; Zn += Point->Zn; Point = Point->Last; } if (H < 0) /*overlapped bonds*/ H = 0; M = C * 12.011 + H * 1.0079 + N * 14.0067 + O * 15.9994 + P * 30.97376 + S * 32.064 + Si * 28.086 + B * 10.81 + Br * 79.904 + Cl * 35.453 + F * 18.9984 + I * 126.9045 + Mg * 24.305 + Na * 22.98977 + K * 39.098 + Ca * 40.08 + Cd * 112.41 + Co * 58.933 + Cr * 51.996 + Cu * 63.546 + Fe * 55.847 + Li * 6.941 + Mn * 54.938 + Ni * 58.69 + Al * 26.981539 + Ba * 137.327 + Cs * 132.90543 + As * 74.92159 + Be *9.012182 + Ga * 69.723 + Ge * 72.61 + Sb * 121.75 + Sc * 44.95591 + Se * 78.96 + Sn * 118.710 + Sr * 87.62 + Rb * 85.4678 + Te * 127.60 + Ti * 47.88 + V * 50.9415 + Zn * 65.39 + In * 114.82 + Bi * 208.98037 + Pb *207.2 + Tl * 204.3833; Me = C * 12 + H * 1.007825037 + N * 14.003074008 + O * 15.99491464 + P * 30.9737634 + S * 31.9720718 + Si * 27.9769284 + B * 11.0093053 + Br * 78.9183361 + Cl * 34.968852729 + F * 18.99840325 + I * 126.904477 + Mg * 23.9850450 + Na * 22.9897697 + K * 38.9637079 + Ca * 39.9626 + Cd * 113.9034 + Co * 58.9332 + Cr * 51.9405 + Cu * 62.9296 + Fe * 55.9349 +Li * 7.0160 + Mn * 54.93805 + Ni * 57.9353 + Al * 26.981539 + Ba * 137.9052 + Cs * 132.90543 + As * 74.92159 + Be * 9.012182 + Ga * 68.9256 + Ge * 73.9212 + Sb * 120.9038 + Sc * 44.95591 + Se *79.9165 + Sn * 119.9022 + Sr * 87.9056 + Rb * 84.9118 + Te * 129.9062 + Ti * 47.9479 + V * 50.9440 + Zn * 63.9291 + In * 114.9039 + Bi * 208.98037 + Pb * 207.9766 + Tl * 204.9744; if (Me > 0 && *Alert == '\0') { if (C > 1) printf("C%ld", C); if (C == 1) putchar('C'); if (H > 1) printf("H%ld", H); if (H == 1) putchar('H'); if (N > 1) printf("N%ld", N); if (N == 1) putchar('N'); if (O > 1) printf("O%ld", O); if (O == 1) putchar('O'); if (P > 1) printf("P%ld", P); if (P == 1) putchar('P'); if (S > 1) printf("S%ld", S); if (S == 1) putchar('S'); if (Si > 1) printf("Si%ld", Si); if (Si == 1) printf("Si"); if (B > 1) printf("B%ld", B); if (B == 1) putchar('B'); if (Br > 1) printf("Br%ld", Br); if (Br == 1) printf("Br"); if (Cl > 1) printf("Cl%ld", Cl); if (Cl == 1) printf("Cl"); if (F > 1) printf("F%ld", F); if (F == 1) putchar('F'); if (I > 1) printf("I%ld", I); if (I == 1) putchar('I'); if (Al > 1) printf("Al%ld", Al); if (Al == 1) printf("Al"); if (As > 1) printf("As%ld", As); if (As == 1) printf("As"); if (Ba > 1) printf("Ba%ld", Ba); if (Ba == 1) printf("Ba"); if (Be > 1) printf("Be%ld", Be); if (Be == 1) printf("Be"); if (Bi > 1) printf("Bi%ld", Bi); if (Bi == 1) printf("Bi"); if (Ca > 1) printf("Ca%ld", Ca); if (Ca == 1) printf("Ca"); if (Cd > 1) printf("Cd%ld", Cd); if (Cd == 1) printf("Cd"); if (Co > 1) printf("Co%ld", Co); if (Co == 1) printf("Co"); if (Cr > 1) printf("Cr%ld", Cr); if (Cr == 1) printf("Cr"); if (Cs > 1) printf("Cs%ld", Cs); if (Cs == 1) printf("Cs"); if (Cu > 1) printf("Cu%ld", Cu); if (Cu == 1) printf("Cu"); if (Fe > 1) printf("Fe%ld", Fe); if (Fe == 1) printf("Fe"); if (Ga > 1) printf("Ga%ld", Ga); if (Ga == 1) printf("Ga"); if (Ge > 1) printf("Ge%ld", Ge); if (Ge == 1) printf("Ge"); if (In > 1) printf("In%ld", In); if (In == 1) printf("In"); if (Li > 1) printf("Li%ld", Li); if (Li == 1) printf("Li"); if (Mg > 1) printf("Mg%ld", Mg); if (Mg == 1) printf("Mg"); if (Mn > 1) printf("Mn%ld", Mn); if (Mn == 1) printf("Mn"); if (Na > 1) printf("Na%ld", Na); if (Na == 1) printf("Na"); if (Ni > 1) printf("Ni%ld", Ni); if (Ni == 1) printf("Ni"); if (Pb > 1) printf("Pb%ld", Pb); if (Pb == 1) printf("Pb"); if (Rb > 1) printf("Rb%ld", Rb); if (Rb == 1) printf("Rb"); if (Sb > 1) printf("Sb%ld", Sb); if (Sb == 1) printf("Sb"); if (Sc > 1) printf("Sc%ld", Sc); if (Sc == 1) printf("Sc"); if (Se > 1) printf("Se%ld", Se); if (Se == 1) printf("Se"); if (Sn > 1) printf("Sn%ld", Sn); if (Sn == 1) printf("Sn"); if (Sr > 1) printf("Sr%ld", Sr); if (Sr == 1) printf("Sr"); if (Te > 1) printf("Te%ld", Te); if (Te == 1) printf("Te"); if (Ti > 1) printf("Ti%ld", Ti); if (Ti == 1) printf("Ti"); if (Tl > 1) printf("Tl%ld", Tl); if (Tl == 1) printf("Tl"); if (V > 1) printf("V%ld", V); if (V == 1) printf("V"); if (Zn > 1) printf("Zn%ld", Zn); if (Zn == 1) printf("Zn"); if (K > 1) printf("K%ld", K); if (K == 1) putchar('K'); printf(" [%2.3f]", M); printf(" Me=%2.10f ", Me); if (C > 0) printf("%4.2f%%C;", C * 12.011 * 100 / M); if (H > 0) printf("%4.2f%%H;", H * 1.0079 * 100 / M); if (B > 0) printf("%4.2f%%B;", B * 10.81 * 100 / M); if (N > 0) printf("%4.2f%%N;", N * 14.0067 * 100 / M); if (O > 0) printf("%4.2f%%O;", O * 15.9994 * 100 / M); if (P > 0) printf("%4.2f%%P;", P * 30.97376 * 100 / M); if (S > 0) printf("%4.2f%%S;", S * 32.0640 * 100 / M); if (K > 0) printf("%4.2f%%K;", K * 39.098 * 100 / M); if (Mg > 0) printf("%4.2f%%Mg;", Mg * 24.305 * 100 / M); if (Na > 0) printf("%4.2f%%Na;", Na * 22.98977 * 100 / M); if (Si > 0) printf("%4.2f%%Si;", Si * 28.086 * 100 / M); if (Br > 0) printf("%4.2f%%Br;", Br * 79.904 * 100 / M); if (Cl > 0) printf("%4.2f%%Cl;", Cl * 35.453 * 100 / M); if (F > 0) printf("%4.2f%%F;", F * 18.9984 * 100 / M); if (I > 0) printf("%4.2f%%I;", I * 126.9045 * 100 / M); if (Al >0) printf("%4.2f%%Al;", Al * 26.981539 * 100 / M); if (As >0) printf("%4.2f%%As;", As * 74.92159 * 100 / M); if (Ba >0) printf("%4.2f%%Ba;", Ba * 137.327 * 100 / M); if (Be >0) printf("%4.2f%%Be;", Be * 9.012182 * 100 / M); if (Bi >0) printf("%4.2f%%Bi;", Bi * 208.98037 * 100 / M); if (Ca >0) printf("%4.2f%%Ca;", Ca * 40.08 * 100 / M); if (Cd >0) printf("%4.2f%%Cd;", Cd * 112.41 * 100 / M); if (Co >0) printf("%4.2f%%Co;", Co * 58.993 * 100 / M); if (Cr >0) printf("%4.2f%%Cr;", Cr * 51.996 * 100 / M); if (Cs >0) printf("%4.2f%%Cs;", Cs * 132.90543 * 100 / M); if (Cu >0) printf("%4.2f%%Cu;", Cu * 63.546 * 100 / M); if (Fe >0) printf("%4.2f%%Fe;", Fe * 55.847 * 100 / M); if (Ga >0) printf("%4.2f%%Ga;", Ga * 69.723 * 100 / M); if (Ge >0) printf("%4.2f%%Ge;", Ge * 72.61 * 100 / M); if (In >0) printf("%4.2f%%In;", In * 114.82 * 100 / M); if (Li >0) printf("%4.2f%%Li;", Li * 6.941 * 100 / M); if (Mn >0) printf("%4.2f%%Mn;", Mn * 54.938 * 100 / M); if (Ni >0) printf("%4.2f%%Ni;", Ni * 58.69 *100 / M); if (Pb >0) printf("%4.2f%%Pb;", Pb * 207.2 *100 / M); if (Rb >0) printf("%4.2f%%Rb;", Rb * 85.4678 *100 / M); if (Sb >0) printf("%4.2f%%Sb;", Sb * 121.75 *100 / M); if (Sc >0) printf("%4.2f%%Sc;", Sc * 44.95591 *100 / M); if (Se >0) printf("%4.2f%%Se;", Se * 78.96 *100 / M); if (Sn >0) printf("%4.2f%%Sn;", Sn * 118.71 *100 / M); if (Sr >0) printf("%4.2f%%Sr;", Sr * 87.62 *100 / M); if (Te >0) printf("%4.2f%%Te;", Te * 127.60 *100 / M); if (Ti >0) printf("%4.2f%%Ti;", Ti * 47.88 *100 / M); if (Tl >0) printf("%4.2f%%Tl;", Tl * 204.3833 *100 / M); if (V >0) printf("%4.2f%%V;", V * 50.9415 *100 / M); if (Zn >0) printf("%4.2f%%Zn;", Zn * 65.39 *100 / M); } else { if (*Alert != '\0') printf("%s overlapped bonds !", Alert); else printf("C0H0 [0.00] Me=0.0000000000 0.00%%C;0.00%%H"); } putchar('\n'); exit(EXIT_SUCCESS); } /* End. */ chemtool-1.6.14/ChangeLog0000644000175000001440000020661312202267665014420 0ustar martinusers1.1.2 new bond types - wedge and dashed wedge 1.1.3 wedge and dashed wedge supported in xfig and latex export (oops) sub- and superscripted text drawn in smaller font sub- and superscripting preserved in standard xfig export postscript export mode added (relies on fig2dev) load dialog added using Robert McMullens ListTree widget Added a new example, the antibiotic tetracycline 1.1.4 Simple 'Add fragment' functionality added 1.1.5 updated README file improved dialog boxes text may now contain spaces (encoded as backslashes) 1.1.6 'Added' fragments can be flipped horizontally and/or vertically 1.1.7 Added symbol mode, use '@' in text to invoke it for a character 1.1.8 Added 'New' button to clear canvas. Added bond types 7 - 'wiggly' bond for uncertain stereochemistry, 8 - half arrow (use two of appropriate lengths for equilibrium reactions) and 9 - normal (reaction) arrow. Changed picking code to always return nearest object. ------------ gtk118 Version 1.1.8 with new GUI based on GTK toolkit Added 'Rotate' and 'Copy' functions for marked objects, Moved 'Flip H' and 'Flip V' from 'Add' dialog to general functions Improved marking method to allow dragging marked objects across other geometry ------------ 1.1.9 Button 2 in 'Bond type' mode reverses bond direction (e.g. for wedges) Centered double bond is now available at all angles Wide line for raised single bond (might need this for double as well?) Added example7, anabsinthin Correct initialization of drawing area, interconnection of 'radio buttons'. Fixed exporting of labels to xfig (right-justified labels had text backwards). Collect labels with special formatting (that are exported as individual characters) into XFig 'compound objects' for easier editing. ------------- 1.2a Renamed function round to round_coord to avoid name clash with glibc function. Cleaned up some code that provoked gcc warnings. Fixed gtk pointer chaos that barely worked on Linux libc5 and crashed on glibc. Canvas pixmap is now kept and cleared instead of recreated. File and Export Windows are now modal, Add button is greyed until a mark is set on the canvas. Marked fragments are now drawn in blue. 1.2a2 Improved font size and line width in xfig export (patch by Radek Liboska) Corrected positioning of sub/superscripts and handling of right-justified text in xfig export Increased width of 'wide' line from 4 to 6 units Treat command line parameter as name of file to load 1.2a3 Added pop-up message window for I/O operations (and fixed calls to I/O functions to always check the return value). Added check for "Chemtool Version" string in file header in load_mol and made version number mismatch non-fatal. Added redraw to make marked fragment immediately change color. Added experimental undo stack based on Matt Kimball's libundo library (set -DLIBUNDO in the Makefile to activate) - snapshots are saved with each 'mark' operation and may be recalled after a 'move' or 'rotate' by clicking the right mouse button. Restored yes/no dialog) for Load/Clear/Quit with unsaved changes. Restored xbm export function - though currently with reversed colors (???). Corrected label display - more whitespace around labels, vertical alignment of right-justified text was incorrect after subscript. 1.2a4 Fixed crashes caused by long message texts. Worked around pixmap inversion problem (by inverting the picture before exporting). Tried to make sure that the export pop-up does not leave traces in the xbm, set busy cursor for xbm export. Started commenting functions, removed dead code, formatted the sources with GNU indent. 1.2a5 Corrected spelling of Radek's name in ChangeLog. Changed XFIG (and PS) page format to European A4, fixed positioning of right-justified text with special characters (patch by Radek Liboska). Added bond type 11, circle (first point sets center, second radius). Increased drawing area size, added scrollbars. Added one more zoom step to either side. Improved arrowhead proportions. Added examples tcdd.cht and claisen.cht 1.2a6 Corrected scale of exported image, positioning of centered text and (dis-)appearance of vertical bonds near centered labels in XFig and Postscript export modes. Improved calculation of compound boxes around specially formatted labels in XFig mode. Added Del button to delete the marked fragment (user needs to klick in the marked area to confirm). Rewrote part of the export code for specially formatted labels. Sub/superscript position quality should be less dependent on drawing scale now. 1.2a7 Changed some line widths in export modes, modified arrowheads again, increased displacement and font size for superscript plus and minus signs. In text mode, mouse button 2 (middle) loads a label from the cursor position into the text entry box. Fixed claisen.cht (which had an arrow hidden in one bond) and added a new example, amp.cht (adenosine monophosphate, provided by Radek Liboska). 1.2a8 Updated Imakefile. Made fragment created by Copy function appear slightly offset from the original. Added redraw after a Delete. Added bond type 12, a dotted line. Added 'created by Chemtool 1.2' comment to XFig file header. Changed xbm export to always switch to zoom scale 1, as this appears to reduce the risk of a fatal Xlib error. Added several new molecule files provided by Radek Liboska (adamantane,cyclohexane,various nucleotides), moved all examples to subdirectory 'examples'. 1.2a9 Changed suffix of (encapsulated) postscript output files to .eps and fixed reporting of error codes in all export functions. Updated README file. Unless something serious comes up, this version will be released as 1.2. 1.2a10 Allow popups to be closed via the window manager without making the corresponding menu unavailable or even crashing chemtool. Corrected focus passing between submenus in the file dialog. Added sanity checks for >0 atoms in save and delete functions. Increased offset of copied fragment. 1.2 Re-release of 1.2a10 ---------------------------------------------------------------------------- 1.3a1 Fixed and restored XBM export. Added a (almost empty) template menu (the beginnings of which were already hidden in 1.2a8). Fixed kerning of mixed sub- and superscripts (as in SO_4^2^-). Changed allocation of initial drawing area, calculate actual size before saving. 1.3a2 Added option menu for default bond type , added label support to template function 1.3a3 Reduced preallocated drawing area to 'windowsize+100', as the increase in 1.3a1 (which used window+1000) caused a massive slowdown at startup. Freed unneeded pixmaps in the button setup code. Fragment rotation code now stores the initial coordinates and uses them as basis for the new positions - the previous, incremental calculation was severely plagued by accumulation of errors. 1.3a4 Changed bond option menu to use small icons instead of longer and less clear text labels. Removed check for 'cursor inside marked region' in 'Move' mode to allow smooth dragging. Started populating the O and N heterocycle panels of the template menu. Fixed a duplicate bond in the tcdd example, and removed those examples that have become templates. 1.3a5 Added shortcut for some labels - pressing c,n,o,s,p,r,i,h,d or b inserts the corresponding centered element symbol at the last drawing position, 'l','1','2','3' insert the left justified labels 'Cl','CH','CH_2','CH_3'. Fixed a GC leak in export_bitmap. 1.3a6 Moved the nucleoside examples to the template system. Made marker position default to last drawing position, so that the 'Add' function is now always active. Beginnings of internationalization (.mo file for German locale added). Fixed naphthalene template, added dicyclo- pentadiene. Changed Add_atom to automatically convert blanks in label input to backslashes for storage. Prepared a few drawings for later inclusion in the template system (camphor,pteridine,caffeine,glucose, fructose,mannose,galactose,neuraminic acid, spiro[4.5]decane). 1.3a7 Template cleanup: porphine moved to heterocycle panel, spirodecane added in its place. Glc,Fru,Man,Gal transfered to carbohydrate templates, caffeine to heterocycles. Czech translation (by Radek Liboska) added. Improved bounding box coordinates for xfig compound object (used for sub/superscripted labels) Changed export functions to remove the intermediate '.f2l' files. Changed orientation in xfig header to Portrait. Adapted xfig (and xfig-based) export modes to the new XFig default depth of 100. Changed depth of xfig text (labels) to 90 and added filled white polygons at depth 95 to hide overlapping line segments (experimental, used only for sub/superscripted text at the moment). Reset default filename to 'unnamed' when the current molecule is deleted. 1.3a8 Changed buttons mark/move/rotate/flip/delete/copy from text to icon to reclaim space for the text entry box (icons created by Radek Liboska). Added white polygon to clear area under normal text as well. 1.3a9 Added program icon. Added an interface for Radek Liboskas standalone program CHT, which calculates sum formula and molecular weight from a chemtool sketch. Corrected example drawing of brevetoxin. 1.3a10 Really reset mark flag when nothing was within the marker box. Allow saving only the marked region (formula weight computation only). Helper program CHT now parses those labels that are not in its internal table of common substituents; exact mass is now returned automatically.Added status line with message history. 1.3a11 Internationalization support made optional (define DISABLE_NLS in the Imakefile if you do not want it) to allow compiling on systems without GNU-style locale support again. Improved ring size and position in the benzene and cyclopentadiene templates (Michael Banck). Reset all marks before loading a template. If the template menu is already open, pressing the Template button now brings it to the front. Added templates (inden,biphenyl), removed the ugly question mark placeholders. Changed handling of windowmanager events, so that using the window decorations' CLOSE button brings up the Yes/No dialog while the chemtool window is still alive. Changes in helper program CHT (cht011a): now recognizes Ac in complex substituents; correctly handles aromatic 'ring' in formula input; checks input file for identifier "Chemtool"; reads number of bonds from "bonds" line (to handle label-only files gracefully); exits on unattached labels instead of silently miscalculating formula and mass. Subsequently updated to Radek Liboskas current version 0.19, which already includes equivalent changes. Added list of abbreviations supported by cht. 1.3a12 Reset all marks before 'adding' a sketch. Adding a label on top of an existing one now replaces the old label as it should. Added a function for rescaling objects (useful for drawing reagents above the reaction arrow - but labels are not rescaled yet). Added linetype 13, a single bond with opaque background (for crossing bonds - see the bicyclooctane template). Updated the German translation. This - plus or minus some templates - is my release candidate for 1.3. 1.3a13 Dropped the internal icon, as it was only causing trouble, especially with KDE. Most window managers allow specification of an external icon anyway (added chemtool.xpm for this purpose). Moved 'delete fragment' button to the end of the button row. Updated Czech translation by Radek Liboska. Added linetype 13 to the helper program CHT, made it accept any Chemtool 1.x file, not only version 1.2. Updated the 'documentation', i.e. the README file, split out an INSTALL file. Set version number in chemtool files to 1.3. Fixed bug that left a newly 'added' structure active but unable to move. Rewrote positioning logic for subscripts and right-justified text in export modes again. Changed screen display of molecule from 'fixed' fonts to helvetica as used in the export modes - previously, labels that appeared fine on screen could overlap in the final (postscript) output. Fixed 'mannose' template that showed exactly this. Added formatting option '|' for slanted characters (as in iPr,tBu). 1.3a14 Fixed label shortcuts for CH_2 and CH_3 that could crash chemtool (buffer overrun). Fixed scaling in export function , which had been applied to labels only. Improved label size at smallest scale. Added correction factor for sub/superscript after certain characters (the joys of proportionally-spaced fonts :-( ). Handled reopening of template menu after a close via the window manager. Updated 'About' menu (mention Radek Liboska as developer, add the tu-darmstadt webpage). 1.3a15 Changed canvas bitmap allocation to avoid uncovering garbled portions when the sliders are used. Fixed fragment deletion code (deletion of the marked fragment and redisplay of the modified drawing are now performed immediately). This hopefully fixes the crashes some people have been seeing with this function. 1.3 Added Check for no (or no selected) atoms before trying to delete a fragment, fixed bug that could deletion of a fragment to fail. Changed functions for horizontal and vertical flip to transform the atom(s) directly bonded to the marked fragment as well. Added current filename (if any) to window title. Use xfig's own arrow type in export of regular arrows (Michael Banck). Some code cleanup: removed dead code, fixed unnecessary parameter passing between functions, tidied formatting with GNU indent. Removed Imakefile and provided regular Makefile (the build process relies on gtk-config, not xmkmf, since 1.2), added install targets for the localization files and manpage. Updated cht to version 1.3. 1.3.1 Updated src-cht to version 1.7, which now also outputs composition in mass percentages and flags duplicate bonds with an exclamation mark. Fixed string buffer overflow problem with returned values from cht. Fixed some example files that contained duplicate bonds. Added appropriate window titles for the file selection dialogues. Fixed unit flag in xfig output (was 'Centimeters', should be 'Metric'). In eps export mode, fig2dev is now called with the '-L eps' option of fig2dev-3.2.3 first, and if this fails for some reason, the old-style '-Lps' option is tried (which would create non-encapsulated postscript with more recent versions of fig2dev). Modified the new Makefile (which was always recompiling all sources even if only one was changed). Reduced height of chemtool window by 20 pixels to keep the status line (with cht output) visible on 800x600 (laptop) screens. Modified calculation of xfig bounding box for labels - it was creating degenerate boxes (both x coordinates equal) for labels like H^+ which sometimes confused xfig. Chemtool now uses different cursor glyphs for the drawing and editing modes (Radek Liboska). An 'Add' or a failed 'Load' no longer changes the default filename. 'Delete marked fragment' is now performed by clicking the right button in 'mark' mode, the corresponding menu button is replaced by a function for cleaning up formula drawings (which removes duplicate bonds and fuses closes contacts) . Chemtool no longer draws a line from the top left corner to the first point set, and does not show the 'unsaved changes' dialog when there are no bonds or labels. Fixed button bar to correctly toggle from rotate to scale mode. Added callback to suppress insertion of labels via the hotkey function when the user wants to type into the text entry box. Fixed Latex export to not use whiteout boxes (which were obscuring the labels they were supposed to create space for), removed erroneous reference to the temporary .f2l file in the popup message. Drawing size (but not font size) was reversed in the two smallest zoom scales. Did another round of label positioning and kerning fixes in both screen and export modes. Updated alternate URL in documentation and About dialog, as the tu-darmstadt system is about to be shutdown. Added russian localisation (Michael Shigorin, based on 1.3). Updated czech localisation (Radek Liboska). ------- New development branch based on 1.3: 1.4.a1 Most of the bug fixes from 1.3.1 except those related to label kerning and export functions. Added two new bond types, the 'left' and 'right' versions of a partial (dashed) double bond, to chemtool and cht. In 'bondtype' mode, the type of the selected bond is now changed to the current default type instead of the next type in the cyclic list. Replaced the upper button row of the GUI by a more standard menu bar (Michael Bancks). 1.4.a2 Added the kerning and export fixes from 1.3.1. Added #ifdefs to simplify switching between the 'old' and 'new' GUI style. Made copying a marked object automatically invoke 'Move' mode instead of re-entering 'Mark' mode to prevent accidental placement of the copy on top of other geometry. Added function to draw square brackets around the marked part of a structure (currently treated as 2x3 single bonds internally). Added function to draw curves by specifying four control points - the curve runs from the first to the last point and is bounded by the other two (cubic bezier curve). Depending on the current bondtype at the time of drawing, the curve can be dotted, have a half or full arrowhead (bondtypes 12,8 or 9), be used to define a solid black object (e.g. orbital lobes, 'wide' linetype) or a simple line (all other bondtypes). This new object type is stored in a new section 'splines' in chemtool files, and converted to a xfig 'polyline' on export. In this version, it can only be added, marked and deleted - copying, moving or changing is not yet implemented. 1.4.a3 Fixed erratic text placement when textmode was already active at the time the text entry box was activated. Fixed broken dialog messages for Latex output. (Both bugs introduced in 1.3.1-pre2). Fixed miscalculation of spline curve, implemented copying, moving, and mirroring of curves, moving a curves control points and changing its type. Pressing the right mouse button in curve mode cancels the incomplete curve now. Added correct 'radio button' behaviour for the 'curve' button. Corrected fill color and shape of curve arrowheads. Replaced the simple export popup with an extended file selection dialog that provides choice of filetype and automatically appends appropriate suffixes. Changed xbm export to dump only the relevant part of the drawing area if nothing is marked. Unified the export dialog handling, clarified filetypes (LaTex export was named XFig/Latex although it has no separate xfig content, XBM was erroneously described as X pixmap instead of bitmap on its tooltip). 1.4.a4 Exporting to eps only claimed to use filename.eps, but actually reused the name of the drawing file, potentially overwriting it. Fill style for curves was not reset correctly on export, leading to strange effects on subsequent curves. Curve control points were not hidden in xbm output. 'Half arrow' curves had an extraneous arc protruding behind the arrowhead. Added preliminary support for 'curve' objects to template system (maximum of 2 per template), added 'orbital' page to template system (currently sporting one p orbital only). 1.4.a5 Implemented rotating and rescaling of spline curve objects. Limited size of arrowhead on curved arrows, added code to ensure that half arrowheads appear on the correct side of curved arrows. Added shortcut for 'curved semiarrows' to bondtype menu. (This creates a spline with two coinciding control points slightly offset from the midpoint of the line, so converting existing bonds to or from this type is not possible.) Control points are now only shown in 'move' mode, they are larger than before and displayed for 'circle' bonds as well. Moving the center of a circle now moves that circle without resizing it. 1.4.a6 Added special treatment of wedges and greek characters in Latex export mode to work around fig2devs apparent inability to translate filled polygons and the X11 symbol font into pictex commands. Changed wavy bond to change chirality depending on direction, so that they can be linked to form longer patterns. Some documentation updates. 1.4.a7 Added french localisation (by Jerome Pansanel, based on 1.3). Added arbitrary scaling (via the -m option of fig2dev) of eps and pictex output (suggested by Jerome Kieffer). Added a few examples (Viagra and some antibiotics) provided by Michael Banck. 1.4.a8 Added manual page for cht. Added menu code update by Michael Banck, most menu options have Ctrl-(key) shortcuts now. Added experimental (and not yet fully functional) automatic ring generation using Ctrl-3 to Ctrl-9 for 3- to 9-membered, Ctrl-0 to Ctrl-2 for 10-, 11-, 12-membered rings. Used fewer lines for the pictex representation of wedges to avoid exceeding Latex' memory capacity even with small molecules. 1.4.a9 Backed out the pictex wedge changes of a8, as the real solution is to increase the value of extra_mem_bot in texmf.cnf (without it, Latex will fail when there are even just a few simple drawings, with or without wedges, in a file. This is a known feature of PicTeX). Fixed output of regular characters in pictex - it was using italics because of leftover $ characters from the earlier implementation. Changed filenames of the examples added in a7 to reflect their contents. Successful exporting is now reported in the status bar instead of the popup window. Updated README and chemtool manpage. Rewrote ring generating code (Michael Banck) so that rings are correctly attached now. Ring drawing is initiated by holding the control key while drawing a bond that serves as the first segment of the ring. Ring size is governed by the current drawing mode (5, 6 or 8 sides), but it can be preset on a per-ring basis by pressing Ctrl-3 to Ctrl-9 for 3 to 9 sides, Ctrl-0 to Ctrl2 for 10, 11 and 12-membered rings. Rings are always drawn in clockwise direction based on the direction of the initial bond, they are marked automatically and can be erased by pressing Ctrl-mouse3 immediately after drawing. 1.4.a10 Fixed bug that prevented the template menu from working in alpha9. Fixed passing of pointers and added type casts to improve portability on platforms with different default sizes of int and pointer. Updated Makefiles (add declaration of $MAKE for building cht on systems where the default make program is not GNU make; install cht manpage; building cht does not require the math library). Prepared menu items for localisation, updated german translation. 1.4.a11 Tried a different approach to solve the portability issues in main.c. Dashed wedges are now drawn without the final, widest line (M.Banck), filled wedges adapt to the width of an adjacent wide line. Corrected rendering of arrowheads in Pictex output. Added polish translation (Nikodem Kuznik). Added several drawings of antibiotics to the examples and several chiral auxiliaries to the templates (files provided by M.Banck), moved some of the simple examples to the templates. Added '-i / --interpret' flag to cht to allow using it from the command line (e.g. cht -i C_6H_5OH). Added a rough sketch of the citrate cycle to the examples. Added a Makefile for compiling on 64bit SGI systems (provided by Michiel Kreutzer). 1.4.a12 Fixed zoom bug introduced with alpha11 (zoom out did not work). Fixed calculation of 'adaptive' wedge width in the export functions. Added key sequence '@*' for the 'dot' symbol character (which is not available with regular keyboard mappings), correspondingly added '*' to the shortcuts available in drawing mode. (For radicals, and to mark the atom positions in cumulenes, ketenes, etc.) Added a new bond type, 'striped' single bond for diastereomers. Drawing a ring with the 'circle' bond type now creates a polygon with an aromatic ring inside, instead of a sequence of overlapping circles. Updated Czech translations. 1.4.a13 Made cht work again (the new interactive mode had an uninitialized variable that prevented normal operation). Fixed a small spelling error in the Czech translation. Added Michiel Kreutzers Makefile for older 32bit SGI workstations. Holding the control button while dragging the mouse in scale mode now does anisotropic scaling for '3d' effects. 1.4.a14 Fixed locale declarations to make language support work again with new glibc. Moved declaration of locale path into the Makefile. Transformed an ugly bunch of 'if' clauses into a switch() for (slightly) faster screen drawing. Modified 'adaptive wedge' drawing code to draw a regular wedge when the angle between the wedge and the wide bond would make the wedge collapse into a thin line. Fixed a typo in the german locale file, added the trivial updates to the french localisation. Cleaned up the template menu code to fix the problem with missing template icons reported for RedHat 7.1. Added the updated polish translation provided by Nikodem Kuznik. Updated the rpm spec file in preparation for the 1.4 release. 1.4 Added updated russian translation (Michael Shigorin), updated the french translation (my french is horrible). Updated the usage instructions in the README and manual page.Changed rotation and inversion functions to act on the center of the marked fragment (Michael Banck). Reduced sensitivity of the scaling function. Fixed a potential memory overflow problem in move/rotate/scale. ----------- 1.5a1 Added function for importing MDL molfiles (Michael Banck). Revived 'undo' functionality based on Matt Kimballs 'libundo' project (his web page seems to have vanished, as have all other traces of this project, but as it was GPL'ed, we could distribute it with chemtool). Added (untested) export code for the Scalable Vector Graphics (SVG) file format. 1.5a2 Allowed adding of individual atoms to a marked object by selecting them with Ctrl+mouse. Changed rotation and inversion functions to use the center of the fragment as reference. Removed check for MDL version string in molfile import, as it is missing from BABEL- generated files. (Michael Banck) Tested (using W3C's Amaya) and fixed the SVG export. 1.5a3 Fixed MDL molfile parsing, which was sometimes reading incomplete lines. (Michael Banck). Fixed potential memory overflow problem in move,rotate and scale modes (converted a fixed size temporary array to malloc'd storage) and fixed the center calculation in rotate and invert modes (both backports from 1.4 final). Added functions for drawing various boxes (Radek Liboska) and changed the bracket button to display a corresponding popup menu. 1.5a4 Added curly braces and improved round braces, fixed xfig/latex/ps export of curves (which was broken by a runaway search-and-replace in 1.5a2) (Radek Liboska). Added PDB file import (simple distance- based bonding and doing z-axis projection). 1.5a5 Corrected one of the carbohydrate templates. Changed default extension of SVG files to .xml (mainly for croczilla, the svg-enabled mozilla). Added function for printing the current drawing (Radek Liboska), added printer configuration dialog. 1.5a6 Holding the control key while rotating a fragment now snaps to the nearest angle position of the current draw mode (Michael Banck). Added print scale to the printer configuration panel. Added shortcuts for zoom (Radek Liboska). Made a few small conformance fixes in the SVG export. PDB import now interprets CONECT records if present. Added a few carbohydrate templates (fucose,xylose,neuraminic acid). The printer configuration and the current working directory can now be saved in a ~/.chemtoolrc file that is read on startup. 1.5a7 Fixed filename problem that prevented printing (already broken in 1.5a5, though not in Radeks original patch). Activated and corrected the code that was supposed to configure the working directory name in alpha6. 1.5a8 Fixed 180 degrees rollover bug in fragment rotation (Michael Banck). Added brazilian portuguese localisation provided by Flavio Matsumoto (based on 1.4.1). Expanded template system to allow up to 15 labels per template (from 10). Added a few disaccharide templates (sucrose, maltose,lactose). Fixed position of whiteout box for plain labels in xfig-based export modes. Added tooltips to template system. 1.5a9 Corrected and completed the template tooltips. Fixed bug in whiteout box positioning - was using uninitalized variable for centered labels since 1.5a8. Updated brazilian portuguese translations to 1.5a8 (Flavio Matsumoto). Replaced the braindead GTK file dialogs with Michael Torrie's 'advanced gtk fileselection' code, which allows consistent handling of extension masks and directory traversal. Added default path and file extension options to Setup dialog and .chemtoolrc file. Added check for fig2dev version number to handle the recent change in postscript option names. Rewrote export functions to call fig2dev through pipes instead of using unsafe temporary files. Changed the automatic ring generator to draw six-membered rings with a correct set of double bonds when one of the double bond drawing modes is in use, and improved the accurracy of the ring coordinates (Michael Banck). Rearranged includes (ctype.h first) to work around reported compile problem on Mac OS-X. 1.5a10 Fixed reference counting of bonds,labels and curves in undo/redo. Added the code from Matt Kimballs original libundo library (compacted into undo.c/undo.h), providing multilevel ('unlimited') undo/redo capability. 1.5a11 Fixed crashes on export (caused by double close of output stream), reset undo history and drawing position on File->New. 1.5a12 File->New was a sure way to crash 1.5a11,should be fixed now. Improved reference counting in undo/redo, the undo stack should now survive both File->New and repeated undo'ing all the way to an empty canvas. Added hooks for more detailed error reporting in the xfig export. Added default shortcuts for Undo and Redo, renamed 'Setup Printer' menuitem to 'Setup Defaults'. Fixed typo that prevented building the old, menuless GUI (which probably noone needs anymore). Added signal handler to try and save the current drawing in case of a crash. 1.5a13 Fixed spurious error messages in file exports ( got mixed up with success and failure codes). Fixed crash in XBM export when no region was selected and there were 'active' fragments from an Add, Template, or ringdrawing operation present. Calculation of image width now takes length and direction of labels into account. Added configure script (Michael Banck). Improved kerning of combined sub- and superscripts in the middle of a label, changed cht call to use mkstemp for temporary file (Masao Kawamura). Added MDL molfile export (Michael Banck). 1.5a14 Fixes for stupid bugs in a13 (could cause crashes on Save on some machines; would still complain on export although files exported correctly). 1.5a15 Improved calculation of label length in SVG and XBM image sizing. Prevented negative image coordinates in XBM export that could cause random patterns to appear at the edges of the image. Added warning dialog for the case where saving or exporting would overwrite an existing file. Added support for drawing bonds of 1/3 and 1/2 standard length. 1.5a16 Added preview window to file selection dialog. Fixed a few cases where the input file was not properly closed when reading from it returned an error. Fixed spurious error message after successful import of MDL molfiles. 1.5a17 Activated preview in 'Add' mode. Fixed bug in Torrie's gtkfilesel code that caused a gtk error message when there was no previous filename to display during directory traversal. Added preliminary 3d rotation support to PDB import code (dropping CONECT reading for now - on the other hand the code should be usable for MOL as well). Added options for PDB label handling (all/non H/unnumbered) on import. Trimmed extension from the names of imported files on loading to prevent accidental overwriting of the original by the chemtool-generated file. Reset status message on 'File/New'. 1.5a18 Removed spurios preview area and PDB mode selectors from SaveAs dialog. Added Latex-like brace syntax for multi-character sub- and superscripts (one can now write C_{10}H_{22} instead of C_1_0H_2_2). Added support for two-digit subscripts in either notation to cht. 1.5a19 Added 3d rotation support to MDL molfile import, and restored interpretation of CONECT records in PDB import. Added sanity check of file header to MDL import. 1.5a20 Default file path could get initialized to meaningless data when a .chemtoolrc was present but had an empty datadir directive. Exchanged x and y rotation axes in 3d import, as the previous arrangement was counter-intuitive. Disabled all editing functions except zooming during 3d import. Added filename masks for the import dialogs - *.pdb,*.ent for PDB, *.mol,*.mdl for Molfile. Modified gtkfilesel code to allow up to three suffix masks. 1.5a21 Trying to load a chemtool file after importing some other file could cause the program to crash in the file selection dialog if no default filename mask was defined. Changed scaling of imported molfiles to take bond distances in the file into account. 1.5a22 Moved initial drawing position to make templates and labels appear near the center of the visible canvas instead of in the top left corner. Used pixmaps instead of labels for the navigation buttons in the file dialog. Updated Makefile.in so that cht-1.9 gets built. 1.5a23 Added sanity check to PDB reader to prevent endless loop on bad input. Updated .spec file and czech locale (Radek Liboska). Removed some dead code, reformatted sources with indent. Replaced pixmaps in file dialog with nicer-looking ones (Michael Banck). Updated german locale, recreated the localisation template and merged it into the existing fr,pl,pt_BR and ru locale files. Updated the README file. 1.5a24 Added labelling shortcuts to draw 'electron pairs' using the numeric keypad (if one imagines the atom symbol sitting on the '5' key, the surrounding keys represent the possible locations of 'electron pair' lines). Fixed SaveAs function (which could invalidate the canvas pixmap). Reconnected Set_Textmode() function to force textmode on activation of the label entry widget only if necessary. First point no longer snaps to closest endpoint when drawing half arrows - this makes drawing equilibrium arrows easier again. One can now use the Ctrl and Shift keys in Move mode to restrict movement to the horizontal and vertical direction respectively. 1.5a25 Adjusted position of 'electron pairs' a little, added adjustment for left and right side of two-character element symbols. Decreased size of 'whitespace' under labels in the screen display a little. Added special flag to bonds structure to distinguish regular bonds from decorative elements such as electron pairs, brackets and boxes (for molecular weight calculation and mdl molfile export). Changed helper program CHT accordingly, and made it ignore the 'half arrow' bondtype as well. Updated the README file. 1.5a26 Corrected file preview (badly applied last-minute patch in the already uploaded 1.5a25 - if one ignored the compiler warning, the resulting binary would crash on loading a preview). Improved preview window creation to solve some rare crashes. Fixed premature setting of 'modified' flag when nothing was changed in a drawing. Changed 'save' function to write the newly introduced 'decoration' flag only when it is set (as all previous versions are confused by it) and updated the version number in the header. Modified arrow drawing routines to shift the arrowhead when it would be obscured by a label (for drawing N-oxides and boron compouns). Modified CHT to ignore arrows that are not part of a molecule. 1.5a27 Corrected CONECT record interpretation in PDB import. Corrected initial drawing of imported 3d structure and repositioning error on confirmation of orientation. Fixed clipping of circle diameter line by inscribed characters (necessary for correct xfig/eps output when the circles are (ab)used as "balloons" for fragments.) Changed tidying function to skip over circles. Changed arrow drawing to limit arrowhead size for long arrows. Added bold text, using '#' as control character. 1.5 Updated spec file (Radek Liboska). Fix for 'stepwise rotation' mode not working for counter-clockwise rotation (Michael Banck). Added a program icon to the main window, and .cht mimetype definitions for Gnome and KDE (Radek Liboska), and updated configure script and Makefile.in to install them as needed. Fixed return code checking for printing (was not recognizing failed attempts due to wrong print command or queue name). Fixed off-by-one error in print status message length that could cause memory corruption. Updated Brazilian Portuguese translation (Flavio Matsumoto). Updated Russian translation and added .sdf extension to molfile import patterns (Michael Shigorin). Changed SVG filename extension back to .svg, as this is more correct than .xml (and the .xml name turned out to be necessary only as a workaround for a bug in Mozilla that has been fixed in the meantime). Updated Polish translation (Nikodem Kuznik). Made a few cosmetic changes in Makefile.in (Michael Banck). ---------------------------------------------------------------------------- 1.6a1 Added universal import mode based on BABEL (both Pat Walters' original version and the recent OpenBabel effort) converting to MDL molfile in a pipe. Began adding more elements to cht. 1.6a2 Menu entry 'Import (Babel)' is now only greyed out, no longer omitted if babel is not found on the system. Added exact masses for the elements added to cht in 16a1 (Ca,Cd,Co,Cr,Cu,Fe,Mn,Ni), completed element list for all stable maingroup elements (except noble gases) and the first row of transition metals. Added greek Phi (@F) as alternative symbol for Ph in cht. Updated the manpage for cht, and changed its Makefile.in to use the new version 2.3 of the source file for building. 1.6a3 Corrected typo that prevented import via the old babel-1.6. Fixed molfile (or babel-based) import of molecules with more than 100 bonds. Added dodecahedrane,pagodane and C70 (derived from the CSD database entries) to the examples. 1.6a4 Added partial support for EMF export (needs libEMF from sourceforge, and configure --enable-emf). Spline curves (i.e. curved arrows, orbital lobes and the like) are not yet exported, and text seems to be broken at least when viewed with SO 5.2. Fixed file selection dialogs to hide the babel-specific part only if it has actually been created (that is, when babel is installed). Fixed PDB import that got broken by the new babel code (it was falling through to babel mode). Improved SVG linewidths, scaling and labeling (Radek Liboska). 1.6a5 Fixed configure,configure.in and config.h.in to actually provide EMF option. Modified image sizing and label positioning in EMF export. 1.6a6 Corrected EMF frame size calculation and drawing of invisible box around EMF image. Removed duplicate atom label from viagra example. Added EMF export of spline objects (orbitals, curved arrows, etc.). Updated French translation (Jerome Pansanel). Added DESTDIR build option to Makefile.in and .desktop and .spec file for the Polish Linux Distribution (in subdir ./pld for now) (Pawel Golaszewski). 1.6a7 Added portability fixes to the undo code (*BSD and HPUX have MAP_ANON but not MAP_ANONYMOUS, and insist on fd being -1 when mmaping memory) (Nakata Maho). Added optional display of a (passive) background grid for positioning. Fixed output of greek characters in SVG export (glyph order differs in UTF and in the X11 Symbol set used by chemtool). 1.6a8 Prevented crash in babel-based import without valid input data, and fixed a race condition that could cause chemtool to suggest installation of babel although it had just found it. Added missing typecast in undo.c to quieten compiler on some platforms. Fixed Makefile.in for cht and removed a few unused functions from cht.c that might cause portability problems (Christian Weisgerber). Added SVG translation for the bullet symbol used for allenes or above-plane CH. Updated TODO list based on suggestions received from Radek Liboska. Cursor keys can now be used for pixel-precise drawing (and cursor key in combination with Shift key moves cursor position by five pixels). Changed gridsize to correspond to default bondlength,added hexagonal grid. The cleanup function now rightens bonds that deviate from ideal horizontal or vertical orientation by a single pixel - this is sometimes not visible on screen, but very much visible when printed. The print dialog and the XFig, LaTeX and EPS export options are now greyed out if fig2dev is not found at startup. Added the beginnings of color support (bonds and text can be black,red,green,blue,cyan, magenta or yellow). The requirement to write the 'decoration' flag in order to be able to write the color code behind it makes files written with this version finally incompatible with 1.4 and earlier. Fixed a race condition between mouse motion and buttonpress events that could lead to transient garbage on the screen (Daniel Uppstroem). Rubberband marker rectangle can now be drawn right-to left and bottom-to-top as well (Daniel Uppstroem). 1.6a9 Added another portability fix to the undo code - some systems, e.g. pre-8 Solaris, have neither MAP_ANON nor MAP_ANONYMOUS, but use /dev/zero instead (Fabio Rainone, by way of Thomas Volk). Fixed label reading code in the file loading functions to account for new textcolor field, incremented version number in the file header. Added SVG color support. Added cursor key support in 'Move fragment' mode. 1.6a10 The background grid can now be moved using Alt+Cursorkey. Spline curves can now be drawn in color too. The pen now snaps to additional grid positions at two and three times the standard bond length. Added a brief help text to accompany the 'About' window in the 'Help' menu. 1.6a11 Extended the hexagonal backdrop to cover the whole canvas again. Removed unnecessary `radio button' boxes on the items in the bond type selection menu. Created new row in main window for the text entry widget. Corrected screen drawing of blanks in labels (apparently a victim of cut-and-paste coding since at least v1.5). Added limited support for an alternate text font (bold,italic or sub/superscript are still drawn in Helvetica when this font is active). Added font button for switching between the standard Helvetica font and Times Roman (with the label of the text entry widget changing accordingly). 1.6a12 Replaced the stock gtkmenu code with an own version based on a patch by Matt Kimball (found in the gtk-devel mailinglist archive on gtk.org) which adds scrolling functionality to long optionmenues. This solves the problem of the babel import types being partly inaccessible due to the menu extending beyond the screen. 1.6a13 Fixed gtk pixmap reference problem in the Add dialog. Revived code for selection of single atoms, added marking of such selected atom with a green rectangle. Attachment site can be marked before saving a molecule or fragment, it then becomes the reference point for adding this fragment to other molecules (previously, this had to be the first atom in a file). Attachment sites are marked in the preview window by a small x. 1.6a14 Attachment site marker is now transformed (shifted, rotated or rescaled) with the fragment it is attached to. Drawing using the cursor keys is now controlled by the state of the shift key, i.e. one no longer has to keep the mouse button pressed during key-based cursor motion. Pressing Return commits a line, while in Move mode it 'drops' (unmarks) the marked fragment. Added support for new transfig version 3.2.4 (or current beta) that is able to generate preview bitmaps in eps files directly. 1.6a15 Updated rpm spec file. Added option to change the baselength of bonds (normally 10.668 mm). Removed references to Thomas Volks original website, which no longer exists. 1.6a16 Corrected check for newest transfig/fig2dev. Have new fig2dev generate monochrome TIFF previews inside the eps file instead of color - those were just too big. (A simple reaction scheme goes from 14kb eps to 60kb with b/w preview, and to 3 megabytes with color. The ascii EPSI previews are not much smaller than monochrome TIFF (55kb), and not as widely supported. Offer EMF output via fig2dev if sufficiently new version is installed (builtin EMF is still available as a compile-time option). Fixed ugly string overflow bug introduced by the rewrite of the default error message for formula weight calculation in alpha10 - this could cause crashes typically via the action sequence 'draw something, select mark mode,calculate fw, select draw mode again'. Thanks to Radek Liboska for alerting me to this problem. 1.6a17 Reenabled moving of newly 'Add'ed molecules (broken in a13). Improved rendering of 'Cl' in labels containing sub- or superscripts. Made eps preview addition a configurable (runtime) option. Changed title of configuration window, changed configuration menues to use regular menuitems instead of ugly check_menu_item widgets. Corrected width of white boxes under centered, non-sub/superscripted labels in the xfig-based export modes. Drawing these boxes is now an option (and switched off by default !). Corrected height and width information on fig text objects. Shortened wedge bonds connected to labels to remove the swallowtail effect that was sometimes visible on oblique bonds. Made fig2dev version check more robust. Removed a duplicate bond in the Indolizomycin example. Made F1 help text and template tooltips available for translation, added German translation of help text. 1.6a18 Added bold and italic variants of the alternate (Times Roman) font in the xfig-based export modes (Michael Banck). Fixed wrong xfig font_flag setting that could lead to missing or clipped labels in (e)ps export. Re-enabled deleting marked fragments by right-clicking, modified atom picking code for insertion points to be more reliable. Fixed "bondtype" button to update bond color as well as type. 1.6a19 Smoothed wedge-single bond intersections (Michael Banck). Added background color option for display and eps export. 1.6a20 Changed preview mode to enforce a white background on labels, not the current canvas color. Changed font handling to load all sizes once on startup instead of always loading and unloading just the set needed for the current zoom scale. Switched to scaled fonts at 17 and 20pt instead of using the default 18pt twice. Added fontsize property to text - text at 8,10,12,14,17,20 and 24pt can now coexist in a drawing. Increased allowed label length to 100 and fixed a bug that could truncate labels to well below 80 characters on loading. Fixed overflow in color code calculation that caused a white canvas to turn into an almost black background on eps export in alpha19. 1.6a21 Fixed nasty bug introduced in a20 (increase of label length constant MAXCL was not reflected in ct1.h, so different parts of the program had different ideas about the size of label data, causing crashes in Undo/Redo or File->New). Changed label shortcut to use the currently selected fontsize instead of the default for the current zoom scale (Michael Banck). Reduced number of lines in dashed wedge from 10 to 5 (Michael Banck). Modified dashed wedge and dotted line to draw a variable number of items (lines / dots) at constant interval instead of always drawing 10(5) equally spaced for lines of any length. Added hint for bold text to the textbox tooltip message. 1.6a22 Some objects (wedges,arrowheads,filled splines) were still exported with black interior regardless of their color. Color information for splines was read back but ignored on loading a file. The special treatment of wedge-bond-joins introduced in a19 could produce ugly results when the wide end of the wedge met two or more bonds. Changed number of lines in dashed wedges back to 10 for default length. Improved(?) text kerning in xfig-based print and export. 1.6a23 Allowed changing the properties of a dashed bond (by fixing an "off by one" error) (Radek Liboska). Fixed several bugs in SVG output (incorrect viewBox, wrong string length in color definition, missing fill attribute on text, syntax error in dashed line specification, bad arrowhead position) and added SVG support for variable text size, bold, italic and Times font (Radek Liboska). Modified text kerning in fig-based output once more. Updated Makefile.in to actually use the improved gtkmenu code introduced in 16a12, added 'lint' target for code checking with splint. Applied fixes (mostly typecasts) suggested by splint -weak. Updated Czech translation (Radek Liboska). 1.6a24 Corrected mistyped fontsizes for sub- and superscripts in SVG, eliminated a debug message (Radek Liboska). Changed number of dashes in dashed wedges to seven, which seems to be a good compromise. Corrected SVG representation of the 'wavy' bond. In text mode, left-clicking while holding the ctrl key now places an automatically incrementing counter at the cursor position for numbering sites. (There is currently no way to reset or otherwise modify the counter, it is reset only by 'New'. Note however that it becomes an ordinary label that can be moved or edited after placing it). 1.6a25 Changed double bond drawing code to no longer switch sides depending on drawing (or rotation) angle. (As a result of this, many templates and older drawings will need fixing, as bondtype 1 now consistently has the shorter bond on its left (assuming clockwise drawing), type 2 on its right.) Ctrl-rightmouse in text mode now resets the atom number counter introduced in alpha24, Ctrl-middle mouse sets it to the value in the text entry box (or zero, if no valid number can be read). 1.6a26 Applied Daniel Uppstroem's patch of 16a8 to the fragment move/rotate code, as the same kind of race condition existed there and could make a fragment assume the position (and even geometry) of a previously moved/rotated one. Some labels in the enhanced fileselection code were not available for translation (Radek Liboska). Spline curves could not be 'unmarked' by the Unmark_all function. Loading a template now removes all previously active markers again. Adapted templates and examples to the changed double bond drawing scheme, renamed some of the examples that were previously just example#. Adapted ring drawing shortcut to the changed double bond drawing scheme (Michael Banck). 1.6a27 Rescaling a molecule now also scales its labels. Downscaling beyond zero size (causing strange inversions) is no longer possible. Updated master .pot file for translations. Corrected label size setting in molecules read from templates (which was not yet adapted to the new fontsize scheme). Changed label printing in the xfig-based output modes once again to support the recent changes to the font and zoom code. Added wedge/bond joining to the SVG export mode. Renamed the "Orbitals" template menu to "Symbols" and added "plus", "minus" and a rearrangement arrow to it. Added a note about building chemtool on systems that do not allow name clashes with library functions to the INSTALL document (CYGWIN apparently does not let us use our own gtkmenu and gtkfileselection - ultimately, configure should test this). 1.6a28 Added two new bond types, a triple bond with all three lines equal, and a quadruple bond. Fixed bad nesting of loops in svg export that led to duplication of lines instead of the intended wedge join of a27. Tweaked subscript positioning in fig-based output some more, implemented bond pruning at label positions. 1.6a29 Added a portability fix for systems like GNU Hurd that have neither PATH_MAX nor MAXPATHLEN (Michael Banck). Suppressed the ugly markers that decorated previously selected items in the fontsize menu (Michael Banck). Saving via the Ctrl-S shortcut now produces a feedback message in the status line (Michael Banck). Saving via the shortcut function did not work if the drawing contained only curve objects. Changed export functions to use a fixed fontheight conversion table, which should resolve label positioning problems seen on at least one system with a non-standard Helvetica screen font. Reduced the amount of bond pruning around labels. Improved the positioning of right-justified labels by using individual character widths instead of average values in calculation of text length. Corrected horizontal placement of italic characters fig and fig-based export modes. 1.6 Added a 'configure' option to select between using our menu and fileselection functions and the stock GTK+-1.2 ones (set to use our own by default, unless on AIX or CYGWIN, where overloading of library functions is not possible). Updated the INSTALL document accordingly. Removed most of the obsolete cht versions from src-cht and fixed the conditional in the main Makefile that was still looking for an older version of the sources. Updated the manual page. Added an overview of the changes from the last stable version. Added tooltip for font selection button. Corrected helptext section on semiautomatic ring drawing, which was still refering to function keys. Made several messages and items available for translation. Updated German translation. Updated Polish translation (Nikodem Kuznik). Updated Czech translation (Radek Liboska). Fixed bug that caused heterocycle templates to be inserted with the 'decoration' flag set (and hence ignored in subsequent m.w. calculations) (Radek Liboska). Changed babel identification to take the recent change in usage message behaviour into account (needs -H for mode list in >= 1.100.1). Corrected GTK initialization for Russian locale (Michael Shigorin). Suppressed display of empty tooltip boxes for empty templates. 1.6.1 Fixed copy&paste error in helpwindow code that prevented catching of windowmanager kill signal (resulting in help window being unavailable after closing via window decoration instead of Ok button). Increased message length for semiautomatic ring drawing to prevent truncation of translated messages. Use a less strict test for labels on bond ends to improve reliability of the bond pruning on export. Updated French translation (Jerome Pansanel). Increased xfig label length value to prevent excessive clipping in eps export. Adjusted right-aligned labels and spacing around parentheses in xfig-based export modes. Added proper escaping of percent and dollar characters in latex export. Hopefully fixed compatibility problem with some SGI Irix systems caused by misapplication of Fabio Rainone's patches to the undo code in 1.6a9. Fixed potential crash on startup or font style switching that could result from missing Times or Helvetica fonts. Modified font loading to try the corresponding 100dpi font if a 75dpi font cannot be found. Special characters in Latex/PicTex export were not enclosed in $'s as they should be (Bruno Parente). Added proper linestyle initialization for all pencolors to make linewidth scale with zoom level again (Soeren Kristensen). SVG output improvements (Radek Liboska): added semicolons in style options, tweaked label y positions, use y displacement on sub/superscripts instead of the baseline-shift keyword, as the latter is not supported by some popular SVG editors (sodipodi and inkscape). In text mode, left-clicking on a label while the entry box is empty now updates font, size, color and alignment of that label to the current settings. In drawing modes, pressing the spacebar allows entering regular labels without leaving drawing mode (label is stored with 'Return'). Updated Brazilian Portuguese translation (Flavio Massao Matsumoto). Changed rindex() to its POSIX equivalent strrchr to improve portability. Updated README and chemtool manual page, and added an html copy. 1.6.2 Right-justified labels where misplaced by one character width on export. It is now possible to drag bonds in 'move' mode without having to 'mark' them first. Configure script now searches several locations for KDE by default. 1.6.3 Added forgotten parentheses around an if statement that prevented compilation on OS X. Converted all sprintf statements to snprintf, added type casts (and some directives) to make splint happy again. (Using it would have prevented the error above - now a "make lint" should again report no issues until something gets broken again.) Added .cht extension to all remaining example file names, added anthocyanidine example (which uses color for variable substituents). Changed configure script to add Darwin-specific LDFLAGS that allow us to use our own gtk widgets on OS X (Andrew Rohl). Changed Makefile.in to allow overriding its CFLAGS and CPPFLAGS settings as mentioned in the help message of configure. Corrected prototypes of the 'undo' functions in ct1.h (taken from the SuSE 9.1 srpm - meissner@suse.de). Changed all int/pointer conversions to use the glib macros instead of direct type casts - this makes chemtool work on 64 bit platforms (again?). Updated cht to recognize the second and third row of transition elements. Added cht's table of known abbreviations to both README and using_chemtool.html. 1.6.4 Added LaTeX translations for degree, copyright, plusminus. Added amino acid template. Limited arrowhead size for curved arrows. Changed positioning of left-justified labels without sub/superscript, reduced size and modified placement of sub/superscripts on export to more closely resemble the screen display. Changed font loading to require either 75dpi or 100dpi fonts, not a mixture of both. Added install -d targets for kde directories to Makefile.in. Extended xfig compound box (and optional whiteout box) to cover sub/super- scripts, corrected box size for sub/superscripted, right-justified labels. Added #ifdefs for compilation with GTK 2.x and adapted the configure script. If both GTK 1.x and 2.x are found, configure defaults to using 2.x, unless it was invoked with --enable-gtk1 . 1.6.5 Added Dutch localisation (Myckel Habets). Modified molfile output to translate OH,SH,NH,NH_2,PH,CH,CH_2,CH_3 into non-H atom plus hydrogen count and avoid use of 'query' bondtypes such as 'single or aromatic'. Fixed atom symbol justification in molfile export. Fixed compilation without GNU gettext and with the old-style button bar instead of menus. Corrected non-posix test semantics in configure.in and configure (which broke the FreeBSD port). Modified the built-in MDL molfile reader to skip over optional atom properties blocks. Cleaned up the naphthalene template (rings not perfectly joined). Added mdl molfile preview, import of V3000 molfiles, sdf reading support and preview browsing within sdf files. 1.6.6 Fixed a killer bug in the mdl preview code that must have crept in during a last minute edit. Fixed drawing of "wiggly" (unknown stereo- chemistry) bonds. Improved scaling in the molfile preview window and made it display heteroatom labels. Added a sample sdf file. 1.6.7 Various GTK2 fixes backported from the 1.7 alpha series: labels containing sub- or superscript were exported with all characters overlayed in the same position; the opening brace of multi-character subscripts was displayed on the screen; sub- and superscripts were too close to the regular baseline; symbol characters were rendered as regular latin characters or not at all; misdetection of the fig2dev version caused eps output to be full-page postscript; the background color selector could crash the program. RPM spec file did not install the dutch locale file. General fixes and enhancements backported from the 1.7 alpha series: Optional output to OpenOffice Draw (sxd) format using fig2sxd. SVG export lacked the 'xmlns' namespace tag (important at least for firefox 1.1) and did not handle the 'radical' dot correctly. SVG export uses rgb color values instead of color names for compatibility. The pencolor button was made wider to make it easier to recognize its color. The keys of the decimal keypad block now draw two dots instead of a line for an electron pair when used together with the shift key. The separation between the lines of double and triple bonds is now configurable. New bond types for drawing filled and unfilled p orbitals. 1.6.8 Use dy instead of y in SVG sub/superscripting to work around yet another bug in current firefox and konqueror. "Hexagonal" background grid is actually rhombic, changed descriptions and menu texts accordingly (Tamas Tevesz). Extended check for babel to recognize OpenBabel 2.0. Fixed a long-standing bug, probably dating back to 1.4a1, that manifested itself in crashes when compiled with gcc 4.0.x and optimization (Michal Marek/Richard Guenther). Reduced button spacing in gtk2 builds to keep rightmost button in full view. Mouse button 3 (right button) in move or rotate mode now aborts/undoes the transformation. Added a function to export files through babel. 1.6.9 Fixed placement of sub/superscripted, right-justified labels in gtk2 screen view and fig-based exports. Improved character spacing in gtk2 label output. Fig-based EMF export now uses a temporary file to work around a bug in fig2dev. Corrected whitespace calculation for gtk2 screen rendering of labels. Labels that (incorrectly) end with a sub- or superscript marker are now truncated before rendering. Corrected screen and file rendering of triple bonds with all three lines of equal length, and screen rendering of quadruple bonds. 1.6.10 Fixed copy/paste error that affected switching from text mode to spline drawing (rescaling was activated instead). Fixed interaction between menu accelerators and labeling shortcuts. Restyled options menu (Sebastian Koppehel). Fixed more gtk2/unicode breakage (non-ascii, non-greek characters were not displayed correctly and could even crash the program). Added a "round brackets" (parentheses) option to the box/bracket tool. Added option for fig2dev's international language support flag to allow exporting/printing of non-(western)European language labels and reduced width of arrowheads in ps/eps output (suggested by Andrei Golosovsky). Fixed compile problem in cht with recent gcc/glibc. Made the program more robust against errors in imported files (thanks to compile checks done by ALTlinux). Mentioned configure's options and useful settings for compiling on CYGWIN in the INSTALL document. Fix size of arrowheads and positioning of superscripts in SVG export (based on patch by Javeed Shaikh). Included a copy of the GNU GPL file COPYING to clarify license status for packagers. Updated the manual page. Fixed comparison against string literal (Pavol Rusnak). SVG output left blanks in labels unprotected, breaking subsequent saving of file. Fixed SVG output of upper half of ISO8859 in the (unicode-unaware) GTK1 build. Fixed crash after detection of a non-functional babel installation (e.g. due to missing libraries). Added fig2dev/gs-based export to PNG. Fixed duplicate filetype selector in the "Import (Babel)" menu and allocation problem in creating the list of supported file types. Screen display now uses bond clipping instead of placing spots of background color underneath labels. Exporting to an unwritable path could crash chemtool (if a pipe error was raised before the write error was handled). Added "kprinter" option to print command selection. Fixed overly eager cleanup function that was removing the drop shadows from the decorated boxes. Fixed "load" operation to invalidate any pending "mark" rectangles. Revised calculation of text lengths in xfig output. Added templates for the isomers of diazole and for two representations of the morphine structure. 1.6.11 Reworked the package structure to conform to the usual autotools and gettext conventions in the hope that this simplifies maintenance of translations. (I have disabled creation of fuzzy translations in the po/Makefile.* after seeing morphine translated as porphine (understandable) and mannose as exit (huh???)). Re-enabled translation of several error messages; updated translations. Corrected calculation of text dimensions for simple labels (fixes label truncation in fig-based export modes as reported by Nuno Azoia). Current bond length and zoom factor are now saved in structure files and restored upon Load (but not Add). Export to OpenOffice should not use the LaTeX flag. Fixed truncation of triple and "left"-double bonds with labels in the screen drawing. Updated the README file. Made another attempt at improving the rendering of sub/superscripted labels in print and fig-based export modes. Fixed substituent alignment in the tetracycline example. Fixed previewing of files created with older versions of chemtool (that lack color information, such as many of the provided examples). Added the "gtklp" cups frontend to the print commands menu and made the "kprinter" entry actually usable. Reformatted this ChangeLog to once again fit into 80 chars per line. Added European Portuguese translation (Nuno Azoia). Updated the chemtool manpage and the introductory html file. 1.6.12 Improved trunctation of bonds between labels at the same height (e.g. CH2-CH2). Added simple batch mode operation - when invoked as "chemtoolbg ", it converts the given chemtool file to the desired output format without opening a window. Corrected label spacing after parentheses. Improved manpage formatting (Daniel Leidert). Fixed SVG export of texts containing xml special characters (<,>,&). Chemtool now checks the screen dimensions on startup and reduces its window height if necessary to fit on small (asus eeepc) screens. Added Bulgarian translation (Svetoslav Stefanov). Removed unused function declarations from cht. Marked objects are now highlighted by increased linewidth. Copying no longer offsets the copy from the original by default, thereby keeping alignment between copies. Resurrected support for building against an external libEMF. Changed molfile export to make Y axis direction consistent with other programs. Updated polish translation (Micha Smoczyk). Added bond color "white" for drawing on colored backgrounds. Changed pencolor selection button to present a drop-down menu instead of switching to the next color. .... 1.6.13 Initialized background color setting for all modes. Fixed building with gnu "gold" linker and similar systems that do not resolve indirect dependencies on libX11 automatically (Dominik Mierzejewski,Daniel Leidert). Tweaked the settings for the "crossing" bond to allow clipping of other bonds closer to its endpoints. Added missing "undo" savepoint on entering "Move" mode. When a default extension is defined, it is now automatically appended to the filename on saving if needed (Pavel Solntsev via Michael Shigorin). Fixed mis-declaration of color numbers for the font and pencolor icons that could cause a crash on startup especially when compiling with gcc-4.5 and later. Added limited support for "special" (such as greek) characters inserted by cut-and-paste from OpenOffice or other UTF-8 capable programs. (Internally, these are converted to the "@+character" encoding, so only the already supported range of symbols will work. This is mostly due to chemtool's reliance on xfig/transfig). Changed conditionals for national language support to the standard ENABLE_NLS understood by configure (Daniel Leidert - this fixes missed support for translations in the default Debian packages). 1.6.14 Updated build system to autoconf-2.69 to allow building for ARM64 (Fedora bug 925219). Fixed potential crash due to double free() in EPS and related outputs. Fixed illegal memory access in EPS output of sub/superscripted characters. Fixed detection of newer versions of openbabel. chemtool-1.6.14/chemproc.c0000644000175000001440000013771311675152144014614 0ustar martinusers/* * functions for calculation and memory-management */ #include #include "ct1.h" #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef M_PI #define M_PI 3.14159265358979323846 /* pi */ #endif #ifndef M_PI_4 #define M_PI_4 0.78539816339744830962 /* pi/4 */ #endif #define boxgap 25 #ifdef LIBUNDO #include "undo.h" #endif void del_struct (struct data *hpc) /* remove the data structure corresponding to a bond */ { if (hp->n && hpc) { (hpc->prev)->next = hpc->next; (hpc->next)->prev = hpc->prev; #ifdef LIBUNDO undo_free (hpc); #else free (hpc); #endif hp->n--; } } struct dc * select_char (int mx, int my, float s_f) /* find the label closest to the current cursor position */ { int x, y, d; struct dc *hpc; struct xy_co *coord; x = round_coord (mx, s_f); y = round_coord (my, s_f); coord = position (x, y, x, y, No_angle); x = coord->x; y = coord->y; hpc = dac_root.next; for (d = 0; d < hp->nc; d++) { if (x == hpc->x && y == hpc->y) return (hpc); hpc = hpc->next; } return (NULL); } void add_char (int x, int y, char *c, int direct, int marked, int color, int font, int size) /* add a new label */ { struct dc *last; strcpy (new_c->c, c); new_c->x = x; new_c->y = y; new_c->direct = direct; new_c->marked = marked; new_c->color = color; new_c->font = font; new_c->size = size; #ifdef LIBUNDO new_c->next = (struct dc *) undo_malloc (sizeof (struct dc)); #else new_c->next = (struct dc *) malloc (sizeof (struct dc)); #endif last = new_c; new_c = new_c->next; hp->nc++; new_c->prev = last; new_c->next = NULL; } void del_char (struct dc *hpc) /* remove a label */ { if (hp->nc && hpc) { (hpc->prev)->next = hpc->next; (hpc->next)->prev = hpc->prev; #ifdef LIBUNDO undo_free (hpc); #else free (hpc); #endif hp->nc--; } } int round_coord (int i, float step) /* performs adaptive rounding of the input value */ { int h; h = i / step; if (((float) i / step - h) > 0.5) h++; return (h); } void add_struct (int x, int y, int tx, int ty, int bond, int smarked, int tmarked, int decoration, int color) /* adds the data corresponding to a new bond */ { struct data *last; struct xy_co *coord; int lx,ly; if (bond == 17) { add_spline (x, y, (int) (x + 0.5 * (tx - x)), (int)(y - 0.5 * (ty - y)), (int) (x + 0.5 * (tx - x)), (int)(y - 0.5 * (ty - y)), tx, ty, 1, smarked,color); return; } if (bond == 20) { coord=multi_bonds(x,y,tx+(tx-x),ty+(ty-y),60); lx=coord->tx; ly=coord->ty; coord=multi_bonds(tx+tx-x,ty+ty-y,x,y,60); add_spline (x, y, lx,ly, coord->x, coord->y, x, y , 0, smarked,color); return; } if (bond == 21) { coord=multi_bonds(x,y,tx+(tx-x),ty+(ty-y),60); lx=coord->tx; ly=coord->ty; coord=multi_bonds(tx+tx-x,ty+ty-y,x,y,60); add_spline (x, y, lx,ly, coord->x, coord->y, x, y , -1, smarked,color); return; } new->x = x; new->y = y; new->tx = tx; new->ty = ty; new->bond = bond; new->smarked = smarked; new->tmarked = tmarked; new->decoration = decoration; new->color = color; #ifdef LIBUNDO new->next = (struct data *) undo_malloc (sizeof (struct data)); #else new->next = (struct data *) malloc (sizeof (struct data)); #endif last = new; new = new->next; hp->n++; new->prev = last; new->next = NULL; } void add_spline (int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int type, int marked, int color) /* adds the data corresponding to a new spline curve*/ { struct spline *last; sp_new->x0 = x0; sp_new->y0 = y0; sp_new->x1 = x1; sp_new->y1 = y1; sp_new->x2 = x2; sp_new->y2 = y2; sp_new->x3 = x3; sp_new->y3 = y3; sp_new->type = type; sp_new->marked = marked; sp_new->color = color; #ifdef LIBUNDO sp_new->next = (struct spline *) undo_malloc (sizeof (struct spline)); #else sp_new->next = (struct spline *) malloc (sizeof (struct spline)); #endif last = sp_new; sp_new = sp_new->next; hp->nsp++; sp_new->prev = last; sp_new->next = NULL; } void del_spline (struct spline *hpsp) /* remove the data structure corresponding to a spline curve */ { if (hp->nsp && hpsp) { (hpsp->prev)->next = hpsp->next; (hpsp->next)->prev = hpsp->prev; #ifdef LIBUNDO undo_free (hpsp); #else free (hpsp); #endif hp->nsp--; } } struct data * select_vector (int mx, int my, float s_f) /* returns the bond that is closest to the current cursor position */ { int v1, v2, v, d, x, y, tx, ty; struct data *hpc, *hmin; int vmin; hpc = da_root.next; vmin = 999999; hmin = 0; for (d = 0; d < hp->n; d++) { x = hpc->x * s_f; tx = hpc->tx * s_f; y = hpc->y * s_f; ty = hpc->ty * s_f; v = calc_vector (abs (tx - x), abs (ty - y)); v1 = calc_vector (abs (mx - x), abs (my - y)); v2 = calc_vector (abs (tx - mx), abs (ty - my)); if (v1 + v2 <= v) { vmin = MIN (vmin, v - v1 - v2); hmin = hpc; } hpc = hpc->next; } if (hmin) return (hmin); else return (NULL); } struct xy_co * multi_bonds (int mx, int my, int mtx, int mty, int r) /* calculates the line endpoints required for drawing a double or triple bond */ { int x = 0, y = 0, tx = 0, ty = 0, dx, dy; struct xy_co *coord = &xycoord[0]; float alpha; int v; dx = mtx - mx; dy = mty - my; v = calc_vector (abs(dx), abs(dy)); alpha = (float) asin ((float) dx / v); if ((dx < 0 && dy < 0) || !dy) { x = (int) (r * cos (alpha - M_PI_4)); y = (int) (r * sin (alpha - M_PI_4)); tx = (int) (r * cos (alpha + M_PI_4)); ty = (int) (r * sin (alpha + M_PI_4)); } if (dx > 0 && dy > 0) { x = (int)(-r * cos (alpha + M_PI_4)); y = (int)(r * sin (alpha + M_PI_4)); tx = (int)(-r * cos (alpha - M_PI_4)); ty = (int)(r * sin (alpha - M_PI_4)); } if (dx < 0 && dy > 0) { x = (int) (-r * cos (M_PI + alpha - M_PI_4)); y = (int) (r * sin (M_PI + alpha - M_PI_4)); tx = (int) (r * cos (alpha + M_PI_4)); ty = (int) (-r * sin (alpha + M_PI_4)); } if (dx > 0 && dy < 0) { x = (int) (-r * cos (alpha + M_PI_4)); y = (int) (-r * sin (alpha + M_PI_4)); tx = (int) (-r * cos (alpha - M_PI_4)); ty = (int) ( -r * sin (alpha - M_PI_4)); } if (!dx && dy < 0) { x = (int) (-r * cos (M_PI_4)); y = (int) (-r * sin (M_PI_4)); tx = (int) (-r * cos (M_PI_4)); ty = (int) (r * sin (M_PI_4)); } if (!dx && dy > 0) { x = (int) (r * cos (M_PI_4)); y = (int) (r * sin (M_PI_4)); tx = (int) (r * cos (M_PI_4)); ty = (int) (-r * sin (M_PI_4)); } x = (int) (-r * cos (alpha + M_PI_4)); y = (int) (-r * sin (alpha + M_PI_4)); tx = (int)( -r * cos (alpha - M_PI_4)); ty = (int) (-r * sin (alpha - M_PI_4)); if (dy >0) { x = (int) (r * cos (alpha - M_PI_4)); y = (int) (-r * sin (alpha - M_PI_4)); tx = (int) (r * cos (alpha + M_PI_4)); ty = (int) (-r * sin (alpha + M_PI_4)); } coord->x = mx + x; coord->y = my + y; coord->tx = mtx + tx; coord->ty = mty + ty; return (coord); } struct xy_co * center_double_bond (int mx, int my, int mtx, int mty, int r) /* returns the line endpoints for drawing a centered double bond */ { int x = 0, y = 0, tx = 0, ty = 0; int sx = 0, sy = 0, stx = 0, sty = 0; struct xy_co *coord = &xycoord[0]; struct xy_co *coord2 = &xycoord[1]; float alpha; int v, dx, dy;; dx = mtx - mx; dy = mty - my; v = calc_vector (dx, dy); alpha = (float) asin ((float) dx / v); if ((dx < 0 && dy < 0) || !dy) { x = (int) (r * cos (alpha - M_PI)); y = (int) (r * sin (alpha - M_PI)); tx = (int) (r * cos (alpha + M_PI)); ty = (int) (r * sin (alpha + M_PI)); sx = (int) (-r * cos (alpha - M_PI)); sy = (int) (-r * sin (alpha - M_PI)); stx = (int) (-r * cos (alpha + M_PI)); sty = (int) (-r * sin (alpha + M_PI)); } if (dx > 0 && dy > 0) { x = (int) (-r * cos (alpha + M_PI)); y = (int) (r * sin (alpha + M_PI)); tx = (int) (-r * cos (alpha - M_PI)); ty = (int) (r * sin (alpha - M_PI)); sx = (int) (r * cos (alpha + M_PI)); sy = (int) (-r * sin (alpha + M_PI)); stx = (int) (r * cos (alpha - M_PI)); sty = (int) (-r * sin (alpha - M_PI)); } if (dx < 0 && dy > 0) { x = (int) (-r * cos (M_PI + alpha - M_PI)); y = (int) (r * sin (M_PI + alpha - M_PI)); tx = (int) (r * cos (alpha + M_PI)); ty = (int) (-r * sin (alpha + M_PI)); sx = (int) (r * cos (M_PI + alpha - M_PI)); sy = (int) (-r * sin (M_PI + alpha - M_PI)); stx = (int) (-r * cos (alpha + M_PI)); sty = (int) (r * sin (alpha + M_PI)); } if (dx > 0 && dy < 0) { x = (int) (-r * cos (alpha + M_PI)); y = (int) (-r * sin (alpha + M_PI)); tx = (int) (-r * cos (alpha - M_PI)); ty = (int) (-r * sin (alpha - M_PI)); sx = (int) (r * cos (alpha + M_PI)); sy = (int) (r * sin (alpha + M_PI)); stx = (int) (r * cos (alpha - M_PI)); sty = (int) (r * sin (alpha - M_PI)); } if (!dx && dy < 0) { x = (int) (-r * cos (M_PI)); y = (int) (-r * sin (M_PI)); tx = (int) (-r * cos (M_PI)); ty = (int) (r * sin (M_PI)); sx = (int) (r * cos (M_PI)); sy = (int) (r * sin (M_PI)); stx = (int) (r * cos (M_PI)); sty = (int) (-r * sin (M_PI)); } if (!dx && dy > 0) { x = (int) (r * cos (M_PI)); y = (int) (r * sin (M_PI)); tx = (int) (r * cos (M_PI)); ty = (int) (-r * sin (M_PI)); sx = (int) (-r * cos (M_PI)); sy = (int) (-r * sin (M_PI)); stx = (int) (-r * cos (M_PI)); sty = (int) (r * sin (M_PI)); } coord->x = mx + x; coord->y = my + y; coord->tx = mtx + tx; coord->ty = mty + ty; coord2->x = mx + sx; coord2->y = my + sy; coord2->tx = mtx + stx; coord2->ty = mty + sty; return (coord); } int calc_vector (int dx, int dy) /* returns the length of a bond vector */ { return ((int) sqrt ((double)(dx * dx + dy * dy))); } struct xy_co * calc_angle (int x, int y, int ang_type, int angle, int factor) /* returns the nearest grid position to the cursor */ { struct xy_co *coord = &xycoord[0]; int hex[] = { 0, -64, 32, -55, 55, -32, 64, 0, 55, 32, 32, 55, 0, 64, -32, 55, -55, 32, -64, 0, -55, -32, -32, -55 }; int pent[] = { 0, -64, 37, -51, 60, -19, 60, 19, 37, 51, 0, 63, -37, 51, -60, 19, -60, -19, -37, -51 }; int pent_sw[] = { 19, -60, 51, -37, 63, 0, 51, 37, 19, 60, -19, 60, -51, 37, -63, 0, -51, -37, -19, -60 }; int octa_angle[] = { 0, 64, 45, 45, 63, 0, 45, -45, 0, -63, -45, -45, -63, 0, -45, 45 }; switch (ang_type) { case Hex: coord->x = x + hex[angle * 2] / factor; coord->y = y + hex[angle * 2 + 1] / factor; break; case Pent: coord->x = x + pent[angle * 2] / factor; coord->y = y + pent[angle * 2 + 1] / factor; break; case Pent_switch: coord->x = x + pent_sw[angle * 2] / factor; coord->y = y + pent_sw[angle * 2 + 1] / factor; break; case Octa: coord->x = x + octa_angle[angle * 2] / factor; coord->y = y + octa_angle[angle * 2 + 1] / factor; break; } return (coord); } struct xy_co * position (int x, int y, int ax, int ay, int ang_type) { int angle_count[] = { 0, 12, 10, 10, 8 }; int d, i, dmax, dx, dy, v, bx, by, bv; int hx, hy; struct dc *hp_a; struct data *hp_b; struct spline *hp_s; struct xy_co *coord = &xycoord[0]; bx = x; by = y; bv = 16; hp_b = da_root.next; for (d = 0; d < hp->n; d++) { dx = abs (x - hp_b->x); dy = abs (y - hp_b->y); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hp_b->x; by = hp_b->y; } dx = abs (x - hp_b->tx); dy = abs (y - hp_b->ty); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hp_b->tx; by = hp_b->ty; } hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { dx = abs (x - hp_a->x); dy = abs (y - hp_a->y); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hp_a->x; by = hp_a->y; } hp_a = hp_a->next; } hp_s = sp_root.next; for (d = 0; d < hp->nsp; d++) { dx = abs (x - hp_s->x0); dy = abs (y - hp_s->y0); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hp_s->x0; by = hp_s->y0; } dx = abs (x - hp_s->x1); dy = abs (y - hp_s->y1); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hp_s->x1; by = hp_s->y1; } dx = abs (x - hp_s->x2); dy = abs (y - hp_s->y2); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hp_s->x2; by = hp_s->y2; } dx = abs (x - hp_s->x3); dy = abs (y - hp_s->y3); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hp_s->x3; by = hp_s->y3; } hp_s = hp_s->next; } dmax = angle_count[ang_type]; for (i = 1; i < 4; i++) { for (d = 0; d < dmax; d++) { coord = calc_angle (ax, ay, ang_type, d, i); hx = coord->x; hy = coord->y; dx = abs (x - hx); dy = abs (y - hy); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hx; by = hy; } /*retry at double distance */ hx = 2*hx-ax ; hy = 2*hy-ay ; dx = abs (x - hx); dy = abs (y - hy); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hx; by = hy; } /*retry at greater distance */ hx = 3*coord->x-2*ax ; hy = 3*coord->y-2*ay ; dx = abs (x - hx); dy = abs (y - hy); v = calc_vector (dx, dy); if (v < bv) { bv = v; bx = hx; by = hy; } } } coord->x = bx; coord->y = by; return (coord); } struct xy_co * intersect (int ax, int ay, int atx, int aty, int bx, int by, int btx, int bty) /* returns the intersection of two lines */ { struct xy_co *coord = &xycoord[0]; /* the direction vectors of the two lines */ int avx = atx - ax, avy = aty - ay, bvx = btx - bx, bvy = bty - by; float mu; /* the factor of the second line */ mu = (float)(avx * (ay - by) + avy * (bx - ax)) / (float)(bvy * avx - avy * bvx); coord->x = bx + (int)rint(mu * bvx); coord->y = by + (int)rint(mu * bvy); return (coord); } void setup_data (void) /* initializes the bond and label arrays */ { new = &da_root; new->prev = NULL; #ifdef LIBUNDO new->next = (struct data *) undo_malloc (sizeof (struct data)); #else new->next = (struct data *) malloc (sizeof (struct data)); #endif new = new->next; new->prev = &da_root; new_c = &dac_root; new_c->prev = NULL; #ifdef LIBUNDO new_c->next = (struct dc *) undo_malloc (sizeof (struct dc)); #else new_c->next = (struct dc *) malloc (sizeof (struct dc)); #endif new_c = new_c->next; new_c->prev = &dac_root; sp_new = &sp_root; sp_new->prev = NULL; #ifdef LIBUNDO sp_new->next = (struct spline *) undo_malloc (sizeof (struct spline)); #else sp_new->next = (struct spline *) malloc (sizeof (struct spline)); #endif sp_new = sp_new->next; sp_new->prev = &sp_root; #ifdef LIBUNDO hp = (struct new *) undo_malloc (sizeof (struct new)); #else hp = (struct new *) malloc (sizeof (struct new)); #endif hp->n = 0; hp->nc = 0; hp->nsp = 0; } void clear_data (void) /* clears the bond and label lists */ { struct data *hp_b; struct dc *hp_a; struct spline *hp_sp; int hn, hnc, hnsp, d; hn = hp->n; hnc = hp->nc; hnsp = hp->nsp; hp_b = da_root.next; for (d = 0; d < hn; d++) { del_struct (hp_b); hp_b = hp_b->next; } hp_a = dac_root.next; for (d = 0; d < hnc; d++) { del_char (hp_a); hp_a = hp_a->next; } hp_sp = sp_root.next; for (d = 0; d < hnsp; d++) { del_spline (hp_sp); hp_sp = hp_sp->next; } } int check_pos_rec (int x, int y, int rx, int ry, int rtx, int rty) /* checks if a given point is inside the rectangle (rx|ry)(rtx|rty) */ { if (x > rx && y > ry && x < rtx && y < rty) return (1); return (0); } int partial_delete () /* deletes the bonds and labels inside the selection rectangle */ { int d, r = False; int hn; struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; hp_atom = dac_root.next; hn = hp->nc; for (d = 0; d < hn; d++) { if (hp_atom->marked) { del_char (hp_atom); r = True; } hp_atom = hp_atom->next; if (!hp_atom) break; } hp_bond = da_root.next; hn = hp->n; for (d = 0; d < hn; d++) { if (hp_bond->smarked || hp_bond->tmarked) { del_struct (hp_bond); r = True; } hp_bond = hp_bond->next; if (!hp_bond) break; } hp_spline = sp_root.next; hn = hp->nsp; for (d = 0; d < hn; d++) { if (hp_spline->marked) { del_spline (hp_spline); r = True; } hp_spline = hp_spline->next; if (!hp_spline) break; } if (addflag ==1) if (refmark==1){ addflag=0; refmark=0; refx=refy=0; } if (r) { FreePix (); CreatePix (); Display_Mol (); } return (r); } void get_center_marked (int *x, int *y) /* get the geometric center of the marked fragment */ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int d; int xmax,ymax,xmin,ymin; xmin=1000000; ymin=1000000; xmax=-1000000; ymax=-1000000; if (hp->n || hp->nc || hp->nsp) { hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { if (hp_atom->marked == 1) { if (hp_atom->x > xmax) xmax = hp_atom->x; if (hp_atom->y > ymax) ymax = hp_atom->y; if (hp_atom->x < xmin) xmin = hp_atom->x; if (hp_atom->y < ymin) ymin = hp_atom->y; } hp_atom = hp_atom->next; } hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_bond->smarked == 1) { if (hp_bond->x > xmax) xmax = hp_bond->x; if (hp_bond->y > ymax) ymax = hp_bond->y; if (hp_bond->x < xmin) xmin = hp_bond->x; if (hp_bond->y < ymin) ymin = hp_bond->y; if (hp_bond->tx > xmax) xmax = hp_bond->tx; if (hp_bond->ty > ymax) ymax = hp_bond->ty; if (hp_bond->tx < xmin) xmin = hp_bond->tx; if (hp_bond->ty < ymin) ymin = hp_bond->ty; } hp_bond = hp_bond->next; } hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->marked) { if (hp_spline->x0 < xmin) xmin = hp_spline->x0; if (hp_spline->x0 > xmax) xmax = hp_spline->x0; if (hp_spline->y0 < ymin) ymin = hp_spline->y0; if (hp_spline->y0 > ymax) ymax = hp_spline->y0; if (hp_spline->x1 < xmin) xmin = hp_spline->x1; if (hp_spline->x1 > xmax) xmax = hp_spline->x1; if (hp_spline->y1 < ymin) ymin = hp_spline->y1; if (hp_spline->y1 > ymax) ymax = hp_spline->y1; if (hp_spline->x2 < xmin) xmin = hp_spline->x2; if (hp_spline->x2 > xmax) xmax = hp_spline->x2; if (hp_spline->y2 < ymin) ymin = hp_spline->y2; if (hp_spline->y2 > ymax) ymax = hp_spline->y2; if (hp_spline->x3 < xmin) xmin = hp_spline->x3; if (hp_spline->x3 > xmax) xmax = hp_spline->x3; if (hp_spline->y3 < ymin) ymin = hp_spline->y3; if (hp_spline->y3 > ymax) ymax = hp_spline->y3; } hp_spline = hp_spline->next; } } *x = (xmin + xmax) / 2; *y = (ymin + ymax) / 2; return; } void center_mol (void) /* tries to center the drawing on the drawing area */ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int xmax = 0, ymax = 0; int xmin = head.width, ymin = head.height; int d; if (hp->n || hp->nc || hp->nsp) { hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { if (hp_atom->x > xmax) xmax = hp_atom->x; if (hp_atom->y > ymax) ymax = hp_atom->y; if (hp_atom->x < xmin) xmin = hp_atom->x; if (hp_atom->y < ymin) ymin = hp_atom->y; hp_atom = hp_atom->next; } hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_bond->x > xmax) xmax = hp_bond->x; if (hp_bond->y > ymax) ymax = hp_bond->y; if (hp_bond->x < xmin) xmin = hp_bond->x; if (hp_bond->y < ymin) ymin = hp_bond->y; if (hp_bond->tx > xmax) xmax = hp_bond->tx; if (hp_bond->ty > ymax) ymax = hp_bond->ty; if (hp_bond->tx < xmin) xmin = hp_bond->tx; if (hp_bond->ty < ymin) ymin = hp_bond->ty; hp_bond = hp_bond->next; } hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->x0 < xmin) xmin = hp_spline->x0; if (hp_spline->x0 > xmax) xmax = hp_spline->x0; if (hp_spline->y0 < ymin) ymin = hp_spline->y0; if (hp_spline->y0 > ymax) ymax = hp_spline->y0; if (hp_spline->x1 < xmin) xmin = hp_spline->x1; if (hp_spline->x1 > xmax) xmax = hp_spline->x1; if (hp_spline->y1 < ymin) ymin = hp_spline->y1; if (hp_spline->y1 > ymax) ymax = hp_spline->y1; if (hp_spline->x2 < xmin) xmin = hp_spline->x2; if (hp_spline->x2 > xmax) xmax = hp_spline->x2; if (hp_spline->y2 < ymin) ymin = hp_spline->y2; if (hp_spline->y2 > ymax) ymax = hp_spline->y2; if (hp_spline->x3 < xmin) xmin = hp_spline->x3; if (hp_spline->x3 > xmax) xmax = hp_spline->x3; if (hp_spline->y3 < ymin) ymin = hp_spline->y3; if (hp_spline->y3 > ymax) ymax = hp_spline->y3; hp_spline = hp_spline->next; } head.width = xmax + 400 - xmin; head.height = ymax + 400 - ymin; if (mark.flag) { mark.x = mark.x + 200 - xmin; mark.y = mark.y + 200 - ymin; } hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { hp_atom->x = hp_atom->x - xmin + 200; hp_atom->y = hp_atom->y - ymin + 200; hp_atom = hp_atom->next; } hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { hp_bond->x = hp_bond->x - xmin + 200; hp_bond->y = hp_bond->y - ymin + 200; hp_bond->tx = hp_bond->tx - xmin + 200; hp_bond->ty = hp_bond->ty - ymin + 200; hp_bond = hp_bond->next; } } if (hp->nsp) { hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { hp_spline->x0 = hp_spline->x0 - xmin + 200; hp_spline->y0 = hp_spline->y0 - ymin + 200; hp_spline->x1 = hp_spline->x1 - xmin + 200; hp_spline->y1 = hp_spline->y1 - ymin + 200; hp_spline->x2 = hp_spline->x2 - xmin + 200; hp_spline->y2 = hp_spline->y2 - ymin + 200; hp_spline->x3 = hp_spline->x3 - xmin + 200; hp_spline->y3 = hp_spline->y3 - ymin + 200; hp_spline = hp_spline->next; if (!hp_spline) break; } } } void cut_end (int *x, int *y, int tx, int ty, int r) { int dx, dy, v; int qx, qy; float alpha; dx = tx - *x; dy = ty - *y; v = calc_vector (dx, dy); alpha = (float) asin ((float) dx / v); qx = (int) (r * sin (alpha)); qy = (int) (r * cos (alpha)); if (dx < 0 && dy < 0) { *x = *x + qx; *y = *y - qy; } if (dx == 0 && dy < 0) { *y = *y - r; } if (dx > 0 && dy < 0) { *x = *x + qx; *y = *y - qy; } if (dx < 0 && dy == 0) { *x = *x - r; } if (dx > 0 && dy == 0) { *x = *x + r; } if (dx < 0 && dy > 0) { *x = *x + qx; *y = *y + qy; } if (dx == 0 && dy > 0) { *y = *y + r; } if (dx > 0 && dy > 0) { *x = *x + qx; *y = *y + qy; } } struct xy_co * bond_cut (int x, int y, int tx, int ty, int r) { struct xy_co *coord = &xycoord[0]; struct dc *hp_a; int d, i, n; char *hc; hp_a = dac_root.next; for (d = 0; d < hp->nc; d++) { hc = hp_a->c; #ifdef GTK2 n = (int)g_utf8_strlen (hp_a->c,-1); for (i = 0; i < n; i++) { if (Extra_char (*hc,1)) { hc++; --n; } hc++; } #else n = (int)strlen (hp_a->c); for (i = 0; i < n; i++) { if (Extra_char (*hc)) { hc++; --n; } hc++; } #endif if (x == hp_a->x && y == hp_a->y) { if (hp_a->direct == -10) { cut_end (&x, &y, tx, ty, r * n); } else { cut_end (&x, &y, tx, ty, r); } } if (tx == hp_a->x && ty == hp_a->y) { if (hp_a->direct == -10) { cut_end (&tx, &ty, x, y, r * n); } else { cut_end (&tx, &ty, x, y, r); } } hp_a = hp_a->next; } coord->x = x; coord->y = y; coord->tx = tx; coord->ty = ty; return (coord); } int move_pos (int x, int y, int tx, int ty) /* updates the position of a given bond or label */ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int d, f = False; hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_bond->x == x && hp_bond->y == y) { if (hp_bond->bond == 11) { hp_bond->tx = tx + (hp_bond->tx - hp_bond->x); hp_bond->ty = ty + (hp_bond->ty - hp_bond->y); } hp_bond->x = tx; hp_bond->y = ty; f = True; } if (hp_bond->tx == x && hp_bond->ty == y) { hp_bond->tx = tx; hp_bond->ty = ty; f = True; } hp_bond = hp_bond->next; } hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { if (hp_atom->x == x && hp_atom->y == y) { hp_atom->x = tx; hp_atom->y = ty; f = True; } hp_atom = hp_atom->next; } hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->x0 == x && hp_spline->y0 == y) { hp_spline->x0 = tx; hp_spline->y0 = ty; f = True; } if (hp_spline->x1 == x && hp_spline->y1 == y) { hp_spline->x1 = tx; hp_spline->y1 = ty; f = True; } if (hp_spline->x2 == x && hp_spline->y2 == y) { hp_spline->x2 = tx; hp_spline->y2 = ty; f = True; } if (hp_spline->x3 == x && hp_spline->y3 == y) { hp_spline->x3 = tx; hp_spline->y3 = ty; f = True; } hp_spline = hp_spline->next; } if ( !f) { hp_bond = select_vector(x,y, 1.); if (hp_bond) { hp_bond->x += tx-x; hp_bond->y += ty-y; hp_bond->tx += tx-x; hp_bond->ty += ty-y; f = True; } } return f; } int partial_move (int dx, int dy) /* updates the position of all selected bonds and labels */ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int d, f = False; hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_bond->smarked == 1) { hp_bond->x = hp_bond->x + dx; hp_bond->y = hp_bond->y + dy; f = True; } if (hp_bond->tmarked == 1) { hp_bond->tx = hp_bond->tx + dx; hp_bond->ty = hp_bond->ty + dy; f = True; } hp_bond = hp_bond->next; } hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { if (hp_atom->marked == 1) { hp_atom->x = hp_atom->x + dx; hp_atom->y = hp_atom->y + dy; f = True; } hp_atom = hp_atom->next; } if (hp->nsp) { hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->marked) { hp_spline->x0 = hp_spline->x0 + dx; hp_spline->y0 = hp_spline->y0 + dy; hp_spline->x1 = hp_spline->x1 + dx; hp_spline->y1 = hp_spline->y1 + dy; hp_spline->x2 = hp_spline->x2 + dx; hp_spline->y2 = hp_spline->y2 + dy; hp_spline->x3 = hp_spline->x3 + dx; hp_spline->y3 = hp_spline->y3 + dy; f = True; } hp_spline = hp_spline->next; if (!hp_spline) break; } } if (addflag==1 && refmark ==1) { refx+=dx; refy+=dy; } return f; } int partial_rotate (/*int xcent, int ycent,*/ double rotsin, double rotcos) /* rotates all marked bonds and labels by a given angle */ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int d, f = False; double tmp; int dtmp; double rx, ry; dtmp = 0; hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_bond->smarked == 1) { rx = (double)tmpx[dtmp]; ry = (double)tmpy[dtmp++]; tmp = rx * rotcos - ry * rotsin; ry = rx * rotsin + ry * rotcos; tmp = tmp + copysign (0.5, tmp); ry = ry + copysign (0.5, ry); hp_bond->x = (int) tmp + xcent; hp_bond->y = (int) ry + ycent; f = True; } if (hp_bond->tmarked == 1) { rx = (double)tmpx[dtmp]; ry = (double)tmpy[dtmp++]; tmp = rx * rotcos - ry * rotsin; tmp = tmp + copysign (0.5, tmp); ry = rx * rotsin + ry * rotcos; ry = ry + copysign (0.5, ry); hp_bond->tx = (int) tmp + xcent; hp_bond->ty = (int) ry + ycent; f = True; } hp_bond = hp_bond->next; } hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { if (hp_atom->marked == 1) { rx = (double)tmpx[dtmp]; ry = (double)tmpy[dtmp++]; tmp = rx * rotcos - ry * rotsin; tmp = tmp + copysign (0.5, tmp); ry = rx * rotsin + ry * rotcos; ry = ry + copysign (0.5, ry); hp_atom->x = (int) tmp + xcent; hp_atom->y = (int) ry + ycent; f = True; } hp_atom = hp_atom->next; } hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->marked == 1) { rx = (double)tmpx[dtmp]; ry = (double)tmpy[dtmp++]; tmp = rx * rotcos - ry * rotsin; tmp = tmp + copysign (0.5, tmp); ry = rx * rotsin + ry * rotcos; ry = ry + copysign (0.5, ry); hp_spline->x0 = (int) tmp + xcent; hp_spline->y0 = (int) ry + ycent; rx = (double)tmpx[dtmp]; ry = (double)tmpy[dtmp++]; tmp = rx * rotcos - ry * rotsin; tmp = tmp + copysign (0.5, tmp); ry = rx * rotsin + ry * rotcos; ry = ry + copysign (0.5, ry); hp_spline->x1 = (int) tmp + xcent; hp_spline->y1 = (int) ry + ycent; rx = (double)tmpx[dtmp]; ry = (double)tmpy[dtmp++]; tmp = rx * rotcos - ry * rotsin; tmp = tmp + copysign (0.5, tmp); ry = rx * rotsin + ry * rotcos; ry = ry + copysign (0.5, ry); hp_spline->x2 = (int) tmp + xcent; hp_spline->y2 = (int) ry + ycent; rx = (double)tmpx[dtmp]; ry = (double)tmpy[dtmp++]; tmp = rx * rotcos - ry * rotsin; tmp = tmp + copysign (0.5, tmp); ry = rx * rotsin + ry * rotcos; ry = ry + copysign (0.5, ry); hp_spline->x3 = (int) tmp + xcent; hp_spline->y3 = (int) ry + ycent; f = True; } hp_spline = hp_spline->next; } if (addflag==1 && refmark==1){ rx = (double)tmpx[dtmp]; ry = (double)tmpy[dtmp++]; tmp = rx * rotcos - ry * rotsin; tmp = tmp + copysign (0.5, tmp); ry = rx * rotsin + ry * rotcos; ry = ry + copysign (0.5, ry); refx = (int) tmp + xcent; refy = (int) ry + ycent; } return f; } void flip_horiz () /** flips all currently marked bonds and labels horizontally center line of the marker box serves as mirror plane **/ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int d, dummy; hp_bond = da_root.next; hp_atom = dac_root.next; /* xref = mark.x + mark.w / 2;*/ if (hp->n == 0 && hp->nsp == 0) return; get_center_marked (&xref, &dummy); for (d = 0; d < hp->n; d++) { if (hp_bond->smarked || hp_bond->tmarked) { hp_bond->x = hp_bond->x - 2 * (hp_bond->x - xref); hp_bond->tx = hp_bond->tx - 2 * (hp_bond->tx - xref); switch (hp_bond->bond) { case 1: hp_bond->bond=2; break; case 2: hp_bond->bond=1; break; case 14: hp_bond->bond=15; break; case 15: hp_bond->bond=14; break; default: break; } } hp_bond = hp_bond->next; } for (d = 0; d < hp->nc; d++) { if (hp_atom->marked) hp_atom->x = hp_atom->x - 2 * (hp_atom->x - xref); hp_atom = hp_atom->next; } if (hp->nsp) { hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->marked) { hp_spline->x0 = hp_spline->x0 - 2 * (hp_spline->x0 - xref); hp_spline->x1 = hp_spline->x1 - 2 * (hp_spline->x1 - xref); hp_spline->x2 = hp_spline->x2 - 2 * (hp_spline->x2 - xref); hp_spline->x3 = hp_spline->x3 - 2 * (hp_spline->x3 - xref); } hp_spline = hp_spline->next; if (!hp_spline) break; } } if (addflag==1 && refmark ==1 ) refx = refx - 2* (refx-xref); FreePix (); CreatePix (); Display_Mol (); } void flip_vert () /** flips all currently marked bonds and labels vertically center line of the marker box serves as mirror plane **/ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int d, dummy; if (hp->n == 0 && hp->nsp == 0) return; hp_bond = da_root.next; hp_atom = dac_root.next; /* yref = mark.y + mark.h / 2;*/ get_center_marked (&dummy, &yref); for (d = 0; d < hp->n; d++) { if (hp_bond->smarked || hp_bond->tmarked) { hp_bond->y = hp_bond->y - 2 * (hp_bond->y - yref); hp_bond->ty = hp_bond->ty - 2 * (hp_bond->ty - yref); switch (hp_bond->bond) { case 1: hp_bond->bond=2; break; case 2: hp_bond->bond=1; break; case 14: hp_bond->bond=15; break; case 15: hp_bond->bond=14; break; default: break; } } hp_bond = hp_bond->next; } for (d = 0; d < hp->nc; d++) { if (hp_atom->marked) hp_atom->y = hp_atom->y - 2 * (hp_atom->y - yref); hp_atom = hp_atom->next; } if (hp->nsp) { hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->marked) { hp_spline->y0 = hp_spline->y0 - 2 * (hp_spline->y0 - yref); hp_spline->y1 = hp_spline->y1 - 2 * (hp_spline->y1 - yref); hp_spline->y2 = hp_spline->y2 - 2 * (hp_spline->y2 - yref); hp_spline->y3 = hp_spline->y3 - 2 * (hp_spline->y3 - yref); } hp_spline = hp_spline->next; if (!hp_spline) break; } } if (addflag==1 && refmark ==1 ) refy = refy - 2* (refy-yref); FreePix (); CreatePix (); Display_Mol (); } void copy_obj () /** creates a copy of the marked object, transfering the mark to the newly generated fragment. Dangling bonds, where one end is linked to something outside the box, are ignored. **/ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; int d, n_end, nc_end, nsp_end; if (hp->n == 0 && hp->nc == 0 && hp->nsp == 0) return; hp_bond = da_root.next; hp_atom = dac_root.next; n_end = hp->n; nc_end = hp->nc; nsp_end = hp->nsp; for (d = 0; d < n_end; d++) { if (hp_bond->smarked && hp_bond->tmarked) add_struct (hp_bond->x , hp_bond->y , hp_bond->tx , hp_bond->ty , hp_bond->bond, 1, 1,hp_bond->decoration, hp_bond->color); hp_bond->smarked = hp_bond->tmarked = 0; hp_bond = hp_bond->next; } for (d = 0; d < nc_end; d++) { if (hp_atom->marked) add_char (hp_atom->x , hp_atom->y , hp_atom->c, hp_atom->direct, 1, hp_atom->color,hp_atom->font,hp_atom->size); hp_atom->marked = 0; hp_atom = hp_atom->next; } hp_spline = sp_root.next; for (d = 0; d < nsp_end; d++) { if (hp_spline->marked) { add_spline (hp_spline->x0 , hp_spline->y0 , hp_spline->x1 , hp_spline->y1 , hp_spline->x2 , hp_spline->y2 , hp_spline->x3 , hp_spline->y3 , hp_spline->type, 1, hp_spline->color); hp_spline->marked = 0; } hp_spline = hp_spline->next; } FreePix (); CreatePix (); Display_Mol (); } int partial_rescale (int updown, int aniso) /* updates the position of all selected bonds and labels */ { struct data *hp_bond; struct dc *hp_atom; struct spline *hp_spline; double factor, factorx; int rx, ry, dtmp; int d, f = False; if (hp->n == 0 && hp->nsp == 0) return (f); if (updown < 0) factor = 1. - abs (updown) / 10.; else factor = 1. + updown / 10.; if (factor < 0.) return f; /* negative scale would cause strange inversions */ if (aniso) factorx = 1.; else factorx = factor; dtmp = 0; hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_bond->smarked == 1) { rx = tmpx[dtmp]; ry = tmpy[dtmp++]; hp_bond->x = (int) (rx * factorx) + xcent; hp_bond->y = (int) (ry * factor) + ycent; f = True; } if (hp_bond->tmarked == 1) { rx = tmpx[dtmp]; ry = tmpy[dtmp++]; hp_bond->tx = (int) (rx * factorx) + xcent; hp_bond->ty = (int) (ry * factor) + ycent; f = True; } hp_bond = hp_bond->next; } hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { if (hp_atom->marked == 1) { rx = tmpx[dtmp]; ry = tmpy[dtmp++]; hp_atom->x = (int) (rx * factorx) + xcent; hp_atom->y = (int) (ry * factor) + ycent; if (factor < 0.9) hp_atom->size -=1 ; if (factor < 0.6) hp_atom->size -=1 ; if (factor < 0.3) hp_atom->size -=1 ; if (factor > 1.1) hp_atom->size +=1 ; if (factor > 1.3) hp_atom->size +=1 ; if (factor > 1.6) hp_atom->size +=1 ; if (hp_atom->size <0) hp_atom->size=0; if (hp_atom->size >6) hp_atom->size=6; f = True; } hp_atom = hp_atom->next; } hp_spline = sp_root.next; for (d = 0; d < hp->nsp; d++) { if (hp_spline->marked == 1) { rx = tmpx[dtmp]; ry = tmpy[dtmp++]; hp_spline->x0 = (int) (rx * factorx) + xcent; hp_spline->y0 = (int) (ry * factor) + ycent; rx = tmpx[dtmp]; ry = tmpy[dtmp++]; hp_spline->x1 = (int) (rx * factorx) + xcent; hp_spline->y1 = (int) (ry * factor) + ycent; rx = tmpx[dtmp]; ry = tmpy[dtmp++]; hp_spline->x2 = (int) (rx * factorx) + xcent; hp_spline->y2 = (int) (ry * factor) + ycent; rx = tmpx[dtmp]; ry = tmpy[dtmp++]; hp_spline->x3 = (int) (rx * factorx) + xcent; hp_spline->y3 = (int) (ry * factor) + ycent; f = True; } hp_spline = hp_spline->next; } if (addflag == 1 && refmark == 1) { rx = tmpx[dtmp]; ry = tmpy[dtmp++]; refx = (int) (rx * factorx) + xcent; refy = (int) (ry * factor) + ycent; } return f; } void tidy_mol () { int hn, hnc; int d, t; int r = 0; struct data *hp_bond, *tmp_bond; struct dc *hp_atom; if (hp->n == 0 && hp->nc == 0 && hp->nsp == 0) return; Unmark_all (); hp_bond = da_root.next; hn = hp->n; for (d = 0; d < hn; d++) /* for all bonds */ { if (hp_bond->bond == 11) continue; /* do not bother with circles */ /* straigthen near-vertical or near-horizontal bonds */ if (abs (hp_bond->y - hp_bond->ty) ==1) hp_bond->ty=hp_bond->y; if (abs (hp_bond->x - hp_bond->tx) ==1) hp_bond->tx=hp_bond->x; tmp_bond = da_root.next; for (t = 0; t < d; t++) /* check against all preceding bonds */ { if (tmp_bond->bond == 11) continue; if (hp_bond->decoration || tmp_bond->decoration == 1) continue; /* if startpoint or endpoint very close to another, snap to that */ if (abs (hp_bond->x - tmp_bond->x) < 5 && abs (hp_bond->y - tmp_bond->y) < 5) { hp_bond->x = tmp_bond->x; hp_bond->y = tmp_bond->y; } if (abs (hp_bond->tx - tmp_bond->x) < 5 && abs (hp_bond->ty - tmp_bond->y) < 5) { hp_bond->tx = tmp_bond->x; hp_bond->ty = tmp_bond->y; } if (abs (hp_bond->tx - tmp_bond->tx) < 5 && abs (hp_bond->ty - tmp_bond->ty) < 5) { hp_bond->tx = tmp_bond->tx; hp_bond->ty = tmp_bond->ty; } if (abs (hp_bond->x - tmp_bond->tx) < 5 && abs (hp_bond->y - tmp_bond->ty) < 5) { hp_bond->x = tmp_bond->tx; hp_bond->y = tmp_bond->ty; } /* if startpoint _and_ endpoint overlap another bond, mark for deletion */ if (abs (hp_bond->x - tmp_bond->x) < 5 && abs (hp_bond->y - tmp_bond->y) < 5 && abs (hp_bond->tx - tmp_bond->tx) < 5 && abs (hp_bond->ty - tmp_bond->ty) < 5) { if (hp_bond->bond <= tmp_bond->bond) hp_bond->smarked = hp_bond->tmarked = 1; else tmp_bond->smarked = tmp_bond->tmarked = 1; } if (abs (hp_bond->tx - tmp_bond->x) < 5 && abs (hp_bond->ty - tmp_bond->y) < 5 && abs (hp_bond->x - tmp_bond->tx) < 5 && abs (hp_bond->y - tmp_bond->ty) < 5) { if (hp_bond->bond <= tmp_bond->bond) hp_bond->smarked = hp_bond->tmarked = 1; else tmp_bond->smarked = tmp_bond->tmarked = 1; } tmp_bond = tmp_bond->next; } hp_atom = dac_root.next; hnc = hp->nc; for (t = 0; t < hnc; t++) { /* if a label is close to either startpoint or endpoint, move it */ if (abs (hp_atom->x - hp_bond->x) < 5 && abs (hp_atom->y - hp_bond->y) < 5) { hp_atom->x = hp_bond->x; hp_atom->y = hp_bond->y; } if (abs (hp_atom->x - hp_bond->tx) < 5 && abs (hp_atom->y - hp_bond->ty) < 5) { hp_atom->x = hp_bond->tx; hp_atom->y = hp_bond->ty; } hp_atom = hp_atom->next; if (!hp_atom) break; } hp_bond = hp_bond->next; if (!hp_bond) break; } hp_bond = da_root.next; hn = hp->n; for (d = 0; d < hn; d++) { if (hp_bond->smarked && hp_bond->tmarked) { del_struct (hp_bond); r = True; } hp_bond = hp_bond->next; if (!hp_bond) break; } hp_atom = dac_root.next; hn = hp->nc; for (d = 0; d < hn; d++) { if (hp_atom->marked) { del_char (hp_atom); r = True; } hp_atom = hp_atom->next; if (!hp_atom) break; } FreePix (); CreatePix (); Display_Mol (); return; } void add_bracket () { int gauge; if (importflag != 0) return; gauge = 10 + (boxgap * mark.h / 600 * mark.w / 600); add_struct (mark.x, mark.y, mark.x + gauge, mark.y, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y, mark.x, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y + mark.h, mark.x + gauge, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w - gauge, mark.y, mark.x + mark.w, mark.y, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w, mark.y, mark.x + mark.w, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w - gauge, mark.y + mark.h, mark.x + mark.w, mark.y + mark.h, 0, 0, 0, 1, curpen); FreePix (); CreatePix (); Display_Mol (); } void add_r_bracket () { int gauge; if (importflag != 0) return; gauge = 10 + (boxgap * mark.h / 600 * mark.w / 600); add_struct (mark.x, mark.y + gauge, mark.x, mark.y + mark.h - gauge, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w, mark.y + gauge, mark.x + mark.w, mark.y + mark.h - gauge, 0, 0, 0, 1, curpen); add_spline (mark.x, mark.y + gauge, mark.x, mark.y + gauge / 2, mark.x + gauge / 2, mark.y, mark.x + gauge, mark.y, 0, 0,curpen); add_spline (mark.x + mark.w - gauge, mark.y, mark.x + mark.w - gauge / 2, mark.y, mark.x + mark.w, mark.y + gauge / 2, mark.x + mark.w, mark.y + gauge, 0, 0,curpen); add_spline (mark.x, mark.y + mark.h - gauge, mark.x, mark.y + mark.h - gauge / 2, mark.x + gauge / 2, mark.y + mark.h, mark.x + gauge, mark.y + mark.h, 0, 0,curpen); add_spline (mark.x + mark.w - gauge, mark.y + mark.h, mark.x + mark.w - gauge / 2, mark.y + mark.h, mark.x + mark.w, mark.y + mark.h - gauge / 2, mark.x + mark.w, mark.y + mark.h - gauge, 0, 0,curpen); FreePix (); CreatePix (); Display_Mol (); } void add_r2_bracket () { int gauge; if (importflag != 0) return; gauge = 10 + (boxgap * mark.h / 600 * mark.w / 600); add_spline (mark.x+gauge,mark.y, mark.x-gauge,mark.y+gauge/2, mark.x-gauge,mark.y+mark.h-gauge/2, mark.x+gauge,mark.y+mark.h,0,0,curpen); add_spline (mark.x+mark.w-gauge,mark.y, mark.x+mark.w+gauge,mark.y+gauge/2, mark.x+mark.w+gauge,mark.y+mark.h-gauge/2, mark.x+mark.w-gauge,mark.y+mark.h,0,0,curpen); FreePix (); CreatePix (); Display_Mol (); } void add_brace () { int gauge; if (importflag != 0) return; gauge = 10 + (boxgap * mark.h / 600 * mark.w / 600); add_spline (mark.x + gauge, mark.y, mark.x - gauge, mark.y, mark.x + gauge, mark.y + mark.h / 2, mark.x - gauge, mark.y + mark.h / 2, 0, 0,curpen); add_spline (mark.x - gauge, mark.y + mark.h / 2, mark.x + gauge, mark.y + mark.h / 2, mark.x - gauge, mark.y + mark.h, mark.x + gauge, mark.y + mark.h, 0, 0,curpen); add_spline (mark.x + mark.w - gauge, mark.y, mark.x + mark.w + gauge, mark.y, mark.x + mark.w - gauge, mark.y + mark.h / 2, mark.x + mark.w + gauge, mark.y + mark.h / 2, 0, 0,curpen); add_spline (mark.x + mark.w + gauge, mark.y + mark.h / 2, mark.x + mark.w - gauge, mark.y + mark.h / 2, mark.x + mark.w + gauge, mark.y + mark.h, mark.x + mark.w - gauge, mark.y + mark.h, 0, 0,curpen); FreePix (); CreatePix (); Display_Mol (); } void add_box1 () { if (importflag != 0) return; add_struct (mark.x, mark.y, mark.x + mark.w, mark.y, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y, mark.x, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y + mark.h, mark.x + mark.w, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w, mark.y, mark.x + mark.w, mark.y + mark.h, 0, 0, 0, 1, curpen); FreePix (); CreatePix (); Display_Mol (); } void add_box2 () { if (importflag != 0) return; add_struct (mark.x, mark.y, mark.x + mark.w, mark.y, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y, mark.x, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y + mark.h, mark.x + mark.w, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w, mark.y, mark.x + mark.w, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w + 2, mark.y + 3, mark.x + mark.w + 2, mark.y + mark.h + 3, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w + 3, mark.y + mark.h + 2, mark.x + 3, mark.y + mark.h + 2, 0, 0, 0, 1, curpen); FreePix (); CreatePix (); Display_Mol (); } void add_box3 () { if (importflag != 0) return; add_struct (mark.x, mark.y, mark.x + mark.w, mark.y, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y, mark.x, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y + mark.h, mark.x + mark.w, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w, mark.y, mark.x + mark.w, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w + 5, mark.y + 8, mark.x + mark.w + 5, mark.y + mark.h + 8, 10, 0, 0, 1, curpen); add_struct (mark.x + mark.w + 9, mark.y + mark.h + 5, mark.x + 9, mark.y + mark.h + 5, 10, 0, 0, 1, curpen); FreePix (); CreatePix (); Display_Mol (); } void add_box4 () { if (importflag != 0) return; add_struct (mark.x + boxgap, mark.y, mark.x + mark.w - boxgap, mark.y, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y + boxgap, mark.x, mark.y + mark.h - boxgap, 0, 0, 0, 1, curpen); add_struct (mark.x + boxgap, mark.y + mark.h, mark.x + mark.w - boxgap, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x + mark.w, mark.y + boxgap, mark.x + mark.w, mark.y + mark.h - boxgap, 0, 0, 0, 1, curpen); add_spline (mark.x, mark.y + boxgap, mark.x, mark.y, mark.x, mark.y, mark.x + boxgap, mark.y, 0, 0,curpen); add_spline (mark.x + mark.w - boxgap, mark.y, mark.x + mark.w, mark.y, mark.x + mark.w, mark.y, mark.x + mark.w, mark.y + boxgap, 0, 0,curpen); add_spline (mark.x, mark.y + mark.h - boxgap, mark.x, mark.y + mark.h, mark.x, mark.y + mark.h, mark.x + boxgap, mark.y + mark.h, 0, 0,curpen); add_spline (mark.x + mark.w - boxgap, mark.y + mark.h, mark.x + mark.w, mark.y + mark.h, mark.x + mark.w, mark.y + mark.h, mark.x + mark.w, mark.y + mark.h - boxgap, 0, 0,curpen); FreePix (); CreatePix (); Display_Mol (); } int has_label(int x, int y) /* checks if a given coordinate (i.e. bond-limit) has a label/atom on it */ { int d; struct dc *hp_atom; hp_atom = dac_root.next; for (d = 0; d < hp->nc; d++) { if ( abs(hp_atom->x-x)<5 && abs(hp_atom->y-y)<5 ) return d; hp_atom = hp_atom->next; } return -1; } int endpoint_connected(int x, int y, int tx, int ty) /* checks if the endpoint of a bond has another bond on it */ { int d; struct data *hp_bond; hp_bond = da_root.next; for (d = 0; d < hp->n; d++) { if (hp_bond->x == tx && hp_bond->y == ty) { /* this bond starts at our endpoint */ if (hp_bond->tx != x && hp_bond->ty != y) /* and its not 'our' bond, so return true */ return 0; } if (hp_bond->tx == tx && hp_bond->ty == ty) { /* same as above, it ends at our endpoint this time though */ if (hp_bond->x != x && hp_bond->y != y) return 0; } hp_bond = hp_bond->next; } return 1; } chemtool-1.6.14/m4/0000755000175000001440000000000012202262426013144 5ustar martinuserschemtool-1.6.14/m4/inttypes_h.m40000644000175000001440000000210310715417303015573 0ustar martinusers# inttypes_h.m4 serial 5 (gettext-0.12) dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([jm_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], jm_ac_cv_header_inttypes_h=yes, jm_ac_cv_header_inttypes_h=no)]) if test $jm_ac_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 ]) chemtool-1.6.14/m4/longdouble.m40000644000175000001440000000230010715417303015536 0ustar martinusers# longdouble.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl Test whether the compiler supports the 'long double' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_LONGDOUBLE], [ AC_CACHE_CHECK([for long double], gt_cv_c_long_double, [if test "$GCC" = yes; then gt_cv_c_long_double=yes else AC_TRY_COMPILE([ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; ], , gt_cv_c_long_double=yes, gt_cv_c_long_double=no) fi]) if test $gt_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) fi ]) chemtool-1.6.14/m4/iconv.m40000644000175000001440000000665310715417303014541 0ustar martinusers# iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) chemtool-1.6.14/m4/intdiv0.m40000644000175000001440000000356510715417303014777 0ustar martinusers# intdiv0.m4 serial 1 (gettext-0.11.3) dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ AC_TRY_RUN([ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac ]) ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) chemtool-1.6.14/m4/wint_t.m40000644000175000001440000000153110715417303014715 0ustar martinusers# wint_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, [AC_TRY_COMPILE([#include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) fi ]) chemtool-1.6.14/m4/po.m40000644000175000001440000004265210715417303014040 0ustar martinusers# po.m4 serial 3 (gettext-0.14) dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AM_NLS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU msgfmt. if test "$GMSGFMT" != ":"; then dnl If it is no GNU msgfmt we define it as : so that the dnl Makefiles still can work. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` AC_MSG_RESULT( [found $GMSGFMT program is not GNU msgfmt; ignore it]) GMSGFMT=":" fi fi dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po fi AC_OUTPUT_COMMANDS([ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac 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" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" < exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([jm_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], jm_ac_cv_header_stdint_h=yes, jm_ac_cv_header_stdint_h=no)]) if test $jm_ac_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 ]) chemtool-1.6.14/m4/signed.m40000644000175000001440000000140110715417303014656 0ustar martinusers# signed.m4 serial 1 (gettext-0.10.40) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([bh_C_SIGNED], [ AC_CACHE_CHECK([for signed], bh_cv_c_signed, [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) if test $bh_cv_c_signed = no; then AC_DEFINE(signed, , [Define to empty if the C compiler doesn't support this keyword.]) fi ]) chemtool-1.6.14/m4/isc-posix.m40000644000175000001440000000213310715417303015326 0ustar martinusers# isc-posix.m4 serial 2 (gettext-0.11.2) dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. # This test replaces the one in autoconf. # Currently this macro should have the same name as the autoconf macro # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ] ) chemtool-1.6.14/m4/glibc21.m40000644000175000001440000000172710715417303014643 0ustar martinusers# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([jm_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" ] ) chemtool-1.6.14/m4/gettext.m40000666000175000001440000004513612202253330015101 0ustar martinusers# gettext.m4 serial 28 (gettext-0.13) dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define(gt_included_intl, ifelse([$1], [external], [no], [yes])) define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Set USE_NLS. AM_NLS ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. dnl Add a version number to the cache macros. define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return (long) gettext ("")]ifelse([$2], [need-ngettext], [ + (long) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias ();], [bindtextdomain ("", ""); return (long) gettext ("")]ifelse([$2], [need-ngettext], [ + (long) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) dnl Now see whether libintl exists and depends on libiconv. if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias ();], [bindtextdomain ("", ""); return (long) gettext ("")]ifelse([$2], [need-ngettext], [ + (long) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext_libintl=yes ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi 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 "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([bh_C_SIGNED])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl AC_REQUIRE([gt_TYPE_WCHAR_T])dnl AC_REQUIRE([gt_TYPE_WINT_T])dnl AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) AC_REQUIRE([jm_AC_HEADER_STDINT_H]) AC_REQUIRE([gt_TYPE_INTMAX_T]) AC_REQUIRE([gt_PRINTF_POSIX]) AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([jm_GLIBC21])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gl_XSIZE])dnl AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ __fsetlocking]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). gt_CHECK_DECL(_snprintf, [#include ]) gt_CHECK_DECL(_snwprintf, [#include ]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(feof_unlocked, [#include ]) gt_CHECK_DECL(fgets_unlocked, [#include ]) gt_CHECK_DECL(getc_unlocked, [#include ]) case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi AC_SUBST([HAVE_ASPRINTF]) if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi AC_SUBST([HAVE_SNPRINTF]) if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi AC_SUBST([HAVE_WPRINTF]) AM_ICONV AM_LANGINFO_CODESET if test $ac_cv_header_locale_h = yes; then AM_LC_MESSAGES 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.]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) chemtool-1.6.14/m4/ulonglong.m40000644000175000001440000000204210715417303015413 0ustar martinusers# ulonglong.m4 serial 3 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Paul Eggert. # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], [ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], [unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull;], ac_cv_type_unsigned_long_long=yes, ac_cv_type_unsigned_long_long=no)]) if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, [Define if you have the 'unsigned long long' type.]) fi ]) chemtool-1.6.14/m4/nls.m40000644000175000001440000000350510715417303014210 0ustar martinusers# nls.m4 serial 1 (gettext-0.12) dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl 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_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) AC_DEFUN([AM_MKINSTALLDIRS], [ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate it. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) ]) chemtool-1.6.14/m4/lib-link.m40000644000175000001440000005534310715417303015124 0ustar martinusers# lib-link.m4 serial 4 (gettext-0.12) dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, dnl hardcode_direct, hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) chemtool-1.6.14/m4/uintmax_t.m40000644000175000001440000000235010715417303015421 0ustar martinusers# uintmax_t.m4 serial 7 (gettext-0.12) dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl 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([jm_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) AC_REQUIRE([jm_AC_HEADER_STDINT_H]) if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) else AC_DEFINE(HAVE_UINTMAX_T, 1, [Define if you have the 'uintmax_t' type in or .]) fi ]) chemtool-1.6.14/m4/wchar_t.m40000644000175000001440000000155310715417303015044 0ustar martinusers# wchar_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl 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 ]) chemtool-1.6.14/m4/progtest.m40000644000175000001440000000563410715417303015270 0ustar martinusers# progtest.m4 serial 3 (gettext-0.12) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl 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. # 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 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 ]) chemtool-1.6.14/m4/printf-posix.m40000644000175000001440000000310610715417303016053 0ustar martinusers# printf-posix.m4 serial 2 (gettext-0.13.1) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl Test whether the printf() function supports POSIX/XSI format strings with dnl positions. AC_DEFUN([gt_PRINTF_POSIX], [ AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], gt_cv_func_printf_posix, [ AC_TRY_RUN([ #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); }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, [ AC_EGREP_CPP(notposix, [ #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif ], gt_cv_func_printf_posix="guessing no", gt_cv_func_printf_posix="guessing yes") ]) ]) case $gt_cv_func_printf_posix in *yes) AC_DEFINE(HAVE_POSIX_PRINTF, 1, [Define if your printf() function supports format strings with positions.]) ;; esac ]) chemtool-1.6.14/m4/xsize.m40000644000175000001440000000103110715417303014546 0ustar martinusers# xsize.m4 serial 2 dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_CHECK_HEADERS(stdint.h) ]) chemtool-1.6.14/m4/intmax.m40000644000175000001440000000217210715417303014713 0ustar martinusers# intmax.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl 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([jm_AC_HEADER_INTTYPES_H]) AC_REQUIRE([jm_AC_HEADER_STDINT_H]) AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, [AC_TRY_COMPILE([ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) fi ]) chemtool-1.6.14/m4/longlong.m40000644000175000001440000000164310715417303015234 0ustar martinusers# longlong.m4 serial 4 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Paul Eggert. # Define HAVE_LONG_LONG if 'long long' works. AC_DEFUN([jm_AC_TYPE_LONG_LONG], [ AC_CACHE_CHECK([for long long], ac_cv_type_long_long, [AC_TRY_LINK([long long ll = 1LL; int i = 63;], [long long llmax = (long long) -1; return ll << i | ll >> i | llmax / ll | llmax % ll;], ac_cv_type_long_long=yes, ac_cv_type_long_long=no)]) if test $ac_cv_type_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the 'long long' type.]) fi ]) chemtool-1.6.14/m4/size_max.m40000644000175000001440000000407210715417303015233 0ustar martinusers# size_max.m4 serial 2 dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS(stdint.h) dnl First test whether the system already has SIZE_MAX. AC_MSG_CHECKING([for SIZE_MAX]) result= AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], result=yes) if test -z "$result"; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', dnl which is guaranteed to work from LONG_MIN to LONG_MAX. _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, [#include ], result=?) _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, [#include ], result=?) _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, [#include ], result=?) if test "$fits_in_uint" = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_TRY_COMPILE([#include extern size_t foo; extern unsigned long foo; ], [], fits_in_uint=0) fi if test -z "$result"; then if test "$fits_in_uint" = 1; then result="$res_hi$res_lo"U else result="$res_hi$res_lo"UL fi else dnl Shouldn't happen, but who knows... result='~(size_t)0' fi fi AC_MSG_RESULT([$result]) if test "$result" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi ]) chemtool-1.6.14/m4/inttypes-pri.m40000644000175000001440000000222710715417303016063 0ustar martinusers# inttypes-pri.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_REQUIRE([gt_HEADER_INTTYPES_H]) if test $gt_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) fi ]) chemtool-1.6.14/m4/inttypes.m40000644000175000001440000000171710715417303015276 0ustar martinusers# inttypes.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Paul Eggert. # Define HAVE_INTTYPES_H if exists and doesn't clash with # . AC_DEFUN([gt_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, [ AC_TRY_COMPILE( [#include #include ], [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) ]) if test $gt_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, [Define if exists and doesn't clash with .]) fi ]) chemtool-1.6.14/m4/lib-prefix.m40000644000175000001440000001250710715417303015457 0ustar martinusers# lib-prefix.m4 serial 3 (gettext-0.13) dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) chemtool-1.6.14/m4/codeset.m40000644000175000001440000000157610715417303015050 0ustar martinusers# codeset.m4 serial AM1 (gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) chemtool-1.6.14/m4/lcmessage.m40000644000175000001440000000261610715417303015361 0ustar martinusers# lcmessage.m4 serial 3 (gettext-0.11.3) dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl 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([AM_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi ]) chemtool-1.6.14/m4/lib-ld.m40000644000175000001440000000675610715417303014572 0ustar martinusers# lib-ld.m4 serial 3 (gettext-0.13) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl 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 ]) chemtool-1.6.14/m4/Makefile.am0000644000175000001440000000037110715417303015204 0ustar martinusersEXTRA_DIST = \ codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \ inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \ lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \ ulonglong.m4 chemtool-1.6.14/config.h.in0000666000175000001440000000737512202253333014664 0ustar martinusers/* config.h.in. Generated from configure.ac by autoheader. */ /* use optional libEMF instead of fig2dev for EMF output */ #undef EMF /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* the GTK2 library */ #undef GTK2 /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if your system has a working POSIX `fnmatch' function. */ #undef HAVE_FNMATCH /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `getwd' function. */ #undef HAVE_GETWD /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `ibs' library (-libs). */ #undef HAVE_LIBIBS /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `X11' library (-lX11). */ #undef HAVE_LIBX11 /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* 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 `strtod' function. */ #undef HAVE_STRTOD /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_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_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* the undo library is available */ #undef LIBUNDO /* Define if you want to use pull-down menus instead of button bars */ #undef MENU /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `unsigned int' if does not define. */ #undef size_t chemtool-1.6.14/install-sh0000755000175000001440000003253712202253333014637 0ustar martinusers#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: chemtool-1.6.14/ABOUT-NLS0000644000175000001440000015111610715417303014063 0ustar martinusersNotes on the Free Translation Project ************************************* Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work at translations should contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. Quick configuration advice ========================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. INSTALL Matters =============== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the GNU `gettext' own library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will respectively bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might be not what is desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages have usually many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. Using This Package ================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your country by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. Translating Teams ================= For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skill are praised more than programming skill, here. Available Packages ================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of January 2004. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am ar az be bg bs ca cs da de el en en_GB eo es +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | () | ant-phone | () | anubis | | ap-utils | | aspell | [] | bash | [] [] [] [] | batchelor | | bfd | [] [] | binutils | [] [] | bison | [] [] [] | bluez-pin | [] [] [] | clisp | | clisp | [] [] [] | console-tools | [] [] | coreutils | [] [] [] [] | cpio | [] [] [] | darkstat | [] () [] | diffutils | [] [] [] [] [] [] [] | e2fsprogs | [] [] [] | enscript | [] [] [] [] | error | [] [] [] [] [] | fetchmail | [] () [] [] [] [] | fileutils | [] [] [] | findutils | [] [] [] [] [] [] [] | flex | [] [] [] [] | fslint | | gas | [] | gawk | [] [] [] [] | gbiff | [] | gcal | [] | gcc | [] [] | gettext | [] [] [] [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] | gimp-print | [] [] [] [] [] | gliv | | glunarclock | [] [] | gnubiff | [] | gnucash | [] () [] [] | gnucash-glossary | [] () [] | gnupg | [] () [] [] [] [] | gpe-aerial | [] | gpe-beam | [] [] | gpe-calendar | [] [] | gpe-clock | [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] | gpe-taskmanager | [] [] | gpe-timesheet | [] | gpe-today | [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] [] | gprof | [] [] [] | gpsdrive | () () () | gramadoir | [] | grep | [] [] [] [] [] [] | gretl | [] | gtick | [] () | hello | [] [] [] [] [] [] | id-utils | [] [] | indent | [] [] [] [] | iso_3166 | [] [] [] [] [] [] [] [] [] [] | iso_3166_1 | [] [] [] [] [] [] | iso_3166_2 | | iso_3166_3 | [] | iso_4217 | [] [] [] [] | iso_639 | | jpilot | [] [] [] | jtag | | jwhois | [] | kbd | [] [] [] [] [] | latrine | () | ld | [] [] | libc | [] [] [] [] [] [] | libgpewidget | [] [] | libiconv | [] [] [] [] [] | lifelines | [] () | lilypond | [] | lingoteach | | lingoteach_lessons | () () | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | [] [] | make | [] [] [] | man-db | [] () [] [] () | minicom | [] [] [] | mysecretdiary | [] [] [] | nano | [] () [] [] [] | nano_1_0 | [] () [] [] [] | opcodes | [] | parted | [] [] [] [] [] | ptx | [] [] [] [] [] | python | | radius | [] | recode | [] [] [] [] [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] [] [] [] [] [] | sed | [] [] [] [] [] [] | sh-utils | [] [] [] | shared-mime-info | | sharutils | [] [] [] [] [] [] | silky | () | skencil | [] () [] | sketch | [] () [] | soundtracker | [] [] [] | sp | [] | tar | [] [] [] [] | texinfo | [] [] [] | textutils | [] [] [] [] | tin | () () | tp-robot | | tuxpaint | [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] [] [] | vorbis-tools | [] [] [] [] | wastesedge | () | wdiff | [] [] [] [] | wget | [] [] [] [] [] [] | xchat | [] [] [] [] | xfree86_xkb_xml | [] [] | xpad | [] | +----------------------------------------------------+ af am ar az be bg bs ca cs da de el en en_GB eo es 4 0 0 1 9 4 1 40 41 60 78 17 1 5 13 68 et eu fa fi fr ga gl he hr hu id is it ja ko lg +-------------------------------------------------+ a2ps | [] [] [] () () | aegis | | ant-phone | [] | anubis | [] | ap-utils | [] | aspell | [] [] | bash | [] [] | batchelor | [] [] | bfd | [] | binutils | [] [] | bison | [] [] [] [] | bluez-pin | [] [] [] [] [] | clisp | | clisp | [] | console-tools | | coreutils | [] [] [] [] [] [] | cpio | [] [] [] [] | darkstat | () [] [] [] | diffutils | [] [] [] [] [] [] [] | e2fsprogs | | enscript | [] [] | error | [] [] [] [] | fetchmail | [] | fileutils | [] [] [] [] [] [] | findutils | [] [] [] [] [] [] [] [] [] [] [] | flex | [] [] [] | fslint | [] | gas | [] | gawk | [] [] [] | gbiff | [] | gcal | [] | gcc | [] | gettext | [] [] [] | gettext-examples | [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] | gimp-print | [] [] | gliv | () | glunarclock | [] [] [] [] | gnubiff | [] | gnucash | () [] | gnucash-glossary | [] | gnupg | [] [] [] [] [] [] [] | gpe-aerial | [] | gpe-beam | [] | gpe-calendar | [] [] [] | gpe-clock | [] | gpe-conf | [] | gpe-contacts | [] [] | gpe-edit | [] [] | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] | gpe-sketchbook | [] | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] [] [] | gpe-today | [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] | gprof | [] [] | gpsdrive | () () () | gramadoir | [] [] | grep | [] [] [] [] [] [] [] [] [] [] [] | gretl | [] [] | gtick | [] [] [] | hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] [] | indent | [] [] [] [] [] [] [] [] [] | iso_3166 | [] [] [] [] [] [] [] | iso_3166_1 | [] [] [] [] [] | iso_3166_2 | | iso_3166_3 | | iso_4217 | [] [] [] [] [] [] | iso_639 | | jpilot | [] () | jtag | [] | jwhois | [] [] [] [] | kbd | [] | latrine | [] | ld | [] | libc | [] [] [] [] [] [] | libgpewidget | [] [] [] [] | libiconv | [] [] [] [] [] [] [] [] [] | lifelines | () | lilypond | [] | lingoteach | [] [] | lingoteach_lessons | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | | make | [] [] [] [] [] [] | man-db | () () | minicom | [] [] [] [] | mysecretdiary | [] [] | nano | [] [] [] [] | nano_1_0 | [] [] [] [] | opcodes | [] | parted | [] [] [] | ptx | [] [] [] [] [] [] [] | python | | radius | [] | recode | [] [] [] [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] | sed | [] [] [] [] [] [] [] [] [] | sh-utils | [] [] [] [] [] [] [] | shared-mime-info | [] [] [] | sharutils | [] [] [] [] [] | silky | () [] () () | skencil | [] | sketch | [] | soundtracker | [] [] | sp | [] () | tar | [] [] [] [] [] [] [] [] [] | texinfo | [] [] [] [] | textutils | [] [] [] [] [] [] | tin | [] () | tp-robot | [] | tuxpaint | [] [] [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux | [] [] [] [] () [] | vorbis-tools | [] | wastesedge | () | wdiff | [] [] [] [] [] [] | wget | [] [] [] [] [] [] [] | xchat | [] [] [] | xfree86_xkb_xml | [] [] | xpad | [] [] | +-------------------------------------------------+ et eu fa fi fr ga gl he hr hu id is it ja ko lg 22 2 1 26 106 28 24 8 10 41 33 1 26 33 12 0 lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru +-----------------------------------------------------+ a2ps | [] [] () () [] [] [] | aegis | () () () | ant-phone | [] [] | anubis | [] [] [] [] [] [] | ap-utils | [] () [] | aspell | [] | bash | [] [] [] | batchelor | [] | bfd | [] | binutils | [] | bison | [] [] [] [] [] | bluez-pin | [] [] [] | clisp | | clisp | [] | console-tools | [] | coreutils | [] [] | cpio | [] [] [] [] [] | darkstat | [] [] [] [] | diffutils | [] [] [] [] [] [] | e2fsprogs | [] | enscript | [] [] [] [] | error | [] [] [] | fetchmail | [] [] () [] | fileutils | [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] | fslint | [] [] | gas | | gawk | [] [] [] | gbiff | [] [] | gcal | | gcc | | gettext | [] [] [] | gettext-examples | [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] | gimp-print | [] | gliv | [] [] [] | glunarclock | [] [] [] [] | gnubiff | [] | gnucash | [] [] () [] | gnucash-glossary | [] [] | gnupg | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] [] | gpe-go | [] [] [] | gpe-login | [] [] [] [] | gpe-ownerinfo | [] [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] [] | gphoto2 | [] | gprof | [] [] | gpsdrive | () () [] | gramadoir | () [] | grep | [] [] [] [] [] | gretl | | gtick | [] [] [] | hello | [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] [] | indent | [] [] [] [] | iso_3166 | [] [] [] | iso_3166_1 | [] [] | iso_3166_2 | | iso_3166_3 | [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] | jpilot | () () | jtag | | jwhois | [] [] [] [] () | kbd | [] [] [] | latrine | [] | ld | | libc | [] [] [] [] | libgpewidget | [] [] [] | libiconv | [] [] [] [] [] | lifelines | | lilypond | | lingoteach | | lingoteach_lessons | | lynx | [] [] [] | m4 | [] [] [] [] [] | mailutils | [] [] [] | make | [] [] [] [] | man-db | [] | minicom | [] [] [] [] | mysecretdiary | [] [] [] | nano | [] [] [] [] [] | nano_1_0 | [] [] [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | ptx | [] [] [] [] [] [] [] [] | python | | radius | [] [] | recode | [] [] [] [] | rpm | [] [] [] | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] | sh-utils | [] [] | shared-mime-info | [] [] | sharutils | [] [] | silky | () | skencil | [] [] | sketch | [] [] | soundtracker | | sp | | tar | [] [] [] [] [] [] | texinfo | [] [] [] [] | textutils | [] [] | tin | | tp-robot | [] | tuxpaint | [] [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] | vorbis-tools | [] [] [] | wastesedge | | wdiff | [] [] [] [] [] | wget | [] [] [] | xchat | [] [] [] | xfree86_xkb_xml | [] [] | xpad | [] [] | +-----------------------------------------------------+ lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru 1 2 0 3 12 0 10 69 6 7 1 40 26 36 76 63 sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu +-----------------------------------------------------+ a2ps | [] [] [] [] | 16 aegis | | 0 ant-phone | | 3 anubis | [] [] | 9 ap-utils | () | 3 aspell | | 4 bash | | 9 batchelor | | 3 bfd | [] [] | 6 binutils | [] [] [] | 8 bison | [] [] | 14 bluez-pin | [] [] [] | 14 clisp | | 0 clisp | | 5 console-tools | | 3 coreutils | [] [] [] [] | 16 cpio | [] [] | 14 darkstat | [] [] [] () () | 12 diffutils | [] [] [] | 23 e2fsprogs | [] [] | 6 enscript | [] [] | 12 error | [] [] [] | 15 fetchmail | [] [] | 11 fileutils | [] [] [] [] [] | 17 findutils | [] [] [] [] [] [] | 29 flex | [] [] | 13 fslint | | 3 gas | [] | 3 gawk | [] [] | 12 gbiff | | 4 gcal | [] [] | 4 gcc | [] | 4 gettext | [] [] [] [] [] | 16 gettext-examples | [] [] [] [] [] | 14 gettext-runtime | [] [] [] [] [] [] [] [] | 22 gettext-tools | [] [] [] [] [] [] | 14 gimp-print | [] [] | 10 gliv | | 3 glunarclock | [] [] [] | 13 gnubiff | | 3 gnucash | [] [] | 9 gnucash-glossary | [] [] [] | 8 gnupg | [] [] [] [] | 17 gpe-aerial | [] | 7 gpe-beam | [] | 8 gpe-calendar | [] [] [] [] | 13 gpe-clock | [] [] [] | 10 gpe-conf | [] [] | 9 gpe-contacts | [] [] [] | 11 gpe-edit | [] [] [] [] [] | 12 gpe-go | | 5 gpe-login | [] [] [] [] [] | 13 gpe-ownerinfo | [] [] [] [] | 13 gpe-sketchbook | [] [] | 9 gpe-su | [] [] [] | 10 gpe-taskmanager | [] [] [] | 10 gpe-timesheet | [] [] [] [] | 12 gpe-today | [] [] [] [] [] | 13 gpe-todo | [] [] [] [] | 12 gphoto2 | [] [] [] | 11 gprof | [] [] | 9 gpsdrive | [] [] | 3 gramadoir | [] | 5 grep | [] [] [] [] | 26 gretl | | 3 gtick | | 7 hello | [] [] [] [] [] | 34 id-utils | [] [] | 12 indent | [] [] [] [] | 21 iso_3166 | [] [] [] [] [] [] [] | 27 iso_3166_1 | [] [] [] | 16 iso_3166_2 | | 0 iso_3166_3 | | 2 iso_4217 | [] [] [] [] [] [] | 24 iso_639 | | 1 jpilot | [] [] [] [] [] | 9 jtag | [] | 2 jwhois | () [] [] | 11 kbd | [] [] | 11 latrine | | 2 ld | [] [] | 5 libc | [] [] [] [] | 20 libgpewidget | [] [] [] [] | 13 libiconv | [] [] [] [] [] [] [] [] | 27 lifelines | [] | 2 lilypond | [] | 3 lingoteach | | 2 lingoteach_lessons | () | 0 lynx | [] [] [] | 14 m4 | [] [] | 15 mailutils | | 5 make | [] [] [] | 16 man-db | [] | 5 minicom | | 11 mysecretdiary | [] [] | 10 nano | [] [] [] [] | 17 nano_1_0 | [] [] [] | 17 opcodes | [] [] | 6 parted | [] [] [] | 15 ptx | [] [] | 22 python | | 0 radius | | 4 recode | [] [] [] | 20 rpm | [] [] | 9 screem | [] [] | 2 scrollkeeper | [] [] [] | 15 sed | [] [] [] [] [] [] | 24 sh-utils | [] [] | 14 shared-mime-info | [] [] | 7 sharutils | [] [] [] [] | 17 silky | () | 3 skencil | [] | 6 sketch | [] | 6 soundtracker | [] [] | 7 sp | [] | 3 tar | [] [] [] [] [] | 24 texinfo | [] [] [] | 14 textutils | [] [] [] [] | 16 tin | | 1 tp-robot | | 2 tuxpaint | [] [] [] [] [] | 29 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux | [] [] | 15 vorbis-tools | | 8 wastesedge | | 0 wdiff | [] [] [] | 18 wget | [] [] [] [] [] [] [] [] | 24 xchat | [] [] [] [] [] | 15 xfree86_xkb_xml | [] [] [] [] [] | 11 xpad | | 5 +-----------------------------------------------------+ 63 teams sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu 131 domains 47 19 28 83 0 0 59 13 1 1 11 0 22 22 0 1373 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If January 2004 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. Using `gettext' in new packages =============================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `translation@iro.umontreal.ca' to make the `.pot' files available to the translation teams. chemtool-1.6.14/undo.c0000644000175000001440000006671510715417303013757 0ustar martinusers/* libundo, an easy to use undo/redo management library Copyright 1999 Matt Kimball This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #define BLOCK_FLAG_LARGE 0x01 #define MEMORY_RAW_SIZE(mem) (*(size_t *)(mem)) #define MEMORY_USED(mem) (MEMORY_RAW_SIZE(mem) & 1) #define MEMORY_SIZE(mem) (MEMORY_RAW_SIZE(mem) & ~1) #define MEMORY_SET_SIZE_USED(mem, size, used) \ (MEMORY_RAW_SIZE(mem) = ((size) & ~1) | ((used) ? 1 : 0)) #define MEMORY_NEXT(mem) (MEMORY_OFFSET((mem), MEMORY_SIZE(mem))) #define MEMORY_BODY(mem) (MEMORY_OFFSET((mem), UNDO_MEMORY_OVERHEAD)) #define FOREACH_SIZED_BLOCK(mem, size, block_ix, block) \ for((block_ix) = 0, (block) = &(mem)->size##_alloc_list[0]; \ (block_ix) < (mem)->size##_alloc_list_count; \ (block_ix)++, (block) = &(mem)->size##_alloc_list[(block_ix)]) #define FOREACH_SMALL_BLOCK(mem, block_ix, block) \ FOREACH_SIZED_BLOCK(mem, small, block_ix, block) #define FOREACH_LARGE_BLOCK(mem, block_ix, block) \ FOREACH_SIZED_BLOCK(mem, large, block_ix, block) #define MEMORY_BACKUP_OVERHEAD(mem) \ ((mem) = MEMORY_OFFSET((mem), -UNDO_MEMORY_OVERHEAD)) #define BLOCK_END(block) MEMORY_OFFSET((block).mem, (block).size) #define IN_BLOCK(block, m) ((m) >= (block).mem && (m) < BLOCK_END(block)) #define BLOCK_PAGES(block) ((block).size / getpagesize()) #define FOREACH_IN_BLOCK(block, mem) \ for((mem) = (block).mem; \ (mem) != BLOCK_END(block); \ (mem) = MEMORY_NEXT(mem)) /* Some systems define MAP_ANON instead of MAP_ANONYMOUS. */ /* Some (e.g. Solaris <8) have neither, but map /dev/zero instead */ #ifndef MAP_ANONYMOUS #ifdef MAP_ANON #define MAP_ANONYMOUS MAP_ANON #else #include #include #include static int dev_zero_fd; #endif /* MAP_ANON */ #endif /* MAP_ANONYMOUS */ #ifdef MAP_ANONYMOUS #define MAP_NEW_ANON_AT_FLAGS(pos, size, flags) \ (mmap((pos), (size), \ PROT_READ | PROT_WRITE | PROT_EXEC, \ MAP_PRIVATE | MAP_ANONYMOUS | (flags),-1, 0)) #else #define MAP_NEW_ANON_AT_FLAGS(pos, size, flags) \ (mmap((pos), (size), \ PROT_READ | PROT_WRITE | PROT_EXEC, \ MAP_PRIVATE | (flags),dev_zero_fd, 0)) #endif #define MAP_NEW_ANON(size) MAP_NEW_ANON_AT_FLAGS(0, (size), 0) #define MAP_NEW_ANON_AT(pos, size) \ MAP_NEW_ANON_AT_FLAGS((pos), (size), MAP_FIXED) #define PAGE_REMAINDER(size) (getpagesize() - (size)) #define IF_IN_BLOCK_VAR \ unsigned _if_in_block_ix; \ UNDO_BLOCK *_if_in_block #define IF_IN_SMALL_BLOCK(memory, ptr) \ FOREACH_SMALL_BLOCK((memory), _if_in_block_ix, _if_in_block) \ if(IN_BLOCK(*_if_in_block, (ptr))) #define IF_IN_LARGE_BLOCK(memory, ptr) \ FOREACH_LARGE_BLOCK((memory), _if_in_block_ix, _if_in_block) \ if((ptr) == _if_in_block->mem) #define NEW(type) ((type *)calloc(1, sizeof(type))) #define UNDO_SUCCESS return UNDO_NOERROR; #define UNDO_ERROR(err) return (undo_set_error(err), (err)); #define UNDO_ERROR_NULL(err) return (undo_set_error(err), (void*)NULL); #ifdef LIBUNDO void undo_set_error (int err); typedef struct _UNDO_HISTORY UNDO_HISTORY; typedef struct _UNDO_HISTORY_ITEM UNDO_HISTORY_ITEM; struct _UNDO_HISTORY { UNDO_HISTORY_ITEM *item; unsigned length; unsigned ix; size_t memory_limit; }; struct _UNDO_HISTORY_ITEM { void *mem; size_t size; }; typedef struct _UNDO_MEMORY_STREAM UNDO_MEMORY_STREAM; typedef struct _UNDO_MEMORY_STREAM_BLOCK_HEADER UNDO_MEMORY_STREAM_BLOCK_HEADER; #define MEMORY_OFFSET(mem, offset) ((void *)((char *)(mem) + (offset))) struct _UNDO_MEMORY_STREAM { void (*destroy) (UNDO_MEMORY_STREAM * stream); size_t (*read) (UNDO_MEMORY_STREAM * stream, size_t offset, void *mem, size_t count); void *implementation; }; UNDO_HISTORY *undo_history_new (void); int undo_history_destroy (UNDO_HISTORY * history); int undo_history_record (UNDO_HISTORY * history, UNDO_MEMORY_STREAM * stream); UNDO_MEMORY_STREAM *undo_history_undo (UNDO_HISTORY * history); UNDO_MEMORY_STREAM *undo_history_redo (UNDO_HISTORY * history); unsigned undo_history_undo_count (UNDO_HISTORY * history); unsigned undo_history_redo_count (UNDO_HISTORY * history); void undo_history_set_memory_limit (UNDO_HISTORY * history, size_t limit); size_t undo_history_memory_usage (UNDO_HISTORY * history); #include "undo.h" size_t undo_memory_stream_write (size_t offset, void *mem, size_t size, size_t * pos, void *data, size_t length); size_t undo_memory_stream_length (UNDO_MEMORY_STREAM * stream); /* This might not be the same as sizeof(UNDO_MEMORY_STREAM_BLOCK_HEADER) if the compiler pads the structure in some way. This value represents the size of the header when it is serialized in a stream. */ #define STREAM_SERIALIZED_BLOCK_HEADER_SIZE (sizeof(void *) + \ sizeof(size_t) + sizeof(unsigned)) struct _UNDO_MEMORY_STREAM_BLOCK_HEADER { void *addr; size_t size; unsigned flags; }; size_t undo_memory_stream_read_header (UNDO_MEMORY_STREAM * stream, size_t offset, UNDO_MEMORY_STREAM_BLOCK_HEADER * header); typedef struct _UNDO_BLOCK UNDO_BLOCK; typedef struct _UNDO_MEMORY UNDO_MEMORY; struct _UNDO_BLOCK { void *mem; size_t size; }; struct _UNDO_MEMORY { UNDO_BLOCK *small_alloc_list; unsigned small_alloc_list_count; UNDO_BLOCK *large_alloc_list; unsigned large_alloc_list_count; }; struct _UNDO { char *name; UNDO_MEMORY *memory; UNDO_HISTORY *history; }; UNDO_MEMORY *undo_memory_new (void); int undo_memory_destroy (UNDO_MEMORY * memory); size_t undo_memory_used (UNDO_MEMORY * memory); unsigned undo_memory_pages_used (UNDO_MEMORY * memory); void *undo_memory_alloc (UNDO_MEMORY * memory, size_t size); int undo_memory_free (UNDO_MEMORY * memory, void *alloc); size_t undo_memory_size (UNDO_MEMORY * memory, void *alloc); UNDO_MEMORY_STREAM *undo_memory_stream (UNDO_MEMORY * memory); int undo_memory_set (UNDO_MEMORY * memory, UNDO_MEMORY_STREAM * stream); #define UNDO_MEMORY_OVERHEAD (sizeof(size_t)) static UNDO *undo_session = NULL; int undo_new (char *session_name) { if (session_name == NULL) UNDO_ERROR (UNDO_BADPARAM); undo_session = NEW (UNDO); if (undo_session == NULL) UNDO_ERROR (UNDO_NOMEM); #ifndef MAP_ANONYMOUS dev_zero_fd = open("/dev/zero",O_RDONLY); #endif undo_session->name = (char *) malloc (strlen (session_name) + 1); if (undo_session->name == NULL) { undo_destroy (); UNDO_ERROR (UNDO_NOMEM); } strcpy (undo_session->name, session_name); undo_session->memory = undo_memory_new (); if (undo_session->memory == NULL) { undo_destroy (); UNDO_ERROR (UNDO_NOMEM); } undo_session->history = undo_history_new (); if (undo_session->history == NULL) { undo_destroy (); UNDO_ERROR (UNDO_NOMEM); } UNDO_SUCCESS; } int undo_destroy (void) { if (undo_session == NULL) UNDO_ERROR (UNDO_NOSESSION); if (undo_session->name) free (undo_session->name); if (undo_session->memory) undo_memory_destroy (undo_session->memory); if (undo_session->history) undo_history_destroy (undo_session->history); undo_session = NULL; #ifndef MAP_ANONYMOUS close(dev_zero_fd); #endif UNDO_SUCCESS; } UNDO * undo_get_session (void) { return undo_session; } int undo_set_session (UNDO * undo) { undo_session = undo; UNDO_SUCCESS; } int undo_set_memory_limit (size_t max_memory) { if (undo_session == NULL) UNDO_ERROR (UNDO_NOSESSION); undo_history_set_memory_limit (undo_session->history, max_memory); UNDO_SUCCESS; } unsigned undo_get_undo_count (void) { if (undo_session == NULL) return 0; return undo_history_undo_count (undo_session->history); } unsigned undo_get_redo_count (void) { if (undo_session == NULL) return 0; return undo_history_redo_count (undo_session->history); } int undo_undo (void) { UNDO_MEMORY_STREAM *stream; int ret; if (undo_session == NULL) UNDO_ERROR (UNDO_NOSESSION); if (undo_history_undo_count (undo_session->history) == 0) UNDO_ERROR (UNDO_NODO); stream = undo_history_undo (undo_session->history); if (stream == NULL) UNDO_ERROR (UNDO_NOMEM); ret = undo_memory_set (undo_session->memory, stream); stream->destroy (stream); return ret; } int undo_redo (void) { UNDO_MEMORY_STREAM *stream; int ret; if (undo_session == NULL) UNDO_ERROR (UNDO_NOSESSION); if (undo_history_redo_count (undo_session->history) == 0) UNDO_ERROR (UNDO_NODO); stream = undo_history_redo (undo_session->history); if (stream == NULL) UNDO_ERROR (UNDO_NOMEM); ret = undo_memory_set (undo_session->memory, stream); stream->destroy (stream); return ret; } int undo_snapshot (void) { UNDO_MEMORY_STREAM *stream; int ret; if (undo_session == NULL) UNDO_ERROR (UNDO_NOSESSION); stream = undo_memory_stream (undo_session->memory); if (stream == NULL) UNDO_ERROR (UNDO_NOMEM); ret = undo_history_record (undo_session->history, stream); stream->destroy (stream); return ret; } void * undo_malloc (size_t size) { if (undo_session == NULL) UNDO_ERROR_NULL (UNDO_NOSESSION); return undo_memory_alloc (undo_session->memory, size); } void * undo_realloc (void *mem, size_t size) { size_t min_size; void *new_mem; if (undo_session == NULL) UNDO_ERROR_NULL (UNDO_NOSESSION); if (mem == NULL) return undo_memory_alloc (undo_session->memory, size); min_size = undo_memory_size (undo_session->memory, mem); if (size < min_size) min_size = size; if (size == min_size) return mem; new_mem = undo_memory_alloc (undo_session->memory, size); if (new_mem == NULL) UNDO_ERROR_NULL (UNDO_NOMEM); memcpy (new_mem, mem, min_size); undo_memory_free (undo_session->memory, mem); return new_mem; } void undo_free (void *mem) { if (undo_session == NULL) return; undo_memory_free (undo_session->memory, mem); } static void *undo_memory_alloc_small (UNDO_MEMORY * memory, size_t size); static void *undo_memory_alloc_large (UNDO_MEMORY * memory, size_t size); static void *undo_memory_alloc_small_block (UNDO_BLOCK * block, size_t size); static void undo_memory_block_coalesce_free (UNDO_BLOCK * block); static void *undo_memory_alloc_new_small_block (UNDO_MEMORY * mem, size_t size); static void *undo_memory_new_block (UNDO_BLOCK ** block_list, unsigned *length, size_t size); static int undo_memory_new_block_record (UNDO_BLOCK ** block_list, unsigned *len, void *mem, size_t size); static int undo_memory_delete_block (UNDO_BLOCK ** block_list, unsigned *length, unsigned index); static void undo_stream_destroy (UNDO_MEMORY_STREAM * stream); static size_t undo_stream_read (UNDO_MEMORY_STREAM * stream, size_t offset, void *mem, size_t size); static size_t undo_stream_block_write (size_t offset, void *mem, size_t size, size_t * pos, UNDO_BLOCK * block, unsigned flags); static void undo_memory_clear (UNDO_MEMORY * memory); static int undo_memory_add_blocks_from_stream (UNDO_MEMORY * memory, UNDO_MEMORY_STREAM * stream); static void undo_memory_block_header_record (UNDO_MEMORY * memory, UNDO_MEMORY_STREAM_BLOCK_HEADER * header); UNDO_MEMORY * undo_memory_new (void) { UNDO_MEMORY *mem; mem = NEW (UNDO_MEMORY); if (mem == NULL) UNDO_ERROR_NULL (UNDO_NOMEM); return mem; } int undo_memory_destroy (UNDO_MEMORY * memory) { if (memory == NULL) UNDO_ERROR (UNDO_BADPARAM); undo_memory_clear (memory); free (memory); UNDO_SUCCESS; } size_t undo_memory_used (UNDO_MEMORY * memory) { size_t used; unsigned block_ix; UNDO_BLOCK *block; used = 0; FOREACH_SMALL_BLOCK (memory, block_ix, block) { void *mem; FOREACH_IN_BLOCK (*block, mem) { if (MEMORY_USED (mem)) { used += MEMORY_SIZE (mem); } } } FOREACH_LARGE_BLOCK (memory, block_ix, block) { used += block->size; } return used; } void * undo_memory_alloc (UNDO_MEMORY * memory, size_t size) { while (size & (sizeof (size_t) - 1)) size++; if (size < getpagesize () - UNDO_MEMORY_OVERHEAD * 2) { return undo_memory_alloc_small (memory, size); } else { return undo_memory_alloc_large (memory, size); } } int undo_memory_free (UNDO_MEMORY * memory, void *alloc) { IF_IN_BLOCK_VAR; IF_IN_SMALL_BLOCK (memory, alloc) { MEMORY_BACKUP_OVERHEAD (alloc); MEMORY_SET_SIZE_USED (alloc, MEMORY_SIZE (alloc), 0); UNDO_SUCCESS; } IF_IN_LARGE_BLOCK (memory, alloc) { return undo_memory_delete_block (&memory->large_alloc_list, &memory->large_alloc_list_count, _if_in_block_ix); } UNDO_ERROR (UNDO_BADPARAM); } size_t undo_memory_size (UNDO_MEMORY * memory, void *alloc) { IF_IN_BLOCK_VAR; IF_IN_SMALL_BLOCK (memory, alloc) { MEMORY_BACKUP_OVERHEAD (alloc); return MEMORY_SIZE (alloc) - UNDO_MEMORY_OVERHEAD; } IF_IN_LARGE_BLOCK (memory, alloc) { return _if_in_block->size; } return 0; } unsigned undo_memory_pages_used (UNDO_MEMORY * memory) { unsigned block_ix; UNDO_BLOCK *block; unsigned pages; pages = 0; FOREACH_SMALL_BLOCK (memory, block_ix, block) { pages += BLOCK_PAGES (*block); } FOREACH_LARGE_BLOCK (memory, block_ix, block) { pages += BLOCK_PAGES (*block); } return pages; } UNDO_MEMORY_STREAM * undo_memory_stream (UNDO_MEMORY * memory) { UNDO_MEMORY_STREAM *stream; stream = NEW (UNDO_MEMORY_STREAM); if (stream == NULL) UNDO_ERROR_NULL (UNDO_NOMEM); stream->implementation = memory; stream->destroy = /*(void * )*/ undo_stream_destroy; stream->read = /*(void *)*/ undo_stream_read; return (UNDO_MEMORY_STREAM *) stream; } int undo_memory_set (UNDO_MEMORY * memory, UNDO_MEMORY_STREAM * stream) { undo_memory_clear (memory); return undo_memory_add_blocks_from_stream (memory, stream); } static void * undo_memory_alloc_small (UNDO_MEMORY * memory, size_t size) { unsigned block_ix; UNDO_BLOCK *block; FOREACH_SMALL_BLOCK (memory, block_ix, block) { void *mem; mem = undo_memory_alloc_small_block (block, size); if (mem != NULL) { return mem; } } return undo_memory_alloc_new_small_block (memory, size); } static void * undo_memory_alloc_large (UNDO_MEMORY * memory, size_t size) { size_t page_fraction; page_fraction = size & (getpagesize () - 1); if (page_fraction) { size += PAGE_REMAINDER (page_fraction); } return undo_memory_new_block (&memory->large_alloc_list, &memory->large_alloc_list_count, size); } static void * undo_memory_alloc_small_block (UNDO_BLOCK * block, size_t size) { void *mem; size_t new_size; undo_memory_block_coalesce_free (block); new_size = size + UNDO_MEMORY_OVERHEAD; FOREACH_IN_BLOCK (*block, mem) { if (!MEMORY_USED (mem) && MEMORY_SIZE (mem) >= new_size) { if (MEMORY_SIZE (mem) == new_size) { MEMORY_SET_SIZE_USED (mem, new_size, 1); } else { size_t old_size; void *next; old_size = MEMORY_SIZE (mem); MEMORY_SET_SIZE_USED (mem, new_size, 1); next = MEMORY_NEXT (mem); MEMORY_SET_SIZE_USED (next, old_size - new_size, 0); } return MEMORY_BODY (mem); } } return NULL; } static void undo_memory_block_coalesce_free (UNDO_BLOCK * block) { void *last, *mem; last = NULL; FOREACH_IN_BLOCK (*block, mem) { if (last == NULL) { last = mem; continue; } if (!MEMORY_USED (last) && !MEMORY_USED (mem)) { MEMORY_SET_SIZE_USED (last, MEMORY_SIZE (last) + MEMORY_SIZE (mem), 0); continue; } last = mem; } } static void * undo_memory_alloc_new_small_block (UNDO_MEMORY * mem, size_t size) { void *page, *next; page = undo_memory_new_block (&mem->small_alloc_list, &mem->small_alloc_list_count, getpagesize ()); if (page == NULL) { UNDO_ERROR_NULL (UNDO_NOMEM); } MEMORY_SET_SIZE_USED (page, size + UNDO_MEMORY_OVERHEAD, 1); next = MEMORY_NEXT (page); MEMORY_SET_SIZE_USED (next, PAGE_REMAINDER (size + UNDO_MEMORY_OVERHEAD), 0); return MEMORY_BODY (page); } static void * undo_memory_new_block (UNDO_BLOCK ** block_list, unsigned *len, size_t size) { void *mem; mem = MAP_NEW_ANON (size); if (mem == NULL) UNDO_ERROR_NULL (UNDO_NOMEM); if (undo_memory_new_block_record (block_list, len, mem, size)) { munmap (mem, size); return NULL; } return mem; } static int undo_memory_new_block_record (UNDO_BLOCK ** block_list, unsigned *len, void *mem, size_t size) { UNDO_BLOCK *new_block_list; new_block_list = (UNDO_BLOCK *) realloc (*block_list, (*len + 1) * sizeof (UNDO_BLOCK)); if (new_block_list == NULL) { UNDO_ERROR (UNDO_NOMEM); } *block_list = new_block_list; (*block_list)[*len].mem = mem; (*block_list)[*len].size = size; (*len)++; UNDO_SUCCESS; } static int undo_memory_delete_block (UNDO_BLOCK ** block_list, unsigned *length, unsigned index) { UNDO_BLOCK *block; UNDO_BLOCK *new_block_list; block = &(*block_list)[index]; munmap (block->mem, block->size); if (*length == 1) { free (*block_list); new_block_list = NULL; } else { memcpy (&(*block_list)[index], &(*block_list)[index + 1], sizeof (UNDO_BLOCK) * (*length - 1 - index)); new_block_list = realloc (*block_list, sizeof (UNDO_BLOCK) * (*length - 1)); if (new_block_list == NULL) { (*length)--; UNDO_SUCCESS; } } *block_list = new_block_list; (*length)--; UNDO_SUCCESS; } static void undo_stream_destroy (UNDO_MEMORY_STREAM * stream) { free (stream); } static size_t undo_stream_read (UNDO_MEMORY_STREAM * stream, size_t offset, void *mem, size_t size) { unsigned block_ix; UNDO_BLOCK *block; UNDO_MEMORY *memory; size_t ret; size_t pos; unsigned flags; memory = (UNDO_MEMORY *) stream->implementation; ret = 0; pos = 0; flags = 0; FOREACH_SMALL_BLOCK (memory, block_ix, block) { ret += undo_stream_block_write (offset, mem, size, &pos, block, flags); } flags = BLOCK_FLAG_LARGE; FOREACH_LARGE_BLOCK (memory, block_ix, block) { ret += undo_stream_block_write (offset, mem, size, &pos, block, flags); } return ret; } static size_t undo_stream_block_write (size_t offset, void *mem, size_t size, size_t * pos, UNDO_BLOCK * block, unsigned flags) { size_t ret; ret = 0; ret += undo_memory_stream_write (offset, mem, size, pos, &block->mem, sizeof (void *)); ret += undo_memory_stream_write (offset, mem, size, pos, &block->size, sizeof (size_t)); ret += undo_memory_stream_write (offset, mem, size, pos, &flags, sizeof (unsigned)); ret += undo_memory_stream_write (offset, mem, size, pos, block->mem, block->size); return ret; } static void undo_memory_clear (UNDO_MEMORY * memory) { unsigned block_ix; UNDO_BLOCK *block; FOREACH_SMALL_BLOCK (memory, block_ix, block) { munmap (block->mem, block->size); } FOREACH_LARGE_BLOCK (memory, block_ix, block) { munmap (block->mem, block->size); } memset (memory, 0, sizeof (UNDO_MEMORY)); } static int undo_memory_add_blocks_from_stream (UNDO_MEMORY * memory, UNDO_MEMORY_STREAM * stream) { size_t pos, num_read; UNDO_MEMORY_STREAM_BLOCK_HEADER header; pos = 0; do { num_read = undo_memory_stream_read_header (stream, pos, &header); if (num_read != STREAM_SERIALIZED_BLOCK_HEADER_SIZE) { UNDO_SUCCESS; } pos += num_read; if (MAP_NEW_ANON_AT (header.addr, header.size) != header.addr) { UNDO_ERROR (UNDO_NOMEM); } undo_memory_block_header_record (memory, &header); num_read = stream->read (stream, pos, header.addr, header.size); pos += num_read; } while (1); } static void undo_memory_block_header_record (UNDO_MEMORY * memory, UNDO_MEMORY_STREAM_BLOCK_HEADER * header) { UNDO_BLOCK **undo_block_list; unsigned *undo_block_list_count; if (header->flags & BLOCK_FLAG_LARGE) { undo_block_list = &memory->large_alloc_list; undo_block_list_count = &memory->large_alloc_list_count; } else { undo_block_list = &memory->small_alloc_list; undo_block_list_count = &memory->small_alloc_list_count; } undo_memory_new_block_record (undo_block_list, undo_block_list_count, header->addr, header->size); } size_t undo_memory_stream_write (size_t offset, void *mem, size_t size, size_t * pos, void *data, size_t length) { size_t begin_mem, end_mem; size_t begin_data; if (offset < *pos) { begin_mem = *pos - offset; begin_data = 0; } else { begin_mem = 0; begin_data = offset - *pos; } if (offset + size < *pos + length) { end_mem = size; } else { end_mem = size - (offset + size - *pos - length); } *pos += length; if ((signed) end_mem < 0) return 0; if (end_mem <= begin_mem) return 0; memcpy (MEMORY_OFFSET (mem, begin_mem), MEMORY_OFFSET (data, begin_data), end_mem - begin_mem); return end_mem - begin_mem; } size_t undo_memory_stream_length (UNDO_MEMORY_STREAM * stream) { size_t len, diff; char buff[4096]; len = 0; do { diff = stream->read (stream, len, buff, 4096); len += diff; } while (diff != 0); return len; } size_t undo_memory_stream_read_header (UNDO_MEMORY_STREAM * stream, size_t offset, UNDO_MEMORY_STREAM_BLOCK_HEADER * header) { size_t num_read; num_read = 0; num_read += stream->read (stream, offset + num_read, &header->addr, sizeof (void *)); num_read += stream->read (stream, offset + num_read, &header->size, sizeof (size_t)); num_read += stream->read (stream, offset + num_read, &header->flags, sizeof (unsigned)); return num_read; } static void undo_history_stream_destroy (UNDO_MEMORY_STREAM * stream); static size_t undo_history_stream_read (UNDO_MEMORY_STREAM * stream, size_t offset, void *mem, size_t size); static int undo_history_add_item (UNDO_HISTORY * history, void *mem, size_t size); static UNDO_MEMORY_STREAM *undo_history_stream (UNDO_HISTORY * history); static void undo_history_shrink (UNDO_HISTORY * history, size_t size); static void undo_history_strip (UNDO_HISTORY * history, int count); UNDO_HISTORY * undo_history_new (void) { UNDO_HISTORY *history; history = NEW (UNDO_HISTORY); if (history == NULL) UNDO_ERROR_NULL (UNDO_NOMEM); return history; } int undo_history_destroy (UNDO_HISTORY * history) { if (history == NULL) UNDO_ERROR (UNDO_BADPARAM); free (history); UNDO_SUCCESS; } int undo_history_record (UNDO_HISTORY * history, UNDO_MEMORY_STREAM * stream) { void *mem; size_t size; int ret; if (history->memory_limit == 0) UNDO_ERROR (UNDO_NOLIMIT); size = undo_memory_stream_length (stream); if (size > history->memory_limit) { undo_history_shrink (history, 0); UNDO_SUCCESS; } undo_history_shrink (history, history->memory_limit - size); mem = (void *) malloc (size); if (mem == NULL) UNDO_ERROR (UNDO_NOMEM); stream->read (stream, 0, mem, size); ret = undo_history_add_item (history, mem, size); if (ret) { free (mem); } return ret; } UNDO_MEMORY_STREAM * undo_history_undo (UNDO_HISTORY * history) { UNDO_MEMORY_STREAM *stream; if (history->ix == 0) UNDO_ERROR_NULL (UNDO_NODO); stream = undo_history_stream (history); if (stream) history->ix--; return stream; } UNDO_MEMORY_STREAM * undo_history_redo (UNDO_HISTORY * history) { UNDO_MEMORY_STREAM *stream; if (history->ix >= history->length - 1) UNDO_ERROR_NULL (UNDO_NODO); stream = undo_history_stream (history); if (stream) history->ix++; return stream; } unsigned undo_history_undo_count (UNDO_HISTORY * history) { if (history->length) return history->ix; return 0; } unsigned undo_history_redo_count (UNDO_HISTORY * history) { if (history->length) return history->length - 1 - history->ix; return 0; } void undo_history_set_memory_limit (UNDO_HISTORY * history, size_t limit) { history->memory_limit = limit; } size_t undo_history_memory_usage (UNDO_HISTORY * history) { int ix; size_t total; total = 0; for (ix = 0; ix < (int)history->length; ix++) { total += history->item[ix].size; } return total; } static void undo_history_stream_destroy (UNDO_MEMORY_STREAM * stream) { free (stream); } static size_t undo_history_stream_read (UNDO_MEMORY_STREAM * stream, size_t offset, void *mem, size_t size) { UNDO_HISTORY *history; size_t pos; void *history_mem; size_t history_size; history = (UNDO_HISTORY *) stream->implementation; pos = 0; history_mem = history->item[history->ix].mem; history_size = history->item[history->ix].size; return undo_memory_stream_write (offset, mem, size, &pos, history_mem, history_size); } static int undo_history_add_item (UNDO_HISTORY * history, void *mem, size_t size) { UNDO_HISTORY_ITEM *new_item; new_item = realloc (history->item, sizeof (UNDO_HISTORY_ITEM) * (history->length + 1)); if (new_item == NULL) { UNDO_ERROR (UNDO_NOMEM); } history->item = new_item; history->length++; history->ix = history->length - 1; history->item[history->ix].mem = mem; history->item[history->ix].size = size; UNDO_SUCCESS; } static UNDO_MEMORY_STREAM * undo_history_stream (UNDO_HISTORY * history) { UNDO_MEMORY_STREAM *stream; stream = NEW (UNDO_MEMORY_STREAM); if (stream == NULL) UNDO_ERROR_NULL (UNDO_NOMEM); stream->implementation = history; stream->destroy = undo_history_stream_destroy; stream->read = undo_history_stream_read; return stream; } static void undo_history_shrink (UNDO_HISTORY * history, size_t size) { int first_saved; int ix; size_t total; total = 0; first_saved = 0; for (ix = 0; ix < (int)history->length; ix++) { total += history->item[ix].size; while (total > size) { total -= history->item[first_saved].size; first_saved++; } } undo_history_strip (history, first_saved); } static void undo_history_strip (UNDO_HISTORY * history, int count) { int ix; if (count == 0) return; for (ix = 0; ix < count; ix++) { free (history->item[ix].mem); } memmove (history->item, history->item + count, sizeof (UNDO_HISTORY_ITEM) * (history->length - count)); history->length -= count; history->ix = history->length - 1; } static int undo_last_error = UNDO_NOERROR; void undo_set_error (int err) { undo_last_error = err; } int undo_get_errcode (void) { int ret; ret = undo_last_error; undo_last_error = UNDO_NOERROR; return ret; } char * undo_strerror (int errcode) { char *err_string[] = { "No error", "Bad parameter passed to undo function", "Out of memory", "No active undo session", "Nothing to undo/redo", "No undoable memory limit set" }; if (errcode < 0) return NULL; if (errcode >= (int) (sizeof (err_string) / sizeof (char *))) return NULL; return err_string[errcode]; } #endif chemtool-1.6.14/po/0000755000175000001440000000000012202262433013240 5ustar martinuserschemtool-1.6.14/po/pt_PT.po0000644000175000001440000007055112202261041014630 0ustar martinusers# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Martin Kroeker # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: Chetool 1.6.11\n" "Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: 2007-07-30 16:47+0200\n" "Last-Translator: Nuno Azoia \n" "Language-Team: European Portuguese\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" "O esquema actual não está guardado !\n" "Tem a certeza que quer continuar ?" #: main.c:225 main.c:293 msgid "Yes" msgstr "Sim" #: main.c:240 main.c:308 msgid "No" msgstr "Não" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" "O ficheiro\n" "%s\n" "Já existe !\n" "Quer gravar por cima ?" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" "\n" "O próximo anel a ser desenhado terá %d lados" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" "\n" "Foram importadas %d ligações e %d etiquetas" #: main.c:1359 main.c:2667 main.c:5829 msgid "unnamed" msgstr "semtitulo" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" "\n" "Pronto" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" "\n" "O processo de ajuda falhou - %s %s %s %s!" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" "\n" "O esquema foi impresso!" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" "\n" "Não foi possível imprimir o esquema!" #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr "modo de ângulo inválido %d\n" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr "modo de texto inválido %d\n" #: main.c:2353 msgid "Load from file..." msgstr "Carregar do ficheiro..." #: main.c:2394 msgid "Import MDL file..." msgstr "Importar ficheiro MDL" #: main.c:2434 msgid "Import via BABEL..." msgstr "Importar via BABEL" #: main.c:2456 msgid "Export via BABEL..." msgstr "Exportar via BABEL..." #: main.c:2478 msgid "Import PDB file..." msgstr "Importar ficheiro PDB..." #: main.c:2521 msgid "Add from file..." msgstr "Adicionar ficheiro..." #: main.c:2637 msgid "Save as..." msgstr "Guardar como..." #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" "\n" "Nada para guardar" #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" "\n" "O processamento de %s falhou !" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" "\n" "Esquema guaardado em %s (%d ligações, %d etiquetas)" #: main.c:2821 main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" "O processamento de\n" " %s\n" "falhou !\n" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" "\n" "O esquema foi exportado como %s (%d ligações, %d etiquetas)" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "Entrada SDF: %d" #: main.c:2979 main.c:3060 main.c:3101 main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr "Não foi possível abrir %s\n" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" "%s\n" " não parece ser um ficheiro Chemtool\n" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" "%s foi criado por uma versão mais recente.\n" "É possível que se percam alguma configurações.\n" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr "Erro ao carregar %s \n" #: main.c:3048 main.c:3089 main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" "\n" "Escolha a orientação (Ctrl-Mouse1 para z), carregue Enter quando terminar" #: main.c:3067 main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr "Ocorreram problemas ao converter %s\n" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" "Esquema gravado em\n" " %s\n" " (%d ligações, %d etiquetas)\n" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" "Com o botão esquerdo pressionado, arraste o rato para desenhar ligaçãoes. \n" "O botão direito é utilizado para apagar objectos - tanto ligações como texto\n" "dependendo do modo de edição que estiver activo.\n" "\n" "Na barra do programa, os butões com anéis desenhados permitem a selecção de\n" "diferentes modo de desenho, cada um dos quais com diferentes ângulos de ligação\n" "pré-definidos. Estes ângulos pré-definidos são apenas uma orientação, uma vez\n" "que é possível desenhar com qualquer ângulo de ligação em todos os modos.\n" "\n" "O botão com uma linha segmentada permite desenhar curvas marcando 4 pontos de\n" "controlo ao longo da curva (trata-se de uma curva spline de aproximação, uma\n" "vez que a linha não passa obrigatoriamente pelos pontos de controlo).\n" "\n" "Para desenhar um sistema cíclico, pressione simultaneamente Ctrl e a tecla\n" "correspondente ao número de lados do polígono pretendido. Depois basta desenhar\n" "uma ligação mantendo a tecla Ctrl pressionada. O polígono irá nascer partindo da\n" "ligação desenhada, no sentido dos ponteiros do relógio.\n" "Se não seleccionar o número de lados do polígono, então o sistema irá desenhar\n" "por defeito um polígono correspondente ao modo de desenho que estiver seleccionado.\n" "\n" "Pode seleccionar o tipo de ligação e a respectiva cor utilizando os respectivos butões\n" "antes de as desenhar, ou então altera-las posteriormente utilizando o modo Ligação.\n" "\n" "Para desenhar etiquetas, escreva o que pretende na janela de texto, situada na barra\n" "de ferramentas, por debaixo dos butões, e depois coloque-a na posição desejada\n" "utilizando o botão esquerdo do rato. É possível utilizar alguns atalhos do teclado\n" "principal para as etiquetas mais comuns, enquanto está a desenhar a estrutura:\n" "as teclas c,o,p,s,l adicionam o elemento correspondente no final da última ligação\n" "desenhada, ou então no sítio seleccionado com o botão esquerdo do rato. As teclas\n" "1,2 e 3 adicionam respectivamente um grupo CH, CH_2 e CH_3. A tecla 'l' adiciona\n" "um átomo de cloro e o * adiciona um ponto grande.\n" "\n" "O teclado numérico inser um par de electrões não partilhados à volta do átomo,\n" "na mesma posição relativa que cada tecla ocupa relativamente à tecla 5\n" "\n" "No modo de texto pode utilizar alguns prefixos para formatar o caracter seguinte:\n" "_ para caracteres em índice, ^ para expoentes, @ para símbolos (caracteres gregos),\n" "| para caracteres em itálico e # para texto em negrito (bold).\n" "Quando a caixa de texto está vazia, se carregar numa etiqueta presente no esquema\n" "copia essa mesma etiqueta para a área de texto para a reutilizar e/ou editar.\n" "\n" "A melhor método para desenhar é utilizar o rato, mas também pode utilizar as teclas\n" "do cursor em combinação com a tecla Ctrl para um posicionamento exacto.\n" "Quando utilizado em conjunto com a tecla Alt, o cursor move-se apenas ao longo da\n" "rectangular ou da rede rômbica que pode ser projectada na área de desenho.\n" "\n" "Se necessitar de funções em termos de desenho que não estão disponíveis no\n" "Chemtool, experimente exportar o esquema no formato fig e então editar a figura\n" "no Programa XFig (de Brian Smith e outros). Na realidade o Chemtool necessita de\n" "um programa associado a este, o transfig/fig2dev, para a impressão de esquemas e\n" "e para exportar os esquemas para o formato eps e LaTex, por exemplo. Outros formatos,\n" "como sejam fig, XBM e SVG são gerados directamente pelo Chemtool. Outro programa\n" "que é muito útil e altamente recomendado é o Babel, quer seja no seu formato original\n" "ou na forma do projecto de código aberto OpenBabel. Utilizando qualquer um destes\n" "programas o Chemtool é capaz de importar (e exportar) dados de (e para) uma grande\n" "variedade de tipos de ficheiros, produzidos por muitos outros programas de desenho\n" "de moléculas, enquanto que sem o Babel apenas é possível importar e exportar ficheiros mol\n" "\n" "Está disponível mais informação e ajuda no manual do Chemtool (#man chemtool) e no\n" "ficherio README incluido no ficheiro do código de fonte e na página de internet.\n" "Este ficheiro está normalmente instalado em /usr/share/doc/packages/chemtool.\n" "Se encontrar algum 'bug' no programa, ou se tiver alguma questão ou comentário\n" "por favor contacte o autor principal, martin@ruby.chemie.uni-freiburg.de" #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" " Chemtool Version 1.6.14\n" "autores\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "e\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" #: main.c:3450 msgid "PDB labels:" msgstr "Etiquetas PDB:" #: main.c:3453 msgid "All" msgstr "Tudo" #: main.c:3461 msgid "non-H" msgstr "sem H's" #: main.c:3470 msgid "no numbers" msgstr "sem números" #: main.c:3479 msgid "non H,no numbers" msgstr "sem H's, sem números" #: main.c:3489 main.c:3833 main.c:4139 msgid "None" msgstr "Nenhuma" #: main.c:3501 msgid "SDF entry:" msgstr "Entrada SDF:" #: main.c:3504 msgid "First" msgstr "Primeiro" #: main.c:3511 msgid "Previous" msgstr "Anterior" #: main.c:3518 msgid "Next" msgstr "Próximo" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr "Factor de ampliação para Latex / EPS" #: main.c:3708 msgid "Unknown error" msgstr "Erro desconhecido" #: main.c:3732 main.c:4010 msgid "Configurable options" msgstr "Opções configuráveis" #: main.c:3767 msgid "_General" msgstr "_Geral" #: main.c:3788 msgid "Display" msgstr "" #: main.c:3794 msgid "Saving and Exporting" msgstr "Guardar e Exportar" #: main.c:3800 msgid "Other" msgstr "Outro" #: main.c:3811 msgid "_Background color:" msgstr "Cor do fundo:" #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr "Adicionar rectângulos brancos debaixo das etiquetas" #: main.c:3834 main.c:4148 msgid "EPSI" msgstr "" #: main.c:3835 main.c:4157 msgid "TIFF mono" msgstr "" #: main.c:3836 main.c:4165 msgid "TIFF color" msgstr "TIFF colorido" #: main.c:3841 msgid "_Data directory:" msgstr "_Directoria de dados" #: main.c:3848 msgid "E_xtension:" msgstr "E_xtensão" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr "Imagem de pré-visualização para adicionar aos ficheiros _EPS:" #: main.c:3863 main.c:4184 msgid "Support national character sets in labels" msgstr "Suporte de conjuntos de caracteres nacionais nas etiquetas" #: main.c:3883 msgid "Base bond _length:" msgstr "Comprimento base de _ligação" #: main.c:3891 msgid "Double bond _separation:" msgstr "E_spaçamento das licações duplas" #: main.c:3904 msgid "_Printing" msgstr "Im_pressão" #: main.c:3934 main.c:4049 msgid "Portrait" msgstr "Retrato" #: main.c:3935 main.c:4054 msgid "Landscape" msgstr "Paisagem" #: main.c:3949 msgid "Print _command:" msgstr "_Comando de Impressão:" #: main.c:3956 msgid "Printer _name:" msgstr "_Nome da Impressora:" #: main.c:3963 msgid "Paper si_ze:" msgstr "Tamanho do papel" #: main.c:3970 msgid "_Orientation:" msgstr "_Orientação" #: main.c:3977 msgid "Print sc_ale factor:" msgstr "Factor de esc_ala da impressão" #: main.c:3993 msgid "Select background color" msgstr "Seleccione a cor de fundo" #: main.c:4019 msgid "Paper size:" msgstr "Tamanho do papel:" #: main.c:4044 msgid "Orientation:" msgstr "Orientação:" #: main.c:4069 msgid "Print scale factor :" msgstr "Factor de escala da impressão:" #: main.c:4094 msgid "Print command:" msgstr "Comando de impressão:" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr "Imagem de pré-visualização para adicionar aos ficherios eps:" #: main.c:4198 msgid "Background color :" msgstr "Cor do fundo:" #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr "Adicionar um rectângulo branco por debaixo das etiquetas" #: main.c:4225 msgid "Printer name:" msgstr "Nome da Impressora:" #: main.c:4238 msgid "Data directory:" msgstr "Directoria de dados:" #: main.c:4251 msgid "Extension:" msgstr "Extensão:" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr "Comprimento base de ligação (10.668mm)" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "Espaçamento das ligações duplas (4 pixel)" #: main.c:4298 msgid "Ok" msgstr "" #: main.c:4308 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "Cancelar" #: main.c:4327 main.c:4912 msgid "Templates" msgstr "Modelos" #: main.c:4338 main.c:4340 msgid "Carbocycles" msgstr "Carbocíclos" #: main.c:4378 main.c:4380 msgid "Sugars" msgstr "Açúcares" #: main.c:4422 main.c:4424 msgid "Heterocycles" msgstr "Heterocíclos" #: main.c:4466 main.c:4468 msgid "Amino Acids" msgstr "Aminoácidos" #: main.c:4511 main.c:4513 msgid "Symbols" msgstr "Símbolos" #: main.c:4559 gtkfilesel.c:1196 msgid "Close" msgstr "Fechar" #: main.c:4605 msgid "New" msgstr "Novo" #: main.c:4613 msgid "Open" msgstr "Abrir" #: main.c:4621 main.c:4904 msgid "Add" msgstr "Adicionar" #: main.c:4629 msgid "Import MOL" msgstr "Importar MOL" #: main.c:4637 msgid "Import PDB" msgstr "Importar PDB" #: main.c:4645 msgid "Import (Babel)" msgstr "Importar (Babel)" #: main.c:4653 msgid "Export..." msgstr "Exportar..." #: main.c:4661 msgid "Export (Babel)" msgstr "Exportar (Babel)" #: main.c:4670 main.c:4941 msgid "Print" msgstr "Imprimir" #: main.c:4678 msgid "Setup Defaults" msgstr "Configurações" #: main.c:4693 main.c:4960 msgid "Save Config" msgstr "Guardar configurações" #: main.c:4702 main.c:4921 msgid "Save" msgstr "Guardar" #: main.c:4710 msgid "Save As..." msgstr "Guardar como..." #: main.c:4719 main.c:5031 msgid "Quit" msgstr "Sair" #: main.c:4727 msgid "File" msgstr "Ficheiro" #: main.c:4734 msgid "Copy" msgstr "Copiar" #: main.c:4746 msgid "Flip horizontally" msgstr "Inverter horizontalmente" #: main.c:4752 msgid "Flip vertically" msgstr "Inverter verticalmente" #: main.c:4759 msgid "Undo" msgstr "Desfazer" #: main.c:4767 msgid "Redo" msgstr "Refazer" #: main.c:4777 msgid "Edit" msgstr "Editar" #: main.c:4784 msgid "Zoom in" msgstr "" #: main.c:4790 msgid "Zoom out" msgstr "" #: main.c:4801 main.c:4996 msgid "Center" msgstr "Centrar" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr "Rede rect/romb/sem rede" #: main.c:4815 msgid "View" msgstr "Ver" #: main.c:4823 msgid "Templates..." msgstr "Modelos..." #: main.c:4832 msgid "Calculate Formula Weight" msgstr "Calcular Peso Molecular" #: main.c:4840 msgid "Clean up drawing" msgstr "Limpar o esquema" #: main.c:4846 msgid "Tools" msgstr "Ferramentas" #: main.c:4854 main.c:5039 msgid "About" msgstr "Sobre" #: main.c:4863 main.c:4872 msgid "Help" msgstr "Ajuda" #: main.c:4895 msgid "Load" msgstr "Carregar" #: main.c:4900 msgid "Load a chemtool sketch" msgstr "Carregar um esquema do Chemtool" #: main.c:4909 msgid "Add fragment from file" msgstr "Adicionar um fragmento de um ficheiro" #: main.c:4918 msgid "Add template structure" msgstr "Adicionar uma estrutura modelo" #: main.c:4926 msgid "Save sketch to file" msgstr "Guardar um desenho para um ficheiro" #: main.c:4929 msgid "Export" msgstr "Exportar" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "Criar ficheiro EPS, XFig, PicTeX ou XBM" #: main.c:4947 msgid "Print file to a postscript printer" msgstr "Imprimir o ficheiro numa impressora postscript" #: main.c:4950 msgid "Setup" msgstr "" #: main.c:4957 msgid "Setup default options" msgstr "Opções normais do Setup" #: main.c:4966 msgid "Save default options" msgstr "Guardar opções normais" #: main.c:4969 msgid "Import" msgstr "Importar" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr "Ler um ficheiro escrito no formato MDL/molfile" #: main.c:4978 msgid "ImportPDB" msgstr "ImportarPDB" #: main.c:4984 msgid "Read a file written in PDB format" msgstr "Ler um ficheiro escrito no formato PDB" #: main.c:4987 msgid "Zoom In" msgstr "" #: main.c:4992 msgid "Increase zoom scale" msgstr "Aumentar o tamanho do esquema" #: main.c:5002 msgid "Center molecule in drawing area" msgstr "Centrar a molécula na área de desenho" #: main.c:5005 msgid "Zoom Out" msgstr "" #: main.c:5010 msgid "Decrease zoom scale" msgstr "Diminuir o tamanho do esquema" #: main.c:5014 msgid "Clear" msgstr "Limpar" #: main.c:5019 msgid "Remove molecule" msgstr "Remover a molécula" #: main.c:5022 msgid "FW" msgstr "PM" #: main.c:5027 msgid "Calculate Formula Mass" msgstr "Calcular a massa da fórmula" #: main.c:5036 msgid "Exit Chemtool" msgstr "Sair do Chemtool" #: main.c:5045 msgid "About Chemtool" msgstr "Sobre o Chemtool" #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr "Desenhar ângulos de 0/30/60/90 graus" #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr "Desenhar ângulos de 0/36/72... graus" #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr "Desenhar ângulos de 18/54/90... graus" #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr "Desenhar ângulos de 0/45/90... graus" #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr "Desenhar curvas baseadas em 4 pontos de controlo" #: main.c:5174 msgid "Draw left-justified text" msgstr "Adicionar text alinhado à esquerda" #: main.c:5191 msgid "Draw centered text" msgstr "Adicionar text centrado" #: main.c:5208 msgid "Draw right-justified text" msgstr "Adicionar text alinhado à direita" #: main.c:5236 msgid "Set current textfont" msgstr "Seleccionar o tipo de letra" #: main.c:5266 msgid "Choose default bond type" msgstr "Seleccionar o tipo de ligação" #: main.c:5283 msgid "Select pen color" msgstr "Seleccionar a cor das linhas" #: main.c:5288 msgid "Bonds" msgstr "Ligações" #: main.c:5293 msgid "Toggle bond types" msgstr "Modifiquar o tipo de ligação" #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr "Selecionar os objectos para os mover, rodar ou eliminar" #: main.c:5327 msgid "Move marked object" msgstr "Mover o objecto seleccionado" #: main.c:5344 msgid "Rotate marked object" msgstr "Rodar o objecto seleccionado" #: main.c:5363 msgid "Flip object horizontally" msgstr "Inverter o objecto na horizontal" #: main.c:5381 msgid "Flip object vertically" msgstr "Inverter o objecto na vertical" #: main.c:5407 msgid "Copy marked object" msgstr "Copiar o objecto seleccionado " #: main.c:5422 msgid "Rescale marked object" msgstr "Aumentar o diminuir o objecto seleccionado" #: main.c:5441 msgid "Draw brackets around object" msgstr "Desenhar parêntesis rectos à volta do objecto" #: main.c:5456 msgid "Draw rounded brackets around object" msgstr "Desenhar parêntesis redondos à volta do objecto" #: main.c:5471 msgid "Draw round brackets around object" msgstr "Desenhar parêntesis arredondados à volta do objecto" #: main.c:5486 msgid "Draw braces around object" msgstr "Desenhar chavetas à volta do objecto" #: main.c:5501 msgid "Draw simple box around object" msgstr "Desenhar caixa simples à volta do objecto" #: main.c:5515 msgid "Draw shaded box around object" msgstr "Desenhar caixa sombreada à volta do objecto" #: main.c:5529 msgid "Draw fancy box around object" msgstr "Desenhar caixa com duplo sombreado à volta do objecto" #: main.c:5543 msgid "Draw rounded box around object" msgstr "Desenhar caixa arredondada à volta do objecto" #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr "Desenhar parêntesis e caixas à volta do objecto" #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr "Remover ligações duplicadas, etc" #: main.c:5605 msgid "Text :" msgstr "Texto :" #: main.c:5619 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "Antes de qualquer caracter adicione _ para índice, ^ para expoente," "@ para símbolos, | para itálico, # para negrito; p.e. H_2O, @a_D^2^0" #: main.c:5624 msgid "Select current text size" msgstr "Seleccionar tamanho do texto" #: main.c:5753 #, c-format msgid "Ready" msgstr "Pronto" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "Chemtool: naõ consegue carregar nenhum tipo de letra\n" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr "Problemas de alocação de memória (SIGSEGV) -" #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr "Matemática inválida algures (SIGFPE) -" #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr "Problemas no acesso à memória (SIGBUS) -" #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr "Recebeu ordem para sair (SIGHUP) -" #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr " despejando o desenho actual para o ficheiro crashdumo.cht\n" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "Procurar em:" #: gtkfilesel.c:796 msgid "Directories" msgstr "Directorias" #: gtkfilesel.c:825 msgid "Mask:" msgstr "Filtro:" #: gtkfilesel.c:838 msgid "Files" msgstr "Ficheiros" #: gtkfilesel.c:872 msgid "OK" msgstr "" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "Não é possível ler da directoria: %s" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "Criar Dir" #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr "Apagar ficheiro" #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr "Alterar o nome ao ficheiro" #: gtkfilesel.c:1173 msgid "Error" msgstr "Erro" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "Criar directoria" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "Nome da directoria:" #: gtkfilesel.c:1297 msgid "Create" msgstr "Criar" #: gtkfilesel.c:1397 msgid "Delete" msgstr "Apagar" #: gtkfilesel.c:1512 msgid "Rename" msgstr "Mudar o nome" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "Selecção:" #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr "Considere a hipótese de instalar Babel/OpenBabel para a conversão de outros tipos de ficheiros...\n" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "Ciclopentadienil" #: templates.hx:2 msgid "Benzene" msgstr "Benzeno" #: templates.hx:2 msgid "Naphthalene" msgstr "Naftaleno" #: templates.hx:2 msgid "Azulene" msgstr "Azuleno" #: templates.hx:3 msgid "Adamantane" msgstr "Adamantano" #: templates.hx:3 templates.hx:5 msgid "Cyclohexane" msgstr "Ciclohexano" #: templates.hx:3 msgid "Steroid backbone" msgstr "Estrutura dos esteróides" #: templates.hx:3 msgid "Cycloheptatriene" msgstr "Cicloheptatrieno" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "Ciclooctatetraeno" #: templates.hx:4 msgid "Fluorene" msgstr "Fluoreno" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "Spiro[4.5]decano" #: templates.hx:4 msgid "Heptalene" msgstr "Heptaleno" #: templates.hx:4 msgid "Fulvalene" msgstr "Fulvaleno" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "Diciclopentadieno" #: templates.hx:5 msgid "Indene" msgstr "Indeno" #: templates.hx:5 msgid "Biphenyl" msgstr "Bifenilo" #: templates.hx:5 msgid "Norbornane" msgstr "Norbornano" #: templates.hx:5 msgid "Binaphthyl" msgstr "Binaftilo" #: templates.hx:6 msgid "Coronene" msgstr "" #: templates.hx:8 msgid "Pyranose core" msgstr "Estrutura das piranoses" #: templates.hx:8 msgid "Furanose core" msgstr "Estrutura das furanoses" #: templates.hx:8 msgid "Ribofuranose" msgstr "Ribofuranose" #: templates.hx:8 msgid "Fructose" msgstr "Fructose" #: templates.hx:8 msgid "Galactose" msgstr "Galactose" #: templates.hx:9 msgid "Glucose" msgstr "Glucose" #: templates.hx:9 msgid "Mannose" msgstr "Manose" #: templates.hx:9 msgid "Fucose" msgstr "Fucose" #: templates.hx:9 msgid "Xylose" msgstr "Xilose" #: templates.hx:9 msgid "Neuraminic acid" msgstr "Ácido Neuramínico" #: templates.hx:10 msgid "Sucrose" msgstr "Sacarose" #: templates.hx:10 msgid "Maltose" msgstr "Maltose" #: templates.hx:10 msgid "Lactose" msgstr "Lactose" #: templates.hx:14 msgid "Adenine" msgstr "Adenina" #: templates.hx:14 msgid "Guanine" msgstr "Guanina" #: templates.hx:14 msgid "Thymine" msgstr "Timina" #: templates.hx:14 msgid "Cytosine" msgstr "Citosina" #: templates.hx:14 msgid "Uracil" msgstr "Uracil" #: templates.hx:15 msgid "Porphine" msgstr "Porfirína" #: templates.hx:15 msgid "Caffeine" msgstr "Cafeína" #: templates.hx:15 msgid "Evans auxiliary" msgstr "Auxiliar de Evans" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "Auxiliar SAMP" #: templates.hx:15 msgid "Imidazole" msgstr "Imidazol" #: templates.hx:16 msgid "Benzimidazole" msgstr "Benzimidazol" #: templates.hx:16 msgid "Pyrazole" msgstr "Pirazol" #: templates.hx:16 msgid "Diazole" msgstr "Diazol" #: templates.hx:17 msgid "Morphine" msgstr "Morfina" #: templates.hx:17 msgid "Morphine 3D" msgstr "Morfina 3D" #: templates.hx:23 msgid "Backbone" msgstr "Esqueleto" #: templates.hx:26 msgid "p orbital" msgstr "Orbital p" #: templates.hx:26 msgid "plus" msgstr "Sinal mais" #: templates.hx:26 msgid "minus" msgstr "Sinal menos" #: templates.hx:26 msgid "rearrangement" msgstr "Rearranjo" chemtool-1.6.14/po/fr.gmo0000666000175000001440000005270012202261360014361 0ustar martinusersKLxy>-* 5%P v#/*>!' 6A(E'n 8 @KTZcz  $ $C$c$h${$$ $$$$$ $$$ %%%%9% @%L% ^%j%z% %!% %"%&%4&Z&v&%&&&&!&!'#@'d'','' ''''' ((!(0( D( N(Y(\('a((((((((( ( ) ))$)8)@) E) O)\)c)r) ) ))) )))!) * **6*;*R* d*p*x*-** *%** ++ #+/+?+C+F+ K+V+Y+\+a+ }+ + + +++}+#?,#c,,,,",,,, -- .-<-)A-!k------ -- --. . %. 0. <.G.[.s.. ....../ // / '/ 1/ ;/H/CO////// /////0 000"0+0>0 O0 ]0g0000 000 00 0012H2723;%3"a3)3/3(344!4?464*5RG555 553525)26\6(z666 666 6+6%7 -787A7J7R7p77 77*7*788L 8hEoEQEEEEFFF)0FZF kFwFFFFFFFF FGG-6G*dG-G(G(G5H'EHmH9H0H!H!I*3I+^I*I)I*I< JGJ LJYJ`J gJJJJJJ J JJJ'J$K-K FKgKKKKK KK KKKKK L LL"L3L NL [LhLLLLL+LLLM#M+MFMeMuM}MGM M(M,N-N6N?N [NgNzNNN NNNN N N NNNOOO(O'OP P#P2;P'nP&PPPP QQ* Q"KQnQsQ{Q%QQQ"Q QRR /R;RORlR%RRR R S#S8SQSjS{SSSS S SS SSHS$T,TGTNTfTnT~TTTTTTTTTTTT U)U9"4m8a-E1TSLR@r^oA3{Wz)(\$N gk<&u %s %s %s %s Choose orientation (Ctrl-Mouse1 for z), press Enter when done Drawing exported as %s (%d bonds, %d labels) Drawing printed! Drawing saved in %s (%d bonds, %d labels) Failed to print drawing ! Helper process failed - %s %s %s %s! Imported %d bonds and %d labels Next ring drawn will have %d sides Nothing to save Ready Writing to %s failed ! Chemtool Version 1.6.14 by Martin Kroeker, Radek Liboska, Michael Banck and Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dumping current drawing to file crashdump.cht %s does not appear to be a Chemtool file %s was created by a newer version. Some features may be lost. AboutAbout ChemtoolAdamantaneAddAdd filled _white rectangle under labelsAdd filled white rectangle under labelsAdd fragment from fileAdd from file...Add template structureAdenineAllAmino AcidsAzuleneBackground color :Base bond _length:Base bondlength (10.668mm) :BenzeneBinaphthylBiphenylBondsCaffeineCalculate Formula MassCalculate Formula WeightCancelCarbocyclesCenterCenter molecule in drawing areaChoose default bond typeClean up drawingClearClick and drag the mouse to draw bonds on the canvas. The right mouse button is used to delete objects - either bonds or text depending on which drawing mode is active. The buttons with different ringtypes on them select drawing modes with preferred angles, but you can actually draw at any angle in all modes. The button with the segmented line on it lets you draw curves by marking control points along the curve (a cubic spline). You can select the bondtype and color using the appropriate button or change them later by clicking on the desired bond in Bonds mode. To draw a cyclic system, simply press the Ctrl key together with the number key corresponding to the number of sides for the polygon, and then draw one side while pressing the Ctrl button. For drawing labels, write them into the text box in the top right of the window and place them on the canvas with the mouse. You can also use a number of keyboard shortcuts for common labels while in bond drawing mode: Simply press the 'c' key, or n,o,p,s,f to add the element symbol at the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl, * for a big dot. The keys of the numeric keypad each insert an 'electron pair' line around an atom symbol in the position corresponding to the location of the key around the center of the numeric keypad. The text mode uses the following prefixes for special text: _ for subscripts, ^ for superscripts, @ for symbols (greek characters), | for italic (slanted) characters and # for bold text. When the text box is empty, clicking on any label in the drawing area copies that label into the box for reuse. Drawing is best done with the mouse, but you can also use the cursor keys in combination with the Ctrl key for exact positioning. When used with the Alt key, the cursor keys move the rectangular or rhombic grid that can be projected on the drawing area. If you need general drawing functions not provided by chemtool, try exporting to fig format and editing your figure in Brian Smith's xfig program. Its companion transfig/fig2dev is required by chemtool for printing and for exporting to eps or LaTeX, while the fig, XBM and SVG output are generated directly. Another useful and highly recommended helper program is Babel - either in its original version, or in the form of the new OpenBabel project. Using either version, chemtool is able to import foreign data from a variety of file formats, while only molfile im- and export is built into chemtool. More help is available in the manual page for chemtool and in the file README included in the source distribution as well as on the website. This should normally get installed in /usr/share/doc/packages/chemtool. If you find any bugs or have a question or suggestion, please contact the main author, martin@ruby.chemie.uni-freiburg.deCloseConfigurable optionsConsider installing Babel/OpenBabel for file format conversions... CopyCopy marked objectCoroneneCreateCreate DirCreate DirectoryCreate EPS, XFig, PicTeX or XBM fileCycloheptatrieneCyclohexaneCyclooctatetraeneCyclopentadienylCytosineData directory:Decrease zoom scaleDeleteDelete FileDicyclopentadieneDirectoriesDirectory name:Directory unreadable: %sDraw at 0/30/60/90 degree anglesDraw at 0/36/72/... degree anglesDraw at 0/45/90... degree anglesDraw at 18/54/90/... degree anglesDraw braces around objectDraw brackets and boxes around objectDraw brackets around objectDraw centered textDraw curves based on 4 control pointsDraw fancy box around objectDraw left-justified textDraw right-justified textDraw round brackets around objectDraw rounded box around objectDraw rounded brackets around objectDraw shaded box around objectDraw simple box around objectDrawing saved in %s (%d bonds, %d labels) EPSIE_xtension:EditErrorError loading %s Evans auxiliaryExit ChemtoolExportExport (Babel)Export via BABEL...Export...Extension:FWFileFile %s already exists ! Overwrite it ?FilesFlip horizontallyFlip object horizontallyFlip object verticallyFlip verticallyFluoreneFructoseFucoseFulvaleneFuranose coreGalactoseGlucoseGrid rect/rhomb/offGuanineHelpHeptaleneHeterocyclesImportImport (Babel)Import MDL file...Import MOLImport PDBImport PDB file...Import via BABEL...ImportPDBIncrease zoom scaleIndeneInvalid math somewhere (SIGFPE) -LactoseLandscapeLatex / EPS scale factor :LoadLoad a chemtool sketchLoad from file...Looking in:MaltoseMannoseMark objects for moving, rotating or deletingMask:Memory access problem (SIGBUS) -Memory allocation problem (SIGSEGV) -MorphineMorphine 3DMove marked objectNaphthaleneNeuraminic acidNewNoNoneNorbornaneOKOkOpenOrdered to quit (SIGHUP) - Orientation:PDB labels:Paper si_ze:Paper size:PorphinePortraitPrefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0Preview image to add to _EPS files:Preview image to add to eps files :PrintPrint _command:Print command:Print file to a postscript printerPrint sc_ale factor:Print scale factor :Printer _name:Printer name:Problems converting %s Pyranose coreQuitRead a file written in MDL/molfile formatRead a file written in PDB formatReadyRedoRemove moleculeRemoves duplicate bonds, etc.RenameRename FileRescale marked objectRibofuranoseRotate marked objectSAMP auxiliarySaveSave As...Save ConfigSave as...Save sketch to fileSelect background colorSelect current text sizeSelect pen colorSelection: Set current textfontSetup DefaultsSetup default optionsSpiro[4.5]decaneSteroid backboneSucroseSugarsSymbolsTIFF colorTIFF monoTemplatesTemplates...Text :The current drawing is not saved ! Do you really wish to continue ?ThymineToggle bond typesToolsUnable to open %s UndoUnknown errorUracilViewWriting to %s failed ! XyloseYesZoom InZoom OutZoom inZoom out_Background color:_Data directory:_Orientation:_Printingchemtool: can't load any font invalid angle mode %d invalid text mode %d minusno numbersnon H,no numbersnon-Hp orbitalplusrearrangementunnamedProject-Id-Version: Chemtool-1.6 Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de POT-Creation-Date: 2007-05-23 23:58+0200 PO-Revision-Date: 2003-09-12 10:59GMT Last-Translator: Jerome PANSANEL Language-Team: Francais MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Generator: KBabel 0.9.5 %s %s %s %s Choissisez l'orientation (Ctrl-Souris1 pour z), puis appuyer sur Entre Dessin export sous %s (%d liaisons, %d zone de texte) Dessin imprim ! Dessin sauvegard dans %s (%d liaisons, %d zones de texte) Echec de l'impression du dessin ! Echec du processus d'aide - %s %s %s %s! Importation de %d liaisons et %d zone de texte Le prochain cycle dessin aura %d cts Rien enregistrer Prt Echec de l'criture sur %s !Version de Chemtool 1.6.14 ralis par Martin Kroeker, Radek Liboska, Michael Banck et Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.htmlCopie du dessin courant dans le fichier crashdump.cht %s ne semble pas tre un fichier Chemtool %s a t cre avec une version postrieure. Certains dtails peuvent tre perdus. A proposA propos de ChemtoolAdamantaneAjouterAjouter un rectangle _blanc sous les zones de texteAjouter un rectangle blanc sous les zones de texteAjouter un fragment partir d'un fichierAjouter partir d'un fichierAjouter un fragment partir d'un modleAdenineToutAcides aminsAzulneCouleur de fond :_Longueur d'une liaison de base:Longueur d'une liaison de base (10,668mm) :BenzneBinaphthylBiphnylLiaisonsCafineCalculer la masse molculaireCalculer la masse molculaireAnnulerCarbocyclesCentrerCentrer la molcule dans la zone de dessinSlectionner le type de liaison par dfautNettoyer le dessinEffacerCliquer et glisser la souris pour crer des liaisons sur le dessin. Le bouton droit est utilis pour effacer des objets - que ce soient des liaisons ou des zones de texte (cela dpend du mode de dessin activ). Les icnes reprsentant les diffrents cycles permettent de slectionner un mode de dessin. Chacun de ses modes est li un angle, bien qu'il soit possible de dessiner n'importe quel angle avec tous les modes. L'icne comportant un segment dcoup en quatre permet de raliser des courbes en plaant quatre points de contrle. Vous pouvez slectionner le type et la couleur de la liaison en utilisant l'icne approprie ou en les changeant par aprs en cliquant sur le mode de liaison souhait. Pour dessiner un systme cyclique, appuyer simplement sur la touche Ctrl conjointement avec le chiffre correspondant au nombre de cts du polygone, puis dessiner un ct en appuyant sur la touche Ctrl. Pour placer un texte, crivez-le dans le cadre 'Texte' en haut de la fentre et placez le sur le dessin avec la souris. Vous pouvez galement utiliser des raccourcis claviers pour les noms d'atomes courants lorsque le mode de dessins de liaison est activ : appuyer simplement sur la touche 'c', 'n', 'o', 'p', 's', ou 'f' pour ajouter le symbole de l'lment la dernire position active ; '1', '2' et '3' pour CH, CH_2 et CH_3, 'l' pour Cl, '*' pour un point. Les touches du clavier numrique permettent d'insrer une paire d'lectrons libres autour du symbole de l'atome, l'endroit correspondant la position de la touche par rapport au centre du clavier numrique. Le mode texte utilise les prfixes suivants pour inclure des caractres spciaux : _ pour les indices, ^ pour les exposants, @ pour les symboles (caractres grecs), | pour les caractres en italique et # pour le texte en gras. Lorsque le cadre 'Texte' est rempli, un clic sur n'importe quelle partie du dessin permet de copier le contenu du cadre. Le dessin est plus facile avec la souris. Vous pouvez nanmoins utiliser les flches du clavier en combinaison avec la touche Ctrl pour un positionnement exact. Lorsqu'elles sont utilises en combinaison avec la touche Alt, elles permettent de bouger la grille rectangulaire ou hexagonale, qui peut tre projete sur la surface de dessin. Si vous avez besoin de fonctions de dessin indisponibles dans Chemtool, essayez d'exporter votre dessin au format fig et de l'diter avec le programme xfig, ralis par Brian Smith's. Le programme transfig/fig2dev est ncessaire pour que Chemtool puisse imprimer et d'exporter en eps ou LaTeX. Par-contre, les fichiers au format fig, XBM et SVG sont gnrs directement. Un autre programme utile et recommand est Babel - soit en version original, soit par le biais du nouveau projet OpenBabel. L'utilisation de ces programmes permet d'importer dans Chemtool une grande varit de formats de fichier, alors qu'il n'y a que le format mol inclus de base dans Chemtool. Un complment d'aide est disponible dans les pages du manuel et dans le fichier README fournit avec les fichiers sources du programme. Ils sont galement disponibles sur le site web. Normalement, la documenation est installe dans le rpertoire /usr/share/doc/packages/chemtool. si vous trouvez des bugs ou si vous avez des questions/suggestions, veuillez-vous adresser, s'il vous plait, au dveloppeur principal du projet, martin@ruby.chemie.uni-freiburg.deFermerOptions configurablesConsidrer l'installation de Babel/OpenBabel pour les convertions de fichiers... CopierCopier l'objet slectionnCoronneCrerCrer un rpertoireCrer un rpertoireCrer un fichier EPS, XFig, PicTeX ou XBMCycloheptatrineCyclohexaneCyclooctatetraneCyclopentadinylCytosineRpertoire des donnes :Diminuer le zoomEffacerEffacer un fichierDicyclopentadineRpertoiresNom du rpertoire :Rpertoire non lisible : %sDessiner avec des angles de 0/30/60/90 degrsDessiner avec des angles de 0/36/72 degrsDessiner avec des angles de 0/45/90... degrsDessiner avec des angles 18/54/90 degrsDessiner des accolades autour de l'objetDessiner des crochets et des cadres autour de l'objetDessiner des crochets autour de l'objetEcrire un texte centrDessiner une courbe partir de quatre points de contrleDessiner un cadre personnalis autour de l'objetEcrire un texte justifi gaucheEcrire un texte justifi droiteDessiner des parenthses autour de l'objetDessiner un cadre arrondi autour de l'objetDessiner des parenthses autour de l'objetDessiner un cadre ombr autour de l'objetDessiner un simple cadre autour de l'objetDessin sauvegard dans %s (%d liaisons, %d zones de texte) EPSIE_xtension :diterErreurErreur lors du chargement de %s Auxiliaire EvansSortir de ChemtoolExporterExporter (Babel)Exporter via BabelExporter...Extension :MMFichierLe fichier %s existe dj ! L'craser ?FichiersBasculer horizontalementBasculer l'objet horizontalementBasculer l'objet verticalementBasculer verticalementFluorneFructoseFucoseFulvalneNoyau furanoseGalactoseGlucoseGrille rect/hex/offGuanineAideHeptalneHtrocyclesImporterImporter (Babel)Importer un fichier MDL...Importer MOLImporter PDBImporter un fichier PDB...Importer via BabelImporter un fichier PDBAugmenter le zoomIndneErreur mathmatique quelque part (SIGFPE) -LactosePaysageFacteur d'chelle Latex / EPS :ChargerCharger un dessin ChemtoolCharger partir du fichier...Chercher dans :MaltoseMannoseSlectionner les objets pour les dplacer, les tourner ou les supprimerFiltre : Problme d'accs la mmoire (SIGBUS) -Problme d'allocation de mmoire (SIGSEGV) -MorphineMorphineDplacer les objets marqusNaphthalneAcide neuraminiqueNouveauNonAucunNorbornaneOKOkOuvrirInjonction quitter (SIGHUP) - Orientation :Labels PDB :_Taille du papier :Taille du papier :PorphinePortraitPrfixer un caractre avec _ pour les indices, ^ pour les exposants, @ pour les symboles, | pour l'italique, # pour un texte gras; i.e. H_2O, @a_D^2^0Type d'image ajouter au fichier _eps :Type d'image ajouter au fichier eps :Imprimer_Commande d'impression :Commande d'impression :Imprimer le fichier vers une imprimante postscriptEc_helle de l'image pour l'impression :Echelle de l'image pour l'impression :_Nom de l'imprimante :Nom de l'imprimante :Problmes en convertissant %s Noyau pyranoseQuitterLire un fichier dans le format MDL/molfileLire un fichier dans un format PDBPrtRefaireSupprimer la molculeRetirer les liaisons dupliques, etc.RenommerRenommer un fichierRedimensionner l'objet slectionnRibofuranoseTourner les objets marqusAuxiliaire SAMPEnregistrerEnregistrer sous...Enregistrer la configurationEnregistrer sous...Enregistrer le dessin dans un fichierSlectionner la couleur de fondSlectionner la taille du texteSlectionner la couleur du styloSlection : Slectionner la police de caractreConfiguration par dfautConfiguration par dfautSpiro[4,5]dcaneSquelette de strodeSucroseSucresSymbolesTIFF couleurTIFF monoModlesModles...Texte :Le dessin actuel n'est pas sauvegard ! Voulez-vous vraiment continuer ?ThymineChanger le type de liaisonOutilsImpossible d'ouvrir %s DfaireErreur inconnueUracileVueEchec de l'criture sur %s XyloseOuiZoom +Zoom -Zoom +Zoom -Couleur de _fond:Rpertoire des _donnes :_Orientation :Im_primerChemtool : ne peut charger aucune police mode angulaire invalide %d mode texte invalide %d moinspas de nombreni H, ni nombrenon-Horbitale pplusrarrangementsansnomchemtool-1.6.14/po/cs.po0000644000175000001440000007163012202261154014213 0ustar martinusers# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: Chemtool 1.6\n" "Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: 2003-06-18 09:49+0200\n" "Last-Translator: Radek Liboska \n" "Language-Team: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-2\n" "Content-Transfer-Encoding: 8bit\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" "Souasn vzorec nen uloen!\n" "Opravdu si pejete pokraovat?" #: main.c:225 main.c:293 msgid "Yes" msgstr "Ano" #: main.c:240 main.c:308 msgid "No" msgstr "Ne" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" "Soubor\n" "%s\n" "ji existuje!\n" "Pepsat?" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" "\n" "Pt kruh bude mt %d stran" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" "\n" "Importovno %d vazeb a %d popisek" #: main.c:1359 main.c:2667 main.c:5829 msgid "unnamed" msgstr "nepojmenovany" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" "\n" "Hotovo" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" "\n" "Pomocn program selhal - %s %s %s %s!" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" "\n" "Tisk proveden!" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" "\n" "Vzorec nebyl vytitn! " #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr "chybn md hl %d\n" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr "chybn md textu %d\n" #: main.c:2353 msgid "Load from file..." msgstr "Nati ze souboru..." #: main.c:2394 msgid "Import MDL file..." msgstr "Import MDL souboru..." #: main.c:2434 msgid "Import via BABEL..." msgstr "" #: main.c:2456 msgid "Export via BABEL..." msgstr "Exportuj (BABEL)..." #: main.c:2478 msgid "Import PDB file..." msgstr "Import PDB souboru..." #: main.c:2521 msgid "Add from file..." msgstr "Pidej ze souboru..." #: main.c:2637 msgid "Save as..." msgstr "Ulo jako..." #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" "\n" "Nic k vrcen/obnoven" #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" "\n" "Zpis do %s selhal !" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" "\n" "Vzorec uloen jako %s (%d vazeb, %d popisek)" #: main.c:2821 main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" "Zpis do\n" " %s\n" "selhal !\n" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" "\n" "Vzorec exportovn jako %s (%d vazeb, %d popisek)" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "" #: main.c:2979 main.c:3060 main.c:3101 main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr "Nemohu otevt %s\n" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" "%s\n" " nevypad na soubor Chemtoolu\n" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" "%s byl vytvoen novj verz .\n" "Nkter vlastnosti mohou bt ztraceny.\n" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr "Chyba natn %s \n" #: main.c:3048 main.c:3089 main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" "\n" "Vyber orientaci (Ctrl-Mouse1 pro z), pot stiskni Enter " #: main.c:3067 main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr "Problm s konverz %s\n" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" "Vzorec uloen jako\n" " %s\n" " (%d vazeb, %d popisek)\n" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" "Kliknutm a tahem myi lze kreslit vazby. \n" "Prav tlatko myi lze pout k vymazn objektu - vazeb, textu\n" "nebo celho vbru, v zvislosti na momentln aktivnm kreslcm mdu.\n" "\n" "Tlatka v lit menu s rznmi typy kruh vybraj kreslc md\n" "s preferovanmi hly vazeb, ale obecn je mono pout libovolnho\n" "hlu v ktermkoliv zvolenm mdu.\n" "Tlatko s dlenou rou vol vkldn kubickch kivek, a to tak, e\n" "umstme tyi dc body podl zamlen kivky.\n" "Typ vazby a jej barvu lze vybrat pouitm odpovdajc pedvolby v menu\n" "vazeb; zmnu typu a barvy lze provst i dodaten pi stlaenm tlatku\n" "'Vazby'.\n" "Nakreslit cyklick systm najednou lze jednodue stisknutm funkn klvesy\n" "jej slo odpovd potu vazeb v kruhu a nslednm nakreslenm jedn\n" "jeho vazby se souasnm podrenm tlatka Ctrl.\n" "\n" "Znaky atom a skupin je zapoteb nejprve napsat do vstupnho dku textu\n" "v horn sti okna aplikace a pak umstit do vzorce kliknutm my.\n" "Ke vloen bnch znaek atom lze pout klvesovch zkratek pmo v mdu\n" "kreslen vazeb: jednodue stisknutm klvesy 'c' nebo n,o,p,s,f,i,b,r,d,h\n" "vlome odpovdajc symbol na konec prv nakreslen vazby; 1,2 a 3 vlo\n" "CH, CH_2 a CH_3, l bude Cl a * bude tun puntk.\n" "\n" "Klvesy na numerick klvesnici vkldaj elektronov pr, rku kolem " "symbolu\n" "atomu na pozici odpovdajc poloze klvesy okolo stedu numerick\n" "klvesnice.\n" "Textov md pouv nsledujcch pedpon ke speciln modifikaci textu:\n" "_ pro index (subskript), ^ pro exponent (superskript), @ pro symboly (eck\n" "znaky), | pro kurzvu (sklonn psmo) a # pro tun text.\n" "Kliknutm prostednm tlatkem myi po kterkoliv znace pouit\n" "ve vzorci je tato zkoprovna zpt do vstupn linky k dalmu pouit.\n" "\n" "Kreslen se nejlpe provd my, avak je tak mon pout kursorovch\n" "klves v kombinaci s klvesou Ctrl, zvlt pro pesn umstn. Pokud jsou\n" "kursorov klvesy pouity v kombinaci s klvesou Alt, pohybuj pravohlou\n" "nebo hexagonln mkou, promtanou na kreslc plochu.\n" "\n" "Pokud potebujete obecn kreslc funkce, kter nejsou k dispozici v " "aplikaci\n" "Chemtool, exportujte vzorec do formtu .fig a dle editujte kresbu v " "programu\n" "Xfig pana Briana Smithe. Ten je doprovzen programem transfig/fig2dev, " "kter\n" "je vyadovn aplikac Chemtool k tisku a exportu do formt eps nebo LaTeX\n" "(a emf), zatmco fig, XBM a SVG vstupy jsou generovny pmo. Jinm\n" "uitenm a doporuenm programem je Babel, a to bu v pvodn verzi nebo\n" "ve form novho projektu OpenBabel. Pouitm kterkoliv z verz Babelu je\n" "Chemtool schopen importovat ciz data z cel plejdy formt, zatmco\n" "zabudovn je pouze import (a export) z formtu molfile. Vstup ve " "vektorovm\n" " formtu svg lze zobrazit ve webovm prohlei (Adobe plug-in), tisknout\n" "a editovat programem Sodipodi nebo Javovou aplikac Batik\n" "\n" "Dal informace jsou uvedeny v manulovch strnkch a v souboru\n" "README kter je soust dokumentace distribuce, a tak na webovch\n" "strnkch projektu.\n" "Pokud narazte na chybu v programu nebo budete mt dotazy i nvrhy, " "obrate\n" "se, prosm, na hlavnho autora na adrese martin@ruby.chemie.uni-freiburg.de" #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" " Chemtool verze 1.6.14\n" "napsali\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "a\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" #: main.c:3450 msgid "PDB labels:" msgstr "Popisky PDB:" #: main.c:3453 msgid "All" msgstr "Ve" #: main.c:3461 msgid "non-H" msgstr "bez H" #: main.c:3470 msgid "no numbers" msgstr "bez sel" #: main.c:3479 msgid "non H,no numbers" msgstr "bez H, sel" #: main.c:3489 main.c:3833 main.c:4139 msgid "None" msgstr "dn" #: main.c:3501 msgid "SDF entry:" msgstr "" #: main.c:3504 msgid "First" msgstr "" #: main.c:3511 msgid "Previous" msgstr "" #: main.c:3518 msgid "Next" msgstr "" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr "Latex / EPS faktor zvten :" #: main.c:3708 msgid "Unknown error" msgstr "Neznm chyba" #: main.c:3732 main.c:4010 msgid "Configurable options" msgstr "Volby nastaven" #: main.c:3767 msgid "_General" msgstr "" #: main.c:3788 msgid "Display" msgstr "" #: main.c:3794 msgid "Saving and Exporting" msgstr "" #: main.c:3800 msgid "Other" msgstr "" #: main.c:3811 msgid "_Background color:" msgstr "_Barva pozad:" #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr "Vkldej _bl obdlnky pod text" #: main.c:3834 main.c:4148 msgid "EPSI" msgstr "" #: main.c:3835 main.c:4157 msgid "TIFF mono" msgstr "" #: main.c:3836 main.c:4165 msgid "TIFF color" msgstr "" #: main.c:3841 msgid "_Data directory:" msgstr "Adres _dokument:" #: main.c:3848 msgid "E_xtension:" msgstr "_Ppona:" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr "Nhledy vloen do _eps soubor:" #: main.c:3863 main.c:4184 msgid "Support national character sets in labels" msgstr "" #: main.c:3883 msgid "Base bond _length:" msgstr "Zkladn dlka _vazeb:" #: main.c:3891 msgid "Double bond _separation:" msgstr "" #: main.c:3904 msgid "_Printing" msgstr "Tiskni" #: main.c:3934 main.c:4049 msgid "Portrait" msgstr "Nastojato" #: main.c:3935 main.c:4054 msgid "Landscape" msgstr "Naleato" #: main.c:3949 msgid "Print _command:" msgstr "Pkaz _tisku:" #: main.c:3956 msgid "Printer _name:" msgstr "_Nzev tiskrny:" #: main.c:3963 msgid "Paper si_ze:" msgstr "Ve_likost papru" #: main.c:3970 msgid "_Orientation:" msgstr "_Orientace:" #: main.c:3977 msgid "Print sc_ale factor:" msgstr "kla tisku:" #: main.c:3993 msgid "Select background color" msgstr "Barva pozad:" #: main.c:4019 msgid "Paper size:" msgstr "Velikost papru" #: main.c:4044 msgid "Orientation:" msgstr "Orientace:" #: main.c:4069 msgid "Print scale factor :" msgstr "kla tisku:" #: main.c:4094 msgid "Print command:" msgstr "Pkaz tisku:" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr "Nhledy vloen do eps soubor:" #: main.c:4198 msgid "Background color :" msgstr "Barva pozad:" #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr "Vkldej bl obdlnky pod text" #: main.c:4225 msgid "Printer name:" msgstr "Nzev tiskrny:" #: main.c:4238 msgid "Data directory:" msgstr "Adres dokument:" #: main.c:4251 msgid "Extension:" msgstr "Ppona:" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr "Zkladn dlka vazeb (10.668mm):" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "" #: main.c:4298 msgid "Ok" msgstr "" #: main.c:4308 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "Zruit" #: main.c:4327 main.c:4912 msgid "Templates" msgstr "Templty" #: main.c:4338 main.c:4340 msgid "Carbocycles" msgstr "Karbocykly" #: main.c:4378 main.c:4380 msgid "Sugars" msgstr "Cukry" #: main.c:4422 main.c:4424 msgid "Heterocycles" msgstr "Heterocykly" #: main.c:4466 main.c:4468 msgid "Amino Acids" msgstr "" #: main.c:4511 main.c:4513 msgid "Symbols" msgstr "Symboly" #: main.c:4559 gtkfilesel.c:1196 msgid "Close" msgstr "Zavi" #: main.c:4605 msgid "New" msgstr "Nov" #: main.c:4613 msgid "Open" msgstr "Otevi" #: main.c:4621 main.c:4904 msgid "Add" msgstr "Pidej" #: main.c:4629 msgid "Import MOL" msgstr "Importuj MOL" #: main.c:4637 msgid "Import PDB" msgstr "Importuj PDB" #: main.c:4645 msgid "Import (Babel)" msgstr "Importuj (Babel)" #: main.c:4653 msgid "Export..." msgstr "Exportuj..." #: main.c:4661 msgid "Export (Babel)" msgstr "Exportuj (Babel)" #: main.c:4670 main.c:4941 msgid "Print" msgstr "Tiskni" #: main.c:4678 msgid "Setup Defaults" msgstr "Nastaven" #: main.c:4693 main.c:4960 msgid "Save Config" msgstr "Ulo nastaven" #: main.c:4702 main.c:4921 msgid "Save" msgstr "Ulo" #: main.c:4710 msgid "Save As..." msgstr "Ulo jako..." #: main.c:4719 main.c:5031 msgid "Quit" msgstr "mytec" #: main.c:4727 msgid "File" msgstr "Soubor" #: main.c:4734 msgid "Copy" msgstr "Kopruj" #: main.c:4746 msgid "Flip horizontally" msgstr "Peklop horizontln" #: main.c:4752 msgid "Flip vertically" msgstr "Peklop vertikln" #: main.c:4759 msgid "Undo" msgstr "Vra" #: main.c:4767 msgid "Redo" msgstr "Obnov" #: main.c:4777 msgid "Edit" msgstr "Editace" #: main.c:4784 msgid "Zoom in" msgstr "Zvti" #: main.c:4790 msgid "Zoom out" msgstr "Zmeni" #: main.c:4801 main.c:4996 msgid "Center" msgstr "Vycentruj" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr "Mka orto/hex/vypnuta" #: main.c:4815 msgid "View" msgstr "Pohled" #: main.c:4823 msgid "Templates..." msgstr "Templty..." #: main.c:4832 msgid "Calculate Formula Weight" msgstr "Vypoti molekulovou hmotu" #: main.c:4840 msgid "Clean up drawing" msgstr "Odstra duplikty" #: main.c:4846 msgid "Tools" msgstr "Nstroje" #: main.c:4854 main.c:5039 msgid "About" msgstr "O programu" #: main.c:4863 main.c:4872 msgid "Help" msgstr "Npovda" #: main.c:4895 msgid "Load" msgstr "Nati" #: main.c:4900 msgid "Load a chemtool sketch" msgstr "Nati chemtool ske" #: main.c:4909 msgid "Add fragment from file" msgstr "Pidej fragment ze souboru" #: main.c:4918 msgid "Add template structure" msgstr "Pidej templtovou strukturu" #: main.c:4926 msgid "Save sketch to file" msgstr "Ulo ske do souboru" #: main.c:4929 msgid "Export" msgstr "" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "Vytvo soubor EPS, XFig, PicTeX nebo XBM" #: main.c:4947 msgid "Print file to a postscript printer" msgstr "Tiskni soubor na postscriptov tiskrn" #: main.c:4950 msgid "Setup" msgstr "" #: main.c:4957 msgid "Setup default options" msgstr "Nastaven" #: main.c:4966 msgid "Save default options" msgstr "" #: main.c:4969 msgid "Import" msgstr "" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr "Nati soubor v MDL molfile formtu" #: main.c:4978 msgid "ImportPDB" msgstr "" #: main.c:4984 msgid "Read a file written in PDB format" msgstr "Nati soubor v PDB formtu" #: main.c:4987 msgid "Zoom In" msgstr "Zvti" #: main.c:4992 msgid "Increase zoom scale" msgstr "Zvti o stupe" #: main.c:5002 msgid "Center molecule in drawing area" msgstr "Vycentruj molekulu na kreslc ploe" #: main.c:5005 msgid "Zoom Out" msgstr "Zmeni" #: main.c:5010 msgid "Decrease zoom scale" msgstr "Zmeni o stupe" #: main.c:5014 msgid "Clear" msgstr "isti" #: main.c:5019 msgid "Remove molecule" msgstr "Odstra molekulu" #: main.c:5022 msgid "FW" msgstr "MV" #: main.c:5027 msgid "Calculate Formula Mass" msgstr "Vypoti molekulovou hmotu" #: main.c:5036 msgid "Exit Chemtool" msgstr "Ukoni program" #: main.c:5045 msgid "About Chemtool" msgstr "O programu Chemtool" #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr "Kresli v 0/30/60/90 stupovch hlech" #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr "Kresli v 0/36/72/... stupovch hlech" #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr "Kresli v 18/54/90/... stupovch hlech" #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr "Kresli v 0/45/90... stupovch hlech" #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr "Kresli kivky pomoc 4 dcch bod" #: main.c:5174 msgid "Draw left-justified text" msgstr "Pi text zarovnan vlevo" #: main.c:5191 msgid "Draw centered text" msgstr "Pi vycentrovan text" #: main.c:5208 msgid "Draw right-justified text" msgstr "Pi text zarovnan vpravo" #: main.c:5236 msgid "Set current textfont" msgstr "Zm psmo (patky/bez patek)" #: main.c:5266 msgid "Choose default bond type" msgstr "Vyber zkladn typ vazby" #: main.c:5283 msgid "Select pen color" msgstr "Vyber barvu pera" #: main.c:5288 msgid "Bonds" msgstr "Vazby" #: main.c:5293 msgid "Toggle bond types" msgstr "Zm typ vazby" #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr "Ozna objekty pro posun, rotaci nebo mazn" #: main.c:5327 msgid "Move marked object" msgstr "Posu oznaen objekt" #: main.c:5344 msgid "Rotate marked object" msgstr "Oto oznaen objekt" #: main.c:5363 msgid "Flip object horizontally" msgstr "Peklop objekt horizontln" #: main.c:5381 msgid "Flip object vertically" msgstr "Peklop objekt vertikln" #: main.c:5407 msgid "Copy marked object" msgstr "Kopruj oznaen objekt" #: main.c:5422 msgid "Rescale marked object" msgstr "kluj oznaen objekt" #: main.c:5441 msgid "Draw brackets around object" msgstr "Vlo zvorky kolem objektu" #: main.c:5456 msgid "Draw rounded brackets around object" msgstr "Kresli kulat zvorky kolem objektu" #: main.c:5471 msgid "Draw round brackets around object" msgstr "Kresli kulat zvorky kolem objektu" #: main.c:5486 msgid "Draw braces around object" msgstr "Kresli sloen zvorky kolem objektu" #: main.c:5501 msgid "Draw simple box around object" msgstr "Kresli jednoduch rmeek kolem objektu" #: main.c:5515 msgid "Draw shaded box around object" msgstr "Kresli stnovan rmeek kolem objektu" #: main.c:5529 msgid "Draw fancy box around object" msgstr "Kresli tun stnovan rmeek kolem objektu" #: main.c:5543 msgid "Draw rounded box around object" msgstr "Kresli zakulacen rmeek kolem objektu" #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr "Kresli zvorky a rmeky kolem objektu" #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr "Odstra duplikty atd." #: main.c:5605 msgid "Text :" msgstr "" #: main.c:5619 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "" "pidejte ped znak _ chcete-li vytvoit index, ^ pro exponent, @ pro " "symbol,\n" "| pro sklonn a # pro tun psmo; nap. H_2O, @b-stice, @a_D^2^0" #: main.c:5624 msgid "Select current text size" msgstr "Zm psmo (patky/bez patek)" #: main.c:5753 #, c-format msgid "Ready" msgstr "Hotovo" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "chemtool: nemohu naist d znaky\n" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr "Problm s alokac pamti (SIGSEGV) -" #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr "Matematick chyba (SIGFPE) -" #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr "Problm pstupu do pamti (SIGBUS) -" #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr "Pkaz k ukonen (SIGHUP) - " #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr "ukldm souasn vzorec do souboru crashdump.cht\n" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "Vyhledat v:" #: gtkfilesel.c:796 msgid "Directories" msgstr "Adrese" #: gtkfilesel.c:825 msgid "Mask:" msgstr "Maska:" #: gtkfilesel.c:838 msgid "Files" msgstr "Soubory" #: gtkfilesel.c:872 msgid "OK" msgstr "" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "Adres nelze st: %s" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "Vytvoit adres" #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr "Smazat soubor" #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr "Pejmenovat soubor" #: gtkfilesel.c:1173 msgid "Error" msgstr "Chyba" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "Vytvoit adres" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "Nzev adrese:" #: gtkfilesel.c:1297 msgid "Create" msgstr "Vytvoit" #: gtkfilesel.c:1397 msgid "Delete" msgstr "Odstranit" #: gtkfilesel.c:1512 msgid "Rename" msgstr "Pejmenovat" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "Vbr: " #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr "" "Pedpokldm instalaci Babel/OpenBabel pro konverzi formt soubor...\n" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "" #: templates.hx:2 msgid "Benzene" msgstr "Benzen" #: templates.hx:2 msgid "Naphthalene" msgstr "Naftalen" #: templates.hx:2 msgid "Azulene" msgstr "Azulen" #: templates.hx:3 msgid "Adamantane" msgstr "Adamantan" #: templates.hx:3 templates.hx:5 msgid "Cyclohexane" msgstr "Cyklohexan" #: templates.hx:3 msgid "Steroid backbone" msgstr "Steroidn pte" #: templates.hx:3 msgid "Cycloheptatriene" msgstr "Cykloheptatrien" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "Cyklooktatetraen" #: templates.hx:4 msgid "Fluorene" msgstr "Fluoren" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "Spiro[4.5]decan" #: templates.hx:4 msgid "Heptalene" msgstr "Heptalen" #: templates.hx:4 msgid "Fulvalene" msgstr "Fulvalen" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "Dicyklopentadien" #: templates.hx:5 msgid "Indene" msgstr "Inden" #: templates.hx:5 msgid "Biphenyl" msgstr "Bifenyl" #: templates.hx:5 msgid "Norbornane" msgstr "Norbornan" #: templates.hx:5 msgid "Binaphthyl" msgstr "Binaftyl" #: templates.hx:6 msgid "Coronene" msgstr "Coronen" #: templates.hx:8 msgid "Pyranose core" msgstr "Pyranosov kruh" #: templates.hx:8 msgid "Furanose core" msgstr "Furanosov kruh" #: templates.hx:8 msgid "Ribofuranose" msgstr "Ribofuranosa" #: templates.hx:8 msgid "Fructose" msgstr "Fruktosa" #: templates.hx:8 msgid "Galactose" msgstr "Galaktosa" #: templates.hx:9 msgid "Glucose" msgstr "Glukosa" #: templates.hx:9 msgid "Mannose" msgstr "Mannosa" #: templates.hx:9 msgid "Fucose" msgstr "Fukosa" #: templates.hx:9 msgid "Xylose" msgstr "Xylosa" #: templates.hx:9 msgid "Neuraminic acid" msgstr "Neuramov kyselina" #: templates.hx:10 msgid "Sucrose" msgstr "Sacharosa" #: templates.hx:10 msgid "Maltose" msgstr "Maltosa" #: templates.hx:10 msgid "Lactose" msgstr "Lactosa" #: templates.hx:14 msgid "Adenine" msgstr "Adenin" #: templates.hx:14 msgid "Guanine" msgstr "Guanin" #: templates.hx:14 msgid "Thymine" msgstr "Thymin" #: templates.hx:14 msgid "Cytosine" msgstr "Cytosin" #: templates.hx:14 msgid "Uracil" msgstr "" #: templates.hx:15 msgid "Porphine" msgstr "Porfyrin" #: templates.hx:15 msgid "Caffeine" msgstr "Kofein" #: templates.hx:15 msgid "Evans auxiliary" msgstr "Evans" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "SAMP" #: templates.hx:15 msgid "Imidazole" msgstr "" #: templates.hx:16 msgid "Benzimidazole" msgstr "" #: templates.hx:16 msgid "Pyrazole" msgstr "" #: templates.hx:16 msgid "Diazole" msgstr "" #: templates.hx:17 msgid "Morphine" msgstr "Morfin" #: templates.hx:17 msgid "Morphine 3D" msgstr "Morfin 3D" #: templates.hx:23 msgid "Backbone" msgstr "" #: templates.hx:26 msgid "p orbital" msgstr "p orbital" #: templates.hx:26 msgid "plus" msgstr "" #: templates.hx:26 msgid "minus" msgstr "" #: templates.hx:26 msgid "rearrangement" msgstr "peskupen" #~ msgid "Help - somebody ate my atoms (hp->n=%d, da_root.next NULL)!!!\n" #~ msgstr "Pomoc - kdosi seral m atomy (hp->n=%d, da_root.next NULL)!!!\n" #~ msgid "Help - somebody ate my atoms (d=%d,hp->n=%d)!!!\n" #~ msgstr "Pomoc - kdosi seral m atomy (d=%d,hp->n=%d)!!!\n" #~ msgid "failed to load font %s !!!\n" #~ msgstr "naten znak %s bylo nespn!!!\n" #~ msgid "Failed to load symbol font, using standard font\n" #~ msgstr "" #~ "Naten znakov sady symbol bylo nespn, pouiji standardn znakovou " #~ "sadu\n" #~ msgid "Error creating directory \"" #~ msgstr "Chyba pi vytven adrese \"" #~ msgid "Error deleting file \"" #~ msgstr "Chyba odstraovn souboru \"" #~ msgid "Really delete file \"" #~ msgstr "Skuten odstranit soubor \"" #~ msgid "Error renaming file \"" #~ msgstr "Chyba pejmenovn souboru \"" #~ msgid "Rename file " #~ msgstr "Pejmenovat soubor " #~ msgid " to:" #~ msgstr " na:" #~ msgid "Name too long" #~ msgstr "Pli dlouh nzev" #~ msgid "Chemtool Version " #~ msgstr "Verze Chemtoolu" #~ msgid "endless molfile???\n" #~ msgstr "molfile bez konce???\n" #~ msgid "expecting na %d nb %d\n" #~ msgstr "oekvm na %d nb %d\n" #~ msgid "undefined text direction in svg output\n" #~ msgstr "nedefinovan smr textu ve vstupu svg\n" #~ msgid "no emf font parameters for zoom factor %d\n" #~ msgstr "chyb emf parametry znak pro faktor zvten %d\n" #~ msgid "undefined text direction in emf output\n" #~ msgstr "nedefinovan smr textu ve vstupu emf\n" #~ msgid "no figfont parameters for zoom factor %d\n" #~ msgstr "chyb figfont parametry pro faktor zvten %d\n" #~ msgid "no figfont parameters for fontsize %d\n" #~ msgstr "chyb figfont parametry pro velikost znaku %d\n" #~ msgid "undefined text direction in xfig output\n" #~ msgstr "nedefinovan smr textu ve vstupu xfig\n" #~ msgid "no translation for %d\n" #~ msgstr "dn peklad %d\n" #~ msgid "could not close fig file" #~ msgstr "nemohu zavt soubor fig" #~ msgid "program cht not available or unable to write to" #~ msgstr "program cht nen dosaiteln nebo nemohu zapisovat" #~ msgid "File selection" #~ msgstr "Vbr souboru" #~ msgid "_Configurable options" #~ msgstr "Volby _nastaven" #~ msgid "No error" #~ msgstr "Bez chyby" #~ msgid "Bad parameter passed to undo function" #~ msgstr "patn parametry podstoupeny funkci Zpt" #~ msgid "Out of memory" #~ msgstr "Nedostatek pamti" #~ msgid "No active undo session" #~ msgstr "dn aktivn sezen vrcen" #~ msgid "Nothing to undo/redo" #~ msgstr "Nic k vrcen/obnoven" #~ msgid "No undoable memory limit set" #~ msgstr "Nenastaven limit pamti vrcen" #~ msgid "destroy" #~ msgstr "zni" #~ msgid "clicked" #~ msgstr "kliknut" #~ msgid "could not write to" #~ msgstr "nemohu pst do" #~ msgid "X Bitmap" #~ msgstr "X Bitmapa" #~ msgid "activate" #~ msgstr "aktivuj" #~ msgid "Help - somebody ate my atoms!!!\n" #~ msgstr "Pomoc - kdosi mi seral m atomy!!!\n" #~ msgid "" #~ "\n" #~ "Drawing printed! " #~ msgstr "" #~ "\n" #~ "Vzorec vytitn! " #~ msgid "Printer Configuration" #~ msgstr "Nastaven tiskrny" #~ msgid "toggled" #~ msgstr "pepnuto" chemtool-1.6.14/po/POTFILES.in0000644000175000001440000000007110715417303015020 0ustar martinusersmain.c graph.c gtkfilesel.c inout.c undo.c templates.hx chemtool-1.6.14/po/nl.gmo0000666000175000001440000004760612202261360014374 0ustar martinusers<3\()>;-z*% &#Gk|/7*g> ('F]n / 6BIi ""C""## # '#2#$C#h# y###### ## ##$ $!?$ a$"$$%$$%%%:%W%p%!%%#%% &,+&X& ]&i&n&t&& &&&& & &&&'&'','E'\'l' u' '''' ' '''' ' '(( +(5(I(!P( r(|(((( (-(( )%&)L) _)k){))) ))))) ) ) ) )))})#{*#****"* + +5+ D+R+ j+x+)}+!+++++, ,,+,@,O, T, _, k,v,,,, ,,,,-#-4-<-C- K- V- `- j-w-C~------ -. .&.*.2.;.C.L._. p. ~..... ... ./ //T!/v0?070151K1$j1'101112#202(2b3|33 3 33334 4=4E4 J4U4]4p4%44 4444 4 5 5!5<5X5k5 r5~A AKAAAB BB'B):BdB uBBBBB BBB BCC0CNCiCCC#CCC*D!/DQDgD~D!DD$DD5ESE XEfEoEtEEE EEE E EFF' F 5F?FUFpFFF F FFFF F F FGG .G MMM NN-NS(*lu5 Bpe]w{XP2. noF4JGtUk @"<T\vrWZcDQ['REKhA,V %s %s %s %s Choose orientation (Ctrl-Mouse1 for z), press Enter when done Drawing exported as %s (%d bonds, %d labels) Drawing printed! Drawing saved in %s (%d bonds, %d labels) Failed to print drawing ! Helper process failed - %s %s %s %s! Imported %d bonds and %d labels Next ring drawn will have %d sides Nothing to save Ready Writing to %s failed ! Chemtool Version 1.6.14 by Martin Kroeker, Radek Liboska, Michael Banck and Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dumping current drawing to file crashdump.cht %s does not appear to be a Chemtool file %s was created by a newer version. Some features may be lost. AboutAbout ChemtoolAdamantaneAddAdd filled _white rectangle under labelsAdd filled white rectangle under labelsAdd fragment from fileAdd from file...Add template structureAdenineAllAmino AcidsAzuleneBackground color :Base bond _length:Base bondlength (10.668mm) :BenzeneBondsCaffeineCalculate Formula MassCalculate Formula WeightCancelCarbocyclesCenterCenter molecule in drawing areaChoose default bond typeClean up drawingClearClick and drag the mouse to draw bonds on the canvas. The right mouse button is used to delete objects - either bonds or text depending on which drawing mode is active. The buttons with different ringtypes on them select drawing modes with preferred angles, but you can actually draw at any angle in all modes. The button with the segmented line on it lets you draw curves by marking control points along the curve (a cubic spline). You can select the bondtype and color using the appropriate button or change them later by clicking on the desired bond in Bonds mode. To draw a cyclic system, simply press the Ctrl key together with the number key corresponding to the number of sides for the polygon, and then draw one side while pressing the Ctrl button. For drawing labels, write them into the text box in the top right of the window and place them on the canvas with the mouse. You can also use a number of keyboard shortcuts for common labels while in bond drawing mode: Simply press the 'c' key, or n,o,p,s,f to add the element symbol at the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl, * for a big dot. The keys of the numeric keypad each insert an 'electron pair' line around an atom symbol in the position corresponding to the location of the key around the center of the numeric keypad. The text mode uses the following prefixes for special text: _ for subscripts, ^ for superscripts, @ for symbols (greek characters), | for italic (slanted) characters and # for bold text. When the text box is empty, clicking on any label in the drawing area copies that label into the box for reuse. Drawing is best done with the mouse, but you can also use the cursor keys in combination with the Ctrl key for exact positioning. When used with the Alt key, the cursor keys move the rectangular or rhombic grid that can be projected on the drawing area. If you need general drawing functions not provided by chemtool, try exporting to fig format and editing your figure in Brian Smith's xfig program. Its companion transfig/fig2dev is required by chemtool for printing and for exporting to eps or LaTeX, while the fig, XBM and SVG output are generated directly. Another useful and highly recommended helper program is Babel - either in its original version, or in the form of the new OpenBabel project. Using either version, chemtool is able to import foreign data from a variety of file formats, while only molfile im- and export is built into chemtool. More help is available in the manual page for chemtool and in the file README included in the source distribution as well as on the website. This should normally get installed in /usr/share/doc/packages/chemtool. If you find any bugs or have a question or suggestion, please contact the main author, martin@ruby.chemie.uni-freiburg.deCloseConfigurable optionsConsider installing Babel/OpenBabel for file format conversions... CopyCopy marked objectCoroneneCreateCreate DirCreate DirectoryCreate EPS, XFig, PicTeX or XBM fileCycloheptatrieneCyclohexaneCyclooctatetraeneCytosineData directory:Decrease zoom scaleDeleteDelete FileDicyclopentadieneDirectoriesDirectory name:Directory unreadable: %sDraw at 0/30/60/90 degree anglesDraw at 0/36/72/... degree anglesDraw at 0/45/90... degree anglesDraw at 18/54/90/... degree anglesDraw braces around objectDraw brackets and boxes around objectDraw brackets around objectDraw centered textDraw curves based on 4 control pointsDraw fancy box around objectDraw left-justified textDraw right-justified textDraw round brackets around objectDraw rounded box around objectDraw rounded brackets around objectDraw shaded box around objectDraw simple box around objectDrawing saved in %s (%d bonds, %d labels) EPSIE_xtension:EditErrorError loading %s Evans auxiliaryExit ChemtoolExportExport (Babel)Export via BABEL...Export...Extension:FWFileFile %s already exists ! Overwrite it ?FilesFlip horizontallyFlip object horizontallyFlip object verticallyFlip verticallyFluoreneFulvaleneFuranose coreGrid rect/rhomb/offGuanineHelpHeptaleneHeterocyclesImportImport (Babel)Import MDL file...Import MOLImport PDBImport PDB file...Import via BABEL...ImportPDBIncrease zoom scaleIndeneInvalid math somewhere (SIGFPE) -LandscapeLatex / EPS scale factor :LoadLoad a chemtool sketchLoad from file...Looking in:Mark objects for moving, rotating or deletingMask:Memory access problem (SIGBUS) -Memory allocation problem (SIGSEGV) -Move marked objectNaphthaleneNeuraminic acidNewNoNoneNorbornaneOKOkOpenOrdered to quit (SIGHUP) - Orientation:PDB labels:Paper si_ze:Paper size:PorphinePortraitPrefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0Preview image to add to _EPS files:Preview image to add to eps files :PrintPrint _command:Print command:Print file to a postscript printerPrint sc_ale factor:Print scale factor :Printer _name:Printer name:Problems converting %s Pyranose coreQuitRead a file written in MDL/molfile formatRead a file written in PDB formatReadyRedoRemove moleculeRemoves duplicate bonds, etc.RenameRename FileRescale marked objectRotate marked objectSAMP auxiliarySaveSave As...Save ConfigSave as...Save sketch to fileSelect background colorSelect current text sizeSelect pen colorSelection: Set current textfontSetup DefaultsSetup default optionsSpiro[4.5]decaneSteroid backboneSucroseSugarsSymbolsTIFF colorTIFF monoTemplatesTemplates...Text :The current drawing is not saved ! Do you really wish to continue ?ThymineToggle bond typesToolsUnable to open %s UndoUnknown errorViewWriting to %s failed ! YesZoom InZoom OutZoom inZoom out_Background color:_Data directory:_Orientation:_Printingchemtool: can't load any font invalid angle mode %d invalid text mode %d minusno numbersnon H,no numbersnon-Hp orbitalplusrearrangementunnamedProject-Id-Version: Chemtool-1.6.3 Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de POT-Creation-Date: 2007-05-23 23:58+0200 PO-Revision-Date: 2005-01-10 18:53+0100 Last-Translator: Myckel Habets Language-Team: NONE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit %s %s %s %s Kies richting (Ctrl-Muis1 voor z), druk Enter als u klaar bent Tekening als %s geexporteerd (%d bindingen, %d labels) Tekening afgedrukt! Tekening als %s opgeslagen (%d bindingen, %d labels) Kon tekening niet afdrukken ! Helpprogramma faalde - %s %s %s %s! %d bindingen en %d labels geimporteerd De volgende getekende ring zal %d kanten hebben Niets om op te slaan Gereed Kon niet naar %s schrijven! Chemtool Versie 1.6.14 door Martin Kroeker, Radek Liboska, Michael Banck en Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dump huidige tekening in bestand crashdump.cht %s lijkt geen Chemtool bestand te zijn %s was met een nieuwere versie van Chemtool gemaakt. Enkele gegevens kunnen verloren zijn gegaan. InfoInfo over ChemtoolAdamantaanToevoegen_Witte achtergrond onder labelsWitte achtergrond onder labelsFragment van bestand toevoegenToevoegen van bestand...Structuur sjabloon toevoegenAdenineAlleAminozurenAzuleenAchtergrondkleur :Standaard bindings_lengte:Standaard bindingslengte (10.668mm) :BenzeenBindingenCaffeineBereken MolecuulgewichtBereken MolecuulmassaAnnulerenCarbocyclenCentrerenCentreert molekuul in tekengebiedKies standaard bindingstypeTekening opschonenWissenKlik en sleep the muis om bindingen in het tekenvlak te tekenen. De rechter muisknop wordt gebruikt om objecten te verwijderen - zowel bindingen als tekst, afhankelijk van welke tekenmodus actief is. De knoppen met verschillende ringtypes selecteren de tekenmoduses met de gewenste hoeken, maar je kan ook in elke hoek in alle moduses tekenen. De knop met de gesegmenteerde lijn laat u curves tekenen door controlepunten langs de curve aan te geven. U kan de bindingstype en kleur selecteren met de daarvoor aangegeven knop of verander het later door klikken op de gewenste binding in bindingsmodus. Om een cyclisch systeem te tekenen, druk tegelijk op de CTRL toets en de numerieke toets overeenkomend met het aantal zijden van de polygon, en teken dan een zijde terwijl u de CTRL knop ingedrukt houdt. Voor het tekenen van tekstlabels, schrijf ze in de tekstregel bovenin het venster en plaats ze in het tekenvenster met de muis. U kan ook een aantal sneltoetsen voor veelvuldig gebruikte tekstlabels gebruiken als u in bindings- tekenmodus bent: Druk de 'c' toets, of n, o, p, s, f om een element symbool op de huidige tekenpositie te tekenen. 1, 2 en 3 voor CH, CH_2 en CH_3, l voor Cl, * voor een dikke punt. De toetsen va het nummerieke toetsenbord voegen elk een 'electronenpaar' lijn om een atoomsymbool in, in de positie overeenkomend met de locatie van de toets ten opzichte van de centrum van het numerieke toetsenbord. De tekstmodus gebruikt de volgende prefixes voor speciale tekst: _ voor subscript, ^ voor superscript, @ voor symbolen (griekse tekens), | voor schuin geschreven tekens en # voor vette tekst. Als de tekstregel leeg is, kliken op een tekstlabel in het tekenvenster copieert die tekstlabel in de tekstregel voor hergebruik. Tekenen is het makkelijkst met de muis, maar ook de cursor toetsen in combinatie met de CTRL toets kan gebruikt worden voor exacte positionering. Als de Alt toets gebruikt wordt, verplaatsen de cursor toetsen de vierkantige of zeskantige raster die op het tekenvenster geprojecteerd kan worden. Als u algemene tekenfunties nodig heeft, die niet door chemtool geleverd worden, probeer te exporteren naar fig formaat en bewerk uw tekening in Brian Smith's xfig programma. Zijn bijgeleverde transfig/fig2dev is nodig voor chemtool voor afdrukken en exporteren naar eps of LaTeX, terwijl de fig, XBM en SVG uitvoer direct gegenereerd worden. Nog een bruikbaar en aanbevolen hulpprogramma is Babel - zowel in zijn originele versie als in de vorm van het nieuwe OpenBabel project. Door gebruik van een van de versies, is chemtool in staat gegevens in exotische bestandsformaten te importeren, terwijl alleen molfile im- en export in chemtool ingebouwd is. Meer help is beschikbaar in de handleidingspagina van chemtool en in het bestand README, bijgeleverd in de bron distributie en op de website. Deze zou normaal in /usr/share/doc/packages/chemtool te vinden moeten zijn. Als u bugs vind, suggesties of vragen heeft, neem a.u.b. contact op met de schrijver, martin@ruby.chemie.uni-freiburg.de (Duitse of Engelse taal a.u.b.)SluitenInstellingenOverweeg Babel/Openbabel te installeren voor bestandsformaat conversies... KopierenKopieer gemarkeerd objectCoroneenAanmakenDirectory AanmakenDirectory AanmakenMaak een EPS, XFig, PicTeX of XBM bestandCycloheptatrieenCyclohexaanCyclooctatetraeenCytosineGegevensdirectory:Verkleint de zoomfactorVerwijderenBestand VerwijderenDicyclopentadieenDirectoriesDirectorynaam:Directory niet leesbaar: %sTekenen met 0/30/60/90 gradenTekenen met 0/36/72 gradenTekenen met 0/45/90 gradenTekenen met 18/54/90 gradenTeken krulhaken om objectTeken haken en vierkanten om objectTeken haken om objectTekst centrerenTeken curven gebaseerd op 4 controlepuntenTeken omtekend vierkant om objectTekst links uitlijnenTekst rechts uitlijnenTeken ronde haken om objectTeken afgerond vierkant om objectTeken ronde haken om objectTeken vierkant met schaduw om objectTeken simpel vierkant om objectTekening als %s opgeslagen (%d bindingen, %d labels) EPSI_Uitbreiding:BewerkenFout%s kan niet geladen worden Evans AuxiliarSluit Chemtool afExporterenExporteer (Babel)...Exporteer via BABEL...Exporteer...Uitbreiding:MWBestandBestand %s bestaat al ! Overschrijven ?BestandenHorizontaal spiegelenSpiegel object horizontaalSpiegel object vertikaalVertikaal spiegelenFluoreenFulvaleenFuranose kernRaster quadr./hex./uitGuanineHelpHeptaleenHeterocyclenImporteerImporteer (Babel)Importeer MDL bestand...Importeer MOLImporteer PDBImporteer PDB bestand...Importeer via BABEL...Importeer PDBVergroot de zoomfactorIndeenRekenfout (SIGFPE) -LiggendLatex / EPS schalingsfactor :LadenLaad een chemtool tekeningladen van bestand...Huidige locatie:Markeer objecten voor verplaatsen, rotatie en verwijderingWeergave:Geheugetoegangsprobleem (SIGBUS) -Geheugentoewijzingsprobleem (SIGSEGV) -Verplaats gemarkeerd objectNaphthaleenNeuraminezuurNieuwNeeGeenNorbornaanOKOkOpenenAfsluitingssignaal (SIGHUP) -Orientatie:PDB Labels:Papier_formaatPapierformaatPorphineStaandPrefix een teken met _ voor subscript, ^ voor superscript, @ voor symbolen, | voor schuin, # voor dikke tekst; bijv. H_2O, @a_D^2^0_Voorbeeld plaatje om aan EPS bestanden toe te voegen:Voorbeeld plaatje om aan eps bestanden toe te voegen :AfdrukkenAfdruk_commando:Afdrukcommando:Druk bestand af naar een postscript printer_Schalingsfactor:Schalingsfactor :Printer_naam:Printernaam:Problemen met conversie van %s Pyranose kernAfsluitenLees een bestand, geschreven in MDL/molfile formaatLees een bestand, geschreven in PDB formaatKlaarNogmaalsWist de tekeningVerwijder dubbel getekende bindingen, etc.HernoemenBestand HernoemenVergroot/verklein gemarkeerd objectRoteer gemarkeerd objectSAMP AuxiliarOpslaanOpslaan als...Configuratie opslaanOpslaan als...Tekening naar bestand opslaanSelecteer achtergrondkleurSelecteer huidige tekstgrootteSelecteer tekenkleurSelectie: Huidige lettertype instellenStandaardinstellingenStandaardinstellingenSpiro[4.5]decaanSteroïdSucroseSuikersSymbolenTIFF kleurTIFF monoSjablonenSjablonen...Tekst :De huidige tekening is niet opgeslagen ! Wilt u echt doorgaan?ThymineAan/uit bindingstypenGereedschappenKan %s niet openen Ongedaan makenOnbekende foutBeeldKon niet naar %s schrijven! JaInzoomenUitzoomenVergrotenVerkleinenAchtergrond_kleur:_Gegevensdirectory:_Orientatie:Afdrukkenchemtool: kan geen lettertype laden ongeldige hoekmodus %d ongeldige tekstmodus %d minuszonder nummerszonder H, geen nummersniet-HP-orbitaalplusherschikkingnaamlooschemtool-1.6.14/po/boldquot.sed0000666000175000001440000000033112202253330015563 0ustar martinuserss/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g chemtool-1.6.14/po/bg.po0000644000175000001440000010675012202261072014177 0ustar martinusers# Russian translation for chemtool # Copyright (C) 2001 Free Software Foundation, Inc. # Michael Shigorin , 2001, 2002. # msgid "" msgstr "" "Project-Id-Version: chemtool 1.6rc\n" "Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: 2008-03-17 22:56+0200\n" "Last-Translator: lfu project \n" "Language-Team: Svetoslav Stefanov \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Bulgarian\n" "X-Poedit-Country: BULGARIA\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" "Текущият чертеж не е запазен!\n" "Продължаване?" #: main.c:225 #: main.c:293 msgid "Yes" msgstr "Да" #: main.c:240 #: main.c:308 msgid "No" msgstr "Не" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" "Файлът\n" "%s\n" "вече съществува!\n" "Презаписване?" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" "\n" "Следващият пръстен ще има %d страни" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" "\n" "Внесени %d връзки и %d етикети" #: main.c:1359 #: main.c:2667 #: main.c:5829 msgid "unnamed" msgstr "без име" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" "\n" "Готово" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" "\n" "Грешка в помощният процес - %s %s %s %s!" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" "\n" "%s %s %s %s" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" "\n" "Завършен печат!" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" "\n" "Провален печат!" #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr "грешен режим на ъгъла %d\n" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr "грешен режим на текста %d\n" #: main.c:2353 msgid "Load from file..." msgstr "Зареждане от файл..." #: main.c:2394 msgid "Import MDL file..." msgstr "Внесяне на MDL-файл..." #: main.c:2434 msgid "Import via BABEL..." msgstr "Внасяне чрез Babel..." #: main.c:2456 msgid "Export via BABEL..." msgstr "Изнасяне чрез Babel..." #: main.c:2478 msgid "Import PDB file..." msgstr "Внасяне на PDB-файл..." #: main.c:2521 msgid "Add from file..." msgstr "Добавяне от файл..." #: main.c:2637 msgid "Save as..." msgstr "Запазване като..." #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" "\n" "Няма нищо за запазване" #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" "\n" "Записът в %s се провали!" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" "\n" "Чертежът е запазен в %s (връзки: %d, етикети: %d)" #: main.c:2821 #: main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" "Записът в\n" " %s\n" "се провали!\n" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" "\n" "Чертежът е изнесен като %s (връзки: %d, етикети: %d)" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "" #: main.c:2979 #: main.c:3060 #: main.c:3101 #: main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr "Не може да се отвори %s\n" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" "%s\n" "не прилича на файл на Chemtool\n" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" "%s е създаден с по-нова версия.\n" "Някои детайли може да се загубят.\n" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr "Грешка при зареждането на %s \n" #: main.c:3048 #: main.c:3089 #: main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" "\n" "Изберете ориентация (Ctrl-Mouse1 за оста z) и натиснете Enter" #: main.c:3067 #: main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr "Проблем с конвертирането на %s\n" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" "Чертежът е запазен в\n" " %s\n" " (връзки: %d, етикети: %d)\n" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" "Цъкнете и влачете мишката за да чертаете вериги \n" "по платното. Десният бутон на мишката се използва \n" "за изтриване на обекти - вериги или текст, в зависимост \n" "от режима на чертане.\n" "\n" "Бутоните с различни типове пръстени избират режим \n" "на чертане с избрани ъгли, но всъщност можете да \n" "чертаете под произволен ъгъл във всички режими. \n" "Бутонът с прекъсната линия на него ви позволява \n" "да чертаете криви, като маркирате контролни точки \n" "по кривата (cubic spline). \n" "Чрез подходящият бутон може да изберете тип на \n" "веригата и цвят или може да ги промените по-късно \n" "като натиснете желаната верига в режим Вериги. \n" "\n" "За да начертаете циклична система, \n" "просто натиснете Ctrl заедно с цифровият клавиш, \n" "отговарящ на броя на страните на полигона и \n" "тогава начертайте една страна като задържате Ctrl. \n" "\n" "За да начертаете етикети, напишете ги в \n" "текстовото поле в горният десен ъгъл на \n" " прозореца и ги поставете на платното \n" "с мишката. Може да използвате и клавишни \n" "комбинации за често срещани етикети \n" "докато сте в режим на чертане на вериги: \n" "Натиснете 'c' или 'n', 'o', 'p', 's', 'f' за да добавите \n" "символ на елемента в текущата позиция на чертане, \n" "'1', '2' и '3' за CH, CH_2 и CH_3, 'l' за Cl,\n" "'*' за голяма точка. \n" "\n" "Всеки клавиш от цифровата клавиатура вмъква \n" "'електронна двойка' около атома, кореспондираща \n" "на позицията на клавиша относно централния \n" " клавиш на цифровата клавиатура.\n" "Текстовият режим използва следните представки \n" "за специален текст: \n" "'_' за долен индекс, '^' за горен индекс \n" " @ за символи (гръцки букви), '|' за курсив \n" "и '#' за получер текст. \n" "Когато текстовото поле е празно, цъкането върху \n" "произволен етикет в чертожната зона, води до\n" "копиране на този етикет в полето за \n" "повторно използване. \n" "\n" "Най-добре се чертае с мишката, но може \n" "да използвате и стрелките в комбинация \n" "с Ctrl за точно позициониране. \n" "Използвани с Alt, стрелките местят \n" "квадратната или ромбоидна мрежа, която \n" "може да бъде сложена на чертожната площ. \n" "\n" "Ако имате нужда от чертожни функции, които \n" "не се осигуряват от chemtool, опитайте да \n" "изнесете файл във fig формат и да редактирате \n" "вашата фигура в програмата на Brian Smith xfig. \n" "Допълнението и transfig/fig2dev e необходимо на \n" "chemtool за печат и изнасяне в eps или LaTex \n" "за разлика от fig, XBM и SVG, които се \n" "генерират директно.\n" "Друга полезна и силно препоръчвана програма е \n" "Babel - в оригиналната си и OpenBabel версия. \n" "И с двете версии chemtool може да внася данни \n" "от различни файлови формати, докато само \n" " внасяне и изнасяне на molfile е вградено в нея. \n" "\n" "Допълнителна помощ е налична в ръководството \n" "на chemtool и в README файла, включен в \n" "изходния код, а също така и на уеб страницата. \n" "Нормално това се намира в \n" " /usr/share/doc/packages/chemtool.\n" "Ако намерите някакви програмни грешки или имате \n" "въпрос, или предложение, моля свържете се с \n" "главният автор martin@ruby.chemie.uni-freiburg.de" #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" " Chemtool версия 1.6.14\n" "автори:\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "и\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html\n" "\n" "Български перевод:\n" "Светослав Стефанов" #: main.c:3450 msgid "PDB labels:" msgstr "PDB етикети:" #: main.c:3453 msgid "All" msgstr "Всичко" #: main.c:3461 msgid "non-H" msgstr "не-H" #: main.c:3470 msgid "no numbers" msgstr "без номера" #: main.c:3479 msgid "non H,no numbers" msgstr "не-H, без номера" #: main.c:3489 #: main.c:3833 #: main.c:4139 msgid "None" msgstr "Не" #: main.c:3501 msgid "SDF entry:" msgstr "" #: main.c:3504 msgid "First" msgstr "Първи" #: main.c:3511 msgid "Previous" msgstr "Предишен" #: main.c:3518 msgid "Next" msgstr "Следващ" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr "Мащаб LaTeX/EPS:" #: main.c:3708 msgid "Unknown error" msgstr "Неизвестна грешка" #: main.c:3732 #: main.c:4010 msgid "Configurable options" msgstr "Параметри за настройка" #: main.c:3767 msgid "_General" msgstr "Общ" #: main.c:3788 msgid "Display" msgstr "Display" #: main.c:3794 msgid "Saving and Exporting" msgstr "Записване и изнасяне" #: main.c:3800 msgid "Other" msgstr "" #: main.c:3811 msgid "_Background color:" msgstr "Фонов цвят" #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr "Добавяне на бял фон около етикетите" #: main.c:3834 #: main.c:4148 msgid "EPSI" msgstr "" #: main.c:3835 #: main.c:4157 msgid "TIFF mono" msgstr "TIFF (моно)" #: main.c:3836 #: main.c:4165 msgid "TIFF color" msgstr "TIFF (цветно)" #: main.c:3841 msgid "_Data directory:" msgstr "Каталог с данни:" #: main.c:3848 msgid "E_xtension:" msgstr "Разширение:" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr "Предварително преглеждане на чертежите за добавяне в eps-файлове:" #: main.c:3863 #: main.c:4184 msgid "Support national character sets in labels" msgstr "Поддръжка на национални символи в етикетите" #: main.c:3883 msgid "Base bond _length:" msgstr "Базова дължина на веригата:" #: main.c:3891 msgid "Double bond _separation:" msgstr "" #: main.c:3904 msgid "_Printing" msgstr "Печат" #: main.c:3934 #: main.c:4049 msgid "Portrait" msgstr "Портрет" #: main.c:3935 #: main.c:4054 msgid "Landscape" msgstr "Ландшафт" #: main.c:3949 msgid "Print _command:" msgstr "Команда за печат:" #: main.c:3956 msgid "Printer _name:" msgstr "Име на принтер:" #: main.c:3963 msgid "Paper si_ze:" msgstr "Размер на хартията:" #: main.c:3970 msgid "_Orientation:" msgstr "Ориентация:" #: main.c:3977 msgid "Print sc_ale factor:" msgstr "Мащаб при печат:" #: main.c:3993 msgid "Select background color" msgstr "Избиране на фонов цвят" #: main.c:4019 msgid "Paper size:" msgstr "Размер на хартията:" #: main.c:4044 msgid "Orientation:" msgstr "Ориентация:" #: main.c:4069 msgid "Print scale factor :" msgstr "Мащаб при печат:" #: main.c:4094 msgid "Print command:" msgstr "Команда за печат:" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr "Предварително преглеждане на чертежите за добавяне в eps-файлове:" #: main.c:4198 msgid "Background color :" msgstr "Фонов цвят" #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr "Добавяне на бял фон около етикетите" #: main.c:4225 msgid "Printer name:" msgstr "Име на принтер:" #: main.c:4238 msgid "Data directory:" msgstr "Каталог с данни:" #: main.c:4251 msgid "Extension:" msgstr "Разширение:" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr "Базова дължина на веригата (10.668мм):" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "" #: main.c:4298 msgid "Ok" msgstr "ОК" #: main.c:4308 #: gtkfilesel.c:880 #: gtkfilesel.c:1306 #: gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "Отказ" #: main.c:4327 #: main.c:4912 msgid "Templates" msgstr "Шаблони" #: main.c:4338 #: main.c:4340 msgid "Carbocycles" msgstr "Карбоцикли" #: main.c:4378 #: main.c:4380 msgid "Sugars" msgstr "Захари" #: main.c:4422 #: main.c:4424 msgid "Heterocycles" msgstr "Хетероцикли" #: main.c:4466 #: main.c:4468 msgid "Amino Acids" msgstr "Аминокиселини" #: main.c:4511 #: main.c:4513 msgid "Symbols" msgstr "Символи" #: main.c:4559 #: gtkfilesel.c:1196 msgid "Close" msgstr "Затваряне" #: main.c:4605 msgid "New" msgstr "Нов" #: main.c:4613 msgid "Open" msgstr "Отваряне" #: main.c:4621 #: main.c:4904 msgid "Add" msgstr "Добавяне" #: main.c:4629 msgid "Import MOL" msgstr "Внасяне на MOL" #: main.c:4637 msgid "Import PDB" msgstr "Внасяне на PDB" #: main.c:4645 msgid "Import (Babel)" msgstr "Внасяне на (Babel)" #: main.c:4653 msgid "Export..." msgstr "Изнасяне..." #: main.c:4661 msgid "Export (Babel)" msgstr "Изнасяне (Babel)" #: main.c:4670 #: main.c:4941 msgid "Print" msgstr "Печат" #: main.c:4678 msgid "Setup Defaults" msgstr "Начални настройки" #: main.c:4693 #: main.c:4960 msgid "Save Config" msgstr "Запазване на настройките" #: main.c:4702 #: main.c:4921 msgid "Save" msgstr "Запазване" #: main.c:4710 msgid "Save As..." msgstr "Запазване като..." #: main.c:4719 #: main.c:5031 msgid "Quit" msgstr "Изход" #: main.c:4727 msgid "File" msgstr "Файл" #: main.c:4734 msgid "Copy" msgstr "Копиране" #: main.c:4746 msgid "Flip horizontally" msgstr "Хоризонтално обръщане" #: main.c:4752 msgid "Flip vertically" msgstr "Вертикално обръщане" #: main.c:4759 msgid "Undo" msgstr "Отмяна" #: main.c:4767 msgid "Redo" msgstr "Повтаряне" #: main.c:4777 msgid "Edit" msgstr "Редактиране" #: main.c:4784 msgid "Zoom in" msgstr "Приближаване [+]" #: main.c:4790 msgid "Zoom out" msgstr "Отдалечаване [-]" #: main.c:4801 #: main.c:4996 msgid "Center" msgstr "Център" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr "Мрежа квадрат/ромб/изключена" #: main.c:4815 msgid "View" msgstr "Изглед" #: main.c:4823 msgid "Templates..." msgstr "Шаблони..." #: main.c:4832 msgid "Calculate Formula Weight" msgstr "Молекулярна маса" #: main.c:4840 msgid "Clean up drawing" msgstr "Изчистване на чертежа" #: main.c:4846 msgid "Tools" msgstr "Инструменти" #: main.c:4854 #: main.c:5039 msgid "About" msgstr "Относно" #: main.c:4863 #: main.c:4872 msgid "Help" msgstr "Помощ" #: main.c:4895 msgid "Load" msgstr "Зареждане" #: main.c:4900 msgid "Load a chemtool sketch" msgstr "Зареждане на Chemtool чертеж" #: main.c:4909 msgid "Add fragment from file" msgstr "Добавяне на фрагмент от файл" #: main.c:4918 msgid "Add template structure" msgstr "Добавяне на структура от шаблон" #: main.c:4926 msgid "Save sketch to file" msgstr "Съхраняване на чертежа във файл" #: main.c:4929 msgid "Export" msgstr "Изнасяне" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "Създаване на EPS, XFig, PicTeX или XBM файл" #: main.c:4947 msgid "Print file to a postscript printer" msgstr "Печат към postscript принтер" #: main.c:4950 msgid "Setup" msgstr "Настройки" #: main.c:4957 msgid "Setup default options" msgstr "Начални настройки" #: main.c:4966 msgid "Save default options" msgstr "Запазване на начални настройки" #: main.c:4969 msgid "Import" msgstr "Внасяне" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr "Прочитане на MDL/molfile-файл" #: main.c:4978 msgid "ImportPDB" msgstr "Внасяне на PDB" #: main.c:4984 msgid "Read a file written in PDB format" msgstr "Прочитане на PDB-файл" #: main.c:4987 msgid "Zoom In" msgstr "Приближаване [+]" #: main.c:4992 msgid "Increase zoom scale" msgstr "Увеличаване на мащаба" #: main.c:5002 msgid "Center molecule in drawing area" msgstr "Центриране на молекулата" #: main.c:5005 msgid "Zoom Out" msgstr "Отдалечаване [-]" #: main.c:5010 msgid "Decrease zoom scale" msgstr "Намаляване на мащаба" #: main.c:5014 msgid "Clear" msgstr "Изчистване" #: main.c:5019 msgid "Remove molecule" msgstr "Премахване на молекулата" #: main.c:5022 msgid "FW" msgstr "Маса" #: main.c:5027 msgid "Calculate Formula Mass" msgstr "Молекулярна маса" #: main.c:5036 msgid "Exit Chemtool" msgstr "Изход от Chemtool" #: main.c:5045 msgid "About Chemtool" msgstr "Относно Chemtool" #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr "Чертане под ъгъл от 0/30/60/90 градуса" #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr "Чертане под ъгъл от 0/36/72/... градуса" #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr "Чертане под ъгъл от 18/54/90/... градуса" #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr "Чертане под ъгъл от 18/54/90/... градуса" #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr "Чертане на криви с 4 контролни точки" #: main.c:5174 msgid "Draw left-justified text" msgstr "Текст (ляво подравнен)" #: main.c:5191 msgid "Draw centered text" msgstr "Текст (центриран)" #: main.c:5208 msgid "Draw right-justified text" msgstr "Текст (дясно подравнен)" #: main.c:5236 msgid "Set current textfont" msgstr "Текущ шрифт" #: main.c:5266 msgid "Choose default bond type" msgstr "Избиране на начален тип верига" #: main.c:5283 msgid "Select pen color" msgstr "Цвят на писалката" #: main.c:5288 msgid "Bonds" msgstr "Вериги" #: main.c:5293 msgid "Toggle bond types" msgstr "Превключване на типа верига" #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr "Маркиране на обекти за преместване, завъртане или изтриване" #: main.c:5327 msgid "Move marked object" msgstr "Преместване на маркирания обект" #: main.c:5344 msgid "Rotate marked object" msgstr "Завъртане на маркирания обект" #: main.c:5363 msgid "Flip object horizontally" msgstr "Хоризонтално обръщане на обекта" #: main.c:5381 msgid "Flip object vertically" msgstr "Вертикално обръщане на обекта" #: main.c:5407 msgid "Copy marked object" msgstr "Копиране на маркирания обект" #: main.c:5422 msgid "Rescale marked object" msgstr "Мащабиране на маркирания обект" #: main.c:5441 msgid "Draw brackets around object" msgstr "Квадратни скоби около обекта" #: main.c:5456 msgid "Draw rounded brackets around object" msgstr "Кръгли скоби около обекта" #: main.c:5471 msgid "Draw round brackets around object" msgstr "Кръгли скоби около обекта" #: main.c:5486 msgid "Draw braces around object" msgstr "Фигурални скобки около обекта" # XXX here finished #: main.c:5501 msgid "Draw simple box around object" msgstr "Проста рамка около обекта" #: main.c:5515 msgid "Draw shaded box around object" msgstr "Рамка с цвят около обекта" #: main.c:5529 msgid "Draw fancy box around object" msgstr "Декоративна рамка около обекта" #: main.c:5543 msgid "Draw rounded box around object" msgstr "Закръглена рамка около обекта" #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr "Скоби и рамки около обекта" #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr "Премахване на дублиращи се вериги и т.н." #: main.c:5605 msgid "Text :" msgstr "Текст:" #: main.c:5619 msgid "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "Представка: _ за долен индекс, ^ - за горен индекс, @ - за символи, | - курсив, # - получер. Например, H_2O, @a_D^2^0" #: main.c:5624 msgid "Select current text size" msgstr "Избиране на размер на текста" #: main.c:5753 #, c-format msgid "Ready" msgstr "Готово" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "chemtool: не мога да заредя подходящ шрифт\n" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr "Проблем с разпределението на паметта (SIGSEGV) - " #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr "Неправилно изчисление (SIGFPE) - " #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr "Грешка с достъпа до паметта (SIGBUS) - " #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr "Принудителен изход (SIGHUP) - " #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr "запис на текущия чертеж във файл crashdump.cht\n" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "Търсене в:" #: gtkfilesel.c:796 msgid "Directories" msgstr "Папки" #: gtkfilesel.c:825 msgid "Mask:" msgstr "Маска:" #: gtkfilesel.c:838 msgid "Files" msgstr "Файлове" #: gtkfilesel.c:872 msgid "OK" msgstr "ОК" #: gtkfilesel.c:916 #: gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "Съдържанието на папката не може да бъде показано: %s" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "Създаване на папка" #: gtkfilesel.c:960 #: gtkfilesel.c:1375 msgid "Delete File" msgstr "Изтриване на файл" #: gtkfilesel.c:971 #: gtkfilesel.c:1480 msgid "Rename File" msgstr "Преименуване на файл" #: gtkfilesel.c:1173 msgid "Error" msgstr "Грешка" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "Създаване на папка" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "Имен на папка:" #: gtkfilesel.c:1297 msgid "Create" msgstr "Създаване" #: gtkfilesel.c:1397 msgid "Delete" msgstr "Изтриване" #: gtkfilesel.c:1512 msgid "Rename" msgstr "Преименуване" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "Избор:" #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr "Опитайте да инсталирате Babel/OpenBabel за конвертиране на файловите формати...\n" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "Циклопентадиенил" #: templates.hx:2 msgid "Benzene" msgstr "Бензол" #: templates.hx:2 msgid "Naphthalene" msgstr "Нафталин" #: templates.hx:2 msgid "Azulene" msgstr "Азулен" #: templates.hx:3 msgid "Adamantane" msgstr "Адамантан" #: templates.hx:3 #: templates.hx:5 msgid "Cyclohexane" msgstr "Циклохексан" #: templates.hx:3 msgid "Steroid backbone" msgstr "Стероиден скелет" #: templates.hx:3 msgid "Cycloheptatriene" msgstr "Циклопентатриен" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "Циклооктатетраен" #: templates.hx:4 msgid "Fluorene" msgstr "Флуорен" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "Спиро[4.5]декан" #: templates.hx:4 msgid "Heptalene" msgstr "Хептален" #: templates.hx:4 msgid "Fulvalene" msgstr "Фулвален" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "Дициклопентадиен" #: templates.hx:5 msgid "Indene" msgstr "Индол" #: templates.hx:5 msgid "Biphenyl" msgstr "Бифенил" #: templates.hx:5 msgid "Norbornane" msgstr "Норборнан" #: templates.hx:5 msgid "Binaphthyl" msgstr "Бинафтил" #: templates.hx:6 msgid "Coronene" msgstr "Коронен" #: templates.hx:8 msgid "Pyranose core" msgstr "Ядро на Пираноза" #: templates.hx:8 msgid "Furanose core" msgstr "Ядро на Фураноза" #: templates.hx:8 msgid "Ribofuranose" msgstr "Рибофураноза" #: templates.hx:8 msgid "Fructose" msgstr "Фруктоза" #: templates.hx:8 msgid "Galactose" msgstr "Галактоза" #: templates.hx:9 msgid "Glucose" msgstr "Глюкоза" #: templates.hx:9 msgid "Mannose" msgstr "Маноза" #: templates.hx:9 msgid "Fucose" msgstr "Фукоза" #: templates.hx:9 msgid "Xylose" msgstr "Ксилоза" #: templates.hx:9 msgid "Neuraminic acid" msgstr "Невраминова киселина" #: templates.hx:10 msgid "Sucrose" msgstr "Захароза" #: templates.hx:10 msgid "Maltose" msgstr "Малтоза" #: templates.hx:10 msgid "Lactose" msgstr "Лактоза" #: templates.hx:14 msgid "Adenine" msgstr "Аденин" #: templates.hx:14 msgid "Guanine" msgstr "Гуанин" #: templates.hx:14 msgid "Thymine" msgstr "Тимин" #: templates.hx:14 msgid "Cytosine" msgstr "Цитозин" #: templates.hx:14 msgid "Uracil" msgstr "Урацил" #: templates.hx:15 msgid "Porphine" msgstr "Порфин" #: templates.hx:15 msgid "Caffeine" msgstr "Кофеин" #: templates.hx:15 msgid "Evans auxiliary" msgstr "" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "" #: templates.hx:15 msgid "Imidazole" msgstr "Имидазол" #: templates.hx:16 msgid "Benzimidazole" msgstr "Бензимидазол" #: templates.hx:16 msgid "Pyrazole" msgstr "Пиразол" #: templates.hx:16 msgid "Diazole" msgstr "Диазол" #: templates.hx:17 msgid "Morphine" msgstr "Морфин" #: templates.hx:17 msgid "Morphine 3D" msgstr "Morphine 3D" #: templates.hx:23 msgid "Backbone" msgstr "" #: templates.hx:26 msgid "p orbital" msgstr "p-орбитала" #: templates.hx:26 msgid "plus" msgstr "плюс" #: templates.hx:26 msgid "minus" msgstr "минус" #: templates.hx:26 msgid "rearrangement" msgstr "преподреждане" #~ msgid "Help - somebody ate my atoms (hp->n=%d, da_root.next NULL)!!!\n" #~ msgstr "Ай! Кто-то съел мои атомы (hp->n=%d, da_root.next NULL)!!!\n" #~ msgid "Help - somebody ate my atoms (d=%d,hp->n=%d)!!!\n" #~ msgstr "Ай! Кто-то съел мои атомы (d=%d,hp->n=%d)!!!\n" #~ msgid "failed to load font %s !!!\n" #~ msgstr "не могу загрузить шрифт %s !!!\n" #~ msgid "Failed to load symbol font, using standard font\n" #~ msgstr "Не могу загрузить шрифт Symbol, использую обычный\n" #~ msgid "Error creating directory \"" #~ msgstr "Ошибка создания каталога \"" #~ msgid "Error deleting file \"" #~ msgstr "Ошибка при удалении файла \"" #~ msgid "Really delete file \"" #~ msgstr "Действительно удалить файл \"" #~ msgid "Error renaming file \"" #~ msgstr "Ошибка переименования файла \"" #~ msgid "Rename file \"" #~ msgstr "Переименовать файл \"" #~ msgid "\" to:" #~ msgstr "\" в: " #~ msgid "Name too long" #~ msgstr "Слишком длинное имя" #~ msgid "Chemtool Version " #~ msgstr "Версия Chemtool " #~ msgid "endless molfile???\n" #~ msgstr "бесконечный .MOL???\n" #~ msgid "expecting na %d nb %d\n" #~ msgstr "ожидаю na %d nb %d\n" #~ msgid "Molecule exported from chemtool\n" #~ msgstr "Молекула экспортирована из Chemtool\n" #~ msgid "undefined text direction in svg output\n" #~ msgstr "неопределенное направление текста в выводе svg\n" #~ msgid "no emf font parameters for zoom factor %d\n" #~ msgstr "отсутствуют параметры шрифта emf для масштаба %d\n" #~ msgid "undefined text direction in emf output\n" #~ msgstr "неопределенное направление текста в выводе emf\n" #~ msgid "no figfont parameters for zoom factor %d\n" #~ msgstr "отсутствуют параметры шрифта фигур для масштаба %d\n" #~ msgid "no figfont parameters for fontsize %d\n" #~ msgstr "отсутствуют параметры шрифта фигур для размера шрифта %d\n" #~ msgid "undefined text direction in xfig output\n" #~ msgstr "неопределенное направление текста в выводе xfig\n" #~ msgid "no translation for %d\n" #~ msgstr "не переведено: %d\n" #~ msgid "could not close fig file" #~ msgstr "не могу закрыть файл fig" #~ msgid "program cht not available or unable to write to" #~ msgstr "программа cht недоступна (возможно, по записи)" #~ msgid "File selection" #~ msgstr "Выбор файла" #~ msgid "_Configurable options" #~ msgstr "Изменяемые параметры" #~ msgid "Print _scale factor :" #~ msgstr "Масштаб при печати:" #~ msgid "No error" #~ msgstr "Нет ошибок" #~ msgid "Bad parameter passed to undo function" #~ msgstr "Функции отмены передан неверный параметр" #~ msgid "Out of memory" #~ msgstr "Не хватает памяти" #~ msgid "No active undo session" #~ msgstr "Нечего отменять" #~ msgid "Nothing to undo/redo" #~ msgstr "Нечего отменять/повторять" #~ msgid "No undoable memory limit set" #~ msgstr "Не установлен предел памяти на отмену" chemtool-1.6.14/po/pt_BR.po0000644000175000001440000007217112202261321014611 0ustar martinusers# CHEMTOOL. # Copyright (C) 2004 Free Software Foundation, Inc. # Flvio Massao Matsumoto , 2004. # msgid "" msgstr "" "Project-Id-Version: Chemtool 1.6.1\n" "Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: 2004-03-18 09:44BRST\n" "Last-Translator: Flvio M. Matsumoto \n" "Language-Team: Brazilian Portuguese\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" "A figura corrente no foi salva !\n" "Deseja realmente continuar ?" #: main.c:225 main.c:293 msgid "Yes" msgstr "Sim" #: main.c:240 main.c:308 msgid "No" msgstr "No" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" "Arquivo\n" "%s\n" "j existe !\n" "Sobrepor ?" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" "\n" "O prximo anel desenhado ter %d lados" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" "\n" "Importados %d ligaes e %d rtulos" #: main.c:1359 main.c:2667 main.c:5829 msgid "unnamed" msgstr "sem_nome" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" "\n" "Pronto" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" "\n" "Processo externo falhou - %s %s %s %s!" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" "\n" "Figura impressa!" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" "\n" "Erro na impresso da figura !" #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr "modo de ngulo invlido %d\n" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr "modo de texto invlido %d\n" #: main.c:2353 msgid "Load from file..." msgstr "Carregar do arquivo..." #: main.c:2394 msgid "Import MDL file..." msgstr "Importar arquivo MDL..." #: main.c:2434 msgid "Import via BABEL..." msgstr "Importar via BABEL" #: main.c:2456 msgid "Export via BABEL..." msgstr "Exportar via BABEL" #: main.c:2478 msgid "Import PDB file..." msgstr "Importar arquivo PDB..." #: main.c:2521 msgid "Add from file..." msgstr "Adicionar do arquivo..." #: main.c:2637 msgid "Save as..." msgstr "Salvar como..." #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" "\n" "Nada para salvar" #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" "\n" "Erro ao gravar para %s !" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" "\n" "Figura salva em %s (%d ligaes, %d rtulos)" #: main.c:2821 main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" "Erro ao gravar para\n" " %s !\n" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" "\n" "Figura exportada como %s (%d ligaes, %d rtulos)" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "" #: main.c:2979 main.c:3060 main.c:3101 main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr "No posso abrir %s\n" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" "%s\n" " no parecer ser um arquivo do Chemtool\n" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" "%s foi criado por uma verso mais nova.\n" "Algumas caractersticas podem se perder.\n" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr "Erro ao carregar %s \n" #: main.c:3048 main.c:3089 main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" "\n" "Escolha orientao (Ctrl-Mouse1 para z), pressione Enter quando pronto" #: main.c:3067 main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr "Problemas ao converter %s\n" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" "Figura salva em\n" " %s\n" " (%d ligaes, %d rtulos)\n" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" "Clique e arraste o mouse para desenhar ligaes na tela. \n" "O boto direito usado para apagar objetos, ligaes\n" "ou texto, dependendo do modo de edio que est ativo.\n" "\n" "Os botes com diferentes tipos de anis selecionam modos de edio com " "deter-\n" "minados ngulos, mas possvel desenhar em qualquer ngulo em todos os " "modos.\n" "\n" "O boto contendo uma linha segmentada permite desenhar curvas marcando-se\n" "pontos de controle ao longo da curva (um spline cbico).\n" "Voc pode selecionar o tipo de ligao e a cor usando botes apropriados\n" "ou mudar depois clicando na ligao desejada, no modo Ligaes.\n" "\n" "Para desenhar um sistema cclico, pressione Ctrl junto com a tecla\n" "do nmero correspondente ao nmero de lados do polgono, e ento\n" "desenhe uma dos lados enquanto pressiona a tecla Ctrl.\n" "\n" "Para adicinar rtulos, escreva-o na caixa de texto na parte superiordireita " "da janela\n" "e os posicione-os na tela com o mouse. Podem-se usar alguns atalhos de\n" "teclado para rtulos comuns durante o modo de desenho de ligao:\n" "Pressione a tecla 'c', or n, o, p, s, f para adicionar o smbolo do elemento " "na\n" "posio corrente de desenho, 1, 2 e 3 para CH, CH_2 e CH_3, l para Cl,\n" "e * para um ponto grande.\n" "\n" "As teclas do teclado numrico insere uma linha de 'par eletrnico'\n" "ao redor do smbolo do tomo na posio correspondente localizao\n" "da tecla ao redor do centro do teclado numrico (5).\n" "\n" "O modo texto usa os seguintes prefixos para formatao:\n" "_ para ndices, ^ for expoentes, @ para smbolos (caracteres gregos),\n" "| para caracteres em itlico e # para negrito.\n" "Quando a caixa de texto estiver vazia, ao clicar em qualquer rtulo na rea\n" "de desenho copia-se o rtulo na caixa para se poder usar de novo.\n" "\n" "O desenho feito mais facilmente com o mouse, mas se pode usar \n" "as teclas do cursor junto com o Ctrl para um posicionamento exato.\n" "Quando usado com a tecla Alt, as teclas do cursor move uma grade\n" "retangular ou hexagonal que pode ser projetado na rea de desenho.\n" "\n" "Se for necessria uma funo de desenho que no h no chemtool,\n" "exporte em formato fig e edite sua figura no programa xfig \n" "do Brian Smith. O trasfig/fig2dev que o acompanha necessrio para que\n" "o chemtool imprima e exporte para eps ou LaTeX, enquanto que o fig, \n" "XBM e SVG so gerado diretamente. Outro programa auxiliar til e " "recomendado\n" " o Babel - tanto na verso original, como no novo projeto Openabel. Em " "ambas\n" "as verses o chemtool capaz de importar dados de arquivos de formatos\n" "variados, enquanto somente a importao e a exportao em formato de " "arquivo\n" "mol est contido no programa chemtools.\n" "\n" "Mais ajuda pode ser encontrado na pgina de man do chemtool e no arquivo\n" "README includo no cdigo fonte ou ainda no site da web.\n" "Este arquivo normalmente encontrado em /usr/share/doc/packages/chemtool.\n" "Se voc encontrar algum bug, tem uma questo ou sugesto, favor contactar\n" "o autor principal, martin@ruby.chemie.uni-freiburg.de" #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" " Chemtool Verso 1.6.14\n" "por\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "e\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" #: main.c:3450 msgid "PDB labels:" msgstr "Rtulos PDB:" #: main.c:3453 msgid "All" msgstr "Todos" #: main.c:3461 msgid "non-H" msgstr "sem H" #: main.c:3470 msgid "no numbers" msgstr "sem nmeros" #: main.c:3479 msgid "non H,no numbers" msgstr "sem H, sem nmeros" #: main.c:3489 main.c:3833 main.c:4139 msgid "None" msgstr "Nenhum" #: main.c:3501 msgid "SDF entry:" msgstr "" #: main.c:3504 msgid "First" msgstr "" #: main.c:3511 msgid "Previous" msgstr "" #: main.c:3518 msgid "Next" msgstr "" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr "Escala Latex / EPS :" #: main.c:3708 msgid "Unknown error" msgstr "Erro desconhecido" #: main.c:3732 main.c:4010 msgid "Configurable options" msgstr "Opes configurveis" #: main.c:3767 msgid "_General" msgstr "" #: main.c:3788 msgid "Display" msgstr "" #: main.c:3794 msgid "Saving and Exporting" msgstr "" #: main.c:3800 msgid "Other" msgstr "" #: main.c:3811 msgid "_Background color:" msgstr "Cor do _fundo: " #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr "Adiciona retngulo _branco sob rtulos" #: main.c:3834 main.c:4148 msgid "EPSI" msgstr "" #: main.c:3835 main.c:4157 msgid "TIFF mono" msgstr "" #: main.c:3836 main.c:4165 msgid "TIFF color" msgstr "" #: main.c:3841 msgid "_Data directory:" msgstr "_Diretrio de dados:" #: main.c:3848 msgid "E_xtension:" msgstr "E_xtenso:" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr "Visualiza imagem a adicionar a arquivos _eps:" #: main.c:3863 main.c:4184 msgid "Support national character sets in labels" msgstr "" #: main.c:3883 msgid "Base bond _length:" msgstr "Comprimento de _ligao base:" #: main.c:3891 msgid "Double bond _separation:" msgstr "" #: main.c:3904 msgid "_Printing" msgstr "Imprimir" #: main.c:3934 main.c:4049 msgid "Portrait" msgstr "Vertical" #: main.c:3935 main.c:4054 msgid "Landscape" msgstr "Horizontal" #: main.c:3949 msgid "Print _command:" msgstr "_Comando de impresso:" #: main.c:3956 msgid "Printer _name:" msgstr "_Nome da impressora:" #: main.c:3963 msgid "Paper si_ze:" msgstr "_Tamanho de papel:" #: main.c:3970 msgid "_Orientation:" msgstr "_Orientao:" #: main.c:3977 msgid "Print sc_ale factor:" msgstr "E_scala de impresso:" #: main.c:3993 msgid "Select background color" msgstr "Seleciona cor de fundo" #: main.c:4019 msgid "Paper size:" msgstr "Tamanho de papel:" #: main.c:4044 msgid "Orientation:" msgstr "Orientao:" #: main.c:4069 msgid "Print scale factor :" msgstr "Escala de impresso:" #: main.c:4094 msgid "Print command:" msgstr "Comando de impresso:" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr "Visualiza imagem a adicionar a arquivos eps:" #: main.c:4198 msgid "Background color :" msgstr "Cor do fundo: " #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr "Adiciona retngulo branco sob rtulos" #: main.c:4225 msgid "Printer name:" msgstr "Nome da impressora:" #: main.c:4238 msgid "Data directory:" msgstr "Diretrio de dados:" #: main.c:4251 msgid "Extension:" msgstr "Extenso:" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr "Comprimento de ligao base (10,668mm):" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "" #: main.c:4298 msgid "Ok" msgstr "" #: main.c:4308 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "Cancela" #: main.c:4327 main.c:4912 msgid "Templates" msgstr "Moldes" #: main.c:4338 main.c:4340 msgid "Carbocycles" msgstr "Anis" #: main.c:4378 main.c:4380 msgid "Sugars" msgstr "Acares" #: main.c:4422 main.c:4424 msgid "Heterocycles" msgstr "Heterocclicos" #: main.c:4466 main.c:4468 msgid "Amino Acids" msgstr "Aminos-cido" #: main.c:4511 main.c:4513 msgid "Symbols" msgstr "Smbolos" #: main.c:4559 gtkfilesel.c:1196 msgid "Close" msgstr "Fechar" #: main.c:4605 msgid "New" msgstr "Novo" #: main.c:4613 msgid "Open" msgstr "Abrir" #: main.c:4621 main.c:4904 msgid "Add" msgstr "Adicionar" #: main.c:4629 msgid "Import MOL" msgstr "Importar MOL" #: main.c:4637 msgid "Import PDB" msgstr "Importar PDB" #: main.c:4645 msgid "Import (Babel)" msgstr "Importar (Babel)" #: main.c:4653 msgid "Export..." msgstr "Exportar..." #: main.c:4661 msgid "Export (Babel)" msgstr "Exportar (Babel)" #: main.c:4670 main.c:4941 msgid "Print" msgstr "Imprimir" #: main.c:4678 msgid "Setup Defaults" msgstr "Configurao padro" #: main.c:4693 main.c:4960 msgid "Save Config" msgstr "Salvar config" #: main.c:4702 main.c:4921 msgid "Save" msgstr "Salvar" #: main.c:4710 msgid "Save As..." msgstr "Salvar como..." #: main.c:4719 main.c:5031 msgid "Quit" msgstr "Sair" #: main.c:4727 msgid "File" msgstr "Arquivo" #: main.c:4734 msgid "Copy" msgstr "Copiar" #: main.c:4746 msgid "Flip horizontally" msgstr "Reflexo horizontal" #: main.c:4752 msgid "Flip vertically" msgstr "Reflexo vertical" #: main.c:4759 msgid "Undo" msgstr "Desfazer" #: main.c:4767 msgid "Redo" msgstr "Refazer" #: main.c:4777 msgid "Edit" msgstr "Editar" #: main.c:4784 msgid "Zoom in" msgstr "Ampliar" #: main.c:4790 msgid "Zoom out" msgstr "Reduzir" #: main.c:4801 main.c:4996 msgid "Center" msgstr "Centralizar" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr "Grade retang/hexag/deslig" #: main.c:4815 msgid "View" msgstr "Exibio" #: main.c:4823 msgid "Templates..." msgstr "Moldes..." #: main.c:4832 msgid "Calculate Formula Weight" msgstr "Calcular Massa Molecular" #: main.c:4840 msgid "Clean up drawing" msgstr "Organizar figura" #: main.c:4846 msgid "Tools" msgstr "Ferramentas" #: main.c:4854 main.c:5039 msgid "About" msgstr "Sobre" #: main.c:4863 main.c:4872 msgid "Help" msgstr "Ajuda" #: main.c:4895 msgid "Load" msgstr "Carregar" #: main.c:4900 msgid "Load a chemtool sketch" msgstr "Carrega uma figura do Chemtool" #: main.c:4909 msgid "Add fragment from file" msgstr "Adiciona fragmento do arquivo" #: main.c:4918 msgid "Add template structure" msgstr "Adiciona estrutura do molde" #: main.c:4926 msgid "Save sketch to file" msgstr "Salva desenho para arquivo" #: main.c:4929 msgid "Export" msgstr "Exportar" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "Cria arquivo EPS, XFig, PicTeX ou XBM" #: main.c:4947 msgid "Print file to a postscript printer" msgstr "Imprime um arquivo para impressora postscript" #: main.c:4950 msgid "Setup" msgstr "" #: main.c:4957 msgid "Setup default options" msgstr "Configurao padro" #: main.c:4966 msgid "Save default options" msgstr "" #: main.c:4969 msgid "Import" msgstr "Importar" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr "L um arquivo em formato MDL/molfile" #: main.c:4978 msgid "ImportPDB" msgstr "ImportarPDB" #: main.c:4984 msgid "Read a file written in PDB format" msgstr "L um arquivo em formato PDB" #: main.c:4987 msgid "Zoom In" msgstr "Ampliar" #: main.c:4992 msgid "Increase zoom scale" msgstr "Amplia escala de zoom" #: main.c:5002 msgid "Center molecule in drawing area" msgstr "Centraliza molcula na rea de desenho" #: main.c:5005 msgid "Zoom Out" msgstr "Reduzir" #: main.c:5010 msgid "Decrease zoom scale" msgstr "Reduz escala de zoom" #: main.c:5014 msgid "Clear" msgstr "Limpar" #: main.c:5019 msgid "Remove molecule" msgstr "Remove molcula" #: main.c:5022 msgid "FW" msgstr "MM" #: main.c:5027 msgid "Calculate Formula Mass" msgstr "Calcula Massa Molecular" #: main.c:5036 msgid "Exit Chemtool" msgstr "Sai do Chemtool" #: main.c:5045 msgid "About Chemtool" msgstr "Sobre Chemtool" #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr "Desenha em ngulos de 0/30/60/90 graus" #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr "Desenha em ngulos de 0/36/72/... graus" #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr "Desenha em ngulos de 18/54/90/... graus" #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr "Desenha em ngulos de 0/45/90/... graus" #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr "Desenha curva baseada em 4 pontos de controle" #: main.c:5174 msgid "Draw left-justified text" msgstr "Insere texto alinhado esquerda" #: main.c:5191 msgid "Draw centered text" msgstr "Insere texto centralizado" #: main.c:5208 msgid "Draw right-justified text" msgstr "Insere texto alinhado direita" #: main.c:5236 msgid "Set current textfont" msgstr "Seleciona fonte do texto" #: main.c:5266 msgid "Choose default bond type" msgstr "Escolhe tipo de ligao padro" #: main.c:5283 msgid "Select pen color" msgstr "Seleciona cor da pena" #: main.c:5288 msgid "Bonds" msgstr "Ligaes" #: main.c:5293 msgid "Toggle bond types" msgstr "Muda tipos de ligaes" #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr "Marca objeto para mover, girar ou apagar" #: main.c:5327 msgid "Move marked object" msgstr "Move objetos marcados" #: main.c:5344 msgid "Rotate marked object" msgstr "Gira objetos marcados" #: main.c:5363 msgid "Flip object horizontally" msgstr "Reflete objeto horizontalmente" #: main.c:5381 msgid "Flip object vertically" msgstr "Reflete objeto verticalmente" #: main.c:5407 msgid "Copy marked object" msgstr "Copia objetos marcados" #: main.c:5422 msgid "Rescale marked object" msgstr "Muda escala de objetos marcados" #: main.c:5441 msgid "Draw brackets around object" msgstr "Desenha colchetes ao redor do objeto" #: main.c:5456 msgid "Draw rounded brackets around object" msgstr "Desenha parnteses ao redor do objeto" #: main.c:5471 msgid "Draw round brackets around object" msgstr "Desenha parnteses ao redor do objeto" #: main.c:5486 msgid "Draw braces around object" msgstr "Desenha chaves ao redor do objeto" #: main.c:5501 msgid "Draw simple box around object" msgstr "Desenha retngulo simples ao redor do objeto" #: main.c:5515 msgid "Draw shaded box around object" msgstr "Desenha retngulo sombreado ao redor do objeto" #: main.c:5529 msgid "Draw fancy box around object" msgstr "Desenha retngulo 3D ao redor do objeto" #: main.c:5543 msgid "Draw rounded box around object" msgstr "Desenha retngulo arredondado ao redor do objeto" #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr "Desenha colchetes e retngulos ao redor do objeto" #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr "Remove ligaes duplicadas, etc." #: main.c:5605 msgid "Text :" msgstr "Texto: " #: main.c:5619 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "" "Anteceda um caractere com _ para ndice, ^ para expoente, @ para smbolos, | " "para itlico, # para negrito; e.g. H_2O, @a_D^2^0" #: main.c:5624 msgid "Select current text size" msgstr "Seleciona tamanho da fonte" #: main.c:5753 #, c-format msgid "Ready" msgstr "Pronto" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "chemtool: no posso carregar nenhuma fonte\n" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr "Problema de alocao de memria (SIGSEGV) -" #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr "Operao matemtica invlida (SIGFPE) -" #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr "Problema de alocao de memria (SIGBUS) -" #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr "Ordenado para sair (SIGHUP) -" #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr " salvando figura corrente para crashdump.cht\n" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "Examinando:" #: gtkfilesel.c:796 msgid "Directories" msgstr "Diretrios" #: gtkfilesel.c:825 msgid "Mask:" msgstr "Mscara:" #: gtkfilesel.c:838 msgid "Files" msgstr "Arquivos" #: gtkfilesel.c:872 msgid "OK" msgstr "" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "Diretrio inacessvel: %s" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "Criar dir" #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr "Apagar arquivo" #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr "Renomear arquivo" #: gtkfilesel.c:1173 msgid "Error" msgstr "Erro" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "Criar diretrio" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "Nome do diretrio:" #: gtkfilesel.c:1297 msgid "Create" msgstr "Criar" #: gtkfilesel.c:1397 msgid "Delete" msgstr "Apagar" #: gtkfilesel.c:1512 msgid "Rename" msgstr "Renomear" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "Seleo: " #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr "Favor instalar Babel/OpenBabel para converses de arquivos...\n" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "Ciclopentadienilo" #: templates.hx:2 msgid "Benzene" msgstr "Benzeno" #: templates.hx:2 msgid "Naphthalene" msgstr "Naftaleno" #: templates.hx:2 msgid "Azulene" msgstr "Azuleno" #: templates.hx:3 msgid "Adamantane" msgstr "Adamantano" #: templates.hx:3 templates.hx:5 msgid "Cyclohexane" msgstr "Cicloexano" #: templates.hx:3 msgid "Steroid backbone" msgstr "Esqueleto de esteride" #: templates.hx:3 msgid "Cycloheptatriene" msgstr "Cicloeptatrieno" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "Cicloctatetraeno" #: templates.hx:4 msgid "Fluorene" msgstr "Fluoreno" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "Espiro[4.5]decano" #: templates.hx:4 msgid "Heptalene" msgstr "Heptaleno" #: templates.hx:4 msgid "Fulvalene" msgstr "Fulvaleno" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "Diciclopentadieno" #: templates.hx:5 msgid "Indene" msgstr "Indeno" #: templates.hx:5 msgid "Biphenyl" msgstr "Bifenila" #: templates.hx:5 msgid "Norbornane" msgstr "Norbornano" #: templates.hx:5 msgid "Binaphthyl" msgstr "Binaftila" #: templates.hx:6 msgid "Coronene" msgstr "Coroneno" #: templates.hx:8 msgid "Pyranose core" msgstr "Esqueleto de piranose" #: templates.hx:8 msgid "Furanose core" msgstr "Esqueleto de furanose" #: templates.hx:8 msgid "Ribofuranose" msgstr "Ribofuranose" #: templates.hx:8 msgid "Fructose" msgstr "Frutose" #: templates.hx:8 msgid "Galactose" msgstr "Galactose" #: templates.hx:9 msgid "Glucose" msgstr "Glicose" #: templates.hx:9 msgid "Mannose" msgstr "Manose" #: templates.hx:9 msgid "Fucose" msgstr "" #: templates.hx:9 msgid "Xylose" msgstr "Xilose" #: templates.hx:9 msgid "Neuraminic acid" msgstr "cido neuramnico" #: templates.hx:10 msgid "Sucrose" msgstr "Sacarose" #: templates.hx:10 msgid "Maltose" msgstr "" #: templates.hx:10 msgid "Lactose" msgstr "" #: templates.hx:14 msgid "Adenine" msgstr "Adenina" #: templates.hx:14 msgid "Guanine" msgstr "Guanina" #: templates.hx:14 msgid "Thymine" msgstr "Timina" #: templates.hx:14 msgid "Cytosine" msgstr "Citosina" #: templates.hx:14 msgid "Uracil" msgstr "Uracila" #: templates.hx:15 msgid "Porphine" msgstr "Porfina" #: templates.hx:15 msgid "Caffeine" msgstr "Cafena" #: templates.hx:15 msgid "Evans auxiliary" msgstr "" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "" #: templates.hx:15 msgid "Imidazole" msgstr "" #: templates.hx:16 msgid "Benzimidazole" msgstr "" #: templates.hx:16 msgid "Pyrazole" msgstr "" #: templates.hx:16 msgid "Diazole" msgstr "" #: templates.hx:17 msgid "Morphine" msgstr "" #: templates.hx:17 msgid "Morphine 3D" msgstr "" #: templates.hx:23 msgid "Backbone" msgstr "" #: templates.hx:26 msgid "p orbital" msgstr "Orbital p" #: templates.hx:26 msgid "plus" msgstr "mais" #: templates.hx:26 msgid "minus" msgstr "menos" #: templates.hx:26 msgid "rearrangement" msgstr "rearranjo" #~ msgid "Help - somebody ate my atoms (hp->n=%d, da_root.next NULL)!!!\n" #~ msgstr "" #~ "Socorro - algum comeu meus tomos (hp->n=%d, da_root.next NULL)!!!\n" #~ msgid "Help - somebody ate my atoms (d=%d,hp->n=%d)!!!\n" #~ msgstr "Socorro - algum comeu meus tomos (d=%d,hp->n=%d)!!!\n" #~ msgid "failed to load font %s !!!\n" #~ msgstr "erro ao carregar a fonte %s !!!\n" #~ msgid "Failed to load symbol font, using standard font\n" #~ msgstr "Erro ao carregar fonte de smbolos, ser usada fonte padro\n" #~ msgid "Error creating directory \"" #~ msgstr "Erro ao criar diretrio \"" #~ msgid "Error deleting file \"" #~ msgstr "Erro ao apagar arquivo \"" #~ msgid "Really delete file \"" #~ msgstr "Realmente apagar arquivo \"" #~ msgid "Error renaming file \"" #~ msgstr "Erro ao renomear arquivo \"" #~ msgid "Rename file \"" #~ msgstr "Renomear arquivo \"" #~ msgid "\" to:" #~ msgstr "\" para:" #~ msgid "Name too long" #~ msgstr "Nome muito longo" #~ msgid "Chemtool Version " #~ msgstr "Chemtool Verso" #~ msgid "endless molfile???\n" #~ msgstr "arquivo mol sem fim???\n" #~ msgid "expecting na %d nb %d\n" #~ msgstr "esperando na %d nb %d\n" #~ msgid "Molecule exported from chemtool\n" #~ msgstr "Molcula exportada do chemtool\n" #~ msgid "" #~ "\n" #~ "Created with Chemtool 1.6.9 from file %s \n" #~ "\n" #~ msgstr "" #~ "\n" #~ "Criado com Chemtool 1.6.9 a partir do arquivo %s \n" #~ "\n" #~ msgid "undefined text direction in svg output\n" #~ msgstr "direo de texto indefinido na sada svg\n" #~ msgid "Created by" #~ msgstr "Criado por" #~ msgid "no emf font parameters for zoom factor %d\n" #~ msgstr "sem parmetros de font emf para fator de ampliao %d\n" #~ msgid "undefined text direction in emf output\n" #~ msgstr "direo de texto indefinido na sada emf\n" #~ msgid "no figfont parameters for zoom factor %d\n" #~ msgstr "sem parmetros figfont para fator de ampliao %d\n" #~ msgid "# generated by Chemtool " #~ msgstr "# gerado por Chemtool" #~ msgid "no figfont parameters for fontsize %d\n" #~ msgstr "sem parmetros figfont para tamanho de fonte %d\n" #~ msgid "undefined text direction in xfig output\n" #~ msgstr "direo de texto indefinido na sada xfig\n" #~ msgid "no translation for %d\n" #~ msgstr "sem traduo para %d\n" #~ msgid "could not close fig file" #~ msgstr "no foi fechado arquivo fig" #~ msgid "Chemtool 1.6.9" #~ msgstr "Chemtool 1.6.9" #~ msgid "program cht not available or unable to write to" #~ msgstr "programa cht no disponvel ou no pde gravar em" #~ msgid "Chemtool 1.6.9 (%s)" #~ msgstr "Chemtool 1.6.9 (%s)" #~ msgid "File selection" #~ msgstr "Seleo de arquivo" #~ msgid "_Configurable options" #~ msgstr "Opes _configurveis" #~ msgid "No error" #~ msgstr "Sem erros" #~ msgid "Bad parameter passed to undo function" #~ msgstr "Parmetro errado para funo desfazer" #~ msgid "Out of memory" #~ msgstr "Sem memria" #~ msgid "No active undo session" #~ msgstr "Sem sesso para desfazer ativa" #~ msgid "Nothing to undo/redo" #~ msgstr "Nada para desfazer/refazer" #~ msgid "No undoable memory limit set" #~ msgstr "Sem limite de memria para desfazer" chemtool-1.6.14/po/ru.gmo0000666000175000001440000004636412202261360014411 0ustar martinusersl9>-* K%f #/*>7= LW(['%B JU^dm  ##C)#m#r### ##$## ##$$$/$C$ J$V$ h$t$$ $!$ $"%$%%>%d%%%%%%%! &+&#J&n&&,& &&&& '''%' 9' C'N'Q''V'~'''''''' ' ' (((-(5( :( D(Q(X(g( z( ((( (((!(( ))+)0)G) Y)e)m)-u)) )%)) ***#*&* +*6*9*<*A* ]* j* v* ***}*#+#C+g+m+}+"++++ ++ ,,)!,!K,m,s,x,,, ,, ,,, , - --,-E- V-b-w------- - - - -.C.L.T.f.l.. ............ / / /?/V/l/ r/}// // /b/;15P1 101101$ 2)/2Y2k2s22.L3{3D33 3 33#3#"4F4a4v4444 44 44444555.5 55@5F5\5s55 5??;? ??@@&@6@&F@m@ }@@@@@@@ @@@ AA&*A'QA(yA(AAAB&B=B YBzBBBBB C'C2CC vCCCCCCCC C CDD( D5D;D UDvDDDDD D D DD DDE E E!E(E7E QE \EgEE EEE*EEEEFF1FCFJFSF7[FF#F*FFGG&G,G0G 4G>GAGDGLG hG tGGGGGzG:'H:bHHHHHHH I II?INITIkI~I II"I II I JJ .J8JIJ]JnJ J JJ JJJJJKKK K *K 6K @KMK(TK}KK KKKKKKKL LLLLL L)L U`Smh Choose orientation (Ctrl-Mouse1 for z), press Enter when done Drawing exported as %s (%d bonds, %d labels) Drawing printed! Drawing saved in %s (%d bonds, %d labels) Failed to print drawing ! Helper process failed - %s %s %s %s! Imported %d bonds and %d labels Next ring drawn will have %d sides Nothing to save Ready Writing to %s failed ! Chemtool Version 1.6.14 by Martin Kroeker, Radek Liboska, Michael Banck and Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dumping current drawing to file crashdump.cht %s does not appear to be a Chemtool file %s was created by a newer version. Some features may be lost. AboutAbout ChemtoolAdamantaneAddAdd filled _white rectangle under labelsAdd filled white rectangle under labelsAdd fragment from fileAdd from file...Add template structureAdenineAllAzuleneBackground color :Base bond _length:Base bondlength (10.668mm) :BenzeneBinaphthylBiphenylBondsCaffeineCalculate Formula MassCalculate Formula WeightCancelCarbocyclesCenterCenter molecule in drawing areaChoose default bond typeClean up drawingClearClick and drag the mouse to draw bonds on the canvas. The right mouse button is used to delete objects - either bonds or text depending on which drawing mode is active. The buttons with different ringtypes on them select drawing modes with preferred angles, but you can actually draw at any angle in all modes. The button with the segmented line on it lets you draw curves by marking control points along the curve (a cubic spline). You can select the bondtype and color using the appropriate button or change them later by clicking on the desired bond in Bonds mode. To draw a cyclic system, simply press the Ctrl key together with the number key corresponding to the number of sides for the polygon, and then draw one side while pressing the Ctrl button. For drawing labels, write them into the text box in the top right of the window and place them on the canvas with the mouse. You can also use a number of keyboard shortcuts for common labels while in bond drawing mode: Simply press the 'c' key, or n,o,p,s,f to add the element symbol at the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl, * for a big dot. The keys of the numeric keypad each insert an 'electron pair' line around an atom symbol in the position corresponding to the location of the key around the center of the numeric keypad. The text mode uses the following prefixes for special text: _ for subscripts, ^ for superscripts, @ for symbols (greek characters), | for italic (slanted) characters and # for bold text. When the text box is empty, clicking on any label in the drawing area copies that label into the box for reuse. Drawing is best done with the mouse, but you can also use the cursor keys in combination with the Ctrl key for exact positioning. When used with the Alt key, the cursor keys move the rectangular or rhombic grid that can be projected on the drawing area. If you need general drawing functions not provided by chemtool, try exporting to fig format and editing your figure in Brian Smith's xfig program. Its companion transfig/fig2dev is required by chemtool for printing and for exporting to eps or LaTeX, while the fig, XBM and SVG output are generated directly. Another useful and highly recommended helper program is Babel - either in its original version, or in the form of the new OpenBabel project. Using either version, chemtool is able to import foreign data from a variety of file formats, while only molfile im- and export is built into chemtool. More help is available in the manual page for chemtool and in the file README included in the source distribution as well as on the website. This should normally get installed in /usr/share/doc/packages/chemtool. If you find any bugs or have a question or suggestion, please contact the main author, martin@ruby.chemie.uni-freiburg.deCloseConfigurable optionsConsider installing Babel/OpenBabel for file format conversions... CopyCopy marked objectCoroneneCreateCreate DirCreate DirectoryCreate EPS, XFig, PicTeX or XBM fileCycloheptatrieneCyclohexaneCyclooctatetraeneCyclopentadienylCytosineData directory:Decrease zoom scaleDeleteDelete FileDicyclopentadieneDirectoriesDirectory name:Directory unreadable: %sDraw at 0/30/60/90 degree anglesDraw at 0/36/72/... degree anglesDraw at 0/45/90... degree anglesDraw at 18/54/90/... degree anglesDraw braces around objectDraw brackets and boxes around objectDraw brackets around objectDraw centered textDraw curves based on 4 control pointsDraw fancy box around objectDraw left-justified textDraw right-justified textDraw round brackets around objectDraw rounded box around objectDraw rounded brackets around objectDraw shaded box around objectDraw simple box around objectDrawing saved in %s (%d bonds, %d labels) E_xtension:EditErrorError loading %s Exit ChemtoolExportExport (Babel)Export via BABEL...Export...Extension:FWFileFile %s already exists ! Overwrite it ?FilesFlip horizontallyFlip object horizontallyFlip object verticallyFlip verticallyFluoreneFructoseFucoseFulvaleneFuranose coreGalactoseGlucoseGrid rect/rhomb/offGuanineHelpHeptaleneHeterocyclesImportImport (Babel)Import MDL file...Import MOLImport PDBImport PDB file...Import via BABEL...ImportPDBIncrease zoom scaleIndeneInvalid math somewhere (SIGFPE) -LactoseLandscapeLatex / EPS scale factor :LoadLoad a chemtool sketchLoad from file...Looking in:MaltoseMannoseMark objects for moving, rotating or deletingMask:Memory access problem (SIGBUS) -Memory allocation problem (SIGSEGV) -Move marked objectNaphthaleneNeuraminic acidNewNoNoneNorbornaneOKOkOpenOrdered to quit (SIGHUP) - Orientation:PDB labels:Paper si_ze:Paper size:PorphinePortraitPrefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0Preview image to add to _EPS files:Preview image to add to eps files :PrintPrint _command:Print command:Print file to a postscript printerPrint sc_ale factor:Print scale factor :Printer _name:Printer name:Problems converting %s Pyranose coreQuitRead a file written in MDL/molfile formatRead a file written in PDB formatReadyRedoRemove moleculeRemoves duplicate bonds, etc.RenameRename FileRescale marked objectRibofuranoseRotate marked objectSaveSave As...Save ConfigSave as...Save sketch to fileSelect current text sizeSelect pen colorSelection: Set current textfontSetup DefaultsSetup default optionsSpiro[4.5]decaneSteroid backboneSucroseSugarsSymbolsTIFF colorTIFF monoTemplatesTemplates...Text :The current drawing is not saved ! Do you really wish to continue ?ThymineToggle bond typesToolsUnable to open %s UndoUnknown errorUracilViewWriting to %s failed ! XyloseYesZoom InZoom OutZoom inZoom out_Background color:_Data directory:_Orientation:_Printingchemtool: can't load any font invalid angle mode %d invalid text mode %d minusno numbersnon H,no numbersnon-Hp orbitalplusrearrangementProject-Id-Version: chemtool 1.6rc Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de POT-Creation-Date: 2007-05-23 23:58+0200 PO-Revision-Date: 2003-06-27 00:54+0300 Last-Translator: Michael Shigorin Language-Team: russian MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit (Ctrl-Mouse1 z), Enter %s (: %d, : %d) ! %s (: %d, : %d) ! - %s %s %s %s! : %d, : %d : %d %s ! Chemtool Version 1.6.14 : Martin Kroeker, Radek Liboska, Michael Banck Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html : crashdump.cht %s Chemtool %s . . ? ... : (10.668): . - , ( ). , . () . . , Ctrl , , ( Ctrl). ( ) . ( ): 'c' n,o,p,s,f , 1,2,3 CH, CH_2 CH_3 , 'l' Cl '*' - . ' ' ( - '5'). : '_' '^' , '@' - , '|' - '#' - . , . , ( Ctrl ). Alt . , chemtool, fig xfig ( - Brian Smith). - transfig/fig2dev - chemtool eps LaTeX, fig, xbm svg . Babel - OpenBabel. chemtool , chemtool mol /. man- chemtool, README, . - , , martin@ruby.chemie.uni-freiburg.de Babel/OpenBabel ... EPS, XFig, PicTeX XBM : : : %s 0/30/60/90 0/36/72/... 18/54/90/... 18/54/90/... () 4 ( ) ( ) %s (: %d, : %d) : %s Chemtool (Babel) Babel......:M %s ! ? 4/6/ (Babel) MDL-... MOL PDB PDB-... Babel... PDB - (SIGFPE) - LaTeX/EPS: Chemtool ... : , : (SIGBUS) - (SIGSEGV) - (SIGHUP) - : PDB: : : : _ , ^ - , @ - ,| - , # - . , H_2O, @a_D^2^0 eps- : eps- : : : PS- : : : : %s MDL MOL- PDB- .. ... ... Chemtool : [4.5] TIFF ()TIFF ()...: ! ? %s %s ! [+][-][+][-] ::chemtool: %d %d -H, -Hp-chemtool-1.6.14/po/de.gmo0000666000175000001440000005065212202261360014346 0ustar martinusers=>-0^*p% #!29Q/*>H  (' 4K\s{  $07Wp ###### ##$#$ #$/$A$R$[$k$$ $$ $$$$!$ %!5% W%"x%%%%%%% &0&M&f&!&&#&&',!' N'Z'_'e'x' '' '''''''''(.(>(G(P( W( a( o(y(((( ( (((( ( (( ))))!0)R) Z)d)))) )))-)) )%*D* M*Y* l*x***** ***** * * * **+}+#+#+++++",&,;,P, _,m, ,,),!,,,,,- $-0-F-[- j- u-- - - -----. .!.6.E.[.l.}..).. . .C./!/3/9/L/ Q/_/d/}///////// / // 00*0 00 :0H0uP0C15 2@27U2)2%2%2/333H3%P3v3-42A4Tt444 4 5 5 5&5/5G5/^55)555 5556"6?6F6J6*R6}66 6 6,6667\ 7 rB }BBBBBBB0BC *C5CFCWC_CvCC CC CCCC! D)/D&YD&D'D/D5D*5E`E,zE/EEE)F*:F)eF0F#F6F G )G4G;G[GjG{G GGG*GGGG#G$H7HJHRH[HbHkH zHHHHHH HHH H H H H II1I7IOI WI#bIIIIIII3IJ!!J%CJiJ qJ|J J JJJJJ JJJJJ K KK 'K5K =K~HK K K LL L 'L14LfLzL L L&LLL8L0MNM UMaM?zM MM'MM N 'N4N DNNN_NwNN)NNNN OO 4O BOPO `O nOyO,OOO OUO P'P YR ko-~%?8 :5EhK<"2+`3dX b0v}$4UrB ifTJx@PnV(g[)G#j{_wyu1|e9QsZ^C/q!=Nc*M'lDH&WpA, ]7\;O Choose orientation (Ctrl-Mouse1 for z), press Enter when done Drawing exported as %s (%d bonds, %d labels) Drawing printed! Drawing saved in %s (%d bonds, %d labels) Failed to print drawing ! Helper process failed - %s %s %s %s! Imported %d bonds and %d labels Next ring drawn will have %d sides Nothing to save Ready Writing to %s failed ! Chemtool Version 1.6.14 by Martin Kroeker, Radek Liboska, Michael Banck and Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dumping current drawing to file crashdump.cht %s does not appear to be a Chemtool file %s was created by a newer version. Some features may be lost. DisplayOtherSaving and ExportingAboutAbout ChemtoolAdamantaneAddAdd filled _white rectangle under labelsAdd filled white rectangle under labelsAdd fragment from fileAdd from file...Add template structureAdenineAllAmino AcidsAzuleneBackground color :Base bond _length:Base bondlength (10.668mm) :BenzeneBondsCaffeineCalculate Formula MassCalculate Formula WeightCancelCarbocyclesCenterCenter molecule in drawing areaChoose default bond typeClean up drawingClearClick and drag the mouse to draw bonds on the canvas. The right mouse button is used to delete objects - either bonds or text depending on which drawing mode is active. The buttons with different ringtypes on them select drawing modes with preferred angles, but you can actually draw at any angle in all modes. The button with the segmented line on it lets you draw curves by marking control points along the curve (a cubic spline). You can select the bondtype and color using the appropriate button or change them later by clicking on the desired bond in Bonds mode. To draw a cyclic system, simply press the Ctrl key together with the number key corresponding to the number of sides for the polygon, and then draw one side while pressing the Ctrl button. For drawing labels, write them into the text box in the top right of the window and place them on the canvas with the mouse. You can also use a number of keyboard shortcuts for common labels while in bond drawing mode: Simply press the 'c' key, or n,o,p,s,f to add the element symbol at the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl, * for a big dot. The keys of the numeric keypad each insert an 'electron pair' line around an atom symbol in the position corresponding to the location of the key around the center of the numeric keypad. The text mode uses the following prefixes for special text: _ for subscripts, ^ for superscripts, @ for symbols (greek characters), | for italic (slanted) characters and # for bold text. When the text box is empty, clicking on any label in the drawing area copies that label into the box for reuse. Drawing is best done with the mouse, but you can also use the cursor keys in combination with the Ctrl key for exact positioning. When used with the Alt key, the cursor keys move the rectangular or rhombic grid that can be projected on the drawing area. If you need general drawing functions not provided by chemtool, try exporting to fig format and editing your figure in Brian Smith's xfig program. Its companion transfig/fig2dev is required by chemtool for printing and for exporting to eps or LaTeX, while the fig, XBM and SVG output are generated directly. Another useful and highly recommended helper program is Babel - either in its original version, or in the form of the new OpenBabel project. Using either version, chemtool is able to import foreign data from a variety of file formats, while only molfile im- and export is built into chemtool. More help is available in the manual page for chemtool and in the file README included in the source distribution as well as on the website. This should normally get installed in /usr/share/doc/packages/chemtool. If you find any bugs or have a question or suggestion, please contact the main author, martin@ruby.chemie.uni-freiburg.deCloseConfigurable optionsCopyCopy marked objectCoroneneCreateCreate DirCreate DirectoryCreate EPS, XFig, PicTeX or XBM fileCycloheptatrieneCyclohexaneCyclooctatetraeneCyclopentadienylCytosineData directory:Decrease zoom scaleDeleteDelete FileDicyclopentadieneDirectoriesDirectory name:Directory unreadable: %sDouble bond _separation:Doublebond separation (4 pixel) :Draw at 0/30/60/90 degree anglesDraw at 0/36/72/... degree anglesDraw at 0/45/90... degree anglesDraw at 18/54/90/... degree anglesDraw braces around objectDraw brackets and boxes around objectDraw brackets around objectDraw centered textDraw curves based on 4 control pointsDraw fancy box around objectDraw left-justified textDraw right-justified textDraw round brackets around objectDraw rounded box around objectDraw rounded brackets around objectDraw shaded box around objectDraw simple box around objectDrawing saved in %s (%d bonds, %d labels) E_xtension:EditErrorError loading %s Evans auxiliaryExit ChemtoolExport (Babel)Extension:FWFileFile %s already exists ! Overwrite it ?FilesFirstFlip horizontallyFlip object horizontallyFlip object verticallyFlip verticallyFluoreneFructoseFucoseFulvaleneFuranose coreGalactoseGlucoseGrid rect/rhomb/offGuanineHelpHeptaleneHeterocyclesImportImport (Babel)Import MDL file...Import MOLImport PDBImport PDB file...ImportPDBIncrease zoom scaleIndeneInvalid math somewhere (SIGFPE) -LactoseLandscapeLatex / EPS scale factor :LoadLoad a chemtool sketchLoad from file...Looking in:MaltoseMannoseMark objects for moving, rotating or deletingMask:Memory access problem (SIGBUS) -Memory allocation problem (SIGSEGV) -MorphineMorphine 3DMove marked objectNaphthaleneNeuraminic acidNewNextNoNoneNorbornaneOKOkOpenOrdered to quit (SIGHUP) - Orientation:PDB labels:Paper si_ze:Paper size:PorphinePortraitPrefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0Preview image to add to _EPS files:Preview image to add to eps files :PreviousPrintPrint _command:Print command:Print file to a postscript printerPrint sc_ale factor:Print scale factor :Printer _name:Printer name:Problems converting %s Pyranose coreQuitRead a file written in MDL/molfile formatRead a file written in PDB formatReadyRedoRemove moleculeRemoves duplicate bonds, etc.RenameRename FileRescale marked objectRotate marked objectSAMP auxiliarySDF entry:SDF entry: %dSaveSave As...Save ConfigSave as...Save default optionsSave sketch to fileSelect background colorSelect current text sizeSelect pen colorSelection: Set current textfontSetup DefaultsSetup default optionsSpiro[4.5]decaneSteroid backboneSucroseSugarsSupport national character sets in labelsSymbolsTemplatesTemplates...The current drawing is not saved ! Do you really wish to continue ?ThymineToggle bond typesToolsUnable to open %s UndoUnknown errorViewWriting to %s failed ! XyloseYesZoom InZoom OutZoom inZoom out_Background color:_Data directory:_General_Orientation:_Printingchemtool: can't load any font no numbersnon H,no numbersnon-Hp orbitalrearrangementunnamedProject-Id-Version: chemtool 1.6.11 Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de POT-Creation-Date: 2007-05-23 23:58+0200 PO-Revision-Date: 2007-04-15 18:52+0200 Last-Translator: Martin Kroeker Language-Team: de MIME-Version: 1.0 Content-Type: text/plain; charset=iso_8859-1 Content-Transfer-Encoding: iso_8859-1 Orientierung whlen (Strg-Maus1 fr z), mit Eingabetaste festlegen Zeichnung als %s exportiert (%d Bindungen, %d Texte) Zeichnung gedruckt! Zeichnung als %s gespeichert (%d Bindungen, %d Texte) Zeichnung konnte nicht gedruckt werden ! Hilfsprogramm versagte -%s %s %s %s! %d Bindungen und %d Texte importiert Der nchste Ring wird mit %d Seiten gezeichnet Nichts zu speichern Bereit %s konnte nicht geschrieben werden ! Chemtool Version 1.6.14 von Martin Kroeker, Radek Liboska, Michael Banck und Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.htmlsichere aktuelle Zeichnung als crashdump.cht %s scheint keine Chemtool-Zeichnungsdatei zu sein %s wurde mit einer neueren Version erstellt. Mglicherweise gehen Details verloren. AnzeigeSonstigeSpeichern und Exportierenberber ChemtoolAdamantanEinfgenTexte _weiss unterlegenTexte weiss unterlegenFgt ein Strukturfragment aus einer Datei hinzuZeichnung einfgen aus...Fgt eine Struktur aus den Vorlagen hinzuAdeninAlleAminosurenAzulenHintergrundfarbe :Standardbindungs_lnge:Standardbindungslnge (10.668mm) :BenzolTypKoffeinBestimmt Summenformel und MolekulargewichtSummenformel/MolmasseAbbruchCarbocyclenZentrierenZentriert die Zeichnung in der ZeichenflcheVoreinstellung der LinienartZeichnung bereinigenNeuDurch Markieren und Ziehen der Maus knnen Bindungen gezeichnet werden. Mit der rechten Maustaste werden Objekte gelscht - entweder Bindungen oder Text, je nachdem welcher Zeichenmodus gerade aktiv ist. Die Schaltflchen mit den verschiedenen Ringsymbolen whlen Zeichenmodi mit voreingestellten Winkeln aus, es knnen jedoch immer auch beliebige Winkel gezeichnet werden. Die Schaltflche mit dem Linienzug erlaubt das Zeichnen von Bezierkurven durch Angabe der Sttzstellen fr die Kurve Bindungsart und -farbe knnen mit den jeweiligen Knpfen voreingestellt werden, oder auch nachtrglich durch Anklicken im Modus 'Bindung' gendert werden. Zum Zeichnen von Ringen gengt es, Strg und die entsprechende Zifferntaste zu drcken, um die Grsse zu whlen, und dann eine Ringseite mit gedrckter Strg-Taste zu zeichnen Atomsymbole und beliebiger Text knnen nach Eintrag in die Textzeile an jeder Stelle in der Zeichnung abgesetzt werden. Zum raschen Setzen von Atom- symbolen beim Zeichnen steht auch eine Reihe von Krzeln zur Verfgung: Drcken der Tasten c,n,o,p,s oder f im Zeichenmodus fgt das entsprechende Element an der aktuellen Zeichenposition ein, 1,2,3 steht fr eine CH- ,CH2 oder CH3-Gruppe, l fr Cl und * fr einen dicken Punkt. Mit den Tasten des Ziffernblocks knnen Elektronenpaare um ein Atomsymbol gesetzt werden. Stellt man sich das Atom auf der 5 vor, so fgen die umgebenden Tasten jeweils den Elektronenpaar-Strich jeweils in ihrer Position ein. Zum Wechsel von Schriftart und Position dienen die folgenden Zeichen, die jeweils auf den nachfolgenden Buchstaben wirken: _ fr Tiefstellung, ^ fr Hochstellung, @ fr Symbole und griechische Buch- staben, | fr kursiven und # fr fettgedruckten Text. Wenn die Textbox leer ist, kann ein Text aus der Zeichnung durch Anklicken hineinkopiert werden. Das Zeichnen geht am Besten mit der Maus, der Cursor kann aber auch z.B. zum exakteren Positionieren mit den Cursortasten bewegt werden. Mit der Alt-Taste kombiniert, bewegen die Cursortasten das einblendbare quadratische oder hexagonale Raster. Praktisch alle von chemtool nicht bereitgestellten Zeichenfunktionen und weitere Schriftarten bietet das Programm XFig von Brian Smith. Dessen Schwesterprogramm transfig/fig2dev wird von chemtool zum Drucken und zum Erzeugen von EPS- und LaTeX-Dateien gebraucht, whrend die Dateiformate fig (fr XFig), XBM (bitmap) und SVG direkt erzeugt werden. Ein weiteres empfehlenswertes Programm ist Babel bzw. OpenBabel. Wenn es installiert ist, kann chemtool es zum Einlesen vieler Fremdformate benutzen - ohne babel knnen immerhin noch PDB- und MOL-Dateien einge- lesen werden. Mehr Informationen finden sich auf der Handbuchseite, im README (vermutlich in /usr/share/doc/packages/chemtool installiert) sowie auf der Webseiten. Fehlerbeschreibungen, Fragen, Wnsche und Anregungen bitte an martin@ruby.chemie.uni-freiburg.de schicken.SchliessenEinstellungenKopierenKopiert das markierte ObjektCoronenAnlegenVerzeichnis anlegenVerzeichnis anlegenErzeugt eine EPS-, XFig-, PicTeX- oder XBM-DateiCycloheptatrienCyclohexanCyclooctatetraenCyclopentadienylCytosinZeichnungsverzeichnis:Verkleinert die DarstellungLschenDatei lschenDicyclopentadienVerzeichnisseVerzeichnisname:Verzeichnis nicht lesbar: %sDoppelbindungs_abstand:Doppelbindungsabstand (4 pixel) :Zeichnet mit 0/30/60/90 Grad-WinkelrasterZeichnet mit 0/36/72 Grad-WinkelrasterZeichnet mit 0/45/90 Grad-WinkelrasterZeichnet mit 18/54/90 Grad-WinkelrasterZeichnet eine geschweifte Klammer um das ObjektZeichnet eine Klammer oder einen Rahmen um das ObjektZeichnet eine eckige Klammer um das ObjektSchreibt zentrierten TextZeichnet Kurven anhand von 4 KontrollpunktenZeichnet einen aufwendigen Rahmen um das ObjektSchreibt linksbndigen TextSchreibt rechtsbndigen TextZeichnet eine runde Klammer um das ObjektZeichnet einen runden Rahmen um das ObjektZeichnet eine runde Klammer um das ObjektZeichnet einen schattierten Rahmen um das ObjektZeichnet einen Rahmen um das ObjektZeichnung als %s gespeichert (%d Bindungen, %d Texte) _Erweiterung:BearbeitenFehler%s konnte nicht geladen werden Evans-AuxiliarBeendet ChemtoolExport (Babel)Erweiterung:MWDateiDatei %s existiert schon ! berschreiben ?DateienErsterWaagerecht spiegelnKippt das Objekt um seine HochachseKippt das Objekt um seine LngsachseSenkrecht spiegelnFluorenFruktoseFukoseFulvalenFuranosegerstGalaktoseGlukoseRaster quadr./rhomb./ausGuaninHilfeHeptalenHeterocyclenImportImport (Babel)MDL-ImportMOL-ImportPDB-ImportPDB-ImportPDB-ImportVergrssert die DarstellungIndenRechenfehler (SIGFPE) -LaktoseQuerformatSkalierungsfaktor fr Latex / EPS :LadenLdt eine Chemtool-ZeichnungZeichnung laden aus...Aktuelles VerzeichnisMaltoseMannoseMarkiert ein Fragment zum Verschieben, Drehen, usw.Maske:Speicherzugriffsfehler (SIGBUS) -Speicherverwaltungsfehler (SIGSEGV) -MorphinMorphin 3DVerschiebt das markierte ObjektNaphthalinNeuraminsureNeuNchsterNeinKeineNorbornanOKOkLadenPer Signal beendet (SIGHUP) -Ausrichtung:PDB-LabelPapier_format:Papierformat:PorphinHochformatKennzeichnung von Tiefstellungen mit _, Hochstellung mit ^, Sonderzeichen mit @, kursiv mit |, fett mit #; z.B. H_2O, @a_D^2^0_Vorschaubildart in EPS-Dateien:Vorschaubildart in EPS-Dateien :VorigerDruckenDruck_befehl:Druckbefehl:Druckt die Zeichnung auf einem Postscript-Drucker_Skalierungsfaktor:Skalierungsfaktor :Drucker_name:Druckername:Probleme bei der Konvertierung von %s PyranosegerstEndeImportiert eine im MDL/molfile-Format geschriebene DateiImportiert eine im PDB-Format geschriebene DateiBereitWiederholenLscht die ZeichenflcheBereinigt das markierte Objekt (lscht doppelte Bindungen usw.)UmbenennenDatei umbenennenVergrssert oder verkleinert das ObjektDreht das markierte ObjektSAMP-AuxiliarSDF-Eintrag:SDF-Eintrag: %dSpeichernSpeichern als...Einstellungen speichernSpeichern als...Einstellungen speichernSpeichert die Struktur als Chemtool-DateiHintergrundfarbe einstellenndert die Schriftgrendert die StiftfarbeAuswahl: Schriftart umschaltenEinstellungenEinstellungenSpiro[4.5]decanSteroidgerstSaccharoseZuckerNationale Sonderzeichen in Text untersttzenSymboleVorlagenVorlagen...Die aktuelle Zeichnung ist noch nicht gespeichert! Wollen Sie wirklich weitermachen ?Thyminndert den LinientypWerkzeuge%s konnte nicht geffnet werden Rckgngig machenUnklarer FehlerAnsicht%s konnte nicht geschrieben werden ! XyloseJaZoom +Zoom -VergrernVerkleinernHintergrundfar_be:_Zeichnungsverzeichnis:_AllgemeinAus_richtung:_Druckenchemtool: keine einzige nutzbare Schrift gefunden ohne Nummernohne H u.Nummernnicht-HP-OrbitalUmlagerungnamenloschemtool-1.6.14/po/quot.sed0000666000175000001440000000023112202253330014721 0ustar martinuserss/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g chemtool-1.6.14/po/remove-potcdate.sin0000644000175000001440000000066010715417303017060 0ustar martinusers# 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 } chemtool-1.6.14/po/insert-header.sin0000666000175000001440000000124012202253330016502 0ustar martinusers# 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 } chemtool-1.6.14/po/fr.po0000644000175000001440000007541112202261221014211 0ustar martinusers# This is a message file in .po format # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR.#: msgid "" msgstr "" "Project-Id-Version: Chemtool-1.6\n" "Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: 2003-09-12 10:59GMT\n" "Last-Translator: Jerome PANSANEL \n" "Language-Team: Francais \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 0.9.5\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" "Le dessin actuel n'est pas sauvegard !\n" "Voulez-vous vraiment continuer ?" #: main.c:225 main.c:293 msgid "Yes" msgstr "Oui" #: main.c:240 main.c:308 msgid "No" msgstr "Non" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" "Le fichier\n" "%s\n" "existe dj !\n" "L'craser ?" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" "\n" "Le prochain cycle dessin aura %d cts" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" "\n" "Importation de %d liaisons et %d zone de texte" #: main.c:1359 main.c:2667 main.c:5829 msgid "unnamed" msgstr "sansnom" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" "\n" "Prt" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" "\n" "Echec du processus d'aide - %s %s %s %s!" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" "\n" "%s %s %s %s" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" "\n" "Dessin imprim !" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" "\n" "Echec de l'impression du dessin !" #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr "mode angulaire invalide %d\n" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr "mode texte invalide %d\n" #: main.c:2353 msgid "Load from file..." msgstr "Charger partir du fichier..." #: main.c:2394 msgid "Import MDL file..." msgstr "Importer un fichier MDL..." #: main.c:2434 msgid "Import via BABEL..." msgstr "Importer via Babel" #: main.c:2456 msgid "Export via BABEL..." msgstr "Exporter via Babel" #: main.c:2478 msgid "Import PDB file..." msgstr "Importer un fichier PDB..." #: main.c:2521 msgid "Add from file..." msgstr "Ajouter partir d'un fichier" #: main.c:2637 msgid "Save as..." msgstr "Enregistrer sous..." #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" "\n" "Rien enregistrer" #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" "\n" "Echec de l'criture sur %s !" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" "\n" "Dessin sauvegard dans %s (%d liaisons, %d zones de texte)" #: main.c:2821 main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" "Echec de l'criture sur\n" "%s\n" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" "\n" "Dessin export sous %s (%d liaisons, %d zone de texte)" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "" #: main.c:2979 main.c:3060 main.c:3101 main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr "Impossible d'ouvrir %s\n" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" "%s\n" "ne semble pas tre un fichier Chemtool\n" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" "%s a t cre avec une version postrieure.\n" "Certains dtails peuvent tre perdus.\n" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr "Erreur lors du chargement de %s\n" #: main.c:3048 main.c:3089 main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" "\n" "Choissisez l'orientation (Ctrl-Souris1 pour z), puis appuyer sur Entre" #: main.c:3067 main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr "Problmes en convertissant %s\n" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" "Dessin sauvegard dans\n" "%s\n" " (%d liaisons, %d zones de texte)\n" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" "Cliquer et glisser la souris pour crer des liaisons sur le dessin.\n" "Le bouton droit est utilis pour effacer des objets - que ce soient des " "liaisons\n" "ou des zones de texte (cela dpend du mode de dessin activ).\n" "\n" "Les icnes reprsentant les diffrents cycles permettent de slectionner un\n" "mode de dessin. Chacun de ses modes est li un angle, bien qu'il soit\n" "possible de dessiner n'importe quel angle avec tous les modes.\n" "\n" "L'icne comportant un segment dcoup en quatre permet de raliser des\n" "courbes en plaant quatre points de contrle.\n" "Vous pouvez slectionner le type et la couleur de la liaison en utilisant " "l'icne\n" "approprie ou en les changeant par aprs en cliquant sur le mode de liaison\n" "souhait.\n" "\n" "Pour dessiner un systme cyclique, appuyer simplement sur la touche Ctrl\n" "conjointement avec le chiffre correspondant au nombre de cts du\n" "polygone, puis dessiner un ct en appuyant sur la touche Ctrl.\n" "\n" "Pour placer un texte, crivez-le dans le cadre 'Texte' en haut de la " "fentre\n" "et placez le sur le dessin avec la souris. Vous pouvez galement utiliser\n" "des raccourcis claviers pour les noms d'atomes courants lorsque le mode de\n" "dessins de liaison est activ : appuyer simplement sur la touche 'c', 'n', " "'o', 'p',\n" "'s', ou 'f' pour ajouter le symbole de l'lment la dernire position " "active ;\n" "'1', '2' et '3' pour CH, CH_2 et CH_3, 'l' pour Cl, '*' pour un point.\n" "\n" "Les touches du clavier numrique permettent d'insrer une paire d'lectrons\n" "libres autour du symbole de l'atome, l'endroit correspondant la " "position\n" "de la touche par rapport au centre du clavier numrique.\n" "\n" "Le mode texte utilise les prfixes suivants pour inclure des caractres\n" "spciaux :\n" "_ pour les indices, ^ pour les exposants, @ pour les symboles (caractres\n" "grecs), | pour les caractres en italique et # pour le texte en gras.\n" "Lorsque le cadre 'Texte' est rempli, un clic sur n'importe quelle partie du " "dessin\n" "permet de copier le contenu du cadre.\n" "\n" "Le dessin est plus facile avec la souris. Vous pouvez nanmoins utiliser " "les\n" "flches du clavier en combinaison avec la touche Ctrl pour un " "positionnement\n" "exact. Lorsqu'elles sont utilises en combinaison avec la touche Alt, elles\n" "permettent de bouger la grille rectangulaire ou hexagonale, qui peut tre\n" "projete sur la surface de dessin.\n" "\n" "Si vous avez besoin de fonctions de dessin indisponibles dans Chemtool,\n" "essayez d'exporter votre dessin au format fig et de l'diter avec le\n" "programme xfig, ralis par Brian Smith's. Le programme transfig/fig2dev\n" "est ncessaire pour que Chemtool puisse imprimer et d'exporter en eps ou\n" "LaTeX. Par-contre, les fichiers au format fig, XBM et SVG sont gnrs\n" "directement. Un autre programme utile et recommand est Babel - soit en\n" "version original, soit par le biais du nouveau projet OpenBabel.\n" "L'utilisation de ces programmes permet d'importer dans Chemtool une\n" "grande varit de formats de fichier, alors qu'il n'y a que le format mol " "inclus\n" "de base dans Chemtool.\n" "\n" "Un complment d'aide est disponible dans les pages du manuel et dans le\n" "fichier README fournit avec les fichiers sources du programme. Ils sont\n" "galement disponibles sur le site web. Normalement, la documenation est\n" "installe dans le rpertoire /usr/share/doc/packages/chemtool.\n" "si vous trouvez des bugs ou si vous avez des questions/suggestions,\n" "veuillez-vous adresser, s'il vous plait, au dveloppeur principal du " "projet,\n" "martin@ruby.chemie.uni-freiburg.de" #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" "Version de Chemtool 1.6.14\n" "ralis par\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "et\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" #: main.c:3450 msgid "PDB labels:" msgstr "Labels PDB :" #: main.c:3453 msgid "All" msgstr "Tout" #: main.c:3461 msgid "non-H" msgstr "non-H" #: main.c:3470 msgid "no numbers" msgstr "pas de nombre" #: main.c:3479 msgid "non H,no numbers" msgstr "ni H, ni nombre" #: main.c:3489 main.c:3833 main.c:4139 msgid "None" msgstr "Aucun" #: main.c:3501 msgid "SDF entry:" msgstr "" #: main.c:3504 msgid "First" msgstr "" #: main.c:3511 msgid "Previous" msgstr "" #: main.c:3518 msgid "Next" msgstr "" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr "Facteur d'chelle Latex / EPS :" #: main.c:3708 msgid "Unknown error" msgstr "Erreur inconnue" #: main.c:3732 main.c:4010 msgid "Configurable options" msgstr "Options configurables" #: main.c:3767 msgid "_General" msgstr "" #: main.c:3788 msgid "Display" msgstr "" #: main.c:3794 msgid "Saving and Exporting" msgstr "" #: main.c:3800 msgid "Other" msgstr "" #: main.c:3811 msgid "_Background color:" msgstr "Couleur de _fond:" #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr "Ajouter un rectangle _blanc sous les zones de texte" #: main.c:3834 main.c:4148 msgid "EPSI" msgstr "EPSI" #: main.c:3835 main.c:4157 msgid "TIFF mono" msgstr "TIFF mono" #: main.c:3836 main.c:4165 msgid "TIFF color" msgstr "TIFF couleur" #: main.c:3841 msgid "_Data directory:" msgstr "Rpertoire des _donnes :" #: main.c:3848 msgid "E_xtension:" msgstr "E_xtension :" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr "Type d'image ajouter au fichier _eps :" #: main.c:3863 main.c:4184 msgid "Support national character sets in labels" msgstr "" #: main.c:3883 msgid "Base bond _length:" msgstr "_Longueur d'une liaison de base:" #: main.c:3891 msgid "Double bond _separation:" msgstr "" #: main.c:3904 msgid "_Printing" msgstr "Im_primer" #: main.c:3934 main.c:4049 msgid "Portrait" msgstr "Portrait" #: main.c:3935 main.c:4054 msgid "Landscape" msgstr "Paysage" #: main.c:3949 msgid "Print _command:" msgstr "_Commande d'impression :" #: main.c:3956 msgid "Printer _name:" msgstr "_Nom de l'imprimante :" #: main.c:3963 msgid "Paper si_ze:" msgstr "_Taille du papier :" #: main.c:3970 msgid "_Orientation:" msgstr "_Orientation :" #: main.c:3977 msgid "Print sc_ale factor:" msgstr "Ec_helle de l'image pour l'impression :" #: main.c:3993 msgid "Select background color" msgstr "Slectionner la couleur de fond" #: main.c:4019 msgid "Paper size:" msgstr "Taille du papier :" #: main.c:4044 msgid "Orientation:" msgstr "Orientation :" #: main.c:4069 msgid "Print scale factor :" msgstr "Echelle de l'image pour l'impression :" #: main.c:4094 msgid "Print command:" msgstr "Commande d'impression :" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr "Type d'image ajouter au fichier eps :" #: main.c:4198 msgid "Background color :" msgstr "Couleur de fond :" #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr "Ajouter un rectangle blanc sous les zones de texte" #: main.c:4225 msgid "Printer name:" msgstr "Nom de l'imprimante :" #: main.c:4238 msgid "Data directory:" msgstr "Rpertoire des donnes :" #: main.c:4251 msgid "Extension:" msgstr "Extension :" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr "Longueur d'une liaison de base (10,668mm) :" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "" #: main.c:4298 msgid "Ok" msgstr "Ok" #: main.c:4308 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "Annuler" #: main.c:4327 main.c:4912 msgid "Templates" msgstr "Modles" #: main.c:4338 main.c:4340 msgid "Carbocycles" msgstr "Carbocycles" #: main.c:4378 main.c:4380 msgid "Sugars" msgstr "Sucres" #: main.c:4422 main.c:4424 msgid "Heterocycles" msgstr "Htrocycles" #: main.c:4466 main.c:4468 msgid "Amino Acids" msgstr "Acides amins" #: main.c:4511 main.c:4513 msgid "Symbols" msgstr "Symboles" #: main.c:4559 gtkfilesel.c:1196 msgid "Close" msgstr "Fermer" #: main.c:4605 msgid "New" msgstr "Nouveau" #: main.c:4613 msgid "Open" msgstr "Ouvrir" #: main.c:4621 main.c:4904 msgid "Add" msgstr "Ajouter" #: main.c:4629 msgid "Import MOL" msgstr "Importer MOL" #: main.c:4637 msgid "Import PDB" msgstr "Importer PDB" #: main.c:4645 msgid "Import (Babel)" msgstr "Importer (Babel)" #: main.c:4653 msgid "Export..." msgstr "Exporter..." #: main.c:4661 msgid "Export (Babel)" msgstr "Exporter (Babel)" #: main.c:4670 main.c:4941 msgid "Print" msgstr "Imprimer" #: main.c:4678 msgid "Setup Defaults" msgstr "Configuration par dfaut" #: main.c:4693 main.c:4960 msgid "Save Config" msgstr "Enregistrer la configuration" #: main.c:4702 main.c:4921 msgid "Save" msgstr "Enregistrer" #: main.c:4710 msgid "Save As..." msgstr "Enregistrer sous..." #: main.c:4719 main.c:5031 msgid "Quit" msgstr "Quitter" #: main.c:4727 msgid "File" msgstr "Fichier" #: main.c:4734 msgid "Copy" msgstr "Copier" #: main.c:4746 msgid "Flip horizontally" msgstr "Basculer horizontalement" #: main.c:4752 msgid "Flip vertically" msgstr "Basculer verticalement" #: main.c:4759 msgid "Undo" msgstr "Dfaire" #: main.c:4767 msgid "Redo" msgstr "Refaire" #: main.c:4777 msgid "Edit" msgstr "diter" #: main.c:4784 msgid "Zoom in" msgstr "Zoom +" #: main.c:4790 msgid "Zoom out" msgstr "Zoom -" #: main.c:4801 main.c:4996 msgid "Center" msgstr "Centrer" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr "Grille rect/hex/off" #: main.c:4815 msgid "View" msgstr "Vue" #: main.c:4823 msgid "Templates..." msgstr "Modles..." #: main.c:4832 msgid "Calculate Formula Weight" msgstr "Calculer la masse molculaire" #: main.c:4840 msgid "Clean up drawing" msgstr "Nettoyer le dessin" #: main.c:4846 msgid "Tools" msgstr "Outils" #: main.c:4854 main.c:5039 msgid "About" msgstr "A propos" #: main.c:4863 main.c:4872 msgid "Help" msgstr "Aide" #: main.c:4895 msgid "Load" msgstr "Charger" #: main.c:4900 msgid "Load a chemtool sketch" msgstr "Charger un dessin Chemtool" #: main.c:4909 msgid "Add fragment from file" msgstr "Ajouter un fragment partir d'un fichier" #: main.c:4918 msgid "Add template structure" msgstr "Ajouter un fragment partir d'un modle" #: main.c:4926 msgid "Save sketch to file" msgstr "Enregistrer le dessin dans un fichier" #: main.c:4929 msgid "Export" msgstr "Exporter" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "Crer un fichier EPS, XFig, PicTeX ou XBM" #: main.c:4947 msgid "Print file to a postscript printer" msgstr "Imprimer le fichier vers une imprimante postscript" #: main.c:4950 msgid "Setup" msgstr "" #: main.c:4957 msgid "Setup default options" msgstr "Configuration par dfaut" #: main.c:4966 msgid "Save default options" msgstr "" #: main.c:4969 msgid "Import" msgstr "Importer" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr "Lire un fichier dans le format MDL/molfile" #: main.c:4978 msgid "ImportPDB" msgstr "Importer un fichier PDB" #: main.c:4984 msgid "Read a file written in PDB format" msgstr "Lire un fichier dans un format PDB" #: main.c:4987 msgid "Zoom In" msgstr "Zoom +" #: main.c:4992 msgid "Increase zoom scale" msgstr "Augmenter le zoom" #: main.c:5002 msgid "Center molecule in drawing area" msgstr "Centrer la molcule dans la zone de dessin" #: main.c:5005 msgid "Zoom Out" msgstr "Zoom -" #: main.c:5010 msgid "Decrease zoom scale" msgstr "Diminuer le zoom" #: main.c:5014 msgid "Clear" msgstr "Effacer" #: main.c:5019 msgid "Remove molecule" msgstr "Supprimer la molcule" #: main.c:5022 msgid "FW" msgstr "MM" #: main.c:5027 msgid "Calculate Formula Mass" msgstr "Calculer la masse molculaire" #: main.c:5036 msgid "Exit Chemtool" msgstr "Sortir de Chemtool" #: main.c:5045 msgid "About Chemtool" msgstr "A propos de Chemtool" #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr "Dessiner avec des angles de 0/30/60/90 degrs" #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr "Dessiner avec des angles de 0/36/72 degrs" #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr "Dessiner avec des angles 18/54/90 degrs" #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr "Dessiner avec des angles de 0/45/90... degrs" #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr "Dessiner une courbe partir de quatre points de contrle" #: main.c:5174 msgid "Draw left-justified text" msgstr "Ecrire un texte justifi gauche" #: main.c:5191 msgid "Draw centered text" msgstr "Ecrire un texte centr" #: main.c:5208 msgid "Draw right-justified text" msgstr "Ecrire un texte justifi droite" #: main.c:5236 msgid "Set current textfont" msgstr "Slectionner la police de caractre" #: main.c:5266 msgid "Choose default bond type" msgstr "Slectionner le type de liaison par dfaut" #: main.c:5283 msgid "Select pen color" msgstr "Slectionner la couleur du stylo" #: main.c:5288 msgid "Bonds" msgstr "Liaisons" #: main.c:5293 msgid "Toggle bond types" msgstr "Changer le type de liaison" #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr "" "Slectionner les objets pour les dplacer, les tourner ou les supprimer" #: main.c:5327 msgid "Move marked object" msgstr "Dplacer les objets marqus" #: main.c:5344 msgid "Rotate marked object" msgstr "Tourner les objets marqus" #: main.c:5363 msgid "Flip object horizontally" msgstr "Basculer l'objet horizontalement" #: main.c:5381 msgid "Flip object vertically" msgstr "Basculer l'objet verticalement" #: main.c:5407 msgid "Copy marked object" msgstr "Copier l'objet slectionn" #: main.c:5422 msgid "Rescale marked object" msgstr "Redimensionner l'objet slectionn" #: main.c:5441 msgid "Draw brackets around object" msgstr "Dessiner des crochets autour de l'objet" #: main.c:5456 msgid "Draw rounded brackets around object" msgstr "Dessiner des parenthses autour de l'objet" #: main.c:5471 msgid "Draw round brackets around object" msgstr "Dessiner des parenthses autour de l'objet" #: main.c:5486 msgid "Draw braces around object" msgstr "Dessiner des accolades autour de l'objet" #: main.c:5501 msgid "Draw simple box around object" msgstr "Dessiner un simple cadre autour de l'objet" #: main.c:5515 msgid "Draw shaded box around object" msgstr "Dessiner un cadre ombr autour de l'objet" #: main.c:5529 msgid "Draw fancy box around object" msgstr "Dessiner un cadre personnalis autour de l'objet" #: main.c:5543 msgid "Draw rounded box around object" msgstr "Dessiner un cadre arrondi autour de l'objet" #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr "Dessiner des crochets et des cadres autour de l'objet" #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr "Retirer les liaisons dupliques, etc." #: main.c:5605 msgid "Text :" msgstr "Texte :" #: main.c:5619 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "" "Prfixer un caractre avec _ pour les indices, ^ pour les exposants, @ pour " "les symboles, | pour l'italique, # pour un texte gras; i.e. H_2O, @a_D^2^0" #: main.c:5624 msgid "Select current text size" msgstr "Slectionner la taille du texte" #: main.c:5753 #, c-format msgid "Ready" msgstr "Prt" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "Chemtool : ne peut charger aucune police\n" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr "Problme d'allocation de mmoire (SIGSEGV) -" #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr "Erreur mathmatique quelque part (SIGFPE) -" #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr "Problme d'accs la mmoire (SIGBUS) -" #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr "Injonction quitter (SIGHUP) - " #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr "Copie du dessin courant dans le fichier crashdump.cht\n" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "Chercher dans :" #: gtkfilesel.c:796 msgid "Directories" msgstr "Rpertoires" #: gtkfilesel.c:825 msgid "Mask:" msgstr "Filtre : " #: gtkfilesel.c:838 msgid "Files" msgstr "Fichiers" #: gtkfilesel.c:872 msgid "OK" msgstr "OK" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "Rpertoire non lisible : %s" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "Crer un rpertoire" #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr "Effacer un fichier" #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr "Renommer un fichier" #: gtkfilesel.c:1173 msgid "Error" msgstr "Erreur" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "Crer un rpertoire" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "Nom du rpertoire :" # #: gtkfilesel.c:1297 msgid "Create" msgstr "Crer" #: gtkfilesel.c:1397 msgid "Delete" msgstr "Effacer" #: gtkfilesel.c:1512 msgid "Rename" msgstr "Renommer" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "Slection : " #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr "" "Considrer l'installation de Babel/OpenBabel pour les convertions de " "fichiers...\n" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "Cyclopentadinyl" #: templates.hx:2 msgid "Benzene" msgstr "Benzne" #: templates.hx:2 msgid "Naphthalene" msgstr "Naphthalne" #: templates.hx:2 msgid "Azulene" msgstr "Azulne" #: templates.hx:3 msgid "Adamantane" msgstr "Adamantane" #: templates.hx:3 templates.hx:5 msgid "Cyclohexane" msgstr "Cyclohexane" #: templates.hx:3 msgid "Steroid backbone" msgstr "Squelette de strode" #: templates.hx:3 msgid "Cycloheptatriene" msgstr "Cycloheptatrine" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "Cyclooctatetrane" #: templates.hx:4 msgid "Fluorene" msgstr "Fluorne" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "Spiro[4,5]dcane" #: templates.hx:4 msgid "Heptalene" msgstr "Heptalne" #: templates.hx:4 msgid "Fulvalene" msgstr "Fulvalne" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "Dicyclopentadine" #: templates.hx:5 msgid "Indene" msgstr "Indne" #: templates.hx:5 msgid "Biphenyl" msgstr "Biphnyl" #: templates.hx:5 msgid "Norbornane" msgstr "Norbornane" #: templates.hx:5 msgid "Binaphthyl" msgstr "Binaphthyl" #: templates.hx:6 msgid "Coronene" msgstr "Coronne" #: templates.hx:8 msgid "Pyranose core" msgstr "Noyau pyranose" #: templates.hx:8 msgid "Furanose core" msgstr "Noyau furanose" #: templates.hx:8 msgid "Ribofuranose" msgstr "Ribofuranose" #: templates.hx:8 msgid "Fructose" msgstr "Fructose" #: templates.hx:8 msgid "Galactose" msgstr "Galactose" #: templates.hx:9 msgid "Glucose" msgstr "Glucose" #: templates.hx:9 msgid "Mannose" msgstr "Mannose" #: templates.hx:9 msgid "Fucose" msgstr "Fucose" #: templates.hx:9 msgid "Xylose" msgstr "Xylose" #: templates.hx:9 msgid "Neuraminic acid" msgstr "Acide neuraminique" #: templates.hx:10 msgid "Sucrose" msgstr "Sucrose" #: templates.hx:10 msgid "Maltose" msgstr "Maltose" #: templates.hx:10 msgid "Lactose" msgstr "Lactose" #: templates.hx:14 msgid "Adenine" msgstr "Adenine" #: templates.hx:14 msgid "Guanine" msgstr "Guanine" #: templates.hx:14 msgid "Thymine" msgstr "Thymine" #: templates.hx:14 msgid "Cytosine" msgstr "Cytosine" #: templates.hx:14 msgid "Uracil" msgstr "Uracile" #: templates.hx:15 msgid "Porphine" msgstr "Porphine" #: templates.hx:15 msgid "Caffeine" msgstr "Cafine" #: templates.hx:15 msgid "Evans auxiliary" msgstr "Auxiliaire Evans" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "Auxiliaire SAMP" #: templates.hx:15 msgid "Imidazole" msgstr "" #: templates.hx:16 msgid "Benzimidazole" msgstr "" #: templates.hx:16 msgid "Pyrazole" msgstr "" #: templates.hx:16 msgid "Diazole" msgstr "" #: templates.hx:17 msgid "Morphine" msgstr "Morphine" #: templates.hx:17 msgid "Morphine 3D" msgstr "Morphine" #: templates.hx:23 msgid "Backbone" msgstr "" #: templates.hx:26 msgid "p orbital" msgstr "orbitale p" #: templates.hx:26 msgid "plus" msgstr "plus" #: templates.hx:26 msgid "minus" msgstr "moins" #: templates.hx:26 msgid "rearrangement" msgstr "rarrangement" #~ msgid "Help - somebody ate my atoms (hp->n=%d, da_root.next NULL)!!!\n" #~ msgstr "" #~ "Aide - quelqu'un dteste mes atomes (hp->n=%d, da_root.next NULL)!!!\n" #~ msgid "Help - somebody ate my atoms (d=%d,hp->n=%d)!!!\n" #~ msgstr "A l'aide - quelqu'un dteste mes atomes (d=%d,hp->n=%d)!!!\n" #~ msgid "failed to load font %s !!!\n" #~ msgstr "Impossible de charger la police %s !!!\n" #~ msgid "Failed to load symbol font, using standard font\n" #~ msgstr "" #~ "Impossible de charger la police symbol, utilisation de la police " #~ "standard\n" #~ msgid "Error creating directory \"" #~ msgstr "Erreur lors de la cration du rpertoire \"" #~ msgid "Error deleting file \"" #~ msgstr "Erreur lors de l'effacement du fichier \"" #~ msgid "Really delete file \"" #~ msgstr "Effacer rellement le fichier \"" #~ msgid "Error renaming file \"" #~ msgstr "Erreur lors du renommage du fichier \"" #~ msgid "Rename file \"" #~ msgstr "Renommer le fichier \"" #~ msgid "\" to:" #~ msgstr "\" vers :" #~ msgid "Name too long" #~ msgstr "Nom trop long" #~ msgid "Chemtool Version " #~ msgstr "Version de Chemtool" #~ msgid "endless molfile???\n" #~ msgstr "Fichier mol sans fin ???\n" #~ msgid "expecting na %d nb %d\n" #~ msgstr "attendu : na %d nb %d\n" #~ msgid "Molecule exported from chemtool\n" #~ msgstr "Molcule exporte de Chemtool\n" #~ msgid "" #~ "\n" #~ "Created with Chemtool 1.6.9 from file %s \n" #~ "\n" #~ msgstr "" #~ "\n" #~ "Cr par Chemtool 1.6.9 partir du fichier %s \n" #~ "\n" #~ msgid "undefined text direction in svg output\n" #~ msgstr "Direction du texte non-dfinie dans la sortie svg\n" # #~ msgid "Created by" #~ msgstr "Cr par" #~ msgid "no emf font parameters for zoom factor %d\n" #~ msgstr "Pas de paramtre de la police emf pour le facteur du zoom %d\n" #~ msgid "undefined text direction in emf output\n" #~ msgstr "Direction du texte non-dfinie dans la sortie emf\n" #~ msgid "no figfont parameters for zoom factor %d\n" #~ msgstr "Pas de paramtre figfont pour le facteur du zoom %d\n" #~ msgid "# generated by Chemtool " #~ msgstr "# gnr par Chemtool " #~ msgid "no figfont parameters for fontsize %d\n" #~ msgstr "Pas de paramtre figfont pour la taille de caractre %d\n" #~ msgid "undefined text direction in xfig output\n" #~ msgstr "Direction du texte non-dfinie dans la sortie xfig\n" #~ msgid "no translation for %d\n" #~ msgstr "Pas de traduction pour %d\n" #~ msgid "could not close fig file" #~ msgstr "Impossible de fermer le fichier fig" #~ msgid " " #~ msgstr " " #~ msgid "TIFFm" #~ msgstr "TIFFm" #~ msgid "TIFFc" #~ msgstr "TIFFc" #~ msgid "Chemtool 1.6.9" #~ msgstr "Chemtool 1.6.9" #~ msgid "program cht not available or unable to write to" #~ msgstr "" #~ "le programme cht n'est pas disponible ou il est impossible de l'utiliser" #~ msgid ".rad" #~ msgstr ".rad" #~ msgid " ?" #~ msgstr " ?" #~ msgid "Chemtool 1.6.9 (%s)" #~ msgstr "Chemtool 1.6.9 (%s)" #~ msgid "File selection" #~ msgstr "Slection de fichier" #~ msgid "_Configurable options" #~ msgstr "Options _configurables" #~ msgid "No error" #~ msgstr "Pas d'erreur" #~ msgid "Bad parameter passed to undo function" #~ msgstr "Mauvais paramtre pass la fonction 'dfaire'" #~ msgid "Out of memory" #~ msgstr "Hors de la mmoire" #~ msgid "No active undo session" #~ msgstr "Pas de session 'dfaire' active" #~ msgid "Nothing to undo/redo" #~ msgstr "Rien dfaire/refaire" #~ msgid "No undoable memory limit set" #~ msgstr "La limite de la mmoire 'dfaire' n'est pas spcifie" chemtool-1.6.14/po/Makevars.template0000666000175000001440000000341612202253330016552 0ustar martinusers# 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 = Free Software Foundation, Inc. # 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 = # 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 = chemtool-1.6.14/po/pl.gmo0000666000175000001440000005323612202261360014372 0ustar martinusers,[<>-(*:e% #/*> Q^z ('.6 :FNat    4M^ dk%q%C%%%%% %%$&3& D&P&b&s&|&&& &&& &&&'!' ='!^' '"''%'( (%3(Y(v((!((#(),),J)w) |))))) )))) ) )**' *3*9*?*Q*j***** * * ***** * * +++,+ ?+ J+U+h+ |+++!++ ++++ , ,*,2,-:,h, n,%,, ,, ,,,,-- ---- - <- I- U- b-n-w-}-#-#".F.O.U.e."t.... .. ./ /)/!LDLML\LxLLLLLLL LLL MMM M,M5M>MWM lM yMMM MMM+MNN$NDNLNeNxNNNMNN%N# O1O 9O"DOgOpOOOOO OOOO-O O OOP P#P+P4P4P )Q3Q:QQQ(gQQQQQQRRR,$R$QRvR}RR!R RR"R RS "S-S4SCSWSfS|SSSSSS SSTT,T @TJT/PTT T TT TT4TTT UU*U 1U?UFU$LUqUyU}U UU U UUU UU%U!V#$VHV NV\VpV vVVV V Tb+G2SrC@n,YH.&V65ak0| B1y_vKR7Dm9x^>zA#J( OM<tql%?`QUZ /o !{$}Xp:*fw4;\N3gij']hPu-eF8dcW=~L[IsE )" %s %s %s %s Choose orientation (Ctrl-Mouse1 for z), press Enter when done Drawing exported as %s (%d bonds, %d labels) Drawing printed! Drawing saved in %s (%d bonds, %d labels) Failed to print drawing ! Helper process failed - %s %s %s %s! Imported %d bonds and %d labels Next ring drawn will have %d sides Nothing to save Ready Writing to %s failed ! Chemtool Version 1.6.14 by Martin Kroeker, Radek Liboska, Michael Banck and Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dumping current drawing to file crashdump.cht %s does not appear to be a Chemtool file %s was created by a newer version. Some features may be lost. OtherSaving and ExportingAboutAbout ChemtoolAdamantaneAddAdd filled _white rectangle under labelsAdd filled white rectangle under labelsAdd fragment from fileAdd from file...Add template structureAdenineAllAmino AcidsAzuleneBackground color :Base bond _length:Base bondlength (10.668mm) :BenzeneBenzimidazoleBinaphthylBiphenylBondsCaffeineCalculate Formula MassCalculate Formula WeightCancelCarbocyclesCenterCenter molecule in drawing areaChoose default bond typeClean up drawingClearClick and drag the mouse to draw bonds on the canvas. The right mouse button is used to delete objects - either bonds or text depending on which drawing mode is active. The buttons with different ringtypes on them select drawing modes with preferred angles, but you can actually draw at any angle in all modes. The button with the segmented line on it lets you draw curves by marking control points along the curve (a cubic spline). You can select the bondtype and color using the appropriate button or change them later by clicking on the desired bond in Bonds mode. To draw a cyclic system, simply press the Ctrl key together with the number key corresponding to the number of sides for the polygon, and then draw one side while pressing the Ctrl button. For drawing labels, write them into the text box in the top right of the window and place them on the canvas with the mouse. You can also use a number of keyboard shortcuts for common labels while in bond drawing mode: Simply press the 'c' key, or n,o,p,s,f to add the element symbol at the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl, * for a big dot. The keys of the numeric keypad each insert an 'electron pair' line around an atom symbol in the position corresponding to the location of the key around the center of the numeric keypad. The text mode uses the following prefixes for special text: _ for subscripts, ^ for superscripts, @ for symbols (greek characters), | for italic (slanted) characters and # for bold text. When the text box is empty, clicking on any label in the drawing area copies that label into the box for reuse. Drawing is best done with the mouse, but you can also use the cursor keys in combination with the Ctrl key for exact positioning. When used with the Alt key, the cursor keys move the rectangular or rhombic grid that can be projected on the drawing area. If you need general drawing functions not provided by chemtool, try exporting to fig format and editing your figure in Brian Smith's xfig program. Its companion transfig/fig2dev is required by chemtool for printing and for exporting to eps or LaTeX, while the fig, XBM and SVG output are generated directly. Another useful and highly recommended helper program is Babel - either in its original version, or in the form of the new OpenBabel project. Using either version, chemtool is able to import foreign data from a variety of file formats, while only molfile im- and export is built into chemtool. More help is available in the manual page for chemtool and in the file README included in the source distribution as well as on the website. This should normally get installed in /usr/share/doc/packages/chemtool. If you find any bugs or have a question or suggestion, please contact the main author, martin@ruby.chemie.uni-freiburg.deCloseConfigurable optionsConsider installing Babel/OpenBabel for file format conversions... CopyCopy marked objectCoroneneCreateCreate DirCreate DirectoryCreate EPS, XFig, PicTeX or XBM fileCycloheptatrieneCyclohexaneCyclooctatetraeneCyclopentadienylCytosineData directory:Decrease zoom scaleDeleteDelete FileDiazoleDicyclopentadieneDirectoriesDirectory name:Directory unreadable: %sDouble bond _separation:Doublebond separation (4 pixel) :Draw at 0/30/60/90 degree anglesDraw at 0/36/72/... degree anglesDraw at 0/45/90... degree anglesDraw at 18/54/90/... degree anglesDraw braces around objectDraw brackets and boxes around objectDraw brackets around objectDraw centered textDraw curves based on 4 control pointsDraw fancy box around objectDraw left-justified textDraw right-justified textDraw round brackets around objectDraw rounded box around objectDraw rounded brackets around objectDraw shaded box around objectDraw simple box around objectDrawing saved in %s (%d bonds, %d labels) EPSIE_xtension:EditErrorError loading %s Evans auxiliaryExit ChemtoolExportExport (Babel)Export via BABEL...Export...Extension:FWFileFile %s already exists ! Overwrite it ?FilesFirstFlip horizontallyFlip object horizontallyFlip object verticallyFlip verticallyFluoreneFructoseFucoseFulvaleneFuranose coreGalactoseGlucoseGrid rect/rhomb/offGuanineHelpHeptaleneHeterocyclesImidazoleImportImport (Babel)Import MDL file...Import MOLImport PDBImport PDB file...Import via BABEL...ImportPDBIncrease zoom scaleIndeneInvalid math somewhere (SIGFPE) -LactoseLandscapeLatex / EPS scale factor :LoadLoad a chemtool sketchLoad from file...Looking in:MaltoseMannoseMark objects for moving, rotating or deletingMask:Memory access problem (SIGBUS) -Memory allocation problem (SIGSEGV) -MorphineMorphine 3DMove marked objectNaphthaleneNeuraminic acidNewNextNoNoneNorbornaneOKOkOpenOrdered to quit (SIGHUP) - Orientation:PDB labels:Paper si_ze:Paper size:PorphinePortraitPrefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0Preview image to add to _EPS files:Preview image to add to eps files :PreviousPrintPrint _command:Print command:Print file to a postscript printerPrint sc_ale factor:Print scale factor :Printer _name:Printer name:Problems converting %s Pyranose corePyrazoleQuitRead a file written in MDL/molfile formatRead a file written in PDB formatReadyRedoRemove moleculeRemoves duplicate bonds, etc.RenameRename FileRescale marked objectRibofuranoseRotate marked objectSAMP auxiliarySaveSave As...Save ConfigSave as...Save default optionsSave sketch to fileSelect background colorSelect current text sizeSelect pen colorSelection: Set current textfontSetupSetup DefaultsSetup default optionsSpiro[4.5]decaneSteroid backboneSucroseSugarsSupport national character sets in labelsSymbolsTIFF colorTIFF monoTemplatesTemplates...Text :The current drawing is not saved ! Do you really wish to continue ?ThymineToggle bond typesToolsUnable to open %s UndoUnknown errorUracilViewWriting to %s failed ! XyloseYesZoom InZoom OutZoom inZoom out_Background color:_Data directory:_General_Orientation:_Printingchemtool: can't load any font invalid angle mode %d invalid text mode %d minusno numbersnon H,no numbersnon-Hp orbitalplusrearrangementunnamedProject-Id-Version: pl Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de POT-Creation-Date: 2007-05-23 23:58+0200 PO-Revision-Date: 2008-12-13 16:16+0100 Last-Translator: Micha Smoczyk Language-Team: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-Generator: KBabel 1.11.4 %s %s %s %s Wybierz orientacj (Ctrl-Mysz1 dla z), po zakoczeniu nacinij Enter Rysunek eksportowano jako %s (%d wiza, %d etykiet) Rysunek zosta wydrukowany! Rysunek zapisano jako %s (%d wiza, %d etykiet) Wydrukowanie rysunku nie powiodo si ! Otwarcie pomocy nie powiodo si - %s %s %s %s! Importowano %d wiza i %d etykiet Nastpny piercie bdzie mia %d boki Brak danych do zapisania Gotowy Zapisanie do %s nie powiodo si !Chemtool wersja 1.6.14 Autorzy: Martin Kroeker, Radek Liboska, Michael Banck Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html Polskie tumaczenie: Nikodem Kunik, Micha Smoczykzapisywanie aktualnego rysunku do pliku crashdump.cht %s nie jest plikiem programu Chemtool %s zosta utworzony przez nowsz wersj programu Niektre funkcje mog nie dziaa prawidowo. InneZapisywanie i eksportO programie ChemTool...Informacje o ChemtoolAdamantanDodajDodaj biay _wypeniony prostokt pod etykietamiDodaj biay wypeniony prostokt pod etykietamiDodaje fragment z plikuDodaj z pliku...Dodaje struktur z bibliotekiAdeninaWszystkieAminokwasyAzulenKolor ta :Podstawowa dugo _wiza:Podstawowa dugo wiza (10.668mm) :BenzenBenzimidazolBinaftylBifenylWizaniaKofeinaOblicz mas czsteczkow (Ms)Oblicz mas czsteczkowAnulujKarbocykleWycentrujWycentruj czsteczk w obszarze rysowaniaWybr domylnego typu wizaWyrwnaj rysunekWyczyNacinij i przecignij wskanik myszy, aby narysowa wizania. Prawy przycisk myszy suy do usuwania obiektw - wiza lub tekstu w zalenoci od aktywnego trybu. Przyciski z rnymi wieloktami (lewa strona panelu) umoliwiaj wybr trybu rysowania wiza ze wskazaniem na rne kty. Moliwe jest jednak rysowanie pod dowolnymi ktami po wybraniu kadego z przyciskw. Przycisk z aman krzyw pozwala na rysowanie krzywych opartych o wyznaczone przez uytkownika punkty kontrolne. Wyboru rodzaju, rzdu i koloru wiza mona dokona przez nacinicie przycisku wyboru domylnego typu wiza i koloru pira. Aby narysowa ukad cykliczny, trzymajc klawisz Ctrl naley przycisn klawisz cyfry (3, 4, 5,...)odpowiadajcy liczbie ktw podanego wielokta, a nastpnie dalej trzymajc klawisz Ctrl narysowa jeden z jego bokw. Aby opisa atomy lub grupy, naley wprowadzi tekst opisu w polu 'Tekst' a nastpnie umieci go w podanym miejscu za pomoc kursora. Aby doda symbole pierwiastkw do rysowanej wanie pozycji w trybie rysowania wiza, naley nacisn klawisze: c, n, p, o, s lub f. Nacinicie 1, 2 lub 3 spowoduje dodanie grup odpowiednio CH, CH_2 lub CH_3, a nacinicie '*' spowoduje dodanie duej kropki. Naciskajc klawisze na klawiaturze alfanumerycznej dodana zostanie para elektronowa do ostatniego rysowanego elementu w pozycji jak zajmuje nacinity klawisz wok klawisza '5'. Pole tekstowe akceptuje nastpujce prefiksy dla specjalnego tekstu: _ dla indeksu dolnego, ^ dla indeksu grnego, @ dla symboli (alfabet grecki), | dla kursywy oraz # dla tekstu pogrubionego. Jeli pole tekstowe jest puste, mona skopiowa dowolny tekst z pola rysunku poprzez kliknicie na tekst. Najlepszy efekt rysowanie uzyskuje si przy zastosowaniu myszki. Mona te rysowa wykorzystujc klawisze kursora z kombinacjami klawiszy Crtl oraz Alt. Trzymajc klawisz Ctrl mona wybra podan pozycj rysowania, natomiast klawisz Alt umoliwia rysowanie prostoktne lub szecioktne w zalenoci od wybranej siatki. W przypadku potrzeby uycia funkcji graficznych, ktre nie s dostpne w programie ChemTool, mona skorzysta w opcji eksportu rysunku do formatu fig, a nastpnie edycji wyeksportowanego rysunku,w programie xfig B. Smitha. Cze tego pakietu (transfig/fig2dev) jest rwnie wykorzystywana przez ChemTool w czasie drukowania. i eksportu do formatw eps i LaTeX. Formaty fig, XBM i SVG s generowane bezporednio. Innym uytecznym i polecanym programem jest Babel, zarwno w oryginalnej postaci, jak i w ramach nowego projektu OpenBabel. Zastosowanie tych programw umoliwia import danych z wielu rnych formatw uywanych w chemii. Jedynie import i eksport do formatu molfile jest wbudowany w ChemTool. Bardziej szczegowa pomoc jest dostpna na stronie projektu ChemTool oraz w pliku README doczonym w dystrybucji rde i na stronie projektu. Zazwyczaj powinien te by zainstalowane w katalogu /usr/share/doc/packages/chemtool. W przypadku znalezienia bdw, zadania pyta, zgoszenia sugetii, autor prosi o kontakt: martin@ruby.chemie.uni-freiburg.deZamknijOpcjeZainstalowanie Babel/OpenBabel umoliwi konwersje plikw chemicznych... KopiujKopiowanie zaznaczonych obiektwKoronenUtwrzUtwrz katalogUtwrz katalogUtwrz plik graficzny EPS, XFig, PicTeX lub XBMCykloheptatrienCykloheksanCyklooktatetraenCyklopentadienylCytozynaKatalog danych:Zmniejsz skal powikszeniaUsuUsu plikDiazolDicyklopentadienKatalogiNazwa katalogu:Nie mona odczyta katalogu: %s_Odstp podwjnych wiza:Odstp podwjnych wiza (4 piksele) :Rysowanie pod ktami 0/30/60/90 stopniRysowanie pod ktami 0/36/72/... stopniRysowanie pod ktami 0/45/90/... stopniRysowanie pod ktami 18/54/90/... stopniRysowanie nawiasw kwadratowych wok obiektwRysowanie nawiasw i prostoktw wok obiektwRysowanie nawiasw wok obiektwUtworzenie tekstu wycentrowanegoRysowanie krzywych opartych na 4 punktach kontrolnychRysowanie wymylnych prostoktw wok obiektwUtworzenie tekstu wyrwnanego do lewejUtworzenie tekstu wyrwnanego do prawejRysowanie nawiasw okrgych wok obiektwRysowanie zaokrglonych prostoktw wok obiektwRysowanie nawiasw okrgych wok obiektwRysowanie cieniowany prostoktw wok obiektwRysowanie zwykych prostoktw wok obiektwRysunek zapisano jako %s (%d wiza, %d etykiet) EPSI_Rozszerzenie:EdycjaBdBd podczas wczytywania %s grupa EvansaZakocz ChemtoolEksportujEksportuj (poprzez Babel)Eksportuj poprzez BABEL...Eksportuj...Rozszerzenie:MsPlikPlik %s ju istnieje ! Nadpisa ?PlikiPierwszyOdwr poziomoPoziome odwrcenie obiektwPionowe odwrcenie obiektwOdwr pionowoFluorenFruktozaFukozaFulwalenSzkielet furanozowyGalaktozaGlukozaSiatka prosto-/szeciokt/brakGuaninaPomocHeptalenHeterocykleImidazolImportujImportuj (poprzez Babel)Importuj plik MDL...Importuj MOLImportuj PDBImportuj plik PDB...Importuj poprzez BABEL...Importuj PDBZwiksza skal powikszeniaIndenBd w operacjach matematycznych (SIGFPE) -LaktozaPejzaWspczynnik skali dla Latex / EPS :WczytajWczytaj rysunek chemtoolZaaduj z pliku...cieka:MaltozaMannozaZaznaczanie obiektw, ktre mona w nastpstwie przesuwa, obraca lub usuwaMaskuj:Bd w dostpie do pamici (SIGBUS) -Bd w alokacji pamici (SIGSEGV) -MorfinaMorfina 3DPrzesunicie zaznaczonych obiektwNaftalenKwas neuraminowyNowyNastpnyNieNicNorbornanOKOkOtwrzSystem wyda polecenie zakoczenia (SIGHUP) -Orientacja:Etykiety PDB:_Rozmiar papieru:Rozmiar papieru:PorfirynaPortretWprowad wyraenie poprzedzone: _ dla indeksu dolnego; ^ dla indeksu grnego; @ dla symboli; | dla kursywy; # dla pogrubionego; np.: H_2O, @a_D^2^0Podld obrazu, ktry zostanie dodany do plikw _eps:Podld obrazu, ktry zostanie dodany do plikw eps :PoprzedniDrukujPole_cenie drukowania:Polecenie drukowania:Wydrukuj plik na drukarce postscriptowejCzynnik _skali wydruku:Czynnik skali wydruku :_Nazwa drukarki:Nazwa drukarki:Problemy podczas konwersji %s Szkielet piranozowyPirazolZakoczWczytaj plik zapisany w formacie MDL/molfileWczytaj plik zapisany w formacie PDBGotowyPrzywrUsu czsteczkUsuwanie podwojonych wiza, itp.Zmie nazwZmie nazw plikuZmiana skali zaznaczonych obiektwRybofuranozaObrt zaznaczonych obiektwgrupa SAMPZapiszZapisz jako...Zapisz konfiguracjZapisz jako...Zapisz domylne opcjeZapisuj rysunek do plikuWybierz kolor taWybr rozmiaru czcionkiWybr koloru piraWybr: Wybr czcionkiUstawieniaUstawienia domylneUstawienia domylneSpiro[4.5]dekanSzkielet steroidowySacharozaCukryObsuga narodowych zestaww znakw w etykietachSymbolekolor TIFFmono TIFFSzablonySzablony...Tekst :Rysunek nie zosta zapisany! Czy chcesz kontynuowa?TyminaZmiana typu wizaNarzdziaNie mona otworzy %s CofnijNieznany bdUracylWidokZapisanie do %s nie powiodo si ! KsylozaTakPowikszPomniejszPowikszPomniejszKolor _ta:Katalog _danych:_Oglne_Orientacja:Drukujchemtool: nie mona wczyta czcionek nieprawidowe ustawienie kta %d nieprawidowe ustawienie tekstu %d minusbez numeracjinie H,bez numeracjinie-Horbital pplusprzegrupowaniebez_nazwychemtool-1.6.14/po/pt_PT.gmo0000666000175000001440000005554112202261360015006 0ustar martinusersQ>-@n*% # 1BIa/*->X  (' 5L]t|    0I P\c $$C$%%1% 8%C%$T%y% %%%%%%% %%& &&/&H&!a& &!& &"& '%$'J'f'%y''''!'(#0(T(r(,( ((((( () )) /) 9)D)G)'L)t)z)))))))) ) ) * **)*1* 6* @* M*W*^*m* * *** ***!*+ ++1+6+M+ _+k+s+-{++ +%++ + , ,*,:,>,C,F, K,V,[, w, , , ,,,},#9-#]-----"---- .. 1.?.H.)M.!w...... .. .// ,/ 7/E/ J/ U/ a/l///// ///00.0?0G0)N0x0 0 0 00C0001 1 1 %131:1?1X1_1c1v11 1 11111 122 2&2 +292[A2L3>3)46B4'y4*4.4/4+5>5F5f5;6)A6_k6 6666 7 7479S7%77777 78 8 8"8(A8j8 r8 88 88888 88'8!9A9R9Y9IJdJJJJ JJ'JJ K KK/K8KMKkKrKKK KK'K#K,L%4L%ZL%L&L%L1L/%MUM0mM6M#M"M5N.RN1N,N*N6 O BOMOTOYOoOOOOO O OOO1O P!P*P CPdPPPPP PP PPPPQ Q Q%Q.Q7QHQ ^Q kQxQQ QQQ(QQR&R6R?R_R wRRR7RR*R/R.S 6SAS ^ShS|SSSS SS"S SSSS TTT@T?T*U3U_.\mIVe~w)rnX| u%7Nx[{U;,O6CT<vobh?'}c-K1Ak:jEDd ZY!(5s2H 3]y&0z t"=@BS/pM `^qJWF Choose orientation (Ctrl-Mouse1 for z), press Enter when done Drawing exported as %s (%d bonds, %d labels) Drawing printed! Drawing saved in %s (%d bonds, %d labels) Failed to print drawing ! Helper process failed - %s %s %s %s! Imported %d bonds and %d labels Next ring drawn will have %d sides Nothing to save Ready Writing to %s failed ! Chemtool Version 1.6.14 by Martin Kroeker, Radek Liboska, Michael Banck and Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dumping current drawing to file crashdump.cht %s does not appear to be a Chemtool file %s was created by a newer version. Some features may be lost. OtherSaving and ExportingAboutAbout ChemtoolAdamantaneAddAdd filled _white rectangle under labelsAdd filled white rectangle under labelsAdd fragment from fileAdd from file...Add template structureAdenineAllAmino AcidsAzuleneBackboneBackground color :Base bond _length:Base bondlength (10.668mm) :BenzeneBenzimidazoleBinaphthylBiphenylBondsCaffeineCalculate Formula MassCalculate Formula WeightCancelCarbocyclesCenterCenter molecule in drawing areaChoose default bond typeClean up drawingClearClick and drag the mouse to draw bonds on the canvas. The right mouse button is used to delete objects - either bonds or text depending on which drawing mode is active. The buttons with different ringtypes on them select drawing modes with preferred angles, but you can actually draw at any angle in all modes. The button with the segmented line on it lets you draw curves by marking control points along the curve (a cubic spline). You can select the bondtype and color using the appropriate button or change them later by clicking on the desired bond in Bonds mode. To draw a cyclic system, simply press the Ctrl key together with the number key corresponding to the number of sides for the polygon, and then draw one side while pressing the Ctrl button. For drawing labels, write them into the text box in the top right of the window and place them on the canvas with the mouse. You can also use a number of keyboard shortcuts for common labels while in bond drawing mode: Simply press the 'c' key, or n,o,p,s,f to add the element symbol at the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl, * for a big dot. The keys of the numeric keypad each insert an 'electron pair' line around an atom symbol in the position corresponding to the location of the key around the center of the numeric keypad. The text mode uses the following prefixes for special text: _ for subscripts, ^ for superscripts, @ for symbols (greek characters), | for italic (slanted) characters and # for bold text. When the text box is empty, clicking on any label in the drawing area copies that label into the box for reuse. Drawing is best done with the mouse, but you can also use the cursor keys in combination with the Ctrl key for exact positioning. When used with the Alt key, the cursor keys move the rectangular or rhombic grid that can be projected on the drawing area. If you need general drawing functions not provided by chemtool, try exporting to fig format and editing your figure in Brian Smith's xfig program. Its companion transfig/fig2dev is required by chemtool for printing and for exporting to eps or LaTeX, while the fig, XBM and SVG output are generated directly. Another useful and highly recommended helper program is Babel - either in its original version, or in the form of the new OpenBabel project. Using either version, chemtool is able to import foreign data from a variety of file formats, while only molfile im- and export is built into chemtool. More help is available in the manual page for chemtool and in the file README included in the source distribution as well as on the website. This should normally get installed in /usr/share/doc/packages/chemtool. If you find any bugs or have a question or suggestion, please contact the main author, martin@ruby.chemie.uni-freiburg.deCloseConfigurable optionsConsider installing Babel/OpenBabel for file format conversions... CopyCopy marked objectCreateCreate DirCreate DirectoryCreate EPS, XFig, PicTeX or XBM fileCycloheptatrieneCyclohexaneCyclooctatetraeneCyclopentadienylCytosineData directory:Decrease zoom scaleDeleteDelete FileDiazoleDicyclopentadieneDirectoriesDirectory name:Directory unreadable: %sDouble bond _separation:Doublebond separation (4 pixel) :Draw at 0/30/60/90 degree anglesDraw at 0/36/72/... degree anglesDraw at 0/45/90... degree anglesDraw at 18/54/90/... degree anglesDraw braces around objectDraw brackets and boxes around objectDraw brackets around objectDraw centered textDraw curves based on 4 control pointsDraw fancy box around objectDraw left-justified textDraw right-justified textDraw round brackets around objectDraw rounded box around objectDraw rounded brackets around objectDraw shaded box around objectDraw simple box around objectDrawing saved in %s (%d bonds, %d labels) E_xtension:EditErrorError loading %s Evans auxiliaryExit ChemtoolExportExport (Babel)Export via BABEL...Export...Extension:FWFileFile %s already exists ! Overwrite it ?FilesFirstFlip horizontallyFlip object horizontallyFlip object verticallyFlip verticallyFluoreneFructoseFucoseFulvaleneFuranose coreGalactoseGlucoseGrid rect/rhomb/offGuanineHelpHeptaleneHeterocyclesImidazoleImportImport (Babel)Import MDL file...Import MOLImport PDBImport PDB file...Import via BABEL...ImportPDBIncrease zoom scaleIndeneInvalid math somewhere (SIGFPE) -LactoseLandscapeLatex / EPS scale factor :LoadLoad a chemtool sketchLoad from file...Looking in:MaltoseMannoseMark objects for moving, rotating or deletingMask:Memory access problem (SIGBUS) -Memory allocation problem (SIGSEGV) -MorphineMorphine 3DMove marked objectNaphthaleneNeuraminic acidNewNextNoNoneNorbornaneOpenOrdered to quit (SIGHUP) - Orientation:PDB labels:Paper si_ze:Paper size:PorphinePortraitPrefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0Preview image to add to _EPS files:Preview image to add to eps files :PreviousPrintPrint _command:Print command:Print file to a postscript printerPrint sc_ale factor:Print scale factor :Printer _name:Printer name:Problems converting %s Pyranose corePyrazoleQuitRead a file written in MDL/molfile formatRead a file written in PDB formatReadyRedoRemove moleculeRemoves duplicate bonds, etc.RenameRename FileRescale marked objectRibofuranoseRotate marked objectSAMP auxiliarySDF entry:SDF entry: %dSaveSave As...Save ConfigSave as...Save default optionsSave sketch to fileSelect background colorSelect current text sizeSelect pen colorSelection: Set current textfontSetup DefaultsSetup default optionsSpiro[4.5]decaneSteroid backboneSucroseSugarsSupport national character sets in labelsSymbolsTIFF colorTemplatesTemplates...Text :The current drawing is not saved ! Do you really wish to continue ?ThymineToggle bond typesToolsUnable to open %s UndoUnknown errorUracilViewWriting to %s failed ! XyloseYes_Background color:_Data directory:_General_Orientation:_Printingchemtool: can't load any font invalid angle mode %d invalid text mode %d minusno numbersnon H,no numbersnon-Hp orbitalplusrearrangementunnamedProject-Id-Version: Chetool 1.6.11 Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de POT-Creation-Date: 2007-05-23 23:58+0200 PO-Revision-Date: 2007-07-30 16:47+0200 Last-Translator: Nuno Azoia Language-Team: European Portuguese MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Escolha a orientação (Ctrl-Mouse1 para z), carregue Enter quando terminar O esquema foi exportado como %s (%d ligações, %d etiquetas) O esquema foi impresso! Esquema guaardado em %s (%d ligações, %d etiquetas) Não foi possível imprimir o esquema! O processo de ajuda falhou - %s %s %s %s! Foram importadas %d ligações e %d etiquetas O próximo anel a ser desenhado terá %d lados Nada para guardar Pronto O processamento de %s falhou ! Chemtool Version 1.6.14 autores Martin Kroeker, Radek Liboska, Michael Banck e Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html despejando o desenho actual para o ficheiro crashdumo.cht %s não parece ser um ficheiro Chemtool %s foi criado por uma versão mais recente. É possível que se percam alguma configurações. OutroGuardar e ExportarSobreSobre o ChemtoolAdamantanoAdicionarAdicionar rectângulos brancos debaixo das etiquetasAdicionar um rectângulo branco por debaixo das etiquetasAdicionar um fragmento de um ficheiroAdicionar ficheiro...Adicionar uma estrutura modeloAdeninaTudoAminoácidosAzulenoEsqueletoCor do fundo:Comprimento base de _ligaçãoComprimento base de ligação (10.668mm)BenzenoBenzimidazolBinaftiloBifeniloLigaçõesCafeínaCalcular a massa da fórmulaCalcular Peso MolecularCancelarCarbocíclosCentrarCentrar a molécula na área de desenhoSeleccionar o tipo de ligaçãoLimpar o esquemaLimparCom o botão esquerdo pressionado, arraste o rato para desenhar ligaçãoes. O botão direito é utilizado para apagar objectos - tanto ligações como texto dependendo do modo de edição que estiver activo. Na barra do programa, os butões com anéis desenhados permitem a selecção de diferentes modo de desenho, cada um dos quais com diferentes ângulos de ligação pré-definidos. Estes ângulos pré-definidos são apenas uma orientação, uma vez que é possível desenhar com qualquer ângulo de ligação em todos os modos. O botão com uma linha segmentada permite desenhar curvas marcando 4 pontos de controlo ao longo da curva (trata-se de uma curva spline de aproximação, uma vez que a linha não passa obrigatoriamente pelos pontos de controlo). Para desenhar um sistema cíclico, pressione simultaneamente Ctrl e a tecla correspondente ao número de lados do polígono pretendido. Depois basta desenhar uma ligação mantendo a tecla Ctrl pressionada. O polígono irá nascer partindo da ligação desenhada, no sentido dos ponteiros do relógio. Se não seleccionar o número de lados do polígono, então o sistema irá desenhar por defeito um polígono correspondente ao modo de desenho que estiver seleccionado. Pode seleccionar o tipo de ligação e a respectiva cor utilizando os respectivos butões antes de as desenhar, ou então altera-las posteriormente utilizando o modo Ligação. Para desenhar etiquetas, escreva o que pretende na janela de texto, situada na barra de ferramentas, por debaixo dos butões, e depois coloque-a na posição desejada utilizando o botão esquerdo do rato. É possível utilizar alguns atalhos do teclado principal para as etiquetas mais comuns, enquanto está a desenhar a estrutura: as teclas c,o,p,s,l adicionam o elemento correspondente no final da última ligação desenhada, ou então no sítio seleccionado com o botão esquerdo do rato. As teclas 1,2 e 3 adicionam respectivamente um grupo CH, CH_2 e CH_3. A tecla 'l' adiciona um átomo de cloro e o * adiciona um ponto grande. O teclado numérico inser um par de electrões não partilhados à volta do átomo, na mesma posição relativa que cada tecla ocupa relativamente à tecla 5 No modo de texto pode utilizar alguns prefixos para formatar o caracter seguinte: _ para caracteres em índice, ^ para expoentes, @ para símbolos (caracteres gregos), | para caracteres em itálico e # para texto em negrito (bold). Quando a caixa de texto está vazia, se carregar numa etiqueta presente no esquema copia essa mesma etiqueta para a área de texto para a reutilizar e/ou editar. A melhor método para desenhar é utilizar o rato, mas também pode utilizar as teclas do cursor em combinação com a tecla Ctrl para um posicionamento exacto. Quando utilizado em conjunto com a tecla Alt, o cursor move-se apenas ao longo da rectangular ou da rede rômbica que pode ser projectada na área de desenho. Se necessitar de funções em termos de desenho que não estão disponíveis no Chemtool, experimente exportar o esquema no formato fig e então editar a figura no Programa XFig (de Brian Smith e outros). Na realidade o Chemtool necessita de um programa associado a este, o transfig/fig2dev, para a impressão de esquemas e e para exportar os esquemas para o formato eps e LaTex, por exemplo. Outros formatos, como sejam fig, XBM e SVG são gerados directamente pelo Chemtool. Outro programa que é muito útil e altamente recomendado é o Babel, quer seja no seu formato original ou na forma do projecto de código aberto OpenBabel. Utilizando qualquer um destes programas o Chemtool é capaz de importar (e exportar) dados de (e para) uma grande variedade de tipos de ficheiros, produzidos por muitos outros programas de desenho de moléculas, enquanto que sem o Babel apenas é possível importar e exportar ficheiros mol Está disponível mais informação e ajuda no manual do Chemtool (#man chemtool) e no ficherio README incluido no ficheiro do código de fonte e na página de internet. Este ficheiro está normalmente instalado em /usr/share/doc/packages/chemtool. Se encontrar algum 'bug' no programa, ou se tiver alguma questão ou comentário por favor contacte o autor principal, martin@ruby.chemie.uni-freiburg.deFecharOpções configuráveisConsidere a hipótese de instalar Babel/OpenBabel para a conversão de outros tipos de ficheiros... CopiarCopiar o objecto seleccionado CriarCriar DirCriar directoriaCriar ficheiro EPS, XFig, PicTeX ou XBMCicloheptatrienoCiclohexanoCiclooctatetraenoCiclopentadienilCitosinaDirectoria de dados:Diminuir o tamanho do esquemaApagarApagar ficheiroDiazolDiciclopentadienoDirectoriasNome da directoria:Não é possível ler da directoria: %sE_spaçamento das licações duplasEspaçamento das ligações duplas (4 pixel)Desenhar ângulos de 0/30/60/90 grausDesenhar ângulos de 0/36/72... grausDesenhar ângulos de 0/45/90... grausDesenhar ângulos de 18/54/90... grausDesenhar chavetas à volta do objectoDesenhar parêntesis e caixas à volta do objectoDesenhar parêntesis rectos à volta do objectoAdicionar text centradoDesenhar curvas baseadas em 4 pontos de controloDesenhar caixa com duplo sombreado à volta do objectoAdicionar text alinhado à esquerdaAdicionar text alinhado à direitaDesenhar parêntesis arredondados à volta do objectoDesenhar caixa arredondada à volta do objectoDesenhar parêntesis redondos à volta do objectoDesenhar caixa sombreada à volta do objectoDesenhar caixa simples à volta do objectoEsquema gravado em %s (%d ligações, %d etiquetas) E_xtensãoEditarErroErro ao carregar %s Auxiliar de EvansSair do ChemtoolExportarExportar (Babel)Exportar via BABEL...Exportar...Extensão:PMFicheiroO ficheiro %s Já existe ! Quer gravar por cima ?FicheirosPrimeiroInverter horizontalmenteInverter o objecto na horizontalInverter o objecto na verticalInverter verticalmenteFluorenoFructoseFucoseFulvalenoEstrutura das furanosesGalactoseGlucoseRede rect/romb/sem redeGuaninaAjudaHeptalenoHeterocíclosImidazolImportarImportar (Babel)Importar ficheiro MDLImportar MOLImportar PDBImportar ficheiro PDB...Importar via BABELImportarPDBAumentar o tamanho do esquemaIndenoMatemática inválida algures (SIGFPE) -LactosePaisagemFactor de ampliação para Latex / EPSCarregarCarregar um esquema do ChemtoolCarregar do ficheiro...Procurar em:MaltoseManoseSelecionar os objectos para os mover, rodar ou eliminarFiltro:Problemas no acesso à memória (SIGBUS) -Problemas de alocação de memória (SIGSEGV) -MorfinaMorfina 3DMover o objecto seleccionadoNaftalenoÁcido NeuramínicoNovoPróximoNãoNenhumaNorbornanoAbrirRecebeu ordem para sair (SIGHUP) -Orientação:Etiquetas PDB:Tamanho do papelTamanho do papel:PorfirínaRetratoAntes de qualquer caracter adicione _ para índice, ^ para expoente,@ para símbolos, | para itálico, # para negrito; p.e. H_2O, @a_D^2^0Imagem de pré-visualização para adicionar aos ficheiros _EPS:Imagem de pré-visualização para adicionar aos ficherios eps:AnteriorImprimir_Comando de Impressão:Comando de impressão:Imprimir o ficheiro numa impressora postscriptFactor de esc_ala da impressãoFactor de escala da impressão:_Nome da Impressora:Nome da Impressora:Ocorreram problemas ao converter %s Estrutura das piranosesPirazolSairLer um ficheiro escrito no formato MDL/molfileLer um ficheiro escrito no formato PDBProntoRefazerRemover a moléculaRemover ligações duplicadas, etcMudar o nomeAlterar o nome ao ficheiroAumentar o diminuir o objecto seleccionadoRibofuranoseRodar o objecto seleccionadoAuxiliar SAMPEntrada SDF:Entrada SDF: %dGuardarGuardar como...Guardar configuraçõesGuardar como...Guardar opções normaisGuardar um desenho para um ficheiroSeleccione a cor de fundoSeleccionar tamanho do textoSeleccionar a cor das linhasSelecção:Seleccionar o tipo de letraConfiguraçõesOpções normais do SetupSpiro[4.5]decanoEstrutura dos esteróidesSacaroseAçúcaresSuporte de conjuntos de caracteres nacionais nas etiquetasSímbolosTIFF coloridoModelosModelos...Texto :O esquema actual não está guardado ! Tem a certeza que quer continuar ?TiminaModifiquar o tipo de ligaçãoFerramentasNão foi possível abrir %s DesfazerErro desconhecidoUracilVerO processamento de %s falhou ! XiloseSimCor do fundo:_Directoria de dados_Geral_OrientaçãoIm_pressãoChemtool: naõ consegue carregar nenhum tipo de letra modo de ângulo inválido %d modo de texto inválido %d Sinal menossem númerossem H's, sem númerossem H'sOrbital pSinal maisRearranjosemtitulochemtool-1.6.14/po/Makevars0000644000175000001440000000344210715417303014744 0ustar martinusers# 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 = Martin Kroeker # 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 = martin@ruby.chemie.uni-freiburg.de # 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 = chemtool-1.6.14/po/Rules-quot0000666000175000001440000000337612202253330015254 0ustar martinusers# 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 chemtool-1.6.14/po/pt_BR.gmo0000666000175000001440000004746612202261360014775 0ustar martinusersL3|H>I-*% 4#Uy/E*u> (',Tk|   !8Q Xdk ""C"!#&#9#B# I#T#$e## ####### # $ $($8$ Q$!r$ $"$$%$%4%%G%m%%%!%%#%"&@&,^& &&&& &&&& & &''' '2'8'J'c'z''' ' ' ''''' ' ''(( '( 2(=(P( d(n((!( ((((( ( )-)@) F)%g)) ))))) ))) ) * * *&*/*}8*#*#**++"#+F+[+p+ ++ ++)+!+, ,,,=, D,P, f,s,, , , ,,,,, --&-5-K-\-m-u-|- - --C---... .,.3.8.Q.X.\.d.m.u.~.. . ..../ //(/ ./8/ =/K/gS/G03171-I1w1'1$1'1 22%2?2-2+3Q3333 3 3&3%33424N4V4 \4i4q44'44 44444 5#5+5 15&=5d555Q 5@@> AHAOAfAoA uAA%AA AAAAAB%B,B;B MBXBkB&B'B'B(B!%C1GC$yCC-C'C D/D%OD0uD%D.D,D/(E XEcEjEoEEEEE E EEE!EFF"FAF^FpFyF FF FFFFF FFFFG &G 3G@GXG kGwGG'G GGGGH H'H(.HWH*`H+HH HHHHH HI I (I 4IAITIfInI~wI-I,$JQJZJqJ-JJJJJ K$K:K$?KdKKKK KKKK KLL%L 4LBLQLlLLL LLLLLM(M1M:MCM JMTM>\MMM MMMMMMN N'N+N3N;NCNKN[N pN}N+NNNN NNO OO #O-O*b }E`2K698nA'Jaf7{O|<%=.ijQZ?4v, 1;PgN: ^_&$d0@U)o+mx# Dse]t~YR3/ qprH5LIwWkB!>Vyuz[cFS\(TlGMh C"-X Choose orientation (Ctrl-Mouse1 for z), press Enter when done Drawing exported as %s (%d bonds, %d labels) Drawing printed! Drawing saved in %s (%d bonds, %d labels) Failed to print drawing ! Helper process failed - %s %s %s %s! Imported %d bonds and %d labels Next ring drawn will have %d sides Nothing to save Ready Writing to %s failed ! Chemtool Version 1.6.14 by Martin Kroeker, Radek Liboska, Michael Banck and Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dumping current drawing to file crashdump.cht %s does not appear to be a Chemtool file %s was created by a newer version. Some features may be lost. AboutAbout ChemtoolAdamantaneAddAdd filled _white rectangle under labelsAdd filled white rectangle under labelsAdd fragment from fileAdd from file...Add template structureAdenineAllAmino AcidsAzuleneBackground color :Base bond _length:Base bondlength (10.668mm) :BenzeneBinaphthylBiphenylBondsCaffeineCalculate Formula MassCalculate Formula WeightCancelCarbocyclesCenterCenter molecule in drawing areaChoose default bond typeClean up drawingClearClick and drag the mouse to draw bonds on the canvas. The right mouse button is used to delete objects - either bonds or text depending on which drawing mode is active. The buttons with different ringtypes on them select drawing modes with preferred angles, but you can actually draw at any angle in all modes. The button with the segmented line on it lets you draw curves by marking control points along the curve (a cubic spline). You can select the bondtype and color using the appropriate button or change them later by clicking on the desired bond in Bonds mode. To draw a cyclic system, simply press the Ctrl key together with the number key corresponding to the number of sides for the polygon, and then draw one side while pressing the Ctrl button. For drawing labels, write them into the text box in the top right of the window and place them on the canvas with the mouse. You can also use a number of keyboard shortcuts for common labels while in bond drawing mode: Simply press the 'c' key, or n,o,p,s,f to add the element symbol at the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl, * for a big dot. The keys of the numeric keypad each insert an 'electron pair' line around an atom symbol in the position corresponding to the location of the key around the center of the numeric keypad. The text mode uses the following prefixes for special text: _ for subscripts, ^ for superscripts, @ for symbols (greek characters), | for italic (slanted) characters and # for bold text. When the text box is empty, clicking on any label in the drawing area copies that label into the box for reuse. Drawing is best done with the mouse, but you can also use the cursor keys in combination with the Ctrl key for exact positioning. When used with the Alt key, the cursor keys move the rectangular or rhombic grid that can be projected on the drawing area. If you need general drawing functions not provided by chemtool, try exporting to fig format and editing your figure in Brian Smith's xfig program. Its companion transfig/fig2dev is required by chemtool for printing and for exporting to eps or LaTeX, while the fig, XBM and SVG output are generated directly. Another useful and highly recommended helper program is Babel - either in its original version, or in the form of the new OpenBabel project. Using either version, chemtool is able to import foreign data from a variety of file formats, while only molfile im- and export is built into chemtool. More help is available in the manual page for chemtool and in the file README included in the source distribution as well as on the website. This should normally get installed in /usr/share/doc/packages/chemtool. If you find any bugs or have a question or suggestion, please contact the main author, martin@ruby.chemie.uni-freiburg.deCloseConfigurable optionsConsider installing Babel/OpenBabel for file format conversions... CopyCopy marked objectCoroneneCreateCreate DirCreate DirectoryCreate EPS, XFig, PicTeX or XBM fileCycloheptatrieneCyclohexaneCyclooctatetraeneCyclopentadienylCytosineData directory:Decrease zoom scaleDeleteDelete FileDicyclopentadieneDirectoriesDirectory name:Directory unreadable: %sDraw at 0/30/60/90 degree anglesDraw at 0/36/72/... degree anglesDraw at 0/45/90... degree anglesDraw at 18/54/90/... degree anglesDraw braces around objectDraw brackets and boxes around objectDraw brackets around objectDraw centered textDraw curves based on 4 control pointsDraw fancy box around objectDraw left-justified textDraw right-justified textDraw round brackets around objectDraw rounded box around objectDraw rounded brackets around objectDraw shaded box around objectDraw simple box around objectDrawing saved in %s (%d bonds, %d labels) E_xtension:EditErrorError loading %s Exit ChemtoolExportExport (Babel)Export via BABEL...Export...Extension:FWFileFile %s already exists ! Overwrite it ?FilesFlip horizontallyFlip object horizontallyFlip object verticallyFlip verticallyFluoreneFructoseFulvaleneFuranose coreGalactoseGlucoseGrid rect/rhomb/offGuanineHelpHeptaleneHeterocyclesImportImport (Babel)Import MDL file...Import MOLImport PDBImport PDB file...Import via BABEL...ImportPDBIncrease zoom scaleIndeneInvalid math somewhere (SIGFPE) -LandscapeLatex / EPS scale factor :LoadLoad a chemtool sketchLoad from file...Looking in:MannoseMark objects for moving, rotating or deletingMask:Memory access problem (SIGBUS) -Memory allocation problem (SIGSEGV) -Move marked objectNaphthaleneNeuraminic acidNewNoNoneNorbornaneOpenOrdered to quit (SIGHUP) - Orientation:PDB labels:Paper si_ze:Paper size:PorphinePortraitPrefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0Preview image to add to _EPS files:Preview image to add to eps files :PrintPrint _command:Print command:Print file to a postscript printerPrint sc_ale factor:Print scale factor :Printer _name:Printer name:Problems converting %s Pyranose coreQuitRead a file written in MDL/molfile formatRead a file written in PDB formatReadyRedoRemove moleculeRemoves duplicate bonds, etc.RenameRename FileRescale marked objectRibofuranoseRotate marked objectSaveSave As...Save ConfigSave as...Save sketch to fileSelect background colorSelect current text sizeSelect pen colorSelection: Set current textfontSetup DefaultsSetup default optionsSpiro[4.5]decaneSteroid backboneSucroseSugarsSymbolsTemplatesTemplates...Text :The current drawing is not saved ! Do you really wish to continue ?ThymineToggle bond typesToolsUnable to open %s UndoUnknown errorUracilViewWriting to %s failed ! XyloseYesZoom InZoom OutZoom inZoom out_Background color:_Data directory:_Orientation:_Printingchemtool: can't load any font invalid angle mode %d invalid text mode %d minusno numbersnon H,no numbersnon-Hp orbitalplusrearrangementunnamedProject-Id-Version: Chemtool 1.6.1 Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de POT-Creation-Date: 2007-05-23 23:58+0200 PO-Revision-Date: 2004-03-18 09:44BRST Last-Translator: Flvio M. Matsumoto Language-Team: Brazilian Portuguese MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Escolha orientao (Ctrl-Mouse1 para z), pressione Enter quando pronto Figura exportada como %s (%d ligaes, %d rtulos) Figura impressa! Figura salva em %s (%d ligaes, %d rtulos) Erro na impresso da figura ! Processo externo falhou - %s %s %s %s! Importados %d ligaes e %d rtulos O prximo anel desenhado ter %d lados Nada para salvar Pronto Erro ao gravar para %s ! Chemtool Verso 1.6.14 por Martin Kroeker, Radek Liboska, Michael Banck e Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html salvando figura corrente para crashdump.cht %s no parecer ser um arquivo do Chemtool %s foi criado por uma verso mais nova. Algumas caractersticas podem se perder. SobreSobre ChemtoolAdamantanoAdicionarAdiciona retngulo _branco sob rtulosAdiciona retngulo branco sob rtulosAdiciona fragmento do arquivoAdicionar do arquivo...Adiciona estrutura do moldeAdeninaTodosAminos-cidoAzulenoCor do fundo: Comprimento de _ligao base:Comprimento de ligao base (10,668mm):BenzenoBinaftilaBifenilaLigaesCafenaCalcula Massa MolecularCalcular Massa MolecularCancelaAnisCentralizarCentraliza molcula na rea de desenhoEscolhe tipo de ligao padroOrganizar figuraLimparClique e arraste o mouse para desenhar ligaes na tela. O boto direito usado para apagar objetos, ligaes ou texto, dependendo do modo de edio que est ativo. Os botes com diferentes tipos de anis selecionam modos de edio com deter- minados ngulos, mas possvel desenhar em qualquer ngulo em todos os modos. O boto contendo uma linha segmentada permite desenhar curvas marcando-se pontos de controle ao longo da curva (um spline cbico). Voc pode selecionar o tipo de ligao e a cor usando botes apropriados ou mudar depois clicando na ligao desejada, no modo Ligaes. Para desenhar um sistema cclico, pressione Ctrl junto com a tecla do nmero correspondente ao nmero de lados do polgono, e ento desenhe uma dos lados enquanto pressiona a tecla Ctrl. Para adicinar rtulos, escreva-o na caixa de texto na parte superiordireita da janela e os posicione-os na tela com o mouse. Podem-se usar alguns atalhos de teclado para rtulos comuns durante o modo de desenho de ligao: Pressione a tecla 'c', or n, o, p, s, f para adicionar o smbolo do elemento na posio corrente de desenho, 1, 2 e 3 para CH, CH_2 e CH_3, l para Cl, e * para um ponto grande. As teclas do teclado numrico insere uma linha de 'par eletrnico' ao redor do smbolo do tomo na posio correspondente localizao da tecla ao redor do centro do teclado numrico (5). O modo texto usa os seguintes prefixos para formatao: _ para ndices, ^ for expoentes, @ para smbolos (caracteres gregos), | para caracteres em itlico e # para negrito. Quando a caixa de texto estiver vazia, ao clicar em qualquer rtulo na rea de desenho copia-se o rtulo na caixa para se poder usar de novo. O desenho feito mais facilmente com o mouse, mas se pode usar as teclas do cursor junto com o Ctrl para um posicionamento exato. Quando usado com a tecla Alt, as teclas do cursor move uma grade retangular ou hexagonal que pode ser projetado na rea de desenho. Se for necessria uma funo de desenho que no h no chemtool, exporte em formato fig e edite sua figura no programa xfig do Brian Smith. O trasfig/fig2dev que o acompanha necessrio para que o chemtool imprima e exporte para eps ou LaTeX, enquanto que o fig, XBM e SVG so gerado diretamente. Outro programa auxiliar til e recomendado o Babel - tanto na verso original, como no novo projeto Openabel. Em ambas as verses o chemtool capaz de importar dados de arquivos de formatos variados, enquanto somente a importao e a exportao em formato de arquivo mol est contido no programa chemtools. Mais ajuda pode ser encontrado na pgina de man do chemtool e no arquivo README includo no cdigo fonte ou ainda no site da web. Este arquivo normalmente encontrado em /usr/share/doc/packages/chemtool. Se voc encontrar algum bug, tem uma questo ou sugesto, favor contactar o autor principal, martin@ruby.chemie.uni-freiburg.deFecharOpes configurveisFavor instalar Babel/OpenBabel para converses de arquivos... CopiarCopia objetos marcadosCoronenoCriarCriar dirCriar diretrioCria arquivo EPS, XFig, PicTeX ou XBMCicloeptatrienoCicloexanoCicloctatetraenoCiclopentadieniloCitosinaDiretrio de dados:Reduz escala de zoomApagarApagar arquivoDiciclopentadienoDiretriosNome do diretrio:Diretrio inacessvel: %sDesenha em ngulos de 0/30/60/90 grausDesenha em ngulos de 0/36/72/... grausDesenha em ngulos de 0/45/90/... grausDesenha em ngulos de 18/54/90/... grausDesenha chaves ao redor do objetoDesenha colchetes e retngulos ao redor do objetoDesenha colchetes ao redor do objetoInsere texto centralizadoDesenha curva baseada em 4 pontos de controleDesenha retngulo 3D ao redor do objetoInsere texto alinhado esquerdaInsere texto alinhado direitaDesenha parnteses ao redor do objetoDesenha retngulo arredondado ao redor do objetoDesenha parnteses ao redor do objetoDesenha retngulo sombreado ao redor do objetoDesenha retngulo simples ao redor do objetoFigura salva em %s (%d ligaes, %d rtulos) E_xtenso:EditarErroErro ao carregar %s Sai do ChemtoolExportarExportar (Babel)Exportar via BABELExportar...Extenso:MMArquivoArquivo %s j existe ! Sobrepor ?ArquivosReflexo horizontalReflete objeto horizontalmenteReflete objeto verticalmenteReflexo verticalFluorenoFrutoseFulvalenoEsqueleto de furanoseGalactoseGlicoseGrade retang/hexag/desligGuaninaAjudaHeptalenoHeterocclicosImportarImportar (Babel)Importar arquivo MDL...Importar MOLImportar PDBImportar arquivo PDB...Importar via BABELImportarPDBAmplia escala de zoomIndenoOperao matemtica invlida (SIGFPE) -HorizontalEscala Latex / EPS :CarregarCarrega uma figura do ChemtoolCarregar do arquivo...Examinando:ManoseMarca objeto para mover, girar ou apagarMscara:Problema de alocao de memria (SIGBUS) -Problema de alocao de memria (SIGSEGV) -Move objetos marcadosNaftalenocido neuramnicoNovoNoNenhumNorbornanoAbrirOrdenado para sair (SIGHUP) -Orientao:Rtulos PDB:_Tamanho de papel:Tamanho de papel:PorfinaVerticalAnteceda um caractere com _ para ndice, ^ para expoente, @ para smbolos, | para itlico, # para negrito; e.g. H_2O, @a_D^2^0Visualiza imagem a adicionar a arquivos _eps:Visualiza imagem a adicionar a arquivos eps:Imprimir_Comando de impresso:Comando de impresso:Imprime um arquivo para impressora postscriptE_scala de impresso:Escala de impresso:_Nome da impressora:Nome da impressora:Problemas ao converter %s Esqueleto de piranoseSairL um arquivo em formato MDL/molfileL um arquivo em formato PDBProntoRefazerRemove molculaRemove ligaes duplicadas, etc.RenomearRenomear arquivoMuda escala de objetos marcadosRibofuranoseGira objetos marcadosSalvarSalvar como...Salvar configSalvar como...Salva desenho para arquivoSeleciona cor de fundoSeleciona tamanho da fonteSeleciona cor da penaSeleo: Seleciona fonte do textoConfigurao padroConfigurao padroEspiro[4.5]decanoEsqueleto de esterideSacaroseAcaresSmbolosMoldesMoldes...Texto: A figura corrente no foi salva ! Deseja realmente continuar ?TiminaMuda tipos de ligaesFerramentasNo posso abrir %s DesfazerErro desconhecidoUracilaExibioErro ao gravar para %s ! XiloseSimAmpliarReduzirAmpliarReduzirCor do _fundo: _Diretrio de dados:_Orientao:Imprimirchemtool: no posso carregar nenhuma fonte modo de ngulo invlido %d modo de texto invlido %d menossem nmerossem H, sem nmerossem HOrbital pmaisrearranjosem_nomechemtool-1.6.14/po/Makefile.in.in0000666000175000001440000003020512202253330015712 0ustar martinusers# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.14 PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # 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 -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @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 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ 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); \ else \ cp -p $(srcdir)/$$file $(distdir); \ 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 $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: chemtool-1.6.14/po/de.po0000644000175000001440000007074212202261173014202 0ustar martinusers# SOME DESCRIPTIVE TITLE. # Copyright (C) 2007 Martin Kroeker # FIRST AUTHOR , 2007. # msgid "" msgstr "" "Project-Id-Version: chemtool 1.6.11\n" "Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: 2007-04-15 18:52+0200\n" "Last-Translator: Martin Kroeker\n" "Language-Team: de \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso_8859-1\n" "Content-Transfer-Encoding: iso_8859-1\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" "Die aktuelle Zeichnung ist noch nicht gespeichert!\n" "Wollen Sie wirklich weitermachen ?" #: main.c:225 main.c:293 msgid "Yes" msgstr "Ja" #: main.c:240 main.c:308 msgid "No" msgstr "Nein" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" "Datei\n" "%s\n" "existiert schon !\n" "berschreiben ?" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" "\n" "Der nchste Ring wird mit %d Seiten gezeichnet" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" "\n" "%d Bindungen und %d Texte importiert" #: main.c:1359 main.c:2667 main.c:5829 msgid "unnamed" msgstr "namenlos" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" "\n" "Bereit" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" "\n" "Hilfsprogramm versagte -%s %s %s %s!" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" "\n" "Zeichnung gedruckt!" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" "\n" "Zeichnung konnte nicht gedruckt werden !" #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr "" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr "" #: main.c:2353 msgid "Load from file..." msgstr "Zeichnung laden aus..." #: main.c:2394 msgid "Import MDL file..." msgstr "MDL-Import" #: main.c:2434 msgid "Import via BABEL..." msgstr "" #: main.c:2456 msgid "Export via BABEL..." msgstr "" #: main.c:2478 msgid "Import PDB file..." msgstr "PDB-Import" #: main.c:2521 msgid "Add from file..." msgstr "Zeichnung einfgen aus..." #: main.c:2637 msgid "Save as..." msgstr "Speichern als..." #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" "\n" "Nichts zu speichern" #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" "\n" "%s konnte nicht geschrieben werden !" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" "\n" "Zeichnung als %s\n" " gespeichert (%d Bindungen, %d Texte)" #: main.c:2821 main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" "%s\n" "konnte nicht geschrieben werden !\n" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" "\n" "Zeichnung als %s exportiert (%d Bindungen, %d Texte)" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "SDF-Eintrag: %d" #: main.c:2979 main.c:3060 main.c:3101 main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr "%s konnte nicht geffnet werden\n" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" "%s\n" "scheint keine Chemtool-Zeichnungsdatei zu sein\n" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" "%s wurde mit einer neueren Version erstellt.\n" "Mglicherweise gehen Details verloren.\n" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr "%s konnte nicht geladen werden\n" #: main.c:3048 main.c:3089 main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" "\n" "Orientierung whlen (Strg-Maus1 fr z), mit Eingabetaste festlegen" #: main.c:3067 main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr "Probleme bei der Konvertierung von %s\n" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" "Zeichnung als\n" "%s\n" "gespeichert (%d Bindungen, %d Texte)\n" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" "Durch Markieren und Ziehen der Maus knnen Bindungen gezeichnet werden.\n" "Mit der rechten Maustaste werden Objekte gelscht - entweder Bindungen oder\n" "Text, je nachdem welcher Zeichenmodus gerade aktiv ist.\n" "\n" "Die Schaltflchen mit den verschiedenen Ringsymbolen whlen Zeichenmodi\n" "mit voreingestellten Winkeln aus, es knnen jedoch immer auch beliebige\n" "Winkel gezeichnet werden.\n" "\n" "Die Schaltflche mit dem Linienzug erlaubt das Zeichnen von Bezierkurven\n" "durch Angabe der Sttzstellen fr die Kurve\n" "Bindungsart und -farbe knnen mit den jeweiligen Knpfen voreingestellt\n" "werden, oder auch nachtrglich durch Anklicken im Modus 'Bindung' gendert\n" "werden.\n" "Zum Zeichnen von Ringen gengt es, Strg und die entsprechende Zifferntaste\n" "zu drcken, um die Grsse zu whlen, und dann eine Ringseite mit\n" "gedrckter Strg-Taste zu zeichnen\n" "\n" "Atomsymbole und beliebiger Text knnen nach Eintrag in die Textzeile an " "jeder\n" "Stelle in der Zeichnung abgesetzt werden. Zum raschen Setzen von Atom-\n" "symbolen beim Zeichnen steht auch eine Reihe von Krzeln zur Verfgung:\n" "Drcken der Tasten c,n,o,p,s oder f im Zeichenmodus fgt das entsprechende\n" " Element an der aktuellen Zeichenposition ein, 1,2,3 steht fr eine CH- ," "CH2\n" "oder CH3-Gruppe, l fr Cl und * fr einen dicken Punkt.\n" "\n" "Mit den Tasten des Ziffernblocks knnen Elektronenpaare um ein Atomsymbol\n" "gesetzt werden. Stellt man sich das Atom auf der 5 vor, so fgen die \n" "umgebenden Tasten jeweils den Elektronenpaar-Strich jeweils in ihrer\n" "Position ein.\n" "\n" "Zum Wechsel von Schriftart und Position dienen die folgenden Zeichen, die\n" "jeweils auf den nachfolgenden Buchstaben wirken:\n" "_ fr Tiefstellung, ^ fr Hochstellung, @ fr Symbole und griechische Buch-\n" "staben, | fr kursiven und # fr fettgedruckten Text.\n" "Wenn die Textbox leer ist, kann ein Text aus der Zeichnung durch Anklicken\n" "hineinkopiert werden.\n" "\n" "Das Zeichnen geht am Besten mit der Maus, der Cursor kann aber auch z.B.\n" "zum exakteren Positionieren mit den Cursortasten bewegt werden.\n" "Mit der Alt-Taste kombiniert, bewegen die Cursortasten das einblendbare\n" "quadratische oder hexagonale Raster.\n" "\n" "Praktisch alle von chemtool nicht bereitgestellten Zeichenfunktionen und\n" "weitere Schriftarten bietet das Programm XFig von Brian Smith. Dessen\n" "Schwesterprogramm transfig/fig2dev wird von chemtool zum Drucken und zum\n" "Erzeugen von EPS- und LaTeX-Dateien gebraucht, whrend die Dateiformate\n" "fig (fr XFig), XBM (bitmap) und SVG direkt erzeugt werden.\n" "Ein weiteres empfehlenswertes Programm ist Babel bzw. OpenBabel.\n" "Wenn es installiert ist, kann chemtool es zum Einlesen vieler Fremdformate\n" "benutzen - ohne babel knnen immerhin noch PDB- und MOL-Dateien einge-\n" "lesen werden.\n" "Mehr Informationen finden sich auf der Handbuchseite, im README (vermutlich\n" "in /usr/share/doc/packages/chemtool installiert) sowie auf der Webseiten.\n" "Fehlerbeschreibungen, Fragen, Wnsche und Anregungen bitte an\n" "martin@ruby.chemie.uni-freiburg.de schicken." #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" " Chemtool Version 1.6.14\n" "von\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "und\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" #: main.c:3450 msgid "PDB labels:" msgstr "PDB-Label" #: main.c:3453 msgid "All" msgstr "Alle" #: main.c:3461 msgid "non-H" msgstr "nicht-H" #: main.c:3470 msgid "no numbers" msgstr "ohne Nummern" #: main.c:3479 msgid "non H,no numbers" msgstr "ohne H u.Nummern" #: main.c:3489 main.c:3833 main.c:4139 msgid "None" msgstr "Keine" #: main.c:3501 msgid "SDF entry:" msgstr "SDF-Eintrag:" #: main.c:3504 msgid "First" msgstr "Erster" #: main.c:3511 msgid "Previous" msgstr "Voriger" #: main.c:3518 msgid "Next" msgstr "Nchster" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr "Skalierungsfaktor fr Latex / EPS :" #: main.c:3708 msgid "Unknown error" msgstr "Unklarer Fehler" #: main.c:3732 main.c:4010 msgid "Configurable options" msgstr "Einstellungen" #: main.c:3767 msgid "_General" msgstr "_Allgemein" #: main.c:3788 msgid "Display" msgstr "Anzeige" #: main.c:3794 msgid "Saving and Exporting" msgstr "Speichern und Exportieren" #: main.c:3800 msgid "Other" msgstr "Sonstige" #: main.c:3811 msgid "_Background color:" msgstr "Hintergrundfar_be:" #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr "Texte _weiss unterlegen" #: main.c:3834 main.c:4148 msgid "EPSI" msgstr "" #: main.c:3835 main.c:4157 msgid "TIFF mono" msgstr "" #: main.c:3836 main.c:4165 msgid "TIFF color" msgstr "" #: main.c:3841 msgid "_Data directory:" msgstr "_Zeichnungsverzeichnis:" #: main.c:3848 msgid "E_xtension:" msgstr "_Erweiterung:" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr "_Vorschaubildart in EPS-Dateien:" #: main.c:3863 main.c:4184 msgid "Support national character sets in labels" msgstr "Nationale Sonderzeichen in Text untersttzen" #: main.c:3883 msgid "Base bond _length:" msgstr "Standardbindungs_lnge:" #: main.c:3891 msgid "Double bond _separation:" msgstr "Doppelbindungs_abstand:" #: main.c:3904 msgid "_Printing" msgstr "_Drucken" #: main.c:3934 main.c:4049 msgid "Portrait" msgstr "Hochformat" #: main.c:3935 main.c:4054 msgid "Landscape" msgstr "Querformat" #: main.c:3949 msgid "Print _command:" msgstr "Druck_befehl:" #: main.c:3956 msgid "Printer _name:" msgstr "Drucker_name:" #: main.c:3963 msgid "Paper si_ze:" msgstr "Papier_format:" #: main.c:3970 msgid "_Orientation:" msgstr "Aus_richtung:" #: main.c:3977 msgid "Print sc_ale factor:" msgstr "_Skalierungsfaktor:" #: main.c:3993 msgid "Select background color" msgstr "Hintergrundfarbe einstellen" #: main.c:4019 msgid "Paper size:" msgstr "Papierformat:" #: main.c:4044 msgid "Orientation:" msgstr "Ausrichtung:" #: main.c:4069 msgid "Print scale factor :" msgstr "Skalierungsfaktor :" #: main.c:4094 msgid "Print command:" msgstr "Druckbefehl:" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr "Vorschaubildart in EPS-Dateien :" #: main.c:4198 msgid "Background color :" msgstr "Hintergrundfarbe :" #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr "Texte weiss unterlegen" #: main.c:4225 msgid "Printer name:" msgstr "Druckername:" #: main.c:4238 msgid "Data directory:" msgstr "Zeichnungsverzeichnis:" #: main.c:4251 msgid "Extension:" msgstr "Erweiterung:" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr "Standardbindungslnge (10.668mm) :" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "Doppelbindungsabstand (4 pixel) :" #: main.c:4298 msgid "Ok" msgstr "Ok" #: main.c:4308 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "Abbruch" #: main.c:4327 main.c:4912 msgid "Templates" msgstr "Vorlagen" #: main.c:4338 main.c:4340 msgid "Carbocycles" msgstr "Carbocyclen" #: main.c:4378 main.c:4380 msgid "Sugars" msgstr "Zucker" #: main.c:4422 main.c:4424 msgid "Heterocycles" msgstr "Heterocyclen" #: main.c:4466 main.c:4468 msgid "Amino Acids" msgstr "Aminosuren" #: main.c:4511 main.c:4513 msgid "Symbols" msgstr "Symbole" #: main.c:4559 gtkfilesel.c:1196 msgid "Close" msgstr "Schliessen" #: main.c:4605 msgid "New" msgstr "Neu" #: main.c:4613 msgid "Open" msgstr "Laden" #: main.c:4621 main.c:4904 msgid "Add" msgstr "Einfgen" #: main.c:4629 msgid "Import MOL" msgstr "MOL-Import" #: main.c:4637 msgid "Import PDB" msgstr "PDB-Import" #: main.c:4645 msgid "Import (Babel)" msgstr "Import (Babel)" #: main.c:4653 msgid "Export..." msgstr "" #: main.c:4661 msgid "Export (Babel)" msgstr "Export (Babel)" #: main.c:4670 main.c:4941 msgid "Print" msgstr "Drucken" #: main.c:4678 msgid "Setup Defaults" msgstr "Einstellungen" #: main.c:4693 main.c:4960 msgid "Save Config" msgstr "Einstellungen speichern" #: main.c:4702 main.c:4921 msgid "Save" msgstr "Speichern" #: main.c:4710 msgid "Save As..." msgstr "Speichern als..." #: main.c:4719 main.c:5031 msgid "Quit" msgstr "Ende" #: main.c:4727 msgid "File" msgstr "Datei" #: main.c:4734 msgid "Copy" msgstr "Kopieren" #: main.c:4746 msgid "Flip horizontally" msgstr "Waagerecht spiegeln" #: main.c:4752 msgid "Flip vertically" msgstr "Senkrecht spiegeln" #: main.c:4759 msgid "Undo" msgstr "Rckgngig machen" #: main.c:4767 msgid "Redo" msgstr "Wiederholen" #: main.c:4777 msgid "Edit" msgstr "Bearbeiten" #: main.c:4784 msgid "Zoom in" msgstr "Vergrern" #: main.c:4790 msgid "Zoom out" msgstr "Verkleinern" #: main.c:4801 main.c:4996 msgid "Center" msgstr "Zentrieren" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr "Raster quadr./rhomb./aus" #: main.c:4815 msgid "View" msgstr "Ansicht" #: main.c:4823 msgid "Templates..." msgstr "Vorlagen..." #: main.c:4832 msgid "Calculate Formula Weight" msgstr "Summenformel/Molmasse" #: main.c:4840 msgid "Clean up drawing" msgstr "Zeichnung bereinigen" #: main.c:4846 msgid "Tools" msgstr "Werkzeuge" #: main.c:4854 main.c:5039 msgid "About" msgstr "ber" #: main.c:4863 main.c:4872 msgid "Help" msgstr "Hilfe" #: main.c:4895 msgid "Load" msgstr "Laden" #: main.c:4900 msgid "Load a chemtool sketch" msgstr "Ldt eine Chemtool-Zeichnung" #: main.c:4909 msgid "Add fragment from file" msgstr "Fgt ein Strukturfragment aus einer Datei hinzu" #: main.c:4918 msgid "Add template structure" msgstr "Fgt eine Struktur aus den Vorlagen hinzu" #: main.c:4926 msgid "Save sketch to file" msgstr "Speichert die Struktur als Chemtool-Datei" #: main.c:4929 msgid "Export" msgstr "" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "Erzeugt eine EPS-, XFig-, PicTeX- oder XBM-Datei" #: main.c:4947 msgid "Print file to a postscript printer" msgstr "Druckt die Zeichnung auf einem Postscript-Drucker" #: main.c:4950 msgid "Setup" msgstr "" #: main.c:4957 msgid "Setup default options" msgstr "Einstellungen" #: main.c:4966 msgid "Save default options" msgstr "Einstellungen speichern" #: main.c:4969 msgid "Import" msgstr "Import" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr "Importiert eine im MDL/molfile-Format geschriebene Datei" #: main.c:4978 msgid "ImportPDB" msgstr "PDB-Import" #: main.c:4984 msgid "Read a file written in PDB format" msgstr "Importiert eine im PDB-Format geschriebene Datei" #: main.c:4987 msgid "Zoom In" msgstr "Zoom +" #: main.c:4992 msgid "Increase zoom scale" msgstr "Vergrssert die Darstellung" #: main.c:5002 msgid "Center molecule in drawing area" msgstr "Zentriert die Zeichnung in der Zeichenflche" #: main.c:5005 msgid "Zoom Out" msgstr "Zoom -" #: main.c:5010 msgid "Decrease zoom scale" msgstr "Verkleinert die Darstellung" #: main.c:5014 msgid "Clear" msgstr "Neu" #: main.c:5019 msgid "Remove molecule" msgstr "Lscht die Zeichenflche" #: main.c:5022 msgid "FW" msgstr "MW" #: main.c:5027 msgid "Calculate Formula Mass" msgstr "Bestimmt Summenformel und Molekulargewicht" #: main.c:5036 msgid "Exit Chemtool" msgstr "Beendet Chemtool" #: main.c:5045 msgid "About Chemtool" msgstr "ber Chemtool" #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr "Zeichnet mit 0/30/60/90 Grad-Winkelraster" #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr "Zeichnet mit 0/36/72 Grad-Winkelraster" #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr "Zeichnet mit 18/54/90 Grad-Winkelraster" #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr "Zeichnet mit 0/45/90 Grad-Winkelraster" #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr "Zeichnet Kurven anhand von 4 Kontrollpunkten" #: main.c:5174 msgid "Draw left-justified text" msgstr "Schreibt linksbndigen Text" #: main.c:5191 msgid "Draw centered text" msgstr "Schreibt zentrierten Text" #: main.c:5208 msgid "Draw right-justified text" msgstr "Schreibt rechtsbndigen Text" #: main.c:5236 msgid "Set current textfont" msgstr "Schriftart umschalten" #: main.c:5266 msgid "Choose default bond type" msgstr "Voreinstellung der Linienart" #: main.c:5283 msgid "Select pen color" msgstr "ndert die Stiftfarbe" #: main.c:5288 msgid "Bonds" msgstr "Typ" #: main.c:5293 msgid "Toggle bond types" msgstr "ndert den Linientyp" #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr "Markiert ein Fragment zum Verschieben, Drehen, usw." #: main.c:5327 msgid "Move marked object" msgstr "Verschiebt das markierte Objekt" #: main.c:5344 msgid "Rotate marked object" msgstr "Dreht das markierte Objekt" #: main.c:5363 msgid "Flip object horizontally" msgstr "Kippt das Objekt um seine Hochachse" #: main.c:5381 msgid "Flip object vertically" msgstr "Kippt das Objekt um seine Lngsachse" #: main.c:5407 msgid "Copy marked object" msgstr "Kopiert das markierte Objekt" #: main.c:5422 msgid "Rescale marked object" msgstr "Vergrssert oder verkleinert das Objekt" #: main.c:5441 msgid "Draw brackets around object" msgstr "Zeichnet eine eckige Klammer um das Objekt" #: main.c:5456 msgid "Draw rounded brackets around object" msgstr "Zeichnet eine runde Klammer um das Objekt" #: main.c:5471 msgid "Draw round brackets around object" msgstr "Zeichnet eine runde Klammer um das Objekt" #: main.c:5486 msgid "Draw braces around object" msgstr "Zeichnet eine geschweifte Klammer um das Objekt" #: main.c:5501 msgid "Draw simple box around object" msgstr "Zeichnet einen Rahmen um das Objekt" #: main.c:5515 msgid "Draw shaded box around object" msgstr "Zeichnet einen schattierten Rahmen um das Objekt" #: main.c:5529 msgid "Draw fancy box around object" msgstr "Zeichnet einen aufwendigen Rahmen um das Objekt" #: main.c:5543 msgid "Draw rounded box around object" msgstr "Zeichnet einen runden Rahmen um das Objekt" #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr "Zeichnet eine Klammer oder einen Rahmen um das Objekt" #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr "Bereinigt das markierte Objekt (lscht doppelte Bindungen usw.)" #: main.c:5605 msgid "Text :" msgstr "" #: main.c:5619 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "" "Kennzeichnung von Tiefstellungen mit _, Hochstellung mit ^, Sonderzeichen " "mit @, kursiv mit |, fett mit #; z.B. H_2O, @a_D^2^0" #: main.c:5624 msgid "Select current text size" msgstr "ndert die Schriftgre" #: main.c:5753 #, c-format msgid "Ready" msgstr "Bereit" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "chemtool: keine einzige nutzbare Schrift gefunden\n" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr "Speicherverwaltungsfehler (SIGSEGV) -" #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr "Rechenfehler (SIGFPE) -" #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr "Speicherzugriffsfehler (SIGBUS) -" #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr "Per Signal beendet (SIGHUP) -" #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr "sichere aktuelle Zeichnung als crashdump.cht\n" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "Aktuelles Verzeichnis" #: gtkfilesel.c:796 msgid "Directories" msgstr "Verzeichnisse" #: gtkfilesel.c:825 msgid "Mask:" msgstr "Maske:" #: gtkfilesel.c:838 msgid "Files" msgstr "Dateien" #: gtkfilesel.c:872 msgid "OK" msgstr "OK" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "Verzeichnis nicht lesbar: %s" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "Verzeichnis anlegen" #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr "Datei lschen" #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr "Datei umbenennen" #: gtkfilesel.c:1173 msgid "Error" msgstr "Fehler" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "Verzeichnis anlegen" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "Verzeichnisname:" #: gtkfilesel.c:1297 msgid "Create" msgstr "Anlegen" #: gtkfilesel.c:1397 msgid "Delete" msgstr "Lschen" #: gtkfilesel.c:1512 msgid "Rename" msgstr "Umbenennen" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "Auswahl: " #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr "" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "Cyclopentadienyl" #: templates.hx:2 msgid "Benzene" msgstr "Benzol" #: templates.hx:2 msgid "Naphthalene" msgstr "Naphthalin" #: templates.hx:2 msgid "Azulene" msgstr "Azulen" #: templates.hx:3 msgid "Adamantane" msgstr "Adamantan" #: templates.hx:3 templates.hx:5 msgid "Cyclohexane" msgstr "Cyclohexan" #: templates.hx:3 msgid "Steroid backbone" msgstr "Steroidgerst" #: templates.hx:3 msgid "Cycloheptatriene" msgstr "Cycloheptatrien" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "Cyclooctatetraen" #: templates.hx:4 msgid "Fluorene" msgstr "Fluoren" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "Spiro[4.5]decan" #: templates.hx:4 msgid "Heptalene" msgstr "Heptalen" #: templates.hx:4 msgid "Fulvalene" msgstr "Fulvalen" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "Dicyclopentadien" #: templates.hx:5 msgid "Indene" msgstr "Inden" #: templates.hx:5 msgid "Biphenyl" msgstr "" #: templates.hx:5 msgid "Norbornane" msgstr "Norbornan" #: templates.hx:5 msgid "Binaphthyl" msgstr "" #: templates.hx:6 msgid "Coronene" msgstr "Coronen" #: templates.hx:8 msgid "Pyranose core" msgstr "Pyranosegerst" #: templates.hx:8 msgid "Furanose core" msgstr "Furanosegerst" #: templates.hx:8 msgid "Ribofuranose" msgstr "" #: templates.hx:8 msgid "Fructose" msgstr "Fruktose" #: templates.hx:8 msgid "Galactose" msgstr "Galaktose" #: templates.hx:9 msgid "Glucose" msgstr "Glukose" #: templates.hx:9 msgid "Mannose" msgstr "Mannose" #: templates.hx:9 msgid "Fucose" msgstr "Fukose" #: templates.hx:9 msgid "Xylose" msgstr "Xylose" #: templates.hx:9 msgid "Neuraminic acid" msgstr "Neuraminsure" #: templates.hx:10 msgid "Sucrose" msgstr "Saccharose" #: templates.hx:10 msgid "Maltose" msgstr "Maltose" #: templates.hx:10 msgid "Lactose" msgstr "Laktose" #: templates.hx:14 msgid "Adenine" msgstr "Adenin" #: templates.hx:14 msgid "Guanine" msgstr "Guanin" #: templates.hx:14 msgid "Thymine" msgstr "Thymin" #: templates.hx:14 msgid "Cytosine" msgstr "Cytosin" #: templates.hx:14 msgid "Uracil" msgstr "" #: templates.hx:15 msgid "Porphine" msgstr "Porphin" #: templates.hx:15 msgid "Caffeine" msgstr "Koffein" #: templates.hx:15 msgid "Evans auxiliary" msgstr "Evans-Auxiliar" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "SAMP-Auxiliar" #: templates.hx:15 msgid "Imidazole" msgstr "" #: templates.hx:16 msgid "Benzimidazole" msgstr "" #: templates.hx:16 msgid "Pyrazole" msgstr "" #: templates.hx:16 msgid "Diazole" msgstr "" #: templates.hx:17 msgid "Morphine" msgstr "Morphin" #: templates.hx:17 msgid "Morphine 3D" msgstr "Morphin 3D" #: templates.hx:23 msgid "Backbone" msgstr "" #: templates.hx:26 msgid "p orbital" msgstr "P-Orbital" #: templates.hx:26 msgid "plus" msgstr "" #: templates.hx:26 msgid "minus" msgstr "" #: templates.hx:26 msgid "rearrangement" msgstr "Umlagerung" #~ msgid "failed to load font %s !!!\n" #~ msgstr "Schriftart %s nicht gefunden !!!\n" #~ msgid "Failed to load symbol font, using standard font\n" #~ msgstr "" #~ "Symbolzeichensatz konnte nicht geladen werden, verwende normale Schrift\n" #~ msgid "Error creating directory \"" #~ msgstr "Fehler beim Anlegen des Verzeichnisses \"" #~ msgid "Error deleting file \"" #~ msgstr "Fehler beim Lschen der Datei\"" #~ msgid "Really delete file \"" #~ msgstr "Wirklich lschen ? \"" #~ msgid "Error renaming file \"" #~ msgstr "Fehler beim Umbenennen von \"" #~ msgid "Rename file \"" #~ msgstr "Umbenennen: Datei \"" #~ msgid "\" to:" #~ msgstr "\" in:" #~ msgid "Name too long" #~ msgstr "Name zu lang" #~ msgid "" #~ "\n" #~ "Created with Chemtool 1.6.9 from file %s \n" #~ "\n" #~ msgstr "" #~ "\n" #~ "Erstellt mit Chemtool 1.6.9 aus Datei %s \n" #~ "\n" #~ msgid "undefined text direction in svg output\n" #~ msgstr "undefinierte Textrichtung bei der SVG-Ausgabe\n" #~ msgid "no emf font parameters for zoom factor %d\n" #~ msgstr "Keine passende EMF-Schrift fuer Zoomfaktor %d\n" #~ msgid "undefined text direction in emf output\n" #~ msgstr "undefinierte Textrichtung in der EMF-Ausgabe\n" #~ msgid "no figfont parameters for zoom factor %d\n" #~ msgstr "Keine passende XFig-Schrift fuer Zoomfaktor %d\n" #~ msgid "# generated by Chemtool " #~ msgstr "# erstellt von Chemtool" #~ msgid "no figfont parameters for fontsize %d\n" #~ msgstr "Keine passende XFig-Schrift fuer Schriftgrad %d\n" #~ msgid "undefined text direction in xfig output\n" #~ msgstr "undefinierte Textrichtung in der XFig-Ausgabe\n" #~ msgid "no translation for %d\n" #~ msgstr "kein passender TeX-Code fr %d\n" #~ msgid "File selection" #~ msgstr "Dateiauswahl" #~ msgid "No error" #~ msgstr "Keine Fehler" #~ msgid "Bad parameter passed to undo function" #~ msgstr "Ungltiger Parameter fuer undo" #~ msgid "Out of memory" #~ msgstr "Kein Speicher mehr" #~ msgid "No active undo session" #~ msgstr "Keine undo-Umgebung aktiv" #~ msgid "Nothing to undo/redo" #~ msgstr "Nichts zu tun fr undo/redo" #~ msgid "No undoable memory limit set" #~ msgstr "Kein Speicherlimit fr undo gesetzt" chemtool-1.6.14/po/ru.po0000644000175000001440000007016712202261001014227 0ustar martinusers# Russian translation for chemtool # Copyright (C) 2001 Free Software Foundation, Inc. # Michael Shigorin , 2001, 2002. # msgid "" msgstr "" "Project-Id-Version: chemtool 1.6rc\n" "Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: 2003-06-27 00:54+0300\n" "Last-Translator: Michael Shigorin \n" "Language-Team: russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=koi8-r\n" "Content-Transfer-Encoding: 8bit\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" " !\n" "?" #: main.c:225 main.c:293 msgid "Yes" msgstr "" #: main.c:240 main.c:308 msgid "No" msgstr "" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" "\n" "%s\n" " !\n" " ?" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" "\n" " : %d" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" "\n" " : %d, : %d" #: main.c:1359 main.c:2667 main.c:5829 msgid "unnamed" msgstr "" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" "\n" "" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" "\n" " - %s %s %s %s!" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" "\n" "!" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" "\n" " !" #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr " %d\n" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr " %d\n" #: main.c:2353 msgid "Load from file..." msgstr " ..." #: main.c:2394 msgid "Import MDL file..." msgstr " MDL-..." #: main.c:2434 msgid "Import via BABEL..." msgstr " Babel..." #: main.c:2456 msgid "Export via BABEL..." msgstr " Babel..." #: main.c:2478 msgid "Import PDB file..." msgstr " PDB-..." #: main.c:2521 msgid "Add from file..." msgstr " ..." #: main.c:2637 msgid "Save as..." msgstr " ..." #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" "\n" " " #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" "\n" " %s !" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" "\n" " %s (: %d, : %d)" #: main.c:2821 main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" " \n" " %s\n" " !\n" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" "\n" " %s (: %d, : %d)" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "" #: main.c:2979 main.c:3060 main.c:3101 main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr " %s\n" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" "%s\n" " Chemtool\n" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" "%s .\n" " .\n" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr " %s \n" #: main.c:3048 main.c:3089 main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" "\n" " (Ctrl-Mouse1 z), Enter" #: main.c:3067 main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr " %s\n" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" " \n" " %s\n" " (: %d, : %d)\n" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" " . \n" " - ,\n" " ( ).\n" "\n" " \n" ", .\n" "\n" " ()\n" " .\n" " \n" " .\n" "\n" " , Ctrl ,\n" " , ( " "Ctrl).\n" "\n" " ( )\n" " . " "\n" " ( ): 'c' \n" "n,o,p,s,f , 1,2,3 CH,\n" "CH_2 CH_3 , 'l' Cl '*' - .\n" "\n" " ' ' " "\n" " ( " "\n" " - '5').\n" "\n" " :\n" "'_' '^' , '@' - ,\n" " '|' - '#' - .\n" " , \n" " .\n" "\n" " , \n" " ( Ctrl ).\n" " Alt \n" " .\n" "\n" " , chemtool,\n" " fig \n" " xfig ( - Brian Smith). \n" "- transfig/fig2dev - chemtool eps \n" "LaTeX, fig, xbm svg .\n" " Babel - \n" " OpenBabel. chemtool \n" " , chemtool\n" " mol /.\n" "\n" " man- chemtool, \n" "README, .\n" " - , \n" " , martin@ruby.chemie.uni-freiburg.de" #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" " Chemtool Version 1.6.14\n" ":\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html\n" "\n" " :\n" " " #: main.c:3450 msgid "PDB labels:" msgstr " PDB:" #: main.c:3453 msgid "All" msgstr "" #: main.c:3461 msgid "non-H" msgstr "-H" #: main.c:3470 msgid "no numbers" msgstr " " #: main.c:3479 msgid "non H,no numbers" msgstr "-H, " #: main.c:3489 main.c:3833 main.c:4139 msgid "None" msgstr "" #: main.c:3501 msgid "SDF entry:" msgstr "" #: main.c:3504 msgid "First" msgstr "" #: main.c:3511 msgid "Previous" msgstr "" #: main.c:3518 msgid "Next" msgstr "" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr " LaTeX/EPS:" #: main.c:3708 msgid "Unknown error" msgstr " " #: main.c:3732 main.c:4010 msgid "Configurable options" msgstr " " #: main.c:3767 msgid "_General" msgstr "" #: main.c:3788 msgid "Display" msgstr "" #: main.c:3794 msgid "Saving and Exporting" msgstr "" #: main.c:3800 msgid "Other" msgstr "" #: main.c:3811 msgid "_Background color:" msgstr " " #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr " " #: main.c:3834 main.c:4148 msgid "EPSI" msgstr "" #: main.c:3835 main.c:4157 msgid "TIFF mono" msgstr "TIFF ()" #: main.c:3836 main.c:4165 msgid "TIFF color" msgstr "TIFF ()" #: main.c:3841 msgid "_Data directory:" msgstr " :" #: main.c:3848 msgid "E_xtension:" msgstr ":" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr " eps- :" #: main.c:3863 main.c:4184 msgid "Support national character sets in labels" msgstr "" #: main.c:3883 msgid "Base bond _length:" msgstr " :" #: main.c:3891 msgid "Double bond _separation:" msgstr "" #: main.c:3904 msgid "_Printing" msgstr "" #: main.c:3934 main.c:4049 msgid "Portrait" msgstr "" #: main.c:3935 main.c:4054 msgid "Landscape" msgstr "" #: main.c:3949 msgid "Print _command:" msgstr " :" #: main.c:3956 msgid "Printer _name:" msgstr " :" #: main.c:3963 msgid "Paper si_ze:" msgstr " :" #: main.c:3970 msgid "_Orientation:" msgstr ":" #: main.c:3977 msgid "Print sc_ale factor:" msgstr " :" #: main.c:3993 msgid "Select background color" msgstr "" #: main.c:4019 msgid "Paper size:" msgstr " :" #: main.c:4044 msgid "Orientation:" msgstr ":" #: main.c:4069 msgid "Print scale factor :" msgstr " :" #: main.c:4094 msgid "Print command:" msgstr " :" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr " eps- :" #: main.c:4198 msgid "Background color :" msgstr " " #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr " " #: main.c:4225 msgid "Printer name:" msgstr " :" #: main.c:4238 msgid "Data directory:" msgstr " :" #: main.c:4251 msgid "Extension:" msgstr ":" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr " (10.668):" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "" #: main.c:4298 msgid "Ok" msgstr "" #: main.c:4308 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "" #: main.c:4327 main.c:4912 msgid "Templates" msgstr "" #: main.c:4338 main.c:4340 msgid "Carbocycles" msgstr "" #: main.c:4378 main.c:4380 msgid "Sugars" msgstr "" #: main.c:4422 main.c:4424 msgid "Heterocycles" msgstr "" #: main.c:4466 main.c:4468 msgid "Amino Acids" msgstr "" #: main.c:4511 main.c:4513 msgid "Symbols" msgstr "" #: main.c:4559 gtkfilesel.c:1196 msgid "Close" msgstr "" #: main.c:4605 msgid "New" msgstr "" #: main.c:4613 msgid "Open" msgstr "" #: main.c:4621 main.c:4904 msgid "Add" msgstr "" #: main.c:4629 msgid "Import MOL" msgstr " MOL" #: main.c:4637 msgid "Import PDB" msgstr " PDB" #: main.c:4645 msgid "Import (Babel)" msgstr " (Babel)" #: main.c:4653 msgid "Export..." msgstr "..." #: main.c:4661 msgid "Export (Babel)" msgstr " (Babel)" #: main.c:4670 main.c:4941 msgid "Print" msgstr "" #: main.c:4678 msgid "Setup Defaults" msgstr " " #: main.c:4693 main.c:4960 msgid "Save Config" msgstr " " #: main.c:4702 main.c:4921 msgid "Save" msgstr "" #: main.c:4710 msgid "Save As..." msgstr " ..." #: main.c:4719 main.c:5031 msgid "Quit" msgstr "" #: main.c:4727 msgid "File" msgstr "" #: main.c:4734 msgid "Copy" msgstr "" #: main.c:4746 msgid "Flip horizontally" msgstr " " #: main.c:4752 msgid "Flip vertically" msgstr " " #: main.c:4759 msgid "Undo" msgstr "" #: main.c:4767 msgid "Redo" msgstr "" #: main.c:4777 msgid "Edit" msgstr "" #: main.c:4784 msgid "Zoom in" msgstr "[+]" #: main.c:4790 msgid "Zoom out" msgstr "[-]" #: main.c:4801 main.c:4996 msgid "Center" msgstr "" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr " 4/6/" #: main.c:4815 msgid "View" msgstr "" #: main.c:4823 msgid "Templates..." msgstr "..." #: main.c:4832 msgid "Calculate Formula Weight" msgstr " " #: main.c:4840 msgid "Clean up drawing" msgstr " " #: main.c:4846 msgid "Tools" msgstr "" #: main.c:4854 main.c:5039 msgid "About" msgstr "?" #: main.c:4863 main.c:4872 msgid "Help" msgstr "" #: main.c:4895 msgid "Load" msgstr "" #: main.c:4900 msgid "Load a chemtool sketch" msgstr " Chemtool" #: main.c:4909 msgid "Add fragment from file" msgstr " " #: main.c:4918 msgid "Add template structure" msgstr " " #: main.c:4926 msgid "Save sketch to file" msgstr " Chemtool" #: main.c:4929 msgid "Export" msgstr "" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr " EPS, XFig, PicTeX XBM" #: main.c:4947 msgid "Print file to a postscript printer" msgstr " PS-" #: main.c:4950 msgid "Setup" msgstr "" #: main.c:4957 msgid "Setup default options" msgstr " " #: main.c:4966 msgid "Save default options" msgstr "" #: main.c:4969 msgid "Import" msgstr "" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr " MDL MOL-" #: main.c:4978 msgid "ImportPDB" msgstr " PDB" #: main.c:4984 msgid "Read a file written in PDB format" msgstr " PDB-" #: main.c:4987 msgid "Zoom In" msgstr "[+]" #: main.c:4992 msgid "Increase zoom scale" msgstr " " #: main.c:5002 msgid "Center molecule in drawing area" msgstr " " #: main.c:5005 msgid "Zoom Out" msgstr "[-]" #: main.c:5010 msgid "Decrease zoom scale" msgstr " " #: main.c:5014 msgid "Clear" msgstr "" #: main.c:5019 msgid "Remove molecule" msgstr " " #: main.c:5022 msgid "FW" msgstr "M" #: main.c:5027 msgid "Calculate Formula Mass" msgstr " " #: main.c:5036 msgid "Exit Chemtool" msgstr " Chemtool" #: main.c:5045 msgid "About Chemtool" msgstr " " #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr " 0/30/60/90 " #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr " 0/36/72/... " #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr " 18/54/90/... " #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr " 18/54/90/... " #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr " 4 " #: main.c:5174 msgid "Draw left-justified text" msgstr " ( )" #: main.c:5191 msgid "Draw centered text" msgstr " ()" #: main.c:5208 msgid "Draw right-justified text" msgstr " ( )" #: main.c:5236 msgid "Set current textfont" msgstr " " #: main.c:5266 msgid "Choose default bond type" msgstr " " #: main.c:5283 msgid "Select pen color" msgstr " " #: main.c:5288 msgid "Bonds" msgstr "" #: main.c:5293 msgid "Toggle bond types" msgstr " " #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr " , " #: main.c:5327 msgid "Move marked object" msgstr " " #: main.c:5344 msgid "Rotate marked object" msgstr " " #: main.c:5363 msgid "Flip object horizontally" msgstr " " #: main.c:5381 msgid "Flip object vertically" msgstr " " #: main.c:5407 msgid "Copy marked object" msgstr " " #: main.c:5422 msgid "Rescale marked object" msgstr " " #: main.c:5441 msgid "Draw brackets around object" msgstr " " #: main.c:5456 msgid "Draw rounded brackets around object" msgstr " " #: main.c:5471 msgid "Draw round brackets around object" msgstr " " #: main.c:5486 msgid "Draw braces around object" msgstr " " # XXX here finished #: main.c:5501 msgid "Draw simple box around object" msgstr " " #: main.c:5515 msgid "Draw shaded box around object" msgstr " " #: main.c:5529 msgid "Draw fancy box around object" msgstr " " #: main.c:5543 msgid "Draw rounded box around object" msgstr " " #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr " " #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr " .." #: main.c:5605 msgid "Text :" msgstr ":" #: main.c:5619 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "" " : _ , ^ - , @ - ,| " "- , # - . , H_2O, @a_D^2^0" #: main.c:5624 msgid "Select current text size" msgstr " " #: main.c:5753 #, c-format msgid "Ready" msgstr "" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "chemtool: \n" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr " (SIGSEGV) - " #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr " - (SIGFPE) - " #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr " (SIGBUS) - " #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr " (SIGHUP) - " #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr " crashdump.cht\n" #: gtkfilesel.c:664 msgid "Looking in:" msgstr " :" #: gtkfilesel.c:796 msgid "Directories" msgstr "" #: gtkfilesel.c:825 msgid "Mask:" msgstr ":" #: gtkfilesel.c:838 msgid "Files" msgstr "" #: gtkfilesel.c:872 msgid "OK" msgstr "" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr " : %s" #: gtkfilesel.c:949 msgid "Create Dir" msgstr " " #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr " " #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr " " #: gtkfilesel.c:1173 msgid "Error" msgstr "" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr " " #: gtkfilesel.c:1285 msgid "Directory name:" msgstr " :" #: gtkfilesel.c:1297 msgid "Create" msgstr "" #: gtkfilesel.c:1397 msgid "Delete" msgstr "" #: gtkfilesel.c:1512 msgid "Rename" msgstr "" #: gtkfilesel.c:2155 msgid "Selection: " msgstr ":" #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr " Babel/OpenBabel ...\n" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "" #: templates.hx:2 msgid "Benzene" msgstr "" #: templates.hx:2 msgid "Naphthalene" msgstr "" #: templates.hx:2 msgid "Azulene" msgstr "" #: templates.hx:3 msgid "Adamantane" msgstr "" #: templates.hx:3 templates.hx:5 msgid "Cyclohexane" msgstr "" #: templates.hx:3 msgid "Steroid backbone" msgstr " " #: templates.hx:3 msgid "Cycloheptatriene" msgstr "" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "" #: templates.hx:4 msgid "Fluorene" msgstr "" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "[4.5]" #: templates.hx:4 msgid "Heptalene" msgstr "" #: templates.hx:4 msgid "Fulvalene" msgstr "" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "" #: templates.hx:5 msgid "Indene" msgstr "" #: templates.hx:5 msgid "Biphenyl" msgstr "" #: templates.hx:5 msgid "Norbornane" msgstr "" #: templates.hx:5 msgid "Binaphthyl" msgstr "" #: templates.hx:6 msgid "Coronene" msgstr "" #: templates.hx:8 msgid "Pyranose core" msgstr " " #: templates.hx:8 msgid "Furanose core" msgstr " " #: templates.hx:8 msgid "Ribofuranose" msgstr "" #: templates.hx:8 msgid "Fructose" msgstr "" #: templates.hx:8 msgid "Galactose" msgstr "" #: templates.hx:9 msgid "Glucose" msgstr "" #: templates.hx:9 msgid "Mannose" msgstr "" #: templates.hx:9 msgid "Fucose" msgstr "" #: templates.hx:9 msgid "Xylose" msgstr "" #: templates.hx:9 msgid "Neuraminic acid" msgstr " " #: templates.hx:10 msgid "Sucrose" msgstr "" #: templates.hx:10 msgid "Maltose" msgstr "" #: templates.hx:10 msgid "Lactose" msgstr "" #: templates.hx:14 msgid "Adenine" msgstr "" #: templates.hx:14 msgid "Guanine" msgstr "" #: templates.hx:14 msgid "Thymine" msgstr "" #: templates.hx:14 msgid "Cytosine" msgstr "" #: templates.hx:14 msgid "Uracil" msgstr "" #: templates.hx:15 msgid "Porphine" msgstr "" #: templates.hx:15 msgid "Caffeine" msgstr "" #: templates.hx:15 msgid "Evans auxiliary" msgstr "" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "" #: templates.hx:15 msgid "Imidazole" msgstr "" #: templates.hx:16 msgid "Benzimidazole" msgstr "" #: templates.hx:16 msgid "Pyrazole" msgstr "" #: templates.hx:16 msgid "Diazole" msgstr "" #: templates.hx:17 msgid "Morphine" msgstr "" #: templates.hx:17 msgid "Morphine 3D" msgstr "" #: templates.hx:23 msgid "Backbone" msgstr "" #: templates.hx:26 msgid "p orbital" msgstr "p-" #: templates.hx:26 msgid "plus" msgstr "" #: templates.hx:26 msgid "minus" msgstr "" #: templates.hx:26 msgid "rearrangement" msgstr "" #~ msgid "Help - somebody ate my atoms (hp->n=%d, da_root.next NULL)!!!\n" #~ msgstr "! - (hp->n=%d, da_root.next NULL)!!!\n" #~ msgid "Help - somebody ate my atoms (d=%d,hp->n=%d)!!!\n" #~ msgstr "! - (d=%d,hp->n=%d)!!!\n" #~ msgid "failed to load font %s !!!\n" #~ msgstr " %s !!!\n" #~ msgid "Failed to load symbol font, using standard font\n" #~ msgstr " Symbol, \n" #~ msgid "Error creating directory \"" #~ msgstr " \"" #~ msgid "Error deleting file \"" #~ msgstr " \"" #~ msgid "Really delete file \"" #~ msgstr " \"" #~ msgid "Error renaming file \"" #~ msgstr " \"" #~ msgid "Rename file \"" #~ msgstr " \"" #~ msgid "\" to:" #~ msgstr "\" : " #~ msgid "Name too long" #~ msgstr " " #~ msgid "Chemtool Version " #~ msgstr " Chemtool " #~ msgid "endless molfile???\n" #~ msgstr " .MOL???\n" #~ msgid "expecting na %d nb %d\n" #~ msgstr " na %d nb %d\n" #~ msgid "Molecule exported from chemtool\n" #~ msgstr " Chemtool\n" #~ msgid "undefined text direction in svg output\n" #~ msgstr " svg\n" #~ msgid "no emf font parameters for zoom factor %d\n" #~ msgstr " emf %d\n" #~ msgid "undefined text direction in emf output\n" #~ msgstr " emf\n" #~ msgid "no figfont parameters for zoom factor %d\n" #~ msgstr " %d\n" #~ msgid "no figfont parameters for fontsize %d\n" #~ msgstr " %d\n" #~ msgid "undefined text direction in xfig output\n" #~ msgstr " xfig\n" #~ msgid "no translation for %d\n" #~ msgstr " : %d\n" #~ msgid "could not close fig file" #~ msgstr " fig" #~ msgid "program cht not available or unable to write to" #~ msgstr " cht (, )" #~ msgid "File selection" #~ msgstr " " #~ msgid "_Configurable options" #~ msgstr " " #~ msgid "Print _scale factor :" #~ msgstr " :" #~ msgid "No error" #~ msgstr " " #~ msgid "Bad parameter passed to undo function" #~ msgstr " " #~ msgid "Out of memory" #~ msgstr " " #~ msgid "No active undo session" #~ msgstr " " #~ msgid "Nothing to undo/redo" #~ msgstr " /" #~ msgid "No undoable memory limit set" #~ msgstr " " chemtool-1.6.14/po/LINGUAS0000644000175000001440000000004110767710555014301 0ustar martinusersbg cs de fr nl pl pt_BR pt_PT ru chemtool-1.6.14/po/cs.gmo0000666000175000001440000004700212202261360014356 0ustar martinusers43L>-X*% #%IZay/*E>p ('$;Lckow  (/Ohy ""C""""# ##$)#N# _#k#}#### ## ### $!%$ G$"h$$%$$$%$ %=%V%!p%%#%%%,& >&J&O&U&h& x&&& & &&&'&&&''6'F'O'X' _' i' w''''' ' ''' ' '' ( (!'(I( Q([(v({(( (((-(( (%);) D)P) c)o)))) ))) ) ) ) )))})#y*#****"* ++3+ B+P+ h+v+){+!+++++, ,, ),6,K,Z, _, j, v,,,,, ,,,--.-?-G-N- V- `-Cm------ ---.. .(.1.9.B.U. f. t.~... ... . ./X />e0100-01&31"Z1}111111o2!2G2 33 *343!;3 ]3~333333 33 4#4*434;4A4H4b4|4 4 4$4444= 4,A2AGBAAAAAAA(AB B!B2B:BMB ]B gBuBBBB%B&B%C')C$QC&vCCC$C,C D9D#SD'wD#D&D'D/E BELETEZEnEtEEE EEEE EEEF!F;FNFVF_FfFoF FFFFFF FFF F GG%G5G;GXG`GiGGGG GGG+GG%H$*HOH VH`HvHHHHH HHH H HHHI II IIII J'J :J GJTJeJuJJJ"JJJJJJ K"K5K LKYKnKsK xKK KK KKKKK L !L+L;L KLUL[LcL lL;xLLLLLL LLMMM"M)M0M7M>MMM aMmM#tMMM M MM M M M)` zC^1I58{7m?&H_d6yM;$|~s-ghOX=3+ 0:NeL9]%#b/>S(n*lv" Brc\WP2. poqF4JGuUi@ <T}[wtxYaDQZ'RjEKf A!,kV Choose orientation (Ctrl-Mouse1 for z), press Enter when done Drawing exported as %s (%d bonds, %d labels) Drawing printed! Drawing saved in %s (%d bonds, %d labels) Failed to print drawing ! Helper process failed - %s %s %s %s! Imported %d bonds and %d labels Next ring drawn will have %d sides Nothing to save Ready Writing to %s failed ! Chemtool Version 1.6.14 by Martin Kroeker, Radek Liboska, Michael Banck and Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dumping current drawing to file crashdump.cht %s does not appear to be a Chemtool file %s was created by a newer version. Some features may be lost. AboutAbout ChemtoolAdamantaneAddAdd filled _white rectangle under labelsAdd filled white rectangle under labelsAdd fragment from fileAdd from file...Add template structureAdenineAllAzuleneBackground color :Base bond _length:Base bondlength (10.668mm) :BenzeneBinaphthylBiphenylBondsCaffeineCalculate Formula MassCalculate Formula WeightCancelCarbocyclesCenterCenter molecule in drawing areaChoose default bond typeClean up drawingClearClick and drag the mouse to draw bonds on the canvas. The right mouse button is used to delete objects - either bonds or text depending on which drawing mode is active. The buttons with different ringtypes on them select drawing modes with preferred angles, but you can actually draw at any angle in all modes. The button with the segmented line on it lets you draw curves by marking control points along the curve (a cubic spline). You can select the bondtype and color using the appropriate button or change them later by clicking on the desired bond in Bonds mode. To draw a cyclic system, simply press the Ctrl key together with the number key corresponding to the number of sides for the polygon, and then draw one side while pressing the Ctrl button. For drawing labels, write them into the text box in the top right of the window and place them on the canvas with the mouse. You can also use a number of keyboard shortcuts for common labels while in bond drawing mode: Simply press the 'c' key, or n,o,p,s,f to add the element symbol at the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl, * for a big dot. The keys of the numeric keypad each insert an 'electron pair' line around an atom symbol in the position corresponding to the location of the key around the center of the numeric keypad. The text mode uses the following prefixes for special text: _ for subscripts, ^ for superscripts, @ for symbols (greek characters), | for italic (slanted) characters and # for bold text. When the text box is empty, clicking on any label in the drawing area copies that label into the box for reuse. Drawing is best done with the mouse, but you can also use the cursor keys in combination with the Ctrl key for exact positioning. When used with the Alt key, the cursor keys move the rectangular or rhombic grid that can be projected on the drawing area. If you need general drawing functions not provided by chemtool, try exporting to fig format and editing your figure in Brian Smith's xfig program. Its companion transfig/fig2dev is required by chemtool for printing and for exporting to eps or LaTeX, while the fig, XBM and SVG output are generated directly. Another useful and highly recommended helper program is Babel - either in its original version, or in the form of the new OpenBabel project. Using either version, chemtool is able to import foreign data from a variety of file formats, while only molfile im- and export is built into chemtool. More help is available in the manual page for chemtool and in the file README included in the source distribution as well as on the website. This should normally get installed in /usr/share/doc/packages/chemtool. If you find any bugs or have a question or suggestion, please contact the main author, martin@ruby.chemie.uni-freiburg.deCloseConfigurable optionsConsider installing Babel/OpenBabel for file format conversions... CopyCopy marked objectCoroneneCreateCreate DirCreate DirectoryCreate EPS, XFig, PicTeX or XBM fileCycloheptatrieneCyclohexaneCyclooctatetraeneCytosineData directory:Decrease zoom scaleDeleteDelete FileDicyclopentadieneDirectoriesDirectory name:Directory unreadable: %sDraw at 0/30/60/90 degree anglesDraw at 0/36/72/... degree anglesDraw at 0/45/90... degree anglesDraw at 18/54/90/... degree anglesDraw braces around objectDraw brackets and boxes around objectDraw brackets around objectDraw centered textDraw curves based on 4 control pointsDraw fancy box around objectDraw left-justified textDraw right-justified textDraw round brackets around objectDraw rounded box around objectDraw rounded brackets around objectDraw shaded box around objectDraw simple box around objectDrawing saved in %s (%d bonds, %d labels) E_xtension:EditErrorError loading %s Evans auxiliaryExit ChemtoolExport (Babel)Export via BABEL...Export...Extension:FWFileFile %s already exists ! Overwrite it ?FilesFlip horizontallyFlip object horizontallyFlip object verticallyFlip verticallyFluoreneFructoseFucoseFulvaleneFuranose coreGalactoseGlucoseGrid rect/rhomb/offGuanineHelpHeptaleneHeterocyclesImport (Babel)Import MDL file...Import MOLImport PDBImport PDB file...Increase zoom scaleIndeneInvalid math somewhere (SIGFPE) -LactoseLandscapeLatex / EPS scale factor :LoadLoad a chemtool sketchLoad from file...Looking in:MaltoseMannoseMark objects for moving, rotating or deletingMask:Memory access problem (SIGBUS) -Memory allocation problem (SIGSEGV) -MorphineMorphine 3DMove marked objectNaphthaleneNeuraminic acidNewNoNoneNorbornaneOpenOrdered to quit (SIGHUP) - Orientation:PDB labels:Paper si_ze:Paper size:PorphinePortraitPrefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0Preview image to add to _EPS files:Preview image to add to eps files :PrintPrint _command:Print command:Print file to a postscript printerPrint sc_ale factor:Print scale factor :Printer _name:Printer name:Problems converting %s Pyranose coreQuitRead a file written in MDL/molfile formatRead a file written in PDB formatReadyRedoRemove moleculeRemoves duplicate bonds, etc.RenameRename FileRescale marked objectRibofuranoseRotate marked objectSAMP auxiliarySaveSave As...Save ConfigSave as...Save sketch to fileSelect background colorSelect current text sizeSelect pen colorSelection: Set current textfontSetup DefaultsSetup default optionsSpiro[4.5]decaneSteroid backboneSucroseSugarsSymbolsTemplatesTemplates...The current drawing is not saved ! Do you really wish to continue ?ThymineToggle bond typesToolsUnable to open %s UndoUnknown errorViewWriting to %s failed ! XyloseYesZoom InZoom OutZoom inZoom out_Background color:_Data directory:_Orientation:_Printingchemtool: can't load any font invalid angle mode %d invalid text mode %d no numbersnon H,no numbersnon-Hp orbitalrearrangementunnamedProject-Id-Version: Chemtool 1.6 Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de POT-Creation-Date: 2007-05-23 23:58+0200 PO-Revision-Date: 2003-06-18 09:49+0200 Last-Translator: Radek Liboska Language-Team: cs MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit Vyber orientaci (Ctrl-Mouse1 pro z), pot stiskni Enter Vzorec exportovn jako %s (%d vazeb, %d popisek) Tisk proveden! Vzorec uloen jako %s (%d vazeb, %d popisek) Vzorec nebyl vytitn! Pomocn program selhal - %s %s %s %s! Importovno %d vazeb a %d popisek Pt kruh bude mt %d stran Nic k vrcen/obnoven Hotovo Zpis do %s selhal ! Chemtool verze 1.6.14 napsali Martin Kroeker, Radek Liboska, Michael Banck a Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.htmlukldm souasn vzorec do souboru crashdump.cht %s nevypad na soubor Chemtoolu %s byl vytvoen novj verz . Nkter vlastnosti mohou bt ztraceny. O programuO programu ChemtoolAdamantanPidejVkldej _bl obdlnky pod textVkldej bl obdlnky pod textPidej fragment ze souboruPidej ze souboru...Pidej templtovou strukturuAdeninVeAzulenBarva pozad:Zkladn dlka _vazeb:Zkladn dlka vazeb (10.668mm):BenzenBinaftylBifenylVazbyKofeinVypoti molekulovou hmotuVypoti molekulovou hmotuZruitKarbocyklyVycentrujVycentruj molekulu na kreslc ploeVyber zkladn typ vazbyOdstra dupliktyistiKliknutm a tahem myi lze kreslit vazby. Prav tlatko myi lze pout k vymazn objektu - vazeb, textu nebo celho vbru, v zvislosti na momentln aktivnm kreslcm mdu. Tlatka v lit menu s rznmi typy kruh vybraj kreslc md s preferovanmi hly vazeb, ale obecn je mono pout libovolnho hlu v ktermkoliv zvolenm mdu. Tlatko s dlenou rou vol vkldn kubickch kivek, a to tak, e umstme tyi dc body podl zamlen kivky. Typ vazby a jej barvu lze vybrat pouitm odpovdajc pedvolby v menu vazeb; zmnu typu a barvy lze provst i dodaten pi stlaenm tlatku 'Vazby'. Nakreslit cyklick systm najednou lze jednodue stisknutm funkn klvesy jej slo odpovd potu vazeb v kruhu a nslednm nakreslenm jedn jeho vazby se souasnm podrenm tlatka Ctrl. Znaky atom a skupin je zapoteb nejprve napsat do vstupnho dku textu v horn sti okna aplikace a pak umstit do vzorce kliknutm my. Ke vloen bnch znaek atom lze pout klvesovch zkratek pmo v mdu kreslen vazeb: jednodue stisknutm klvesy 'c' nebo n,o,p,s,f,i,b,r,d,h vlome odpovdajc symbol na konec prv nakreslen vazby; 1,2 a 3 vlo CH, CH_2 a CH_3, l bude Cl a * bude tun puntk. Klvesy na numerick klvesnici vkldaj elektronov pr, rku kolem symbolu atomu na pozici odpovdajc poloze klvesy okolo stedu numerick klvesnice. Textov md pouv nsledujcch pedpon ke speciln modifikaci textu: _ pro index (subskript), ^ pro exponent (superskript), @ pro symboly (eck znaky), | pro kurzvu (sklonn psmo) a # pro tun text. Kliknutm prostednm tlatkem myi po kterkoliv znace pouit ve vzorci je tato zkoprovna zpt do vstupn linky k dalmu pouit. Kreslen se nejlpe provd my, avak je tak mon pout kursorovch klves v kombinaci s klvesou Ctrl, zvlt pro pesn umstn. Pokud jsou kursorov klvesy pouity v kombinaci s klvesou Alt, pohybuj pravohlou nebo hexagonln mkou, promtanou na kreslc plochu. Pokud potebujete obecn kreslc funkce, kter nejsou k dispozici v aplikaci Chemtool, exportujte vzorec do formtu .fig a dle editujte kresbu v programu Xfig pana Briana Smithe. Ten je doprovzen programem transfig/fig2dev, kter je vyadovn aplikac Chemtool k tisku a exportu do formt eps nebo LaTeX (a emf), zatmco fig, XBM a SVG vstupy jsou generovny pmo. Jinm uitenm a doporuenm programem je Babel, a to bu v pvodn verzi nebo ve form novho projektu OpenBabel. Pouitm kterkoliv z verz Babelu je Chemtool schopen importovat ciz data z cel plejdy formt, zatmco zabudovn je pouze import (a export) z formtu molfile. Vstup ve vektorovm formtu svg lze zobrazit ve webovm prohlei (Adobe plug-in), tisknout a editovat programem Sodipodi nebo Javovou aplikac Batik Dal informace jsou uvedeny v manulovch strnkch a v souboru README kter je soust dokumentace distribuce, a tak na webovch strnkch projektu. Pokud narazte na chybu v programu nebo budete mt dotazy i nvrhy, obrate se, prosm, na hlavnho autora na adrese martin@ruby.chemie.uni-freiburg.deZaviVolby nastavenPedpokldm instalaci Babel/OpenBabel pro konverzi formt soubor... KoprujKopruj oznaen objektCoronenVytvoitVytvoit adresVytvoit adresVytvo soubor EPS, XFig, PicTeX nebo XBMCykloheptatrienCyklohexanCyklooktatetraenCytosinAdres dokument:Zmeni o stupeOdstranitSmazat souborDicyklopentadienAdreseNzev adrese:Adres nelze st: %sKresli v 0/30/60/90 stupovch hlechKresli v 0/36/72/... stupovch hlechKresli v 0/45/90... stupovch hlechKresli v 18/54/90/... stupovch hlechKresli sloen zvorky kolem objektuKresli zvorky a rmeky kolem objektuVlo zvorky kolem objektuPi vycentrovan textKresli kivky pomoc 4 dcch bodKresli tun stnovan rmeek kolem objektuPi text zarovnan vlevoPi text zarovnan vpravoKresli kulat zvorky kolem objektuKresli zakulacen rmeek kolem objektuKresli kulat zvorky kolem objektuKresli stnovan rmeek kolem objektuKresli jednoduch rmeek kolem objektuVzorec uloen jako %s (%d vazeb, %d popisek) _Ppona:EditaceChybaChyba natn %s EvansUkoni programExportuj (Babel)Exportuj (BABEL)...Exportuj...Ppona:MVSouborSoubor %s ji existuje! Pepsat?SouboryPeklop horizontlnPeklop objekt horizontlnPeklop objekt vertiklnPeklop vertiklnFluorenFruktosaFukosaFulvalenFuranosov kruhGalaktosaGlukosaMka orto/hex/vypnutaGuaninNpovdaHeptalenHeterocyklyImportuj (Babel)Import MDL souboru...Importuj MOLImportuj PDBImport PDB souboru...Zvti o stupeIndenMatematick chyba (SIGFPE) -LactosaNaleatoLatex / EPS faktor zvten :NatiNati chemtool skeNati ze souboru...Vyhledat v:MaltosaMannosaOzna objekty pro posun, rotaci nebo maznMaska:Problm pstupu do pamti (SIGBUS) -Problm s alokac pamti (SIGSEGV) -MorfinMorfin 3DPosu oznaen objektNaftalenNeuramov kyselinaNovNednNorbornanOteviPkaz k ukonen (SIGHUP) - Orientace:Popisky PDB:Ve_likost papruVelikost papruPorfyrinNastojatopidejte ped znak _ chcete-li vytvoit index, ^ pro exponent, @ pro symbol, | pro sklonn a # pro tun psmo; nap. H_2O, @b-stice, @a_D^2^0Nhledy vloen do _eps soubor:Nhledy vloen do eps soubor:TiskniPkaz _tisku:Pkaz tisku:Tiskni soubor na postscriptov tiskrnkla tisku:kla tisku:_Nzev tiskrny:Nzev tiskrny:Problm s konverz %s Pyranosov kruhmytecNati soubor v MDL molfile formtuNati soubor v PDB formtuHotovoObnovOdstra molekuluOdstra duplikty atd.PejmenovatPejmenovat souborkluj oznaen objektRibofuranosaOto oznaen objektSAMPUloUlo jako...Ulo nastavenUlo jako...Ulo ske do souboruBarva pozad:Zm psmo (patky/bez patek)Vyber barvu peraVbr: Zm psmo (patky/bez patek)NastavenNastavenSpiro[4.5]decanSteroidn pteSacharosaCukrySymbolyTempltyTemplty...Souasn vzorec nen uloen! Opravdu si pejete pokraovat?ThyminZm typ vazbyNstrojeNemohu otevt %s VraNeznm chybaPohledZpis do %s selhal ! XylosaAnoZvtiZmeniZvtiZmeni_Barva pozad:Adres _dokument:_Orientace:Tisknichemtool: nemohu naist d znaky chybn md hl %d chybn md textu %d bez selbez H, selbez Hp orbitalpeskupennepojmenovanychemtool-1.6.14/po/bg.gmo0000666000175000001440000006456312202261360014354 0ustar martinusersQ01>C-*% .#Os/?*o>  $(('Qy  # 1<EKTk  $$C%T%Y%l%u% |%%$%% %%%%&&*& 1&=&E& W&c&s& &!& &"&'%-'S'o'%''''!'(#9(]({(,( (((( (()) () 2)=)@)'E)m)s)y))))))) ) ) )**"*** /* 9* F*P*W*f* y* *** ***!** ++*+/+F+ X+d+l+-t++ +%++ +, ,#,3,7,<,?, D,O,R,U,Z, v, , , ,,,},#8-#\-----"---- .. 0.>.G.)L.!v...... .. .// !/ ,/ 8/C/X/l/// ////// 00$0)+0U0 ]0 h0 r0 |00C000001 11!1&1?1F1J1R1[1c1l111 1 11111 222 %2/2 42B2J23` 4Vl44P425?P545@5*6 16*?6j6J]737s7P8-_88888A8A94\9!9:9 9 9: #:0:2D:?w: :::: : ;;7; W;b; w;.;8;(;< *<6O*IOtOO5 PAPPP"cP"P=PPQ Q >Q_QnQ'QQ Q Q Q R!R];R=R>R?S?VS7S0S5S5TAUT9T(T*T/%U7UU/U.U/URVoVV V4VVVW"!WDWXWnWwWHWW W)W; X7IX%XXX XXXYY5&Y \Y iYtYYYYY#YYZ#,Z PZqZ(Z Z5ZZ[[)[-<[#j[[[ [n[ ,\>8\Qw\ \ \;\]'/]W]^]m]r]w]]]]/]]]#]##^ G^T^c^v_v_ ` `%`E`+e`````7a=a\a ka,va%a aa/aHbbb&{b9bb7b-c@c._cc9c:c)"d4Ld d ddd!d!de5eUe feQseeeeef fO%f uf3ff(f f!g #g 0g+=gigxg}gggggh#h*h @hFKh+h-h hh i'i.iAiJi ei:He~jdO*#g+8P}Q`$4?^.[kJUc|u)plWz s%7MvZyT<,N6DS=tmaf@'{-1Bi;hFEbYX!(5q2I 3\w& 0x r">ACR/9nL _]oKVG %s %s %s %s Choose orientation (Ctrl-Mouse1 for z), press Enter when done Drawing exported as %s (%d bonds, %d labels) Drawing printed! Drawing saved in %s (%d bonds, %d labels) Failed to print drawing ! Helper process failed - %s %s %s %s! Imported %d bonds and %d labels Next ring drawn will have %d sides Nothing to save Ready Writing to %s failed ! Chemtool Version 1.6.14 by Martin Kroeker, Radek Liboska, Michael Banck and Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html dumping current drawing to file crashdump.cht %s does not appear to be a Chemtool file %s was created by a newer version. Some features may be lost. DisplaySaving and ExportingAboutAbout ChemtoolAdamantaneAddAdd filled _white rectangle under labelsAdd filled white rectangle under labelsAdd fragment from fileAdd from file...Add template structureAdenineAllAmino AcidsAzuleneBackground color :Base bond _length:Base bondlength (10.668mm) :BenzeneBenzimidazoleBinaphthylBiphenylBondsCaffeineCalculate Formula MassCalculate Formula WeightCancelCarbocyclesCenterCenter molecule in drawing areaChoose default bond typeClean up drawingClearClick and drag the mouse to draw bonds on the canvas. The right mouse button is used to delete objects - either bonds or text depending on which drawing mode is active. The buttons with different ringtypes on them select drawing modes with preferred angles, but you can actually draw at any angle in all modes. The button with the segmented line on it lets you draw curves by marking control points along the curve (a cubic spline). You can select the bondtype and color using the appropriate button or change them later by clicking on the desired bond in Bonds mode. To draw a cyclic system, simply press the Ctrl key together with the number key corresponding to the number of sides for the polygon, and then draw one side while pressing the Ctrl button. For drawing labels, write them into the text box in the top right of the window and place them on the canvas with the mouse. You can also use a number of keyboard shortcuts for common labels while in bond drawing mode: Simply press the 'c' key, or n,o,p,s,f to add the element symbol at the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl, * for a big dot. The keys of the numeric keypad each insert an 'electron pair' line around an atom symbol in the position corresponding to the location of the key around the center of the numeric keypad. The text mode uses the following prefixes for special text: _ for subscripts, ^ for superscripts, @ for symbols (greek characters), | for italic (slanted) characters and # for bold text. When the text box is empty, clicking on any label in the drawing area copies that label into the box for reuse. Drawing is best done with the mouse, but you can also use the cursor keys in combination with the Ctrl key for exact positioning. When used with the Alt key, the cursor keys move the rectangular or rhombic grid that can be projected on the drawing area. If you need general drawing functions not provided by chemtool, try exporting to fig format and editing your figure in Brian Smith's xfig program. Its companion transfig/fig2dev is required by chemtool for printing and for exporting to eps or LaTeX, while the fig, XBM and SVG output are generated directly. Another useful and highly recommended helper program is Babel - either in its original version, or in the form of the new OpenBabel project. Using either version, chemtool is able to import foreign data from a variety of file formats, while only molfile im- and export is built into chemtool. More help is available in the manual page for chemtool and in the file README included in the source distribution as well as on the website. This should normally get installed in /usr/share/doc/packages/chemtool. If you find any bugs or have a question or suggestion, please contact the main author, martin@ruby.chemie.uni-freiburg.deCloseConfigurable optionsConsider installing Babel/OpenBabel for file format conversions... CopyCopy marked objectCoroneneCreateCreate DirCreate DirectoryCreate EPS, XFig, PicTeX or XBM fileCycloheptatrieneCyclohexaneCyclooctatetraeneCyclopentadienylCytosineData directory:Decrease zoom scaleDeleteDelete FileDiazoleDicyclopentadieneDirectoriesDirectory name:Directory unreadable: %sDraw at 0/30/60/90 degree anglesDraw at 0/36/72/... degree anglesDraw at 0/45/90... degree anglesDraw at 18/54/90/... degree anglesDraw braces around objectDraw brackets and boxes around objectDraw brackets around objectDraw centered textDraw curves based on 4 control pointsDraw fancy box around objectDraw left-justified textDraw right-justified textDraw round brackets around objectDraw rounded box around objectDraw rounded brackets around objectDraw shaded box around objectDraw simple box around objectDrawing saved in %s (%d bonds, %d labels) E_xtension:EditErrorError loading %s Exit ChemtoolExportExport (Babel)Export via BABEL...Export...Extension:FWFileFile %s already exists ! Overwrite it ?FilesFirstFlip horizontallyFlip object horizontallyFlip object verticallyFlip verticallyFluoreneFructoseFucoseFulvaleneFuranose coreGalactoseGlucoseGrid rect/rhomb/offGuanineHelpHeptaleneHeterocyclesImidazoleImportImport (Babel)Import MDL file...Import MOLImport PDBImport PDB file...Import via BABEL...ImportPDBIncrease zoom scaleIndeneInvalid math somewhere (SIGFPE) -LactoseLandscapeLatex / EPS scale factor :LoadLoad a chemtool sketchLoad from file...Looking in:MaltoseMannoseMark objects for moving, rotating or deletingMask:Memory access problem (SIGBUS) -Memory allocation problem (SIGSEGV) -MorphineMorphine 3DMove marked objectNaphthaleneNeuraminic acidNewNextNoNoneNorbornaneOKOkOpenOrdered to quit (SIGHUP) - Orientation:PDB labels:Paper si_ze:Paper size:PorphinePortraitPrefix a character with _ for subscript, ^ for superscript, @ for symbols, | for italic, # for bold text; e.g. H_2O, @a_D^2^0Preview image to add to _EPS files:Preview image to add to eps files :PreviousPrintPrint _command:Print command:Print file to a postscript printerPrint sc_ale factor:Print scale factor :Printer _name:Printer name:Problems converting %s Pyranose corePyrazoleQuitRead a file written in MDL/molfile formatRead a file written in PDB formatReadyRedoRemove moleculeRemoves duplicate bonds, etc.RenameRename FileRescale marked objectRibofuranoseRotate marked objectSaveSave As...Save ConfigSave as...Save default optionsSave sketch to fileSelect background colorSelect current text sizeSelect pen colorSelection: Set current textfontSetupSetup DefaultsSetup default optionsSpiro[4.5]decaneSteroid backboneSucroseSugarsSupport national character sets in labelsSymbolsTIFF colorTIFF monoTemplatesTemplates...Text :The current drawing is not saved ! Do you really wish to continue ?ThymineToggle bond typesToolsUnable to open %s UndoUnknown errorUracilViewWriting to %s failed ! XyloseYesZoom InZoom OutZoom inZoom out_Background color:_Data directory:_General_Orientation:_Printingchemtool: can't load any font invalid angle mode %d invalid text mode %d minusno numbersnon H,no numbersnon-Hp orbitalplusrearrangementunnamedProject-Id-Version: chemtool 1.6rc Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de POT-Creation-Date: 2007-05-23 23:58+0200 PO-Revision-Date: 2008-03-17 22:56+0200 Last-Translator: lfu project Language-Team: Svetoslav Stefanov MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Poedit-Language: Bulgarian X-Poedit-Country: BULGARIA %s %s %s %s Изберете ориентация (Ctrl-Mouse1 за оста z) и натиснете Enter Чертежът е изнесен като %s (връзки: %d, етикети: %d) Завършен печат! Чертежът е запазен в %s (връзки: %d, етикети: %d) Провален печат! Грешка в помощният процес - %s %s %s %s! Внесени %d връзки и %d етикети Следващият пръстен ще има %d страни Няма нищо за запазване Готово Записът в %s се провали! Chemtool версия 1.6.14 автори: Martin Kroeker, Radek Liboska, Michael Banck и Thomas Volk http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html Български перевод: Светослав Стефановзапис на текущия чертеж във файл crashdump.cht %s не прилича на файл на Chemtool %s е създаден с по-нова версия. Някои детайли може да се загубят. DisplayЗаписване и изнасянеОтносноОтносно ChemtoolАдамантанДобавянеДобавяне на бял фон около етикетитеДобавяне на бял фон около етикетитеДобавяне на фрагмент от файлДобавяне от файл...Добавяне на структура от шаблонАденинВсичкоАминокиселиниАзуленФонов цвятБазова дължина на веригата:Базова дължина на веригата (10.668мм):БензолБензимидазолБинафтилБифенилВеригиКофеинМолекулярна масаМолекулярна масаОтказКарбоциклиЦентърЦентриране на молекулатаИзбиране на начален тип веригаИзчистване на чертежаИзчистванеЦъкнете и влачете мишката за да чертаете вериги по платното. Десният бутон на мишката се използва за изтриване на обекти - вериги или текст, в зависимост от режима на чертане. Бутоните с различни типове пръстени избират режим на чертане с избрани ъгли, но всъщност можете да чертаете под произволен ъгъл във всички режими. Бутонът с прекъсната линия на него ви позволява да чертаете криви, като маркирате контролни точки по кривата (cubic spline). Чрез подходящият бутон може да изберете тип на веригата и цвят или може да ги промените по-късно като натиснете желаната верига в режим Вериги. За да начертаете циклична система, просто натиснете Ctrl заедно с цифровият клавиш, отговарящ на броя на страните на полигона и тогава начертайте една страна като задържате Ctrl. За да начертаете етикети, напишете ги в текстовото поле в горният десен ъгъл на прозореца и ги поставете на платното с мишката. Може да използвате и клавишни комбинации за често срещани етикети докато сте в режим на чертане на вериги: Натиснете 'c' или 'n', 'o', 'p', 's', 'f' за да добавите символ на елемента в текущата позиция на чертане, '1', '2' и '3' за CH, CH_2 и CH_3, 'l' за Cl, '*' за голяма точка. Всеки клавиш от цифровата клавиатура вмъква 'електронна двойка' около атома, кореспондираща на позицията на клавиша относно централния клавиш на цифровата клавиатура. Текстовият режим използва следните представки за специален текст: '_' за долен индекс, '^' за горен индекс @ за символи (гръцки букви), '|' за курсив и '#' за получер текст. Когато текстовото поле е празно, цъкането върху произволен етикет в чертожната зона, води до копиране на този етикет в полето за повторно използване. Най-добре се чертае с мишката, но може да използвате и стрелките в комбинация с Ctrl за точно позициониране. Използвани с Alt, стрелките местят квадратната или ромбоидна мрежа, която може да бъде сложена на чертожната площ. Ако имате нужда от чертожни функции, които не се осигуряват от chemtool, опитайте да изнесете файл във fig формат и да редактирате вашата фигура в програмата на Brian Smith xfig. Допълнението и transfig/fig2dev e необходимо на chemtool за печат и изнасяне в eps или LaTex за разлика от fig, XBM и SVG, които се генерират директно. Друга полезна и силно препоръчвана програма е Babel - в оригиналната си и OpenBabel версия. И с двете версии chemtool може да внася данни от различни файлови формати, докато само внасяне и изнасяне на molfile е вградено в нея. Допълнителна помощ е налична в ръководството на chemtool и в README файла, включен в изходния код, а също така и на уеб страницата. Нормално това се намира в /usr/share/doc/packages/chemtool. Ако намерите някакви програмни грешки или имате въпрос, или предложение, моля свържете се с главният автор martin@ruby.chemie.uni-freiburg.deЗатварянеПараметри за настройкаОпитайте да инсталирате Babel/OpenBabel за конвертиране на файловите формати... КопиранеКопиране на маркирания обектКороненСъздаванеСъздаване на папкаСъздаване на папкаСъздаване на EPS, XFig, PicTeX или XBM файлЦиклопентатриенЦиклохексанЦиклооктатетраенЦиклопентадиенилЦитозинКаталог с данни:Намаляване на мащабаИзтриванеИзтриване на файлДиазолДициклопентадиенПапкиИмен на папка:Съдържанието на папката не може да бъде показано: %sЧертане под ъгъл от 0/30/60/90 градусаЧертане под ъгъл от 0/36/72/... градусаЧертане под ъгъл от 18/54/90/... градусаЧертане под ъгъл от 18/54/90/... градусаФигурални скобки около обектаСкоби и рамки около обектаКвадратни скоби около обектаТекст (центриран)Чертане на криви с 4 контролни точкиДекоративна рамка около обектаТекст (ляво подравнен)Текст (дясно подравнен)Кръгли скоби около обектаЗакръглена рамка около обектаКръгли скоби около обектаРамка с цвят около обектаПроста рамка около обектаЧертежът е запазен в %s (връзки: %d, етикети: %d) Разширение:РедактиранеГрешкаГрешка при зареждането на %s Изход от ChemtoolИзнасянеИзнасяне (Babel)Изнасяне чрез Babel...Изнасяне...Разширение:МасаФайлФайлът %s вече съществува! Презаписване?ФайловеПървиХоризонтално обръщанеХоризонтално обръщане на обектаВертикално обръщане на обектаВертикално обръщанеФлуоренФруктозаФукозаФулваленЯдро на ФуранозаГалактозаГлюкозаМрежа квадрат/ромб/изключенаГуанинПомощХепталенХетероциклиИмидазолВнасянеВнасяне на (Babel)Внесяне на MDL-файл...Внасяне на MOLВнасяне на PDBВнасяне на PDB-файл...Внасяне чрез Babel...Внасяне на PDBУвеличаване на мащабаИндолНеправилно изчисление (SIGFPE) - ЛактозаЛандшафтМащаб LaTeX/EPS:ЗарежданеЗареждане на Chemtool чертежЗареждане от файл...Търсене в:МалтозаМанозаМаркиране на обекти за преместване, завъртане или изтриванеМаска:Грешка с достъпа до паметта (SIGBUS) - Проблем с разпределението на паметта (SIGSEGV) - МорфинMorphine 3DПреместване на маркирания обектНафталинНевраминова киселинаНовСледващНеНеНорборнанОКОКОтварянеПринудителен изход (SIGHUP) - Ориентация:PDB етикети:Размер на хартията:Размер на хартията:ПорфинПортретПредставка: _ за долен индекс, ^ - за горен индекс, @ - за символи, | - курсив, # - получер. Например, H_2O, @a_D^2^0Предварително преглеждане на чертежите за добавяне в eps-файлове:Предварително преглеждане на чертежите за добавяне в eps-файлове:ПредишенПечатКоманда за печат:Команда за печат:Печат към postscript принтерМащаб при печат:Мащаб при печат:Име на принтер:Име на принтер:Проблем с конвертирането на %s Ядро на ПиранозаПиразолИзходПрочитане на MDL/molfile-файлПрочитане на PDB-файлГотовоПовтарянеПремахване на молекулатаПремахване на дублиращи се вериги и т.н.ПреименуванеПреименуване на файлМащабиране на маркирания обектРибофуранозаЗавъртане на маркирания обектЗапазванеЗапазване като...Запазване на настройкитеЗапазване като...Запазване на начални настройкиСъхраняване на чертежа във файлИзбиране на фонов цвятИзбиране на размер на текстаЦвят на писалкатаИзбор:Текущ шрифтНастройкиНачални настройкиНачални настройкиСпиро[4.5]деканСтероиден скелетЗахарозаЗахариПоддръжка на национални символи в етикетитеСимволиTIFF (цветно)TIFF (моно)ШаблониШаблони...Текст:Текущият чертеж не е запазен! Продължаване?ТиминПревключване на типа веригаИнструментиНе може да се отвори %s ОтмянаНеизвестна грешкаУрацилИзгледЗаписът в %s се провали! КсилозаДаПриближаване [+]Отдалечаване [-]Приближаване [+]Отдалечаване [-]Фонов цвятКаталог с данни:ОбщОриентация:Печатchemtool: не мога да заредя подходящ шрифт грешен режим на ъгъла %d грешен режим на текста %d минусбез номеране-H, без номеране-Hp-орбиталаплюспреподрежданебез имеchemtool-1.6.14/po/pl.po0000644000175000001440000006570012202261264014224 0ustar martinusers# translation of pl.po to # Copyright (C) 2003, 2008 Free Software Foundation, Inc. # Nikodem Kunik , 2003 # msgid "" msgstr "" "Project-Id-Version: pl\n" "Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: 2008-12-13 16:16+0100\n" "Last-Translator: Micha Smoczyk\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-2\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" "Rysunek nie zosta zapisany!\n" "Czy chcesz kontynuowa?" #: main.c:225 main.c:293 msgid "Yes" msgstr "Tak" #: main.c:240 main.c:308 msgid "No" msgstr "Nie" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" "Plik\n" "%s\n" "ju istnieje !\n" "Nadpisa ?" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" "\n" "Nastpny piercie bdzie mia %d boki" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" "\n" "Importowano %d wiza i %d etykiet" #: main.c:1359 main.c:2667 main.c:5829 msgid "unnamed" msgstr "bez_nazwy" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" "\n" "Gotowy" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" "\n" "Otwarcie pomocy nie powiodo si - %s %s %s %s!" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" "\n" "%s %s %s %s" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" "\n" "Rysunek zosta wydrukowany!" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" "\n" "Wydrukowanie rysunku nie powiodo si !" #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr "nieprawidowe ustawienie kta %d\n" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr "nieprawidowe ustawienie tekstu %d\n" #: main.c:2353 msgid "Load from file..." msgstr "Zaaduj z pliku..." #: main.c:2394 msgid "Import MDL file..." msgstr "Importuj plik MDL..." #: main.c:2434 msgid "Import via BABEL..." msgstr "Importuj poprzez BABEL..." #: main.c:2456 msgid "Export via BABEL..." msgstr "Eksportuj poprzez BABEL..." #: main.c:2478 msgid "Import PDB file..." msgstr "Importuj plik PDB..." #: main.c:2521 msgid "Add from file..." msgstr "Dodaj z pliku..." #: main.c:2637 msgid "Save as..." msgstr "Zapisz jako..." #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" "\n" "Brak danych do zapisania" #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" "\n" "Zapisanie do %s nie powiodo si !" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" "\n" "Rysunek zapisano jako %s (%d wiza, %d etykiet)" #: main.c:2821 main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" "Zapisanie do\n" " %s\n" "nie powiodo si !\n" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" "\n" "Rysunek eksportowano jako %s (%d wiza, %d etykiet)" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "" #: main.c:2979 main.c:3060 main.c:3101 main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr "Nie mona otworzy %s\n" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" "%s\n" " nie jest plikiem programu Chemtool\n" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" "%s zosta utworzony przez nowsz wersj programu \n" "Niektre funkcje mog nie dziaa prawidowo.\n" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr "Bd podczas wczytywania %s \n" #: main.c:3048 main.c:3089 main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" "\n" "Wybierz orientacj (Ctrl-Mysz1 dla z), po zakoczeniu nacinij Enter" #: main.c:3067 main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr "Problemy podczas konwersji %s\n" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" "Rysunek zapisano jako\n" " %s\n" " (%d wiza, %d etykiet)\n" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" "Nacinij i przecignij wskanik myszy, aby narysowa wizania. \n" "Prawy przycisk myszy suy do usuwania obiektw - wiza lub tekstu\n" "w zalenoci od aktywnego trybu.\n" "\n" "Przyciski z rnymi wieloktami (lewa strona panelu) umoliwiaj wybr\n" "trybu rysowania wiza ze wskazaniem na rne kty. Moliwe jest\n" "jednak rysowanie pod dowolnymi ktami po wybraniu kadego\n" "z przyciskw.\n" "\n" "Przycisk z aman krzyw pozwala na rysowanie krzywych opartych \n" "o wyznaczone przez uytkownika punkty kontrolne.\n" " \n" "Wyboru rodzaju, rzdu i koloru wiza mona dokona przez nacinicie\n" "przycisku wyboru domylnego typu wiza i koloru pira.\n" "\n" "Aby narysowa ukad cykliczny, trzymajc klawisz Ctrl\n" "naley przycisn klawisz cyfry (3, 4, 5,...)odpowiadajcy liczbie\n" "ktw podanego wielokta, a nastpnie dalej trzymajc klawisz Ctrl\n" "narysowa jeden z jego bokw.\n" "\n" "Aby opisa atomy lub grupy, naley wprowadzi tekst opisu w polu 'Tekst'\n" "a nastpnie umieci go w podanym miejscu za pomoc kursora.\n" "Aby doda symbole pierwiastkw do rysowanej wanie pozycji w trybie\n" "rysowania wiza, naley nacisn klawisze: c, n, p, o, s lub f.\n" "Nacinicie 1, 2 lub 3 spowoduje dodanie grup odpowiednio CH, CH_2\n" "lub CH_3, a nacinicie '*' spowoduje dodanie duej kropki.\n" "\n" "Naciskajc klawisze na klawiaturze alfanumerycznej dodana zostanie para\n" "elektronowa do ostatniego rysowanego elementu w pozycji jak zajmuje\n" "nacinity klawisz wok klawisza '5'.\n" "\n" "Pole tekstowe akceptuje nastpujce prefiksy dla specjalnego tekstu:\n" "_ dla indeksu dolnego, ^ dla indeksu grnego, @ dla symboli\n" "(alfabet grecki),\n" "| dla kursywy oraz # dla tekstu pogrubionego.\n" "Jeli pole tekstowe jest puste, mona skopiowa dowolny tekst z pola\n" "rysunku poprzez kliknicie na tekst.\n" "\n" "Najlepszy efekt rysowanie uzyskuje si przy zastosowaniu myszki.\n" "Mona te rysowa wykorzystujc klawisze kursora z kombinacjami\n" "klawiszy Crtl oraz Alt. Trzymajc klawisz Ctrl mona wybra podan\n" "pozycj rysowania, natomiast klawisz Alt umoliwia rysowanie prostoktne\n" "lub szecioktne w zalenoci od wybranej siatki.\n" "\n" "W przypadku potrzeby uycia funkcji graficznych, ktre nie s dostpne\n" "w programie ChemTool, mona skorzysta w opcji eksportu rysunku do formatu " "fig, a nastpnie edycji wyeksportowanego rysunku,w programie\n" "xfig B. Smitha.\n" " Cze tego pakietu (transfig/fig2dev) jest rwnie wykorzystywana przez\n" "ChemTool w czasie drukowania. i eksportu do formatw eps i LaTeX.\n" "Formaty fig, XBM i SVG s generowane bezporednio.\n" "Innym uytecznym i polecanym programem jest Babel, zarwno w oryginalnej\n" "postaci, jak i w ramach nowego projektu OpenBabel. Zastosowanie tych\n" "programw umoliwia import danych z wielu rnych formatw uywanych\n" "w chemii. Jedynie import i eksport do formatu molfile jest wbudowany\n" "w ChemTool.\n" "\n" "Bardziej szczegowa pomoc jest dostpna na stronie projektu ChemTool oraz\n" "w pliku README doczonym w dystrybucji rde i na stronie projektu.\n" "Zazwyczaj powinien te by zainstalowane w katalogu\n" "/usr/share/doc/packages/chemtool.\n" "W przypadku znalezienia bdw, zadania pyta, zgoszenia sugetii,\n" "autor prosi o kontakt: martin@ruby.chemie.uni-freiburg.de" #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" "Chemtool wersja 1.6.14\n" "Autorzy:\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" "\n" "Polskie tumaczenie: Nikodem Kunik, Micha Smoczyk" #: main.c:3450 msgid "PDB labels:" msgstr "Etykiety PDB:" #: main.c:3453 msgid "All" msgstr "Wszystkie" #: main.c:3461 msgid "non-H" msgstr "nie-H" #: main.c:3470 msgid "no numbers" msgstr "bez numeracji" #: main.c:3479 msgid "non H,no numbers" msgstr "nie H,bez numeracji" #: main.c:3489 main.c:3833 main.c:4139 msgid "None" msgstr "Nic" #: main.c:3501 msgid "SDF entry:" msgstr "" #: main.c:3504 msgid "First" msgstr "Pierwszy" #: main.c:3511 msgid "Previous" msgstr "Poprzedni" #: main.c:3518 msgid "Next" msgstr "Nastpny" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr "Wspczynnik skali dla Latex / EPS :" #: main.c:3708 msgid "Unknown error" msgstr "Nieznany bd" #: main.c:3732 main.c:4010 msgid "Configurable options" msgstr "Opcje" #: main.c:3767 msgid "_General" msgstr "_Oglne" #: main.c:3788 #, fuzzy msgid "Display" msgstr "Wywietlanie" #: main.c:3794 msgid "Saving and Exporting" msgstr "Zapisywanie i eksport" #: main.c:3800 msgid "Other" msgstr "Inne" #: main.c:3811 msgid "_Background color:" msgstr "Kolor _ta:" #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr "Dodaj biay _wypeniony prostokt pod etykietami" #: main.c:3834 main.c:4148 msgid "EPSI" msgstr "EPSI" #: main.c:3835 main.c:4157 msgid "TIFF mono" msgstr "mono TIFF" #: main.c:3836 main.c:4165 msgid "TIFF color" msgstr "kolor TIFF" #: main.c:3841 msgid "_Data directory:" msgstr "Katalog _danych:" #: main.c:3848 msgid "E_xtension:" msgstr "_Rozszerzenie:" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr "Podld obrazu, ktry zostanie dodany do plikw _eps:" #: main.c:3863 main.c:4184 msgid "Support national character sets in labels" msgstr "Obsuga narodowych zestaww znakw w etykietach" #: main.c:3883 msgid "Base bond _length:" msgstr "Podstawowa dugo _wiza:" #: main.c:3891 msgid "Double bond _separation:" msgstr "_Odstp podwjnych wiza:" #: main.c:3904 msgid "_Printing" msgstr "Drukuj" #: main.c:3934 main.c:4049 msgid "Portrait" msgstr "Portret" #: main.c:3935 main.c:4054 msgid "Landscape" msgstr "Pejza" #: main.c:3949 msgid "Print _command:" msgstr "Pole_cenie drukowania:" #: main.c:3956 msgid "Printer _name:" msgstr "_Nazwa drukarki:" #: main.c:3963 msgid "Paper si_ze:" msgstr "_Rozmiar papieru:" #: main.c:3970 msgid "_Orientation:" msgstr "_Orientacja:" #: main.c:3977 msgid "Print sc_ale factor:" msgstr "Czynnik _skali wydruku:" #: main.c:3993 msgid "Select background color" msgstr "Wybierz kolor ta" #: main.c:4019 msgid "Paper size:" msgstr "Rozmiar papieru:" #: main.c:4044 msgid "Orientation:" msgstr "Orientacja:" #: main.c:4069 msgid "Print scale factor :" msgstr "Czynnik skali wydruku :" #: main.c:4094 msgid "Print command:" msgstr "Polecenie drukowania:" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr "Podld obrazu, ktry zostanie dodany do plikw eps :" #: main.c:4198 msgid "Background color :" msgstr "Kolor ta :" #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr "Dodaj biay wypeniony prostokt pod etykietami" #: main.c:4225 msgid "Printer name:" msgstr "Nazwa drukarki:" #: main.c:4238 msgid "Data directory:" msgstr "Katalog danych:" #: main.c:4251 msgid "Extension:" msgstr "Rozszerzenie:" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr "Podstawowa dugo wiza (10.668mm) :" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "Odstp podwjnych wiza (4 piksele) :" #: main.c:4298 msgid "Ok" msgstr "Ok" #: main.c:4308 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "Anuluj" #: main.c:4327 main.c:4912 msgid "Templates" msgstr "Szablony" #: main.c:4338 main.c:4340 msgid "Carbocycles" msgstr "Karbocykle" #: main.c:4378 main.c:4380 msgid "Sugars" msgstr "Cukry" #: main.c:4422 main.c:4424 msgid "Heterocycles" msgstr "Heterocykle" #: main.c:4466 main.c:4468 msgid "Amino Acids" msgstr "Aminokwasy" #: main.c:4511 main.c:4513 msgid "Symbols" msgstr "Symbole" #: main.c:4559 gtkfilesel.c:1196 msgid "Close" msgstr "Zamknij" #: main.c:4605 msgid "New" msgstr "Nowy" #: main.c:4613 msgid "Open" msgstr "Otwrz" #: main.c:4621 main.c:4904 msgid "Add" msgstr "Dodaj" #: main.c:4629 msgid "Import MOL" msgstr "Importuj MOL" #: main.c:4637 msgid "Import PDB" msgstr "Importuj PDB" #: main.c:4645 msgid "Import (Babel)" msgstr "Importuj (poprzez Babel)" #: main.c:4653 msgid "Export..." msgstr "Eksportuj..." #: main.c:4661 msgid "Export (Babel)" msgstr "Eksportuj (poprzez Babel)" #: main.c:4670 main.c:4941 msgid "Print" msgstr "Drukuj" #: main.c:4678 msgid "Setup Defaults" msgstr "Ustawienia domylne" #: main.c:4693 main.c:4960 msgid "Save Config" msgstr "Zapisz konfiguracj" #: main.c:4702 main.c:4921 msgid "Save" msgstr "Zapisz" #: main.c:4710 msgid "Save As..." msgstr "Zapisz jako..." #: main.c:4719 main.c:5031 msgid "Quit" msgstr "Zakocz" #: main.c:4727 msgid "File" msgstr "Plik" #: main.c:4734 msgid "Copy" msgstr "Kopiuj" #: main.c:4746 msgid "Flip horizontally" msgstr "Odwr poziomo" #: main.c:4752 msgid "Flip vertically" msgstr "Odwr pionowo" #: main.c:4759 msgid "Undo" msgstr "Cofnij" #: main.c:4767 msgid "Redo" msgstr "Przywr" #: main.c:4777 msgid "Edit" msgstr "Edycja" #: main.c:4784 msgid "Zoom in" msgstr "Powiksz" #: main.c:4790 msgid "Zoom out" msgstr "Pomniejsz" #: main.c:4801 main.c:4996 msgid "Center" msgstr "Wycentruj" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr "Siatka prosto-/szeciokt/brak" #: main.c:4815 msgid "View" msgstr "Widok" #: main.c:4823 msgid "Templates..." msgstr "Szablony..." #: main.c:4832 msgid "Calculate Formula Weight" msgstr "Oblicz mas czsteczkow" #: main.c:4840 msgid "Clean up drawing" msgstr "Wyrwnaj rysunek" #: main.c:4846 msgid "Tools" msgstr "Narzdzia" #: main.c:4854 main.c:5039 msgid "About" msgstr "O programie ChemTool..." #: main.c:4863 main.c:4872 msgid "Help" msgstr "Pomoc" #: main.c:4895 msgid "Load" msgstr "Wczytaj" #: main.c:4900 msgid "Load a chemtool sketch" msgstr "Wczytaj rysunek chemtool" #: main.c:4909 msgid "Add fragment from file" msgstr "Dodaje fragment z pliku" #: main.c:4918 msgid "Add template structure" msgstr "Dodaje struktur z biblioteki" #: main.c:4926 msgid "Save sketch to file" msgstr "Zapisuj rysunek do pliku" #: main.c:4929 msgid "Export" msgstr "Eksportuj" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "Utwrz plik graficzny EPS, XFig, PicTeX lub XBM" #: main.c:4947 msgid "Print file to a postscript printer" msgstr "Wydrukuj plik na drukarce postscriptowej" #: main.c:4950 msgid "Setup" msgstr "Ustawienia" #: main.c:4957 msgid "Setup default options" msgstr "Ustawienia domylne" #: main.c:4966 msgid "Save default options" msgstr "Zapisz domylne opcje" #: main.c:4969 msgid "Import" msgstr "Importuj" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr "Wczytaj plik zapisany w formacie MDL/molfile" #: main.c:4978 msgid "ImportPDB" msgstr "Importuj PDB" #: main.c:4984 msgid "Read a file written in PDB format" msgstr "Wczytaj plik zapisany w formacie PDB" #: main.c:4987 msgid "Zoom In" msgstr "Powiksz" #: main.c:4992 msgid "Increase zoom scale" msgstr "Zwiksza skal powikszenia" #: main.c:5002 msgid "Center molecule in drawing area" msgstr "Wycentruj czsteczk w obszarze rysowania" #: main.c:5005 msgid "Zoom Out" msgstr "Pomniejsz" #: main.c:5010 msgid "Decrease zoom scale" msgstr "Zmniejsz skal powikszenia" #: main.c:5014 msgid "Clear" msgstr "Wyczy" #: main.c:5019 msgid "Remove molecule" msgstr "Usu czsteczk" #: main.c:5022 msgid "FW" msgstr "Ms" #: main.c:5027 msgid "Calculate Formula Mass" msgstr "Oblicz mas czsteczkow (Ms)" #: main.c:5036 msgid "Exit Chemtool" msgstr "Zakocz Chemtool" #: main.c:5045 msgid "About Chemtool" msgstr "Informacje o Chemtool" #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr "Rysowanie pod ktami 0/30/60/90 stopni" #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr "Rysowanie pod ktami 0/36/72/... stopni" #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr "Rysowanie pod ktami 18/54/90/... stopni" #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr "Rysowanie pod ktami 0/45/90/... stopni" #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr "Rysowanie krzywych opartych na 4 punktach kontrolnych" #: main.c:5174 msgid "Draw left-justified text" msgstr "Utworzenie tekstu wyrwnanego do lewej" #: main.c:5191 msgid "Draw centered text" msgstr "Utworzenie tekstu wycentrowanego" #: main.c:5208 msgid "Draw right-justified text" msgstr "Utworzenie tekstu wyrwnanego do prawej" #: main.c:5236 msgid "Set current textfont" msgstr "Wybr czcionki" #: main.c:5266 msgid "Choose default bond type" msgstr "Wybr domylnego typu wiza" #: main.c:5283 msgid "Select pen color" msgstr "Wybr koloru pira" #: main.c:5288 msgid "Bonds" msgstr "Wizania" #: main.c:5293 msgid "Toggle bond types" msgstr "Zmiana typu wiza" #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr "Zaznaczanie obiektw, ktre mona w nastpstwie przesuwa, obraca lub usuwa" #: main.c:5327 msgid "Move marked object" msgstr "Przesunicie zaznaczonych obiektw" #: main.c:5344 msgid "Rotate marked object" msgstr "Obrt zaznaczonych obiektw" #: main.c:5363 msgid "Flip object horizontally" msgstr "Poziome odwrcenie obiektw" #: main.c:5381 msgid "Flip object vertically" msgstr "Pionowe odwrcenie obiektw" #: main.c:5407 msgid "Copy marked object" msgstr "Kopiowanie zaznaczonych obiektw" #: main.c:5422 msgid "Rescale marked object" msgstr "Zmiana skali zaznaczonych obiektw" #: main.c:5441 msgid "Draw brackets around object" msgstr "Rysowanie nawiasw wok obiektw" #: main.c:5456 msgid "Draw rounded brackets around object" msgstr "Rysowanie nawiasw okrgych wok obiektw" #: main.c:5471 msgid "Draw round brackets around object" msgstr "Rysowanie nawiasw okrgych wok obiektw" #: main.c:5486 msgid "Draw braces around object" msgstr "Rysowanie nawiasw kwadratowych wok obiektw" #: main.c:5501 msgid "Draw simple box around object" msgstr "Rysowanie zwykych prostoktw wok obiektw" #: main.c:5515 msgid "Draw shaded box around object" msgstr "Rysowanie cieniowany prostoktw wok obiektw" #: main.c:5529 msgid "Draw fancy box around object" msgstr "Rysowanie wymylnych prostoktw wok obiektw" #: main.c:5543 msgid "Draw rounded box around object" msgstr "Rysowanie zaokrglonych prostoktw wok obiektw" #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr "Rysowanie nawiasw i prostoktw wok obiektw" #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr "Usuwanie podwojonych wiza, itp." #: main.c:5605 msgid "Text :" msgstr "Tekst :" #: main.c:5619 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "" "Wprowad wyraenie poprzedzone: _ dla indeksu dolnego; ^ dla indeksu " "grnego; @ dla symboli; | dla kursywy; # dla pogrubionego; np.: H_2O, " "@a_D^2^0" #: main.c:5624 msgid "Select current text size" msgstr "Wybr rozmiaru czcionki" #: main.c:5753 #, c-format msgid "Ready" msgstr "Gotowy" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "chemtool: nie mona wczyta czcionek\n" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr "Bd w alokacji pamici (SIGSEGV) -" #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr "Bd w operacjach matematycznych (SIGFPE) -" #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr "Bd w dostpie do pamici (SIGBUS) -" #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr "System wyda polecenie zakoczenia (SIGHUP) -" #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr "zapisywanie aktualnego rysunku do pliku crashdump.cht\n" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "cieka:" #: gtkfilesel.c:796 msgid "Directories" msgstr "Katalogi" #: gtkfilesel.c:825 msgid "Mask:" msgstr "Maskuj:" #: gtkfilesel.c:838 msgid "Files" msgstr "Pliki" #: gtkfilesel.c:872 msgid "OK" msgstr "OK" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "Nie mona odczyta katalogu: %s" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "Utwrz katalog" #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr "Usu plik" #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr "Zmie nazw pliku" #: gtkfilesel.c:1173 msgid "Error" msgstr "Bd" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "Utwrz katalog" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "Nazwa katalogu:" #: gtkfilesel.c:1297 msgid "Create" msgstr "Utwrz" #: gtkfilesel.c:1397 msgid "Delete" msgstr "Usu" #: gtkfilesel.c:1512 msgid "Rename" msgstr "Zmie nazw" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "Wybr: " #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr "Zainstalowanie Babel/OpenBabel umoliwi konwersje plikw chemicznych...\n" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "Cyklopentadienyl" #: templates.hx:2 msgid "Benzene" msgstr "Benzen" #: templates.hx:2 msgid "Naphthalene" msgstr "Naftalen" #: templates.hx:2 msgid "Azulene" msgstr "Azulen" #: templates.hx:3 msgid "Adamantane" msgstr "Adamantan" #: templates.hx:3 templates.hx:5 msgid "Cyclohexane" msgstr "Cykloheksan" #: templates.hx:3 msgid "Steroid backbone" msgstr "Szkielet steroidowy" #: templates.hx:3 msgid "Cycloheptatriene" msgstr "Cykloheptatrien" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "Cyklooktatetraen" #: templates.hx:4 msgid "Fluorene" msgstr "Fluoren" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "Spiro[4.5]dekan" #: templates.hx:4 msgid "Heptalene" msgstr "Heptalen" #: templates.hx:4 msgid "Fulvalene" msgstr "Fulwalen" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "Dicyklopentadien" #: templates.hx:5 msgid "Indene" msgstr "Inden" #: templates.hx:5 msgid "Biphenyl" msgstr "Bifenyl" #: templates.hx:5 msgid "Norbornane" msgstr "Norbornan" #: templates.hx:5 msgid "Binaphthyl" msgstr "Binaftyl" #: templates.hx:6 msgid "Coronene" msgstr "Koronen" #: templates.hx:8 msgid "Pyranose core" msgstr "Szkielet piranozowy" #: templates.hx:8 msgid "Furanose core" msgstr "Szkielet furanozowy" #: templates.hx:8 msgid "Ribofuranose" msgstr "Rybofuranoza" #: templates.hx:8 msgid "Fructose" msgstr "Fruktoza" #: templates.hx:8 msgid "Galactose" msgstr "Galaktoza" #: templates.hx:9 msgid "Glucose" msgstr "Glukoza" #: templates.hx:9 msgid "Mannose" msgstr "Mannoza" #: templates.hx:9 msgid "Fucose" msgstr "Fukoza" #: templates.hx:9 msgid "Xylose" msgstr "Ksyloza" #: templates.hx:9 msgid "Neuraminic acid" msgstr "Kwas neuraminowy" #: templates.hx:10 msgid "Sucrose" msgstr "Sacharoza" #: templates.hx:10 msgid "Maltose" msgstr "Maltoza" #: templates.hx:10 msgid "Lactose" msgstr "Laktoza" #: templates.hx:14 msgid "Adenine" msgstr "Adenina" #: templates.hx:14 msgid "Guanine" msgstr "Guanina" #: templates.hx:14 msgid "Thymine" msgstr "Tymina" #: templates.hx:14 msgid "Cytosine" msgstr "Cytozyna" #: templates.hx:14 msgid "Uracil" msgstr "Uracyl" #: templates.hx:15 msgid "Porphine" msgstr "Porfiryna" #: templates.hx:15 msgid "Caffeine" msgstr "Kofeina" #: templates.hx:15 msgid "Evans auxiliary" msgstr "grupa Evansa" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "grupa SAMP" #: templates.hx:15 msgid "Imidazole" msgstr "Imidazol" #: templates.hx:16 msgid "Benzimidazole" msgstr "Benzimidazol" #: templates.hx:16 msgid "Pyrazole" msgstr "Pirazol" #: templates.hx:16 msgid "Diazole" msgstr "Diazol" #: templates.hx:17 msgid "Morphine" msgstr "Morfina" #: templates.hx:17 msgid "Morphine 3D" msgstr "Morfina 3D" #: templates.hx:23 msgid "Backbone" msgstr "" #: templates.hx:26 msgid "p orbital" msgstr "orbital p" #: templates.hx:26 msgid "plus" msgstr "plus" #: templates.hx:26 msgid "minus" msgstr "minus" #: templates.hx:26 msgid "rearrangement" msgstr "przegrupowanie" chemtool-1.6.14/po/nl.po0000644000175000001440000007307012202261236014220 0ustar martinusers# Dutch translation for chemtool. # Copyright (C) 2005 Free Software Foundation, Inc. # Myckel Habets , 2005. # msgid "" msgstr "" "Project-Id-Version: Chemtool-1.6.3\n" "Report-Msgid-Bugs-To: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: 2005-01-10 18:53+0100\n" "Last-Translator: Myckel Habets \n" "Language-Team: NONE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" "De huidige tekening is niet opgeslagen !\n" "Wilt u echt doorgaan?" #: main.c:225 main.c:293 msgid "Yes" msgstr "Ja" #: main.c:240 main.c:308 msgid "No" msgstr "Nee" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" "Bestand\n" "%s\n" "bestaat al !\n" "Overschrijven ?" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" "\n" "De volgende getekende ring zal %d kanten hebben" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" "\n" "%d bindingen en %d labels geimporteerd" #: main.c:1359 main.c:2667 main.c:5829 msgid "unnamed" msgstr "naamloos" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" "\n" "Gereed" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" "\n" "Helpprogramma faalde - %s %s %s %s!" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" "\n" "%s %s %s %s" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" "\n" "Tekening afgedrukt!" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" "\n" "Kon tekening niet afdrukken !" #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr "ongeldige hoekmodus %d\n" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr "ongeldige tekstmodus %d\n" #: main.c:2353 msgid "Load from file..." msgstr "laden van bestand..." #: main.c:2394 msgid "Import MDL file..." msgstr "Importeer MDL bestand..." #: main.c:2434 msgid "Import via BABEL..." msgstr "Importeer via BABEL..." #: main.c:2456 msgid "Export via BABEL..." msgstr "Exporteer via BABEL..." #: main.c:2478 msgid "Import PDB file..." msgstr "Importeer PDB bestand..." #: main.c:2521 msgid "Add from file..." msgstr "Toevoegen van bestand..." #: main.c:2637 msgid "Save as..." msgstr "Opslaan als..." #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" "\n" "Niets om op te slaan" #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" "\n" "Kon niet naar %s schrijven!" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" "\n" "Tekening als %s opgeslagen (%d bindingen, %d labels)" #: main.c:2821 main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" "Kon niet naar\n" "%s\n" "schrijven!\n" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" "\n" "Tekening als %s geexporteerd (%d bindingen, %d labels)" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "" #: main.c:2979 main.c:3060 main.c:3101 main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr "Kan %s niet openen\n" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" "%s\n" " lijkt geen Chemtool bestand te zijn\n" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" "%s was met een nieuwere versie van Chemtool gemaakt.\n" "Enkele gegevens kunnen verloren zijn gegaan.\n" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr "%s kan niet geladen worden\n" #: main.c:3048 main.c:3089 main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" "\n" "Kies richting (Ctrl-Muis1 voor z), druk Enter als u klaar bent" #: main.c:3067 main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr "Problemen met conversie van %s\n" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" "Tekening als\n" "%s\n" "opgeslagen (%d bindingen, %d labels)\n" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" "Klik en sleep the muis om bindingen in het tekenvlak te tekenen.\n" "De rechter muisknop wordt gebruikt om objecten te verwijderen - zowel\n" "bindingen als tekst, afhankelijk van welke tekenmodus actief is.\n" "\n" "De knoppen met verschillende ringtypes selecteren de tekenmoduses\n" "met de gewenste hoeken, maar je kan ook in elke hoek in alle moduses " "tekenen.\n" "\n" "De knop met de gesegmenteerde lijn laat u curves tekenen door\n" "controlepunten langs de curve aan te geven.\n" "U kan de bindingstype en kleur selecteren met de daarvoor aangegeven knop\n" "of verander het later door klikken op de gewenste binding in bindingsmodus.\n" "\n" "Om een cyclisch systeem te tekenen, druk tegelijk op de CTRL toets en de\n" "numerieke toets overeenkomend met het aantal zijden van de polygon, en\n" "teken dan een zijde terwijl u de CTRL knop ingedrukt houdt.\n" "\n" "Voor het tekenen van tekstlabels, schrijf ze in de tekstregel bovenin het \n" "venster en plaats ze in het tekenvenster met de muis. U kan ook een aantal\n" "sneltoetsen voor veelvuldig gebruikte tekstlabels gebruiken als u in " "bindings-\n" "tekenmodus bent: Druk de 'c' toets, of n, o, p, s, f om een element symbool " "op\n" "de huidige tekenpositie te tekenen. 1, 2 en 3 voor CH, CH_2 en CH_3, l voor " "Cl,\n" "* voor een dikke punt.\n" "\n" "De toetsen va het nummerieke toetsenbord voegen elk een 'electronenpaar' " "lijn\n" "om een atoomsymbool in, in de positie overeenkomend met de locatie van de " "toets\n" "ten opzichte van de centrum van het numerieke toetsenbord.\n" "\n" "De tekstmodus gebruikt de volgende prefixes voor speciale tekst:\n" "_ voor subscript, ^ voor superscript, @ voor symbolen (griekse tekens),\n" "| voor schuin geschreven tekens en # voor vette tekst.\n" "Als de tekstregel leeg is, kliken op een tekstlabel in het tekenvenster\n" "copieert die tekstlabel in de tekstregel voor hergebruik.\n" "\n" "Tekenen is het makkelijkst met de muis, maar ook de cursor toetsen\n" "in combinatie met de CTRL toets kan gebruikt worden voor exacte\n" "positionering. Als de Alt toets gebruikt wordt, verplaatsen de cursor\n" "toetsen de vierkantige of zeskantige raster die op het tekenvenster\n" "geprojecteerd kan worden.\n" "\n" "Als u algemene tekenfunties nodig heeft, die niet door chemtool geleverd\n" "worden, probeer te exporteren naar fig formaat en bewerk uw tekening in\n" "Brian Smith's xfig programma. Zijn bijgeleverde transfig/fig2dev is nodig\n" "voor chemtool voor afdrukken en exporteren naar eps of LaTeX, terwijl de " "fig,\n" "XBM en SVG uitvoer direct gegenereerd worden. Nog een bruikbaar en " "aanbevolen\n" "hulpprogramma is Babel - zowel in zijn originele versie als in de vorm van " "het\n" "nieuwe OpenBabel project. Door gebruik van een van de versies, is chemtool " "in\n" "staat gegevens in exotische bestandsformaten te importeren, terwijl alleen\n" "molfile im- en export in chemtool ingebouwd is.\n" "\n" "Meer help is beschikbaar in de handleidingspagina van chemtool en in het\n" "bestand README, bijgeleverd in de bron distributie en op de website. Deze\n" "zou normaal in /usr/share/doc/packages/chemtool te vinden moeten zijn.\n" "Als u bugs vind, suggesties of vragen heeft, neem a.u.b. contact op met de\n" "schrijver, martin@ruby.chemie.uni-freiburg.de (Duitse of Engelse taal a.u.b.)" #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" " Chemtool Versie 1.6.14\n" "door\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "en\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" #: main.c:3450 msgid "PDB labels:" msgstr "PDB Labels:" #: main.c:3453 msgid "All" msgstr "Alle" #: main.c:3461 msgid "non-H" msgstr "niet-H" #: main.c:3470 msgid "no numbers" msgstr "zonder nummers" #: main.c:3479 msgid "non H,no numbers" msgstr "zonder H, geen nummers" #: main.c:3489 main.c:3833 main.c:4139 msgid "None" msgstr "Geen" #: main.c:3501 msgid "SDF entry:" msgstr "" #: main.c:3504 msgid "First" msgstr "" #: main.c:3511 msgid "Previous" msgstr "" #: main.c:3518 msgid "Next" msgstr "" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr "Latex / EPS schalingsfactor :" #: main.c:3708 msgid "Unknown error" msgstr "Onbekende fout" #: main.c:3732 main.c:4010 msgid "Configurable options" msgstr "Instellingen" #: main.c:3767 msgid "_General" msgstr "" #: main.c:3788 msgid "Display" msgstr "" #: main.c:3794 msgid "Saving and Exporting" msgstr "" #: main.c:3800 msgid "Other" msgstr "" #: main.c:3811 msgid "_Background color:" msgstr "Achtergrond_kleur:" #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr "_Witte achtergrond onder labels" #: main.c:3834 main.c:4148 msgid "EPSI" msgstr "EPSI" #: main.c:3835 main.c:4157 msgid "TIFF mono" msgstr "TIFF mono" #: main.c:3836 main.c:4165 msgid "TIFF color" msgstr "TIFF kleur" #: main.c:3841 msgid "_Data directory:" msgstr "_Gegevensdirectory:" #: main.c:3848 msgid "E_xtension:" msgstr "_Uitbreiding:" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr "_Voorbeeld plaatje om aan EPS bestanden toe te voegen:" #: main.c:3863 main.c:4184 msgid "Support national character sets in labels" msgstr "" #: main.c:3883 msgid "Base bond _length:" msgstr "Standaard bindings_lengte:" #: main.c:3891 msgid "Double bond _separation:" msgstr "" #: main.c:3904 msgid "_Printing" msgstr "Afdrukken" #: main.c:3934 main.c:4049 msgid "Portrait" msgstr "Staand" #: main.c:3935 main.c:4054 msgid "Landscape" msgstr "Liggend" #: main.c:3949 msgid "Print _command:" msgstr "Afdruk_commando:" #: main.c:3956 msgid "Printer _name:" msgstr "Printer_naam:" #: main.c:3963 msgid "Paper si_ze:" msgstr "Papier_formaat" #: main.c:3970 msgid "_Orientation:" msgstr "_Orientatie:" #: main.c:3977 msgid "Print sc_ale factor:" msgstr "_Schalingsfactor:" #: main.c:3993 msgid "Select background color" msgstr "Selecteer achtergrondkleur" #: main.c:4019 msgid "Paper size:" msgstr "Papierformaat" #: main.c:4044 msgid "Orientation:" msgstr "Orientatie:" #: main.c:4069 msgid "Print scale factor :" msgstr "Schalingsfactor :" #: main.c:4094 msgid "Print command:" msgstr "Afdrukcommando:" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr "Voorbeeld plaatje om aan eps bestanden toe te voegen :" #: main.c:4198 msgid "Background color :" msgstr "Achtergrondkleur :" #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr "Witte achtergrond onder labels" #: main.c:4225 msgid "Printer name:" msgstr "Printernaam:" #: main.c:4238 msgid "Data directory:" msgstr "Gegevensdirectory:" #: main.c:4251 msgid "Extension:" msgstr "Uitbreiding:" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr "Standaard bindingslengte (10.668mm) :" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "" #: main.c:4298 msgid "Ok" msgstr "Ok" #: main.c:4308 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "Annuleren" #: main.c:4327 main.c:4912 msgid "Templates" msgstr "Sjablonen" #: main.c:4338 main.c:4340 msgid "Carbocycles" msgstr "Carbocyclen" #: main.c:4378 main.c:4380 msgid "Sugars" msgstr "Suikers" #: main.c:4422 main.c:4424 msgid "Heterocycles" msgstr "Heterocyclen" #: main.c:4466 main.c:4468 msgid "Amino Acids" msgstr "Aminozuren" #: main.c:4511 main.c:4513 msgid "Symbols" msgstr "Symbolen" #: main.c:4559 gtkfilesel.c:1196 msgid "Close" msgstr "Sluiten" #: main.c:4605 msgid "New" msgstr "Nieuw" #: main.c:4613 msgid "Open" msgstr "Openen" #: main.c:4621 main.c:4904 msgid "Add" msgstr "Toevoegen" #: main.c:4629 msgid "Import MOL" msgstr "Importeer MOL" #: main.c:4637 msgid "Import PDB" msgstr "Importeer PDB" #: main.c:4645 msgid "Import (Babel)" msgstr "Importeer (Babel)" #: main.c:4653 msgid "Export..." msgstr "Exporteer..." #: main.c:4661 msgid "Export (Babel)" msgstr "Exporteer (Babel)..." #: main.c:4670 main.c:4941 msgid "Print" msgstr "Afdrukken" #: main.c:4678 msgid "Setup Defaults" msgstr "Standaardinstellingen" #: main.c:4693 main.c:4960 msgid "Save Config" msgstr "Configuratie opslaan" #: main.c:4702 main.c:4921 msgid "Save" msgstr "Opslaan" #: main.c:4710 msgid "Save As..." msgstr "Opslaan als..." #: main.c:4719 main.c:5031 msgid "Quit" msgstr "Afsluiten" #: main.c:4727 msgid "File" msgstr "Bestand" #: main.c:4734 msgid "Copy" msgstr "Kopieren" #: main.c:4746 msgid "Flip horizontally" msgstr "Horizontaal spiegelen" #: main.c:4752 msgid "Flip vertically" msgstr "Vertikaal spiegelen" #: main.c:4759 msgid "Undo" msgstr "Ongedaan maken" #: main.c:4767 msgid "Redo" msgstr "Nogmaals" #: main.c:4777 msgid "Edit" msgstr "Bewerken" #: main.c:4784 msgid "Zoom in" msgstr "Vergroten" #: main.c:4790 msgid "Zoom out" msgstr "Verkleinen" #: main.c:4801 main.c:4996 msgid "Center" msgstr "Centreren" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr "Raster quadr./hex./uit" #: main.c:4815 msgid "View" msgstr "Beeld" #: main.c:4823 msgid "Templates..." msgstr "Sjablonen..." #: main.c:4832 msgid "Calculate Formula Weight" msgstr "Bereken Molecuulmassa" #: main.c:4840 msgid "Clean up drawing" msgstr "Tekening opschonen" #: main.c:4846 msgid "Tools" msgstr "Gereedschappen" #: main.c:4854 main.c:5039 msgid "About" msgstr "Info" #: main.c:4863 main.c:4872 msgid "Help" msgstr "Help" #: main.c:4895 msgid "Load" msgstr "Laden" #: main.c:4900 msgid "Load a chemtool sketch" msgstr "Laad een chemtool tekening" #: main.c:4909 msgid "Add fragment from file" msgstr "Fragment van bestand toevoegen" #: main.c:4918 msgid "Add template structure" msgstr "Structuur sjabloon toevoegen" #: main.c:4926 msgid "Save sketch to file" msgstr "Tekening naar bestand opslaan" #: main.c:4929 msgid "Export" msgstr "Exporteren" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "Maak een EPS, XFig, PicTeX of XBM bestand" #: main.c:4947 msgid "Print file to a postscript printer" msgstr "Druk bestand af naar een postscript printer" #: main.c:4950 msgid "Setup" msgstr "" #: main.c:4957 msgid "Setup default options" msgstr "Standaardinstellingen" #: main.c:4966 msgid "Save default options" msgstr "" #: main.c:4969 msgid "Import" msgstr "Importeer" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr "Lees een bestand, geschreven in MDL/molfile formaat" #: main.c:4978 msgid "ImportPDB" msgstr "Importeer PDB" #: main.c:4984 msgid "Read a file written in PDB format" msgstr "Lees een bestand, geschreven in PDB formaat" #: main.c:4987 msgid "Zoom In" msgstr "Inzoomen" #: main.c:4992 msgid "Increase zoom scale" msgstr "Vergroot de zoomfactor" #: main.c:5002 msgid "Center molecule in drawing area" msgstr "Centreert molekuul in tekengebied" #: main.c:5005 msgid "Zoom Out" msgstr "Uitzoomen" #: main.c:5010 msgid "Decrease zoom scale" msgstr "Verkleint de zoomfactor" #: main.c:5014 msgid "Clear" msgstr "Wissen" #: main.c:5019 msgid "Remove molecule" msgstr "Wist de tekening" #: main.c:5022 msgid "FW" msgstr "MW" #: main.c:5027 msgid "Calculate Formula Mass" msgstr "Bereken Molecuulgewicht" #: main.c:5036 msgid "Exit Chemtool" msgstr "Sluit Chemtool af" #: main.c:5045 msgid "About Chemtool" msgstr "Info over Chemtool" #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr "Tekenen met 0/30/60/90 graden" #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr "Tekenen met 0/36/72 graden" #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr "Tekenen met 18/54/90 graden" #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr "Tekenen met 0/45/90 graden" #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr "Teken curven gebaseerd op 4 controlepunten" #: main.c:5174 msgid "Draw left-justified text" msgstr "Tekst links uitlijnen" #: main.c:5191 msgid "Draw centered text" msgstr "Tekst centreren" #: main.c:5208 msgid "Draw right-justified text" msgstr "Tekst rechts uitlijnen" #: main.c:5236 msgid "Set current textfont" msgstr "Huidige lettertype instellen" #: main.c:5266 msgid "Choose default bond type" msgstr "Kies standaard bindingstype" #: main.c:5283 msgid "Select pen color" msgstr "Selecteer tekenkleur" #: main.c:5288 msgid "Bonds" msgstr "Bindingen" #: main.c:5293 msgid "Toggle bond types" msgstr "Aan/uit bindingstypen" #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr "Markeer objecten voor verplaatsen, rotatie en verwijdering" #: main.c:5327 msgid "Move marked object" msgstr "Verplaats gemarkeerd object" #: main.c:5344 msgid "Rotate marked object" msgstr "Roteer gemarkeerd object" #: main.c:5363 msgid "Flip object horizontally" msgstr "Spiegel object horizontaal" #: main.c:5381 msgid "Flip object vertically" msgstr "Spiegel object vertikaal" #: main.c:5407 msgid "Copy marked object" msgstr "Kopieer gemarkeerd object" #: main.c:5422 msgid "Rescale marked object" msgstr "Vergroot/verklein gemarkeerd object" #: main.c:5441 msgid "Draw brackets around object" msgstr "Teken haken om object" #: main.c:5456 msgid "Draw rounded brackets around object" msgstr "Teken ronde haken om object" #: main.c:5471 msgid "Draw round brackets around object" msgstr "Teken ronde haken om object" #: main.c:5486 msgid "Draw braces around object" msgstr "Teken krulhaken om object" #: main.c:5501 msgid "Draw simple box around object" msgstr "Teken simpel vierkant om object" #: main.c:5515 msgid "Draw shaded box around object" msgstr "Teken vierkant met schaduw om object" #: main.c:5529 msgid "Draw fancy box around object" msgstr "Teken omtekend vierkant om object" #: main.c:5543 msgid "Draw rounded box around object" msgstr "Teken afgerond vierkant om object" #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr "Teken haken en vierkanten om object" #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr "Verwijder dubbel getekende bindingen, etc." #: main.c:5605 msgid "Text :" msgstr "Tekst :" #: main.c:5619 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "" "Prefix een teken met _ voor subscript, ^ voor superscript, @ voor symbolen, " "| voor schuin, # voor dikke tekst; bijv. H_2O, @a_D^2^0" #: main.c:5624 msgid "Select current text size" msgstr "Selecteer huidige tekstgrootte" #: main.c:5753 #, c-format msgid "Ready" msgstr "Klaar" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "chemtool: kan geen lettertype laden\n" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr "Geheugentoewijzingsprobleem (SIGSEGV) -" #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr "Rekenfout (SIGFPE) -" #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr "Geheugetoegangsprobleem (SIGBUS) -" #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr "Afsluitingssignaal (SIGHUP) -" #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr " dump huidige tekening in bestand crashdump.cht\n" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "Huidige locatie:" #: gtkfilesel.c:796 msgid "Directories" msgstr "Directories" #: gtkfilesel.c:825 msgid "Mask:" msgstr "Weergave:" #: gtkfilesel.c:838 msgid "Files" msgstr "Bestanden" #: gtkfilesel.c:872 msgid "OK" msgstr "OK" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "Directory niet leesbaar: %s" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "Directory Aanmaken" #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr "Bestand Verwijderen" #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr "Bestand Hernoemen" #: gtkfilesel.c:1173 msgid "Error" msgstr "Fout" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "Directory Aanmaken" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "Directorynaam:" #: gtkfilesel.c:1297 msgid "Create" msgstr "Aanmaken" #: gtkfilesel.c:1397 msgid "Delete" msgstr "Verwijderen" #: gtkfilesel.c:1512 msgid "Rename" msgstr "Hernoemen" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "Selectie: " #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr "" "Overweeg Babel/Openbabel te installeren voor bestandsformaat conversies...\n" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "" #: templates.hx:2 msgid "Benzene" msgstr "Benzeen" #: templates.hx:2 msgid "Naphthalene" msgstr "Naphthaleen" #: templates.hx:2 msgid "Azulene" msgstr "Azuleen" #: templates.hx:3 msgid "Adamantane" msgstr "Adamantaan" #: templates.hx:3 templates.hx:5 msgid "Cyclohexane" msgstr "Cyclohexaan" #: templates.hx:3 msgid "Steroid backbone" msgstr "Steroïd" #: templates.hx:3 msgid "Cycloheptatriene" msgstr "Cycloheptatrieen" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "Cyclooctatetraeen" #: templates.hx:4 msgid "Fluorene" msgstr "Fluoreen" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "Spiro[4.5]decaan" #: templates.hx:4 msgid "Heptalene" msgstr "Heptaleen" #: templates.hx:4 msgid "Fulvalene" msgstr "Fulvaleen" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "Dicyclopentadieen" #: templates.hx:5 msgid "Indene" msgstr "Indeen" #: templates.hx:5 msgid "Biphenyl" msgstr "" #: templates.hx:5 msgid "Norbornane" msgstr "Norbornaan" #: templates.hx:5 msgid "Binaphthyl" msgstr "" #: templates.hx:6 msgid "Coronene" msgstr "Coroneen" #: templates.hx:8 msgid "Pyranose core" msgstr "Pyranose kern" #: templates.hx:8 msgid "Furanose core" msgstr "Furanose kern" #: templates.hx:8 msgid "Ribofuranose" msgstr "" #: templates.hx:8 msgid "Fructose" msgstr "" #: templates.hx:8 msgid "Galactose" msgstr "" #: templates.hx:9 msgid "Glucose" msgstr "" #: templates.hx:9 msgid "Mannose" msgstr "" #: templates.hx:9 msgid "Fucose" msgstr "" #: templates.hx:9 msgid "Xylose" msgstr "" #: templates.hx:9 msgid "Neuraminic acid" msgstr "Neuraminezuur" #: templates.hx:10 msgid "Sucrose" msgstr "Sucrose" #: templates.hx:10 msgid "Maltose" msgstr "" #: templates.hx:10 msgid "Lactose" msgstr "" #: templates.hx:14 msgid "Adenine" msgstr "Adenine" #: templates.hx:14 msgid "Guanine" msgstr "Guanine" #: templates.hx:14 msgid "Thymine" msgstr "Thymine" #: templates.hx:14 msgid "Cytosine" msgstr "Cytosine" #: templates.hx:14 msgid "Uracil" msgstr "" #: templates.hx:15 msgid "Porphine" msgstr "Porphine" #: templates.hx:15 msgid "Caffeine" msgstr "Caffeine" #: templates.hx:15 msgid "Evans auxiliary" msgstr "Evans Auxiliar" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "SAMP Auxiliar" #: templates.hx:15 msgid "Imidazole" msgstr "" #: templates.hx:16 msgid "Benzimidazole" msgstr "" #: templates.hx:16 msgid "Pyrazole" msgstr "" #: templates.hx:16 msgid "Diazole" msgstr "" #: templates.hx:17 msgid "Morphine" msgstr "" #: templates.hx:17 msgid "Morphine 3D" msgstr "" #: templates.hx:23 msgid "Backbone" msgstr "" #: templates.hx:26 msgid "p orbital" msgstr "P-orbitaal" #: templates.hx:26 msgid "plus" msgstr "plus" #: templates.hx:26 msgid "minus" msgstr "minus" #: templates.hx:26 msgid "rearrangement" msgstr "herschikking" #~ msgid "Help - somebody ate my atoms (hp->n=%d, da_root.next NULL)!!!\n" #~ msgstr "Help - atomen verloren (hp->n=%d, da_root.next NULL)!!!\n" #~ msgid "Help - somebody ate my atoms (d=%d,hp->n=%d)!!!\n" #~ msgstr "Help - atomen verloren (d=%d,hp->n=%d)!!!\n" #~ msgid "failed to load font %s !!!\n" #~ msgstr "Lettertype %s niet gevonden !!!\n" #~ msgid "Failed to load symbol font, using standard font\n" #~ msgstr "" #~ "Symboollettertype kon niet geladen worden, terugvallen naar standaard " #~ "lettertype\n" #~ msgid "Error creating directory \"" #~ msgstr "Fout bij aanmaken van directory\"" #~ msgid "Error deleting file \"" #~ msgstr "Fout bij verwijderen van bestand\"" #~ msgid "Really delete file \"" #~ msgstr "Bestand Verwijderen? \"" #~ msgid "Error renaming file \"" #~ msgstr "Fout bij hernoemen van bestand \"" #~ msgid "Rename file \"" #~ msgstr "Bestand hernoemen \"" #~ msgid "\" to:" #~ msgstr "\" naar:" #~ msgid "Name too long" #~ msgstr "Naam te lang" #~ msgid "Chemtool Version " #~ msgstr "Chemtool Versie" #~ msgid "endless molfile???\n" #~ msgstr "oneindig molbestand???\n" #~ msgid "expecting na %d nb %d\n" #~ msgstr "verwacht na %d nb %d\n" #~ msgid "Molecule exported from chemtool\n" #~ msgstr "Molecuul geexporteerd van chemtool\n" #~ msgid "" #~ "\n" #~ "Created with Chemtool 1.6.9 from file %s \n" #~ "\n" #~ msgstr "" #~ "\n" #~ "Gemaakt met Chemtool 1.6.9 van bestand %s \n" #~ "\n" #~ msgid "undefined text direction in svg output\n" #~ msgstr "ongedefinieerde tekstrichting in svg uitvoer\n" #~ msgid "Created by" #~ msgstr "Gemaakt door" #~ msgid "no emf font parameters for zoom factor %d\n" #~ msgstr "geen emf lettertypeparameters voor zoomfactor %d\n" #~ msgid "undefined text direction in emf output\n" #~ msgstr "ongedefinieerde tekstrichting in svg uitvoer\n" #~ msgid "no figfont parameters for zoom factor %d\n" #~ msgstr "geen fig lettertypeparameters voor zoomfactor %d\n" #~ msgid "# generated by Chemtool " #~ msgstr "# gegenereerd door Chemtool" #~ msgid "no figfont parameters for fontsize %d\n" #~ msgstr "geen fig lettertypeparameters voor lettergrootte %d\n" #~ msgid "undefined text direction in xfig output\n" #~ msgstr "ongedefinieerde tekstrichting in xfig uitvoer\n" #~ msgid "no translation for %d\n" #~ msgstr "geen vertaling voor %d\n" #~ msgid "could not close fig file" #~ msgstr "kon fig bestand niet sluiten" #~ msgid " " #~ msgstr " " #~ msgid "TIFFm" #~ msgstr "TIFFm" #~ msgid "TIFFc" #~ msgstr "TIFFc" #~ msgid "Chemtool 1.6.9" #~ msgstr "Chemtool 1.6.9" #~ msgid "program cht not available or unable to write to" #~ msgstr "" #~ "programma cht: niet beschikbaar of kan niet schrijven naar programma" #~ msgid ".rad" #~ msgstr ".rad" #~ msgid " ?" #~ msgstr " ?" #~ msgid "Chemtool 1.6.9 (%s)" #~ msgstr "Chemtool 1.6.9 (%s)" #~ msgid "File selection" #~ msgstr "Bestandsselectie" #~ msgid "_Configurable options" #~ msgstr "_Instellingen" #~ msgid "No error" #~ msgstr "Geen foutmelding" #~ msgid "Bad parameter passed to undo function" #~ msgstr "Ongeldige parameter aan \"ongedaan maken\" funtie gegeven" #~ msgid "Out of memory" #~ msgstr "Geheugentekort" #~ msgid "No active undo session" #~ msgstr "Geen actieve \"ongedaan maken\" sessie" #~ msgid "Nothing to undo/redo" #~ msgstr "Niets voor \"ongedaan maken\\nogmaals\"" #~ msgid "No undoable memory limit set" #~ msgstr "Geen \"ongedaan maken\" geheugenlimiet ingesteld" chemtool-1.6.14/po/chemtool.pot0000644000175000001440000004436112202261122015600 0ustar martinusers# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Martin Kroeker # 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: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-05-23 23:58+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" #: main.c:225 main.c:293 msgid "Yes" msgstr "" #: main.c:240 main.c:308 msgid "No" msgstr "" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" #: main.c:1033 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" #: main.c:1359 main.c:2667 main.c:5829 msgid "unnamed" msgstr "" #: main.c:1361 #, c-format msgid "" "\n" "Ready" msgstr "" #: main.c:1389 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" #: main.c:1394 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" #: main.c:1416 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" #: main.c:1420 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" #: main.c:1783 #, c-format msgid "invalid angle mode %d\n" msgstr "" #: main.c:1803 #, c-format msgid "invalid text mode %d\n" msgstr "" #: main.c:2353 msgid "Load from file..." msgstr "" #: main.c:2394 msgid "Import MDL file..." msgstr "" #: main.c:2434 msgid "Import via BABEL..." msgstr "" #: main.c:2456 msgid "Export via BABEL..." msgstr "" #: main.c:2478 msgid "Import PDB file..." msgstr "" #: main.c:2521 msgid "Add from file..." msgstr "" #: main.c:2637 msgid "Save as..." msgstr "" #: main.c:2656 #, c-format msgid "" "\n" "Nothing to save" msgstr "" #: main.c:2682 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" #: main.c:2687 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" #: main.c:2821 main.c:3176 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" #: main.c:2829 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" #: main.c:2906 #, c-format msgid "SDF entry: %d" msgstr "" #: main.c:2979 main.c:3060 main.c:3101 main.c:3138 #, c-format msgid "Unable to open %s\n" msgstr "" #: main.c:2986 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" #: main.c:2996 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" #: main.c:3009 #, c-format msgid "Error loading %s \n" msgstr "" #: main.c:3048 main.c:3089 main.c:3126 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" #: main.c:3067 main.c:3145 #, c-format msgid "Problems converting %s\n" msgstr "" #: main.c:3181 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" #: main.c:3259 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" #: main.c:3336 msgid "" " Chemtool Version 1.6.14\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" #: main.c:3450 msgid "PDB labels:" msgstr "" #: main.c:3453 msgid "All" msgstr "" #: main.c:3461 msgid "non-H" msgstr "" #: main.c:3470 msgid "no numbers" msgstr "" #: main.c:3479 msgid "non H,no numbers" msgstr "" #: main.c:3489 main.c:3833 main.c:4139 msgid "None" msgstr "" #: main.c:3501 msgid "SDF entry:" msgstr "" #: main.c:3504 msgid "First" msgstr "" #: main.c:3511 msgid "Previous" msgstr "" #: main.c:3518 msgid "Next" msgstr "" #: main.c:3589 msgid "Latex / EPS scale factor :" msgstr "" #: main.c:3708 msgid "Unknown error" msgstr "" #: main.c:3732 main.c:4010 msgid "Configurable options" msgstr "" #: main.c:3767 msgid "_General" msgstr "" #: main.c:3788 msgid "Display" msgstr "" #: main.c:3794 msgid "Saving and Exporting" msgstr "" #: main.c:3800 msgid "Other" msgstr "" #: main.c:3811 msgid "_Background color:" msgstr "" #: main.c:3819 msgid "Add filled _white rectangle under labels" msgstr "" #: main.c:3834 main.c:4148 msgid "EPSI" msgstr "" #: main.c:3835 main.c:4157 msgid "TIFF mono" msgstr "" #: main.c:3836 main.c:4165 msgid "TIFF color" msgstr "" #: main.c:3841 msgid "_Data directory:" msgstr "" #: main.c:3848 msgid "E_xtension:" msgstr "" #: main.c:3856 msgid "Preview image to add to _EPS files:" msgstr "" #: main.c:3863 main.c:4184 msgid "Support national character sets in labels" msgstr "" #: main.c:3883 msgid "Base bond _length:" msgstr "" #: main.c:3891 msgid "Double bond _separation:" msgstr "" #: main.c:3904 msgid "_Printing" msgstr "" #: main.c:3934 main.c:4049 msgid "Portrait" msgstr "" #: main.c:3935 main.c:4054 msgid "Landscape" msgstr "" #: main.c:3949 msgid "Print _command:" msgstr "" #: main.c:3956 msgid "Printer _name:" msgstr "" #: main.c:3963 msgid "Paper si_ze:" msgstr "" #: main.c:3970 msgid "_Orientation:" msgstr "" #: main.c:3977 msgid "Print sc_ale factor:" msgstr "" #: main.c:3993 msgid "Select background color" msgstr "" #: main.c:4019 msgid "Paper size:" msgstr "" #: main.c:4044 msgid "Orientation:" msgstr "" #: main.c:4069 msgid "Print scale factor :" msgstr "" #: main.c:4094 msgid "Print command:" msgstr "" #: main.c:4134 msgid "Preview image to add to eps files :" msgstr "" #: main.c:4198 msgid "Background color :" msgstr "" #: main.c:4212 msgid "Add filled white rectangle under labels" msgstr "" #: main.c:4225 msgid "Printer name:" msgstr "" #: main.c:4238 msgid "Data directory:" msgstr "" #: main.c:4251 msgid "Extension:" msgstr "" #: main.c:4264 msgid "Base bondlength (10.668mm) :" msgstr "" #: main.c:4278 msgid "Doublebond separation (4 pixel) :" msgstr "" #: main.c:4298 msgid "Ok" msgstr "" #: main.c:4308 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "" #: main.c:4327 main.c:4912 msgid "Templates" msgstr "" #: main.c:4338 main.c:4340 msgid "Carbocycles" msgstr "" #: main.c:4378 main.c:4380 msgid "Sugars" msgstr "" #: main.c:4422 main.c:4424 msgid "Heterocycles" msgstr "" #: main.c:4466 main.c:4468 msgid "Amino Acids" msgstr "" #: main.c:4511 main.c:4513 msgid "Symbols" msgstr "" #: main.c:4559 gtkfilesel.c:1196 msgid "Close" msgstr "" #: main.c:4605 msgid "New" msgstr "" #: main.c:4613 msgid "Open" msgstr "" #: main.c:4621 main.c:4904 msgid "Add" msgstr "" #: main.c:4629 msgid "Import MOL" msgstr "" #: main.c:4637 msgid "Import PDB" msgstr "" #: main.c:4645 msgid "Import (Babel)" msgstr "" #: main.c:4653 msgid "Export..." msgstr "" #: main.c:4661 msgid "Export (Babel)" msgstr "" #: main.c:4670 main.c:4941 msgid "Print" msgstr "" #: main.c:4678 msgid "Setup Defaults" msgstr "" #: main.c:4693 main.c:4960 msgid "Save Config" msgstr "" #: main.c:4702 main.c:4921 msgid "Save" msgstr "" #: main.c:4710 msgid "Save As..." msgstr "" #: main.c:4719 main.c:5031 msgid "Quit" msgstr "" #: main.c:4727 msgid "File" msgstr "" #: main.c:4734 msgid "Copy" msgstr "" #: main.c:4746 msgid "Flip horizontally" msgstr "" #: main.c:4752 msgid "Flip vertically" msgstr "" #: main.c:4759 msgid "Undo" msgstr "" #: main.c:4767 msgid "Redo" msgstr "" #: main.c:4777 msgid "Edit" msgstr "" #: main.c:4784 msgid "Zoom in" msgstr "" #: main.c:4790 msgid "Zoom out" msgstr "" #: main.c:4801 main.c:4996 msgid "Center" msgstr "" #: main.c:4809 msgid "Grid rect/rhomb/off" msgstr "" #: main.c:4815 msgid "View" msgstr "" #: main.c:4823 msgid "Templates..." msgstr "" #: main.c:4832 msgid "Calculate Formula Weight" msgstr "" #: main.c:4840 msgid "Clean up drawing" msgstr "" #: main.c:4846 msgid "Tools" msgstr "" #: main.c:4854 main.c:5039 msgid "About" msgstr "" #: main.c:4863 main.c:4872 msgid "Help" msgstr "" #: main.c:4895 msgid "Load" msgstr "" #: main.c:4900 msgid "Load a chemtool sketch" msgstr "" #: main.c:4909 msgid "Add fragment from file" msgstr "" #: main.c:4918 msgid "Add template structure" msgstr "" #: main.c:4926 msgid "Save sketch to file" msgstr "" #: main.c:4929 msgid "Export" msgstr "" #: main.c:4938 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "" #: main.c:4947 msgid "Print file to a postscript printer" msgstr "" #: main.c:4950 msgid "Setup" msgstr "" #: main.c:4957 msgid "Setup default options" msgstr "" #: main.c:4966 msgid "Save default options" msgstr "" #: main.c:4969 msgid "Import" msgstr "" #: main.c:4975 msgid "Read a file written in MDL/molfile format" msgstr "" #: main.c:4978 msgid "ImportPDB" msgstr "" #: main.c:4984 msgid "Read a file written in PDB format" msgstr "" #: main.c:4987 msgid "Zoom In" msgstr "" #: main.c:4992 msgid "Increase zoom scale" msgstr "" #: main.c:5002 msgid "Center molecule in drawing area" msgstr "" #: main.c:5005 msgid "Zoom Out" msgstr "" #: main.c:5010 msgid "Decrease zoom scale" msgstr "" #: main.c:5014 msgid "Clear" msgstr "" #: main.c:5019 msgid "Remove molecule" msgstr "" #: main.c:5022 msgid "FW" msgstr "" #: main.c:5027 msgid "Calculate Formula Mass" msgstr "" #: main.c:5036 msgid "Exit Chemtool" msgstr "" #: main.c:5045 msgid "About Chemtool" msgstr "" #: main.c:5086 msgid "Draw at 0/30/60/90 degree angles" msgstr "" #: main.c:5102 msgid "Draw at 0/36/72/... degree angles" msgstr "" #: main.c:5124 msgid "Draw at 18/54/90/... degree angles" msgstr "" #: main.c:5141 msgid "Draw at 0/45/90... degree angles" msgstr "" #: main.c:5158 msgid "Draw curves based on 4 control points" msgstr "" #: main.c:5174 msgid "Draw left-justified text" msgstr "" #: main.c:5191 msgid "Draw centered text" msgstr "" #: main.c:5208 msgid "Draw right-justified text" msgstr "" #: main.c:5236 msgid "Set current textfont" msgstr "" #: main.c:5266 msgid "Choose default bond type" msgstr "" #: main.c:5283 msgid "Select pen color" msgstr "" #: main.c:5288 msgid "Bonds" msgstr "" #: main.c:5293 msgid "Toggle bond types" msgstr "" #: main.c:5310 msgid "Mark objects for moving, rotating or deleting" msgstr "" #: main.c:5327 msgid "Move marked object" msgstr "" #: main.c:5344 msgid "Rotate marked object" msgstr "" #: main.c:5363 msgid "Flip object horizontally" msgstr "" #: main.c:5381 msgid "Flip object vertically" msgstr "" #: main.c:5407 msgid "Copy marked object" msgstr "" #: main.c:5422 msgid "Rescale marked object" msgstr "" #: main.c:5441 msgid "Draw brackets around object" msgstr "" #: main.c:5456 msgid "Draw rounded brackets around object" msgstr "" #: main.c:5471 msgid "Draw round brackets around object" msgstr "" #: main.c:5486 msgid "Draw braces around object" msgstr "" #: main.c:5501 msgid "Draw simple box around object" msgstr "" #: main.c:5515 msgid "Draw shaded box around object" msgstr "" #: main.c:5529 msgid "Draw fancy box around object" msgstr "" #: main.c:5543 msgid "Draw rounded box around object" msgstr "" #: main.c:5560 msgid "Draw brackets and boxes around object" msgstr "" #: main.c:5576 msgid "Removes duplicate bonds, etc." msgstr "" #: main.c:5605 msgid "Text :" msgstr "" #: main.c:5619 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "" #: main.c:5624 msgid "Select current text size" msgstr "" #: main.c:5753 #, c-format msgid "Ready" msgstr "" #: main.c:5816 #, c-format msgid "chemtool: can't load any font\n" msgstr "" #: main.c:5954 #, c-format msgid "Memory allocation problem (SIGSEGV) -" msgstr "" #: main.c:5957 #, c-format msgid "Invalid math somewhere (SIGFPE) -" msgstr "" #: main.c:5960 #, c-format msgid "Memory access problem (SIGBUS) -" msgstr "" #: main.c:5963 #, c-format msgid "Ordered to quit (SIGHUP) - " msgstr "" #: main.c:5965 #, c-format msgid " dumping current drawing to file crashdump.cht\n" msgstr "" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "" #: gtkfilesel.c:796 msgid "Directories" msgstr "" #: gtkfilesel.c:825 msgid "Mask:" msgstr "" #: gtkfilesel.c:838 msgid "Files" msgstr "" #: gtkfilesel.c:872 msgid "OK" msgstr "" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "" #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr "" #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr "" #: gtkfilesel.c:1173 msgid "Error" msgstr "" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "" #: gtkfilesel.c:1297 msgid "Create" msgstr "" #: gtkfilesel.c:1397 msgid "Delete" msgstr "" #: gtkfilesel.c:1512 msgid "Rename" msgstr "" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "" #: inout.c:5767 #, c-format msgid "Consider installing Babel/OpenBabel for file format conversions...\n" msgstr "" #: templates.hx:2 msgid "Cyclopentadienyl" msgstr "" #: templates.hx:2 msgid "Benzene" msgstr "" #: templates.hx:2 msgid "Naphthalene" msgstr "" #: templates.hx:2 msgid "Azulene" msgstr "" #: templates.hx:3 msgid "Adamantane" msgstr "" #: templates.hx:3 templates.hx:5 msgid "Cyclohexane" msgstr "" #: templates.hx:3 msgid "Steroid backbone" msgstr "" #: templates.hx:3 msgid "Cycloheptatriene" msgstr "" #: templates.hx:3 msgid "Cyclooctatetraene" msgstr "" #: templates.hx:4 msgid "Fluorene" msgstr "" #: templates.hx:4 msgid "Spiro[4.5]decane" msgstr "" #: templates.hx:4 msgid "Heptalene" msgstr "" #: templates.hx:4 msgid "Fulvalene" msgstr "" #: templates.hx:4 msgid "Dicyclopentadiene" msgstr "" #: templates.hx:5 msgid "Indene" msgstr "" #: templates.hx:5 msgid "Biphenyl" msgstr "" #: templates.hx:5 msgid "Norbornane" msgstr "" #: templates.hx:5 msgid "Binaphthyl" msgstr "" #: templates.hx:6 msgid "Coronene" msgstr "" #: templates.hx:8 msgid "Pyranose core" msgstr "" #: templates.hx:8 msgid "Furanose core" msgstr "" #: templates.hx:8 msgid "Ribofuranose" msgstr "" #: templates.hx:8 msgid "Fructose" msgstr "" #: templates.hx:8 msgid "Galactose" msgstr "" #: templates.hx:9 msgid "Glucose" msgstr "" #: templates.hx:9 msgid "Mannose" msgstr "" #: templates.hx:9 msgid "Fucose" msgstr "" #: templates.hx:9 msgid "Xylose" msgstr "" #: templates.hx:9 msgid "Neuraminic acid" msgstr "" #: templates.hx:10 msgid "Sucrose" msgstr "" #: templates.hx:10 msgid "Maltose" msgstr "" #: templates.hx:10 msgid "Lactose" msgstr "" #: templates.hx:14 msgid "Adenine" msgstr "" #: templates.hx:14 msgid "Guanine" msgstr "" #: templates.hx:14 msgid "Thymine" msgstr "" #: templates.hx:14 msgid "Cytosine" msgstr "" #: templates.hx:14 msgid "Uracil" msgstr "" #: templates.hx:15 msgid "Porphine" msgstr "" #: templates.hx:15 msgid "Caffeine" msgstr "" #: templates.hx:15 msgid "Evans auxiliary" msgstr "" #: templates.hx:15 msgid "SAMP auxiliary" msgstr "" #: templates.hx:15 msgid "Imidazole" msgstr "" #: templates.hx:16 msgid "Benzimidazole" msgstr "" #: templates.hx:16 msgid "Pyrazole" msgstr "" #: templates.hx:16 msgid "Diazole" msgstr "" #: templates.hx:17 msgid "Morphine" msgstr "" #: templates.hx:17 msgid "Morphine 3D" msgstr "" #: templates.hx:23 msgid "Backbone" msgstr "" #: templates.hx:26 msgid "p orbital" msgstr "" #: templates.hx:26 msgid "plus" msgstr "" #: templates.hx:26 msgid "minus" msgstr "" #: templates.hx:26 msgid "rearrangement" msgstr "" chemtool-1.6.14/po/en@boldquot.header0000666000175000001440000000247112202253330016672 0ustar martinusers# 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. # chemtool-1.6.14/po/stamp-po0000666000175000001440000000001212202261360014716 0ustar martinuserstimestamp chemtool-1.6.14/po/cht.pot0000644000175000001440000003606210715417303014556 0ustar martinusers# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Martin Kroeker # 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: martin@ruby.chemie.uni-freiburg.de\n" "POT-Creation-Date: 2007-04-15 18:13+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: main.c:217 msgid "" "The current drawing is not saved !\n" "Do you really wish to continue ?" msgstr "" #: main.c:225 main.c:293 msgid "Yes" msgstr "" #: main.c:240 main.c:308 msgid "No" msgstr "" #: main.c:284 #, c-format msgid "" "File\n" "%s\n" "already exists !\n" "Overwrite it ?" msgstr "" #: main.c:660 #, c-format msgid "" "\n" "Next ring drawn will have %d sides" msgstr "" #: main.c:1019 #, c-format msgid "" "\n" "Imported %d bonds and %d labels" msgstr "" #: main.c:1345 main.c:2653 main.c:5815 msgid "unnamed" msgstr "" #: main.c:1347 #, c-format msgid "" "\n" "Ready" msgstr "" #: main.c:1375 #, c-format msgid "" "\n" "Helper process failed - %s %s %s %s!" msgstr "" #: main.c:1380 #, c-format msgid "" "\n" "%s %s %s %s" msgstr "" #: main.c:1402 #, c-format msgid "" "\n" "Drawing printed!" msgstr "" #: main.c:1406 #, c-format msgid "" "\n" "Failed to print drawing !" msgstr "" #: main.c:2339 msgid "Load from file..." msgstr "" #: main.c:2380 msgid "Import MDL file..." msgstr "" #: main.c:2420 msgid "Import via BABEL..." msgstr "" #: main.c:2442 msgid "Export via BABEL..." msgstr "" #: main.c:2464 msgid "Import PDB file..." msgstr "" #: main.c:2507 msgid "Add from file..." msgstr "" #: main.c:2623 msgid "Save as..." msgstr "" #: main.c:2642 #, c-format msgid "" "\n" "Nothing to save" msgstr "" #: main.c:2668 #, c-format msgid "" "\n" "Writing to %s failed !" msgstr "" #: main.c:2673 #, c-format msgid "" "\n" "Drawing saved in %s (%d bonds, %d labels)" msgstr "" #: main.c:2807 main.c:3162 #, c-format msgid "" "Writing to\n" " %s\n" "failed !\n" msgstr "" #: main.c:2815 #, c-format msgid "" "\n" "Drawing exported as %s (%d bonds, %d labels)" msgstr "" #: main.c:2892 #, c-format msgid "SDF entry: %d" msgstr "" #: main.c:2965 main.c:3046 main.c:3087 main.c:3124 #, c-format msgid "Unable to open %s\n" msgstr "" #: main.c:2972 #, c-format msgid "" "%s\n" " does not appear to be a Chemtool file\n" msgstr "" #: main.c:2982 #, c-format msgid "" "%s was created by a newer version.\n" "Some features may be lost.\n" msgstr "" #: main.c:2995 #, c-format msgid "Error loading %s \n" msgstr "" #: main.c:3034 main.c:3075 main.c:3112 #, c-format msgid "" "\n" "Choose orientation (Ctrl-Mouse1 for z), press Enter when done" msgstr "" #: main.c:3053 main.c:3131 #, c-format msgid "Problems converting %s\n" msgstr "" #: main.c:3167 #, c-format msgid "" "Drawing saved in\n" " %s\n" " (%d bonds, %d labels)\n" msgstr "" #: main.c:3245 msgid "" "Click and drag the mouse to draw bonds on the canvas. \n" "The right mouse button is used to delete objects - either bonds\n" "or text depending on which drawing mode is active.\n" "\n" "The buttons with different ringtypes on them select drawing modes\n" "with preferred angles, but you can actually draw at any angle in all modes.\n" "\n" "The button with the segmented line on it lets you draw curves by marking\n" "control points along the curve (a cubic spline).\n" "You can select the bondtype and color using the appropriate button\n" "or change them later by clicking on the desired bond in Bonds mode.\n" "\n" "To draw a cyclic system, simply press the Ctrl key together with the\n" "number key corresponding to the number of sides for the polygon, and\n" "then draw one side while pressing the Ctrl button.\n" "\n" "For drawing labels, write them into the text box in the top right of the " "window\n" "and place them on the canvas with the mouse. You can also use a number of\n" "keyboard shortcuts for common labels while in bond drawing mode:\n" "Simply press the 'c' key, or n,o,p,s,f to add the element symbol at\n" " the current drawing position, 1,2 and 3 for CH, CH_2 and CH_3, l for Cl,\n" " * for a big dot.\n" "\n" "The keys of the numeric keypad each insert an 'electron pair' line\n" "around an atom symbol in the position corresponding to the location\n" "of the key around the center of the numeric keypad.\n" "\n" "The text mode uses the following prefixes for special text:\n" "_ for subscripts, ^ for superscripts, @ for symbols (greek characters),\n" "| for italic (slanted) characters and # for bold text.\n" "When the text box is empty, clicking on any label in the drawing area\n" "copies that label into the box for reuse.\n" "\n" "Drawing is best done with the mouse, but you can also use the\n" "cursor keys in combination with the Ctrl key for exact positioning.\n" "When used with the Alt key, the cursor keys move the rectangular\n" "or rhombic grid that can be projected on the drawing area.\n" "\n" "If you need general drawing functions not provided by chemtool,\n" "try exporting to fig format and editing your figure in Brian Smith's\n" "xfig program. Its companion transfig/fig2dev is required by chemtool\n" "for printing and for exporting to eps or LaTeX, while the fig, XBM and\n" "SVG output are generated directly. Another useful and highly recommended\n" "helper program is Babel - either in its original version, or in the form\n" "of the new OpenBabel project. Using either version, chemtool is able to\n" "import foreign data from a variety of file formats, while only molfile\n" "im- and export is built into chemtool.\n" "\n" "More help is available in the manual page for chemtool and in the file\n" " README included in the source distribution as well as on the website.\n" "This should normally get installed in /usr/share/doc/packages/chemtool.\n" "If you find any bugs or have a question or suggestion, please contact the\n" "main author, martin@ruby.chemie.uni-freiburg.de" msgstr "" #: main.c:3322 msgid "" " Chemtool Version 1.6.10\n" "by\n" "Martin Kroeker,\n" "Radek Liboska,\n" "Michael Banck\n" "and\n" "Thomas Volk\n" "\n" "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html" msgstr "" #: main.c:3436 msgid "PDB labels:" msgstr "" #: main.c:3439 msgid "All" msgstr "" #: main.c:3447 msgid "non-H" msgstr "" #: main.c:3456 msgid "no numbers" msgstr "" #: main.c:3465 msgid "non H,no numbers" msgstr "" #: main.c:3475 main.c:3819 main.c:4125 msgid "None" msgstr "" #: main.c:3487 msgid "SDF entry:" msgstr "" #: main.c:3490 msgid "First" msgstr "" #: main.c:3497 msgid "Previous" msgstr "" #: main.c:3504 msgid "Next" msgstr "" #: main.c:3575 msgid "Latex / EPS scale factor :" msgstr "" #: main.c:3694 msgid "Unknown error" msgstr "" #: main.c:3718 main.c:3996 msgid "Configurable options" msgstr "" #: main.c:3753 msgid "_General" msgstr "" #: main.c:3774 msgid "Display" msgstr "" #: main.c:3780 msgid "Saving and Exporting" msgstr "" #: main.c:3786 msgid "Other" msgstr "" #: main.c:3797 msgid "_Background color:" msgstr "" #: main.c:3805 msgid "Add filled _white rectangle under labels" msgstr "" #: main.c:3820 main.c:4134 msgid "EPSI" msgstr "" #: main.c:3821 main.c:4143 msgid "TIFF mono" msgstr "" #: main.c:3822 main.c:4151 msgid "TIFF color" msgstr "" #: main.c:3827 msgid "_Data directory:" msgstr "" #: main.c:3834 msgid "E_xtension:" msgstr "" #: main.c:3842 msgid "Preview image to add to _EPS files:" msgstr "" #: main.c:3849 main.c:4170 msgid "Support national character sets in labels" msgstr "" #: main.c:3869 msgid "Base bond _length:" msgstr "" #: main.c:3877 msgid "Double bond _separation:" msgstr "" #: main.c:3890 msgid "_Printing" msgstr "" #: main.c:3920 main.c:4035 msgid "Portrait" msgstr "" #: main.c:3921 main.c:4040 msgid "Landscape" msgstr "" #: main.c:3935 msgid "Print _command:" msgstr "" #: main.c:3942 msgid "Printer _name:" msgstr "" #: main.c:3949 msgid "Paper si_ze:" msgstr "" #: main.c:3956 msgid "_Orientation:" msgstr "" #: main.c:3963 msgid "Print sc_ale factor:" msgstr "" #: main.c:3979 msgid "Select background color" msgstr "" #: main.c:4005 msgid "Paper size:" msgstr "" #: main.c:4030 msgid "Orientation:" msgstr "" #: main.c:4055 msgid "Print scale factor :" msgstr "" #: main.c:4080 msgid "Print command:" msgstr "" #: main.c:4120 msgid "Preview image to add to eps files :" msgstr "" #: main.c:4184 msgid "Background color :" msgstr "" #: main.c:4198 msgid "Add filled white rectangle under labels" msgstr "" #: main.c:4211 msgid "Printer name:" msgstr "" #: main.c:4224 msgid "Data directory:" msgstr "" #: main.c:4237 msgid "Extension:" msgstr "" #: main.c:4250 msgid "Base bondlength (10.668mm) :" msgstr "" #: main.c:4264 msgid "Doublebond separation (4 pixel) :" msgstr "" #: main.c:4284 msgid "Ok" msgstr "" #: main.c:4294 gtkfilesel.c:880 gtkfilesel.c:1306 gtkfilesel.c:1407 #: gtkfilesel.c:1522 msgid "Cancel" msgstr "" #: main.c:4313 main.c:4898 msgid "Templates" msgstr "" #: main.c:4324 main.c:4326 msgid "Carbocycles" msgstr "" #: main.c:4364 main.c:4366 msgid "Sugars" msgstr "" #: main.c:4408 main.c:4410 msgid "Heterocycles" msgstr "" #: main.c:4452 main.c:4454 msgid "Amino Acids" msgstr "" #: main.c:4497 main.c:4499 msgid "Symbols" msgstr "" #: main.c:4545 gtkfilesel.c:1196 msgid "Close" msgstr "" #: main.c:4591 msgid "New" msgstr "" #: main.c:4599 msgid "Open" msgstr "" #: main.c:4607 main.c:4890 msgid "Add" msgstr "" #: main.c:4615 msgid "Import MOL" msgstr "" #: main.c:4623 msgid "Import PDB" msgstr "" #: main.c:4631 msgid "Import (Babel)" msgstr "" #: main.c:4639 msgid "Export..." msgstr "" #: main.c:4647 msgid "Export (Babel)" msgstr "" #: main.c:4656 main.c:4927 msgid "Print" msgstr "" #: main.c:4664 msgid "Setup Defaults" msgstr "" #: main.c:4679 main.c:4946 msgid "Save Config" msgstr "" #: main.c:4688 main.c:4907 msgid "Save" msgstr "" #: main.c:4696 msgid "Save As..." msgstr "" #: main.c:4705 main.c:5017 msgid "Quit" msgstr "" #: main.c:4713 msgid "File" msgstr "" #: main.c:4720 msgid "Copy" msgstr "" #: main.c:4732 msgid "Flip horizontally" msgstr "" #: main.c:4738 msgid "Flip vertically" msgstr "" #: main.c:4745 msgid "Undo" msgstr "" #: main.c:4753 msgid "Redo" msgstr "" #: main.c:4763 msgid "Edit" msgstr "" #: main.c:4770 msgid "Zoom in" msgstr "" #: main.c:4776 msgid "Zoom out" msgstr "" #: main.c:4787 main.c:4982 msgid "Center" msgstr "" #: main.c:4795 msgid "Grid rect/rhomb/off" msgstr "" #: main.c:4801 msgid "View" msgstr "" #: main.c:4809 msgid "Templates..." msgstr "" #: main.c:4818 msgid "Calculate Formula Weight" msgstr "" #: main.c:4826 msgid "Clean up drawing" msgstr "" #: main.c:4832 msgid "Tools" msgstr "" #: main.c:4840 main.c:5025 msgid "About" msgstr "" #: main.c:4849 main.c:4858 msgid "Help" msgstr "" #: main.c:4881 msgid "Load" msgstr "" #: main.c:4886 msgid "Load a chemtool sketch" msgstr "" #: main.c:4895 msgid "Add fragment from file" msgstr "" #: main.c:4904 msgid "Add template structure" msgstr "" #: main.c:4912 msgid "Save sketch to file" msgstr "" #: main.c:4915 msgid "Export" msgstr "" #: main.c:4924 msgid "Create EPS, XFig, PicTeX or XBM file" msgstr "" #: main.c:4933 msgid "Print file to a postscript printer" msgstr "" #: main.c:4936 msgid "Setup" msgstr "" #: main.c:4943 msgid "Setup default options" msgstr "" #: main.c:4952 msgid "Save default options" msgstr "" #: main.c:4955 msgid "Import" msgstr "" #: main.c:4961 msgid "Read a file written in MDL/molfile format" msgstr "" #: main.c:4964 msgid "ImportPDB" msgstr "" #: main.c:4970 msgid "Read a file written in PDB format" msgstr "" #: main.c:4973 msgid "Zoom In" msgstr "" #: main.c:4978 msgid "Increase zoom scale" msgstr "" #: main.c:4988 msgid "Center molecule in drawing area" msgstr "" #: main.c:4991 msgid "Zoom Out" msgstr "" #: main.c:4996 msgid "Decrease zoom scale" msgstr "" #: main.c:5000 msgid "Clear" msgstr "" #: main.c:5005 msgid "Remove molecule" msgstr "" #: main.c:5008 msgid "FW" msgstr "" #: main.c:5013 msgid "Calculate Formula Mass" msgstr "" #: main.c:5022 msgid "Exit Chemtool" msgstr "" #: main.c:5031 msgid "About Chemtool" msgstr "" #: main.c:5072 msgid "Draw at 0/30/60/90 degree angles" msgstr "" #: main.c:5088 msgid "Draw at 0/36/72/... degree angles" msgstr "" #: main.c:5110 msgid "Draw at 18/54/90/... degree angles" msgstr "" #: main.c:5127 msgid "Draw at 0/45/90... degree angles" msgstr "" #: main.c:5144 msgid "Draw curves based on 4 control points" msgstr "" #: main.c:5160 msgid "Draw left-justified text" msgstr "" #: main.c:5177 msgid "Draw centered text" msgstr "" #: main.c:5194 msgid "Draw right-justified text" msgstr "" #: main.c:5222 msgid "Set current textfont" msgstr "" #: main.c:5252 msgid "Choose default bond type" msgstr "" #: main.c:5269 msgid "Select pen color" msgstr "" #: main.c:5274 msgid "Bonds" msgstr "" #: main.c:5279 msgid "Toggle bond types" msgstr "" #: main.c:5296 msgid "Mark objects for moving, rotating or deleting" msgstr "" #: main.c:5313 msgid "Move marked object" msgstr "" #: main.c:5330 msgid "Rotate marked object" msgstr "" #: main.c:5349 msgid "Flip object horizontally" msgstr "" #: main.c:5367 msgid "Flip object vertically" msgstr "" #: main.c:5393 msgid "Copy marked object" msgstr "" #: main.c:5408 msgid "Rescale marked object" msgstr "" #: main.c:5427 msgid "Draw brackets around object" msgstr "" #: main.c:5442 msgid "Draw rounded brackets around object" msgstr "" #: main.c:5457 msgid "Draw round brackets around object" msgstr "" #: main.c:5472 msgid "Draw braces around object" msgstr "" #: main.c:5487 msgid "Draw simple box around object" msgstr "" #: main.c:5501 msgid "Draw shaded box around object" msgstr "" #: main.c:5515 msgid "Draw fancy box around object" msgstr "" #: main.c:5529 msgid "Draw rounded box around object" msgstr "" #: main.c:5546 msgid "Draw brackets and boxes around object" msgstr "" #: main.c:5562 msgid "Removes duplicate bonds, etc." msgstr "" #: main.c:5591 msgid "Text :" msgstr "" #: main.c:5605 msgid "" "Prefix a character with _ for subscript, ^ for superscript, @ for symbols, | " "for italic, # for bold text; e.g. H_2O, @a_D^2^0" msgstr "" #: main.c:5610 msgid "Select current text size" msgstr "" #: main.c:5739 #, c-format msgid "Ready" msgstr "" #: gtkfilesel.c:664 msgid "Looking in:" msgstr "" #: gtkfilesel.c:796 msgid "Directories" msgstr "" #: gtkfilesel.c:825 msgid "Mask:" msgstr "" #: gtkfilesel.c:838 msgid "Files" msgstr "" #: gtkfilesel.c:872 msgid "OK" msgstr "" #: gtkfilesel.c:916 gtkfilesel.c:2174 #, c-format msgid "Directory unreadable: %s" msgstr "" #: gtkfilesel.c:949 msgid "Create Dir" msgstr "" #: gtkfilesel.c:960 gtkfilesel.c:1375 msgid "Delete File" msgstr "" #: gtkfilesel.c:971 gtkfilesel.c:1480 msgid "Rename File" msgstr "" #: gtkfilesel.c:1173 msgid "Error" msgstr "" #: gtkfilesel.c:1271 msgid "Create Directory" msgstr "" #: gtkfilesel.c:1285 msgid "Directory name:" msgstr "" #: gtkfilesel.c:1297 msgid "Create" msgstr "" #: gtkfilesel.c:1397 msgid "Delete" msgstr "" #: gtkfilesel.c:1512 msgid "Rename" msgstr "" #: gtkfilesel.c:2155 msgid "Selection: " msgstr "" chemtool-1.6.14/po/en@quot.header0000666000175000001440000000226312202253330016030 0ustar martinusers# 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. # chemtool-1.6.14/ct.h0000644000175000001440000002210211675153346013415 0ustar martinusers#ifdef HAVE_CONFIG_H #include #endif #undef __GNUC__ #include #include #include #include #include #ifndef MAXPATHLEN # ifdef PATH_MAX # define MAXPATHLEN PATH_MAX # else # define MAXPATHLEN 2048 # define PATH_MAX MAXPATHLEN # endif #endif #define PIXMAPWIDTH 1600 #define PIXMAPHEIGHT 1200 #define MAXCL 101 #define BONDTYPES 22 #define BONDCOLORS 8 #define Hex 1 /* define angletypes and textdirect. , DONT CHANGE THEM !*/ #define Pent 2 #define Pent_switch 3 #define Octa 4 #define No_angle 0 #define Left_Text 0 #define Middle_Text -1 #define Right_Text -2 #define False 0 #define True 1 struct data { int x,y; int tx,ty; int bond; int smarked,tmarked; int decoration; int color; struct data *next; struct data *prev; } da_root, *new ; struct dc { int x,y; char c[MAXCL]; int direct; int marked; int color; int font; int size; struct dc *next; struct dc *prev; } dac_root, *new_c; struct data_head { int pix_width, pix_height; int width, height; } head; struct new { int x,y; int tx,ty; int startx,starty; int n, nc; int nsp; } *hp; struct xy_co { int x,y; int tx,ty; } xycoord[30]; struct marked { int x,y; int w, h; int flag; } mark; struct spline { int x0,y0; int x1,y1; int x2,y2; int x3,y3; int type; int marked; int color; struct spline *next; struct spline *prev; } sp_root, *sp_new; float size_factor; int zoom_factor; int draw_angle; int text_direct; int font_type; int line_type; int modify; int addflag; int xbmflag; int drawmode; int xref,yref; char *paper[11]={"A4","A3","A2","A1","A0","Letter", "Legal","Ledger","C","D","E"}; int papersize; char *orientation[2]={"-p 1","-l 1"}; int orient; float printscale; int printcmd; char *printcommand[4]={"lpr -P","lp -d","kprinter -d","gtklp -d"}; char *queuename; char datadir[PATH_MAX]; char datamask[PATH_MAX]; int figversion; int importflag; int pdbmode; void Clear(void); /* chemproc.c */ extern struct data *select_vector(int mx, int my, float s_f); extern void add_struct(int x,int y,int tx, int ty, int bond, int smarked, int tmarked, int decoration, int color); extern int round_coord(int i, float step); extern void del_char(struct dc *hpc); extern void del_struct(struct data *hpc); extern void add_char(int x,int y, char *c, int direct, int marked, int color, int font, int size); extern struct dc *select_char(int mx, int my, float s_f); extern struct xy_co *calc_angle(int x, int y, int ang_type, int angle, int factor); extern struct xy_co *position(int x, int y, int ax, int ay, int ang_type); extern void setup_data(void); extern void clear_data(void); extern int partial_delete(int x, int y, int tx, int ty); extern void center_mol(void); extern int move_pos(int x, int y, int tx, int ty); extern int check_pos_rec(int x, int y, int rx, int ry, int rtx, int rty); extern int partial_move(int x, int y, int tx, int ty, int dx, int dy); extern int partial_rotate(/*int xcent, int ycent,*/ double rotsin, double rotcos); extern int calc_vector(int dx, int dy); extern struct xy_co *multi_bonds(int mx, int my, int mtx, int mty, int r); extern struct xy_co *center_double_bond(int mx,int my,int mtx, int mty, int r); extern struct xy_co *intersect(int ax, int ay, int atx, int aty, int bx, int by, int btx, int bty); struct xy_co *bond_cut(int x, int y, int tx, int ty, int r); extern void add_box1(void); extern void add_box2(void); extern void add_box3(void); extern void add_box4(void); extern void Unmark_all(void); extern void get_center_marked (int*, int*); /* graph.c */ extern void CreatePix(void); extern void FreePix(void ); extern void CopyPlane(void ); extern void Display_Mol(void); extern void Drawline( int , int, int, int , int, int ); extern void DrawWide( int, int, int, int, int,int); extern void DrawWedge( int, int, int, int, int,int); extern void DrawDashedWedge( int, int, int, int, int,int); extern void DrawArrow( int, int, int, int, int,int,int); extern void DrawWiggly( int, int, int, int, int,int); extern void Drawstring( int, int, char*, int, int, int, int, int, int); extern int Extra_char(char c); extern int Load_Font(void); extern void Set_Line(int); /* draw.c */ extern void Add_double(int, int); extern void Add_vector(int); extern void Del_vector( int, int); extern void Set_vector( int, int,int); extern void Put_vector( int, int); extern void Invert_vector(int, int); extern void Add_atom( int, int); extern void Add_number( int, int); extern void Fetch_atom( int, int); extern void Del_atom( int, int); extern void Set_start_rec( int, int); extern void Put_rec(int, int); extern void Del_rec(void); extern void Mark_rec(int); extern void Mark_atom(int, int); extern void Center(void); extern void Put_pmove(int, int,int); extern void Set_pmove(int, int); extern void Put_protate( int, int, int); extern void Put_pscale( int, int, int); extern void Add_ring (int, int, int); /* dialog.c */ extern void Load(void); extern void Add(void); extern void Save(void); extern void Quit(void); void Zoom(GtkWidget*, gpointer); void Change_Text(GtkWidget*, gpointer); void Change_Angle(GtkWidget*, gpointer); extern void flip_horiz(void); extern void flip_vert(void); extern void copy_obj(void); /* inout.c */ extern int save_mol(FILE *fp, int partial); extern int load_mol(char *filename); extern int import_mdl_mol(char *filename,int skip); extern int import_pdb(char *filename); extern int import_babel(char *filename); extern int add_mol(char *filename); extern int export_bitmap(char *filename); extern int export_xfig(char *filename); extern int export_latex_pic(char *filename, float scalefactor); extern int export_svg(char *filename); extern int export_latex_pic(char *filename, float scalefactor); extern int export_ps_pic(char *filename, float scalefactor); extern int export_png_pic(char *filename, float scalefactor); extern int print_ps_pic(void); extern int export_fw(char *filename); extern int export_mdl_mol(FILE *fp, int topipe); extern int export_emf(char *filename); extern int export_sxd(char *filename); extern int export_babel(char *filename); extern int export_asy(char *filename); extern int readrc(void); extern int writerc(void); extern void pdbrotate(int,int,int); #ifdef LIBUNDO extern int undo_get_undo_count(); extern int undo_get_redo_count(); extern int undo_undo(); extern int undo_undo(); extern int undo_redo(); extern int undo_snapshot(); extern int undo_new(char*); extern int undo_destroy(); extern int undo_set_memory_limit(size_t memmax); #endif GdkPixmap *picture,*savedpicture,*preview; GtkWidget *textbox; int xcent,ycent; int *tmpx,*tmpy; char formula[51],weight[21],eweight[21],compos[65]; void yesnodialog (void (*)(void)); void CheckAndClear(void); void yesnodialog2 (void (*)(void),char*); void do_fw(void); void set_bond (GtkWidget* , gpointer); void Bondmode (GtkWidget*); void Movemode (GtkWidget*); void Markmode (GtkWidget*); void Rotatemode (GtkWidget*); void Rescalemode (GtkWidget*); void show_or_raise (GtkWidget*); void Add_template (GtkWidget*, gpointer); void exp_mode (GtkWidget*, gpointer); void do_export (GtkWidget*,GtkFileSelection*); void really_export(void); void file_ok_sel(GtkWidget*,GtkFileSelection*); void reallysave(void); void CheckAndLoad(void); int CheckAndQuit(void); void Set_bondtype(int, int, int); void tidy_mol(void); void do_undo(void); void do_redo(void); int newpaper(GtkWidget*,gpointer); int neworient(GtkWidget*,gpointer); int newprcmd(GtkWidget*,gpointer); void Set_Textmode(GtkWidget*,GdkEvent*); void Splinemode(GtkWidget*); void Import(void); void Import_PDB(void); void SaveAs(void); void Export(void); extern void add_bracket(void); extern void add_r_bracket(void); extern void add_r2_bracket(void); extern void add_brace(void); void add_spline(int, int, int, int, int, int, int, int, int, int, int); void show_boxmenu(void); void show_penmenu(void); void print_ps(void); void setup_printer(GtkWidget*,gpointer); void do_complete(void); void check_fig2dev(void); extern void check_babel(void); extern void check_fig2sxd(void); void ct_crash(int); void restore_picture(void); void getpreview(GtkWidget*, gint, gint, GdkEventButton*, gpointer); void set_icon(GtkWidget*); extern int load_preview(char*); extern int preview_mdl_mol(char*, int); extern void pdbstore(void); double *pdbx, *pdby,*pdbz; int *bondfrom,*bondto; short *bondtype,*atjust; char **atcode; int pdbn=0; int nbonds=0; float importfactor=50.; int importoffset=500; extern char **intype; extern char **inmode; extern int babelin; extern char **outtype; extern char **outmode; extern int babelout; char* babel; GdkGC *mygc[8],*background_gc,*hlgc; int curpen=0; int gridtype=0; int gridx=0; int gridy=0; int serif_flag=0; int refx=0,refy=0,refmark=0; double bondlen_mm=10.668; int db_dist=4; int mb_dist=10; int epsoption, use_whiteout,use_intlchars; int bgred,bggreen,bgblue; char bghexcolor[10]; int curfontsize=3; extern int undo_malloc(size_t); int atnum; int draw_ok=0; int sdfindex=0; int have_fig2sxd; chemtool-1.6.14/configure0000755000175000001440000111621712202253333014541 0ustar martinusers#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for Chemtool 1.6.13. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 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=: # Pre-4.2 versions of Zsh do 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_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: martin@ruby.chemie.uni-freiburg.de about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_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 || $as_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" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # 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" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/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= # Identity of this package. PACKAGE_NAME='Chemtool' PACKAGE_TARNAME='chemtool' PACKAGE_VERSION='1.6.13' PACKAGE_STRING='Chemtool 1.6.13' PACKAGE_BUGREPORT='martin@ruby.chemie.uni-freiburg.de' PACKAGE_URL='' ac_unique_file="main.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" ac_header_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS MYGTKOBJS MYGTKSRCS EMFLIBS gnomemimedir kdemimedir LIBOBJS EGREP GREP X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS CPP XMKMF GTK_LIBS GTK_CFLAGS GTK_CONFIG PKG_CONFIG RM CP LN_S POSUB LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV host_os host_vendor host_cpu host build_os build_vendor build_cpu build am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MSGMERGE XGETTEXT GMSGFMT MSGFMT USE_NLS MKINSTALLDIRS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_nls enable_dependency_tracking with_gnu_ld enable_rpath with_libiconv_prefix with_libintl_prefix enable_enable_gtk1 with_gtk_prefix with_gtk_exec_prefix enable_gtktest with_x with_localedir with_kdedir with_gnomedir enable_undo enable_menu enable_emf enable_stockgtk ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS XMKMF CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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= ;; *) 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_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=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_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. 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 # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 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 .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" 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 Chemtool 1.6.13 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/chemtool] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR 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 Chemtool 1.6.13:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-nls do not use Native Language Support --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-rpath do not hardcode runtime library paths --enable-gtk1 Use GTK+-1.x even if GTK+-2.x is available no --disable-gtktest Do not try to compile and run a test GTK program --enable-undo Build with libundo yes --enable-menu Enable new style pull-down-menu yes --enable-emf Enable enhanced metafile output via libEMF no --enable-stockgtk use standard GTK menu and fileselection widgets no Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --with-gtk-prefix=PFX Prefix where GTK is installed (optional) --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional) --with-x use the X Window System --with-localedir=DIR Set locale directory=DIR DATADIR/locale --with-kdedir=DIR Set KDE directory=DIR /opt/kde3,/opt/kde2,/opt/kde --with-gnomedir=DIR Set GNOME directory=DIR /usr 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 (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory XMKMF Path to xmkmf, Makefile generator for X Window System 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" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 $as_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 Chemtool configure 1.6.13 generated by GNU Autoconf 2.69 Copyright (C) 2012 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 ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------- ## ## Report this to martin@ruby.chemie.uni-freiburg.de ## ## ------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" 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 eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type 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 Chemtool $as_me 1.6.13, which was generated by GNU Autoconf 2.69. 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=. $as_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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 $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; 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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_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'; as_fn_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 $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " stdlib.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " sys/param.h" # 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 am__api_version='1.11' 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 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. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$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 test -d ./--version && rmdir ./--version 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. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=chemtool VERSION=1.6.13 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&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 if $ac_dir/$ac_word --statistics /dev/null >/dev/null 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&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 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&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 if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$GMSGFMT" != ":"; then if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 $as_echo "found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } GMSGFMT=":" fi fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi rm -f messages.po fi ac_config_commands="$ac_config_commands default-1" 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" DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM | *.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 if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg 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) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&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 && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&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` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 $as_echo_n "checking for ld used by GCC... " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi 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/lib" fi fi fi LIBICONV= LTLIBICONV= INCICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then 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*) 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/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } LIBINTL= LTLIBINTL= POSUB= if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if ${gt_cv_func_gnugettext1_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return (long) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_gnugettext1_libc=yes else gt_cv_func_gnugettext1_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext1_libc" >&5 $as_echo "$gt_cv_func_gnugettext1_libc" >&6; } if test "$gt_cv_func_gnugettext1_libc" != "yes"; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi fi LIBINTL= LTLIBINTL= INCINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then 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*) 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/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if ${gt_cv_func_gnugettext1_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); int main () { bindtextdomain ("", ""); return (long) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_gnugettext1_libintl=yes else gt_cv_func_gnugettext1_libintl=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); int main () { bindtextdomain ("", ""); return (long) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext1_libintl=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext1_libintl" >&5 $as_echo "$gt_cv_func_gnugettext1_libintl" >&6; } fi if test "$gt_cv_func_gnugettext1_libc" = "yes" \ || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$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 $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg 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) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CP+:} false; then : $as_echo_n "(cached) " >&6 else case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 $as_echo "$CP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_RM+:} false; then : $as_echo_n "(cached) " >&6 else case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 $as_echo "$RM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -libs" >&5 $as_echo_n "checking for main in -libs... " >&6; } if ${ac_cv_lib_ibs_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-libs $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ibs_main=yes else ac_cv_lib_ibs_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ibs_main" >&5 $as_echo "$ac_cv_lib_ibs_main" >&6; } if test "x$ac_cv_lib_ibs_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBIBS 1 _ACEOF LIBS="-libs $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acos in -lm" >&5 $as_echo_n "checking for acos in -lm... " >&6; } if ${ac_cv_lib_m_acos+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 acos (); int main () { return acos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_acos=yes else ac_cv_lib_m_acos=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_acos" >&5 $as_echo "$ac_cv_lib_m_acos" >&6; } if test "x$ac_cv_lib_m_acos" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi $as_echo "#define LIBUNDO 1" >>confdefs.h $as_echo "#define MENU 1" >>confdefs.h # Check whether --enable-enable_gtk1 was given. if test "${enable_enable_gtk1+set}" = set; then : enableval=$enable_enable_gtk1; enable_gtk1=no fi # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK version and compile options " >&5 $as_echo_n "checking for GTK version and compile options ... " >&6; } if test x$PKG_CONFIG = xno -o x$enable_gtk1 = xyes ; then # Check whether --with-gtk-prefix was given. if test "${with_gtk_prefix+set}" = set; then : withval=$with_gtk_prefix; gtk_config_prefix="$withval" else gtk_config_prefix="" fi # Check whether --with-gtk-exec-prefix was given. if test "${with_gtk_exec_prefix+set}" = set; then : withval=$with_gtk_exec_prefix; gtk_config_exec_prefix="$withval" else gtk_config_exec_prefix="" fi # Check whether --enable-gtktest was given. if test "${enable_gtktest+set}" = set; then : enableval=$enable_gtktest; else enable_gtktest=yes fi for module in . do case "$module" in gthread) gtk_config_args="$gtk_config_args gthread" ;; esac done if test x$gtk_config_exec_prefix != x ; then gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config fi fi if test x$gtk_config_prefix != x ; then gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_prefix/bin/gtk-config fi fi # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTK_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $GTK_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GTK_CONFIG="$GTK_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTK_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no" ;; esac fi GTK_CONFIG=$ac_cv_path_GTK_CONFIG if test -n "$GTK_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_CONFIG" >&5 $as_echo "$GTK_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_gtk_version=1.0.2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; } no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes else GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" rm -f conf.gtktest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If gtk-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } #endif /* defined (GTK_MAJOR_VERSION) ... */ else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); printf("*** correct copy of gtk-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_gtk=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$GTK_CONFIG" = "no" ; then echo "*** The gtk-config script installed by GTK could not be found" echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GTK_CONFIG environment variable to the" echo "*** full path to gtk-config." else if test -f conf.gtktest ; then : else echo "*** Could not run GTK test program, checking why..." CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" echo "*** version of GTK. If it is not finding GTK, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK was incorrectly installed" echo "*** or that you have moved GTK since it was installed. In the latter case, you" echo "*** may want to edit the gtk-config script: $GTK_CONFIG" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" exit 1 fi rm -f conf.gtktest else if $PKG_CONFIG gtk+-2.0 --cflags ; then GTK_CFLAGS="-DGTK2 `$PKG_CONFIG gtk+-2.0 --cflags` " GTK_LIBS=`$PKG_CONFIG gtk+-2.0 --libs` $as_echo "#define GTK2 1" >>confdefs.h enable_stockgtk=yes else if $PKG_CONFIG --cflags gtk+ ; then GTK_CFLAGS=`$PKG_CONFIG gtk+ --cflags` GTK_LIBS=`$PKG_CONFIG gtk+ --libs` fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; 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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then 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" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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 if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then 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" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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 if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi LDFLAGS="$X_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 $as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } if ${ac_cv_lib_X11_XOpenDisplay+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_XOpenDisplay=yes else ac_cv_lib_X11_XOpenDisplay=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 $as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBX11 1 _ACEOF LIBS="-lX11 $LIBS" fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in strings.h unistd.h libintl.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* 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 sort of thing. */ char tx; char *t = &tx; 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 sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; 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 if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working POSIX fnmatch" >&5 $as_echo_n "checking for working POSIX fnmatch... " >&6; } if ${ac_cv_func_fnmatch_works+:} false; then : $as_echo_n "(cached) " >&6 else # Some versions of Solaris, SCO, and the GNU C Library # have a broken or incompatible fnmatch. # So we run a test program. If we are cross-compiling, take no chance. # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test. if test "$cross_compiling" = yes; then : ac_cv_func_fnmatch_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # define y(a, b, c) (fnmatch (a, b, c) == 0) # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) int main () { return (!(y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) && n ("a\\\\bc", "abc", FNM_NOESCAPE) && y ("*x", ".x", 0) && n ("*x", ".x", FNM_PERIOD) && 1)); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fnmatch_works=yes else ac_cv_func_fnmatch_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fnmatch_works" >&5 $as_echo "$ac_cv_func_fnmatch_works" >&6; } if test $ac_cv_func_fnmatch_works = yes; then : $as_echo "#define HAVE_FNMATCH 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } if ${ac_cv_func_mmap_fixed_mapped+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_mmap_fixed_mapped=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 # 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; const char *cdata2; int i, pagesize; int fd, fd2; 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 2; if (write (fd, data, pagesize) != pagesize) return 3; close (fd); /* Next, check that the tail of a page is zero-filled. File must have non-zero length, otherwise we risk SIGBUS for entire page. */ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd2 < 0) return 4; cdata2 = ""; if (write (fd2, cdata2, 1) != 1) return 5; data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); if (data2 == MAP_FAILED) return 6; for (i = 0; i < pagesize; ++i) if (*(data2 + i)) return 7; close (fd2); if (munmap (data2, pagesize)) return 8; /* 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 9; if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 10; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 11; /* 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 12; if (read (fd, data3, pagesize) != pagesize) return 13; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 14; close (fd); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_mmap_fixed_mapped=yes else 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.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 $as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then $as_echo "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt for ac_func in getcwd getwd mkdir strtod strtol do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Check whether --with-localedir was given. if test "${with_localedir+set}" = set; then : withval=$with_localedir; localedir=$withval else localedir=$datadir/locale fi # Check whether --with-kdedir was given. if test "${with_kdedir+set}" = set; then : withval=$with_kdedir; kdedir=$withval else kdedir="/opt/kde3 /opt/kde2 /opt/kde" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KDE " >&5 $as_echo_n "checking for KDE ... " >&6; } for the_kdedir in $kdedir; do if test -d $the_kdedir/share/mimelnk ; then kdemimedir=$the_kdedir { $as_echo "$as_me:${as_lineno-$LINENO}: result: apparently in $kdemimedir" >&5 $as_echo "apparently in $kdemimedir" >&6; } break; else KDEMIMEDIR=$KDEDIR if test -d $KDEMIMEDIR/share/mimelnk; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: apparently in $KDEMIMEDIR" >&5 $as_echo "apparently in $KDEMIMEDIR" >&6; } kdemimedir=$KDEMIMEDIR fi fi done if test "x$kdemimedir" = "x" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-gnomedir was given. if test "${with_gnomedir+set}" = set; then : withval=$with_gnomedir; gnomedir=$withval else gnomedir=/usr fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNOME " >&5 $as_echo_n "checking for GNOME ... " >&6; } if test -d $gnomedir/share/mime-info ; then gnomemimedir=$gnomedir { $as_echo "$as_me:${as_lineno-$LINENO}: result: apparently in $gnomemimedir" >&5 $as_echo "apparently in $gnomemimedir" >&6; } else GNOMEMIMEDIR=$GNOMEDIR if test -d $GNOMEMIMEDIR/share/mime-info; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: apparently in $GNOMEMIMEDIR" >&5 $as_echo "apparently in $GNOMEMIMEDIR" >&6; } gnomemimedir=$GNOMEMIMEDIR fi fi if test "x$GNOMEMIMEDIR" = "x" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable libundo" >&5 $as_echo_n "checking whether to enable libundo... " >&6; } # Check whether --enable-undo was given. if test "${enable_undo+set}" = set; then : enableval=$enable_undo; else enable_undo=yes fi if test x$enable_undo = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define LIBUNDO 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use pull-down menus" >&5 $as_echo_n "checking whether to use pull-down menus... " >&6; } # Check whether --enable-menu was given. if test "${enable_menu+set}" = set; then : enableval=$enable_menu; else enable_menu=yes fi if test x$enable_menu = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define MENU 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable emf output" >&5 $as_echo_n "checking whether to enable emf output... " >&6; } # Check whether --enable-emf was given. if test "${enable_emf+set}" = set; then : enableval=$enable_emf; else enable_emf=no fi if test x$enable_emf = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define EMF 1" >>confdefs.h EMFLIBS="-lEMF -lstdc++" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } EMFLIBS="" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether standard GTK dialogs should be used instead of our own" >&5 $as_echo_n "checking whether standard GTK dialogs should be used instead of our own... " >&6; } # Check whether --enable-stockgtk was given. if test "${enable_stockgtk+set}" = set; then : enableval=$enable_stockgtk; else enable_stockgtk=no fi if test x$enable_stockgtk = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } MYGTKSRCS="" MYGTKOBJS="" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_sys_system=`uname -s` if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "CYGWIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: sorry, overriding library functions is impossible on your system, enforcing \"yes\"" >&5 $as_echo " sorry, overriding library functions is impossible on your system, enforcing \"yes\"" >&6; } MYGTKSRCS="" MYGTKOBJS="" else MYGTKSRCS="gtkmenu.c gtkfilesel.c" MYGTKOBJS="gtkmenu.o gtkfilesel.o" if test "$ac_sys_system" = "Darwin" ; then LDFLAGS="-force_flat_namespace ${LDFLAGS}" fi fi fi ac_config_files="$ac_config_files Makefile src-cht/Makefile m4/Makefile po/Makefile.in po/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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; 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 if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_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= U= 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=`$as_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. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## 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=: # Pre-4.2 versions of Zsh do 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_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_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 || $as_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" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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 Chemtool $as_me 1.6.13, which was generated by GNU Autoconf 2.69. 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 case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # 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_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent 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_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ Chemtool config.status 1.6.13 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 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' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= 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 ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_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. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # 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. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src-cht/Makefile") CONFIG_FILES="$CONFIG_FILES src-cht/Makefile" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # 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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[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="$ac_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 || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append 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 '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 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 || $as_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"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 || ac_write_fail=1 # 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= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 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 || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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 " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_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 "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "default-1":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac 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" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi chemtool-1.6.14/gtkfilesel.c0000644000175000001440000026761010715417303015140 0ustar martinusers/* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * 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. */ /* * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #include #include #include #include #include #include #include #include #include #include #include "fnmatch.h" #include "config.h" //#ifdef DISABLE_NLS //#define _(Text) Text //#else //#include //#define _(Text) gettext(Text) //#endif #include #include #include #include "gtkfilesel.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gtkintl.h" /* The Hurd doesn't define either PATH_MAX or MAXPATHLEN, so we put this * * in here, since the rest of the code in the file does require some * * fixed maximum * */ #ifndef MAXPATHLEN # ifdef PATH_MAX # define MAXPATHLEN PATH_MAX # else # define MAXPATHLEN 2048 # endif #endif #define DIR_LIST_WIDTH 180 #define DIR_LIST_HEIGHT 180 #define FILE_LIST_WIDTH 180 #define FILE_LIST_HEIGHT 180 /* I've put this here so it doesn't get confused with the * file completion interface */ typedef struct _HistoryCallbackArg HistoryCallbackArg; struct _HistoryCallbackArg { gchar *directory; GtkWidget *menu_item; }; typedef struct _CompletionState CompletionState; typedef struct _CompletionDir CompletionDir; typedef struct _CompletionDirSent CompletionDirSent; typedef struct _CompletionDirEntry CompletionDirEntry; typedef struct _CompletionUserDir CompletionUserDir; typedef struct _PossibleCompletion PossibleCompletion; /* Non-external file completion decls and structures */ /* A contant telling PRCS how many directories to cache. Its actually * kept in a list, so the geometry isn't important. */ #define CMPL_DIRECTORY_CACHE_SIZE 10 /* A constant used to determine whether a substring was an exact * match by first_diff_index() */ #define PATTERN_MATCH -1 /* The arguments used by all fnmatch() calls below */ #define FNMATCH_FLAGS (FNM_PATHNAME | FNM_PERIOD) #define CMPL_ERRNO_TOO_LONG ((1<<16)-1) /* This structure contains all the useful information about a directory * for the purposes of filename completion. These structures are cached * in the CompletionState struct. CompletionDir's are reference counted. */ struct _CompletionDirSent { ino_t inode; time_t mtime; dev_t device; gint entry_count; gchar *name_buffer; /* memory segment containing names of all entries */ struct _CompletionDirEntry *entries; }; struct _CompletionDir { CompletionDirSent *sent; gchar *fullname; gint fullname_len; struct _CompletionDir *cmpl_parent; gint cmpl_index; gchar *cmpl_text; }; /* This structure contains pairs of directory entry names with a flag saying * whether or not they are a valid directory. NOTE: This information is used * to provide the caller with information about whether to update its completions * or try to open a file. Since directories are cached by the directory mtime, * a symlink which points to an invalid file (which will not be a directory), * will not be reevaluated if that file is created, unless the containing * directory is touched. I consider this case to be worth ignoring (josh). */ struct _CompletionDirEntry { gint is_dir; gchar *entry_name; }; struct _CompletionUserDir { gchar *login; gchar *homedir; }; struct _PossibleCompletion { /* accessible fields, all are accessed externally by functions * declared above */ gchar *text; gint is_a_completion; gint is_directory; gint file_size; gint file_time; gint uid; gint gid; /* Private fields */ gint text_alloc; }; struct _CompletionState { gint last_valid_char; gchar *updated_text; gint updated_text_len; gint updated_text_alloc; gint re_complete; gchar *user_dir_name_buffer; gint user_directories_len; gchar *last_completion_text; gint user_completion_index; /* if >= 0, currently completing ~user */ struct _CompletionDir *completion_dir; /* directory completing from */ struct _CompletionDir *active_completion_dir; struct _PossibleCompletion the_completion; struct _CompletionDir *reference_dir; /* initial directory */ GList *directory_storage; GList *directory_sent_storage; struct _CompletionUserDir *user_directories; }; /* File completion functions which would be external, were they used * outside of this file. */ static CompletionState *cmpl_init_state (void); static void cmpl_free_state (CompletionState * cmpl_state); static gint cmpl_state_okay (CompletionState * cmpl_state); static gchar *cmpl_strerror (gint); static PossibleCompletion *cmpl_completion_matches (gchar * text_to_complete, gchar ** remaining_text, CompletionState * cmpl_state); /* Returns a name for consideration, possibly a completion, this name * will be invalid after the next call to cmpl_next_completion. */ static char *cmpl_this_completion (PossibleCompletion *); /* True if this completion matches the given text. Otherwise, this * output can be used to have a list of non-completions. */ static gint cmpl_is_a_completion (PossibleCompletion *); /* True if the completion is a directory */ static gint cmpl_is_directory (PossibleCompletion *); /* Obtains the next completion, or NULL */ static PossibleCompletion *cmpl_next_completion (CompletionState *); /* Updating completions: the return value of cmpl_updated_text() will * be text_to_complete completed as much as possible after the most * recent call to cmpl_completion_matches. For the present * application, this is the suggested replacement for the user's input * string. You must CALL THIS AFTER ALL cmpl_text_completions have * been received. */ static gchar *cmpl_updated_text (CompletionState * cmpl_state); /* After updating, to see if the completion was a directory, call * this. If it was, you should consider re-calling completion_matches. */ static gint cmpl_updated_dir (CompletionState * cmpl_state); /* Current location: if using file completion, return the current * directory, from which file completion begins. More specifically, * the cwd concatenated with all exact completions up to the last * directory delimiter('/'). */ static gchar *cmpl_reference_position (CompletionState * cmpl_state); /* backing up: if cmpl_completion_matches returns NULL, you may query * the index of the last completable character into cmpl_updated_text. */ static gint cmpl_last_valid_char (CompletionState * cmpl_state); /* When the user selects a non-directory, call cmpl_completion_fullname * to get the full name of the selected file. */ static gchar *cmpl_completion_fullname (gchar *, CompletionState * cmpl_state); /* Directory operations. */ static CompletionDir *open_ref_dir (gchar * text_to_complete, gchar ** remaining_text, CompletionState * cmpl_state); static gboolean check_dir (gchar * dir_name, struct stat *result, gboolean * stat_subdirs); static CompletionDir *open_dir (gchar * dir_name, CompletionState * cmpl_state); static CompletionDir *open_user_dir (gchar * text_to_complete, CompletionState * cmpl_state); static CompletionDir *open_relative_dir (gchar * dir_name, CompletionDir * dir, CompletionState * cmpl_state); static CompletionDirSent *open_new_dir (gchar * dir_name, struct stat *sbuf, gboolean stat_subdirs); static gint correct_dir_fullname (CompletionDir * cmpl_dir); static gint correct_parent (CompletionDir * cmpl_dir, struct stat *sbuf); static gchar *find_parent_dir_fullname (gchar * dirname); static CompletionDir *attach_dir (CompletionDirSent * sent, gchar * dir_name, CompletionState * cmpl_state); static void free_dir_sent (CompletionDirSent * sent); static void free_dir (CompletionDir * dir); static void prune_memory_usage (CompletionState * cmpl_state); /* Completion operations */ static PossibleCompletion *attempt_homedir_completion (gchar * text_to_complete, CompletionState * cmpl_state); static PossibleCompletion *attempt_file_completion (CompletionState * cmpl_state); static CompletionDir *find_completion_dir (gchar * text_to_complete, gchar ** remaining_text, CompletionState * cmpl_state); static PossibleCompletion *append_completion_text (gchar * text, CompletionState * cmpl_state); static gint get_pwdb (CompletionState * cmpl_state); static gint first_diff_index (gchar * pat, gchar * text); static gint compare_user_dir (const void *a, const void *b); static gint compare_cmpl_dir (const void *a, const void *b); static void update_cmpl (PossibleCompletion * poss, CompletionState * cmpl_state); static void gtk_file_selection_class_init (GtkFileSelectionClass * klass); static void gtk_file_selection_init (GtkFileSelection * filesel); static void gtk_file_selection_destroy (GtkObject * object); static gint gtk_file_selection_key_press (GtkWidget * widget, GdkEventKey * event, gpointer user_data); static void gtk_file_selection_file_button (GtkWidget * widget, gint row, gint column, GdkEventButton * bevent, gpointer user_data); static void gtk_file_selection_dir_button (GtkWidget * widget, gint row, gint column, GdkEventButton * bevent, gpointer data); static void gtk_file_selection_undir_button (GtkWidget * widget, gint row, gint column, GdkEventButton * bevent, gpointer data); static void gtk_file_selection_populate (GtkFileSelection * fs, gchar * rel_path, gint try_complete); static void gtk_file_selection_abort (GtkFileSelection * fs); static void gtk_file_selection_update_history_menu (GtkFileSelection * fs, gchar * current_dir); static void gtk_file_selection_create_dir (GtkWidget * widget, gpointer data); static void gtk_file_selection_delete_file (GtkWidget * widget, gpointer data); static void gtk_file_selection_rename_file (GtkWidget * widget, gpointer data); static gboolean gtk_file_selection_history_combo_callback (GtkWidget * widget, GdkEventKey * event, gpointer data); static gboolean gtk_file_selection_history_combo_list_key_handler (GtkWidget * widget, GdkEventKey * event, gpointer user_data); static gboolean gtk_file_selection_history_combo_list_callback (GtkWidget * thelist, GdkEventButton * event, gpointer user_data); static void gtk_file_selection_mask_entry_callback (GtkWidget * widget, gpointer data); static void gtk_file_selection_create_dir (GtkWidget * widget, gpointer data); static void gtk_file_selection_delete_file (GtkWidget * widget, gpointer data); static void gtk_file_selection_rename_file (GtkWidget * widget, gpointer data); static void gtk_file_selection_home_button (GtkWidget * widget, gpointer data); static void gtk_file_selection_up_button (GtkWidget * widget, gpointer data); static void gtk_file_selection_prev_button (GtkWidget * widget, gpointer data); static void gtk_file_selection_next_button (GtkWidget * widget, gpointer data); static void gtk_file_selection_refresh_button (GtkWidget * widget, gpointer data); static gint gtk_file_selection_match_char (gchar, gchar * mask); static gint gtk_file_selection_match_mask (gchar *, gchar *); static GtkWindowClass *parent_class = NULL; /* Saves errno when something cmpl does fails. */ static gint cmpl_errno; /* General notes: * Make prev and next inactive if their respective * * histories are empty. * Add facilities for handling hidden files and * * directories * * Add an api to access the mask, and hidden files * * check box? (prob not in 1.2.x series) * */ /* Routine for applying mask to filenames * * Need to be optimized to minimize recursion * * help the for loop by looking for the next * * instance of the mask character following * * the '*'. ei *.c -- look for '.' * * Also, swap all *? pairs (-> ?*), as that * * will make it possible to look ahead (? * * makes it very nondeterministic as in *?.c * * which really is ?*.c * * Allow multiply masks, separted by commas * * Allow more flexible [] handling (ie [a-zA-Z] * * * */ static gint gtk_file_selection_match_char (gchar text, gchar * mask) { gchar *maskc; gint x; gint s; if (mask[0] == '[') { if (!strchr (mask, ']')) return 0; maskc = g_strdup (mask + 1); /* get the portion of mask inside [] */ (*(strchr (maskc, ']'))) = 0; s =(gint) strlen ((char *) maskc); for (x = 0; x < s; x++) { if (text == maskc[x]) { g_free (maskc); return s + 2; } } g_free (maskc); return 0; } if (mask[0] == '?') return 1; if (mask[0] == text) return 1; return 0; } static gint gtk_file_selection_match_mask (gchar * text, gchar * mask) { int mc; int tc; gchar *mymask; gchar *mask2, *mask3; int tc1 = 0; tc = 0; mc = 0; if (mask[0] == 0 && text[0] == 0) return 1; if (mask[0] == '*') { /*MK*/ mymask = g_strdup (mask); mask2 = g_strdup (strchr (mymask, ',')); if (mask2 != (char *) NULL) { tc1 = 1; (*(strchr (mymask, ','))) = 0; } for (tc = 0; tc <= (int)strlen (text); tc++) { if (gtk_file_selection_match_mask (text + tc, mymask + 1)) { /* fprintf(stderr,"%s matches %s\n",text,mymask);*/ g_free (mymask); g_free (mask2); return 1; } } /*MK*/ if (tc1 == 0) { /* fprintf(stderr,"no mask2\n");*/ g_free (mymask); return 0; } mask2++; /* fprintf(stderr,"mask2: %s, text=%s\n",mask2,text);*/ if (mask2[0] != '*') { g_free (mymask); free (--mask2); return 0; } tc = 0; mask3 = strchr (mask2, ','); if (mask3 != (char *) NULL) { tc = 1; (*(strchr (mask2, ','))) = 0; } for (tc1 = 0; tc1 <= (int)strlen (text); tc1++) { if (gtk_file_selection_match_mask (text + tc1, mask2 + 1)) { /* fprintf(stderr,"%s matches %s\n",text,mask2);*/ free (--mask2); g_free (mymask); return 1; } } if (tc == 0) { /* fprintf(stderr,"no mask3 -- no match for %s\n",text);*/ g_free (--mask2); g_free (mymask); return 0; } mask3++; /* fprintf(stderr,"mask3: %s, text=%s\n",mask3,text);*/ if (mask3[0] != '*') { g_free (--mask2); g_free (mymask); return 0; } for (tc = 0; tc <= (int)strlen (text); tc++) { if (gtk_file_selection_match_mask (text + tc, mask3 + 1)) { /* fprintf(stderr,"%s matches %s\n",text,mask3);*/ g_free (--mask2); g_free (mymask); return 1; } } /*MK*/ g_free (--mask2); g_free (mymask); /* fprintf(stderr,"nothing matches %s\n",text);*/ return 0; } mc = gtk_file_selection_match_char (text[0], mask); if (mc) return gtk_file_selection_match_mask (text + 1, mask + mc); else return 0; } GtkType gtk_file_selection_get_type (void) { static GtkType file_selection_type = 0; if (!file_selection_type) { static const GtkTypeInfo filesel_info = { "GtkFileSelection", (guint)sizeof (GtkFileSelection), (guint)sizeof (GtkFileSelectionClass), (GtkClassInitFunc) gtk_file_selection_class_init, (GtkObjectInitFunc) gtk_file_selection_init, /* reserved_1 */ NULL, /* reserved_2 */ NULL, (GtkClassInitFunc) NULL, }; file_selection_type = gtk_type_unique (GTK_TYPE_WINDOW, &filesel_info); } return file_selection_type; } static void gtk_file_selection_class_init (GtkFileSelectionClass * class) { GtkObjectClass *object_class; object_class = (GtkObjectClass *) class; parent_class = gtk_type_class (GTK_TYPE_WINDOW); object_class->destroy = gtk_file_selection_destroy; } static void gtk_file_selection_init (GtkFileSelection * filesel) { GtkWidget *entry_vbox; GtkWidget *label; GtkWidget *list_hbox; GtkWidget *confirm_area; GtkWidget *vbox; GtkWidget *hbox; GtkWidget *pulldown_hbox; GtkWidget *scrolled_win; GtkWidget *mask_label; GtkWidget *bigframe; GtkWidget *label_lookingin; GtkWidget *up_button; GtkWidget *home_button; GtkWidget *prev_button; GtkWidget *next_button; GtkWidget *refresh_button; GdkPixmap *pixmap; GtkWidget *pixmapwidget; GtkStyle *style; GdkBitmap *mask; char *dir_title[2]; char *file_title[2]; filesel->cmpl_state = cmpl_init_state (); filesel->mask = NULL; filesel->prev_history = NULL; filesel->next_history = NULL; filesel->saved_entry = NULL; /* The dialog-sized vertical box */ filesel->main_vbox = gtk_vbox_new (FALSE, 10); gtk_container_set_border_width (GTK_CONTAINER (filesel), 10); gtk_container_add (GTK_CONTAINER (filesel), filesel->main_vbox); gtk_widget_show (filesel->main_vbox); /* The horizontal box containing create, rename etc. buttons */ filesel->button_area = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START); gtk_button_box_set_spacing (GTK_BUTTON_BOX (filesel->button_area), 0); gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area, FALSE, FALSE, 0); gtk_widget_show (filesel->button_area); gtk_file_selection_show_fileop_buttons (filesel); /* hbox for pulldown menu */ pulldown_hbox = gtk_hbox_new (FALSE, 5); gtk_box_pack_start (GTK_BOX (filesel->main_vbox), pulldown_hbox, FALSE, FALSE, 0); gtk_widget_show (pulldown_hbox); /* The combo box that replaces the pulldown menu */ label_lookingin = gtk_label_new (_("Looking in:")); gtk_widget_show (label_lookingin); gtk_box_pack_start (GTK_BOX (pulldown_hbox), label_lookingin, FALSE, FALSE, 0); filesel->history_combo = gtk_combo_new (); gtk_widget_show (filesel->history_combo); gtk_combo_set_value_in_list (GTK_COMBO (filesel->history_combo), FALSE, FALSE); gtk_box_pack_start (GTK_BOX (pulldown_hbox), filesel->history_combo, TRUE, TRUE, 0); (void)gtk_signal_connect (GTK_OBJECT (((GtkCombo *) filesel->history_combo)->entry), "key-press-event", (GtkSignalFunc) gtk_file_selection_history_combo_callback, (gpointer) filesel); (void)gtk_signal_connect (GTK_OBJECT (((GtkCombo *) filesel->history_combo)->list), "button-press-event", (GtkSignalFunc) gtk_file_selection_history_combo_list_callback, (gpointer) filesel); (void)gtk_signal_connect (GTK_OBJECT (((GtkCombo *) filesel->history_combo)->list), "key-press-event", (GtkSignalFunc) gtk_file_selection_history_combo_list_key_handler, (gpointer) filesel); /* frame to put the following hbox in */ bigframe = gtk_frame_new (NULL); gtk_widget_show (bigframe); gtk_box_pack_start (GTK_BOX (filesel->main_vbox), bigframe, TRUE, TRUE, 0); /* The horizontal box containing the directory and file listboxes */ list_hbox = gtk_hbox_new (FALSE, 5); gtk_container_add (GTK_CONTAINER (bigframe), list_hbox); gtk_container_set_border_width (GTK_CONTAINER (list_hbox), 5); gtk_widget_show (list_hbox); /* vbox to put the buttons and directory listing in */ vbox = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox); gtk_box_pack_start (GTK_BOX (list_hbox), vbox, FALSE, FALSE, 0); hbox = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); /* home_button = gtk_button_new_with_label (_("Home"));*/ /* style= gtk_widget_get_style(GTK_WIDGET(filesel));*/ gtk_widget_realize (GTK_WIDGET (filesel)); style = filesel->button_area->style; pixmap = gdk_pixmap_create_from_xpm_d (GTK_WIDGET (filesel)->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) filesel_home_pixmap); pixmapwidget = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwidget); gdk_pixmap_unref (pixmap); home_button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (home_button), pixmapwidget); gtk_widget_show (home_button); (void)gtk_signal_connect (GTK_OBJECT (home_button), "clicked", (GtkSignalFunc) gtk_file_selection_home_button, (gpointer) filesel); gtk_box_pack_start (GTK_BOX (hbox), home_button, TRUE, TRUE, 0); /* prev_button = gtk_button_new_with_label (_("Prev"));*/ pixmap = gdk_pixmap_create_from_xpm_d (GTK_WIDGET (filesel)->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) filesel_back_pixmap); pixmapwidget = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwidget); gdk_pixmap_unref (pixmap); prev_button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (prev_button), pixmapwidget); (void)gtk_signal_connect (GTK_OBJECT (prev_button), "clicked", (GtkSignalFunc) gtk_file_selection_prev_button, (gpointer) filesel); gtk_widget_show (prev_button); gtk_box_pack_start (GTK_BOX (hbox), prev_button, TRUE, TRUE, 0); /* up_button = gtk_button_new_with_label (_("Up"));*/ pixmap = gdk_pixmap_create_from_xpm_d (GTK_WIDGET (filesel)->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) filesel_up_pixmap); pixmapwidget = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwidget); gdk_pixmap_unref (pixmap); up_button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (up_button), pixmapwidget); (void)gtk_signal_connect (GTK_OBJECT (up_button), "clicked", (GtkSignalFunc) gtk_file_selection_up_button, (gpointer) filesel); gtk_widget_show (up_button); gtk_box_pack_start (GTK_BOX (hbox), up_button, TRUE, TRUE, 0); /* next_button = gtk_button_new_with_label (_("Next"));*/ pixmap = gdk_pixmap_create_from_xpm_d (GTK_WIDGET (filesel)->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) filesel_forward_pixmap); pixmapwidget = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwidget); gdk_pixmap_unref (pixmap); next_button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (next_button), pixmapwidget); gtk_widget_show (next_button); (void)gtk_signal_connect (GTK_OBJECT (next_button), "clicked", (GtkSignalFunc) gtk_file_selection_next_button, (gpointer) filesel); gtk_box_pack_start (GTK_BOX (hbox), next_button, TRUE, TRUE, 0); /* refresh_button = gtk_button_new_with_label (_("Refresh"));*/ pixmap = gdk_pixmap_create_from_xpm_d (GTK_WIDGET (filesel)->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) filesel_reload_pixmap); pixmapwidget = gtk_pixmap_new (pixmap, mask); gtk_widget_show (pixmapwidget); gdk_pixmap_unref (pixmap); refresh_button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (refresh_button), pixmapwidget); gtk_widget_show (refresh_button); (void)gtk_signal_connect (GTK_OBJECT (refresh_button), "clicked", (GtkSignalFunc) gtk_file_selection_refresh_button, (gpointer) filesel); gtk_box_pack_start (GTK_BOX (hbox), refresh_button, TRUE, TRUE, 0); /* The directories clist */ dir_title[0] = _("Directories"); dir_title[1] = NULL; filesel->dir_list = gtk_clist_new_with_titles (1, (gchar **) dir_title); gtk_widget_set_usize (filesel->dir_list, DIR_LIST_WIDTH, DIR_LIST_HEIGHT); (void)gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "select_row", (GtkSignalFunc) gtk_file_selection_dir_button, (gpointer) filesel); (void)gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "unselect_row", (GtkSignalFunc) gtk_file_selection_undir_button, (gpointer) filesel); gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->dir_list); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 5); gtk_widget_show (filesel->dir_list); gtk_widget_show (scrolled_win); /* vbox area for mask entry and files clist */ vbox = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox); gtk_box_pack_start (GTK_BOX (list_hbox), vbox, TRUE, TRUE, 0); hbox = gtk_hbox_new (FALSE, 5); gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); mask_label = gtk_label_new (_("Mask:")); gtk_widget_show (mask_label); gtk_box_pack_start (GTK_BOX (hbox), mask_label, FALSE, FALSE, 0); filesel->mask_entry = gtk_entry_new (); gtk_widget_show (filesel->mask_entry); (void)gtk_signal_connect (GTK_OBJECT (filesel->mask_entry), "activate", (GtkSignalFunc) gtk_file_selection_mask_entry_callback, (gpointer) filesel); gtk_box_pack_start (GTK_BOX (hbox), filesel->mask_entry, TRUE, TRUE, 0); /* The files clist */ file_title[0] = _("Files"); file_title[1] = NULL; filesel->file_list = gtk_clist_new_with_titles (1, (gchar **) file_title); gtk_widget_set_usize (filesel->file_list, FILE_LIST_WIDTH, FILE_LIST_HEIGHT); (void)gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row", (GtkSignalFunc) gtk_file_selection_file_button, (gpointer) filesel); gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 5); gtk_widget_show (filesel->file_list); gtk_widget_show (scrolled_win); /* action area for packing buttons into. */ filesel->action_area = gtk_hbox_new (TRUE, 0); gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area, FALSE, FALSE, 0); gtk_widget_show (filesel->action_area); /* The OK/Cancel button area */ confirm_area = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (confirm_area), GTK_BUTTONBOX_END); gtk_button_box_set_spacing (GTK_BUTTON_BOX (confirm_area), 5); gtk_box_pack_end (GTK_BOX (filesel->main_vbox), confirm_area, FALSE, FALSE, 0); gtk_widget_show (confirm_area); /* The OK button */ filesel->ok_button = gtk_button_new_with_label (_("OK")); GTK_WIDGET_SET_FLAGS (filesel->ok_button, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (confirm_area), filesel->ok_button, TRUE, TRUE, 0); gtk_widget_grab_default (filesel->ok_button); gtk_widget_show (filesel->ok_button); /* The Cancel button */ filesel->cancel_button = gtk_button_new_with_label (_("Cancel")); GTK_WIDGET_SET_FLAGS (filesel->cancel_button, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (confirm_area), filesel->cancel_button, TRUE, TRUE, 0); gtk_widget_show (filesel->cancel_button); /* The selection entry widget */ entry_vbox = gtk_vbox_new (FALSE, 2); gtk_box_pack_end (GTK_BOX (filesel->main_vbox), entry_vbox, FALSE, FALSE, 0); gtk_widget_show (entry_vbox); filesel->selection_text = label = gtk_label_new (""); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (entry_vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); filesel->selection_entry = gtk_entry_new (); (void)gtk_signal_connect (GTK_OBJECT (filesel->selection_entry), "key_press_event", (GtkSignalFunc) gtk_file_selection_key_press, filesel); (void)gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "focus_in_event", (GtkSignalFunc) gtk_widget_grab_default, GTK_OBJECT (filesel->ok_button)); (void)gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "activate", (GtkSignalFunc) gtk_button_clicked, GTK_OBJECT (filesel->ok_button)); gtk_box_pack_start (GTK_BOX (entry_vbox), filesel->selection_entry, TRUE, TRUE, 0); gtk_widget_show (filesel->selection_entry); if (!cmpl_state_okay (filesel->cmpl_state)) { gchar err_buf[256]; snprintf (err_buf,256, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno)); gtk_label_set_text (GTK_LABEL (filesel->selection_text), err_buf); } else { gtk_file_selection_populate (filesel, "", FALSE); } gtk_widget_grab_focus (filesel->selection_entry); } GtkWidget * gtk_file_selection_new (const gchar * title) { GtkFileSelection *filesel; filesel = gtk_type_new (GTK_TYPE_FILE_SELECTION); gtk_window_set_title (GTK_WINDOW (filesel), title); return GTK_WIDGET (filesel); } void gtk_file_selection_show_fileop_buttons (GtkFileSelection * filesel) { g_return_if_fail (filesel != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); /* delete, create directory, and rename */ if (!filesel->fileop_c_dir) { filesel->fileop_c_dir = gtk_button_new_with_label (_("Create Dir")); (void)gtk_signal_connect (GTK_OBJECT (filesel->fileop_c_dir), "clicked", (GtkSignalFunc) gtk_file_selection_create_dir, (gpointer) filesel); gtk_box_pack_start (GTK_BOX (filesel->button_area), filesel->fileop_c_dir, TRUE, TRUE, 0); gtk_widget_show (filesel->fileop_c_dir); } if (!filesel->fileop_del_file) { filesel->fileop_del_file = gtk_button_new_with_label (_("Delete File")); (void)gtk_signal_connect (GTK_OBJECT (filesel->fileop_del_file), "clicked", (GtkSignalFunc) gtk_file_selection_delete_file, (gpointer) filesel); gtk_box_pack_start (GTK_BOX (filesel->button_area), filesel->fileop_del_file, TRUE, TRUE, 0); gtk_widget_show (filesel->fileop_del_file); } if (!filesel->fileop_ren_file) { filesel->fileop_ren_file = gtk_button_new_with_label (_("Rename File")); (void)gtk_signal_connect (GTK_OBJECT (filesel->fileop_ren_file), "clicked", (GtkSignalFunc) gtk_file_selection_rename_file, (gpointer) filesel); gtk_box_pack_start (GTK_BOX (filesel->button_area), filesel->fileop_ren_file, TRUE, TRUE, 0); gtk_widget_show (filesel->fileop_ren_file); } gtk_widget_queue_resize (GTK_WIDGET (filesel)); } void gtk_file_selection_hide_fileop_buttons (GtkFileSelection * filesel) { g_return_if_fail (filesel != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); if (filesel->fileop_ren_file) { gtk_widget_destroy (filesel->fileop_ren_file); filesel->fileop_ren_file = NULL; } if (filesel->fileop_del_file) { gtk_widget_destroy (filesel->fileop_del_file); filesel->fileop_del_file = NULL; } if (filesel->fileop_c_dir) { gtk_widget_destroy (filesel->fileop_c_dir); filesel->fileop_c_dir = NULL; } } void gtk_file_selection_set_filename (GtkFileSelection * filesel, const gchar * filename) { char buf[MAXPATHLEN]; const char *name, *last_slash; g_return_if_fail (filesel != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); g_return_if_fail (filename != NULL); last_slash = strrchr (filename, '/'); if (!last_slash) { buf[0] = 0; name = filename; } else { gint len = MIN ((int)MAXPATHLEN - 1, (int)(last_slash - filename + 1)); strncpy (buf, filename, (size_t)len); buf[len] = 0; name = last_slash + 1; } gtk_file_selection_populate (filesel, buf, FALSE); if (filesel->selection_entry) gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), name); } gchar * gtk_file_selection_get_filename (GtkFileSelection * filesel) { static char nothing[2] = ""; char *text; char *filename; g_return_val_if_fail (filesel != NULL, nothing); g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), nothing); text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)); if (text) { filename = cmpl_completion_fullname (text, filesel->cmpl_state); return filename; } return nothing; } void gtk_file_selection_complete (GtkFileSelection * filesel, const gchar * pattern) { gchar *new_pattern; gint x; g_return_if_fail (filesel != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); g_return_if_fail (pattern != NULL); if (filesel->selection_entry) gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), pattern); if (strchr (pattern, '*') || strchr (pattern, '?')) { for (x = (gint)strlen (pattern); x >= 0; x--) { if (pattern[x] == '/') break; } gtk_entry_set_text (GTK_ENTRY (filesel->mask_entry), g_strdup (pattern + x + 1)); if (filesel->mask) g_free (filesel->mask); filesel->mask = g_strdup (pattern + x + 1); new_pattern = g_strdup (pattern); new_pattern[x + 1] = 0; gtk_file_selection_populate (filesel, (gchar *) new_pattern, TRUE); g_free (new_pattern); } else { gtk_file_selection_populate (filesel, (gchar *) pattern, TRUE); } } static void gtk_file_selection_destroy (GtkObject * object) { GtkFileSelection *filesel; GList *list; g_return_if_fail (object != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (object)); filesel = GTK_FILE_SELECTION (object); if (filesel->fileop_dialog) gtk_widget_destroy (filesel->fileop_dialog); if (filesel->next_history) { list = filesel->next_history; while (list) { g_free (list->data); list = list->next; } } g_list_free (filesel->next_history); filesel->next_history = NULL; if (filesel->prev_history) { list = filesel->prev_history; while (list) { g_free (list->data); list = list->next; } } g_list_free (filesel->prev_history); filesel->prev_history = NULL; if (filesel->mask) { g_free (filesel->mask); filesel->mask = NULL; } cmpl_free_state (filesel->cmpl_state); filesel->cmpl_state = NULL; if (GTK_OBJECT_CLASS (parent_class)->destroy) (*GTK_OBJECT_CLASS (parent_class)->destroy) (object); } /* Begin file operations callbacks */ static void gtk_file_selection_fileop_error (GtkFileSelection * fs, gchar * error_message) { GtkWidget *label; GtkWidget *vbox; GtkWidget *button; GtkWidget *dialog; g_return_if_fail (error_message != NULL); /* main dialog */ dialog = gtk_dialog_new (); /* gtk_signal_connect (GTK_OBJECT (dialog), "destroy", (GtkSignalFunc) gtk_file_selection_fileop_destroy, (gpointer) fs); */ gtk_window_set_title (GTK_WINDOW (dialog), _("Error")); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); /* If file dialog is grabbed, make this dialog modal too */ /* When error dialog is closed, file dialog will be grabbed again */ if (GTK_WINDOW (fs)->modal) gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, FALSE, FALSE, 0); gtk_widget_show (vbox); label = gtk_label_new (error_message); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); /* yes, we free it */ g_free (error_message); /* close button */ button = gtk_button_new_with_label (_("Close")); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_widget_destroy, (gpointer) dialog); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (dialog); } static void gtk_file_selection_fileop_destroy (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); fs->fileop_dialog = NULL; } static void gtk_file_selection_create_dir_confirmed (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; gchar *dirname; gchar *path; gchar *full_path; gchar *buf; CompletionState *cmpl_state; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); dirname = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); cmpl_state = (CompletionState *) fs->cmpl_state; path = cmpl_reference_position (cmpl_state); full_path = g_strconcat (path, "/", dirname, NULL); if ((mkdir (full_path, 0755) < 0)) { buf = g_strconcat ("Error creating directory \"", dirname, "\": ", g_strerror (errno), NULL); gtk_file_selection_fileop_error (fs, buf); } g_free (full_path); gtk_widget_destroy (fs->fileop_dialog); gtk_file_selection_populate (fs, "", FALSE); } static void gtk_file_selection_create_dir (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; GtkWidget *label; GtkWidget *dialog; GtkWidget *vbox; GtkWidget *button; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); if (fs->fileop_dialog) return; /* main dialog */ fs->fileop_dialog = dialog = gtk_dialog_new (); (void)gtk_signal_connect (GTK_OBJECT (dialog), "destroy", (GtkSignalFunc) gtk_file_selection_fileop_destroy, (gpointer) fs); gtk_window_set_title (GTK_WINDOW (dialog), _("Create Directory")); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); /* If file dialog is grabbed, grab option dialog */ /* When option dialog is closed, file dialog will be grabbed again */ if (GTK_WINDOW (fs)->modal) gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, FALSE, FALSE, 0); gtk_widget_show (vbox); label = gtk_label_new (_("Directory name:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); /* The directory entry widget */ fs->fileop_entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, TRUE, TRUE, 5); GTK_WIDGET_SET_FLAGS (fs->fileop_entry, GTK_CAN_DEFAULT); gtk_widget_show (fs->fileop_entry); /* buttons */ button = gtk_button_new_with_label (_("Create")); (void)gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_file_selection_create_dir_confirmed, (gpointer) fs); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_show (button); button = gtk_button_new_with_label (_("Cancel")); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_widget_destroy, (gpointer) dialog); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (dialog); } static void gtk_file_selection_delete_file_confirmed (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; CompletionState *cmpl_state; gchar *path; gchar *full_path; gchar *buf; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); cmpl_state = (CompletionState *) fs->cmpl_state; path = cmpl_reference_position (cmpl_state); full_path = g_strconcat (path, "/", fs->fileop_file, NULL); if ((unlink (full_path) < 0)) { buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ", g_strerror (errno), NULL); gtk_file_selection_fileop_error (fs, buf); } g_free (full_path); gtk_widget_destroy (fs->fileop_dialog); gtk_file_selection_populate (fs, "", FALSE); } static void gtk_file_selection_delete_file (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; GtkWidget *label; GtkWidget *vbox; GtkWidget *button; GtkWidget *dialog; gchar *filename; gchar *buf; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); if (fs->fileop_dialog) return; filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); if (strlen (filename) < 1) return; fs->fileop_file = filename; /* main dialog */ fs->fileop_dialog = dialog = gtk_dialog_new (); (void)gtk_signal_connect (GTK_OBJECT (dialog), "destroy", (GtkSignalFunc) gtk_file_selection_fileop_destroy, (gpointer) fs); gtk_window_set_title (GTK_WINDOW (dialog), _("Delete File")); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); /* If file dialog is grabbed, grab option dialog */ /* When option dialog is closed, file dialog will be grabbed again */ if (GTK_WINDOW (fs)->modal) gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, FALSE, FALSE, 0); gtk_widget_show (vbox); buf = g_strconcat ("Really delete file \"", filename, "\" ?", NULL); label = gtk_label_new (buf); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); g_free (buf); /* buttons */ button = gtk_button_new_with_label (_("Delete")); (void)gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_file_selection_delete_file_confirmed, (gpointer) fs); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_show (button); button = gtk_button_new_with_label (_("Cancel")); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_widget_destroy, (gpointer) dialog); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (dialog); } static void gtk_file_selection_rename_file_confirmed (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; gchar *buf; gchar *file; gchar *path; gchar *new_filename; gchar *old_filename; CompletionState *cmpl_state; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); file = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); cmpl_state = (CompletionState *) fs->cmpl_state; path = cmpl_reference_position (cmpl_state); new_filename = g_strconcat (path, "/", file, NULL); old_filename = g_strconcat (path, "/", fs->fileop_file, NULL); if ((rename (old_filename, new_filename)) < 0) { buf = g_strconcat ("Error renaming file \"", file, "\": ", g_strerror (errno), NULL); gtk_file_selection_fileop_error (fs, buf); } g_free (new_filename); g_free (old_filename); gtk_widget_destroy (fs->fileop_dialog); gtk_file_selection_populate (fs, "", FALSE); } static void gtk_file_selection_rename_file (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; GtkWidget *label; GtkWidget *dialog; GtkWidget *vbox; GtkWidget *button; gchar *buf; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); if (fs->fileop_dialog) return; fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); if (strlen (fs->fileop_file) < 1) return; /* main dialog */ fs->fileop_dialog = dialog = gtk_dialog_new (); (void)gtk_signal_connect (GTK_OBJECT (dialog), "destroy", (GtkSignalFunc) gtk_file_selection_fileop_destroy, (gpointer) fs); gtk_window_set_title (GTK_WINDOW (dialog), _("Rename File")); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); /* If file dialog is grabbed, grab option dialog */ /* When option dialog closed, file dialog will be grabbed again */ if (GTK_WINDOW (fs)->modal) gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, FALSE, FALSE, 0); gtk_widget_show (vbox); buf = g_strconcat ("Rename file \"", fs->fileop_file, "\" to:", NULL); label = gtk_label_new (buf); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); g_free (buf); /* New filename entry */ fs->fileop_entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, TRUE, TRUE, 5); GTK_WIDGET_SET_FLAGS (fs->fileop_entry, GTK_CAN_DEFAULT); gtk_widget_show (fs->fileop_entry); gtk_entry_set_text (GTK_ENTRY (fs->fileop_entry), fs->fileop_file); gtk_editable_select_region (GTK_EDITABLE (fs->fileop_entry), 0, (gint)strlen (fs->fileop_file)); /* buttons */ button = gtk_button_new_with_label (_("Rename")); (void)gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_file_selection_rename_file_confirmed, (gpointer) fs); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_show (button); button = gtk_button_new_with_label (_("Cancel")); (void)gtk_signal_connect_object (GTK_OBJECT (button), "clicked", (GtkSignalFunc) gtk_widget_destroy, (gpointer) dialog); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (dialog); } static gint gtk_file_selection_key_press (GtkWidget * widget, GdkEventKey * event, gpointer user_data) { GtkFileSelection *fs; char *text; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); fs = GTK_FILE_SELECTION (user_data); if (event->keyval == GDK_Tab) { text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); text = g_strdup (text); gtk_file_selection_populate (fs, text, TRUE); g_free (text); gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); return TRUE; } if (fs->saved_entry) { gtk_clist_unselect_all ((GtkCList *) (fs->dir_list)); gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), fs->saved_entry); g_free (fs->saved_entry); fs->saved_entry = NULL; } return FALSE; } static void gtk_file_selection_home_button (GtkWidget * widget, gpointer data) { GList *list; GtkFileSelection *fs = data; list = fs->next_history; if (list) { g_free (list->data); list = list->next; } g_list_free (fs->next_history); fs->next_history = NULL; gtk_file_selection_populate (fs, "~/", FALSE); } static void gtk_file_selection_up_button (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; GList *list; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); list = fs->next_history; if (list) { g_free (list->data); list = list->next; } g_list_free (fs->next_history); fs->next_history = NULL; gtk_file_selection_populate (fs, "../", FALSE); /*change directories. */ } static void gtk_file_selection_prev_button (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; GList *list; GList *first; gchar *path; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); list = fs->prev_history; if (list && g_list_length (list) > 1) { first = list; /* get first element */ list = list->next; /* pop off current directory */ list->prev = NULL; /* make this the new head. */ fs->prev_history = list; /* update prev_history list */ fs->next_history = g_list_prepend (fs->next_history, first->data); /* put it on next_history */ first->next = NULL; /* orphan the old first node */ g_list_free (first); /* free the node (data is now in use by next_history) */ path = g_malloc (strlen (list->data) + 4); /* plenty of space */ strcpy (path, list->data); /* get the 2nd path in the history */ strcat (path, "/"); /* append a '/' */ gtk_file_selection_populate (fs, path, FALSE); /* change directories. */ g_free (path); } } static void gtk_file_selection_next_button (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; GList *list; GList *first; gchar *path; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); list = fs->next_history; if (list && g_list_length (list) > 0) { first = list; /*get first element */ list = list->next; /*pop off current directory */ if (list) list->prev = NULL; fs->next_history = list; /*update prev_history list */ path = g_malloc (strlen (first->data) + 4); /*plenty of space */ strcpy (path, first->data); strcat (path, "/"); /*append a / */ gtk_file_selection_populate (fs, path, FALSE); /*change directories. */ g_free (path); first->next = NULL; /* orphan the old first node */ g_list_free (first); /* free the node (data is now in use by next_history) */ } } void static gtk_file_selection_refresh_button (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); gtk_file_selection_populate (fs, "", FALSE); } static void gtk_file_selection_mask_entry_callback (GtkWidget * widget, gpointer data) { GtkFileSelection *fs = data; if (fs->mask) g_free (fs->mask); fs->mask = g_strdup (gtk_entry_get_text (GTK_ENTRY (fs->mask_entry))); if (strlen (fs->mask) == 0) { g_free (fs->mask); fs->mask = NULL; } gtk_file_selection_refresh_button (widget, data); } static gboolean gtk_file_selection_history_combo_list_key_handler (GtkWidget * widget, GdkEventKey * event, gpointer user_data) { /* g_print("Key pressed! \n"); */ return TRUE; } static gboolean gtk_file_selection_history_combo_list_callback (GtkWidget * thelist, GdkEventButton * event, gpointer user_data) { GtkFileSelection *fs = user_data; GList *list; gchar *path; list = fs->next_history; if (list) { g_free (list->data); list = list->next; } g_list_free (fs->next_history); fs->next_history = NULL; path = g_malloc (strlen (gtk_entry_get_text (GTK_ENTRY (((GtkCombo *) fs->history_combo)->entry))) + 4); strcpy (path, gtk_entry_get_text (GTK_ENTRY (((GtkCombo *) fs->history_combo)->entry))); strcat (path, "/"); gtk_file_selection_populate (fs, path, TRUE); g_free (path); return TRUE; } static gboolean gtk_file_selection_history_combo_callback (GtkWidget * widget, GdkEventKey * event, gpointer data) { GtkEntry *entry = (GtkEntry *) widget; GtkFileSelection *fs = data; GList *list; gchar *path; g_return_val_if_fail (fs != NULL, FALSE); g_return_val_if_fail (GTK_IS_FILE_SELECTION (fs), FALSE); if (event->keyval == GDK_Return) { list = fs->next_history; if (list) { g_free (list->data); list = list->next; } g_list_free (fs->next_history); fs->next_history = NULL; path = g_malloc (strlen (gtk_entry_get_text (entry)) + 4); strcpy (path, gtk_entry_get_text (entry)); strcat (path, "/"); gtk_file_selection_populate (fs, path, TRUE); g_free (path); gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); return TRUE; } else { return FALSE; } } static void gtk_file_selection_update_history_menu (GtkFileSelection * fs, gchar * current_directory) { gchar *current_dir; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); g_return_if_fail (current_directory != NULL); current_dir = g_strdup (current_directory); if (fs->prev_history) { if (strcmp ((fs->prev_history)->data, current_dir)) { /*if this item isn't on the top of the list */ fs->prev_history = g_list_prepend (fs->prev_history, g_strdup (current_dir)); } } else { fs->prev_history = g_list_prepend (fs->prev_history, g_strdup (current_dir)); } gtk_combo_set_popdown_strings (GTK_COMBO (fs->history_combo), fs->prev_history); g_free (current_dir); } static void gtk_file_selection_file_button (GtkWidget * widget, gint row, gint column, GdkEventButton * bevent, gpointer user_data) { GtkFileSelection *fs = NULL; gchar *filename, *temp = NULL; g_return_if_fail (GTK_IS_CLIST (widget)); fs = user_data; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); (void)gtk_clist_get_text (GTK_CLIST (fs->file_list), row, 0, &temp); filename = g_strdup (temp); if (filename) { if (bevent) switch (bevent->type) { case GDK_2BUTTON_PRESS: gtk_button_clicked (GTK_BUTTON (fs->ok_button)); break; default: gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); break; } else gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); g_free (filename); } } static void gtk_file_selection_dir_button (GtkWidget * widget, gint row, gint column, GdkEventButton * bevent, gpointer user_data) { GList *list; GtkFileSelection *fs = NULL; gchar *filename, *temp = NULL; g_return_if_fail (GTK_IS_CLIST (widget)); fs = GTK_FILE_SELECTION (user_data); g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); (void)gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp); filename = g_strdup (temp); if (filename) { if (bevent) switch (bevent->type) { case GDK_2BUTTON_PRESS: list = fs->next_history; if (list) { g_free (list->data); list = list->next; } g_list_free (fs->next_history); fs->next_history = NULL; gtk_file_selection_populate (fs, filename, FALSE); if (fs->saved_entry) { /* might be NULL --MK30.12.2001 */ gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), fs->saved_entry); g_free (fs->saved_entry); fs->saved_entry = NULL; } break; default: /* here we need to add the "filename" to the beginning of what's already in the entry. Save what's in the entry, then restore it on the double click */ if (fs->saved_entry) g_free (fs->saved_entry); fs->saved_entry = g_strdup (gtk_entry_get_text (GTK_ENTRY (fs->selection_entry))); temp = g_strconcat (filename, fs->saved_entry, NULL); gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), temp); g_free (temp); break; } else gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); g_free (filename); } } static void gtk_file_selection_undir_button (GtkWidget * widget, gint row, gint column, GdkEventButton * bevent, gpointer user_data) { GtkFileSelection *fs = NULL; gchar *filename, *temp = NULL; g_return_if_fail (GTK_IS_CLIST (widget)); fs = GTK_FILE_SELECTION (user_data); g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); (void)gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp); filename = g_strdup (temp); if (filename) { if (bevent) switch (bevent->type) { default: /* here we need to add the "filename" to the beginning of what's already in the entry. Save what's in the entry, then restore it on the double click */ if (fs->saved_entry) { gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), fs->saved_entry); g_free (fs->saved_entry); fs->saved_entry = NULL; } break; } else gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); //????? g_free (filename); } } static void gtk_file_selection_populate (GtkFileSelection * fs, gchar * rel_path, gint try_complete) { CompletionState *cmpl_state; PossibleCompletion *poss; gchar *filename; gint row; gchar *rem_path = rel_path; gchar *sel_text; gchar *text[2]; gint did_recurse = FALSE; gint possible_count = 0; gint selection_index = -1; gint file_list_width; gint dir_list_width; g_return_if_fail (fs != NULL); g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); cmpl_state = (CompletionState *) fs->cmpl_state; poss = cmpl_completion_matches (rel_path, &rem_path, cmpl_state); if (!cmpl_state_okay (cmpl_state)) { /* Something went wrong. */ gtk_file_selection_abort (fs); return; } g_assert (cmpl_state->reference_dir); gtk_clist_freeze (GTK_CLIST (fs->dir_list)); gtk_clist_clear (GTK_CLIST (fs->dir_list)); gtk_clist_freeze (GTK_CLIST (fs->file_list)); gtk_clist_clear (GTK_CLIST (fs->file_list)); /* Set the dir_list to include ./ and ../ */ text[1] = NULL; text[0] = "./"; row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); text[0] = "../"; row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); /*reset the max widths of the lists */ dir_list_width = gdk_string_width (fs->dir_list->style->font, "../"); gtk_clist_set_column_width (GTK_CLIST (fs->dir_list), 0, dir_list_width); file_list_width = 1; gtk_clist_set_column_width (GTK_CLIST (fs->file_list), 0, file_list_width); while (poss) { if (cmpl_is_a_completion (poss)) { possible_count += 1; filename = cmpl_this_completion (poss); text[0] = filename; if (cmpl_is_directory (poss)) { if (strcmp (filename, "./") != 0 && strcmp (filename, "../") != 0) { int width = gdk_string_width (fs->dir_list->style->font, filename); row = gtk_clist_append (GTK_CLIST (fs->dir_list), text); if (width > dir_list_width) { dir_list_width = width; gtk_clist_set_column_width (GTK_CLIST (fs->dir_list), 0, width); } } } else { if (fs->mask) { if (gtk_file_selection_match_mask (filename, fs->mask)) { int width = gdk_string_width (fs->file_list->style->font, filename); row = gtk_clist_append (GTK_CLIST (fs->file_list), text); if (width > file_list_width) { file_list_width = width; gtk_clist_set_column_width (GTK_CLIST (fs->file_list), 0, width); } } } else { int width = gdk_string_width (fs->file_list->style->font, filename); row = gtk_clist_append (GTK_CLIST (fs->file_list), text); if (width > file_list_width) { file_list_width = width; gtk_clist_set_column_width (GTK_CLIST (fs->file_list), 0, width); } } } } poss = cmpl_next_completion (cmpl_state); } gtk_clist_thaw (GTK_CLIST (fs->dir_list)); gtk_clist_thaw (GTK_CLIST (fs->file_list)); /* File lists are set. */ g_assert (cmpl_state->reference_dir); if (try_complete) { /* User is trying to complete filenames, so advance the user's input * string to the updated_text, which is the common leading substring * of all possible completions, and if its a directory attempt * attempt completions in it. */ if (cmpl_updated_text (cmpl_state)[0]) { if (cmpl_updated_dir (cmpl_state)) { gchar *dir_name = g_strdup (cmpl_updated_text (cmpl_state)); did_recurse = TRUE; gtk_file_selection_populate (fs, dir_name, TRUE); g_free (dir_name); } else { if (fs->selection_entry) gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), cmpl_updated_text (cmpl_state)); } } else { selection_index = (gint) ( cmpl_last_valid_char (cmpl_state) - ((gint)strlen (rel_path) - (gint)strlen (rem_path)) ); if (fs->selection_entry) gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), rem_path); } } else { if (fs->selection_entry){} /* Here we need to take the old filename and keep it! */ /*gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), ""); */ ; } if (!did_recurse) { if (fs->selection_entry) gtk_entry_set_position (GTK_ENTRY (fs->selection_entry), selection_index); if (fs->selection_entry) { sel_text = g_strconcat (_("Selection: "), cmpl_reference_position (cmpl_state), NULL); gtk_label_set_text (GTK_LABEL (fs->selection_text), sel_text); g_free (sel_text); } gtk_file_selection_update_history_menu (fs, cmpl_reference_position (cmpl_state)); } } static void gtk_file_selection_abort (GtkFileSelection * fs) { gchar err_buf[256]; snprintf (err_buf,256, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno)); /* BEEP gdk_beep(); */ if (fs->selection_entry) gtk_label_set_text (GTK_LABEL (fs->selection_text), err_buf); } /**********************************************************************/ /* External Interface */ /**********************************************************************/ /* The four completion state selectors */ static gchar * cmpl_updated_text (CompletionState * cmpl_state) { return cmpl_state->updated_text; } static gint cmpl_updated_dir (CompletionState * cmpl_state) { return cmpl_state->re_complete; } static gchar * cmpl_reference_position (CompletionState * cmpl_state) { return cmpl_state->reference_dir->fullname; } static gint cmpl_last_valid_char (CompletionState * cmpl_state) { return cmpl_state->last_valid_char; } static gchar * cmpl_completion_fullname (gchar * text, CompletionState * cmpl_state) { static char nothing[2] = ""; if (!cmpl_state_okay (cmpl_state)) { return nothing; } else if (text[0] == '/') { strcpy (cmpl_state->updated_text, text); } else if (text[0] == '~') { CompletionDir *dir; char *slash; dir = open_user_dir (text, cmpl_state); if (!dir) { /* spencer says just return ~something, so * for now just do it. */ strcpy (cmpl_state->updated_text, text); } else { strcpy (cmpl_state->updated_text, dir->fullname); slash = strchr (text, '/'); if (slash) strcat (cmpl_state->updated_text, slash); } } else { strcpy (cmpl_state->updated_text, cmpl_state->reference_dir->fullname); if (strcmp (cmpl_state->reference_dir->fullname, "/") != 0) strcat (cmpl_state->updated_text, "/"); strcat (cmpl_state->updated_text, text); } return cmpl_state->updated_text; } /* The three completion selectors */ static gchar * cmpl_this_completion (PossibleCompletion * pc) { return pc->text; } static gint cmpl_is_directory (PossibleCompletion * pc) { return pc->is_directory; } static gint cmpl_is_a_completion (PossibleCompletion * pc) { return pc->is_a_completion; } /**********************************************************************/ /* Construction, deletion */ /**********************************************************************/ static CompletionState * cmpl_init_state (void) { gchar getcwd_buf[2 * MAXPATHLEN]; CompletionState *new_state; new_state = g_new (CompletionState, 1); /* We don't use getcwd() on SUNOS, because, it does a popen("pwd") * and, if that wasn't bad enough, hangs in doing so. */ #if defined(sun) && !defined(__SVR4) if (!getwd (getcwd_buf)) #else if (!getcwd (getcwd_buf, MAXPATHLEN)) #endif { /* Oh joy, we can't get the current directory. Um..., we should have * a root directory, right? Right? (Probably not portable to non-Unix) */ strcpy (getcwd_buf, "/"); } tryagain: new_state->reference_dir = NULL; new_state->completion_dir = NULL; new_state->active_completion_dir = NULL; new_state->directory_storage = NULL; new_state->directory_sent_storage = NULL; new_state->last_valid_char = 0; new_state->updated_text = g_new (gchar, MAXPATHLEN); new_state->updated_text_alloc = (gint)MAXPATHLEN; new_state->the_completion.text = g_new (gchar, MAXPATHLEN); new_state->the_completion.text_alloc = (gint)MAXPATHLEN; new_state->user_dir_name_buffer = NULL; new_state->user_directories = NULL; new_state->reference_dir = open_dir (getcwd_buf, new_state); if (!new_state->reference_dir) { /* Directories changing from underneath us, grumble */ strcpy (getcwd_buf, "/"); goto tryagain; } return new_state; } static void cmpl_free_dir_list (GList * dp0) { GList *dp = dp0; while (dp) { free_dir (dp->data); dp = dp->next; } g_list_free (dp0); } static void cmpl_free_dir_sent_list (GList * dp0) { GList *dp = dp0; while (dp) { free_dir_sent (dp->data); dp = dp->next; } g_list_free (dp0); } static void cmpl_free_state (CompletionState * cmpl_state) { cmpl_free_dir_list (cmpl_state->directory_storage); cmpl_free_dir_sent_list (cmpl_state->directory_sent_storage); if (cmpl_state->user_dir_name_buffer) g_free (cmpl_state->user_dir_name_buffer); if (cmpl_state->user_directories) g_free (cmpl_state->user_directories); if (cmpl_state->the_completion.text) g_free (cmpl_state->the_completion.text); if (cmpl_state->updated_text) g_free (cmpl_state->updated_text); g_free (cmpl_state); } static void free_dir (CompletionDir * dir) { g_free (dir->fullname); g_free (dir); } static void free_dir_sent (CompletionDirSent * sent) { g_free (sent->name_buffer); g_free (sent->entries); g_free (sent); } static void prune_memory_usage (CompletionState * cmpl_state) { GList *cdsl = cmpl_state->directory_sent_storage; GList *cdl = cmpl_state->directory_storage; GList *cdl0 = cdl; gint len = 0; for (; cdsl && len < CMPL_DIRECTORY_CACHE_SIZE; len += 1) cdsl = cdsl->next; if (cdsl) { cmpl_free_dir_sent_list (cdsl->next); cdsl->next = NULL; } cmpl_state->directory_storage = NULL; while (cdl) { if (cdl->data == cmpl_state->reference_dir) cmpl_state->directory_storage = g_list_prepend (NULL, cdl->data); else free_dir (cdl->data); cdl = cdl->next; } g_list_free (cdl0); } /**********************************************************************/ /* The main entrances. */ /**********************************************************************/ static PossibleCompletion * cmpl_completion_matches (gchar * text_to_complete, gchar ** remaining_text, CompletionState * cmpl_state) { gchar *first_slash; PossibleCompletion *poss; prune_memory_usage (cmpl_state); g_assert (text_to_complete != NULL); cmpl_state->user_completion_index = -1; cmpl_state->last_completion_text = text_to_complete; cmpl_state->the_completion.text[0] = 0; cmpl_state->last_valid_char = 0; cmpl_state->updated_text_len = -1; cmpl_state->updated_text[0] = 0; cmpl_state->re_complete = FALSE; first_slash = strchr (text_to_complete, '/'); if (text_to_complete[0] == '~' && !first_slash) { /* Text starts with ~ and there is no slash, show all the * home directory completions. */ poss = attempt_homedir_completion (text_to_complete, cmpl_state); update_cmpl (poss, cmpl_state); return poss; } cmpl_state->reference_dir = open_ref_dir (text_to_complete, remaining_text, cmpl_state); if (!cmpl_state->reference_dir) return NULL; cmpl_state->completion_dir = find_completion_dir (*remaining_text, remaining_text, cmpl_state); cmpl_state->last_valid_char = *remaining_text - text_to_complete; if (!cmpl_state->completion_dir) return NULL; cmpl_state->completion_dir->cmpl_index = -1; cmpl_state->completion_dir->cmpl_parent = NULL; cmpl_state->completion_dir->cmpl_text = *remaining_text; cmpl_state->active_completion_dir = cmpl_state->completion_dir; cmpl_state->reference_dir = cmpl_state->completion_dir; poss = attempt_file_completion (cmpl_state); update_cmpl (poss, cmpl_state); return poss; } static PossibleCompletion * cmpl_next_completion (CompletionState * cmpl_state) { PossibleCompletion *poss = NULL; cmpl_state->the_completion.text[0] = 0; if (cmpl_state->user_completion_index >= 0) poss = attempt_homedir_completion (cmpl_state->last_completion_text, cmpl_state); else poss = attempt_file_completion (cmpl_state); update_cmpl (poss, cmpl_state); return poss; } /**********************************************************************/ /* Directory Operations */ /**********************************************************************/ /* Open the directory where completion will begin from, if possible. */ static CompletionDir * open_ref_dir (gchar * text_to_complete, gchar ** remaining_text, CompletionState * cmpl_state) { gchar *first_slash; CompletionDir *new_dir; first_slash = strchr (text_to_complete, '/'); if (text_to_complete[0] == '~') { new_dir = open_user_dir (text_to_complete, cmpl_state); if (new_dir) { if (first_slash) *remaining_text = first_slash + 1; else *remaining_text = text_to_complete + strlen (text_to_complete); } else { return NULL; } } else if (text_to_complete[0] == '/' || !cmpl_state->reference_dir) { gchar *tmp = g_strdup (text_to_complete); gchar *p; p = tmp; while (*p && *p != '*' && *p != '?') p++; *p = '\0'; p = strrchr (tmp, '/'); if (p) { if (p == tmp) p++; *p = '\0'; new_dir = open_dir (tmp, cmpl_state); if (new_dir) *remaining_text = text_to_complete + ((p == tmp + 1) ? (p - tmp) : (p + 1 - tmp)); } else { /* If no possible candidates, use the cwd */ gchar *curdir = g_get_current_dir (); new_dir = open_dir (curdir, cmpl_state); if (new_dir) *remaining_text = text_to_complete; g_free (curdir); } g_free (tmp); } else { *remaining_text = text_to_complete; new_dir = open_dir (cmpl_state->reference_dir->fullname, cmpl_state); } if (new_dir) { new_dir->cmpl_index = -1; new_dir->cmpl_parent = NULL; } return new_dir; } /* open a directory by user name */ static CompletionDir * open_user_dir (gchar * text_to_complete, CompletionState * cmpl_state) { gchar *first_slash; gint cmp_len; g_assert (text_to_complete && text_to_complete[0] == '~'); first_slash = strchr (text_to_complete, '/'); if (first_slash) cmp_len = first_slash - text_to_complete - 1; else cmp_len = (gint)strlen (text_to_complete + 1); if (!cmp_len) { /* ~/ */ gchar *homedir = g_get_home_dir (); if (homedir) return open_dir (homedir, cmpl_state); else return NULL; } else { /* ~user/ */ char *copy = g_new (char, cmp_len + 1); struct passwd *pwd; strncpy (copy, text_to_complete + 1, (size_t)cmp_len); copy[cmp_len] = 0; pwd = getpwnam (copy); g_free (copy); if (!pwd) { cmpl_errno = errno; return NULL; } return open_dir (pwd->pw_dir, cmpl_state); } } /* open a directory relative the the current relative directory */ static CompletionDir * open_relative_dir (gchar * dir_name, CompletionDir * dir, CompletionState * cmpl_state) { gchar path_buf[2 * MAXPATHLEN]; if (dir->fullname_len + strlen (dir_name) + 2 >= MAXPATHLEN) { cmpl_errno = CMPL_ERRNO_TOO_LONG; return NULL; } strcpy (path_buf, dir->fullname); if (dir->fullname_len > 1) { path_buf[dir->fullname_len] = '/'; strcpy (path_buf + dir->fullname_len + 1, dir_name); } else { strcpy (path_buf + dir->fullname_len, dir_name); } return open_dir (path_buf, cmpl_state); } /* after the cache lookup fails, really open a new directory */ static CompletionDirSent * open_new_dir (gchar * dir_name, struct stat *sbuf, gboolean stat_subdirs) { CompletionDirSent *sent; DIR *directory; gchar *buffer_ptr; struct dirent *dirent_ptr; gint buffer_size = 0; gint entry_count = 0; gint i; struct stat ent_sbuf; char path_buf[MAXPATHLEN * 2]; gint path_buf_len; sent = g_new (CompletionDirSent, 1); sent->mtime = sbuf->st_mtime; sent->inode = sbuf->st_ino; sent->device = sbuf->st_dev; path_buf_len = (gint)strlen (dir_name); if (path_buf_len > (gint)MAXPATHLEN) { cmpl_errno = CMPL_ERRNO_TOO_LONG; return NULL; } strcpy (path_buf, dir_name); directory = opendir (dir_name); if (!directory) { cmpl_errno = errno; return NULL; } while ((dirent_ptr = readdir (directory)) != NULL) { int entry_len = (int)strlen (dirent_ptr->d_name); buffer_size += entry_len + 1; entry_count += 1; if (path_buf_len + entry_len + 2 >= (int)MAXPATHLEN) { cmpl_errno = CMPL_ERRNO_TOO_LONG; closedir (directory); return NULL; } } sent->name_buffer = g_new (gchar, buffer_size); sent->entries = g_new (CompletionDirEntry, entry_count); sent->entry_count = entry_count; buffer_ptr = sent->name_buffer; rewinddir (directory); for (i = 0; i < entry_count; i += 1) { dirent_ptr = readdir (directory); if (!dirent_ptr) { cmpl_errno = errno; closedir (directory); return NULL; } strcpy (buffer_ptr, dirent_ptr->d_name); sent->entries[i].entry_name = buffer_ptr; buffer_ptr += strlen (dirent_ptr->d_name); *buffer_ptr = 0; buffer_ptr += 1; path_buf[path_buf_len] = '/'; strcpy (path_buf + path_buf_len + 1, dirent_ptr->d_name); if (stat_subdirs) { if (stat (path_buf, &ent_sbuf) >= 0 && S_ISDIR (ent_sbuf.st_mode)) sent->entries[i].is_dir = 1; else /* stat may fail, and we don't mind, since it could be a * dangling symlink. */ sent->entries[i].is_dir = 0; } else sent->entries[i].is_dir = 1; } qsort (sent->entries, (size_t)sent->entry_count, sizeof (CompletionDirEntry), compare_cmpl_dir); closedir (directory); return sent; } static gboolean check_dir (gchar * dir_name, struct stat *result, gboolean * stat_subdirs) { /* A list of directories that we know only contain other directories. * Trying to stat every file in these directories would be very * expensive. */ static struct { gchar *name; gboolean present; struct stat statbuf; } /*@ignore@ splint does not like the incomplete initializer, but it is OK */ no_stat_dirs[] = { { "/afs", FALSE, { 0} } , { "/net", FALSE, { 0} } }; /*@end@ splint should resume checking here */ static const gint n_no_stat_dirs = (int) ( sizeof (no_stat_dirs) / sizeof (no_stat_dirs[0])); static gboolean initialized = FALSE; gint i; if (!initialized) { initialized = TRUE; for (i = 0; i < n_no_stat_dirs; i++) { if (stat (no_stat_dirs[i].name, &no_stat_dirs[i].statbuf) == 0) no_stat_dirs[i].present = TRUE; } } if (stat (dir_name, result) < 0) { cmpl_errno = errno; return FALSE; } *stat_subdirs = TRUE; for (i = 0; i < n_no_stat_dirs; i++) { if (no_stat_dirs[i].present && (no_stat_dirs[i].statbuf.st_dev == result->st_dev) && (no_stat_dirs[i].statbuf.st_ino == result->st_ino)) { *stat_subdirs = FALSE; break; } } return TRUE; } /* open a directory by absolute pathname */ static CompletionDir * open_dir (gchar * dir_name, CompletionState * cmpl_state) { struct stat sbuf; gboolean stat_subdirs; CompletionDirSent *sent; GList *cdsl; if (!check_dir (dir_name, &sbuf, &stat_subdirs)) return NULL; cdsl = cmpl_state->directory_sent_storage; while (cdsl) { sent = cdsl->data; if (sent->inode == sbuf.st_ino && sent->mtime == sbuf.st_mtime && sent->device == sbuf.st_dev) return attach_dir (sent, dir_name, cmpl_state); cdsl = cdsl->next; } sent = open_new_dir (dir_name, &sbuf, stat_subdirs); if (sent) { cmpl_state->directory_sent_storage = g_list_prepend (cmpl_state->directory_sent_storage, sent); return attach_dir (sent, dir_name, cmpl_state); } return NULL; } static CompletionDir * attach_dir (CompletionDirSent * sent, gchar * dir_name, CompletionState * cmpl_state) { CompletionDir *new_dir; new_dir = g_new (CompletionDir, 1); cmpl_state->directory_storage = g_list_prepend (cmpl_state->directory_storage, new_dir); new_dir->sent = sent; new_dir->fullname = g_strdup (dir_name); new_dir->fullname_len = (gint)strlen (dir_name); return new_dir; } static gint correct_dir_fullname (CompletionDir * cmpl_dir) { gint length = (gint)strlen (cmpl_dir->fullname); struct stat sbuf; if (strcmp (cmpl_dir->fullname + length - 2, "/.") == 0) { if (length == 2) { strcpy (cmpl_dir->fullname, "/"); cmpl_dir->fullname_len = 1; return TRUE; } else { cmpl_dir->fullname[length - 2] = 0; } } else if (strcmp (cmpl_dir->fullname + length - 3, "/./") == 0) cmpl_dir->fullname[length - 2] = 0; else if (strcmp (cmpl_dir->fullname + length - 3, "/..") == 0) { if (length == 3) { strcpy (cmpl_dir->fullname, "/"); cmpl_dir->fullname_len = 1; return TRUE; } if (stat (cmpl_dir->fullname, &sbuf) < 0) { cmpl_errno = errno; return FALSE; } cmpl_dir->fullname[length - 2] = 0; if (!correct_parent (cmpl_dir, &sbuf)) return FALSE; } else if (strcmp (cmpl_dir->fullname + length - 4, "/../") == 0) { if (length == 4) { strcpy (cmpl_dir->fullname, "/"); cmpl_dir->fullname_len = 1; return TRUE; } if (stat (cmpl_dir->fullname, &sbuf) < 0) { cmpl_errno = errno; return FALSE; } cmpl_dir->fullname[length - 3] = 0; if (!correct_parent (cmpl_dir, &sbuf)) return FALSE; } cmpl_dir->fullname_len = (gint)strlen (cmpl_dir->fullname); return TRUE; } static gint correct_parent (CompletionDir * cmpl_dir, struct stat *sbuf) { struct stat parbuf; gchar *last_slash; gchar *new_name; gchar c = 0; last_slash = strrchr (cmpl_dir->fullname, '/'); g_assert (last_slash); if (last_slash != cmpl_dir->fullname) { /* last_slash[0] = 0; */ } else { c = last_slash[1]; last_slash[1] = 0; } if (stat (cmpl_dir->fullname, &parbuf) < 0) { cmpl_errno = errno; return FALSE; } if (parbuf.st_ino == sbuf->st_ino && parbuf.st_dev == sbuf->st_dev) /* it wasn't a link */ return TRUE; if (c) last_slash[1] = c; /* else last_slash[0] = '/'; */ /* it was a link, have to figure it out the hard way */ new_name = find_parent_dir_fullname (cmpl_dir->fullname); if (!new_name) return FALSE; g_free (cmpl_dir->fullname); cmpl_dir->fullname = new_name; return TRUE; } static gchar * find_parent_dir_fullname (gchar * dirname) { gchar buffer[MAXPATHLEN]; gchar buffer2[MAXPATHLEN]; #if defined(sun) && !defined(__SVR4) if (!getwd (buffer)) #else if (!getcwd (buffer, MAXPATHLEN)) #endif { cmpl_errno = errno; return NULL; } if (chdir (dirname) != 0 || chdir ("..") != 0) { cmpl_errno = errno; return NULL; } #if defined(sun) && !defined(__SVR4) if (!getwd (buffer2)) #else if (!getcwd (buffer2, MAXPATHLEN)) #endif { chdir (buffer); cmpl_errno = errno; return NULL; } if (chdir (buffer) != 0) { cmpl_errno = errno; return NULL; } return g_strdup (buffer2); } /**********************************************************************/ /* Completion Operations */ /**********************************************************************/ static PossibleCompletion * attempt_homedir_completion (gchar * text_to_complete, CompletionState * cmpl_state) { gint index, length; if (!cmpl_state->user_dir_name_buffer && !get_pwdb (cmpl_state)) return NULL; length = (gint) (strlen (text_to_complete) - 1); cmpl_state->user_completion_index += 1; while (cmpl_state->user_completion_index < cmpl_state->user_directories_len) { index = first_diff_index (text_to_complete + 1, cmpl_state->user_directories [cmpl_state->user_completion_index].login); switch (index) { case PATTERN_MATCH: break; default: if (cmpl_state->last_valid_char < (index + 1)) cmpl_state->last_valid_char = index + 1; cmpl_state->user_completion_index += 1; continue; } cmpl_state->the_completion.is_a_completion = 1; cmpl_state->the_completion.is_directory = 1; (void)append_completion_text ("~", cmpl_state); (void)append_completion_text (cmpl_state->user_directories [cmpl_state->user_completion_index].login, cmpl_state); return append_completion_text ("/", cmpl_state); } if (text_to_complete[1] || cmpl_state->user_completion_index > cmpl_state->user_directories_len) { cmpl_state->user_completion_index = -1; return NULL; } else { cmpl_state->user_completion_index += 1; cmpl_state->the_completion.is_a_completion = 1; cmpl_state->the_completion.is_directory = 1; return append_completion_text ("~/", cmpl_state); } } /* returns the index (>= 0) of the first differing character, * PATTERN_MATCH if the completion matches */ static gint first_diff_index (gchar * pat, gchar * text) { gint diff = 0; while (*pat && *text && *text == *pat) { pat += 1; text += 1; diff += 1; } if (*pat) return diff; return PATTERN_MATCH; } static PossibleCompletion * append_completion_text (gchar * text, CompletionState * cmpl_state) { gint len, i = 1; if (!cmpl_state->the_completion.text) return NULL; len = (int) (strlen (text) + strlen (cmpl_state->the_completion.text) + 1); if (cmpl_state->the_completion.text_alloc > len) { strcat (cmpl_state->the_completion.text, text); return &cmpl_state->the_completion; } while (i < len) { i <<= 1; } cmpl_state->the_completion.text_alloc = i; cmpl_state->the_completion.text = (gchar *) g_realloc (cmpl_state->the_completion.text, (gulong)i); if (!cmpl_state->the_completion.text) return NULL; else { strcat (cmpl_state->the_completion.text, text); return &cmpl_state->the_completion; } } static CompletionDir * find_completion_dir (gchar * text_to_complete, gchar ** remaining_text, CompletionState * cmpl_state) { gchar *first_slash = strchr (text_to_complete, '/'); CompletionDir *dir = cmpl_state->reference_dir; CompletionDir *next; *remaining_text = text_to_complete; while (first_slash) { gint len = first_slash - *remaining_text; gint found = 0; gchar *found_name = NULL; /* Quiet gcc */ gint i; gchar *pat_buf = g_new (gchar, len + 1); strncpy (pat_buf, *remaining_text, (size_t)len); pat_buf[len] = 0; for (i = 0; i < dir->sent->entry_count; i += 1) { if (dir->sent->entries[i].is_dir && fnmatch (pat_buf, dir->sent->entries[i].entry_name, FNMATCH_FLAGS) != FNM_NOMATCH) { if (found) { g_free (pat_buf); return dir; } else { found = 1; found_name = dir->sent->entries[i].entry_name; } } } if (!found) { /* Perhaps we are trying to open an automount directory */ found_name = pat_buf; } next = open_relative_dir (found_name, dir, cmpl_state); if (!next) { g_free (pat_buf); return NULL; } next->cmpl_parent = dir; dir = next; if (!correct_dir_fullname (dir)) { g_free (pat_buf); return NULL; } *remaining_text = first_slash + 1; first_slash = strchr (*remaining_text, '/'); g_free (pat_buf); } return dir; } static void update_cmpl (PossibleCompletion * poss, CompletionState * cmpl_state) { gint cmpl_len; if (!poss || !cmpl_is_a_completion (poss)) return; cmpl_len = (gint)strlen (cmpl_this_completion (poss)); if (cmpl_state->updated_text_alloc < cmpl_len + 1) { cmpl_state->updated_text = (gchar *) g_realloc (cmpl_state->updated_text, (gulong)cmpl_state->updated_text_alloc); cmpl_state->updated_text_alloc = 2 * cmpl_len; } if (cmpl_state->updated_text_len < 0) { strcpy (cmpl_state->updated_text, cmpl_this_completion (poss)); cmpl_state->updated_text_len = cmpl_len; cmpl_state->re_complete = cmpl_is_directory (poss); } else if (cmpl_state->updated_text_len == 0) { cmpl_state->re_complete = FALSE; } else { gint first_diff = first_diff_index (cmpl_state->updated_text, cmpl_this_completion (poss)); cmpl_state->re_complete = FALSE; if (first_diff == PATTERN_MATCH) return; if (first_diff > cmpl_state->updated_text_len) strcpy (cmpl_state->updated_text, cmpl_this_completion (poss)); cmpl_state->updated_text_len = first_diff; cmpl_state->updated_text[first_diff] = 0; } } static PossibleCompletion * attempt_file_completion (CompletionState * cmpl_state) { gchar *pat_buf, *first_slash; CompletionDir *dir = cmpl_state->active_completion_dir; dir->cmpl_index += 1; if (dir->cmpl_index == dir->sent->entry_count) { if (dir->cmpl_parent == NULL) { cmpl_state->active_completion_dir = NULL; return NULL; } else { cmpl_state->active_completion_dir = dir->cmpl_parent; return attempt_file_completion (cmpl_state); } } g_assert (dir->cmpl_text); first_slash = strchr (dir->cmpl_text, '/'); if (first_slash) { gint len = first_slash - dir->cmpl_text; pat_buf = g_new (gchar, len + 1); strncpy (pat_buf, dir->cmpl_text, (size_t)len); pat_buf[len] = 0; } else { gint len = (gint)strlen (dir->cmpl_text); pat_buf = g_new (gchar, len + 2); strcpy (pat_buf, dir->cmpl_text); strcpy (pat_buf + len, "*"); } if (first_slash) { if (dir->sent->entries[dir->cmpl_index].is_dir) { if (fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, FNMATCH_FLAGS) != FNM_NOMATCH) { CompletionDir *new_dir; new_dir = open_relative_dir (dir->sent->entries[dir->cmpl_index]. entry_name, dir, cmpl_state); if (!new_dir) { g_free (pat_buf); return NULL; } new_dir->cmpl_parent = dir; new_dir->cmpl_index = -1; new_dir->cmpl_text = first_slash + 1; cmpl_state->active_completion_dir = new_dir; g_free (pat_buf); return attempt_file_completion (cmpl_state); } else { g_free (pat_buf); return attempt_file_completion (cmpl_state); } } else { g_free (pat_buf); return attempt_file_completion (cmpl_state); } } else { if (dir->cmpl_parent != NULL) { (void)append_completion_text (dir->fullname + strlen (cmpl_state->completion_dir-> fullname) + 1, cmpl_state); (void)append_completion_text ("/", cmpl_state); } (void)append_completion_text (dir->sent->entries[dir->cmpl_index].entry_name, cmpl_state); cmpl_state->the_completion.is_a_completion = (fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, FNMATCH_FLAGS) != FNM_NOMATCH); cmpl_state->the_completion.is_directory = dir->sent->entries[dir->cmpl_index].is_dir; if (dir->sent->entries[dir->cmpl_index].is_dir) (void)append_completion_text ("/", cmpl_state); g_free (pat_buf); return &cmpl_state->the_completion; } } static gint get_pwdb (CompletionState * cmpl_state) { struct passwd *pwd_ptr; gchar *buf_ptr; gint len = 0, i, count = 0; if (cmpl_state->user_dir_name_buffer) return TRUE; /*@i@*/ setpwent (); /*@i@*/ while ((pwd_ptr = getpwent ()) != NULL) { len += strlen (pwd_ptr->pw_name); len += strlen (pwd_ptr->pw_dir); len += 2; count += 1; } /*@i@*/ setpwent (); cmpl_state->user_dir_name_buffer = g_new (gchar, len); cmpl_state->user_directories = g_new (CompletionUserDir, count); cmpl_state->user_directories_len = count; buf_ptr = cmpl_state->user_dir_name_buffer; for (i = 0; i < count; i += 1) { pwd_ptr = getpwent (); if (!pwd_ptr) { cmpl_errno = errno; goto error; } strcpy (buf_ptr, pwd_ptr->pw_name); cmpl_state->user_directories[i].login = buf_ptr; buf_ptr += strlen (buf_ptr); buf_ptr += 1; strcpy (buf_ptr, pwd_ptr->pw_dir); cmpl_state->user_directories[i].homedir = buf_ptr; buf_ptr += strlen (buf_ptr); buf_ptr += 1; } qsort (cmpl_state->user_directories, (size_t)cmpl_state->user_directories_len, sizeof (CompletionUserDir), compare_user_dir); /*@i@*/ endpwent (); return TRUE; error: if (cmpl_state->user_dir_name_buffer) g_free (cmpl_state->user_dir_name_buffer); if (cmpl_state->user_directories) g_free (cmpl_state->user_directories); cmpl_state->user_dir_name_buffer = NULL; cmpl_state->user_directories = NULL; return FALSE; } static gint compare_user_dir (const void *a, const void *b) { return strcmp ((((CompletionUserDir *) a))->login, (((CompletionUserDir *) b))->login); } static gint compare_cmpl_dir (const void *a, const void *b) { return strcmp ((((CompletionDirEntry *) a))->entry_name, (((CompletionDirEntry *) b))->entry_name); } static gint cmpl_state_okay (CompletionState * cmpl_state) { return cmpl_state && cmpl_state->reference_dir; } static gchar * cmpl_strerror (gint err) { if (err == CMPL_ERRNO_TOO_LONG) return "Name too long"; else return g_strerror (err); } /* Testing area */ #ifdef TORRIE_DEBUG /* Get the selected filename and print it to the console */ void file_ok_sel (GtkWidget * w, GtkFileSelection * fs) { g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); } void destroy (GtkWidget * widget, gpointer data) { gtk_main_quit (); } int main (int argc, char *argv[]) { GtkWidget *filew; gtk_init (&argc, &argv); /* Create a new file selection widget */ filew = gtk_file_selection_new ("Michael's Glorious File Selector"); // gtk_file_selection_complete(GTK_FILE_SELECTION(filew),"bob"); (void)gtk_signal_connect (GTK_OBJECT (filew), "destroy", (GtkSignalFunc) destroy, &filew); /* Connect the ok_button to file_ok_sel function */ (void)gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), "clicked", (GtkSignalFunc) file_ok_sel, filew); /* Connect the cancel_button to destroy the widget */ (void)gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), "clicked", (GtkSignalFunc) gtk_widget_destroy, GTK_OBJECT (filew)); gtk_widget_show (filew); /* g_print("%d",gtk_file_selection_match_mask("mask.c","m*.c")); g_print("%d",gtk_file_selection_match_mask("mask.c","m???.c")); g_print("%d",gtk_file_selection_match_mask("mask.c","m??*.c")); g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c")); g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c???")); g_print("%d",gtk_file_selection_match_mask("mask.cout","m*.c*")); g_print("%d",gtk_file_selection_match_mask("mask.cout","n*.c???")); g_print("%d",gtk_file_selection_match_mask("mask.c","[mn]*")); g_print("%d",gtk_file_selection_match_mask("COPYING","*.xpm")); */ gtk_main (); return 0; } /* example-end */ #endif chemtool-1.6.14/graph.c0000644000175000001440000017377411675152270014124 0ustar martinusers/* * functions for the graphic output of the pixmap */ #include #include "ct1.h" #ifdef GTK2 PangoFontDescription *font[7], *smallfont[7], *symbfont[7], *ssymbfont[7], *slfont[7], *boldfont[7], *textfont[7]; #else GdkFont *font[7], *smallfont[7], *symbfont[7], *ssymbfont[7], *slfont[7], *boldfont[7], *textfont[7]; #endif #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef MAX #define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif void CreatePix () /* initializes fonts, linestyles and factors */ { float ztab[] = { 0.4, 0.6, 0.8, 1, 1.2 }; int ltab[] = { 0, 0, 2, 2, 2 }; /* int ftab[] = { 2, 3, 4, 5, 6 };*/ size_factor = ztab[zoom_factor]; if (bondlen_mm != 0 && bondlen_mm != 10.668) size_factor *= bondlen_mm/10.668; head.pix_width = 1600; head.pix_height = 1600; Set_Line (ltab[zoom_factor]); } void FreePix () /* erases the drawing area */ { GdkRectangle update_rect; int i; gdk_draw_rectangle (picture, background_gc, TRUE, 0, 0, (gint)drawing_area->allocation.width, (gint)drawing_area->allocation.height); if (gridtype==1) { for (i=0+gridx;i<=(int)drawing_area->allocation.width;i=i+50) gdk_draw_line (picture, drawing_area->style->bg_gc[GTK_STATE_INSENSITIVE], (gint) (i * size_factor), (gint) (0), (gint) (i * size_factor), (gint) (drawing_area->allocation.height)); for (i=0+gridy;i<=(int)drawing_area->allocation.height;i=i+50) gdk_draw_line (picture, drawing_area->style->bg_gc[GTK_STATE_INSENSITIVE], (gint) (0), (gint) (i*size_factor), (gint) (drawing_area->allocation.width), (gint) (i * size_factor)); } if (gridtype==2){ for (i=-2560+gridx;i<=5280;i=i+64){ gdk_draw_line (picture, drawing_area->style->bg_gc[GTK_STATE_INSENSITIVE], (gint) (0+gridx), (gint) ((gridy+i)*size_factor), (gint) (5500+gridx)*size_factor, (gint) (3200+gridy+i) * size_factor); gdk_draw_line (picture, drawing_area->style->bg_gc[GTK_STATE_INSENSITIVE], (gint) (0+gridx), (gint) ((i+gridy)*size_factor), (gint) (5500+gridx)*size_factor, (gint) (-3200+gridy+i) * size_factor); } } update_rect.x = 0; update_rect.y = 0; update_rect.width = drawing_area->allocation.width; update_rect.height = drawing_area->allocation.height; gtk_widget_draw ((GtkWidget *) drawing_area, &update_rect); } void CopyPlane () /* updates the display with the contents of the background pixmap */ { GdkRectangle update_rect; gdk_draw_pixmap (drawing_area->window, drawing_area->style-> fg_gc[GTK_WIDGET_STATE (drawing_area)], picture, 0, 0, 0, 0, head.pix_width, head.pix_height); update_rect.x = 0; update_rect.y = 0; update_rect.width = (guint16)head.pix_width; update_rect.height = (guint16)head.pix_height; } void Display_Mol () /* calls the individual bond and text drawing functions to display the picture */ { struct data *hpc; struct dc *hpc_c; struct spline *hpc_sp; int d,i; char *c; struct xy_co *coord; int tmpx1,tmpx2,tmpy1,tmpy2,tmptx1,tmptx2,tmpty1,tmpty2; GdkRectangle update_rect; if (head.pix_width == 0 || head.pix_height == 0) return; gdk_draw_rectangle (picture, background_gc, TRUE, 0, 0, head.pix_width, head.pix_height); if (gridtype==1) { for (i=0+gridx;i<=head.pix_width;i=i+64) gdk_draw_line (picture,drawing_area->style->bg_gc[GTK_STATE_INSENSITIVE], (gint) (i * size_factor), (gint) (0), (gint) (i * size_factor), (gint) (head.pix_height)); for (i=0+gridy;i<=head.pix_height;i=i+64) gdk_draw_line (picture, drawing_area->style->bg_gc[GTK_STATE_INSENSITIVE], (gint) (0), (gint) (i*size_factor), (gint) (head.pix_width), (gint) (i * size_factor)); } if (gridtype==2){ for (i=-2560+gridx;i<=6400;i=i+64){ gdk_draw_line (picture, drawing_area->style->bg_gc[GTK_STATE_INSENSITIVE], (gint) (0+gridx), (gint) ((gridy+i)*size_factor), (gint) (5500+gridx)*size_factor, (gint) (3200+gridy+i) * size_factor); gdk_draw_line (picture, drawing_area->style->bg_gc[GTK_STATE_INSENSITIVE], (gint) (0+gridx), (gint) ((i+gridy)*size_factor), (gint) (5500+gridx)*size_factor, (gint) (-3200+gridy+i) * size_factor); } } hpc = da_root.next; if (!hpc) fprintf (stderr, "Help - somebody ate my atoms (hp->n=%d, da_root.next NULL)!!!\n", hp->n); for (d = 0; d < hp->n; d++) { int x=hpc->x; int y=hpc->y; int tx=hpc->tx; int ty=hpc->ty; #if 1 //constant clipping factor works better than original 4*size_factor if ( !use_whiteout) { int siz,strl; int j; i=has_label(hpc->x,hpc->y); if (i>=0) { hpc_c = dac_root.next; for (j = 0; j < i; j++)hpc_c=hpc_c->next; siz=hpc_c->size; // font size if (y-ty==0&& hpc_c->direct ==0) { // horizontal bond, left justified label strl=0; for (i=0;i<(int)strlen(hpc_c->c);i++) { // count regular characters in label if(hpc_c->c[i] != '_' && hpc_c->c[i] != '^' && hpc_c->c[i] != '{' && hpc_c->c[i] != '{') strl++; } if (tx>x) { x+=(strl-1)*3.2*(siz+1); // move bond endpoint off label if (hpc_c->c[strlen(hpc_c->c)-1]=='H') x+=5; if (hpc_c->c[strlen(hpc_c->c)-2]=='_') x-=1.6*(siz+1); // adjust for trailing subscripts if (hpc_c->c[strlen(hpc_c->c)-1]=='}') x-=4.8*(siz+1); } else { } } int ox=x; x += (3.2*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); y += (3.2*(siz+1)/calc_vector(abs(tx-ox),abs(ty-y))) *(ty-y); } i=has_label(hpc->tx,hpc->ty); if (i>=0) { hpc_c = dac_root.next; for (j = 0; j < i; j++)hpc_c=hpc_c->next; siz=hpc_c->size; if (y-ty==0 ){ strl=0; for (i=0;i<(int)strlen(hpc_c->c);i++) { if(hpc_c->c[i] != '_' && hpc_c->c[i] != '^' && hpc_c->c[i] != '{' && hpc_c->c[i] != '{') strl++; } if ( hpc_c->direct<-1) { if (tx>x) tx-=(strlen(hpc_c->c)-1)*3.2*(siz+1); //QUAK else //QUAK tx+=(strlen(hpc_c->c)-1)*3.2*(siz+1); } else if ( hpc_c->direct==0 && txc[strlen(hpc_c->c)-2]=='_') tx-=1.6*(siz+1); if (hpc_c->c[strlen(hpc_c->c)-1]=='}') tx-=4.8*(siz+1); } } int otx=tx; tx -= (3.2*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); ty -= (3.2*(siz+1)/calc_vector(abs(otx-x),abs(ty-y))) *(ty-y); } } #endif switch (hpc->bond) { case 0: Drawline (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); /*single */ break; case 1: { /*leftdouble */ coord = multi_bonds (x, y, tx, ty, mb_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); Drawline (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); } break; case 2: { /*rightdouble */ coord = multi_bonds (tx, ty, x, y, mb_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); Drawline (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); } break; case 5: DrawWedge (x, y, tx, ty, hpc->smarked + hpc->tmarked, hpc->color); break; case 6: DrawDashedWedge (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); break; case 7: DrawWiggly (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); break; case 8: DrawArrow (x, y, tx, ty, 1, hpc->smarked + hpc->tmarked,hpc->color); break; case 9: DrawArrow (x, y, tx, ty, 2, hpc->smarked + hpc->tmarked,hpc->color); break; case 10: DrawWide (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); break; case 11: DrawCircle (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); break; case 12: DrawDotted (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); break; case 13: /* "crossing" bonds are drawn in their own loop later, to make sure they end up on top */ break; case 4: { /*middouble */ coord = center_double_bond (x, y, tx, ty, db_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); coord++; Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); } break; case 3: { /*triple */ coord = multi_bonds (x, y, tx, ty, mb_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); Drawline (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); coord = multi_bonds (tx, ty, x, y, mb_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); Drawline (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); } break; case 14: { /*left partial double */ coord = multi_bonds (x, y, tx, ty, mb_dist); DrawDashed (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); Drawline (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); } break; case 15: { /*right partial double */ coord = multi_bonds (tx, ty, x, y, mb_dist); DrawDashed (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); Drawline (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); } break; case 16: /*zebra dashed single bond */ DrawStripe (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); break; case 18: { /*triple, equal lengths */ coord = center_double_bond (x, y, tx, ty, 2*db_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); coord++; Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); Drawline (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); /*single */ } break; case 19: { /*quadruple */ coord = center_double_bond (x, y, tx, ty, db_dist+3); tmpx1=coord->x; tmpy1=coord->y; tmptx1=coord->tx; tmpty1=coord->ty; coord++; tmpx2=coord->x; tmpy2=coord->y; tmptx2=coord->tx; tmpty2=coord->ty; coord = center_double_bond (tmpx1, tmpy1, tmptx1, tmpty1, db_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); coord++; Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); coord = center_double_bond (tmpx2, tmpy2,tmptx2, tmpty2, db_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); coord++; Drawline (coord->x, coord->y, coord->tx, coord->ty, hpc->smarked + hpc->tmarked,hpc->color); } break; } hpc = hpc->next; if (!hpc) { fprintf (stderr, "Help - somebody ate my atoms (d=%d,hp->n=%d)!!!\n", d, hp->n); hp->n = d; continue; } } /* second loop - only for drawing "crossing" bonds (type 13) */ hpc = da_root.next; for (d = 0; d < hp->n; d++) { int x=hpc->x; int y=hpc->y; int tx=hpc->tx; int ty=hpc->ty; #if 1 //constant clipping factor works better than original 4*size_factor if ( !use_whiteout) { int siz,strl; int j; i=has_label(hpc->x,hpc->y); if (i>=0) { hpc_c = dac_root.next; for (j = 0; j < i; j++)hpc_c=hpc_c->next; siz=hpc_c->size; // font size if (y-ty==0&& hpc_c->direct ==0) { // horizontal bond, left justified label strl=0; for (i=0;i<(int)strlen(hpc_c->c);i++) { // count regular characters in label if(hpc_c->c[i] != '_' && hpc_c->c[i] != '^' && hpc_c->c[i] != '{' && hpc_c->c[i] != '{') strl++; } if (tx>x) { x+=(strl-1)*3.2*(siz+1); // move bond endpoint off label if (hpc_c->c[strlen(hpc_c->c)-1]=='H') x+=5; if (hpc_c->c[strlen(hpc_c->c)-2]=='_') x-=1.6*(siz+1); // adjust for trailing subscripts if (hpc_c->c[strlen(hpc_c->c)-1]=='}') x-=4.8*(siz+1); } else { } } int ox=x; x += (3.2*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); y += (3.2*(siz+1)/calc_vector(abs(tx-ox),abs(ty-y))) *(ty-y); } i=has_label(hpc->tx,hpc->ty); if (i>=0) { hpc_c = dac_root.next; for (j = 0; j < i; j++)hpc_c=hpc_c->next; siz=hpc_c->size; if (y-ty==0 ){ strl=0; for (i=0;i<(int)strlen(hpc_c->c);i++) { if(hpc_c->c[i] != '_' && hpc_c->c[i] != '^' && hpc_c->c[i] != '{' && hpc_c->c[i] != '{') strl++; } if ( hpc_c->direct<-1) { if (tx>x) tx-=(strlen(hpc_c->c)-1)*3.2*(siz+1); //QUAK else //QUAK tx+=(strlen(hpc_c->c)-1)*3.2*(siz+1); } else if ( hpc_c->direct==0 && txc[strlen(hpc_c->c)-2]=='_') tx-=1.6*(siz+1); if (hpc_c->c[strlen(hpc_c->c)-1]=='}') tx-=4.8*(siz+1); } } int otx=tx; tx -= (3.2*(siz+1)/calc_vector(abs(tx-x),abs(ty-y))) *(tx-x); ty -= (3.2*(siz+1)/calc_vector(abs(otx-x),abs(ty-y))) *(ty-y); } } #endif if (hpc->bond==13) DrawAcross (x, y, tx, ty, hpc->smarked + hpc->tmarked,hpc->color); hpc = hpc->next; } /* */ hpc_c = dac_root.next; for (d = 0; d < hp->nc; d++) { c = hpc_c->c; Drawstring (hpc_c->x, hpc_c->y, c, hpc_c->direct, hpc_c->marked, hpc_c->color,hpc_c->font,hpc_c->size,0); hpc_c = hpc_c->next; } hpc_sp = sp_root.next; for (d = 0; d < hp->nsp; d++) { Drawspline (hpc_sp->x0, hpc_sp->y0, hpc_sp->x1, hpc_sp->y1, hpc_sp->x2, hpc_sp->y2, hpc_sp->x3, hpc_sp->y3, hpc_sp->type, hpc_sp->marked,hpc_sp->color); hpc_sp = hpc_sp->next; } if (drawmode == 4 && addflag==1 && !xbmflag) { gdk_draw_rectangle (picture, mygc[2], TRUE, refx * size_factor - 1, refy * size_factor - 1, 3, 3); } gdk_draw_pixmap (drawing_area->window, drawing_area->style-> fg_gc[GTK_WIDGET_STATE (drawing_area)], picture, 0, 0, 0, 0, head.pix_width, head.pix_height); update_rect.x = 0; update_rect.y = 0; update_rect.width = (guint16)head.pix_width; update_rect.height = (guint16)head.pix_height; gtk_widget_draw ((GtkWidget *) drawing_area, &update_rect); } void draw_preview_bonds (x, y, tx, ty, b) /* calls the individual bond functions to create the preview image */ int x, y, tx, ty, b; { struct xy_co *coord; switch (b) { case 0: Drawline (x, y, tx, ty, 0, 0); /*single */ break; case 1: { /*leftdouble */ coord = multi_bonds (x, y, tx, ty, mb_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, 0,0); Drawline (x, y, tx, ty, 0, 0); } break; case 2: { /*rightdouble */ coord = multi_bonds (tx, ty, x, y, mb_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, 0,0); Drawline (x, y, tx, ty, 0,0); } break; case 5: DrawWedge (x, y, tx, ty, 0, 0); break; case 6: DrawDashedWedge (x, y, tx, ty, 0, 0); break; case 7: DrawWiggly (x, y, tx, ty, 0, 0); break; case 8: DrawArrow (x, y, tx, ty, 1, 0, 0); break; case 9: DrawArrow (x, y, tx, ty, 2, 0, 0); break; case 10: DrawWide (x, y, tx, ty, 0, 0); break; case 11: DrawCircle (x, y, tx, ty, 0, 0); break; case 12: DrawDotted (x, y, tx, ty, 0, 0); break; case 13: DrawAcross (x, y, tx, ty, 0, 0); break; case 4: { /*middouble */ coord = center_double_bond (x, y, tx, ty, db_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, 0, 0); coord++; Drawline (coord->x, coord->y, coord->tx, coord->ty, 0, 0); } break; case 3: { /*triple */ coord = multi_bonds (x, y, tx, ty, mb_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, 0, 0); Drawline (x, y, tx, ty, 0, 0); coord = multi_bonds (tx, ty, x, y, mb_dist); Drawline (coord->x, coord->y, coord->tx, coord->ty, 0, 0); Drawline (x, y, tx, ty, 0, 0); } break; case 14: { /*left partial double */ coord = multi_bonds (x, y, tx, ty, mb_dist); DrawDashed (coord->x, coord->y, coord->tx, coord->ty, 0, 0); Drawline (x, y, tx, ty, 0, 0); } break; case 15: { /*right partial double */ coord = multi_bonds (tx, ty, x, y, mb_dist); DrawDashed (coord->x, coord->y, coord->tx, coord->ty, 0, 0); Drawline (x, y, tx, ty, 0, 0); } break; case 16: /*zebra dashed single bond */ DrawStripe (x, y, tx, ty, 0, 0); break; } } void Drawline (int x, int y, int tx, int ty, int active, int color) /* draws a single bond */ { if ( xbmflag) gdk_draw_line (picture, drawing_area->style->black_gc, (gint) (x * size_factor), (gint) (y * size_factor), (gint) (tx * size_factor), (gint) (ty * size_factor)); else if (active) gdk_draw_line (picture, hlgc, (gint) (x * size_factor), (gint) (y * size_factor), (gint) (tx * size_factor), (gint) (ty * size_factor)); else gdk_draw_line (picture, mygc[color], (gint) (x * size_factor), (gint) (y * size_factor), (gint) (tx * size_factor), (gint) (ty * size_factor)); } void DrawAcross (int x, int y, int tx, int ty, int active,int color) /* draws a single bond on a white background */ { gint npoints = 4; GdkPoint mypoints[4]; struct xy_co *coord; GdkGC *thegc; thegc = background_gc; coord = center_double_bond (x, y, tx, ty, 6); mypoints[0].x = (coord->x + (coord->tx - coord->x) / 8) * size_factor; mypoints[0].y = (coord->y + (coord->ty - coord->y) / 8) * size_factor; mypoints[1].x = (coord->tx - (coord->tx - coord->x) / 8) * size_factor; mypoints[1].y = (coord->ty - (coord->ty - coord->y) / 8) * size_factor; coord++; mypoints[2].x = (coord->tx - (coord->tx - coord->x) / 8) * size_factor; mypoints[2].y = (coord->ty - (coord->ty - coord->y) / 8) * size_factor; mypoints[3].x = (coord->x + (coord->tx - coord->x) / 8) * size_factor; mypoints[3].y = (coord->y + (coord->ty - coord->y) / 8) * size_factor; gdk_draw_polygon (picture, thegc, TRUE, (GdkPoint *) mypoints, (gint) npoints); if (xbmflag) thegc=drawing_area->style->black_gc; else if (active) thegc=hlgc; else thegc=mygc[color]; gdk_draw_line (picture, thegc, (gint) (x * size_factor), (gint) (y * size_factor), (gint) (tx * size_factor), (gint) (ty * size_factor)); } void DrawDashed (int x, int y, int tx, int ty, int active,int color) /* draws a dashed bond */ { GdkGC *thegc; GdkSegment mypoints[6]; int xlen, ylen, i; gint nsegments = 6; xlen = tx - x; ylen = ty - y; for (i = 0; i < nsegments; i++) { mypoints[i].x1 = (gint16) ((x + 2 * i * 0.09 * xlen) * size_factor); mypoints[i].y1 = (gint16) ((y + 2 * i * 0.09 * ylen) * size_factor); mypoints[i].x2 = (gint16) ((x + (2 * i + 1) * 0.09 * xlen) * size_factor); mypoints[i].y2 = (gint16) ((y + (2 * i + 1) * 0.09 * ylen) * size_factor); } if (xbmflag) thegc= drawing_area->style->black_gc; else if (active) thegc=hlgc; else thegc=mygc[color]; gdk_draw_segments (picture, thegc, (GdkSegment *) mypoints, (gint) nsegments); } void DrawDotted (int x, int y, int tx, int ty, int active, int color) /* draws a dotted bond */ { GdkGC *thegc; GdkPoint mypoints[100]; int xlen, ylen, i; gint npoints ; int len; float step; xlen = tx - x; ylen = ty - y; len=(int) rint(calc_vector(abs(xlen),abs(ylen))/6.3); step = 1./len; npoints=len; if (npoints>99)npoints=99; for (i = 0; i < npoints; i++) { mypoints[i].x = (gint16) ((x + i * step * xlen) * size_factor); mypoints[i].y = (gint16) ((y + i * step * ylen) * size_factor); } if (xbmflag) thegc= drawing_area->style->black_gc; else if (active) thegc=hlgc; else thegc=mygc[color]; gdk_draw_points (picture, thegc, (GdkPoint *) mypoints, (gint) npoints); } void DrawWide (int x, int y, int tx, int ty, int active,int color) /* draws a wide single bond */ { gint npoints = 4; GdkPoint mypoints[4]; struct xy_co *coord; GdkGC *thegc; if (xbmflag) thegc = drawing_area->style->black_gc; else if (active) thegc = hlgc; else thegc=mygc[color]; coord = center_double_bond (x, y, tx, ty, 6); mypoints[0].x = (gint16) (coord->x * size_factor); mypoints[0].y = (gint16) (coord->y * size_factor); mypoints[1].x = (gint16) (coord->tx * size_factor); mypoints[1].y = (gint16) (coord->ty * size_factor); coord++; mypoints[2].x = (gint16) (coord->tx * size_factor); mypoints[2].y = (gint16) (coord->ty * size_factor); mypoints[3].x = (gint16) (coord->x * size_factor); mypoints[3].y = (gint16) (coord->y * size_factor); gdk_draw_polygon (picture, thegc, TRUE, (GdkPoint *) mypoints, (gint) npoints); } void DrawStripe (int x, int y, int tx, int ty, int active, int color) /* draws a striped single bond */ { int i; GdkPoint mypoints[4]; struct xy_co *coord; GdkGC *thegc; if (xbmflag) thegc = drawing_area->style->black_gc; else if (active) thegc = hlgc; else thegc=mygc[color]; coord = center_double_bond (x, y, tx, ty, 4); mypoints[0].x = (gint16) (coord->x * size_factor); mypoints[0].y = (gint16) (coord->y * size_factor); mypoints[1].x = (gint16) (coord->tx * size_factor); mypoints[1].y = (gint16) (coord->ty * size_factor); coord++; mypoints[2].x = (gint16) (coord->x * size_factor); mypoints[2].y = (gint16) (coord->y * size_factor); mypoints[3].x = (gint16) (coord->tx * size_factor); mypoints[3].y = (gint16) (coord->ty * size_factor); for (i = 0; i < 10; i++) { gdk_draw_line (picture, thegc, mypoints[0].x + i * (mypoints[1].x - mypoints[0].x) / 10, mypoints[0].y + i * (mypoints[1].y - mypoints[0].y) / 10, mypoints[2].x + i * (mypoints[3].x - mypoints[2].x) / 10, mypoints[2].y + i * (mypoints[3].y - mypoints[2].y) / 10); } } void DrawCircle (int x, int y, int tx, int ty, int active,int color) /* draws a circle of radius (tx/ty)-(x/y) around (x/y) */ { GdkGC *thegc; int topleftx, toplefty; int radius; if (xbmflag) thegc = drawing_area->style->black_gc; else if (active ) thegc = hlgc; else thegc=mygc[color]; radius = calc_vector (abs (tx - x), abs (ty - y)) * size_factor; topleftx = x * size_factor - radius; toplefty = y * size_factor - radius; gdk_draw_arc (picture, thegc, FALSE, topleftx, toplefty, 2 * radius, 2 * radius, 0, 360 * 64); if (drawmode == 3 && !xbmflag) { thegc = hlgc; gdk_draw_rectangle (picture, thegc, TRUE, x * size_factor - 1, y * size_factor - 1, 3, 3); gdk_draw_rectangle (picture, thegc, TRUE, tx * size_factor - 1, ty * size_factor - 1, 3, 3); } } void DrawWiggly (int x, int y, int tx, int ty, int active, int color) /* draws a wavy line */ { gint ax, ay, width, height, angle1, angle2; int narcs, veclen, boxlen; int i, xlen, ylen, ang; int boxcorx, boxcory; GdkGC *thegc; if (xbmflag) thegc = drawing_area->style->black_gc; else if (active) thegc = hlgc; else thegc=mygc[color]; narcs = 5; xlen = tx - x; ylen = ty - y; veclen = calc_vector (abs (tx - x), abs (ty - y)); ang = (int) (180. + asin (copysign ((float) ylen / (float) veclen, (double) (xlen * -ylen) )) * 180. / 3.14159); boxlen = (int) (0.2 * veclen); boxcorx = (int) ((1. - (float) xlen / (float) veclen) * boxlen / 2); boxcory = (int) ((1. - (float) ylen / (float) veclen) * boxlen / 2); for (i = 0; i < narcs; ++i) { ax = (gint)((x + 0.2 * i * xlen - boxcorx) * size_factor); ay = (gint)((y + 0.2 * i * ylen - boxcory) * size_factor); width = boxlen * size_factor; height = boxlen * size_factor; angle1 = ang * 64; angle2 = (gint) (-180 * 64 * pow (-1, (double)i)); if (x > tx) angle2 *= -1; gdk_draw_arc (picture, thegc, FALSE, ax, ay, width, height, angle1, angle2); } } void DrawArrow (int x, int y, int tx, int ty, int head, int active, int color) /* draws an arrow with either full or one-sided arrowhead */ { int xlen, ylen, xbase, ybase; gint npoints; float veclen, headfact, scalefact; GdkPoint mypoints[3]; GdkGC *thegc; if (xbmflag) thegc = drawing_area->style->black_gc; else if (active) thegc = hlgc; else thegc= mygc[color]; xlen = tx - x; ylen = ty - y; veclen = sqrt ((double)(xlen * xlen + ylen * ylen)); scalefact=64./veclen; /* keep arrowhead size constant (64=std length)*/ /* headfact = 1. - 20. / veclen;*/ headfact = 0.8; xbase = x + headfact * xlen*scalefact; ybase = y + headfact * ylen*scalefact; xbase = (int) (tx - 0.2 *xlen*scalefact); ybase = (int) (ty - 0.2 *ylen*scalefact); mypoints[0].x = tx * size_factor; mypoints[0].y = ty * size_factor; if (select_char (tx,ty,1) != NULL){ xbase = x+headfact*xlen-12*xlen/veclen; ybase = y+headfact*ylen-12*ylen/veclen; mypoints[0].x = (gint16) ((tx-12*xlen/veclen)*size_factor); mypoints[0].y = (gint16) ((ty-12*ylen/veclen)*size_factor); } mypoints[1].x = (gint16) ((xbase + 0.1 * ylen) * size_factor); mypoints[1].y = (gint16) ((ybase - 0.1 * xlen) * size_factor); mypoints[1].x = (gint16) ((xbase + 0.1 * ylen*scalefact) * size_factor); mypoints[1].y = (gint16) ((ybase - 0.1 * xlen*scalefact) * size_factor); if (head == 1) { mypoints[2].x = (gint16) (xbase * size_factor); /*on baseline */ mypoints[2].y = (gint16) (ybase * size_factor); } else { mypoints[2].x = (gint16) ((xbase - 0.1 * ylen) * size_factor); mypoints[2].y = (gint16) ((ybase + 0.1 * xlen) * size_factor); mypoints[2].x = (gint16) ((xbase - 0.1 * ylen*scalefact) * size_factor); mypoints[2].y = (gint16) ((ybase + 0.1 * xlen*scalefact) * size_factor); } npoints = 3; gdk_draw_line (picture, thegc, x * size_factor, y * size_factor, tx * size_factor, ty * size_factor); gdk_draw_polygon (picture, thegc, TRUE, (GdkPoint *) mypoints, (gint) npoints); } void DrawDashedWedge (int x, int y, int tx, int ty, int active,int color) /* draws the dashed wedge for a bond behind the image plane */ { int i, xlen, ylen; GdkGC *thegc; int len; float step,factor; if (xbmflag) thegc = drawing_area->style->black_gc; else if (active) thegc = hlgc; else thegc= mygc[color]; xlen = tx - x; ylen = ty - y; len=(int) rint(calc_vector(abs(xlen),abs(ylen))/8.); if (len<8) len=8; step = 1./len; factor=0.0125; if (len>20) factor= 0.00125; if (len==8) { factor =0.03; } for (i = 1; i < len; i++) gdk_draw_line (picture, thegc, (x + step * i * xlen - factor * ylen * i) * size_factor, (y + step * i * ylen + factor * xlen * i) * size_factor, (x + step * i * xlen + factor * ylen * i) * size_factor, (y + step * i * ylen - factor * xlen * i) * size_factor); } void DrawWedge (int x, int y, int tx, int ty, int active, int color) /* draws the wedge-shaped single bond 'pointing towards the viewer' */ { int xlen, ylen; gint npoints; GdkPoint mypoints[3]; GdkGC *thegc; struct data *hpc; struct xy_co *coord; int d; float area; if (xbmflag) thegc = drawing_area->style->black_gc; else if (active) thegc = hlgc; else thegc = mygc[color]; xlen = tx - x; ylen = ty - y; float c=1.; if (xlen*xlen+ylen*ylen <=1000.) c=2.; mypoints[0].x = (gint16) (x * size_factor); mypoints[0].y = (gint16) (y * size_factor); mypoints[1].x = (gint16) ((tx - 0.1 *c * ylen) * size_factor); mypoints[1].y = (gint16) ((ty + 0.1 *c* xlen) * size_factor); mypoints[2].x = (gint16) ((tx + 0.1 *c* ylen) * size_factor); mypoints[2].y = (gint16) ((ty - 0.1 *c* xlen) * size_factor); hpc = da_root.next; for (d = 0; d < hp->n; d++) { if (hpc->bond == 10) { if ((abs (hpc->x - tx) < 3 && abs (hpc->y - ty) < 3) || (abs (hpc->tx - tx) < 3 && abs (hpc->ty - ty) < 3)) { coord = center_double_bond (hpc->x, hpc->y, hpc->tx, hpc->ty, 6); if (abs (hpc->x - tx) < 3 && abs (hpc->y - ty) < 3) { mypoints[1].x = (gint16) (coord->x * size_factor); mypoints[1].y = (gint16) (coord->y * size_factor); coord++; mypoints[2].x = (gint16) (coord->x * size_factor); mypoints[2].y = (gint16) (coord->y * size_factor); } else { mypoints[1].x = (gint16) (coord->tx * size_factor); mypoints[1].y = (gint16) (coord->ty * size_factor); coord++; mypoints[2].x = (gint16) (coord->tx * size_factor); mypoints[2].y = (gint16) (coord->ty * size_factor); } area = 0.5 * abs (mypoints[0].x * (mypoints[1].y - mypoints[2].y) + mypoints[1].x * (mypoints[2].y - mypoints[0].y) + mypoints[2].x * (mypoints[0].y - mypoints[1].y)); if (fabs (area) < 76. * size_factor) { mypoints[1].x = (gint16) ((tx - 0.05 * ylen) * size_factor); mypoints[1].y = (gint16) ((ty + 0.05 * xlen) * size_factor); mypoints[2].x = (gint16) ((tx + 0.05 * ylen) * size_factor); mypoints[2].y = (gint16) ((ty - 0.05 * xlen) * size_factor); } } } hpc = hpc->next; } npoints = 3; gdk_draw_polygon (picture, thegc, TRUE, (GdkPoint *) mypoints, (gint) npoints); } void Drawspline (int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int type, int active, int color) /* draws a spline curve, optionally with full of half arrowhead */ { int xlen, ylen, xbase, ybase; double px0, py0, px1, py1; int i; double t; gint npoints; GdkPoint mypoints[21]; GdkGC *thegc; if (xbmflag) thegc = drawing_area->style->black_gc; else if (active) thegc = hlgc; else thegc = mygc[color]; if (drawmode == 3 && !xbmflag) { gdk_draw_rectangle (picture, thegc, TRUE, x0 * size_factor - 1, y0 * size_factor - 1, 3, 3); gdk_draw_rectangle (picture, thegc, TRUE, x1 * size_factor - 1, y1 * size_factor - 1, 3, 3); gdk_draw_rectangle (picture, thegc, TRUE, x2 * size_factor - 1, y2 * size_factor - 1, 3, 3); gdk_draw_rectangle (picture, thegc, TRUE, x3 * size_factor - 1, y3 * size_factor - 1, 3, 3); } px0 = (double)x0; py0 = (double)y0; for (i = 0; i < 21; i++) { t = (float) i / 20.; px1 = t * t * t * (double) x3 + 3. * t * t * (1. - t) * (double) x2 + 3. * t * (1. - t) * (1. - t) * (double) x1 + (1. - t) * (1. - t) * (1. - t) * px0; py1 = t * t * t * (double) y3 + 3. * t * t * (1. - t) * (double) y2 + 3. * t * (1. - t) * (1. - t) * (double) y1 + (1. - t) * (1. - t) * (1. - t) * py0; mypoints[i].x = (gint16) (px1 * size_factor); mypoints[i].y = (gint16) (py1 * size_factor); } npoints = 21; if (type >= 0) { /* move end of last line segment back a bit to keep it from protruding beneath the arrowhead */ xbase= mypoints[20].x; ybase= mypoints[20].y; mypoints[20].x = mypoints[20].x - (gint16) ( 0.03*(mypoints[20].x-mypoints[19].x)); mypoints[20].y = mypoints[20].y - (gint16) (0.03*(mypoints[20].y-mypoints[19].y)); gdk_draw_lines (picture, thegc, mypoints, npoints); mypoints[20].x=xbase; mypoints[20].y=ybase; } if (type == -1) gdk_draw_polygon (picture, thegc, TRUE, mypoints, npoints); if (type == -2) gdk_draw_points (picture, thegc, mypoints, npoints); if (type <= 0) return; for (i=0;i<4;i++){ /* find acceptable arrowhead length */ xlen = mypoints[20].x - mypoints[19-i].x; ylen = mypoints[20].y - mypoints[19-i].y; xbase = mypoints[19-i].x; ybase = mypoints[19-i].y; if (xlen*xlen+ylen*ylen >200 *size_factor*size_factor) break; } if (xlen*xlen+ylen*ylen >400 *size_factor*size_factor) { xlen -= (mypoints[20].x - mypoints[19].x)/2; ylen -= (mypoints[20].y - mypoints[19].y)/2; xbase = mypoints[19].x +(mypoints[20].x - mypoints[19].x)/2 ; ybase = mypoints[19].y +(mypoints[20].y - mypoints[19].y)/2 ; } if (xlen != 0) xlen = (int) copysign (10. * size_factor, (double)xlen); if (ylen != 0) ylen = (int) copysign (10. * size_factor, (double)ylen); /* tip of arrow at original endpoint of last line */ mypoints[0].x = mypoints[20].x; mypoints[0].y = mypoints[20].y; /* calculate both possible positions for arrow side */ mypoints[1].x = (gint16) (xbase + 0.5 * ylen); mypoints[1].y = (gint16) (ybase - 0.5 * xlen); if (type == 1) { mypoints[2].x = (gint16) (xbase - 0.5 * ylen); mypoints[2].y = (gint16) (ybase + 0.5 * xlen); /* and choose the one facing outward (farther from the starting point) */ px0 = (double) ((mypoints[1].x - x0 * size_factor) * (mypoints[1].x - x0 * size_factor) + (mypoints[1].y - y0 * size_factor) * (mypoints[1].y - y0 * size_factor)); px1 = (double) ((mypoints[2].x - x0 * size_factor) * (mypoints[2].x - x0 * size_factor) + (mypoints[2].y - y0 * size_factor) * (mypoints[2].y - y0 * size_factor)); if (px0 < px1) { mypoints[1].x = mypoints[2].x; mypoints[1].y = mypoints[2].y; } mypoints[2].x = (gint16)xbase; /*on baseline */ mypoints[2].y = (gint16)ybase; } else { mypoints[2].x = (gint16) (xbase - 0.5 * ylen); /* on opposite side of line */ mypoints[2].y = (gint16) (ybase + 0.5 * xlen); } npoints = 3; gdk_draw_polygon (picture, thegc, TRUE, (GdkPoint *) mypoints, (gint) npoints); } void Drawstring (int x, int y, char *cc, int direct, int active, int thecolor, int serif_flag, int size, int preview) /* draws a label with sub- and superscripting, symbols and text justification */ { int ha, tw, a; int nch, textl, chl, chr; int d, hx, n; int shiftall = 0; int variance[MAXCL]; gchar *c; #ifdef GTK2 int dummy; gchar l[8]; gchar *c_p; gunichar hc, hl; gunichar text[MAXCL]; gunichar symbol[MAXCL]; gunichar slanted[MAXCL]; gunichar bold[MAXCL]; static PangoLayout *thelayout; #else char *l, *hc, hl[2]; unsigned char text[MAXCL]; char symbol[MAXCL]; char slanted[MAXCL]; char bold[MAXCL]; #endif GdkGC *thegc; int save_x, sub_lastx, sup_lastx; int fontsize; fontsize=size; if (zoom_factor <2) fontsize-=2-zoom_factor; if (zoom_factor >2) fontsize+=zoom_factor-2; if (fontsize<0 ) fontsize=curfontsize; if (fontsize>6) fontsize=6; if (preview) fontsize=0; if (xbmflag) thegc = drawing_area->style->black_gc; else if (active) thegc = hlgc; else thegc = mygc[thecolor]; x = x * size_factor; hx = x; y = y * size_factor; #ifdef GTK2 memset(l,0,8*sizeof(gchar)); c=g_locale_to_utf8(cc,-1,NULL,NULL,NULL); if (!c) c=g_convert(cc,-1,"UTF-8","ISO8859-1",NULL,NULL,NULL); if (!c) { fprintf(stderr,"invalid character in chemtool file\n"); return; } c_p=c; if (!thelayout) thelayout = gtk_widget_create_pango_layout(drawing_area,"X"); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &a); pango_layout_set_text(thelayout, "x", -1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &ha); ha = ha/2; n = (int) g_utf8_strlen(c,-1); #else c=cc; a = gdk_char_height (font[fontsize], 'X'); ha = gdk_char_height (font[fontsize], 'x') / 2; a += 6; n = (int)strlen (c); tw = gdk_char_width (font[fontsize], 'x') ; #endif #ifdef GTK2 for (d = 0; d < n; d++) { symbol[d] = FALSE; slanted[d] = FALSE; bold[d]=FALSE; hc = g_utf8_get_char(c); if (shiftall != 0) { if (hc == '}') { shiftall = 0; if (!(c=g_utf8_next_char(c)))continue; --n; hc=g_utf8_get_char(c); } variance[d] = shiftall; } if (shiftall == 0) { if ((variance[d] = Extra_char (hc,ha)) != 0) { c=g_utf8_next_char(c); if ((hc=g_utf8_get_char(c))) { --n; if (hc == '{') { --n; shiftall = variance[d]; c=g_utf8_next_char(c); hc=g_utf8_get_char(c); } } else { variance[d] = 0; n=d; continue; } } } text[d] = hc; c = g_utf8_next_char(c); if (text[d] == '@' && (hl=g_utf8_get_char(c))) { symbol[d] = TRUE; text[d] = hl; if (text[d] == '+') text[d]=8005;//QUAK else if (text[d] == '-') text[d]=8006;//QUAK c = g_utf8_next_char(c); --n; } else if (text[d] == '|' && (hl=g_utf8_get_char(c))) { slanted[d] = TRUE; text[d] = hl; c = g_utf8_next_char(c); --n; } else if (text[d] == '#' && (hl=g_utf8_get_char(c))) { bold[d] = TRUE; text[d] = hl; c = g_utf8_next_char(c); --n; } else if (text[d] == '\\' && (hl=g_utf8_get_char(c))) { text[d] = ' '; } } #else hc = c; for (d = 0; d < n; d++) { symbol[d] = FALSE; slanted[d] = FALSE; bold[d]=FALSE; if (shiftall != 0) { if (*hc == '}') { shiftall = 0; if (*(hc + 1)) hc++; --n; } variance[d] = shiftall; } if (shiftall == 0) { if ((variance[d] = Extra_char (*hc)) != 0) { if (*(hc + 1)) { hc++; --n; if (*hc == '{') { shiftall = variance[d]; hc++; --n; } } else { variance[d] = 0; } } } text[d] = (unsigned char) *hc++; if (text[d] == '@' && *hc) { symbol[d] = TRUE; text[d] = (unsigned char) *hc++; --n; } else if (text[d] == '|' && *hc) { slanted[d] = TRUE; text[d] = (unsigned char) *hc++; --n; } else if (text[d] == '#' && *hc) { bold[d] = TRUE; text[d] = (unsigned char) *hc++; --n; } else if (text[d] == '\\' && *hc) { text[d] = ' '; } } #endif nch = n; if (nch > 0) { chl = 0; chr = 0; x = save_x = sub_lastx = sup_lastx = 0; for (d = 0; d < nch; d++) { #ifdef GTK2 /* l = g_locale_to_utf8((const gchar*) &text[d],1,NULL,NULL,NULL); */ memset(l,0,8*sizeof(gchar)); g_unichar_to_utf8(text[d],l); #endif if (variance[d]) { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); #else tw = gdk_char_width (smallfont[fontsize], (gchar)text[d]) + 2; #endif if (symbol[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,ssymbfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = gdk_char_width (ssymbfont[fontsize], (gchar)text[d]); #endif if (variance[d] < 0) { if (save_x < x) x = sub_lastx; x = sub_lastx = x + tw; } else { if (save_x < x) x = sup_lastx; x = sup_lastx = x + tw; } } else /* not sub- or superscripted */ { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); #else tw = 1 + gdk_char_width (font[fontsize], (gchar)text[d]); #endif if (symbol[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = gdk_char_width (symbfont[fontsize], (gchar)text[d]); #endif if (bold[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,boldfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = gdk_char_width (boldfont[fontsize], (gchar)text[d]); #endif if (slanted[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,slfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = 1 + gdk_char_width (slfont[fontsize], (gchar)text[d]); #endif if (save_x < x) { if (sub_lastx < sup_lastx) x = sup_lastx; else x = sub_lastx; } x = save_x = sub_lastx = sup_lastx = x + tw; chr = tw; } if (chl == 0) chl = tw; } if (x != sub_lastx || x != sup_lastx) save_x+= tw; /* if the label ends with a sub/superscripted character, */ /* add its length to the current position (which is before */ /* the sub/superscript to allow vertical alignment of simultaneous */ /* sub- and superscripts */ textl = save_x; switch (direct) { case 0: hx = hx - chl / 2; break; case -1: hx = hx - (textl - 1) / 2; break; case -2: hx = hx + chr / 2 - (textl - 1); break; } } nch = n; x = hx; save_x = sub_lastx = sup_lastx = x; for (d = 0; d < n; d++) { #ifdef GTK2 /* l = g_locale_to_utf8((const gchar*) &text[d],1,NULL,NULL,NULL);*/ memset(l,0,8*sizeof(gchar)); g_unichar_to_utf8(text[d], l); #endif if (variance[d]) { #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = gdk_char_width (smallfont[fontsize], (gchar)text[d]) + 2; #endif if (symbol[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,ssymbfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = gdk_char_width (ssymbfont[fontsize], (gchar)text[d]); #endif if (variance[d] < 0) { if (save_x < x) x = sub_lastx; sub_lastx = x + tw; } else { if (save_x < x) x = sup_lastx; sup_lastx = x + tw; } } else { /* not sub- or superscripted */ #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); #else tw = 1 + gdk_char_width (font[fontsize], (gchar)text[d]); #endif if (symbol[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = gdk_char_width (symbfont[fontsize], (gchar)text[d]); #endif if (bold[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,boldfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = gdk_char_width (boldfont[fontsize], (gchar)text[d]); #endif if (slanted[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,slfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = 1 + gdk_char_width (slfont[fontsize], (gchar)text[d]); #endif if (save_x < x) { if (sub_lastx < sup_lastx) x = sup_lastx; else x = sub_lastx; } save_x = sub_lastx = sup_lastx = x + tw; } /* erase a circular area slightly larger than the current character to create some space around the label */ if (text[d] != 183) { if (use_whiteout) fprintf(stderr,"whitespace\n"); if (preview) gdk_draw_arc (picture, drawing_area->style->white_gc, 1, x - 5 * size_factor, y - a + ha - 5 * size_factor + variance[d], tw + 8 * size_factor, a + 10 * size_factor, 0, 360 * 64); else if (use_whiteout) gdk_draw_arc (picture, background_gc, 1, x - 2 * size_factor, y -a + ha + size_factor * variance[d], tw + 8 * size_factor, a + 2 * size_factor, 0, 360 * 64); x = x + tw; } } n = nch; x = hx; #ifdef GTK2 y -= a ; #endif save_x = sub_lastx = sup_lastx = x; for (d = 0; d < n; d++) { #ifdef GTK2 memset(l,0,8*sizeof(gchar)); /*#ifdef GTK2*/ /* l = g_locale_to_utf8((const gchar*) &text[d],1,NULL,NULL,NULL);*/ g_unichar_to_utf8(text[d],l); if (symbol[d]) { unsigned int unicodechar=text[d]+848; switch (unicodechar){ /* catch sequence mismatches with X Symbol font*/ case 915: /*C*/ case 947: /*c*/ unicodechar+=20; break; case 918: case 950: /*f*/ unicodechar+=16; break; case 919: case 951: /*g*/ unicodechar-=4; break; case 920: case 952: /*h*/ unicodechar-=1; break; case 922: /*J is vartheta*/ unicodechar=977; break; case 954: /*j is varphi*/ unicodechar=981; break; case 923: case 924: case 925: case 955: case 956: case 957: unicodechar-=1; break; case 926: /*N*/ unicodechar=78; break; case 958: /*n*/ unicodechar=118; break; case 929: /*Q*/ unicodechar=920; break; case 961: /*p*/ unicodechar=952; break; case 962: unicodechar-=1; break; case 966:/*v*/ unicodechar=982; break; case 967: /*w*/ unicodechar=969; break; case 968: unicodechar=958; break; case 969: unicodechar-=1; break; case 970: unicodechar=950; break; case 930: /*R*/ unicodechar-=1; break; case 934: /*V*/ unicodechar=962; break; case 935: /*W*/ unicodechar+=2; break; case 936: /*X*/ unicodechar=926; break; case 937: /*Y*/ unicodechar-=1; break; case 938: unicodechar=90; break; case 1031: /*centered dot*/ case 775: /* bullet */ unicodechar=8226; break; default: break; } g_unichar_to_utf8((gunichar)unicodechar,l); } #else hl[0] = (char)text[d]; hl[1] = 0; l = &hl[0]; #endif if (variance[d]) { #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = gdk_char_width (smallfont[fontsize], (gchar)text[d]) + 2; #endif if (symbol[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,ssymbfont[fontsize]); pango_layout_get_pixel_size(thelayout, &tw, &dummy); } #else tw = gdk_char_width (ssymbfont[fontsize], (gchar)text[d]); #endif if (variance[d] < 0) { if (save_x < x) x = sub_lastx; sub_lastx = x + tw; } else { if (save_x < x) x = sup_lastx; sup_lastx = x + tw; } if (symbol[d]) { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,ssymbfont[fontsize]); gdk_draw_layout(picture,background_gc,x,y+ha+variance[d],thelayout); gdk_draw_layout(picture,thegc,x,y+ha+variance[d],thelayout); #else gdk_draw_text (picture, ssymbfont[fontsize], background_gc, x, y + ha + variance[d], l, (gint)strlen (l)); gdk_draw_text (picture, ssymbfont[fontsize], thegc, x, y + ha + variance[d], l, (gint)strlen (l)); #endif } else { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,smallfont[fontsize]); gdk_draw_layout(picture,background_gc,x,y+ha+variance[d],thelayout); gdk_draw_layout(picture,thegc,x,y+ha+variance[d],thelayout); #else gdk_draw_text (picture, smallfont[fontsize], background_gc, x, y + ha + variance[d], l, (gint)strlen (l)); gdk_draw_text (picture, smallfont[fontsize], thegc, x, y + ha + variance[d], l, (gint)strlen (l)); #endif } x = x + tw; } else /* not sub- or superscripted */ { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,font[fontsize]); pango_layout_get_pixel_size(thelayout,&tw,&dummy); #else tw = 1 + gdk_char_width (font[fontsize], (gchar)text[d]); #endif if (symbol[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); pango_layout_get_pixel_size(thelayout,&tw,&dummy); } #else tw = gdk_char_width (symbfont[fontsize], (gchar)text[d]); #endif if (bold[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,boldfont[fontsize]); pango_layout_get_pixel_size(thelayout,&tw,&dummy); } #else tw = gdk_char_width (boldfont[fontsize], (gchar)text[d]); #endif if (slanted[d]) #ifdef GTK2 { pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,slfont[fontsize]); pango_layout_get_pixel_size(thelayout,&tw,&dummy); } #else tw = 1 + gdk_char_width (slfont[fontsize],(gchar) text[d]); #endif if (save_x < x) { if (sub_lastx < sup_lastx) x = sup_lastx; else x = sub_lastx; } if (symbol[d]) { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,symbfont[fontsize]); gdk_draw_layout(picture,background_gc,x,y+ha,thelayout); gdk_draw_layout(picture,thegc,x,y+ha,thelayout); #else gdk_draw_text (picture, symbfont[fontsize], background_gc, x, y + ha, l, (gint)strlen (l)); gdk_draw_text (picture, symbfont[fontsize], thegc, x, y + ha, l, (gint)strlen (l)); #endif } else if (bold[d]) { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,boldfont[fontsize]); gdk_draw_layout(picture,background_gc,x,y+ha,thelayout); gdk_draw_layout(picture,thegc,x,y+ha,thelayout); #else gdk_draw_text (picture, boldfont[fontsize], background_gc, x, y + ha, l, (gint)strlen (l)); gdk_draw_text (picture, boldfont[fontsize], thegc, x, y + ha, l, (gint)strlen (l)); #endif } else if (slanted[d]) { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,slfont[fontsize]); gdk_draw_layout(picture,background_gc,x,y+ha,thelayout); gdk_draw_layout(picture,thegc,x,y+ha,thelayout); #else gdk_draw_text (picture, slfont[fontsize], background_gc, x, y + ha, l, (gint)strlen (l)); gdk_draw_text (picture, slfont[fontsize], thegc, x, y + ha, l, (gint)strlen (l)); #endif } else if (serif_flag) { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,textfont[fontsize]); gdk_draw_layout(picture,background_gc,x,y+ha,thelayout); gdk_draw_layout(picture,thegc,x,y+ha,thelayout); #else gdk_draw_text (picture, textfont[fontsize], background_gc, x, y + ha, l, (gint)strlen (l)); gdk_draw_text (picture, textfont[fontsize], thegc, x, y + ha, l, (gint)strlen (l)); #endif } else { #ifdef GTK2 pango_layout_set_text(thelayout,l,-1); pango_layout_set_font_description(thelayout,font[fontsize]); gdk_draw_layout(picture,background_gc,x,y+ha,thelayout); gdk_draw_layout(picture,thegc,x,y+ha,thelayout); #else gdk_draw_text (picture, font[fontsize], background_gc, x, y + ha, l, (gint)strlen (l)); gdk_draw_text (picture, font[fontsize], thegc, x, y + ha, l, (gint)strlen (l)); #endif } x = x + tw; save_x = sub_lastx = sup_lastx = x; } } #ifdef GTK2 free(c_p); #endif } #ifdef GTK2 int Extra_char (gunichar c, int ha) #else int Extra_char (char c) #endif /* process control characters for sub- and superscripting */ { #ifndef GTK2 int ha = gdk_char_height (font[zoom_factor], 'x') / 2; #endif if (c == '_') return (ha); if (c == '^') return (-ha); return (0); } int Load_Font () /* load the normal, subscript and symbol fonts for all zoom scales */ { #ifdef GTK2 int i; gchar *pangosymtype[]= {"Symbol 8", "Symbol 10", "Symbol 12", "Symbol 14", "Symbol 18", "Symbol 20", "Symbol 24" }; gchar *pangossymtype[]= {"Symbol 8", "Symbol 8", "Symbol 10", "Symbol 12", "Symbol 14", "Symbol 18", "Symbol 24" }; gchar *pangofntype[]= { "Helvetica 8", "Helvetica 10", "Helvetica 12", "Helvetica 14", "Helvetica 17", "Helvetica 20", "Helvetica 24"}; gchar *pangosfntype[]= { "Helvetica 8", "Helvetica 8", "Helvetica 10", "Helvetica 12", "Helvetica 14", "Helvetica 14", "Helvetica 20"}; gchar *pangosltype[]= { "Helvetica oblique 8", "Helvetica oblique 10", "Helvetica oblique 12", "Helvetica oblique 14", "Helvetica oblique 18", "Helvetica oblique 18", "Helvetica oblique 24"}; gchar *pangobtype[]= { "Helvetica bold 8", "Helvetica bold 10", "Helvetica bold 12", "Helvetica bold 14", "Helvetica bold 18", "Helvetica bold 18", "Helvetica bold 24"}; gchar *pangotexttype[]= { "Times 8", "Times 10", "Times 12", "Times 14", "Times 18", "Times 18", "Times 24"}; for (i=0;i<7;i++){ font[i]=pango_font_description_from_string(pangofntype[i]); symbfont[i]=pango_font_description_from_string(pangosymtype[i]); ssymbfont[i]=pango_font_description_from_string(pangossymtype[i]); smallfont[i]=pango_font_description_from_string(pangosfntype[i]); slfont[i]=pango_font_description_from_string(pangosltype[i]); boldfont[i]=pango_font_description_from_string(pangobtype[i]); textfont[i]=pango_font_description_from_string(pangotexttype[i]); } #else int i,fnt; /* NB: entries 0 and 1 are used for preview only, the default font is 4(!) */ gchar *symtype75[] = { "*-symbol-*-*-8-*", "*-symbol-*-*-10-*", "*-symbol-*-*-12-*", "*-symbol-*-*-14-*", "*-symbol-*-*-18-*", "*-symbol-*-*-18-*", "*-symbol-*-*-24-*" }; gchar *ssymtype75[] = { "*-symbol-*-*-8-*", "*-symbol-*-*-8-*", "*-symbol-*-*-10-*", "*-symbol-*-*-12-*", "*-symbol-*-*-14-*", "*-symbol-*-*-18-*", "*-symbol-*-*-24-*" }; gchar *symtype100[] = { "*-symbol-*-*-11-*", "*-symbol-*-*-14-*", "*-symbol-*-*-17-*", "*-symbol-*-*-20-*", "*-symbol-*-*-25-*", "*-symbol-*-*-25-*", "*-symbol-*-*-34-*" }; gchar *ssymtype100[] = { "*-symbol-*-*-11-*", "*-symbol-*-*-11-*", "*-symbol-*-*-14-*", "*-symbol-*-*-17-*", "*-symbol-*-*-20-*", "*-symbol-*-*-25-*", "*-symbol-*-*-34-*" }; gchar *fntype75[] = { "*-helvetica-medium-r-normal--8-*", "*-helvetica-medium-r-normal--10-*", "*-helvetica-medium-r-normal--12-*", "*-helvetica-medium-r-normal--14-*", "*-helvetica-medium-r-normal--18-*", "*-helvetica-medium-r-normal--18-*", "*-helvetica-medium-r-normal--24-*" }; gchar *fntype100[] = { "*-helvetica-medium-r-normal--11-*", "*-helvetica-medium-r-normal--14-*", "*-helvetica-medium-r-normal--17-*", "*-helvetica-medium-r-normal--20-*", "*-helvetica-medium-r-normal--25-*", "*-helvetica-medium-r-normal--25-*", "*-helvetica-medium-r-normal--34-*" }; gchar *fallback[] = { "5x7", "6x10", "7x13", "9x15", "8x16", "10x20", "12x24" }; gchar *sfntype75[] = { "*-helvetica-medium-r-normal--8-*", "*-helvetica-medium-r-normal--8-*", "*-helvetica-medium-r-normal--10-*", "*-helvetica-medium-r-normal--12-*", "*-helvetica-bold-r-normal--14-*", "*-helvetica-bold-r-normal--14-*", "*-helvetica-medium-r-normal--20-*" }; gchar *sfntype100[] = { "*-helvetica-medium-r-normal--11-*", "*-helvetica-medium-r-normal--11-*", "*-helvetica-medium-r-normal--14-*", "*-helvetica-medium-r-normal--17-*", "*-helvetica-bold-r-normal--20-*", "*-helvetica-bold-r-normal--20-*", "*-helvetica-medium-r-normal--25-*" }; /* {"5x7", "5x7", "6x10", "8x13", "7x14", "8x13bold", "10x20"};*/ gchar *sltype75[] = { "*-helvetica-medium-o-normal--8-*", "*-helvetica-medium-o-normal--10-*", "*-helvetica-medium-o-normal--12-*", "*-helvetica-medium-o-normal--14-*", "*-helvetica-medium-o-normal--18-*", "*-helvetica-medium-o-normal--18-*", "*-helvetica-medium-o-normal--24-*" }; gchar *sltype100[] = { "*-helvetica-medium-o-normal--11-*", "*-helvetica-medium-o-normal--14-*", "*-helvetica-medium-o-normal--17-*", "*-helvetica-medium-o-normal--20-*", "*-helvetica-medium-o-normal--25-*", "*-helvetica-medium-o-normal--25-*", "*-helvetica-medium-o-normal--34-*" }; gchar *btype75[] = { "*-helvetica-bold-r-normal--8-*", "*-helvetica-bold-r-normal--10-*", "*-helvetica-bold-r-normal--12-*", "*-helvetica-bold-r-normal--14-*", "*-helvetica-bold-r-normal--18-*", "*-helvetica-bold-r-normal--18-*", "*-helvetica-bold-r-normal--24-*" }; gchar *btype100[] = { "*-helvetica-bold-r-normal--11-*", "*-helvetica-bold-r-normal--14-*", "*-helvetica-bold-r-normal--17-*", "*-helvetica-bold-r-normal--20-*", "*-helvetica-bold-r-normal--25-*", "*-helvetica-bold-r-normal--25-*", "*-helvetica-bold-r-normal--34-*" }; gchar *texttype75[] = { "*-times-medium-r-normal--8-*", "*-times-medium-r-normal--10-*", "*-times-medium-r-normal--12-*", "*-times-medium-r-normal--14-*", "*-times-medium-r-normal--18-*", "*-times-medium-r-normal--18-*", "*-times-medium-r-normal--24-*" }; gchar *texttype100[] = { "*-times-medium-r-normal--11-*", "*-times-medium-r-normal--14-*", "*-times-medium-r-normal--17-*", "*-times-medium-r-normal--20-*", "*-times-medium-r-normal--25-*", "*-times-medium-r-normal--25-*", "*-times-medium-r-normal--34-*" }; for (i=0;i<7;i++) { if (font[i]) gdk_font_unref (font[i]); if (symbfont[i]) gdk_font_unref (symbfont[i]); if (smallfont[i]) gdk_font_unref (smallfont[i]); if (ssymbfont[i]) gdk_font_unref (ssymbfont[i]); if (slfont[i]) gdk_font_unref (slfont[i]); if (boldfont[i]) gdk_font_unref (boldfont[i]); if (textfont[i]) gdk_font_unref (textfont[i]); fnt=i; if ((font[i] = gdk_font_load (fntype75[fnt])) == NULL) if((font[i] = gdk_font_load (fntype100[fnt])) == NULL) { fprintf (stderr, "failed to load font %s !!!\n", fntype75[fnt]); if ((font[i] = gdk_font_load (fallback[fnt])) == NULL) return (0); } if ((symbfont[i] = gdk_font_load (symtype75[fnt])) == NULL) if((symbfont[i] = gdk_font_load (symtype100[fnt])) == NULL) { fprintf (stderr, "Failed to load symbol font, using standard font\n"); symbfont[i] = font[i]; } if ((ssymbfont[i] = gdk_font_load (ssymtype75[fnt])) == NULL) if((ssymbfont[i] = gdk_font_load (ssymtype100[fnt])) == NULL) ssymbfont[i] = font[i]; if ((smallfont[i] = gdk_font_load (sfntype75[fnt])) == NULL) if ((smallfont[i] = gdk_font_load (sfntype100[fnt])) == NULL) smallfont[i] = font[i]; if ((slfont[i] = gdk_font_load (sltype75[fnt])) == NULL) if ((slfont[i] = gdk_font_load (sltype100[fnt])) == NULL) slfont[i] = font[i]; if ((boldfont[i] = gdk_font_load (btype75[fnt])) == NULL) if ((boldfont[i] = gdk_font_load (btype100[fnt])) == NULL) boldfont[i] = font[i]; if ((textfont[i] = gdk_font_load (texttype75[fnt])) == NULL) if ((textfont[i] = gdk_font_load (texttype100[fnt])) == NULL) textfont[i] = font[i]; } #endif return (1); } void Set_Line (int lsty) /* define standard line attributes for bond drawing */ { int i; for (i=0; i<7; i++) gdk_gc_set_line_attributes (mygc[i], lsty, 0, GDK_CAP_BUTT, GDK_JOIN_MITER); gdk_gc_set_line_attributes (background_gc, lsty, 0, GDK_CAP_BUTT, GDK_JOIN_MITER); gdk_gc_set_line_attributes (drawing_area->style->black_gc, lsty, 0, GDK_CAP_BUTT, GDK_JOIN_MITER); } chemtool-1.6.14/examples/0000755000175000001440000000000012202252007014434 5ustar martinuserschemtool-1.6.14/examples/breve.cht0000644000175000001440000000431410715417303016252 0ustar martinusersChemtool Version 1.2 geometry 1762 767 bonds 89 420 519 365 551 0 365 551 310 519 0 475 423 530 455 0 530 519 475 551 0 530 455 575 410 0 575 410 638 410 0 670 355 725 328 0 725 328 780 355 0 780 355 835 323 0 890 355 945 323 0 945 323 1000 355 0 1000 355 1000 419 0 1000 419 945 451 0 1000 355 1045 309 0 1045 309 1108 309 0 1108 309 1140 254 0 1140 254 1204 254 0 1204 254 1236 309 0 1236 309 1204 364 0 1204 364 1140 377 0 1396 144 1428 199 0 200 522 145 554 4 310 519 310 583 5 420 519 420 583 5 530 519 530 583 5 637 533 672 568 6 780 428 780 492 5 890 419 890 483 5 1140 377 1172 432 5 1236 309 1268 364 5 1332 254 1364 309 5 1332 144 1305 88 5 1300 199 1268 144 6 1204 254 1172 199 6 1108 309 1076 254 6 1000 355 1000 290 6 890 355 890 291 6 780 355 780 291 6 638 410 606 355 6 530 455 530 391 6 420 455 420 391 6 310 455 310 391 6 1041 437 1081 436 0 1081 436 1127 410 1 1127 410 1140 377 0 1428 199 1492 199 5 1492 199 1547 161 0 1547 161 1602 193 0 1547 161 1547 97 4 1602 193 1602 257 4 420 519 420 455 0 310 519 310 455 0 530 519 530 455 0 780 428 780 355 0 835 451 890 419 0 890 419 945 451 0 1396 254 1428 199 0 1300 309 1332 254 0 1332 254 1396 254 0 1332 254 1300 199 0 1300 199 1332 144 0 1332 144 1396 144 0 200 455 255 423 2 654 485 638 410 0 654 485 727 480 0 654 485 688 532 5 637 533 572 551 0 572 551 530 519 0 638 410 670 355 0 1140 377 1108 309 0 1300 309 1236 309 0 727 480 780 428 0 835 323 890 355 0 890 355 890 419 0 1236 199 1300 199 0 1204 254 1236 199 0 420 455 475 423 0 420 455 365 423 0 255 551 200 522 0 200 522 200 455 0 310 455 255 423 0 255 423 255 359 0 310 455 365 423 0 255 551 310 519 0 475 551 420 519 0 637 533 654 485 0 835 451 780 428 0 1041 437 1000 419 0 1000 419 1000 482 5 atoms 37 255 551 O -1 475 551 O -1 575 410 O -1 727 480 O -1 835 323 O -1 1045 309 O -1 1204 364 O -1 1236 199 O -1 1396 254 O -1 945 451 O -1 365 423 O -1 1305 88 OH 0 420 391 CH_3 0 672 568 CH_3 0 780 291 CH_3 0 890 291 CH_3 0 1000 482 CH_3 0 1268 144 H_3C -2 310 391 H -1 310 583 H -1 420 583 H -1 530 583 H -1 530 391 H -1 606 355 H -1 688 532 H -1 780 492 H -1 890 483 H -1 1000 290 H -1 1172 432 H -1 1076 254 H -1 1172 199 H -1 1268 364 H -1 1364 309 H -1 730 698 Brevetoxin\B -1 1602 257 O -1 145 554 O 0 255 359 CH_3 0 chemtool-1.6.14/examples/Indolizomycin.cht0000644000175000001440000000120610715417303017773 0ustar martinusersChemtool Version 1.6 geometry 729 370 bonds 23 219 176 269 213 0 0 0 269 213 249 273 0 0 0 249 273 187 273 0 0 0 187 273 167 213 0 0 0 167 213 219 176 0 0 0 301 116 321 176 0 0 0 321 176 269 213 0 0 0 219 176 238 117 0 0 0 238 117 301 116 0 0 0 301 116 269 62 5 0 0 187 273 125 260 5 0 0 167 213 137 249 5 0 0 238 117 269 62 5 0 0 321 176 372 213 0 0 0 372 213 432 194 2 0 0 432 194 469 245 0 0 0 469 245 529 226 2 0 0 529 226 566 277 0 0 0 626 258 566 277 1 0 0 626 258 663 309 0 0 0 566 277 547 337 0 0 0 321 176 372 139 5 0 0 219 176 164 144 7 0 0 atoms 4 125 260 O -1 0 0 3 269 213 N -1 0 0 3 372 139 H -1 0 0 3 164 144 HO -2 0 0 3 splines 0 chemtool-1.6.14/examples/kdo.cht0000644000175000001440000000063410715417303015725 0ustar martinusersChemtool Version 1.4 geometry 445 346 bonds 14 217 222 254 273 0 217 222 277 241 0 277 241 337 222 0 254 273 314 254 0 314 254 374 273 0 337 222 374 273 0 254 273 204 264 0 217 222 216 176 0 277 241 259 192 0 374 273 375 315 0 374 273 405 246 0 259 192 314 160 0 314 160 321 121 0 259 192 236 150 6 atoms 7 337 222 O -1 216 176 HO -2 204 264 HO -2 405 246 COOH 0 236 150 OH 0 321 121 OH 0 375 315 OH 0 splines 0 chemtool-1.6.14/examples/anabsinthin.cht0000644000175000001440000000312710715417303017446 0ustar martinusersChemtool Version 1.6 geometry 620 513 bonds 52 105 122 160 90 0 0 0 160 90 215 122 0 0 0 215 122 215 186 0 0 0 215 186 183 210 0 0 0 135 210 105 184 0 0 0 105 122 105 186 0 0 0 215 186 258 223 1 0 0 309 186 309 122 0 0 0 309 122 360 85 0 0 0 411 121 466 89 0 0 0 521 121 521 185 0 0 0 521 185 489 209 0 0 0 489 209 441 209 0 0 0 441 209 411 183 0 0 0 505 263 461 309 0 0 0 418 265 441 209 0 0 0 466 89 510 66 5 0 0 360 85 411 48 5 0 0 160 90 192 35 6 0 0 160 90 128 35 5 0 0 309 122 309 58 6 0 0 309 186 309 250 6 0 0 489 209 553 209 6 0 0 466 89 466 25 6 0 0 360 85 360 21 6 0 0 215 122 309 122 0 0 0 309 186 258 223 0 0 0 258 223 258 287 0 0 0 360 85 411 122 0 0 0 155 310 155 373 4 0 0 135 210 135 146 5 0 0 411 48 462 148 10 0 0 466 89 521 121 0 0 0 462 148 510 66 10 0 0 215 122 215 58 5 0 0 505 263 564 281 0 0 0 461 309 418 265 0 0 0 183 210 183 146 6 0 0 112 266 61 279 0 0 0 462 148 516 161 5 0 0 461 309 461 372 4 0 0 489 209 505 263 5 0 0 183 210 199 264 5 0 0 155 310 199 264 0 0 0 155 310 112 266 0 0 0 135 210 112 266 0 0 0 135 210 183 210 0 0 0 411 122 356 154 6 0 0 309 186 411 185 0 0 0 411 183 411 122 0 0 0 411 183 462 148 5 0 0 441 209 377 209 5 0 0 atoms 22 155 373 O -1 0 0 3 461 372 O -1 0 0 3 510 66 O -1 0 0 3 192 35 OH 0 0 0 3 215 58 H -1 0 0 3 309 58 H -1 0 0 3 309 250 H -1 0 0 3 377 209 H -1 0 0 3 553 209 H -1 0 0 3 360 21 H -1 0 0 3 183 146 H -1 0 0 3 135 146 H -1 0 0 3 128 35 H_3C -2 0 0 3 61 279 H_3C -2 0 0 3 466 25 H_3C -2 0 0 3 516 161 CH_3 0 0 0 3 258 287 CH_3 0 0 0 3 356 154 H -1 0 0 3 199 264 O -1 0 0 3 418 265 O -1 0 0 3 216 467 Anabsinthin 0 0 0 3 564 281 CH_3 0 0 0 3 splines 0 chemtool-1.6.14/examples/sample.sdf0000644000175000001440000001754710715417303016442 0ustar martinusers186 Kekule 10110113542D 18 19 0 0 0 0 22 V2000 -1.5425 -0.7080 0.0000 O 0 0 0 0 0 0 1.6135 0.3799 0.0000 O 0 0 0 0 0 0 -0.2924 0.7469 0.0000 C 0 0 0 0 0 0 -0.9285 0.3799 0.0000 C 0 0 0 0 0 0 0.3425 0.3799 0.0000 C 0 0 0 0 0 0 0.9774 0.7469 0.0000 C 0 0 0 0 0 0 0.3425 -0.3539 0.0000 C 0 0 0 0 0 0 -0.9285 -0.3539 0.0000 C 0 0 0 0 0 0 -0.2924 -0.7210 0.0000 C 0 0 0 0 0 0 0.9774 -0.7210 0.0000 C 0 0 0 0 0 0 1.6135 -0.3539 0.0000 C 0 0 0 0 0 0 -1.5324 0.7289 0.0000 C 0 0 0 0 0 0 -2.1734 0.3592 0.0000 O 0 0 0 0 0 0 -1.5322 1.4689 0.0000 O 0 0 0 0 0 0 -0.2924 1.4599 0.0000 O 0 0 0 0 0 0 -0.2924 -1.5000 0.0000 C 0 0 0 0 0 0 0.9774 -1.5000 0.0000 C 0 0 0 0 0 0 2.2774 -0.7370 0.0000 C 0 0 0 0 0 0 1 8 2 0 0 0 0 2 6 1 0 0 0 0 2 11 1 0 0 0 0 3 4 2 0 0 0 0 3 5 1 0 0 0 0 3 15 1 0 0 0 0 4 8 1 0 0 0 0 4 12 1 0 0 0 0 5 6 2 0 0 0 0 5 7 1 0 0 0 0 7 9 2 0 0 0 0 7 10 1 0 0 0 0 8 9 1 0 0 0 0 9 16 1 0 0 0 0 10 11 1 0 0 0 0 10 17 1 1 0 0 0 11 18 1 6 0 0 0 12 13 2 0 0 0 0 12 14 1 0 0 0 0 M STY 5 1 SUP 2 SUP 3 SUP 4 SUP 5 SUP M SAL 1 3 12 13 14 M SBL 1 1 8 M SMT 1 HO2C M SBV 1 8 0.6039 -0.3489 M SAL 2 1 15 M SBL 2 1 6 M SMT 2 HO M SBV 2 6 0.0000 -0.7129 M SAL 3 1 16 M SBL 3 1 14 M SMT 3 Me M SBV 3 14 0.0000 0.7789 M SAL 4 1 17 M SBL 4 1 16 M SMT 4 Me M SBV 4 16 0.0000 0.7789 M SAL 5 1 18 M SBL 5 1 17 M SMT 5 Me M SBV 5 17 -0.6639 0.3830 M END > 186 > K > $$$$$ 377 Kekule 10110113542D 29 32 0 0 0 0 11 V2000 -3.1290 1.3990 0.0000 O 0 0 0 0 0 0 -3.1290 -1.4509 0.0000 O 0 0 0 0 0 0 2.6009 1.1369 0.0000 O 0 0 0 0 0 0 4.2109 1.5049 0.0000 C 0 0 0 0 0 0 4.8489 1.1369 0.0000 C 0 0 0 0 0 0 3.5739 1.1369 0.0000 C 0 0 0 0 0 0 4.8489 0.4010 0.0000 C 0 0 0 0 0 0 3.5739 0.4010 0.0000 C 0 0 0 0 0 0 4.2109 0.0329 0.0000 C 0 0 0 0 0 0 1.2009 1.5049 0.0000 C 0 0 0 0 0 0 0.5629 1.1369 0.0000 C 0 0 0 0 0 0 1.8389 1.1369 0.0000 C 0 0 0 0 0 0 1.8389 0.4010 0.0000 C 0 0 0 0 0 0 0.5629 0.4010 0.0000 C 0 0 0 0 0 0 1.2009 0.0329 0.0000 C 0 0 0 0 0 0 -3.1290 0.7690 0.0000 C 0 0 0 0 0 0 -2.4920 0.4010 0.0000 C 0 0 0 0 0 0 -3.7669 0.4010 0.0000 C 0 0 0 0 0 0 -4.3770 0.7669 0.0000 C 0 0 0 0 0 0 -5.0139 0.3990 0.0000 C 0 0 0 0 0 0 -2.4920 -0.3360 0.0000 C 0 0 0 0 0 0 -3.7669 -0.3360 0.0000 C 0 0 0 0 0 0 -5.0139 -0.3370 0.0000 C 0 0 0 0 0 0 -3.1290 -0.7039 0.0000 C 0 0 0 0 0 0 -4.3770 -0.7060 0.0000 C 0 0 0 0 0 0 -1.8450 -0.7089 0.0000 O 0 0 0 0 0 0 -1.7290 0.4010 0.0000 C 0 0 0 0 0 0 -1.3590 1.0418 0.0000 C 0 0 0 0 0 0 -0.6190 1.0418 0.0000 C 0 0 0 0 0 0 1 16 2 0 0 0 0 2 24 2 0 0 0 0 3 6 1 0 0 0 0 3 12 1 0 0 0 0 4 5 2 0 0 0 0 4 6 1 0 0 0 0 5 7 1 0 0 0 0 6 8 2 0 0 0 0 7 9 2 0 0 0 0 8 9 1 0 0 0 0 10 12 2 0 0 0 0 10 11 1 0 0 0 0 11 14 2 0 0 0 0 12 13 1 0 0 0 0 13 15 2 0 0 0 0 14 15 1 0 0 0 0 14 29 1 0 0 0 0 16 17 1 0 0 0 0 16 18 1 0 0 0 0 17 21 2 0 0 0 0 17 27 1 0 0 0 0 18 22 2 0 0 0 0 18 19 1 0 0 0 0 19 20 2 0 0 0 0 20 23 1 0 0 0 0 21 24 1 0 0 0 0 21 26 1 0 0 0 0 22 25 1 0 0 0 0 22 24 1 0 0 0 0 23 25 2 0 0 0 0 27 28 1 0 0 0 0 28 29 1 0 0 0 0 M STY 2 1 SUP 2 SUP M SAL 1 1 26 M SBL 1 1 27 M SMT 1 OH M SBV 1 27 -0.6469 0.3729 M SAL 2 3 27 28 29 M SBL 2 2 21 17 M SMT 2 (CH2)3 M SBV 2 21 -0.7629 0.0000 M SBV 2 17 1.1820 -0.6408 M END > 377 > K > $$$$$ 740 Kekule 10110113552D 33 35 0 0 0 0 24 V2000 4.5097 1.8617 0.0000 N 0 0 0 0 0 0 4.5097 0.3937 0.0000 N 0 0 0 0 0 0 5.7257 1.8787 0.0000 N 0 0 0 0 0 0 6.3607 0.7777 0.0000 N 0 0 0 0 0 0 6.3607 1.5117 0.0000 C 0 0 0 0 0 0 5.1457 1.4947 0.0000 C 0 0 0 0 0 0 5.1457 0.7607 0.0000 C 0 0 0 0 0 0 5.7257 0.4107 0.0000 C 0 0 0 0 0 0 3.8737 1.4947 0.0000 C 0 0 0 0 0 0 3.8737 0.7607 0.0000 C 0 0 0 0 0 0 0.4697 1.1277 0.0000 C 0 0 0 0 0 0 -0.1662 0.7607 0.0000 C 0 0 0 0 0 0 1.1057 0.7607 0.0000 C 0 0 0 0 0 0 1.1057 0.0267 0.0000 C 0 0 0 0 0 0 -0.1662 0.0267 0.0000 C 0 0 0 0 0 0 0.4697 -0.3402 0.0000 C 0 0 0 0 0 0 -6.7735 -1.1497 0.0000 C 0 0 0 0 0 0 -7.4837 -0.9419 0.0000 O 0 0 0 0 0 0 -6.5984 -1.8687 0.0000 O 0 0 0 0 0 0 -6.2385 -0.6386 0.0000 C 0 0 0 0 0 0 -5.5282 -0.8464 0.0000 C 0 0 0 0 0 0 -4.9932 -0.3352 0.0000 C 0 0 0 0 0 0 -4.2829 -0.5430 0.0000 N 0 0 0 0 0 0 -3.7479 -0.0318 0.0000 C 0 0 0 0 0 0 -4.1283 0.6028 0.0000 O 0 0 0 0 0 0 -2.2932 -1.1252 0.0000 C 0 0 0 0 0 0 -1.7581 -0.6140 0.0000 O 0 0 0 0 0 0 -2.1180 -1.8442 0.0000 O 0 0 0 0 0 0 1.8697 0.7607 0.0000 N 0 0 0 0 0 0 2.2397 1.4016 0.0000 C 0 0 0 0 0 0 2.2397 0.1198 0.0000 C 0 0 0 0 0 0 5.7257 -0.3882 0.0000 N 0 0 0 0 0 0 6.9837 1.8717 0.0000 N 0 0 0 0 0 0 1 9 2 0 0 0 0 1 6 1 0 0 0 0 2 10 2 0 0 0 0 2 7 1 0 0 0 0 3 5 2 0 0 0 0 3 6 1 0 0 0 0 4 8 2 0 0 0 0 4 5 1 0 0 0 0 5 33 1 0 0 0 0 6 7 2 0 0 0 0 7 8 1 0 0 0 0 8 32 1 0 0 0 0 9 10 1 0 0 0 0 10 31 1 0 0 0 0 11 12 2 0 0 0 0 11 13 1 0 0 0 0 12 15 1 0 0 0 0 13 14 2 0 0 0 0 13 29 1 0 0 0 0 14 16 1 0 0 0 0 15 16 2 0 0 0 0 15 24 1 0 0 0 0 17 18 1 0 0 0 0 17 19 2 0 0 0 0 17 20 1 0 0 0 0 20 21 1 0 0 0 0 21 22 1 0 0 0 0 22 23 1 0 0 0 0 22 26 1 0 0 0 0 23 24 1 0 0 0 0 24 25 2 0 0 0 0 26 27 2 0 0 0 0 26 28 1 0 0 0 0 29 30 1 0 0 0 0 29 31 1 0 0 0 0 M STY 5 1 SUP 2 SUP 3 SUP 4 SUP 5 SUP M SAL 1 9 17 18 19 20 21 22 23 24 25 M SBL 1 2 29 22 M SMT 1 HO2CCH2CH2CHNHCO M SBV 1 29 2.7000 -0.7899 M SBV 1 22 3.5817 0.0586 M SAL 2 3 26 27 28 M SBL 2 1 29 M SMT 2 CO2H M SBV 2 29 -2.7000 0.7899 M SAL 3 3 29 30 31 M SBL 3 2 19 14 M SMT 3 NMeCH2 M SBV 3 19 -0.7639 0.0000 M SBV 3 14 1.6340 0.6408 M SAL 4 1 32 M SBL 4 1 12 M SMT 4 NH2 M SBV 4 12 0.0000 0.7989 M SAL 5 1 33 M SBL 5 1 9 M SMT 5 NH2 M SBV 5 9 -0.6230 -0.3599 M END > 740 > K > M END chemtool-1.6.14/examples/tbutylazulene.cht0000644000175000001440000000061310715417303020054 0ustar martinusersChemtool Version 1.6 geometry 467 464 bonds 15 188 248 225 197 2 0 0 225 197 285 216 0 0 0 285 216 285 279 0 0 0 285 279 225 298 2 0 0 225 298 188 248 0 0 0 285 216 336 179 2 0 0 285 279 336 316 0 0 0 336 316 402 298 1 0 0 336 179 400 197 0 0 0 400 197 425 248 2 0 0 425 248 402 298 0 0 0 225 298 203 358 0 0 0 203 358 139 358 0 0 0 203 358 235 413 6 0 0 203 358 203 422 5 0 0 atoms 0 splines 0 chemtool-1.6.14/examples/textsizes.cht0000644000175000001440000000036410715417303017212 0ustar martinusersChemtool Version 1.6.11 geometry 1279 722 bonds 0 atoms 6 668 448 CH_2CH_3 0 0 0 6 229 657 CH_2CH_3 0 0 0 5 409 249 CH_2CH_3 0 0 0 4 894 151 CH_2CH_3 0 0 0 3 1148 300 CH_2CH_3 0 0 0 2 1163 588 CH_2CH_3 0 0 0 1 splines 0 scalefactors 4.668000 2 chemtool-1.6.14/examples/viagra.cht0000644000175000001440000000205510715417303016420 0ustar martinusersChemtool Version 1.6 geometry 512 639 bonds 36 94 229 149 197 2 0 0 149 197 204 229 0 0 0 204 229 204 293 2 0 0 204 293 149 325 0 0 0 149 325 94 293 2 0 0 94 293 94 229 0 0 0 149 197 149 133 0 0 0 149 133 94 101 0 0 0 94 101 94 37 0 0 0 149 325 149 389 0 0 0 149 389 213 389 4 0 0 149 389 85 389 4 0 0 149 389 149 453 0 0 0 149 453 204 485 0 0 0 204 485 204 549 0 0 0 204 549 149 581 0 0 0 149 581 94 549 0 0 0 94 549 94 485 0 0 0 94 485 149 453 0 0 0 204 229 259 197 0 0 0 259 197 259 133 0 0 0 259 133 314 101 0 0 0 314 101 369 133 0 0 0 369 133 369 197 1 0 0 369 197 314 229 0 0 0 314 229 259 197 2 0 0 369 133 429 114 0 0 0 429 114 466 165 0 0 0 466 165 429 216 2 0 0 429 216 369 197 0 0 0 314 101 314 37 4 0 0 429 114 448 54 0 0 0 259 133 231 110 0 0 0 429 216 448 276 0 0 0 448 276 416 331 0 0 0 416 331 448 386 0 0 0 atoms 12 149 133 O -1 0 0 3 149 389 S -1 0 0 3 213 389 O -1 0 0 3 85 389 O -1 0 0 3 149 453 N -1 0 0 3 149 581 N -1 0 0 3 259 133 N -1 0 0 3 314 229 N -1 0 0 3 314 37 O -1 0 0 3 429 114 N -1 0 0 3 466 165 N -1 0 0 3 231 110 H -1 0 0 3 splines 0 chemtool-1.6.14/examples/rutamycin_b.cht0000644000175000001440000000271310715417303017464 0ustar martinusersChemtool Version 1.6 geometry 841 821 bonds 56 215 267 160 235 2 0 0 160 235 160 171 0 0 0 160 171 215 139 0 0 0 215 139 270 171 0 0 0 270 171 325 139 0 0 0 325 139 380 171 0 0 0 380 171 435 139 0 0 0 435 139 490 171 0 0 0 490 171 545 139 0 0 0 545 139 600 171 0 0 0 600 171 655 139 0 0 0 655 139 710 171 0 0 0 710 171 710 235 0 0 0 710 235 655 267 0 0 0 655 267 655 331 2 0 0 655 331 600 363 0 0 0 600 363 600 427 0 0 0 545 459 490 427 0 0 0 545 459 545 523 0 0 0 545 523 490 555 0 0 0 490 555 435 523 0 0 0 435 523 435 459 0 0 0 435 459 490 427 0 0 0 380 427 325 459 0 0 0 325 459 270 427 0 0 0 270 427 270 363 0 0 0 270 363 215 331 2 0 0 215 331 215 267 0 0 0 435 587 435 651 0 0 0 435 651 490 683 0 0 0 490 683 545 651 0 0 0 545 651 545 587 0 0 0 600 683 655 651 0 0 0 655 651 710 683 0 0 0 215 139 215 75 5 0 0 270 171 270 235 5 0 0 435 139 435 75 5 0 0 545 139 545 75 5 0 0 655 139 655 75 5 0 0 710 235 765 267 5 0 0 270 427 215 459 5 0 0 435 459 380 427 5 0 0 490 555 435 587 5 0 0 490 427 490 363 5 0 0 545 459 600 427 5 0 0 490 683 490 747 5 0 0 545 651 600 683 5 0 0 600 363 545 331 4 0 0 215 459 215 523 0 0 0 545 587 490 555 6 0 0 655 587 655 651 6 0 0 325 75 325 139 6 0 0 490 171 490 235 5 0 0 765 139 710 171 6 0 0 380 171 380 235 4 0 0 600 171 600 235 4 0 0 atoms 10 600 427 O -1 0 0 3 435 523 O -1 0 0 3 545 587 O -1 0 0 3 380 235 O -1 0 0 3 545 331 O -1 0 0 3 765 139 OH 0 0 0 3 655 587 OH 0 0 0 3 490 235 OH 0 0 0 3 270 235 OH 0 0 0 3 600 235 O -1 0 0 3 splines 0 chemtool-1.6.14/examples/tcdd.cht0000644000175000001440000000121410715417303016061 0ustar martinusersChemtool Version 1.6 geometry 586 232 bonds 22 148 115 203 83 0 0 0 203 83 258 115 0 0 0 258 115 258 179 0 0 0 258 179 203 211 0 0 0 203 211 148 179 0 0 0 148 179 148 115 0 0 0 203 147 233 115 11 0 0 258 115 313 83 0 0 0 313 83 368 115 0 0 0 368 115 368 179 0 0 0 368 179 313 211 0 0 0 313 211 258 179 0 0 0 367 115 422 83 0 0 0 422 83 477 115 0 0 0 477 115 477 179 0 0 0 477 179 422 211 0 0 0 422 211 367 179 0 0 0 421 146 452 115 11 0 0 478 115 533 83 0 0 0 478 179 533 211 0 0 0 148 179 93 211 0 0 0 148 115 93 83 0 0 0 atoms 6 313 83 O -1 0 0 3 313 211 O -1 0 0 3 93 83 Cl -2 0 0 3 93 211 Cl -2 0 0 3 533 83 Cl 0 0 0 3 533 211 Cl 0 0 0 3 splines 0 chemtool-1.6.14/examples/camphor.cht0000644000175000001440000000043310715417303016576 0ustar martinusersChemtool Version 1.2 geometry 273 276 bonds 12 106 155 161 123 0 161 123 216 155 0 216 155 216 219 0 106 155 106 219 0 106 219 161 251 0 161 251 216 219 0 161 123 142 183 0 142 183 161 251 0 142 183 167 182 0 142 183 117 182 0 161 123 162 86 0 216 155 249 134 4 atoms 1 249 134 O -1 chemtool-1.6.14/examples/pteridin.cht0000644000175000001440000000057710715417303016774 0ustar martinusersChemtool Version 1.6 geometry 456 333 bonds 11 194 206 249 174 2 0 0 249 174 304 206 0 0 0 304 206 304 270 2 0 0 304 270 249 302 0 0 0 249 302 194 270 2 0 0 194 270 194 206 0 0 0 305 207 360 175 0 0 0 360 175 415 207 2 0 0 415 207 415 271 0 0 0 415 271 360 303 2 0 0 360 303 305 271 0 0 0 atoms 4 360 175 N -1 0 0 3 249 302 N -1 0 0 3 249 174 N -1 0 0 3 415 271 N -1 0 0 3 splines 0 chemtool-1.6.14/examples/bufotalin.cht0000644000175000001440000000166510715417303017140 0ustar martinusersChemtool Version 1.0 geometry 1019 988 bounds 37 255 635 255 571 0 255 571 310 539 0 310 539 365 571 0 365 571 365 635 0 365 635 310 667 0 310 667 255 635 0 365 571 365 507 0 365 571 420 539 0 420 539 475 571 0 475 571 475 635 0 475 635 420 667 0 420 667 365 635 0 420 539 420 475 0 420 475 475 443 0 475 443 530 475 0 530 475 530 539 0 530 539 475 571 0 530 475 530 411 0 530 475 590 456 0 590 456 627 507 0 627 507 590 558 0 590 558 530 539 0 590 456 590 392 0 590 392 535 360 0 590 392 645 360 1 645 360 645 296 0 645 296 590 264 0 590 264 535 296 0 535 296 535 360 1 530 539 530 603 0 590 264 590 200 4 627 507 691 507 0 691 507 755 507 0 755 507 755 571 4 755 507 819 507 0 255 635 200 667 0 365 635 365 699 0 atoms 16 691 507 O -1 755 507 C -1 365 507 CH_3 0 365 699 CH_3 0 530 411 CH_3 0 819 507 CH_3 0 530 603 OH 0 200 667 HO -2 645 296 O -2 590 200 O -2 755 571 O -2 475 788 Bufotalin -1 310 602 A -1 423 602 B -1 473 508 C -1 575 510 D -1 chemtool-1.6.14/examples/c70.cht0000644000175000001440000000364410715417303015545 0ustar martinusersChemtool Version 1.5 geometry 442 402 bonds 105 304 139 339 137 0 304 139 302 166 0 304 139 271 133 0 339 137 327 130 0 339 137 370 161 0 327 130 347 147 0 327 130 285 127 0 302 166 335 191 0 302 166 267 188 0 370 161 368 189 0 370 161 390 180 0 347 147 380 173 0 347 147 326 164 0 335 191 368 189 0 335 191 319 229 0 368 189 386 225 0 390 180 380 173 0 390 180 400 219 0 380 173 379 205 0 326 164 346 199 0 326 164 287 162 0 319 229 339 264 0 319 229 278 227 0 386 225 400 219 0 386 225 375 261 0 400 219 402 250 0 379 205 346 199 0 379 205 391 242 0 346 199 325 231 0 339 264 375 261 0 339 264 316 298 0 375 261 383 293 0 402 250 391 242 0 402 250 397 287 0 391 242 376 273 0 325 231 343 268 0 325 231 282 229 0 285 127 271 133 0 285 127 266 143 0 271 133 238 155 0 287 162 266 143 0 287 162 264 195 0 266 143 230 166 0 230 166 217 171 0 230 166 230 198 0 217 171 238 155 0 217 171 202 209 0 238 155 235 183 0 235 183 267 188 0 235 183 213 216 0 267 188 278 227 0 278 227 255 260 0 316 298 329 331 0 316 298 274 296 0 329 331 294 350 0 329 331 361 329 0 294 350 294 366 0 294 350 260 328 0 294 366 329 363 0 294 366 261 360 0 329 363 317 356 0 329 363 362 345 0 317 356 339 331 0 317 356 275 354 0 362 345 361 329 0 362 345 384 319 0 361 329 383 293 0 383 293 397 287 0 397 287 384 319 0 384 319 374 313 0 374 313 339 331 0 374 313 376 273 0 339 331 320 303 0 275 354 257 327 0 275 354 261 360 0 320 303 280 301 0 320 303 343 268 0 280 301 257 327 0 280 301 261 264 0 343 268 376 273 0 282 229 264 195 0 282 229 261 264 0 264 195 230 198 0 230 198 213 234 0 213 234 227 266 0 213 234 198 240 0 227 266 224 305 0 227 266 261 264 0 224 305 257 327 0 224 305 210 311 0 261 360 229 339 0 229 339 229 322 0 229 339 210 311 0 229 322 260 328 0 229 322 210 284 0 260 328 274 296 0 274 296 255 260 0 255 260 221 254 0 221 254 210 284 0 221 254 213 216 0 210 284 199 277 0 199 277 210 311 0 199 277 198 240 0 198 240 202 209 0 202 209 213 216 0 atoms 0 splines 0 chemtool-1.6.14/examples/claisen.cht0000644000175000001440000000142010715417303016560 0ustar martinusersChemtool Version 1.6 geometry 1013 470 bonds 25 255 328 310 296 0 0 0 310 296 365 328 0 0 0 365 328 365 392 0 0 0 365 392 310 424 0 0 0 310 424 255 392 0 0 0 255 392 255 328 0 0 0 310 360 340 328 11 0 0 310 296 310 232 0 0 0 310 232 365 200 0 0 0 365 200 420 232 0 0 0 420 232 420 296 2 0 0 510 364 658 364 9 0 0 756 332 811 300 0 0 0 811 300 866 332 0 0 0 866 332 866 396 0 0 0 866 396 811 428 0 0 0 811 428 756 396 0 0 0 756 396 756 332 0 0 0 811 364 841 332 11 0 0 811 300 811 236 0 0 0 365 200 365 136 0 0 0 866 332 921 300 0 0 0 921 300 921 236 0 0 0 921 236 866 204 1 0 0 866 204 866 140 0 0 0 atoms 5 364 135 R 0 0 0 3 310 232 O -1 0 0 3 866 141 R 0 0 0 3 811 236 OH 0 0 0 3 572 345 @DT 0 0 0 3 splines 2 344 220 367 240 367 240 386 220 1 0 404 261 387 279 387 279 392 307 1 0 chemtool-1.6.14/examples/byrostatin1.cht0000644000175000001440000000317410715417303017431 0ustar martinusersChemtool Version 1.6 geometry 894 682 bonds 61 208 140 263 108 0 0 0 263 108 318 140 2 0 0 318 140 373 108 0 0 0 373 108 428 140 0 0 0 428 140 428 204 0 0 0 428 204 373 236 0 0 0 373 236 318 204 0 0 0 318 204 318 140 0 0 0 428 140 483 108 0 0 0 483 108 538 140 0 0 0 538 140 538 204 0 0 0 538 140 593 108 0 0 0 593 108 648 140 0 0 0 648 140 648 204 0 0 0 648 204 593 236 0 0 0 593 236 538 204 0 0 0 593 108 561 53 0 0 0 593 108 625 53 0 0 0 648 140 703 108 0 0 0 703 108 758 140 0 0 0 758 140 758 204 4 0 0 758 140 813 108 0 0 0 593 236 593 300 0 0 0 593 300 648 332 0 0 0 648 332 703 300 0 0 0 703 300 758 332 0 0 0 758 332 758 396 0 0 0 758 396 703 428 0 0 0 703 428 648 396 0 0 0 703 428 703 492 0 0 0 703 492 648 524 0 0 0 703 492 758 524 0 0 0 648 396 593 428 0 0 0 593 428 538 396 0 0 0 538 396 483 428 0 0 0 483 428 483 492 0 0 0 483 492 538 524 0 0 0 538 524 593 492 0 0 0 593 492 593 428 0 0 0 538 524 538 588 1 0 0 538 588 593 620 0 0 0 428 524 428 588 0 0 0 428 588 373 620 4 0 0 428 588 483 620 0 0 0 483 428 483 364 0 0 0 483 428 428 396 0 0 0 428 396 428 332 0 0 0 428 332 373 300 1 0 0 373 300 373 236 0 0 0 428 396 364 396 0 0 0 428 396 396 451 0 0 0 428 140 483 108 5 0 0 373 236 373 300 5 0 0 593 236 593 300 5 0 0 758 396 703 428 5 0 0 703 492 648 524 5 0 0 648 140 703 108 5 0 0 428 524 483 492 6 0 0 647 374 648 332 6 0 0 538 78 538 140 6 0 0 483 428 483 364 5 0 0 atoms 13 428 204 O -1 0 0 3 538 204 O -1 0 0 3 703 108 O -1 0 0 3 758 396 O -1 0 0 3 538 396 O -1 0 0 3 428 524 O -1 0 0 3 373 620 O -1 0 0 3 758 204 O -1 0 0 3 648 524 HO -2 0 0 3 538 78 HO -2 0 0 3 647 374 OH 0 0 0 3 593 620 COOMe 0 0 0 3 208 140 MeOOC -2 0 0 3 splines 0 chemtool-1.6.14/examples/14263232.mol0000644000175000001440000000517410715417303016073 0ustar martinusers -ISIS- 03270013122D 27 30 0 0 0 0 0 0 0 0999 V2000 -1.4333 1.5833 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0 -1.4333 0.9000 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0 -0.8338 0.5584 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 -0.8338 1.9292 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0 -0.2385 1.5833 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.2401 0.9018 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.3575 1.9228 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.9498 1.5846 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1.5421 1.9211 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1.5440 2.5972 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.9476 2.9396 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.3532 2.5973 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 0.9548 0.9015 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.3593 0.5620 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.3585 -0.1177 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.9516 -0.4601 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1.5470 -0.1207 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0 1.5494 0.5612 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 0.9481 3.6229 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 2.1394 1.5786 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 2.7375 1.9250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 3.3333 1.5833 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 2.2167 0.0625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1.7250 -0.7750 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.8338 2.6125 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 -2.0323 1.9229 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -2.0305 0.5573 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 11 12 1 0 0 0 0 13 14 2 0 0 0 0 5 6 2 0 0 0 0 6 14 1 0 0 0 0 13 8 1 0 0 0 0 7 5 1 0 0 0 0 7 8 2 0 0 0 0 1 4 1 0 0 0 0 13 18 1 0 0 0 0 14 15 1 0 0 0 0 15 16 2 0 0 0 0 16 17 1 0 0 0 0 17 18 1 0 0 0 0 2 3 1 0 0 0 0 11 19 2 0 0 0 0 3 6 1 0 0 0 0 9 20 1 0 0 0 0 5 4 1 0 0 0 0 20 21 1 0 0 0 0 21 22 1 0 0 0 0 1 2 1 0 0 0 0 17 23 1 0 0 0 0 7 12 1 0 0 0 0 17 24 1 0 0 0 0 8 9 1 0 0 0 0 4 25 1 6 0 0 0 9 10 2 0 0 0 0 1 26 1 1 0 0 0 10 11 1 0 0 0 0 2 27 1 6 0 0 0 M END chemtool-1.6.14/examples/anthocyanidine.cht0000644000175000001440000000143210715417303020142 0ustar martinusersChemtool Version 1.6 geometry 763 602 bonds 27 254 389 309 357 2 0 0 309 357 364 389 0 0 0 364 389 364 453 2 0 0 364 453 309 485 0 0 0 309 485 254 453 2 0 0 254 453 254 389 0 0 0 364 389 420 358 0 0 0 420 358 475 390 2 0 0 475 390 475 454 0 0 0 475 454 420 486 2 0 0 420 486 364 453 0 0 0 254 389 200 357 0 0 0 309 485 309 548 0 0 0 475 454 530 486 0 0 0 475 390 529 360 0 0 0 584 264 640 296 2 0 0 640 296 640 360 0 0 0 640 360 584 392 2 0 0 584 392 529 360 0 0 0 529 360 529 296 2 0 0 529 296 584 264 0 0 0 640 296 694 266 0 0 0 640 360 694 392 0 0 2 584 264 584 200 0 0 6 418 327 426 327 11 1 0 410 327 426 327 0 1 0 418 320 418 335 0 1 0 atoms 7 420 358 O -1 0 0 3 200 357 HO -2 0 0 3 309 548 OH 0 0 0 3 530 486 OH 0 0 0 3 694 266 OH 0 0 0 3 584 200 OH 0 6 0 3 694 392 OH 0 2 0 3 splines 0 chemtool-1.6.14/examples/Dehydrotubifolin.cht0000644000175000001440000000123310715417303020456 0ustar martinusersChemtool Version 1.6 geometry 550 338 bonds 25 161 181 216 213 2 0 0 216 213 216 276 0 0 0 216 276 161 308 2 0 0 161 308 106 277 0 0 0 106 277 105 213 2 0 0 105 213 161 181 0 0 0 276 194 313 245 0 0 0 313 245 276 296 2 0 0 276 296 216 276 0 0 0 216 213 276 194 0 0 0 302 137 365 130 0 0 0 365 130 402 181 0 0 0 402 181 376 239 0 0 0 376 239 313 245 0 0 0 276 194 302 137 0 0 0 214 187 202 126 0 0 0 202 126 256 95 0 0 0 256 95 320 95 0 0 0 320 95 380 114 0 0 0 380 114 440 95 2 0 0 440 95 500 114 0 0 0 302 137 339 188 6 0 0 276 194 214 187 10 0 0 302 137 256 95 10 0 0 402 181 380 114 10 0 0 atoms 3 276 296 N -1 0 0 3 256 95 N -1 0 0 3 339 188 H -1 0 0 3 splines 0 chemtool-1.6.14/examples/atp.cht0000644000175000001440000000242410715417303015733 0ustar martinusersChemtool Version 1.6 geometry 1012 761 bonds 33 520 371 584 371 0 0 0 584 371 648 371 0 0 0 648 371 648 474 0 0 0 648 474 699 437 0 0 0 699 437 750 474 0 0 0 750 474 731 534 0 0 0 731 534 668 534 0 0 0 668 534 648 474 0 0 0 750 474 750 372 0 0 0 750 372 713 321 0 0 0 713 321 750 270 2 0 0 750 270 810 289 0 0 0 810 289 810 352 1 0 0 810 352 750 372 0 0 0 810 289 865 257 0 0 0 865 257 920 289 2 0 0 920 289 920 353 0 0 0 920 353 865 385 2 0 0 865 385 810 353 0 0 0 865 257 865 193 0 0 0 731 534 731 598 0 0 0 668 534 668 598 0 0 0 520 371 520 307 4 0 0 520 371 520 435 0 0 0 520 371 456 371 0 0 0 456 371 392 371 0 0 0 392 371 392 307 0 0 0 392 371 392 435 4 0 0 392 371 328 371 0 0 0 328 371 264 371 0 0 0 264 371 264 307 4 0 0 264 371 264 435 0 0 0 264 371 200 371 0 0 0 atoms 25 520 371 P -1 0 0 3 584 371 O -1 0 0 3 648 371 CH_2 0 0 0 3 520 307 O -1 0 0 3 699 437 O -1 0 0 3 731 598 OH 0 0 0 3 668 598 HO -2 0 0 3 750 372 N -2 0 0 3 750 270 N -2 0 0 3 865 385 N -2 0 0 3 920 289 N -2 0 0 3 865 193 NH_2 0 0 0 3 450 692 Adenosintriphosphat-ATP 0 0 0 3 456 371 O -1 0 0 3 328 371 O -1 0 0 3 328 371 O -1 0 0 3 392 371 P -1 0 0 3 264 371 P -1 0 0 3 392 435 O -1 0 0 3 264 307 O -1 0 0 3 200 371 ^-O -2 0 0 3 392 307 O^- 0 0 0 3 392 307 O^- 0 0 0 3 520 435 O^- 0 0 0 3 264 435 O^- 0 0 0 3 splines 0 chemtool-1.6.14/examples/Lepicidin-A-Aglycon.cht0000644000175000001440000000165110715417303020620 0ustar martinusersChemtool Version 1.6 geometry 707 578 bonds 34 263 246 263 182 0 0 0 263 182 318 150 0 0 0 318 150 318 86 0 0 0 318 86 373 54 0 0 0 373 54 428 86 0 0 0 428 86 428 150 0 0 0 428 150 483 182 0 0 0 263 246 318 278 0 0 0 318 278 373 246 0 0 0 373 246 428 278 0 0 0 531 289 505 347 0 0 0 505 347 442 341 0 0 0 442 341 428 278 0 0 0 428 278 484 247 0 0 0 484 247 531 289 2 0 0 483 182 484 247 0 0 0 532 405 495 457 0 0 0 495 457 432 451 0 0 0 432 451 406 393 2 0 0 406 393 442 341 0 0 0 505 347 532 405 0 0 0 592 426 592 489 0 0 0 592 489 533 508 0 0 0 533 508 495 457 0 0 0 532 405 592 426 0 0 0 208 150 153 182 0 0 0 592 489 643 526 5 0 0 318 278 318 342 4 0 0 483 182 538 150 4 0 0 428 86 483 54 5 0 0 428 150 373 182 5 0 0 564 350 532 405 6 0 0 428 214 428 278 6 0 0 208 150 263 182 6 0 0 atoms 7 538 150 O -1 0 0 3 318 342 O -1 0 0 3 263 246 O -1 0 0 3 483 54 OH 0 0 0 3 428 214 H -1 0 0 3 564 350 H -1 0 0 3 643 526 OH 0 0 0 3 splines 0 chemtool-1.6.14/examples/dodecahedran.cht0000644000175000001440000000112210715417303017542 0ustar martinusersChemtool Version 1.5 geometry 271 246 bonds 30 147 193 142 224 0 147 193 111 146 0 147 193 204 172 0 142 224 194 224 0 142 224 101 197 0 194 224 232 191 0 194 224 185 196 10 232 191 247 143 0 232 191 204 172 0 247 143 228 95 0 247 143 218 146 10 185 196 128 180 10 185 196 218 146 10 101 197 128 180 10 101 197 82 149 0 111 146 82 149 0 111 146 144 96 0 128 180 125 120 10 204 172 201 112 0 228 95 201 112 0 228 95 187 68 0 218 146 182 99 10 82 149 97 101 0 144 96 201 112 0 144 96 135 68 0 125 120 182 99 10 125 120 97 101 10 187 68 182 99 10 187 68 135 68 0 97 101 135 68 0 atoms 0 splines 0 chemtool-1.6.14/examples/tetracyclin.cht0000644000175000001440000000202010715417303017460 0ustar martinusersChemtool Version 1.6.3 geometry 707 458 bonds 32 123 240 123 176 0 0 0 123 176 178 144 2 0 0 178 144 233 176 0 0 0 233 176 233 240 2 0 0 233 240 178 272 0 0 0 178 272 123 240 2 0 0 233 176 288 144 0 0 0 288 144 343 176 0 0 0 343 176 343 240 0 0 0 343 240 288 272 0 0 0 288 272 233 240 0 0 0 343 176 398 144 0 0 0 398 144 453 176 0 0 0 453 176 453 240 0 0 0 453 240 398 272 0 0 0 398 272 343 240 2 0 0 453 176 508 144 0 0 0 508 144 563 176 0 0 0 563 176 563 240 2 0 0 563 240 508 272 0 0 0 508 272 453 240 0 0 0 178 272 178 336 0 0 0 288 144 233 112 5 0 0 288 144 343 112 6 0 0 453 176 453 112 6 0 0 508 144 508 80 6 0 0 563 176 618 144 0 0 0 563 240 643 280 0 0 0 508 272 508 336 4 0 0 453 240 453 304 6 0 0 398 272 398 336 0 0 0 288 272 288 336 4 0 0 atoms 13 233 112 HO -2 0 0 3 343 112 CH_3 0 0 0 3 453 112 H -1 0 0 3 508 80 N(CH_3)_2 0 0 0 3 618 144 OH 0 0 0 3 453 304 OH 0 0 0 3 398 336 OH 0 0 0 3 178 336 OH 0 0 0 3 288 336 O -1 0 0 3 508 336 O -1 0 0 3 643 280 CONH_2 0 0 0 3 363 417 Tetracyclin -1 0 0 3 433 406 0 0 0 3 splines 0 chemtool-1.6.14/examples/v3000.mol0000644000175000001440000000104610715417303015727 0ustar martinusersL-Alanine GSMACCS-II07129516502D 1 0.00366 0.00000 0 Figure 1, J. Chem. Inf. Comput. Sci., Vol 32, No. 3., 1992 0 0 0 0 0 999V3000 M V30 BEGIN CTAB M V30 COUNTS 6 5 0 0 1 M V30 BEGIN ATOM M V30 1 C -0.6622 0.5342 0 0 CFG=2 M V30 2 C 0.6622 -0.3 0 0 M V30 3 C -0.7207 2.0817 0 0 MASS=13 M V30 4 N -1.8622 -0.3695 0 0 CHG=1 M V30 5 O 0.622 -1.8037 0 0 M V30 6 O 1.9464 0.4244 0 0 CHG=-1 M V30 END ATOM M V30 BEGIN BOND M V30 1 1 1 2 M V30 2 1 1 3 CFG=1 M V30 3 1 1 4 M V30 4 2 2 5 M V30 5 1 2 6 M V30 END BOND M V30 END CTAB M END chemtool-1.6.14/examples/indigo.cht0000644000175000001440000000133110715417303016414 0ustar martinusersChemtool Version 1.6 geometry 734 383 bonds 25 194 206 249 174 2 0 0 249 174 304 206 0 0 0 304 206 304 270 2 0 0 304 270 249 302 0 0 0 249 302 194 270 2 0 0 194 270 194 206 0 0 0 304 206 364 187 0 0 0 364 187 401 238 0 0 0 401 238 364 289 0 0 0 364 289 304 270 0 0 0 401 238 461 238 4 0 0 461 238 498 186 0 0 0 498 186 558 205 0 0 0 558 205 558 268 1 0 0 558 268 498 287 0 0 0 498 287 461 238 0 0 0 558 205 613 173 0 0 0 613 173 668 205 2 0 0 668 205 668 269 0 0 0 668 269 613 301 2 0 0 613 301 558 268 0 0 0 364 187 383 127 4 0 0 498 287 479 347 4 0 0 498 186 479 126 0 0 0 364 289 383 349 0 0 0 atoms 6 383 127 O -1 0 0 3 479 347 O -1 0 0 3 498 186 N -1 0 0 3 364 289 N -1 0 0 3 479 126 H -1 0 0 3 383 349 H -1 0 0 3 splines 0 chemtool-1.6.14/examples/krebs.cht0000644000175000001440000000410210715417303016250 0ustar martinusersChemtool Version 1.4 geometry 1986 1915 bonds 39 1193 318 1225 373 0 1225 373 1193 428 0 1193 318 1225 263 0 1193 428 1225 483 0 1225 373 1289 373 0 1225 373 1161 373 0 1525 608 1557 663 0 1557 663 1525 718 0 1525 608 1557 553 0 1525 718 1557 773 0 1557 663 1621 663 0 1525 718 1461 718 0 1565 1213 1597 1268 0 1597 1268 1565 1323 0 1565 1213 1597 1158 0 1565 1323 1597 1378 0 1565 1323 1501 1323 4 1232 1499 1264 1554 0 1264 1554 1232 1609 0 1232 1499 1264 1444 0 1232 1609 1264 1664 0 1232 1609 1168 1609 4 373 1197 405 1252 2 405 1252 373 1307 0 373 1197 405 1142 0 411 635 443 690 0 443 690 411 745 0 411 635 443 580 0 443 690 507 690 0 777 337 809 392 0 809 392 777 447 0 777 337 809 282 0 809 392 873 392 4 693 1540 725 1595 0 725 1595 693 1650 0 693 1540 725 1485 0 894 116 949 84 0 894 116 839 84 4 894 116 894 180 0 atoms 39 1225 263 COO^- 0 1225 483 COO^- 0 1289 373 COO^- 0 1161 373 HO -2 1557 553 COO^- 0 1557 773 COO^- 0 1621 663 COO^- 0 1597 1158 COO^- 0 1597 1378 COO^- 0 1501 1323 O -1 1264 1444 COO^- 0 1168 1609 O -1 1270 1669 S|C|o|A 0 405 1142 COO^- 0 373 1307 ^-OOC -2 443 580 COO^- 0 411 745 ^-OOC -2 507 690 OH 0 809 282 COO^- 0 777 447 ^-OOC -2 873 392 O 0 725 1485 COO^- 0 693 1650 ^-OOC -2 1480 717 HO -2 839 84 O -1 949 84 S|C|o|A 0 1079 151 HS|C|o|A 0 1455 1072 CO_2 0 1791 867 NAD^+ 0 1580 1480 NAD^+ 0 1305 1370 CO_2 0 769 1741 ATP 0 1085 1735 ADP+P 0 239 1451 FADH_2 0 445 1650 FAD 0 430 411 NAD^+ 0 610 289 NADH\+H^+ 0 1806 1052 NADH\+H^+ 0 1519 1612 NADH\+H^+ 0 splines 16 835 350 987 325 987 325 1145 347 2 1287 400 1377 450 1377 450 1487 560 2 1612 792 1650 922 1650 922 1630 1107 2 1515 1357 1440 1467 1440 1467 1302 1555 2 1117 1615 982 1645 982 1645 765 1587 2 640 1532 517 1437 517 1437 417 1290 2 355 1130 332 950 332 950 370 777 2 510 532 625 435 625 435 735 382 2 916 201 987 359 987 359 1072 179 2 1629 875 1579 999 1579 999 1501 1060 2 1774 875 1664 947 1664 947 1785 1046 1 1553 1471 1427 1432 1427 1432 1500 1594 1 1489 1385 1386 1417 1386 1417 1332 1394 2 1084 1711 972 1621 972 1621 805 1707 1 491 1621 520 1422 520 1422 330 1447 1 475 427 563 482 563 482 652 316 1 chemtool-1.6.14/examples/G-host.pdb0000644000175000001440000002511110715417303016275 0ustar martinusersCOMPND Title REMARK 1 PDB to MMOD atom-numbering translation table; the mmod numbers REMARK 1 pertain to the .dat file from which this file was created, REMARK 1 not to one created from this file: REMARK 1 PDB: 1 2 3 4 5 6 7 8 9 REMARK 1 MMOD: 1 2 3 4 5 6 7 8 9 / REMARK 1 PDB: 10 11 12 13 14 15 16 17 18 REMARK 1 MMOD: 10 11 12 13 14 15 16 24 25 / REMARK 1 PDB: 19 20 21 22 23 24 25 26 27 REMARK 1 MMOD: 26 27 28 29 30 31 32 33 34 / REMARK 1 PDB: 28 29 30 31 32 33 34 35 36 REMARK 1 MMOD: 35 36 54 55 56 57 58 59 60 / REMARK 1 PDB: 37 38 39 40 41 42 43 44 45 REMARK 1 MMOD: 61 66 67 68 69 70 71 72 73 / REMARK 1 PDB: 46 47 48 49 50 51 52 53 54 REMARK 1 MMOD: 74 75 76 17 18 19 20 21 22 / REMARK 1 PDB: 55 56 57 58 59 60 61 62 63 REMARK 1 MMOD: 23 37 38 39 40 41 42 43 44 / REMARK 1 PDB: 64 65 66 67 68 69 70 71 72 REMARK 1 MMOD: 45 46 47 48 49 50 51 52 53 / REMARK 1 PDB: 73 74 75 76 77 78 79 80 81 REMARK 1 MMOD: 62 63 64 65 77 78 79 80 81 / REMARK 1 PDB: 82 83 84 85 86 87 REMARK 1 MMOD: 82 83 84 85 86 87 / HETATM 1 C GUE G 0 4.758 -0.842 0.135 0.25 0.25 0 HETATM 2 C GUE G 0 3.647 0.169 -0.164 0.25 0.25 0 HETATM 3 C GUE G 0 3.134 0.483 1.243 0.54 0.54 0 HETATM 4 O04 GUE G 0 4.312 0.535 2.036 -0.50 -0.50 0 HETATM 5 C GUE G 0 5.226 -0.443 1.544 0.25 0.25 0 HETATM 6 N06 GUE G 0 2.437 1.751 1.294 -0.44 -0.44 0 HETATM 7 C GUE G 0 2.961 3.000 1.508 0.20 0.20 0 HETATM 8 N08 GUE G 0 2.088 3.964 1.423 -0.49 -0.49 0 HETATM 9 C09 GUE G 0 0.891 3.309 1.141 0.12 0.12 0 HETATM 10 C10 GUE G 0 1.090 1.951 1.089 0.34 0.34 0 HETATM 11 N11 GUE G 0 0.162 0.980 0.870 -0.51 -0.51 0 HETATM 12 C12 GUE G 0 -1.066 1.477 0.675 0.46 0.46 0 HETATM 13 N13 GUE G 0 -1.345 2.825 0.670 -0.56 -0.56 0 HETATM 14 C14 GUE G 0 -0.419 3.827 0.915 0.52 0.52 0 HETATM 15 O15 GUE G 0 -0.794 5.000 0.910 -0.51 -0.51 0 HETATM 16 N16 GUE G 0 -2.074 0.632 0.478 -0.80 -0.80 0 HETATM 17 C24 GUE G 0 6.665 0.076 1.556 0.25 0.25 0 HETATM 18 O25 GUE G 0 7.603 -0.943 1.159 -0.40 -0.40 0 HETATM 19 C26 GUE G 0 8.894 -0.570 1.134 0.60 0.60 0 HETATM 20 O27 GUE G 0 9.296 0.529 1.404 -0.45 -0.45 0 HETATM 21 C28 GUE G 0 9.765 -1.746 0.712 0.00 0.00 0 HETATM 22 O29 GUE G 0 4.266 -2.206 0.130 -0.40 -0.40 0 HETATM 23 C30 GUE G 0 3.918 -4.336 -0.789 0.00 0.00 0 HETATM 24 O31 GUE G 0 2.643 -0.362 -1.060 -0.40 -0.40 0 HETATM 25 C32 GUE G 0 2.053 0.497 -1.909 0.60 0.60 0 HETATM 26 O33 GUE G 0 2.327 1.660 -2.024 -0.45 -0.45 0 HETATM 27 C34 GUE G 0 0.981 -0.228 -2.711 0.00 0.00 0 HETATM 28 C35 GUE G 0 4.440 -2.922 -0.998 0.60 0.60 0 HETATM 29 O36 GUE G 0 4.918 -2.510 -2.019 -0.45 -0.45 0 HETATM 30 H54 GUE G 0 5.168 -1.322 2.188 0.00 0.00 0 HETATM 31 H55 GUE G 0 5.576 -0.688 -0.569 0.00 0.00 0 HETATM 32 H56 GUE G 0 4.151 1.054 -0.552 0.00 0.00 0 HETATM 33 H57 GUE G 0 2.501 -0.331 1.598 0.00 0.00 0 HETATM 34 H58 GUE G 0 4.008 3.169 1.723 0.20 0.20 0 HETATM 35 H59 GUE G 0 -2.282 3.155 0.448 0.38 0.38 0 HETATM 36 H60 GUE G 0 -1.918 -0.378 0.493 0.40 0.40 0 HETATM 37 H61 GUE G 0 -3.023 0.968 0.328 0.40 0.40 0 HETATM 38 H66 GUE G 0 6.730 0.934 0.885 0.00 0.00 0 HETATM 39 H67 GUE G 0 6.893 0.400 2.573 0.00 0.00 0 HETATM 40 H68 GUE G 0 10.810 -1.436 0.686 0.00 0.00 0 HETATM 41 H69 GUE G 0 9.647 -2.561 1.426 0.00 0.00 0 HETATM 42 H70 GUE G 0 9.463 -2.085 -0.279 0.00 0.00 0 HETATM 43 H71 GUE G 0 4.032 -4.909 -1.709 0.00 0.00 0 HETATM 44 H72 GUE G 0 4.482 -4.817 0.011 0.00 0.00 0 HETATM 45 H73 GUE G 0 2.864 -4.295 -0.516 0.00 0.00 0 HETATM 46 H74 GUE G 0 0.126 -0.434 -2.067 0.00 0.00 0 HETATM 47 H75 GUE G 0 0.662 0.398 -3.544 0.00 0.00 0 HETATM 48 H76 GUE G 0 1.382 -1.166 -3.094 0.00 0.00 0 HETATM 49 N17 HOS H 0 0.380 -2.017 0.398 -1.00 -1.00 0 HETATM 50 C18 HOS H 0 -0.710 -2.898 0.230 0.38 0.38 0 HETATM 51 N19 HOS H 0 -1.921 -2.364 0.330 -0.49 -0.49 0 HETATM 52 C20 HOS H 0 -2.965 -3.187 0.185 0.23 0.23 0 HETATM 53 C21 HOS H 0 -2.831 -4.546 -0.076 -0.14 -0.14 0 HETATM 54 C22 HOS H 0 -1.557 -5.083 -0.183 -0.02 -0.02 0 HETATM 55 C23 HOS H 0 -0.469 -4.239 -0.024 -0.14 -0.14 0 HETATM 56 C37 HOS H 0 -4.316 -2.600 0.315 0.00 0.00 0 HETATM 57 C38 HOS H 0 -4.549 -1.319 -0.203 -0.11 -0.11 0 HETATM 58 C39 HOS H 0 -5.774 -0.673 0.003 0.00 0.00 0 HETATM 59 C40 HOS H 0 -5.935 0.723 -0.455 0.23 0.23 0 HETATM 60 C41 HOS H 0 -6.811 -1.350 0.667 -0.11 -0.11 0 HETATM 61 C42 HOS H 0 -6.601 -2.655 1.143 -0.11 -0.11 0 HETATM 62 C43 HOS H 0 -5.352 -3.278 0.980 -0.11 -0.11 0 HETATM 63 N44 HOS H 0 -4.926 1.576 -0.232 -0.49 -0.49 0 HETATM 64 C45 HOS H 0 -5.089 2.845 -0.630 0.47 0.47 0 HETATM 65 C46 HOS H 0 -6.240 3.301 -1.274 -0.03 -0.03 0 HETATM 66 C47 HOS H 0 -7.270 2.404 -1.510 -0.02 -0.02 0 HETATM 67 C48 HOS H 0 -7.115 1.092 -1.089 -0.14 -0.14 0 HETATM 68 N49 HOS H 0 -4.066 3.676 -0.368 -0.49 -0.49 0 HETATM 69 C50 HOS H 0 -4.148 4.961 -0.728 0.39 0.39 0 HETATM 70 C51 HOS H 0 -5.270 5.482 -1.386 -0.11 -0.11 0 HETATM 71 C52 HOS H 0 -6.343 4.637 -1.668 -0.11 -0.11 0 HETATM 72 N53 HOS H 0 -3.070 5.823 -0.432 -1.00 -1.00 0 HETATM 73 H62 HOS H 0 0.211 -1.030 0.591 0.43 0.43 0 HETATM 74 H63 HOS H 0 1.326 -2.348 0.304 0.43 0.43 0 HETATM 75 H64 HOS H 0 -3.698 -5.178 -0.200 0.11 0.11 0 HETATM 76 H65 HOS H 0 -1.415 -6.134 -0.385 0.11 0.11 0 HETATM 77 H77 HOS H 0 -3.768 -0.814 -0.748 0.11 0.11 0 HETATM 78 H78 HOS H 0 -7.761 -0.865 0.834 0.11 0.11 0 HETATM 79 H79 HOS H 0 -7.396 -3.172 1.662 0.11 0.11 0 HETATM 80 H80 HOS H 0 -5.188 -4.263 1.390 0.11 0.11 0 HETATM 81 H81 HOS H 0 -8.175 2.718 -2.008 0.11 0.11 0 HETATM 82 H82 HOS H 0 -7.900 0.371 -1.261 0.11 0.11 0 HETATM 83 H83 HOS H 0 -5.311 6.524 -1.669 0.11 0.11 0 HETATM 84 H84 HOS H 0 -7.223 5.009 -2.169 0.11 0.11 0 HETATM 85 H85 HOS H 0 -2.242 5.489 0.076 0.43 0.43 0 HETATM 86 H86 HOS H 0 0.535 -4.627 -0.096 0.11 0.11 0 HETATM 87 H87 HOS H 0 -3.100 6.796 -0.692 0.43 0.43 0 CONECT 1 2 5 22 31 CONECT 2 1 3 24 32 CONECT 3 2 4 6 33 CONECT 4 3 5 CONECT 5 4 1 17 30 CONECT 6 3 7 10 CONECT 7 6 34 CONECT 7 8 CONECT 7 8 CONECT 8 9 CONECT 8 7 CONECT 8 7 CONECT 9 8 14 CONECT 9 10 CONECT 9 10 CONECT 10 6 11 CONECT 10 9 CONECT 10 9 CONECT 11 10 CONECT 11 12 CONECT 11 12 CONECT 12 13 16 CONECT 12 11 CONECT 12 11 CONECT 13 12 14 35 CONECT 14 13 9 CONECT 14 15 CONECT 14 15 CONECT 15 14 CONECT 15 14 CONECT 16 12 36 37 CONECT 17 5 18 38 39 CONECT 18 17 19 CONECT 19 18 21 CONECT 19 20 CONECT 19 20 CONECT 20 19 CONECT 20 19 CONECT 21 19 40 41 42 CONECT 22 1 28 CONECT 23 28 43 44 45 CONECT 24 2 25 CONECT 25 24 27 CONECT 25 26 CONECT 25 26 CONECT 26 25 CONECT 26 25 CONECT 27 25 46 47 48 CONECT 28 22 23 CONECT 28 29 CONECT 28 29 CONECT 29 28 CONECT 29 28 CONECT 30 5 CONECT 31 1 CONECT 32 2 CONECT 33 3 CONECT 34 7 CONECT 35 13 CONECT 36 16 CONECT 37 16 CONECT 38 17 CONECT 39 17 CONECT 40 21 CONECT 41 21 CONECT 42 21 CONECT 43 23 CONECT 44 23 CONECT 45 23 CONECT 46 27 CONECT 47 27 CONECT 48 27 CONECT 49 50 73 74 CONECT 50 49 51 CONECT 50 55 CONECT 50 55 CONECT 51 50 CONECT 51 52 CONECT 51 52 CONECT 52 53 56 CONECT 52 51 CONECT 52 51 CONECT 53 52 75 CONECT 53 54 CONECT 53 54 CONECT 54 55 76 CONECT 54 53 CONECT 54 53 CONECT 55 54 86 CONECT 55 50 CONECT 55 50 CONECT 56 52 57 CONECT 56 62 CONECT 56 62 CONECT 57 56 77 CONECT 57 58 CONECT 57 58 CONECT 58 59 60 CONECT 58 57 CONECT 58 57 CONECT 59 58 67 CONECT 59 63 CONECT 59 63 CONECT 60 58 78 CONECT 60 61 CONECT 60 61 CONECT 61 62 79 CONECT 61 60 CONECT 61 60 CONECT 62 61 80 CONECT 62 56 CONECT 62 56 CONECT 63 64 CONECT 63 59 CONECT 63 59 CONECT 64 63 68 CONECT 64 65 CONECT 64 65 CONECT 65 66 71 CONECT 65 64 CONECT 65 64 CONECT 66 65 81 CONECT 66 67 CONECT 66 67 CONECT 67 59 82 CONECT 67 66 CONECT 67 66 CONECT 68 64 CONECT 68 69 CONECT 68 69 CONECT 69 70 72 CONECT 69 68 CONECT 69 68 CONECT 70 69 83 CONECT 70 71 CONECT 70 71 CONECT 71 65 84 CONECT 71 70 CONECT 71 70 CONECT 72 69 85 87 CONECT 73 49 CONECT 74 49 CONECT 75 53 CONECT 76 54 CONECT 77 57 CONECT 78 60 CONECT 79 61 CONECT 80 62 CONECT 81 66 CONECT 82 67 CONECT 83 70 CONECT 84 71 CONECT 85 72 CONECT 86 55 CONECT 87 72 ENDchemtool-1.6.14/examples/penicillin_v.cht0000644000175000001440000000135110715417303017620 0ustar martinusersChemtool Version 1.6 geometry 756 364 bonds 24 87 101 142 69 2 0 0 142 69 197 101 0 0 0 197 101 197 165 2 0 0 197 165 142 197 0 0 0 142 197 87 165 2 0 0 87 165 87 101 0 0 0 197 165 252 197 0 0 0 252 197 307 165 0 0 0 307 165 362 197 0 0 0 362 197 417 165 0 0 0 417 165 472 197 0 0 0 472 197 472 261 0 0 0 472 197 536 197 0 0 0 536 197 536 261 0 0 0 536 261 472 261 0 0 0 536 197 596 178 0 0 0 596 178 633 229 0 0 0 633 229 596 280 0 0 0 596 280 536 261 0 0 0 633 229 688 197 0 0 0 633 229 688 261 0 0 0 362 197 362 261 4 0 0 472 261 427 306 4 0 0 596 280 633 331 0 0 0 atoms 8 252 197 O -1 0 0 3 417 165 N -1 0 0 3 536 261 N -1 0 0 3 596 178 S -1 0 0 3 362 261 O -1 0 0 3 427 306 O -1 0 0 3 633 331 CO_2H 0 0 0 3 633 331 CO_2H 0 0 0 3 splines 0 chemtool-1.6.14/examples/labeltest0000644000175000001440000000134410715417303016351 0ustar martinusersChemtool Version 1.6 geometry 938 436 bonds 18 210 133 265 101 0 0 0 265 101 328 101 0 0 0 216 253 270 221 0 0 0 270 221 334 221 0 0 0 204 397 258 367 0 0 0 258 367 322 367 0 0 0 210 133 146 133 0 0 0 216 253 153 253 0 0 0 204 397 140 397 0 0 0 729 102 784 70 0 0 0 784 70 847 70 0 0 0 735 222 789 190 0 0 0 789 190 853 190 0 0 0 723 366 777 336 0 0 0 777 336 841 336 0 0 0 729 102 665 102 0 0 0 735 222 674 222 0 0 0 723 366 659 366 0 0 0 atoms 12 328 101 CH_2OH 0 0 0 3 334 221 CH_2OH 0 0 0 6 322 367 CH_2OH 0 0 0 0 146 133 HOCH_2CH_2 -2 0 0 3 153 253 HOCH_2CH_2 -2 0 0 6 140 397 HOCH_2CH_2 -2 0 0 0 665 102 H_2N -2 0 0 3 674 222 H_2N -2 0 0 6 659 366 H_2N -2 0 0 0 841 336 NH_2 0 0 0 0 853 190 NH_2 0 0 0 6 847 70 NH_2 0 0 0 3 splines 0 chemtool-1.6.14/examples/bcarotin.pdb0000644000175000001440000001411410715417303016736 0ustar martinusersHEADER 1 573.6 beta-Carotin ATOM 1 C PIM 1 -12.388 -2.286 -.966 1.00 -.06 ATOM 2 C PIM 1 -11.634 -3.391 -1.666 1.00 -.04 ATOM 3 C PIM 1 -10.294 -1.603 .048 1.00 -.06 ATOM 4 C PIM 1 -9.329 -.720 -.275 1.00 -.06 ATOM 5 C PIM 1 -7.897 -1.011 -.040 1.00 -.05 ATOM 6 C PIM 1 -7.095 .014 .326 1.00 -.06 ATOM 7 C PIM 1 -7.385 -2.428 -.185 1.00 -.04 ATOM 8 C PIM 1 -5.684 -.139 .716 1.00 -.06 ATOM 9 C PIM 1 -4.943 .949 1.027 1.00 -.06 ATOM 10 C PIM 1 -3.550 .891 1.506 1.00 -.05 ATOM 11 C PIM 1 -2.861 2.055 1.519 1.00 -.06 ATOM 12 C PIM 1 -2.905 -.399 1.965 1.00 -.04 ATOM 13 C PIM 1 -1.455 2.197 1.929 1.00 -.06 ATOM 14 C PIM 1 -.944 3.435 2.090 1.00 -.06 ATOM 15 C PIM 1 .469 3.571 2.476 1.00 -.06 ATOM 16 C PIM 1 1.075 4.733 2.812 1.00 -.05 ATOM 17 H PIM 1 1.068 2.674 2.492 1.00 .06 ATOM 18 C PIM 1 2.515 4.658 3.114 1.00 -.06 ATOM 19 C PIM 1 .305 6.035 2.854 1.00 -.04 ATOM 20 H PIM 1 2.952 3.681 3.250 1.00 .06 ATOM 21 C PIM 1 3.326 5.733 3.236 1.00 -.06 ATOM 22 C PIM 1 4.740 5.532 3.590 1.00 -.06 ATOM 23 C PIM 1 5.596 6.527 3.918 1.00 -.05 ATOM 24 H PIM 1 5.114 4.520 3.614 1.00 .06 ATOM 25 C PIM 1 5.159 7.976 3.915 1.00 -.04 ATOM 26 C PIM 1 6.973 6.122 4.268 1.00 -.06 ATOM 27 C PIM 1 7.788 6.854 5.059 1.00 -.06 ATOM 28 H PIM 1 7.301 5.183 3.854 1.00 .07 ATOM 29 H PIM 1 7.373 7.760 5.472 1.00 .06 ATOM 30 C PIM 1 9.200 6.537 5.420 1.00 -.04 ATOM 31 C PIM 1 10.076 7.557 5.518 1.00 -.06 ATOM 32 C PIM 1 9.722 8.994 5.211 1.00 -.04 ATOM 33 C PIM 1 11.527 7.349 5.867 1.00 -.02 ATOM 34 C PIM 1 11.786 6.073 6.615 1.00 -.08 ATOM 35 H PIM 1 11.873 8.195 6.480 1.00 .03 ATOM 36 H PIM 1 12.107 7.329 4.933 1.00 .03 ATOM 37 C PIM 1 10.925 5.055 6.520 1.00 -.07 ATOM 38 H PIM 1 2.932 6.725 3.081 1.00 .06 ATOM 39 H PIM 1 6.016 8.636 4.109 1.00 .03 ATOM 40 H PIM 1 4.395 8.129 4.691 1.00 .03 ATOM 41 H PIM 1 4.733 8.223 2.931 1.00 .03 ATOM 42 H PIM 1 10.599 9.633 5.391 1.00 .02 ATOM 43 H PIM 1 8.897 9.319 5.862 1.00 .02 ATOM 44 H PIM 1 9.417 9.079 4.158 1.00 .03 ATOM 45 H PIM 1 .172 6.411 1.829 1.00 .03 ATOM 46 H PIM 1 -.679 5.869 3.315 1.00 .03 ATOM 47 H PIM 1 .854 6.779 3.449 1.00 .03 ATOM 48 H PIM 1 -1.594 4.280 1.926 1.00 .06 ATOM 49 H PIM 1 -5.242 -1.120 .777 1.00 .06 ATOM 50 H PIM 1 -5.401 1.920 .918 1.00 .06 ATOM 51 H PIM 1 -3.381 2.948 1.209 1.00 .06 ATOM 52 H PIM 1 -3.676 -1.150 2.187 1.00 .03 ATOM 53 H PIM 1 -2.318 -.214 2.877 1.00 .03 ATOM 54 H PIM 1 -2.243 -.777 1.172 1.00 .03 ATOM 55 H PIM 1 -.806 1.353 2.108 1.00 .06 ATOM 56 H PIM 1 -9.578 .234 -.711 1.00 .07 ATOM 57 H PIM 1 -7.528 1.002 .369 1.00 .06 ATOM 58 H PIM 1 -8.067 -3.002 -.830 1.00 .03 ATOM 59 H PIM 1 -7.331 -2.900 .806 1.00 .03 ATOM 60 H PIM 1 -6.385 -2.415 -.644 1.00 .03 ATOM 61 H PIM 1 -10.015 -2.543 .498 1.00 .06 ATOM 62 H PIM 1 -12.341 -4.004 -2.244 1.00 .02 ATOM 63 H PIM 1 -11.130 -4.026 -.923 1.00 .02 ATOM 64 H PIM 1 -10.888 -2.956 -2.348 1.00 .03 ATOM 65 C PIM 1 -12.556 -.346 .578 1.00 .00 ATOM 66 C PIM 1 -14.509 -.937 -.861 1.00 -.08 ATOM 67 C PIM 1 -13.895 -.062 -.058 1.00 -.07 ATOM 68 C PIM 1 -11.830 .996 .730 1.00 -.05 ATOM 69 C PIM 1 -12.812 -.893 1.987 1.00 -.05 ATOM 70 H PIM 1 -10.904 .858 1.306 1.00 .02 ATOM 71 H PIM 1 -12.483 1.702 1.263 1.00 .02 ATOM 72 H PIM 1 -11.592 1.398 -.266 1.00 .02 ATOM 73 H PIM 1 -13.403 -.163 2.560 1.00 .02 ATOM 74 H PIM 1 -11.850 -1.063 2.493 1.00 .02 ATOM 75 H PIM 1 -13.364 -1.842 1.925 1.00 .02 ATOM 76 C PIM 1 -13.881 -2.270 -1.163 1.00 -.02 ATOM 77 C PIM 1 -11.762 -1.397 -.178 1.00 -.04 ATOM 78 H PIM 1 -14.322 -3.019 -.488 1.00 .03 ATOM 79 H PIM 1 -14.112 -2.549 -2.201 1.00 .03 ATOM 80 C PIM 1 9.685 5.116 5.663 1.00 .00 ATOM 81 C PIM 1 10.049 4.450 4.329 1.00 -.05 ATOM 82 C PIM 1 8.637 4.273 6.403 1.00 -.05 ATOM 83 H PIM 1 10.439 3.440 4.522 1.00 .02 ATOM 84 H PIM 1 10.816 5.045 3.813 1.00 .02 ATOM 85 H PIM 1 9.157 4.377 3.691 1.00 .02 ATOM 86 H PIM 1 8.360 4.778 7.340 1.00 .02 ATOM 87 H PIM 1 9.069 3.289 6.635 1.00 .02 ATOM 88 H PIM 1 7.742 4.130 5.781 1.00 .02 ATOM 89 H PIM 1 11.152 4.138 7.041 1.00 .06 ATOM 90 H PIM 1 12.683 5.965 7.205 1.00 .06 ATOM 91 H PIM 1 -15.480 -.699 -1.267 1.00 .06 ATOM 92 H PIM 1 -14.392 .868 .171 1.00 .06 END chemtool-1.6.14/examples/amine.mol0000644000175000001440000000344310715417303016253 0ustar martinusers ROtkserver12159708312D 0 0.00000 0.00000??? 19 18 0 0 0 0 0 0 0 0 1 V2000 -5.4279 193.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 33.5433 170.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 72.5144 193.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 111.4860 170.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 150.4570 193.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 189.4280 170.7500 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 8.5221 217.4121 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 -29.5900 207.2000 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 -19.3779 169.0879 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 15.6095 149.3773 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 51.4771 149.3774 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 90.4481 214.6227 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 54.5806 214.6226 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 93.5523 149.3773 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 129.4198 149.3774 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 168.3908 214.6226 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 132.5232 214.6226 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 189.4279 142.8500 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 213.5901 184.7000 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 2 3 1 0 0 0 0 3 4 1 0 0 0 0 4 5 1 0 0 0 0 5 6 1 0 0 0 0 1 7 1 0 0 0 0 1 8 1 0 0 0 0 1 9 1 0 0 0 0 2 10 1 0 0 0 0 2 11 1 0 0 0 0 3 12 1 0 0 0 0 3 13 1 0 0 0 0 4 14 1 0 0 0 0 4 15 1 0 0 0 0 5 16 1 0 0 0 0 5 17 1 0 0 0 0 6 18 1 0 0 0 0 6 19 1 0 0 0 0 M END chemtool-1.6.14/examples/pagodan.cht0000644000175000001440000000227010715417303016557 0ustar martinusersChemtool Version 1.5 geometry 334 360 bonds 50 157 209 217 205 0 157 209 138 161 0 157 209 141 266 0 157 209 151 194 0 217 205 240 260 0 217 205 236 155 0 217 205 211 191 0 138 161 95 139 0 138 161 184 124 0 138 161 117 176 0 95 139 64 162 0 95 139 84 103 0 95 139 128 139 0 240 260 190 291 0 240 260 254 284 0 240 260 273 260 0 190 291 141 266 0 190 291 188 328 0 190 291 184 276 0 184 124 236 155 0 184 124 185 84 0 184 124 178 109 0 236 155 268 128 0 236 155 258 166 0 268 128 301 147 0 268 128 276 91 0 268 128 227 133 0 141 266 130 291 0 141 266 100 271 0 151 194 211 191 0 151 194 128 139 0 151 194 132 245 0 211 191 227 133 0 211 191 230 239 0 128 139 178 109 0 128 139 110 127 0 273 260 230 239 0 273 260 304 237 0 273 260 284 296 0 184 276 132 245 0 184 276 230 239 0 184 276 178 316 0 178 109 227 133 0 178 109 178 63 0 227 133 235 114 0 100 271 132 245 0 100 271 67 252 0 100 271 92 308 0 132 245 115 236 0 230 239 242 222 0 atoms 20 185 84 H -1 188 328 H -1 117 176 H -1 130 291 H -1 254 284 H -1 258 166 H -1 64 162 H -1 84 103 H -1 301 147 H -1 276 91 H -1 110 127 H -1 304 237 H -1 284 296 H -1 178 316 H -1 178 63 H -1 235 114 H -1 67 252 H -1 92 308 H -1 115 236 H -1 242 222 H -1 splines 0 chemtool-1.6.14/examples/reaction.cht0000644000175000001440000000267210715417303016760 0ustar martinusersChemtool Version 1.3 geometry 1545 671 bonds 55 349 360 404 392 0 349 360 349 296 0 349 296 404 264 0 404 264 459 296 0 459 296 459 360 2 459 360 404 392 0 404 264 404 200 4 349 360 294 392 4 459 296 514 264 0 404 492 334 462 0 334 462 264 492 0 264 492 264 428 0 264 428 200 428 0 299 542 299 602 0 404 492 404 392 0 264 492 299 542 5 404 492 369 542 5 299 542 369 542 10 602 401 630 417 0 630 417 630 449 4 630 417 646 390 0 630 417 657 433 0 657 433 689 433 0 689 433 689 401 0 689 433 716 449 0 646 390 673 374 0 673 374 673 342 0 673 374 705 374 0 602 401 575 417 0 498 487 818 487 0 818 487 882 487 9 1240 368 1295 400 0 1240 368 1240 304 0 1240 304 1295 272 0 1295 272 1350 304 0 1350 304 1350 368 2 1350 368 1295 400 0 1295 272 1295 208 4 1240 368 1185 400 4 1350 304 1405 272 0 1295 500 1225 470 0 1225 470 1155 500 0 1155 500 1155 436 0 1190 550 1190 610 0 1295 500 1295 400 0 1155 500 1190 550 5 1295 500 1260 550 5 1190 550 1260 550 10 1155 436 1100 404 0 1100 404 1045 436 0 1045 436 990 404 0 990 404 990 340 4 990 404 926 404 0 926 404 910 403 0 990 404 958 459 0 atoms 26 404 200 O -1 294 392 O -2 349 296 HN -2 404 392 N -1 514 264 CH_3 0 334 462 O -1 200 428 HO -2 299 602 ODMTr 0 630 417 P -1 630 449 O -1 646 390 O -1 657 433 O -1 575 417 TsO -2 622 532 NaH,\DMF -1 1295 208 O -1 1185 400 O -2 1240 304 HN -2 1295 400 N -1 1405 272 CH_3 0 1225 470 O -1 1190 610 ODMTr 0 1100 404 O -1 990 404 P -1 990 340 O -1 910 403 |i-prO -2 958 459 |i-prO -2 chemtool-1.6.14/examples/chlorophyll.cht0000644000175000001440000000414310715417303017506 0ustar martinusersChemtool Version 1.6 geometry 740 1677 bonds 69 457 315 512 347 2 0 0 457 315 402 347 0 0 0 402 347 402 411 0 0 0 512 347 512 411 0 0 0 512 347 572 328 0 0 0 572 328 609 379 2 0 0 609 379 572 430 0 0 0 572 430 512 411 2 0 0 572 430 604 485 0 0 0 604 485 572 540 2 0 0 572 540 512 559 0 0 0 572 540 609 591 0 0 0 609 591 572 642 2 0 0 572 642 512 623 0 0 0 512 623 512 559 0 0 0 512 623 457 655 1 0 0 457 655 402 623 0 0 0 402 623 402 559 1 0 0 402 559 342 540 0 0 0 402 623 342 642 0 0 0 342 642 305 591 0 0 0 305 591 342 540 0 0 0 342 540 310 485 2 0 0 310 485 342 430 0 0 0 402 411 342 430 0 0 0 342 430 305 379 2 0 0 305 379 342 328 0 0 0 342 328 402 347 2 0 0 342 642 310 697 0 0 0 310 697 255 729 0 0 0 255 729 255 793 0 0 0 255 793 319 793 4 0 0 255 793 255 857 0 0 0 255 857 200 889 0 0 0 200 889 255 921 0 0 0 255 921 255 985 2 0 0 255 985 200 1017 0 0 0 200 1017 255 1049 0 0 0 255 1049 200 1081 0 0 0 200 1081 255 1113 0 0 0 255 1113 200 1145 0 0 0 255 985 310 1017 0 0 0 255 1113 319 1113 0 0 0 200 1145 255 1177 0 0 0 255 1177 200 1209 0 0 0 200 1209 255 1241 0 0 0 255 1241 200 1273 0 0 0 255 1241 319 1241 0 0 0 200 1273 255 1305 0 0 0 255 1305 200 1337 0 0 0 200 1337 255 1369 0 0 0 255 1369 200 1401 0 0 0 255 1369 319 1369 0 0 0 572 642 553 702 0 0 0 457 655 489 710 0 0 0 489 710 553 702 0 0 0 489 710 457 765 0 0 0 553 702 608 734 1 0 0 402 411 458 482 0 0 0 512 559 458 482 0 0 0 512 411 458 482 0 0 0 402 559 458 482 0 0 0 342 328 342 264 0 0 0 342 264 342 200 4 0 0 572 328 572 264 0 0 0 609 379 673 379 0 0 0 609 591 673 591 0 0 0 305 591 241 591 0 0 0 305 379 241 379 0 0 0 atoms 25 402 411 N -1 0 0 3 512 411 N -1 0 0 3 512 559 N -1 0 0 3 402 559 N -1 0 0 3 310 697 CH_2 0 0 0 3 255 729 H_2C -2 0 0 3 255 793 C -1 0 0 3 255 857 O -1 0 0 3 319 793 O -1 0 0 3 310 1017 CH_3 0 0 0 3 319 1113 CH_3 0 0 0 3 319 1241 CH_3 0 0 0 3 319 1369 CH_3 0 0 0 3 200 1401 H_3C -2 0 0 3 457 765 COOCH_3 0 0 0 3 608 734 O -1 0 0 3 458 482 Mg -1 0 0 3 342 264 CH 0 0 0 3 342 200 CH_2 0 0 0 3 572 264 CH_3 0 0 0 3 673 379 C_2H_5 0 0 0 3 673 591 CH_3 0 0 0 3 241 379 H_3C -2 0 0 3 241 591 H_3C -2 0 0 3 287 1525 Chlorophyll-a 0 0 0 3 splines 0 chemtool-1.6.14/examples/AMP.cht0000644000175000001440000000154410715417303015566 0ustar martinusersChemtool Version 1.6 geometry 609 520 bonds 25 498 354 428 314 0 0 0 428 314 358 354 0 0 0 358 354 358 290 0 0 0 358 290 294 290 0 0 0 444 151 444 215 2 0 0 444 215 389 247 0 0 0 389 247 334 215 2 0 0 334 215 334 151 0 0 0 334 151 389 119 2 0 0 389 119 444 151 0 0 0 389 119 389 67 0 0 0 444 215 499 247 0 0 0 499 247 554 215 0 0 0 554 215 554 151 1 0 0 554 151 444 151 0 0 0 499 247 498 354 0 0 0 358 354 390 409 5 0 0 498 354 466 409 5 0 0 390 409 466 409 10 0 0 390 409 390 473 0 0 0 466 409 466 473 0 0 0 294 290 230 290 0 0 0 230 290 230 226 0 0 0 230 290 166 290 0 0 0 230 290 198 345 0 0 0 atoms 13 428 314 O -1 0 0 3 389 247 N -1 0 0 3 499 247 N -1 0 0 3 554 151 N -1 0 0 3 334 151 N -1 0 0 3 389 67 NH_2 0 0 0 3 390 473 OH 0 0 0 3 466 473 OH 0 0 0 3 230 226 O -1 0 0 3 294 290 O -1 0 0 3 166 290 O^- -2 0 0 3 198 345 O^- -2 0 0 3 230 290 P -1 0 0 3 splines 0 chemtool-1.6.14/examples/Neu20000644000175000001440000000070610715417303015204 0ustar martinusersChemtool Version 1.3 geometry 451 242 bonds 16 279 185 339 204 10 376 153 339 204 5 219 204 250 148 0 219 204 279 185 5 376 153 316 172 0 316 172 250 148 0 376 153 410 170 0 279 185 264 220 0 219 204 180 185 0 250 148 214 160 0 214 160 181 141 0 181 141 146 157 0 214 160 235 129 0 376 153 376 121 0 181 141 182 110 0 146 157 112 136 0 atoms 8 316 172 O -1 410 170 OH 0 235 129 OH 0 182 110 OH 0 376 121 COOH 0 112 136 HO -2 180 185 H_2N -2 264 220 OH 0 chemtool-1.6.14/examples/Adenosine.cht0000644000175000001440000000127410715417303017056 0ustar martinusersChemtool Version 1.6 geometry 402 511 bonds 21 310 346 240 306 0 0 0 240 306 170 346 0 0 0 170 346 170 282 0 0 0 170 282 106 282 0 0 0 256 143 256 207 2 0 0 256 207 201 239 0 0 0 201 239 146 207 2 0 0 146 207 146 143 0 0 0 146 143 201 111 2 0 0 201 111 256 143 0 0 0 201 111 201 59 0 0 0 256 207 311 239 0 0 0 311 239 366 207 0 0 0 366 207 366 143 1 0 0 366 143 256 143 0 0 0 311 239 310 346 0 0 0 170 346 202 401 5 0 0 310 346 278 401 5 0 0 202 401 278 401 10 0 0 202 401 202 465 0 0 0 278 401 278 465 0 0 0 atoms 9 240 306 O -1 0 0 3 201 239 N -1 0 0 3 311 239 N -1 0 0 3 366 143 N -1 0 0 3 146 143 N -1 0 0 3 201 59 NH_2 0 0 0 3 106 282 HO -2 0 0 3 202 465 OH 0 0 0 3 278 465 OH 0 0 0 3 splines 0 chemtool-1.6.14/undo.h0000644000175000001440000000372710715417303013756 0ustar martinusers/* libundo, an easy to use undo/redo management library Copyright 1999 Matt Kimball This program is free software; you can redistribute 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 __libundo_h #define __libundo_h #ifdef HAVE_CONFIG_H #include #endif #include /* For size_t */ typedef struct _UNDO UNDO; /* Undo session management */ int undo_new(char *session_name); int undo_destroy(void); UNDO *undo_get_session(void); int undo_set_session(UNDO *undo); /* Undo limits */ int undo_set_memory_limit(size_t max_memory); /* Memory management for undo-watched memory */ void *undo_malloc(size_t size); void *undo_realloc(void *mem, size_t size); void undo_free(void *mem); /* Recording functions */ int undo_snapshot(void); /* Undo and redo */ int undo_undo(void); int undo_redo(void); unsigned undo_get_undo_count(void); unsigned undo_get_redo_count(void); /* Error codes */ #define UNDO_NOERROR 0 /* No error */ #define UNDO_BADPARAM 1 /* Bad parameter passed to function */ #define UNDO_NOMEM 2 /* Not enough memory */ #define UNDO_NOSESSION 3 /* No undo session */ #define UNDO_NODO 4 /* Nothing to undo/redo */ #define UNDO_NOLIMIT 5 /* No memory limit specified */ /* Error recovery */ int undo_get_errcode(void); char *undo_strerror(int errcode); #endif chemtool-1.6.14/missing0000755000175000001440000002623312202253333014226 0ustar martinusers#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: chemtool-1.6.14/Makefile.sgi640000644000175000001440000000200611675350633015230 0ustar martinusersPREFIX=/usr/local LOCALEDIR=/usr/share/locale GTKCONFIGFLAGS=-I/usr/freeware/include/gtk-1.2 -I/usr/freeware/include/glib-1.2 \ -I/usr/freeware/lib64/glib/include CFLAGS=-mabi=64 -fno-builtin -O2 -Wall -Wunused ${GTKCONFIGFLAGS} -DMENU -DENABLE_NLS CC=gcc CP=/bin/cp RM=/bin/rm -f MAKE=gmake SRCS = main.c chemproc.c graph.c draw.c inout.c OBJS = main.o chemproc.o graph.o draw.o inout.o GTKCONFIGLIBS=-mabi=64 -L/usr/freeware/lib64 \ -lgtk -lgdk -lgmodule -lglib -lXi -lXext -lX11 -lm SYS_LIBRARIES = ${GTKCONFIGLIBS} -lm all: chemtool cht default: all chemtool: ${OBJS} ${CC} ${OBJS} ${SYS_LIBRARIES} -o chemtool cht: src-cht/cht-2.5.c cd src-cht;${MAKE} #.c.o: # ${CC} ${CFLAGS} ${EXTRA_INCLUDES} -c ${SRCS} install: chemtool src-cht/cht ${CP} chemtool src-cht/cht ${PREFIX}/bin ${CP} chemtool.1 ${PREFIX}/man/man1 for L in `ls locales`; do ${CP} locales/$$L/chemtool.mo ${LOCALEDIR}/$$L/LC_MESSAGES;done clean: ${RM} *.o *~ src-cht/*.o src-cht/*~ chemtool src-cht/cht chemtool-1.6.14/chemcurs.h0000644000175000001440000000424410715417303014615 0ustar martinusers#define pencil_width 18 #define pencil_height 18 #define pencil_x_hot 0 #define pencil_y_hot 0 static unsigned char pencil_bits[] = { 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x7c, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x88, 0x01, 0x00, 0x18, 0x03, 0x00, 0x30, 0x06, 0x00, 0x60, 0x0c, 0x00, 0xc0, 0x18, 0x00, 0x80, 0x31, 0x00, 0x00, 0x63, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x8c, 0x01, 0x00, 0xf8, 0x03, 0x00, 0x30, 0x03, 0x00, 0xe0, 0x01, 0x00, 0xc0, 0x00}; #define pencil_mask_width 20 #define pencil_mask_height 20 static unsigned char pencil_mask_bits[] = { 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x7c, 0x00, 0x00, 0xfc, 0x00, 0x00, 0xf8, 0x01, 0x00, 0xf8, 0x03, 0x00, 0xf0, 0x07, 0x00, 0xe0, 0x0f, 0x00, 0xc0, 0x1f, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfc, 0x01, 0x00, 0xf8, 0x03, 0x00, 0xf0, 0x03, 0x00, 0xe0, 0x01, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #define text_width 16 #define text_height 16 #define text_x_hot 7 #define text_y_hot 11 static unsigned char text_bits[] = { 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xc2, 0x21, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x00, 0x00, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0xf0, 0x07}; #define text_mask_width 16 #define text_mask_height 16 static unsigned char text_mask_bits[] = { 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xc2, 0x21, 0xc2, 0x21, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x70, 0x07, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xf0, 0x07}; #define bonds_width 16 #define bonds_height 16 #define bonds_x_hot 7 #define bonds_y_hot 7 static unsigned char bonds_bits[] = { 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xdf, 0x01, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfe, 0x9f, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x07}; #define bonds_mask_width 16 #define bonds_mask_height 16 static unsigned char bonds_mask_bits[] = { 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xff, 0xff, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0xff, 0xff, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xf0, 0x07, 0xf0, 0x07, 0xf8, 0x0f}; chemtool-1.6.14/autoclean.sh0000755000175000001440000000235710715417303015150 0ustar martinusers#!/bin/sh # Example for use of GNU gettext. # Copyright (C) 2003-2004 Free Software Foundation, Inc. # This file is in the public domain. # # Script for cleaning all autogenerated files. test ! -f Makefile || make distclean # Brought in by explicit copy. rm -f gettext.h # Brought in by autopoint. rm -f ABOUT-NLS rm -f config.rpath rm -f m4/codeset.m4 rm -f m4/gettext.m4 rm -f m4/glibc21.m4 rm -f m4/iconv.m4 rm -f m4/intdiv0.m4 rm -f m4/intmax.m4 rm -f m4/inttypes-pri.m4 rm -f m4/inttypes.m4 rm -f m4/inttypes_h.m4 rm -f m4/isc-posix.m4 rm -f m4/lcmessage.m4 rm -f m4/lib-ld.m4 rm -f m4/lib-link.m4 rm -f m4/lib-prefix.m4 rm -f m4/longdouble.m4 rm -f m4/longlong.m4 rm -f m4/nls.m4 rm -f m4/po.m4 rm -f m4/printf-posix.m4 rm -f m4/progtest.m4 rm -f m4/signed.m4 rm -f m4/size_max.m4 rm -f m4/stdint_h.m4 rm -f m4/uintmax_t.m4 rm -f m4/ulonglong.m4 rm -f m4/wchar_t.m4 rm -f m4/wint_t.m4 rm -f m4/xsize.m4 rm -f mkinstalldirs rm -f po/Makefile.in.in rm -f po/remove-potcdate.sin # Generated by aclocal. rm -f aclocal.m4 # Generated by autoconf. rm -f configure # Generated or brought in by automake. rm -f Makefile.in rm -f m4/Makefile.in rm -f install-sh rm -f missing rm -f config.guess rm -f config.sub rm -f po/*.pot rm -f po/stamp-po rm -f po/*.gmo chemtool-1.6.14/aclocal.m40000666000175000001440000010404712202253332014472 0ustar martinusers# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 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. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 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 ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 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. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/gettext.m4]) m4_include([m4/iconv.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/nls.m4]) m4_include([m4/po.m4]) m4_include([m4/progtest.m4]) m4_include([acinclude.m4]) chemtool-1.6.14/README0000644000175000001440000004571012202262475013517 0ustar martinusers------------------------------------------------------------------------------- Chemtool Version 1.6.14 ------------------------------------------------------------------------------- Chemtool is a program for drawing organic molecules and saving them in a number of file formats including eps, emf, sxd, svg or X bitmap file. It runs under the X Window System using the GTK widget set. Most operations in chemtool can be accomplished using the mouse - the first (usually the left) button is used to select or place things, the middle button modifies properties (e.g. reverses the direction of a bond), and the right button is used to delete objects. The program offers essentially unlimited undo/redo, two text fonts plus symbols, seven colors, drawing at several zoom scales, and square and hexagonal backdrop grids for easier alignment. Drawing of bonds: Bonds can be drawn in 4 different angle settings (hexagon with 30deg. intervals, two pentagons with 72deg. intervals (different orientation), and a 45deg. i octagon). (Intermediate angles are possible in all of these modes as well - just ignore the marker points in this case). Pressing the mouse button 1 sets the starting point of a bond and also displays a set of markers at the appropriate angular positions. Dragging the mouse while holding down the button draws a line in the desired direction. The bond style chooser in the center of the button bar determines the type of bond that is drawn - initially, this is a single bond. If you want to change the type of a bond later, either click on it with the middle button of your mouse to advance to the next type(s), or select the appropriate type in the chooser and then switch to bondtype mode and pick all bonds that you want to change over to the new type. Pressing the middle mousebutton on a bond when in 'Bondtype' mode reverses the direction of that bond. The bond types available in chemtool are - a single bond - a double bond (with one line shorter than the other) - a double bond (having the shorter line on the opposite side) - a centered double bond - a triple bond (with the flanking lines shorter than the center) - a wedge-shaped bond - a dashed wedge-shaped bond - a wavy line - a dashed wide line - a half arrow - an arrow - a wide bond - a circle - a dotted line - a single bond that 'cuts out' a segment from any bond it crosses - a triple bond (with equal line lengths) - a quadruple bond - light and dark pi orbital lobes The additional bond type available in the pulldown menu, - curved arrow is special insofar as no other bond type can be converted to or from this type. (it is actually a shortcut for one of the curve-drawing functions described below). Pressing the third (usually the right) mouse button deletes the bond next to the cursor position. Semiautomatic drawing of rings: Rings of 3 to 12 members can be drawn easily by holding down the Ctrl key while drawing a line. This line will then become the first segment of a ring that is automatically drawn in clockwise direction. The size of the ring defaults to that appropriate for the selected drawing mode (i.e. 5, 6 or 8 sides), but it can be set on a per-ring basis by pressing Ctlr- before drawing the ring, where numbers 3-9 correspond to 3 to 9-membered rings, while 0 to 2 select 10, 11 and 12-membered rings, respectively. Newly drawn rings can be deleted by pressing Ctrl and mouse button 3 together. Drawing of curved lines: Curved lines for objects like arrows or orbital lobes can be drawn in spline curve mode by specifing four control points that form a bounding polygon (startpoint, two points on either side of the peak, endpoint). Of the regular bondtypes available in the Style menu, the 'single line', 'semiarrow', arrow and 'dashed line' retain their usual function, while the 'wide line' type is used to denote a filled polygon. The control points are only visible in 'Move' mode, where they can be dragged around to change the form of a curve after it is drawn. For drawing curved arrows, there is also a predefined function in the bond style chooser. This is actually a shortcut for one of the curve drawing functions described above, with the second and third control points automatically generated. As such, it can not be converted to or from any of the conventional bond types. (One can, however, convert it to any of the other curve types, e.g. to change the type of arrowhead). The shape of the arrow will usually need to be adjusted by shifting the control point that appears alongside it in 'Move' mode. Inserting text: Text written into the text box can be positioned with the cursor and may appear left, middle or right-aligned in the drawing. The font size can be selected from the chooser to the right of the text entry field, while the 't/T' button next to the text-alignment buttons lets you switch between two fonts - Helvetica for regular labels, and Times Roman for descriptions. Like the line drawings, text can be in any of the colors available on the color selector. If you want to change the color, font or alignment of a label afterwards, just choose the appropriate combination of settings and then select the desired label with the left mouse button. When the text entry area is empty, this will just update the properties without changing the text itself. When the text entry area is not empty, its contents will also replace the text of the label. Copying the text of a label to the entry area is done with the middle mouse button, while the right mouse button deletes the selected label. There are two special characters to be used for sub- and superscripting the following character: '^' to shift up (e.g. N^+) '_' to shift down (e.g. CH_3) Curly braces {} can be used to mark sequences of characters to sub- or superscript, e.g. C_{10}H_{22}. The control character '|' is used to itializise the following character, as in |t-Bu, while the '#' character boldfaces it. The special character '@' switches to symbol mode, which uses the standard X11 symbol font. All alphabetic keys produce the corresponding greek characters in this mode, and several other symbols are available if their standard latin1 equivalents are already mapped onto the keyboard: yen -> infinity hyphen -> uparrow macron -> downarrow Direct input of symbol characters is also possible, e.g. by cut-and-paste from LibreOffice or other Unicode-aware programs. Internally they are converted to the above syntax where possible. Output of symbol characters outside the original X11 symbol font may not work satisfactorily, as not all tools used are sufficiently modern - in particular xfig and the transfig package used for postscript and png export will not handle multibyte characters. The symbols 'plusminus' and 'registered' (trademark) are already in the standard font, although they are not normally available on the keyboard. Use the following commands (or add the declarations to your .xmodmaprc ) to make them available via + (+): xmodmap -e 'keysym r = r R registered' \ -e 'keysym o = o O yen' \ -e 'keysym p = p P plusminus' \ -e 'keysym u = u U hyphen' \ -e 'keysym d = d D macron' (this leads to AltGr-P = plusminus, AltGr-R = registered in normal mode and AltGr-O = infinity, AltGr-U = uparrow, AltGr-D = downarrow in symbol font). For 'dots-and-crosses' diagrams, the following mappings to the symbol font might be useful: acute -> cross (e.g. keysym x = x X acute) middle dot -> filled dot (e.g. keysym d = d D periodcentered) (using the degree sign for the open dot). For drawing ionic charges, the key sequences @+ and @- provided plus and minus signs inscribed in a circle. When you want to use symbols as sub- or superscripts, place the sub- or superscripting character before the '@' character, e.g. K_@a . Labeling shortcuts : In all bond drawing modes, several keyboard shortcuts are available to add atom symbols without having to leave drawing mode. The label is placed at the current drawing position (the endpoint of the last line drawn, or the spot last clicked on). The keys 'c','h','n','o','s','p' and 'r' insert the corresponding capital letter, 'l' (lowercase L) inserts 'Cl', while '1', '2', '3' insert CH,CH_2 and CH_3, respectively. The asterisk key (*) inserts a filled circle. Pressing the space bar once allows you to enter arbitrary labels, which will be placed at the current position when you press the Return key. The keys of the numeric keypad can be used to draw short 'electron pair' lines next to an element symbol - if one imagines the element symbol to be sitting on the central '5' key, each key draws the appropriate electron pair for its position. For quick numbering of the atoms in a molecule, switch to one of the text modes, hold down the Control key and pick each atom in succession with the left mouse button. Numbering starts at 1, and the sequence can be reset at any time by clicking the right mouse button. If you need to use your own numbering scheme, clicking the middle button (while still holding down the Control key) makes it pick up whatever number is in the text entry field. Moving, rotating, flipping or scaling objects Using the 'Mark' button, you can easily select parts of the current drawing by enclosing them with a 'rubberband' rectangle. If you need to add atoms outside of the rectangular area to your selection, simply draw another rubberband around them while holding down the Ctrl key. The selected parts will appear highlighted in blue and are immediately available for - moving: simply drag the fragment to the desired position with the mouse while holding down the left mouse button. Pressing the Ctrl key limits movement to the horizontal, while pressing the Shift key selects vertical-only movement. - rotating: horizontal movement of the mouse translates to smooth rotation around the pivot point selected when pressing the mouse button. Pressing the Ctrl key switches to stepwise rotation according to the angular intervals of the current drawing mode. - flipping (mirroring) the fragment about a horizontal or vertical mirror plane through its center: this is performed by clicking on the appropraite the menu button - copying : clicking on the 'Copy' menu button creates an exact copy of the selected fragment slightly offset to the original. The mark is automatically transfered to the new copy. - rescaling: horizontal mouse movement is translated into a smooth increase or decrease of size of the marked fragment - deleting : to delete the marked fragment, simply click the third (usually the right) mouse button after it is highlighted. - optimizing: clicking on the 'bucket and broom' symbol invokes a function that removes overlapping (duplicate) bonds and labels from the drawing and tries to straighten bonds that are almost horizontal or vertical. - bracketing and framing: clicking on the bracket button invokes a pop-up menu offering a choice of brackets and various boxes. The chosen item is drawn in the size and position determined by the marker box that was drawn by the user. Centering the drawing: If there is not enough space for your molecule you can put it in the middle of the sheet with the center button. Exporting to foreign formats: You can export your molecules as an X bitmap, an encapsulated postscript file, an input file for Brian Smith' XFig program, as an MDL molfile, an input file for the Asymptote package (a powerful alternative to pictex) or in the PicTeX format. The PicTeX and Postscript output functions rely on the fig2dev program from the transfig package. You can create the outputs in different sizes according to the current zoom scale. The PicTeX and Postscript modes additionally allow scaling to an arbitrary percentage selectable on the export menu . To include the PicTeX-file in your LaTeX document, you will need the pictex macro package. Depending on the versions you use, you might also have to load the 'color' package in the preamble of your LaTeX file. If you experience 'TeX capacity exceeded' error messages, increase the extra_mem_bot parameter in your texmf.cnf file (usually located in /usr/share/texmf/web2c, /usr/local/texmf or /etc/texmf). Pictex is known for its unusual (by tex standards) memory requirements, and the standard settings often do not account for this (although you may find a comment a la 'change this if you use pictex' in the texmf.cnf file). Something like extra_mem_bot=400000 should not hurt on any moderately modern system. Adding previously saved figures: To add another molecule from a previously saved chemtool drawing, select its filename in the dialog window that comes up when you press the 'Add' button. Marking a file in the dialog automatically displays its contents in a small preview window. The newly added molecule is automatically made active so that it can be repositioned as desired. If you want to add it to a predefined position on another molecule, you can mark that attachment site by left-clicking on it instead of dragging the marker rectangle. A small green dot will appear at what is now the reference position for the new part. If you save molecules with such a marker set, it will in turn define their attachment site when they are added to another drawing. Adding one of the predefined templates: Choosing 'Templates' from the 'Tools' menu opens a second window with a small collection of predefined structures. Simply click on the image of the desired molecule to add it to your drawing. The Template window can be kept open throughout a chemtool session - if it is hidden by another window, you can move it to the front by clicking the 'Template' button in chemtool again. The data in the template system differ from normal chemtool drawings only by the fact that they are stored within the program, and in a slightly awkward format (x and y coordinates listed separately in the source file templates.h). These are meant to provide a convenient basis set available to all users, but not individually extendable (you can use the 'Add' function for your own structures). Please let us know if you want specific molecules added to the templates - their name or ideally a regular chemtool drawing file is all we need. (send email to martin@ruby.chemie.uni-freiburg.de) Importing from foreign file formats: Chemtool is able to import files written either in the PDB format originally used by the Protein Databank (which is now also written by most modeling packages), or in the molfile (V2000) format developed by MDL Inc. for their ISIS products. As both formats can contain 3D information, while chemtool at least currently does 2D drawing only, the molecule is imported as a temporary3D image first, which can be rotated using the mouse (with Z-axis rotation initiated by pressing the Ctrl key simultaneously with the (left) mouse button 1). After pressing the Return key, the current orientation is stored as a 2D projection that can be further edited. All editing commands except zooming are disabled in 3d mode. The PDB import offers a choice which of the atom symbols to import - you can either import all labels, only those of non-hydrogen atoms, optionally omitting any trailing sequence numbers, or no labels at all. Bonds are read from CONECT records, if present, or guessed from the interatomic distances. In MDL import mode, C atom labels are automatically suppressed, and bond types are preserved where possible. If you have a version of the BABEL program installed - either the original Babel written by Pat Walters or the current OpenBabel effort - chemtool will automatically offer a menu option for importing from any of the file formats this supports. Determining sum formula and molecular weight: Since development version 1.3a7, the distribution contains a helper program, cht, by Radek Liboska (Prague) to calculate sum formula and (exact) molecular weight from a chemtool drawing file. It is also available from within chemtool to calculate these data for the current structure or a marked fragment of it. Cht can be misled by duplicate bonds ( chemtool does not remove overlapping bonds, such as they might result from fusing ring systems, automatically), by reaction arrows and by the 'aromatic ring' symbol, so you should avoid these and check the plausibility of the generated sum formula where possible. The following common abbreviations are known to cht: Ac # C2 H3 O # Acetyl Ade # C5 H4 N5 # Adeninyl Bn # C7 H7 # Benzyl Bu # C4 H9 # Butyl Bz # C7 H5 O # Benzoyl BOC # C5 H9 O2 # Butyloxycarbonyl CE # C3 H4 N # Cyanoethyl Cyt # C4 H4 N3 O # Cytosinyl DBAM # C9 H19 N # Dibutylaminomethylene, biradical DMAM # C3 H7 N # Dimethylaminomethylen, biradical DMTr # C21 H19 O2 # Dimethoxytrityl Et # C2 H5 # Ethyl Gua # C5 H4 N5 O # Guaninyl iBu # C4 H9 # iso-Butyl iPr # C3 H7 # iso-Propyl Me # C H3 # Methyl Ms # C H3 S O2 # Mesyl MOC # C2 H3 O2 # Methoxycarbonyl MOM # C2 H5 O # Methoxymethyl MMTr # C20 H16 O # Monomethoxytrityl Ph # C6 H5 # Phenyl @F (phi)# C6 H5 # Phenyl Pr # C3 H7 # Propyl TBDMS # C6 H15 Si # tert-Butyldimethylsilyl TBDPS # C16 H19 Si # tert-Butyldiphenylsilyl tBu # C4 H9 # tert-Butyl Tf # C F3 S O2 # Triflyl Thy # C5 H5 N2 O2 # Thyminyl TMS # C3 H9 Si # Trimethylsilyl TMTr # C22 H22 O3 # Dimethoxytrityl Tol # C8 H7 O # Tolyl Tr # C19 H15 # Trityl Ts # C7 H7 S O2 # Tosyl Ura # C4 H3 N2 O2 # Uracilyl Z # C8 H7 O2 # Benzyloxycarbonyl Drawing functions not available within Chemtool: For features not currently supported by chemtool, like patterns or general line-drawing functions, getting Brian Smith's XFig drawing package from www-epb.lbl.gov/xfig is highly recommended. About the only thing it does not offer is support for 'chemical' linetypes and drawing angles - which is why chemtool was written as a sort of companion program. (There will probably be more of the most sorely needed drawing options added to chemtool over time, but duplicating the more general-purpose features of xfig seems rather pointless.) Licensing : For license information see the file 'COPYING' in this package. This software comes with ABSOLUTELY NO WARRANTY. ----------------------> Primary Authors: Thomas Volk (program creator, maintainer up to 1.1.1) (then a student of chemistry and biology at Ulm University) Dr. Martin Kroeker (primary developer since 1.1.2) martin@ruby.chemie.uni-freiburg.de Webpage: http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html chemtool-1.6.14/ct1.h0000644000175000001440000002104711675153355013505 0ustar martinusers/*@ignore@ splint claims the structs are redefined - i do not think so */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #ifndef MAXPATHLEN # ifdef PATH_MAX # define MAXPATHLEN PATH_MAX # else # define MAXPATHLEN 2048 # define PATH_MAX MAXPATHLEN # endif #endif #define PIXMAPWIDTH 1600 #define PIXMAPHEIGHT 1200 #define MAXCL 101 #define Hex 1 /* define angletypes and textdirect. , DONT CHANGE THEM !*/ #define Pent 2 #define Pent_switch 3 #define Octa 4 #define No_angle 0 #define Left_Text 0 #define Middle_Text -1 #define Right_Text -2 #define False 0 #define True 1 extern struct data { int x,y; int tx,ty; int bond; int smarked,tmarked; int decoration; int color; struct data *next; struct data *prev; } da_root, *new; extern struct dc { int x,y; char c[MAXCL]; int direct; int marked; int color; int font; int size; struct dc *next; struct dc *prev; } dac_root, *new_c; extern struct data_head { int pix_width, pix_height; int width, height; } head; extern struct new { int x,y; int tx,ty; int startx,starty; int n, nc; int nsp; } *hp; extern struct xy_co { int x,y; int tx,ty; } xycoord[30]; extern struct marked { int x,y; int w, h; int flag; } mark; extern struct spline { int x0,y0; int x1,y1; int x2,y2; int x3,y3; int type; int marked; int color; struct spline *next; struct spline *prev; } sp_root, *sp_new; extern float size_factor; extern int zoom_factor; extern int draw_angle; extern int text_direct; extern int font_type; extern int line_type; extern int modify; extern int addflag; extern int xbmflag; extern int drawmode; extern int xref,yref; extern int papersize; extern char *paper[11]; extern char *orientation[2]; extern int orient; extern float printscale; extern int printcmd; extern char *printcommand[4]; extern char *queuename; extern char datadir[PATH_MAX]; extern char datamask[PATH_MAX]; extern int figversion; extern int importflag; extern int pdbmode; /* chemproc.c */ extern struct data *select_vector(int mx, int my, float s_f); extern void add_struct(int x,int y,int tx, int ty, int bond, int smarked, int tmarked, int decoration, int color); extern int round_coord(int i, float step); extern void del_char(struct dc *hpc); extern void del_struct(struct data *hpc); extern void del_spline(struct spline *); extern void add_char(int ,int , char *, int , int, int, int, int); extern struct dc *select_char(int mx, int my, float s_f); extern struct xy_co *calc_angle(int x, int y, int ang_type, int angle, int); extern struct xy_co *position(int x, int y, int ax, int ay, int ang_type); extern void setup_data(void); extern void clear_data(void); extern int partial_delete(void); extern void center_mol(void); extern int move_pos(int x, int y, int tx, int ty); extern int check_pos_rec(int x, int y, int rx, int ry, int rtx, int rty); extern int partial_move(int dx, int dy); extern int partial_rotate(double rotsin, double rotcos); extern int partial_rescale(int updown, int aniso); extern int calc_vector(int dx, int dy); extern struct xy_co *multi_bonds(int mx, int my, int mtx, int mty, int r); extern struct xy_co *center_double_bond(int mx,int my,int mtx, int mty, int r); extern struct xy_co *intersect(int ax, int ay, int atx, int aty, int bx, int by, int btx, int bty); /*struct xy_co *bond_cut(int x, int y, int tx, int ty, int r);*/ extern void cut_end (int *x, int *y, int tx, int ty, int r); extern void get_center_marked (int*, int*); extern void add_box1(void); extern void add_box2(void); extern void add_box3(void); extern void add_box4(void); extern void add_bracket(void); extern void add_r_bracket(void); extern void add_brace(void); /* graph.c */ extern void CreatePix(void ); extern void FreePix(void ); extern void CopyPlane(void ); extern void Display_Mol(void); extern void Drawline( int , int, int, int , int, int ); extern void DrawWide( int, int, int, int, int,int); extern void DrawStripe( int, int, int, int, int,int); extern void DrawWedge( int, int, int, int, int,int); extern void DrawDashedWedge( int, int, int, int, int,int); extern void DrawArrow( int, int, int, int, int,int,int); extern void DrawWiggly( int, int, int, int, int,int); extern void Drawstring( int, int, char*, int, int, int, int, int, int); extern void DrawCircle( int, int, int, int, int,int); extern void DrawDotted( int , int, int, int , int, int ); extern void DrawAcross( int , int, int, int , int , int); #ifdef GTK2 extern int Extra_char(gunichar c, int ha); #else extern int Extra_char(char c); #endif extern int Load_Font(void); extern void Set_Line(int); /* draw.c */ extern void Add_double( int, int); extern void Add_vector(int); extern void Add_ring(int, int, int); extern void Del_vector( int, int); extern void Set_vector( int, int,int); extern void Put_vector( int, int); extern void Invert_vector( int, int); extern void Add_atom( int, int); extern void Add_number( int, int); extern void Fetch_atom( int, int); extern void Del_atom( int, int); extern void Set_start_rec( int, int); extern void Put_rec( int, int); extern void Del_rec(void); extern void Mark_rec(int); extern void Mark_atom( int, int); extern void Center(void); extern void Put_pmove( int, int,int); extern void Set_pmove( int, int); extern void Put_protate( int, int, int); extern void Set_pscale ( int, int); extern void Put_pscale( int, int,int); extern void Unmark_all (void); extern void Set_bondtype(int, int, int); /* dialog.c */ extern void Load(void); extern void Add(void); extern void Save(void); extern void Quit(void); extern void Zoom(GtkWidget*, gpointer); extern void Change_Text(GtkWidget*, gpointer); extern void Change_Angle(GtkWidget*, gpointer); extern void flip_horiz(void); extern void flip_vert(void); extern void copy_obj(void); /* inout.c */ extern int save_mol(FILE *fp, int partial); extern int load_mol(char *filename); extern int add_mol(char *filename); extern int export_bitmap(char *filename); extern int export_xfig(char *filename); extern int export_svg(char *filename); extern int export_mdl_mol(FILE *fp, int topipe); extern int import_mdl_mol(char *filename,int skip); extern int import_pdb(char *filename); extern int export_latex_pic(char *filename,float scalefactor); extern int export_ps_pic(char *filename, float scalefactor); extern int print_ps_pic(void); extern void xfig_line (FILE*, int, int, int, int); extern void xfig_wedge (FILE*, int, int, int, int, int, int); extern void xfig_wiggly (FILE*, int, int, int, int); extern void xfig_arrow (FILE*, int, int, int, int, int, int); extern void xfig_circle (FILE*, int, int, int, int); extern void xfig_spline (FILE *, int , int , int , int , int , int , int , int , int, int); extern int exfig(FILE*, int); extern int export_fw(char*); extern int export_sxd(char*); extern int export_babel(char*); extern int readrc(void); extern int writerc(void); extern void check_fig2dev(void); extern void check_fig2sxd(void); #ifdef LIBUNDO extern void undo_free(void*); extern void* undo_malloc(size_t); extern int undo_snapshot(); #endif extern GdkPixmap *picture; extern GtkWidget *drawing_area,*preview_area; extern GtkWidget *textbox; extern int xcent,ycent; extern int *tmpx,*tmpy; extern char formula[51],weight[21],eweight[21],compos[65]; extern void DrawDashed( int , int, int, int , int, int ); extern void tidy_mol(void); extern void Drawspline (int, int, int, int, int, int, int, int, int, int, int); extern void add_spline (int, int, int, int, int, int, int, int, int, int, int); extern void draw_preview_bonds(int, int, int, int, int); extern void pdbrotate(int,int,int); extern double *pdbx,*pdby,*pdbz; extern int *bondfrom,*bondto; extern short *bondtype,*atjust; extern char **atcode; extern int pdbn; extern int nbonds; extern float importfactor; extern int importoffset; char **intype; char **inmode; int babelin; char **outtype; char **outmode; int babelout; extern char *babel; extern GdkGC *mygc[8],*background_gc,*hlgc; extern int curpen; extern int gridtype; extern int gridx,gridy; extern int serif_flag; extern int refx,refy,refmark; extern double bondlen_mm; extern int db_dist; extern int mb_dist; extern int epsoption, use_whiteout,use_intlchars; extern int bgred,bggreen,bgblue; extern char bghexcolor[10]; extern int curfontsize; extern int atnum; extern int draw_ok; extern int sdfindex; extern int have_fig2sxd; extern int has_label(int,int); /*@end@*/ chemtool-1.6.14/Makefile.am0000644000175000001440000000213511306530236014662 0ustar martinusers# Example for use of GNU gettext. # Copyright (C) 2003 Free Software Foundation, Inc. # This file is in the public domain. # # Makefile configuration - processed by automake. # General automake options. AUTOMAKE_OPTIONS = foreign no-dependencies ACLOCAL_AMFLAGS = -I m4 # The list of subdirectories containing Makefiles. SUBDIRS = m4 po src-cht # The list of programs that are built. bin_PROGRAMS = chemtool src-cht/cht # The source files of the 'chemtool' program. chemtool_SOURCES = main.c draw.c graph.c chemproc.c undo.c inout.c templates.h gettext.h # Define a C macro LOCALEDIR indicating where catalogs will be installed. localedir = $(datadir)/locale DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ # Make sure the gettext.h include file is found. AM_CPPFLAGS = -I. -I$(srcdir) @GTK_CFLAGS@ # Link time dependencies. LDADD = @LIBINTL@ @GTK_LIBS@ @EMFLIBS@ # Additional files to be distributed. EXTRA_DIST = autogen.sh autoclean.sh # Manual files dist_man_MANS = chemtool.1 cht.1 # Softlink installed program to batch version install-exec-hook: cd $(DESTDIR)$(bindir) && \ $(LN_S) chemtool chemtoolbg chemtool-1.6.14/chemtool.xpm0000644000175000001440000001753010715417303015175 0ustar martinusers/* XPM */ static char * chemtool_xpm[] = { "48 48 198 2", " c None", ". c #9B9B9B", "+ c #999999", "@ c #9A9A9A", "# c #FFFFFF", "$ c #4C6F7F", "% c #5D889D", "& c #A9C5D2", "* c #A7C4D1", "= c #AAC5D2", "- c #C5C7C8", "; c #6899B0", "> c #C7D7DE", ", c #95AEB9", "' c #6999B0", ") c #B3CBD7", "! c #EBEBEB", "~ c #ACACAC", "{ c #C5C5C5", "] c #D4D4D4", "^ c #DADADA", "/ c #A1A1A1", "( c #FEFEFE", "_ c #A5A5A5", ": c #FCFCFC", "< c #E8E8E8", "[ c #EDEDED", "} c #F9F9F9", "| c #FDFDFD", "1 c #E5E5E5", "2 c #B1B1B1", "3 c #8D8D8D", "4 c #919191", "5 c #959595", "6 c #949494", "7 c #939393", "8 c #9C9C9C", "9 c #DCDCDC", "0 c #FBFBFB", "a c #EEEEEE", "b c #C9C9C9", "c c #868686", "d c #4B4B4B", "e c #717171", "f c #000000", "g c #BCBCBC", "h c #BBBBBB", "i c #AEAEAE", "j c #828282", "k c #BFBFBF", "l c #FAFAFA", "m c #F3F3F3", "n c #D7D7D7", "o c #A4A4A4", "p c #787878", "q c #555555", "r c #636363", "s c #C3C3C3", "t c #F4F4F4", "u c #F8F8F8", "v c #E3E3E3", "w c #B3B3B3", "x c #878787", "y c #848484", "z c #727272", "A c #B5B5B5", "B c #E7E7E7", "C c #C2C2C2", "D c #929292", "E c #A6A6A6", "F c #AFAFAF", "G c #ECECEC", "H c #F2F2F2", "I c #D0D0D0", "J c #9D9D9D", "K c #CECECE", "L c #D3D3D3", "M c #DFDFDF", "N c #DEDEDE", "O c #ABABAB", "P c #858585", "Q c #909090", "R c #C1C1C1", "S c #E9E9E9", "T c #B2B2B2", "U c #E2E2E2", "V c #F7F7F7", "W c #838383", "X c #C6C6C6", "Y c #A7A7A7", "Z c #A0A0A0", "` c #E1E1E1", " . c #E0E0E0", ".. c #C4C4C4", "+. c #B7B7B7", "@. c #A8A8A8", "#. c #A9A9A9", "$. c #E6E6E6", "%. c #C7C7C7", "&. c #7C7C7C", "*. c #5C5C5C", "=. c #626262", "-. c #CDCDCD", ";. c #424242", ">. c #353535", ",. c #F0F0F0", "'. c #D2D2D2", "). c #9F9F9F", "!. c #777777", "~. c #4E4E4E", "{. c #292929", "]. c #6B6B6B", "^. c #ADADAD", "/. c #6F6F6F", "(. c #2B2B2B", "_. c #3B3B3B", ":. c #B9B9B9", "<. c #323232", "[. c #1A1A1A", "}. c #8F8F8F", "|. c #DBDBDB", "1. c #EAEAEA", "2. c #A3A3A3", "3. c #F6F6F6", "4. c #F5F5F5", "5. c #CACACA", "6. c #989898", "7. c #CBCBCB", "8. c #AAAAAA", "9. c #3A3A3A", "0. c #0C0C0C", "a. c #494949", "b. c #B6B6B6", "c. c #707070", "d. c #747474", "e. c #C8C8C8", "f. c #414141", "g. c #080808", "h. c #1F1F1F", "i. c #969696", "j. c #646464", "k. c #B8B8B8", "l. c #EFEFEF", "m. c #0A0A0A", "n. c #676767", "o. c #575757", "p. c #8E8E8E", "q. c #484848", "r. c #090909", "s. c #020202", "t. c #333333", "u. c #BEBEBE", "v. c #818181", "w. c #1D1D1D", "x. c #0E0E0E", "y. c #101010", "z. c #0D0D0D", "A. c #040404", "B. c #121212", "C. c #888888", "D. c #474747", "E. c #010101", "F. c #050505", "G. c #535353", "H. c #D5D5D5", "I. c #D6D6D6", "J. c #797979", "K. c #242424", "L. c #030303", "M. c #0F0F0F", "N. c #2D2D2D", "O. c #4F4F4F", "P. c #515151", "Q. c #525252", "R. c #545454", "S. c #585858", "T. c #5A5A5A", "U. c #737373", "V. c #BABABA", "W. c #4C4C4C", "X. c #060606", "Y. c #191919", "Z. c #898989", "`. c #7B7B7B", " + c #2A2A2A", ".+ c #0B0B0B", "++ c #272727", "@+ c #5F5F5F", "#+ c #F1F1F1", "$+ c #666666", "%+ c #1C1C1C", "&+ c #181818", "*+ c #E4E4E4", "=+ c #7E7E7E", "-+ c #444444", ";+ c #363636", ">+ c #CCCCCC", ",+ c #9E9E9E", ". + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @ # ", "+ $ $ % & % & & & & & & & & & * = = = = = = = = = = = = = = = = = = = = = = % $ $ % = $ $ - + # ", "+ $ $ % ; % ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; % $ $ % ; $ $ > + # ", "+ , ' % ' % ' ' ' ' $ ' $ ' ' $ ' ' $ ' ' $ ' ' $ ' ' ' $ ' ' $ ' ' $ ' $ ' % ' ' % ' % ) # + ! ", "+ ~ { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { ] + { ", "+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @ ^ ", "+ ~ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / / # ", "+ ~ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / / # ", "+ ~ # # # # # # # # # # # # # # # # # # # # # # # # # # ( ( ( ( ( ( ( ( ( ( ( ( ( # # # # / / # ", "+ _ # # # # # # # # # # # # # # # # # # # # ( : # # # # # # # < < < < < < < < [ } ( # # # / / # ", "+ @ # # # # # # # # # # # # # # # # # # # | } 1 2 3 4 # # 5 5 5 5 5 5 5 5 6 7 8 9 : # # # / / # ", "+ @ # # # # # # # # # # # # # # # # # | 0 a b c d e 2 # # f # # g g g g g h i j k l # # # / / # ", "+ @ # # # # # # # # # # # # # # # ( : m n o p q r s t } } f f # } } } } } u v 7 g } ( # # / / # ", "+ @ # # # # # # # # # # # # # ( | u v w x y j z A m | ( ( f f f ( ( ( ( ( | B 6 g } ( # # / / # ", "+ @ # # # # # # # # # # # # | l ! C D y E F j _ G | # # # f f f f # # # # ( < 5 g } ( # # / / # ", "+ . # # # # # # # # # # ( 0 H I J j J K L 4 4 M : # # # # f f f f f # # # ( < 5 g } ( # # / / # ", "+ 8 # # # # # # # # # ( } N O P Q R S S E P K } ( # # # # f f f f f f # # ( < 5 g } ( # # / / # ", "+ 8 # # # # # # # # # | M 7 x T U V m g W h t ( # # # # # f f f f f f f # ( < 5 g } ( # # / / # ", "+ J # # # # # # # # # 0 X c b m : } K x Y G | # # # # # # f f f f f f f f # < 5 g } ( # # / / # ", "+ Z # # # # # # # # # l s 4 ` | : ` D D .: # # # # # # # f f f f f # # # ( < 5 g } ( # # / / # ", "+ / # # # # # # # # # l ..D v | V +.P K } ( # # # # # # # f f # f f # # # ( < 5 g } ( # # / / # ", "+ / # # # # # # # # # l ..D v | m _ Z a | # # # # # # # # f # # # f f # # ( < 5 g } ( # # / / # ", "+ / # # # # # # # # # l ..D v | H o @.t ( # # # # # # # # # # # # f f # # ( < 5 g } ( # # / / # ", "+ / # # # # # # # # # l ..D v | H o #.t ( # # # # # # # # # # # # # f f # | $.7 g } ( # # / / # ", "+ / # # # # # # # # # l ..D v | H o #.t ( # # # # # # # # # # # # # f f # t %.&.h } # # # / / # ", "+ / # # # # # # # # # l ..D v | H o #.t ( # # # # # # # # # # # # ( | u # @.*.=.-.: # # # / / # ", "+ / # # # # # # # # # l ..D v | H o #.t ( # # # # # # # # # # # | l G ..P ;.>.@ ,.( # # # / / # ", "+ Z # # # # # # # # # l ..D v | H o #.t ( # # # # # # # # # ( 0 H '.).!.~.{.].M : # # # # / / # ", "+ + # # # # # # # # # l ..D v | H o #.t ( # # # # # # # ( : V N ^.P P /.(._.:.} ( # # # # / / # ", "+ + # # # # # # # # # l s D U : H o @.m ( ( ( ( ( ( ( | } < g 3 c E D <.[.j G | # # # # # / / # ", "+ + # # # # # # # # # l C }.|.t 1.).2.G 3.3.3.3.3.3.4.G 5.6.W / 7.8.9.0.a.I 0 # # # # # # / / # ", "+ + # # # # # # # # ( u b.z J ^.E c.d.Y i F F F F i ^.. W 5 e.$.:.f.g.h.Z t ( # # # # # # / / # ", "+ + # # # # # # # # : v Q d.i.8 5 j.j.D + @ @ @ @ @ + J k. .l.R a.g.m.n.U | # # # # # # # / / # ", "+ + # # # # # # # | a 8.P X ! ! I /.o.c p.}.}.}.}.}.}.4 i.@ p.q.r.s.t.u.} # # # # # # # # / / # ", "+ + # # # # # # ( 3.k v.b.H t -.z w.r.x.y.y.y.y.y.y.y.y.y.y.z.A.f B.x a ( # # # # # # # # / / # ", "+ + # # # # # ( l L C./ B B Y D.x.E.f E.s.A.A.A.A.A.A.A.A.F.F.F.0.G.H.: # # # # # # # # # / / # ", "+ + # # # # # : U i.4 I.K J.K.A.f L.M.N.D.O.P.P.P.P.P.Q.R.o.S.T.U.R V ( # # # # # # # # # / / # ", "+ + # # # # | a @.W V.Y W.y.s.X.Y.D.Z.s ^ N M M M M M M . .` ` 1.u ( # # # # # # # # # # / / # ", "+ + # # # ( 4.g `.D p +r..+++@+2.n #+l | ( ( ( ( ( ( ( ( ( ( ( ( ( # # # # # # # # # # # / / # ", "+ + # # ( l I &.$+d %+&+9.p :.*+V : ( # # # # # # # # # # # # # # # # # # # # # # # # # # / / # ", "+ + # # : N =+-+;+<.R.D >+[ } | ( # # # # # # # # # # # # # # # # # # # # # # # # # # # # / / # ", "+ + # ( 3.#.D.d !.^.9 m 0 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / / # ", "+ + # ( u { ).{ < V : ( # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / / # ", "+ + # # | V 4.l | ( # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / / # ", "+ + # # # ( ( # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # / / # ", "+ + { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { 8 ).# ", "v ,+@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ + @.# ", "# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # "};