* rig_list_foreach * executes cfunc on all the elements stored in the rig hash list */ @cond Doxygen_Suppress
| 398 | */ |
| 399 | //! @cond Doxygen_Suppress |
| 400 | int 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 | /* |