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

int HAMLIB_API rig_token_foreach ( RIG rig,
int(*)(const struct confparams *, rig_ptr_t)  cfunc,
rig_ptr_t  data 

call a function against each configuration token of a rig

rig The rig handle
cfunc The function to perform on each token
data Any data to be passed to cfunc
Executes cfunc on all the elements stored in the conf table. rig_token_foreach starts first with backend conf table, then finish with frontend table.

RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).

Definition at line 369 of file conf.c.

References caps, rig_caps::cfgparams, confparams::name, RIG_EINVAL, and RIG_OK.

      const struct confparams *cfp;

      if (!rig || !rig->caps || !cfunc)
            return -RIG_EINVAL;

      for (cfp = rig->caps->cfgparams; cfp && cfp->name; cfp++)
            if ((*cfunc)(cfp, data) == 0)
                  return RIG_OK;

      for (cfp = frontend_cfg_params; cfp->name; cfp++)
            if ((*cfunc)(cfp, data) == 0)
                  return RIG_OK;

      return RIG_OK;

Generated by  Doxygen 1.6.0   Back to index