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

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

Executes cfunc on all the elements stored in the extlevels table The callback cfunc is called until it returns a value which is not strictly positive. A zero value means a normal end of iteration, and a negative value an abnormal end, which will be the return value of rig_ext_level_foreach.

rigThe rig handle
cfunccallback function of each extlevel
datacookie to be passed to cfunc callback

Definition at line 62 of file ext.c.

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

      const struct confparams *cfp;
      int ret;

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

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

      return RIG_OK;

Generated by  Doxygen 1.6.0   Back to index