| 3265 | } |
| 3266 | |
| 3267 | GMT_LOCAL void gmtplot_echo_command (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL, struct GMT_OPTION *options) { |
| 3268 | /* This routine will echo the command and its arguments to the |
| 3269 | * PostScript output file so that the user can see what scales |
| 3270 | * etc was used to produce this plot. Any options with arguments |
| 3271 | * containing spaces will be enclosed in single quotes. |
| 3272 | */ |
| 3273 | size_t length = 0; |
| 3274 | char outstring[GMT_LEN1024] = {""}, not_used[GMT_LEN32] = {""}; |
| 3275 | struct GMT_OPTION *opt = NULL; |
| 3276 | |
| 3277 | if (GMT->current.setting.run_mode == GMT_MODERN) |
| 3278 | PSL_command (PSL, "\n%% PostScript produced by:\n%%@GMT: gmt %s", gmt_current_name (GMT->init.module_name, not_used)); |
| 3279 | else |
| 3280 | PSL_command (PSL, "\n%% PostScript produced by:\n%%@GMT: gmt %s", GMT->init.module_name); |
| 3281 | for (opt = options; opt; opt = opt->next) { |
| 3282 | if (length >= GMT_LEN512) { |
| 3283 | PSL_command (PSL, "%s \\\n%%@GMT:+", outstring); |
| 3284 | length = 0; |
| 3285 | gmt_M_memset (outstring, GMT_LEN1024, char); |
| 3286 | } |
| 3287 | strcat (outstring, " "); length++; |
| 3288 | if (!(opt->option == GMT_OPT_INFILE || opt->option == GMT_OPT_OUTFILE)) { |
| 3289 | if (strchr (opt->arg, ' ')) outstring[length++] = '\''; |
| 3290 | outstring[length++] = '-'; |
| 3291 | outstring[length++] = opt->option; |
| 3292 | } |
| 3293 | if ((strlen (opt->arg) + length) < GMT_LEN1024) strcat (outstring, opt->arg); |
| 3294 | length += strlen (opt->arg); |
| 3295 | if (strchr (opt->arg, ' ')) outstring[length++] = '\''; |
| 3296 | } |
| 3297 | PSL_command (PSL, "%s\n", outstring); |
| 3298 | } |
| 3299 | |
| 3300 | GMT_LOCAL void gmtplot_NaN_pen_up (double x[], double y[], unsigned int pen[], uint64_t n) { |
| 3301 | /* Ensure that if there are NaNs we set pen = PSL_MOVE */ |
no test coverage detected