summaryrefslogtreecommitdiff
path: root/daemon.h
blob: 492764abe4752a4101127c684f16748b44871d81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef IPC_H
#define IPC_H

typedef struct Timer Timer;

int socket_create();
void socket_set_server(int sockfd);
void socket_set_client(int sockfd);
void socket_bind_clean(int sig);

struct Daemon {
  int sockfd;
  int statusfd;
  Timer* timer;
};

typedef struct Daemon Daemon;

void daemon_init(Daemon *d);
void *daemon_listener_loop(void *d);
void daemon_run(Daemon *d);

#endif