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

  1. Subject:  v14i012:  Device-independant graphics system, with drivers
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Joe Dellinger <joe@hanauma.STANFORD.EDU>
  7. Posting-number: Volume 14, Issue 12
  8. Archive-name: vplot/part07
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 7 (of 24)."
  17. # Wrapped by rsalz@fig.bbn.com on Fri Mar 25 11:46:56 1988
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. if test -f 'Envision_device/envilib/envigetpoint.c' -a "${1}" != "-c" ; then 
  20.   echo shar: Will not clobber existing file \"'Envision_device/envilib/envigetpoint.c'\"
  21. else
  22. echo shar: Extracting \"'Envision_device/envilib/envigetpoint.c'\" \(1627 characters\)
  23. sed "s/^X//" >'Envision_device/envilib/envigetpoint.c' <<'END_OF_FILE'
  24. X/*
  25. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  26. X * University. Official permission to use this software is included in
  27. X * the documentation. It authorizes you to use this file for any
  28. X * non-commercial purpose, provided that this copyright notice is not
  29. X * removed and that any modifications made to this file are commented
  30. X * and dated in the style of my example below.
  31. X */
  32. X
  33. X/*
  34. X *
  35. X *  source file:   ./filters/envilib/envigetpoint.c
  36. X *
  37. X * Joe Dellinger (SEP), June 11 1987
  38. X *    Inserted this sample edit history entry.
  39. X *    Please log any further modifications made to this file:
  40. X */
  41. X
  42. X#include <stdio.h>
  43. X#include "envi.h"
  44. X
  45. extern FILE    *pltout;
  46. X
  47. envigetpoint (termout, x, y)
  48. X    FILE           *termout;
  49. X    int            *x, *y;
  50. X{
  51. char            string[80];
  52. char            c;
  53. X
  54. X    envisetmode (REG);
  55. X    envipanoff ();        /* Turn off panning */
  56. X    envicursoron ();        /* Turn on the cursor */
  57. X    fflush (pltout);
  58. X
  59. X    fflush (termout);
  60. X    fgets (string, 79, termout);/* Wait for a return */
  61. X    fflush (termout);
  62. X
  63. X    fprintf (pltout, "%cYC", ESC);    /* Ask for position of cursor */
  64. X    fflush (pltout);
  65. X    c = '\0';
  66. X    fflush (termout);
  67. X    fscanf (termout, "%4x%4x\n%c\n", x, y, &c);    /* Get answer */
  68. X
  69. X    /* Undo the window weirdness */
  70. X    *x = (*x + 1) / 4;
  71. X    *y = (*y + 0) / 4;
  72. X/*
  73. X * The plus 1 and 0 are to try to make it land on the right point.
  74. X * Sometimes we get one off. I'm not sure where the problem lies.
  75. X */
  76. X
  77. X    envipanon ();        /* Turn on panning */
  78. X    envicursoroff ();        /* Turn the cursor off again */
  79. X    fflush (pltout);
  80. X    if (c == 'q')
  81. X    return (1);
  82. X    else
  83. X    return (0);
  84. X}
  85. END_OF_FILE
  86. if test 1627 -ne `wc -c <'Envision_device/envilib/envigetpoint.c'`; then
  87.     echo shar: \"'Envision_device/envilib/envigetpoint.c'\" unpacked with wrong size!
  88. fi
  89. # end of 'Envision_device/envilib/envigetpoint.c'
  90. fi
  91. if test -f 'Envision_device/envilib/enviplot.c' -a "${1}" != "-c" ; then 
  92.   echo shar: Will not clobber existing file \"'Envision_device/envilib/enviplot.c'\"
  93. else
  94. echo shar: Extracting \"'Envision_device/envilib/enviplot.c'\" \(1741 characters\)
  95. sed "s/^X//" >'Envision_device/envilib/enviplot.c' <<'END_OF_FILE'
  96. X/*
  97. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  98. X * University. Official permission to use this software is included in
  99. X * the documentation. It authorizes you to use this file for any
  100. X * non-commercial purpose, provided that this copyright notice is not
  101. X * removed and that any modifications made to this file are commented
  102. X * and dated in the style of my example below.
  103. X */
  104. X
  105. X/*
  106. X *
  107. X *  source file:   ./filters/envilib/enviplot.c
  108. X *
  109. X * Joe Dellinger (SEP), June 11 1987
  110. X *    Inserted this sample edit history entry.
  111. X *    Please log any further modifications made to this file:
  112. X */
  113. X
  114. X#include <stdio.h>
  115. X#include "envi.h"
  116. extern FILE    *pltout;
  117. X
  118. int             lost = 1;    /* 1 means we are lost, zero means we aren't */
  119. X
  120. enviplot (x, y, draw)    /* efficiently get to the point x,y. */
  121. X    int             x, y, draw;    /* draw 0 means we want to move, not to draw */
  122. X{
  123. int             hiy, loy, hix, lox;
  124. int             ok;    /* ok not 1 means that our old position is
  125. X             * meaningless */
  126. static int      ohiy, oloy, ohix, olox;
  127. X
  128. X    if (draw == 0)
  129. X    {
  130. X    envisetmode (REG);
  131. X    }
  132. X    envisetmode (TEK);
  133. X
  134. X    ok = (lost == 0);
  135. X    hiy = (y >> 5) | 040;    /* y/32+32 hi y byte */
  136. X    loy = (y & 037) | 0140;    /* y%32+96 low y byte */
  137. X    hix = (x >> 5) | 040;    /* x/32+32 hi x byte */
  138. X    lox = (x & 037) | 0100;    /* x%32+64 low x byte */
  139. X
  140. X    if ((hiy != ohiy) || (ok != 1))
  141. X    fprintf (pltout, "%c", hiy);
  142. X    if ((hix != ohix) || (ok != 1))
  143. X    {
  144. X    fprintf (pltout, "%c%c", loy, hix);
  145. X    }
  146. X    else
  147. X    {
  148. X    if ((loy != oloy) || (ok != 1))
  149. X        fprintf (pltout, "%c", loy);
  150. X    }
  151. X    fprintf (pltout, "%c", lox);
  152. X
  153. X    /* remember this for next time */
  154. X    oloy = loy;
  155. X    ohiy = hiy;
  156. X    ohix = hix;
  157. X    olox = lox;
  158. X
  159. X    lost = 0;
  160. X}
  161. END_OF_FILE
  162. if test 1741 -ne `wc -c <'Envision_device/envilib/enviplot.c'`; then
  163.     echo shar: \"'Envision_device/envilib/enviplot.c'\" unpacked with wrong size!
  164. fi
  165. # end of 'Envision_device/envilib/enviplot.c'
  166. fi
  167. if test -f 'Envision_device/envilib/envipoint.c' -a "${1}" != "-c" ; then 
  168.   echo shar: Will not clobber existing file \"'Envision_device/envilib/envipoint.c'\"
  169. else
  170. echo shar: Extracting \"'Envision_device/envilib/envipoint.c'\" \(1567 characters\)
  171. sed "s/^X//" >'Envision_device/envilib/envipoint.c' <<'END_OF_FILE'
  172. X/*
  173. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  174. X * University. Official permission to use this software is included in
  175. X * the documentation. It authorizes you to use this file for any
  176. X * non-commercial purpose, provided that this copyright notice is not
  177. X * removed and that any modifications made to this file are commented
  178. X * and dated in the style of my example below.
  179. X */
  180. X
  181. X/*
  182. X *
  183. X *  source file:   ./filters/envilib/envipoint.c
  184. X *
  185. X * Joe Dellinger (SEP), June 11 1987
  186. X *    Inserted this sample edit history entry.
  187. X *    Please log any further modifications made to this file:
  188. X */
  189. X
  190. X#include <stdio.h>
  191. X#include "envi.h"
  192. extern FILE    *pltout;
  193. X
  194. extern int      lost;
  195. X
  196. envipoint (x, y)    /* draw a point at x,y. */
  197. X    int             x, y;
  198. X{
  199. int             hiy, loy, hix, lox;
  200. int             ok;    /* ok not 1 means that our old position is
  201. X             * meaningless */
  202. static int      ohiy, oloy, ohix, olox;
  203. X
  204. X    envisetmode (MOV);
  205. X
  206. X    ok = (lost == 0);
  207. X    hiy = (y >> 5) | 040;    /* y/32+32 hi y byte */
  208. X    loy = (y & 037) | 0140;    /* y%32+96 low y byte */
  209. X    hix = (x >> 5) | 040;    /* x/32+32 hi x byte */
  210. X    lox = (x & 037) | 0100;    /* x%32+64 low x byte */
  211. X
  212. X    if ((hiy != ohiy) || (ok != 1))
  213. X    fprintf (pltout, "%c", hiy);
  214. X    if ((hix != ohix) || (ok != 1))
  215. X    {
  216. X    fprintf (pltout, "%c%c", loy, hix);
  217. X    }
  218. X    else
  219. X    {
  220. X    if ((loy != oloy) || (ok != 1))
  221. X        fprintf (pltout, "%c", loy);
  222. X    }
  223. X    fprintf (pltout, "%c", lox);
  224. X
  225. X    /* remember this for next time */
  226. X    oloy = loy;
  227. X    ohiy = hiy;
  228. X    ohix = hix;
  229. X    olox = lox;
  230. X
  231. X    lost = 0;
  232. X}
  233. END_OF_FILE
  234. if test 1567 -ne `wc -c <'Envision_device/envilib/envipoint.c'`; then
  235.     echo shar: \"'Envision_device/envilib/envipoint.c'\" unpacked with wrong size!
  236. fi
  237. # end of 'Envision_device/envilib/envipoint.c'
  238. fi
  239. if test -f 'Masscomp_device/gpslib/gpsconf.c' -a "${1}" != "-c" ; then 
  240.   echo shar: Will not clobber existing file \"'Masscomp_device/gpslib/gpsconf.c'\"
  241. else
  242. echo shar: Extracting \"'Masscomp_device/gpslib/gpsconf.c'\" \(1675 characters\)
  243. sed "s/^X//" >'Masscomp_device/gpslib/gpsconf.c' <<'END_OF_FILE'
  244. X/*
  245. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  246. X * University. Official permission to use this software is included in
  247. X * the documentation. It authorizes you to use this file for any
  248. X * non-commercial purpose, provided that this copyright notice is not
  249. X * removed and that any modifications made to this file are commented
  250. X * and dated in the style of my example below.
  251. X */
  252. X
  253. X/*
  254. X *
  255. X *  source file:   ./filters/gpslib/gpsconf.c
  256. X *
  257. X * Stewart A. Levin (SEP), July, 3 1987
  258. X *    Cribbed rasconf.c for gps filter
  259. X */
  260. X
  261. X/*
  262. X * Keyword: vplot versatec color pen masscomp
  263. X */
  264. X#include <stdio.h>
  265. X#include "../include/enum.h"
  266. X#include "../include/extern.h"
  267. X#include "gpspen.h"
  268. X
  269. X/*
  270. X * mandatory declarations and initializations
  271. X */
  272. X#ifdef SEP
  273. char            name[] = "Gpspen";
  274. X#else
  275. char            name[] = "gpspen";
  276. X#endif
  277. X#include "gpsdoc.h"
  278. X
  279. X/*
  280. X * device routine table
  281. X */
  282. extern int
  283. genmessage (), gpsopen (), genmarker ();
  284. extern int
  285. genvector (), gentext ();
  286. extern int
  287. genpoint (), gpsplot ();
  288. extern int
  289. vecarea (), genraster ();
  290. extern int
  291. nulldev (), gpsattr (), gpsreset (), gpsclose ();
  292. X
  293. struct device   dev =
  294. X{
  295. X
  296. X /* control routines */
  297. X gpsopen,        /* open */
  298. X gpsreset,        /* reset */
  299. X genmessage,        /* message */
  300. X nulldev,        /* erase */
  301. X gpsclose,        /* close */
  302. X
  303. X /* high level output */
  304. X genvector,        /* vector */
  305. X genmarker,        /* marker */
  306. X gentext,        /* text */
  307. X vecarea,        /* area */
  308. X genraster,        /* raster */
  309. X genpoint,        /* point */
  310. X gpsattr,        /* attributes */
  311. X
  312. X /* input */
  313. X nulldev,        /* getpoint */
  314. X nulldev,        /* interact */
  315. X
  316. X /* low level output */
  317. X gpsplot,        /* plot */
  318. X nulldev,        /* startpoly */
  319. X nulldev,        /* midpoly */
  320. X nulldev        /* endpoly */
  321. X};
  322. END_OF_FILE
  323. if test 1675 -ne `wc -c <'Masscomp_device/gpslib/gpsconf.c'`; then
  324.     echo shar: \"'Masscomp_device/gpslib/gpsconf.c'\" unpacked with wrong size!
  325. fi
  326. # end of 'Masscomp_device/gpslib/gpsconf.c'
  327. fi
  328. if test -f 'Printronix_device/lprlib/lprconf.c' -a "${1}" != "-c" ; then 
  329.   echo shar: Will not clobber existing file \"'Printronix_device/lprlib/lprconf.c'\"
  330. else
  331. echo shar: Extracting \"'Printronix_device/lprlib/lprconf.c'\" \(1809 characters\)
  332. sed "s/^X//" >'Printronix_device/lprlib/lprconf.c' <<'END_OF_FILE'
  333. X/*
  334. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  335. X * University. Official permission to use this software is included in
  336. X * the documentation. It authorizes you to use this file for any
  337. X * non-commercial purpose, provided that this copyright notice is not
  338. X * removed and that any modifications made to this file are commented
  339. X * and dated in the style of my example below.
  340. X */
  341. X
  342. X/*
  343. X *
  344. X *  source file:   ./filters/lprlib/lprconf.c
  345. X *
  346. X * Joe Dellinger (SEP), June 11 1987
  347. X *    Inserted this sample edit history entry.
  348. X *    Please log any further modifications made to this file:
  349. X */
  350. X
  351. X/*
  352. X * printronix P300/P600 configuration
  353. X */
  354. X#include <stdio.h>
  355. X#include "../include/enum.h"
  356. X#include "../include/extern.h"
  357. X
  358. X/*
  359. X * mandatory declarations and initializations
  360. X */
  361. X#ifdef SEP
  362. char            name[] = "Lprpen";
  363. X#else
  364. char            name[] = "lprpen";
  365. X#endif
  366. X#include "lprdoc.h"
  367. X
  368. X/*
  369. X * device routine table
  370. X */
  371. extern int
  372. lpropen (), lprerase (), lprclose (), lprvector ();
  373. extern int
  374. gentext (), genraster (), genmessage (), genpatarea ();
  375. extern int
  376. genpoint (), genmarker (), lprattr (), nulldev ();
  377. X
  378. struct device   dev = {
  379. X
  380. X /* control routines */
  381. X               lpropen,    /* open */
  382. X               nulldev,    /* reset */
  383. X               genmessage,    /* message */
  384. X               lprerase,    /* erase */
  385. X               lprclose,    /* close */
  386. X
  387. X /* high level output */
  388. X               lprvector,    /* vector */
  389. X               genmarker,    /* marker */
  390. X               gentext,    /* text */
  391. X               genpatarea,    /* area */
  392. X               genraster,    /* raster */
  393. X               genpoint,    /* point */
  394. X               lprattr,    /* attributes */
  395. X
  396. X /* input */
  397. X               nulldev,    /* getpoint */
  398. X               nulldev,    /* interact */
  399. X
  400. X /* low level output */
  401. X               nulldev,    /* plot */
  402. X               nulldev,    /* startpoly */
  403. X               nulldev,    /* midpoly */
  404. X               nulldev    /* endpoly */
  405. X};
  406. END_OF_FILE
  407. if test 1809 -ne `wc -c <'Printronix_device/lprlib/lprconf.c'`; then
  408.     echo shar: \"'Printronix_device/lprlib/lprconf.c'\" unpacked with wrong size!
  409. fi
  410. # end of 'Printronix_device/lprlib/lprconf.c'
  411. fi
  412. if test -f 'Regis_device/gigilib/gigiattr.c' -a "${1}" != "-c" ; then 
  413.   echo shar: Will not clobber existing file \"'Regis_device/gigilib/gigiattr.c'\"
  414. else
  415. echo shar: Extracting \"'Regis_device/gigilib/gigiattr.c'\" \(1556 characters\)
  416. sed "s/^X//" >'Regis_device/gigilib/gigiattr.c' <<'END_OF_FILE'
  417. X/*
  418. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  419. X * University. Official permission to use this software is included in
  420. X * the documentation. It authorizes you to use this file for any
  421. X * non-commercial purpose, provided that this copyright notice is not
  422. X * removed and that any modifications made to this file are commented
  423. X * and dated in the style of my example below.
  424. X */
  425. X
  426. X/*
  427. X *
  428. X *  source file:   ./filters/gigilib/gigiattr.c
  429. X *
  430. X * Joe Dellinger (SEP), June 11 1987
  431. X *    Inserted this sample edit history entry.
  432. X *    Please log any further modifications made to this file:
  433. X */
  434. X
  435. X/*
  436. X * control graphics attributes
  437. X */
  438. X#include <stdio.h>
  439. X#include "gigi.h"
  440. X#include "../include/attrcom.h"
  441. extern FILE    *pltout;
  442. extern char     wstype[], callname[];
  443. X
  444. gigiattributes (command, value, dummy1, dummy2, dummy3)
  445. X    int             command, value, dummy1, dummy2, dummy3;
  446. X{
  447. static int      cur_color;
  448. int             color;
  449. X
  450. X    switch (command)
  451. X    {
  452. X    case SET_COLOR:
  453. X    if ((!strcmp (wstype, "vt125")) && (value > 3))
  454. X        color = 1 + (value - 2) % 3;    /* this maps 7 (white) to 3
  455. X                         * (white) */
  456. X    else
  457. X    if (value > 7)
  458. X        color = 1 + (value - 8) % 7;
  459. X    else
  460. X        color = value;
  461. X
  462. X    if ((color != cur_color) && (color >= 0))
  463. X    {
  464. X        if (color == 0)
  465. X        fprintf (pltout, ";@:W (W(EI%dA0N0M2P1(M2)))@;", color);
  466. X        else
  467. X        fprintf (pltout, ";@:W (W(VI%dA0N0M2P1(M2)))@;", color);
  468. X        lastop = ' ';
  469. X        cur_color = color;
  470. X    }
  471. X    break;
  472. X    case SET_COLOR_TABLE:    /* None to set on GIGI */
  473. X    break;
  474. X    default:
  475. X    break;
  476. X    }
  477. X
  478. X    return 0;
  479. X}
  480. END_OF_FILE
  481. if test 1556 -ne `wc -c <'Regis_device/gigilib/gigiattr.c'`; then
  482.     echo shar: \"'Regis_device/gigilib/gigiattr.c'\" unpacked with wrong size!
  483. fi
  484. # end of 'Regis_device/gigilib/gigiattr.c'
  485. fi
  486. if test -f 'Regis_device/gigilib/gigiclose.c' -a "${1}" != "-c" ; then 
  487.   echo shar: Will not clobber existing file \"'Regis_device/gigilib/gigiclose.c'\"
  488. else
  489. echo shar: Extracting \"'Regis_device/gigilib/gigiclose.c'\" \(1576 characters\)
  490. sed "s/^X//" >'Regis_device/gigilib/gigiclose.c' <<'END_OF_FILE'
  491. X/*
  492. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  493. X * University. Official permission to use this software is included in
  494. X * the documentation. It authorizes you to use this file for any
  495. X * non-commercial purpose, provided that this copyright notice is not
  496. X * removed and that any modifications made to this file are commented
  497. X * and dated in the style of my example below.
  498. X */
  499. X
  500. X/*
  501. X *
  502. X *  source file:   ./filters/gigilib/gigiclose.c
  503. X *
  504. X * Joe Dellinger (SEP), June 11 1987
  505. X *    Inserted this sample edit history entry.
  506. X *    Please log any further modifications made to this file:
  507. X */
  508. X
  509. X/*
  510. X * Routine to finish up with the terminal.
  511. X */
  512. X#include <stdio.h>
  513. X#include "gigi.h"
  514. X#include "../include/closestat.h"
  515. X#include "../include/mesgcom.h"
  516. extern FILE    *pltout;
  517. X
  518. gigiclose (status)
  519. X    int             status;
  520. X{
  521. X    switch (status)
  522. X    {
  523. X    case CLOSE_DONE:
  524. X    if (lastop != '\0')
  525. X        goff ();
  526. X    break;
  527. X    case CLOSE_FLUSH:
  528. X    fflush (pltout);
  529. X    break;
  530. X    case CLOSE_PAUSE:
  531. X    gigimessage (MESG_HOME);
  532. X    break;
  533. X    case CLOSE_INTERRUPT:
  534. X    if (lastop != '\0')
  535. X    {
  536. X        fprintf (pltout, ";;;");
  537. X    }
  538. X    break;
  539. X    case CLOSE_NORMAL:
  540. X    case CLOSE_ERROR:
  541. X    case CLOSE_NOTHING:
  542. X    default:            /* not meant for us, ignore */
  543. X    break;
  544. X    }
  545. X}
  546. X
  547. extern char    *getenv ();
  548. goff ()
  549. X{
  550. X    /* GIGI owners manual page 66 */
  551. static char     off1[10] = "X\\";
  552. char           *screencolor;
  553. X    off1[0] = ESC;
  554. X    if (NULL != (screencolor = getenv ("SCREEN")))
  555. X    fprintf (pltout, ";S(I(%c))", *screencolor);
  556. X    fprintf (pltout, "%s", off1);
  557. X    fflush (pltout);
  558. X    lastop = ' ';
  559. X}
  560. END_OF_FILE
  561. if test 1576 -ne `wc -c <'Regis_device/gigilib/gigiclose.c'`; then
  562.     echo shar: \"'Regis_device/gigilib/gigiclose.c'\" unpacked with wrong size!
  563. fi
  564. # end of 'Regis_device/gigilib/gigiclose.c'
  565. fi
  566. if test -f 'Tek_device/cteklib/ctekattr.c' -a "${1}" != "-c" ; then 
  567.   echo shar: Will not clobber existing file \"'Tek_device/cteklib/ctekattr.c'\"
  568. else
  569. echo shar: Extracting \"'Tek_device/cteklib/ctekattr.c'\" \(1793 characters\)
  570. sed "s/^X//" >'Tek_device/cteklib/ctekattr.c' <<'END_OF_FILE'
  571. X/*
  572. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  573. X * University. Official permission to use this software is included in
  574. X * the documentation. It authorizes you to use this file for any
  575. X * non-commercial purpose, provided that this copyright notice is not
  576. X * removed and that any modifications made to this file are commented
  577. X * and dated in the style of my example below.
  578. X */
  579. X
  580. X/*
  581. X *
  582. X *  source file:   ./filters/cteklib/ctekattr.c
  583. X *
  584. X * Joe Dellinger (SEP), June 11 1987
  585. X *    Inserted this sample edit history entry.
  586. X *    Please log any further modifications made to this file:
  587. X */
  588. X
  589. X/*
  590. X * control graphics attributes
  591. X */
  592. X#include <stdio.h>
  593. X#include <math.h>
  594. X#include "ctek.h"
  595. X#include "../include/attrcom.h"
  596. extern FILE    *pltout;
  597. X
  598. ctekattributes (command, value, v1, v2, v3)
  599. X    register int    command, value;
  600. X    int             v1, v2, v3;
  601. X{
  602. static int      cur_color;
  603. int             color;
  604. int             hue, lightness, saturation, temp;
  605. float           x, y;
  606. X
  607. X    switch (command)
  608. X    {
  609. X    case SET_COLOR:
  610. X    color = value;
  611. X
  612. X    if ((color != cur_color) && (color >= 0))
  613. X    {
  614. X        ctekcolor (color);
  615. X        cur_color = color;
  616. X    }
  617. X    break;
  618. X    case SET_COLOR_TABLE:
  619. X    if (value < 8)
  620. X    {
  621. X        x = v3 - .5 * v2 - .5 * v1;
  622. X        y = (.866) * (v1 - v2);
  623. X        if (x == 0. && y == 0.)
  624. X        {
  625. X        hue = 0;
  626. X        }
  627. X        else
  628. X        {
  629. X        hue = (180.) * atan2 (y, x) / 3.1416;
  630. X        }
  631. X        if (v1 < v2)
  632. X        {
  633. X        temp = v1;
  634. X        v1 = v2;
  635. X        v2 = temp;
  636. X        }
  637. X        if (v1 < v3)
  638. X        {
  639. X        temp = v1;
  640. X        v1 = v3;
  641. X        v3 = temp;
  642. X        }
  643. X        if (v2 < v3)
  644. X        {
  645. X        temp = v2;
  646. X        v2 = v3;
  647. X        v3 = temp;
  648. X        }
  649. X        lightness = 100 * (v1 + v3) / (255 * 2);
  650. X        saturation = 100 * abs (v1 - v3) / 255;
  651. X        cteksetcoltab (value, hue, lightness, saturation);
  652. X    }
  653. X    break;
  654. X    default:
  655. X    break;
  656. X    }
  657. X
  658. X    return 0;
  659. X}
  660. END_OF_FILE
  661. if test 1793 -ne `wc -c <'Tek_device/cteklib/ctekattr.c'`; then
  662.     echo shar: \"'Tek_device/cteklib/ctekattr.c'\" unpacked with wrong size!
  663. fi
  664. # end of 'Tek_device/cteklib/ctekattr.c'
  665. fi
  666. if test -f 'Tek_device/cteklib/ctekclose.c' -a "${1}" != "-c" ; then 
  667.   echo shar: Will not clobber existing file \"'Tek_device/cteklib/ctekclose.c'\"
  668. else
  669. echo shar: Extracting \"'Tek_device/cteklib/ctekclose.c'\" \(1607 characters\)
  670. sed "s/^X//" >'Tek_device/cteklib/ctekclose.c' <<'END_OF_FILE'
  671. X/*
  672. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  673. X * University. Official permission to use this software is included in
  674. X * the documentation. It authorizes you to use this file for any
  675. X * non-commercial purpose, provided that this copyright notice is not
  676. X * removed and that any modifications made to this file are commented
  677. X * and dated in the style of my example below.
  678. X */
  679. X
  680. X/*
  681. X *
  682. X *  source file:   ./filters/cteklib/ctekclose.c
  683. X *
  684. X * Joe Dellinger (SEP), June 11 1987
  685. X *    Inserted this sample edit history entry.
  686. X *    Please log any further modifications made to this file:
  687. X */
  688. X
  689. X/*
  690. X * Routine to close the device
  691. X */
  692. X#include <stdio.h>
  693. X#include "ctek.h"
  694. X#include "../include/mesgcom.h"
  695. X#include "../include/closestat.h"
  696. X#include "../include/extern.h"
  697. X#include "../include/enum.h"
  698. X
  699. X#define BELL    007
  700. int             want_bell = YES;
  701. X
  702. ctekclose (status)
  703. X    int             status;
  704. X{
  705. X    switch (status)
  706. X    {
  707. X    case CLOSE_PAUSE:
  708. X    cteksetmode (ANSI);
  709. X    if (want_bell == YES)
  710. X    {
  711. X        Putc (BELL);
  712. X        Putc (BELL);
  713. X        Putc (BELL);
  714. X        Putc (BELL);
  715. X        Putc (BELL);
  716. X    }
  717. X    break;
  718. X
  719. X    case CLOSE_ERROR:
  720. X    break;
  721. X
  722. X    case CLOSE_FLUSH:
  723. X    fflush (pltout);
  724. X    break;
  725. X
  726. X    case CLOSE_INTERRUPT:
  727. X    Putc (US);
  728. X    fprintf (pltout, "%c%%!1", ESC);
  729. X    Putc (US);
  730. X    fprintf (pltout, "%c%%!1", ESC);
  731. X    Putc (US);
  732. X    fprintf (pltout, "%c%%!1", ESC);
  733. X    Putc (US);
  734. X    fprintf (pltout, "%c%%!1", ESC);
  735. X    cteksetmode (ANSI);
  736. X    break;
  737. X
  738. X    case CLOSE_NOTHING:    /* No input */
  739. X    case CLOSE_NORMAL:
  740. X    break;
  741. X
  742. X    case CLOSE_DONE:
  743. X    cteksetmode (ANSI);
  744. X    break;
  745. X
  746. X    default:            /* not meant for us, ignore */
  747. X    break;
  748. X    }
  749. X}
  750. END_OF_FILE
  751. if test 1607 -ne `wc -c <'Tek_device/cteklib/ctekclose.c'`; then
  752.     echo shar: \"'Tek_device/cteklib/ctekclose.c'\" unpacked with wrong size!
  753. fi
  754. # end of 'Tek_device/cteklib/ctekclose.c'
  755. fi
  756. if test -f 'Tek_device/cteklib/ctekmessage.c' -a "${1}" != "-c" ; then 
  757.   echo shar: Will not clobber existing file \"'Tek_device/cteklib/ctekmessage.c'\"
  758. else
  759. echo shar: Extracting \"'Tek_device/cteklib/ctekmessage.c'\" \(1678 characters\)
  760. sed "s/^X//" >'Tek_device/cteklib/ctekmessage.c' <<'END_OF_FILE'
  761. X/*
  762. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  763. X * University. Official permission to use this software is included in
  764. X * the documentation. It authorizes you to use this file for any
  765. X * non-commercial purpose, provided that this copyright notice is not
  766. X * removed and that any modifications made to this file are commented
  767. X * and dated in the style of my example below.
  768. X */
  769. X
  770. X/*
  771. X *
  772. X *  source file:   ./filters/cteklib/ctekmessage.c
  773. X *
  774. X * Joe Dellinger (SEP), June 11 1987
  775. X *    Inserted this sample edit history entry.
  776. X *    Please log any further modifications made to this file:
  777. X */
  778. X
  779. X/*
  780. X * Device dependent subroutine to handle message operations
  781. X */
  782. X#include    <stdio.h>
  783. X#include    "ctek.h"
  784. X#include    "../include/mesgcom.h"
  785. X#include    "../include/enum.h"
  786. extern FILE    *pltout;
  787. X
  788. ctekmessage (command, string)
  789. X    int             command;
  790. X    char            string[];
  791. X{
  792. X
  793. X    switch (command)
  794. X    {
  795. X    case MESG_HOME:        /* Home */
  796. X    cteksetmode (ANSI);
  797. X    fprintf (pltout, "%c[H", ESC);
  798. X    break;
  799. X    case MESG_READY:
  800. X    cteksetmode (ANSI);
  801. X    break;
  802. X    case MESG_TEXT:
  803. X    fprintf (pltout, "%s", string);
  804. X    break;
  805. X    case MESG_ON:        /* Turn on Text */
  806. X    cteksetmode (TEK);
  807. X    fprintf (pltout, "%cLV1", ESC);
  808. X    fflush (pltout);
  809. X    break;
  810. X    case MESG_OFF:        /* Turn off text */
  811. X    cteksetmode (TEK);
  812. X    fprintf (pltout, "%cLV0", ESC);
  813. X    fflush (pltout);
  814. X    break;
  815. X    case MESG_ERASE:        /* Erase Text */
  816. X    cteksetmode (TEK);
  817. X    fprintf (pltout, "%cLZ", ESC);
  818. X    fflush (pltout);
  819. X    break;
  820. X    case MESG_HIGHLIGHT_ON:
  821. X    fprintf (pltout, "%c[7m", ESC);
  822. X    break;
  823. X    case MESG_HIGHLIGHT_OFF:
  824. X    fprintf (pltout, "%c[0m", ESC);
  825. X    break;
  826. X    case MESG_DONE:
  827. X    default:
  828. X    fflush (pltout);
  829. X    break;
  830. X    }
  831. X}
  832. END_OF_FILE
  833. if test 1678 -ne `wc -c <'Tek_device/cteklib/ctekmessage.c'`; then
  834.     echo shar: \"'Tek_device/cteklib/ctekmessage.c'\" unpacked with wrong size!
  835. fi
  836. # end of 'Tek_device/cteklib/ctekmessage.c'
  837. fi
  838. if test -f 'Tek_device/cteklib/cteksetmode.c' -a "${1}" != "-c" ; then 
  839.   echo shar: Will not clobber existing file \"'Tek_device/cteklib/cteksetmode.c'\"
  840. else
  841. echo shar: Extracting \"'Tek_device/cteklib/cteksetmode.c'\" \(1752 characters\)
  842. sed "s/^X//" >'Tek_device/cteklib/cteksetmode.c' <<'END_OF_FILE'
  843. X/*
  844. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  845. X * University. Official permission to use this software is included in
  846. X * the documentation. It authorizes you to use this file for any
  847. X * non-commercial purpose, provided that this copyright notice is not
  848. X * removed and that any modifications made to this file are commented
  849. X * and dated in the style of my example below.
  850. X */
  851. X
  852. X/*
  853. X *
  854. X *  source file:   ./filters/cteklib/cteksetmode.c
  855. X *
  856. X * Joe Dellinger (SEP), June 11 1987
  857. X *    Inserted this sample edit history entry.
  858. X *    Please log any further modifications made to this file:
  859. X */
  860. X
  861. X/*
  862. X * Three possible modes for the Tek 4105: ANSI, Tek (or alpha), and
  863. X * vector input mode. This is the exclusive routine that keeps
  864. X * track of which mode we are in, and does what is necessary to
  865. X * change modes.
  866. X */
  867. X/*
  868. X * Updated to realize the fact that popping out to TEK mode loses
  869. X * the train of vectors! (i.e. sets variable "lost" appropriately)
  870. X */
  871. X#include    <stdio.h>
  872. X#include    "ctek.h"
  873. extern FILE    *pltout;
  874. X
  875. int             lost;
  876. X
  877. cteksetmode (mode)
  878. X    int             mode;
  879. X{
  880. static int      old_mode = ANSI;
  881. X
  882. X    switch (mode)
  883. X    {
  884. X    case ANSI:
  885. X    if (old_mode == VECTOR)
  886. X    {
  887. X        lost = 1;
  888. X        Putc (US);
  889. X        old_mode = TEK;
  890. X    }
  891. X    if (old_mode == TEK)
  892. X    {
  893. X        fprintf (pltout, "%c%%!1", ESC);
  894. X        old_mode = ANSI;
  895. X    }
  896. X    break;
  897. X    case TEK:
  898. X    if (old_mode == VECTOR)
  899. X    {
  900. X        lost = 1;
  901. X        Putc (US);
  902. X        old_mode = TEK;
  903. X    }
  904. X    else
  905. X    if (old_mode == ANSI)
  906. X    {
  907. X        fprintf (pltout, "%c%%!0", ESC);
  908. X        old_mode = TEK;
  909. X    }
  910. X    break;
  911. X    case VECTOR:
  912. X    if (old_mode == TEK)
  913. X    {
  914. X        Putc (GS);
  915. X        old_mode = VECTOR;
  916. X    }
  917. X    else
  918. X    if (old_mode == ANSI)
  919. X    {
  920. X        fprintf (pltout, "%c%%!0%c", ESC, GS);
  921. X        old_mode = VECTOR;
  922. X    }
  923. X    break;
  924. X    }
  925. X}
  926. END_OF_FILE
  927. if test 1752 -ne `wc -c <'Tek_device/cteklib/cteksetmode.c'`; then
  928.     echo shar: \"'Tek_device/cteklib/cteksetmode.c'\" unpacked with wrong size!
  929. fi
  930. # end of 'Tek_device/cteklib/cteksetmode.c'
  931. fi
  932. if test -f 'Virtual_device/raslib/rasconf.c' -a "${1}" != "-c" ; then 
  933.   echo shar: Will not clobber existing file \"'Virtual_device/raslib/rasconf.c'\"
  934. else
  935. echo shar: Extracting \"'Virtual_device/raslib/rasconf.c'\" \(1741 characters\)
  936. sed "s/^X//" >'Virtual_device/raslib/rasconf.c' <<'END_OF_FILE'
  937. X/*
  938. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  939. X * University. Official permission to use this software is included in
  940. X * the documentation. It authorizes you to use this file for any
  941. X * non-commercial purpose, provided that this copyright notice is not
  942. X * removed and that any modifications made to this file are commented
  943. X * and dated in the style of my example below.
  944. X */
  945. X
  946. X/*
  947. X *
  948. X *  source file:   ./filters/raslib/rasconf.c
  949. X *
  950. X * Joe Dellinger (SEP), June 11 1987
  951. X *    Inserted this sample edit history entry.
  952. X *    Please log any further modifications made to this file:
  953. X */
  954. X
  955. X/*
  956. X * Keyword: vplot raster movie pen
  957. X */
  958. X#include <stdio.h>
  959. X#include "../include/enum.h"
  960. X#include "../include/extern.h"
  961. X#include "raspen.h"
  962. X
  963. X/*
  964. X * mandatory declarations and initializations
  965. X */
  966. X#ifdef SEP
  967. char            name[] = "Raspen";
  968. X#else
  969. char            name[] = "raspen";
  970. X#endif
  971. X#include "rasdoc.h"
  972. X
  973. X/*
  974. X * device routine table
  975. X */
  976. extern int
  977. genmessage (), raserase (), rasopen (), genmarker ();
  978. extern int
  979. rasvector (), gentext ();
  980. extern int      genpoint ();
  981. extern int
  982. genpatarea (), genraster ();
  983. extern int
  984. nulldev (), rasattr (), rasreset (), rasclose ();
  985. X
  986. struct device   dev =
  987. X{
  988. X
  989. X /* control routines */
  990. X rasopen,        /* open */
  991. X rasreset,        /* reset */
  992. X genmessage,        /* message */
  993. X raserase,        /* erase */
  994. X rasclose,        /* close */
  995. X
  996. X /* high level output */
  997. X rasvector,        /* vector */
  998. X genmarker,        /* marker */
  999. X gentext,        /* text */
  1000. X genpatarea,        /* area */
  1001. X genraster,        /* raster */
  1002. X genpoint,        /* point */
  1003. X rasattr,        /* attributes */
  1004. X
  1005. X /* input */
  1006. X nulldev,        /* getpoint */
  1007. X nulldev,        /* interact */
  1008. X
  1009. X /* low level output */
  1010. X nulldev,        /* plot */
  1011. X nulldev,        /* startpoly */
  1012. X nulldev,        /* midpoly */
  1013. X nulldev        /* endpoly */
  1014. X};
  1015. END_OF_FILE
  1016. if test 1741 -ne `wc -c <'Virtual_device/raslib/rasconf.c'`; then
  1017.     echo shar: \"'Virtual_device/raslib/rasconf.c'\" unpacked with wrong size!
  1018. fi
  1019. # end of 'Virtual_device/raslib/rasconf.c'
  1020. fi
  1021. if test -f 'Virtual_device/vplib/vpconf.c' -a "${1}" != "-c" ; then 
  1022.   echo shar: Will not clobber existing file \"'Virtual_device/vplib/vpconf.c'\"
  1023. else
  1024. echo shar: Extracting \"'Virtual_device/vplib/vpconf.c'\" \(1773 characters\)
  1025. sed "s/^X//" >'Virtual_device/vplib/vpconf.c' <<'END_OF_FILE'
  1026. X/*
  1027. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1028. X * University. Official permission to use this software is included in
  1029. X * the documentation. It authorizes you to use this file for any
  1030. X * non-commercial purpose, provided that this copyright notice is not
  1031. X * removed and that any modifications made to this file are commented
  1032. X * and dated in the style of my example below.
  1033. X */
  1034. X
  1035. X/*
  1036. X *
  1037. X *  source file:   ./filters/vplib/vpconf.c
  1038. X *
  1039. X * Joe Dellinger (SEP), Dec 19 1987
  1040. X *    Inserted this sample edit history entry.
  1041. X *    Please log any further modifications made to this file:
  1042. X */
  1043. X
  1044. X/*
  1045. X * A generic filter --- both inputs and outputs vplot.
  1046. X * Keyword: pchain pen vplot
  1047. X */
  1048. X#include <stdio.h>
  1049. X#include "../include/extern.h"
  1050. X
  1051. X/*
  1052. X * mandatory declarations
  1053. X */
  1054. X#ifdef SEP
  1055. char            name[] = "Vppen";
  1056. X#else
  1057. char            name[] = "vppen";
  1058. X#endif
  1059. X#include "vpdoc.h"
  1060. X
  1061. X/*
  1062. X * device routine table
  1063. X */
  1064. extern int
  1065. vpopen (), vpreset (), vpmessage (), vperase (), vpclose ();
  1066. extern int
  1067. vpattributes (), vpvector (), vpplot ();
  1068. extern int
  1069. vpstartpoly (), vpmidpoly (), vpendpoly ();
  1070. extern int
  1071. vpraster (), vpmarker (), vptext ();
  1072. extern int
  1073. genarea (), genpoint ();
  1074. extern int      nulldev ();
  1075. X
  1076. struct device   dev =
  1077. X{
  1078. X /* control routines */
  1079. X vpopen,        /* open */
  1080. X vpreset,        /* reset */
  1081. X vpmessage,        /* message */
  1082. X vperase,        /* erase */
  1083. X vpclose,        /* close */
  1084. X
  1085. X /* high level output */
  1086. X vpvector,        /* vector */
  1087. X vpmarker,        /* marker */
  1088. X vptext,        /* text */
  1089. X genarea,        /* area */
  1090. X vpraster,        /* raster */
  1091. X genpoint,        /* point */
  1092. X vpattributes,        /* attributes */
  1093. X
  1094. X /* input */
  1095. X nulldev,        /* getpoint */
  1096. X nulldev,        /* interact */
  1097. X
  1098. X /* low level output */
  1099. X vpplot,        /* plot */
  1100. X vpstartpoly,        /* startpoly */
  1101. X vpmidpoly,        /* midpoly */
  1102. X vpendpoly        /* endpoly */
  1103. X};
  1104. END_OF_FILE
  1105. if test 1773 -ne `wc -c <'Virtual_device/vplib/vpconf.c'`; then
  1106.     echo shar: \"'Virtual_device/vplib/vpconf.c'\" unpacked with wrong size!
  1107. fi
  1108. # end of 'Virtual_device/vplib/vpconf.c'
  1109. fi
  1110. if test -f 'Virtual_device/vplib/vpdoc.h' -a "${1}" != "-c" ; then 
  1111.   echo shar: Will not clobber existing file \"'Virtual_device/vplib/vpdoc.h'\"
  1112. else
  1113. echo shar: Extracting \"'Virtual_device/vplib/vpdoc.h'\" \(1808 characters\)
  1114. sed "s/^X//" >'Virtual_device/vplib/vpdoc.h' <<'END_OF_FILE'
  1115. char *documentation[] = {
  1116. X" ",
  1117. X"NAME",
  1118. X#ifdef SEP
  1119. X"    Vppen - SEPlib vplot filter for the virtual vplot device",
  1120. X#else
  1121. X"    vppen - vplot filter for the virtual vplot device",
  1122. X#endif
  1123. X" ",
  1124. X"Although it is perhaps not obvious, this program can be used to",
  1125. X"\"Capture the screen\". Ie, you play with Pen options until you",
  1126. X"get something you like, and then you can use those options with",
  1127. X"this program to make a new vplot file that without any options",
  1128. X"will draw the same thing.",
  1129. X" ",
  1130. X"OPTIONS",
  1131. X"    Defaults: dumb=n stat=n big=y align=uu vpstyle=y blast=y bit=0",
  1132. X"        gridnum=0,0 gridsize=xsize,ysize grid=-1",
  1133. X"dumb=y causes output to only be vectors, erases, and color changes.",
  1134. X"stat=y causes plot statistics to be printed to stdout instead of vplot.",
  1135. X"big=y expands the size of the device's screen (and hence outermost",
  1136. X"clipping window) to nearly infinity (bad for rotated style!).",
  1137. X"align=xy aligns plot:",
  1138. X"x is one of l, r, c, u for left, right, center, unaligned",
  1139. X"y is one of b, t, c, u for bottom, top, center, unaligned.",
  1140. X"In all cases the given point is aligned to have coordinate zero.",
  1141. X"vpstyle=n omits declaring absolute style in the output file.",
  1142. X"(The generic pen option \"size\" defaults to absolute for input.)",
  1143. X"blast is as in the libvplot raster documentation. ",
  1144. X"if bit > 0, then bit raster is used with bit the color.",
  1145. X"gridnum=numx,numy grids the screen, each part has gridsize=xsize,ysize",
  1146. X"numy defaults to numx. [xy]size default to [xy]screensize / num[xy].",
  1147. X"grid=N turns on drawing a grid, with fatness N.",
  1148. X"",
  1149. X"Some combinations of options are not allowed.",
  1150. X"You may not redirect or pipe the input if either the stat or align option",
  1151. X"is used. ALL GENERIC PEN OPTIONS ARE APPLICABLE.",
  1152. X};
  1153. int    doclength = { sizeof documentation/sizeof documentation[0] };
  1154. END_OF_FILE
  1155. if test 1808 -ne `wc -c <'Virtual_device/vplib/vpdoc.h'`; then
  1156.     echo shar: \"'Virtual_device/vplib/vpdoc.h'\" unpacked with wrong size!
  1157. fi
  1158. # end of 'Virtual_device/vplib/vpdoc.h'
  1159. fi
  1160. if test -f 'Virtual_device/vplib/vpreset.c' -a "${1}" != "-c" ; then 
  1161.   echo shar: Will not clobber existing file \"'Virtual_device/vplib/vpreset.c'\"
  1162. else
  1163. echo shar: Extracting \"'Virtual_device/vplib/vpreset.c'\" \(1673 characters\)
  1164. sed "s/^X//" >'Virtual_device/vplib/vpreset.c' <<'END_OF_FILE'
  1165. X/*
  1166. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1167. X * University. Official permission to use this software is included in
  1168. X * the documentation. It authorizes you to use this file for any
  1169. X * non-commercial purpose, provided that this copyright notice is not
  1170. X * removed and that any modifications made to this file are commented
  1171. X * and dated in the style of my example below.
  1172. X */
  1173. X
  1174. X/*
  1175. X *
  1176. X *  source file:   ./filters/vplib/vpreset.c
  1177. X *
  1178. X * Joe Dellinger (SEP), Dec 19 1987
  1179. X *    Inserted this sample edit history entry.
  1180. X *    Please log any further modifications made to this file:
  1181. X * Joe Dellinger Feb 25 1988
  1182. X *    Do erases FIRST! And only THEN the setstyle.
  1183. X */
  1184. X
  1185. X#include <stdio.h>
  1186. X#include <vplot.h>
  1187. X#include "../include/extern.h"
  1188. X#include "../include/attrcom.h"
  1189. X#include "../include/enum.h"
  1190. X#include "../include/round.h"
  1191. X#include "vp.h"
  1192. X
  1193. extern int      erase;
  1194. X
  1195. vpreset ()
  1196. X{
  1197. X/*
  1198. X * Reset everything we can think of.
  1199. X * Ignore initial erases, and instead look at the command line
  1200. X * value of "erase" to decide whether to have an initial erase
  1201. X * or not.
  1202. X */
  1203. X
  1204. X/*
  1205. X * vpsetflag is used to squeeze out redundant attribute-setting commands.
  1206. X */
  1207. X    vpsetflag = NO;
  1208. X
  1209. X    if (erase & FORCE_INITIAL)
  1210. X    vp_erase ();
  1211. X
  1212. X    if (!vpdumb && vpstyle)
  1213. X    {
  1214. X    vp_style (ABSOLUTE);
  1215. X    }
  1216. X
  1217. X    if (!vpdumb)
  1218. X    {
  1219. X    dev.attributes (SET_WINDOW, dev_xmin, dev_ymin, dev_xmax, dev_ymax);
  1220. X    dev.attributes (SET_COLOR, WHITE, 0, 0, 0);
  1221. X    dev.attributes (NEW_FAT, 0, 0, 0, 0);
  1222. X    dev.attributes (NEW_DASH, 0, 0, 0, 0);
  1223. X    dev.attributes (NEW_FONT, txfont, txprec, txovly, 0);
  1224. X    dev.attributes (NEW_ALIGN, txalign.hor, txalign.ver, 0, 0);
  1225. X    dev.attributes (NEW_OVERLAY, overlay, 0, 0, 0);
  1226. X    }
  1227. X}
  1228. END_OF_FILE
  1229. if test 1673 -ne `wc -c <'Virtual_device/vplib/vpreset.c'`; then
  1230.     echo shar: \"'Virtual_device/vplib/vpreset.c'\" unpacked with wrong size!
  1231. fi
  1232. # end of 'Virtual_device/vplib/vpreset.c'
  1233. fi
  1234. if test -f 'Vplot_Kernel/filters/Tests/Font.c' -a "${1}" != "-c" ; then 
  1235.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/Font.c'\"
  1236. else
  1237. echo shar: Extracting \"'Vplot_Kernel/filters/Tests/Font.c'\" \(1739 characters\)
  1238. sed "s/^X//" >'Vplot_Kernel/filters/Tests/Font.c' <<'END_OF_FILE'
  1239. X/*
  1240. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1241. X * University. Official permission to use this software is included in
  1242. X * the documentation. It authorizes you to use this file for any
  1243. X * non-commercial purpose, provided that this copyright notice is not
  1244. X * removed and that any modifications made to this file are commented
  1245. X * and dated in the style of my example below.
  1246. X */
  1247. X
  1248. X/*
  1249. X *
  1250. X *  source file:   ./filters/Tests/Font.c
  1251. X *
  1252. X * Joe Dellinger (SEP), June 11 1987
  1253. X *    Inserted this sample edit history entry.
  1254. X *    Please log any further modifications made to this file:
  1255. X */
  1256. X
  1257. X#include <stdio.h>
  1258. X#include <vplot.h>
  1259. X#define NUMFONTS 17
  1260. char           *fontnames[] =
  1261. X{
  1262. X "pen",
  1263. X "romans",
  1264. X "romand",
  1265. X "romanc",
  1266. X "romant",
  1267. X "italicc",
  1268. X "italict",
  1269. X "scripts",
  1270. X "scriptc",
  1271. X "greeks",
  1272. X "greekc",
  1273. X "cyrilc",
  1274. X "gothgbt",
  1275. X "gothgrt",
  1276. X "gothitt",
  1277. X "math",
  1278. X "misc",
  1279. X ""
  1280. X};
  1281. X
  1282. main (argc, argv)
  1283. X    int             argc;
  1284. X    char          **argv;
  1285. X{
  1286. int             ii, xx, yy, font;
  1287. X
  1288. X    if (argc == 1)
  1289. X    {
  1290. X    fprintf (stderr, "usage: Font font_number | plas | ?pen\n");
  1291. X    exit (1);
  1292. X    }
  1293. X    font = atoi (argv[1]);
  1294. X
  1295. X    printf ("S a\n");
  1296. X
  1297. X    printf ("m 2400 30\n");
  1298. X    printf ("F 0 1 0\n");
  1299. X    if (font < NUMFONTS)
  1300. X    printf ("T 5 0\n\\f2 Font %d: %s\n", font, fontnames[font]);
  1301. X    else
  1302. X    printf ("T 5 0\n\\f2 Font %d: hardware\n", font);
  1303. X
  1304. X    for (ii = 30; ii < 200; ii++)
  1305. X    {
  1306. X    xx = (ii - 30) % 10;
  1307. X    yy = (ii - 30) / 10;
  1308. X
  1309. X    xx = xx * 550 + 300;
  1310. X    yy = yy * 255 + 300;
  1311. X
  1312. X    printf ("m %d %d\n", xx, yy);
  1313. X    printf ("F 0 1 0\nJ %d %d\n", TH_RIGHT, TV_NORMAL);
  1314. X    printf ("T 3 0\n%d:\\v%d :\n", ii, ii);
  1315. X    printf ("m %d %d\n", xx + 10, yy);
  1316. X    printf ("F %d 1 0\nJ %d %d\n", font, TH_NORMAL, TV_NORMAL);
  1317. X    printf ("T 8 0\n\\v%d \n", ii);
  1318. X    }
  1319. X}
  1320. END_OF_FILE
  1321. if test 1739 -ne `wc -c <'Vplot_Kernel/filters/Tests/Font.c'`; then
  1322.     echo shar: \"'Vplot_Kernel/filters/Tests/Font.c'\" unpacked with wrong size!
  1323. fi
  1324. # end of 'Vplot_Kernel/filters/Tests/Font.c'
  1325. fi
  1326. if test -f 'Vplot_Kernel/filters/Tests/TEST_align' -a "${1}" != "-c" ; then 
  1327.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/TEST_align'\"
  1328. else
  1329. echo shar: Extracting \"'Vplot_Kernel/filters/Tests/TEST_align'\" \(1715 characters\)
  1330. sed "s/^X//" >'Vplot_Kernel/filters/Tests/TEST_align' <<'END_OF_FILE'
  1331. e
  1332. S s
  1333. c 1
  1334. f 3
  1335. z
  1336. Test of text alignment.
  1337. z
  1338. X
  1339. z
  1340. Text should be aligned as it claims to be, despite the size changes.
  1341. z
  1342. All cyan colored text (top 4 on the left) should be boxed.
  1343. z
  1344. No boxes should be opaque, except for the slanted one
  1345. z
  1346. containing the word "Symbol". That box should stop at the
  1347. z
  1348. green degree symbol, which should be centered.
  1349. c 7
  1350. m 1000 2000
  1351. d 3000 2000
  1352. m 1000 2100
  1353. d 1000 1900
  1354. m 1000 2000
  1355. f 0
  1356. c 5
  1357. J 1 2
  1358. F 3 2 1
  1359. T 10 0
  1360. X\c2 L\c-1 eft, Base (fine!)\nNewline!\nAll in a box!
  1361. f 3
  1362. c 7
  1363. m 1000 3000
  1364. d 3000 3000
  1365. m 3000 3100
  1366. d 3000 2900
  1367. m 3000 3000
  1368. f 0
  1369. c 5
  1370. J 3 3
  1371. X# Here we break up a ts that would otherwise make a ligature, like
  1372. X# the KH, ch, and ya.
  1373. T 10 0
  1374. Right, \F11 \c2 (KHochet\-sya!)\c-1 \F-1  \^1\_\h\_2
  1375. f 3
  1376. c 7
  1377. m 1000 4000
  1378. d 3000 4000
  1379. m 2000 4100
  1380. d 2000 3900
  1381. m 2000 4000
  1382. f 0
  1383. c 5
  1384. J 2 4
  1385. T 10 0
  1386. Center, Cap (ffffi)
  1387. f 3
  1388. c 7
  1389. m 1000 5000
  1390. d 3000 5000
  1391. m 2000 5100
  1392. d 2000 4900
  1393. m 2000 5000
  1394. f 0
  1395. c 5
  1396. J 2 1
  1397. T 10 0
  1398. Center, Bottom (fffi)
  1399. F 3 2 0
  1400. f 3
  1401. c 7
  1402. m 1000 1000
  1403. d 3000 1000
  1404. m 2000 1100
  1405. d 2000 0900
  1406. m 2000 1000
  1407. f 0
  1408. c 6
  1409. J 2 5
  1410. T 10 0
  1411. Center, Top! (cauliflower)
  1412. f 3
  1413. c 7
  1414. m 4000 1000
  1415. d 6000 1000
  1416. m 5000 1100
  1417. d 5000 0900
  1418. m 5000 1000
  1419. f 0
  1420. c 6
  1421. J 2 5
  1422. T 10 0
  1423. Center \s200 (Size) \s50 Top!
  1424. f 3
  1425. c 7
  1426. m 4000 2000
  1427. d 6000 2000
  1428. m 5000 2100
  1429. d 5000 1900
  1430. m 5000 2000
  1431. f 0
  1432. c 6
  1433. J 2 5
  1434. T 10 0
  1435. X(Center) \s80 Size \s20 Top!
  1436. f 3
  1437. c 7
  1438. m 4000 3000
  1439. d 6000 3000
  1440. m 5000 3100
  1441. d 5000 2900
  1442. m 5000 3000
  1443. f 0
  1444. c 6
  1445. J 2 5
  1446. T 10 0
  1447. Center \s80 Size \s270 (Top)!
  1448. f 3
  1449. c 7
  1450. m 4000 5000
  1451. d 6000 5000
  1452. m 5000 5100
  1453. d 5000 4900
  1454. m 5000 5000
  1455. f 0
  1456. c 6
  1457. J 2 1
  1458. T 10 0
  1459. X\s20 Center, \s200 (ffi,) \s80 Bottom\m1 \_\F10 f\M1 \^g
  1460. f 3
  1461. c 7
  1462. m 4000 4000
  1463. d 6000 4000
  1464. m 5000 4100
  1465. d 5000 3900
  1466. m 5000 4000
  1467. f 0
  1468. c 6
  1469. J 4 6
  1470. F 3 2 3
  1471. T 11 30
  1472. Symbol, -> \F1 \c4 \v127 \c-1 \m0 \F-1  <- Symbol\M0 
  1473. END_OF_FILE
  1474. if test 1715 -ne `wc -c <'Vplot_Kernel/filters/Tests/TEST_align'`; then
  1475.     echo shar: \"'Vplot_Kernel/filters/Tests/TEST_align'\" unpacked with wrong size!
  1476. fi
  1477. # end of 'Vplot_Kernel/filters/Tests/TEST_align'
  1478. fi
  1479. if test -f 'Vplot_Kernel/filters/genlib/genarea.c' -a "${1}" != "-c" ; then 
  1480.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/genlib/genarea.c'\"
  1481. else
  1482. echo shar: Extracting \"'Vplot_Kernel/filters/genlib/genarea.c'\" \(1772 characters\)
  1483. sed "s/^X//" >'Vplot_Kernel/filters/genlib/genarea.c' <<'END_OF_FILE'
  1484. X/*
  1485. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1486. X * University. Official permission to use this software is included in
  1487. X * the documentation. It authorizes you to use this file for any
  1488. X * non-commercial purpose, provided that this copyright notice is not
  1489. X * removed and that any modifications made to this file are commented
  1490. X * and dated in the style of my example below.
  1491. X */
  1492. X
  1493. X/*
  1494. X *
  1495. X *  source file:   ./filters/genlib/genarea.c
  1496. X *
  1497. X * Joe Dellinger (SEP), June 11 1987
  1498. X *    Inserted this sample edit history entry.
  1499. X *    Please log any further modifications made to this file:
  1500. X */
  1501. X
  1502. X#include <stdio.h>
  1503. X#include "../include/vertex.h"
  1504. X#include "../include/params.h"
  1505. X#include "../include/extern.h"
  1506. X
  1507. extern int      smart_clip;
  1508. X
  1509. extern int      Allgone;
  1510. X
  1511. X/*
  1512. X * Device Independent Polygon treatment.
  1513. X * Do a first-pass sort of clipping using
  1514. X * polysubs, and then finish the job by calling polyfix and
  1515. X * polystart.
  1516. X *
  1517. X * Not the prettiest of code, but hey, it works.
  1518. X * Someone out there should volunteer to clean this up a bit.
  1519. X */
  1520. X
  1521. genarea (npts, head)
  1522. X    int             npts;
  1523. X    struct vertex  *head;
  1524. X{
  1525. struct vertex  *v;
  1526. int             firstpoint, i;
  1527. X
  1528. X    Allgone = 1;        /* Assume none left unless polyfix tells us */
  1529. X    if (!smart_clip)
  1530. X    {
  1531. X    firstpoint = 2;
  1532. X    xminclip (0, 0, &firstpoint);    /* Tell them all to get ready */
  1533. X    }
  1534. X
  1535. X    firstpoint = 1;
  1536. X
  1537. X    v = head;
  1538. X    for (i = 0; i < npts; i++)
  1539. X    {
  1540. X    if (!smart_clip)
  1541. X    {
  1542. X        xminclip (v->x, v->y, &firstpoint);
  1543. X    }
  1544. X    else
  1545. X    {
  1546. X        polyfix (v->x, v->y, &firstpoint);
  1547. X    }
  1548. X    v++;
  1549. X    }
  1550. X    if (!smart_clip)
  1551. X    {
  1552. X    firstpoint = -1;    /* Means this was the last point! */
  1553. X    xminclip (0, 0, &firstpoint);
  1554. X    }
  1555. X    if (Allgone == 0)        /* If still 1, means there's nothing left! */
  1556. X    {
  1557. X    polystart ();
  1558. X    }
  1559. X}
  1560. END_OF_FILE
  1561. if test 1772 -ne `wc -c <'Vplot_Kernel/filters/genlib/genarea.c'`; then
  1562.     echo shar: \"'Vplot_Kernel/filters/genlib/genarea.c'\" unpacked with wrong size!
  1563. fi
  1564. # end of 'Vplot_Kernel/filters/genlib/genarea.c'
  1565. fi
  1566. if test -f 'Vplot_Kernel/filters/include/closestat.h' -a "${1}" != "-c" ; then 
  1567.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/closestat.h'\"
  1568. else
  1569. echo shar: Extracting \"'Vplot_Kernel/filters/include/closestat.h'\" \(1573 characters\)
  1570. sed "s/^X//" >'Vplot_Kernel/filters/include/closestat.h' <<'END_OF_FILE'
  1571. X/*
  1572. X * status passed to device's finish routine:
  1573. X *
  1574. X * status of CLOSE_NORMAL means normal finish,
  1575. X *
  1576. X * status of CLOSE_ERROR means fatal error condition is causing the exit,
  1577. X *
  1578. X * status of CLOSE_INTERRUPT means we just got "INTERRUPTed" (the user
  1579. X *     hit control C, for example), and
  1580. X *
  1581. X * status of CLOSE_NOTHING means that they provided no input
  1582. X *    (dev.reset was never called, just dev.open).
  1583. X *
  1584. X * Following each of these will be a call with a status of CLOSE_DONE.
  1585. X * The device is guaranteed never to be called again after this call.
  1586. X * But that doesn't mean YOU should exit! You should return and let
  1587. X * dovplot and frontend do the exiting!!!
  1588. X *
  1589. X * Status of CLOSE_PAUSE gives us a chance to beep or do whatever should be
  1590. X * done during the pause generated by setting endpause=YES (remember that
  1591. X * the user can do this too). The sequence of calls to dev.close when closing
  1592. X * normally and with endpause=YES is PAUSE, NORMAL, DONE.
  1593. X * Many devices will simply ignore the case CLOSE_PAUSE. It is NOT the
  1594. X * responsibility of dev.close to wait for the user to do something before
  1595. X * returning! That responsibility is in dev.interact's domain.
  1596. X *
  1597. X * CLOSE_FLUSH means that the output stream to the plot device should be
  1598. X * flushed for one reason or another. Most devices should support this,
  1599. X * ESPECIALLY devices where it is possible for the user to look at the
  1600. X * output as it is produced!
  1601. X */
  1602. X
  1603. X#define CLOSE_DONE    -1
  1604. X#define CLOSE_NOTHING     0
  1605. X#define CLOSE_ERROR      1
  1606. X#define CLOSE_INTERRUPT     2
  1607. X#define CLOSE_NORMAL      3
  1608. X#define CLOSE_PAUSE      4
  1609. X#define CLOSE_FLUSH     5
  1610. END_OF_FILE
  1611. if test 1573 -ne `wc -c <'Vplot_Kernel/filters/include/closestat.h'`; then
  1612.     echo shar: \"'Vplot_Kernel/filters/include/closestat.h'\" unpacked with wrong size!
  1613. fi
  1614. # end of 'Vplot_Kernel/filters/include/closestat.h'
  1615. fi
  1616. if test -f 'Vplot_Kernel/filters/include/intcom.h' -a "${1}" != "-c" ; then 
  1617.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/intcom.h'\"
  1618. else
  1619. echo shar: Extracting \"'Vplot_Kernel/filters/include/intcom.h'\" \(1549 characters\)
  1620. sed "s/^X//" >'Vplot_Kernel/filters/include/intcom.h' <<'END_OF_FILE'
  1621. X/*
  1622. X * commands to the device's "interact" routine
  1623. X */
  1624. X
  1625. X#define    INT_USER_PAUSE        0
  1626. X#define    INT_GET_STRING        1
  1627. X#define    INT_PAUSE        2
  1628. X#define    INT_F_PAUSE        3
  1629. X
  1630. X/*
  1631. X * Termout is conncted to read input from "/dev/tty".
  1632. X * You don't have to use it if that isn't appropriate.
  1633. X *
  1634. X * dev.interact(INT_GET_STRING, termout, instring)
  1635. X * FILE *termout;
  1636. X * char *instring;
  1637. X *
  1638. X * Wait for the user to enter a newline-terminated string.
  1639. X * Put the user's string into instring and return. (This option
  1640. X * is currently not used, but is provided to allow interactive
  1641. X * extensions in the future without changing the device-dependent code
  1642. X * interface.)
  1643. X *
  1644. X *
  1645. X * dev.interact(INT_PAUSE, termout, instring)
  1646. X * FILE *termout;
  1647. X * char *instring;
  1648. X *
  1649. X * Wait for the user to indicate his desire for plotting to continue,
  1650. X * in whatever fashion is appropriate for that device, then return.
  1651. X * For most devices, this will be by hitting "return" on the keyboard,
  1652. X * and so this case can simply be handled the same way as the previous one.
  1653. X * Any text stuffed into "instring" will be ignored, however.
  1654. X *
  1655. X * dev.interact(INT_F_PAUSE, termout, instring)
  1656. X * FILE *termout;
  1657. X * char *instring;
  1658. X *
  1659. X * Just like the INT_PAUSE case, except that this is a pause generated
  1660. X * by "endpause=y", occuring after all plotting is over with.
  1661. X *
  1662. X * dev.interact(INT_USER_PAUSE, termout, instring)
  1663. X * FILE *termout;
  1664. X * char *instring;
  1665. X *
  1666. X * Never used from dovplot. Provided so that in case the device wants to
  1667. X * make its own special case for internal use only, a number is already
  1668. X * reserved.
  1669. X */
  1670. END_OF_FILE
  1671. if test 1549 -ne `wc -c <'Vplot_Kernel/filters/include/intcom.h'`; then
  1672.     echo shar: \"'Vplot_Kernel/filters/include/intcom.h'\" unpacked with wrong size!
  1673. fi
  1674. # end of 'Vplot_Kernel/filters/include/intcom.h'
  1675. fi
  1676. if test -f 'Vplot_Kernel/filters/include/vplotfonts/README' -a "${1}" != "-c" ; then 
  1677.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/vplotfonts/README'\"
  1678. else
  1679. echo shar: Extracting \"'Vplot_Kernel/filters/include/vplotfonts/README'\" \(1552 characters\)
  1680. sed "s/^X//" >'Vplot_Kernel/filters/include/vplotfonts/README' <<'END_OF_FILE'
  1681. This directory contains all the Vplot fonts.
  1682. The fonts are in three forms:
  1683. X
  1684. X.vplot_fonts : This is the human-editable form generated by the program
  1685. X        hertovplot.c. Its format is documented in the beginning
  1686. X        of the program makefont.c
  1687. X
  1688. X.bin :        A binary form of the font, which can be loaded at
  1689. X        execute time on demand by gentext.c. (They aren't
  1690. X        loaded unless the user accesses the font.)
  1691. X
  1692. X.include:    An ``include'' file form of the font, which can be
  1693. X        #include'd into gentext.c at compile time. This way
  1694. X        gentext.c won't have to read the font off disk at
  1695. X        runtime if the user uses it.
  1696. X
  1697. Which fonts are included and which are loaded at compile time is set
  1698. in the include file font_definitions.h in the .../vplot/include
  1699. directory. It should be obvious from the file how to modify it.
  1700. If you have more or fewer fonts than we do here, you will also have to edit
  1701. the makefile in this directory so that it knows what fonts you have.
  1702. X
  1703. Generally, very commonly used fonts should be included, and all the
  1704. others should be loaded at runtime as needed. At SEP we have only
  1705. fonts 0, 1, and 3 (pen, roman simplex, and roman complex) compiled in.
  1706. Since the fonts are quite large, compiling in each font takes a
  1707. large amount of compile time. (To say nothing of making lint virtually
  1708. unuseable.)
  1709. X
  1710. Please read "vplottext.mn" and the Makefile in this directory to
  1711. find out how to obtain the necessary .vplot_font files. "pen.vplot_font"
  1712. is NOT a Hershey font and is an official part of Vplot. It is not beautiful,
  1713. but it is complete and efficient.
  1714. X
  1715. X- Joe Dellinger
  1716. END_OF_FILE
  1717. if test 1552 -ne `wc -c <'Vplot_Kernel/filters/include/vplotfonts/README'`; then
  1718.     echo shar: \"'Vplot_Kernel/filters/include/vplotfonts/README'\" unpacked with wrong size!
  1719. fi
  1720. # end of 'Vplot_Kernel/filters/include/vplotfonts/README'
  1721. fi
  1722. if test -f 'Vplot_Kernel/filters/loclib/err.c' -a "${1}" != "-c" ; then 
  1723.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/loclib/err.c'\"
  1724. else
  1725. echo shar: Extracting \"'Vplot_Kernel/filters/loclib/err.c'\" \(1776 characters\)
  1726. sed "s/^X//" >'Vplot_Kernel/filters/loclib/err.c' <<'END_OF_FILE'
  1727. X/*
  1728. X *
  1729. X *  source file:   ./filters/loclib/err.c
  1730. X *
  1731. X * Joe Dellinger (SEP), June 11 1987
  1732. X *    Inserted this sample edit history entry.
  1733. X *    Please log any further modifications made to this file:
  1734. X * Joe Dellinger Feb 16 1988
  1735. X *    Use VARARGS and vsprintf if they are available.
  1736. X */
  1737. X
  1738. X/*
  1739. X *    error abortion subroutine
  1740. X *
  1741. X *    a is a printf format string, while b-h are optional arguments
  1742. X *    When the subroutine is called, the program will stop after
  1743. X *    printing its message.
  1744. X *    Example:    err("Cannot divide %f by %f\n", x, y);
  1745. X *
  1746. X *      perror() is wiped out by including a dummy version of it here.
  1747. X *    this is because perror has the audacity to print directly to
  1748. X *    stderr, which we can't allow. this special version of err replaces
  1749. X *    the normal seplib version and forces seplib to go through ERR,
  1750. X *    the vplot filter subroutine for error messages that takes special
  1751. X *    care not to try to print messages in the middle of plotting.
  1752. X */
  1753. X#include <stdio.h>
  1754. X#include "../include/err.h"
  1755. X#include "../include/extern.h"
  1756. X
  1757. X#if defined (SUN) || defined (ultrix)
  1758. X#include <varargs.h>
  1759. X/*VARARGS1*/
  1760. err (va_alist)
  1761. va_dcl
  1762. X{
  1763. va_list         apdum;
  1764. extern char   **xargv;
  1765. char           *format;
  1766. char            string[120];
  1767. X
  1768. X    va_start (apdum);
  1769. X    format = va_arg (apdum, char *);
  1770. X    vsprintf (string, format, apdum);
  1771. X    va_end (apdum);
  1772. X
  1773. X    ERR (FATAL, name, "sep: %s", string);
  1774. X/*
  1775. X * Force the linker to link in my version of perror
  1776. X */
  1777. X    perror ();
  1778. X}
  1779. X#else
  1780. X/*VARARGS1*/
  1781. err (a, b, c, d, e, f, g, h)
  1782. X    char           *a, *b, *c, *d, *e, *f, *g, *h;
  1783. X{
  1784. extern char   **xargv;
  1785. char            string[120];
  1786. X
  1787. X    sprintf (string, a, b, c, d, e, f, g, h);
  1788. X    ERR (FATAL, name, "sep: %s", string);
  1789. X/*
  1790. X * Force the linker to link in my version of perror
  1791. X */
  1792. X    perror ();
  1793. X}
  1794. X#endif
  1795. X
  1796. perror ()
  1797. X{
  1798. X}
  1799. END_OF_FILE
  1800. if test 1776 -ne `wc -c <'Vplot_Kernel/filters/loclib/err.c'`; then
  1801.     echo shar: \"'Vplot_Kernel/filters/loclib/err.c'\" unpacked with wrong size!
  1802. fi
  1803. # end of 'Vplot_Kernel/filters/loclib/err.c'
  1804. fi
  1805. if test -f 'Vplot_Kernel/filters/utilities/greycorr.c' -a "${1}" != "-c" ; then 
  1806.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/utilities/greycorr.c'\"
  1807. else
  1808. echo shar: Extracting \"'Vplot_Kernel/filters/utilities/greycorr.c'\" \(1532 characters\)
  1809. sed "s/^X//" >'Vplot_Kernel/filters/utilities/greycorr.c' <<'END_OF_FILE'
  1810. X/*
  1811. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1812. X * University. Official permission to use this software is included in
  1813. X * the documentation. It authorizes you to use this file for any
  1814. X * non-commercial purpose, provided that this copyright notice is not
  1815. X * removed and that any modifications made to this file are commented
  1816. X * and dated in the style of my example below.
  1817. X */
  1818. X
  1819. X/*
  1820. X *
  1821. X *  source file:   ./filters/utilities/greycorr.c
  1822. X *
  1823. X * Joe Dellinger (SEP), June 11 1987
  1824. X *    Inserted this sample edit history entry.
  1825. X *    Please log any further modifications made to this file:
  1826. X */
  1827. X
  1828. X/*
  1829. X * Utility to modify color tables for plotting grey rasters.
  1830. X */
  1831. X
  1832. X#include <stdio.h>
  1833. X#include "../include/extern.h"
  1834. X#include "../include/round.h"
  1835. X
  1836. int
  1837. greycorr (colornum)
  1838. X    int             colornum;
  1839. X{
  1840. float           newval;
  1841. extern float    greyc, pixc;
  1842. X
  1843. X    newval = colornum;
  1844. X/* 
  1845. X * correction to simulate nonlinearity of graphics displays
  1846. X */
  1847. X    if (greyc != 1.)
  1848. X    {
  1849. X    newval /= 255.;
  1850. X    newval = (-2. + 2. * greyc) * newval * newval * newval + 3. * (1. - greyc) * newval * newval + greyc * newval;
  1851. X    newval *= 255.;
  1852. X    if (newval < 0)
  1853. X        newval = 0.;
  1854. X    if (newval > 255.)
  1855. X        newval = 255.;
  1856. X    }
  1857. X
  1858. X/*
  1859. X * correction for pixel overlap on hardcopy devices
  1860. X */
  1861. X    if (pixc != 1.)
  1862. X    {
  1863. X    if (newval < pixc * 128.)
  1864. X    {
  1865. X        newval /= pixc;
  1866. X    }
  1867. X    else
  1868. X    {
  1869. X        newval = 128. + (newval - pixc * 128.) / (2. - pixc);
  1870. X    }
  1871. X    if (newval < 0)
  1872. X        newval = 0.;
  1873. X    if (newval > 255.)
  1874. X        newval = 255.;
  1875. X    }
  1876. X
  1877. X    return ROUND (newval);
  1878. X}
  1879. END_OF_FILE
  1880. if test 1532 -ne `wc -c <'Vplot_Kernel/filters/utilities/greycorr.c'`; then
  1881.     echo shar: \"'Vplot_Kernel/filters/utilities/greycorr.c'\" unpacked with wrong size!
  1882. fi
  1883. # end of 'Vplot_Kernel/filters/utilities/greycorr.c'
  1884. fi
  1885. if test -f 'Vplot_Kernel/lvplot/vp_file.c' -a "${1}" != "-c" ; then 
  1886.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_file.c'\"
  1887. else
  1888. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_file.c'\" \(1668 characters\)
  1889. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_file.c' <<'END_OF_FILE'
  1890. X/*
  1891. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1892. X * University. Official permission to use this software is included in
  1893. X * the documentation. It authorizes you to use this file for any
  1894. X * non-commercial purpose, provided that this copyright notice is not
  1895. X * removed and that any modifications made to this file are commented
  1896. X * and dated in the style of my example below.
  1897. X */
  1898. X
  1899. X/*
  1900. X *  source file:   ./lvplot/vp_file.c
  1901. X *
  1902. X * Joe Dellinger (SEP), June 11 1987
  1903. X *    Inserted this sample edit history entry.
  1904. X *    Please log any further modifications made to this file:
  1905. X *
  1906. X * Steve Cole (SEP), October 27 1987
  1907. X *    Null character is added to filename when called from fortran
  1908. X *      to prevent allocation errors.
  1909. X */
  1910. X
  1911. X#include <stdio.h>
  1912. X#include <vplot.h>
  1913. X#include "vp_pc.h"
  1914. X
  1915. X#ifdef FORTRAN
  1916. X
  1917. X#define VPFILE vpwfile_
  1918. X
  1919. X#else
  1920. X
  1921. X#define VPFILE vp_file
  1922. X
  1923. X#endif
  1924. X
  1925. X#ifdef FORTRAN
  1926. VPFILE (filename, nchars)
  1927. X    int            *nchars;
  1928. X#else
  1929. VPFILE (filename)
  1930. X#endif
  1931. X    char           *filename;
  1932. X{
  1933. FILE           *temp, *fopen ();
  1934. X
  1935. X#ifdef FORTRAN
  1936. char           *tempfilename;
  1937. char           *malloc ();
  1938. int             ncharsp1, i;
  1939. X    ncharsp1 = *(nchars) + 1;
  1940. X    tempfilename = (char *) malloc (ncharsp1);
  1941. X    tempfilename[ncharsp1 - 1] = '\0';
  1942. X    for (i = 0; i < *(nchars); i++)
  1943. X    {
  1944. X    tempfilename[i] = filename[i];
  1945. X    }
  1946. X    temp = fopen (tempfilename, "w");
  1947. X#else FORTRAN
  1948. X    temp = fopen (filename, "w");
  1949. X#endif
  1950. X    if (temp == NULL)
  1951. X    {
  1952. X#ifdef FORTRAN
  1953. X    fprintf (stderr, "libvplot.vpfile: cannot create %s\n", tempfilename);
  1954. X#else
  1955. X    fprintf (stderr, "libvplot.vpfile: cannot create %s\n", filename);
  1956. X#endif
  1957. X    exit (-1);
  1958. X    }
  1959. X    vp_pc._pltout = temp;
  1960. X}
  1961. END_OF_FILE
  1962. if test 1668 -ne `wc -c <'Vplot_Kernel/lvplot/vp_file.c'`; then
  1963.     echo shar: \"'Vplot_Kernel/lvplot/vp_file.c'\" unpacked with wrong size!
  1964. fi
  1965. # end of 'Vplot_Kernel/lvplot/vp_file.c'
  1966. fi
  1967. if test -f 'Vplot_Kernel/lvplot/vp_fill.c' -a "${1}" != "-c" ; then 
  1968.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_fill.c'\"
  1969. else
  1970. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_fill.c'\" \(1662 characters\)
  1971. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_fill.c' <<'END_OF_FILE'
  1972. X/*
  1973. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1974. X * University. Official permission to use this software is included in
  1975. X * the documentation. It authorizes you to use this file for any
  1976. X * non-commercial purpose, provided that this copyright notice is not
  1977. X * removed and that any modifications made to this file are commented
  1978. X * and dated in the style of my example below.
  1979. X */
  1980. X
  1981. X/*
  1982. X *
  1983. X *  source file:   ./lvplot/vp_fill.c
  1984. X *
  1985. X * Joe Dellinger (SEP), June 11 1987
  1986. X *    Inserted this sample edit history entry.
  1987. X *    Please log any further modifications made to this file:
  1988. X * Joe Dellinger Jan 14 1988
  1989. X *    Do rounding.
  1990. X */
  1991. X
  1992. X#include <stdio.h>
  1993. X#include <vplot.h>
  1994. X#include "round.h"
  1995. X#include "vp_pc.h"
  1996. X
  1997. X#ifdef FORTRAN
  1998. X
  1999. X#ifndef UUU
  2000. X#define AREA    vpfill_
  2001. X#else UUU
  2002. X#define UAREA    vpufill_
  2003. X#endif UUU
  2004. X#define LP        *lp
  2005. X#define XP xp2
  2006. X#define YP yp2
  2007. X
  2008. X#else
  2009. X
  2010. X#ifndef UUU
  2011. X#define AREA    vp_fill
  2012. X#else UUU
  2013. X#define UAREA    vp_ufill
  2014. X#endif UUU
  2015. X#define LP        lp
  2016. X#define XP xp
  2017. X#define YP yp
  2018. X
  2019. X#endif
  2020. X
  2021. X#ifndef UUU
  2022. AREA (xp, yp, lp)
  2023. X#else UUU
  2024. UAREA (xp, yp, lp)
  2025. X#endif UUU
  2026. X    float          *xp, *yp;
  2027. X    int             LP;
  2028. X{
  2029. int             i;
  2030. int             ix, iy;
  2031. X
  2032. X#ifdef FORTRAN
  2033. register float *xp2, *yp2;
  2034. X    xp2 = xp;
  2035. X    yp2 = yp;
  2036. X#endif FORTRAN
  2037. X
  2038. X    putc (VP_AREA, vp_pc._pltout);
  2039. X    puth (LP, vp_pc._pltout);
  2040. X
  2041. X    for (i = 0; i < LP; i++)
  2042. X    {
  2043. X#ifndef UUU
  2044. X    ix = ROUND ((*XP) * RPERIN);
  2045. X    iy = ROUND ((*YP) * RPERIN);
  2046. X#else UUU
  2047. X    ix = ROUND ((vp_pc._x0 + ((*XP) - vp_pc._xu0) * vp_pc._xscl) * RPERIN);
  2048. X    iy = ROUND ((vp_pc._y0 + ((*YP) - vp_pc._yu0) * vp_pc._yscl) * RPERIN);
  2049. X#endif UUU
  2050. X    XP++;
  2051. X    YP++;
  2052. X    puth (ix, vp_pc._pltout);
  2053. X    puth (iy, vp_pc._pltout);
  2054. X    }
  2055. X}
  2056. END_OF_FILE
  2057. if test 1662 -ne `wc -c <'Vplot_Kernel/lvplot/vp_fill.c'`; then
  2058.     echo shar: \"'Vplot_Kernel/lvplot/vp_fill.c'\" unpacked with wrong size!
  2059. fi
  2060. # end of 'Vplot_Kernel/lvplot/vp_fill.c'
  2061. fi
  2062. if test -f 'Vplot_Kernel/lvplot/vp_pline.c' -a "${1}" != "-c" ; then 
  2063.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_pline.c'\"
  2064. else
  2065. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_pline.c'\" \(1673 characters\)
  2066. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_pline.c' <<'END_OF_FILE'
  2067. X/*
  2068. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  2069. X * University. Official permission to use this software is included in
  2070. X * the documentation. It authorizes you to use this file for any
  2071. X * non-commercial purpose, provided that this copyright notice is not
  2072. X * removed and that any modifications made to this file are commented
  2073. X * and dated in the style of my example below.
  2074. X */
  2075. X
  2076. X/*
  2077. X *
  2078. X *  source file:   ./lvplot/vp_pline.c
  2079. X *
  2080. X * Joe Dellinger (SEP), June 11 1987
  2081. X *    Inserted this sample edit history entry.
  2082. X *    Please log any further modifications made to this file:
  2083. X * Joe Dellinger Jan 14 1988
  2084. X *    Do rounding.
  2085. X */
  2086. X
  2087. X#include <stdio.h>
  2088. X#include <vplot.h>
  2089. X#include "round.h"
  2090. X#include "vp_pc.h"
  2091. X
  2092. X#ifdef FORTRAN
  2093. X
  2094. X#ifndef UUU
  2095. X#define PLINE    vppline_
  2096. X#else UUU
  2097. X#define UPLINE    vpupline_
  2098. X#endif UUU
  2099. X#define LP        *lp
  2100. X#define XP xp2
  2101. X#define YP yp2
  2102. X
  2103. X#else
  2104. X
  2105. X#ifndef UUU
  2106. X#define PLINE    vp_pline
  2107. X#else UUU
  2108. X#define UPLINE    vp_upline
  2109. X#endif UUU
  2110. X#define LP        lp
  2111. X#define XP xp
  2112. X#define YP yp
  2113. X
  2114. X#endif
  2115. X
  2116. X#ifndef UUU
  2117. PLINE (xp, yp, lp)
  2118. X#else UUU
  2119. UPLINE (xp, yp, lp)
  2120. X#endif UUU
  2121. X    float          *xp, *yp;
  2122. X    int             LP;
  2123. X{
  2124. int             i;
  2125. int             ix, iy;
  2126. X
  2127. X#ifdef FORTRAN
  2128. register float *xp2, *yp2;
  2129. X    xp2 = xp;
  2130. X    yp2 = yp;
  2131. X#endif FORTRAN
  2132. X
  2133. X    putc (VP_PLINE, vp_pc._pltout);
  2134. X    puth (LP, vp_pc._pltout);
  2135. X    for (i = 0; i < LP; i++)
  2136. X    {
  2137. X#ifndef UUU
  2138. X    ix = ROUND ((*XP) * RPERIN);
  2139. X    iy = ROUND ((*YP) * RPERIN);
  2140. X#else UUU
  2141. X    ix = ROUND ((vp_pc._x0 + ((*XP) - vp_pc._xu0) * vp_pc._xscl) * RPERIN);
  2142. X    iy = ROUND ((vp_pc._y0 + ((*YP) - vp_pc._yu0) * vp_pc._yscl) * RPERIN);
  2143. X#endif UUU
  2144. X    XP++;
  2145. X    YP++;
  2146. X    puth (ix, vp_pc._pltout);
  2147. X    puth (iy, vp_pc._pltout);
  2148. X    }
  2149. X}
  2150. END_OF_FILE
  2151. if test 1673 -ne `wc -c <'Vplot_Kernel/lvplot/vp_pline.c'`; then
  2152.     echo shar: \"'Vplot_Kernel/lvplot/vp_pline.c'\" unpacked with wrong size!
  2153. fi
  2154. # end of 'Vplot_Kernel/lvplot/vp_pline.c'
  2155. fi
  2156. echo shar: End of archive 7 \(of 24\).
  2157. cp /dev/null ark7isdone
  2158. MISSING=""
  2159. 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
  2160.     if test ! -f ark${I}isdone ; then
  2161.     MISSING="${MISSING} ${I}"
  2162.     fi
  2163. done
  2164. if test "${MISSING}" = "" ; then
  2165.     echo You have unpacked all 24 archives.
  2166.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2167. else
  2168.     echo You still need to unpack the following archives:
  2169.     echo "        " ${MISSING}
  2170. fi
  2171. ##  End of shell archive.
  2172. exit 0
  2173.