Article 13725 of alt.sources:
Path: nntpd.lkg.dec.com!lead.zk3.dec.com!pa.dec.com!news1.digital.com!nntp-hub2.barrnet.net!news.sgi.com!news.sprintlink.net!news-peer.sprintlink.net!howland.erols.net!news.bbnplanet.com!cam-news-hub1.bbnplanet.com!uunet!in1.uu.net!news.iij.ad.jp!wnoc-tyo-news!waseda.ac.jp!cfi.waseda!wsdnws.cfi.waseda.ac.jp!seiichi
From: seiichi@muraoka.info.waseda.ac.jp (YOSHIDA Seiichi)
Newsgroups: alt.sources
Subject: pad2ps-3.1 (7/11)
Followup-To: alt.sources
Date: 03 Nov 1996 10:31:34 GMT
Organization: Centre for Infomatics, Waseda University
Lines: 5015
Distribution: world
Message-ID: <SEIICHI.96Nov3193134@muras5.muraoka.info.waseda.ac.jp>
NNTP-Posting-Host: unknown@muras5.muraoka.info.waseda.ac.jp
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Xref: nntpd.lkg.dec.com alt.sources:13725

#!/bin/sh
# This is `pad2ps-3.1.07' (part 7 of a multipart archive).
# Do not concatenate these parts, unpack them in order with `/bin/sh'.
# File `pad2ps-3.1/doc/manual.ps' is being continued...
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
if test ! -r _sh23946/seq; then
  $echo 'Please unpack part 1 first!'
  exit 1
fi
shar_sequence=`cat _sh23946/seq`
if test "$shar_sequence" != 7; then
  $echo 'Please unpack part' "$shar_sequence" 'next!'
  exit 1
fi
if test ! -f _sh23946/new; then
  $echo 'x -' 'STILL SKIPPING' 'pad2ps-3.1/doc/manual.ps'
else
  $echo 'x -' 'continuing file' 'pad2ps-3.1/doc/manual.ps'
  sed 's/^X//' << 'SHAR_EOF' >> pad2ps-3.1/doc/manual.ps &&
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
22 r (12,16)s
322 2337 p (if)s
2 r 12 2 ru
13 r (rightspace)s
f4 SF
20 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
21 r (30)s
322 2387 p (if)s
2 r 12 2 ru
13 r (vspace)s
f4 SF
26 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
f3 SF
26 r (30)s
322 2437 p (Jav)s
-3 r (a)s
f4 SF
18 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
18 r (22)s
322 2486 p (jav)s
-3 r (a2pad)s
f4 SF
24 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
25 r (22)s
322 2536 p (lab)s
1 r (el)s
f4 SF
25 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
25 r (18)s
322 2586 p (linewidth)s
f4 SF
21 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
21 r (30)s
322 2636 p (lo)s
1 r (cate)s
f4 SF
24 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
24 r (26)s
322 2686 p (max)s
2 r 12 2 ru
13 r (length)s
f4 SF
21 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
f3 SF
21 r (28)s
322 2736 p (message)s
f4 SF
23 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
23 r (24)s
322 2785 p (min)s
2 r 12 2 ru
13 r (length)s
f4 SF
25 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
f3 SF
25 r (28)s
322 2835 p (mkpad)s
f4 SF
25 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
25 r (20)s
1093 195 p (newpage)s
f4 SF
18 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
18 r (28)s
1093 245 p (pad.st)s
-1 r (y)s
f4 SF
21 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
22 r (5)s
1093 295 p (pad)s
2 r 12 2 ru
13 r (vspace)s
f4 SF
23 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
f3 SF
23 r (30)s
1093 345 p (pad2eps)s
f4 SF
24 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
24 r (6)s
1093 394 p (pad2ps)s
f4 SF
24 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
24 r (4)s
1093 444 p (pad2tex)s
f4 SF
25 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
25 r (5)s
1093 494 p (P)s
-3 r (ADEL)s
f4 SF
25 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
26 r (7)s
1093 544 p (padframe)s
f4 SF
20 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
f3 SF
21 r (27)s
1093 594 p (padframe)s
2 r 12 2 ru
13 r (hspace)s
f4 SF
17 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
17 r (30)s
1093 643 p (padframe)s
2 r 12 2 ru
13 r (vspace)s
f4 SF
18 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
f3 SF
18 r (30)s
1093 693 p (padlinewidth)s
f4 SF
24 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
24 r (30)s
1093 743 p (padtitle)s
2 r 12 2 ru
13 r (rate)s
f4 SF
19 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
f3 SF
20 r (29)s
1093 793 p (page)s
f4 SF
17 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
18 r (26)s
1093 843 p (page)s
2 r 12 2 ru
13 r (b)s
1 r (ottom)s
f4 SF
17 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
17 r (29)s
1093 892 p (page)s
2 r 12 2 ru
13 r (left)s
f4 SF
17 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
f3 SF
18 r (29)s
1093 942 p (page)s
2 r 12 2 ru
13 r (righ)s
-1 r (t)s
f4 SF
22 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
22 r (29)s
1093 992 p (page)s
2 r 12 2 ru
13 r (top)s
f4 SF
26 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
26 r (29)s
1093 1042 p (pageframe)s
f4 SF
21 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
21 r (27)s
1093 1092 p (p)s
1 r (oster)s
f4 SF
21 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
f3 SF
22 r (28)s
1093 1142 p (refer)s
f4 SF
18 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
18 r (18)s
1093 1191 p (sh2pad)s
f4 SF
23 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
23 r (21)s
1093 1241 p (sideline)s
2 r 12 2 ru
13 r (space)s
f4 SF
19 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
f3 SF
19 r (30)s
1093 1291 p (switc)s
-1 r (h)s
f4 SF
20 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
20 r (13)s
1093 1341 p (texmo)s
1 r (de)s
f4 SF
21 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
21 r (5,26)s
1093 1391 p (title)s
f4 SF
22 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
22 r (24)s
1093 1440 p (title)s
2 r 12 2 ru
13 r (rate)s
f4 SF
25 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
25 r (29)s
1093 1490 p (titleb)s
1 r (ox)s
f4 SF
25 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
26 r (27)s
1093 1540 p (try)s
f5 SF
13 r (\030)s
f3 SF
14 r (catch)s
f4 SF
18 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
f3 SF
19 r (17)s
1093 1590 p (vrate)s
f4 SF
21 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
22 r (27)s
1093 1640 p (vspace)s
f4 SF
18 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
18 r (30)s
1093 1689 p (vsp)s
f4 SF
19 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
19 r (29)s
1093 1739 p (while)s
f4 SF
21 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
6 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
7 r (:)s
f3 SF
21 r (10)s
EP
%%Trailer
%%Pages: 34
END
%%EOF
SHAR_EOF
  $echo 'File' 'pad2ps-3.1/doc/manual.ps' 'is complete' &&
  $shar_touch -am 1102183296 'pad2ps-3.1/doc/manual.ps' &&
  chmod 0644 'pad2ps-3.1/doc/manual.ps' ||
  $echo 'restore of' 'pad2ps-3.1/doc/manual.ps' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/doc/manual.ps:' 'MD5 check failed'
f4e45000e444e038294d6e2d69f58bb9  pad2ps-3.1/doc/manual.ps
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/doc/manual.ps'`"
    test 330177 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/doc/manual.ps:' 'original size' '330177,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/mkpad.man ==============
if test -f 'pad2ps-3.1/mkpad.man' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/mkpad.man' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/mkpad.man' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/mkpad.man' &&
X.\"
X.\"  mkpad.1 -- pad2ps 3.1j  1996-11-02
X.\"
X.\"  S. Yoshida (seiichi@muraoka.info.waseda.ac.jp)
X.\"
X.TH MKPAD 1 "1996-11-02" "pad2ps 3.1"
X.SH "NAME"
mkpad \- convert various programs into PADEL
X.SH "SYNOPSIS"
X.B "mkpad"
[-awk] [-c] [-c++] [-csh] [-java] [-sh]
X.SH "DESCRIPTION"
X.I mkpad
convert C, C++, Bourne shell, C shell, Java, and AWK programs into
PADEL.  The original program is read from the standard input, and the
output is produced on the standard output.
X.SH "OPTIONS"
X.IP \fB\-awk\fR
X.br
Convert AWK program into PADEL.
X.PP
X.IP \fB\-c\fR
X.br
Convert C program into PADEL.
X.PP
X.IP \fB\-c++\fR
X.br
Convert C++ program into PADEL.
X.PP
X.IP \fB\-csh\fR
X.br
Convert C shell program into PADEL.
X.PP
X.IP \fB\-java\fR
X.br
Convert Java program into PADEL.
X.PP
X.IP \fB\-sh\fR
X.br
Convert Bourne shell program into PADEL.
X.PP
X.SH "ENVIRONMENT VARIABLES"
X.IP \fB\PAD2PSLIB\fR
X.br
Specifies the path where the modules for \fIpad2ps\fPseries are located.
By default, this variable is set as /usr/local/lib/pad2ps.
X.PP
X.IP \fB\TMP\fR
X.br
Specifies the directory where temporary files are to be created.
By defalut, this variable is set as /tmp.
X.PP
X.SH "FILES"
X.nf
X.ta \w'/usr/local/lib/tex/macros/pad.sty__'u
/usr/local/bin/pad2*               execute files
/usr/local/bin/mkpad               translation script into PADEL
/usr/local/lib/pad2ps/pad2*        main modules
/usr/local/lib/pad2ps/*2pad        translation modules into PADEL
/usr/local/lib/tex/macros/pad.sty  style file
/usr/local/man/man1/pad2*.1        manual pages
/usr/local/man/man1/mkpad.1        manual pages
/tmp/pad2ps-XXXXXX                 temporary files
/tmp/foo2pad-XXXXXX                temporary files
/tmp/c2pad-XXXXXX                  temporary files
X.SH "SEE ALSO"
pad2ps(1).
X.SH "AUTHOR"
X.nf
Seiichi Yoshida
X.br
seiichi@muraoka.info.waseda.ac.jp
X.br
http://www.info.waseda.ac.jp/muraoka/members/seiichi/index.html
SHAR_EOF
  $shar_touch -am 1102142396 'pad2ps-3.1/mkpad.man' &&
  chmod 0644 'pad2ps-3.1/mkpad.man' ||
  $echo 'restore of' 'pad2ps-3.1/mkpad.man' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/mkpad.man:' 'MD5 check failed'
3344aaff36cc1e9e956181fdf4e722c4  pad2ps-3.1/mkpad.man
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/mkpad.man'`"
    test 1899 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/mkpad.man:' 'original size' '1899,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/pad2ps.man ==============
if test -f 'pad2ps-3.1/pad2ps.man' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/pad2ps.man' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/pad2ps.man' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/pad2ps.man' &&
X.\"
X.\"  pad2ps.1 -- pad2ps 3.1  1996-11-02
X.\"
X.\"  S. Yoshida (seiichi@muraoka.info.waseda.ac.jp)
X.\"
X.TH PAD2PS 1 "1996-11-02" "pad2ps 3.1"
X.SH "NAME"
pad2ps  \- Draw PAD figure in PostScript format
X.br
pad2tex \- Draw PAD figure in LaTeX format
X.br
pad2eps \- Draw PAD figure in Encapsulated PostScript format
X.SH "SYNOPSIS"
X.B "pad2ps"
[ \fIinput-file-name\fP  [ \fIoutput-file-name\fP ] ]
[-awk] [-c] [-c++] [-csh] [-D \fIsymbol-name\fP[=\fIvalue\fP] ... ]
[-dir \fIdirectory\fP] [-help] [-ifdef] [-inline] [-java]
[-nohelp] [-noopt] [-O] [-P \fIparameter-variables\fP=\fIvalue\fP ... ]
[-pad] [-quiet] [-semicolon] [-sh] [-stdin] [-tab \fIvalue\fP] [-warn]
X.SH "DESCRIPTION"
X.I pad2ps
,
X.I pad2tex
, and
X.I pad2eps
convert a PAD source written in PADEL syntax into PostScript, LaTeX, 
and Encapsulated PostScript (EPS) format.
X.I pad2ps
,
X.I pad2tex
,
X.I pad2eps
also convert C, C++, Bourne shell, C shell, Java, and AWK programs into
PostScript, LaTeX, and EPS format.
X.SH "OPTIONS"
X.IP \fB\-awk\fR
X.br
Specifies that the input file is the AWK program.
You do not need to set this option if the suffix of the input file is \.awk.
X.PP
X.IP \fB\-c\fR
X.br
Specifies that the input file is the C program.
You do not need to set this option if the suffix of the input file is \.c.
X.PP
X.IP \fB\-c++\fR
X.br
Specifies that the input file is the C++ program.
You do not need to set this option if the suffix of the input file
is \.cc, \.cpp, or \.C.
X.PP
X.IP \fB\-csh\fR
X.br
Specifies that the input file is the C shell program.
You do not need to set this option if the suffix of the input file
is \.csh.
X.PP
X.IP \fB-D\fR
\fIsymbol\fP[=\fIvalue\fP] \.\.\.
X.sp
This option is only valid when converting C or C++ program.
This option defines symbol name(s) used for #ifdef, #ifndef, and others.
When defining multiple symbols, list the symbols after \fB\-D\fR.
X.sp
X    ex. pad2ps filename -D DEBUG __linux__
X.sp
The values may be attached to the symbols.  For example, 
X.sp
X        pad2ps filename -D MAX=100 > z.ps
X.sp
is equivalent to writing,
X.sp
X        #define MAX 100
X.sp
in filename.
X.PP
X.IP \fB-dir\fR
\fIdirectory\fP
X.sp
When the output file name is specified for \fIpad2eps\fP and others, the files
are created in the current directory.  You should set this option if you want
to create the file in other directory.
X.PP
X.IP \fB\-help\fR
X.br
Print the help messages.
X.PP
X.IP \fB\-ifdef\fR
X.br
This option is only valid when converting C and C++ programs.
By setting this option, all symbols to be defined are printed.  This is 
all listing of the symbols used in #ifdef and others.
X.PP
X.IP \fB\-inline\fR
X.br
This option is only valid when converting C++ programs.
By setting this option, PAD figures for inline functions that is defined 
inside the class definition will be drawn.  By default, only functions that
are defined outside the class definition are converted into PAD figures.
X.PP
X.IP \fB\-java\fR
X.br
Specifies that the input file is the Java program.
You do not need to set this option if the suffix of the input file is \.java.
X.PP
X.IP \fB\-nohelp\fR
X.br
Does not print the help messages.
This option is handy when using the command in script.
X.PP
X.IP \fB\-noopt\fR
X.br
This option is only valid when converting C, C++, and Java programs.
This is the opposite of \fB\-O\fR option; By setting this option, everything
including the variable declarations will be printed.
X.PP
X.IP \fB\-O\fR
X.br
This option is only valid when converting C, C++, and Java programs.
By setting this option, optimization is done.  This means variable
declarations such as:
X.sp
X	int i;
X.sp
will not be printed in PAD.  However, the variable declarations with 
initialization, such as:
X.sp
X	int i=0;
X.sp
will be printed in PAD.
All global variable declared at top of a C or C++ program are also
printed, regardless of whether \fB\-O\fR option is set.
X.PP
X.IP \fB-P\fR
\fIparameter-variable\fP=\fIvalue\fP \.\.\.
X.sp
Specifies the parameter variables.
When specifing multiple variables, list the variables right after \fB\-P\fR.
X.sp
X    ex. pad2ps filename -P page=1 centering=on
X.PP
X.IP \fB\-pad\fR
X.br
Specifies that the input file is written in the PAD syntax (PADEL).
When this option is specified, the suffix of the input file is ignored.
For instance, the file with the suffix .c will not be treated as C program.
X.PP
X.IP \fB\-quiet\fR
X.br
Suspend printing messages other than error messages.
This option is handy when using the command in script.
X.PP
X.IP \fB\-semicolon\fR
X.br
This option is only valid when converting C, C++, or Java program.
By setting this option, ';' at end of lines will be printed.
X.PP
X.IP \fB\-sh\fR
X.br
Specifies that the input file is Bourne shell program.
You do not need to set this option if the suffix of the input file is \.sh.
X.PP
X.IP \fB\-stdin\fR
X.br
Reads from the standard input.  When no input file name is specified, pad2ps
will automatically read from the standard input, so this option may be omitted.
But if you want to read from the standard input and want to specifies the output file
name, then yoiu need to set this option.
X.PP
X.IP \fB\-tab\fR
\fIvalue\fP
X.sp
Sets tab width for LaTeX file created with \fIpad2tex\fP, or tab width for PADEL
file  converted by \fImkpad\fP.
X.PP
X.IP \fB\-warn\fR
X.br
Print warnings.
X.PP
X.SH "PARAMETER VARIABLES"
X.IP \fBtitle\fR
= \fIstring\fP
X.IP " " 7
Specifies the overall title of PAD, if any.
The string may contain spaces.
By default, the file name will be the title when executed with the file name.  If executed
without file name, then no title is set by default.
X.sp
X    ex. /* pad2ps: title = This is a pad title. */
X.PP
X.IP \fBmessage\fR 8
= \fIstring\fP
X.IP " " 7
Writes messages in specified position in PAD.
The message is regarded as normal statement, except that the message is not enclosed by frame.
X.PP
X.IP \fBcomment\fR 8
= \fIstring\fP
X.IP " " 7
Specifies the comment that should be attached to a PAD box.
The comment should be written in the next line of the destination box.
In PAD figure, the comment is attached to the right of the box.
X.PP
X.IP \fBtexmode\fR 8
= latex | verbatim
X.IP " " 7
Specifies whether the string in the original PADEL is regarded as LaTeX command or
regarded as normal string, when converting into LaTeX format with \fIpad2tex\fP.
When latex is specified the following PADEL will give you a Sigma notation:
X.sp
X	if ( $ \\sum_{i=0}^{\\infty} x_{i} = 0 $ ) {
X.br
X		$ s = \\sum_{i=0}^{\\infty} x_{i}^{2} $
X.br
X	}
X.sp
If verbatim is specified, then the string is printed as it is.  The default setting
is verbatim.
X.PP
X.IP \fBcentering\fR 10
= on | off
X.IP " " 7
When on is set, the output is centerized; otherwise the output is aligned to left.
The default is on.
X.PP
X.IP \fBlocate\fR 7
= topdown | bottomup | middle
X.IP " " 7
Specifies the location format of PAD.
The default is middle.
X.PP
X.IP \fBpage\fR
= \fIvalue\fP
X.sp
Specifies starting page where you want to print page numbers.
By default, the page numbers are not printed.  So you need to set this option 
even if you are to print page numbers from the first page.
X.PP
X.IP \fBfigure\fR
= \fIvalue\fP
X.IP " " 7
Specifies starting number when you want to put figure numbers to each PAD figures.
By default, no figure number is put.
X.PP
X.IP \fBfigure_locate\fR 14
= top | bottom
X.IP " " 7
Specifies the location of figure title.
Top will put the title above the PAD figure, and bottom will put below.
By default, bottom is selected when printing figure numbers; otherwise top is
selected.
X.PP
X.IP \fBtitlebox\fR 9
= on | off
X.IP " " 7
When off is selected, each PAD's title (function name for C program) will become
the figure title for each PAD figure.
When on is selected, each PAD's title will be written inside PAD as a PAD box with
double lined sidelines. 
The default is off.
X.PP
X.IP \fBpageframe\fR 10
= on | off
X.IP " " 7
When on is selected, each page is enclosed with frame.
By default this option is off.
X.PP
X.IP \fBpadframe\fR 9
= on | off
X.IP " " 7
When on is selected, each PAD as a whole is enclosed with frame.
When \fBcentering\fR is on, the frame size will be aligned to PAD size; otherwise the size
is the same as the page width.
By default this option is on.
X.PP
X.IP \fBslice\fR
= on | off
X.IP " " 7
When on is selected, each PAD is drawn at top of a new page; otherwise a PAD will be drawn
without any consideration of page boundary.
The default is off.
X.PP
X.IP \fBhrate\fR
= \fIvalue\fP
X.IP " " 7
Specifies horizontal magnification ratio.
You can set fraction value.
The default value is 1.0.
X.PP
X.IP \fBvrate\fR
= \fIvalue\fP
X.IP " " 7
Specifies vertical magnification ratio.
The default value is 1.0.
X.PP
X.IP \fBposter\fR
= on | off
X.IP " " 7
When on is selected, a large PAD that would split over several pages in sideway 
is created as it is; otherwise the output will be compressed as to put the figure
in one paper.
The default setting is off.
X.PP
X.IP \fBmax_length\fR 11
= \fIvalue\fP
X.IP " " 7
Specifies the maximum length of PAD string.
All strings longer than this value will be folded.
The default value is infinity.
X.PP
X.IP \fBmin_length\fR 11
= \fIvalue\fP
X.IP " " 7
Specifies the minimum length of PAD string.
No string will be shorter than this value when folded.
The default value is 0.
X.PP
X.IP \fBnewpage\fR
X.sp
Insert page break at specified location.
X.PP
X.IP \fBvsp\fR
= \fIvalue\fP
X.IP " " 7
Put vertical spacing at specified location.
You can freely set the amount of spaces to be put.
When negative number is specified, the interval between PADs is lessened.
Unlike adding empty lines, you can put spaces at head of a program.
X.PP
X.IP "PAGE SIZE"
X.IP \fBpage_top\fR 9
= \fIvalue\fP
X.IP " " 7
Specifies the coordinate of top of a page.
The default value is 9800.
The value may range from 0 to 10000.
X.PP
X.IP \fBpage_bottom\fR 12
= \fIvalue\fP
X.IP "  " 7
Specifies the coordinate of a bottom of a page.
The default value is 0.
You cannot chage the location of page number by changing this value, though.
X.PP
X.IP \fBpage_left\fR 10
= \fIvalue\fP
X.IP " " 7
Specifies the coordinate of a left of a page.
This value is used for aligning PAD when \fBcentering\fR is off.
When \fBcentering\fR is on, this value is ignored
The default value is 500.
The value may range from 0 to 9000.
X.PP
X.IP \fBpage_right\fR 11
= \fIvalue\fP
X.IP " " 7
Specifies the coordinate of a right of a page.
This value is ignored when \fBcentering\fR is on.
The default value is 8500.
X.PP
X.IP "FONT SIZE"
X.IP \fBfontsize\fR 9
= \fIvalue\fP
X.IP " " 7
Specifies the height of the font.
The default value is 200
X.PP
X.IP \fBfontwidth\fR 10
= \fIvalue\fP
X.IP " " 7
Specifies the width of the alphabets font.
The default value is 100.
X.PP
X.IP \fBtitle_rate\fR 11
= \fIvalue\fP
X.IP " " 7
Specifies the magnification ratio of the overall title font to the normal font.
The default value is 2.0.
X.PP
X.IP \fBpadtitle_rate\fR 14
= \fIvalue\fP
X.IP " " 7
Specifies the magnification ratio of the PAD title font to the normal font.
The default value is 1.5.
This value is ignored when printing figure number.
X.PP
X.IP \fBfigure_rate\fR 12
= \fIvalue\fP
X.IP " " 7
Specifies the magnification ratio of the PAD figure title font to the normal font.
The default value is 1.5.
This value is only valid when printing figure number.
X.PP
X.IP "SPACES"
X.IP \fBpad_vspace\fR 16
= \fIvalue\fP ( 400 )
X.IP \fBvspace\fR 16
= \fIvalue\fP ( 120 )
X.IP \fBhspace\fR 16
= \fIvalue\fP ( 200 )
X.IP \fBbox_vspace\fR 16
= \fIvalue\fP (  25 )
X.IP \fBif_vspace\fR 16
= \fIvalue\fP (  50 )
X.IP \fBbox_hspace\fR 16
= \fIvalue\fP ( 125 )
X.IP \fBif_rightspace\fR 16
= \fIvalue\fP ( 200 )
X.IP \fBsideline_space\fR 16
= \fIvalue\fP (  50 )
X.IP \fBpadframe_vspace\fR 16
= \fIvalue\fP ( 180 )
X.IP \fBpadframe_hspace\fR 16 
= \fIvalue\fP ( 300 )
X.IP " " 7
Each value shows the size of spaces to be put in the corresponding places.
Set these values accordingly to make fine tunings.
The values in paranthesis are the default.
X.PP
X.IP "LINE THICKNESS"
X.IP \fBlinewidth\fR 10
= \fIvalue\fP
X.IP " " 7
Specifies the thickness of lines that connect PADs.
The default value is 16.
X.PP
X.IP \fBpadlinewidth\fR 13
= \fIvalue\fP
X.IP " " 7
Specifies the thickness of lines used to draw PAD.
The default value is 16.
X.PP
X.IP \fBframelinewidth\fR 15
= \fIvalue\fP
X.IP " " 7
Specifies the thickness of lines used for frames.
The default value is 8.
X.PP
X.SH "ENVIRONMENT VARIABLES"
X.IP \fB\PAD2PSLIB\fR
X.br
Specifies the path where the modules for \fIpad2ps\fP series are located.
By default, this variable is set as /usr/local/lib/pad2ps.
X.PP
X.IP \fB\TMP\fR
X.br
Specifies the directory where temporary files are to be created.
By default, this variable is set as /tmp.
X.PP
X.SH "FILES"
X.nf
X.ta \w'/usr/local/lib/tex/macros/pad.sty__'u
/usr/local/bin/pad2*               execute files
/usr/local/bin/mkpad               translation script into PADEL
/usr/local/lib/pad2ps/pad2*        main modules
/usr/local/lib/pad2ps/*2pad        translation modules into PADEL
/usr/local/lib/tex/macros/pad.sty  style file
/usr/local/man/man1/pad2*.1        manual pages
/usr/local/man/man1/mkpad.1        manual pages
/tmp/pad2ps-XXXXXX                 temporary files
/tmp/foo2pad-XXXXXX                temporary files
/tmp/c2pad-XXXXXX                  temporary files
X.SH "AUTHOR"
X.nf
Seiichi Yoshida
X.br
seiichi@muraoka.info.waseda.ac.jp
X.br
http://www.info.waseda.ac.jp/muraoka/members/seiichi/index.html
X
X
X
SHAR_EOF
  $shar_touch -am 1102152296 'pad2ps-3.1/pad2ps.man' &&
  chmod 0644 'pad2ps-3.1/pad2ps.man' ||
  $echo 'restore of' 'pad2ps-3.1/pad2ps.man' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/pad2ps.man:' 'MD5 check failed'
cdd737c53d56525e94c6bd0baf9e604d  pad2ps-3.1/pad2ps.man
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/pad2ps.man'`"
    test 13322 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/pad2ps.man:' 'original size' '13322,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/awk2pad/parser.c ==============
if test ! -d 'pad2ps-3.1/src'; then
  $echo 'x -' 'creating directory' 'pad2ps-3.1/src'
  mkdir 'pad2ps-3.1/src'
fi
if test ! -d 'pad2ps-3.1/src/awk2pad'; then
  $echo 'x -' 'creating directory' 'pad2ps-3.1/src/awk2pad'
  mkdir 'pad2ps-3.1/src/awk2pad'
fi
if test -f 'pad2ps-3.1/src/awk2pad/parser.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/awk2pad/parser.c' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/awk2pad/parser.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/awk2pad/parser.c' &&
/*                                                                     */
/*  parser.c -- translate AWK program into PADEL and print the result  */
/*                                                                     */
/*  awk2pad  by S. Yoshida                                             */
/*                                                                     */
X
#include "config.h"
X
#include <string.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
#include <ctype.h>
#include "awk2pad.h"
#include "lib.h"
X
#define MAKE_STRING_WHILE(X)	{\
X				    count_paren = 0;\
X				    set_str();\
X				    get_token();\
X				    while(X){\
X					if(token == Ret){\
X					    append(" ");\
X					    *sp = '\0';\
X					    do{\
X						get_token();\
X					    }while(token == Sp);\
X					}else{\
X					    if(token == Sp){\
X						strcat(sp,word);\
X					    }else{\
X						if(token == Lpar)\
X						     count_paren--;\
X						if(token == Rpar)\
X						     count_paren++;\
X						if(*sp != '\0')\
X						    append(sp);\
X						*sp = '\0';\
X						append_str();\
X					    }\
X					    get_token();\
X					}\
X				    }\
X				    if(*sp != '\0')\
X					append(sp);\
X				    *sp = '\0';\
X				}
X
#define END_OF_LINE()		{\
X				    tt = token; get_token();\
X				     while(token == Sp)\
X					get_token();\
X				    if(tt != Ret  &&  token == Ret)\
X					get_token();\
X				}
X
static char *str = NULL;
static int nest_level = 0;
static int count_paren = 0;
static token_type tt = Nontoken;
X
static void function(void);
static void body(void);
static void command(void);
static void for_statement(void);
static void else_statement(void);
static void do_statement(void);
static void condition(void);
X
static void set_str(void);
static void append_str(void);
static void append(char *);
static void print_str(void);
static void print_hsp(void);
X
void parser(void)
/* output */
{
#ifdef DEBUG
X    if(quiet == Off)
X	fprintf(stderr,"Translating AWK program into PADEL starts...");
#endif
X
X    get_token();
X
X    while(token != Eof){
X	while(token == Sp)
X	    get_token();
X
X	if(token == Ret){               /* empty line */
X	    putchar('\n');
X	    get_token();
X	}else if(token != Eof)
X	    function();			/* pattern or function */
X    }
X
#ifdef DEBUG
X    if(quiet == Off)
X	fprintf(stderr,"done\n");
#endif
}
X
void function(void)
/* pattern or function */
{
X    char sp[BUFSIZ] = {'\0'};
X    char buf[BUFSIZ];
X    int p;
X
X    str = NULL;
X    if(token != Lbrace){
X	MAKE_STRING_WHILE(token != Lbrace  &&  token != Eof);
X	print_str();
X	putchar('\n');
X    }
X    puts("{");
X
X    nest_level++;
X    body();
X    nest_level--;
X
X    puts("}");
X
X    END_OF_LINE();
}
X
void body(void)
{
X    char sp[BUFSIZ] = {'\0'};
X
X    get_token();
X    END_OF_LINE();
X
X    while(token != Rbrace  &&  token != Eof){
X	switch(token){
X	    case Ret:			/* empty line */
X		putchar('\n');
X		get_token();
X		break;
X	    case Lbrace:		/* embraced by { } */
X		body();
X		END_OF_LINE();
X		break;
X	    default:
X		command();
X	}
X
X        while(token == Sp)
X            get_token();
X    }
X
X    get_token();
}
X
void command(void)
{
X    char sp[BUFSIZ] = {'\0'};
X    char buf[BUFSIZ];
X    int i,p;
X
X    switch(token){
X	case For:
X	case While:
X	case If:
X	    for_statement();
X	    break;
X	case Do:
X	    do_statement();
X	    break;
X	case Semicolon:
X	    print_hsp();
X	    printf("{    }\n");
X	    END_OF_LINE();
X	    break;
X	default:
X	    MAKE_STRING_WHILE(token != Semicolon  &&  token != Ret  &&  token != Rbrace  &&  token != Eof);
X	    print_hsp();
X	    print_str();
X	    putchar('\n');
X	    if(token != Rbrace)
X		END_OF_LINE();
X    }
}
X
void for_statement(void)
{
X    char *old_str, sp[BUFSIZ] = {'\0'};
X    char ret_buf[BUFSIZ] = {'\0'}, comm_buf[BUFSIZ] = {'\0'};
X    bool ret_flag = Off;
X    token_type type;
X    int i,sp_len,ret_count = 0;
X
X    type = token;
X
X    old_str = str;
X    MAKE_STRING_WHILE(token != Lpar);
X    if(elseif_flag == On)	/* create string following "else" */
X	str = joint(2,old_str,str);
X    condition();
X    while(token == Sp  ||  token == Ret){
X	if(token == Sp)
X	    strcat(sp,word);
X	else if(token == Ret)
X	    ret_flag = On;
X	get_token();
X    }
X
X    if(elseif_flag == On)	/* spacing at the head of the line is not required with "else if" */
X	elseif_flag = Off;
X    else
X	print_hsp();
X
X    print_str();
X
X    if(token == Lbrace){
X	if(ret_flag == On){
X	    putchar('\n');
X	    print_hsp();
X	    printf("{\n");
X	}else
X	    printf("%s{\n",sp);
X
X	nest_level++;
X	body();				/* body */
X	nest_level--;
X
X	if(type != If){
X	    print_hsp();
X	    printf("}\n");
X	    END_OF_LINE();
X	}else{
X	    sp_len = nest_level * tab;
X	    for(i = 0 ; i < sp_len ; i++)
X		append(" ");
X	    append("}");
X	    print_str();
X	}
X
X	ret_flag = On;
X    }else{
X	putchar('\n');
X	nest_level++;
X	command();
X	nest_level--;
X	ret_flag = Off;
X    }
X
X    *sp = '\0';
X    ret_count = 0;
X    if(type == If){			/* whether else body is present */
X	no_print_comment_flag = On;
X	while(token == Sp  ||  token == Ret  ||  token == Comment){
X	    if(token == Sp){
X		strcat(sp,word);
X	    }else if(token == Ret){
X                ret_count++;
X		strcat(ret_buf,"\n");
X	    }else if(token == Comment){
X		strcat(ret_buf,word);
X		strcat(comm_buf,word);
X		ret_count++;
X	    }
X	    get_token();
X	}
X	no_print_comment_flag = Off;
X	if(token != Else){		/* if there is no else body... */
X	    print_str();
X	    if(ret_flag == On  &&  ret_count == 0)
X		strcpy(ret_buf,"\n");
X	    fputs(ret_buf,stdout);
X	    return;
X	}else{				/* if there is else body... */
X	    sp_len = nest_level * tab;
X	    if (*comm_buf != '\0') {
X		if(ret_flag == On)
X		    putchar('\n');
X		fputs(comm_buf,stdout);
X	    } else {
X		if(ret_flag == On){
X		    if(ret_count > 0)
X			putchar('\n');
X		    else
X			sp_len = strlen(sp);
X		}
X	    }
X
X	    for(i = 0 ; i < sp_len ; i++)
X		append(" ");
X	    append("else");
X	    else_statement();
X	}
X    }
}
X
void else_statement(void)
{
X    char sp[BUFSIZ] = {'\0'};
X    bool ret_flag = Off;
X
X    get_token();
X    while(token == Sp  ||  token == Ret){
X	if(token == Sp)
X	    strcat(sp,word);
X	else if(token == Ret)
X	    ret_flag = On;
X	get_token();
X    }
X
X    if(token == If){
X	if(ret_flag == Off){		/* else if */
X	    append(sp);
X	    elseif_flag = On;
X	    command();
X	}else{
X	    print_str();
X	    putchar('\n');
X	    nest_level++;
X	    command();
X	    nest_level--;
X	}
X    }else{
X	print_str();
X	if(token == Lbrace){
X	    if(ret_flag == On){
X		putchar('\n');
X		print_hsp();
X		printf("{\n");
X	    }else
X		printf("%s{\n",sp);
X
X	    nest_level++;
X	    body();			/* body */
X	    nest_level--;
X
X	    print_hsp();
X	    printf("}\n");
X
X	    END_OF_LINE();
X	    return;
X	}else{
X	    putchar('\n');
X	    nest_level++;
X	    command();
X	    nest_level--;
X	}
X    }
}
X
void do_statement(void)
{
X    char sp[BUFSIZ] = {'\0'};
X    bool ret_flag = Off;
X
X    get_token();
X    while(token == Sp  ||  token == Ret){
X	if(token == Sp)
X	    strcat(sp,word);
X	else if(token == Ret)
X	    ret_flag = On;
X	get_token();
X    }
X
X    print_hsp();
X
X    if(token == Lbrace){
X	if(ret_flag == On)
X	    printf("do\n{\n");
X	else
X	    printf("do%s{\n",sp);
X
X	nest_level++;
X	body();				/* body */
X	nest_level--;
X
X	print_hsp();
X	printf("}");
X    }else{
X	printf("do\n");
X	nest_level++;
X	command();
X	nest_level--;
X	while(token == Sp  ||  token == Ret)
X	    get_token();
X	print_hsp();
X    }
X
X    *sp = '\0';
X    MAKE_STRING_WHILE(token != Lpar);
X    condition();
X
X    print_str();
X    putchar('\n');
X
X    while(token != Semicolon)
X	get_token();
X    get_token();
X    END_OF_LINE();
}
X
void condition(void)
{
X    char sp[BUFSIZ] = {'\0'};
X
X    append_str();
X    get_token();
X
X    while(token != Rpar){
X	if(token == Lpar)
X	    condition();
X	else if(token == Ret){
X	    append(" ");
X	    *sp = '\0';
X	    do{
X		get_token();
X	    }while(token == Sp);
X	}else{
X	    if(token == Sp)
X		strcat(sp,word);
X	    else{
X		if(*sp != '\0')
X		    append(sp);
X		*sp = '\0';
X		append_str();
X	    }
X
X	    get_token();
X	}
X    }
X
X    if(*sp != '\0')
X	append(sp);
X    append_str();
X    get_token();
}
X
void set_str(void)
{
X    int l;
X
X    l = strlen(word);
X    str = (char *)malloc((l+2) * sizeof(char));
X    strcpy(str,word);
}
X
void append_str(void)
{
X    int l;
X    char *s;
X
X    l = strlen(word);
X    s = (char *)malloc((l+2) * sizeof(char));
X    strcpy(s,word);
X    str = joint(2,str,s);
}
X
void append(char *p)
{
X    int l;
X    char *s;
X
X    l = strlen(p);
X    s = (char *)malloc((l+2) * sizeof(char));
X    strcpy(s,p);
X    str = joint(2,str,s);
}
X
void print_str(void)
{
X    if(str != NULL){
X	printf("%s",str);
X	free(str);
X	str = NULL;
X    }
}
X
void print_hsp(void)
{
X    int i;
X
X    for(i = 0 ; i < nest_level * tab ; i++)
X	putchar(' ');
}
SHAR_EOF
  $shar_touch -am 0820130496 'pad2ps-3.1/src/awk2pad/parser.c' &&
  chmod 0644 'pad2ps-3.1/src/awk2pad/parser.c' ||
  $echo 'restore of' 'pad2ps-3.1/src/awk2pad/parser.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/src/awk2pad/parser.c:' 'MD5 check failed'
de073e888d9d113362b2000969f59626  pad2ps-3.1/src/awk2pad/parser.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/src/awk2pad/parser.c'`"
    test 8570 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/src/awk2pad/parser.c:' 'original size' '8570,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/awk2pad/token.c ==============
if test -f 'pad2ps-3.1/src/awk2pad/token.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/awk2pad/token.c' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/awk2pad/token.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/awk2pad/token.c' &&
/*                                 */
/*  token.c -- get token           */
/*                                 */
/*  awk2pad  by S. Yoshida         */
/*                                 */
X
#include "config.h"
X
#include <string.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
#include <ctype.h>
#include "awk2pad.h"
#include "lib.h"
X
static int ch = 0;
static int pch = 0;		/* reading next character in ahead */
static int word_ptr = 0;	/* pointer to the tail of the word */
static bool newline = On;	/* whether it is a head of a line */
static bool comm_flag = Off;	/* whether it is in a comment field */
X
static void set_ch(void);
static void append_ch(void);
static void get_ch(void);
static int p_getchar(FILE *);
X
void get_token(void)
/* get token */
{
X    if(token == Eof)
X	fatal_error("input file terminates unexpectedly.");
X
X    if(ch == 0)
X	get_ch();
X
X    switch(ch){
X	case EOF:
X	    token = Eof;
X	    *word = '\0';
X	    return;
X	case '\n':
X	    newline = On;
X	    token = Ret;
X	    *word = ' ';
X	    *(word+1) = '\0';
X	    get_ch();
X	    return;
X	case ' ':
X	case '\t':
X	    token = Sp;
X	    set_ch();
X	    get_ch();
X	    while(ch == ' '  ||  ch == '\t'){
X		append_ch();
X		get_ch();
X	    }
X	    return;
X	case '#':
X	    comm_flag = On;
X	    set_ch();
X	    get_ch();
X	    while(ch != '\n'){
X		append_ch();
X		get_ch();
X	    }
X
X	    /* do not print at this place */
X	    if (no_print_comment_flag == On) {
X		char buf[BUFSIZ];
X
X		if(word[strlen(word)-1] == '\\'  ||  newline == On){
X		    set_ch();
X		    get_ch();
X		}
X		comm_flag = Off;
X		newline = On;
X
X		strcpy(buf,"// ");
X		strcat(buf,word);
X		strcat(buf,"\n");
X		strcpy(word,buf);
X		token = Comment;
X		return;
X	    }
X
X	    if (elseif_flag == On) {
X	        putchar('\n');
X	        elseif_flag = Off;
X	    }
X	    printf("// ");
X	    puts(word);
X	    comm_flag = Off;
X	    set_ch();
X	    get_ch();
X	    if(word[strlen(word)-1] != '\\'  &&  newline != On){	/* insert return code if the comment is not at the head of the line */
X		newline = On;
X		token = Ret;
X	    }else{
X		newline = On;
X		get_token();
X	    }
X	    return;
X	case '"':
X	    newline = Off;
X	    set_ch();
X
X	    do{
X		get_ch();
X		if(ch == '\n'){
X		    ch = '\\'; append_ch();
X		    ch = 'n'; append_ch();
X		}else if(ch == '\\'){
X		    append_ch();
X		    get_ch(); append_ch();
X		    ch = ' ';
X		}else
X		    append_ch();
X	    }while(ch != '"');
X
X	    get_ch();
X
X	    token = Str;
X	    return;
X	case '\'':
X	    newline = Off;
X	    set_ch();
X
X	    do{
X		get_ch();
X		if(ch == '\n'){
X		    ch = '\\'; append_ch();
X		    ch = 'n'; append_ch();
X		}else if(ch == '\\'){
X		    append_ch();
X		    get_ch(); append_ch();
X		    ch = ' ';
X		}else
X		    append_ch();
X	    }while(ch != '\'');
X
X	    get_ch();
X
X	    token = Str;
X	    return;
X	case '`':
X	    newline = Off;
X	    set_ch();
X
X	    do{
X		get_ch();
X		if(ch == '\n'){
X		    ch = '\\'; append_ch();
X		    ch = 'n'; append_ch();
X		}else if(ch == '\\'){
X		    append_ch();
X		    get_ch(); append_ch();
X		    ch = ' ';
X		}else
X		    append_ch();
X	    }while(ch != '`');
X
X	    get_ch();
X
X	    token = Str;
X	    return;
X	case '\\':
X	    newline = Off;
X	    token = Str;
X	    set_ch();
X	    get_ch();
X	    append_ch();
X	    get_ch();
X	    return;
X	case '(':
X	    newline = Off;
X	    token = Lpar;
X	    set_ch();
X	    get_ch();
X	    return;
X	case ')':
X	    newline = Off;
X	    token = Rpar;
X	    set_ch();
X	    get_ch();
X	    return;
X	case '{':
X	    newline = Off;
X	    token = Lbrace;
X	    set_ch();
X	    get_ch();
X	    return;
X	case '}':
X	    newline = Off;
X	    token = Rbrace;
X	    set_ch();
X	    get_ch();
X	    return;
X	case ';':
X	    newline = Off;
X	    token = Semicolon;
X	    set_ch();
X	    get_ch();
X	    return;
X	default:
X	    if(isdigit(ch)){
X		token = Num;
X		set_ch();
X		get_ch();
X		while(isdigit(ch)){
X		    append_ch();
X		    get_ch();
X		}
X		newline = Off;
X		return;
X	    }
X
X	    if(isalpha(ch)  ||  ch == '_'){
X		token = Name;
X		set_ch();
X		get_ch();
X		while(isalnum(ch)  ||  (char)ch == '_'){
X		    append_ch();
X		    get_ch();
X		}
X
X		if(strcmp(word,"if") == 0)
X		    token = If;
X		else if(strcmp(word,"else") == 0)
X		    token = Else;
X		else if(strcmp(word,"while") == 0)
X		    token = While;
X		else if(strcmp(word,"do") == 0)
X		    token = Do;
X		else if(strcmp(word,"for") == 0)
X		    token = For;
X
X		newline = Off;
X		return;
X	    }
X
X	    token = Str;
X	    set_ch();
X	    get_ch();
X	    newline = Off;
X	    return;
X    }
}
X
void set_ch(void)
/* set the character just read */
{
X    *word = ch;
X    *(word + 1) = '\0';
X    word_ptr = 1;
}
X
void append_ch(void)
/* append the character just read */
{
X    *(word + word_ptr) = ch;
X    *(word + word_ptr + 1) = '\0';
X    word_ptr++;
}
X
void get_ch(void)
/* get one character */
{
X    if(ch == 0){
X	ch = p_getchar(input_stream);
X	pch = p_getchar(input_stream);
X    }else{
X	ch = pch;
X	pch = p_getchar(input_stream);
X    }
X
X    if(comm_flag == Off  &&  
X       ch == '\\'  &&  pch == '\n'){	/* substitute '\' at the end of the line to space */
X	line_count++;
X	ch = ' ';
X	pch = p_getchar(input_stream);
X	while(pch == ' '  ||  pch == '\t')
X	    pch = p_getchar(input_stream);
X    }
X
X    if(ch == '\n')
X	line_count++;
}
X
int p_getchar(FILE *fp)
/* read one character */
{
X    int c = 0;
X    while(((0 <= c  &&  c < ' '  &&  c != '\t'  &&  c != '\n')  ||  c == 0x7F)  &&  c != EOF){
X	c = getc(fp);
X    }
X    return c;
}
SHAR_EOF
  $shar_touch -am 0820130496 'pad2ps-3.1/src/awk2pad/token.c' &&
  chmod 0644 'pad2ps-3.1/src/awk2pad/token.c' ||
  $echo 'restore of' 'pad2ps-3.1/src/awk2pad/token.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/src/awk2pad/token.c:' 'MD5 check failed'
68bb55610046f0a0cf4873309d625bce  pad2ps-3.1/src/awk2pad/token.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/src/awk2pad/token.c'`"
    test 5336 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/src/awk2pad/token.c:' 'original size' '5336,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/awk2pad/awk2pad.h ==============
if test -f 'pad2ps-3.1/src/awk2pad/awk2pad.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/awk2pad/awk2pad.h' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/awk2pad/awk2pad.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/awk2pad/awk2pad.h' &&
/*                          */
/*  awk2pad.h               */
/*                          */
/*  awk2pad  by S. Yoshida  */
/*                          */
X
#ifndef _AWK2PAD_H
#define _AWK2PAD_H
X
#include "config.h"
X
#ifndef JAPANESE
#ifndef ENGLISH
#define ENGLISH		/* output in English by default */
#endif
#endif
X
#include <stdio.h>
#include "lib.h"
#include "version.h"
X
typedef enum {
X    Nontoken, Eof, Comment,
X    Ret, Sp,
X    Str, Name, Num,
X    Lpar, Rpar, Lbrace, Rbrace,
X    Semicolon,
X    If, Else, While, Do, For
} token_type;
X
X
extern token_type token;	/* token */
extern char word[];		/* string just read */
X
extern bool no_print_comment_flag;	/* do not print comment */
extern bool elseif_flag;                /* whether in middle of processing else if */ 
X
extern int tab;			/* tab width */
X
extern bool debug;		/* -debug option */
extern bool quiet;		/* -quiet option */
extern bool print_warning;	/* whether to print warning or no */
extern int line_count;		/* line in process */
X
extern FILE *input_stream;	/* input file */
X
X
/* parser.c */
extern void parser(void);		/* output */
X
/* token.c */
extern void get_token(void);		/* get toke */
X
#endif  /* ! _CSH2PAD_H */
SHAR_EOF
  $shar_touch -am 0820130496 'pad2ps-3.1/src/awk2pad/awk2pad.h' &&
  chmod 0644 'pad2ps-3.1/src/awk2pad/awk2pad.h' ||
  $echo 'restore of' 'pad2ps-3.1/src/awk2pad/awk2pad.h' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/src/awk2pad/awk2pad.h:' 'MD5 check failed'
d36275c9ace7295462d570d47e4adf64  pad2ps-3.1/src/awk2pad/awk2pad.h
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/src/awk2pad/awk2pad.h'`"
    test 1189 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/src/awk2pad/awk2pad.h:' 'original size' '1189,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/awk2pad/Makefile.in ==============
if test -f 'pad2ps-3.1/src/awk2pad/Makefile.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/awk2pad/Makefile.in' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/awk2pad/Makefile.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/awk2pad/Makefile.in' &&
### Makefile of awk2pad  by S. Yoshida
X
### configuration by configure
X
prefix = @prefix@
exec_prefix = @exec_prefix@
LIBDIR = @libdir@/pad2ps
X
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
X
CC = @CC@
X
LIBS = @LIBS@ -L../lib -lpublic
X
### make commands
X
CFLAGS = -O2
LDFLAGS =
MFLAGS =
X
INCLUDES = -I.. -I../lib
X
HDRS = awk2pad.h
SRCS = awk2pad.c parser.c token.c
OBJS = awk2pad.o parser.o token.o
X
TARGS = awk2pad
X
all: ${TARGS}
X
awk2pad: ${OBJS} ${HDRS}
X	$(CC) $(LDFLAGS) ${OBJS} -o $@ $(LIBS)
X
%.o: %.c
X	$(CC) $(CFLAGS) $(INCLUDES) -c $<
X
install: ${TARGS}
X	$(INSTALL) -d $(LIBDIR)
X	if [ -f $(LIBDIR)/awk2pad ]; then rm -f $(LIBDIR)/awk2pad; fi
X	$(INSTALL_PROGRAM) awk2pad $(LIBDIR)
X
clean:
X	rm -f ${OBJS} ${TARGS} a.out core *~ *.bak
X
distclean:
X	rm -f ${OBJS} ${TARGS} a.out core *~ *.bak
X	rm -f Makefile
SHAR_EOF
  $shar_touch -am 0820130496 'pad2ps-3.1/src/awk2pad/Makefile.in' &&
  chmod 0644 'pad2ps-3.1/src/awk2pad/Makefile.in' ||
  $echo 'restore of' 'pad2ps-3.1/src/awk2pad/Makefile.in' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/src/awk2pad/Makefile.in:' 'MD5 check failed'
7f516a38d36280c66e8efb12d3684e3f  pad2ps-3.1/src/awk2pad/Makefile.in
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/src/awk2pad/Makefile.in'`"
    test 850 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/src/awk2pad/Makefile.in:' 'original size' '850,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/awk2pad/awk2pad.c ==============
if test -f 'pad2ps-3.1/src/awk2pad/awk2pad.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/awk2pad/awk2pad.c' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/awk2pad/awk2pad.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/awk2pad/awk2pad.c' &&
/*                               */
/*  awk2pad.c -- main routine    */
/*                               */
/*  awk2pad  by S. Yoshida       */
/*                               */
X
#include "config.h"
X
#include <stdlib.h>
#include <string.h>
#include "awk2pad.h"
X
token_type token = None;	/* token */
char word[BUFSIZ] = {'\0'};	/* string read */
X
bool no_print_comment_flag = Off;	/* do not print comment */
bool elseif_flag = Off;                 /* whether in middle of processing else if */
X
int tab = 4;			/* tab width */
X
bool debug = Off;		/* -debug option */
bool quiet = Off;		/* -quiet option */
bool print_warning = Off;	/* whether to print warning or not */
int line_count = 1;		/* line in process */
X
FILE *input_stream;		/* input file */
X
X
#ifdef JAPANESE
static char kconv[BUFSIZ] = "nkf -e";	/* KANJI converter */
static bool noconv = Off;		/* -noconv */
#endif
static bool nohelp = Off;		/* -nohelp */
static bool stdin_flag = Off;		/* -stdin */
X
static char filename[BUFSIZ] = {'\0'};		/* name of the input file */
static char command[BUFSIZ];			/* command */
X
static void option(int,char **);	/* processing options */
static void print_help(void);		/* printing help messages */
X
int main(int argc,char **argv)
{
X    option(argc,argv);			/* processing options */
X
X    if(quiet == Off)
X	fprintf(stderr,"\nawk2pad %s  by %s\n\n",VERSION,AUTHOR);
X
X    if(stdin_flag == On)
X	filename[0] = '\0';
X
#ifdef JAPANESE
X    if(noconv == Off)
X	sprintf(command,"cat %s | %s",filename,kconv);
X    else
#endif
X	sprintf(command,"cat %s",filename);
X
X    input_stream = popen(command,"r");
X
X    parser();
X
X    fclose(input_stream);
X
X    if(quiet == Off)
X	fprintf(stderr,"\n%d errors, %d warnings.\n",error_count,warning_count);
X
X    return 0;
}
X
void option(int argc,char **argv)
/* processing options */
{
X    int i;
X
X    for(i = 1 ; i < argc ; i++){
X	if(argv[i][0] != '-'){		/* file name */
X	    if(filename[0] == '\0')
X		strcpy(filename,argv[i]);
X	    else if(nohelp == Off){
X		print_help();
X		exit(1);
X	    }
X	}else{				/* options */
X	    switch(argv[i][1]){
#ifdef DEBUG
X		case 'd':
X		    if(strcmp(argv[i],"-debug") == 0){
X			debug = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
#endif
X		case 'h':
X		    if(strcmp(argv[i],"-help") == 0){
X			print_help();
X			exit(0);
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
#ifdef JAPANESE
X		case 'k':
X		    if(strcmp(argv[i],"-kconv") == 0  &&  i + 1 < argc){
X			strcpy(kconv,argv[++i]);
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
#endif
X		case 'n':
X		    if(strcmp(argv[i],"-nohelp") == 0){
X			nohelp = On;
#ifdef JAPANESE
X		    }else if(strcmp(argv[i],"-noconv") == 0){
X			noconv = On;
#endif
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 'q':
X		    if(strcmp(argv[i],"-quiet") == 0){
X			quiet = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 's':
X		    if(strcmp(argv[i],"-stdin") == 0){
X			stdin_flag = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 't':
X		    if(strcmp(argv[i],"-tab") == 0){
X			i++;
X			tab = atoi(argv[i]);
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 'w':
X		    if(strcmp(argv[i],"-warn") == 0){
X			print_warning = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		default:
X		    if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X	    }
X	}
X    }
}
X
void print_help(void)
{
X    fprintf(stderr,"\nawk2pad %s  by %s\n\n",VERSION,AUTHOR);
X    fputs("usage: awk2pad [filename] [options]\n",stderr);
#ifdef DEBUG
X    fputs("-debug                  Print parser debug message.\n",stderr);
#endif
X    fputs("-help                   Print help message.\n",stderr);
#ifdef JAPANESE
X    fputs("-kconv converter        Kanji code converter [default: \"nkf -e\"].\n",stderr);
X    fputs("-noconv                 Do not convert kanji code.\n",stderr);
#endif
X    fputs("-nohelp                 Do not print help message.\n",stderr);
X    fputs("-quiet                  Do not print messages.\n",stderr);
X    fputs("-stdin                  Input from stdin.\n",stderr);
X    fputs("-tab width              Set TAB width [default: 4].\n",stderr);
X    fputs("-warn                   Print warnings.\n",stderr);
}
SHAR_EOF
  $shar_touch -am 0820130496 'pad2ps-3.1/src/awk2pad/awk2pad.c' &&
  chmod 0644 'pad2ps-3.1/src/awk2pad/awk2pad.c' ||
  $echo 'restore of' 'pad2ps-3.1/src/awk2pad/awk2pad.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/src/awk2pad/awk2pad.c:' 'MD5 check failed'
d4a3129e2369dcfbbccf7c990cc09670  pad2ps-3.1/src/awk2pad/awk2pad.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/src/awk2pad/awk2pad.c'`"
    test 4406 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/src/awk2pad/awk2pad.c:' 'original size' '4406,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/c2pad/c2pad.c ==============
if test ! -d 'pad2ps-3.1/src/c2pad'; then
  $echo 'x -' 'creating directory' 'pad2ps-3.1/src/c2pad'
  mkdir 'pad2ps-3.1/src/c2pad'
fi
if test -f 'pad2ps-3.1/src/c2pad/c2pad.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/c2pad/c2pad.c' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/c2pad/c2pad.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/c2pad/c2pad.c' &&
/*                             */
/*  c2pad.c -- main routine    */
/*                             */
/*  c2pad  by S. Yoshida       */
/*                             */
X
#include "config.h"
X
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "c2pad.h"
X
token_type token = None;	/* token */
char word[BUFSIZ] = {'\0'};	/* string just read */
X
bool no_print_comment_flag = Off;	/* do not print comment */
bool elseif_flag = Off;                 /* whether in middle of processing else if */
X
int tab = 4;			/* tab width */
bool optimize = Off;		/* -O option */
bool semicolon = Off;		/* -semicolon option */
bool inline_flag = Off;		/* -inline option */
X
bool ifdef = Off;		/* -ifdef option */
X
DEF *defined_list = NULL;	/* list of defined symbols */
void *ifdef_value = TRUE;	/* current #ifdef value */
X
bool debug = Off;		/* -debug option */
bool quiet = Off;		/* -quiet option */
bool print_warning = Off;	/* whether to print warning or not */
int line_count = 1;		/* line in process */
X
FILE *input_stream;		/* input file */
X
X
#ifdef JAPANESE
static char kconv[BUFSIZ] = "nkf -e";	/* KANJI converter */
static bool noconv = Off;		/* -noconv */
#endif
static bool nohelp = Off;		/* -nohelp */
static bool stdin_flag = Off;		/* -stdin */
X
static char filename[BUFSIZ] = {'\0'};		/* name of input file */
static char command[BUFSIZ];			/* command */
X
static char prepfile[BUFSIZ];		/* file name after treating pre-processor */
X
static void prep(void);			/* pre-processor (processing \ at the end of line) */
static int p_getchar(FILE *);		/* read one character */
X
static void option(int,char **);	/* handle options */
static void print_help(void);		/* print help messages */
X
#if defined(HAVE_ATEXIT)
static void at_exit(void);		/* handle termination process */
#elif defined(HAVE_ON_EXIT)
static void at_exit(int,void *);	/* handle termination process */
#endif
X
int main(int argc,char **argv)
{
X    char tmp[BUFSIZ];
X    char *env;
X
X    /* managing at exit() */
#if defined(HAVE_ATEXIT)
X    atexit(at_exit);
#elif defined(HAVE_ON_EXIT)
X    on_exit(at_exit,NULL);
#endif
X
X    /* file name after treating pre-processor */
#ifdef TMP
X    strcpy(prepfile,TMP);
X    strcat(prepfile,"/");
#else
X    strcpy(prepfile,"/tmp/");
#endif
X    if((env = getenv("TMP")) != NULL  &&  strlen(env) > 0){
X	/* get the environment variable TMP */
X	strcpy(prepfile,env);
X	strcat(prepfile,"/");
X    }
X    strcat(prepfile,"c2pad-XXXXXX");
X
X    option(argc,argv);			/* handle options */
X
X    if(quiet == Off)
X	fprintf(stderr,"\nc2pad %s  by %s\n\n",VERSION,AUTHOR);
X
X    if(stdin_flag == On)
X	filename[0] = '\0';
X
#ifdef JAPANESE
X    if(noconv == Off)
X	sprintf(command,"cat %s | %s",filename,kconv);
X    else
#endif
X	sprintf(command,"cat %s",filename);
X
X    input_stream = popen(command,"r");
X
X    mktemp(prepfile);
X
X    prep();		/* pre-processor (treat \ at the end of line) */
X
X    pclose(input_stream);
X
X    input_stream = fopen(prepfile,"r");
X
X    if(ifdef == On)
X	list_defines();
X    else
X	parser();
X
X    fclose(input_stream);
X
X    remove(prepfile);
X
X    if(quiet == Off)
X	fprintf(stderr,"\n%d errors, %d warnings.\n",error_count,warning_count);
X
X    return 0;
}
X
void prep(void)
/* pre-processor (treat \ at the end of line) */
{
X    FILE *fp;
X    int ch;
X    int pch = 0;
X
X    fp = fopen(prepfile,"w");
X
X    ch = p_getchar(input_stream);
X    while(ch != EOF){
X	if(ch == '\\'){
X	    ch = p_getchar(input_stream);
X	    if(ch != '\n'){
X		fputc('\\',fp);
X		fputc(ch,fp);
X	    }
X	}else
X	    fputc(ch,fp);
X	pch = ch;
X	ch = p_getchar(input_stream);
X    }
X
X    fclose(fp);
}
X
int p_getchar(FILE *fp)
/* read one character */
{
X    int c = 0;
X    while(((0 <= c  &&  c < ' '  &&  c != '\t'  &&  c != '\n')  ||  c == 0x7F)  &&  c != EOF){
X	c = getc(fp);
X    }
X    return c;
}
X
void option(int argc,char **argv)
/* handle option */
{
X    int i,p;
X    char *ptr;
X
X    for(i = 1 ; i < argc ; i++){
X	if(argv[i][0] != '-'){		/* file name */
X	    if(filename[0] == '\0')
X		strcpy(filename,argv[i]);
X	    else if(nohelp == Off){
X		print_help();
X		exit(1);
X	    }
X	}else{				/* options */
X	    switch(argv[i][1]){
X		case 'D':
X		    if(strcmp(argv[i],"-D") == 0){
X			i++;
X			while(i < argc  &&  argv[i][0] != '-'){
X			    ptr = strchr(argv[i],'=');
X			    if(ptr != NULL){
X				*ptr='\0';
X				p = atoi(ptr + 1);
X			    }else
X				p = 0;
X
X			    add_symbol(argv[i],p);
X
X			    i++;
X			}
X			i--;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
#ifdef DEBUG
X		case 'd':
X		    if(strcmp(argv[i],"-debug") == 0){
X			debug = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
#endif
X		case 'h':
X		    if(strcmp(argv[i],"-help") == 0){
X			print_help();
X			exit(0);
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 'i':
X		    if(strcmp(argv[i],"-ifdef") == 0){
X			ifdef = On;
X		    }else if(strcmp(argv[i],"-inline") == 0){
X			inline_flag = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
#ifdef JAPANESE
X		case 'k':
X		    if(strcmp(argv[i],"-kconv") == 0  &&  i + 1 < argc){
X			strcpy(kconv,argv[++i]);
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
#endif
X		case 'n':
X		    if(strcmp(argv[i],"-nohelp") == 0){
X			nohelp = On;
X		    }else if(strcmp(argv[i],"-noopt") == 0){
X			optimize = Off;
#ifdef JAPANESE
X		    }else if(strcmp(argv[i],"-noconv") == 0){
X			noconv = On;
#endif
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 'O':
X		    if(strcmp(argv[i],"-O") == 0){
X			optimize = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 'q':
X		    if(strcmp(argv[i],"-quiet") == 0){
X			quiet = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 's':
X		    if(strcmp(argv[i],"-semicolon") == 0){
X			semicolon = On;
X		    }else if(strcmp(argv[i],"-stdin") == 0){
X			stdin_flag = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 't':
X		    if(strcmp(argv[i],"-tab") == 0){
X			i++;
X			tab = atoi(argv[i]);
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		case 'w':
X		    if(strcmp(argv[i],"-warn") == 0){
X			print_warning = On;
X		    }else if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X		default:
X		    if(nohelp == Off){
X			print_help();
X			exit(1);
X		    }
X		    break;
X	    }
X	}
X    }
}
X
void print_help(void)
{
X    fprintf(stderr,"\nc2pad %s  by %s\n\n",VERSION,AUTHOR);
X    fputs("usage: c2pad [filename] [options]\n",stderr);
X    fputs("-D symbols ...          Define symbols. Ex: -D DEBUG __linux__\n",stderr);
#ifdef DEBUG
X    fputs("-debug                  Print parser debug message.\n",stderr);
#endif
X    fputs("-help                   Print help message.\n",stderr);
X    fputs("-ifdef                  Print defined symbols.\n",stderr);
X    fputs("-inline                 Draw PAD of inline functions too.\n",stderr);
#ifdef JAPANESE
X    fputs("-kconv converter        Kanji code converter [default: \"nkf -e\"].\n",stderr);
X    fputs("-noconv                 Do not convert kanji code.\n",stderr);
#endif
X    fputs("-nohelp                 Do not print help message.\n",stderr);
X    fputs("-noopt                  No optimizing.\n",stderr);
X    fputs("-O                      Optimizing.\n",stderr);
X    fputs("-quiet                  Do not print messages.\n",stderr);
X    fputs("-semicolon              Print ';' at EOL.\n",stderr);
X    fputs("-stdin                  Input from stdin.\n",stderr);
X    fputs("-tab width              Set TAB width [default: 4].\n",stderr);
X    fputs("-warn                   Print warnings.\n",stderr);
}
X
X
#if defined(HAVE_ATEXIT) || defined(HAVE_ON_EXIT)
#if defined(HAVE_ATEXIT)
void at_exit(void)
#elif defined(HAVE_ON_EXIT)
void at_exit(int val, void *p)
#endif
/* handle termination process */
{
X    remove(prepfile);
}
#endif
SHAR_EOF
  $shar_touch -am 0820130496 'pad2ps-3.1/src/c2pad/c2pad.c' &&
  chmod 0644 'pad2ps-3.1/src/c2pad/c2pad.c' ||
  $echo 'restore of' 'pad2ps-3.1/src/c2pad/c2pad.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/src/c2pad/c2pad.c:' 'MD5 check failed'
5325f1f77ed0e0ab661636feb8efe943  pad2ps-3.1/src/c2pad/c2pad.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/src/c2pad/c2pad.c'`"
    test 7979 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/src/c2pad/c2pad.c:' 'original size' '7979,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/c2pad/c2pad.h ==============
if test -f 'pad2ps-3.1/src/c2pad/c2pad.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/c2pad/c2pad.h' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/c2pad/c2pad.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/c2pad/c2pad.h' &&
/*                        */
/*  c2pad.h               */
/*                        */
/*  c2pad  by S. Yoshida  */
/*                        */
X
#ifndef _C2PAD_H
#define _C2PAD_H
X
#include "config.h"
X
#ifndef JAPANESE
#ifndef ENGLISH
#define ENGLISH		/* output in English by default */
#endif
#endif
X
#include <stdio.h>
#include "lib.h"
#include "version.h"
X
#define TRUE		((void *)10)	/* #ifdef and other's value (true/false) */
#define FALSE		((void *)11)
#define ABS_FALSE	((void *)12)
#define TRUED_FALSE	((void *)13)
X
X
typedef enum {
X    Nontoken, Eof, Comment,
X    Ret, Sp,
X    Str, Name, Num,
X    Lpar, Rpar, Lbrace, Rbrace, Lbracket, Rbracket,
X    Colon, Colon2, Semicolon,
X    Sharp, Question,
X    Equal, Equal2, Neq, Less, Great, Less_eq, Great_eq,
X    Not, And, Or, And2, Or2,
X    Plus, Minus, Times, Divide, Exp, Lshift, Rshift,
X    If, Else, While, For, Do, Switch, Case, Default,
X    Return, Break, Continue, Goto,
X    Public, Private, Protected,
X    Ifdef, Ifndef, Elif, Endif, Define, Undef, Defined
} token_type;
X
typedef struct _DEF DEF;
X
struct _DEF {
X    char *sym;
X    int val;
X    DEF *next;
};
X
X
extern token_type token;	/* token */
extern char word[];		/* string just read */
X
extern bool no_print_comment_flag;	/* do not print comment */
extern bool elseif_flag;                /* whether in middle of processing else if */
X
extern int tab;			/* tab width */
extern bool optimize;		/* -O option */
extern bool semicolon;		/* -semicolon option */
extern bool inline_flag;	/* -inline option */
X
extern bool ifdef;		/* -ifdef option */
X
extern DEF *defined_list;	/* list of defined symbol */
extern void *ifdef_value;	/* current #ifdef value */
X
extern bool debug;		/* -debug option */
extern bool quiet;		/* -quiet option */
extern bool print_warning;	/* whether to print warning or not */
extern int line_count;		/* line in process */
X
extern FILE *input_stream;	/* input file */
X
X
/* ifdef.c */
extern void list_defines(void);		/* print list of symbols to be dealt with #ifdef */
extern void eval_ifdef(void);		/* evaluate #ifdef */
extern void add_symbol(char *,int);	/* add newly defined symbols */
X
/* parser.c */
extern void parser(void);		/* output */
X
/* token.c */
extern void get_token(void);		/* get token */
X
#endif  /* ! _C2PAD_H */
SHAR_EOF
  $shar_touch -am 0820130496 'pad2ps-3.1/src/c2pad/c2pad.h' &&
  chmod 0644 'pad2ps-3.1/src/c2pad/c2pad.h' ||
  $echo 'restore of' 'pad2ps-3.1/src/c2pad/c2pad.h' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/src/c2pad/c2pad.h:' 'MD5 check failed'
f613507e05c50ff5571605b3149817b8  pad2ps-3.1/src/c2pad/c2pad.h
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/src/c2pad/c2pad.h'`"
    test 2270 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/src/c2pad/c2pad.h:' 'original size' '2270,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/c2pad/parser.c ==============
if test -f 'pad2ps-3.1/src/c2pad/parser.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/c2pad/parser.c' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/c2pad/parser.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/c2pad/parser.c' &&
/*                                                       */
/*  parser.c -- translate C into  PADEL and print result */
/*                                                       */
/*  c2pad  by S. Yoshida                                 */
/*                                                       */
X
#include "config.h"
X
#include <string.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
#include <ctype.h>
#include "c2pad.h"
#include "lib.h"
X
#define MAKE_STRING_WHILE(X)	{\
X				    label_flag = On;\
X				    set_str();\
X				    get_token();\
X				    while(X){\
X					if(token == Ret){\
X					    append(" ");\
X					    *sp = '\0';\
X					    do{\
X						get_token();\
X					    }while(token == Sp);\
X					}else{\
X					    if(token == Sp)\
X						strcat(sp,word);\
X					    else{\
X						if(token == Question)\
X						    label_flag = Off;\
X						if(*sp != '\0')\
X						    append(sp);\
X						*sp = '\0';\
X						append_str();\
X					    }\
X					    get_token();\
X					}\
X				    }\
X				    if(*sp != '\0')\
X					append(sp);\
X				    *sp = '\0';\
X				}
X
#define END_OF_LINE()		{\
X				    while(token == Sp)\
X					get_token();\
X				    if(token == Ret)\
X					get_token();\
X				}
X
static char *str = NULL;
static int nest_level = 0;
static bool label_flag = On;
static char classname[BUFSIZ] = {'\0'};
X
static void function(void);
static void body(int);
static void command(void);
static void for_statement(void);
static void else_statement(bool);
static void do_statement(void);
static void condition(void);
static void paired_brace(void);
X
static void set_str(void);
static void append_str(void);
static void append(char *);
static void print_str(void);
static void print_hsp(void);
X
static int to_optimize(char *);
X
void parser(void)
/* print */
{
#ifdef DEBUG
X    if(quiet == Off)
X	fprintf(stderr,"Translating C into PADEL starts...");
#endif
X
X    get_token();
X
X    while(token != Eof){
X	while(token == Sp)
X	    get_token();
X
X	if(token == Ret){		/* empty line */
X	    putchar('\n');
X	    get_token();
X	}else if(token != Eof)
X	    function();			/* declaration or function */
X    }
X
#ifdef DEBUG
X    if(quiet == Off)
X	fprintf(stderr,"done\n");
#endif
}
X
void function(void)
/* declaration or function */
{
X    char sp[BUFSIZ] = {'\0'};
X    char buf[BUFSIZ];
X    bool ret_flag = Off;
X    char *s = NULL;
X    int p;
X
X    if(inline_flag == On  &&  classname[0] != '\0'  &&  (token == Public  ||  token == Private  ||  token == Protected)){
X	MAKE_STRING_WHILE(token == Sp  ||  token == Ret);
X	if(token == Colon){	/* such as "public:" */
X	    get_token();
X	    END_OF_LINE();
X	    free(str);
X	    str = NULL;
X	    return;
X	}else
X	    s = str;
X    }
X
X    MAKE_STRING_WHILE(token != Lpar  &&  token != Lbrace  &&  token != Lbracket  &&  token != Semicolon  &&  token != Eof);
X    str = joint(2,s,str);
X
X    if(token == Lpar){
X	strcpy(buf,str);
X	free(str);
X	str = NULL;
X	condition();			/* argument list */
X	while(token == Sp  ||  token == Ret){
X	    if(token == Sp)
X		strcat(sp,word);
X	    else if(token == Ret)
X		ret_flag = On;
X	    get_token();
X	}
X
X	if(token != Semicolon){
X	    while(token != Lbrace)	/* type declaration of argument */
X		get_token();
X
X	    if(classname[0] != '\0'){	/* inline function in class */
X		for (p = strlen(buf) - 1 ; p >= 0 && isspace(buf[p]) ; p--) ;
X		for (; p >= 0 && ! isspace(buf[p]) ; p--) ;
X
X		if (p >= 0) {
X		    buf[p] = '\0';
X		    printf("inline %s ",buf);
X		} else
X		    printf("inline ");
X		printf("%s:: %s",classname,buf+p+1);
X		print_str();
X	    }else{
X		printf("%s",buf);
X		print_str();
X	    }
X	    if(ret_flag == On)
X		printf("\n{\n");
X	    else
X		printf("%s\n{\n",sp);
X
X	    nest_level++;
X	    body(0);			/* function body */
X	    nest_level--;
X
X	    printf("}\n");
X
X	    END_OF_LINE();
X	    return;
X	}
X    }
X
X    if(token == Lbrace){		/* struct or class */
X	if(inline_flag == On  &&  classname[0] == '\0'){	/* class */
X	    strcpy(buf,str);
X	    for (p = 0 ; p < strlen(buf) && buf[p] != ':' ; p++) ;
X	    buf[p] = '\0';
X	    for (p-- ; p >= 0 && isspace(buf[p]) ; p--) ;
X	    for ( ; p >= 0 && ! isspace(buf[p]) ; p--) ;
X	    strcpy(classname,buf+p+1);
X	    free(str);
X	    str = NULL;
X	    get_token();
X
X	    while(token != Rbrace  &&  token != Eof){
X		while(token == Sp)
X		    get_token();
X
X		if(token == Ret){		/* empty line */
X		    putchar('\n');
X		    get_token();
X		}else if(token != Eof)
X		    function();			/* declaration or function */
X	    }
X
X	    classname[0] = '\0';
X	}else
X	    paired_brace();
X	while(token != Semicolon){
X	    if(token == Lbrace)
X		paired_brace();
X	    else if(token == Lpar)
X		condition();
X	    else
X		get_token();
X	}
X    }
X
X    if(token == Lbracket){		/* arrays */
X	get_token();
X	while(token != Semicolon){
X	    if(token == Lbrace)
X		paired_brace();
X	    else if(token == Lpar)
X		condition();
X	    else
X		get_token();
X	}
X    }
X
X    if(token == Semicolon){		/* global variable declaration */
X	get_token();
X	END_OF_LINE();
X	if(str != NULL){
X	    free(str);
X	    str = NULL;
X	}
X	return;
X    }
}
X
void body(int flag)
{
X    if(flag != 1){
X	get_token();
X	END_OF_LINE();
X
X	while(token == Sp)
X	    get_token();
X    }
X
X    while(token != Rbrace  &&  token != Eof){
X	switch(token){
X	    case Ret:			/* empty line */
X		putchar('\n');
X		get_token();
X		break;
X	    case Lbrace:		/* embraced by { } */
X		body(0);
X		END_OF_LINE();
X		break;
X	    default:
X		command();
X	}
X
X	while(token == Sp)
X	    get_token();
X    }
X
X    get_token();
}
X
void command(void)
{
X    char sp[BUFSIZ] = {'\0'};
X    char buf[BUFSIZ];
X    char *s;
X    int count;
X
X    switch(token){
X	case For:
X	case While:
X	case If:
X	case Switch:
X	    for_statement();
X	    break;
X	case Do:
X	    do_statement();
X	    break;
X	case Case:
X	case Default:
X	    MAKE_STRING_WHILE(token != Colon);
X	    nest_level--;
X	    print_hsp();
X	    nest_level++;
X	    print_str();
X	    printf(":\n");
X	    get_token();
X	    while(token == Sp  ||  token == Ret)
X		get_token();
X	    break;
X	case Semicolon:
X	    print_hsp();
X	    if(semicolon == On)
X		printf(";\n");
X	    else
X		printf("{    }\n");
X	    get_token();
X	    END_OF_LINE();
X	    break;
X	case Goto:
X	    strcpy(buf,word);
X	    get_token();
X	    MAKE_STRING_WHILE(token == Sp  ||  token == Ret);
X	    print_hsp();
X	    printf("refer (%s%s%s) {\n",str+1,word,str+1);
X	    nest_level++;
X	    print_hsp();
X	    puts(buf);
X	    nest_level--;
X	    print_hsp();
X	    puts("}");
X
X	    free(str);
X	    MAKE_STRING_WHILE(token != Semicolon  &&  token != Eof);
X	    free(str);
X	    str = NULL;
X	    get_token();
X	    END_OF_LINE();
X	    break;
X	case Return:
X	case Break:
X	case Continue:
X	default:
X	    MAKE_STRING_WHILE(token != Semicolon  &&  token != Lbrace
X			      &&  token != Colon);
X	    if(token == Colon  &&  label_flag == On){	/* label */
X		print_str();
X		printf(":\n");
X	    }else{
X		if(token == Colon){		/* (cond ? T : F) form */
X		    s = str;
X		    MAKE_STRING_WHILE(token != Semicolon);
X		    str = joint(2,s,str);
X		}else if(token == Lbrace){		/* struct and others */
X		    count = 1;
X		    s = str;
X		    while(token == Lbrace){
X			do{
X			    MAKE_STRING_WHILE(token != Rbrace  &&  token != Lbrace);
X			    s = joint(2,s,str);
X			    count += (token == Lbrace) ? 1 : -1;
X			}while(count > 0);
X			MAKE_STRING_WHILE(token != Semicolon  &&  token != Lbrace);
X			s = joint(2,s,str);
X		    }
X		    str = s;
X		}
X		if(to_optimize(str)){
X		    free(str);
X		}else{
X		    print_hsp();
X		    print_str();
X		    if(semicolon == On)
X			putchar(';');
X		    putchar('\n');
X		}
X	    }
X	    get_token();
X	    END_OF_LINE();
X    }
}
X
void for_statement(void)
{
X    char *old_str, sp[BUFSIZ] = {'\0'};
X    char ret_buf[BUFSIZ] = {'\0'}, comm_buf[BUFSIZ] = {'\0'};
X    bool ret_flag = Off;
X    token_type type;
X    int i,sp_len,ret_count = 0;
X    int flag = 0;
X
X    type = token;
X
X    old_str = str;
X    MAKE_STRING_WHILE(token != Lpar);
X    if(elseif_flag == On)	/* create string following "else" */
X	str = joint(2,old_str,str);
X    condition();
X    while(token == Sp  ||  token == Ret){
X	if(token == Sp)
X	    strcat(sp,word);
X	else if(token == Ret)
X	    ret_flag = On;
X	get_token();
X    }
X
X    if(type == Switch){		/* part in between "switch(){" and the first "case" */
X	flag = 1;
X	old_str = str;
X	str = NULL;
X	get_token();
X	END_OF_LINE();
X	while(token == Sp)
X	    get_token();
X	while(token != Case  &&  token != Default  &&  token != Rbrace  &&  token != Eof){
X	    if(token == Ret){
X		putchar('\n');
X		get_token();
X	    }else
X		command();
X	    while(token == Sp)
X		get_token();
X	}
X	str = old_str;
X    }
X
X    if(elseif_flag == On)	/* spacing at the head of line is not required with "else if" */
X	elseif_flag = Off;
X    else
X	print_hsp();
X
X    print_str();
X
X    if(flag == 1  ||  token == Lbrace){
X	if(ret_flag == On){
X	    putchar('\n');
X	    print_hsp();
X	    printf("{\n");
X	}else
X	    printf("%s{\n",sp);
X
X	nest_level++;
X	if(type == Switch)
X	    nest_level++;
X	body(flag);				/* repetition body */
X	nest_level--;
X	if(type == Switch)
X	    nest_level--;
X
X	if(type != If){
X	    print_hsp();
X	    printf("}\n");
X	    END_OF_LINE();
X	}else{
X	    sp_len = nest_level * tab;
X	    for(i = 0 ; i < sp_len ; i++)
X		append(" ");
X	    append("}");
X	    print_str();
X	}
X
X	ret_flag = On;
X    }else{
X	putchar('\n');
X	nest_level++;
X	command();
X	nest_level--;
X	ret_flag = Off;
X    }
X
X    *sp = '\0';
X    ret_count = 0;
X    if(type == If){			/* whether there is "else" body */
X	no_print_comment_flag = On;
X	while(token == Sp  ||  token == Ret  ||  token == Comment){
X	    if(token == Sp){
X		strcat(sp,word);
X	    }else if(token == Ret){
X		ret_count++;
X		strcat(ret_buf,"\n");
X	    }else if(token == Comment){
X		strcat(ret_buf,word);
X		strcat(comm_buf,word);
X		ret_count++;
X		if (word[strlen(word)-1] != '\n') {
X		    strcat(ret_buf,"\n");
X		    strcat(comm_buf,"\n");
X		    get_token();
X		    while (token == Sp)
X			get_token();
X		    if (token == Ret)
X			get_token();
X		    continue;
X		}
X	    }
X	    get_token();
X	}
X	no_print_comment_flag = Off;
X	if(token != Else){		/* if there is no "else" body... */
X	    print_str();
X	    if(ret_flag == On  &&  ret_count == 0)
X		strcpy(ret_buf,"\n");
X	    fputs(ret_buf,stdout);
X	    return;
X	}else{				/* if there is "else" body... */
X	    sp_len = nest_level * tab;
X	    if (*comm_buf != '\0') {
X		if(ret_flag == On)
X		    putchar('\n');
X		fputs(comm_buf,stdout);
X		ret_flag = Off;
X	    } else {
X		if(ret_flag == On){
X		    if(ret_count > 0){
X			putchar('\n');
X			ret_flag = Off;
X		    }else
X			sp_len = strlen(sp);
X		}
X	    }
X
X	    for(i = 0 ; i < sp_len ; i++)
X		append(" ");
X	    append("else");
X	    else_statement(ret_flag);
X	}
X    }
}
X
void else_statement(bool old_ret_flag)
{
X    char sp[BUFSIZ] = {'\0'};
X    bool ret_flag = Off;
X    bool mid_comm_flag = Off;
X
X    no_print_comment_flag = On;
X    get_token();
X    while(token == Sp  ||  token == Ret  ||  token == Comment){
X	if(token == Sp)
X	    strcat(sp,word);
X	else if(token == Ret)
X	    ret_flag = On;
X	else if(token == Comment){
X	    mid_comm_flag = On;
X	    if (old_ret_flag == On) {
X		putchar('\n');
X		old_ret_flag = Off;
X	    }
X	    if (word[strlen(word)-1] != '\n') {
X		puts(word);
X		get_token();
X		while (token == Sp)
X		    get_token();
X		if (token == Ret)
X		    get_token();
X		continue;
X	    }
X	    printf("%s",word);
X	}
X	get_token();
X    }
X    no_print_comment_flag = Off;
X
X    if(token == If){
X	if(ret_flag == Off){		/* else if */
X	    append(sp);
X	    if (mid_comm_flag == Off)
X	        elseif_flag = On;
X	    command();
X	}else{
X	    print_str();
X	    putchar('\n');
X	    nest_level++;
X	    command();
X	    nest_level--;
X	}
X    }else{
X	print_str();
X	if(token == Lbrace){
X	    if(ret_flag == On){
X		putchar('\n');
X		print_hsp();
X		printf("{\n");
X	    }else
X		printf("%s{\n",sp);
X
X	    nest_level++;
X	    body(0);			/* repetition body */
X	    nest_level--;
X
X	    print_hsp();
X	    printf("}\n");
X
X	    END_OF_LINE();
X	    return;
X	}else{
X	    putchar('\n');
X	    nest_level++;
X	    command();
X	    nest_level--;
X	}
X    }
}
X
void do_statement(void)
{
X    char sp[BUFSIZ] = {'\0'};
X    bool ret_flag = Off;
X
X    get_token();
X    while(token == Sp  ||  token == Ret){
X	if(token == Sp)
X	    strcat(sp,word);
X	else if(token == Ret)
X	    ret_flag = On;
X	get_token();
X    }
X
X    print_hsp();
X
X    if(token == Lbrace){
X	if(ret_flag == On)
X	    printf("do\n{\n");
X	else
X	    printf("do%s{\n",sp);
X
X	nest_level++;
X	body(0);				/* repetition body */
X	nest_level--;
X
X	print_hsp();
X	printf("}");
X    }else{
X	printf("do\n");
X	nest_level++;
X	command();
X	nest_level--;
X	while(token == Sp  ||  token == Ret)
X	    get_token();
X	print_hsp();
X    }
X
X    *sp = '\0';
X    MAKE_STRING_WHILE(token != Lpar);
X    condition();
X
X    print_str();
X    putchar('\n');
X
X    while(token != Semicolon)
X	get_token();
X    get_token();
X    END_OF_LINE();
}
X
void condition(void)
{
X    char sp[BUFSIZ] = {'\0'};
X
X    append_str();
X    get_token();
X
X    while(token != Rpar){
X	if(token == Lpar)
X	    condition();
X	else if(token == Ret){
X	    append(" ");
X	    *sp = '\0';
X	    do{
X		get_token();
X	    }while(token == Sp);
X	}else{
X	    if(token == Sp)
X		strcat(sp,word);
X	    else{
X		if(*sp != '\0')
X		    append(sp);
X		*sp = '\0';
X		append_str();
X	    }
X
X	    get_token();
X	}
X    }
X
X    if(*sp != '\0')
X	append(sp);
X    append_str();
X    get_token();
}
X
void paired_brace(void)
{
X    get_token();
X
X    while(token != Rbrace){
X	if(token == Lbrace)
X	    paired_brace();
X	else
X	    get_token();
X    }
X    get_token();
}
X
void set_str(void)
{
X    int l;
X
X    l = strlen(word);
X    str = (char *)malloc((l+2) * sizeof(char));
X    strcpy(str,word);
}
X
void append_str(void)
{
X    int l;
X    char *s;
X
X    l = strlen(word);
X    s = (char *)malloc((l+2) * sizeof(char));
X    strcpy(s,word);
X    str = joint(2,str,s);
}
X
void append(char *p)
{
X    int l;
X    char *s;
X
X    l = strlen(p);
X    s = (char *)malloc((l+2) * sizeof(char));
X    strcpy(s,p);
X    str = joint(2,str,s);
}
X
void print_str(void)
{
X    if(str != NULL){
X	printf("%s",str);
X	free(str);
X	str = NULL;
X    }
}
X
void print_hsp(void)
{
X    int i;
X
X    for(i = 0 ; i < nest_level * tab ; i++)
X	putchar(' ');
}
X
int to_optimize(char *s)
/* return 1 if it is to be discarded by optimization; otherwise return 0 */
{
X    int flag = 1;
X    char *p;
X
X    if(optimize == On){
X	for(p = s ; *p != '\0' ; p++){
X	    switch(*p){
X		case '_':
X		case ',':
X		case ';':
X		case '*':
X		case '[':
X		case ']':
X		case ' ':
X		case '\t':
X		    break;
X		default:
X		    if( ! (isalnum(*p)))
X			flag = 0;
X	    }
X	}
X	return flag;
X    }
X
X    return 0;
}
SHAR_EOF
  $shar_touch -am 0820130496 'pad2ps-3.1/src/c2pad/parser.c' &&
  chmod 0644 'pad2ps-3.1/src/c2pad/parser.c' ||
  $echo 'restore of' 'pad2ps-3.1/src/c2pad/parser.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/src/c2pad/parser.c:' 'MD5 check failed'
5d305e00336485f7ce6dbd704901a244  pad2ps-3.1/src/c2pad/parser.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/src/c2pad/parser.c'`"
    test 14383 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/src/c2pad/parser.c:' 'original size' '14383,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/c2pad/ifdef.c ==============
if test -f 'pad2ps-3.1/src/c2pad/ifdef.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/c2pad/ifdef.c' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/c2pad/ifdef.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/c2pad/ifdef.c' &&
/*                              */
/*  ifdef.c -- evaluate #ifdef  */
/*                              */
/*  c2pad  by S. Yoshida        */
/*                              */
X
#include "config.h"
X
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
#include "c2pad.h"
#include "lib.h"
X
static int sp;
static int cp;
static int stack[50];
static token_type cmd[50];
X
static void remove_symbol(char *);
static DEF *is_defined(char *);
int is_operator(token_type);
static int rpn(void);
void evaluate_rpn(token_type);
X
void list_defines(void)
/* print list of defined symbols to be dealt with #ifdef */
{
X    DEF *ptr;
X
X    get_token();
X
X    while(token != Eof){
X	if(token == Sharp){		/* # at the beginning of line */
X	    get_token();
X	    while(token == Sp)
X		get_token();
X
X	    switch(token){
X		case If:
X		case Ifdef:
X		case Ifndef:
X		case Elif:
X		    get_token();
X		    while(token == Sp)
X			get_token();
X
X		    while(token != Ret){
X			if(token == Name)
X			    add_symbol(word,0);
X			get_token();
X			while(token == Sp)
X			    get_token();
X		    }
X		    break;
X		default:
X		    while(token != Ret)
X			get_token();
X	    }
X	}
X	get_token();
X    }
X
X    for(ptr = defined_list ; ptr != NULL ; ptr = ptr->next)
X	puts(ptr->sym);
}
X
void eval_ifdef(void)
/* evaluate #ifdef */
{
X    token_type t;
X    char tmp[BUFSIZ];
X    int p;
X
X    get_token();
X    while(token == Sp)
X	get_token();
X
X    t = token;
X
X    switch(t){
X	case If:
X	case Ifdef:
X	case Ifndef:
X	case Elif:
X	case Define:
X	case Undef:
X	    get_token();
X	    while(token == Sp)
X		get_token();
X	    break;
X    }
X
X    switch(t){
X	case If:
X	    p = rpn();
X	    push(ifdef_value);
X	    if(ifdef_value != TRUE)
X		ifdef_value = ABS_FALSE;
X	    else{
X		if(p == 0)
X		    ifdef_value = FALSE;
X		else
X		    ifdef_value = TRUE;
X	    }
X	    break;
X	case Ifdef:
X	    push(ifdef_value);
X	    if(ifdef_value != TRUE)
X		ifdef_value = ABS_FALSE;
X	    else{
X		if(is_defined(word) == NULL)
X		    ifdef_value = FALSE;
X		else
X		    ifdef_value = TRUE;
X	    }
X	    break;
X	case Ifndef:
X	    push(ifdef_value);
X	    if(ifdef_value != TRUE)
X		ifdef_value = ABS_FALSE;
X	    else{
X		if(is_defined(word) == NULL)
X		    ifdef_value = TRUE;
X		else
X		    ifdef_value = FALSE;
X	    }
X	    break;
X	case Else:
X	    if(ifdef_value == TRUE)
X	        ifdef_value = FALSE;
X	    else if(ifdef_value == FALSE)
X	        ifdef_value = TRUE;
X	    break;
X	case Elif:
X	    p = rpn();
X	    if(ifdef_value == TRUE)
X		ifdef_value = TRUED_FALSE;
X	    else if(ifdef_value == FALSE){
X		if(p == 0)
X		    ifdef_value = FALSE;
X		else
X		    ifdef_value = TRUE;
X	    }
X	    break;
X	case Endif:
X	    ifdef_value = pop();
X	    break;
X	case Define:
X	    strcpy(tmp,word);
X	    get_token();
X	    while(token == Sp)
X		get_token();
X	    if(token != Ret)
X		p = rpn();
X	    else
X		p = 0;
X	    if(ifdef_value == TRUE)
X		add_symbol(tmp,p);
X	    break;
X	case Undef:
X	    if(ifdef_value == TRUE)
X		remove_symbol(word);
X	    break;
X    }
X
X    while(token != Ret)
X	get_token();
X
X    if(ifdef_value == TRUE)
X	get_token();
X    else{
X	while(ifdef_value != TRUE)
X	    get_token();
X    }
}
X
void add_symbol(char *sym,int val)
/* add newly defined symbol */
{
X    DEF *ptr;
X    int l;
X
X    if(is_defined(sym) == NULL){
X	ptr = defined_list;
X	defined_list = (DEF *)malloc(sizeof(DEF));
X	defined_list->next = ptr;
X
X	l = strlen(sym);
X	defined_list->sym = (char *)malloc((l+2) * sizeof(char));
X	strcpy(defined_list->sym,sym);
X	defined_list->val = val;
X    }
}
X
void remove_symbol(char *sym)
/* delete defined symbol */
{
X    DEF *prev = NULL;
X    DEF *ptr;
X
X    for(ptr = defined_list ; ptr != NULL ; ptr = ptr->next){
X	if(strcmp(ptr->sym,sym) == 0){
X	    if(prev != NULL)
X	        prev->next = ptr->next;
X	    else
X	        defined_list = ptr->next;
X	    free(ptr);
X	    return;
X	}
X    }
}
X
DEF *is_defined(char *sym)
/* return pointer to requested symbol if already defined */
{
X    DEF *ptr;
X
X    for(ptr = defined_list ; ptr != NULL ; ptr = ptr->next){
X	if(strcmp(ptr->sym,sym) == 0)
X	    return(ptr);
X    }
X    return(NULL);
}
X
int is_operator(token_type t)
/* return weight if the token is operator */
{
X    int p = -1;
X
X    switch(token){
X	case Defined:
X	case Not:
X	    p++;
X	case Exp:
X	    p++;
X	case Times:
X	case Divide:
X	    p++;
X	case Plus:
X	case Minus:
X	    p++;
X	case Lshift:
X	case Rshift:
X	    p++;
X	case Less:
X	case Great:
X	case Less_eq:
X	case Great_eq:
X	    p++;
X	case Equal2:
X	case Neq:
X	    p++;
X	case And:
X	    p++;
X	case Or:
X	    p++;
X	case And2:
X	    p++;
X	case Or2:
X	    p++;
X	case Rpar:
X	    p++;
X	case Lpar:
X	    p++;
X    }
X
X    return(p);
}
X
int rpn(void)
/* calculate #ifdef condition in reversed Polland format */
{
X    int p;
X    DEF *ptr;
X
X    sp = -1;
X    cp = -1;
X
X    while(token != Ret){
X	if(token == Rpar){
X	    while(cp > 0  &&  cmd[cp] != Lpar)
X		evaluate_rpn(cmd[cp--]);
X	    cp--;
X	}else if(token == Lpar  ||  token == Not  ||  token == Defined){
X	    /* always push left bracket and monomial operator */
X	    cmd[++cp] = token;
X	}else{
X	    p = is_operator(token);
X	    if(p != -1){			/* operator */
X		while(cp != -1  &&  is_operator(cmd[cp]) >= p)
X		    /* evaluate if the operator in stack is stronger or as same as the current opeator */
X		    evaluate_rpn(cmd[cp--]);
X		cmd[++cp] = token;		/* push into stack */
X	    }else{
X		if(token == Num){		/* number */
X		    sp++;
X		    stack[sp] = atoi(word);
X		}else{				/* symbol */
X		    sp++;
X		    ptr = is_defined(word);
X		    if(ptr != NULL)
X			stack[sp] = ptr->val;
X		    else
X			stack[sp] = EOF;
X		}
X	    }
X	}
X
X	get_token();
X	while(token == Sp)
X	    get_token();
X    }
X
X    while(cp >= 0)
X       evaluate_rpn(cmd[cp--]);
X
X    return(stack[sp]);
}
X
void evaluate_rpn(token_type op)
/* evaluate operators in reversed Polland format */
{
X    switch(op){
X	case Equal2:
X	    stack[sp-1] = stack[sp-1] == stack[sp];
X	    sp--;
X	    break;
X	case Neq:
X	    stack[sp-1] = stack[sp-1] != stack[sp];
X	    sp--;
X	    break;
X	case Less:
X	    stack[sp-1] = stack[sp-1] < stack[sp];
X	    sp--;
X	    break;
X	case Great:
X	    stack[sp-1] = stack[sp-1] > stack[sp];
X	    sp--;
X	    break;
X	case Less_eq:
X	    stack[sp-1] = stack[sp-1] <= stack[sp];
X	    sp--;
X	    break;
X	case Great_eq:
X	    stack[sp-1] = stack[sp-1] >= stack[sp];
X	    sp--;
X	    break;
X	case Not:
X	    if(stack[sp] == 0)
X	        stack[sp] = 1;
X	    else
X	        stack[sp] = 0;
X	    break;
X	case And:
X	    stack[sp-1] = stack[sp-1] & stack[sp];
X	    sp--;
X	    break;
X	case Or:
X	    stack[sp-1] = stack[sp-1] | stack[sp];
X	    sp--;
X	    break;
X	case And2:
X	    stack[sp-1] = stack[sp-1] && stack[sp];
X	    sp--;
X	    break;
X	case Or2:
X	    stack[sp-1] = stack[sp-1] || stack[sp];
X	    sp--;
X	    break;
X	case Plus:
X	    stack[sp-1] = stack[sp-1] + stack[sp];
X	    sp--;
X	    break;
X	case Minus:
X	    stack[sp-1] = stack[sp-1] - stack[sp];
X	    sp--;
X	    break;
X	case Times:
X	    stack[sp-1] = stack[sp-1] * stack[sp];
X	    sp--;
X	    break;
X	case Divide:
X	    stack[sp-1] = stack[sp-1] / stack[sp];
X	    sp--;
X	    break;
X	case Exp:
X	    stack[sp-1] = stack[sp-1] ^ stack[sp];
X	    sp--;
X	    break;
X	case Lshift:
X	    stack[sp-1] = stack[sp-1] << stack[sp];
X	    sp--;
X	    break;
X	case Rshift:
X	    stack[sp-1] = stack[sp-1] >> stack[sp];
X	    sp--;
X	    break;
X	case Defined:
X	    if(stack[sp] == EOF)
X	        stack[sp] = 0;
X	    else
X	        stack[sp] = 1;
X	    break;
X    }
}
SHAR_EOF
  $shar_touch -am 0820130496 'pad2ps-3.1/src/c2pad/ifdef.c' &&
  chmod 0644 'pad2ps-3.1/src/c2pad/ifdef.c' ||
  $echo 'restore of' 'pad2ps-3.1/src/c2pad/ifdef.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'pad2ps-3.1/src/c2pad/ifdef.c:' 'MD5 check failed'
81c6147b16557dd9eaf8784a3ccdad4a  pad2ps-3.1/src/c2pad/ifdef.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'pad2ps-3.1/src/c2pad/ifdef.c'`"
    test 7336 -eq "$shar_count" ||
    $echo 'pad2ps-3.1/src/c2pad/ifdef.c:' 'original size' '7336,' 'current size' "$shar_count!"
  fi
fi
# ============= pad2ps-3.1/src/c2pad/token.c ==============
if test -f 'pad2ps-3.1/src/c2pad/token.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'pad2ps-3.1/src/c2pad/token.c' '(file already exists)'
  rm -f _sh23946/new
else
  > _sh23946/new
  $echo 'x -' extracting 'pad2ps-3.1/src/c2pad/token.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'pad2ps-3.1/src/c2pad/token.c' &&
/*                                 */
/*  token.c -- get token           */
/*                                 */
/*  c2pad  by S. Yoshida           */
/*                                 */
X
#include "config.h"
X
#include <string.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
#include <ctype.h>
#include "c2pad.h"
#include "lib.h"
X
#define PRINT_COMMENT_IMMEDIATELY
X
static int ch = 0;
static int pch = 0;		/* read one character in ahead */
static int word_ptr = 0;	/* pointer to the tail of word */
static bool newline = On;	/* whether it is the head of line */
static char *comm = NULL;	/* preserved comment */
X
static void set_ch(void);
static void append_ch(void);
static void get_ch(void);
X
#ifndef PRINT_COMMENT_IMMEDIATELY
static void preserve_comment(void);
#endif
X
void get_token(void)
/* get token */
{
X    int old_ch;
X
X    if(token == Eof)
X	fatal_error("input file terminates unexpectedly.");
X
#ifndef PRINT_COMMENT_IMMEDIATELY
X    if(newline == On  &&  comm != NULL){
X	/* print preserved comment */
X
X	/* do not print at this place */
X	if (no_print_comment_flag == On) {
X	    strcpy(word,comm);
X	    free(comm);
X	    comm = NULL;
X	    token = Comment;
X	    return;
X	}
X
X	printf("%s",comm);
X	free(comm);
X	comm = NULL;
X    }
#endif
X
X    if(ch == 0)
X	get_ch();
X
X    switch(ch){
X	case EOF:
X	    token = Eof;
X	    *word = '\0';
X	    return;
X	case '\n':
X	    newline = On;
X	    token = Ret;
X	    set_ch();
X	    get_ch();
X	    return;
X	case ' ':
X	case '\t':
X	    token = Sp;
X	    set_ch();
X	    get_ch();
X	    while(ch == ' '  ||  ch == '\t'){
X		append_ch();
X		get_ch();
X	    }
X	    return;
X	case '#':
X	    if(newline == On){
X		if(ifdef == On){		/* -ifdef */
X		    token = Sharp;
X		    get_ch();
X		    return;
X		}else{
X		    get_ch();
X		    eval_ifdef();		/* evaluate #ifdef */
X		    return;
X		}
X	    }else{			/* '#' not at the head of line */
X		token = Str;
X		set_ch();
X		get_ch();
X		return;
X	    }
X	case '/':
X	    set_ch();
X	    get_ch();
X	    if(ch != '*'  &&  ch != '/'){
X		newline = Off;
X		token = Divide;
X		return;
X	    }else if(ch == '*'){	/* C style comment */
X		append_ch();
X		get_ch(); append_ch();
X
X		do{
X		    old_ch = ch;
X		    get_ch(); append_ch();
X		}while(old_ch != '*'  ||  ch != '/');
X
X		get_ch();
X
#ifndef PRINT_COMMENT_IMMEDIATELY
X		if(newline == On){	/* print immediately if it is a comment at the head of line */
#endif
X		    if(ifdef == Off  &&  ifdef_value == TRUE){
X			/* do not print at this place */
X			if (no_print_comment_flag == On) {
#ifdef PRINT_COMMENT_IMMEDIATELY
X			    if(newline == Off)
X				strcat(word,"\n");
#endif
X			    token = Comment;
X			    return;
X			}
X
#ifdef PRINT_COMMENT_IMMEDIATELY
X			if (elseif_flag == On) {
X			    putchar('\n');
X			    elseif_flag = Off;
X			  }
#endif
X			puts(word);
X		    }
X
#ifdef PRINT_COMMENT_IMMEDIATELY
X		    if(newline == Off){
X			get_token();
X			return;
X		    }
#endif
X		    get_token();
X		    while(token == Sp)
X			get_token();
X		    if(token == Ret)
X			get_token();
#ifndef PRINT_COMMENT_IMMEDIATELY
X		}else{		/* all other comments are preserved, and are printed after inserting return code */
X		    if(ifdef == Off  &&  ifdef_value == TRUE)
X			preserve_comment();
X		    get_token();
X		}
#endif
X		return;
X	    }else{			/* C++ style comment */
X		append_ch();
X		get_ch();
X
X		while(ch != '\n'){
X		    append_ch();
X		    get_ch();
X		}
X
#ifndef PRINT_COMMENT_IMMEDIATELY
X		if(newline == On){	/* print immediately if it is a comment at the head of line */
#endif
X		    if(ifdef == Off  &&  ifdef_value == TRUE){
X			/* do not print at this place */
X			if (no_print_comment_flag == On) {
X			    get_ch();
X			    strcat(word,"\n");
X			    token = Comment;
X			    return;
X			  }
X
#ifdef PRINT_COMMENT_IMMEDIATELY
X			if (elseif_flag == On) {
X			    putchar('\n');
X			    elseif_flag = Off;
X			}
#endif
X			puts(word);
X		    }
X
#ifdef PRINT_COMMENT_IMMEDIATELY
X		    if(newline == On)
#endif
X		    get_ch();
X		    get_token();
#ifndef PRINT_COMMENT_IMMEDIATELY
X		}else{		/* all other comments are preserved, and are printed after inserting return code */
X		    if(ifdef == Off  &&  ifdef_value == TRUE)
X			preserve_comment();
X		    get_token();
X		}
#endif
X		return;
X	    }
X	case '"':
X	    newline = Off;
X	    set_ch();
X
X	    do{
X		get_ch();
X		if(ch == '\n'){
X		    ch = '\\'; append_ch();
X		    ch = 'n'; append_ch();
X		}else if(ch == '\\'){
X		    append_ch();
X		    get_ch(); append_ch();
X		    ch = ' ';
X		}else
X		    append_ch();
X	    }while(ch != '"');
X
X	    get_ch();
X
X	    token = Str;
X	    return;
X	case '\'':
X	    newline = Off;
X	    set_ch();
X
X	    do{
X		get_ch();
X		if(ch == '\n'){
X		    ch = '\\'; append_ch();
X		    ch = 'n'; append_ch();
X		}else if(ch == '\\'){
X		    append_ch();
X		    get_ch(); append_ch();
X		    ch = ' ';
X		}else
X		    append_ch();
X	    }while(ch != '\'');
X
X	    get_ch();
X
X	    token = Str;
X	    return;
X	case '<':
X	    newline = Off;
X	    set_ch();
X	    get_ch();
X	    switch(ch){
X		case '<':
X		    token = Lshift;
X		    append_ch();
SHAR_EOF
  : || $echo 'restore of' 'pad2ps-3.1/src/c2pad/token.c' 'failed'
fi
$echo 'End of' 'archive' 'part' '7'
$echo 'File' 'pad2ps-3.1/src/c2pad/token.c' 'is continued in part' '8'
echo 8 > _sh23946/seq
exit 0


