home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / graphics-0.17 / plot2ps / close.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-11  |  1.5 KB  |  48 lines

  1. /* plot2ps, a utility for converting Unix plot files into postscript.
  2.    Copyright (C) 1989 Free Software Foundation, Inc.
  3.  
  4. Plot2ps is distributed in the hope that it will be useful, but WITHOUT ANY
  5. WARRANTY.  No author or distributor accepts responsibility to anyone for the
  6. consequences of using it or for whether it serves any particular purpose or
  7. works at all, unless he says so in writing.  Refer to the GNU General Public
  8. License for full details.
  9.  
  10. Everyone is granted permission to copy, modify and redistribute plot2ps, but
  11. only under the conditions described in the GNU General Public License.  A copy
  12. of this license is supposed to have been given to you along with plot2ps so
  13. you can know your rights and responsibilities.  It should be in a file named
  14. COPYING.  Among other things, the copyright notice and this notice must be
  15. preserved on all copies.  */
  16.  
  17. /* This file is the close routine, which is a standard part of the plot
  18.    library.  Normally it closes the plotting device.  We just print out the
  19.    postscript trailer. */
  20.  
  21. #include "sys-defines.h"
  22. #include "libplot.h"
  23.  
  24. int
  25. closepl ()
  26. {
  27.   double xmin, xmax, ymin, ymax;
  28.  
  29.   draw_line ();
  30.   fputs ("\
  31. End %I eop\n\
  32. \n\
  33. %%Trailer\n\
  34. ", stdout);
  35.   get_range (&xmin, &xmax, &ymin, &ymax);
  36.   /* SCALING is the scale for the whole page. It is set int the CTM written
  37.      after the prologe in open.c */
  38.   printf ("%%%%BoundingBox: %d %d %d %d\n",
  39.       (int) (SCALING*xmin), (int) (SCALING*ymin),
  40.       (int) (SCALING*xmax), (int) (SCALING*ymax));
  41.   fputs ("\
  42. \n\
  43. end\n\
  44. showpage\n\
  45. ", stdout);
  46.   return 0;
  47. }
  48.