24#ifndef __M_IO_LAYER_H__
25#define __M_IO_LAYER_H__
27#include <mstdlib/mstdlib_io.h>
1069# include <winsock2.h>
1070# include <ws2tcpip.h>
1071# include <mstcpip.h>
1072# include <windows.h>
1073# define M_EVENT_SOCKET SOCKET
1074# define M_EVENT_INVALID_SOCKET INVALID_SOCKET
1075# define M_EVENT_HANDLE HANDLE
1076# define M_EVENT_INVALID_HANDLE NULL
1078# define M_EVENT_HANDLE int
1079# define M_EVENT_INVALID_HANDLE -1
1080# define M_EVENT_SOCKET int
1081# define M_EVENT_INVALID_SOCKET -1
1091struct M_io_callbacks;
1173#define M_IO_LAYERS_MAX 16
enum M_event_type M_event_type_t
Definition: m_event.h:189
M_bool M_io_callbacks_reg_errormsg(M_io_callbacks_t *callbacks, M_bool(*cb_errormsg)(M_io_layer_t *layer, char *error, size_t err_len))
M_bool M_io_callbacks_reg_processevent(M_io_callbacks_t *callbacks, M_bool(*cb_process_event)(M_io_layer_t *layer, M_event_type_t *type))
void M_io_layer_softevent_add(M_io_layer_t *layer, M_bool sibling_only, M_event_type_t type, M_io_error_t err)
M_bool M_io_callbacks_reg_read(M_io_callbacks_t *callbacks, M_io_error_t(*cb_read)(M_io_layer_t *layer, unsigned char *buf, size_t *read_len, M_io_meta_t *meta))
M_bool M_io_error_is_critical(M_io_error_t err)
M_io_error_t M_io_layer_write(M_io_t *io, size_t layer_id, const unsigned char *buf, size_t *write_len, M_io_meta_t *meta)
struct M_io_layer M_io_layer_t
Definition: m_io_layer.h:1086
M_io_t * M_io_init(M_io_type_t type)
M_io_t * M_io_layer_get_io(M_io_layer_t *layer)
void M_io_layer_softevent_del(M_io_layer_t *layer, M_bool sibling_only, M_event_type_t type)
void M_io_layer_release(M_io_layer_t *layer)
M_bool M_io_callbacks_reg_disconnect(M_io_callbacks_t *callbacks, M_bool(*cb_disconnect)(M_io_layer_t *layer))
struct M_io_handle M_io_handle_t
Definition: m_io_layer.h:1089
size_t M_io_layer_get_index(M_io_layer_t *layer)
M_bool M_io_callbacks_reg_state(M_io_callbacks_t *callbacks, M_io_state_t(*cb_state)(M_io_layer_t *layer))
M_io_error_t M_io_layer_read(M_io_t *io, size_t layer_id, unsigned char *buf, size_t *read_len, M_io_meta_t *meta)
void M_io_set_error(M_io_t *io, M_io_error_t err)
void M_io_callbacks_destroy(M_io_callbacks_t *callbacks)
const char * M_io_layer_get_name(M_io_layer_t *layer)
M_bool M_io_callbacks_reg_destroy(M_io_callbacks_t *callbacks, void(*cb_destroy)(M_io_layer_t *layer))
M_bool M_io_callbacks_reg_init(M_io_callbacks_t *callbacks, M_bool(*cb_init)(M_io_layer_t *layer))
void M_io_layer_softevent_clear(M_io_layer_t *layer)
M_bool M_io_callbacks_reg_reset(M_io_callbacks_t *callbacks, M_bool(*cb_reset)(M_io_layer_t *layer))
M_io_layer_t * M_io_layer_add(M_io_t *io, const char *layer_name, M_io_handle_t *handle, const M_io_callbacks_t *callbacks)
struct M_io_callbacks M_io_callbacks_t
Definition: m_io_layer.h:1092
M_io_callbacks_t * M_io_callbacks_create(void)
M_bool M_io_callbacks_reg_unregister(M_io_callbacks_t *callbacks, void(*cb_unregister)(M_io_layer_t *layer))
M_bool M_io_callbacks_reg_accept(M_io_callbacks_t *callbacks, M_io_error_t(*cb_accept)(M_io_t *new_conn, M_io_layer_t *orig_layer))
M_io_layer_t * M_io_layer_acquire(M_io_t *io, size_t layer_id, const char *name)
M_io_type_t M_io_get_type(M_io_t *io)
M_io_handle_t * M_io_layer_get_handle(M_io_layer_t *layer)
M_bool M_io_callbacks_reg_write(M_io_callbacks_t *callbacks, M_io_error_t(*cb_write)(M_io_layer_t *layer, const unsigned char *buf, size_t *write_len, M_io_meta_t *meta))
enum M_io_error M_io_error_t
Definition: m_io.h:93
enum M_io_type M_io_type_t
Definition: m_io.h:54
struct M_io M_io_t
Definition: m_io.h:59
struct M_io_meta M_io_meta_t
Definition: m_io.h:64
enum M_io_state M_io_state_t
Definition: m_io.h:106