-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.h
39 lines (29 loc) · 839 Bytes
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _MAIN_H
#define _MAIN_H
#define __STDC_FORMAT_MACROS
#include <stdint.h>
#include <stdbool.h>
#include <inttypes.h>
#include <pthread.h>
typedef struct thread_t {
/* pthread instance */
pthread_t thread;
/* Thread name */
char* name;
/* Target function */
void* function;
/* Target function argument */
void* arg;
} thread_t;
/* Declare threads */
/** { [pthread_t], name[64], function, arg } **/
#define THREADS_NUMBER 5
#define DECLARE_THREADS() \
thread_t threads[THREADS_NUMBER] = { \
{ 0, "SDR ", rx_sdr, NULL }, \
{ 0, "TCP Socket ", rx_tcp_socket, NULL }, \
{ 0, "RTLTCP Socket ", rx_rtltcp_socket, NULL }, \
{ 0, "TCP Feed ", rx_tcp_feed, NULL }, \
{ 0, "RTLTCP Feed ", rx_rtltcp_feed, NULL }, \
};
#endif