Hamlib 4.7.1
Loading...
Searching...
No Matches
fifo.h
1/*
2 * Hamlib Interface - FIFO support
3 * Copyright (c) 2023-2025 by the Hamlib group
4 *
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21/* SPDX-License-Identifier: LGPL-2.1-or-later */
22
23#ifndef _HL_FIFO_H
24#define _HL_FIFO_H
25
26//#include "hamlib/rig.h"
27//#include <pthread.h>
28
29__BEGIN_DECLS
30
31// FIFO currently used for send_morse queue
32#define HAMLIB_FIFO_SIZE 1024
33
34typedef struct FIFO_RIG_s
35{
36 char data[HAMLIB_FIFO_SIZE];
37 int head;
38 int tail;
39 int flush; // flush flag for stop_morse
40 pthread_mutex_t mutex;
41} FIFO_RIG;
42
43/* Function prototypes */
44void initFIFO(FIFO_RIG *fifo);
45void resetFIFO(FIFO_RIG *fifo);
46int hl_push(FIFO_RIG *fifo, const char *msg);
47int hl_pop(FIFO_RIG *fifo);
48int hl_peek(FIFO_RIG *fifo);
49
50__END_DECLS
51
52#endif /* _HL_FIFO_H */
Definition fifo.h:35