aboutsummaryrefslogtreecommitdiff
path: root/client/acronc/handler.h
blob: 1036f6a7847c2ebb58ae8a0ed7d9ada20b37f375 (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
39
40
/*
 * Created by yuuta on 7/24/22.
 */

#ifndef ACRONC_HANDLER_H
#define ACRONC_HANDLER_H

#include <uv.h>
#include <libac.h>

extern uv_loop_t *loop;

int h_signal(void (*on_int)(void),
             void (*on_quit)(void));

int h_stdin(int (*on_input)(ac_request_t *req),
            void (*on_close)(void));

int stdin_start(void);

void stdin_stop(void);

int h_socket(ac_connection_parameters_t *p,
             const struct addrinfo *ai,
             void (*on_connect_result)(bool),
             int (*on_ready)(void),
             int (*on_received)(ac_obj_t *obj),
             void (*on_closed)(void));

int sock_request(ac_request_t *req);

int sock_ext(bool trigger_callback);

int a_dns(const char *host,
          uint16_t port,
          void (*on_resolv)(int status,
                            const struct addrinfo *,
                            void (*on_connect_result)(bool)));

#endif /* ACRONC_HANDLER_H */