home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume14 / vplot / part08 < prev    next >
Encoding:
Internet Message Format  |  1988-03-28  |  57.8 KB

  1. Subject:  v14i013:  Device-independant graphics system, with drivers
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5. From: rsalz@uunet.uu.net
  6.  
  7. Submitted-by: Joe Dellinger <joe@hanauma.STANFORD.EDU>
  8. Posting-number: Volume 14, Issue 13
  9. Archive-name: vplot/part08
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 8 (of 24)."
  18. # Wrapped by rsalz@fig.bbn.com on Fri Mar 25 11:47:00 1988
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f 'Envision_device/envilib/enviclose.c' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'Envision_device/envilib/enviclose.c'\"
  22. else
  23. echo shar: Extracting \"'Envision_device/envilib/enviclose.c'\" \(1894 characters\)
  24. sed "s/^X//" >'Envision_device/envilib/enviclose.c' <<'END_OF_FILE'
  25. X/*
  26. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  27. X * University. Official permission to use this software is included in
  28. X * the documentation. It authorizes you to use this file for any
  29. X * non-commercial purpose, provided that this copyright notice is not
  30. X * removed and that any modifications made to this file are commented
  31. X * and dated in the style of my example below.
  32. X */
  33. X
  34. X/*
  35. X *
  36. X *  source file:   ./filters/envilib/enviclose.c
  37. X *
  38. X * Joe Dellinger (SEP), June 11 1987
  39. X *    Inserted this sample edit history entry.
  40. X *    Please log any further modifications made to this file:
  41. X */
  42. X
  43. X#include <stdio.h>
  44. X#include "../include/mesgcom.h"
  45. X#include "../include/closestat.h"
  46. X#include "envi.h"
  47. X
  48. X
  49. extern FILE    *pltout;
  50. X
  51. extern int      out_isatty;
  52. int             want_bell = 1;
  53. X
  54. enviclose (status)
  55. X    int             status;
  56. X{
  57. X    switch (status)
  58. X    {
  59. X    case CLOSE_FLUSH:
  60. X    fflush (pltout);
  61. X    break;
  62. X    case CLOSE_PAUSE:
  63. X    envisetmode (REG);
  64. X    if (want_bell == 1)
  65. X    {
  66. X        fprintf (pltout, "\007");
  67. X    }
  68. X    fflush (pltout);
  69. X    break;
  70. X    case CLOSE_NORMAL:
  71. X    break;
  72. X    case CLOSE_DONE:
  73. X    envisetmode (REG);
  74. X    if (out_isatty)
  75. X    {
  76. X        enviresetcolors ();
  77. X        envinograph ();
  78. X    }
  79. X    enviresetpan ();
  80. X    envicursoroff ();
  81. X    fflush (pltout);
  82. X    break;
  83. X    case CLOSE_ERROR:
  84. X    break;
  85. X    case CLOSE_INTERRUPT:
  86. X    envisetmode (REG);
  87. X    putc (US, pltout);
  88. X    putc (US, pltout);
  89. X    fprintf (pltout, "%c\n\n", ESC);
  90. X    putc (US, pltout);
  91. X    putc (US, pltout);
  92. X    putc (US, pltout);
  93. X    putc (US, pltout);
  94. X    putc (US, pltout);
  95. X    putc (US, pltout);
  96. X    fprintf (pltout, "%c\n", ESC);
  97. X    putc (US, pltout);
  98. X    enviresetcolors ();
  99. X    envinograph ();
  100. X    enviresetpan ();
  101. X    envicursoroff ();
  102. X    enviresetcolors ();
  103. X    envinograph ();
  104. X    enviresetpan ();
  105. X    fprintf (pltout, "%c\n", ESC);
  106. X    enviresetcolors ();
  107. X    envinograph ();
  108. X    enviresetpan ();
  109. X    envicursoroff ();
  110. X    fflush (pltout);
  111. X    break;
  112. X    case CLOSE_NOTHING:
  113. X    break;
  114. X    default:
  115. X    break;
  116. X    }
  117. X}
  118. END_OF_FILE
  119. if test 1894 -ne `wc -c <'Envision_device/envilib/enviclose.c'`; then
  120.     echo shar: \"'Envision_device/envilib/enviclose.c'\" unpacked with wrong size!
  121. fi
  122. # end of 'Envision_device/envilib/enviclose.c'
  123. fi
  124. if test -f 'Envision_device/envilib/enviconf.c' -a "${1}" != "-c" ; then 
  125.   echo shar: Will not clobber existing file \"'Envision_device/envilib/enviconf.c'\"
  126. else
  127. echo shar: Extracting \"'Envision_device/envilib/enviconf.c'\" \(1994 characters\)
  128. sed "s/^X//" >'Envision_device/envilib/enviconf.c' <<'END_OF_FILE'
  129. X/*
  130. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  131. X * University. Official permission to use this software is included in
  132. X * the documentation. It authorizes you to use this file for any
  133. X * non-commercial purpose, provided that this copyright notice is not
  134. X * removed and that any modifications made to this file are commented
  135. X * and dated in the style of my example below.
  136. X */
  137. X
  138. X/*
  139. X *
  140. X *  source file:   ./filters/envilib/enviconf.c
  141. X *
  142. X * Joe Dellinger (SEP), June 11 1987
  143. X *    Inserted this sample edit history entry.
  144. X *    Please log any further modifications made to this file:
  145. X */
  146. X
  147. X/*
  148. X * Envision configuration, models 215 and 220.
  149. X * The only difference between these two is in the open routine.
  150. X * Several configuration variables are reset.
  151. X * Keyword: envision pen vplot
  152. X */
  153. X#include <stdio.h>
  154. X#include "../include/extern.h"
  155. X
  156. X/*
  157. X * mandatory declarations
  158. X */
  159. X#ifdef SEP
  160. char            name[] = "Envipen";
  161. X#else
  162. char            name[] = "envipen";
  163. X#endif
  164. X#include "envidoc.h"
  165. X
  166. X/*
  167. X * device routine table
  168. X */
  169. extern int
  170. enviopen (), envireset (), envimessage (), envierase (), enviclose ();
  171. extern int
  172. genvector (), gentext (), genraster1 ();
  173. extern int      enviattributes ();
  174. extern int
  175. enviplot (), envistartpoly (), envimidpoly (), enviendpoly ();
  176. extern int
  177. genarea (), envipoint (), genmarker ();
  178. extern int
  179. envigetpoint (), vecarea (), nulldev (), geninteract ();
  180. X
  181. struct device   dev =
  182. X{
  183. X /* control routines */
  184. X enviopen,        /* open */
  185. X envireset,        /* reset */
  186. X envimessage,        /* message */
  187. X envierase,        /* erase */
  188. X enviclose,        /* close */
  189. X
  190. X /* high level output */
  191. X genvector,        /* vector */
  192. X genmarker,        /* marker */
  193. X gentext,        /* text */
  194. X genarea,        /* area */
  195. X genraster1,        /* raster */
  196. X envipoint,        /* point */
  197. X enviattributes,    /* attributes */
  198. X
  199. X /* input */
  200. X envigetpoint,        /* getpoint */
  201. X geninteract,        /* interact */
  202. X
  203. X /* low level output */
  204. X enviplot,        /* plot */
  205. X envistartpoly,        /* startpoly */
  206. X envimidpoly,        /* midpoly */
  207. X enviendpoly        /* endpoly */
  208. X};
  209. END_OF_FILE
  210. if test 1994 -ne `wc -c <'Envision_device/envilib/enviconf.c'`; then
  211.     echo shar: \"'Envision_device/envilib/enviconf.c'\" unpacked with wrong size!
  212. fi
  213. # end of 'Envision_device/envilib/enviconf.c'
  214. fi
  215. if test -f 'Imagen_device/imaglib/imagclose.c' -a "${1}" != "-c" ; then 
  216.   echo shar: Will not clobber existing file \"'Imagen_device/imaglib/imagclose.c'\"
  217. else
  218. echo shar: Extracting \"'Imagen_device/imaglib/imagclose.c'\" \(1844 characters\)
  219. sed "s/^X//" >'Imagen_device/imaglib/imagclose.c' <<'END_OF_FILE'
  220. X/*
  221. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  222. X * University. Official permission to use this software is included in
  223. X * the documentation. It authorizes you to use this file for any
  224. X * non-commercial purpose, provided that this copyright notice is not
  225. X * removed and that any modifications made to this file are commented
  226. X * and dated in the style of my example below.
  227. X */
  228. X
  229. X/*
  230. X *
  231. X *  source file:   ./filters/imaglib/imagclose.c
  232. X *
  233. X * Joe Dellinger (SEP), June 11 1987
  234. X *    Inserted this sample edit history entry.
  235. X *    Please log any further modifications made to this file:
  236. X */
  237. X
  238. X/* Routine to finish up */
  239. X#include <stdio.h>
  240. X#include "../include/closestat.h"
  241. X#include "../include/enum.h"
  242. X#include "../include/extern.h"
  243. X#include "../include/err.h"
  244. X#include "imagen.h"
  245. X
  246. imagclose (status)
  247. X    int             status;
  248. X{
  249. char            system_call[120];
  250. extern int      system ();
  251. X
  252. X    switch (status)
  253. X    {
  254. X    case CLOSE_FLUSH:
  255. X    fflush (pltout);
  256. X    break;
  257. X    case CLOSE_NORMAL:
  258. X    if (tex == YES)
  259. X        fprintf (pltout, "%c", POP);
  260. X    if (stripped == NO)
  261. X        fprintf (pltout, "%c", EOPLOT);
  262. X    /*
  263. X     * If we created a temporary file, ipr it and tell it to remove it
  264. X     * when done. 
  265. X     */
  266. X    if (file_created)
  267. X    {
  268. X        fclose (pltout);
  269. X        sprintf (system_call, "lpr -Pim -r -s -v %s\n", scratch_file);
  270. X        if (0 == system (system_call))
  271. X        {
  272. X        file_created = NO;
  273. X        }
  274. X        else
  275. X        {
  276. X        /* else figure we'll need to delete scratch file outselves */
  277. X        ERR (WARN, name, "Couldn't get lpr to cooperate\n");
  278. X        }
  279. X    }
  280. X    break;
  281. X    case CLOSE_ERROR:
  282. X    case CLOSE_NOTHING:
  283. X    case CLOSE_INTERRUPT:
  284. X    break;
  285. X    case CLOSE_DONE:
  286. X    /*
  287. X     * If we created a temporary file, remove it 
  288. X     */
  289. X    if (file_created)
  290. X        unlink (scratch_file);
  291. X    break;
  292. X    case CLOSE_PAUSE:
  293. X    break;
  294. X    default:            /* not meant for us, ignore */
  295. X    break;
  296. X    }
  297. X}
  298. END_OF_FILE
  299. if test 1844 -ne `wc -c <'Imagen_device/imaglib/imagclose.c'`; then
  300.     echo shar: \"'Imagen_device/imaglib/imagclose.c'\" unpacked with wrong size!
  301. fi
  302. # end of 'Imagen_device/imaglib/imagclose.c'
  303. fi
  304. if test -f 'Imagen_device/imaglib/imagconf.c' -a "${1}" != "-c" ; then 
  305.   echo shar: Will not clobber existing file \"'Imagen_device/imaglib/imagconf.c'\"
  306. else
  307. echo shar: Extracting \"'Imagen_device/imaglib/imagconf.c'\" \(1858 characters\)
  308. sed "s/^X//" >'Imagen_device/imaglib/imagconf.c' <<'END_OF_FILE'
  309. X/*
  310. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  311. X * University. Official permission to use this software is included in
  312. X * the documentation. It authorizes you to use this file for any
  313. X * non-commercial purpose, provided that this copyright notice is not
  314. X * removed and that any modifications made to this file are commented
  315. X * and dated in the style of my example below.
  316. X */
  317. X
  318. X/*
  319. X *
  320. X *  source file:   ./filters/imaglib/imagconf.c
  321. X *
  322. X * Joe Dellinger (SEP), June 11 1987
  323. X *    Inserted this sample edit history entry.
  324. X *    Please log any further modifications made to this file:
  325. X */
  326. X
  327. X/*
  328. X * Imagen 8/300 configuration
  329. X * Keyword: vplot imagen pen
  330. X */
  331. X#include <stdio.h>
  332. X#include "../include/enum.h"
  333. X#include "../include/extern.h"
  334. X
  335. X/*
  336. X * mandatory declarations and initializations
  337. X */
  338. X#ifdef SEP
  339. char            name[] = "Imagpen";
  340. X#else
  341. char            name[] = "imagpen";
  342. X#endif
  343. X#include "imagdoc.h"
  344. X
  345. X/*
  346. X * device routine table
  347. X */
  348. extern int
  349. imagopen (), imagreset (), imagerase (), imagclose ();
  350. extern int
  351. imagvector (), imagplot (), imagattributes ();
  352. extern int
  353. gentext (), imagraster (), genmessage (), hersheytext ();
  354. extern int
  355. genarea (), genmarker (), genpoint ();
  356. extern int
  357. nulldev (), imagstartpoly (), imagmidpoly (), imagendpoly ();
  358. X
  359. struct device   dev =
  360. X{
  361. X
  362. X /* control routines */
  363. X imagopen,        /* open */
  364. X imagreset,        /* reset */
  365. X genmessage,        /* message */
  366. X imagerase,        /* erase */
  367. X imagclose,        /* close */
  368. X
  369. X /* high level output */
  370. X imagvector,        /* vector */
  371. X genmarker,        /* marker */
  372. X gentext,        /* text */
  373. X genarea,        /* area */
  374. X imagraster,        /* raster */
  375. X genpoint,        /* point */
  376. X imagattributes,    /* attributes */
  377. X
  378. X /* input */
  379. X nulldev,        /* getpoint */
  380. X nulldev,        /* interact */
  381. X
  382. X /* low level output */
  383. X imagplot,        /* plot */
  384. X imagstartpoly,        /* startpoly */
  385. X imagmidpoly,        /* midpoly */
  386. X imagendpoly        /* endpoly */
  387. X};
  388. END_OF_FILE
  389. if test 1858 -ne `wc -c <'Imagen_device/imaglib/imagconf.c'`; then
  390.     echo shar: \"'Imagen_device/imaglib/imagconf.c'\" unpacked with wrong size!
  391. fi
  392. # end of 'Imagen_device/imaglib/imagconf.c'
  393. fi
  394. if test -f 'Masscomp_device/gpslib/known_bugs' -a "${1}" != "-c" ; then 
  395.   echo shar: Will not clobber existing file \"'Masscomp_device/gpslib/known_bugs'\"
  396. else
  397. echo shar: Extracting \"'Masscomp_device/gpslib/known_bugs'\" \(1902 characters\)
  398. sed "s/^X//" >'Masscomp_device/gpslib/known_bugs' <<'END_OF_FILE'
  399. This does not put out GPS records directly, instead it calls MC/PLOT
  400. library routines.  For this reason gpspen only compiles and runs on
  401. the Masscomp as it links with several of their libraries.
  402. X
  403. On the Masscomp you have to issue the   universe ucb   command in
  404. order for this to compile and run correctly.
  405. X
  406. Don't know how to erase a GPS window.  GPS doesn't appear to have
  407. this notion.
  408. X
  409. There's no GPS notion of area fill, and this is painfully slow with vector draws.
  410. X
  411. Color is a real hash here.  I need to build a crpf.config
  412. ascii file with all sorts of junk in it to make this work well.
  413. For now you can rely on the standard colors 0 to 7 (though 0
  414. may not erase).
  415. X
  416. The mcd command can give you a softcopy preview but the colors won't match
  417. the ones you asked for. Different defaults than the crpf command.
  418. X
  419. The Masscomp truncates filenames to 16 characters!  Ouch Ouch Ouch!
  420. This wreaks havoc in loclib, with getpar_string_store.c and getpar_decode.c
  421. and anything that calls it.  Also several of the test files and I don't
  422. remember what else.  (Oh yes, include/font_definition.h)
  423. X
  424. You need to install vplot.h in one of the standard include libraries before
  425. attempting to make any pen filter, including gpspen.
  426. X
  427. You may need to fix up the location of the vplot text fonts in include/param.h
  428. I did at least.  You also need to fix up filters/machdep.  The link library
  429. list for MC/PLOT is as long as your arm!
  430. X
  431. A good color scheme for a graphics tube may look bad on hardcopy because
  432. the background is white, not black.  Watch out for yellow, especially.
  433. X
  434. The aspect ratio will need some work.  The mcd previews generally fill
  435. the screen, or at least large portions of it, but the color hardcopy
  436. is covering only about half the sheet.
  437. X
  438. Setting ppi=300 does significantly speed up the plotting, but the lines
  439. come out awfully thin.  (The overall plot stays the same height and width.)
  440. X
  441. X    - Stew Levin
  442. END_OF_FILE
  443. if test 1902 -ne `wc -c <'Masscomp_device/gpslib/known_bugs'`; then
  444.     echo shar: \"'Masscomp_device/gpslib/known_bugs'\" unpacked with wrong size!
  445. fi
  446. # end of 'Masscomp_device/gpslib/known_bugs'
  447. fi
  448. if test -f 'Printronix_device/lprlib/lpropen.c' -a "${1}" != "-c" ; then 
  449.   echo shar: Will not clobber existing file \"'Printronix_device/lprlib/lpropen.c'\"
  450. else
  451. echo shar: Extracting \"'Printronix_device/lprlib/lpropen.c'\" \(1995 characters\)
  452. sed "s/^X//" >'Printronix_device/lprlib/lpropen.c' <<'END_OF_FILE'
  453. X/*
  454. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  455. X * University. Official permission to use this software is included in
  456. X * the documentation. It authorizes you to use this file for any
  457. X * non-commercial purpose, provided that this copyright notice is not
  458. X * removed and that any modifications made to this file are commented
  459. X * and dated in the style of my example below.
  460. X */
  461. X
  462. X/*
  463. X *
  464. X *  source file:   ./filters/lprlib/lpropen.c
  465. X *
  466. X * Joe Dellinger (SEP), June 11 1987
  467. X *    Inserted this sample edit history entry.
  468. X *    Please log any further modifications made to this file:
  469. X */
  470. X
  471. X#include <stdio.h>
  472. X#include "../include/err.h"
  473. X#include "../include/enum.h"
  474. X#include "../include/extern.h"
  475. X#include "../include/params.h"
  476. X#include "lprpen.h"
  477. X
  478. X/* raster memory */
  479. short          *mem;    /* front of bit map */
  480. int             xlimit = XSTRSZ;
  481. char            inbuf[BUFSIZ];    /* input buffer -used by getc/h */
  482. short           line[NYW + 1];    /* buffer for one raster line */
  483. X
  484. int             file_created = NO;
  485. char            spoolfile[100];
  486. char            mapfile[100] = "default";
  487. X
  488. lpropen ()
  489. X{
  490. X/*
  491. X * physical device parameters
  492. X */
  493. X    dev_xmax = 3000;
  494. X    dev_ymax = 791;
  495. X    dev_xmin = 0;
  496. X    dev_ymin = 0;
  497. X    pixels_per_inch = 72.0;
  498. X    aspect_ratio = 1.2023;
  499. X    num_col = 0;
  500. X
  501. X/*
  502. X * device capabilities
  503. X */
  504. X    need_end_erase = YES;
  505. X    buffer_output = YES;
  506. X    smart_clip = NO;
  507. X    mono = YES;
  508. X    dither = 3;
  509. X    pixc = 0.6;
  510. X    greyc = -0.5;
  511. X
  512. X/* Since this is a hard copy device, might as well use a nice font */
  513. X    txfont = DEFAULT_HARDCOPY_FONT;
  514. X    txprec = DEFAULT_HARDCOPY_PREC;
  515. X
  516. X    epause = 0;
  517. X    endpause = NO;
  518. X    size = ABSOLUTE;
  519. X    if (isatty (fileno (pltout)))
  520. X    {
  521. X    file_created = YES;
  522. X    sprintf (spoolfile, "%s%s", LPR_SPOOL, "/lprpen_XXXXXX");
  523. X    mktemp (spoolfile);
  524. X    pltout = fopen (spoolfile, "w");
  525. X    if (pltout == NULL)
  526. X    {
  527. X        ERR (FATAL, name, "could not open spool file %s!",
  528. X         spoolfile);
  529. X    }
  530. X    }
  531. X
  532. X    mem = (short *) malloc (2 * XSTRSZ * NYW);
  533. X}
  534. END_OF_FILE
  535. if test 1995 -ne `wc -c <'Printronix_device/lprlib/lpropen.c'`; then
  536.     echo shar: \"'Printronix_device/lprlib/lpropen.c'\" unpacked with wrong size!
  537. fi
  538. # end of 'Printronix_device/lprlib/lpropen.c'
  539. fi
  540. if test -f 'RasterTek_device/rteklib/rtekconf.c' -a "${1}" != "-c" ; then 
  541.   echo shar: Will not clobber existing file \"'RasterTek_device/rteklib/rtekconf.c'\"
  542. else
  543. echo shar: Extracting \"'RasterTek_device/rteklib/rtekconf.c'\" \(1825 characters\)
  544. sed "s/^X//" >'RasterTek_device/rteklib/rtekconf.c' <<'END_OF_FILE'
  545. X/*
  546. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  547. X * University. Official permission to use this software is included in
  548. X * the documentation. It authorizes you to use this file for any
  549. X * non-commercial purpose, provided that this copyright notice is not
  550. X * removed and that any modifications made to this file are commented
  551. X * and dated in the style of my example below.
  552. X */
  553. X
  554. X/*
  555. X *
  556. X *  source file:   ./filters/rteklib/rtekconf.c
  557. X *
  558. X * Joe Dellinger (SEP), June 11 1987
  559. X *    Inserted this sample edit history entry.
  560. X *    Please log any further modifications made to this file:
  561. X */
  562. X
  563. X#include "rtekpen.h"
  564. X
  565. X/* declarations */
  566. X#ifdef SEP
  567. char            name[] = "Rpen";
  568. X#else
  569. char            name[] = "rpen";
  570. X#endif
  571. X#include "rtekdoc.h"
  572. X
  573. X/* physical device size */
  574. int             version = 1 - 75;
  575. X
  576. X/* device routine table */
  577. extern
  578. rtekopen (), rtekclose (), rtekplot (), rtekerase (), rtekattributes ();
  579. extern
  580. rtekpoint (), rtekarea (), rtekraster (), rtekgetpoint ();
  581. extern
  582. nulldev (), genmessage (), genvector (), genmarker (), gentext ();
  583. extern
  584. vecarea (), genpatarea (), geninteract ();
  585. X
  586. struct device   dev = {
  587. X /* control routines */
  588. X               rtekopen,    /* open */
  589. X               nulldev,    /* reset */
  590. X               genmessage,    /* message */
  591. X               rtekerase,    /* erase */
  592. X               rtekclose,    /* close */
  593. X /* high level output */
  594. X               genvector,    /* vector */
  595. X               genmarker,    /* marker */
  596. X               gentext,    /* text */
  597. X               genpatarea,    /* area */
  598. X               rtekraster,    /* raster */
  599. X               rtekpoint,    /* point */
  600. X               rtekattributes,    /* attributes */
  601. X /* input */
  602. X               rtekgetpoint,    /* getpoint */
  603. X               geninteract,    /* interact */
  604. X /* low level output */
  605. X               rtekplot,    /* plot */
  606. X               nulldev,    /* startpoly */
  607. X               nulldev,    /* midpoly */
  608. X               nulldev    /* endpoly */
  609. X};
  610. END_OF_FILE
  611. if test 1825 -ne `wc -c <'RasterTek_device/rteklib/rtekconf.c'`; then
  612.     echo shar: \"'RasterTek_device/rteklib/rtekconf.c'\" unpacked with wrong size!
  613. fi
  614. # end of 'RasterTek_device/rteklib/rtekconf.c'
  615. fi
  616. if test -f 'Regis_device/gigilib/gigiconf.c' -a "${1}" != "-c" ; then 
  617.   echo shar: Will not clobber existing file \"'Regis_device/gigilib/gigiconf.c'\"
  618. else
  619. echo shar: Extracting \"'Regis_device/gigilib/gigiconf.c'\" \(1909 characters\)
  620. sed "s/^X//" >'Regis_device/gigilib/gigiconf.c' <<'END_OF_FILE'
  621. X/*
  622. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  623. X * University. Official permission to use this software is included in
  624. X * the documentation. It authorizes you to use this file for any
  625. X * non-commercial purpose, provided that this copyright notice is not
  626. X * removed and that any modifications made to this file are commented
  627. X * and dated in the style of my example below.
  628. X */
  629. X
  630. X/*
  631. X *
  632. X *  source file:   ./filters/gigilib/gigiconf.c
  633. X *
  634. X * Joe Dellinger (SEP), June 11 1987
  635. X *    Inserted this sample edit history entry.
  636. X *    Please log any further modifications made to this file:
  637. X */
  638. X
  639. X/*
  640. X * Keywords: DEC gigi pen vplot
  641. X * DEC GIGI configuration
  642. X */
  643. X#include <stdio.h>
  644. X#include "../include/enum.h"
  645. X#include "../include/extern.h"
  646. X
  647. char            name[] = "gigipen";
  648. X#include "gigidoc.h"
  649. X
  650. X/*
  651. X * device routine table structure
  652. X */
  653. extern int
  654. gigiopen (), gigireset (), gigimessage (), gigierase (), gigiclose ();
  655. extern int
  656. genvector (), gentext (), genraster1 ();
  657. extern int      gigiattributes ();
  658. extern int
  659. gigiplot (), gigistartpoly (), gigimidpoly (), gigiendpoly ();
  660. extern int
  661. vecarea (), genpoint (), genmarker ();
  662. extern int
  663. gigigetpoint (), nulldev (), geninteract ();
  664. X
  665. struct device   dev = {
  666. X
  667. X /* control routines */
  668. X               gigiopen,    /* open */
  669. X               gigireset,    /* reset */
  670. X               gigimessage,    /* message */
  671. X               gigierase,    /* erase */
  672. X               gigiclose,    /* close */
  673. X
  674. X /* high level output */
  675. X               genvector,    /* vector */
  676. X               genmarker,    /* marker */
  677. X               gentext,    /* text */
  678. X               vecarea,    /* area */
  679. X               genraster1,    /* raster */
  680. X               genpoint,    /* point */
  681. X               gigiattributes,    /* attributes */
  682. X
  683. X /* input */
  684. X               gigigetpoint,    /* getpoint */
  685. X               geninteract,    /* interact */
  686. X
  687. X /* low level output */
  688. X               gigiplot,    /* plot */
  689. X               nulldev,    /* startpoly */
  690. X               nulldev,    /* midpoly */
  691. X               nulldev    /* endpoly */
  692. X};
  693. END_OF_FILE
  694. if test 1909 -ne `wc -c <'Regis_device/gigilib/gigiconf.c'`; then
  695.     echo shar: \"'Regis_device/gigilib/gigiconf.c'\" unpacked with wrong size!
  696. fi
  697. # end of 'Regis_device/gigilib/gigiconf.c'
  698. fi
  699. if test -f 'Regis_device/gigilib/gigimessage.c' -a "${1}" != "-c" ; then 
  700.   echo shar: Will not clobber existing file \"'Regis_device/gigilib/gigimessage.c'\"
  701. else
  702. echo shar: Extracting \"'Regis_device/gigilib/gigimessage.c'\" \(2009 characters\)
  703. sed "s/^X//" >'Regis_device/gigilib/gigimessage.c' <<'END_OF_FILE'
  704. X/*
  705. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  706. X * University. Official permission to use this software is included in
  707. X * the documentation. It authorizes you to use this file for any
  708. X * non-commercial purpose, provided that this copyright notice is not
  709. X * removed and that any modifications made to this file are commented
  710. X * and dated in the style of my example below.
  711. X */
  712. X
  713. X/*
  714. X *
  715. X *  source file:   ./filters/gigilib/gigimessage.c
  716. X *
  717. X * Joe Dellinger (SEP), June 11 1987
  718. X *    Inserted this sample edit history entry.
  719. X *    Please log any further modifications made to this file:
  720. X */
  721. X
  722. X/*
  723. X * Device dependent subroutine to handle text operations
  724. X * Not one of the GIGI's strong points. (Indeed if it has any)
  725. X */
  726. X#include <stdio.h>
  727. X#include <strings.h>
  728. X#include "gigi.h"
  729. X#include "../include/mesgcom.h"
  730. X
  731. extern FILE    *pltout;
  732. X
  733. int             messagecount = 0;
  734. X
  735. gigimessage (command, string)
  736. X    int             command;
  737. X    char            string[];
  738. X{
  739. int             count;
  740. static int      first = 0;
  741. X    switch (command)
  742. X    {
  743. X    case MESG_OFF:
  744. X    case MESG_ON:
  745. X    case MESG_ERASE:
  746. X    break;
  747. X    case MESG_HOME:
  748. X    fprintf (pltout, ";P[0,0];");
  749. X    break;
  750. X    case MESG_READY:
  751. X    if (lastop != '\0')
  752. X    {
  753. X        fprintf (pltout, ";P[0,0];T(BS1D0I0");
  754. X        first = 1;
  755. X    }
  756. X    break;
  757. X    case MESG_DONE:
  758. X    if (first == 1)
  759. X    {
  760. X        first = 0;
  761. X        fprintf (pltout, ")");
  762. X    }
  763. X    if (lastop != '\0')
  764. X        fprintf (pltout, "T(E);");
  765. X    break;
  766. X
  767. X    case MESG_HIGHLIGHT_ON:
  768. X    fprintf (pltout, "W(A1N0I7R)");
  769. X    break;
  770. X
  771. X    case MESG_HIGHLIGHT_OFF:
  772. X    gigimessage (MESG_DONE);
  773. X    gigimessage (MESG_READY);
  774. X    break;
  775. X    case MESG_TEXT:
  776. X    if (strcmp ("\n", string))
  777. X    {
  778. X        if (first == 1)
  779. X        {
  780. X        first = 0;
  781. X        fprintf (pltout, ")");
  782. X        }
  783. X        if (lastop != '\0')
  784. X        {
  785. X        fprintf (pltout, "\"");
  786. X        for (count = messagecount; count > 0; count--)
  787. X            fprintf (pltout, "\n");
  788. X        }
  789. X        fprintf (pltout, "%s", string);
  790. X        if (lastop != '\0')
  791. X        {
  792. X        messagecount++;
  793. X        fprintf (pltout, "\"");
  794. X        }
  795. X    }
  796. X    break;
  797. X    }
  798. X}
  799. END_OF_FILE
  800. if test 2009 -ne `wc -c <'Regis_device/gigilib/gigimessage.c'`; then
  801.     echo shar: \"'Regis_device/gigilib/gigimessage.c'\" unpacked with wrong size!
  802. fi
  803. # end of 'Regis_device/gigilib/gigimessage.c'
  804. fi
  805. if test -f 'Tek_device/cteklib/ctekconf.c' -a "${1}" != "-c" ; then 
  806.   echo shar: Will not clobber existing file \"'Tek_device/cteklib/ctekconf.c'\"
  807. else
  808. echo shar: Extracting \"'Tek_device/cteklib/ctekconf.c'\" \(2030 characters\)
  809. sed "s/^X//" >'Tek_device/cteklib/ctekconf.c' <<'END_OF_FILE'
  810. X/*
  811. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  812. X * University. Official permission to use this software is included in
  813. X * the documentation. It authorizes you to use this file for any
  814. X * non-commercial purpose, provided that this copyright notice is not
  815. X * removed and that any modifications made to this file are commented
  816. X * and dated in the style of my example below.
  817. X */
  818. X
  819. X/*
  820. X *
  821. X *  source file:   ./filters/cteklib/ctekconf.c
  822. X *
  823. X * Joe Dellinger (SEP), June 11 1987
  824. X *    Inserted this sample edit history entry.
  825. X *    Please log any further modifications made to this file:
  826. X */
  827. X
  828. X/*
  829. X * Tek 4100 series configuration
  830. X * Keywords: pen vplot tek
  831. X */
  832. X#include <stdio.h>
  833. X#include "../include/enum.h"
  834. X#include "../include/extern.h"
  835. X
  836. X/*
  837. X * mandatory declarations and initializations
  838. X */
  839. X#ifdef SEP
  840. char            name[] = "Ctekpen";
  841. X#else
  842. char            name[] = "ctekpen";
  843. X#endif
  844. X#include "ctekdoc.h"
  845. X
  846. X/*
  847. X * device routine table
  848. X */
  849. extern int
  850. ctekopen (), ctekreset (), ctekmessage (), ctekerase (), ctekclose ();
  851. extern int
  852. ctekattributes (), ctekstartpoly (), ctekmidpoly (), ctekendpoly ();
  853. extern int
  854. genvector (), gentext (), ctekraster ();
  855. extern int
  856. ctekplot (), ctekgetpoint ();
  857. extern int
  858. genpatarea (), genpoint (), genmarker ();
  859. extern int
  860. nulldev (), geninteract ();
  861. X
  862. struct device   dev = {
  863. X
  864. X /* control routines */
  865. X               ctekopen,    /* open */
  866. X               ctekreset,    /* reset */
  867. X               ctekmessage,    /* message */
  868. X               ctekerase,    /* erase */
  869. X               ctekclose,    /* close */
  870. X
  871. X /* high level output */
  872. X               genvector,    /* vector */
  873. X               genmarker,    /* marker */
  874. X               gentext,    /* text */
  875. X               genpatarea,    /* area */
  876. X               ctekraster,    /* raster */
  877. X               genpoint,    /* point */
  878. X               ctekattributes,    /* attributes */
  879. X
  880. X /* input */
  881. X               ctekgetpoint,    /* getpoint */
  882. X               geninteract,    /* interact */
  883. X
  884. X /* low level output */
  885. X               ctekplot,    /* plot */
  886. X               ctekstartpoly,    /* startpoly */
  887. X               ctekmidpoly,    /* midpoly */
  888. X               ctekendpoly,    /* endpoly */
  889. X};
  890. END_OF_FILE
  891. if test 2030 -ne `wc -c <'Tek_device/cteklib/ctekconf.c'`; then
  892.     echo shar: \"'Tek_device/cteklib/ctekconf.c'\" unpacked with wrong size!
  893. fi
  894. # end of 'Tek_device/cteklib/ctekconf.c'
  895. fi
  896. if test -f 'Tek_device/teklib/tekconf.c' -a "${1}" != "-c" ; then 
  897.   echo shar: Will not clobber existing file \"'Tek_device/teklib/tekconf.c'\"
  898. else
  899. echo shar: Extracting \"'Tek_device/teklib/tekconf.c'\" \(1929 characters\)
  900. sed "s/^X//" >'Tek_device/teklib/tekconf.c' <<'END_OF_FILE'
  901. X/*
  902. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  903. X * University. Official permission to use this software is included in
  904. X * the documentation. It authorizes you to use this file for any
  905. X * non-commercial purpose, provided that this copyright notice is not
  906. X * removed and that any modifications made to this file are commented
  907. X * and dated in the style of my example below.
  908. X */
  909. X
  910. X/*
  911. X *
  912. X *  source file:   ./filters/teklib/tekconf.c
  913. X *
  914. X * Joe Dellinger (SEP), June 11 1987
  915. X *    Inserted this sample edit history entry.
  916. X *    Please log any further modifications made to this file:
  917. X */
  918. X
  919. X/*
  920. X * tektronix 4010-4014 configuration
  921. X * distinctive attributes of emulators are dealt with in tekopen.c
  922. X */
  923. X#include <stdio.h>
  924. X#include "../include/enum.h"
  925. X#include "../include/extern.h"
  926. X
  927. X/*
  928. X * mandatory declarations and initializations
  929. X */
  930. X#ifdef SEP
  931. char            name[] = "Tekpen";
  932. X#else
  933. char            name[] = "tekpen";
  934. X#endif
  935. X#include "tekdoc.h"
  936. X
  937. X/*
  938. X * device routine table
  939. X */
  940. extern int
  941. tekopen (), tekmessage (), tekerase (), tekclose ();
  942. extern int
  943. genvector (), gentext (), genraster (), genmarker ();
  944. extern int
  945. tekplot (), tekpoint ();
  946. extern int
  947. vecarea (), geninteract ();
  948. extern int      nulldev ();
  949. X
  950. struct device   dev = {
  951. X
  952. X /* control routines */
  953. X               tekopen,    /* open */
  954. X               nulldev,    /* reset */
  955. X               tekmessage,    /* message */
  956. X               tekerase,    /* erase */
  957. X               tekclose,    /* close */
  958. X
  959. X /* high level output */
  960. X               genvector,    /* vector */
  961. X               genmarker,    /* marker */
  962. X               gentext,    /* text */
  963. X               nulldev /*vecarea*/ ,    /* area */
  964. X               genraster,    /* raster */
  965. X               tekpoint,    /* point */
  966. X               nulldev,    /* attributes */
  967. X
  968. X /* input */
  969. X               nulldev,    /* getpoint */
  970. X               geninteract,    /* interact */
  971. X
  972. X /* low level output */
  973. X               tekplot,    /* plot */
  974. X               nulldev,    /* startpoly */
  975. X               nulldev,    /* midpoly */
  976. X               nulldev    /* endpoly */
  977. X};
  978. END_OF_FILE
  979. if test 1929 -ne `wc -c <'Tek_device/teklib/tekconf.c'`; then
  980.     echo shar: \"'Tek_device/teklib/tekconf.c'\" unpacked with wrong size!
  981. fi
  982. # end of 'Tek_device/teklib/tekconf.c'
  983. fi
  984. if test -f 'Tek_device/teklib/tekpack.c' -a "${1}" != "-c" ; then 
  985.   echo shar: Will not clobber existing file \"'Tek_device/teklib/tekpack.c'\"
  986. else
  987. echo shar: Extracting \"'Tek_device/teklib/tekpack.c'\" \(2040 characters\)
  988. sed "s/^X//" >'Tek_device/teklib/tekpack.c' <<'END_OF_FILE'
  989. X/*
  990. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  991. X * University. Official permission to use this software is included in
  992. X * the documentation. It authorizes you to use this file for any
  993. X * non-commercial purpose, provided that this copyright notice is not
  994. X * removed and that any modifications made to this file are commented
  995. X * and dated in the style of my example below.
  996. X */
  997. X
  998. X/*
  999. X *
  1000. X *  source file:   ./filters/teklib/tekpack.c
  1001. X *
  1002. X * Joe Dellinger (SEP), June 11 1987
  1003. X *    Inserted this sample edit history entry.
  1004. X *    Please log any further modifications made to this file:
  1005. X */
  1006. X
  1007. X#include <stdio.h>
  1008. X#include "tek.h"
  1009. extern FILE    *pltout;
  1010. X
  1011. X/*
  1012. X * Tek x,y coordinate packing.
  1013. X * Previously-encoded positions are saved in
  1014. X * ohiy, oloy, etc. in order to abbreviate the number of
  1015. X * bytes sent out. This routine assumes pltout is open.
  1016. X */
  1017. tekxypack (x, y)
  1018. X    int             x, y;
  1019. X{
  1020. register int    hiy, loy, hix, lox;
  1021. static int      ohiy, oloy, ohix, olox;
  1022. X
  1023. X    /*
  1024. X     * Encode the new position. 
  1025. X     */
  1026. X    hiy = 0040 | ((y >> 5) & 037);
  1027. X    loy = 0140 | (y & 037);
  1028. X    hix = 0040 | ((x >> 5) & 037);
  1029. X    lox = 0100 | (x & 037);
  1030. X
  1031. X    /*
  1032. X     * Only print what's necessary, according to Tek rules. 
  1033. X     */
  1034. X    if (hiy != ohiy || lost == 1)
  1035. X    putc (hiy, pltout);
  1036. X    if (loy != oloy || hix != ohix || lost == 1)
  1037. X    putc (loy, pltout);
  1038. X    if (hix != ohix || lost == 1)
  1039. X    putc (hix, pltout);
  1040. X    if (hiy != ohiy || loy != oloy || hix != ohix || lox != olox || lost == 1)
  1041. X    putc (lox, pltout);
  1042. X
  1043. X    /*
  1044. X     * Remember these for next time. 
  1045. X     */
  1046. X    ohiy = hiy;
  1047. X    oloy = loy;
  1048. X    ohix = hix;
  1049. X    olox = lox;
  1050. X}
  1051. X
  1052. X/*
  1053. X * Issue a packed integer. From one to three bytes sent.
  1054. X */
  1055. tekipack (i)
  1056. X    register int    i;
  1057. X{
  1058. register int    ihi, imd, ilo;
  1059. X
  1060. X    if (i < 0)
  1061. X    {
  1062. X    i = -i;
  1063. X    ilo = 040;
  1064. X    }
  1065. X    else
  1066. X    ilo = 060;
  1067. X
  1068. X    ihi = 0100 | ((i >> 10) & 037);
  1069. X    imd = 0100 | ((i >> 4) & 077);
  1070. X    ilo |= (i & 017);
  1071. X
  1072. X    if (ihi != 0100)
  1073. X    putc (ihi, pltout);
  1074. X    if (imd != 0100)
  1075. X    putc (imd, pltout);
  1076. X    putc (ilo, pltout);
  1077. X}
  1078. END_OF_FILE
  1079. if test 2040 -ne `wc -c <'Tek_device/teklib/tekpack.c'`; then
  1080.     echo shar: \"'Tek_device/teklib/tekpack.c'\" unpacked with wrong size!
  1081. fi
  1082. # end of 'Tek_device/teklib/tekpack.c'
  1083. fi
  1084. if test -f 'Virtual_device/raslib/rasclose.c' -a "${1}" != "-c" ; then 
  1085.   echo shar: Will not clobber existing file \"'Virtual_device/raslib/rasclose.c'\"
  1086. else
  1087. echo shar: Extracting \"'Virtual_device/raslib/rasclose.c'\" \(1891 characters\)
  1088. sed "s/^X//" >'Virtual_device/raslib/rasclose.c' <<'END_OF_FILE'
  1089. X/*
  1090. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1091. X * University. Official permission to use this software is included in
  1092. X * the documentation. It authorizes you to use this file for any
  1093. X * non-commercial purpose, provided that this copyright notice is not
  1094. X * removed and that any modifications made to this file are commented
  1095. X * and dated in the style of my example below.
  1096. X */
  1097. X
  1098. X/*
  1099. X *
  1100. X *  source file:   ./filters/raslib/rasclose.c
  1101. X *
  1102. X * Joe Dellinger (SEP), June 11 1987
  1103. X *    Inserted this sample edit history entry.
  1104. X *    Please log any further modifications made to this file:
  1105. X */
  1106. X
  1107. X#include <stdio.h>
  1108. X#include "../include/closestat.h"
  1109. X#include "../include/err.h"
  1110. X#include "../include/extern.h"
  1111. X#include "../include/params.h"
  1112. X#include "raspen.h"
  1113. extern int      color_table[NCOLOR][3];
  1114. extern char     colfile[];
  1115. X
  1116. rasclose (status)
  1117. X    int             status;
  1118. X{
  1119. int             value;
  1120. FILE           *colout;
  1121. X
  1122. X    switch (status)
  1123. X    {
  1124. X    case CLOSE_NORMAL:
  1125. X#ifdef SEP
  1126. X    Puthead ("Color table:\n");
  1127. X    for (value = 0; value < NCOLOR; value++)
  1128. X    {
  1129. X        if (color_table[value][0] != -1)
  1130. X        {
  1131. X        Puthead ("%d\t\t%d\t%d\t%d\n", value,
  1132. X             color_table[value][0], color_table[value][1], color_table[value][2]);
  1133. X        }
  1134. X    }
  1135. X    Puthead ("\n");
  1136. X#else
  1137. X    fprintf (stderr, "I recommend using the SEPlib version,\n");
  1138. X    fprintf (stderr, "since Movie is a SEP program.\n");
  1139. X#endif
  1140. X
  1141. X    colout = fopen (colfile, "w");
  1142. X    if (colout == NULL)
  1143. X        ERR (WARN, name, "can't open colfile %s\n", colfile);
  1144. X    else
  1145. X    {
  1146. X        for (value = 0; value < NCOLOR; value++)
  1147. X        {
  1148. X        if (color_table[value][0] != -1)
  1149. X        {
  1150. X            fprintf (colout, "%d\t\t%f\t%f\t%f\n", value,
  1151. X                 (float) color_table[value][0] / MAX_GUN,
  1152. X                 (float) color_table[value][1] / MAX_GUN,
  1153. X                 (float) color_table[value][2] / MAX_GUN);
  1154. X        }
  1155. X        }
  1156. X    }
  1157. X    break;
  1158. X    case CLOSE_FLUSH:
  1159. X    fflush (pltout);
  1160. X    break;
  1161. X    default:
  1162. X    break;
  1163. X    }
  1164. X}
  1165. END_OF_FILE
  1166. if test 1891 -ne `wc -c <'Virtual_device/raslib/rasclose.c'`; then
  1167.     echo shar: \"'Virtual_device/raslib/rasclose.c'\" unpacked with wrong size!
  1168. fi
  1169. # end of 'Virtual_device/raslib/rasclose.c'
  1170. fi
  1171. if test -f 'Vplot_Kernel/filters/Tests/ufilltest.c' -a "${1}" != "-c" ; then 
  1172.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/ufilltest.c'\"
  1173. else
  1174. echo shar: Extracting \"'Vplot_Kernel/filters/Tests/ufilltest.c'\" \(1816 characters\)
  1175. sed "s/^X//" >'Vplot_Kernel/filters/Tests/ufilltest.c' <<'END_OF_FILE'
  1176. X/*
  1177. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1178. X * University. Official permission to use this software is included in
  1179. X * the documentation. It authorizes you to use this file for any
  1180. X * non-commercial purpose, provided that this copyright notice is not
  1181. X * removed and that any modifications made to this file are commented
  1182. X * and dated in the style of my example below.
  1183. X */
  1184. X
  1185. X/*
  1186. X *
  1187. X *  source file:   ./filters/Tests/ufilltest.c
  1188. X *
  1189. X * Joe Dellinger (SEP), June 11 1987
  1190. X *    Inserted this sample edit history entry.
  1191. X *    Please log any further modifications made to this file:
  1192. X */
  1193. X
  1194. X#include <stdio.h>
  1195. X#include <vplot.h>
  1196. X#include <math.h>
  1197. X
  1198. X#define NP 4
  1199. X
  1200. main ()
  1201. X{
  1202. float           xarray[NP], yarray[NP];
  1203. int             i, j;
  1204. int             angle, numhatch;
  1205. int             hatcharray[8];
  1206. extern float    rand ();
  1207. X
  1208. X/*
  1209. X * Set up where you want the vplot output to go.
  1210. X */
  1211. X    vp_filep (stdout);
  1212. X
  1213. X/*
  1214. X * Decide what "style" plot this is to be.
  1215. X */
  1216. X    vp_style (STANDARD);
  1217. X
  1218. X/* 
  1219. X * solid fill
  1220. X */
  1221. X    xarray[0] = 2.;
  1222. X    yarray[0] = 2.;
  1223. X    xarray[1] = 2.;
  1224. X    yarray[1] = 6.;
  1225. X    xarray[2] = 6.;
  1226. X    yarray[2] = 6.;
  1227. X    xarray[3] = 6.;
  1228. X    yarray[3] = 2.;
  1229. X
  1230. X    vp_color (RED);
  1231. X    vp_ufill (xarray, yarray, NP);
  1232. X/*
  1233. X * define a hatching pattern and fill.
  1234. X */
  1235. X    angle = 30;
  1236. X    numhatch = 1;
  1237. X    hatcharray[0] = 1;
  1238. X    hatcharray[1] = CYAN;
  1239. X    hatcharray[2] = 0;
  1240. X    hatcharray[3] = 20;
  1241. X    hatcharray[4] = 1;
  1242. X    hatcharray[5] = WHITE;
  1243. X    hatcharray[6] = 0;
  1244. X    hatcharray[7] = 10;
  1245. X
  1246. X    xarray[0] = 2.;
  1247. X    yarray[0] = 2.;
  1248. X    xarray[1] = 2.;
  1249. X    yarray[1] = 6.;
  1250. X    xarray[2] = 6.;
  1251. X    yarray[2] = 6.;
  1252. X    xarray[3] = 6.;
  1253. X    yarray[3] = 2.;
  1254. X
  1255. X    vp_hatchload (angle, numhatch, CYAN, hatcharray);
  1256. X    vp_color (CYAN);
  1257. X    vp_ufill (xarray, yarray, NP);
  1258. X
  1259. X/*
  1260. X * Finish up
  1261. X */
  1262. X    vp_endplot ();
  1263. X}
  1264. END_OF_FILE
  1265. if test 1816 -ne `wc -c <'Vplot_Kernel/filters/Tests/ufilltest.c'`; then
  1266.     echo shar: \"'Vplot_Kernel/filters/Tests/ufilltest.c'\" unpacked with wrong size!
  1267. fi
  1268. # end of 'Vplot_Kernel/filters/Tests/ufilltest.c'
  1269. fi
  1270. if test -f 'Vplot_Kernel/filters/loclib/bufpar.c' -a "${1}" != "-c" ; then 
  1271.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/loclib/bufpar.c'\"
  1272. else
  1273. echo shar: Extracting \"'Vplot_Kernel/filters/loclib/bufpar.c'\" \(1941 characters\)
  1274. sed "s/^X//" >'Vplot_Kernel/filters/loclib/bufpar.c' <<'END_OF_FILE'
  1275. X/*
  1276. X *
  1277. X *  source file:   ./filters/loclib/bufpar.c
  1278. X *
  1279. X * Joe Dellinger (SEP), June 11 1987
  1280. X *    Inserted this sample edit history entry.
  1281. X *    Please log any further modifications made to this file:
  1282. X */
  1283. X
  1284. X
  1285. X/* bufpar.c: get and store getpar-style parameters from a text
  1286. X *        buffer.
  1287. X *    bufpar_scan:    parse the buffer, and make a hashed list
  1288. X *    bufpar_:            return a value from the list
  1289. X *    bufpar_string_store:    add a {tag,value} pair to the list
  1290. X *    bufpar_free:    erase the list
  1291. X *                                -- c. r. karish  18 dec 1986
  1292. X */
  1293. X
  1294. X#include "fastpar.h"
  1295. X#define NULL 0
  1296. X#define BUF_QUEUE_SIZE 127
  1297. X#define POINTER unsigned long
  1298. char           *alloc ();
  1299. static hash_item *buf_queue[BUF_QUEUE_SIZE];
  1300. static int      buf_queue_size = BUF_QUEUE_SIZE;
  1301. X
  1302. int
  1303. bufpar_scan (strbuf, buflen, reset)
  1304. X    register char  *strbuf;
  1305. X    int             buflen, reset;
  1306. X{
  1307. char           *buffer;
  1308. register char  *bptr;
  1309. register int    ii;
  1310. X
  1311. X    /* make sure the 'queue' is clean */
  1312. X    if (reset)
  1313. X    bzero ((char *) buf_queue, BUF_QUEUE_SIZE * sizeof (POINTER));
  1314. X
  1315. X    /* set up the input */
  1316. X    buffer = alloc (buflen + 3);
  1317. X    bptr = buffer;
  1318. X    *bptr++ = '\n';
  1319. X    for (ii = 0; ii < buflen; ii++)
  1320. X    *bptr++ = *strbuf++;
  1321. X    *bptr++ = '\n';
  1322. X    *bptr = '\0';
  1323. X    getpar_push_input (buffer, 1);
  1324. X
  1325. X    /* scan input, and put results on 'queue' */
  1326. X    getpar_scan (buf_queue, buf_queue_size);
  1327. X}
  1328. X
  1329. int
  1330. bufpar (tag, type, val)
  1331. X    char           *tag, *type;
  1332. X    MIXED           val;
  1333. X{
  1334. X    return (getpar_decode (buf_queue, buf_queue_size, tag, type, val));
  1335. X}
  1336. X
  1337. bufpar_add_string (string)
  1338. X    char           *string;
  1339. X{
  1340. X    getpar_string_store (buf_queue, buf_queue_size, string);
  1341. X}
  1342. X
  1343. X/* aliases: for calling from fortran */
  1344. X
  1345. bpscan_ (buffer)
  1346. X    char           *buffer;
  1347. X{
  1348. X    bufpar_scan (buffer);
  1349. X}
  1350. X
  1351. bufpar_ (tag, type, val)
  1352. X    char           *tag, *type;
  1353. X    MIXED           val;
  1354. X{
  1355. X    bufpar (tag, type, val);
  1356. X}
  1357. X
  1358. bpadds_ (string)
  1359. X    char           *string;
  1360. X{
  1361. X    bufpar_add_string (string);
  1362. X}
  1363. END_OF_FILE
  1364. if test 1941 -ne `wc -c <'Vplot_Kernel/filters/loclib/bufpar.c'`; then
  1365.     echo shar: \"'Vplot_Kernel/filters/loclib/bufpar.c'\" unpacked with wrong size!
  1366. fi
  1367. # end of 'Vplot_Kernel/filters/loclib/bufpar.c'
  1368. fi
  1369. if test -f 'Vplot_Kernel/filters/loclib/getpar.c' -a "${1}" != "-c" ; then 
  1370.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/loclib/getpar.c'\"
  1371. else
  1372. echo shar: Extracting \"'Vplot_Kernel/filters/loclib/getpar.c'\" \(1896 characters\)
  1373. sed "s/^X//" >'Vplot_Kernel/filters/loclib/getpar.c' <<'END_OF_FILE'
  1374. X/*
  1375. clayton        1981    wrote getpar
  1376. hale        1982    ?  INPAR?
  1377. JFC        1-22-83    stdin copied to stdout and parsed first.
  1378. ron        1-28-83 allow for multiple names of a variable
  1379. ron        2-1-83  does not count entries where there is no
  1380. X            argument as being found
  1381. ron        2-2-83  changed the stdin read from character by character
  1382. X            to line by line
  1383. ron        2-4-83    altered the stdin read to not keep lines starting
  1384. X            with '#'
  1385. JFC        2-7-83  hetch introduced
  1386. ron        2-8-83  split up the text file of getpar and fetch
  1387. ron        2-15-83 added count_found so that the routines in fetch and
  1388. X            getpar would use the same found.
  1389. ron        2-23-83 added save_get and getm_getsav so that only the last
  1390. X            parameter is used.
  1391. ron        2-25-83 fixed getpar so that it can do recursive par= in
  1392. X            par files. The limit in depth of the calls is
  1393. X            MAXPARLEVEL.
  1394. stew        3-5-83  defined getpar() as alias for getpar_()
  1395. stew        7-14-83 added err and perror diagnostics
  1396. stew        9-6-87  use <varargs> for portability to Sun-4 and Cray-2
  1397. joe        2-25-88 Make the other getpar synonyms share the same code
  1398. X*/
  1399. X
  1400. X#ifndef GETPARSYNONYM
  1401. X#define GETPARSYNONYM getpar
  1402. X#endif  GETPARSYNONYM
  1403. X
  1404. typedef union { int *i; float *f; double *g ; char *s; } MIXED;
  1405. X
  1406. X#include <varargs.h>
  1407. X
  1408. X/*VARARGS0*/
  1409. int
  1410. GETPARSYNONYM(va_alist /*name,type,ptr*/)
  1411. va_dcl
  1412. X{
  1413. X    char *name, *type;
  1414. X    va_list apdum;
  1415. X    int rc;
  1416. X    MIXED var;
  1417. X    extern int getch_();
  1418. X    va_start(apdum);
  1419. X    name = va_arg(apdum,char *);
  1420. X    type = va_arg(apdum,char *);
  1421. X    switch(type[0]) {
  1422. X    case 'g': var.g = va_arg(apdum,double *); break;
  1423. X    case 's': var.s = va_arg(apdum,char *); break;
  1424. X    case 'f': case 'r': var.f = va_arg(apdum,float *); break;
  1425. X    default: var.i = va_arg(apdum,int *); break;
  1426. X    }
  1427. X    va_end(apdum);
  1428. X    switch(type[0]) {
  1429. X    case 'g': rc = getch_(name,type,var.g); break;
  1430. X    case 's': rc = getch_(name,type,var.s); break;
  1431. X    case 'f': case 'r': rc = getch_(name,type,var.f); break;
  1432. X    default: rc = getch_(name,type,var.i); break;
  1433. X    }
  1434. X    return (rc);
  1435. X}
  1436. END_OF_FILE
  1437. if test 1896 -ne `wc -c <'Vplot_Kernel/filters/loclib/getpar.c'`; then
  1438.     echo shar: \"'Vplot_Kernel/filters/loclib/getpar.c'\" unpacked with wrong size!
  1439. fi
  1440. # end of 'Vplot_Kernel/filters/loclib/getpar.c'
  1441. fi
  1442. if test -f 'Vplot_Kernel/filters/sample.c' -a "${1}" != "-c" ; then 
  1443.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/sample.c'\"
  1444. else
  1445. echo shar: Extracting \"'Vplot_Kernel/filters/sample.c'\" \(1991 characters\)
  1446. sed "s/^X//" >'Vplot_Kernel/filters/sample.c' <<'END_OF_FILE'
  1447. X/*
  1448. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1449. X * University. Official permission to use this software is included in
  1450. X * the documentation. It authorizes you to use this file for any
  1451. X * non-commercial purpose, provided that this copyright notice is not
  1452. X * removed and that any modifications made to this file are commented
  1453. X * and dated in the style of my example below.
  1454. X */
  1455. X
  1456. X/*
  1457. X *
  1458. X *  source file:   ./filters/sample.c
  1459. X *
  1460. X * Joe Dellinger (SEP), Feb 19 1988
  1461. X *    Inserted this sample edit history entry.
  1462. X *    Please log any further modifications made to this file:
  1463. X */
  1464. X
  1465. X#include <stdio.h>
  1466. X/*
  1467. X * Things we have to include
  1468. X */
  1469. X#include "./include/closestat.h"
  1470. X#include "./include/extern.h"
  1471. X
  1472. X/*
  1473. X * These make init_vplot happy
  1474. X */
  1475. extern char callname[];
  1476. extern FILE *pltout;
  1477. int xargc;
  1478. char **xargv;
  1479. X
  1480. X/*
  1481. X * These make dovplot happy
  1482. X */
  1483. extern FILE *pltin;
  1484. extern char pltname[];
  1485. X
  1486. main(argc,argv)
  1487. int argc;
  1488. char **argv;
  1489. X{
  1490. X/*
  1491. X * Copy these across so getpar has something to work with.
  1492. X */
  1493. xargc  = argc;
  1494. xargv = argv;
  1495. X
  1496. X/*
  1497. X * Throw in dummy names just so there's something there.
  1498. X */
  1499. strcpy (callname, "default");
  1500. strcpy (pltname, "Sample");
  1501. X
  1502. X/*
  1503. X * Set up pltin and pltout
  1504. X */
  1505. pltout = stdout;
  1506. pltin = stdin;
  1507. X
  1508. X/*
  1509. X * Initialize everything
  1510. X */
  1511. init_vplot();
  1512. X
  1513. X/*
  1514. X * Do the plot
  1515. X */
  1516. dovplot();
  1517. X
  1518. X/*
  1519. X * Close the device
  1520. X */
  1521. dev.close (CLOSE_NORMAL);
  1522. dev.close (CLOSE_DONE);
  1523. X
  1524. X/*
  1525. X * The problem, of course, is that bypassing all the other routines
  1526. X * we may be overlooking possibly vital things such as did the device
  1527. X * need an "ERASE_END", can it use piped input, did it need the
  1528. X * text screen turned back on, etc, etc.
  1529. X * We also neglect to turn echoing and output translation back on
  1530. X * (if it was turned off), etc, etc. Probably better to at least use
  1531. X * proc_vplot, or to start by making a copy of it.
  1532. X * But, for a specific device with known requirements this
  1533. X * simple example shows how to use the power of dovplot without having to
  1534. X * throw in the kitchen sink, too.
  1535. X */
  1536. X}
  1537. END_OF_FILE
  1538. if test 1991 -ne `wc -c <'Vplot_Kernel/filters/sample.c'`; then
  1539.     echo shar: \"'Vplot_Kernel/filters/sample.c'\" unpacked with wrong size!
  1540. fi
  1541. # end of 'Vplot_Kernel/filters/sample.c'
  1542. fi
  1543. if test -f 'Vplot_Kernel/filters/utilities/clip.c' -a "${1}" != "-c" ; then 
  1544.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/utilities/clip.c'\"
  1545. else
  1546. echo shar: Extracting \"'Vplot_Kernel/filters/utilities/clip.c'\" \(1805 characters\)
  1547. sed "s/^X//" >'Vplot_Kernel/filters/utilities/clip.c' <<'END_OF_FILE'
  1548. X/*
  1549. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1550. X * University. Official permission to use this software is included in
  1551. X * the documentation. It authorizes you to use this file for any
  1552. X * non-commercial purpose, provided that this copyright notice is not
  1553. X * removed and that any modifications made to this file are commented
  1554. X * and dated in the style of my example below.
  1555. X */
  1556. X
  1557. X/*
  1558. X *
  1559. X *  source file:   ./filters/utilities/clip.c
  1560. X *
  1561. X * Joe Dellinger (SEP), June 11 1987
  1562. X *    Inserted this sample edit history entry.
  1563. X *    Please log any further modifications made to this file:
  1564. X */
  1565. X
  1566. X/*
  1567. X * VPLOT utility routine
  1568. X *   Cohen-Sutherland Clipping routine
  1569. X */
  1570. X
  1571. extern int      xwmin, xwmax, ywmin, ywmax;
  1572. X
  1573. X#define code(x,y) (x<xwmin?1:(x>xwmax?2:0))|(y<ywmin?4:(y>ywmax?8:0))
  1574. X
  1575. clip (x1, y1, x2, y2)
  1576. X    int            *x1, *y1, *x2, *y2;
  1577. X{
  1578. register int    c1, c2, temp;
  1579. int             swap;
  1580. X    c1 = code (*x1, *y1);
  1581. X    c2 = code (*x2, *y2);
  1582. X    swap = 0;
  1583. X    if (!(c1 || c2))
  1584. X    return (0);        /* line completely in bounds */
  1585. X    while (c1 | c2)
  1586. X    {
  1587. X    if (c1 & c2)
  1588. X        return (1);        /* line completely out of bounds */
  1589. X    if (!c1)        /* interchange endpoints */
  1590. X    {
  1591. X        temp = *x1;
  1592. X        *x1 = *x2;
  1593. X        *x2 = temp;
  1594. X        temp = *y1;
  1595. X        *y1 = *y2;
  1596. X        *y2 = temp;
  1597. X        temp = c1;
  1598. X        c1 = c2;
  1599. X        c2 = temp;
  1600. X        swap = ~swap;
  1601. X    }
  1602. X    if (c1 < 4)        /* move endpoint in x */
  1603. X    {
  1604. X        temp = (c1 & 2 ? xwmax : xwmin);
  1605. X        *y1 = solve (temp, *x1, *y1, *x2, *y2);
  1606. X        *x1 = temp;
  1607. X    }
  1608. X    else            /* move endpoint in y */
  1609. X    {
  1610. X        temp = (c1 & 8 ? ywmax : ywmin);
  1611. X        *x1 = solve (temp, *y1, *x1, *y2, *x2);
  1612. X        *y1 = temp;
  1613. X    }
  1614. X    c1 = code (*x1, *y1);
  1615. X    }
  1616. X    if (swap)            /* put endpoints in order */
  1617. X    {
  1618. X    temp = *x1;
  1619. X    *x1 = *x2;
  1620. X    *x2 = temp;
  1621. X    temp = *y1;
  1622. X    *y1 = *y2;
  1623. X    *y2 = temp;
  1624. X    }
  1625. X    return (0);
  1626. X}
  1627. END_OF_FILE
  1628. if test 1805 -ne `wc -c <'Vplot_Kernel/filters/utilities/clip.c'`; then
  1629.     echo shar: \"'Vplot_Kernel/filters/utilities/clip.c'\" unpacked with wrong size!
  1630. fi
  1631. # end of 'Vplot_Kernel/filters/utilities/clip.c'
  1632. fi
  1633. if test -f 'Vplot_Kernel/lvplot/vp_area.c' -a "${1}" != "-c" ; then 
  1634.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_area.c'\"
  1635. else
  1636. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_area.c'\" \(1935 characters\)
  1637. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_area.c' <<'END_OF_FILE'
  1638. X/*
  1639. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1640. X * University. Official permission to use this software is included in
  1641. X * the documentation. It authorizes you to use this file for any
  1642. X * non-commercial purpose, provided that this copyright notice is not
  1643. X * removed and that any modifications made to this file are commented
  1644. X * and dated in the style of my example below.
  1645. X */
  1646. X
  1647. X/*
  1648. X *
  1649. X *  source file:   ./lvplot/vp_area.c
  1650. X *
  1651. X * Joe Dellinger (SEP), June 11 1987
  1652. X *    Inserted this sample edit history entry.
  1653. X *    Please log any further modifications made to this file:
  1654. X * Joe Dellinger Jan 14 1988
  1655. X *    Do rounding.
  1656. X */
  1657. X
  1658. X#include <stdio.h>
  1659. X#include <vplot.h>
  1660. X#include "round.h"
  1661. X#include "vp_pc.h"
  1662. X
  1663. X#ifdef FORTRAN
  1664. X
  1665. X#ifndef UUU
  1666. X#define AREA    vparea_
  1667. X#else UUU
  1668. X#define UAREA    vpuarea_
  1669. X#endif UUU
  1670. X#define LP        *lp
  1671. X#define FAT        *fat
  1672. X#define XMASK    *xmask
  1673. X#define YMASK    *ymask
  1674. X#define XP xp2
  1675. X#define YP yp2
  1676. X
  1677. X#else
  1678. X
  1679. X#ifndef UUU
  1680. X#define AREA    vp_area
  1681. X#else UUU
  1682. X#define UAREA    vp_uarea
  1683. X#endif UUU
  1684. X#define LP        lp
  1685. X#define FAT        fat
  1686. X#define XMASK    xmask
  1687. X#define YMASK    ymask
  1688. X#define XP xp
  1689. X#define YP yp
  1690. X
  1691. X#endif
  1692. X
  1693. X#ifndef UUU
  1694. AREA (xp, yp, lp, fat, xmask, ymask)
  1695. X#else UUU
  1696. UAREA (xp, yp, lp, fat, xmask, ymask)
  1697. X#endif UUU
  1698. X    float          *xp, *yp;
  1699. X    int             LP, FAT, XMASK, YMASK;
  1700. X{
  1701. int             i;
  1702. int             ix, iy;
  1703. X
  1704. X#ifdef FORTRAN
  1705. register float *xp2, *yp2;
  1706. X    xp2 = xp;
  1707. X    yp2 = yp;
  1708. X#endif FORTRAN
  1709. X
  1710. X    putc (VP_OLDAREA, vp_pc._pltout);
  1711. X    puth (LP, vp_pc._pltout);
  1712. X    puth (FAT, vp_pc._pltout);
  1713. X    puth (XMASK, vp_pc._pltout);
  1714. X    puth (YMASK, vp_pc._pltout);
  1715. X    for (i = 0; i < LP; i++)
  1716. X    {
  1717. X#ifndef UUU
  1718. X    ix = ROUND ((*XP) * RPERIN);
  1719. X    iy = ROUND ((*YP) * RPERIN);
  1720. X#else UUU
  1721. X    ix = ROUND ((vp_pc._x0 + ((*XP) - vp_pc._xu0) * vp_pc._xscl) * RPERIN);
  1722. X    iy = ROUND ((vp_pc._y0 + ((*YP) - vp_pc._yu0) * vp_pc._yscl) * RPERIN);
  1723. X#endif UUU
  1724. X    XP++;
  1725. X    YP++;
  1726. X    puth (ix, vp_pc._pltout);
  1727. X    puth (iy, vp_pc._pltout);
  1728. X    }
  1729. X}
  1730. END_OF_FILE
  1731. if test 1935 -ne `wc -c <'Vplot_Kernel/lvplot/vp_area.c'`; then
  1732.     echo shar: \"'Vplot_Kernel/lvplot/vp_area.c'\" unpacked with wrong size!
  1733. fi
  1734. # end of 'Vplot_Kernel/lvplot/vp_area.c'
  1735. fi
  1736. if test -f 'Vplot_Kernel/lvplot/vp_pmark.c' -a "${1}" != "-c" ; then 
  1737.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_pmark.c'\"
  1738. else
  1739. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_pmark.c'\" \(1956 characters\)
  1740. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_pmark.c' <<'END_OF_FILE'
  1741. X/*
  1742. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1743. X * University. Official permission to use this software is included in
  1744. X * the documentation. It authorizes you to use this file for any
  1745. X * non-commercial purpose, provided that this copyright notice is not
  1746. X * removed and that any modifications made to this file are commented
  1747. X * and dated in the style of my example below.
  1748. X */
  1749. X
  1750. X/*
  1751. X *
  1752. X *  source file:   ./lvplot/vp_pmark.c
  1753. X *
  1754. X * Joe Dellinger (SEP), June 11 1987
  1755. X *    Inserted this sample edit history entry.
  1756. X *    Please log any further modifications made to this file:
  1757. X * Joe Dellinger Jan 14 1988
  1758. X *    Do rounding.
  1759. X */
  1760. X
  1761. X#include <stdio.h>
  1762. X#include <vplot.h>
  1763. X#include "round.h"
  1764. X#include "vp_pc.h"
  1765. X
  1766. X#ifdef FORTRAN
  1767. X
  1768. X#ifdef UUU
  1769. X#define PMARK    vpupmark_
  1770. X#else UUU
  1771. X#define PMARK    vppmark_
  1772. X#endif UUU
  1773. X#define NPTS    *npts
  1774. X#define MTYPE    *mtype
  1775. X#define MSIZE    *msize
  1776. X#define XP xp2
  1777. X#define YP yp2
  1778. X
  1779. X#else
  1780. X
  1781. X#ifdef UUU
  1782. X#define PMARK    vp_upmark
  1783. X#else UUU
  1784. X#define PMARK    vp_pmark
  1785. X#endif UUU
  1786. X#define NPTS    npts
  1787. X#define MTYPE    mtype
  1788. X#define MSIZE    msize
  1789. X#define XP xp
  1790. X#define YP yp
  1791. X
  1792. X#endif
  1793. X
  1794. PMARK (npts, mtype, msize, xp, yp)
  1795. X    float          *xp, *yp;
  1796. X    int             NPTS, MTYPE, MSIZE;
  1797. X{
  1798. int             i, ix, iy;
  1799. X
  1800. X#ifdef FORTRAN
  1801. float          *xp2, *yp2;
  1802. X
  1803. X    xp2 = xp;
  1804. X    yp2 = yp;
  1805. X#endif FORTRAN
  1806. X
  1807. X    putc (VP_PMARK, vp_pc._pltout);
  1808. X    puth (NPTS, vp_pc._pltout);
  1809. X    puth (MTYPE, vp_pc._pltout);
  1810. X    puth (MSIZE, vp_pc._pltout);
  1811. X
  1812. X#ifdef UUU            /* units are user units */
  1813. X    for (i = 0; i < NPTS; i++)
  1814. X    {
  1815. X    ix = ROUND ((vp_pc._x0 + ((*XP) - vp_pc._xu0) * vp_pc._xscl) * RPERIN);
  1816. X    iy = ROUND ((vp_pc._y0 + ((*YP) - vp_pc._yu0) * vp_pc._yscl) * RPERIN);
  1817. X    XP++;
  1818. X    YP++;
  1819. X    puth (ix, vp_pc._pltout);
  1820. X    puth (iy, vp_pc._pltout);
  1821. X    }
  1822. X#else UUU            /* units are inches */
  1823. X    for (i = 0; i < NPTS; i++)
  1824. X    {
  1825. X    ix = ROUND ((*XP) * RPERIN);
  1826. X    iy = ROUND ((*YP) * RPERIN);
  1827. X    XP++;
  1828. X    YP++;
  1829. X    puth (ix, vp_pc._pltout);
  1830. X    puth (iy, vp_pc._pltout);
  1831. X    }
  1832. X#endif UUU
  1833. X}
  1834. END_OF_FILE
  1835. if test 1956 -ne `wc -c <'Vplot_Kernel/lvplot/vp_pmark.c'`; then
  1836.     echo shar: \"'Vplot_Kernel/lvplot/vp_pmark.c'\" unpacked with wrong size!
  1837. fi
  1838. # end of 'Vplot_Kernel/lvplot/vp_pmark.c'
  1839. fi
  1840. if test -f 'Vplot_Kernel/lvplot/vp_ugtext.c' -a "${1}" != "-c" ; then 
  1841.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_ugtext.c'\"
  1842. else
  1843. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_ugtext.c'\" \(1987 characters\)
  1844. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_ugtext.c' <<'END_OF_FILE'
  1845. X/*
  1846. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1847. X * University. Official permission to use this software is included in
  1848. X * the documentation. It authorizes you to use this file for any
  1849. X * non-commercial purpose, provided that this copyright notice is not
  1850. X * removed and that any modifications made to this file are commented
  1851. X * and dated in the style of my example below.
  1852. X */
  1853. X
  1854. X/*
  1855. X *
  1856. X *  source file:   ./lvplot/vp_ugtext.c
  1857. X *
  1858. X * Joe Dellinger (SEP), Jan 14 1988
  1859. X *    Inserted this sample edit history entry.
  1860. X *    Please log any further modifications made to this file:
  1861. X */
  1862. X
  1863. X#include <stdio.h>
  1864. X#include <vplot.h>
  1865. X#include "vp_pc.h"
  1866. X
  1867. X#ifdef FORTRAN
  1868. X
  1869. X#define UTEXT    vpwugtext_
  1870. X#define TEXT    vpwgtext_
  1871. X#define X        *x
  1872. X#define Y        *y
  1873. X#define XP        &xp
  1874. X#define YP        &yp
  1875. X#define XPATH        *xpath
  1876. X#define YPATH        *ypath
  1877. X#define XPATHP        &xpathp
  1878. X#define YPATHP        &ypathp
  1879. X#define XUP        *xup
  1880. X#define YUP        *yup
  1881. X#define XUPP        &xupp
  1882. X#define YUPP        &yupp
  1883. X
  1884. X#else
  1885. X
  1886. X#define UTEXT    vp_ugtext
  1887. X#define TEXT    vp_gtext
  1888. X#define X        x
  1889. X#define Y        y
  1890. X#define XP        xp
  1891. X#define YP        yp
  1892. X#define XPATH        xpath
  1893. X#define YPATH        ypath
  1894. X#define XPATHP        xpathp
  1895. X#define YPATHP        ypathp
  1896. X#define XUP        xup
  1897. X#define YUP        yup
  1898. X#define XUPP        xupp
  1899. X#define YUPP        yupp
  1900. X
  1901. X#endif
  1902. X
  1903. X#ifdef FORTRAN
  1904. UTEXT (x, y, xpath, ypath, xup, yup, string, nchars)
  1905. X#else
  1906. UTEXT (x, y, xpath, ypath, xup, yup, string)
  1907. X#endif
  1908. X    float           X, Y;
  1909. X    float           XPATH, YPATH;
  1910. X    float           XUP, YUP;
  1911. X    char           *string;
  1912. X#ifdef FORTRAN
  1913. X    int            *nchars;
  1914. X#endif
  1915. X{
  1916. float           xp, yp;
  1917. float           xpathp, ypathp;
  1918. float           xupp, yupp;
  1919. X
  1920. X    xp = vp_pc._x0 + (X - vp_pc._xu0) * vp_pc._xscl;
  1921. X    yp = vp_pc._y0 + (Y - vp_pc._yu0) * vp_pc._yscl;
  1922. X    xpathp = XPATH * vp_pc._xscl;
  1923. X    ypathp = YPATH * vp_pc._yscl;
  1924. X    xupp = XUP * vp_pc._xscl;
  1925. X    yupp = YUP * vp_pc._yscl;
  1926. X
  1927. X#ifdef FORTRAN
  1928. X    TEXT (XP, YP, XPATHP, YPATHP, XUPP, YUPP, string, nchars);
  1929. X#else
  1930. X    TEXT (XP, YP, XPATHP, YPATHP, XUPP, YUPP, string);
  1931. X#endif
  1932. X}
  1933. END_OF_FILE
  1934. if test 1987 -ne `wc -c <'Vplot_Kernel/lvplot/vp_ugtext.c'`; then
  1935.     echo shar: \"'Vplot_Kernel/lvplot/vp_ugtext.c'\" unpacked with wrong size!
  1936. fi
  1937. # end of 'Vplot_Kernel/lvplot/vp_ugtext.c'
  1938. fi
  1939. if test -f 'Vplot_Kernel/lvplot/vp_unit.c' -a "${1}" != "-c" ; then 
  1940.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_unit.c'\"
  1941. else
  1942. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_unit.c'\" \(2008 characters\)
  1943. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_unit.c' <<'END_OF_FILE'
  1944. X/*
  1945. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1946. X * University. Official permission to use this software is included in
  1947. X * the documentation. It authorizes you to use this file for any
  1948. X * non-commercial purpose, provided that this copyright notice is not
  1949. X * removed and that any modifications made to this file are commented
  1950. X * and dated in the style of my example below.
  1951. X */
  1952. X
  1953. X/*
  1954. X *
  1955. X *  source file:   ./lvplot/vp_unit.c
  1956. X *
  1957. X * Joe Dellinger (SEP), June 11 1987
  1958. X *    Inserted this sample edit history entry.
  1959. X *    Please log any further modifications made to this file:
  1960. X */
  1961. X/*
  1962. X * Joe Dellinger Oct 19, 1987 (Monday Massacre)
  1963. X * Put in ifdef's for 4.2 VS 4.3.
  1964. X * Somebody should volunteer to re-write this routine in FORTRAN.
  1965. X * Phil Farrell 31 Dec 1987
  1966. X *   changed 4.3 ifdef identfier from "4.3BSD", which is illegal in
  1967. X *   C because it contains a period and numerals, to FOURTHREEBSD
  1968. X */
  1969. X
  1970. X#ifdef FORTRAN
  1971. X#include <stdio.h>
  1972. X#include <vplot.h>
  1973. X#include "vp_pc.h"
  1974. X
  1975. X/*
  1976. X * fortran logical unit table definitions
  1977. X */
  1978. typedef long    ftnint;
  1979. typedef ftnint  flag;
  1980. X
  1981. typedef struct        /*units*/
  1982. X{
  1983. X    FILE           *ufd;/*0=unconnected*/
  1984. X    char           *ufnm;
  1985. X    long            uinode;
  1986. X    int             url;/*0=sequential*/
  1987. X    flag            useek;    /*true=can backspace, use dir, ...*/
  1988. X    flag            ufmt;
  1989. X    flag            uprnt;
  1990. X    flag            ublnk;
  1991. X    flag            uend;
  1992. X    flag            uwrt;    /*last io was write*/
  1993. X    flag            uscrtch;
  1994. X}               unit;
  1995. X
  1996. extern unit     units[];/*logical units table*/
  1997. vpunit_ (lunit)
  1998. X    long           *lunit;
  1999. X{
  2000. FILE           *fileptr;
  2001. unit           *uptr;
  2002. X
  2003. X    uptr = units + (*lunit);
  2004. X    fileptr = uptr->ufd;
  2005. X/*
  2006. X * A low-level routine from the fortran compiler library is called
  2007. X * here to determine if file is accessed.  This routine has a different
  2008. X * name under 4.2BSD than 4.3BSD.
  2009. X */
  2010. X#ifdef FOURTHREEBSD
  2011. X    nowwriting (uptr);
  2012. X#else
  2013. X    now_acc (uptr, "a");
  2014. X#endif
  2015. X    vp_pc._pltout = fileptr;
  2016. X}
  2017. X#endif
  2018. END_OF_FILE
  2019. if test 2008 -ne `wc -c <'Vplot_Kernel/lvplot/vp_unit.c'`; then
  2020.     echo shar: \"'Vplot_Kernel/lvplot/vp_unit.c'\" unpacked with wrong size!
  2021. fi
  2022. # end of 'Vplot_Kernel/lvplot/vp_unit.c'
  2023. fi
  2024. if test -f 'Vplot_Kernel/lvplot/vp_uraster.c' -a "${1}" != "-c" ; then 
  2025.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_uraster.c'\"
  2026. else
  2027. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_uraster.c'\" \(1985 characters\)
  2028. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_uraster.c' <<'END_OF_FILE'
  2029. X/*
  2030. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  2031. X * University. Official permission to use this software is included in
  2032. X * the documentation. It authorizes you to use this file for any
  2033. X * non-commercial purpose, provided that this copyright notice is not
  2034. X * removed and that any modifications made to this file are commented
  2035. X * and dated in the style of my example below.
  2036. X */
  2037. X
  2038. X/*
  2039. X *
  2040. X *  source file:   ./lvplot/vp_uraster.c
  2041. X *
  2042. X * Joe Dellinger (SEP), June 11 1987
  2043. X *    Inserted this sample edit history entry.
  2044. X *    Please log any further modifications made to this file:
  2045. X */
  2046. X
  2047. X#include <stdio.h>
  2048. X#include <vplot.h>
  2049. X#include "vp_pc.h"
  2050. X
  2051. X#ifdef FORTRAN
  2052. X
  2053. X#define RASTER        vpraster_
  2054. X#define URASTER        vpuraster_
  2055. X#define XLL        *xll
  2056. X#define YLL        *yll
  2057. X#define XPIX        *xpix
  2058. X#define YPIX        *ypix
  2059. X#define PPI        *ppi
  2060. X#define    BIT        *bit
  2061. X#define OFFSET        *offset
  2062. X#define    BLAST        *blast
  2063. X#define    ORIENT        *orient
  2064. X#define    INVERT        *invert
  2065. X
  2066. X#else
  2067. X
  2068. X#define RASTER        vp_raster
  2069. X#define URASTER        vp_uraster
  2070. X#define XLL        xll
  2071. X#define YLL        yll
  2072. X#define XPIX        xpix
  2073. X#define YPIX        ypix
  2074. X#define PPI        ppi
  2075. X#define    BIT        bit
  2076. X#define OFFSET        offset
  2077. X#define    BLAST        blast
  2078. X#define    ORIENT        orient
  2079. X#define    INVERT        invert
  2080. X
  2081. X#endif
  2082. X
  2083. URASTER (array, blast, bit, offset, xpix, ypix, xll, yll, ppi, xur, yur, orient, invert)
  2084. X    unsigned char  *array;
  2085. X    float           XLL, YLL, *xur, *yur, PPI;
  2086. X    int             XPIX, YPIX, BIT, OFFSET, BLAST, ORIENT, INVERT;
  2087. X{
  2088. float           x1, y1, x2, y2;
  2089. X
  2090. X    x1 = vp_pc._x0 + (XLL - vp_pc._xu0) * vp_pc._xscl;
  2091. X    y1 = vp_pc._y0 + (YLL - vp_pc._yu0) * vp_pc._yscl;
  2092. X
  2093. X    if (PPI == 0.)
  2094. X    {
  2095. X    x2 = vp_pc._x0 + (*xur - vp_pc._xu0) * vp_pc._xscl;
  2096. X    y2 = vp_pc._y0 + (*yur - vp_pc._yu0) * vp_pc._yscl;
  2097. X    }
  2098. X
  2099. X    RASTER (array, BLAST, BIT, OFFSET, XPIX, YPIX, x1, y1, PPI, &x2, &y2, ORIENT, INVERT);
  2100. X
  2101. X    if (PPI != 0. && vp_pc._xscl != 0. && vp_pc._yscl != 0.)
  2102. X    {
  2103. X    *xur = (x2 - vp_pc._x0) / vp_pc._xscl + vp_pc._xu0;
  2104. X    *yur = (y2 - vp_pc._y0) / vp_pc._yscl + vp_pc._yu0;
  2105. X    }
  2106. X}
  2107. END_OF_FILE
  2108. if test 1985 -ne `wc -c <'Vplot_Kernel/lvplot/vp_uraster.c'`; then
  2109.     echo shar: \"'Vplot_Kernel/lvplot/vp_uraster.c'\" unpacked with wrong size!
  2110. fi
  2111. # end of 'Vplot_Kernel/lvplot/vp_uraster.c'
  2112. fi
  2113. echo shar: End of archive 8 \(of 24\).
  2114. cp /dev/null ark8isdone
  2115. MISSING=""
  2116. 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 ; do
  2117.     if test ! -f ark${I}isdone ; then
  2118.     MISSING="${MISSING} ${I}"
  2119.     fi
  2120. done
  2121. if test "${MISSING}" = "" ; then
  2122.     echo You have unpacked all 24 archives.
  2123.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2124. else
  2125.     echo You still need to unpack the following archives:
  2126.     echo "        " ${MISSING}
  2127. fi
  2128. ##  End of shell archive.
  2129. exit 0
  2130.