| 110 | } |
| 111 | |
| 112 | int hl_pop(FIFO_RIG *fifo) |
| 113 | { |
| 114 | if (fifo->tail == fifo->head) { return -1; } |
| 115 | |
| 116 | pthread_mutex_lock(&fifo->mutex); |
| 117 | char c = fifo->data[fifo->head]; |
| 118 | #if 0 |
| 119 | |
| 120 | if (isalnum(c)) |
| 121 | rig_debug(RIG_DEBUG_VERBOSE, "%s: pop %c (%d,%d)\n", __func__, c, fifo->head, |
| 122 | fifo->tail); |
| 123 | else |
| 124 | rig_debug(RIG_DEBUG_VERBOSE, "%s: pop 0x%02x (%d,%d)\n", __func__, c, |
| 125 | fifo->head, |
| 126 | fifo->tail); |
| 127 | |
| 128 | #endif |
| 129 | fifo->head = (fifo->head + 1) % HAMLIB_FIFO_SIZE; |
| 130 | pthread_mutex_unlock(&fifo->mutex); |
| 131 | return c; |
| 132 | } |
| 133 | |
| 134 | #ifdef TEST |
| 135 | int main() |
no test coverage detected