2022-08-30 17:54:56 -05:00
|
|
|
// vi:ft=c
|
2022-08-31 11:54:14 -05:00
|
|
|
#ifndef SERVER_H_
|
|
|
|
#define SERVER_H_
|
2022-10-07 18:36:53 -05:00
|
|
|
#include <stdbool.h>
|
2022-08-30 12:08:36 -05:00
|
|
|
#include <stdint.h>
|
2022-10-07 18:36:53 -05:00
|
|
|
#include <time.h>
|
2022-08-29 17:27:03 -05:00
|
|
|
|
2022-10-07 18:36:53 -05:00
|
|
|
typedef struct {
|
2022-10-12 12:33:18 -05:00
|
|
|
// the 0 uniq represents no filter
|
|
|
|
uint64_t uniq;
|
2022-10-07 18:36:53 -05:00
|
|
|
// negative values means no filter
|
|
|
|
int32_t vendor;
|
|
|
|
// negative values means no filter
|
|
|
|
int32_t product;
|
|
|
|
bool js;
|
2022-10-12 12:33:18 -05:00
|
|
|
// NULL means no filter
|
|
|
|
char * name;
|
2022-10-07 18:36:53 -05:00
|
|
|
} ControllerFilter;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
ControllerFilter filter;
|
|
|
|
char *tag;
|
|
|
|
bool duplicate;
|
|
|
|
bool ps4_hidraw;
|
|
|
|
} ServerConfigController;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
ServerConfigController *controllers;
|
|
|
|
size_t controller_count;
|
|
|
|
struct timespec poll_interval;
|
|
|
|
uint32_t request_timeout;
|
|
|
|
} ServerConfig;
|
|
|
|
|
|
|
|
void server_run(uint16_t port, char *config_path);
|
2022-08-29 17:27:03 -05:00
|
|
|
|
|
|
|
#endif
|