| 47 | } |
| 48 | |
| 49 | const u8 *msg_dequeue(struct msg_queue *q) |
| 50 | { |
| 51 | size_t n = tal_count(q->q); |
| 52 | const u8 *msg; |
| 53 | |
| 54 | if (!n) |
| 55 | return NULL; |
| 56 | |
| 57 | msg = q->q[0]; |
| 58 | memmove(q->q, q->q + 1, sizeof(*q->q) * (n-1)); |
| 59 | tal_resize(&q->q, n-1); |
| 60 | return msg; |
| 61 | } |
| 62 | |
| 63 | int msg_extract_fd(const struct msg_queue *q, const u8 *msg) |
| 64 | { |
no outgoing calls
no test coverage detected