Mercurial > hg > th-libs
comparison th_network.h @ 453:efd33accdc81
Break backwards compatibility by renaming BOOL, TRUE and FALSE to lowercase.
Introduce optional but default use of stdbool.h.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 02 Jan 2018 22:56:03 +0200 |
parents | 2991e6b52d95 |
children | 347bfd3e017e |
comparison
equal
deleted
inserted
replaced
452:4471eadea472 | 453:efd33accdc81 |
---|---|
14 #include "th_datastruct.h" | 14 #include "th_datastruct.h" |
15 #include "th_util.h" | 15 #include "th_util.h" |
16 | 16 |
17 | 17 |
18 #ifdef TH_PLAT_WINDOWS | 18 #ifdef TH_PLAT_WINDOWS |
19 # define __OBJC_BOOL // A nasty hack | 19 # define __OBJC_bool // A nasty hack |
20 # include <windows.h> | 20 # include <windows.h> |
21 # include <winsock.h> | 21 # include <winsock.h> |
22 typedef uint16_t in_port_t; | 22 typedef uint16_t in_port_t; |
23 typedef uint32_t in_addr_t; | 23 typedef uint32_t in_addr_t; |
24 #else | 24 #else |
155 void th_conn_reset(th_conn_t *); | 155 void th_conn_reset(th_conn_t *); |
156 | 156 |
157 int th_conn_pull(th_conn_t *); | 157 int th_conn_pull(th_conn_t *); |
158 int th_conn_send_buf(th_conn_t *, const void *buf, const size_t len); | 158 int th_conn_send_buf(th_conn_t *, const void *buf, const size_t len); |
159 int th_conn_send_growbuf(th_conn_t *, th_growbuf_t *buf); | 159 int th_conn_send_growbuf(th_conn_t *, th_growbuf_t *buf); |
160 BOOL th_conn_check(th_conn_t *); | 160 bool th_conn_check(th_conn_t *); |
161 | 161 |
162 | 162 |
163 BOOL th_conn_buf_check(th_conn_t *conn, size_t n); | 163 bool th_conn_buf_check(th_conn_t *conn, size_t n); |
164 BOOL th_conn_buf_skip(th_conn_t *conn, size_t n); | 164 bool th_conn_buf_skip(th_conn_t *conn, size_t n); |
165 int th_conn_buf_strncmp(th_conn_t *conn, const char *str, const size_t n); | 165 int th_conn_buf_strncmp(th_conn_t *conn, const char *str, const size_t n); |
166 int th_conn_buf_strcmp(th_conn_t *conn, const char *str); | 166 int th_conn_buf_strcmp(th_conn_t *conn, const char *str); |
167 char * th_conn_buf_strstr(th_conn_t *conn, const char *str); | 167 char * th_conn_buf_strstr(th_conn_t *conn, const char *str); |
168 | 168 |
169 void th_conn_dump_buffer(FILE *f, th_conn_t *conn); | 169 void th_conn_dump_buffer(FILE *f, th_conn_t *conn); |