! . */
| 10573 | |
| 10574 | /*! . */ |
| 10575 | int gmt_set_psfilename (struct GMT_CTRL *GMT) { |
| 10576 | int k; |
| 10577 | /* Returns 0 or 1 if successful and -1 if failure */ |
| 10578 | GMT->current.ps.figure = gmt_get_current_figure (GMT->parent); |
| 10579 | |
| 10580 | if (GMT->parent->gwf_dir == NULL) { /* Use the established temp directory */ |
| 10581 | GMT_Report (GMT->parent, GMT_MSG_ERROR, "GMT WorkFlow directory not set!\n"); |
| 10582 | return GMT_NOTSET; |
| 10583 | } |
| 10584 | else |
| 10585 | snprintf (GMT->current.ps.filename, GMT_LEN256, "%s/gmt_%d.ps-", GMT->parent->gwf_dir, GMT->current.ps.figure); |
| 10586 | GMT_Report (GMT->parent, GMT_MSG_DEBUG, "Use PS filename %s\n", GMT->current.ps.filename); |
| 10587 | k = 1 + access (GMT->current.ps.filename, W_OK); /* 1 = File exists (must append) or 0 (must create) */ |
| 10588 | GMT->current.ps.initialize = (k == 0); /* False means it is an overlay and -R -J may come from history */ |
| 10589 | return k; |
| 10590 | } |
| 10591 | |
| 10592 | /*! . */ |
| 10593 | int gmt_ps_append (struct GMT_CTRL *GMT, char *source, unsigned int mode, FILE *dest) { |
no test coverage detected