| 121 | |
| 122 | |
| 123 | static int remove_opened_rot(const ROT *rot) |
| 124 | { |
| 125 | struct opened_rot_l *p, *q; |
| 126 | q = NULL; |
| 127 | |
| 128 | for (p = opened_rot_list; p; p = p->next) |
| 129 | { |
| 130 | if (p->rot == rot) |
| 131 | { |
| 132 | if (q == NULL) |
| 133 | { |
| 134 | opened_rot_list = opened_rot_list->next; |
| 135 | } |
| 136 | else |
| 137 | { |
| 138 | q->next = p->next; |
| 139 | } |
| 140 | |
| 141 | free(p); |
| 142 | return RIG_OK; |
| 143 | } |
| 144 | |
| 145 | q = p; |
| 146 | } |
| 147 | |
| 148 | return -RIG_EINVAL; /* Not found in list ! */ |
| 149 | } |
| 150 | #endif /* !DOC_HIDDEN */ |
| 151 | |
| 152 | /** @} */ /* rotator definitions */ |