! Search the list for the selected option and return the pointer to the item. Only the first occurrence will be found. */
| 972 | |
| 973 | /*! Search the list for the selected option and return the pointer to the item. Only the first occurrence will be found. */ |
| 974 | struct GMT_OPTION *GMT_Find_Option (void *V_API, char option, struct GMT_OPTION *head) { |
| 975 | |
| 976 | struct GMT_OPTION *current = NULL; |
| 977 | |
| 978 | if (V_API == NULL) return_null (V_API, GMT_NOT_A_SESSION); /* GMT_Create_Session has not been called */ |
| 979 | |
| 980 | for (current = head; current && current->option != option; current = current->next); /* Linearly search for the specified option */ |
| 981 | return (current); /* NULL if not found */ |
| 982 | } |
| 983 | |
| 984 | /*! Replaces the argument of this option with new arg. */ |
| 985 | int GMT_Update_Option (void *V_API, struct GMT_OPTION *opt, const char *arg) { |
no outgoing calls
no test coverage detected