| 104 | |
| 105 | |
| 106 | static int remove_opened_amp(const AMP *amp) |
| 107 | { |
| 108 | struct opened_amp_l *p, *q; |
| 109 | q = NULL; |
| 110 | |
| 111 | for (p = opened_amp_list; p; p = p->next) |
| 112 | { |
| 113 | if (p->amp == amp) |
| 114 | { |
| 115 | if (q == NULL) |
| 116 | { |
| 117 | opened_amp_list = opened_amp_list->next; |
| 118 | } |
| 119 | else |
| 120 | { |
| 121 | q->next = p->next; |
| 122 | } |
| 123 | |
| 124 | free(p); |
| 125 | return RIG_OK; |
| 126 | } |
| 127 | |
| 128 | q = p; |
| 129 | } |
| 130 | |
| 131 | return -RIG_EINVAL; /* Not found in list ! */ |
| 132 | } |
| 133 | |
| 134 | |
| 135 | #ifdef XXREMOVEDXX |