home *** CD-ROM | disk | FTP | other *** search
- /*
- * low-level i/o routines for the ccps plotting package
- *
- * Rex Sanders, USGS, 2/87
- *
- */
-
- #include <stdio.h>
-
- static FILE *fp;
-
- void
- plbegn_()
- {
-
- char *fname = "ps_plot";
- long t;
-
- if ((fp = fopen(fname, "w")) == NULL)
- {
- fprintf(stderr, "plbegn: can't open %s\n", fname);
- exit(1);
- }
-
- fputs ("%!\n", fp);
- fputs ("% Postscript output from ccps library\n", fp);
- t = time(0);
- fprintf (fp, "%% Created: %s", ctime(&t));
-
- }
-
- void
- pldone_()
- {
- fputs ("% end of ccps output\n", fp);
- fclose(fp);
- }
-
- void
- plcout_(c)
- char *c;
- {
- /*
- * send one char to plot file
- */
- putc(*c, fp);
- }
-
- void
- pliout_(i)
- int *i;
- {
- /*
- * send one integer value to plot file
- */
- fprintf(fp, "%d", *i);
- }
-
- void
- plfout_(f)
- float *f;
- {
- /*
- * send one float value to plot file
- */
- fprintf(fp, "%.3f", *f);
- }
- void
- plsout_(s, l)
- char *s;
- long int l;
- {
- /*
- * send a string to plot file
- */
- char *string;
- for(string = s; l > 0; l--, string++) putc(*string, fp);
- }
-