* \brief Convert alpha string to enum AMP_LEVEL_... * \param s input alpha string * \return AMP_LEVEL_... * * \sa amp_level_e() */
| 1158 | * \sa amp_level_e() |
| 1159 | */ |
| 1160 | setting_t HAMLIB_API amp_parse_level(const char *s) |
| 1161 | { |
| 1162 | int i; |
| 1163 | |
| 1164 | rig_debug(RIG_DEBUG_VERBOSE, "%s called level=%s\n", __func__, s); |
| 1165 | |
| 1166 | rig_debug(RIG_DEBUG_VERBOSE, "%s called str=%s\n", __func__, |
| 1167 | amp_level_str[0].str); |
| 1168 | |
| 1169 | for (i = 0 ; amp_level_str[i].str[0] != '\0'; i++) |
| 1170 | { |
| 1171 | rig_debug(RIG_DEBUG_VERBOSE, "%s called checking=%s\n", __func__, |
| 1172 | amp_level_str[i].str); |
| 1173 | |
| 1174 | if (!strcmp(s, amp_level_str[i].str)) |
| 1175 | { |
| 1176 | return amp_level_str[i].level; |
| 1177 | } |
| 1178 | } |
| 1179 | |
| 1180 | return AMP_LEVEL_NONE; |
| 1181 | } |
| 1182 | |
| 1183 | |
| 1184 | /** |
no test coverage detected