MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / amp_ext_lookup

Function amp_ext_lookup

src/extamp.c:172–200  ·  view source on GitHub ↗

* \brief Lookup an extension levels or parameters token by its name and return * a pointer to the containing #confparams structure member. * * \param amp The #AMP handle. * \param name The extension levels or parameters token name. * * Searches the amp_caps::extlevels table and then the amp_caps::extparms * table for the token by its name. * * \note As this function is called by amp_ext_t

Source from the content-addressed store, hash-verified

170 * \todo Should use Lex to speed it up, strcmp() hurts!
171 */
172const struct confparams *HAMLIB_API amp_ext_lookup(AMP *amp, const char *name)
173{
174 const struct confparams *cfp;
175
176 rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
177
178 if (!amp || !amp->caps)
179 {
180 return NULL;
181 }
182
183 for (cfp = amp->caps->extlevels; cfp && cfp->name; cfp++)
184 {
185 if (!strcmp(cfp->name, name))
186 {
187 return cfp;
188 }
189 }
190
191 for (cfp = amp->caps->extparms; cfp && cfp->name; cfp++)
192 {
193 if (!strcmp(cfp->name, name))
194 {
195 return cfp;
196 }
197 }
198
199 return NULL;
200}
201
202
203/**

Callers 2

amp_ext_token_lookupFunction · 0.85
ampctl_parse.cFile · 0.85

Calls 1

rig_debugFunction · 0.85

Tested by

no test coverage detected