return 0;
}
-#if LWS_POSIX
LWS_VISIBLE void lwsl_emit_stderr(int level, const char *line)
{
unsigned long long now;
fprintf(stderr, "%s%s", buf, line);
}
-#endif
LWS_VISIBLE void _lws_logv(int filter, const char *format, va_list vl)
{
#else /* NOT WIN32 */
#include <unistd.h>
-#define LWS_INVALID_FILE -1
#define LWS_O_RDONLY O_RDONLY
#ifndef MBED_OPERATORS
#include <poll.h>
#include <netdb.h>
+#define LWS_INVALID_FILE -1
#else
#define getdtablesize() (20)
+#define LWS_INVALID_FILE NULL
#endif
#if defined(__GNUC__)
unsigned char *end);
LWS_VISIBLE LWS_EXTERN int
lws_finalize_http_header(struct lws_context *context,
- struct lws *wsi,
- unsigned char **p,
- unsigned char *end);
+ struct lws *wsi,
+ unsigned char **p,
+ unsigned char *end);
LWS_VISIBLE LWS_EXTERN int
lws_add_http_header_by_token(struct lws_context *context,
- struct lws *wsi,
- enum lws_token_indexes token,
- const unsigned char *value,
- int length,
- unsigned char **p,
- unsigned char *end);
+ struct lws *wsi,
+ enum lws_token_indexes token,
+ const unsigned char *value,
+ int length,
+ unsigned char **p,
+ unsigned char *end);
LWS_VISIBLE LWS_EXTERN int
lws_add_http_header_content_length(struct lws_context *context,
- struct lws *wsi,
- unsigned long content_length,
- unsigned char **p,
- unsigned char *end);
+ struct lws *wsi,
+ unsigned long content_length,
+ unsigned char **p,
+ unsigned char *end);
LWS_VISIBLE LWS_EXTERN int
lws_add_http_header_status(struct lws_context *context, struct lws *wsi,
unsigned int code, unsigned char **p,
return 0;
}
-LWS_VISIBLE int lws_get_random(struct lws_context *context,
- void *buf, int len)
+LWS_VISIBLE int lws_get_random(struct lws_context *context, void *buf, int len)
{
- (void)context;
int n = len;
unsigned char *b = (unsigned char *)buf;
+
+ (void)context;
+
while (n--)
b[n]= rand();
return len;
(void)filename;
(void)filelen;
(void)flags;
- return -1;
+ return NULL;
}
static int
unsigned long
_lws_plat_file_seek_cur(struct lws *wsi, lws_filefd_type fd, long offset)
{
- (void)wsi
+ (void)wsi;
(void)fd;
(void)offset;
static int
_lws_plat_file_read(struct lws *wsi, lws_filefd_type fd, unsigned long *amount,
- unsigned char* buf, unsigned long* len)
+ unsigned char *buf, unsigned long len)
{
(void)wsi;
(void)amount;
static int
_lws_plat_file_write(struct lws *wsi, lws_filefd_type fd, unsigned long *amount,
- unsigned char* buf, unsigned long len)
+ unsigned char *buf, unsigned long len)
{
(void)wsi;
(void)amount;
lws_plat_init(struct lws_context *context,
struct lws_context_creation_info *info)
{
+ (void)info;
+
context->fops.open = _lws_plat_file_open;
context->fops.close = _lws_plat_file_close;
context->fops.seek_cur = _lws_plat_file_seek_cur;
}
extern "C" LWS_VISIBLE struct lws *
-wsi_from_fd(struct lws_context *context, lws_sockfd_type fd)
+wsi_from_fd(const struct lws_context *context, lws_sockfd_type fd)
{
lws_conn *conn = (lws_conn *)fd;
(void)context;
#if defined(_WIN32) || defined(MBED_OPERATORS)
LWS_EXTERN struct lws *
-wsi_from_fd(struct lws_context *context, lws_sockfd_type fd);
+wsi_from_fd(const struct lws_context *context, lws_sockfd_type fd);
LWS_EXTERN int
insert_wsi(struct lws_context *context, struct lws *wsi);