home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d165 / plotview.lha / PlotView / Plot / plot.c < prev    next >
C/C++ Source or Header  |  1988-11-22  |  948b  |  105 lines

  1. /*
  2.  *  plot.c : PD implementation of the UNIX plot package.
  3.  *
  4.  * by Joel Swank 4-20-88
  5.  */
  6.  
  7. #include <stdio.h>
  8.  
  9. openpl()
  10. {
  11. /* nothing for it to do */
  12. }
  13.  
  14. erase()
  15. {
  16.     putchar('e');
  17. }
  18.  
  19. label(s)
  20. char *s;
  21. {
  22.     putchar('t');
  23.     puts(s);
  24. }
  25.  
  26. line(x1,y1,x2,y2)
  27. int x1,y1,x2,y2;
  28. {
  29.     putchar('l');
  30.     put_xy(x1,y1);
  31.     put_xy(x2,y2);
  32. }
  33.  
  34. circle(x,y,r)
  35. int x,y,r;
  36. {
  37.     putchar('c');
  38.     put_xy(x,y);
  39.     put_int(r);
  40. }
  41.  
  42. arc(x,y,x0,y0,x1,y1)
  43. int x,y,x0,y0,x1,y1;
  44. {
  45.     putchar('a');
  46.     put_xy(x,y);
  47.     put_xy(x0,y0);
  48.     put_xy(x1,y1);
  49. }
  50.  
  51. move(x,y)
  52. int x,y;
  53. {
  54.     putchar('m');
  55.     put_xy(x,y);
  56. }
  57.  
  58. cont(x,y)
  59. int x,y;
  60. {
  61.     putchar('n');
  62.     put_xy(x,y);
  63. }
  64.  
  65. point(x,y)
  66. int x,y;
  67. {
  68.     putchar('p');
  69.     put_xy(x,y);
  70. }
  71.  
  72. linemod(s)
  73. char *s;
  74. {
  75.     putchar('f');
  76.     puts(s);
  77. }
  78.  
  79. space(x1,y1,x2,y2)
  80. int x1,y1,x2,y2;
  81. {
  82.     putchar('s');
  83.     put_xy(x1,y1);
  84.     put_xy(x2,y2);
  85. }
  86.  
  87. closepl()
  88. {
  89.     fclose(stdout);
  90. }
  91.  
  92. put_xy(x,y)
  93. int x,y;
  94. {
  95.     put_int(x);
  96.     put_int(y);
  97. }
  98.  
  99. put_int(i)
  100. int i;
  101. {
  102.     putchar(i & 0xff);
  103.     putchar((i >> 8) & 0xff);
  104. }
  105.