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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#pragma once
#include "../foundation/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Connection */
typedef struct jnl_connection_struct jnl_connection_struct;
typedef jnl_connection_struct *jnl_connection_t;
enum
{
JNL_CONNECTION_STATE_ERROR = 0,
JNL_CONNECTION_STATE_NOCONNECTION = 1,
JNL_CONNECTION_STATE_RESOLVING = 2,
JNL_CONNECTION_STATE_CONNECTING = 3,
JNL_CONNECTION_STATE_CONNECTED = 4,
JNL_CONNECTION_STATE_CLOSING = 5,
JNL_CONNECTION_STATE_CLOSED = 6,
JNL_CONNECTION_STATE_RESOLVED = 7, // happens after RESOLVING, but going here for compatability
};
/* UDP */
typedef struct jnl_udp_struct jnl_udp_struct;
typedef jnl_udp_struct *jnl_udp_t;
/* HTTP */
typedef struct jnl_http_struct jnl_http_struct;
typedef jnl_http_struct *jnl_http_t;
enum
{
HTTPGET_STATUS_ERROR = -1,
JNL_HTTP_STATUS_ERROR = HTTPGET_STATUS_ERROR,
HTTPGET_STATUS_CONNECTING = 0,
JNL_HTTP_STATUS_CONNECTING = HTTPGET_STATUS_CONNECTING,
HTTPGET_STATUS_READING_HEADERS = 1,
JNL_HTTP_STATUS_READING_HEADERS = HTTPGET_STATUS_READING_HEADERS,
HTTPGET_STATUS_READING_CONTENT = 2,
JNL_HTTP_STATUS_READING_CONTENT = HTTPGET_STATUS_READING_CONTENT,
};
enum
{
HTTPGET_RUN_ERROR = -1,
HTTPGET_RUN_OK = 0,
JNL_HTTP_RUN_OK = HTTPGET_RUN_OK,
HTTPGET_RUN_CONNECTION_CLOSED = 1,
};
/* DNS */
typedef struct jnl_dns_struct jnl_dns_struct;
typedef jnl_dns_struct *jnl_dns_t;
typedef struct jnl_httpu_request_struct jnl_httpu_request_struct;
typedef jnl_httpu_request_struct *jnl_httpu_request_t;
typedef struct jnl_http_request_struct jnl_http_request_struct;
typedef jnl_http_request_struct *jnl_http_request_t;
typedef struct jnl_listen_struct jnl_listen_struct;
typedef jnl_listen_struct *jnl_listen_t;
#ifdef __cplusplus
}
#endif
|