godot/thirdparty/wslay/wslay_event.c

/*
 * Wslay - The WebSocket Library
 *
 * Copyright (c) 2011, 2012 Tatsuhiro Tsujikawa
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
#include "wslay_event.h"

#include <string.h>
#include <assert.h>
#include <stdio.h>

#include "wslay_frame.h"
#include "wslay_net.h"
#include "wslay_macro.h"
/* Start of utf8 dfa */
/* Copyright (c) 2008-2010 Bjoern Hoehrmann <[email protected]>
 * See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
 *
 * Copyright (c) 2008-2009 Bjoern Hoehrmann <[email protected]>
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
#define UTF8_ACCEPT
#define UTF8_REJECT

/* clang-format off */
static const uint8_t utf8d[] =;
/* clang-format on */

static uint32_t decode(uint32_t *state, uint32_t *codep, uint32_t byte) {}

/* End of utf8 dfa */

static ssize_t wslay_event_frame_recv_callback(uint8_t *buf, size_t len,
                                               int flags, void *user_data) {}

static ssize_t wslay_event_frame_send_callback(const uint8_t *data, size_t len,
                                               int flags, void *user_data) {}

static int wslay_event_frame_genmask_callback(uint8_t *buf, size_t len,
                                              void *user_data) {}

static int wslay_event_byte_chunk_init(struct wslay_event_byte_chunk **chunk,
                                       size_t len) {}

static void wslay_event_byte_chunk_free(struct wslay_event_byte_chunk *c) {}

static void wslay_event_byte_chunk_copy(struct wslay_event_byte_chunk *c,
                                        size_t off, const uint8_t *data,
                                        size_t data_length) {}

static void wslay_event_imsg_set(struct wslay_event_imsg *m, uint8_t fin,
                                 uint8_t rsv, uint8_t opcode) {}

static void wslay_event_imsg_chunks_free(struct wslay_event_imsg *m) {}

static void wslay_event_imsg_reset(struct wslay_event_imsg *m) {}

static int wslay_event_imsg_append_chunk(struct wslay_event_imsg *m,
                                         size_t len) {}

static int wslay_event_omsg_non_fragmented_init(struct wslay_event_omsg **m,
                                                uint8_t opcode, uint8_t rsv,
                                                const uint8_t *msg,
                                                size_t msg_length) {}

static int wslay_event_omsg_fragmented_init(
    struct wslay_event_omsg **m, uint8_t opcode, uint8_t rsv,
    const union wslay_event_msg_source source,
    wslay_event_fragmented_msg_callback read_callback) {}

static void wslay_event_omsg_free(struct wslay_event_omsg *m) {}

static uint8_t *wslay_event_flatten_queue(struct wslay_queue *queue,
                                          size_t len) {}

static int wslay_event_is_msg_queueable(wslay_event_context_ptr ctx) {}

int wslay_event_queue_close(wslay_event_context_ptr ctx, uint16_t status_code,
                            const uint8_t *reason, size_t reason_length) {}

static int wslay_event_queue_close_wrapper(wslay_event_context_ptr ctx,
                                           uint16_t status_code,
                                           const uint8_t *reason,
                                           size_t reason_length) {}

static int wslay_event_verify_rsv_bits(wslay_event_context_ptr ctx,
                                       uint8_t rsv) {}

int wslay_event_queue_msg(wslay_event_context_ptr ctx,
                          const struct wslay_event_msg *arg) {}

int wslay_event_queue_msg_ex(wslay_event_context_ptr ctx,
                             const struct wslay_event_msg *arg, uint8_t rsv) {}

int wslay_event_queue_fragmented_msg(
    wslay_event_context_ptr ctx, const struct wslay_event_fragmented_msg *arg) {}

int wslay_event_queue_fragmented_msg_ex(
    wslay_event_context_ptr ctx, const struct wslay_event_fragmented_msg *arg,
    uint8_t rsv) {}

void wslay_event_config_set_callbacks(
    wslay_event_context_ptr ctx,
    const struct wslay_event_callbacks *callbacks) {}

static int
wslay_event_context_init(wslay_event_context_ptr *ctx,
                         const struct wslay_event_callbacks *callbacks,
                         void *user_data) {}

int wslay_event_context_server_init(
    wslay_event_context_ptr *ctx, const struct wslay_event_callbacks *callbacks,
    void *user_data) {}

int wslay_event_context_client_init(
    wslay_event_context_ptr *ctx, const struct wslay_event_callbacks *callbacks,
    void *user_data) {}

void wslay_event_context_free(wslay_event_context_ptr ctx) {}

static void wslay_event_call_on_frame_recv_start_callback(
    wslay_event_context_ptr ctx, const struct wslay_frame_iocb *iocb) {}

static void wslay_event_call_on_frame_recv_chunk_callback(
    wslay_event_context_ptr ctx, const struct wslay_frame_iocb *iocb) {}

static void
wslay_event_call_on_frame_recv_end_callback(wslay_event_context_ptr ctx) {}

static int wslay_event_is_valid_status_code(uint16_t status_code) {}

static int wslay_event_config_get_no_buffering(wslay_event_context_ptr ctx) {}

int wslay_event_recv(wslay_event_context_ptr ctx) {}

static void
wslay_event_on_non_fragmented_msg_popped(wslay_event_context_ptr ctx) {}

static struct wslay_event_omsg *
wslay_event_send_ctrl_queue_pop(wslay_event_context_ptr ctx) {}

int wslay_event_send(wslay_event_context_ptr ctx) {}

ssize_t wslay_event_write(wslay_event_context_ptr ctx, uint8_t *buf,
                          size_t buflen) {}

void wslay_event_set_error(wslay_event_context_ptr ctx, int val) {}

int wslay_event_want_read(wslay_event_context_ptr ctx) {}

int wslay_event_want_write(wslay_event_context_ptr ctx) {}

void wslay_event_shutdown_read(wslay_event_context_ptr ctx) {}

void wslay_event_shutdown_write(wslay_event_context_ptr ctx) {}

int wslay_event_get_read_enabled(wslay_event_context_ptr ctx) {}

int wslay_event_get_write_enabled(wslay_event_context_ptr ctx) {}

int wslay_event_get_close_received(wslay_event_context_ptr ctx) {}

int wslay_event_get_close_sent(wslay_event_context_ptr ctx) {}

void wslay_event_config_set_allowed_rsv_bits(wslay_event_context_ptr ctx,
                                             uint8_t rsv) {}

void wslay_event_config_set_no_buffering(wslay_event_context_ptr ctx, int val) {}

void wslay_event_config_set_max_recv_msg_length(wslay_event_context_ptr ctx,
                                                uint64_t val) {}

uint16_t wslay_event_get_status_code_received(wslay_event_context_ptr ctx) {}

uint16_t wslay_event_get_status_code_sent(wslay_event_context_ptr ctx) {}

size_t wslay_event_get_queued_msg_count(wslay_event_context_ptr ctx) {}

size_t wslay_event_get_queued_msg_length(wslay_event_context_ptr ctx) {}