summaryrefslogtreecommitdiff
path: root/shared.h
blob: 9ae7e76cfc2b962066ddf6b0a039185c3491bd4b (plain)
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
#ifndef foosharedhfoo
#define foosharedhfoo

#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include "linux-input.h"

#define REMOTE_LAYOUT_MAX_WIDTH  1000
#define REMOTE_LAYOUT_MAX_HEIGHT 1000

extern const char *rc_protocols[20];

struct linux_input_keycode {
	const char *name;
	uint32_t value;
	bool alias;
	void *cairo_surface;
};

extern struct linux_input_keycode linux_input_keycodes[];

struct linux_input_keycode *get_linux_keycode_by_name(const char *name);

struct linux_input_keycode *get_linux_keycode_by_value(uint32_t value);

int strtol_strict(const char *str, int *result);

int strtoull_strict(const char *str, uint64_t *result);

extern uint8_t const byte_rev_table[256];

static inline uint8_t bitrev8(uint8_t byte)
{
	return byte_rev_table[byte];
}

#endif