mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
clean move lws_plat externs
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
1cd3ba6fdc
commit
a654fc0d50
4 changed files with 51 additions and 35 deletions
|
@ -33,25 +33,6 @@ static int log_level = LLL_ERR | LLL_WARN | LLL_NOTICE;
|
|||
static void lwsl_emit_stderr(int level, const char *line);
|
||||
static void (*lwsl_emit)(int level, const char *line) = lwsl_emit_stderr;
|
||||
|
||||
void lws_plat_delete_socket_from_fds(struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi, int m);
|
||||
void lws_plat_insert_socket_into_fds(struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi);
|
||||
void lws_plat_service_periodic(struct libwebsocket_context *context);
|
||||
|
||||
int lws_plat_change_pollfd(struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi, struct libwebsocket_pollfd *pfd);
|
||||
int lws_plat_context_early_init(void);
|
||||
void lws_plat_context_early_destroy(struct libwebsocket_context *context);
|
||||
void lws_plat_context_late_destroy(struct libwebsocket_context *context);
|
||||
int lws_poll_listen_fd(struct libwebsocket_pollfd *fd);
|
||||
int
|
||||
lws_plat_service(struct libwebsocket_context *context, int timeout_ms);
|
||||
int lws_plat_init_fd_tables(struct libwebsocket_context *context);
|
||||
void lws_plat_drop_app_privileges(struct lws_context_creation_info *info);
|
||||
unsigned long long time_in_microseconds(void);
|
||||
const char *lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt);
|
||||
|
||||
#ifdef LWS_USE_LIBEV
|
||||
#define _LWS_EV_TAG " libev"
|
||||
#else
|
||||
|
@ -73,17 +54,6 @@ static const char * const log_level_names[] = {
|
|||
"LATENCY",
|
||||
};
|
||||
|
||||
#ifndef LWS_NO_CLIENT
|
||||
extern int lws_client_socket_service(
|
||||
struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi, struct libwebsocket_pollfd *pollfd);
|
||||
#endif
|
||||
#ifndef LWS_NO_SERVER
|
||||
extern int lws_server_socket_service(
|
||||
struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi, struct libwebsocket_pollfd *pollfd);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* lws_get_library_version: get version and git hash library built from
|
||||
*
|
||||
|
|
|
@ -477,6 +477,7 @@ lws_plat_open_file(const char* filename, unsigned long* filelen)
|
|||
*filelen = stat_buf.st_size;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef LWS_USE_IPV6
|
||||
LWS_VISIBLE const char *
|
||||
lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt)
|
||||
|
|
|
@ -312,7 +312,7 @@ lws_plat_open_file(const char* filename, unsigned long* filelen)
|
|||
|
||||
#ifdef LWS_USE_IPV6
|
||||
/*
|
||||
* Windows doesn't have an "inet_top"
|
||||
* Windows doesn't have an "inet_ntop"
|
||||
* This came from http://memset.wordpress.com/2010/10/09/inet_ntop-for-win32/
|
||||
* suggested by Joakim Soderberg
|
||||
*/
|
||||
|
@ -327,12 +327,12 @@ lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt)
|
|||
memcpy(&(srcaddr.sin_addr), src, sizeof(srcaddr.sin_addr));
|
||||
|
||||
srcaddr.sin_family = af;
|
||||
if (!WSAAddressToString((struct sockaddr*) &srcaddr,
|
||||
sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt))
|
||||
if (!WSAAddressToString((struct sockaddr*)&srcaddr,
|
||||
sizeof(struct sockaddr_in), 0, dst, (LPDWORD)&cnt))
|
||||
return dst;
|
||||
|
||||
rv = WSAGetLastError();
|
||||
lwsl_err("WSAAddressToString() : %d\n",rv);
|
||||
lwsl_err("WSAAddressToString() : %d\n", rv);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -713,7 +713,7 @@ LWS_EXTERN int handshake_0405(struct libwebsocket_context *context,
|
|||
LWS_EXTERN int get_daemonize_pid();
|
||||
#endif
|
||||
|
||||
extern int interface_to_sa(struct libwebsocket_context *context,
|
||||
LWS_EXTERN int interface_to_sa(struct libwebsocket_context *context,
|
||||
const char *ifname, struct sockaddr_in *addr, size_t addrlen);
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -732,3 +732,48 @@ SHA1(const unsigned char *d, size_t n, unsigned char *md);
|
|||
LWS_EXTERN int openssl_websocket_private_data_index;
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef LWS_NO_CLIENT
|
||||
LWS_EXTERN int lws_client_socket_service(
|
||||
struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi, struct libwebsocket_pollfd *pollfd);
|
||||
#endif
|
||||
#ifndef LWS_NO_SERVER
|
||||
LWS_EXTERN int lws_server_socket_service(
|
||||
struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi, struct libwebsocket_pollfd *pollfd);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* lws_plat_
|
||||
*/
|
||||
LWS_EXTERN void
|
||||
lws_plat_delete_socket_from_fds(struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi, int m);
|
||||
LWS_EXTERN void
|
||||
lws_plat_insert_socket_into_fds(struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi);
|
||||
LWS_EXTERN void
|
||||
lws_plat_service_periodic(struct libwebsocket_context *context);
|
||||
|
||||
LWS_EXTERN int
|
||||
lws_plat_change_pollfd(struct libwebsocket_context *context,
|
||||
struct libwebsocket *wsi, struct libwebsocket_pollfd *pfd);
|
||||
LWS_EXTERN int
|
||||
lws_plat_context_early_init(void);
|
||||
LWS_EXTERN void
|
||||
lws_plat_context_early_destroy(struct libwebsocket_context *context);
|
||||
LWS_EXTERN void
|
||||
lws_plat_context_late_destroy(struct libwebsocket_context *context);
|
||||
LWS_EXTERN int
|
||||
lws_poll_listen_fd(struct libwebsocket_pollfd *fd);
|
||||
LWS_EXTERN int
|
||||
lws_plat_service(struct libwebsocket_context *context, int timeout_ms);
|
||||
LWS_EXTERN int
|
||||
lws_plat_init_fd_tables(struct libwebsocket_context *context);
|
||||
LWS_EXTERN void
|
||||
lws_plat_drop_app_privileges(struct lws_context_creation_info *info);
|
||||
LWS_EXTERN unsigned long long
|
||||
time_in_microseconds(void);
|
||||
LWS_EXTERN const char *
|
||||
lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt);
|
||||
|
|
Loading…
Add table
Reference in a new issue