--- jgraph-83.orig/MD5 +++ jgraph-83/MD5 @@ -0,0 +1,81 @@ +ffdcef743836662a12702dcf2ae55a8f ./MSDOS.help +64a4e847fc9e74672b4811a9e399ad3d ./NeXT.help +f53969fae482fe3edaad163ef332abb2 ./README +0d5a3e28166d4d7b4f68dcf8fa169e46 ./acc.jgr +478968c628b7b1578f07db559b4e7243 ./acc.tex +b1f1c25d7d520c55570b349195462567 ./ad.jgr +b33b6653626d1cba857911219a74f475 ./alb.jgr +5e2f8986cd85d1eef746c9fe005d0cee ./bailey.jgr +ed78354d175305ad871d1c80ad27dba0 ./bailey.pts +7bef8bac9f791580bae37cf04e50c1c3 ./cube.jgr +7bed117b638fce5928f0ca75361089d4 ./data.txt +2502d9bad5c2bb374a1431dcbc6b14ac ./descrip.mms +4071e21e4807655afcf58684fa6c427d ./disk.jgr +753aef0e6c712790be4aeae8692567c2 ./draw.c +3dd2dcb631857c4b18573aa724807f4d ./ebars.jgr +017552c34434a846d75df94edd4c744b ./edit.c +3d2cb2ff0c757725c4db3f6d8112a320 ./ex1.jgr +7a8e31d8c17dd24e266101e755322474 ./ex2.jgr +852a6455b40c6123768db9be7812cb7e ./exit.c +6973523f7924c0106faf1a7191d85743 ./g8.jgr +daa01300a77a803a1e29885b5c6f0848 ./g8col.jgr +24b1460b9d3da468ecdb6ce29973f49d ./g9n10.jgr +c508a37731fec20a98cca292f8be1bc7 ./gpaper.jgr +cec43aca40cb7110a495b6f7717c4a95 ./hypercube.jgr +0d33f1a0cfcdf138bc2a7f26512cd949 ./jgraph.1 +87a5935930be6f61c8cd3bff887ab0e8 ./jgraph.c +dfd130977c98787fb8fbe53175480d2e ./jgraph.com +bc78e292ebe55c546472372d32d5a442 ./jgraph.h +0fb8d1d64b87d9561a057f37edf98e65 ./jmalloc.c +dbb034d95ed19b3a5be5224bd31d4a57 ./list.c +013b712e607a558f0f98335dd43a6989 ./list.h +8179d3d8c5d2f36bcb375ef210ff514e ./mab2.jgr +975885f357ed960fa49d1d4ccac1bc1e ./mab2.times +cc622ab2e6d0cb8b784c662a387ac807 ./makefile +401850e3ff900e06bccff489594592a4 ./nr.jgr +ce4dde894fdab3c2082c4e1e4021b729 ./printline.c +5e3e30ab777213371d9c7ef19814556f ./prio_list.c +f4dfc26e617bfd6166dbc8cb08f6666c ./prio_list.h +4e98f320163ee4801705c5ba4134acd3 ./process.c +f906d74e1255c6b2fb2de57b13497d5d ./redexp.vms +c07225bfe71f5e23ab04dbc8fc83d604 ./show.c +e8fd7f066035ffa8914e620cbbecf243 ./sin.c +3097b48f655620d55b5363c5a25906b0 ./sin.jgr +4f76ae60de7033d23ba659695be78664 ./sin.pts +abbeb9c23f5b31efd1a391d30c9a3e1a ./sin1.jgr +5689189a1508d45a04d58b0a25206c2d ./sin2.c +74c3752a11476e548330193301fdd102 ./sin2.jgr +7cca7557623b43e0d5d68bd8d47279b3 ./sin2.pts +4a9c1fb7834254de3bbe3c56be431648 ./sin3.jgr +d3bd313d05b24149324124c154285753 ./sin3.pts +9a5415523a0b91aee4d887ca9fabdd27 ./token.c +822cc894ec1380fb9b8a5f6b25387ddb ./tree.awk +e59cb580220fdd3c2bbfd22353a4a53e ./wortman.jgr +ef2b48ee998eef74b8e9f6e3a1bb4c73 ./complex-examples/README +de23af77b2c43e82651965876a98bcd3 ./complex-examples/alg.jgr +ce140b4885d627735868167ec2fab25d ./complex-examples/ckpov.jgr +f5d7e541502e2c9b892925911985a916 ./complex-examples/cll.jgr +d3b37b236ef9589ec0be1c870cb10921 ./complex-examples/conc.jgr +ef00d8d6a3628470ca345816a2076fc1 ./complex-examples/convert.awk +72e4b48a42419f38c103bc890c4fd786 ./complex-examples/cow.jgr +52528240cafc2a294859e1b4110fbd7a ./complex-examples/disk.jgr +a74a4930c3696ff0c23df4a0e39c0bf2 ./complex-examples/diskarray.jgr +ccdbd0d1ae61603a22b61eb1f60187cd ./complex-examples/grex.gtj +3e943aacfddcea0e58344d5bbff336a9 ./complex-examples/grtoj.sh +7780bc34b3eb94013e0467a0e166b9ed ./complex-examples/makefile +1b3ac1ab9b5eb682eed817a997d0afc1 ./complex-examples/mlti.jgr +23fd64cbc573fee551371f573000dc2a ./complex-examples/regs.jgr +fbc11c48612bff207d16f2aa1c80dd45 ./complex-examples/seq.jgr +8f45c3a113b2ba00847d182602af26a9 ./complex-examples/srm.jgr +e05d5fe96129d778b3d25c7f698d0b16 ./complex-examples/timeline.jgr +7f2f3792014337d5579aa0a8dd318e8c ./complex-examples/tree.awk +c6d1ee8ec483a6e5d47626ef7cccf8e1 ./complex-examples/wedmap.jgr +d41d8cd98f00b204e9800998ecf8427e ./MD5 +461948b4c483ead6ac89692842540aa2 ./debian/changelog +6467ef5ed3ab97b98f152286de6ce7b8 ./debian/control +f56de178b81579ff6b5e9044582ab4c1 ./debian/copyright +fb26b2e76448401e9267c3038a541e37 ./debian/jgraph.examples +362717e7464d60c498ef732268770754 ./debian/dirs +a165b0c48efd38c3c2725a282922c6f1 ./debian/docs +9db7827dae4ba989055aab8f36605dfd ./debian/rules +55011b144549cfd3a01f71a15ba6b172 ./disk.eps --- jgraph-83.orig/README +++ jgraph-83/README @@ -46,8 +46,11 @@ Please send me comments and/or bug reports. Author: Jim Plank -Email: jsp@princeton.edu -USmail: Department of Computer Science - Princeton University - 35 Olden St. - Princeton, NJ 08544-2087 +Page: http://www.cs.utk.edu/~plank +Email: plank@cs.utk.edu +USmail: Associate Professor + Department of Computer Science + University of Tennessee + 203 Claxton Complex + 1122 Volunteer Blvd. + Knoxville, TN 37996-3450 --- jgraph-83.orig/complex-examples/makefile +++ jgraph-83/complex-examples/makefile @@ -1,4 +1,26 @@ -ALL = \ +STANDARD_EXAMPLES = \ + acc.jps \ + acc.eps \ + alb.jps \ + ad.jps \ + bailey.jps \ + ebars.jps \ + ex1.jps \ + ex2.jps \ + g8.jps \ + g8col.jps \ + g9n10.jps \ + gpaper.jps \ + hypercube.jps \ + mab2.jps \ + nr.jps \ + sin.jps \ + sin1.jps \ + sin2.jps \ + sin3.jps \ + wortman.jps + +COMPLEX_EXAMPLES = \ seq.jps \ conc.jps \ cow.jps \ @@ -18,11 +40,23 @@ srm.awk \ disk.awk +ALL = $(STANDARD_EXAMPLES) $(COMPLEX_EXAMPLES) + all: $(ALL) clean: - rm -f $(ALL) $(TMPFILES) + rm -f $(ALL) $(TMPFILES) sin.o + +sin: sin.o + cc -o sin sin.o -lm +ad.jps: cube.eps disk.eps +bailey.jps: bailey.pts +ex2.jps: data.txt +mab2.jps: mab2.times +sin.jps: sin +sin2.jps: sin2.pts +sin3.jps: sin3.pts seq.jps: regs.awk convert.awk disk.awk conc.jps: regs.awk convert.awk disk.awk @@ -36,12 +70,12 @@ ckpov.jps: srm.awk disk.awk convert.awk tree1.jps: tree.awk - ( echo "4 3" | nawk -f tree.awk ; echo "xaxis size 5.4" ) |\ + ( echo "4 3" | awk -f tree.awk ; echo "xaxis size 5.4" ) |\ jgraph -P > tree1.jps - ( echo "5 2" | nawk -f tree.awk ; echo "xaxis size 5" ) |\ + ( echo "5 2" | awk -f tree.awk ; echo "xaxis size 5" ) |\ jgraph -P > tree2.jps -.SUFFIXES: .gtj .jgr .jps .awk +.SUFFIXES: .c .o .h .gtj .jgr .jps .awk .eps .tex .dvi .jgr.jps: jgraph -P < $*.jgr > $*.jps @@ -51,3 +85,9 @@ .gtj.jps: sh grtoj.sh < $*.gtj | jgraph -P > $*.jps + +.jgr.eps: + jgraph < $*.jgr > $*.eps + +.tex.dvi: + latex $*.tex --- jgraph-83.orig/complex-examples/regs.jgr +++ jgraph-83/complex-examples/regs.jgr @@ -1,5 +1,5 @@ (* Picture of process state: 0 0.0 to 0.3 0.6 *) - +newgraph newcurve marktype box fill 1 marksize 0.3 0.6 pts 0.15 0.3 newline pts 0.0 0.15 0.3 0.15 newline pts 0.0 0.30 0.3 0.30 --- jgraph-83.orig/complex-examples/tree.awk +++ jgraph-83/complex-examples/tree.awk @@ -1,13 +1,13 @@ -# This is an nawk script for plotting m-level n-ary trees in jgraph. +# This is an awk script for plotting m-level n-ary trees in jgraph. # For each line of input, it will produce a new jgraph. The line must # contain two numbers: m and n, separated by white-space. # # Two nice outputs of this are: # -# ( echo "4 3" | nawk -f tree.awk ; echo "xaxis size 5.4" ) | jgraph -P +# ( echo "4 3" | awk -f tree.awk ; echo "xaxis size 5.4" ) | jgraph -P # # and -# ( echo "5 2" | nawk -f tree.awk ; echo "xaxis size 5" ) | jgraph -P +# ( echo "5 2" | awk -f tree.awk ; echo "xaxis size 5" ) | jgraph -P # { m = $1 --- jgraph-83.orig/debian/changelog +++ jgraph-83/debian/changelog @@ -0,0 +1,194 @@ +jgraph (83-23build1) bionic; urgency=high + + * No change rebuild to pick up -fPIE compiler default + + -- Balint Reczey Tue, 03 Apr 2018 12:30:08 +0000 + +jgraph (83-23) unstable; urgency=medium + + * QA upload. + * Set maintainer to the QA group. + * Replace debian/rules with dh (closes: #800253) + * Update FSF's address. + + -- Adam Borowski Mon, 15 Feb 2016 03:59:47 +0100 + +jgraph (83-22) unstable; urgency=low + + * Fixed manpage typos. Thanks to Francesco Poli. (closes: #352617) + + -- Pedro Zorzenon Neto Sun, 12 Feb 2006 22:36:59 -0200 + +jgraph (83-21) unstable; urgency=low + + * Fixed package description. Thanks to Martin Michlmayr. + (closes: #218285) + * Used "protoize" command to change sources from old-C style to ANSI + * Upgraded Debian Standards Version. + * Fixed many "passing arg X of `function_name' from incompatible + pointer type" warnings. + + -- Pedro Zorzenon Neto Sat, 30 Jul 2005 16:29:45 -0300 + +jgraph (83-20) unstable; urgency=low + + * bugfix - hash label fails with logarithmic axis + sometimes. added manpage information telling the user + what to do in this situation. (Closes: #140063) + * bugfix - wishlist, changed some information in manpage. + Thanks to Neil Spring . + (Closes: #140064) + + -- Pedro Zorzenon Neto Sat, 1 Jun 2002 12:08:02 -0300 + +jgraph (83-19) unstable; urgency=low + + * bugfix - GSview32 (version 4.0) couldn't understand EPS + header. Now jgraph produces EPS by default, and command + line option "-P" will produce PS files. (Closes: #126921) + + -- Pedro Zorzenon Neto Mon, 7 Jan 2002 19:06:36 -0300 + +jgraph (83-18) unstable; urgency=low + + * changed mail address of author Jim Plank in README. + + -- Pedro Zorzenon Neto Mon, 26 Nov 2001 14:10:04 -0300 + +jgraph (83-17) unstable; urgency=low + + * bugfix - segfaults on multiline labels - thanks to + Carlos that reported and sent the patch. + (Closes: #120507) + + -- Pedro Zorzenon Neto Thu, 22 Nov 2001 12:41:48 -0300 + +jgraph (83-16) unstable; urgency=low + + * added support for Iso Latin1 character set and manpage + section explaining how to use it. + (Closes: #111992) + * added expand bounding box support. see manpage (JGRAPH_BORDER) + * changed 02139 FSF postal code in copyright to 0_2_1_3_9. Lintian + will not complain about it anymore. + + -- Pedro Zorzenon Neto Wed, 12 Sep 2001 16:30:54 -0300 + +jgraph (83-15) unstable; urgency=low + + * added jgraph/LaTeX integration section in manpage. + Thanks to Ajay Shah . + (Closes: #108260) + * changed upstream author email in manpage. + + -- Pedro Zorzenon Neto Wed, 15 Aug 2001 19:24:36 -0300 + +jgraph (83-14) unstable; urgency=low + + * changed the mantainer e-mail in debian/control file, + that I forgot in previous upload. + + -- Pedro Zorzenon Neto Wed, 8 Aug 2001 18:10:37 -0300 + +jgraph (83-13) unstable; urgency=low + + * mantainer e-mail changed. + + -- Pedro Zorzenon Neto Mon, 6 Aug 2001 13:35:51 +0000 + +jgraph (83-12) unstable; urgency=low + + * New maintainer, see message: + http://lists.debian.org/debian-devel-0107/msg00289.html + * debian dir rewritten to use debhelper version 3 + * File debian/jgraph.compress removed. Compression of example + files changed to dh_compress default behavior. (compressed + only if greater than 4KBytes) + + -- Pedro Zorzenon Neto Mon, 16 Jul 2001 08:25:32 -0300 + +jgraph (83-11) unstable; urgency=low + + * New maintainer (Closes: #68113, #82867) + * Debian Policy 3.5.0.0 conformance + * debian/rules rewrite with debhelper + + -- Chuan-kai Lin Wed, 31 Jan 2001 12:39:21 +0800 + +jgraph (83-10) unstable; urgency=low + + * cleaned up debian/rules and usr/doc/jgraph + * removed debmake build dependency + * recompiled for libc6 + + -- Rob Browning Thu, 21 Aug 1997 00:02:42 -0500 + +jgraph (83-9) unstable; urgency=low + + * New maintainer (previous was Bill Mitchell ) + * Converted to new packaging standards + * Added complex-examples + + -- Rob Browning Tue, 28 Jan 1997 00:11:29 -0600 + +jgraph (83-8) unstable; urgency=low + + * source package multi-architecture compatability changes + + -- Rob Browning Mon, 27 Jan 1997 22:37:41 -0600 + +jgraph (83-7) unstable; urgency=low + + * rebuilt for elf + + -- Rob Browning Mon, 27 Jan 1997 22:37:31 -0600 + +jgraph (83-6) unstable; urgency=low + + * (skipped) + + -- Rob Browning Mon, 27 Jan 1997 22:37:21 -0600 + +jgraph (83-5) unstable; urgency=low + + * Reposition jgraph.1 from /usr/man to /usr/man/man1. + * use debian.makefile instead of makefile from upstream package + + -- Rob Browning Mon, 27 Jan 1997 22:37:06 -0600 + +jgraph (83-4) unstable; urgency=low + + * Redid debian.rules in Ian Murdock format. + * Cleaned up description and extended descripting in control file. + + -- Rob Browning Mon, 27 Jan 1997 22:35:43 -0600 + +jgraph (83-3) unstable; urgency=low + + * More bolding fixes in jgraph.1. + * Changed CFLAGS in makefile from debug to production flags + + -- Rob Browning Mon, 27 Jan 1997 22:35:12 -0600 + +jgraph (83-2) unstable; urgency=low + + * Changed line 1171 of jgraph.1 from "\fBoff\R" to "\fBoff\fR" + * Changed /usr/doc/examples/jgraph/Makefile to clean up sin.o + as well as the *.jps files on "make clean". + + -- Rob Browning Mon, 27 Jan 1997 22:34:42 -0600 + +jgraph (83-1) unstable; urgency=low + + * Initial Release. + * added debian.* files + * fixed many small problems with bolding in jgraph.1 + * added -O2 and -s compiler flags to CC macro in makefile + * changed occurrances of "nawk" to "awk" in ex2.jgr and makefile + * in jgraph.1, replaced "JGRAPH_DIR" with "/usr/doc/examples/jgraph" + + -- Rob Browning Mon, 27 Jan 1997 22:33:49 -0600 + +Local variables: +mode: debian-changelog +End: --- jgraph-83.orig/debian/compat +++ jgraph-83/debian/compat @@ -0,0 +1 @@ +9 --- jgraph-83.orig/debian/control +++ jgraph-83/debian/control @@ -0,0 +1,24 @@ +Source: jgraph +Section: math +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian QA Group +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.7 + +Package: jgraph +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Jim Plank's program for producing PostScript graphs + Jgraph takes a description of a graph or graphs and produces a + PostScript file on the standard output. + . + Jgraph is ideal for plotting any mixture of scatter point graphs, + line graphs, and/or bar graphs, and embedding the output into LaTeX, + or any other text processing system which can read PostScript. + . + The graph description language is simple enough to get nice looking + graphs with a minimum of effort, yet powerful enough to give the user + the flexibility to tailor the appearance of the graph to his or her + individual preferences. This includes plotting multiple graphs and + laying them out separately on the page (or pages). --- jgraph-83.orig/debian/copyright +++ jgraph-83/debian/copyright @@ -0,0 +1,90 @@ +This Debian package is a combination of the contents of the +jgraph.shar.Z and complex_examples.shar.Z files available from +. + +Copyright: + +Jgraph is distributed under the Gnu Public License (GPL) which the +following email from the author confirms. See +/usr/share/common-licenses/GPL for more details. + +WARNING: in the following email the address of Free Software +Foundation is obsolete. The updated address is: + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301, USA. + + +From plank@cs.utk.edu Mon Dec 5 06:35:37 1994 +Date: Mon, 5 Dec 1994 09:34:59 -0500 +From: plank@cs.utk.edu +To: mitchell@mdd.comm.mot.com +Subject: Re: jgraph for debian linux +Content-Length: 2470 +Status: RO +X-Lines: 66 + +>From mitchell@mdd.comm.mot.com Mon Dec 5 09:21:15 1994 +>To: jsp@Princeton.EDU +>Subject: jgraph for debian linux +> +>>From an email exchange we had: +> +>>> +>>> Sure, I'll be happy to put GNU-style copyright on jgraph. Please +>>> send me a copy of what you have, and I'll try to get a new release +>>> to you as soon as I can. +>>> +>> +>>OK -- here's a copy of the GPL. Most people just provide a statement +>>something like "This package is distributed under the GNU Public +>>License (GPL)". Some software authors quote the GPL, others say +>>something like the following: +>> +>> "You should have received a copy of the GPL with this package. +>> If not, write to the Free Software Foundation, 675 Mass Avenue, +>> Cambridge, MA, 0_2_1_3_9, USA" +>>[...] +> +>Sorry to be bothering you about this so much, but I'm trying to wind +>some stuff up in preparation for an upcoming vacation. Two things -- +> +>Firstoff, could you email me again saying it's OK to put jgraph under GPL? +>Your earlier email fell victim to a drive to reclaim disk space. If I +>don't see a new release from you with a GPL copyright in it, I'll just +>submit the jgraph package and cite your email in the interim. +> + +Indeed -- please put jgraph under GPL. That will be quicker than me +messing with it (unfortunately, I'm very busy right now, and won't +be able to deal with jgraph for at least a week) + +>Secondly, I've been putting together a jgraph package in anticipation +>of the GPL'd distribution, and I note that jgraph.1 has internal problems +>with bolding and unbolding. THere are numerous places where text which +>should not be bolded runs on in bold for several lines. It looks like +>the nroff man page might have been produced by mechanical means, because +>I see repeatable problems in it. I'm no nroff expert, but I noodled out +>the problems by inspection (though I'm not sure I caught them all). The +>following is a diff to fix the jgraph83 man page. It goes on for quite a +>while as plain text, so I compressed and uuencoded it to make it a bit more +>compact. If you'll uncompress it and take a look, the type of problems I +>went should be obvious. +> + +Thanks -- I'll take a look at it. Thanks for all the work you've done! + +Jim + + +--------------------------------------------------------------------------- +Jim Plank +plank@cs.utk.edu +http://www.cs.utk.edu/~plank + +Assistant Professor +Department of Computer Science +University of Tennessee +107 Ayres Hall +Knoxville, TN 37996 + +615-974-4397 --- jgraph-83.orig/debian/dirs +++ jgraph-83/debian/dirs @@ -0,0 +1 @@ +usr/bin --- jgraph-83.orig/debian/docs +++ jgraph-83/debian/docs @@ -0,0 +1 @@ +README --- jgraph-83.orig/debian/install +++ jgraph-83/debian/install @@ -0,0 +1 @@ +jgraph usr/bin --- jgraph-83.orig/debian/jgraph.examples +++ jgraph-83/debian/jgraph.examples @@ -0,0 +1,48 @@ +complex-examples/alg.jgr +complex-examples/ckpov.jgr +complex-examples/cll.jgr +complex-examples/conc.jgr +complex-examples/convert.awk +complex-examples/cow.jgr +complex-examples/diskarray.jgr +complex-examples/disk.jgr +complex-examples/grex.gtj +complex-examples/grtoj.sh +complex-examples/makefile +complex-examples/mlti.jgr +complex-examples/README +complex-examples/regs.jgr +complex-examples/seq.jgr +complex-examples/srm.jgr +complex-examples/timeline.jgr +complex-examples/tree.awk +complex-examples/wedmap.jgr +acc.jgr +ad.jgr +alb.jgr +bailey.jgr +bailey.pts +cube.jgr +data.txt +disk.jgr +ebars.jgr +ex1.jgr +ex2.jgr +g8col.jgr +g8.jgr +g9n10.jgr +gpaper.jgr +hypercube.jgr +mab2.jgr +mab2.times +nr.jgr +sin1.jgr +sin2.jgr +sin2.pts +sin3.jgr +sin3.pts +sin.c +sin.jgr +sin.pts +tree.awk +wortman.jgr --- jgraph-83.orig/debian/manpages +++ jgraph-83/debian/manpages @@ -0,0 +1 @@ +*.1 --- jgraph-83.orig/debian/rules +++ jgraph-83/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --parallel --- jgraph-83.orig/disk.eps +++ jgraph-83/disk.eps @@ -0,0 +1,76 @@ +%!PS-Adobe-2.0 EPSF-1.2 +%%Page: 1 1 +%%BoundingBox: -1 -1 217 217 +%%EndComments +1 setlinecap 1 setlinejoin +0.700 setlinewidth +0.00 setgray + +/Jrnd { exch cvi exch cvi dup 3 1 roll idiv mul } def +/JDEdict 8 dict def +JDEdict /mtrx matrix put +/JDE { + JDEdict begin + /yrad exch def + /xrad exch def + /savematrix mtrx currentmatrix def + xrad yrad scale + 0 0 1 0 360 arc + savematrix setmatrix + end +} def +/JSTR { + gsave 1 eq { gsave 1 setgray fill grestore } if + exch neg exch neg translate + clip + rotate + 4 dict begin + pathbbox /&top exch def + /&right exch def + /&bottom exch def + &right sub /&width exch def + newpath + currentlinewidth mul round dup + &bottom exch Jrnd exch &top + 4 -1 roll currentlinewidth mul setlinewidth + { &right exch moveto &width 0 rlineto stroke } for + end + grestore + newpath +} bind def + gsave /Times-Roman findfont 9.000000 scalefont setfont +0.000000 0.000000 translate +0.700000 setlinewidth gsave grestore +0.700000 setlinewidth gsave grestore + gsave + gsave gsave 108.000000 54.000000 translate 0.000000 rotate +newpath 108.000000 54.000000 JDE +gsave 0.500000 setgray fill grestore +stroke + grestore grestore + gsave 0.500000 setgray + gsave 108.000000 108.000000 translate 0.000000 rotate + newpath -108.000000 -54.000000 moveto 108.000000 -54.000000 lineto + 108.000000 54.000000 lineto + -108.000000 54.000000 lineto +closepath gsave 0.500000 setgray fill grestore +stroke + grestore grestore + gsave 0.700000 setlinewidth [] 0 setdash +0.000000 54.000000 moveto 0.000000 162.000000 lineto +stroke +0.700000 setlinewidth [] 0 setdash + grestore + gsave 0.700000 setlinewidth [] 0 setdash +216.000000 54.000000 moveto 216.000000 162.000000 lineto +stroke +0.700000 setlinewidth [] 0 setdash + grestore + gsave gsave 108.000000 162.000000 translate 0.000000 rotate +newpath 108.000000 54.000000 JDE +gsave 1.000000 setgray fill grestore +stroke + grestore grestore + grestore +-0.000000 -0.000000 translate + grestore --- jgraph-83.orig/draw.c +++ jgraph-83/draw.c @@ -6,14 +6,11 @@ */ #include "jgraph.h" -#include #include static char real_eof = EOF; -float ctop(val, axis) -float val; -Axis axis; +float ctop(float val, Axis axis) { if (axis->is_lg) { if (val <= 0.0) { @@ -29,9 +26,7 @@ } } -float disttop(val, axis) -float val; -Axis axis; +float disttop(float val, Axis axis) { if (axis->is_lg) { return FCPI * val; @@ -40,16 +35,14 @@ } } -float intop(val) -float val; +float intop(float val) { return FCPI * val; } #define MAXIMUM(a,b) ((a > b) ? a : b) -draw_axis(a, other) -Axis a, other; +void draw_axis(Axis a, Axis other) { char orientation; Hash h; @@ -114,16 +107,14 @@ } -draw_label(l) -Label l; +void draw_label(Label l) { if (l->label == CNULL) return; comment(l->label); print_label(l); } -set_clip(g) -Graph g; +void set_clip(Graph g) { comment("Setting Clip"); printf("newpath\n"); @@ -133,8 +124,7 @@ printf(" closepath clip newpath\n"); } -draw_curves(g) -Graph g; +void draw_curves(Graph g) { Curve c; @@ -148,13 +138,11 @@ printf("\n"); } -draw_curve(c, g) -Curve c; -Graph g; +void draw_curve(Curve c, Graph g) { Point p, px, py; int i, j; - float this_x, this_y, last_x, last_y, x, y; + float this_x, this_y, last_x=0, last_y=0, x, y; gsave(); setgray(c->graytype, c->gray); @@ -267,10 +255,7 @@ printf("\n"); } -draw_mark(x, y, c, g) -float x, y; -Curve c; -Graph g; +void draw_mark(float x, float y, Curve c, Graph g) { Point p; float ms0, ms1, scx, scy, trx, try; @@ -314,7 +299,7 @@ if (strcmp(inp, "%%BoundingBox:") == 0) done = 1; } for (i = 0; i < 4; i++) { - if (fscanf(f, "%d", &(bb[i])) == NULL) { + if (fscanf(f, "%d", &(bb[i])) == 0) { fprintf(stderr, "Error: Eps file '%s': eof in %s\n", c->eps, "bounding box"); exit(1); @@ -499,9 +484,7 @@ grestore(); } -draw_arrow(x1, y1, x2, y2, c) -float x1, y1, x2, y2; -Curve c; +void draw_arrow(float x1, float y1, float x2, float y2, Curve c) { float dx, dy; float ms0; @@ -539,12 +522,11 @@ printf("\n"); } -draw_legend(g) -Graph g; +void draw_legend(Graph g) { Curve c; Legend l; - float x, y; + float x = 0.0, y; char tmpmktype; l = g->legend; @@ -603,8 +585,7 @@ printf("\n"); } -draw_strings(g) -Graph g; +void draw_strings(Graph g) { String s; @@ -613,8 +594,7 @@ draw_label(s->s); } -draw_graph(g) -Graph g; +void draw_graph(Graph g) { comment("Drawing New Graph"); printf("%f %f translate\n", g->x_translate, g->y_translate); @@ -634,42 +614,122 @@ } -draw_graphs(gs, pp, landscape) -Graphs gs; -int pp; -int landscape; +void draw_graphs(Graphs gs, int pp, int landscape) { Graphs gs_p; Graph g; + int page_counter=0; for (gs_p = first(gs); gs_p != nil(gs); gs_p = next(gs_p)) { + page_counter++; draw_header(gs_p, pp, landscape); for (g = first(gs_p->g); g != nil(gs_p->g); g = next(g)) { draw_graph(g); } draw_footer(gs_p, pp); } + if (pp) { + printf("\n%%%%Trailer\n"); + printf("%%%%Pages: %i\n",page_counter); + printf("%%%%EOF\n"); + } } -draw_header(gs, pp, landscape) -Graphs gs; -int pp; -int landscape; +void draw_header(Graphs gs, int pp, int landscape) { FILE *f; char c; - if (gs->page == 1) printf("%%!PS-Adobe-2.0 EPSF-1.2\n"); - printf("%%%%Page: %d %d\n", gs->page, gs->page); - if (landscape) { - printf("%%%%BoundingBox: %d %d %d %d\n", gs->bb[1], gs->bb[0], - gs->bb[3], gs->bb[2]); + if (gs->page == 1) { + if (pp) { + printf("%%!PS-Adobe-3.0\n"); + printf("%%%%Pages: (atend)\n"); + printf("%%%%Creator: jgraph\n"); + printf("%%%%EndComments\n\n"); + printf("%%%%BeginProlog\n"); + printf("%%%%EndProlog\n"); + printf("%%%%BeginSetup\n"); + printf("%%%%EndSetup\n"); + } else { + printf("%%!PS-Adobe-2.0 EPSF-1.2\n"); + printf("%%%%Creator: jgraph\n"); + } + } + + if (pp) { + printf("\n%%%%Page: %d %d\n", gs->page, gs->page); + printf("%%%%BeginPageSetup\n"); + printf("%%%%EndPageSetup\n\n"); + } + + if ( (gs->page>1) && !pp ) { + /* tring EPS with more than one page */ + fprintf(stderr, "Error: 'newpage' token is not allowed" + " without '-P' command line option.\n"); + exit(1); + } + + /* if (landscape) { + printf("%%%%BoundingBox: %d %d %d %d\n", gs->bb[1], gs->bb[0], + gs->bb[3], gs->bb[2]); } else { - printf("%%%%BoundingBox: %d %d %d %d\n", gs->bb[0], gs->bb[1], - gs->bb[2], gs->bb[3]); + printf("%%%%BoundingBox: %d %d %d %d\n", gs->bb[0], gs->bb[1], + gs->bb[2], gs->bb[3]); } + printf("%%%%EndComments\n"); */ + + /* BEGIN added by pzn@debian.org */ + { /* expands the bounding box to fit characters with tilde, acute,... + * if user has set JGRAPH_BORDER enviroment variable */ + int expandborder=0; + char *s; \ + s=(char *)getenv("JGRAPH_BORDER"); + if (s!=NULL) { + expandborder=atoi(s); + } + if (!pp) { + if (landscape) { + printf("%%%%BoundingBox: %d %d %d %d\n", gs->bb[1]-expandborder, + gs->bb[0]-expandborder, gs->bb[3]+expandborder, + gs->bb[2]+expandborder); + } else { + printf("%%%%BoundingBox: %d %d %d %d\n", gs->bb[0]-expandborder, + gs->bb[1]-expandborder, gs->bb[2]+expandborder, + gs->bb[3]+expandborder); + } + printf("%%%%EndComments\n\n"); + } + } + + if (gs->page==1) + /* reencode fonts to ISOLatin1 or other */ + { /* NOTE: this is a preliminary version. It will only work with + * the default fonts, that are Times-Roman and Times-Bold + * "export JGRAPH_ENCODING=ISOLatin1Encoding" will work in sh */ + char *s; \ + s=(char *)getenv("JGRAPH_ENCODING"); + if ((s!=NULL) && (strlen(s)>0)) { + comment("Setting font encoding by pzn@debian.org"); + printf("/Times-Bold findfont\n"); + printf("dup length dict begin\n"); + printf(" {1 index /FID ne {def} {pop pop} ifelse} forall\n"); + printf(" /Encoding %s def\n",s); + printf(" currentdict\n"); + printf("end\n"); + printf("/Times-Bold exch definefont pop\n"); + printf("/Times-Roman findfont\n"); + printf("dup length dict begin\n"); + printf(" {1 index /FID ne {def} {pop pop} ifelse} forall\n"); + printf(" /Encoding %s def\n",s); + printf(" currentdict\n"); + printf("end\n"); + printf("/Times-Roman exch definefont pop\n"); + comment("End of font encoding"); + printf("\n"); + } + } + /* END added by pzn */ - printf("%%%%EndComments\n"); if (landscape) { printf("-90 rotate\n"); } @@ -685,7 +745,7 @@ (((11.0 * FCPI) - (gs->bb[3] - gs->bb[1])) / 2.0) - gs->bb[1]); } } else if (landscape) { - printf("%f 0 translate\n", -gs->bb[2] - gs->bb[0]); + printf("%f 0 translate\n", (double) (-gs->bb[2] - gs->bb[0])); } printf("1 setlinecap 1 setlinejoin\n"); printf("0.700 setlinewidth\n"); @@ -746,9 +806,7 @@ } } -draw_footer(gs, pp) -Graphs gs; -int pp; +void draw_footer(Graphs gs, int pp) { FILE *f; char c; @@ -770,5 +828,10 @@ } grestore(); if (pp) printf("showpage\n"); else printf("\n"); + + if (pp) { + printf("%%%%PageTrailer\n"); + } + } --- jgraph-83.orig/edit.c +++ jgraph-83/edit.c @@ -6,15 +6,12 @@ */ -#include - #include "jgraph.h" #define MAX(a,b) ((a > b) ? a : b) #define MIN(a,b) ((a < b) ? a : b) -edit_label(l) -Label l; +void edit_label(Label l) { char *txt, inp_str[80]; float f; @@ -72,8 +69,7 @@ } } -copy_curve(c1, c2) /* Copies curve c2 to c1 */ -Curve c1, c2; +void copy_curve(Curve c1, Curve c2) /* Copies curve c2 to c1 */ { Flist f, newf; Point p, newp; @@ -85,9 +81,9 @@ for (f = first(c2->gen_linetype); f != nil(c2->gen_linetype); f = next(f)) { - newf = (Flist) get_node(c1->gen_linetype); + newf = (Flist) get_node((List)c1->gen_linetype); newf->f = f->f; - insert(newf, c1->gen_linetype); + insert((List)newf, (List)c1->gen_linetype); } c1->pattern = c2->pattern; c1->apattern = c2->apattern; @@ -104,10 +100,10 @@ for (p = first(c2->general_marks); p != nil(c2->general_marks); p = next(p)) { - newp = (Point) get_node(c1->general_marks); + newp = (Point) get_node((List)c1->general_marks); newp->x = p->x; newp->y = p->y; - insert(newp, c1->general_marks); + insert((List)newp, (List)c1->general_marks); } c1->graytype = c2->graytype; c1->gray[0] = c2->gray[0]; @@ -138,8 +134,7 @@ c1->bezier = c2->bezier; } -copy_label(l1, l2) /* Copies label l2 to l1 */ -Label l1, l2; +void copy_label(Label l1, Label l2) /* Copies label l2 to l1 */ { l1->label = l2->label; l1->x = l2->x; @@ -156,8 +151,7 @@ l1->linesep = l2->linesep; } -copy_axis(a1, a2) /* Copies axis a2 to a1 */ -Axis a1, a2; +void copy_axis(Axis a1, Axis a2) /* Copies axis a2 to a1 */ { copy_label(a1->label, a2->label); copy_label(a1->hl, a2->hl); @@ -201,10 +195,7 @@ a1->is_x = a2->is_x; } -Curve do_copy_curve(g, gs, all_gs) -Graph g; -Graphs gs; -Graphs all_gs; +Curve do_copy_curve(Graph g, Graphs gs, Graphs all_gs) { Curve lastc, newc; Graph oldg; @@ -254,10 +245,7 @@ return newc; /* To shut lint up */ } -Label do_copy_string(g, gs, all_gs) -Graph g; -Graphs gs; -Graphs all_gs; +Label do_copy_string(Graph g, Graphs gs, Graphs all_gs) { String lastl, newl; Graph oldg; @@ -307,10 +295,7 @@ } } -Graph last_graph(g, gs, all_gs) -Graph g; -Graphs gs; -Graphs all_gs; +Graph last_graph(Graph g, Graphs gs, Graphs all_gs) { Graph lastg; @@ -329,8 +314,7 @@ return lastg; } -copy_legend(l1, l2) -Legend l1, l2; +void copy_legend(Legend l1, Legend l2) { l1->linelength = l2->linelength; l1->linebreak = l2->linebreak; @@ -339,9 +323,7 @@ copy_label(l1->l, l2->l); } -inherit_axes(g, lastg) -Graph g; -Graph lastg; +void inherit_axes(Graph g, Graph lastg) { char *s; copy_axis(g->x_axis, lastg->x_axis); @@ -356,9 +338,7 @@ g->title->label = s; } -getpattern(inp_str, key, p, a) -char *inp_str, *key, *p; -float *a; +void getpattern(char *inp_str, char *key, char *p, float *a) { int i; float f; @@ -382,12 +362,9 @@ fprintf(stderr, "\n"); exit(1); } - return; } -edit_curve(c, g) -Curve c; -Graph g; +void edit_curve(Curve c, Graph g) { char inp_str[256], *txt; float x, y, f, e1, e2; @@ -418,33 +395,33 @@ exit(1); } } - p = (Point) get_node(c->pts); + p = (Point) get_node((List)c->pts); p->x = x; p->y = y; p->e = e; - insert(p, c->pts); + insert((List)p, (List)c->pts); c->npts++; if (e == 'x') { - p1 = (Point) get_node(c->xepts); + p1 = (Point) get_node((List)c->xepts); p1->x = e1; p1->y = y; - p2 = (Point) get_node(c->xepts); + p2 = (Point) get_node((List)c->xepts); p2->x = e2; p2->y = y; - insert(p1, c->xepts); - insert(p2, c->xepts); + insert((List)p1, (List)c->xepts); + insert((List)p2, (List)c->xepts); xh = MAX(e1, e2); xh = MAX(xh, x); xl = MIN(e1, e2); xl = MIN(xl, x); yh = y; yl = y; } else if (e == 'y') { - p1 = (Point) get_node(c->yepts); + p1 = (Point) get_node((List)c->yepts); p1->y = e1; p1->x = x; - p2 = (Point) get_node(c->yepts); + p2 = (Point) get_node((List)c->yepts); p2->y = e2; p2->x = x; - insert(p1, c->yepts); - insert(p2, c->yepts); + insert((List)p1, (List)c->yepts); + insert((List)p2, (List)c->yepts); yh = MAX(e1, e2); yh = MAX(yh, y); yl = MIN(e1, e2); yl = MIN(yl, y); xh = x; xl = x; @@ -481,10 +458,10 @@ fprintf(stderr, "Reading GMarks, no y value for x=%f\n", x); exit(1); } - p = (Point) get_node(c->general_marks); + p = (Point) get_node((List)c->general_marks); p->x = x; p->y = y; - insert(p, c->general_marks); + insert((List)p, (List)c->general_marks); } rejecttoken(); } else if (strcmp(inp_str, "pfill") == 0) { @@ -550,9 +527,9 @@ } } else if (strcmp(inp_str, "glines") == 0) { while (getfloat(&f)) { - fl = (Flist) get_node (c->gen_linetype); + fl = (Flist) get_node ((List)c->gen_linetype); fl->f = f; - insert(fl, c->gen_linetype); + insert((List)fl, (List)c->gen_linetype); } rejecttoken(); } else if (strcmp(inp_str, "pattern") == 0) { @@ -680,8 +657,7 @@ } } -edit_hash_label(a) -Axis a; +void edit_hash_label(Axis a) { float at, f; char *s; @@ -720,19 +696,18 @@ "hash_label either needs \"at\" or an associated \"hash_at\"\n"); exit(1); } - st = (String) get_node(a->hash_labels); + st = (String) get_node((List)a->hash_labels); st->s = new_label(); st->s->label = s; st->s->x = at; st->s->y = at; - insert(st, a->hash_labels); + insert((List)st, (List)a->hash_labels); return; } } } -edit_axis(a) -Axis a; +void edit_axis(Axis a) { char inp_str[256]; float f; @@ -808,11 +783,11 @@ } else if (strcmp(inp_str, "hash_at") == 0 || strcmp(inp_str, "mhash_at") == 0) { if (getfloat(&f)) { - h = (Hash) get_node (a->hash_lines); + h = (Hash) get_node ((List)a->hash_lines); h->loc = f; h->major = (inp_str[0] == 'h'); h->size = h->major ? HASH_SIZE : MHASH_SIZE; - insert(h, a->hash_lines); + insert((List)h, (List)a->hash_lines); } else rejecttoken(); } else if (strcmp(inp_str, "hash_label") == 0) { edit_hash_label(a); @@ -907,8 +882,7 @@ } } -edit_legend(l) -Legend l; +void edit_legend(Legend l) { char inp_str[256]; float f; @@ -974,10 +948,7 @@ } } -edit_graph(g, gs, all_gs) -Graph g; -Graphs gs; -Graphs all_gs; +void edit_graph(Graph g, Graphs gs, Graphs all_gs) { char inp_str[80]; int num; @@ -1049,8 +1020,7 @@ } } -edit_graphs(gs) -Graphs gs; +void edit_graphs(Graphs gs) { Graphs the_g; Graph g, tmp_g; --- jgraph-83.orig/ex2.jgr +++ jgraph-83/ex2.jgr @@ -25,7 +25,7 @@ newcurve marktype none linetype solid label : N log N / 35000 - pts shell : nawk \ + pts shell : awk \ ' $5 != 0 { \ print $5, $5 * log($5) / 35000}' \ data.txt @@ -52,7 +52,7 @@ newcurve\ marktype none linetype solid\ label : N log N / 35000\ - pts shell : nawk \\ + pts shell : awk \\ ' $5 != 0 { \\ print $5, $5 * log($5) / 35000}' \\ data.txt\ --- jgraph-83.orig/exit.c +++ jgraph-83/exit.c @@ -14,7 +14,7 @@ ** VMS exit status ($STATUS) will be set **-- **/ -#include +#include exit(va_alist) va_dcl --- jgraph-83.orig/general.h +++ jgraph-83/general.h @@ -0,0 +1,90 @@ +#ifndef _GENERAL_H +#define _GENERAL_H + +/* list.c */ +List get_node(List list); +List make_list(int size); +void insert(List item, List list); +void delete_item(List item); +void free_node(List node, List list); + +/* prio_list.c */ +void prio_insert(Prio_list node, Prio_list list, Boolean desc); + +/* token.c */ +void set_input_file(char *s); +void error_header(void); +int getstring(char *s); +int getfloat(float *f); +void rejecttoken(void); +int getint(int *i); +int getsystemstring(void); + +/* printline.c */ +void gsave(void); +void grestore(void); +void setfont(char *f, float s); +void setfill(float x, float y, char t, float *f, char p, float a); +void setgray(char t, float *f); +void printline(float x1, float y1, float x2, float y2, + char orientation); +void print_ebar(float x1, float y1, float x2, float ms, + char orientation); +void start_line(float x1, float y1, Curve c); +void cont_line(float x1, float y1); +void end_line(void); +void bezier_control(float x1, float y1); +void bezier_end(float x1, float y1); +void start_poly(float x1, float y1); +void cont_poly(float x1, float y1); +void end_poly(float x, float y, char ftype, float *fill, char pattern, + float parg); +void printellipse(float x, float y, float radius1, float radius2, + char ftype, float *fill, char pattern, float parg); +void set_comment(int c); +void comment(char *s); +void printline_c(float x1, float y1, float x2, float y2, Graph g); +void print_label(Label l); +void setlinewidth(float size); +void setlinestyle(char style, Flist glist); + +/* edit.c */ +void edit_graphs(Graphs gs); +void copy_label(Label l1, Label l2); + +/* process.c */ +void process_title(Graph g); +void process_legend(Graph g); +void process_axis1(Axis a, Graph g); +void process_axis2(Axis a, Graph g); +void process_label(Label l, Graph g, int adjust); +void process_label_max_n_mins(Label l, float len, float height); +void process_strings(Graph g); +void process_curve(Curve c, Graph g); +void process_curves(Graph g); +void process_label_extrema(Label l, Graph g); +void process_graph(Graph g); +void process_graphs(Graphs gs); + +/* show.c */ +void show_graphs(Graphs gs); + +/* draw.c */ +void draw_axis(Axis a, Axis other); +void draw_label(Label l); +void set_clip(Graph g); +void draw_curves(Graph g); +void draw_curve(Curve c, Graph g); +void draw_mark(float x, float y, Curve c, Graph g); +void draw_arrow(float x1, float y1, float x2, float y2, Curve c); +void draw_legend(Graph g); +void draw_strings(Graph g); +void draw_graph(Graph g); +void draw_graphs(Graphs gs, int pp, int landscape); +void draw_header(Graphs gs, int pp, int landscape); +void draw_footer(Graphs gs, int pp); + +/* jgraph.c */ +void new_graphs(Graphs gs); + +#endif --- jgraph-83.orig/jgraph.1 +++ jgraph-83/jgraph.1 @@ -64,11 +64,11 @@ within the description language are: line and function interpolation, function plotting, and pie graphs. The latter is impossible to do with the aid of -\fBjgraph, \fR +\fBjgraph\fR, however, the others can be effected with \fBjgraph \fR mixed with awk or c. See -FUNCTION PLOTTING AND OTHER NON-INHERENT FEATURES +FUNCTION PLOTTING AND OTHER NON\-INHERENT FEATURES below. .sp Also below is a section @@ -98,7 +98,7 @@ .B \-p The \fB\-p\fR -option re-prints the input on the standard output, only +option re\-prints the input on the standard output, only with all the defaults made explicit. This is useful for letting the user do his/her own special formatting, as it shows the explicit values that the defaults assume, so that they can be manipulated. @@ -110,23 +110,23 @@ .SH THE DESCRIPTION LANGUAGE The description language is essentially keywords followed by attributes. All keywords and attributes except for string attributes -are tokens -- non-white-space characters surrounded by white-space. +are tokens \-\- non\-white\-space characters surrounded by white\-space. Special tokens are ``(*'', ``*)'', ``include'', ``:'', and ``shell'', which denote -comments, include-file statements, string identifiers, and shell-include +comments, include\-file statements, string identifiers, and shell\-include statements: .TP .B Comments Comments are surrounded by the tokens ``(*'' ``*)'' as in -Modula-2 (except that here, the tokens must be surrounded by white- -space). Comments may be nested. If the comment runs to the end of a +Modula\-2 (except that here, the tokens must be surrounded by white\-space). +Comments may be nested. If the comment runs to the end of a file, the last ``*)'' may be omitted. .TP .B Include\-file statements The token following an ``include'' token is expected to be a file name. The result of the statement is to -include the contents of the file at that point. Include-file -statments can be nested within included files, and within shell +include the contents of the file at that point. Include\-file +statements can be nested within included files, and within shell includes. .TP .B Strings @@ -147,7 +147,7 @@ .fi One can get multiline strings by making a backslash the last character before the newline on all but the -last line. Notice that in strings white-space is not ignored. +last line. Notice that in strings white\-space is not ignored. This way of denoting strings allows the user to embed leading and trailing spaces, as well as the null string. For example, the null string ``'' is represented by: @@ -166,8 +166,8 @@ Shell include statements are of the form ``shell'', ``:'', and then a string. The result of the statement is that the string is executed (using popen, which passes the string to sh), and the standard -output is included at that point. Shell-includes can be freely -nested within include-files and other shell-includes. Shell +output is included at that point. Shell\-includes can be freely +nested within include\-files and other shell\-includes. Shell commands may be more than one line, but must not exceed 1000 characters. The shell statement is not (yet) available on VMS. .TP @@ -207,7 +207,7 @@ for a string as defined above. .RE .TP -.B TOP-LEVEL DESCRIPTION COMMANDS +.B TOP\-LEVEL DESCRIPTION COMMANDS .RS .TP .B newgraph @@ -244,7 +244,7 @@ the previous page of graphs. If there is no previous page, then an error will be flagged. (copygraph does not copy the values of the -\fB\fIhash_at\fB, \fImhash_at\fB,\fR +\fB\fIhash_at\fR, \fImhash_at\fR,\fR and \fB\fI\fIhash_label\fB\fR attributes). @@ -258,9 +258,9 @@ \fB\fInewpage\fB\fR is the same as appending together the output of separate calls of jgraph on the text before the -\fB\fInewpage,\fB\fR +\fB\fInewpage\fR,\fR and on the text after the -\fB\fInewpage.\fB\fR +\fB\fInewpage.\fR \fB\fINewpage\fB\fR will most likely produce bizarre results if the \fB\-P\fR @@ -292,7 +292,7 @@ bounding box (e.g. to change the centering), try the \fB\fIbbox\fB\fR command. If there's more than one page in the jgraph file, -\fB\fIY,\fB\fR +\fB\fIY\fR,\fR \fB\fIX\fB\fR and \fB\fIbbox\fB\fR @@ -307,11 +307,11 @@ command lets you explicitly enter one which will go directly into the jgraph output. Its units are the final postscript units. It's probably best to use the -\fB\-p\FR +\fB\-p\fR option to see what the bounding box is that jgraph produces, and then alter that accordingly with -\fB\fIbbox.\fB\fR +\fB\fIbbox.\fR The main use for this is to change the automatic centering that jgraph performs: Usually the center of the bounding box that jgraph computes is put at the center of the page. Changing the bbox changes this @@ -333,10 +333,10 @@ These two commands allow the user to include strings or files (the token specifies the filename) which will be copied directly into jgraph's output. -The \fIpreamble\fB is included at the beginning of the output +The \fIpreamble\fR is included at the beginning of the output (after some initial postscript to set things up for jgraph), -and the \fIepilogue\fB is included at the end. A good use for -the \fIpreamble\fB is to set up a postscript dictionary if you're +and the \fIepilogue\fR is included at the end. A good use for +the \fIpreamble\fR is to set up a postscript dictionary if you're using postscript marks. .PD .RE @@ -344,7 +344,7 @@ .TP .B GRAPH EDITING COMMANDS These commands act on the current graph. -Graph editing is terminated when one of the top-level description +Graph editing is terminated when one of the top\-level description commands is given. .RS .TP @@ -364,13 +364,13 @@ \fB\|{\fIinteger\fB\|}. \fR If the curve doesn't exist, then this command creates it and starts editing it. -\fINewcurve\fB +\fINewcurve\fR and -\fIcurve\fB +\fIcurve\fR interact as -\fInewgraph\fB +\fInewgraph\fR and -\fIgraph\fB +\fIgraph\fR do. .TP \fBnewline\fR @@ -398,7 +398,7 @@ labels, this can be changed. .TP \fBlegend\fR -The edits the legend of the graph (see LEGEND EDITING +This edits the legend of the graph (see LEGEND EDITING COMMANDS). As a default, the graph will contain a legend if any of its curves have labels. .TP @@ -412,28 +412,28 @@ .ns .TP \fBcopystring \|[\fIinteger\fB\|]\fR -\fIString\fB +\fIString\fR and -\fIcopystring\fB +\fIcopystring\fR are to -\fInewstring\fB +\fInewstring\fR as -\fIcurve\fB +\fIcurve\fR and -\fIcopycurve\fB +\fIcopycurve\fR are to -\fInewcurve.\fB +\fInewcurve\fR. .TP \fBborder\fR .br .ns .TP \fBnoborder\fR -\fIBorder\fR\fB +\fIBorder\fR draws a square border around the area defined by the axes. -\fINoborder\fB +\fINoborder\fR specifies no border. -\fINoborder\fB +\fINoborder\fR is the default. .TP \fBclip\fR @@ -441,15 +441,15 @@ .ns .TP \fBnoclip\fR -\fIClip\fB -specifies that all curves in the graph will be clipped -- that is, -no points outside of the of axes will be plotted. Clipping can also be -specified on a per-curve basis. The default is -\fInoclip.\fB +\fIClip\fR +specifies that all curves in the graph will be clipped \-\- that is, +no points outside of the axes will be plotted. Clipping can also be +specified on a per\-curve basis. The default is +\fInoclip\fR. .TP \fBinherit_axes\fR This is an old command which is kept for backward compatibility. -\fICopycurve.\fB +\fICopycurve\fR. is equivalent to: .PP .nf @@ -462,24 +462,24 @@ .ns .TP \fBy_translate \|[\fIfloat\fB\|]\fR -By default, the bottom left-hand corner of each graph is at point +By default, the bottom left\-hand corner of each graph is at point (0,0) (final postscript units). -\fIX_translate\fB +\fIX_translate\fR and -\fIY_translate\fB -translate the bottom left-hand corner of the graph +\fIY_translate\fR +translate the bottom left\-hand corner of the graph \fB\|[\fIfloat\fB\|] \fR inches. The main use of this is to draw more than one graph on a page. Note that jgraph considers all the graphs drawn on the page when it computes its bounding box for centering. Thus, if only one graph is drawn, it will always be centered on the page, regardless of its -\fIX_translate\fB +\fIX_translate\fR and -\fIY_translate\fB +\fIY_translate\fR values. These values are used for relative placement of the graphs. To change the centering of the graphs, use -\fIbbox.\fB +\fIbbox.\fR .TP \fBX \|[\fIfloat\fB\|]\fR .br @@ -487,11 +487,11 @@ .TP \fBY \|[\fIfloat\fB\|]\fR These are the same as -\fIX\fB +\fIX\fR and -\fIY\fB +\fIY\fR in the -Top-level commands, except that they let the user continue editing +Top\-level commands, except that they let the user continue editing the current graph. .PD .RE @@ -500,11 +500,11 @@ .B SIMPLE AXIS EDITING COMMANDS These commands act on the current axis as chosen by -\fIxaxis\fB +\fIxaxis\fR or -\fIyaxis\fB +\fIyaxis\fR (see GRAPH EDITING COMMANDS). -Axis editing terminates when a graph or top-level command is given. +Axis editing terminates when a graph or top\-level command is given. There are more advanced axis editing commands given below which have to do with moving the hash marks, adding new hash marks and labels, etc. See ADVANCED AXIS EDITING COMMANDS. @@ -518,7 +518,9 @@ Set the axis to be linear or logarithmic. The default is linear. If the axis is set to be logarithmic, then values <= 0.0 will be disallowed, as they are at negative infinity on the -axis. +axis. If you are using logarithmic axes and the labels shows 0 0 1 10 +instead of 0.01 0.1 1 10, then you should read "hash_format" in this +section. Hint: xaxis log hash_format g .TP \fBmin \|[\fIfloat\fB\|]\fR .br @@ -531,9 +533,9 @@ \fB\-p \fR option. Unless stated, all units (for example point plotting, string plotting, etc.) will be in terms of the -\fImin\fB +\fImin\fR and -\fImax\fB +\fImax\fR values of the x and y axes. .TP \fBsize \|[\fIfloat\fB\|]\fR @@ -547,7 +549,7 @@ \fBhash \|[\fIfloat\fB\|]\fR Hash marks will be \fB\|[\fIfloat\fB\|] \fR -units apart. Default = -1. +units apart. Default = \-1. If this value equals 0, then there will be no hash marks. If this value is less than 0, then the hash marks will be automatically set by @@ -556,9 +558,9 @@ \fB\-p \fR for the value). By default, each hash mark will be labeled with its value. -\fIHash\fB +\fIHash\fR and -\fIshash\fB +\fIshash\fR are ignored if the axes are logarithmic. .TP @@ -569,20 +571,20 @@ \fBjgraph\fR if \fBhash\fR -= -1. += \-1. If -\fIhash\fB +\fIhash\fR is set by the user, -\fIshash\fB +\fIshash\fR is defaulted to the -\fImin\fB +\fImin\fR value of the axis. .TP \fBmhash \|[\fIinteger\fB\|]\fR Put \fB\|[\fIinteger\fB\|] \fR minor hash marks between the above -hash marks. Default = -1. If this value equals 0, then there will +hash marks. Default = \-1. If this value equals 0, then there will be no minor hash marks. If this value is negative, then the value will be chosen by \fBjgraph \fR @@ -614,7 +616,7 @@ .TP \fBlabel\fR Edit the label of this axis (see LABEL EDITING COMMANDS). -By default, the label is in font ``Times-Bold'', and has a font size of +By default, the label is in font ``Times\-Bold'', and has a font size of 10. If the user doesn't change any of the plotting attributes of the label, \fBjgraph \fR @@ -623,57 +625,57 @@ \fBdraw_at \|[\fIfloat\fB\|]\fR Draw the axis line at this point on the other axis. The default is usually the other axis's -\fImin, \fB +\fImin\fR, however if -\fIhash_scale \fB +\fIhash_scale \fR is positive (see -\fIhash_scale \fB +\fIhash_scale \fR under ADVANCED AXIS EDITING), it will be the other axis's -\fImax.\fB +\fImax\fR. .TP \fBnodraw\fR Do not draw the axis, the hash marks or any labels. This is useful for plotting points with no axes, and for overlaying graphs on top of one another with no clashes. This is equivalent to -\fIno_draw_axis,\fB -\fIno_draw_axis_label,\fB -\fIno_draw_hash_marks,\fB +\fIno_draw_axis\fR, +\fIno_draw_axis_label\fR, +\fIno_draw_hash_marks\fR, and -\fIno_draw_hash_labels.\fB +\fIno_draw_hash_labels\fR. .TP \fBdraw\fR Cancels the effect of -\fInodraw. \fB +\fInodraw\fR. Default = -\fIdraw.\fB +\fIdraw\fR This is equivalent to -\fIdraw_axis,\fB -\fIdraw_axis_label,\fB -\fIdraw_hash_marks,\fB +\fIdraw_axis\fR, +\fIdraw_axis_label\fR, +\fIdraw_hash_marks\fR, and -\fIdraw_hash_labels.\fB +\fIdraw_hash_labels\fR. .TP \fBgrid_lines\fR .br .ns .TP \fBno_grid_lines\fR -\fIGrid_lines\fB +\fIGrid_lines\fR specifies to plot a grid line at each major hash mark on this axis. The default is -\fIno_grid_lines.\fB +\fIno_grid_lines.\fR .TP \fBmgrid_lines\fR .br .ns .TP \fBno_mgrid_lines\fR -\fIMgrid_lines\fB +\fIMgrid_lines\fR specifies to plot a grid line at each minor hash mark on this axis. The default is -\fIno_mgrid_lines.\fB +\fIno_mgrid_lines\fR. .PD .RE .LP @@ -681,23 +683,23 @@ .B CURVE EDITING COMMANDS These commands act on the current curve as chosen by -\fInewcurve\fB +\fInewcurve\fR or -\fIcurve\fB +\fIcurve\fR (see GRAPH EDITING COMMANDS). Curve -editing terminates when a graph or top-level command is given. +editing terminates when a graph or top\-level command is given. .RS .TP \fBpts \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR This sets the points to plot in this curve. The first -\fIfloat\fB +\fIfloat\fR is the x value, and the second -\fIfloat\fB +\fIfloat\fR is the y value of the point. Points are plotted in the order specified. -This command stops reading points when a non-float is given. -The user can specify this command multiple times within a curve -- +This command stops reading points when a non\-float is given. +The user can specify this command multiple times within a curve \-\- each time, simply more points are added to the curve. .TP \fBx_epts \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR @@ -707,23 +709,23 @@ \fBy_epts \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR This allows the user to specify points and ``confidence values'' (otherwise known as ``error bars''). The first two -\fIfloats\fB +\fIfloats\fR specify the x and y values of the point, as above. If \fBx_epts\fR is specified, then the second two -\fIfloats\fB +\fIfloats\fR specify range or confidence values for the x value of the point. Error bars will be printed to each of these x values (using the original point's y value) from the original point. Similarly, -\fIy_epts\fB +\fIy_epts\fR specifies range or confidence values for the y value of the point. -\fIpts\fB -\fIx_epts\fB +\fIpts\fR +\fIx_epts\fR and -\fIy_epts\fB +\fIy_epts\fR can all be intermixed. .TP \fBmarktype\fR @@ -731,25 +733,25 @@ marks are: \fIcircle\fR, \fIbox\fR, \fIdiamond\fR, \fItriangle\fR, \fIx\fR, \fIcross\fR, \fIellipse\fR, \fIxbar\fR, \fIybar\fR, \fItext\fR, \fIpostscript\fR, \fIeps\fR, \fInone\fR, and variants of -\fIgeneral\fR. Most of these are self-explanatory, except for the +\fIgeneral\fR. Most of these are self\-explanatory, except for the last few: \fIXbar\fR makes the curve into a bar graph with the bars going to the x axis. \fIYbar\fR has the bars going to the y axis. \fIText\fR lets the user plot text instead of a mark. The text is -editted as a label (see LABEL EDITING COMMANDS) immediately following +edited as a label (see LABEL EDITING COMMANDS) immediately following the \fItext\fR command. The x and y fields of the label have special meanings here: They define where the label is to be printed in relation to the curve points. For example, if they are both 0, the label will -be printed directly on the curve points. If x is 1.0 and y is -1.0, then +be printed directly on the curve points. If x is 1.0 and y is \-1.0, then the label will be printed one unit to the right and one unit below the curve points (units are units of the x and y axes). Default label values are 0 for x and y, and center justification. - \fIPostscript:\fR See the \fIpostscript\fB token below. - \fIEps:\fR See the \fIeps\fB token below. + \fIPostscript\fR: See the \fIpostscript\fR token below. + \fIEps\fR: See the \fIeps\fR token below. \fINone\fR means that no mark will be plotted (this is useful for drawing lines). There are four types of \fIgeneral\fR marks, which work using the -\fIgmarks\fB command described below. The four marktypes are +\fIgmarks\fR command described below. The four marktypes are \fIgeneral\fR, \fIgeneral_nf\fR, \fIgeneral_bez\fR, and \fIgeneral_bez_nf\fR. By default, a new mark is chosen for each curve. @@ -781,11 +783,11 @@ for \fIgray\fR should be from 0 (black) to 1 (white). Values for -\fIcolor\fR\fB +\fIcolor\fR should also be from 0 to 1. They are RGB values, and thus define the amount of red, green and blue in the curve respectively. Specifying color nullifies the gray value, and vice versa. The default is -\fIgray 0\fB +\fIgray 0\fR .TP \fBfill \|[\fIfloat\fB\|]\fR .br @@ -794,16 +796,16 @@ \fBcfill \|[\fIfloat\fB\| \|\fIfloat\fB\| \|\fIfloat\fB\|]\fR This sets the filling of marks which define an area to fill (e.g. \fIbox\fR, \fIcircle\fR, \fIxbar\fR). -\fIfill\fB +\fIfill\fR defines a gray value, and -\fIcfill\fB +\fIcfill\fR defines a color value (see -\fIgray\fB +\fIgray\fR and -\fIcolor\fB +\fIcolor\fR above for a description of the units). The default is -\fIfill 0\fB +\fIfill 0\fR (black). .TP \fBpattern \fItoken\fB \|[\fIfloat\fB\|]\fR @@ -837,17 +839,17 @@ .ns .TP \fBppattern \fItoken\fB \|[\fIfloat\fB\|]\fR -\fIPoly\fB allows the user to make jgraph treat the curve as a +\fIPoly\fR allows the user to make jgraph treat the curve as a closed polygon (or in the case of a bezier, a closed bezier curve). -\fIpfill\fB, \fIpcfill\fB and \fIppattern\fB specify the +\fIpfill\fR, \fIpcfill\fR and \fIppattern\fR specify the filling of the polygon, -and work like \fIfill\fB, \fIcfill\fB and \fIpattern\fB above. -The default is \fInopoly\fB. +and work like \fIfill\fR, \fIcfill\fR and \fIpattern\fR above. +The default is \fInopoly\fR. .TP \fBgmarks \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR -\fIGmarks\fB +\fIGmarks\fR is a way for the user to define custom marks. For each mark on -\fI(x,y),\fB +\fI(x,y)\fR, Each pair of \fB\|{\fIfloat_x\fB\|}, \|{\fIfloat_y\fB\|}, \fR will define a point on the mark (x + @@ -856,7 +858,7 @@ \fIbox\fR mark could be defined as .PP .nf - gmarks -1 -1 -1 1 1 1 1 -1 + gmarks \-1 \-1 \-1 1 1 1 1 \-1 marktype general .fi .PP @@ -864,7 +866,7 @@ and \fIgeneral_bez_nf\fR, allow the gmarks points to define a closed polygon, a line, a closed bezier curve and a regular bezier curve respectively (the ``nf'' stands for -``non-filled''). +``non\-filled''). .TP \fBpostscript : \|{\fIstring\fB\|}\fR .br @@ -878,23 +880,23 @@ will be copied to the output once for every mark. The postscript will be set up so that when the string or file is put to the output, (0, 0) of the the axes is in the middle of the mark, it is rotated by -\fImrotate\fB degrees, and scaled by -(\fImarksize_x\fB / 2), \fImarksize_y\fB / 2). +\fImrotate\fR degrees, and scaled by +(\fImarksize_x\fR / 2), \fImarksize_y\fR / 2). Thus, the \fIbox\fR mark could be defined as: .PP .nf - postscript : 1 setlinewidth -1 -1 moveto -1 1 lineto \\ - 1 1 lineto 1 -1 lineto -1 -1 lineto stroke + postscript : 1 setlinewidth \-1 \-1 moveto \-1 1 lineto \\ + 1 1 lineto 1 \-1 lineto \-1 \-1 lineto stroke .fi .PP -If the \fImarksize_x\fB is defined to be (0, 0), then jgraph does no +If the \fImarksize_x\fR is defined to be (0, 0), then jgraph does no scaling. This is useful when the postscript has strings, and the user does not want the strings to be scaled. .TP \fBeps {\fItoken\fB\|}\fR This allows the user to include an encapsulated postscript file and treat it as a mark. It automatically sets the marktype to -\fIeps\fB. The file will be scaled so that the bounding +\fIeps\fR. The file will be scaled so that the bounding box is \fImarksize\fR units. Among other things, this allows the user to include whole jgraph files as marks. Please see ad.jgr, explained in HINTS AND EXAMPLE GRAPHS below for an example of this feature. @@ -912,17 +914,17 @@ .ns .TP \fBnorarrows\fR -\fIRarrows\fB +\fIRarrows\fR specifies to draw an arrow at the end of every line segment in the curve. -\fILarrows\fB +\fILarrows\fR specifies to draw an arrow at the beginning of every line segment. The size of the arrows can be changed by using -\fIasize.\fB +\fIasize.\fR The default is -\fInolarrows\fB +\fInolarrows\fR and -\fInorarrows\fB. +\fInorarrows\fR. Arrows always go exactly to the point specified, with the exception of when the marktype is ``circle''. In this case, the arrow goes to the edge of the circle. @@ -940,19 +942,19 @@ .ns .TP \fBnorarrow\fR -This is analgous to the above, except that with \fIlarrow\fB, the +This is analgous to the above, except that with \fIlarrow\fR, the only arrow drawn is to the beginning of the first segment in the -curve, and with \fIrarrow\fB, the only arrow drawn is to the end +curve, and with \fIrarrow\fR, the only arrow drawn is to the end of the last segment. .TP \fBasize \|[\fIfloat\fB\|] \|[\fIfloat\fB\|]\fR This sets the size of the arrows. The first \fB\|[\fIfloat\fB\|] \fR -controls the arrow's width. Its units are those of the x-axis. +controls the arrow's width. Its units are those of the x\-axis. The second \fB\|[\fIfloat\fB\|] \fR -controls the arrow's height. It is in the units of the y-axis. -Use the -p option of jgraph to see the default values. +controls the arrow's height. It is in the units of the y\-axis. +Use the \-p option of jgraph to see the default values. .TP \fBafill \|[\fIfloat\fB\|]\fR .br @@ -964,17 +966,17 @@ .TP \fBapattern \fItoken\fB \|[\fIfloat\fB\|]\fR These control the grayness or color of arrowheads. -\fIAfill\fB, -\fIacfill\fB +\fIAfill\fR, +\fIacfill\fR and -\fIapattern\fB +\fIapattern\fR work in the same way as -\fIfill\fB, -\fIcfill\fB +\fIfill\fR, +\fIcfill\fR and -\fIpattern\fB +\fIpattern\fR described above. The default is -\fIafill 0\fB +\fIafill 0\fR (black). .TP \fBlinetype \|[\fItoken\fB\|]\fR @@ -983,17 +985,17 @@ \fIdotdash\fR, \fIdotdotdash\fR, \fIdotdotdashdash\fR, \fIgeneral\fR, and \fInone\fR. The default is \fInone\fR. \fIGeneral\fR lets the user define his own linetype using the -\fIglines\fB +\fIglines\fR command described below. Points are connected in the order in which they are inserted using the -\fIpts\fB +\fIpts\fR command. .TP \fBglines \|[\fIfloat\fB\|]*\fR This lets the user specify the exact dashing of a line. The format -is as in postscript -- the first number is the length of the first +is as in postscript \-\- the first number is the length of the first dash, the second is the length of the space after the first dash, -etc. For example, \fIdotdash\fB could be defined as ``\fIglines\fB 5 3 +etc. For example, \fIdotdash\fR could be defined as ``\fIglines\fR 5 3 1 3''. .TP \fBlinethickness \|[\fIfloat\fB\|]\fR @@ -1007,7 +1009,7 @@ \fBnobezier\fR .br .ns -\fIBezier\fB +\fIBezier\fR specifies to use the curve's points to define successive bezier curves. The first point is the starting point. The next two are control points for the bezier curve and the next point is the ending point. If there @@ -1016,26 +1018,26 @@ point is the ending point. Thus, a bezier must have a total of (3n + 1) points, where n is at least 1. In bezier curves, marks and arrows only apply to every third point. -\fINobezier\fB is the default. +\fINobezier\fR is the default. .TP \fBclip\fR -This specifies that this curve will be clipped -- that is, +This specifies that this curve will be clipped \-\- that is, no points outside of the of axes will be plotted. .TP \fBnoclip\fR This turns off clipping. If clipping was specified for the entire graph, then -\fInoclip\fB +\fInoclip\fR has no effect. -\fINoclip\fB +\fINoclip\fR is the default. .TP \fBlabel\fR -This edits the label of this curve for the purposed of +This edits the label of this curve for the purpose of drawing a legend. (see LABEL EDITING COMMANDS and LEGEND EDITING COMMANDS). Unless the legend entry is -\fIcustom\fB, +\fIcustom\fR, setting any label attribute except for the text itself will have no effect. .PD @@ -1062,7 +1064,7 @@ label. Units are the units of the x and y axes respectively. .TP \fBfont \|[\fItoken\fB\|]\fR -This sets the font. Default is usually ``Times-Roman''. +This sets the font. Default is usually ``Times\-Roman''. .TP \fBfontsize \|[\fIfloat\fB\|]\fR This sets the fontsize in points. Default is usually 9. @@ -1082,7 +1084,7 @@ \fBhjr\fR These set the horizontal justification to left, center, and right, respectively. Default = -\fIhjc.\fB +\fIhjc.\fR .TP \fBvjt\fR .br @@ -1095,18 +1097,18 @@ \fBvjb\fR These set the vertical justification to top center, and bottom, respectively. Default = -\fIvjb.\fB +\fIvjb.\fR .TP \fBrotate \|[\fIfloat\fB\|]\fR This will rotate the string \fB\|[\fIfloat\fB\|] \fR degrees. The point of rotation is defined by the -\fIvj\fB +\fIvj\fR and -\fIhj\fB +\fIhj\fR commands. For example, to rotate 90 degrees about the center of a string, one would use -\fIvjc hjc rotate 90.\fB +\fIvjc hjc rotate 90.\fR .TP \fBlgray \|[\fIfloat\fB\|]\fR .br @@ -1114,9 +1116,9 @@ .TP \fBlcolor \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR These control the color or the grayness of the label. It works just as -\fIgray\fB +\fIgray\fR and -\fIcolor\fB +\fIcolor\fR do for curves and axes. The default depends on the context. For example, for strings and the title, the default is black. For axis labels and hash labels, the default is the color of the axis. For text as marks, the @@ -1128,7 +1130,7 @@ .B LEGEND EDITING COMMANDS These commands allow the user to alter the appearance of the legend. Legends are printed out for each curve -having a non-null label. The legend entries are printed out +having a non\-null label. The legend entries are printed out in the order of ascending curve numbers. Legend editing terminates when a graph command or top level command is issued. @@ -1138,13 +1140,13 @@ of the entry's curve. Thus, for example, if you wanted each entry's fontsize to be 18, you had to set it in each entry's curve. Now, default legend entry characteristics are set using the -\fIdefaults\fB +\fIdefaults\fR keyword. Unless a -\fIcustom\fB +\fIcustom\fR legend is specified, these default values override any values set in the entry's curve. Thus, to get all entries to have a fontsize of 18, it must be set using -\fIdefaults fontsize 18.\fB +\fIdefaults fontsize 18\fR. If legend editing seems cryptic, try the following example: .PP @@ -1157,18 +1159,18 @@ newcurve marktype x linetype dashed label : Dashed x pts 0 2 1 3 2 3 3 3 legend defaults - font Times-Italic fontsize 14 x 1.5 y 3.5 hjc vjb + font Times\-Italic fontsize 14 x 1.5 y 3.5 hjc vjb .fi .PP The legend of this graph should be centered over the top of the graph, -and all legend entries should be 14pt Times-Italic. +and all legend entries should be 14pt Times\-Italic. .RS .TP \fBon\fR .br .ns .TP -\fBoff\R +\fBoff\fR These turn printing of the legend on and off. The default is on (but, of course, if there are no curve labels defined, there will be no legend). @@ -1202,7 +1204,7 @@ .TP \fBdefaults\fR This lets the user change the attributes of all legend entries. -The defaults are editted as a label (see LABEL EDITING COMMANDS). +The defaults are edited as a label (see LABEL EDITING COMMANDS). A few of the label fields have special meanings: The \fI:\fR field is ignored. The \fIx\fR and \fIy\fR fields define where the label will be printed. The \fIhj\fR and \fIvj\fR fields define the justification @@ -1212,7 +1214,7 @@ will be placed on y=15. This is analagous to label plotting. The \fIrotate\fR field is also analagous to label plotting. -Defaults are as follows. \fIRotate\fR is 0. \fIfont\fR is ``Times-Roman'' +Defaults are as follows. \fIRotate\fR is 0. \fIfont\fR is ``Times\-Roman'' and \fIfontsize\fR is 9. The color is black. Default justification is \fIhjl\fR and \fIvjc\fR. The default \fIx\fR and \fIy\fR values are set according to the \fIhj\fR and \fIvj\fR fields. See the @@ -1223,16 +1225,16 @@ .br .ns .TP -\fIright\fB +\fIright\fR These will automatically produce a legend to the left or the right of the graph. -\fILeft\fB +\fILeft\fR is equivalent to -\fIdefaults hjr vjc\fB +\fIdefaults hjr vjc\fR and -\fIright\fB +\fIright\fR is equivalent to -\fIdefaults hjl vjc.\fB +\fIdefaults hjl vjc\fR. .TP \fBtop\fR .br @@ -1241,13 +1243,13 @@ \fBbottom\fR These will automatically produce a legend on the top or the bottom of the graph. -\fITop\fB +\fITop\fR is equivalent to -\fIdefaults hjl vjb\fB +\fIdefaults hjl vjb\fR and -\fIbottom\fB +\fIbottom\fR is equivalent to -\fIdefaults hjl vjt.\fB +\fIdefaults hjl vjt\fR. .TP \fBx \|[\fIfloat\fB\|]\fR .br @@ -1256,23 +1258,23 @@ \fBy \|[\fIfloat\fB\|]\fR These are included mainly for backward compatability to earlier versions of jgraph. Setting -\fIx\fB +\fIx\fR and -\fIy\fB +\fIy\fR is equivalent to ``defaults x -\fIfloat\fB +\fIfloat\fR y -\fIfloat\fB +\fIfloat\fR hjl vjt'' .TP \fBcustom\fR This lets the user control where each individual legend entry goes. The values of the -\fIdefaults\fB +\fIdefaults\fR fields are ignored, and instead, the values of the curve's labels are used. All justifications have defined results, except for -\fIhjc\fB. +\fIhjc\fR. Similarly, rotation other than 0 is likely to produce bad effects. .PD .RE @@ -1292,13 +1294,13 @@ \fBcolor \|[\fIfloat\fB \fIfloat\fB \fIfloat\fB\|]\fR These specify either the grayness of the axis or its color. Values for -\fIgray\fB +\fIgray\fR should be from 0 (black) to 1 (white). Values for -\fIcolor\fB +\fIcolor\fR should also be from 0 to 1. They are RGB values, and thus define the amount of red, green and blue in the axis respectively. Specifying color nullifies the gray value, and vice versa. The default is -\fIgray 0\fB. +\fIgray 0\fR. These values affect every part of the axis: the label, the hash marks and labels, the axis line and the grid lines. .TP @@ -1319,21 +1321,21 @@ gridlines and the mgridlines to be different from those of the axis lines. The default -\fIgrid_gray\fB +\fIgrid_gray\fR and -\fIgrid_color\fB +\fIgrid_color\fR is the same as the axis's -\fIgray\fB +\fIgray\fR and -\fIcolor\fB. +\fIcolor\fR. The default -\fImgrid_gray\fB +\fImgrid_gray\fR and -\fImgrid_color\fB +\fImgrid_color\fR is the same as -\fIgrid_gray\fB +\fIgrid_gray\fR and -\fIgrid_color\fB. +\fIgrid_color\fR. .TP \fBhash_at \|[\fIfloat\fB\|]\fR Draw a hash mark at this point. No label is @@ -1349,22 +1351,22 @@ Edit the default characteristics of the hash labels. This is so that the user can change the fontsize, justification, etc., of the hash labels. Editing -\fIhash_labels \fB +\fIhash_labels \fR is just like editing normal labels (see LABEL EDITING COMMANDS), except that the -\fI:,\fB -\fIx,\fB +\fI:\fR, +\fIx\fR, and -\fIy\fB +\fIy\fR values are all ignored. Defaults for hash labels are as -follows: Fontsize=9, Font=``Times-Roman'', Justification is dependent +follows: Fontsize=9, Font=``Times\-Roman'', Justification is dependent on whether it is the x or y axis and whether -\fIhash_scale\fB +\fIhash_scale\fR is positive or negative. .TP \fBhash_scale \|[\fIfloat\fB\|]\fR This is to change the size and orientation of -the hash marks. Default = -1.0. Changing this to -2.0 will double +the hash marks. Default = \-1.0. Changing this to \-2.0 will double the length of the hash marks. Changing this to +1.0 will make the hash marks come above or to the right of the axis. .TP @@ -1372,7 +1374,7 @@ By default, the hash marks are drawn either above or below the axis. This command changes where they are drawn. -\fIHash_scale\fB +\fIHash_scale\fR still determines whether they are drawn above or below this point, and their size. .TP @@ -1380,10 +1382,10 @@ By default, the hash labels are drawn either above or below the hash marks (again, this is dependent on -\fIhash_scale\fB). +\fIhash_scale\fR). This command changes where they are drawn. Justification and fontsize, etc., can be changed with the -\fIhash_labels\fB +\fIhash_labels\fR command. .TP \fBauto_hash_marks\fR @@ -1395,17 +1397,17 @@ not \fBjgraph \fR will automatically create hash marks according to -\fIhash,\fB -\fImhash\fB +\fIhash\fR, +\fImhash\fR and -\fIshash\fB +\fIshash\fR (or -\fIlog_base\fB +\fIlog_base\fR and -\fImhash\fB +\fImhash\fR for logarithmic axes). The default is -\fIauto_hash_marks.\fB +\fIauto_hash_marks\fR. .TP \fBauto_hash_labels\fR .br @@ -1416,9 +1418,9 @@ not \fBjgraph \fR will automatically create hash labels for the -\fIauto_hash_marks\fB. +\fIauto_hash_marks\fR. Default = -\fIauto_hash_labels\fB. +\fIauto_hash_labels\fR. .TP \fBdraw_axis\fR .br @@ -1427,7 +1429,7 @@ \fBno_draw_axis\fR This toggles whether or not the axis line is drawn. Default = -\fIdraw_axis.\fB +\fIdraw_axis\fR. .TP \fBdraw_axis_label\fR .br @@ -1435,11 +1437,11 @@ .TP \fBno_draw_axis_label\fR This toggles whether or -not the axis label (as editted by the -\fIlabel\fB +not the axis label (as edited by the +\fIlabel\fR command) is drawn. Default = -\fIdraw_axis_label.\fB +\fIdraw_axis_label\fR. .TP \fBdraw_hash_marks\fR .br @@ -1448,11 +1450,11 @@ \fBno_draw_hash_marks\fR This toggles whether or not the hash marks (both automatic and those created with -\fIhash_at\fB +\fIhash_at\fR and -\fImhash_at\fB) +\fImhash_at\fR) are drawn. Default = -\fIdraw_hash_marks.\fB +\fIdraw_hash_marks\fR. .TP \fBdraw_hash_labels\fR .br @@ -1461,7 +1463,7 @@ \fBno_draw_hash_labels\fR This toggles whether or not the hash labels are drawn. Default = -\fIdraw_hash_labels.\fB +\fIdraw_hash_labels\fR. .PD .RE .LP @@ -1470,19 +1472,19 @@ Hash labels are simply strings printed along the appropriate axis. As a default, they are printed at the place denoted by the most recent -\fIhash_at\fB +\fIhash_at\fR or -\fImhash_at\fB +\fImhash_at\fR for this axis, but this can be changed by the -\fIat\fB +\fIat\fR command. If there has been no -\fIhash_at\fB +\fIhash_at\fR or -\fImhash_at,\fB +\fImhash_at\fR, then an -\fIat\fB +\fIat\fR command must be given, or there will be an error. Hash editing terminates when either one of these commands is not given. @@ -1499,19 +1501,19 @@ .PD .RE .LP -.SH FUNCTION PLOTTING AND OTHER NON-INHERENT FEATURES +.SH FUNCTION PLOTTING AND OTHER NON\-INHERENT FEATURES Although \fBjgraph \fR -doesn't have any built-in functions for interpolation +doesn't have any built\-in functions for interpolation or function plotting, both can be effected in \fBjgraph \fR with a little outside help: .TP \fBFunction plotting\fR With the -\fIinclude\fB +\fIinclude\fR and -\fIshell\fB +\fIshell\fR statement, it's easy to create a file of points of a function with a c or awk program, and include it into a graph. See the section HINTS AND EXAMPLE GRAPHS @@ -1529,135 +1531,218 @@ should be able to draw any kind of scatter/line/bar graph that a user desires. To embellish the graph with extra text, axes, lines, etc., it is helpful to use -\fIcopygraph.\fB +\fIcopygraph.\fR The following example graphs show a few examples of different features -of jgraph. They should be in the directory JGRAPH_DIR. +of jgraph. They should be in the directory /usr/share/doc/examples/jgraph. .sp -- acc.jgr is a simple bar graph. Acc.tex is also included to show +\- acc.jgr is a simple bar graph. Acc.tex is also included to show how one can include the output of jgraph in a LaTeX file. To get this to work, you might have to substitute the entire pathname of the file acc.jps in the acc.tex file. .sp -- g8.jgr is a simple graph with some plotted text. -- g8col.jgr shows how to produce a color background -- it is +\- g8.jgr is a simple graph with some plotted text. +\- g8col.jgr shows how to produce a color background \-\- it is the same as g8.jgr only all on a yellow background. -- ebars.jgr is a simple graph with error bars. -- sin.jgr shows how a sin function can be plotted using a simple c +\- ebars.jgr is a simple graph with error bars. +\- sin.jgr shows how a sin function can be plotted using a simple c program to produce the sin wave. Moreover, this file shows a use of -\fIcopygraph\fB +\fIcopygraph\fR to plot an extra x and y axis at the 0 point. .sp -- sin1.jgr is a further extension of sin.jgr only with one x and y +\- sin1.jgr is a further extension of sin.jgr only with one x and y axis at 0, but with the axis labels at the left and the bottom of the graph. .sp -- sin2.jgr is a different sin wave with a logarithmic x axis. +\- sin2.jgr is a different sin wave with a logarithmic x axis. .sp -- sin3.jgr shows how a bizarre effect can be gotten by sorting the +\- sin3.jgr shows how a bizarre effect can be gotten by sorting the points in a different manner. .sp -- bailey.jgr shows how to use the UNIX spline(1) routine to get +\- bailey.jgr shows how to use the UNIX spline(1) routine to get interpolation between points. .sp -- gpaper.jgr shows how you can get jgraph to easily produce graph paper. +\- gpaper.jgr shows how you can get jgraph to easily produce graph paper. .sp -- g9n10.jgr contains two graphs with complicated legends. It +\- g9n10.jgr contains two graphs with complicated legends. It contains a description of how the legend was created. .sp -- ex1.jgr and ex2.jgr are two examples which were figures 1 and +\- ex1.jgr and ex2.jgr are two examples which were figures 1 and two in an extended abstract for a paper about jgraph. .sp -- mab2.jgr is a graph created by Matt Blaze which shows how a +\- mab2.jgr is a graph created by Matt Blaze which shows how a complicated output graph can be quite concisely and simply stated. In this graph, the x axis is a time line. It shows usage of the -\fIhash_label\fB +\fIhash_label\fR and -\fIhash_labels\fB +\fIhash_labels\fR commands, as well as displaying how jgraph lets you extract data from output files with awk. .sp -- nr.jgr is an example of a rather complicated bar graph with -stripe-filled bars. It was created by Norman Ramsey. +\- nr.jgr is an example of a rather complicated bar graph with +stripe\-filled bars. It was created by Norman Ramsey. .sp -- hypercube.jgr shows an interesting use of jgraph -for picture-drawing. +\- hypercube.jgr shows an interesting use of jgraph +for picture\-drawing. .sp -- ad.jgr is an example which shows how one can include jgraph +\- ad.jgr is an example which shows how one can include jgraph output as jgraph input. The file uses the \fIeps\fR token to include cube.jgr, a jgraph drawing of an Intel hypercube, and disk.jgr, a jgraph drawing of a disk, in a picture. .sp -- alb.jgr is another use of jgraph for picture drawing. This file +\- alb.jgr is another use of jgraph for picture drawing. This file was created by an awk script which Adam Buchsbaum wrote to draw trees and graphs. .sp -- wortman.jgr is a neat graph of processor utilization written +\- wortman.jgr is a neat graph of processor utilization written by Dave Wortman for SIGPLAN '92. It was created by an awk script, which processed the data and emitted the jgraph. .sp -To view these graphs, use jgraph -P, and view the resulting output +To view these graphs, use jgraph \-P, and view the resulting output file with -\fIgs,\fB +\fIgs\fR, or a similar postscript viewer. To make a hard copy of these graphs, pipe the output of jgraph --P directly to -\fIlpr.\fB +\-P directly to +\fIlpr\fR. .SH USING JGRAPH TO DRAW PICTURES As hypercube.jgr and alb.jgr show, jgraph can be used as a postscript preprocessor to make drawings. There are two advantages using jgraph to draw pictures instead of using standard drawing tools like -\fIxfig\fB, -\fIfigtool\fB, +\fIxfig\fR, +\fIfigtool\fR, or -\fIidraw\fB. +\fIidraw\fR. The first is that with jgraph, you know exactly where strings, lines, boxes, etc, will end up, because you plot them explicitly. The second -advantage is that for iterative drawings, with lots of patters, you +advantage is that for iterative drawings, with lots of patterns, you can combine jgraph with awk or c or any other programming language -to get complex output in a simple way. Most what-you-see-is-what-you-get -(WYSIWYG) drawing tools cannot do this. +to get complex output in a simple way. Most +what\-you\-see\-is\-what\-you\-get (WYSIWYG) drawing tools cannot do this. The major disadvantage of using jgraph to draw pictures is that jgraph is not WYSIWYG. You have to set up axes and plot points, lines and strings. It's all a matter of taste. If you'd like to see some more complex pictures drawn with jgraph, as -well as some hints to make picture-drawing easier, send me email -(jsp@princeton.edu). +well as some hints to make picture\-drawing easier, send me email +(plank@cs.utk.edu). -.SH EMBEDDING THE OUTPUT IN LATEX -I haven't read the manuals, but the way I've been loading these files -into LaTeX has been as follows: -.PP +.SH SUPPORT FOR OTHER FONT ENCODINGS +If you want to use non\-english characters to set labels or titles, +set enviroment variable JGRAPH_ENCODING with the font encoding that +you need. This value will be passed directly to the postscript. + +Ex. to use ISO\-8859\-1 characters, try: .nf -1. Toward the beginning of my LaTeX file, I've had ``\\input{psfig}'' -2. Where I've wanted my file, I've put: - \\begin{figure} - \\centerline{\\psfig{figure=/}} - \\end{figure} + export JGRAPH_ENCODING=ISOLatin1Encoding - Some versions of dvips or dvi2ps work without the path-name. Others - require that the path-name be present. +.fi +Note: that only works with default fonts. if you use 'font' in stdin +to specify another font, it won't work. -3. After running latex on the file, do +You also have the possibility to expand the bounding box if jgraph +cuts some acute, tilde or special chars near the border; try: +.nf - lpr -d file.dvi + export JGRAPH_BORDER=5 -4. If that doesn't work, try dvips-ing the file and printing the postscript. +.fi +This support is currently 'testing' code. Send bugs about it +to pzn@debian.org + +.SH INTEGRATION WITH LATEX +.PP +.nf +1. At the top, say + \\usepackage{graphics} +2. The floating object is done using: + + \\begin{figure} + \\begin{center} + \\includegraphics{a.eps} + \\end{center} + \\end{figure} + +3. Now go through dvips as usual and the .ps file will work. .fi .PP +.SH INTEGRATION WITH PDFLATEX + +If you are using pdflatex, it requires .pdf files and not .eps +files. In that case, you have to run epstopdf on the .eps file to get +a .pdf file. After that, +.br + \\includegraphics{a.pdf} +.br +does the trick. +.SH SCALING THE INCLUDED GRAPHICS OBJECT +Sometimes you need to change the size of the included object at LaTeX +time. In that case, you need +.br + \\usepackage{graphicx} +.br +instead of graphics, and then say something like + + \\includegraphics[width=7cm]{a.eps} + or + \\includegraphics[height=7cm]{a.eps} + +you can also omit the .eps/.pdf suffix: + \\includegraphics[height=7cm]{a} + +a.eps and a.pdf can both exist, and includegraphics will automatically +choose the correct one for postscript or pdf output, depending if you +are using latex of pdflatex. + +.SH AUTOMATION USING MAKE +You can automate the mapping from .jgr -> .eps or .jgr -> .pdf +in your Makefile using these rules: +.nf + +--------- cut here --------- +%.eps : %.jgr + jgraph $< > $@ +%.pdf : %.jgr + jgraph $< | epstopdf \-\-filter > $@ +--------- cut here --------- +.fi + +jgraph can also return the exit status correctly, so it is also a good +idea to use it in your scripts to prevent bad .eps files if the .jgr +source is bad. The following Makefile can handle its exit status. +.nf + +--------- cut here --------- +%.eps : %.jgr + jgraph $< > $@; \\ + if [ "$$?" != "0" ]; then \\ + rm \-f $@; \\ + exit 1; \\ + fi +%.pdf : %.jgr + TMP=`tempfile`; jgraph $< > $${TMP}; \\ + if [ "$$?" == "0" ]; then \\ + cat $${TMP} | epstopdf \-\-filter > $@; \\ + rm \-f $${TMP}; \\ + else \\ + rm \-f $${TMP} $@; \\ + exit 1; \\ + fi; +--------- cut here --------- +.fi + .SH BUGS Logarithmic axes cannot contain points <= 0. If I have enough complaints to convince me that this is a bug, I'll try to fix it. .sp There is no real way to make the axes such that they decrease from -left to right or low to high -- or at least not without writing your +left to right or low to high \-\- or at least not without writing your own hash labels. .sp -There may well be loads of other bugs. Send to jsp@princeton.edu. +There may well be loads of other bugs. Send to plank@cs.utk.edu. .sp This is $Revision: 8.3 $. --- jgraph-83.orig/jgraph.c +++ jgraph-83/jgraph.c @@ -5,12 +5,6 @@ * $Author: jsp $ */ -#include - -#ifdef VMS -#include -#endif - #include "jgraph.h" int NMARKTYPES = 17; @@ -29,7 +23,7 @@ char *PATTERNS[] = { "solid", "stripe", "estripe" }; char PTYPES[] = { 's', '/', 'e' }; -Label new_label() +Label new_label(void) { Label l; int i; @@ -49,14 +43,12 @@ } -Curve new_curve(c, num) -Curve c; -int num; +Curve new_curve(Curve c, int num) { Curve new_c; int i; - new_c = (Curve) get_node(c); + new_c = (Curve) get_node((List)c); new_c->num = num; new_c->l = new_label(); new_c->l->vj = 't'; @@ -101,13 +93,11 @@ new_c->postscript = CNULL; new_c->postfile = 0; new_c->eps = CNULL; - prio_insert(new_c, c, 0); + prio_insert((Prio_list)new_c, (Prio_list)c, 0); return new_c; } -Curve new_line(c, num) -Curve c; -int num; +Curve new_line(Curve c, int num) { Curve new_c; new_c = new_curve(c, num); @@ -117,9 +107,7 @@ } -Curve get_curve(c, num) -Curve c; -int num; +Curve get_curve(Curve c, int num) { Curve new_c; for(new_c = last(c); new_c != nil(c) && new_c->num > num; new_c = prev(new_c)); @@ -127,8 +115,7 @@ return new_c; } -Axis new_axis(is_x) -int is_x; +Axis new_axis(int is_x) { int i; Axis a; @@ -185,7 +172,7 @@ return a; } -Legend new_legend() +Legend new_legend(void) { Legend l; l = (Legend) malloc (sizeof(struct legend)); @@ -202,7 +189,7 @@ return l; } -Label new_title() +Label new_title(void) { Label t; @@ -216,22 +203,18 @@ return t; } -String new_string(s, num) -String s; -int num; +String new_string(String s, int num) { String new_s; - new_s = (String) get_node(s); + new_s = (String) get_node((List)s); new_s->num = num; new_s->s = new_label(); - prio_insert(new_s, s, 0); + prio_insert((Prio_list)new_s, (Prio_list)s, 0); return new_s; } -String get_string(s, num) -String s; -int num; +String get_string(String s, int num) { String new_s; for(new_s = last(s); new_s != nil(s) && new_s->num > num; new_s = prev(new_s)); @@ -259,13 +242,11 @@ } */ -Graph new_graph(gs, num) -Graph gs; -int num; +Graph new_graph(Graph gs, int num) { Graph g; - g = (Graph) get_node(gs); + g = (Graph) get_node((List)gs); g->num = num; g->xminval = 0.0; g->yminval = 0.0; @@ -282,13 +263,11 @@ g->border = 0; g->legend = new_legend(); /* g->def = new_default(); */ - prio_insert(g, gs, 0); + prio_insert((Prio_list)g, (Prio_list)gs, 0); return g; } -Graph get_graph(g, num) -Graph g; -int num; +Graph get_graph(Graph g, int num) { Graph new_g; for(new_g = last(g); new_g != nil(g) && new_g->num > num; new_g = prev(new_g)); @@ -296,12 +275,11 @@ return new_g; } -new_graphs(gs) -Graphs gs; +void new_graphs(Graphs gs) { Graphs newg; - newg = (Graphs) get_node(gs); + newg = (Graphs) get_node((List)gs); newg->g = (Graph) make_list(sizeof(struct graph)); newg->height = 0.0; newg->width = 0.0; @@ -312,12 +290,10 @@ newg->prefile = 0; newg->epifile = 0; if (first(gs) == nil(gs)) newg->page = 1; else newg->page = last(gs)->page+1; - insert(newg, gs); + insert((List)newg, (List)gs); } -main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { Graphs gs; int i; @@ -326,9 +302,6 @@ int comments; int nfiles; -#ifdef VMS - IOSTREAM = stdin; /* for token.c -hdd */ -#endif show = 0; pp = 0; comments = 0; --- jgraph-83.orig/jgraph.h +++ jgraph-83/jgraph.h @@ -1,3 +1,6 @@ +#ifndef _JGRAPH_H +#define _JGRAPH_H + /* * $Source: /tmp_mnt/n/fs/grad1/jsp/src/jgraph/RCS/jgraph.h,v $ * $Revision: 8.3 $ @@ -5,11 +8,13 @@ * $Author: jsp $ */ +#include +#include +#include +#include + #include "list.h" #include "prio_list.h" -#ifdef LCC -#include -#endif #define PPI 120 #define FPPI 120.0 @@ -22,6 +27,8 @@ #define HASH_SIZE 5.0 #define MHASH_SIZE 2.0 +typedef int Boolean; + typedef struct point { struct point *flink; struct point *blink; @@ -214,25 +221,25 @@ int page; } *Graphs; -extern float ctop(); -extern float disttop(); -extern float intop(); -extern float ptoc(); -extern float ptodist(); +extern float ctop(float val, Axis axis); +extern float disttop(float val, Axis axis); +extern float intop(float val); +extern float ptoc(float p, Axis a); +extern float ptodist(float p, Axis a); -extern char *getlabel(); -extern char *getmultiline(); +extern char *getlabel(void); +extern char *getmultiline(void); /* Stuff defined in jgraph.c */ -extern Curve new_line(); -extern Curve new_curve(); -extern Curve get_curve(); -extern Graph new_graph(); -extern Graph get_graph(); -extern String new_string(); -extern String get_string(); -extern Label new_label(); +extern Curve new_line(Curve c, int num); +extern Curve new_curve(Curve c, int num); +extern Curve get_curve(Curve c, int num); +extern Graph new_graph(Graph gs, int num); +extern Graph get_graph(Graph g, int num); +extern String new_string(String s, int num); +extern String get_string(String s, int num); +extern Label new_label(void); extern char *MARKTYPESTRS[]; extern char MARKTYPES[]; extern int NMARKTYPES; @@ -240,3 +247,7 @@ extern char *PATTERNS[]; extern char PTYPES[]; extern int NPATTERNS; + +#include "general.h" + +#endif --- jgraph-83.orig/jmalloc.c +++ jgraph-83/jmalloc.c @@ -1,4 +1,3 @@ -#include #include /* Each memory block has 8 extra 32-bit values associated with it. If malloc --- jgraph-83.orig/list.c +++ jgraph-83/list.c @@ -5,7 +5,7 @@ * $Author: jsp $ */ -#include /* Basic includes and definitions */ +#include "jgraph.h" #include "list.h" #define boolean int @@ -32,9 +32,7 @@ List free_list; } *Int_list; -insert(item, list) /* Inserts to the end of a list */ -List item; -List list; +void insert(List item, List list) /* Inserts to the end of a list */ { List last_node; @@ -46,15 +44,14 @@ item->flink = list; } -delete_item(item) /* Deletes an arbitrary iterm */ -List item; +void delete_item(List item) /* Deletes an arbitrary iterm */ { item->flink->blink = item->blink; item->blink->flink = item->flink; } -List make_list(size) /* Creates a new list */ -int size; +List make_list(int size) /* Creates a new list */ + { Int_list l; @@ -67,8 +64,8 @@ return (List) l; } -List get_node(list) /* Allocates a node to be inserted into the list */ -List list; +List get_node(List list) /* Allocates a node to be inserted into the list */ + { Int_list l; List to_return; @@ -83,9 +80,7 @@ } } -free_node(node, list) /* Deallocates a node from the list */ -List node; -List list; +void free_node(List node, List list) /* Deallocates a node from the list */ { Int_list l; --- jgraph-83.orig/list.h +++ jgraph-83/list.h @@ -1,3 +1,6 @@ +#ifndef _LIST_H +#define _LIST_H + /* * $Source: /tmp_mnt/n/fs/grad1/jsp/src/jgraph/RCS/list.h,v $ * $Revision: 8.3 $ @@ -31,3 +34,4 @@ /* List get_node(list); Allocates a node to be inserted into the list */ /* void free_node(node, list); Deallocates a node from the list */ +#endif --- jgraph-83.orig/makefile +++ jgraph-83/makefile @@ -10,7 +10,6 @@ OBJS = draw.o \ edit.o \ - jgraph.o \ list.o \ printline.o \ prio_list.o \ @@ -42,6 +41,7 @@ tree2.jps \ wortman.jps +LOADLIBES = -lm all: jgraph @@ -57,12 +57,12 @@ .tex.dvi: latex $*.tex -.c.o: - $(CC) -c -g $*.c +#.c.o: +# $(CC) -c -g $*.c jgraph: $(OBJS) - $(CC) -g $(OBJS) -lm -o jgraph +# $(CC) -g $(OBJS) -lm -o jgraph sin: sin.o cc -o sin sin.o -lm @@ -75,10 +75,10 @@ sin2.jps: sin2.pts sin3.jps: sin3.pts tree1.jps: tree.awk - ( echo "4 3" | nawk -f tree.awk ; echo "xaxis size 5.4" ) | \ + ( echo "4 3" | awk -f tree.awk ; echo "xaxis size 5.4" ) | \ jgraph -P > tree1.jps tree2.jps: tree.awk - ( echo "5 2" | nawk -f tree.awk ; echo "xaxis size 5.4" ) | \ + ( echo "5 2" | awk -f tree.awk ; echo "xaxis size 5.4" ) | \ jgraph -P > tree2.jps @@ -93,4 +93,4 @@ show.o: show.c jgraph.h list.h prio_list.h token.o: token.c list.h clean: - rm -f *.o a.out *.jps + rm -f *.o a.out *.jps jgraph --- jgraph-83.orig/printline.c +++ jgraph-83/printline.c @@ -6,7 +6,7 @@ */ #include "jgraph.h" -#include +#include #define LINEWIDTHFACTOR 0.700 #define MAX(a, b) ((a > b) ? (a) : (b)) @@ -23,7 +23,7 @@ static int Jgraph_gsave_level = -100; static int Jgraph_comment; -gsave() +void gsave(void) { if (Jgraph_gsave_level == -100) { Jgraph_gsave_level = 0; @@ -33,24 +33,22 @@ printf(" gsave "); } -grestore() +void grestore(void) { Fontlist l; if (last(Jgraph_fonts) != nil(Jgraph_fonts)) { l = last(Jgraph_fonts); if (l->level == Jgraph_gsave_level) { - delete_item(l); - free_node(l, Jgraph_fonts); + delete_item((List)l); + free_node((List)l, (List)Jgraph_fonts); } } Jgraph_gsave_level--; printf(" grestore "); } -setfont(f, s) -char *f; -float s; +void setfont(char *f, float s) { Fontlist l; int ins; @@ -59,26 +57,23 @@ l = last(Jgraph_fonts); ins = (strcmp(l->f, f) != 0 || s != l->s); if (ins) { - delete_item(l); - free_node(l, Jgraph_fonts); + delete_item((List)l); + free_node((List)l, (List)Jgraph_fonts); } } else { ins = 1; } if (ins) { - l = (Fontlist) get_node(Jgraph_fonts); + l = (Fontlist) get_node((List)Jgraph_fonts); l->level = Jgraph_gsave_level; l->s = s; l->f = f; - insert(l, Jgraph_fonts); + insert((List)l, (List)Jgraph_fonts); printf("/%s findfont %f scalefont setfont\n", f, s); } } -setfill( x, y, t, f, p, a) -char t, p ; -float x, y; -float f[], a ; +void setfill(float x, float y, char t, float *f, char p, float a) { /* fprintf(stderr, "Hello? %c %f %c %f\n", t, f[0], p, a); */ if (t == 'g' && f[0] < 0.0) return; @@ -100,9 +95,7 @@ printf(" grestore\n"); } -setgray( t, f) -char t ; -float f[] ; +void setgray(char t, float *f) { if ( t == 'g' ) { if( f[0] >= 0.0 ) printf("%f setgray\n", f[0] ); @@ -111,9 +104,7 @@ } } -printline(x1, y1,x2, y2, orientation) -float x1, y1, x2, y2; -char orientation; +void printline(float x1, float y1, float x2, float y2, char orientation) { if (orientation == 'x') printf("newpath %f %f moveto %f %f lineto stroke\n", x1, y1, x2, y2); @@ -122,67 +113,53 @@ fflush(stdout); } -print_ebar(x1, y1, x2, ms, orientation) -float x1, y1, x2, ms; -char orientation; +void print_ebar(float x1, float y1, float x2, float ms, char orientation) { printline(x1, y1, x2, y1, orientation); printline(x2, y1-ms, x2, y1+ms, orientation); } -start_line(x1, y1, c) -float x1, y1; -Curve c; +void start_line(float x1, float y1, Curve c) { setlinewidth(c->linethick); setlinestyle(c->linetype, c->gen_linetype); printf("%f %f moveto ", x1, y1); } -cont_line(x1, y1) -float x1, y1; +void cont_line(float x1, float y1) { printf(" %f %f lineto\n", x1, y1); } -end_line() +void end_line(void) { printf("stroke\n"); setlinewidth(1.0); setlinestyle('s', (Flist) 0); fflush(stdout); - } -bezier_control(x1, y1) -float x1, y1; +void bezier_control(float x1, float y1) { printf(" %f %f ", x1, y1); } -bezier_end(x1, y1) -float x1, y1; +void bezier_end(float x1, float y1) { printf(" %f %f curveto\n", x1, y1); } - -start_poly(x1, y1) -float x1, y1; +void start_poly(float x1, float y1) { printf(" newpath %f %f moveto", x1, y1); } -cont_poly(x1, y1) -float x1, y1; +void cont_poly(float x1, float y1) { printf(" %f %f lineto\n", x1, y1); } -end_poly(x, y, ftype, fill, pattern, parg) -float x, y; -char ftype, pattern ; -float fill[], parg; +void end_poly(float x, float y, char ftype, float *fill, char pattern, float parg) { printf("closepath "); setfill( x, y, ftype, fill, pattern, parg ); @@ -192,9 +169,7 @@ /* Ellipse at 0, 0 -- assumes that you've already translated to x, y */ -printellipse(x, y, radius1, radius2, ftype, fill, pattern, parg) -char ftype, pattern; -float x, y, radius1, radius2, fill[], parg; +void printellipse(float x, float y, float radius1, float radius2, char ftype, float *fill, char pattern, float parg) { printf("newpath %f %f JDE\n", radius1, radius2); setfill( x, y, ftype, fill, pattern, parg ); @@ -202,32 +177,28 @@ fflush(stdout); } -set_comment(c) -int c; +void set_comment(int c) { Jgraph_comment = c; } -comment(s) -char *s; +void comment(char *s) { if (Jgraph_comment) printf("%% %s\n", s); } -printline_c(x1, y1, x2, y2, g) -float x1, y1, x2, y2; -Graph g; +void printline_c(float x1, float y1, float x2, float y2, Graph g) { printline(ctop(x1, g->x_axis), ctop(y1, g->y_axis), ctop(x2, g->x_axis), ctop(y2, g->y_axis), 'x'); } -print_label(l) -Label l; +void print_label(Label l) { int f, i, nlines; float fnl; char *s; + unsigned char *s_7bit; /* added by pzn@debian.org */ if (l->label == CNULL) return; @@ -266,8 +237,31 @@ } s = l->label; + for (i = 0; i <= nlines; i++) { - printf("(%s) dup stringwidth pop ", s); + /* BEGIN added by pzn@debian.org + * converts 8bit ascii chars to octal value; + * 7bit are not converted */ + { + int i, j=0, len; + len=strlen(s); + s_7bit=malloc(len*4+1); + assert(s_7bit!=NULL); + for (i=0; i<=len; i++) { + if((unsigned char)s[i]<128) { + /* char is ascii 7bit */ + s_7bit[j]=s[i]; + j++; + } else { + /* char must be converted to octal */ + sprintf(s_7bit+j,"\\%03o",(unsigned char)s[i]); + j+=4; + } + } + s_7bit[j-1]=0; + } + printf("(%s) dup stringwidth pop ", s_7bit); free(s_7bit); + /* END added by pzn */ if (l->hj == 'c') { printf("2 div neg 0 moveto\n"); } else if (l->hj == 'r') { @@ -290,15 +284,12 @@ printf("grestore\n"); } -setlinewidth(size) -float size; +void setlinewidth(float size) { printf("%f setlinewidth ", size * LINEWIDTHFACTOR); } -setlinestyle(style, glist) -char style; -Flist glist; +void setlinestyle(char style, Flist glist) { Flist fl; --- jgraph-83.orig/prio_list.c +++ jgraph-83/prio_list.c @@ -5,30 +5,15 @@ * $Author: jsp $ */ +#include "jgraph.h" #include "list.h" #include "prio_list.h" -#include - -typedef int Boolean; - -/* A prioirity list is any list with the first three fields being flink, - * blink and prio. Use the routines of list.c to do everything except - * insertion */ - -typedef struct prio_list { - struct prio_list *flink; - struct prio_list *blink; - int prio; -} *Prio_list; /* Prio_insert inserts nodes into their proper places in priority lists. It first * checks for inserting into the head or tail, and then proceeds sequentially. * Thus, it is worst case linear, but for most cases constant time (right). */ -prio_insert(node, list, desc) -Prio_list node; -Prio_list list; -Boolean desc; +void prio_insert(Prio_list node, Prio_list list, Boolean desc) { Prio_list p; --- jgraph-83.orig/prio_list.h +++ jgraph-83/prio_list.h @@ -1,3 +1,6 @@ +#ifndef _PRIO_LIST_H +#define _PRIO_LIST_H + /* * $Source: /tmp_mnt/n/fs/grad1/jsp/src/jgraph/RCS/prio_list.h,v $ * $Revision: 8.3 $ @@ -5,24 +8,14 @@ * $Author: jsp $ */ -/* Priority lists are just like normal lists of list.h and list.c, except - * that their third field is a (int) prioriy. The routines of list.c should all - * be used except for insert, because it will always put an item at the - * end of a list. Instead, use prio_insert, which will put the item - * into its proper place in the list. The last argument of prio_insert should - * be TRUE if the list is to be kept in descending order; it should be FALSE - * for ascending order. - - * Priority list should be: - -struct prio_list { +/* A prioirity list is any list with the first three fields being flink, + * blink and prio. Use the routines of list.c to do everything except + * insertion */ + +typedef struct prio_list { struct prio_list *flink; struct prio_list *blink; int prio; - ... - } - -*/ - -/* void prio_insert(node, list, descending); */ +} *Prio_list; +#endif --- jgraph-83.orig/process.c +++ jgraph-83/process.c @@ -5,7 +5,6 @@ * $Author: jsp $ */ -#include #include #include "jgraph.h" @@ -18,8 +17,7 @@ static double Pi; -process_title(g) -Graph g; +void process_title(Graph g) { float ytitleloc; @@ -43,8 +41,7 @@ process_label(g->title, g, 0); } -process_legend(g) -Graph g; +void process_legend(Graph g) { Legend l; int anything; @@ -208,8 +205,7 @@ process_label_max_n_mins(l->l, width, height); } -float find_reasonable_hash_interval(a) -Axis a; +float find_reasonable_hash_interval(Axis a) { float s, d; @@ -237,8 +233,7 @@ } } -float find_reasonable_hash_start(a) -Axis a; +float find_reasonable_hash_start(Axis a) { int i; @@ -248,8 +243,7 @@ return ((float) i) * a->hash_interval; } -int find_reasonable_precision(a) -Axis a; +int find_reasonable_precision(Axis a) { int i, b, b2, done; float x, x2, tolerance; @@ -292,8 +286,7 @@ return MAX(b, b2); } -int find_reasonable_minor_hashes(a) -Axis a; +int find_reasonable_minor_hashes(Axis a) { float d; int i; @@ -315,9 +308,7 @@ } } -process_axis1(a, g) -Axis a; -Graph g; +void process_axis1(Axis a, Graph g) { float tmp; int i; @@ -385,9 +376,7 @@ } } -process_axis2(a, g) -Axis a; -Graph g; +void process_axis2(Axis a, Graph g) { float t1, t2, t3, minor_hashes, hloc, tmp; float ymin, ymax, xmin, xmax; @@ -431,13 +420,13 @@ while (t1 <= a->max) { hloc = ctop(t1, a); if (hloc > -.05 && hloc < a->psize + .05) { - h = (Hash) get_node(a->hash_lines); + h = (Hash) get_node((List)a->hash_lines); h->loc = hloc; h->size = HASH_SIZE; h->major = 1; - insert(h, a->hash_lines); + insert((List)h, (List)a->hash_lines); if (a->auto_hash_labels) { - s = (String) get_node (a->hash_labels); + s = (String) get_node ((List)a->hash_labels); s->s = new_label(); s->s->x = hloc; s->s->y = hloc; @@ -461,7 +450,7 @@ default: fprintf(stderr, "Internal jgraph error: hl_st\n"); exit(1); } - insert(s, a->hash_labels); + insert((List)s, (List)a->hash_labels); } } minor_hashes = t2 / ((float) (a->minor_hashes + 1)); @@ -470,11 +459,11 @@ t3 += minor_hashes; hloc = ctop(t3, a); if (hloc > -.05 && hloc < a->psize + .05) { - h = (Hash) get_node(a->hash_lines); + h = (Hash) get_node((List)a->hash_lines); h->loc = hloc; h->size = MHASH_SIZE; h->major = 0; - insert(h, a->hash_lines); + insert((List)h, (List)a->hash_lines); } } if (a->is_lg) { @@ -575,10 +564,7 @@ process_label (a->label, g, 0); } -process_label(l, g, adjust) -Label l; -Graph g; -int adjust; +void process_label(Label l, Graph g, int adjust) { float len, height; int f, i; @@ -617,10 +603,7 @@ process_label_max_n_mins(l, len, height); } -process_label_max_n_mins(l, len, height) -Label l; -float len; -float height; +void process_label_max_n_mins(Label l, float len, float height) { float xlen, ylen, xheight, yheight; float x, y; @@ -666,8 +649,7 @@ } -process_strings(g) -Graph g; +void process_strings(Graph g) { String s; @@ -676,9 +658,7 @@ } } -process_curve(c, g) -Curve c; -Graph g; +void process_curve(Curve c, Graph g) { if (c->bezier && (c->npts < 4 || (c->npts % 3 != 1))) { error_header(); @@ -704,8 +684,7 @@ if (c->pparg == FSIG) c->pparg = 0.0; } -process_curves(g) -Graph g; +void process_curves(Graph g) { Curve c; for(c = first(g->curves); c != nil(g->curves); c = next(c)) { @@ -713,8 +692,7 @@ } } -process_extrema(g) /* This finds all the minval/maxvals for bbox calc */ -Graph g; +void process_extrema(Graph g) /* This finds all the minval/maxvals for bbox calc */ { Curve c; String s; @@ -763,9 +741,7 @@ } } -process_label_extrema(l, g) -Label l; -Graph g; +void process_label_extrema(Label l, Graph g) { if (l->label == CNULL) return; g->yminval = MIN(g->yminval, l->ymin); @@ -774,8 +750,7 @@ g->xmaxval = MAX(g->xmaxval, l->xmax); } -process_graph(g) -Graph g; +void process_graph(Graph g) { g->x_translate = intop(g->x_translate); g->y_translate = intop(g->y_translate); @@ -790,8 +765,7 @@ process_extrema(g); } -process_graphs(gs) -Graphs gs; +void process_graphs(Graphs gs) { Graphs the_g; Graph g; --- jgraph-83.orig/show.c +++ jgraph-83/show.c @@ -5,25 +5,20 @@ * $Author: jsp $ */ -#include #include #include "jgraph.h" -static spaces(nsp) -int nsp; +static void spaces(int nsp) { while(nsp-- > 0) putchar(' '); } -float ptoin(p) -float p; +float ptoin(float p) { return p / FCPI; } -float ptoc(p, a) -float p; -Axis a; +float ptoc(float p, Axis a) { if (a->is_lg) { return (float) exp((p / a->factor + a->logmin) * a->logfactor); @@ -32,9 +27,7 @@ } } -float ptodist(p, a) -float p; -Axis a; +float ptodist(float p, Axis a) { if (a->is_lg) { return p / FCPI; @@ -43,8 +36,7 @@ } } -static show_mltiline(s) -char *s; +static void show_mltiline(char *s) { int i; @@ -57,8 +49,7 @@ putchar('\n'); } -show_string(s) -char *s; +void show_string(char *s) { int i; @@ -74,10 +65,7 @@ } -show_label(l, nsp, g) -Label l; -int nsp; -Graph g; +void show_label(Label l, int nsp, Graph g) { spaces(nsp); show_string(l->label); @@ -98,10 +86,7 @@ return; } -show_lmark(l, nsp, g) -Label l; -int nsp; -Graph g; +void show_lmark(Label l, int nsp, Graph g) { spaces(nsp); show_string(l->label); spaces(nsp); printf("x %f ", ptodist(l->x, g->x_axis)); @@ -113,10 +98,7 @@ return; } -show_curve(c, nsp, g) -Curve c; -int nsp; -Graph g; +void show_curve(Curve c, int nsp, Graph g) { Point p; Point px; @@ -251,10 +233,7 @@ ptodist(c->asize[1], g->y_axis) * 2.0); } -show_axis(a, nsp, g) -Axis a; -int nsp; -Graph g; +void show_axis(Axis a, int nsp, Graph g) { Axis other; Hash h; @@ -342,10 +321,7 @@ } } -show_legend(l, nsp, g) -Legend l; -int nsp; -Graph g; +void show_legend(Legend l, int nsp, Graph g) { if (l->type == 'c') { spaces(nsp); printf("custom\n"); @@ -362,9 +338,7 @@ } } -show_graph(g, nsp) -Graph g; -int nsp; +void show_graph(Graph g, int nsp) { Curve c; @@ -394,8 +368,7 @@ } } -show_graphs(gs) -Graphs gs; +void show_graphs(Graphs gs) { Graphs the_g; Graph g; --- jgraph-83.orig/sin.c +++ jgraph-83/sin.c @@ -1,6 +1,6 @@ #include - main() - { + main(void) +{ double x; for (x = -10.0; x < 10.0; x += .03) printf("%f %f\n", x, sin(x)); --- jgraph-83.orig/sin2.c +++ jgraph-83/sin2.c @@ -1,6 +1,6 @@ #include - main() - { + main(void) +{ double x; for (x = 0.1; x < 100.0; x += .03) printf("%f %f\n", x, sin(x)); --- jgraph-83.orig/token.c +++ jgraph-83/token.c @@ -5,18 +5,7 @@ * $Author: jsp $ */ -#include -#include - -#ifdef LCC -#include -#endif - -#ifdef VMS -#include -#include -#endif - +#include "jgraph.h" #include "list.h" #define CNULL ((char *)0) @@ -35,7 +24,7 @@ static char INPUT[1000]; static int getnew = 1; static char oldchar = '\0'; -static oldcharvalid = 0; +static int oldcharvalid = 0; static char pipe = 0; static int eof = 0; static int init = 0; @@ -46,24 +35,8 @@ static char FILENAME[300]; static int line = 1; -#ifdef VMS -/* On VMS, there are no popen() and pclose(), so we provide dummies here. */ -FILE *popen(command, type) -char *command, *type; -{ - return(NULL); -} -int pclose(stream) -FILE *stream; -{ - return(-1); -} -#endif /*VMS*/ - -set_input_file(s) -char *s; +void set_input_file(char *s) { - FILE *f; Iostack n; if (init == 0) { @@ -81,7 +54,7 @@ } init = 1; } else { - n = (Iostack) get_node(stack); + n = (Iostack) get_node((List)stack); n->stream = NULL; n->filename = (char *) malloc (sizeof(char)*(strlen(s)+2)); strcpy(n->filename, s); @@ -89,16 +62,16 @@ n->oldcharvalid = oldcharvalid; n->pipe = pipe; n->line = line; - insert(n, stack->flink); + insert((List)n, (List)stack->flink); } } -error_header() +void error_header(void) { fprintf(stderr, "%s,%d: ", FILENAME, line); } -int gettokenchar() +int gettokenchar(void) { if (oldcharvalid == 0) oldchar = getc(IOSTREAM); oldcharvalid = 0; @@ -106,14 +79,13 @@ return oldchar; } -ungettokenchar() +void ungettokenchar(void) { oldcharvalid = 1; if (oldchar == '\n') line--; } -int gettoken(s) -char *s; +int gettoken(char *s) { int i; char c; @@ -131,7 +103,7 @@ return i; } -get_comment() +void get_comment(void) { if (eof) return; while (1) { @@ -143,17 +115,16 @@ } } -static int iostackempty() +static int iostackempty(void) { return (first(stack) == nil(stack)); } -static push_iostack(p) -int p; +static void push_iostack(int p) { Iostack n; - n = (Iostack) get_node(stack); + n = (Iostack) get_node((List)stack); n->stream = IOSTREAM; n->filename = (char *) malloc (sizeof(char)*(strlen(FILENAME)+2)); n->oldchar = oldchar; @@ -161,7 +132,7 @@ n->pipe = pipe; n->line = line; strcpy(n->filename, FILENAME); - insert(n, stack); + insert((List)n, (List)stack); if (p) { IOSTREAM = (FILE *) popen(INPUT, "r"); } else { @@ -177,7 +148,7 @@ strcpy(FILENAME, INPUT); } -static pop_iostack() +static void pop_iostack(void) { Iostack n; @@ -195,7 +166,7 @@ if (n->stream == NULL) { n->stream = fopen(n->filename, "r"); if (n->stream == NULL) { - fprintf(stderr, "Error: cannot open file \"%s\"\n", n->stream); + fprintf(stderr, "Error: cannot open file \"%s\"\n", n->filename); exit(1); } } @@ -206,11 +177,11 @@ line = n->line; oldchar = n->oldchar; oldcharvalid = n->oldcharvalid; - delete_item(n); - free_node(n, stack); + delete_item((List)n); + free_node((List)n, (List)stack); } -static nexttoken() +static void nexttoken(void) { if (eof) return; if (getnew) { @@ -234,10 +205,6 @@ push_iostack(0); } } else if (strcmp(INPUT, "shell") == 0) { -#ifdef VMS - fprintf(stderr, "No shell option on VMS, sorry.\n"); - exit(1); -#endif /*VMS*/ if (gettoken(INPUT) == 0 || strcmp(INPUT, ":") != 0) { error_header(); fprintf(stderr, "'shell' must be followed by ':'\n"); @@ -258,8 +225,7 @@ return; } -int getstring(s) -char *s; +int getstring(char *s) { nexttoken(); if (eof) return 0; @@ -267,8 +233,7 @@ return 1; } -int getint(i) -int *i; +int getint(int *i) { int j; @@ -282,8 +247,7 @@ return 1; } -int getfloat(f) -float *f; +int getfloat(float *f) { int j; @@ -304,8 +268,7 @@ } else return 1; } -static char *new_printable_text(s) -char *s; +static char *new_printable_text(char *s) { char *new_s; int to_pad, i, j; @@ -331,11 +294,11 @@ return new_s; } -char *getmultiline() +char *getmultiline(void) { char c; - int i, j, done, len, started; - char *out_str; + int i, done, len=0, started; + char *out_str = NULL; if (getnew == 0) return CNULL; @@ -372,11 +335,9 @@ return out_str; } -char *getlabel() +char *getlabel(void) { - char c; char *txt, *new; - int i; txt = getmultiline(); if (txt == CNULL) return CNULL; @@ -385,7 +346,7 @@ return new; } -int getsystemstring() +int getsystemstring(void) { char c; int i; @@ -415,7 +376,7 @@ return 1; } -rejecttoken() +void rejecttoken(void) { getnew = 0; }