-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.h
50 lines (37 loc) · 960 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
40
41
42
43
44
45
46
47
48
49
50
#ifndef _MAIN_H
#define _MAIN_H
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>
#include <libevdev.h>
typedef struct libevdev LIBEVDEV;
#define NO_DAEMON_ENVVAR_NAME "NODAEMON"
#define SHELL_COMMAND_MAX_LEN 255
typedef struct config {
int type, code, value;
char command[SHELL_COMMAND_MAX_LEN];
struct config *next;
} CONFIG;
#define CONFIG_ITEM_MAX_LEN SHELL_COMMAND_MAX_LEN
// main.c
void clean(void);
void daemonize(void);
void detect_instances(const char *const);
void register_signals(void);
void report(const int, const char *const, ...);
void show_usage(FILE *const);
void terminate(const int);
// load.c
CONFIG *get_config(const char *const);
LIBEVDEV *get_dev(const char *const);
// exec.c
void process_event();
#endif