MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / gmt_set_psfilename

Function gmt_set_psfilename

src/gmt_plot.c:10575–10590  ·  view source on GitHub ↗

! . */

Source from the content-addressed store, hash-verified

10573
10574/*! . */
10575int 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/*! . */
10593int gmt_ps_append (struct GMT_CTRL *GMT, char *source, unsigned int mode, FILE *dest) {

Callers 6

gmt_plotinitFunction · 0.85
GMT_insetFunction · 0.85
GMT_Extract_RegionFunction · 0.85
gmt_init_moduleFunction · 0.85
GMT_subplotFunction · 0.85
GMT_psconvertFunction · 0.85

Calls 2

gmt_get_current_figureFunction · 0.85
GMT_ReportFunction · 0.85

Tested by

no test coverage detected