do_psfiles.c 550 B

1234567891011121314151617181920212223242526272829303132
  1. /* Function: do_psfiles
  2. **
  3. ** Author: Paul W. Carlson May 1992
  4. */
  5. #include <grass/gis.h>
  6. #include <grass/glocale.h>
  7. #include "ps_info.h"
  8. int do_psfiles(void)
  9. {
  10. int i;
  11. char buf[256];
  12. FILE *fp;
  13. for (i = 0; i < PS.num_psfiles; i++) {
  14. if ((fp = fopen(PS.psfiles[i], "r")) == NULL)
  15. continue;
  16. G_message(_("Reading PostScript include file <%s> ..."),
  17. PS.psfiles[i]);
  18. fprintf(PS.fp, "\n");
  19. while (fgets(buf, 256, fp) != NULL)
  20. fprintf(PS.fp, "%s", buf);
  21. fprintf(PS.fp, "\n");
  22. fclose(fp);
  23. }
  24. return 0;
  25. }