! . */
| 1053 | |
| 1054 | /*! . */ |
| 1055 | int 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 | /*! . */ |
| 1077 | int GMT_Parse_Common (void *V_API, const char *given_options, struct GMT_OPTION *in_options) { |
no test coverage detected