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

Function gmtlib_create_header_item

src/gmt_api.c:8336–8354  ·  view source on GitHub ↗

! . */

Source from the content-addressed store, hash-verified

8334
8335/*! . */
8336char * 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/*! . */
8357void gmtlib_close_grd (struct GMT_CTRL *GMT, struct GMT_GRID *G) {

Callers 4

gmtapi_dataset_commentFunction · 0.85
gmtapi_cpt_commentFunction · 0.85
gmtapi_ps_commentFunction · 0.85
gmtlib_write_newheadersFunction · 0.85

Calls 1

GMT_Create_CmdFunction · 0.85

Tested by

no test coverage detected