Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first

  • Loading branch information...
commit cd250542b49f0cf054dc908e1890482d34b581fe 0 parents
U-Arcbook7\Arc authored
Showing with 17,717 additions and 0 deletions.
  1. +6 −0 Cygwin.bat
  2. BIN  Cygwin.ico
  3. BIN  bin/[.exe
  4. BIN  bin/addftinfo.exe
  5. +6,729 −0 bin/afmtodit
  6. +88 −0 bin/apropos
  7. BIN  bin/arch.exe
  8. BIN  bin/ascii.exe
  9. BIN  bin/ash.exe
  10. +1 −0  bin/awk
  11. BIN  bin/banner.exe
  12. BIN  bin/base64.exe
  13. BIN  bin/basename.exe
  14. BIN  bin/bash.exe
  15. +272 −0 bin/bashbug
  16. BIN  bin/bunzip2.exe
  17. BIN  bin/bzcat.exe
  18. +1 −0  bin/bzcmp
  19. +76 −0 bin/bzdiff
  20. +1 −0  bin/bzegrep
  21. +1 −0  bin/bzfgrep
  22. +132 −0 bin/bzgrep
  23. BIN  bin/bzip2.exe
  24. BIN  bin/bzip2recover.exe
  25. +1 −0  bin/bzless
  26. +61 −0 bin/bzmore
  27. BIN  bin/cat.exe
  28. BIN  bin/chcon.exe
  29. +1,274 −0 bin/chem
  30. BIN  bin/chgrp.exe
  31. BIN  bin/chmod.exe
  32. BIN  bin/chown.exe
  33. BIN  bin/chroot.exe
  34. BIN  bin/cksum.exe
  35. BIN  bin/cmp.exe
  36. BIN  bin/comm.exe
  37. BIN  bin/conv.exe
  38. +150 −0 bin/copy-user-registry-fstab
  39. BIN  bin/cp.exe
  40. BIN  bin/csplit.exe
  41. BIN  bin/cut.exe
  42. BIN  bin/cygattr-1.dll
  43. BIN  bin/cygbz2-1.dll
  44. BIN  bin/cygcheck.exe
  45. BIN  bin/cygdrop.exe
  46. BIN  bin/cygform-10.dll
  47. BIN  bin/cygform-8.dll
  48. BIN  bin/cygform-9.dll
  49. BIN  bin/cyggcc_s-1.dll
  50. BIN  bin/cyggmp-3.dll
  51. BIN  bin/cyghistory7.dll
  52. BIN  bin/cygicons-0.dll
  53. BIN  bin/cygiconv-2.dll
  54. BIN  bin/cygintl-8.dll
  55. +123 −0 bin/cyglsa-config
  56. BIN  bin/cyglsa.dll
  57. BIN  bin/cyglsa64.dll
  58. BIN  bin/cyglzma-1.dll
  59. BIN  bin/cygmenu-10.dll
  60. BIN  bin/cygmenu-8.dll
  61. BIN  bin/cygmenu-9.dll
  62. BIN  bin/cygmp-3.dll
  63. BIN  bin/cygncurses++-10.dll
  64. BIN  bin/cygncurses++-8.dll
  65. BIN  bin/cygncurses++-9.dll
  66. BIN  bin/cygncurses-10.dll
  67. BIN  bin/cygncurses-8.dll
  68. BIN  bin/cygncurses-9.dll
  69. BIN  bin/cygpanel-10.dll
  70. BIN  bin/cygpanel-8.dll
  71. BIN  bin/cygpanel-9.dll
  72. BIN  bin/cygpath.exe
  73. BIN  bin/cygpcre-0.dll
  74. BIN  bin/cygpcreposix-0.dll
  75. BIN  bin/cygpopt-0.dll
  76. BIN  bin/cygreadline7.dll
  77. +202 −0 bin/cygserver-config
  78. BIN  bin/cygsigsegv-2.dll
  79. BIN  bin/cygstart.exe
  80. BIN  bin/cygstdc++-6.dll
  81. BIN  bin/cygtic-10.dll
  82. BIN  bin/cygtic-9.dll
  83. BIN  bin/cygwin-console-helper.exe
  84. BIN  bin/cygwin1.dll
  85. BIN  bin/cygz.dll
  86. BIN  bin/d2u.exe
  87. BIN  bin/dash.exe
  88. BIN  bin/date.exe
  89. BIN  bin/dd.exe
  90. BIN  bin/df.exe
  91. BIN  bin/diff.exe
  92. BIN  bin/diff3.exe
  93. BIN  bin/dir.exe
  94. BIN  bin/dircolors.exe
  95. BIN  bin/dirname.exe
  96. BIN  bin/dos2unix.exe
  97. BIN  bin/du.exe
  98. BIN  bin/dump.exe
  99. BIN  bin/dumper.exe
  100. BIN  bin/echo.exe
  101. BIN  bin/editrights.exe
  102. BIN  bin/egrep.exe
  103. BIN  bin/env.exe
  104. BIN  bin/envsubst.exe
  105. BIN  bin/eqn.exe
  106. +91 −0 bin/eqn2graph
  107. BIN  bin/expand.exe
  108. BIN  bin/expr.exe
  109. BIN  bin/factor.exe
  110. BIN  bin/false.exe
  111. BIN  bin/fgrep.exe
  112. BIN  bin/find.exe
  113. BIN  bin/fmt.exe
  114. BIN  bin/fold.exe
  115. BIN  bin/gawk-3.1.8.exe
  116. BIN  bin/gawk.exe
  117. +344 −0 bin/gdiffmk
  118. BIN  bin/getclip.exe
  119. BIN  bin/getfacl.exe
  120. BIN  bin/gettext.exe
  121. +123 −0 bin/gettext.sh
  122. BIN  bin/gkill.exe
  123. +85 −0 bin/grap2graph
  124. BIN  bin/grep.exe
  125. BIN  bin/grn.exe
  126. BIN  bin/grodvi.exe
  127. BIN  bin/groff.exe
  128. +2,205 −0 bin/groffer
  129. +379 −0 bin/grog
  130. BIN  bin/grolbp.exe
  131. BIN  bin/grolj4.exe
  132. BIN  bin/grops.exe
  133. BIN  bin/grotty.exe
  134. BIN  bin/groups.exe
  135. +3 −0  bin/gunzip
  136. +229 −0 bin/gzexe
  137. BIN  bin/gzip.exe
  138. BIN  bin/head.exe
  139. BIN  bin/hostid.exe
  140. BIN  bin/hostname.exe
  141. BIN  bin/hpftodit.exe
  142. BIN  bin/id.exe
  143. +133 −0 bin/igawk
  144. BIN  bin/indxbib.exe
  145. BIN  bin/info.exe
  146. BIN  bin/infokey.exe
  147. BIN  bin/install-info.exe
  148. +18 −0 bin/install-info.exe.manifest
  149. BIN  bin/install.exe
  150. +16 −0 bin/install.exe.manifest
  151. +86 −0 bin/ipck
  152. BIN  bin/ipcrm.exe
  153. BIN  bin/ipcs.exe
  154. BIN  bin/join.exe
  155. BIN  bin/kill.exe
  156. BIN  bin/ldd.exe
  157. BIN  bin/ldh.exe
  158. BIN  bin/less.exe
  159. BIN  bin/lessecho.exe
  160. BIN  bin/lesskey.exe
  161. BIN  bin/link.exe
  162. BIN  bin/lkbib.exe
  163. BIN  bin/ln.exe
  164. BIN  bin/locale.exe
  165. BIN  bin/locate.exe
  166. BIN  bin/login.exe
  167. BIN  bin/logname.exe
  168. BIN  bin/lookbib.exe
  169. BIN  bin/lpr.exe
  170. BIN  bin/ls.exe
  171. +1 −0  bin/lzcat
  172. +1 −0  bin/lzcmp
  173. +1 −0  bin/lzdiff
  174. +1 −0  bin/lzegrep
  175. +1 −0  bin/lzfgrep
  176. +1 −0  bin/lzgrep
  177. +1 −0  bin/lzless
  178. +1 −0  bin/lzma
  179. BIN  bin/lzmadec.exe
  180. BIN  bin/lzmainfo.exe
  181. +1 −0  bin/lzmore
  182. BIN  bin/makeinfo.exe
  183. BIN  bin/man.exe
  184. +36 −0 bin/man2dvi
  185. BIN  bin/man2html.exe
  186. +225 −0 bin/manlint
  187. +1 −0  bin/manpath
  188. BIN  bin/md5sum.exe
  189. BIN  bin/mkdir.exe
  190. BIN  bin/mkfifo.exe
  191. BIN  bin/mkgroup.exe
  192. BIN  bin/mknod.exe
  193. BIN  bin/mkpasswd.exe
  194. BIN  bin/mkshortcut.exe
  195. BIN  bin/mktemp.exe
  196. +155 −0 bin/mmroff
  197. BIN  bin/mount.exe
  198. BIN  bin/msgtool.exe
  199. BIN  bin/mv.exe
  200. +10 −0 bin/neqn
  201. BIN  bin/ngettext.exe
  202. BIN  bin/nice.exe
  203. BIN  bin/nl.exe
  204. BIN  bin/nohup.exe
  205. BIN  bin/nproc.exe
  206. +138 −0 bin/nroff
  207. BIN  bin/od.exe
  208. BIN  bin/oldfind.exe
  209. BIN  bin/passwd.exe
  210. BIN  bin/paste.exe
  211. BIN  bin/pathchk.exe
  212. +629 −0 bin/pdfroff
  213. +19 −0 bin/pdftexi2dvi
  214. BIN  bin/peflags.exe
  215. +289 −0 bin/peflagsall
  216. BIN  bin/pfbtops.exe
  217. BIN  bin/pgawk-3.1.8.exe
  218. BIN  bin/pgawk.exe
  219. BIN  bin/pic.exe
  220. +101 −0 bin/pic2graph
  221. BIN  bin/pinky.exe
  222. BIN  bin/post-grohtml.exe
  223. BIN  bin/pr.exe
  224. BIN  bin/pre-grohtml.exe
  225. BIN  bin/preconv.exe
  226. BIN  bin/printenv.exe
  227. BIN  bin/printf.exe
  228. BIN  bin/ps.exe
  229. BIN  bin/ptx.exe
  230. BIN  bin/putclip.exe
  231. BIN  bin/pwd.exe
  232. BIN  bin/readlink.exe
  233. BIN  bin/readshortcut.exe
  234. BIN  bin/realpath.exe
  235. BIN  bin/rebase.exe
  236. +123 −0 bin/rebaseall
  237. BIN  bin/refer.exe
  238. BIN  bin/regtool.exe
  239. BIN  bin/rm.exe
  240. BIN  bin/rmdir.exe
  241. +223 −0 bin/roff2dvi
  242. +223 −0 bin/roff2html
  243. +223 −0 bin/roff2pdf
  244. +223 −0 bin/roff2ps
  245. +223 −0 bin/roff2text
  246. +223 −0 bin/roff2x
  247. BIN  bin/run.exe
  248. BIN  bin/runcon.exe
  249. BIN  bin/sdiff.exe
  250. BIN  bin/sed.exe
  251. BIN  bin/semstat.exe
  252. BIN  bin/semtool.exe
  253. BIN  bin/seq.exe
  254. BIN  bin/setfacl.exe
  255. BIN  bin/setmetamode.exe
  256. BIN  bin/sh.exe
  257. BIN  bin/sha1sum.exe
  258. BIN  bin/sha224sum.exe
  259. BIN  bin/sha256sum.exe
  260. BIN  bin/sha384sum.exe
  261. BIN  bin/sha512sum.exe
  262. BIN  bin/shmtool.exe
  263. BIN  bin/shred.exe
  264. BIN  bin/shuf.exe
  265. BIN  bin/sleep.exe
  266. BIN  bin/soelim.exe
  267. BIN  bin/sort.exe
  268. BIN  bin/split.exe
  269. BIN  bin/ssp.exe
  270. BIN  bin/stat.exe
  271. BIN  bin/strace.exe
  272. BIN  bin/stty.exe
  273. BIN  bin/su.exe
  274. BIN  bin/sum.exe
  275. BIN  bin/sync.exe
  276. BIN  bin/tac.exe
  277. BIN  bin/tail.exe
  278. BIN  bin/tar.exe
  279. BIN  bin/tbl.exe
  280. BIN  bin/tee.exe
  281. BIN  bin/test.exe
  282. +1,792 −0 bin/texi2dvi
  283. +19 −0 bin/texi2pdf
  284. BIN  bin/texindex.exe
  285. BIN  bin/tfmtodit.exe
  286. BIN  bin/timeout.exe
  287. BIN  bin/touch.exe
  288. BIN  bin/tr.exe
  289. BIN  bin/troff.exe
  290. BIN  bin/true.exe
  291. BIN  bin/truncate.exe
  292. BIN  bin/tsort.exe
  293. BIN  bin/tty.exe
  294. BIN  bin/u2d.exe
  295. BIN  bin/umount.exe
  296. BIN  bin/uname.exe
  297. +3 −0  bin/uncompress
  298. BIN  bin/unexpand.exe
  299. BIN  bin/uniq.exe
  300. BIN  bin/unix2dos.exe
Sorry, we could not display the entire diff because too many files (4,756) changed.
6 Cygwin.bat
@@ -0,0 +1,6 @@
+@echo off
+
+C:
+chdir C:\cygwinlean\bin
+
+bash --login -i
BIN  Cygwin.ico
Binary file not shown
BIN  bin/[.exe
Binary file not shown
BIN  bin/addftinfo.exe
Binary file not shown
6,729 bin/afmtodit
6,729 additions, 0 deletions not shown
88 bin/apropos
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# apropos -- search the whatis database for keywords.
+# whatis -- idem, but match only commands (as whole words).
+#
+# Copyright (c) 1990, 1991, John W. Eaton.
+# Copyright (c) 1994-1999, Andries E. Brouwer.
+#
+# You may distribute under the terms of the GNU General Public
+# License as specified in the README file that comes with the man
+# distribution.
+#
+# apropos/whatis-1.5m aeb 2003-08-01 (from man-1.6f)
+#
+# keep old PATH - 000323 - Bryan Henderson
+# also look in /var/cache/man - 030801 - aeb
+
+program=`basename $0`
+
+# When man pages in your favorite locale look to grep like binary files
+# (and you use GNU grep) you may want to add the 'a' option to *grepopt1.
+aproposgrepopt1='ai'
+aproposgrepopt2=''
+whatisgrepopt1='aiw'
+whatisgrepopt2='^'
+grepopt1=$aproposgrepopt1
+grepopt2=$aproposgrepopt2
+
+if [ $# = 0 ]
+then
+ echo "usage: $program keyword ..."
+ exit 1
+fi
+
+manpath=`man --path | tr : '\040'`
+
+if [ "$manpath" = "" ]
+then
+ echo "$program: manpath is null"
+ exit 1
+fi
+
+args=
+for arg in $*; do
+ case $arg in
+ --version|-V|-v)
+ echo "$program from man-1.6f"
+ exit 0
+ ;;
+ --help|-h)
+ echo "usage: $program keyword ..."
+ exit 0
+ ;;
+ -*)
+ echo "$program: $arg: unknown option"
+ exit 1
+ ;;
+ *)
+ args="$args $arg"
+ esac
+done
+
+while [ "$1" != "" ]
+do
+ found=0
+ for d in /var/cache/man $manpath /usr/lib
+ do
+ if [ -f $d/whatis ]
+ then
+ if grep -"$grepopt1" "$grepopt2""$1" $d/whatis
+ then
+ found=1
+# Some people are satisfied with a single occurrence
+# But it is better to give all
+# break
+ fi
+ fi
+ done
+
+ if [ $found = 0 ]
+ then
+ echo "$1: nothing appropriate"
+ fi
+
+ shift
+done
+
+exit
BIN  bin/arch.exe
Binary file not shown
BIN  bin/ascii.exe
Binary file not shown
BIN  bin/ash.exe
Binary file not shown
1  bin/awk
BIN  bin/banner.exe
Binary file not shown
BIN  bin/base64.exe
Binary file not shown
BIN  bin/basename.exe
Binary file not shown
BIN  bin/bash.exe
Binary file not shown
272 bin/bashbug
@@ -0,0 +1,272 @@
+#!/bin/sh -
+#
+# bashbug - create a bug report and mail it to the bug address
+#
+# The bug address depends on the release status of the shell. Versions
+# with status `devel', `alpha', `beta', or `rc' mail bug reports to
+# chet@cwru.edu and, optionally, to bash-testers@cwru.edu.
+# Other versions send mail to bug-bash@gnu.org.
+#
+# Copyright (C) 1996-2004 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+
+#
+# configuration section:
+# these variables are filled in by the make target in Makefile
+#
+MACHINE="i686"
+OS="cygwin"
+CC="gcc-4"
+CFLAGS=" -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS -I. -I/usr/src/bash-3.2.51-24/src/bash-3.2 -I/usr/src/bash-3.2.51-24/src/bash-3.2/include -I/usr/src/bash-3.2.51-24/src/bash-3.2/lib -O2 -pipe "
+RELEASE="3.2"
+PATCHLEVEL="51"
+RELSTATUS="release"
+MACHTYPE="i686-pc-cygwin"
+
+PATH=/bin:/usr/bin:/usr/local/bin:$PATH
+export PATH
+
+# Check if TMPDIR is set, default to /tmp
+: ${TMPDIR:=/tmp}
+
+#Securely create a temporary directory for the temporary files
+TEMPDIR=$TMPDIR/bbug.$$
+(umask 077 && mkdir $TEMPDIR) || {
+ echo "$0: could not create temporary directory" >&2
+ exit 1
+}
+
+TEMPFILE1=$TEMPDIR/bbug1
+TEMPFILE2=$TEMPDIR/bbug2
+
+USAGE="Usage: $0 [--help] [--version] [bug-report-email-address]"
+VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}"
+
+do_help= do_version=
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --help) shift ; do_help=y ;;
+ --version) shift ; do_version=y ;;
+ --) shift ; break ;;
+ -*) echo "bashbug: ${1}: invalid option" >&2
+ echo "$USAGE" >& 2
+ exit 2 ;;
+ *) break ;;
+ esac
+done
+
+if [ -n "$do_version" ]; then
+ echo "${VERSTR}"
+ exit 0
+fi
+
+if [ -n "$do_help" ]; then
+ echo "${VERSTR}"
+ echo "${USAGE}"
+ echo
+ cat << HERE_EOF
+Bashbug is used to send mail to the Bash maintainers
+for when Bash doesn't behave like you'd like, or expect.
+
+Bashbug will start up your editor (as defined by the shell's
+EDITOR environment variable) with a preformatted bug report
+template for you to fill in. The report will be mailed to the
+bash maintainers by default. See the manual for details.
+
+If you invoke bashbug by accident, just quit your editor without
+saving any changes to the template, and no bug report will be sent.
+HERE_EOF
+ exit 0
+fi
+
+# Figure out how to echo a string without a trailing newline
+N=`echo 'hi there\c'`
+case "$N" in
+*c) n=-n c= ;;
+*) n= c='\c' ;;
+esac
+
+BASHTESTERS="bash-testers@cwru.edu"
+
+case "$RELSTATUS" in
+alpha*|beta*|devel*|rc*) BUGBASH=chet@cwru.edu ;;
+*) BUGBASH=bug-bash@gnu.org ;;
+esac
+
+case "$RELSTATUS" in
+alpha*|beta*|devel*|rc*)
+ echo "$0: This is a testing release. Would you like your bug report"
+ echo "$0: to be sent to the bash-testers mailing list?"
+ echo $n "$0: Send to bash-testers? $c"
+ read ans
+ case "$ans" in
+ y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;;
+ esac ;;
+esac
+
+BUGADDR="${1-$BUGBASH}"
+
+if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then
+ if [ -x /usr/bin/editor ]; then
+ DEFEDITOR=editor
+ elif [ -x /usr/local/bin/ce ]; then
+ DEFEDITOR=ce
+ elif [ -x /usr/local/bin/emacs ]; then
+ DEFEDITOR=emacs
+ elif [ -x /usr/contrib/bin/emacs ]; then
+ DEFEDITOR=emacs
+ elif [ -x /usr/bin/emacs ]; then
+ DEFEDITOR=emacs
+ elif [ -x /usr/bin/xemacs ]; then
+ DEFEDITOR=xemacs
+ elif [ -x /usr/contrib/bin/jove ]; then
+ DEFEDITOR=jove
+ elif [ -x /usr/local/bin/jove ]; then
+ DEFEDITOR=jove
+ elif [ -x /usr/bin/vi ]; then
+ DEFEDITOR=vi
+ else
+ echo "$0: No default editor found: attempting to use vi" >&2
+ DEFEDITOR=vi
+ fi
+fi
+
+
+: ${EDITOR=$DEFEDITOR}
+
+: ${USER=${LOGNAME-`whoami`}}
+
+trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15
+trap 'rm -rf "$TEMPDIR"' 0
+
+UN=
+if (uname) >/dev/null 2>&1; then
+ UN=`uname -a`
+fi
+
+if [ -f /usr/lib/sendmail ] ; then
+ RMAIL="/usr/lib/sendmail"
+ SMARGS="-i -t"
+elif [ -f /usr/sbin/sendmail ] ; then
+ RMAIL="/usr/sbin/sendmail"
+ SMARGS="-i -t"
+else
+ RMAIL=rmail
+ SMARGS="$BUGADDR"
+fi
+
+INITIAL_SUBJECT='[50 character or so descriptive subject here (for reference)]'
+
+cat > "$TEMPFILE1" <<EOF
+From: ${USER}
+To: ${BUGADDR}
+Subject: ${INITIAL_SUBJECT}
+
+Configuration Information [Automatically generated, do not change]:
+Machine: $MACHINE
+OS: $OS
+Compiler: $CC
+Compilation CFLAGS: $CFLAGS
+uname output: $UN
+Machine Type: $MACHTYPE
+
+Bash Version: $RELEASE
+Patch Level: $PATCHLEVEL
+Release Status: $RELSTATUS
+
+Description:
+ [Detailed description of the problem, suggestion, or complaint.]
+
+Repeat-By:
+ [Describe the sequence of events that causes the problem
+ to occur.]
+
+Fix:
+ [Description of how to fix the problem. If you don't know a
+ fix for the problem, don't include this section.]
+EOF
+
+cp "$TEMPFILE1" "$TEMPFILE2"
+chmod u+w "$TEMPFILE1"
+
+trap '' 2 # ignore interrupts while in editor
+
+edstat=1
+while [ $edstat -ne 0 ]; do
+ $EDITOR "$TEMPFILE1"
+ edstat=$?
+
+ if [ $edstat -ne 0 ]; then
+ echo "$0: editor \`$EDITOR' exited with nonzero status."
+ echo "$0: Perhaps it was interrupted."
+ echo "$0: Type \`y' to give up, and lose your bug report;"
+ echo "$0: type \`n' to re-enter the editor."
+ echo $n "$0: Do you want to give up? $c"
+
+ read ans
+ case "$ans" in
+ [Yy]*) exit 1 ;;
+ esac
+
+ continue
+ fi
+
+ # find the subject from the temp file and see if it's been changed
+ CURR_SUB=`grep '^Subject: ' "$TEMPFILE1" | sed 's|^Subject:[ ]*||' | sed 1q`
+
+ case "$CURR_SUB" in
+ "${INITIAL_SUBJECT}")
+ echo
+ echo "$0: You have not changed the subject from the default."
+ echo "$0: Please use a more descriptive subject header."
+ echo "$0: Type \`y' to give up, and lose your bug report;"
+ echo "$0: type \`n' to re-enter the editor."
+ echo $n "$0: Do you want to give up? $c"
+
+ read ans
+ case "$ans" in
+ [Yy]*) exit 1 ;;
+ esac
+
+ echo "$0: The editor will be restarted in five seconds."
+ sleep 5
+ edstat=1
+ ;;
+ esac
+
+done
+
+trap 'rm -rf "$TEMPDIR"; exit 1' 2 # restore trap on SIGINT
+
+if cmp -s "$TEMPFILE1" "$TEMPFILE2"
+then
+ echo "File not changed, no bug report submitted."
+ exit
+fi
+
+echo $n "Send bug report? [y/n] $c"
+read ans
+case "$ans" in
+[Nn]*) exit 0 ;;
+esac
+
+${RMAIL} $SMARGS < "$TEMPFILE1" || {
+ cat "$TEMPFILE1" >> $HOME/dead.bashbug
+ echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2
+}
+
+exit 0
BIN  bin/bunzip2.exe
Binary file not shown
BIN  bin/bzcat.exe
Binary file not shown
1  bin/bzcmp
76 bin/bzdiff
@@ -0,0 +1,76 @@
+#!/bin/sh
+# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
+
+# Bzcmp/diff wrapped for bzip2,
+# adapted from zdiff by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
+
+# Bzcmp and bzdiff are used to invoke the cmp or the diff pro-
+# gram on compressed files. All options specified are passed
+# directly to cmp or diff. If only 1 file is specified, then
+# the files compared are file1 and an uncompressed file1.gz.
+# If two files are specified, then they are uncompressed (if
+# necessary) and fed to cmp or diff. The exit status from cmp
+# or diff is preserved.
+
+PATH="/usr/bin:/bin:$PATH"; export PATH
+prog=`echo $0 | sed 's|.*/||'`
+case "$prog" in
+ *cmp) comp=${CMP-cmp} ;;
+ *) comp=${DIFF-diff} ;;
+esac
+
+OPTIONS=
+FILES=
+for ARG
+do
+ case "$ARG" in
+ -*) OPTIONS="$OPTIONS $ARG";;
+ *) if test -f "$ARG"; then
+ FILES="$FILES $ARG"
+ else
+ echo "${prog}: $ARG not found or not a regular file"
+ exit 1
+ fi ;;
+ esac
+done
+if test -z "$FILES"; then
+ echo "Usage: $prog [${comp}_options] file [file]"
+ exit 1
+fi
+tmp=`mktemp ${TMPDIR:-/tmp}/bzdiff.XXXXXXXXXX` || {
+ echo 'cannot create a temporary file' >&2
+ exit 1
+}
+set $FILES
+if test $# -eq 1; then
+ FILE=`echo "$1" | sed 's/.bz2$//'`
+ bzip2 -cd "$FILE.bz2" | $comp $OPTIONS - "$FILE"
+ STAT="$?"
+
+elif test $# -eq 2; then
+ case "$1" in
+ *.bz2)
+ case "$2" in
+ *.bz2)
+ F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
+ bzip2 -cdfq "$2" > $tmp
+ bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
+ STAT="$?"
+ /bin/rm -f $tmp;;
+
+ *) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
+ STAT="$?";;
+ esac;;
+ *) case "$2" in
+ *.bz2)
+ bzip2 -cdfq "$2" | $comp $OPTIONS "$1" -
+ STAT="$?";;
+ *) $comp $OPTIONS "$1" "$2"
+ STAT="$?";;
+ esac;;
+ esac
+ exit "$STAT"
+else
+ echo "Usage: $prog [${comp}_options] file [file]"
+ exit 1
+fi
1  bin/bzegrep
1  bin/bzfgrep
132 bin/bzgrep
@@ -0,0 +1,132 @@
+#!/bin/sh
+
+# bzgrep -- a wrapper around a grep program that decompresses files as needed
+# Adapted from zgrep of the Debian gzip package by Anibal Monsalve Salazar.
+# Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
+
+# Copyright (C) 1998, 2001, 2002 Free Software Foundation
+# Copyright (C) 1993 Jean-loup Gailly
+
+# This program is free software; you can redistribute 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.
+
+PATH="/usr/bin:$PATH"; export PATH
+
+prog=`echo "$0" | sed 's|.*/||'`
+case "$prog" in
+ *egrep) grep=${EGREP-egrep} ;;
+ *fgrep) grep=${FGREP-fgrep} ;;
+ *) grep=${GREP-grep} ;;
+esac
+
+pat=""
+after_dash_dash=""
+files_with_matches=0
+files_without_matches=0
+no_filename=0
+with_filename=0
+
+while test $# -ne 0; do
+ case "$after_dash_dash$1" in
+ --d* | --rec*) echo >&2 "$0: $1: option not supported"; exit 2;;
+ --files-with-*) files_with_matches=1;;
+ --files-witho*) files_without_matches=1;;
+ --no-f*) no_filename=1;;
+ --wi*) with_filename=1;;
+ --*) ;;
+ -*)
+ case "$1" in
+ -*[dr]*) echo >&2 "$0: $1: option not supported"; exit 2;;
+ esac
+ case "$1" in
+ -*H*) with_filename=1;;
+ esac
+ case "$1" in
+ -*h*) no_filename=1;;
+ esac
+ case "$1" in
+ -*L*) files_without_matches=1;;
+ esac
+ case "$1" in
+ -*l*) files_with_matches=1;;
+ esac;;
+ esac
+ case "$after_dash_dash$1" in
+ -[ef]) opt="$opt $1"; shift; pat="$1"
+ if test "$grep" = grep; then # grep is buggy with -e on SVR4
+ grep=egrep
+ fi;;
+ -[ABCdm])opt="$opt $1 $2"; shift;;
+ --) opt="$opt $1"; after_dash_dash=1;;
+ -*) opt="$opt $1";;
+ *) if test -z "$pat"; then
+ pat="$1"
+ else
+ break;
+ fi;;
+ esac
+ shift
+done
+
+if test -z "$pat"; then
+ echo "grep through bzip2 files"
+ echo "usage: $prog [grep_options] pattern [files]"
+ exit 2
+fi
+
+if test $# -eq 0; then
+ bzip2 -cdfq | $grep $opt "$pat"
+ exit $?
+fi
+
+res=0
+for i do
+ bzip2 -cdfq -- "$i" |
+ if test $files_with_matches -eq 1; then
+ $grep $opt "$pat" > /dev/null && printf "%s\n" "$i"
+ elif test $files_without_matches -eq 1; then
+ $grep $opt "$pat" > /dev/null || printf "%s\n" "$i"
+ elif test $with_filename -eq 0 && { test $# -eq 1 || test $no_filename -eq 1; }; then
+ $grep $opt "$pat"
+ else
+ i=$(echo "$i" | sed -e 's/[\\|&]/\\&/g')
+ if test $with_filename -eq 1; then
+ sed_script="s|^[^:]*:|${i}:|"
+ else
+ sed_script="s|^|${i}:|"
+ fi
+ # Hack adapted from GPLed code at
+ # http://home.comcast.net/~j.p.h/cus-faq-2
+ # Has the same effect as the following two lines of bash:
+ #
+ # $grep $opt "$pat" | sed "$sed_script"
+ # exit ${PIPESTATUS[0]}
+ #
+ # Inside the `...`, fd4 goes to the pipe whose other end is read
+ # and passed to eval; fd1 is the normal standard output
+ # preserved the line before with exec 3>&1
+ exec 3>&1
+ eval `
+ exec 4>&1 >&3 3>&-
+ {
+ $grep $opt "$pat" 4>&-; echo "r=$?;" >&4
+ } | sed "$sed_script"
+ `
+ exit $r
+ fi
+ r=$?
+ test $res -lt $r && res=$r
+done
+exit $res
BIN  bin/bzip2.exe
Binary file not shown
BIN  bin/bzip2recover.exe
Binary file not shown
1  bin/bzless
61 bin/bzmore
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# Bzmore wrapped for bzip2,
+# adapted from zmore by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
+
+PATH="/usr/bin:$PATH"; export PATH
+
+prog=`echo $0 | sed 's|.*/||'`
+case "$prog" in
+ *less) more=less ;;
+ *) more=more ;;
+esac
+
+if test "`echo -n a`" = "-n a"; then
+ # looks like a SysV system:
+ n1=''; n2='\c'
+else
+ n1='-n'; n2=''
+fi
+oldtty=`stty -g 2>/dev/null`
+if stty -cbreak 2>/dev/null; then
+ cb='cbreak'; ncb='-cbreak'
+else
+ # 'stty min 1' resets eof to ^a on both SunOS and SysV!
+ cb='min 1 -icanon'; ncb='icanon eof ^d'
+fi
+if test $? -eq 0 && test -n "$oldtty"; then
+ trap 'stty $oldtty 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM
+else
+ trap 'stty $ncb echo 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM
+fi
+
+if test $# = 0; then
+ if test -t 0; then
+ echo usage: $prog files...
+ else
+ bzip2 -cdfq | eval $more
+ fi
+else
+ FIRST=1
+ for FILE
+ do
+ if test $FIRST -eq 0; then
+ echo $n1 "--More--(Next file: $FILE)$n2"
+ stty $cb -echo 2>/dev/null
+ ANS=`dd bs=1 count=1 2>/dev/null`
+ stty $ncb echo 2>/dev/null
+ echo " "
+ if test "$ANS" = 'e' || test "$ANS" = 'q'; then
+ exit
+ fi
+ fi
+ if test "$ANS" != 's'; then
+ echo "------> $FILE <------"
+ bzip2 -cdfq "$FILE" | eval $more
+ fi
+ if test -t; then
+ FIRST=0
+ fi
+ done
+fi
BIN  bin/cat.exe
Binary file not shown
BIN  bin/chcon.exe
Binary file not shown
1,274 bin/chem
@@ -0,0 +1,1274 @@
+#! /usr/bin/env perl
+
+# chem - a groff preprocessor for producing chemical structure diagrams
+
+# Source file position: <groff-source>/contrib/chem/chem.pl
+# Installed position: <prefix>/bin/chem
+
+# Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# 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 <http://www.gnu.org/licenses/>.
+
+########################################################################
+# settings
+########################################################################
+
+my $Program_Version = '0.3.1';
+my $Last_Update = '03 Jan 2009';
+
+# this setting of the groff version is only used before make is run,
+# otherwise 1.20.1 will set it.
+my $Groff_Version_Preset='1.20preset';
+
+# test on Perl version
+require v5.6;
+
+
+########################################################################
+# begin
+########################################################################
+
+use warnings;
+use strict;
+use Math::Trig;
+
+# for catfile()
+use File::Spec;
+
+# $Bin is the directory where this script is located
+use FindBin;
+
+my $Chem_Name;
+my $Groff_Version;
+my $File_chem_pic;
+my $File_pic_tmac;
+
+BEGIN {
+ {
+ my $before_make; # script before run of `make'
+ {
+ my $at = '@';
+ $before_make = 1 if '1.20.1' eq "${at}VERSION${at}";
+ }
+
+ my %at_at;
+
+ if ($before_make) {
+ my $chem_dir = $FindBin::Bin;
+ $at_at{'BINDIR'} = $chem_dir;
+ $at_at{'G'} = '';
+ $File_chem_pic = File::Spec->catfile($chem_dir, 'chem.pic');
+ $File_pic_tmac = File::Spec->catfile($chem_dir, '..', 'pic.tmac');
+ $Groff_Version = '';
+ $Chem_Name = 'chem';
+ } else {
+ $Groff_Version = '1.20.1';
+ $at_at{'BINDIR'} = '/usr/bin';
+ $at_at{'G'} = '';
+ $at_at{'PICDIR'} = '/usr/share/groff/1.20.1/pic';
+ $at_at{'TMACDIR'} = '/usr/share/groff/1.20.1/tmac';
+ $File_chem_pic =
+ File::Spec->catfile($at_at{'PICDIR'}, 'chem.pic');
+ $File_pic_tmac = File::Spec->catfile($at_at{'TMACDIR'}, 'pic.tmac');
+ $Chem_Name = $at_at{'G'} . 'chem';
+ }
+ }
+}
+
+
+########################################################################
+# check the parameters
+########################################################################
+
+if (@ARGV) {
+ # process any FOO=bar switches
+ # eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
+ my @filespec = ();
+ my $dbl_minus;
+ my $wrong;
+ foreach (@ARGV) {
+ next unless $_;
+ if (/=/) {
+ # ignore FOO=bar switches
+ push @filespec, $_ if -f;
+ next;
+ }
+ if ($dbl_minus) {
+ if (-f $_) {
+ push @filespec, $_ if -s $_;
+ } else {
+ warn "chem: argument $_ is not an existing file.\n";
+ $wrong = 1;
+ }
+ next;
+ }
+ if (/^--$/) {
+ $dbl_minus = 1;
+ next;
+ }
+ if (/^-$/) {
+ push @filespec, $_;
+ next;
+ }
+ if (/^-h$/ or '--help' =~ /^$_/) {
+ &usage();
+ exit 0;
+ }
+ if (/^-v$/ or '--version' =~ /^$_/) {
+ &version();
+ exit 0;
+ }
+ if (-f $_) {
+ push @filespec, $_ if -s $_;
+ } else {
+ $wrong = 1;
+ if (/^-/) {
+ warn "chem: wrong option ${_}.\n";
+ } else {
+ warn "chem: argument $_ is not an existing file.\n";
+ }
+ }
+ }
+ if (@filespec) {
+ @ARGV = @filespec;
+ } else {
+ exit 0 if $wrong;
+ @ARGV = ('-');
+ }
+} else { # @ARGV is empty
+ @ARGV = ('-') unless @ARGV;
+}
+
+
+########################################################################
+# main process
+########################################################################
+
+my %Dc = ( 'up' => 0, 'right' => 90, 'down' => 180, 'left' => 270,
+ 'ne' => 45, 'se' => 135, 'sw' => 225, 'nw' => 315,
+ 0 => 'n', 90 => 'e', 180 => 's', 270 => 'w',
+ 30 => 'ne', 45 => 'ne', 60 => 'ne',
+ 120 => 'se', 135 => 'se', 150 => 'se',
+ 210 => 'sw', 225 => 'sw', 240 => 'sw',
+ 300 => 'nw', 315 => 'nw', 330 => 'nw',
+ );
+
+my $Word_Count;
+my @Words;
+
+my $Line_No;
+my $Last_Name = '';
+
+# from init()
+my $First_Time = 1;
+my $Last_Type;
+my $Dir; # direction
+my %Types = (
+ 'RING' => 'R',
+ 'MOL' => 'M',
+ 'BOND' => 'B',
+ 'OTHER' => 'O' # manifests
+ );
+
+# from setparams()
+my %Params;
+
+# from ring()
+my $Nput;
+my $Aromatic;
+my %Put;
+my %Dbl;
+
+my %Labtype;
+my %Define = ();
+
+my $File_Name = '';
+my $Line = '';
+
+&main();
+
+{
+ my $is_pic = '';
+ my $is_chem = '';
+ my $former_line = '';
+
+ ##########
+ # main()
+ #
+ sub main {
+ my $count_minus = 0;
+ my @stdin = ();
+ my $stdin = 0;
+
+ # for centralizing the pic code
+ open TMAC, "<$File_pic_tmac" and print <TMAC>;
+ close TMAC;
+
+ foreach (@ARGV) {
+ $count_minus++ if /^-$/;
+ }
+
+ foreach my $arg (@ARGV) {
+ &setparams(1.0);
+ next unless $arg;
+ $Line_No = 0;
+ $is_pic = '';
+ $is_chem = '';
+ if ($arg eq '-') {
+ $File_Name = 'standard input';
+ if ($stdin) {
+ &main_line($_) foreach @stdin;
+ } else {
+ $stdin = 1;
+ if ($count_minus <= 1) {
+ while (<STDIN>) {
+ &main_line($_);
+ }
+ } else {
+ @stdin = ();
+ while (<STDIN>) {
+ push @stdin, $_;
+ &main_line($_);
+ }
+ }
+ }
+### main()
+ } else { # $arg is not -
+ $File_Name = $arg;
+ open FILE, "<$arg";
+ &main_line($_) while <FILE>;
+ close FILE;
+ } # if $arg
+ if ($is_pic) {
+ printf ".PE\n";
+ }
+ }
+ } # main()
+
+
+ ##########
+ # main_line()
+ #
+ sub main_line {
+ my $line = $_[0];
+# $Last_Type = $Types{'OTHER'};
+# $Last_Type = '';
+ my $stack;
+ $Line_No++;
+ chomp $line;
+
+ $line = $former_line . $line if $former_line;
+ if ($line =~ /^(.*)\\$/) {
+ $former_line = $1;
+ return 1;
+ } else {
+ $former_line = '';
+ }
+ $Line = $line;
+
+ {
+ @Words = ();
+ my $s = $line;
+ $s =~ s/^\s*//;
+ $s =~ s/\s+$//;
+ return 1 unless $s;
+ $s = " $s";
+ $s =~ s/\s+#.*$// if $is_pic;
+ return 1 unless $s;
+ $line = $s;
+ $line =~ s/^\s*|\s*$//g;
+ my $bool = 1;
+ while ($bool) {
+ $s =~ /^([^"]*)\s("[^"]*"?\S*)(.*)$/;
+ if (defined $1) {
+ my $s1 = $1;
+ my $s2 = $2;
+ $s = $3;
+ $s1 =~ s/^\s*|\s*$//g;
+ push @Words, split(/\s+/, $s1) if $s1;
+ push @Words, $s2;
+ }
+ if ($s !~ /\s"/) {
+ $s =~ s/^\s*|\s*$//g;
+ push @Words, split(/\s+/, $s) if $s;
+ $bool = 0;
+ }
+ }
+
+# @Words = split(/\s+/, $s);
+ return 1 unless @Words;
+# foreach my $i (0..$#Words) {
+# if ($Words[$i] =~ /^\s*#/) {
+# $#Words = $i - 1;
+# last;
+# }
+# }
+# return 1 unless @Words;
+ }
+
+ if ($line =~ /^([\.']\s*PS\s*)|([\.']\s*PS\s.+)$/) {
+ # .PS
+ unless ($is_pic) {
+ $is_pic = 'running';
+ print "$line\n";
+ }
+ return 1;
+ }
+### main_line()
+ if ( $line =~ /^([\.']\s*PE\s*)|([\.']\s*PE\s.+)$/ ) {
+ # .PE
+ $is_chem = '';
+ if ($is_pic) {
+ $is_pic = '';
+ print "$line\n";
+ }
+ return 1;
+ }
+ if ($line =~ /^[\.']\s*cstart\s*$/) {
+ # line: `.cstart'
+ if ($is_chem) {
+ &error("additional `.cstart'; chem is already active.");
+ return 1;
+ }
+ unless ($is_pic) {
+ &print_ps();
+ $is_pic = 'by chem';
+ }
+ $is_chem = '.cstart';
+ &init();
+ return 1;
+ }
+### main_line()
+ if ($line =~ /^\s*begin\s+chem\s*$/) {
+ # line: `begin chem'
+ if ($is_pic) {
+ if ($is_chem) {
+ &error("additional `begin chem'; chem is already active.");
+ return 1;
+ }
+ $is_chem = 'begin chem';
+ &init();
+ } else {
+ print "$line\n";
+ }
+ return 1;
+ }
+ if ($line =~ /^[\.']\s*cend\s*/) {
+ # line `.cend'
+ if ($is_chem) {
+ &error("you end chem with `.cend', but started it with `begin chem'.")
+ if $is_chem eq 'begin chem';
+ if ($is_pic eq 'by chem') {
+ &print_pe();
+ $is_pic = '';
+ }
+ $is_chem = '';
+ } else {
+ print "$line\n";
+ }
+ return 1;
+ }
+ if ($line =~ /^\s*end\s*$/) {
+ # line: `end'
+ if ($is_chem) {
+ &error("you end chem with `end', but started it with `.cstart'.")
+ if $is_chem eq '.cstart';
+ if ($is_pic eq 'by chem') {
+ &print_pe();
+ $is_pic = '';
+ }
+ $is_chem = '';
+ } else {
+ print "$line\n";
+ }
+ return 1;
+ }
+
+### main_line()
+ if (! $is_chem) {
+ print "$line\n";
+ return 1;
+ }
+ if ($line =~ /^[.']/) {
+ # groff request line
+ print "$line\n";
+ return 1;
+ }
+
+ if ($Words[0] eq 'pic') {
+ # pic pass-thru
+ return 1 if $#Words == 0;
+ my $s = $line;
+ $s =~ /^\s*pic\s*(.*)$/;
+ $s = $1;
+ print "$s\n" if $s;
+ $Last_Type = $Types{'OTHER'};
+ $Define{ $Words[2] } = 1 if $#Words >= 2 && $Words[1] eq 'define';
+ return 1;
+ }
+
+ if ($Words[0] eq 'textht') {
+ if ($#Words == 0) {
+ &error("`textht' needs a single argument.");
+ return 0;
+ }
+ &error("only the last argument is taken for `textht', " .
+ "all others are ignored.")
+ unless $#Words <= 1 or ($#Words == 2 && $Words[1] =~ /^=/);
+ $Params{'textht'} = $Words[$#Words];
+ return 1;
+ }
+### main_line()
+ if ($Words[0] eq 'cwid') { # character width
+ if ($#Words == 0) {
+ &error("`cwid' needs a single argument.");
+ return 0;
+ }
+ &error("only the last argument is taken for `cwid', " .
+ "all others are ignored.")
+ unless $#Words <= 1 or ($#Words == 2 && $Words[1] =~ /^=/);
+ $Params{'cwid'} = $Words[$#Words];
+ return 1;
+ }
+ if ($Words[0] eq 'db') { # bond length
+ if ($#Words == 0) {
+ &error("`db' needs a single argument.");
+ return 0;
+ }
+ &error("only the last argument is taken for `db', " .
+ "all others are ignored.")
+ unless $#Words <= 1 or ($#Words == 2 && $Words[1] =~ /^=/);
+ $Params{'db'} = $Words[$#Words];
+ return 1;
+ }
+ if ($Words[0] eq 'size') { # size for all parts of the whole diagram
+ my $size;
+ if ($#Words == 0) {
+ &error("`size' needs a single argument.");
+ return 0;
+ }
+ &error("only the last argument is taken for `size', " .
+ "all others are ignored.")
+ unless $#Words <= 1 or ($#Words == 2 && $Words[1] =~ /^=/);
+ if ($Words[$#Words] <= 4) {
+ $size = $Words[$#Words];
+ } else {
+ $size = $Words[$#Words] / 10;
+ }
+ &setparams($size);
+ return 1;
+ }
+
+### main_line()
+ print "\n#", $Line, "\n"; # debugging, etc.
+ $Last_Name = '';
+# $Last_Type = $Types{'OTHER'};
+# $Last_Type = '';
+
+ if ($Words[0] =~ /^[A-Z].*:$/) {
+ # label; falls thru after shifting left
+ my $w = $Words[0];
+ $Last_Name = $w;
+ $Last_Name =~ s/:$//;
+ print "$w";
+ shift @Words;
+ if (@Words) {
+ print " ";
+ $line =~ s/^\s*$w\s*//;
+ } else {
+ print "\n";
+ return 1;
+ }
+ }
+
+ if ($Words[0] eq 'define') {
+ print "$line\n";
+ $Define{ $Words[1] } = 1 if $#Words >= 1;
+ $Last_Type = $Types{'OTHER'};
+ return 1;
+ }
+ if ($Words[0] =~ /^[\[\]{}]/) {
+ print "$line\n";
+ $Last_Type = $Types{'OTHER'};
+ return 1;
+ }
+
+ if ($Words[0] =~ /^"/) {
+ print 'Last: ', $line, "\n";
+ $Last_Type = $Types{'OTHER'};
+ return 1;
+ }
+
+ if ($Words[0] =~ /bond/) {
+ &bond($Words[0]);
+ return 1;
+ }
+
+ if ($#Words >= 1) {
+ if ($Words[0] =~ /^(double|triple|front|back)$/ &&
+ $Words[1] eq 'bond') {
+ my $w = shift @Words;
+ $Words[0] = $w . $Words[0];
+ &bond($Words[0]);
+ return 1;
+ }
+ if ($Words[0] eq 'aromatic') {
+ my $temp = $Words[0];
+ $Words[0] = $Words[1] ? $Words[1] : '';
+ $Words[1] = $temp;
+ }
+ }
+
+ if ($Words[0] =~ /ring|benz/) {
+ &ring($Words[0]);
+ return 1;
+ }
+ if ($Words[0] eq 'methyl') {
+ # left here as an example
+ $Words[0] = 'CH3';
+ }
+### main_line()
+ if ($Words[0] =~ /^[A-Z]/) {
+ &molecule();
+ return 1;
+ }
+ if ($Words[0] eq 'left') {
+ my %left; # not used
+ $left{++$stack} = &fields(1, $#Words);
+ printf (("Last: [\n"));
+ return 1;
+ }
+ if ($Words[0] eq 'right') {
+ &bracket();
+ $stack--;
+ return 1;
+ }
+ if ($Words[0] eq 'label') { # prints the vertex numbers in a ring
+ if ( exists $Labtype{$Words[1]} and
+ $Labtype{$Words[1]} =~ /^$Types{'RING'}/ ) {
+ my $v = substr($Labtype{$Words[1]}, 1, 1);
+ $Words[1] = '' unless $Words[1];
+ foreach my $i ( 1..$v ) {
+ printf "\"\\s-3%d\\s0\" at 0.%d<%s.C,%s.V%d>\n", $i, $v + 2,
+ $Words[1], $Words[1], $i;
+ }
+ } else {
+ &error("$Words[1] is not a ring.");
+ }
+ return 1;
+ }
+
+ if ( exists $Define{ $Words[0] } ) {
+ print $line, "\n";
+ $Last_Type = $Types{'OTHER'};
+ return 1;
+ }
+ return 1 unless $line;
+# print STDERR "# $Line\n";
+# &error('This is not a chem command. To include a command for pic, ' .
+# "add `pic' as the first word to the command.");
+ print $line, "\n";
+ $Last_Type = $Types{'OTHER'};
+ 1;
+ } # main_line()
+
+}
+
+########################################################################
+# functions
+########################################################################
+
+##########
+# atom(<string>)
+#
+sub atom {
+ # convert CH3 to atom(...)
+ my ($s) = @_;
+ my ($i, $n, $nsub, $cloc, $nsubc, @s);
+ if ($s eq "\"\"") {
+ return $s;
+ }
+ $n = length($s);
+ $nsub = $nsubc = 0;
+ $cloc = index($s, 'C');
+ if (! defined($cloc) || $cloc < 0) {
+ $cloc = 0;
+ }
+ @s = split('', $s);
+ $i = 0;
+ foreach (@s) {
+ unless (/[A-Z]/) {
+ $nsub++;
+ $nsubc++ if $i < $cloc;
+ $i++;
+ }
+ }
+ $s =~ s/([0-9]+\.[0-9]+)|([0-9]+)/\\s-3\\d$&\\u\\s+3/g;
+ if ($s =~ /([^0-9]\.)|(\.[^0-9])/) { # centered dot
+ $s =~ s/\./\\v#-.3m#.\\v#.3m#/g;
+ }
+ sprintf( "atom(\"%s\", %g, %g, %g, %g, %g, %g)",
+ $s, ($n - $nsub / 2) * $Params{'cwid'}, $Params{'textht'},
+ ($cloc - $nsubc / 2 + 0.5) * $Params{'cwid'}, $Params{'crh'},
+ $Params{'crw'}, $Params{'dav'}
+ );
+} # atom()
+
+
+##########
+# bond(<type>)
+#
+sub bond {
+ my ($type) = @_;
+ my ($i, $moiety, $from, $leng);
+ $moiety = '';
+ for ($i = 1; $i <= $#Words; $i++) {
+ if ($Words[$i] eq ';') {
+ &error("a colon `;' must be followed by a space and a single word.")
+ if $i != $#Words - 1;
+ $moiety = $Words[$i + 1] if $#Words > $i;
+ $#Words = $i - 1;
+ last;
+ }
+ }
+ $leng = $Params{'db'}; # bond length
+ $from = '';
+ for ($Word_Count = 1; $Word_Count <= $#Words; ) {
+ if ($Words[$Word_Count] =~
+ /(\+|-)?\d+|up|down|right|left|ne|se|nw|sw/) {
+ $Dir = &cvtdir($Dir);
+ } elsif ($Words[$Word_Count] =~ /^leng/) {
+ $leng = $Words[$Word_Count + 1] if $#Words > $Word_Count;
+ $Word_Count += 2;
+ } elsif ($Words[$Word_Count] eq 'to') {
+ $leng = 0;
+ $from = &fields($Word_Count, $#Words);
+ last;
+ } elsif ($Words[$Word_Count] eq 'from') {
+ $from = &dofrom();
+ last;
+ } elsif ($Words[$Word_Count] =~ /^#/) {
+ $Word_Count = $#Words + 1;
+ last;
+ } else {
+ $from = &fields($Word_Count, $#Words);
+ last;
+ }
+ }
+### bond()
+ if ($from =~ /( to )|^to/) { # said "from ... to ...", so zap length
+ $leng = 0;
+ } elsif (! $from) { # no from given at all
+ $from = 'from Last.' . &leave($Last_Type, $Dir) . ' ' .
+ &fields($Word_Count, $#Words);
+ }
+ printf "Last: %s(%g, %g, %s)\n", $type, $leng, $Dir, $from;
+ $Last_Type = $Types{'BOND'};
+ $Labtype{$Last_Name} = $Last_Type if $Last_Name;
+ if ($moiety) {
+ @Words = ($moiety);
+ &molecule();
+ }
+} # bond()
+
+
+##########
+# bracket()
+#
+sub bracket {
+ my $t;
+ printf (("]\n"));
+ if ($Words[1] && $Words[1] eq ')') {
+ $t = 'spline';
+ } else {
+ $t = 'line';
+ }
+ printf "%s from last [].sw+(%g,0) to last [].sw to last [].nw to last " .
+ "[].nw+(%g,0)\n", $t, $Params{'dbrack'}, $Params{'dbrack'};
+ printf "%s from last [].se-(%g,0) to last [].se to last [].ne to last " .
+ "[].ne-(%g,0)\n", $t, $Params{'dbrack'}, $Params{'dbrack'};
+ if ($Words[2] && $Words[2] eq 'sub') {
+ printf "\" %s\" ljust at last [].se\n", &fields(3, $#Words);
+ }
+} # bracket()
+
+
+##########
+# corner(<dir>)
+#
+# Return the corner name next to the given angle.
+#
+sub corner {
+ my ($d) = @_;
+ $Dc{ (45 * int(($d + 22.5) / 45)) % 360 };
+} # corner()
+
+
+##########
+# cvtdir(<dir>)
+#
+# Maps "[pointing] somewhere" to degrees.
+#
+sub cvtdir {
+ my ($d) = @_;
+ if ($Words[$Word_Count] eq 'pointing') {
+ $Word_Count++;
+ }
+ if ($Words[$Word_Count] =~ /^[+\\-]?\d+/) {
+ return ( $Words[$Word_Count++] % 360 );
+ } elsif ($Words[$Word_Count] =~ /left|right|up|down|ne|nw|se|sw/) {
+ return ( $Dc{$Words[$Word_Count++]} % 360 );
+ } else {
+ $Word_Count++;
+ return $d;
+ }
+} # cvtdir()
+
+
+##########
+# dblring(<v>)
+#
+sub dblring {
+ my ($v) = @_;
+ my ($d, $v1, $v2);
+ # should canonicalize to i,i+1 mod v
+ $d = $Words[$Word_Count];
+ for ($Word_Count++; $Word_Count <= $#Words &&
+ $Words[$Word_Count] =~ /^[1-9]/; $Word_Count++) {
+ $v1 = substr($Words[$Word_Count], 0, 1);
+ $v2 = substr($Words[$Word_Count], 2, 1);
+ if ($v2 == $v1 + 1 || $v1 == $v && $v2 == 1) { # e.g., 2,3 or 5,1
+ $Dbl{$v1} = $d;
+ } elsif ($v1 == $v2 + 1 || $v2 == $v && $v1 == 1) { # e.g., 3,2 or 1,5
+ $Dbl{$v2} = $d;
+ } else {
+ &error(sprintf("weird %s bond in\n\t%s", $d, $_));
+ }
+ }
+} # dblring()
+
+
+##########
+# dofrom()
+#
+sub dofrom {
+ my $n;
+ $Word_Count++; # skip "from"
+ $n = $Words[$Word_Count];
+ if (defined $Labtype{$n}) { # "from Thing" => "from Thing.V.s"
+ return 'from ' . $n . '.' . &leave($Labtype{$n}, $Dir);
+ }
+ if ($n =~ /^\.[A-Z]/) { # "from .V" => "from Last.V.s"
+ return 'from Last' . $n . '.' . &corner($Dir);
+ }
+ if ($n =~ /^[A-Z][^.]*\.[A-Z][^.]*$/) { # "from X.V" => "from X.V.s"
+ return 'from ' . $n . '.' . &corner($Dir);
+ }
+ &fields($Word_Count - 1, $#Words);
+} # dofrom()
+
+
+##########
+# error(<string>)
+#
+sub error {
+ my ($s) = @_;
+ printf STDERR "chem: error in %s on line %d: %s\n",
+ $File_Name, $Line_No, $s;
+} # error()
+
+
+##########
+# fields(<n1>, <n2>)
+#
+sub fields {
+ my ($n1, $n2) = @_;
+ if ($n1 > $n2) {
+ return '';
+ }
+ my $s = '';
+ foreach my $i ($n1..$n2) {
+ if ($Words[$i] =~ /^#/) {
+ last;
+ }
+ $s = $s . $Words[$i] . ' ';
+ }
+ $s;
+} # fields()
+
+
+##########
+# init()
+#
+sub init {
+ if ($First_Time) {
+ printf "copy \"%s\"\n", $File_chem_pic;
+ printf "\ttextht = %g; textwid = .1; cwid = %g\n",
+ $Params{'textht'}, $Params{'cwid'};
+ printf "\tlineht = %g; linewid = %g\n",
+ $Params{'lineht'}, $Params{'linewid'};
+ $First_Time = 0;
+ }
+ printf "Last: 0,0\n";
+ $Last_Type = $Types{'OTHER'};
+ $Dir = 90;
+} # init()
+
+
+##########
+# leave(<last>, <d>)
+#
+sub leave {
+ my ($last, $d) = @_;
+ my ($c, $c1);
+ # return vertex of $last in direction $d
+ if ( $last eq $Types{'BOND'} ) {
+ return 'end';
+ }
+ $d %= 360;
+ if ( $last =~ /^$Types{'RING'}/ ) {
+ return &ringleave($last, $d);
+ }
+ if ( $last eq $Types{'MOL'} ) {
+ if ($d == 0 || $d == 180) {
+ $c = 'C';
+ } elsif ($d > 0 && $d < 180) {
+ $c = 'R';
+ } else {
+ $c = 'L';
+ }
+ if (defined $Dc{$d}) {
+ $c1 = $Dc{$d};
+ } else {
+ $c1 = &corner($d);
+ }
+ return sprintf('%s.%s', $c, $c1);
+ }
+ if ( $last eq $Types{'OTHER'} ) {
+ return &corner($d);
+ }
+ 'c';
+} # leave()
+
+
+##########
+# makering(<type>, <pt>, <v>)
+#
+sub makering {
+ my ($type, $pt, $v) = @_;
+ my ($i, $j, $a, $r, $rat, $fix, $c1, $c2);
+ if ($type =~ /flat/) {
+ $v = 6;
+ # vertices
+ ;
+ }
+ $r = $Params{'ringside'} / (2 * sin(pi / $v));
+ printf "\tC: 0,0\n";
+ for ($i = 0; $i <= $v + 1; $i++) {
+ $a = (($i - 1) / $v * 360 + $pt) / 57.29578; # 57. is $deg
+ printf "\tV%d: (%g,%g)\n", $i, $r * sin($a), $r * cos($a);
+ }
+ if ($type =~ /flat/) {
+ printf "\tV4: V5; V5: V6\n";
+ $v = 5;
+ }
+ # sides
+ if ($Nput > 0) {
+ # hetero ...
+ for ($i = 1; $i <= $v; $i++) {
+ $c1 = $c2 = 0;
+ if ($Put{$i} ne '') {
+ printf "\tV%d: ellipse invis ht %g wid %g at V%d\n",
+ $i, $Params{'crh'}, $Params{'crw'}, $i;
+ printf "\t%s at V%d\n", $Put{$i}, $i;
+ $c1 = $Params{'cr'};
+ }
+ $j = $i + 1;
+ if ($j > $v) {
+ $j = 1;
+ }
+### makering()
+ if ($Put{$j} ne '') {
+ $c2 = $Params{'cr'};
+ }
+ printf "\tline from V%d to V%d chop %g chop %g\n", $i, $j, $c1, $c2;
+ if ($Dbl{$i} ne '') {
+ # should check i<j
+ if ($type =~ /flat/ && $i == 3) {
+ $rat = 0.75;
+ $fix = 5;
+ } else {
+ $rat = 0.85;
+ $fix = 1.5;
+ }
+ if ($Put{$i} eq '') {
+ $c1 = 0;
+ } else {
+ $c1 = $Params{'cr'} / $fix;
+ }
+ if ($Put{$j} eq '') {
+ $c2 = 0;
+ } else {
+ $c2 = $Params{'cr'} / $fix;
+ }
+ printf "\tline from %g<C,V%d> to %g<C,V%d> chop %g chop %g\n",
+ $rat, $i, $rat, $j, $c1, $c2;
+ if ($Dbl{$i} eq 'triple') {
+ printf "\tline from %g<C,V%d> to %g<C,V%d> chop %g chop %g\n",
+ 2 - $rat, $i, 2 - $rat, $j, $c1, $c2;
+ }
+ }
+ }
+### makering()
+ } else {
+ # regular
+ for ($i = 1; $i <= $v; $i++) {
+ $j = $i + 1;
+ if ($j > $v) {
+ $j = 1;
+ }
+ printf "\tline from V%d to V%d\n", $i, $j;
+ if ($Dbl{$i} ne '') {
+ # should check i<j
+ if ($type =~ /flat/ && $i == 3) {
+ $rat = 0.75;
+ } else {
+ $rat = 0.85;
+ }
+ printf "\tline from %g<C,V%d> to %g<C,V%d>\n",
+ $rat, $i, $rat, $j;
+ if ($Dbl{$i} eq 'triple') {
+ printf "\tline from %g<C,V%d> to %g<C,V%d>\n",
+ 2 - $rat, $i, 2 - $rat, $j;
+ }
+ }
+ }
+ }
+### makering()
+ # punt on triple temporarily
+ # circle
+ if ($type =~ /benz/ || $Aromatic > 0) {
+ if ($type =~ /flat/) {
+ $r *= .4;
+ } else {
+ $r *= .5;
+ }
+ printf "\tcircle rad %g at 0,0\n", $r;
+ }
+} # makering()
+
+
+##########
+# molecule()
+#
+sub molecule {
+ my ($n, $type);
+ if ($#Words >= 0) {
+ $n = $Words[0];
+ if ($n eq 'BP') {
+ $Words[0] = "\"\" ht 0 wid 0";
+ $type = $Types{'OTHER'};
+ } else {
+ $Words[0] = &atom($n);
+ $type = $Types{'MOL'};
+ }
+ }
+ $n =~ s/[^A-Za-z0-9]//g; # for stuff like C(OH3): zap non-alnum
+ if ($#Words < 1) {
+ printf "Last: %s: %s with .%s at Last.%s\n",
+ $n, join(' ', @Words), &leave($type, $Dir + 180),
+ &leave($Last_Type, $Dir);
+### molecule()
+ } else {
+ if (! $Words[1]) {
+ printf "Last: %s: %s with .%s at Last.%s\n",
+ $n, join(' ', @Words), &leave($type, $Dir + 180),
+ &leave($Last_Type, $Dir);
+ } elsif ($#Words >= 1 and $Words[1] eq 'below') {
+ $Words[2] = '' if ! $Words[2];
+ printf "Last: %s: %s with .n at %s.s\n", $n, $Words[0], $Words[2];
+ } elsif ($#Words >= 1 and $Words[1] eq 'above') {
+ $Words[2] = '' if ! $Words[2];
+ printf "Last: %s: %s with .s at %s.n\n", $n, $Words[0], $Words[2];
+ } elsif ($#Words >= 2 and $Words[1] eq 'left' && $Words[2] eq 'of') {
+ $Words[3] = '' if ! $Words[3];
+ printf "Last: %s: %s with .e at %s.w+(%g,0)\n",
+ $n, $Words[0], $Words[3], $Params{'dew'};
+ } elsif ($#Words >= 2 and $Words[1] eq 'right' && $Words[2] eq 'of') {
+ $Words[3] = '' if ! $Words[3];
+ printf "Last: %s: %s with .w at %s.e-(%g,0)\n",
+ $n, $Words[0], $Words[3], $Params{'dew'};
+ } else {
+ printf "Last: %s: %s\n", $n, join(' ', @Words);
+ }
+ }
+
+ $Last_Type = $type;
+ if ($Last_Name) {
+ # $Last_Type = '';
+ $Labtype{$Last_Name} = $Last_Type;
+ }
+ $Labtype{$n} = $Last_Type;
+} # molecule()
+
+
+##########
+# print_hash(<hash_or_ref>)
+#
+# print the elements of a hash or hash reference
+#
+sub print_hash {
+ my $hr;
+ my $n = scalar @_;
+ if ($n == 0) {
+ print STDERR "empty hash\n;";
+ return 1;
+ } elsif ($n == 1) {
+ if (ref($_[0]) eq 'HASH') {
+ $hr = $_[0];
+ } else {
+ warn 'print_hash(): the argument is not a hash or hash reference;';
+ return 0;
+ }
+ } else {
+ if ($n % 2) {
+ warn 'print_hash(): the arguments are not a hash;';
+ return 0;
+ } else {
+ my %h = @_;
+ $hr = \%h;
+ }
+ }
+
+### print_hash()
+ unless (%$hr) {
+ print STDERR "empty hash\n";
+ return 1;
+ }
+ print STDERR "hash (ignore the ^ characters):\n";
+ for my $k (sort keys %$hr) {
+ my $hk = $hr->{$k};
+ print STDERR " $k => ";
+ if (defined $hk) {
+ print STDERR "^$hk^";
+ } else {
+ print STDERR "undef";
+ }
+ print STDERR "\n";
+ }
+
+ 1;
+} # print_hash()
+
+
+##########
+# print_pe()
+#
+sub print_pe {
+ print ".PE\n";
+} # print_pe()
+
+
+##########
+# print_ps()
+#
+sub print_ps {
+ print ".PS\n";
+} # print_ps()
+
+##########
+# putring(<v>)
+#
+sub putring {
+ # collect "put Mol at n"
+ my ($v) = @_;
+ my ($m, $mol, $n);
+ $Word_Count++;
+ $mol = $Words[$Word_Count++];
+ if ($Words[$Word_Count] eq 'at') {
+ $Word_Count++;
+ }
+ $n = $Words[$Word_Count];
+ if ($n !~ /^\d+$/) {
+ $n =~ s/(\d)+$/$1/;
+ $n = 0 if $n !~ /^\d+$/;
+ error('use single digit as argument for "put at"');
+ }
+ if ($n >= 1 && $n <= $v) {
+ $m = $mol;
+ $m =~ s/[^A-Za-z0-9]//g;
+ $Put{$n} = $m . ':' . &atom($mol);
+ } elsif ($n == 0) {
+ error('argument of "put at" must be a single digit');
+ } else {
+ error('argument of "put at" is too large');
+ }
+ $Word_Count++;
+} # putring()
+
+
+##########
+# ring(<type>)
+#
+sub ring {
+ my ($type) = @_;
+ my ($typeint, $pt, $verts, $i, $other, $fused, $withat);
+ $pt = 0; # points up by default
+ if ($type =~ /([1-8])$/) {
+ $verts = $1;
+ } elsif ($type =~ /flat/) {
+ $verts = 5;
+ } else {
+ $verts = 6;
+ }
+ $fused = $other = '';
+ for ($i = 1; $i <= $verts; $i++) {
+ $Put{$i} = $Dbl{$i} = '';
+ }
+ $Nput = $Aromatic = $withat = 0;
+ for ($Word_Count = 1; $Word_Count <= $#Words; ) {
+ if ($Words[$Word_Count] eq 'pointing') {
+ $pt = &cvtdir(0);
+ } elsif ($Words[$Word_Count] eq 'double' ||
+ $Words[$Word_Count] eq 'triple') {
+ &dblring($verts);
+ } elsif ($Words[$Word_Count] =~ /arom/) {
+ $Aromatic++;
+ $Word_Count++; # handled later
+### ring()
+ } elsif ($Words[$Word_Count] eq 'put') {
+ &putring($verts);
+ $Nput++;
+ } elsif ($Words[$Word_Count] =~ /^#/) {
+ $Word_Count = $#Words + 1;
+ last;
+ } else {
+ if ($Words[$Word_Count] eq 'with' || $Words[$Word_Count] eq 'at') {
+ $withat = 1;
+ }
+ $other = $other . ' ' . $Words[$Word_Count];
+ $Word_Count++;
+ }
+ }
+ $typeint = $Types{'RING'} . $verts . $pt; # RING | verts | dir
+ if ($withat == 0) {
+ # join a ring to something
+ if ( $Last_Type =~ /^$Types{'RING'}/ ) {
+ # ring to ring
+ if (substr($typeint, 2) eq substr($Last_Type, 2)) {
+ # fails if not 6-sided
+ $fused = 'with .V6 at Last.V2';
+ }
+ }
+ # if all else fails
+ $fused = sprintf('with .%s at Last.%s',
+ &leave($typeint, $Dir + 180), &leave($Last_Type, $Dir));
+ }
+ printf "Last: [\n";
+ &makering($type, $pt, $verts);
+ printf "] %s %s\n", $fused, $other;
+ $Last_Type = $typeint;
+ $Labtype{$Last_Name} = $Last_Type if $Last_Name;
+} # ring()
+
+
+##########
+# ringleave(<last>, <d>)
+#
+sub ringleave {
+ my ($last, $d) = @_;
+ my ($rd, $verts);
+ # return vertex of ring in direction d
+ $verts = substr($last, 1, 1);
+ $rd = substr($last, 2);
+ sprintf('V%d.%s', int( (($d - $rd) % 360) / (360 / $verts)) + 1,
+ &corner($d));
+} # ringleave()
+
+
+##########
+# setparams(<scale>)
+#
+sub setparams {
+ my ($scale) = @_;
+ $Params{'lineht'} = $scale * 0.2;
+ $Params{'linewid'} = $scale * 0.2;
+ $Params{'textht'} = $scale * 0.16;
+ $Params{'db'} = $scale * 0.2; # bond length
+ $Params{'cwid'} = $scale * 0.12; # character width
+ $Params{'cr'} = $scale * 0.08; # rad of invis circles at ring vertices
+ $Params{'crh'} = $scale * 0.16; # ht of invis ellipse at ring vertices
+ $Params{'crw'} = $scale * 0.12; # wid
+ $Params{'dav'} = $scale * 0.015; # vertical shift up for atoms in atom macro
+ $Params{'dew'} = $scale * 0.02; # east-west shift for left of/right of
+ $Params{'ringside'} = $scale * 0.3; # side of all rings
+ $Params{'dbrack'} = $scale * 0.1; # length of bottom of bracket
+} # setparams()
+
+
+##########
+# usage()
+#
+# Print usage information for --help.
+#
+sub usage {
+ print "\n";
+ &version();
+ print <<EOF;
+
+Usage: $Chem_Name [option]... [filespec]...
+
+$Chem_Name is a groff preprocessor for producing chemical structure
+diagrams. The output suits to the pic preprocessor.
+
+"filespec" is one of
+ "filename" name of a readable file
+ "-" for standard input
+
+All available options are
+
+-h --help print this usage message.
+-v --version print version information.
+
+EOF
+} # usage()
+
+
+##########
+# version()
+#
+# Get version information from version.sh and print a text with this.
+#
+sub version {
+ $Groff_Version = $Groff_Version_Preset unless $Groff_Version;
+ my $year = $Last_Update;
+ $year =~ s/^.* //;
+ print <<EOF;
+$Chem_Name $Program_Version of $Last_Update (Perl version)
+is part of groff version $Groff_Version.
+Copyright (C) $year Free Software Foundation, Inc.
+GNU groff and chem come with ABSOLUTELY NO WARRANTY.
+You may redistribute copies of groff and its subprograms
+under the terms of the GNU General Public License.
+EOF
+} # version()
+
+1;
+### Emacs settings
+# Local Variables:
+# mode: CPerl
+# End:
BIN  bin/chgrp.exe
Binary file not shown
BIN  bin/chmod.exe
Binary file not shown
BIN  bin/chown.exe
Binary file not shown
BIN  bin/chroot.exe
Binary file not shown
BIN  bin/cksum.exe
Binary file not shown
BIN  bin/cmp.exe
Binary file not shown
BIN  bin/comm.exe
Binary file not shown
BIN  bin/conv.exe
Binary file not shown
150 bin/copy-user-registry-fstab
@@ -0,0 +1,150 @@
+#!/bin/bash
+#
+# The purpose of this script is to create a user specifc fstab file
+# for Cygwin release 1.7.0 and later from the user mount points of
+# the current user, stored in the registry by an earlier installation
+# of Cygwin (pre-1.7.0).
+#
+# The registry mount points are stored in a file /etc/fstab.d/<username>
+#
+
+export PATH="/bin:$PATH"