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

Function GMT_Delete_Option

src/gmt_parse.c:1055–1074  ·  view source on GitHub ↗

! . */

Source from the content-addressed store, hash-verified

1053
1054/*! . */
1055int GMT_Delete_Option (void *V_API, struct GMT_OPTION *current, struct GMT_OPTION **head) {
1056 /* Remove the specified entry from the linked list. It is assumed that current
1057 * points to the correct option in the linked list. */
1058 struct GMTAPI_CTRL *API = NULL;
1059
1060 if (V_API == NULL) return_error (V_API, GMT_NOT_A_SESSION); /* GMT_Create_Session has not been called */
1061 if (!current) return_error (V_API, GMT_OPTION_IS_NULL); /* No option was passed */
1062 API = gmtparse_get_api_ptr (V_API); /* Cast void pointer to a GMTAPI_CTRL pointer */
1063
1064 /* Remove the current option and bypass via the next/prev pointers in the linked list */
1065 if (current->next) current->next->previous = current->previous;
1066 if (current->previous) /* Reset pointer from previous entry to current's next entry */
1067 current->previous->next = current->next;
1068 else /* current == *head so there is no previous; must update head */
1069 *head = current->next;
1070 gmt_M_str_free (current->arg); /* Option arguments were created by strdup, so we must use free */
1071 gmt_M_free (API->GMT, current); /* Option structure was created by gmt_M_memory, hence gmt_M_free */
1072
1073 return (GMT_OK); /* No error encountered */
1074}
1075
1076/*! . */
1077int GMT_Parse_Common (void *V_API, const char *given_options, struct GMT_OPTION *in_options) {

Callers 9

psternary_prep_optionsFunction · 0.85
GMT_insetFunction · 0.85
GMT_figureFunction · 0.85
GMT_Encode_OptionsFunction · 0.85
gmt_init_moduleFunction · 0.85
GMT_pslegendFunction · 0.85
GMT_grdmathFunction · 0.85

Calls 1

gmtparse_get_api_ptrFunction · 0.85

Tested by

no test coverage detected