home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / gnuplot / part29 < prev    next >
Encoding:
Text File  |  1993-10-29  |  80.5 KB  |  3,009 lines

  1. Newsgroups: comp.sources.misc
  2. From: woo@playfair.stanford.edu ("Alexander Woo")
  3. Subject: v40i041:  gnuplot - interactive function plotting utility, Part29/33
  4. Message-ID: <1993Oct25.030433.2748@sparky.sterling.com>
  5. X-Md4-Signature: c8c49411d30f19cf65d0bf96fa2aa418
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Mon, 25 Oct 1993 03:04:33 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: woo@playfair.stanford.edu ("Alexander Woo")
  12. Posting-number: Volume 40, Issue 41
  13. Archive-name: gnuplot/part29
  14. Environment: UNIX, MS-DOS, VMS
  15. Supersedes: gnuplot3: Volume 24, Issue 23-48
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  gnuplot/README.3p4 gnuplot/README.mf
  22. #   gnuplot/demo/airfoil.dem gnuplot/demo/singulr.dem
  23. #   gnuplot/docs/lasergnu.1 gnuplot/docs/makefile gnuplot/eval.c
  24. #   gnuplot/gnubin.c gnuplot/lasergnu gnuplot/makefile.286
  25. #   gnuplot/os2/gnupmdrv.h gnuplot/term/cgi.trm
  26. #   gnuplot/term/emxvga.trm gnuplot/term/gnugraph.trm
  27. #   gnuplot/term/gpic.trm gnuplot/term/t410x.trm
  28. # Wrapped by kent@sparky on Wed Oct 20 17:15:04 1993
  29. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  30. echo If this archive is complete, you will see the following message:
  31. echo '          "shar: End of archive 29 (of 33)."'
  32. if test -f 'gnuplot/README.3p4' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'gnuplot/README.3p4'\"
  34. else
  35.   echo shar: Extracting \"'gnuplot/README.3p4'\" \(5153 characters\)
  36.   sed "s/^X//" >'gnuplot/README.3p4' <<'END_OF_FILE'
  37. XThis version of gnuplot represents the work of many people.  For a more
  38. Xcomplete list read the RCS log on the top of makefile.unx.  This version
  39. Xoriginally was centered on Jos Van Woude's probability functions,
  40. XDon Tabor's discrete contour levels and Rob Cunningham's binary file
  41. XIO capability.  It has grown tremendously.  Russell Lang and Maurice
  42. XCastro added MS-Windows capability and much more.  Roger Fearick
  43. Xadded OS/2 capabilility.  Alexander Lehmann and Hans-Edgar Koechling
  44. Xgreatly improved Atari support. (There are also an OS-9 and PC-9801 versions
  45. Xof 3.2 and a Mac version of 3.0 and a multiple plot on a page mod
  46. Xwhich were not integrated into this release.)  Eric Youngdale replaced the
  47. Xexplicit function hidden line removal routines with a more general
  48. Ximplicit bitmap (which requires more memory).  Gershon Elber fixed
  49. Xmany 3D bugs and added the "dgrid3d" option which takes allows
  50. Xscattered data to be contoured.  Ed Kubaitis reworked the X11 support.
  51. XIn addition, many more devices are now provided.  We have
  52. Xalways added device drivers because we have no way to debug most of
  53. Xthem and only by including them into the package we obtain feedback.
  54. X
  55. XIn addition, we have begun a contrib subdirectory which contains
  56. Xexternal library, programs, and mods which help in the use of
  57. XGnuplot.  Many of the diffs are now out of date and will take
  58. Xsome work to implement.
  59. X
  60. XThese contributions are not in any particular order.
  61. X
  62. X* Subject: Special Functions for Probability Densities
  63. X  Name: Jos van der Woude
  64. X  Email: jvdwoude@hut.nl
  65. X
  66. X* Subject: Discrete Contour Levels
  67. X  Name: Don Taber
  68. X  Email: news@solitary.stanford.edu,dbt@victoria.risc.rockwell.com
  69. X
  70. X* Subject: LN03p (Graphic Enhance Mode) Driver and REGIS fixes
  71. X  Name: Hung-chi Lihn
  72. X  Email: lihn@ssrl01.slac.stanford.edu
  73. X
  74. X* Subject: LESS-like additions to READLINE capability
  75. X  Name:    Michal Tomczak, Tom Tkacik
  76. X  Email: ntomczak@vm.ucs.ualberta.ca,tkacik@hobbes.cs.gmr.com
  77. X
  78. X* Subject: doc2texinfo : Converts Gnuplot .doc files to Texinfo format.
  79. X  Name: George Ferguson
  80. X  Email: ferguson@cs.rochester.edu
  81. X
  82. X* Subject: Atari ST (gcc 1.40) version  and PureC version
  83. X  Name: Alexander Lehmann, Hans-Edgar Koechling
  84. X  Email: alexlehm@iti.informatik.th-darmstadt.de,
  85. X        koechling@nvdv.e-technik.uni-stuttgart.dpe.de
  86. X
  87. X* Subject: ISO 8869/1 character sets
  88. X  Name: Marius Olafsson
  89. X  Email: marius@rhi.hi.is
  90. X
  91. X* Subject: HP PaintJet Driver
  92. X  Name: Dan Merget
  93. X  Email: danm@hpnmdlc0.sr.hp.com
  94. X
  95. X* Subject: Improvements to HP PCL driver
  96. X  Name: Timothy Collins, Tom Swiler, Alex Woo
  97. X  Email: kaph6@solx1.central.susx.ac.uk,tom@silica.mse.ufl.edu
  98. X
  99. X* Subject: plot "file" thru f(x) for transforming datafiles
  100. X  Name: Jack Veenstra
  101. X  Email: veenstra@cs.rochester.edu
  102. X
  103. X* Subject: improvement to HPGL driver
  104. X  Name: Craig Johnston
  105. X  Email: johnston@maxwell.ee.washington.edu
  106. X
  107. X* Subject: X11 mods
  108. X  Name: Ed Kubaitis, Yehavi Bourvine
  109. X  Email: ejk@ux2.ncsa.uiuc.edu, YEHAVI@vms.huji.ac.il
  110. X
  111. X* Subject: Binary File IO
  112. X  Name: Rob Cunningham, Jos van der Woude
  113. X  Email: rkc@xn.ll.mit.edu,jvdwoude@hut.nl
  114. X
  115. X* Subject: Improved Hidden Line Removal & LITE flag
  116. X  Name: Eric Youngdale
  117. X  Email: eric@tantalus.nrl.navy.mil
  118. X
  119. X* Subject: xlib driver & test programs in contrib
  120. X  Name: Gregg Hanna
  121. X  Email: gregor@kafka.saic.com
  122. X
  123. X* Subject: MS-Windows, boxes and boxerror styles, plot using accepts
  124. X           columns in any order, plus many, many improvements
  125. X  Name: Russell Lang, Maurice Castro
  126. X  Email: rjl@monu1.cc.monash.edu.au, maurice@bruce.cs.monash.edu.au
  127. X
  128. X* Subject: OS/2 version
  129. X  Name: Roger Fearick
  130. X  Email: fearick@physci.uct.ac.za
  131. X
  132. X* Subject: scatter to grid mods "set dgrid3d", plus fixes
  133. X  Name: Gershon Elber scatter to grid mods
  134. X  Email: gershon@cs.utah.edu
  135. X
  136. X* Subject: Notitle option to remove entry in key
  137. X  Name: R. Shouman
  138. X  Email: rshouman@hermes.chpc.utexas.edu
  139. X
  140. X* Subject: Misc. Bug Fixes, new get_data, many improvements
  141. X  Name: Daniel S. Lewart
  142. X  Email: d-lewart@uiuc.edu
  143. X
  144. X
  145. X* Subject: H Olav Eggestad RGIP Uniplex driver (POSIX) and Imagen driver
  146. X  Name: Hans Olav Eggestad
  147. X  Email: olav@jordforsk.nlh.no
  148. X
  149. X* Subject: New plotstyle "steps" for discrete functions
  150. X  Name: John Grosh
  151. X  Email: jgrosh@brl.mil
  152. X
  153. X
  154. X* Subject: CorelDraw! driver (subset of EPS)
  155. X  Name: Chris Parks
  156. X  Email: parks@physics.purdue.edu
  157. X
  158. X* Subject: PSTRICKS  driver (for TeX)
  159. X  Name: Ray Toy
  160. X  Email: toy@soho.crd.ge.com
  161. X
  162. X* Subject: Framemaker MIF 3.0 driver
  163. X  Name: Olof Franksson
  164. X  Email: olof@ikaros.fysik4.kth.se
  165. X
  166. X* Subject: Apollo mods
  167. X  Name:  Jim Richardson
  168. X  Email: jimr@maths.su.oz.au
  169. X
  170. X* Subject: TGIF driver
  171. X  Name: Neal Holtz
  172. X  Email: nholtz@civeng.carleton.ca
  173. X
  174. X* Subject: TPIC specials driver (TeX)
  175. X  Name: Honoo Suzuki
  176. X  Email: honoo@nc.titech.ac.jp
  177. X
  178. X* Subject: Log to any base capability
  179. X  Name: Lawrence Crowl
  180. X  Email: crowl@cs.orst.edu
  181. X
  182. X* Subject: Talaris EXCL driver
  183. X  Name: P. Klosowski
  184. X  Email: przemek@rrdstrad.nist.gov
  185. X
  186. X* Subject: New LaTeX Driver
  187. X  Name: Xiaoguang Zhang
  188. X  Email: zhang@whbws.ms.ornl.gov
  189. X
  190. X* Subject: TeXdraw driver (eepic derivative)
  191. X  Name: Khun Yee Fung
  192. X  Email: clipper@csd.uwo.ca
  193. X
  194. X* Subject: debug and hp2623a driver, fixes
  195. X  Name: Bruce Lueckenoff
  196. X  Email: luecken@udel.edu
  197. END_OF_FILE
  198.   if test 5153 -ne `wc -c <'gnuplot/README.3p4'`; then
  199.     echo shar: \"'gnuplot/README.3p4'\" unpacked with wrong size!
  200.   fi
  201.   # end of 'gnuplot/README.3p4'
  202. fi
  203. if test -f 'gnuplot/README.mf' -a "${1}" != "-c" ; then 
  204.   echo shar: Will not clobber existing file \"'gnuplot/README.mf'\"
  205. else
  206.   echo shar: Extracting \"'gnuplot/README.mf'\" \(4322 characters\)
  207.   sed "s/^X//" >'gnuplot/README.mf' <<'END_OF_FILE'
  208. XMetaFont Terminal Driver for GnuPlot (MF.TRM):
  209. X----------------------------------------------
  210. XThe new terminal driver creates a input file to the MetaFont program.
  211. XThus a figure may be used in the TeX document in the same way as a
  212. Xcharacter is.
  213. X
  214. XTo use the plot in a document the MetaFont program must be run
  215. Xwith the output file from GnuPlot as input. Thus, the user needs a basic
  216. Xknowledge of the font creating prosess and inclusion of a new font in a
  217. Xdocument. However, if the Metafont program are set up properly at the
  218. Xlocal site an unexperienced user could perform the operation without
  219. Xmuch trouble.
  220. X
  221. XThe text support is based on a MetaFont character set.
  222. XCurrently the Computer Modern Roman font set is input but the
  223. Xuser are in principal free to chose whatever fonts he/she needs.
  224. XThe MetaFont source files for the chosen font must be available.
  225. XEach character is stored in a separate picture variable in MetaFont. These
  226. Xvariables may be manipulated (rotated, scaled etc.) when characters are
  227. Xneeded. The drawback is the interpretation time in the MetaFont
  228. Xprogram. On some machines (i.e. PC) the limited amount of memory available
  229. Xmay also cause problem if too many pictures are stored.
  230. X
  231. XThe MetaFont terminal driver MF.TRM is UENCODED and included in this mail.
  232. XAlso the "diff" files between an orginal TERM.C and mine are
  233. XUENCODED included. I am afraid there may be several
  234. Xdifferences which are not due to the MetaFont terminal. However, the new
  235. Xterminal driver should be included in exactly the same manner as the other.
  236. X
  237. XIn TERM.H the only necessary change is :
  238. X
  239. X               #define MF
  240. X
  241. XPlease inform me if something  goes wrong. I will then transfer the code
  242. Xto an anonymous FTP cite where you can pick it up.
  243. X
  244. XTo use the MetaFont terminal driver:
  245. X------------------------------------
  246. X1) In GnuPlot use:   set terminal mf
  247. X                     set output "myfile.mf"
  248. X                          .
  249. X                          .
  250. X                          .
  251. X                     plot ....
  252. X                     exit
  253. X
  254. X
  255. X2) Run MetaFont. Syntax is site dependant:
  256. X
  257. X   On my UNIX I use:   cmmf '\mode=localfont; \mag=1;' input myfile.mf
  258. X   On my PC I use:     mf286 &cm \mode=localfont; \mag=1; input myfile.mf
  259. X
  260. X   Be aware that MetaFont can only handle number less than 4096. Thus if you
  261. X
  262. X   have very high resolution in your localfont and a large picture you will
  263. X   probably get an error message when running metaFont. To solve the
  264. Xproblem,
  265. X   reduce the resolution or the plot size.
  266. X
  267. X3) Run GfToPk, syntax is
  268. X
  269. X   on my UNIX:   gftpk myfile.xxxgf myfile.pk
  270. X   on my PC:     gftpk myfile.xxx myfile.pk
  271. X
  272. X   where xxx is the resolution (typically 300).
  273. X
  274. X   The version of GfToPk included with unix TeX3.14 probably needs to be
  275. X   compiled with more memory than it is. Third line in GFTOPK.C declares
  276. X   a variable "maxrow". Defining this to 32000 should be sufficient.
  277. X
  278. X4) Copy the files myfile.pk and myfile.tfm to a place where you are sure TeX
  279. X   and the dvi processing programs you use  can find them. (They can
  280. Xprobably
  281. X   be located in your current working directory)
  282. X
  283. X5) Include in your TeX document the following statement:
  284. X
  285. X      \font\myfont=myfile  % Declares the new font you just have made
  286. X      {\myfont\char0}      % Typeset character with code zero which
  287. X                           % MF.TRM uses as default character
  288. X
  289. X
  290. X
  291. X
  292. X
  293. XHPGL to GnuPlot converter (HPG2GNU):
  294. X-------------------------------------
  295. XI have also written a program which interprets files written in
  296. XHewlett Packard's plotter language, HPGL, and outputs the graphic
  297. Xon an available GnuPlot terminal.
  298. X
  299. XPersonally, I have used the program as an link to the MetaFont terminal
  300. X(the orginal version of the program only translated from HPGL to MF).
  301. XThis way I am able to design pictures in my favorite graphic drawing
  302. Xprogram,
  303. Xexport the figures to HPGL files and translate to MetaFont. A lot of new
  304. Xsymbols (fancy arrows, electronic components, process symbols etc. etc.)
  305. Xcan thus be  made available to TeX as new font sets without the need to dig
  306. Xinto the MetaFont manual.
  307. X
  308. XHowever, the program is now mainly based on code from the GnuPlot
  309. Xprogram and according to the copyright notes should not be distributed.
  310. X
  311. X
  312. XWith regard
  313. X
  314. XPaal Hedne
  315. XSINTEF Multiphase Laboratory
  316. XN-7034 Trondheim
  317. XNorway
  318. X
  319. XTel.: -47-7-591060
  320. XE.mail: Pal.Hedne@termo.unit.no
  321. END_OF_FILE
  322.   if test 4322 -ne `wc -c <'gnuplot/README.mf'`; then
  323.     echo shar: \"'gnuplot/README.mf'\" unpacked with wrong size!
  324.   fi
  325.   # end of 'gnuplot/README.mf'
  326. fi
  327. if test -f 'gnuplot/demo/airfoil.dem' -a "${1}" != "-c" ; then 
  328.   echo shar: Will not clobber existing file \"'gnuplot/demo/airfoil.dem'\"
  329. else
  330.   echo shar: Extracting \"'gnuplot/demo/airfoil.dem'\" \(4833 characters\)
  331.   sed "s/^X//" >'gnuplot/demo/airfoil.dem' <<'END_OF_FILE'
  332. X#
  333. X# $Id: airfoil.dem%v 3.38.2.45 1993/01/11 04:09:41 woo Exp woo $
  334. X#
  335. X# This demo shows how to use bezier splines to define NACA four
  336. X# series airfoils and complex variables to define Joukowski
  337. X# Airfoils.  It will be expanded after overplotting in implemented
  338. X# to plot Coefficient of Pressure as well.
  339. X#        Alex Woo, Dec. 1992
  340. X#
  341. X# The definitions below follows: "Bezier presentation of airfoils",
  342. X# by Wolfgang Boehm, Computer Aided Geometric Design 4 (1987) pp 17-22.
  343. X#
  344. X#                Gershon Elber, Nov. 1992
  345. X#
  346. X# m = percent camber
  347. X# p = percent chord with maximum camber
  348. Xpause 0  "NACA four series airfoils by bezier splines"
  349. Xpause 0  "Will add pressure distribution later with Overplotting"
  350. Xmm = 0.6
  351. X# NACA6xxx
  352. Xthick = 0.09  
  353. X# nine percent  NACAxx09
  354. Xpp = 0.4
  355. X# NACAx4xx
  356. X# Combined this implies NACA6409 airfoil
  357. X#
  358. X# Airfoil thickness function.
  359. X#
  360. Xset xlabel "NACA6409 -- 9% thick, 40% max camber, 6% camber"
  361. Xx0 = 0.0
  362. Xy0 = 0.0
  363. Xx1 = 0.0
  364. Xy1 = 0.18556
  365. Xx2 = 0.03571
  366. Xy2 = 0.34863
  367. Xx3 = 0.10714
  368. Xy3 = 0.48919
  369. Xx4 = 0.21429 
  370. Xy4 = 0.58214
  371. Xx5 = 0.35714
  372. Xy5 = 0.55724
  373. Xx6 = 0.53571
  374. Xy6 = 0.44992
  375. Xx7 = 0.75000
  376. Xy7 = 0.30281
  377. Xx8 = 1.00000
  378. Xy8 = 0.01050
  379. X#
  380. X# Directly defining the order 8 Bezier basis function for a faster evaluation.
  381. X#
  382. Xbez_d4_i0(x) =     (1 - x)**4
  383. Xbez_d4_i1(x) = 4 * (1 - x)**3 * x
  384. Xbez_d4_i2(x) = 6 * (1 - x)**2 * x**2
  385. Xbez_d4_i3(x) = 4 * (1 - x)**1 * x**3
  386. Xbez_d4_i4(x) =                  x**4
  387. X
  388. Xbez_d8_i0(x) =      (1 - x)**8
  389. Xbez_d8_i1(x) =  8 * (1 - x)**7 * x
  390. Xbez_d8_i2(x) = 28 * (1 - x)**6 * x**2
  391. Xbez_d8_i3(x) = 56 * (1 - x)**5 * x**3
  392. Xbez_d8_i4(x) = 70 * (1 - x)**4 * x**4
  393. Xbez_d8_i5(x) = 56 * (1 - x)**3 * x**5
  394. Xbez_d8_i6(x) = 28 * (1 - x)**2 * x**6
  395. Xbez_d8_i7(x) =  8 * (1 - x)    * x**7
  396. Xbez_d8_i8(x) =                   x**8
  397. X
  398. X
  399. Xm0 = 0.0
  400. Xm1 = 0.1
  401. Xm2 = 0.1
  402. Xm3 = 0.1
  403. Xm4 = 0.0
  404. Xmean_y(t) = m0 * mm * bez_d4_i0(t) + \
  405. X        m1 * mm * bez_d4_i1(t) + \
  406. X        m2 * mm * bez_d4_i2(t) + \
  407. X        m3 * mm * bez_d4_i3(t) + \
  408. X        m4 * mm * bez_d4_i4(t)
  409. X
  410. Xp0 = 0.0
  411. Xp1 = pp / 2
  412. Xp2 = pp
  413. Xp3 = (pp + 1) / 2
  414. Xp4 = 1.0
  415. Xmean_x(t) = p0 * bez_d4_i0(t) + \
  416. X        p1 * bez_d4_i1(t) + \
  417. X        p2 * bez_d4_i2(t) + \
  418. X        p3 * bez_d4_i3(t) + \
  419. X        p4 * bez_d4_i4(t)
  420. X
  421. Xz_x(x) = x0 * bez_d8_i0(x) + x1 * bez_d8_i1(x) + x2 * bez_d8_i2(x) + \
  422. X     x3 * bez_d8_i3(x) + x4 * bez_d8_i4(x) + x5 * bez_d8_i5(x) + \
  423. X     x6 * bez_d8_i6(x) + x7 * bez_d8_i7(x) + x8 * bez_d8_i8(x)
  424. X
  425. Xz_y(x, tk) = \
  426. X   y0 * tk * bez_d8_i0(x) + y1 * tk * bez_d8_i1(x) + y2 * tk * bez_d8_i2(x) + \
  427. X   y3 * tk * bez_d8_i3(x) + y4 * tk * bez_d8_i4(x) + y5 * tk * bez_d8_i5(x) + \
  428. X   y6 * tk * bez_d8_i6(x) + y7 * tk * bez_d8_i7(x) + y8 * tk * bez_d8_i8(x)
  429. X
  430. X#
  431. X# Given t value between zero and one, the airfoild curve is defined as
  432. X# 
  433. X#            c(t) = mean(t1(t)) +/- z(t2(t)) n(t1(t)),
  434. X#
  435. X# where n is the unit normal to the mean line. See the above paper for more.
  436. X#
  437. X# Unfortunately, the parametrization of c(t) is not the same for mean(t1)
  438. X# and z(t2). The mean line (and its normal) can assume linear function t1 = t,
  439. X#                                                     -1
  440. X# but the thickness z_y is, in fact, a function of z_x  (t). Since it is
  441. X# not obvious how to compute this inverse function analytically, we instead
  442. X# replace t in c(t) equation above by z_x(t) to get:
  443. X# 
  444. X#            c(z_x(t)) = mean(z_x(t)) +/- z(t) n(z_x(t)),
  445. X#
  446. X# and compute and display this instead. Note we also ignore n(t) and assumes
  447. X# n(t) is constant in the y direction,
  448. X#
  449. X
  450. Xairfoil_y1(t, thick) = mean_y(z_x(t)) + z_y(t, thick)
  451. Xairfoil_y2(t, thick) = mean_y(z_x(t)) - z_y(t, thick)
  452. Xairfoil_y(t) = mean_y(z_x(t))
  453. Xairfoil_x(t) = mean_x(z_x(t))
  454. Xset nogrid
  455. Xset nozero
  456. Xset parametric
  457. Xset xrange [-0.1:1.1]
  458. Xset yrange [-0.1:.7]
  459. Xset trange [ 0.0:1.0]
  460. Xset title "NACA6409 Airfoil"
  461. Xplot airfoil_x(t), airfoil_y(t) title "mean line" w l 2, \
  462. X     airfoil_x(t), airfoil_y1(t, thick) title "upper surface" w l 1, \
  463. X     airfoil_x(t), airfoil_y2(t, thick) title "lower surface" w l 1
  464. Xpause -1 "Press Return"
  465. Xmm = 0.0
  466. Xpp = .5
  467. Xthick = .12
  468. Xset title "NACA0012 Airfoil"
  469. Xset xlabel "12% thick, no camber -- classical test case"
  470. Xplot airfoil_x(t), airfoil_y(t) title "mean line" w l 2, \
  471. X     airfoil_x(t), airfoil_y1(t, thick) title "upper surface" w l 1, \
  472. X     airfoil_x(t), airfoil_y2(t, thick) title "lower surface" w l 1
  473. Xpause -1 "Press Return"
  474. Xset title ""
  475. Xset xlab ""
  476. Xset key
  477. Xset parametric
  478. Xset samples 100
  479. Xset isosamples 10
  480. Xset data style lines
  481. Xset function style lines
  482. Xpause 0  "Joukowski Airfoil using Complex Variables" 
  483. Xset title "Joukowski Airfoil using Complex Variables" 0,0
  484. Xset time
  485. Xset yrange [-.2 : 1.8]
  486. Xset trange [0: 2*pi]
  487. Xset xrange [-.6:.6]
  488. Xzeta(t) = -eps + (a+eps)*exp(t*{0,1})
  489. Xeta(t) = zeta(t) + a*a/zeta(t)
  490. Xeps = 0.06
  491. Xa =.250
  492. Xset xlabel "eps = 0.06 real"
  493. Xplot real(eta(t)),imag(eta(t))
  494. Xpause -1 "Press Return"
  495. Xeps = 0.06*{1,-1}
  496. Xset xlabel "eps = 0.06 + i0.06"
  497. Xplot real(eta(t)),imag(eta(t))
  498. Xpause -1 "Press Return"
  499. Xset title ""
  500. Xset xlabel ""
  501. X
  502. X
  503. END_OF_FILE
  504.   if test 4833 -ne `wc -c <'gnuplot/demo/airfoil.dem'`; then
  505.     echo shar: \"'gnuplot/demo/airfoil.dem'\" unpacked with wrong size!
  506.   fi
  507.   # end of 'gnuplot/demo/airfoil.dem'
  508. fi
  509. if test -f 'gnuplot/demo/singulr.dem' -a "${1}" != "-c" ; then 
  510.   echo shar: Will not clobber existing file \"'gnuplot/demo/singulr.dem'\"
  511. else
  512.   echo shar: Extracting \"'gnuplot/demo/singulr.dem'\" \(4183 characters\)
  513.   sed "s/^X//" >'gnuplot/demo/singulr.dem' <<'END_OF_FILE'
  514. X# $Id: singulr.dem%v 3.38.2.97 1993/03/16 15:07:24 woo Exp woo $
  515. X#
  516. X# Demo that plots some surfaces with singularities.
  517. X# Author: Carsten Steger
  518. X#
  519. X# (x,y,x^2-y^2,2xy) is the graph of w=z^2 in 4-space.
  520. X# Therefore (x^2-y^2,2xy,x,y) is the graph of w=sqrt(z) in 4-space.
  521. X# Coordinates 1, 2, and 3 give the real part of either function,
  522. X# whereas coordinates 1, 2, and 4 give the imaginary part.
  523. X# The same holds for the cube function w=z^3. The graphs are given by
  524. X# (x,y,x^3-3xy^2,3x^2y-y^3) and (x^3-3xy^2,3x^2y-y^3,x,y).
  525. X# And so on...
  526. X
  527. X
  528. Xset parametric
  529. Xset hidden3d
  530. Xset isosamples 21
  531. Xset autoscale
  532. X
  533. X
  534. Xset view 60,30
  535. Xset urange [-3:3]
  536. Xset vrange [-3:3]
  537. Xset title "Real part of complex square root function"
  538. Xsplot u**2-v**2,2*u*v,u
  539. Xpause -1 "Hit return to continue (1)"
  540. X
  541. X
  542. Xset view 60,210
  543. Xset title "Real part of complex square root function (different view)"
  544. Xreplot
  545. Xpause -1 "Hit return to continue (2)"
  546. X
  547. X
  548. Xset view 60,120
  549. Xset urange [-3:3]
  550. Xset vrange [-3:3]
  551. Xset title "Imaginary part of complex square root function"
  552. Xsplot u**2-v**2,2*u*v,v
  553. Xpause -1 "Hit return to continue (3)"
  554. X
  555. X
  556. Xset view 60,300
  557. Xset title "Imaginary part of complex square root function (different view)"
  558. Xreplot
  559. Xpause -1 "Hit return to continue (4)"
  560. X
  561. X
  562. Xset view 60,30
  563. Xset urange [-3:3]
  564. Xset vrange [-3:3]
  565. Xset title "Real part of complex cube root function"
  566. Xsplot u**3-3*u*v**2,3*u**2*v-v**3,u
  567. Xpause -1 "Hit return to continue (5)"
  568. X
  569. X
  570. Xset view 60,210
  571. Xset title "Real part of complex cube root function (different view)"
  572. Xreplot
  573. Xpause -1 "Hit return to continue (6)"
  574. X
  575. X
  576. Xset view 60,30
  577. Xset urange [-3:3]
  578. Xset vrange [-3:3]
  579. Xset title "Imaginary part of complex cube root function"
  580. Xsplot u**3-3*u*v**2,3*u**2*v-v**3,v
  581. Xpause -1 "Hit return to continue (7)"
  582. X
  583. X
  584. Xset view 60,210
  585. Xset title "Imaginary part of complex cube root function (different view)"
  586. Xreplot
  587. Xpause -1 "Hit return to continue (8)" 
  588. X
  589. X
  590. Xset view 60,30
  591. Xset isosamples 31
  592. Xset urange [-1:1]
  593. Xset vrange [-1:1]
  594. Xset title "Real part of complex 4th root function"
  595. Xsplot u**4-6*u**2*v**2+v**4,4*u**3*v-4*u*v**3,u
  596. Xpause -1 "Hit return to continue (9)"
  597. X
  598. X
  599. Xset view 60,210
  600. Xset title "Real part of complex 4th root function (different view)"
  601. Xreplot
  602. Xpause -1 "Hit return to continue (10)"
  603. X
  604. X
  605. Xset view 60,120
  606. Xset urange [-1:1]
  607. Xset vrange [-1:1]
  608. Xset title "Imaginary part of complex 4th root function"
  609. Xsplot u**4-6*u**2*v**2+v**4,4*u**3*v-4*u*v**3,v
  610. Xpause -1 "Hit return to continue (11)"
  611. X
  612. X
  613. Xset view 60,300
  614. Xset title "Imaginary part of complex 4th root function (different view)"
  615. Xreplot
  616. Xpause -1 "Hit return to continue (12)"
  617. X
  618. X
  619. Xset isosamples 21
  620. Xset view 60,20
  621. Xset urange [-3:3]
  622. Xset vrange [-3:3]
  623. Xset title "Enneper's surface"
  624. Xsplot u-u**3/3+u*v**2,v-v**3/3+v*u**2,u**2-v**2
  625. Xpause -1 "Hit return to continue (13)"
  626. X
  627. X
  628. Xset view 60,110
  629. Xset title "Enneper's surface (different view)"
  630. Xreplot
  631. Xpause -1 "Hit return to continue (14)"
  632. X
  633. X
  634. Xset isosamples 31,11
  635. Xset view 60,30
  636. Xset title "Moebius strip"
  637. Xset urange [0:2*pi]
  638. Xset vrange [-0.25:0.25]
  639. Xsplot (2-v*sin(u/2))*sin(u),(2-v*sin(u/2))*cos(u),v*cos(u/2)
  640. Xpause -1 "Hit return to continue (15)"
  641. X
  642. X
  643. Xset view 60,210
  644. Xset title "Moebius strip (view from opposite side)"
  645. Xreplot
  646. Xpause -1 "Hit return to continue (16)"
  647. X
  648. Xset nokey
  649. Xset xrange [-10:10]
  650. Xset yrange [-10:10]
  651. Xset zrange [-3:3]
  652. Xset urange [0:2*pi]
  653. Xset vrange [0:2*pi]
  654. Xset isosamples 39,60
  655. Xset view 60,120
  656. Xset title "Klein bottle"
  657. Xsplot  (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*cos(v), \
  658. X       (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*sin(v), \
  659. X        2*sin(u)*sin(v/2)+sin(2*u)*cos(v/2)
  660. Xpause -1 "Hit return to continue (17)"
  661. X
  662. X
  663. Xset urange [0:2*pi]
  664. Xset vrange [0:4*pi/3]
  665. Xset isosamples 39,40
  666. Xset view 60,20
  667. Xset title "Klein bottle with look at the 'inside'"
  668. Xreplot
  669. Xpause -1 "Hit return to continue (18)"
  670. X
  671. Xset data style lines
  672. Xset xrange [-12:12]
  673. Xset yrange [-12:12]
  674. Xset zrange [-1:15]
  675. Xset nohidden3d
  676. Xset view 50,15
  677. Xset title "Klein bottle, glassblowers' version (look-through)"
  678. Xsplot "klein.dat"
  679. Xpause -1 "Hit return to continue (19)"
  680. X
  681. X
  682. Xset hidden3d
  683. Xset view 70,305
  684. Xset title "Klein bottle, glassblowers' version (solid)"
  685. Xsplot "klein.dat"
  686. Xpause -1 "Hit return to continue (20)"
  687. X
  688. X
  689. Xset autoscale
  690. Xset title ""
  691. Xset key
  692. Xset noparametric
  693. Xset nohidden3d
  694. Xset samples 100
  695. Xset isosamples 10
  696. Xset view 60,30
  697. END_OF_FILE
  698.   if test 4183 -ne `wc -c <'gnuplot/demo/singulr.dem'`; then
  699.     echo shar: \"'gnuplot/demo/singulr.dem'\" unpacked with wrong size!
  700.   fi
  701.   # end of 'gnuplot/demo/singulr.dem'
  702. fi
  703. if test -f 'gnuplot/docs/lasergnu.1' -a "${1}" != "-c" ; then 
  704.   echo shar: Will not clobber existing file \"'gnuplot/docs/lasergnu.1'\"
  705. else
  706.   echo shar: Extracting \"'gnuplot/docs/lasergnu.1'\" \(1594 characters\)
  707.   sed "s/^X//" >'gnuplot/docs/lasergnu.1' <<'END_OF_FILE'
  708. X.TH LASERGNU l 
  709. X.SH NAME
  710. Xlasergnu \- send gnuplot output to a printer
  711. X.SH SYNOPSIS
  712. X.B lasergnu
  713. X[ flags ] plot-command...
  714. X.SH DESCRIPTION
  715. X.I lasergnu
  716. Xruns
  717. X.IR gnuplot (1)
  718. Xin an environment to produce typeset output on an IMAGEN  or
  719. XPostscript printer.
  720. X.PP
  721. XThe 
  722. X.B gnuplot
  723. Xcommands
  724. X.B plot-command
  725. Xare performed and the output sent to the printer. 
  726. XIf the 
  727. X.B -f
  728. Xoption specifies a file for input, the plot command is optional. 
  729. XThe command-line plot commands are executed prior to any in the
  730. Xfile(s).
  731. X.PP
  732. XFor example, to plot the function
  733. X.I sin(x)
  734. Xfrom -1 to +1, and to use printer im1, use the command
  735. X.br
  736. X.nf
  737. X    lasergnu -Pim1 'plot [-1:1] sin(x) with lines'
  738. X.fi
  739. XTo execute the gnuplot command file
  740. X.I myplot,
  741. Xon the postscript printer lw0, use the command
  742. X.br
  743. X.nf
  744. X    lasergnu -Plw0 -p -f myplot
  745. X.fi
  746. XThe following switches are recognized:
  747. X.TP
  748. X.BI \-p
  749. XUse the postscript language to make the plot, instead of Impress.
  750. XThis is for use on Postscript printers only. This uses a double-size
  751. Xplot in landscape mode as the default.
  752. X.TP
  753. X.BI \-P\0 printer
  754. XThe output of this program is intended for 
  755. X.I printer.
  756. X\ If the file is being spooled, this determines the printer it is spooled
  757. Xto (default: $LASER).
  758. XBe sure to use the -p flag if the printer is a postscript printer.
  759. X.TP
  760. X.BI \-f\0 file
  761. XTake gnuplot commands from the named file.
  762. XMultiple files  may be supplied with separate -f options.
  763. X.TP
  764. X.BI  \-t\0 title
  765. XSpecify the title of the plot.
  766. X.TP
  767. X.BI \-b
  768. XDo not print a banner page.
  769. X.TP
  770. X.BI \-J
  771. XDo not print a banner page.
  772. X.TP
  773. X.B \-help
  774. XPrints a list of options.
  775. X.SH SEE ALSO
  776. Xgnuplot(l), lpr(1)
  777. END_OF_FILE
  778.   if test 1594 -ne `wc -c <'gnuplot/docs/lasergnu.1'`; then
  779.     echo shar: \"'gnuplot/docs/lasergnu.1'\" unpacked with wrong size!
  780.   fi
  781.   # end of 'gnuplot/docs/lasergnu.1'
  782. fi
  783. if test -f 'gnuplot/docs/makefile' -a "${1}" != "-c" ; then 
  784.   echo shar: Will not clobber existing file \"'gnuplot/docs/makefile'\"
  785. else
  786.   echo shar: Extracting \"'gnuplot/docs/makefile'\" \(4379 characters\)
  787.   sed "s/^X//" >'gnuplot/docs/makefile' <<'END_OF_FILE'
  788. X#
  789. X# $Id: makefile%v 3.38.2.84 1993/03/01 01:36:45 woo Exp woo $
  790. X#
  791. X#
  792. X# Makefile for GNUPLOT documentation
  793. X#
  794. X# Note that the top-level file for documentation is gnuplot.doc.
  795. X# See README.
  796. X#
  797. X# To print manual:
  798. X#    make gnuplot.dvi             (for latex)
  799. X#    (print or view gnuplot.dvi)
  800. X# OR
  801. X#    make gnuplot.nroff           (for nroff)
  802. X#    (print or view gnuplot.nroff)
  803. X#   or
  804. X#    make "TROFF=itroff" troff    (for troff; use your troff here)
  805. X#
  806. X# $Id: makefile%v 3.38.2.84 1993/03/01 01:36:45 woo Exp woo $
  807. X
  808. X# usually overridden by ../Makefile
  809. XHELPDEST = /usr/local/lib
  810. X
  811. X# substitute your troff command (and any flags) for this one
  812. XTROFF=troff
  813. X
  814. X# substitute cp if you do not have the install program
  815. XINSTALL=install
  816. X
  817. X# substitute your DVI to PostScript conversion program here
  818. XDVIPS=dvips
  819. X
  820. X# Compiler flags
  821. X# -DSYSV if att sys V
  822. X# -DMSDOS if MSDOS PS
  823. X# -traditional -g -O if gcc (set 'CC = gcc')
  824. X# no extra flags for BSD
  825. XCFLAGS = -s
  826. XCC = cc
  827. X
  828. X# Default information
  829. Xhelp:
  830. X    @echo "Please do a 'make <TARGET>' where <TARGET> is one of" \
  831. X                "the following:"
  832. X    @echo
  833. X    @echo "check        check the gnuplot.doc file"
  834. X    @echo "clean        remove all derived files"
  835. X    @echo "dvi          DVI files (gnuplot.dvi gpcard.dvi)"
  836. X    @echo "gih          Unix and MSDOS help file (gnuplot.gih)"
  837. X    @echo "help         make help"
  838. X    @echo "hlp          VMS help file (gnuplot.hlp)"
  839. X    @echo "info         Info documentation (gnuplot.info)"
  840. X    @echo "install-unix Unix and MSDOS install"
  841. X    @echo "install-vms  VMS install"
  842. X    @echo "nroff        nroff documentation (gnuplot.nroff)"
  843. X    @echo "ps           PostScript files (gnuplot.ps gpcard.ps)"
  844. X    @echo "tex          LaTeX documentation (gnuplot.tex)"
  845. X    @echo "troff        troff documentation"
  846. X    @echo "tutorial     LaTeX tutorial (latextut/tutorial.dvi)"
  847. X    @echo
  848. X    @echo "If you are not familiar with makefiles or just want" \
  849. X                "to know what"
  850. X    @echo "'make <TARGET>' would do without actually doing" \
  851. X                "anything, then type"
  852. X    @echo "        'make -n <TARGET>'"
  853. X    @echo
  854. X
  855. X# default is what is needed for interactive gnuplot
  856. Xdefault: gnuplot.hlp gnuplot.gih
  857. X
  858. X### [tn]roff documentation
  859. Xtroff: gnuplot.ms titlepag.ms
  860. X    tbl gnuplot.ms | eqn | $(TROFF) -ms
  861. X
  862. Xnroff: gnuplot.nroff
  863. X
  864. Xgnuplot.nroff: gnuplot.ms titlepag.ms
  865. X    tbl gnuplot.ms | neqn | nroff -ms | col > gnuplot.nroff
  866. X
  867. Xms: gnuplot.ms
  868. X
  869. Xgnuplot.ms: doc2ms gnuplot.doc
  870. X    ./doc2ms gnuplot.doc gnuplot.ms
  871. X
  872. Xdoc2ms: doc2ms.c
  873. X    $(CC) $(CFLAGS) -o doc2ms doc2ms.c
  874. X
  875. X### LaTeX documentation
  876. Xtex: gnuplot.tex
  877. X
  878. Xgnuplot.tex: doc2tex gnuplot.doc
  879. X    ./doc2tex gnuplot.doc gnuplot.tex
  880. X
  881. X# this is how to make DVI files
  882. Xdvi: gnuplot.dvi gpcard.dvi
  883. X
  884. Xgnuplot.dvi: gnuplot.tex titlepag.tex toc_entr.sty
  885. X    latex gnuplot
  886. X    latex gnuplot
  887. X
  888. Xgpcard.dvi: gpcard.tex
  889. X    tex gpcard
  890. X
  891. X# this is how to make PostScript files
  892. X# if pslatex has been installed, add "times" to titlepage.tex
  893. Xps: gnuplot.ps gpcard.ps
  894. X
  895. Xgnuplot.ps: gnuplot.dvi
  896. X    $(DVIPS) gnuplot
  897. X
  898. Xgpcard.ps: gpcard.dvi
  899. X    $(DVIPS) gpcard
  900. X
  901. Xdoc2tex: doc2tex.c
  902. X    $(CC) $(CFLAGS) -o doc2tex doc2tex.c
  903. X
  904. X# this is how to make gnuplot.hlp
  905. Xhlp: gnuplot.hlp
  906. X
  907. Xgnuplot.hlp: doc2hlp gnuplot.doc
  908. X    ./doc2hlp gnuplot.doc gnuplot.hlp
  909. X
  910. Xdoc2hlp: doc2hlp.c
  911. X    $(CC) $(CFLAGS) -o doc2hlp doc2hlp.c
  912. X
  913. X# this is how to make gnuplot.gih
  914. Xgih: gnuplot.gih
  915. X
  916. Xgnuplot.gih: doc2gih gnuplot.doc
  917. X    ./doc2gih gnuplot.doc gnuplot.gih
  918. X
  919. Xdoc2gih: doc2gih.c
  920. X    $(CC) $(CFLAGS) -o doc2gih doc2gih.c
  921. X
  922. X# this is how to make Info documentation
  923. Xinfo: gnuplot.info
  924. X
  925. Xgnuplot.info: gnuplot.doc
  926. X    perl doc2info.pl gnuplot.doc > gpltinfo.tex
  927. X    makeinfo +fill-column 80 gpltinfo.tex
  928. X    rm -f gpltinfo.tex
  929. X
  930. Xtutorial: latextut/tutorial.tex
  931. X    ( cd latextut; $(MAKE) )
  932. X
  933. X# this is how to check the gnuplot.doc file
  934. Xcheck: checkdoc gnuplot.doc
  935. X    ./checkdoc < gnuplot.doc
  936. X
  937. Xcheckdoc: checkdoc.c
  938. X    $(CC) $(CFLAGS) -o checkdoc checkdoc.c
  939. X
  940. X# For Unix and MSDOS only
  941. Xinstall-unix: gnuplot.gih
  942. X    $(INSTALL) gnuplot.gih $(HELPDEST)
  943. X
  944. X# for VMS only
  945. Xinstall-vms: gnuplot.hlp
  946. X    $(INSTALL) gnuplot.hlp $(HELPDEST)
  947. X
  948. X# remove all derived files
  949. Xclean:
  950. X    rm -f doc2ms gnuplot.nroff gnuplot.ms \
  951. X              doc2tex gnuplot.tex gnuplot.dvi \
  952. X              gnuplot.aux gnuplot.log gnuplot.toc \
  953. X              gnuplot.ps gpcard.dvi gpcard.log gpcard.ps \
  954. X              doc2hlp gnuplot.hlp \
  955. X              doc2gih gnuplot.gih \
  956. X              checkdoc *~ *.o core a.out \
  957. X              gnuplot.info* gpltinfo.tex
  958. X    ( cd latextut; $(MAKE) clean )
  959. END_OF_FILE
  960.   if test 4379 -ne `wc -c <'gnuplot/docs/makefile'`; then
  961.     echo shar: \"'gnuplot/docs/makefile'\" unpacked with wrong size!
  962.   fi
  963.   # end of 'gnuplot/docs/makefile'
  964. fi
  965. if test -f 'gnuplot/eval.c' -a "${1}" != "-c" ; then 
  966.   echo shar: Will not clobber existing file \"'gnuplot/eval.c'\"
  967. else
  968.   echo shar: Extracting \"'gnuplot/eval.c'\" \(4465 characters\)
  969.   sed "s/^X//" >'gnuplot/eval.c' <<'END_OF_FILE'
  970. X#ifndef lint
  971. Xstatic char *RCSid = "$Id: eval.c%v 3.50 1993/07/09 05:35:24 woo Exp $";
  972. X#endif
  973. X
  974. X
  975. X/* GNUPLOT - eval.c */
  976. X/*
  977. X * Copyright (C) 1986 - 1993   Thomas Williams, Colin Kelley
  978. X *
  979. X * Permission to use, copy, and distribute this software and its
  980. X * documentation for any purpose with or without fee is hereby granted, 
  981. X * provided that the above copyright notice appear in all copies and 
  982. X * that both that copyright notice and this permission notice appear 
  983. X * in supporting documentation.
  984. X *
  985. X * Permission to modify the software is granted, but not the right to
  986. X * distribute the modified code.  Modifications are to be distributed 
  987. X * as patches to released version.
  988. X *  
  989. X * This software is provided "as is" without express or implied warranty.
  990. X * 
  991. X *
  992. X * AUTHORS
  993. X * 
  994. X *   Original Software:
  995. X *     Thomas Williams,  Colin Kelley.
  996. X * 
  997. X *   Gnuplot 2.0 additions:
  998. X *       Russell Lang, Dave Kotz, John Campbell.
  999. X *
  1000. X *   Gnuplot 3.0 additions:
  1001. X *       Gershon Elber and many others.
  1002. X * 
  1003. X * There is a mailing list for gnuplot users. Note, however, that the
  1004. X * newsgroup 
  1005. X *    comp.graphics.gnuplot 
  1006. X * is identical to the mailing list (they
  1007. X * both carry the same set of messages). We prefer that you read the
  1008. X * messages through that newsgroup, to subscribing to the mailing list.
  1009. X * (If you can read that newsgroup, and are already on the mailing list,
  1010. X * please send a message info-gnuplot-request@dartmouth.edu, asking to be
  1011. X * removed from the mailing list.)
  1012. X *
  1013. X * The address for mailing to list members is
  1014. X *       info-gnuplot@dartmouth.edu
  1015. X * and for mailing administrative requests is 
  1016. X *       info-gnuplot-request@dartmouth.edu
  1017. X * The mailing list for bug reports is 
  1018. X *       bug-gnuplot@dartmouth.edu
  1019. X * The list of those interested in beta-test versions is
  1020. X *       info-gnuplot-beta@dartmouth.edu
  1021. X */
  1022. X
  1023. X#include <stdio.h>
  1024. X#include "plot.h"
  1025. X
  1026. Xextern int c_token;
  1027. Xextern struct ft_entry ft[];
  1028. Xextern struct udvt_entry *first_udv;
  1029. Xextern struct udft_entry *first_udf;
  1030. Xextern struct at_type at;
  1031. Xextern struct lexical_unit token[];
  1032. X
  1033. Xstruct value *Ginteger();
  1034. X
  1035. X
  1036. X
  1037. Xstruct udvt_entry *
  1038. Xadd_udv(t_num)  /* find or add value and return pointer */
  1039. Xint t_num;
  1040. X{
  1041. Xregister struct udvt_entry **udv_ptr = &first_udv;
  1042. X
  1043. X    /* check if it's already in the table... */
  1044. X
  1045. X    while (*udv_ptr) {
  1046. X        if (equals(t_num,(*udv_ptr)->udv_name))
  1047. X            return(*udv_ptr);
  1048. X        udv_ptr = &((*udv_ptr)->next_udv);
  1049. X    }
  1050. X
  1051. X    *udv_ptr = (struct udvt_entry *)
  1052. X      alloc((unsigned long)sizeof(struct udvt_entry), "value");
  1053. X    (*udv_ptr)->next_udv = NULL;
  1054. X    copy_str((*udv_ptr)->udv_name,t_num);
  1055. X    (*udv_ptr)->udv_value.type = INTGR;    /* not necessary, but safe! */
  1056. X    (*udv_ptr)->udv_undef = TRUE;
  1057. X    return(*udv_ptr);
  1058. X}
  1059. X
  1060. X
  1061. Xstruct udft_entry *
  1062. Xadd_udf(t_num)  /* find or add function and return pointer */
  1063. Xint t_num; /* index to token[] */
  1064. X{
  1065. Xregister struct udft_entry **udf_ptr = &first_udf;
  1066. X
  1067. X    int i;
  1068. X    while (*udf_ptr) {
  1069. X        if (equals(t_num,(*udf_ptr)->udf_name))
  1070. X            return(*udf_ptr);
  1071. X        udf_ptr = &((*udf_ptr)->next_udf);
  1072. X    }
  1073. X     *udf_ptr = (struct udft_entry *)
  1074. X      alloc((unsigned long)sizeof(struct udft_entry), "function");
  1075. X    (*udf_ptr)->next_udf = (struct udft_entry *) NULL;
  1076. X    (*udf_ptr)->definition = NULL;
  1077. X    (*udf_ptr)->at = NULL;
  1078. X    copy_str((*udf_ptr)->udf_name,t_num);
  1079. X    for(i=0; i<MAX_NUM_VAR; i++)
  1080. X        (void) Ginteger(&((*udf_ptr)->dummy_values[i]), 0);
  1081. X    return(*udf_ptr);
  1082. X}
  1083. X
  1084. X
  1085. Xunion argument *
  1086. Xadd_action(sf_index)
  1087. Xenum operators sf_index;        /* index of p-code function */
  1088. X{
  1089. X    if (at.a_count >= MAX_AT_LEN)
  1090. X        int_error("action table overflow",NO_CARET);
  1091. X    at.actions[at.a_count].index = sf_index;
  1092. X    return(&(at.actions[at.a_count++].arg));
  1093. X}
  1094. X
  1095. X
  1096. Xint standard(t_num)  /* return standard function index or 0 */
  1097. X{
  1098. Xregister int i;
  1099. X    for (i = (int)SF_START; ft[i].f_name != NULL; i++) {
  1100. X        if (equals(t_num,ft[i].f_name))
  1101. X            return(i);
  1102. X    }
  1103. X    return(0);
  1104. X}
  1105. X
  1106. X
  1107. Xexecute_at(at_ptr)
  1108. Xstruct at_type *at_ptr;
  1109. X{
  1110. Xregister int i,index,count,offset;
  1111. X
  1112. X    count = at_ptr->a_count;
  1113. X    for (i = 0; i < count;) {
  1114. X        index = (int)at_ptr->actions[i].index;
  1115. X        offset = (*ft[index].func)(&(at_ptr->actions[i].arg));
  1116. X        if (is_jump(index))
  1117. X            i += offset;
  1118. X        else
  1119. X            i++;
  1120. X    }
  1121. X}
  1122. X
  1123. X/*
  1124. X
  1125. X 'ft' is a table containing C functions within this program. 
  1126. X
  1127. X An 'action_table' contains pointers to these functions and arguments to be
  1128. X passed to them. 
  1129. X
  1130. X at_ptr is a pointer to the action table which must be executed (evaluated)
  1131. X
  1132. X so the iterated line exectues the function indexed by the at_ptr and 
  1133. X passes the address of the argument which is pointed to by the arg_ptr 
  1134. X
  1135. X*/
  1136. END_OF_FILE
  1137.   if test 4465 -ne `wc -c <'gnuplot/eval.c'`; then
  1138.     echo shar: \"'gnuplot/eval.c'\" unpacked with wrong size!
  1139.   fi
  1140.   # end of 'gnuplot/eval.c'
  1141. fi
  1142. if test -f 'gnuplot/gnubin.c' -a "${1}" != "-c" ; then 
  1143.   echo shar: Will not clobber existing file \"'gnuplot/gnubin.c'\"
  1144. else
  1145.   echo shar: Extracting \"'gnuplot/gnubin.c'\" \(4608 characters\)
  1146.   sed "s/^X//" >'gnuplot/gnubin.c' <<'END_OF_FILE'
  1147. X#ifndef lint
  1148. Xstatic char *RCSid = "$Id: gnubin.c%v 3.50 1993/07/09 05:35:24 woo Exp $";
  1149. X#endif
  1150. X
  1151. X
  1152. X/*
  1153. X * The addition of gnu_binary_files and binary_files, along with a small patch
  1154. X * to command.c, will permit gnuplot to plot binary files.
  1155. X * gnu_binary_files  - contains the code that relies on gnuplot include files
  1156. X *                     and other definitions
  1157. X * binary_files      - contains those things that are independent of those 
  1158. X *                     definitions and files
  1159. X *
  1160. X * With these routines, hidden line removal of your binary data is possible!
  1161. X *
  1162. X * Last update: 3/3/92 for Gnuplot 3.24.
  1163. X * Created from code for written by RKC for gnuplot 2.0b.
  1164. X *
  1165. X * 19 September 1992  Lawrence Crowl  (crowl@cs.orst.edu)
  1166. X * Added user-specified bases for log scaling.
  1167. X *
  1168. X * Copyright (c) 1991,1992 Robert K. Cunningham, MIT Lincoln Laboratory
  1169. X *
  1170. X */
  1171. X#include <stdio.h>
  1172. X#include <math.h>
  1173. X#include "plot.h"
  1174. X#include "setshow.h"
  1175. X
  1176. X/******************* SHARED INCLUDE FILE--start ***********************
  1177. X *  I recommend that these be put into an include file that all
  1178. X *  will share -- but I leave it up to the powers that be to do this.
  1179. X */
  1180. X/* Copied from command.c -- this should be put in a shared macro file */
  1181. X#define inrange(z,min,max) ((min<max) ? ((z>=min)&&(z<=max)) : ((z>=max)&&(z<=min)) )
  1182. X
  1183. X/* Routines for interfacing with command.c */
  1184. Xfloat GPFAR *vector();
  1185. Xfloat GPFAR *extend_vector();
  1186. Xfloat GPFAR *retract_vector();
  1187. Xfloat GPFAR * GPFAR *matrix();
  1188. Xfloat GPFAR * GPFAR *extend_matrix();
  1189. Xfloat GPFAR * GPFAR *retract_matrix();
  1190. Xvoid free_matrix();
  1191. Xvoid free_vector();
  1192. X/******************* SHARED INCLUDE FILE--end *************************/
  1193. X/*
  1194. X  Here we keep putting new plots onto the end of the linked list
  1195. X
  1196. X  We assume the data's x,y values have x1<x2, x2<x3... and 
  1197. X                                       y1<y2, y2<y3... .
  1198. X  Actually, I think the assumption is less stron than that--it looks like
  1199. X  the direction just has to be the same.
  1200. X
  1201. X  This routine expects the following to be properly initialized:
  1202. X      is_log_x, is_log_y, and is_log_z 
  1203. X      base_log_x, base_log_y, and base_log_z 
  1204. X      log_base_log_x, log_base_log_y, and log_base_log_z 
  1205. X      xmin,ymin, and zmin
  1206. X      xmax,ymax, and zmax
  1207. X      autoscale_lx, autoscale_ly, and autoscale_lz
  1208. X
  1209. X*/
  1210. Xint
  1211. X  get_binary_data(this_plot,fp,p_ret_iso)
  1212. Xstruct surface_points *this_plot;
  1213. XFILE *fp;
  1214. Xstruct iso_curve **p_ret_iso;
  1215. X{
  1216. X  register int i,j;
  1217. X  float GPFAR * GPFAR *matrix, GPFAR *rt, GPFAR *ct;
  1218. X  int nr,nc;
  1219. X  int ndata;
  1220. X  struct iso_curve *this_iso;
  1221. X  float z;
  1222. X
  1223. X  this_plot->plot_type = DATA3D;
  1224. X  this_plot->has_grid_topology = TRUE;
  1225. X
  1226. X  if(!fread_matrix(fp,&matrix,&nr,&nc,&rt,&ct))
  1227. X    int_error("Binary file read error: format unknown!",NO_CARET);
  1228. X
  1229. X  /* Now we do some error checking on the x and y axis */
  1230. X  if(is_log_x)
  1231. X    for(i=0; i<nc; i++)
  1232. X      if(ct[i] < 0.0)
  1233. X    int_error("X value must be above 0 for log scale!",NO_CARET);
  1234. X      else
  1235. X    ct[i] = log(ct[i])/log_base_log_x;
  1236. X
  1237. X  if(is_log_y)
  1238. X    for(i=0; i<nr; i++)
  1239. X      if(rt[i] < 0.0)
  1240. X    int_error("Y value must be above 0 for log scale!",NO_CARET);
  1241. X      else
  1242. X    rt[i] = log(rt[i])/log_base_log_y;
  1243. X
  1244. X  /* Count up the number of used column entries */
  1245. X  if (autoscale_lx) {
  1246. X    ndata = nc;
  1247. X    for(j=0; j< nc; j++){
  1248. X      if (ct[j] < xmin) xmin = ct[j];
  1249. X      if (ct[j] > xmax) xmax = ct[j];
  1250. X    }
  1251. X  }
  1252. X  else {
  1253. X    for(ndata = 0, j = 0; j< nc; j++){
  1254. X      if (!((ct[j] < xmin) || (ct[j] > xmax)))/*Column is in bounds*/
  1255. X    ndata++;
  1256. X    }
  1257. X  }
  1258. X
  1259. X  for(i=0; i < nr; i++){
  1260. X      if (autoscale_ly) {
  1261. X    if (rt[i] < ymin) ymin = rt[i];
  1262. X    if (rt[i] > ymax) ymax = rt[i];
  1263. X      }
  1264. X      else if ((rt[i] < ymin) || (rt[i] > ymax))/* This row is out of bounds */
  1265. X    continue;
  1266. X
  1267. X      this_iso = iso_alloc( ndata );/*Allocate the correct number of entries*/
  1268. X      for(ndata = 0, j = 0; j< nc; j++){/* Cycle through data */
  1269. X
  1270. X    if ((ct[j] < xmin) || (ct[j] > xmax))/*Column is out of bounds*/
  1271. X      continue;       /* Only affects non-autoscale_lx cases */
  1272. X
  1273. X    this_iso->points[ndata].x = ct[j];
  1274. X    this_iso->points[ndata].y = rt[i];
  1275. X    z = matrix[i][j];
  1276. X    if(is_log_z)
  1277. X      if (z <= 0.0)
  1278. X        int_error("Z value must be above 0 for log scale!",NO_CARET);
  1279. X      else
  1280. X        z = log(z)/log_base_log_z;
  1281. X    this_iso->points[ndata].z = z;
  1282. X      
  1283. X    if (autoscale_lz) {
  1284. X      if (z < zmin) zmin = z;
  1285. X      if (z > zmax) zmax = z;
  1286. X    }
  1287. X    ndata++;
  1288. X      }
  1289. X      this_iso->p_count = ndata;
  1290. X      this_iso->next = this_plot->iso_crvs;
  1291. X      this_plot->iso_crvs = this_iso;
  1292. X      this_plot->num_iso_read++;
  1293. X  }
  1294. X  
  1295. X  free_matrix(matrix,0,nr-1,0,nc-1);
  1296. X  free_vector(rt,0,nr-1);
  1297. X  free_vector(ct,0,nc-1);
  1298. X  *p_ret_iso = this_iso;
  1299. X  return(ndata+1);
  1300. X}
  1301. END_OF_FILE
  1302.   if test 4608 -ne `wc -c <'gnuplot/gnubin.c'`; then
  1303.     echo shar: \"'gnuplot/gnubin.c'\" unpacked with wrong size!
  1304.   fi
  1305.   # end of 'gnuplot/gnubin.c'
  1306. fi
  1307. if test -f 'gnuplot/lasergnu' -a "${1}" != "-c" ; then 
  1308.   echo shar: Will not clobber existing file \"'gnuplot/lasergnu'\"
  1309. else
  1310.   echo shar: Extracting \"'gnuplot/lasergnu'\" \(4511 characters\)
  1311.   sed "s/^X//" >'gnuplot/lasergnu' <<'END_OF_FILE'
  1312. X#!/bin/csh -f
  1313. X#
  1314. X# $Id: lasergnu%v 3.50 1993/07/09 05:35:24 woo Exp $
  1315. X#
  1316. X# Print gnuplot output on an Imagen or Postscript laser printer.
  1317. X
  1318. Xset print_banner = on   # Print a banner page unless told otherwise.
  1319. Xset input_files = ()    # the plot input command files
  1320. Xset lpr_opts = ()       # options to lpr
  1321. X
  1322. X# Default printer set by shell variable PRINTER.
  1323. Xif (! $?PRINTER) then
  1324. X    if ($?LASER) then
  1325. X        set PRINTER=$LASER
  1326. X    else
  1327. X        set PRINTER="lw0"
  1328. X    endif
  1329. Xendif
  1330. Xset printer = (-P$PRINTER)
  1331. X
  1332. X# File for plot commands, and for plot output
  1333. Xset TMP=/tmp/plot$$
  1334. Xset outfile=$TMP.out    # the output file
  1335. Xonintr cleanup
  1336. X
  1337. X# default is Imagen mode for Imagen printer; see -p option
  1338. Xset setterm="set terminal imagen"
  1339. Xset LANG="-Limpress"
  1340. X
  1341. Xset usage="usage: lasergnu [-Pprinter] [-b] [-p] [-t title] [-f file] ['plot command']...."
  1342. X
  1343. X# Loop through the command-line arguments.
  1344. X
  1345. Xtop:
  1346. X    if ($#argv > 0) then
  1347. X
  1348. X        switch ("$argv[1]")
  1349. X
  1350. X        case -b*:   # Do not print a banner page.
  1351. X        case -J*:   # Compatible with imprint.
  1352. X            set print_banner = off
  1353. X                set lpr_opts=($lpr_opts -h)
  1354. X            shift argv
  1355. X            goto top
  1356. X
  1357. X        case -f?*:  # Specify file containing plot commands
  1358. X            set input_files = ($input_files `echo $argv[1] | sed 's/^-f//'`)
  1359. X            shift argv
  1360. X            goto top
  1361. X
  1362. X        case -f:    # Specify file containing plot commands
  1363. X            shift argv
  1364. X            if ($#argv > 0) then
  1365. X                set input_files = ($input_files $argv[1])
  1366. X                shift argv
  1367. X            else
  1368. X                echo "Usage: -f file ..."
  1369. X                echo "Type    lasergnu -help    for help."
  1370. X                exit (1)
  1371. X            endif
  1372. X            goto top
  1373. X
  1374. X        case -t?*:  # Specify title of plot
  1375. X            echo set title \""`echo $argv[1] | sed 's/^-t//'`"\" >> $TMP
  1376. X            shift argv
  1377. X            goto top
  1378. X
  1379. X        case -t:    # Specify title of plot
  1380. X            shift argv
  1381. X            if ($#argv > 0) then
  1382. X                echo set title \""$1"\" >> $TMP
  1383. X                shift argv
  1384. X            else
  1385. X                echo "Usage: -t title ..."
  1386. X                echo "Type    lasergnu -help    for help."
  1387. X                exit (1)
  1388. X            endif
  1389. X            goto top
  1390. X        case -help:
  1391. X            echo "$usage"
  1392. X            exit(1)
  1393. X
  1394. X        case -P?*:  # Set the printer, exactly as by itroff.
  1395. X            set printer = $argv[1]
  1396. X            shift argv
  1397. X            goto top
  1398. X
  1399. X        case -P:    # Set the printer, exactly as by itroff.
  1400. X            shift argv
  1401. X            if ($#argv > 0) then
  1402. X                set printer = (-P$argv[1])
  1403. X                shift argv
  1404. X            else
  1405. X                echo "Usage: -P printer ..."
  1406. X                echo "Type    lasergnu -help    for help."
  1407. X                exit (1)
  1408. X            endif
  1409. X            goto top
  1410. X
  1411. X                # use impress
  1412. X        case -I:
  1413. X             echo Imagen is the default mode now
  1414. X             shift argv
  1415. X             goto top
  1416. X
  1417. X                # use postscript instead of impress language
  1418. X        case -p:
  1419. X             set setterm="set term postscript"
  1420. X             set LANG="-Lpostscript"
  1421. X             shift argv
  1422. X             goto top
  1423. X
  1424. X        case -?*:
  1425. X            echo "I do not recognize option $argv[1]."
  1426. X            echo "$usage"
  1427. X            exit (1)
  1428. X
  1429. X        default:
  1430. X              echo "$argv[1]"   >> $TMP
  1431. X            shift argv
  1432. X            goto top
  1433. X
  1434. X        endsw
  1435. X    endif
  1436. X
  1437. X# try to devine the printer type
  1438. Xif ($printer =~ -Plw*) then
  1439. X    set setterm="set term postscript"
  1440. X    set LANG="-Lpostscript"
  1441. Xendif
  1442. X
  1443. Xif ($printer =~ -Pim*) then
  1444. X    set setterm="set term imagen"
  1445. X    set LANG="-Limpress"
  1446. Xendif
  1447. X
  1448. X# Set up input file
  1449. Xecho $setterm > $TMP.plt
  1450. Xecho set output \"$outfile\" >> $TMP.plt
  1451. Xif (-e $TMP) cat $TMP >> $TMP.plt
  1452. X
  1453. X# If input file is specified AND command line contains plot commands, then
  1454. X#   do command line args first, then plot commands in input file.
  1455. Xgnuplot $TMP.plt $input_files
  1456. X
  1457. Xif ($status == 0 && -e $outfile && ! -z $outfile) then
  1458. X    # The printer is whatever printer was last specified,
  1459. X    # or the default printer if none was specified.
  1460. X    if ($LANG == -Limpress) then
  1461. X        /usr/local/bin/ipr $LANG $printer \
  1462. X           -D"jobheader $print_banner" \
  1463. X           -D"pagereversal on" \
  1464. X           -D"program lasergnu" $outfile
  1465. X    else if ($LANG == -Lpostscript) then
  1466. X           lpr $lpr_opts $printer $outfile
  1467. X    endif
  1468. Xelse
  1469. X    echo "lasergnu: error in plotting or empty plot; nothing printed."
  1470. Xendif
  1471. X
  1472. Xcleanup:
  1473. Xrm -f $TMP* $outfile
  1474. END_OF_FILE
  1475.   if test 4511 -ne `wc -c <'gnuplot/lasergnu'`; then
  1476.     echo shar: \"'gnuplot/lasergnu'\" unpacked with wrong size!
  1477.   fi
  1478.   chmod +x 'gnuplot/lasergnu'
  1479.   # end of 'gnuplot/lasergnu'
  1480. fi
  1481. if test -f 'gnuplot/makefile.286' -a "${1}" != "-c" ; then 
  1482.   echo shar: Will not clobber existing file \"'gnuplot/makefile.286'\"
  1483. else
  1484.   echo shar: Extracting \"'gnuplot/makefile.286'\" \(4238 characters\)
  1485.   sed "s/^X//" >'gnuplot/makefile.286' <<'END_OF_FILE'
  1486. X# make file for Borland C++ 3.x
  1487. X#   and Phar Lap LITE286 DOS extender
  1488. X# both LITE286 bin and BORLANDC bin directories must be on the path
  1489. X
  1490. X# where to place gnuplot.gih helpfile
  1491. XHELPFILE = gnuplot.gih
  1492. X# location of LITE286 Pharlap Extender
  1493. XLITE=c:\lite286
  1494. XLITECC=$(LITE)\bin\bcc286
  1495. X# location of Turbo C compiler
  1496. XTC = c:\borlandc
  1497. X# name of C compiler
  1498. XCC = bcc
  1499. X#CC = tcc
  1500. X# location of TLINK.EXE and TCC.EXE or BCC.EXE
  1501. XBIN = $(TC)\bin\\
  1502. X#BIN =
  1503. X# location of BGI files,
  1504. X# change this line if not in TC directory, i.e. $(TC)\bgi
  1505. XBGI = $(TC)\bgi
  1506. X
  1507. X# -c means don't link, -f means emulate 8087 if not present
  1508. X# -ml says large model 
  1509. X# -M means produce link map
  1510. X# -y means include line numbers for debugger
  1511. X# -v means include debug info
  1512. X# -w- means ignore warnings and do not report them
  1513. X# -DREADLINE to use the history/line editing capability. If you want this 
  1514. X#    capability add -DREADLINE to CFLAGS
  1515. XCFLAGS = -Ff=256 -c -f -ml -w- -I$(TC)\include -DMSDOS -DPC -DREADLINE
  1516. XTERMFLAGS =
  1517. X
  1518. XOBJ1 =  bitmap.obj command.obj contour.obj eval.obj graphics.obj graph3d.obj
  1519. XOBJ2 =    help.obj internal.obj misc.obj parse.obj plot.obj readline.obj
  1520. XOBJ3 =    scanner.obj setshow.obj specfun.obj standard.obj term.obj util.obj
  1521. XOBJ4 =    version.obj gnubin.obj binary.obj
  1522. XBGIFILES = cga.bgi egavga.bgi herc.bgi att.bgi
  1523. X
  1524. XOBJS =    $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4)
  1525. X
  1526. XCSOURCE5 = term\aed.trm term\cgi.trm term\dumb.trm term\dxy.trm \
  1527. X    term\eepic.trm term\epson.trm term\fig.trm term\hp26.trm \
  1528. X    term\hp2648.trm term\hpgl.trm term\hpljii.trm 
  1529. XCSOURCE6 = term\impcodes.h term\imagen.trm term\object.h \
  1530. X    term\iris4d.trm term\kyo.trm term\latex.trm term\pc.trm 
  1531. XCSOURCE7 = term\post.trm term\qms.trm term\regis.trm term\sun.trm \
  1532. X    term\t410x.trm term\tek.trm term\unixpc.trm term\unixplot.trm \
  1533. X    term\v384.trm term\x11.trm
  1534. XCSOURCE8 = contour.c specfun.c gnubin.c binary.c
  1535. X
  1536. Xall: gnuplot.exe $(HELPFILE) demo\bf_test.exe $(BGIFILES)
  1537. X
  1538. X# use response file to avoid command-line overflow
  1539. Xgnuplot.exe: $(OBJS)
  1540. X    $(BIN)tlink @&&!
  1541. X$(LITE)\bc3\lib\c0pl +
  1542. Xbitmap command eval graphics graph3d help internal misc parse +
  1543. Xplot scanner setshow specfun standard term util version contour +
  1544. Xgnubin binary +
  1545. Xreadline +
  1546. X$(LITE)\bc3\lib\emu286.lib +
  1547. X,gnuplot,gnuplot, +
  1548. X$(TC)\lib\emu +
  1549. X$(TC)\lib\mathl +
  1550. X$(LITE)\bc3\lib\graph286.lib +
  1551. X$(LITE)\bc3\lib\phapi +
  1552. X$(LITE)\bc3\lib\bcl286, +
  1553. Xgnuplot.def
  1554. X!
  1555. X
  1556. X
  1557. X# default rules
  1558. X
  1559. X.c.obj:
  1560. X    $(LITECC) $(CFLAGS) $<
  1561. X
  1562. Xbitmap.obj: bitmap.c bitmap.h plot.h
  1563. X
  1564. Xcommand.obj: command.c plot.h setshow.h help.h
  1565. X    $(LITECC) $(CFLAGS) command.c
  1566. X
  1567. Xcontour.obj: contour.c plot.h
  1568. X
  1569. Xeval.obj: eval.c plot.h
  1570. X
  1571. Xgraphics.obj: graphics.c plot.h setshow.h
  1572. X
  1573. Xgraph3d.obj: graphics.c plot.h setshow.h
  1574. X
  1575. Xhelp.obj: help.c plot.h help.h
  1576. X
  1577. Xinternal.obj: internal.c plot.h
  1578. X
  1579. Xmisc.obj: misc.c plot.h setshow.h help.h
  1580. X
  1581. Xparse.obj: parse.c plot.h
  1582. X    $(LITECC) $(CFLAGS) parse.c
  1583. X
  1584. Xplot.obj: plot.c plot.h setshow.h
  1585. X    $(LITECC) $(CFLAGS) plot.c
  1586. X
  1587. Xreadline.obj: readline.c
  1588. X
  1589. Xscanner.obj: scanner.c plot.h
  1590. X
  1591. Xsetshow.obj: setshow.c plot.h setshow.h
  1592. X
  1593. Xspecfun.obj: specfun.c
  1594. X
  1595. Xstandard.obj: standard.c plot.h
  1596. X
  1597. X# the CSOURCE? dependencies are not up to date (but who cares)
  1598. Xterm.obj: term.c term.h plot.h setshow.c bitmap.h $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
  1599. X    $(LITECC) $(CFLAGS) $(TERMFLAGS) -Iterm term.c
  1600. X
  1601. Xutil.obj: util.c plot.h
  1602. X
  1603. Xversion.obj: version.c
  1604. X
  1605. X# convert gnuplot.doc to gnuplot.gih
  1606. X$(HELPFILE): doc2gih.exe docs\gnuplot.doc
  1607. X    doc2gih docs\gnuplot.doc $(HELPFILE)
  1608. X
  1609. Xdoc2gih.exe: docs\doc2gih.c
  1610. X    $(BIN)$(CC) -w- -ml -I$(TC)\include -L$(TC)\lib docs\doc2gih.c
  1611. X
  1612. Xdemo\bf_test.exe: bf_test.c binary.obj
  1613. X    $(BIN)$(CC) -edemo\bf_test.exe -w- -ml -I$(TC)\include -L$(TC)\lib bf_test.c binary.obj
  1614. X
  1615. X# copy Borland Graphics Interface files to current directory
  1616. Xcga.bgi: $(BGI)\cga.bgi
  1617. X    copy $(BGI)\$< $<
  1618. X
  1619. Xegavga.bgi: $(BGI)\egavga.bgi
  1620. X    copy $(BGI)\$< $<
  1621. X
  1622. Xherc.bgi: $(BGI)\herc.bgi
  1623. X    copy $(BGI)\$< $<
  1624. X
  1625. Xatt.bgi: $(BGI)\att.bgi
  1626. X    copy $(BGI)\$< $<
  1627. X
  1628. X# clean target - remove all temp files, but leave executable intact
  1629. X# needed when changing configuration (model or overlaying)
  1630. X
  1631. Xclean:
  1632. X    del *.obj
  1633. X    del gnuplot.map
  1634. X    del doc2gih.exe
  1635. X
  1636. X# realclean target - remove all files created by the makefile
  1637. X
  1638. Xrealclean: clean
  1639. X    del gnuplot.exe
  1640. X    del gnuplot.gih
  1641. X    del demo\bf_test.exe
  1642. X    del demo\binary1
  1643. X    del demo\binary2
  1644. X    del demo\binary3
  1645. END_OF_FILE
  1646.   if test 4238 -ne `wc -c <'gnuplot/makefile.286'`; then
  1647.     echo shar: \"'gnuplot/makefile.286'\" unpacked with wrong size!
  1648.   fi
  1649.   # end of 'gnuplot/makefile.286'
  1650. fi
  1651. if test -f 'gnuplot/os2/gnupmdrv.h' -a "${1}" != "-c" ; then 
  1652.   echo shar: Will not clobber existing file \"'gnuplot/os2/gnupmdrv.h'\"
  1653. else
  1654.   echo shar: Extracting \"'gnuplot/os2/gnupmdrv.h'\" \(4603 characters\)
  1655.   sed "s/^X//" >'gnuplot/os2/gnupmdrv.h' <<'END_OF_FILE'
  1656. X/* gnushell header file */
  1657. X/*
  1658. X** static char RCSid[]="$Id: gnupmdrv.h%v 3.50 1993/07/09 05:35:24 woo Exp $" ;
  1659. X*/
  1660. X
  1661. X/*
  1662. X * PM driver for GNUPLOT
  1663. X * Copyright (C) 1992   Roger Fearick
  1664. X *
  1665. X * Permission to use, copy, and distribute this software and its
  1666. X * documentation for any purpose with or without fee is hereby granted, 
  1667. X * provided that the above copyright notice appear in all copies and 
  1668. X * that both that copyright notice and this permission notice appear 
  1669. X * in supporting documentation.
  1670. X *
  1671. X * Permission to modify the software is granted, but not the right to
  1672. X * distribute the modified code.  Modifications are to be distributed 
  1673. X * as patches to released version.
  1674. X *  
  1675. X * This software is provided "as is" without express or implied warranty.
  1676. X * 
  1677. X *
  1678. X * AUTHOR
  1679. X * 
  1680. X *   Gnuplot driver for OS/2:  Roger Fearick
  1681. X * 
  1682. X * Send your comments or suggestions to 
  1683. X *  info-gnuplot@dartmouth.edu.
  1684. X * This is a mailing list; to join it send a note to 
  1685. X *  info-gnuplot-request@dartmouth.edu.  
  1686. X * Send bug reports to
  1687. X *  bug-gnuplot@dartmouth.edu.
  1688. X**/
  1689. X
  1690. X    /* include resource defines */
  1691. X    
  1692. X#ifndef DISPDEFS_H
  1693. X/*#include "dispdefs.h"*/
  1694. X#include "dialogs.h"
  1695. X#endif
  1696. X
  1697. X/*==== own window messages  =================================================*/
  1698. X
  1699. X#define WM_GNUPLOT          (WM_USER+20)
  1700. X#define WM_PAUSEPLOT        (WM_USER+21)
  1701. X#define WM_PAUSEEND         (WM_USER+22)
  1702. X#define WM_USER_SET_DATA    (WM_USER+90)
  1703. X#define WM_USER_GET_DATA    (WM_USER+91)
  1704. X#define WM_USER_CHGFONT     (WM_USER+10) 
  1705. X#define WM_USER_PRINT_BEGIN (WM_USER+200)
  1706. X#define WM_USER_PRINT_OK    (WM_USER+201)
  1707. X#define WM_USER_PRINT_ERROR (WM_USER+202)
  1708. X#define WM_USER_DEV_ERROR   (WM_USER+203)
  1709. X#define WM_USER_PRINT_QBUSY (WM_USER+204)
  1710. X
  1711. X/*==== various names ========================================================*/
  1712. X
  1713. X#define GNUPIPE     "\\pipe\\gnuplot"       /* named pipe to gnuplot */
  1714. X#define GNUQUEUE    "\\queues\\gnuplot"     /* queue for gnuplot termination */
  1715. X#define GNUSEM      "\\sem32\\gnuplot.sem"  /* synch gnuplot and gnupmdrv */
  1716. X#define GNUINI      "gnupmdrv.ini"          /* ini filename */
  1717. X#define ENVGNUHELP  "GNUHELP"               /* gnuplot help envionment name */
  1718. X#define ENVGNUPLOT  "GNUPLOT"               /* general gnuplot environment */
  1719. X#define GNUEXEFILE  "gnuplot.exe"           /* exe file name */
  1720. X#define GNUHELPFILE "gnuplot.gih"           /* help file name */
  1721. X#define GNUTERMINIT "GNUTERM=pm"            /* terminal setup string */
  1722. X#define INITIAL_FONT "12.Helvetica"         /* initial font for plots */
  1723. X#define APP_NAME     "GnuplotPM"             /* application name */
  1724. X
  1725. X        // profile (ini file) names 
  1726. X#define INISHELLPOS  "PosShell"
  1727. X#define INIPLOTPOS   "PosPlot"
  1728. X#define INIFONT      "DefFont" 
  1729. X#define INIOPTS      "DefOpts"      
  1730. X
  1731. X/*==== global data  ==========================================================*/
  1732. X
  1733. XHAB         hab ;                   // application anchor block handle 
  1734. XHWND           hApp ;                  // application window handle 
  1735. XHWND        hwndFrame ;             // frame window handle 
  1736. X#define   FONTBUF   256         /* buffer for dropped font namesize */
  1737. X
  1738. X/*==== stuff for querying printer capability =================================*/
  1739. X
  1740. Xtypedef struct {  //query data for printer setup
  1741. X    float xsize ;
  1742. X    float ysize ;
  1743. X    float xfrac ;
  1744. X    float yfrac ;
  1745. X    short caps ;
  1746. X    char  szFilename[CCHMAXPATHCOMP] ;
  1747. X    PPRQINFO3 piPrinter ;
  1748. X    } QPRINT, *PQPRINT ;
  1749. X
  1750. X#define QP_CAPS_NORMAL 0
  1751. X#define QP_CAPS_FILE   1   /* can print to file */
  1752. X
  1753. X/*==== function declarations =================================================*/
  1754. X
  1755. Xshort            ScalePS( HPS, PRECTL, USHORT ) ;
  1756. Xvoid             PlotThings( HPS, long ) ;
  1757. Xint              SetupPrinter( HWND, char*, PPRQINFO3 ) ;
  1758. XHDC              OpenPrinterDC( HAB, PPRQINFO3, LONG, char* ) ;
  1759. Xint              SetPrinterMode( HWND, PPRQINFO3 ) ;
  1760. XMPARAM           PrintCmdProc( HWND, ULONG, MPARAM, MPARAM ) ;
  1761. XMRESULT EXPENTRY PrintDlgProc( HWND, ULONG, MPARAM, MPARAM ) ;
  1762. XMRESULT EXPENTRY PauseMsgDlgProc( HWND, ULONG, MPARAM, MPARAM ) ;
  1763. XMRESULT EXPENTRY QFontDlgProc( HWND ,ULONG, MPARAM, MPARAM ) ;
  1764. XMRESULT EXPENTRY QPrintDlgProc (HWND, ULONG, MPARAM, MPARAM) ;
  1765. XMRESULT EXPENTRY QPrintersDlgProc ( HWND, ULONG, MPARAM, MPARAM ) ;
  1766. XMRESULT EXPENTRY DisplayClientWndProc(HWND, ULONG, MPARAM, MPARAM);
  1767. XMRESULT EXPENTRY NewFrameWndProc(HWND, ULONG, MPARAM, MPARAM) ;
  1768. XMRESULT EXPENTRY About(HWND, ULONG, MPARAM, MPARAM);
  1769. X
  1770. X        /* own window functions... */
  1771. Xvoid WinSetDlgItemFloat( HWND, USHORT, float ) ;
  1772. Xvoid WinSetDlgItemFloatF( HWND, USHORT, int, float ) ;
  1773. Xvoid WinQueryDlgItemFloat( HWND, USHORT, float* ) ;
  1774. X
  1775. X
  1776. END_OF_FILE
  1777.   if test 4603 -ne `wc -c <'gnuplot/os2/gnupmdrv.h'`; then
  1778.     echo shar: \"'gnuplot/os2/gnupmdrv.h'\" unpacked with wrong size!
  1779.   fi
  1780.   # end of 'gnuplot/os2/gnupmdrv.h'
  1781. fi
  1782. if test -f 'gnuplot/term/cgi.trm' -a "${1}" != "-c" ; then 
  1783.   echo shar: Will not clobber existing file \"'gnuplot/term/cgi.trm'\"
  1784. else
  1785.   echo shar: Extracting \"'gnuplot/term/cgi.trm'\" \(4478 characters\)
  1786.   sed "s/^X//" >'gnuplot/term/cgi.trm' <<'END_OF_FILE'
  1787. X/*
  1788. X * $Id: cgi.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  1789. X *
  1790. X */
  1791. X
  1792. X/* GNUPLOT - cgi.trm */
  1793. X/*
  1794. X * Copyright (C) 1990 - 1993 Ronald Florence
  1795. X *
  1796. X * Permission is hereby granted for unlimited non-commercial
  1797. X * use of this code, on condition that the copyright
  1798. X * notices are left intact and any modifications to the source
  1799. X * code are noted as such.  No warranty of any kind is implied
  1800. X * or granted for this material.
  1801. X *
  1802. X * This file is included by ../term.c.
  1803. X *
  1804. X * This terminal driver supports SCO CGI drivers
  1805. X *
  1806. X * AUTHOR
  1807. X *   Ronald Florence <ron@mlfarm.com>
  1808. X */
  1809. X
  1810. X#ifdef VGA_MONO
  1811. Xstatic short rgb[16][3] = {
  1812. X  0,    0,      0,      /* Black        */
  1813. X  1000,    1000,    1000,    /* White    */
  1814. X  800,    800,    0,    /* Red        */
  1815. X  0,    600,    0,    /* Green    */
  1816. X  0,    800,    800,    /* Blue        */
  1817. X  1000,    1000,    400,    /* Yellow    */
  1818. X  0,    600,    600,    /* Cyan        */
  1819. X  600,    600,    600,    /* Magenta    */
  1820. X  800,    800,    0,    /* Brown    */
  1821. X  600,    600,    600,    /* Lt. Grey    */
  1822. X  400,    600,    400,    /* Dark Grey    */
  1823. X  400,    600,    1000,    /* Lt. Blue    */
  1824. X  400,    1000,    400,    /* Lt Green    */
  1825. X  400,    1000,    1000,    /* Lt Cyan    */
  1826. X  1000,    600,    400,    /* Lt Red    */
  1827. X  600,    600,    1000    /* Lt Magenta    */
  1828. X};
  1829. X#endif
  1830. X
  1831. X#define CGI_XMAX    32767
  1832. X#define CGI_YMAX    32767
  1833. X#define CGI_VTIC    (CGI_YMAX / 75)
  1834. X#define CGI_HTIC    term_tbl[term].h_tic
  1835. X#define CGI_VCHAR    term_tbl[term].v_char
  1836. X#define CGI_HCHAR    term_tbl[term].h_char
  1837. X#define CRT        (gout[45] == 0)
  1838. X#define CGICOLORS    gout[13]
  1839. X#define CGILINES    gout[6]
  1840. X#define CGIROTATES    gout[36]
  1841. X#define CGITEXTALIGN    gout[48]
  1842. X
  1843. Xstatic short gout[66];
  1844. Xstatic short cgidev;
  1845. Xstatic short vect[4];
  1846. Xstatic short gin[19] = {
  1847. X 0,    /* default aspect ratio */
  1848. X 1,    /* solid line */
  1849. X 1,    /* line color */
  1850. X 1,    /* marker type . */
  1851. X 1,    /* marker color */
  1852. X 1,    /* graphics text font */
  1853. X 1,    /* graphics text color */
  1854. X 0,    /* fill interior style */
  1855. X 0,    /* fill style index */
  1856. X 1,    /* fill color index */
  1857. X 1     /* prompt for paper changes */
  1858. X };
  1859. X
  1860. Xchar    *cgidriver, *getenv();
  1861. X
  1862. X
  1863. XCGI_init()
  1864. X{
  1865. X  if (getenv(cgidriver = "CGIDISP") == NULL)
  1866. X    HCGI_init();
  1867. X}
  1868. X
  1869. X
  1870. XHCGI_init()
  1871. X{
  1872. X  if (getenv(cgidriver = "CGIPRNT") == NULL)
  1873. X    int_error("no CGI driver", NO_CARET);
  1874. X}
  1875. X
  1876. X
  1877. XCGI_graphics()
  1878. X{
  1879. X  int    i, aspect;
  1880. X  char *s;
  1881. X  short font_cap[9];
  1882. X  char    err_str[80];
  1883. X
  1884. X  if ( (s=getenv("ASPECT")) != NULL && (aspect=atoi(s)) >= 0 && aspect <= 3 )
  1885. X    gin[0] = aspect;
  1886. X  for (i = 0; cgidriver[i]; i++) 
  1887. X    gin[11+i] = cgidriver[i];
  1888. X  gin[18] = ' ';
  1889. X
  1890. X  if (v_opnwk(gin, &cgidev, gout) < 0) 
  1891. X    {
  1892. X      sprintf(err_str, "CGI error %d opening %s", -vq_error(), cgidriver);
  1893. X      int_error(err_str, NO_CARET);
  1894. X    }
  1895. X  vqt_representation(cgidev, 9, font_cap);
  1896. X  CGI_VCHAR = font_cap[8] * 3 / 2;
  1897. X  CGI_HCHAR = font_cap[7];
  1898. X  CGI_HTIC = CGI_VTIC * ((double) gout[1] / (double) gout[4]) / 
  1899. X            ((double) gout[0] / (double) gout[3]);
  1900. X#ifdef VGA_MONO
  1901. X  if (CGICOLORS > 2)
  1902. X    vsc_table(cgidev, 0, CGICOLORS, rgb);
  1903. X#endif
  1904. X}
  1905. X
  1906. X
  1907. XCGI_text()
  1908. X{
  1909. X  if (CRT)  
  1910. X    {
  1911. X      short ptin[2];
  1912. X      char  strin[2];
  1913. X      
  1914. X      ptin[0] = 0;
  1915. X      ptin[1] = 0;
  1916. X      vrq_string(cgidev, 1, 0, ptin, strin);
  1917. X    }
  1918. X  v_clswk(cgidev);
  1919. X}
  1920. X
  1921. X
  1922. XCGI_reset()
  1923. X{
  1924. X}
  1925. X
  1926. X
  1927. XCGI_move(x, y)
  1928. X     int x, y;
  1929. X{
  1930. X  vect[0] = x;
  1931. X  vect[1] = y;
  1932. X}
  1933. X
  1934. XCGI_vector(x, y)
  1935. X     int x, y;
  1936. X{
  1937. X  vect[2] = x;
  1938. X  vect[3] = y;
  1939. X  v_pline(cgidev, 2, vect);
  1940. X  vect[0] = x;
  1941. X  vect[1] = y;
  1942. X}
  1943. X
  1944. X
  1945. XCGI_linetype(linetype)
  1946. X     int linetype;
  1947. X{
  1948. X  short lcolor;
  1949. X
  1950. X  if (CGICOLORS > 2) 
  1951. X    {
  1952. X      lcolor = (linetype + 2) % CGICOLORS + 1;
  1953. X      vsl_color(cgidev, lcolor);
  1954. X      vsm_color(cgidev, lcolor);
  1955. X    }
  1956. X  vsl_type(cgidev, (linetype < 1) ? 1 : (linetype % CGILINES) + 1);
  1957. X}
  1958. X
  1959. X
  1960. XCGI_put_text(x, y, str)
  1961. Xint x, y;
  1962. Xchar *str;
  1963. X{
  1964. X  v_gtext(cgidev, (short) x, (short) y, str);
  1965. X}
  1966. X
  1967. X
  1968. XCGI_text_angle(ang)
  1969. Xint    ang;
  1970. X{
  1971. X  if (!CGIROTATES)
  1972. X    return FALSE;
  1973. X                /* angles are 1/10 degree ccw */
  1974. X  vst_rotation(cgidev, (ang) ? 900 : 0);
  1975. X  return TRUE;
  1976. X}
  1977. X
  1978. X
  1979. XCGI_justify_text(mode)
  1980. Xenum JUSTIFY mode;
  1981. X{
  1982. X  short hor_in, hor_out, vert_out;
  1983. X
  1984. X  if (!CGITEXTALIGN)
  1985. X    return FALSE;
  1986. X
  1987. X  switch (mode)
  1988. X    {
  1989. X    case LEFT:   hor_in = 0; break;
  1990. X    case CENTRE: hor_in = 1; break;
  1991. X    case RIGHT:  hor_in = 2; break;
  1992. X    }
  1993. X  vst_alignment(cgidev, hor_in, 1, &hor_out, &vert_out); 
  1994. X  return TRUE;
  1995. X}
  1996. X
  1997. X
  1998. X#define POINT_TYPES 6
  1999. X
  2000. XCGI_point(x,y,num)
  2001. X     int x, y, num;
  2002. X{
  2003. X  short  point[2];
  2004. X  static short cgimarker[POINT_TYPES] = {1, 2, 6, 4, 5, 3};
  2005. X                          /* .  +  <> [] X  * */
  2006. X  if (num < 0)
  2007. X    {
  2008. X      CGI_move(x, y);
  2009. X      CGI_vector(x, y);
  2010. X    }
  2011. X  else
  2012. X    {
  2013. X      vsm_type(cgidev, cgimarker[num % POINT_TYPES]);
  2014. X      point[0] = x;
  2015. X      point[1] = y;
  2016. X      v_pmarker(cgidev, 1, point);
  2017. X    }
  2018. X}
  2019. END_OF_FILE
  2020.   if test 4478 -ne `wc -c <'gnuplot/term/cgi.trm'`; then
  2021.     echo shar: \"'gnuplot/term/cgi.trm'\" unpacked with wrong size!
  2022.   fi
  2023.   # end of 'gnuplot/term/cgi.trm'
  2024. fi
  2025. if test -f 'gnuplot/term/emxvga.trm' -a "${1}" != "-c" ; then 
  2026.   echo shar: Will not clobber existing file \"'gnuplot/term/emxvga.trm'\"
  2027. else
  2028.   echo shar: Extracting \"'gnuplot/term/emxvga.trm'\" \(4303 characters\)
  2029.   sed "s/^X//" >'gnuplot/term/emxvga.trm' <<'END_OF_FILE'
  2030. X/* GNUPLOT - emxvga.trm */
  2031. X/*
  2032. X * Copyright (C) 1993
  2033. X *
  2034. X * Permission to use, copy, and distribute this software and its
  2035. X * documentation for any purpose with or without fee is hereby granted, 
  2036. X * provided that the above copyright notice appear in all copies and 
  2037. X * that both that copyright notice and this permission notice appear 
  2038. X * in supporting documentation.
  2039. X *
  2040. X * Permission to modify the software is granted, but not the right to
  2041. X * distribute the modified code.  Modifications are to be distributed 
  2042. X * as patches to released version.
  2043. X *
  2044. X * This software  is provided "as is" without express or implied warranty.
  2045. X *
  2046. X * This file is included by ../term.c.
  2047. X *
  2048. X * This terminal driver supports:
  2049. X *  vgal
  2050. X *  vesa
  2051. X *
  2052. X * AUTHORS
  2053. X *  Russell Lang
  2054. X *
  2055. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  2056. X *
  2057. X */
  2058. X
  2059. X/* VGA driver using EMX/GCC for DOS */
  2060. X#include <graph.h>
  2061. X#include <conio.h>
  2062. X#include <dos.h>
  2063. X
  2064. Xint emx_startx, emx_starty;
  2065. Xint emx_xlast, emx_ylast;
  2066. Xint emx_color;
  2067. Xint emx_angle;
  2068. Xint emx_vmode = 0;
  2069. X#ifdef EMXVESA
  2070. Xint emx_vesamode = G640x480x256;
  2071. X#endif
  2072. X
  2073. X#define EMXVGA_XMAX 640
  2074. X#define EMXVGA_YMAX 480
  2075. X
  2076. X#define EMXVGA_XLAST (EMXVGA_XMAX - 1)
  2077. X#define EMXVGA_YLAST (EMXVGA_YMAX - 1)
  2078. X
  2079. X#define EMXVGA_VCHAR FNT5X9_VCHAR
  2080. X#define EMXVGA_HCHAR FNT5X9_HCHAR
  2081. X#define EMXVGA_VTIC 4
  2082. X#define EMXVGA_HTIC 4
  2083. X
  2084. X#define EMXNUMCOLOR 15
  2085. Xstatic int emx_colors[EMXNUMCOLOR] = {7,8,2,3,4,5,9,14,12,15,13,10,11,1,6};
  2086. X
  2087. X
  2088. XEMXVGA_init()
  2089. X{
  2090. Xunion REGS r;
  2091. X    r.h.ah = 0x0f;
  2092. X    _int86(0x10, &r, &r);
  2093. X    emx_vmode = r.h.al;    /* save old video mode */
  2094. X    /* Get the screen size: */
  2095. X    if (!g_mode(G_MODE_VGA_L))
  2096. X        int_error("Couldn't select graphics mode",NO_CARET);
  2097. X    emx_xlast = g_xsize - 1;
  2098. X        term_tbl[term].xmax = emx_xlast + 1;
  2099. X    emx_ylast = g_ysize - 1;
  2100. X        term_tbl[term].ymax = emx_ylast + 1;
  2101. X    g_mode(G_MODE_OFF);
  2102. X}
  2103. X
  2104. XEMXVGA_graphics()
  2105. X{
  2106. X/* don't use g_mode() here - gmode(G_MODE_OFF) doesn't clean up */
  2107. Xunion REGS r;
  2108. X    r.h.ah = 0x00;
  2109. X    r.h.al = 19;        /* VGA 320x200x256 mode */
  2110. X    _int86(0x10, &r, &r);
  2111. X}
  2112. X
  2113. XEMXVGA_text()
  2114. X{
  2115. X/* don't use g_mode() here - gmode(G_MODE_OFF) doesn't clean up */
  2116. Xunion REGS r;
  2117. Xint ch;
  2118. X    ch = getch();
  2119. X    r.h.ah = 0x00;
  2120. X    r.h.al = emx_vmode;    /* old video mode */
  2121. X    _int86(0x10, &r, &r);
  2122. X    if (ch == 3)
  2123. X        int_error("Interrupt",NO_CARET);
  2124. X}
  2125. X
  2126. XEMXVGA_reset()
  2127. X{
  2128. X}
  2129. X
  2130. X#ifdef EMXVESA
  2131. X/* untested */
  2132. XEMXVESA_options()
  2133. X{
  2134. X    extern struct value *const_express();
  2135. X    extern double real();
  2136. X
  2137. X    if (!END_OF_COMMAND) {
  2138. X        if (almost_equals(c_token,"d$efault")) {
  2139. X            emx_vesamode = G640x480x256;
  2140. X            c_token++;
  2141. X        }
  2142. X    }
  2143. X
  2144. X    if (!END_OF_COMMAND) {
  2145. X        /* We have a vesa mode specified */
  2146. X        struct value a;
  2147. X        emx_vesamode = (int)real(const_express(&a));
  2148. X    }
  2149. X
  2150. X    sprintf(term_options,"%d",emx_vesamode);
  2151. X}
  2152. X
  2153. XEMXVESA_init()
  2154. X{
  2155. X    if (!g_mode(emx_vesamode))
  2156. X        int_error("Couldn't select graphics mode",NO_CARET);
  2157. X    emx_xlast = g_xsize - 1;
  2158. X        term_tbl[term].xmax = emx_xlast + 1;
  2159. X    emx_ylast = g_ysize - 1;
  2160. X        term_tbl[term].ymax = emx_ylast + 1;
  2161. X    g_mode(GTEXT);
  2162. X}
  2163. X
  2164. XEMXVESA_graphics()
  2165. X{
  2166. X    g_mode(emx_vesamode);
  2167. X}
  2168. X
  2169. XEMXVESA_text()
  2170. X{
  2171. Xint ch;
  2172. X    ch = getch();
  2173. X    g_mode(GTEXT);
  2174. X    if (ch == 3)
  2175. X        int_error("Interrupt",NO_CARET);
  2176. X}
  2177. X
  2178. XEMXVESA_reset()
  2179. X{
  2180. X}
  2181. X#endif
  2182. X
  2183. X
  2184. XEMXVGA_linetype(linetype)
  2185. Xint linetype;
  2186. X{
  2187. X    if (linetype >= 13)
  2188. X        linetype %= 13;
  2189. X    emx_color = emx_colors[linetype+2];
  2190. X}
  2191. X
  2192. XEMXVGA_move(x,y)
  2193. Xunsigned int x,y;
  2194. X{
  2195. X    emx_startx = x;
  2196. X    emx_starty = y;
  2197. X}
  2198. X
  2199. X
  2200. XEMXVGA_vector(x,y)
  2201. Xunsigned int x,y;
  2202. X{
  2203. X    g_line(emx_startx,emx_ylast-emx_starty,x,emx_ylast-y,emx_color);
  2204. X    emx_startx = x;
  2205. X    emx_starty = y;
  2206. X}
  2207. X
  2208. X
  2209. Xint EMXVGA_text_angle(ang)
  2210. Xint ang;
  2211. X{
  2212. X    emx_angle=ang;
  2213. X    return TRUE;
  2214. X}
  2215. X
  2216. X
  2217. XEMXVGA_putc(x,y,c,angle)
  2218. Xunsigned int x,y;
  2219. Xchar c;
  2220. Xint angle;
  2221. X{
  2222. Xint i,j,k;
  2223. Xunsigned int pixelon;
  2224. X    i = (int)(c) - 32;
  2225. X    for (j=0; j<FNT5X9_VBITS; j++) {
  2226. X        for (k=0; k<FNT5X9_HBITS; k++) {
  2227. X            pixelon = (((unsigned int)(fnt5x9[i][j])) >> k & 1);
  2228. X            if (pixelon) {
  2229. X                switch(angle) {
  2230. X                    case 0 : g_set(x+k,y-j,emx_color);
  2231. X                            break;
  2232. X                    case 1 : g_set(x-j,y-k,emx_color);
  2233. X                            break;
  2234. X                }
  2235. X            }
  2236. X        }
  2237. X    }
  2238. X}
  2239. X
  2240. X
  2241. XEMXVGA_put_text(x,y,str)
  2242. Xunsigned int x, y;
  2243. Xchar *str;
  2244. X{
  2245. Xint i;
  2246. X    switch(emx_angle) {
  2247. X        case 0 : y -= EMXVGA_VCHAR/2;
  2248. X                break;
  2249. X        case 1 : x += EMXVGA_VCHAR/2;
  2250. X                break;
  2251. X    }
  2252. X    for (i=0;str[i];i++) {
  2253. X        EMXVGA_putc(x,emx_ylast-y,str[i],emx_angle);
  2254. X        switch(emx_angle) {
  2255. X            case 0 : x+=EMXVGA_HCHAR ;
  2256. X                    break;
  2257. X            case 1 : y+=EMXVGA_HCHAR ;
  2258. X                    break;
  2259. X        }
  2260. X    }
  2261. X}
  2262. X
  2263. END_OF_FILE
  2264.   if test 4303 -ne `wc -c <'gnuplot/term/emxvga.trm'`; then
  2265.     echo shar: \"'gnuplot/term/emxvga.trm'\" unpacked with wrong size!
  2266.   fi
  2267.   # end of 'gnuplot/term/emxvga.trm'
  2268. fi
  2269. if test -f 'gnuplot/term/gnugraph.trm' -a "${1}" != "-c" ; then 
  2270.   echo shar: Will not clobber existing file \"'gnuplot/term/gnugraph.trm'\"
  2271. else
  2272.   echo shar: Extracting \"'gnuplot/term/gnugraph.trm'\" \(4989 characters\)
  2273.   sed "s/^X//" >'gnuplot/term/gnugraph.trm' <<'END_OF_FILE'
  2274. X/* GNUPLOT -- gnugraph.trm */
  2275. X/*
  2276. X * Copyright (C) 1993
  2277. X *
  2278. X * Permission to use, copy, and distribute this software and its
  2279. X * documentation for any purpose with or without fee is hereby granted, 
  2280. X * provided that the above copyright notice appear in all copies and 
  2281. X * that both that copyright notice and this permission notice appear 
  2282. X * in supporting documentation.
  2283. X *
  2284. X * Permission to modify the software is granted, but not the right to
  2285. X * distribute the modified code.  Modifications are to be distributed 
  2286. X * as patches to released version.
  2287. X *  
  2288. X * This software  is provided "as is" without express or implied warranty.
  2289. X * 
  2290. X * This file is included by ../term.c.
  2291. X *
  2292. X * This terminal driver supports:
  2293. X *  GNU plot(5) graphics language
  2294. X *
  2295. X * AUTHORS
  2296. X *  Tony Richardson from the unixplot.trm by Colin Kelley, Thomas Williams,
  2297. X *  and Russell Lang and from post.trm by Russell Lang.
  2298. X * 
  2299. X * send your comments or suggestions to (info-gnuplot@ames.arc.nasa.gov).
  2300. X * 
  2301. X * This version of the 'unixplot' driver produces device independent
  2302. X * output.  I've chosen parameter values so that the PostScript output
  2303. X * produced by plot2ps is 5" x 3".  You can use the 'set size' command
  2304. X * to get output up to 8.25" x 8.25", i.e. size values larger than
  2305. X * 1 are okay.
  2306. X */
  2307. X
  2308. X/*
  2309. XUnixplot library writes to stdout.  A fix was put in place by
  2310. X..!arizona!naucse!jdc to let set term and set output redirect
  2311. Xstdout.  All other terminals write to outfile.
  2312. X*/
  2313. X
  2314. X/* This is a device independent format, so the output should look
  2315. X * look "reasonable" on any output device.  I set things up there so
  2316. X * that the output of plot2ps is 5" x 3" (standard GNUPLOT size).
  2317. X * You can use GNUPLOT's size command to obtain plots to almost the
  2318. X * 8.25" x 8.25" limit.
  2319. X */
  2320. X
  2321. Xchar up_font[MAX_ID_LEN+1] = "Courier" ; /* name of font */
  2322. Xint up_fontsize = 10;
  2323. X
  2324. X/* plot2ps produces a 8.25" x 8.25" square. */
  2325. X#define UP_SCREENX 32768
  2326. X#define UP_SCREENY 32768
  2327. X#define UP_SCRXINC 8.25
  2328. X#define UP_SCRYINC 8.25
  2329. X
  2330. X/* We want a 5" x 3" graph by default. */
  2331. X#define UP_XINCHES 5
  2332. X#define UP_YINCHES 3
  2333. X/* UP_XMAX = (UP_SCREENX*UP_XINCHES)/UP_SCRXINC
  2334. X   UP_YMAX (UP_SCREENY*UP_YINCHES)/UP_SCRYINC */
  2335. X#define UP_XMAX 19859
  2336. X#define UP_YMAX 11565
  2337. X
  2338. X#define UP_XLAST (UP_XMAX - 1)
  2339. X#define UP_YLAST (UP_YMAX - 1)
  2340. X
  2341. X/* UP_VCHAR = ((UP_FONTSIZE*UP_YMAX)/(UP_YINCHES*72)) 
  2342. X            = UP_FONTSIZE*UP_VFONTSC
  2343. X   UP_HCHAR = ((UP_FONTSIZE/2)*UP_XMAX)/(UP_XINCHES*72))
  2344. X            = UP_FONTSIZE*UP_HFONTSC
  2345. X*/
  2346. X
  2347. X#define UP_VFONTSC  53.5
  2348. X#define UP_VCHAR    535   /* 10 * VFONTSC */
  2349. X#define UP_HFONTSC  27.6
  2350. X#define UP_HCHAR    276   /* 10 * HFONTSC */
  2351. X
  2352. X#define UP_VTIC (UP_YMAX/80)
  2353. X#define UP_HTIC (UP_XMAX/80)
  2354. X
  2355. X/* These offsets center plot2ps output in the middle of the page.  The
  2356. X * amount of resizing that can be done is limited. */
  2357. X/*
  2358. X * #define UP_XOFF 6454
  2359. X * #define UP_YOFF 10601
  2360. X */
  2361. X
  2362. X/* These offsets give a 1" offset from the lower left corner.  This
  2363. X * gives a greater range of permissible values in GNUPLOT's size
  2364. X * command. */
  2365. X#define UP_XOFF 3972
  2366. X#define UP_YOFF 3972
  2367. X
  2368. Xenum JUSTIFY up_justify=LEFT;
  2369. X
  2370. XUP_options()
  2371. X{
  2372. X        extern struct value *const_express();
  2373. X        extern double real();
  2374. X
  2375. X    if(!END_OF_COMMAND) {
  2376. X      if(almost_equals(c_token,"d$efault")) {
  2377. X        strcpy(up_font,"Courier");
  2378. X        up_fontsize = 10;
  2379. X        term_tbl[term].v_char = (unsigned int)(up_fontsize*UP_VFONTSC);
  2380. X        term_tbl[term].h_char = (unsigned int)(up_fontsize*UP_HFONTSC);
  2381. X        c_token++;
  2382. X      }
  2383. X    }
  2384. X
  2385. X        if (!END_OF_COMMAND && isstring(c_token)) {
  2386. X                quote_str(up_font,c_token);
  2387. X                c_token++;
  2388. X        }
  2389. X
  2390. X        if (!END_OF_COMMAND) {
  2391. X                /* We have font size specified */
  2392. X                struct value a;
  2393. X                up_fontsize = (int)real(const_express(&a));
  2394. X                term_tbl[term].v_char = (unsigned int)(up_fontsize*UP_VFONTSC);
  2395. X                term_tbl[term].h_char = (unsigned int)(up_fontsize*UP_HFONTSC);
  2396. X        }
  2397. X
  2398. X    sprintf(term_options,"\"%s\" %d",up_font,up_fontsize);
  2399. X}
  2400. X
  2401. XUP_init()
  2402. X{
  2403. X    openpl();
  2404. X    space(0,0,UP_SCREENX-1,UP_SCREENY-1);
  2405. X    fontname(up_font);
  2406. X    fontsize(up_fontsize);
  2407. X}
  2408. X
  2409. X
  2410. XUP_graphics()
  2411. X{
  2412. X    erase();
  2413. X}
  2414. X
  2415. X
  2416. XUP_text()
  2417. X{
  2418. X    /* Flush here so that output will be complete. */
  2419. X    fflush(stdout);
  2420. X}
  2421. X
  2422. X
  2423. XUP_linetype(linetype)
  2424. Xint linetype;
  2425. X{
  2426. Xstatic char *lt[2+5] = {"solid", "longdashed", "solid", "dotted","shortdashed",
  2427. X    "dotdashed", "longdashed"};
  2428. X
  2429. X    if (linetype >= 5)
  2430. X        linetype %= 5;
  2431. X    linemod(lt[linetype+2]);
  2432. X}
  2433. X
  2434. X
  2435. XUP_move(x,y)
  2436. Xunsigned int x,y;
  2437. X{
  2438. X    move(x+UP_XOFF,y+UP_YOFF);
  2439. X}
  2440. X
  2441. X
  2442. XUP_vector(x,y)
  2443. Xunsigned int x,y;
  2444. X{
  2445. X    cont(x+UP_XOFF,y+UP_YOFF);
  2446. X}
  2447. X
  2448. X
  2449. XUP_put_text(x,y,str)
  2450. Xunsigned int x,y;
  2451. Xchar str[];
  2452. X{
  2453. X    UP_move(x,y); /* Don't adjust x and y! It's done in UP_move. */
  2454. X    switch(up_justify) {
  2455. X     case LEFT:
  2456. X      alabel('l','c',str);
  2457. X      break;
  2458. X     case CENTRE:
  2459. X      alabel('c','c',str);
  2460. X      break;
  2461. X     case RIGHT:
  2462. X      alabel('r','c',str);
  2463. X      break;
  2464. X    }
  2465. X
  2466. X}
  2467. X
  2468. XUP_text_angle(ang)
  2469. Xint ang;
  2470. X{
  2471. X    rotate(0,0,90*ang);
  2472. X    return TRUE;
  2473. X}
  2474. X
  2475. XUP_justify_text(mode)
  2476. Xenum JUSTIFY mode;
  2477. X{
  2478. X    up_justify=mode;
  2479. X    return TRUE;
  2480. X}
  2481. X
  2482. XUP_reset()
  2483. X{
  2484. X    closepl();
  2485. X}
  2486. X
  2487. END_OF_FILE
  2488.   if test 4989 -ne `wc -c <'gnuplot/term/gnugraph.trm'`; then
  2489.     echo shar: \"'gnuplot/term/gnugraph.trm'\" unpacked with wrong size!
  2490.   fi
  2491.   # end of 'gnuplot/term/gnugraph.trm'
  2492. fi
  2493. if test -f 'gnuplot/term/gpic.trm' -a "${1}" != "-c" ; then 
  2494.   echo shar: Will not clobber existing file \"'gnuplot/term/gpic.trm'\"
  2495. else
  2496.   echo shar: Extracting \"'gnuplot/term/gpic.trm'\" \(4824 characters\)
  2497.   sed "s/^X//" >'gnuplot/term/gpic.trm' <<'END_OF_FILE'
  2498. X/*
  2499. X * $Id: gpic.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
  2500. X */
  2501. X
  2502. X/* GNUPLOT - gpic.trm -*-C-*- */
  2503. X/*
  2504. X * Copyright (C) 1993   
  2505. X *
  2506. X * Permission to use, copy, and distribute this software and its
  2507. X * documentation for any purpose with or without fee is hereby granted, 
  2508. X * provided that the above copyright notice appear in all copies and 
  2509. X * that both that copyright notice and this permission notice appear 
  2510. X * in supporting documentation.
  2511. X *
  2512. X * This software  is provided "as is" without express or implied warranty.
  2513. X * 
  2514. X * This file is included by ../term.c.
  2515. X */
  2516. X
  2517. X/*
  2518. X * This terminal driver supports:
  2519. X *   The GPIC graphics language for groff
  2520. X *
  2521. X * AUTHOR
  2522. X *  Sigfrid Lundberg
  2523. X *
  2524. X * send your comments or suggestions to (siglun@volterra.teorekol.lu.se).
  2525. X * 
  2526. X */
  2527. X
  2528. X
  2529. X#define GPIC_PTS_PER_INCH (72.27)
  2530. X#define GPIC_DOTS_PER_INCH (300)    
  2531. X#define GPIC_UNIT (GPIC_PTS_PER_INCH/GPIC_DOTS_PER_INCH) /* dot size in pt */
  2532. X
  2533. X/* 5 inches wide by 3 inches high (default) */
  2534. X#define GPIC_XMAX (5*GPIC_DOTS_PER_INCH)  
  2535. X#define GPIC_YMAX (3*GPIC_DOTS_PER_INCH)  
  2536. X
  2537. X#define GPIC_HTIC (5*GPIC_DOTS_PER_INCH/72)
  2538. X#define GPIC_VTIC (5*GPIC_DOTS_PER_INCH/72)
  2539. X#define GPIC_HCHAR (GPIC_DOTS_PER_INCH*53/10/72)
  2540. X#define GPIC_VCHAR (GPIC_DOTS_PER_INCH*11/72)    
  2541. X#define GPIC_coord(x) ((float)x)/((float)GPIC_DOTS_PER_INCH)
  2542. X
  2543. Xstatic float GPIC_x, GPIC_y;
  2544. Xstatic unsigned int GPIC_posx;
  2545. Xstatic unsigned int GPIC_posy;
  2546. Xstatic unsigned int GPIC_ltype;
  2547. Xenum JUSTIFY GPIC_justify=LEFT;
  2548. Xstatic int GPIC_angle=0;
  2549. X
  2550. X/* for DOTS point style */
  2551. X
  2552. X#define GPIC_NUMLINES 6        /* number of linetypes below */
  2553. Xstatic char *GPIC_lines[] = {
  2554. X    "thickness 1.0",            /* -2 border */
  2555. X    "",         /* -1 axes */
  2556. X    "",            /*  0 solid thin  */
  2557. X    "dotted",
  2558. X    "dashed 0.05",            /*  1 solid thick */
  2559. X    "dashed 0.075",            /*  2 solid Thick */
  2560. X};
  2561. X
  2562. X
  2563. Xstatic int GPIC_type;        /* current line type */
  2564. Xstatic TBOOLEAN GPIC_inline = FALSE; /* are we in the middle of a line */
  2565. Xstatic int GPIC_linecount = 0; /* number of points in line so far */
  2566. X
  2567. X
  2568. XGPIC_options()
  2569. X{
  2570. X  float x,y;
  2571. X  struct value a;
  2572. X  extern struct value *const_express();
  2573. X  extern double real();
  2574. X
  2575. X  GPIC_x=0;
  2576. X  GPIC_y=0;
  2577. X
  2578. X  if (!END_OF_COMMAND) {
  2579. X    x = real(const_express(&a));
  2580. X    if (!END_OF_COMMAND) {
  2581. X      y = real(const_express(&a));
  2582. X      GPIC_x = x;
  2583. X      GPIC_y = y;
  2584. X    }
  2585. X  }
  2586. X
  2587. X  sprintf(term_options, "Origin is at (%f,%f)",GPIC_x,GPIC_y);
  2588. X
  2589. X}
  2590. X
  2591. XGPIC_init()
  2592. X{
  2593. X  GPIC_linetype(-1);
  2594. X  fprintf(outfile, ".\\\"GNUPLOT: GROFF picture using the gpic preprocessor\n");
  2595. X}
  2596. X
  2597. X
  2598. XGPIC_scale(xs, ys)
  2599. X     double xs, ys;            /* scaling factors */
  2600. X{
  2601. X  register struct termentry *t = &term_tbl[term];
  2602. X
  2603. X  /* we change the table for use in graphics.c and GPIC_graphics */
  2604. X  t->xmax = (unsigned int)(GPIC_XMAX * xs);
  2605. X  t->ymax = (unsigned int)(GPIC_YMAX * ys);
  2606. X
  2607. X  return(TRUE);
  2608. X}
  2609. X
  2610. X
  2611. XGPIC_graphics()
  2612. X{
  2613. X  register struct termentry *t = &term_tbl[term];
  2614. X
  2615. X  fprintf(outfile, ".PS %f %f\n",GPIC_coord(t->xmax),
  2616. X      GPIC_coord(t->ymax));
  2617. X  fprintf(outfile,"x=%f; y=%f\n",GPIC_x, GPIC_y);
  2618. X}
  2619. X
  2620. X
  2621. XGPIC_text()
  2622. X{
  2623. X  GPIC_close_line();
  2624. X  fprintf(outfile, ".PE\n");
  2625. X}
  2626. X
  2627. XGPIC_linetype(linetype)
  2628. X     int linetype;
  2629. X{
  2630. X  if (linetype >= GPIC_NUMLINES-2)
  2631. X    linetype %= (GPIC_NUMLINES-2);
  2632. X  GPIC_ltype = linetype;
  2633. X}
  2634. X
  2635. XGPIC_close_line()
  2636. X{
  2637. X  if(GPIC_linecount>0) {
  2638. X    fprintf(outfile,"; reset linewid\n");
  2639. X    GPIC_linecount = 0;
  2640. X  }
  2641. X}
  2642. X
  2643. XGPIC_move(x,y)
  2644. X     unsigned int x,y;
  2645. X{
  2646. X  GPIC_close_line();
  2647. X  fprintf(outfile,"move to (x+%f,y+%f)\n",GPIC_coord(x),GPIC_coord(y));
  2648. X  GPIC_linecount = 1;
  2649. X}
  2650. X
  2651. X
  2652. XGPIC_vector(ux,uy)
  2653. X     unsigned int ux,uy;
  2654. X{
  2655. X  if(GPIC_linecount==1) {
  2656. X    fprintf(outfile,"line %s to (x+%f,y+%f)",
  2657. X        GPIC_lines[GPIC_ltype+2],
  2658. X        GPIC_coord(ux),GPIC_coord(uy));
  2659. X  } else {
  2660. X    fprintf(outfile," \\\n");
  2661. X    fprintf(outfile,"   then to (x+%f,y+%f)",GPIC_coord(ux),GPIC_coord(uy));
  2662. X  }
  2663. X  GPIC_linecount++;
  2664. X}
  2665. X
  2666. X
  2667. XGPIC_arrow(sx,sy, ex,ey, head)
  2668. X    int sx,sy, ex,ey;
  2669. X    TBOOLEAN head;
  2670. X{
  2671. X  GPIC_close_line();
  2672. X  if(head) {
  2673. X    fprintf(outfile,"arrowhead=7; arrow from x+%f,y+%f to x+%f,y+%f\n",
  2674. X        GPIC_coord(sx),GPIC_coord(sy),GPIC_coord(ex),GPIC_coord(ey));
  2675. X  } else { 
  2676. X    fprintf(outfile,"line from x+%f,y+%f to x+%f,y+%f\n",
  2677. X        GPIC_coord(sx),GPIC_coord(sy),GPIC_coord(ex),GPIC_coord(ey));
  2678. X  }
  2679. X}
  2680. X
  2681. X
  2682. XGPIC_put_text(x, y, str)
  2683. X    int x,y;                /* reference point of string */
  2684. X    char str[];            /* the text */
  2685. X{
  2686. X  GPIC_close_line();
  2687. X  fprintf(outfile, "\"%s\" ",str);
  2688. X  switch(GPIC_justify) {
  2689. X  case LEFT: {
  2690. X    fprintf(outfile,"ljust ");
  2691. X    break;
  2692. X  }
  2693. X  case CENTRE: {
  2694. X    fprintf(outfile," ");
  2695. X    break;
  2696. X  }
  2697. X  case RIGHT: {
  2698. X    fprintf(outfile,"rjust ");
  2699. X    break;
  2700. X  }
  2701. X  }
  2702. X  fprintf(outfile,"at x+%f,y+%f\n",GPIC_coord(x),GPIC_coord(y));
  2703. X}
  2704. X
  2705. X
  2706. X
  2707. Xint GPIC_justify_text(mode)
  2708. X    enum JUSTIFY mode;
  2709. X{
  2710. X  GPIC_justify = mode;
  2711. X  return (TRUE);
  2712. X}
  2713. X
  2714. Xint GPIC_text_angle(angle)
  2715. X    int angle;
  2716. X{
  2717. X  GPIC_close_line();
  2718. X  return (FALSE);
  2719. X}
  2720. X
  2721. XGPIC_reset()
  2722. X{
  2723. X  fflush(outfile);
  2724. X}
  2725. X
  2726. X
  2727. X
  2728. X
  2729. X
  2730. X
  2731. X
  2732. END_OF_FILE
  2733.   if test 4824 -ne `wc -c <'gnuplot/term/gpic.trm'`; then
  2734.     echo shar: \"'gnuplot/term/gpic.trm'\" unpacked with wrong size!
  2735.   fi
  2736.   # end of 'gnuplot/term/gpic.trm'
  2737. fi
  2738. if test -f 'gnuplot/term/t410x.trm' -a "${1}" != "-c" ; then 
  2739.   echo shar: Will not clobber existing file \"'gnuplot/term/t410x.trm'\"
  2740. else
  2741.   echo shar: Extracting \"'gnuplot/term/t410x.trm'\" \(5083 characters\)
  2742.   sed "s/^X//" >'gnuplot/term/t410x.trm' <<'END_OF_FILE'
  2743. X/*
  2744. X * $Id: t410x.trm%v 3.50.1.9 1993/08/05 05:38:59 woo Exp $
  2745. X *
  2746. X */
  2747. X
  2748. X/* GNUPLOT - t410x.trm */
  2749. X/*
  2750. X * Copyright (C) 1990 - 1993   
  2751. X *
  2752. X * Permission to use, copy, and distribute this software and its
  2753. X * documentation for any purpose with or without fee is hereby granted, 
  2754. X * provided that the above copyright notice appear in all copies and 
  2755. X * that both that copyright notice and this permission notice appear 
  2756. X * in supporting documentation.
  2757. X *
  2758. X * Permission to modify the software is granted, but not the right to
  2759. X * distribute the modified code.  Modifications are to be distributed 
  2760. X * as patches to released version.
  2761. X *  
  2762. X * This software  is provided "as is" without express or implied warranty.
  2763. X * 
  2764. X * This file is included by ../term.c.
  2765. X *
  2766. X * This terminal driver supports: Tektronix 410x and 420x series terminals
  2767. X *
  2768. X * AUTHORS
  2769. X *   Colin Kelley, Thomas Williams
  2770. X * 
  2771. X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  2772. X * 
  2773. X */
  2774. X
  2775. X/* Tektronix 410X and 420X driver written by Cary D. Renzema.
  2776. X * email address: caryr@vice.ico.tek.com
  2777. X *
  2778. X * I've tested this driver on the following terminals: 4106, 4107A, 4109
  2779. X * and 4207.  It should work, without editing, on other terminals in the
  2780. X * 410x and 420x families.  It will probably need to be changed to work
  2781. X * on a 4105 (screen size and character rotation are two guesses).  This
  2782. X * file can also be used as a start for a 411x driver.
  2783. X *
  2784. X * Cary R.
  2785. X * April 5, 1990
  2786. X */
  2787. X
  2788. X#ifdef T410X
  2789. X
  2790. X#define T410XXMAX 4095
  2791. X#define T410XYMAX 3131
  2792. X
  2793. X#define T410XVCHAR    71
  2794. X#define T410XHCHAR    51
  2795. X#define T410XVTIC    36
  2796. X#define T410XHTIC    36    
  2797. X
  2798. Xstatic int T410X_angle=0;
  2799. X
  2800. XT410X_init()
  2801. X{
  2802. X    (void) fprintf(outfile, "\033%%!0\033MN0\033MCB7C;\033MQ1\033MT1");
  2803. X    (void) fprintf(outfile, "\033MG1\033RK!\033SK!\033LZ\033%%!1");
  2804. X/*
  2805. X     1. set tek mode
  2806. X     2. set character path to 0 (characters placed equal to rotation)
  2807. X     3. set character size to 59 height
  2808. X     4. set character precision to string
  2809. X     5. set character text index to 1
  2810. X     6. set character write mode to overstrike
  2811. X     7. clear the view
  2812. X     8. clear the segments
  2813. X     9. clear the dialog buffer
  2814. X    10. set ansi mode
  2815. X*/
  2816. X    (void) fflush(outfile);
  2817. X}
  2818. X
  2819. X
  2820. XT410X_reset()
  2821. X{
  2822. X    (void) fprintf(outfile, "\033%%!0\033LZ\033%%!1");
  2823. X/*
  2824. X    1. set tek mode
  2825. X    2. clear the dialog buffer
  2826. X    3. set ansi mode
  2827. X*/
  2828. X    (void) fflush(outfile);
  2829. X}
  2830. X
  2831. X
  2832. XT410X_graphics()
  2833. X{
  2834. X    (void) fprintf(outfile, "\033%%!0\033\014\033LV0");
  2835. X/*
  2836. X    1. set tek mode
  2837. X    2. clear the screen
  2838. X    3. set dialog area invisible
  2839. X*/
  2840. X    (void) fflush(outfile);
  2841. X}
  2842. X
  2843. XT410X_text()
  2844. X{
  2845. X    (void) fprintf(outfile, "\033LV1\033%%!1");
  2846. X/*
  2847. X    1. set dialog area visible
  2848. X    2. set ansi mode
  2849. X*/
  2850. X    (void) fflush(outfile);
  2851. X}
  2852. X
  2853. X
  2854. XT410X_move(x, y)
  2855. Xunsigned int x, y;
  2856. X{
  2857. X    (void) fprintf(outfile, "\033LF");
  2858. X    (void) T410X_encode_x_y(x, y);
  2859. X    (void) fflush(outfile);
  2860. X}
  2861. X
  2862. X
  2863. XT410X_vector(x, y)
  2864. Xunsigned int x, y;
  2865. X{
  2866. X    (void) fprintf(outfile, "\033LG");
  2867. X    (void) T410X_encode_x_y(x, y);
  2868. X    (void) fflush(outfile);
  2869. X}
  2870. X
  2871. X
  2872. XT410X_point(x, y, number)
  2873. Xunsigned int x, y;
  2874. Xint number;
  2875. X{
  2876. X    (void) fprintf(outfile, "\033MM");
  2877. X    (void) T410X_encode_int(max(number, 0)%11);
  2878. X    (void) fprintf(outfile, "\033LH");
  2879. X    (void) T410X_encode_x_y(x, y);
  2880. X    (void) fflush(outfile);
  2881. X}
  2882. X
  2883. X
  2884. XT410X_linetype(linetype)
  2885. Xint linetype;
  2886. X{
  2887. X    switch (linetype) {
  2888. X        case -1:
  2889. X            (void) fprintf(outfile, "\033ML5");
  2890. X            break;
  2891. X        case -2:
  2892. X            (void) fprintf(outfile, "\033ML?");
  2893. X            break;
  2894. X        default:
  2895. X            (void) fprintf(outfile, "\033ML");
  2896. X            (void) T410X_encode_int(linetype%14+2);
  2897. X            break;
  2898. X    }
  2899. X    (void) fprintf(outfile, "\033MV");
  2900. X    (void) T410X_encode_int(max(linetype, 0)%8);
  2901. X    (void) fflush(outfile);
  2902. X}
  2903. X
  2904. X
  2905. XT410X_put_text(x, y, str)
  2906. Xunsigned int x, y;
  2907. Xchar str[];
  2908. X{
  2909. X
  2910. X    if (T410X_angle == 0) {
  2911. X        (void) T410X_move(x, y-T410XVCHAR/2+6);
  2912. X        (void) fprintf(outfile, "\033MR00");
  2913. X    } else {
  2914. X        (void) T410X_move(x+T410XHCHAR/2-6, y);
  2915. X        (void) fprintf(outfile, "\033MRE:0");
  2916. X    }
  2917. X    (void) fprintf(outfile, "\033LT");
  2918. X    (void) T410X_encode_int(strlen(str));
  2919. X    (void) fputs(str, outfile);
  2920. X    (void) fflush(outfile);
  2921. X}
  2922. X
  2923. XT410X_text_angle(ang)
  2924. Xint ang;
  2925. X{
  2926. X
  2927. X    T410X_angle = ang;
  2928. X    return(TRUE);
  2929. X}
  2930. X
  2931. X/* These last two routines are based on fortran code found in the
  2932. X * 4106/4107/4109/CX PROGRAMMERS manual.
  2933. X */
  2934. X
  2935. XT410X_encode_x_y(x, y)
  2936. Xunsigned int x, y;
  2937. X{
  2938. X    static char chix=0, chiy=0, cloy=0, ceb=0;
  2939. X
  2940. X    register unsigned int hix, lox, hiy, loy, eb, lx, ly;
  2941. X
  2942. X    lx = (x <= T410XXMAX) ? x : T410XXMAX;
  2943. X    ly = (y <= T410XYMAX) ? y : T410XYMAX;
  2944. X
  2945. X    hix = lx/128 + 32;
  2946. X    lox = (lx/4)%32 + 64;
  2947. X    hiy = ly/128 + 32;
  2948. X    loy = (ly/4)%32 + 96;
  2949. X    eb = (ly%4)*4 + lx%4 + 96;
  2950. X
  2951. X    if (chiy != hiy) (void) putc(hiy, outfile);
  2952. X    if (ceb != eb) (void) putc(eb, outfile);
  2953. X    if ((cloy!=loy) || (ceb!=eb) || (chix!=hix)) (void) putc(loy, outfile);
  2954. X    if (chix != hix) (void) putc(hix, outfile);
  2955. X    (void) putc(lox, outfile);
  2956. X
  2957. X    chix = hix;
  2958. X    chiy = hiy;
  2959. X    cloy = loy;
  2960. X    ceb = eb;
  2961. X}
  2962. X
  2963. X
  2964. XT410X_encode_int(number)
  2965. Xint number;
  2966. X{
  2967. X    register unsigned int mag, hi1, hi2, lo;
  2968. X
  2969. X    mag = abs(number);
  2970. X
  2971. X    hi1 = mag/1024 + 64;
  2972. X    hi2 = (mag/16)%64 + 64;
  2973. X    lo = mag%16 + 32;
  2974. X
  2975. X    if (number >= 0) lo += 16;
  2976. X
  2977. X    if (hi1 != 64) (void) putc(hi1, outfile);
  2978. X    if ((hi2 != 64) || (hi1 != 64)) (void) putc(hi2, outfile);
  2979. X    (void) putc(lo, outfile);
  2980. X
  2981. X}
  2982. X
  2983. X
  2984. X#endif /* T410X */
  2985. END_OF_FILE
  2986.   if test 5083 -ne `wc -c <'gnuplot/term/t410x.trm'`; then
  2987.     echo shar: \"'gnuplot/term/t410x.trm'\" unpacked with wrong size!
  2988.   fi
  2989.   # end of 'gnuplot/term/t410x.trm'
  2990. fi
  2991. echo shar: End of archive 29 \(of 33\).
  2992. cp /dev/null ark29isdone
  2993. MISSING=""
  2994. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
  2995.     if test ! -f ark${I}isdone ; then
  2996.     MISSING="${MISSING} ${I}"
  2997.     fi
  2998. done
  2999. if test "${MISSING}" = "" ; then
  3000.     echo You have unpacked all 33 archives.
  3001.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  3002. else
  3003.     echo You still must unpack the following archives:
  3004.     echo "        " ${MISSING}
  3005. fi
  3006. exit 0
  3007. exit 0 # Just in case...
  3008.