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

Function hl_pop

src/fifo.c:112–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112int 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
135int main()

Callers 2

morse_data_handlerFunction · 0.85
mainFunction · 0.85

Calls 3

pthread_mutex_lockFunction · 0.85
rig_debugFunction · 0.85
pthread_mutex_unlockFunction · 0.85

Tested by

no test coverage detected