! . */
| 8334 | |
| 8335 | /*! . */ |
| 8336 | char * gmtlib_create_header_item (struct GMTAPI_CTRL *API, unsigned int mode, void *arg) { |
| 8337 | size_t lim; |
| 8338 | char *txt = (mode & GMT_COMMENT_IS_OPTION) ? GMT_Create_Cmd (API, arg) : (char *)arg; |
| 8339 | static char buffer[GMT_BUFSIZ]; |
| 8340 | gmt_M_memset (buffer, GMT_BUFSIZ, char); |
| 8341 | if (mode & GMT_COMMENT_IS_TITLE) strcat (buffer, " Title :"); |
| 8342 | if (mode & GMT_COMMENT_IS_COMMAND) { |
| 8343 | strcat (buffer, " Command : gmt "); |
| 8344 | if (strlen(API->GMT->init.module_name) < 500) /* 500, just to shut up a Coverity issue */ |
| 8345 | strcat (buffer, API->GMT->init.module_name); |
| 8346 | strcat (buffer, " "); |
| 8347 | } |
| 8348 | if (mode & GMT_COMMENT_IS_REMARK) strcat (buffer, " Remark : "); |
| 8349 | if (mode & GMT_COMMENT_IS_MULTISEG) strcat (buffer, "> "); |
| 8350 | lim = GMT_BUFSIZ - strlen (buffer) - 1; /* Max characters left */ |
| 8351 | strncat (buffer, txt, lim); |
| 8352 | if (mode & GMT_COMMENT_IS_OPTION) gmt_M_free (API->GMT, txt); |
| 8353 | return (buffer); |
| 8354 | } |
| 8355 | |
| 8356 | /*! . */ |
| 8357 | void gmtlib_close_grd (struct GMT_CTRL *GMT, struct GMT_GRID *G) { |
no test coverage detected