Logo Search packages:      
Sourcecode: hamlib version File versions  Download package

struct confparams* HAMLIB_API rig_confparam_lookup ( RIG rig,
const char *  name 
) [read]

lookup a confparam struct

Parameters:
rigThe rig handle
nameThe name of the configuration parameter

Lookup conf token by its name.

Returns:
a pointer to the confparams struct if found, otherwise NULL.

Definition at line 498 of file conf.c.

References caps, rig_caps::cfgparams, confparams::name, rig_caps::port_type, RIG_PORT_SERIAL, and confparams::token.

Referenced by rig_set_conf(), and rig_token_lookup().

{
      const struct confparams *cfp;
    token_t token;

      if (!rig || !rig->caps)
            return NULL;

      /* 0 returned for invalid format */
      token = strtol(name, NULL, 0);

      for (cfp = rig->caps->cfgparams; cfp && cfp->name; cfp++)
            if (!strcmp(cfp->name, name) || token == cfp->token)
                  return cfp;

      for (cfp = frontend_cfg_params; cfp->name; cfp++)
            if (!strcmp(cfp->name, name) || token == cfp->token)
                  return cfp;

      if (rig->caps->port_type == RIG_PORT_SERIAL) {
            for (cfp = frontend_serial_cfg_params; cfp->name; cfp++)
                  if (!strcmp(cfp->name, name) || token == cfp->token)
                        return cfp;
      }

      return NULL;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index