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

Function rig_ext_level_foreach

src/ext.c:131–167  ·  view source on GitHub ↗

* \param rig The rig handle * \param cfunc callback function of each extlevel * \param data cookie to be passed to \a cfunc callback * \brief Executes cfunc on all the elements stored in the extlevels table * * The callback \a 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, whic

Source from the content-addressed store, hash-verified

129 * rig_ext_level_foreach.
130 */
131int HAMLIB_API rig_ext_level_foreach(RIG *rig,
132 int (*cfunc)(RIG *,
133 const struct confparams *,
134 rig_ptr_t),
135 rig_ptr_t data)
136{
137 const struct confparams *cfp;
138
139 rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
140
141 if (!rig || !rig->caps || !cfunc)
142 {
143 return -RIG_EINVAL;
144 }
145
146 for (cfp = rig->caps->extlevels; cfp && cfp->name; cfp++)
147 {
148 if (!rig_has_ext_token(rig, cfp->token))
149 {
150 continue;
151 }
152
153 int ret = (*cfunc)(rig, cfp, data);
154
155 if (ret == 0)
156 {
157 return RIG_OK;
158 }
159
160 if (ret < 0)
161 {
162 return ret;
163 }
164 }
165
166 return RIG_OK;
167}
168
169
170/**

Callers 3

generic_save_channelFunction · 0.85
dumpcapsFunction · 0.85
dumpstateFunction · 0.85

Calls 2

rig_debugFunction · 0.85
rig_has_ext_tokenFunction · 0.85

Tested by

no test coverage detected