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

Function rig_list_foreach

src/register.c:400–428  ·  view source on GitHub ↗

* rig_list_foreach * executes cfunc on all the elements stored in the rig hash list */ @cond Doxygen_Suppress

Source from the content-addressed store, hash-verified

398 */
399//! @cond Doxygen_Suppress
400int HAMLIB_API rig_list_foreach(int (*cfunc)(const struct rig_caps *,
401 rig_ptr_t),
402 rig_ptr_t data)
403{
404 struct rig_list *p;
405 int i;
406
407 if (!cfunc)
408 {
409 return -RIG_EINVAL;
410 }
411
412 for (i = 0; i < RIGLSTHASHSZ; i++)
413 {
414 struct rig_list *next = NULL;
415
416 for (p = rig_hash_table[i]; p; p = next)
417 {
418 next = p->next; /* read before call in case it is unregistered */
419
420 if ((*cfunc)(p->caps, data) == 0)
421 {
422 return RIG_OK;
423 }
424 }
425 }
426
427 return RIG_OK;
428}
429//! @endcond
430
431/*

Callers 6

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
list_modelsFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 2

mainFunction · 0.68
mainFunction · 0.68