src: rename preprocessor constants
This commit is contained in:
parent
eb673e3fed
commit
2fc0bafb49
@ -47,9 +47,9 @@ foreach(HEADER_SOURCE ${SOURCES_INCLUDE})
|
||||
set(ALLINONE_DLL_OUTPUT "${HEADER_NAME}-all-in-one")
|
||||
add_library(${ALLINONE_DLL_NAME} SHARED ${ALLINONE_SRC_C})
|
||||
if(MSVC)
|
||||
target_compile_definitions(${ALLINONE_DLL_NAME} PUBLIC "-D${HEADER_NAME_UC}_EXTERN=__declspec(dllexport)" )
|
||||
target_compile_definitions(${ALLINONE_DLL_NAME} PUBLIC "-D${HEADER_NAME_UC}_EXPORT=__declspec(dllexport)" )
|
||||
else()
|
||||
target_compile_definitions(${ALLINONE_DLL_NAME} PUBLIC "-D${HEADER_NAME_UC}_EXTERN=__attribute__((visibility(\"default\")))")
|
||||
target_compile_definitions(${ALLINONE_DLL_NAME} PUBLIC "-D${HEADER_NAME_UC}_EXPORT=__attribute__((visibility(\"default\")))")
|
||||
endif()
|
||||
set_target_properties(${ALLINONE_DLL_NAME} PROPERTIES OUTPUT_NAME ${ALLINONE_DLL_OUTPUT})
|
||||
|
||||
@ -60,10 +60,10 @@ foreach(HEADER_SOURCE ${SOURCES_INCLUDE})
|
||||
target_include_directories(${DLL_NAME} PUBLIC include)
|
||||
if(MSVC)
|
||||
target_compile_options(${DLL_NAME} PUBLIC "-FI${HEADER_SOURCE}")
|
||||
target_compile_definitions(${DLL_NAME} PUBLIC "-D${HEADER_NAME_UC}_EXTERN=__declspec(dllexport)" )
|
||||
target_compile_definitions(${DLL_NAME} PUBLIC "-D${HEADER_NAME_UC}_EXPORT=__declspec(dllexport)" )
|
||||
else()
|
||||
target_compile_options(${DLL_NAME} PUBLIC -include ${HEADER_SOURCE} -fvisibility=hidden)
|
||||
target_compile_definitions(${DLL_NAME} PUBLIC "-D${HEADER_NAME_UC}_EXTERN=__attribute__((visibility(\"default\")))")
|
||||
target_compile_definitions(${DLL_NAME} PUBLIC "-D${HEADER_NAME_UC}_EXPORT=__attribute__((visibility(\"default\")))")
|
||||
endif()
|
||||
set_target_properties(${DLL_NAME} PROPERTIES OUTPUT_NAME ${DLL_OUTPUT})
|
||||
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
#define EPOLL_INTERNAL static
|
||||
#define EPOLL_INTERNAL_EXTERN static
|
||||
#define WEPOLL_INTERNAL static
|
||||
#define WEPOLL_INTERNAL_EXTERN static
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#ifndef EPOLL_H_
|
||||
#define EPOLL_H_
|
||||
#ifndef WEPOLL_H_
|
||||
#define WEPOLL_H_
|
||||
|
||||
#ifndef EPOLL_EXTERN
|
||||
#define EPOLL_EXTERN
|
||||
#ifndef WEPOLL_EXPORT
|
||||
#define WEPOLL_EXPORT
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
@ -60,17 +60,17 @@ struct epoll_event {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EPOLL_EXTERN HANDLE epoll_create(int size);
|
||||
EPOLL_EXTERN HANDLE epoll_create1(int flags);
|
||||
WEPOLL_EXPORT HANDLE epoll_create(int size);
|
||||
WEPOLL_EXPORT HANDLE epoll_create1(int flags);
|
||||
|
||||
EPOLL_EXTERN int epoll_close(HANDLE ephnd);
|
||||
WEPOLL_EXPORT int epoll_close(HANDLE ephnd);
|
||||
|
||||
EPOLL_EXTERN int epoll_ctl(HANDLE ephnd,
|
||||
WEPOLL_EXPORT int epoll_ctl(HANDLE ephnd,
|
||||
int op,
|
||||
SOCKET sock,
|
||||
struct epoll_event* event);
|
||||
|
||||
EPOLL_EXTERN int epoll_wait(HANDLE ephnd,
|
||||
WEPOLL_EXPORT int epoll_wait(HANDLE ephnd,
|
||||
struct epoll_event* events,
|
||||
int maxevents,
|
||||
int timeout);
|
||||
@ -79,4 +79,4 @@ EPOLL_EXTERN int epoll_wait(HANDLE ephnd,
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* EPOLL_H_ */
|
||||
#endif /* WEPOLL_H_ */
|
||||
|
||||
@ -135,7 +135,7 @@ static ssize_t _afd_get_protocol_info(SOCKET socket,
|
||||
return id;
|
||||
}
|
||||
|
||||
EPOLL_INTERNAL ssize_t afd_get_protocol(SOCKET socket,
|
||||
WEPOLL_INTERNAL ssize_t afd_get_protocol(SOCKET socket,
|
||||
SOCKET* afd_socket_out,
|
||||
WSAPROTOCOL_INFOW* protocol_info) {
|
||||
ssize_t id;
|
||||
|
||||
10
src/afd.h
10
src/afd.h
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_AFD_H_
|
||||
#define EPOLL_AFD_H_
|
||||
#ifndef WEPOLL_AFD_H_
|
||||
#define WEPOLL_AFD_H_
|
||||
|
||||
#include "internal.h"
|
||||
#include "ntstatus.h"
|
||||
@ -52,11 +52,11 @@ typedef struct _AFD_POLL_INFO {
|
||||
AFD_POLL_HANDLE_INFO Handles[1];
|
||||
} AFD_POLL_INFO, *PAFD_POLL_INFO;
|
||||
|
||||
EPOLL_INTERNAL int afd_poll(SOCKET driver_socket,
|
||||
WEPOLL_INTERNAL int afd_poll(SOCKET driver_socket,
|
||||
AFD_POLL_INFO* poll_info,
|
||||
OVERLAPPED* overlapped);
|
||||
|
||||
EPOLL_INTERNAL ssize_t afd_get_protocol(SOCKET socket,
|
||||
WEPOLL_INTERNAL ssize_t afd_get_protocol(SOCKET socket,
|
||||
SOCKET* afd_socket_out,
|
||||
WSAPROTOCOL_INFOW* protocol_info);
|
||||
|
||||
@ -78,4 +78,4 @@ static const GUID AFD_PROVIDER_GUID_LIST[] = {
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#endif /* EPOLL_AFD_H_ */
|
||||
#endif /* WEPOLL_AFD_H_ */
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#ifndef EPOLL_API_H_
|
||||
#define EPOLL_API_H_
|
||||
#ifndef WEPOLL_API_H_
|
||||
#define WEPOLL_API_H_
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
EPOLL_INTERNAL int api_global_init(void);
|
||||
WEPOLL_INTERNAL int api_global_init(void);
|
||||
|
||||
#endif /* EPOLL_API_H_ */
|
||||
#endif /* WEPOLL_API_H_ */
|
||||
|
||||
10
src/error.h
10
src/error.h
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_ERROR_H_
|
||||
#define EPOLL_ERROR_H_
|
||||
#ifndef WEPOLL_ERROR_H_
|
||||
#define WEPOLL_ERROR_H_
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
#define return_error(value, ...) _return_error_helper(__VA_ARGS__ + 0, value)
|
||||
|
||||
EPOLL_INTERNAL errno_t err_map_win_error_to_errno(DWORD error);
|
||||
EPOLL_INTERNAL void err_set_win_error(DWORD error);
|
||||
WEPOLL_INTERNAL errno_t err_map_win_error_to_errno(DWORD error);
|
||||
WEPOLL_INTERNAL void err_set_win_error(DWORD error);
|
||||
|
||||
#endif /* EPOLL_ERROR_H_ */
|
||||
#endif /* WEPOLL_ERROR_H_ */
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#ifndef EPOLL_INIT_H_
|
||||
#define EPOLL_INIT_H_
|
||||
#ifndef WEPOLL_INIT_H_
|
||||
#define WEPOLL_INIT_H_
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
EPOLL_INTERNAL int init(void);
|
||||
WEPOLL_INTERNAL int init(void);
|
||||
|
||||
#endif /* EPOLL_INIT_H_ */
|
||||
#endif /* WEPOLL_INIT_H_ */
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
#ifndef EPOLL_INTERNAL_H_
|
||||
#define EPOLL_INTERNAL_H_
|
||||
#ifndef WEPOLL_INTERNAL_H_
|
||||
#define WEPOLL_INTERNAL_H_
|
||||
|
||||
#ifndef EPOLL_INTERNAL
|
||||
#define EPOLL_INTERNAL
|
||||
#define EPOLL_INTERNAL_EXTERN extern
|
||||
#ifndef WEPOLL_INTERNAL
|
||||
#define WEPOLL_INTERNAL
|
||||
#define WEPOLL_INTERNAL_EXTERN extern
|
||||
#endif
|
||||
|
||||
#endif /* EPOLL_INTERNAL_H_ */
|
||||
#endif /* WEPOLL_INTERNAL_H_ */
|
||||
|
||||
2
src/nt.c
2
src/nt.c
@ -4,7 +4,7 @@
|
||||
#include "win.h"
|
||||
|
||||
#define X(return_type, attributes, name, parameters) \
|
||||
EPOLL_INTERNAL return_type(attributes* name) parameters = NULL;
|
||||
WEPOLL_INTERNAL return_type(attributes* name) parameters = NULL;
|
||||
NTDLL_IMPORT_LIST(X)
|
||||
#undef X
|
||||
|
||||
|
||||
10
src/nt.h
10
src/nt.h
@ -1,11 +1,11 @@
|
||||
#ifndef EPOLL_NT_H_
|
||||
#define EPOLL_NT_H_
|
||||
#ifndef WEPOLL_NT_H_
|
||||
#define WEPOLL_NT_H_
|
||||
|
||||
#include "internal.h"
|
||||
#include "ntstatus.h"
|
||||
#include "win.h"
|
||||
|
||||
EPOLL_INTERNAL int nt_global_init(void);
|
||||
WEPOLL_INTERNAL int nt_global_init(void);
|
||||
|
||||
typedef struct _IO_STATUS_BLOCK {
|
||||
union {
|
||||
@ -70,8 +70,8 @@ typedef struct _OBJECT_ATTRIBUTES {
|
||||
(HANDLE handle, PVOID key, BOOLEAN alertable, PLARGE_INTEGER mstimeout))
|
||||
|
||||
#define X(return_type, attributes, name, parameters) \
|
||||
EPOLL_INTERNAL_EXTERN return_type(attributes* name) parameters;
|
||||
WEPOLL_INTERNAL_EXTERN return_type(attributes* name) parameters;
|
||||
NTDLL_IMPORT_LIST(X)
|
||||
#undef X
|
||||
|
||||
#endif /* EPOLL_NT_H_ */
|
||||
#endif /* WEPOLL_NT_H_ */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_NTSTATUS_H_
|
||||
#define EPOLL_NTSTATUS_H_
|
||||
#ifndef WEPOLL_NTSTATUS_H_
|
||||
#define WEPOLL_NTSTATUS_H_
|
||||
|
||||
#include "win.h"
|
||||
|
||||
@ -88,4 +88,4 @@ typedef NTSTATUS* PNTSTATUS;
|
||||
#define STATUS_SEVERITY_ERROR 0x3
|
||||
#endif
|
||||
|
||||
#endif /* EPOLL_NTSTATUS_H_ */
|
||||
#endif /* WEPOLL_NTSTATUS_H_ */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_POLL_GROUP_H_
|
||||
#define EPOLL_POLL_GROUP_H_
|
||||
#ifndef WEPOLL_POLL_GROUP_H_
|
||||
#define WEPOLL_POLL_GROUP_H_
|
||||
|
||||
#include "error.h"
|
||||
#include "internal.h"
|
||||
@ -10,13 +10,13 @@ typedef struct ep_port ep_port_t;
|
||||
typedef struct poll_group_allocator poll_group_allocator_t;
|
||||
typedef struct poll_group poll_group_t;
|
||||
|
||||
EPOLL_INTERNAL poll_group_allocator_t* poll_group_allocator_new(
|
||||
WEPOLL_INTERNAL poll_group_allocator_t* poll_group_allocator_new(
|
||||
ep_port_t* port_info, const WSAPROTOCOL_INFOW* protocol_info);
|
||||
EPOLL_INTERNAL void poll_group_allocator_delete(poll_group_allocator_t* pga);
|
||||
WEPOLL_INTERNAL void poll_group_allocator_delete(poll_group_allocator_t* pga);
|
||||
|
||||
EPOLL_INTERNAL poll_group_t* poll_group_acquire(poll_group_allocator_t* pga);
|
||||
EPOLL_INTERNAL void poll_group_release(poll_group_t* ds);
|
||||
WEPOLL_INTERNAL poll_group_t* poll_group_acquire(poll_group_allocator_t* pga);
|
||||
WEPOLL_INTERNAL void poll_group_release(poll_group_t* ds);
|
||||
|
||||
EPOLL_INTERNAL SOCKET poll_group_get_socket(poll_group_t* poll_group);
|
||||
WEPOLL_INTERNAL SOCKET poll_group_get_socket(poll_group_t* poll_group);
|
||||
|
||||
#endif /* EPOLL_POLL_GROUP_H_ */
|
||||
#endif /* WEPOLL_POLL_GROUP_H_ */
|
||||
|
||||
32
src/port.h
32
src/port.h
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_PORT_DATA_H_
|
||||
#define EPOLL_PORT_DATA_H_
|
||||
#ifndef WEPOLL_PORT_H_
|
||||
#define WEPOLL_PORT_H_
|
||||
|
||||
#include "afd.h"
|
||||
#include "internal.h"
|
||||
@ -27,39 +27,39 @@ typedef struct ep_port {
|
||||
size_t active_poll_count;
|
||||
} ep_port_t;
|
||||
|
||||
EPOLL_INTERNAL ep_port_t* ep_port_new(HANDLE* iocp_out);
|
||||
EPOLL_INTERNAL int ep_port_close(ep_port_t* port_info);
|
||||
EPOLL_INTERNAL int ep_port_delete(ep_port_t* port_info);
|
||||
WEPOLL_INTERNAL ep_port_t* ep_port_new(HANDLE* iocp_out);
|
||||
WEPOLL_INTERNAL int ep_port_close(ep_port_t* port_info);
|
||||
WEPOLL_INTERNAL int ep_port_delete(ep_port_t* port_info);
|
||||
|
||||
EPOLL_INTERNAL int ep_port_wait(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL int ep_port_wait(ep_port_t* port_info,
|
||||
struct epoll_event* events,
|
||||
int maxevents,
|
||||
int timeout);
|
||||
|
||||
EPOLL_INTERNAL int ep_port_ctl(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL int ep_port_ctl(ep_port_t* port_info,
|
||||
int op,
|
||||
SOCKET sock,
|
||||
struct epoll_event* ev);
|
||||
|
||||
EPOLL_INTERNAL poll_group_t* ep_port_acquire_poll_group(
|
||||
WEPOLL_INTERNAL poll_group_t* ep_port_acquire_poll_group(
|
||||
ep_port_t* port_info,
|
||||
size_t protocol_id,
|
||||
const WSAPROTOCOL_INFOW* protocol_info);
|
||||
EPOLL_INTERNAL void ep_port_release_poll_group(poll_group_t* poll_group);
|
||||
WEPOLL_INTERNAL void ep_port_release_poll_group(poll_group_t* poll_group);
|
||||
|
||||
EPOLL_INTERNAL int ep_port_add_socket(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL int ep_port_add_socket(ep_port_t* port_info,
|
||||
ep_sock_t* sock_info,
|
||||
SOCKET socket);
|
||||
EPOLL_INTERNAL int ep_port_del_socket(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL int ep_port_del_socket(ep_port_t* port_info,
|
||||
ep_sock_t* sock_info);
|
||||
EPOLL_INTERNAL ep_sock_t* ep_port_find_socket(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL ep_sock_t* ep_port_find_socket(ep_port_t* port_info,
|
||||
SOCKET socket);
|
||||
|
||||
EPOLL_INTERNAL void ep_port_request_socket_update(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL void ep_port_request_socket_update(ep_port_t* port_info,
|
||||
ep_sock_t* sock_info);
|
||||
EPOLL_INTERNAL void ep_port_clear_socket_update(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL void ep_port_clear_socket_update(ep_port_t* port_info,
|
||||
ep_sock_t* sock_info);
|
||||
EPOLL_INTERNAL bool ep_port_is_socket_update_pending(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL bool ep_port_is_socket_update_pending(ep_port_t* port_info,
|
||||
ep_sock_t* sock_info);
|
||||
|
||||
#endif /* EPOLL_PORT_DATA_H_ */
|
||||
#endif /* WEPOLL_PORT_H_ */
|
||||
|
||||
28
src/queue.h
28
src/queue.h
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_QUEUE_H_
|
||||
#define EPOLL_QUEUE_H_
|
||||
#ifndef WEPOLL_QUEUE_H_
|
||||
#define WEPOLL_QUEUE_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
@ -16,19 +16,19 @@ typedef struct queue {
|
||||
queue_node_t head;
|
||||
} queue_t;
|
||||
|
||||
EPOLL_INTERNAL void queue_init(queue_t* queue);
|
||||
EPOLL_INTERNAL void queue_node_init(queue_node_t* node);
|
||||
WEPOLL_INTERNAL void queue_init(queue_t* queue);
|
||||
WEPOLL_INTERNAL void queue_node_init(queue_node_t* node);
|
||||
|
||||
EPOLL_INTERNAL queue_node_t* queue_first(const queue_t* queue);
|
||||
EPOLL_INTERNAL queue_node_t* queue_last(const queue_t* queue);
|
||||
WEPOLL_INTERNAL queue_node_t* queue_first(const queue_t* queue);
|
||||
WEPOLL_INTERNAL queue_node_t* queue_last(const queue_t* queue);
|
||||
|
||||
EPOLL_INTERNAL void queue_prepend(queue_t* queue, queue_node_t* node);
|
||||
EPOLL_INTERNAL void queue_append(queue_t* queue, queue_node_t* node);
|
||||
EPOLL_INTERNAL void queue_move_first(queue_t* queue, queue_node_t* node);
|
||||
EPOLL_INTERNAL void queue_move_last(queue_t* queue, queue_node_t* node);
|
||||
EPOLL_INTERNAL void queue_remove(queue_node_t* node);
|
||||
WEPOLL_INTERNAL void queue_prepend(queue_t* queue, queue_node_t* node);
|
||||
WEPOLL_INTERNAL void queue_append(queue_t* queue, queue_node_t* node);
|
||||
WEPOLL_INTERNAL void queue_move_first(queue_t* queue, queue_node_t* node);
|
||||
WEPOLL_INTERNAL void queue_move_last(queue_t* queue, queue_node_t* node);
|
||||
WEPOLL_INTERNAL void queue_remove(queue_node_t* node);
|
||||
|
||||
EPOLL_INTERNAL bool queue_empty(const queue_t* queue);
|
||||
EPOLL_INTERNAL bool queue_enqueued(const queue_node_t* node);
|
||||
WEPOLL_INTERNAL bool queue_empty(const queue_t* queue);
|
||||
WEPOLL_INTERNAL bool queue_enqueued(const queue_node_t* node);
|
||||
|
||||
#endif /* EPOLL_QUEUE_H_ */
|
||||
#endif /* WEPOLL_QUEUE_H_ */
|
||||
|
||||
6
src/rb.h
6
src/rb.h
@ -35,8 +35,8 @@
|
||||
* The maximum height of a red-black tree is 2lg (n+1).
|
||||
*/
|
||||
|
||||
#ifndef EPOLL_RB_H_
|
||||
#define EPOLL_RB_H_
|
||||
#ifndef WEPOLL_RB_H_
|
||||
#define WEPOLL_RB_H_
|
||||
|
||||
#ifdef __clang__
|
||||
#define RB_UNUSED __attribute__((__unused__))
|
||||
@ -498,4 +498,4 @@ name##_RB_MINMAX(struct name *head, int val) \
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#endif /* EPOLL_RB_H_ */
|
||||
#endif /* WEPOLL_RB_H_ */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_REFLOCK_TREE_H_
|
||||
#define EPOLL_REFLOCK_TREE_H_
|
||||
#ifndef WEPOLL_REFLOCK_TREE_H_
|
||||
#define WEPOLL_REFLOCK_TREE_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -18,20 +18,20 @@ typedef struct reflock_tree_node {
|
||||
reflock_t reflock;
|
||||
} reflock_tree_node_t;
|
||||
|
||||
EPOLL_INTERNAL void reflock_tree_init(reflock_tree_t* rtl);
|
||||
EPOLL_INTERNAL void reflock_tree_node_init(reflock_tree_node_t* node);
|
||||
WEPOLL_INTERNAL void reflock_tree_init(reflock_tree_t* rtl);
|
||||
WEPOLL_INTERNAL void reflock_tree_node_init(reflock_tree_node_t* node);
|
||||
|
||||
EPOLL_INTERNAL int reflock_tree_add(reflock_tree_t* rlt,
|
||||
WEPOLL_INTERNAL int reflock_tree_add(reflock_tree_t* rlt,
|
||||
reflock_tree_node_t* node,
|
||||
uintptr_t key);
|
||||
|
||||
EPOLL_INTERNAL reflock_tree_node_t* reflock_tree_del_and_ref(
|
||||
WEPOLL_INTERNAL reflock_tree_node_t* reflock_tree_del_and_ref(
|
||||
reflock_tree_t* rlt, uintptr_t key);
|
||||
EPOLL_INTERNAL reflock_tree_node_t* reflock_tree_find_and_ref(
|
||||
WEPOLL_INTERNAL reflock_tree_node_t* reflock_tree_find_and_ref(
|
||||
reflock_tree_t* rlt, uintptr_t key);
|
||||
|
||||
EPOLL_INTERNAL void reflock_tree_node_unref(reflock_tree_node_t* node);
|
||||
EPOLL_INTERNAL void reflock_tree_node_unref_and_destroy(
|
||||
WEPOLL_INTERNAL void reflock_tree_node_unref(reflock_tree_node_t* node);
|
||||
WEPOLL_INTERNAL void reflock_tree_node_unref_and_destroy(
|
||||
reflock_tree_node_t* node);
|
||||
|
||||
#endif /* REFLOCK_TREE_H_ */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_REFLOCK_H_
|
||||
#define EPOLL_REFLOCK_H_
|
||||
#ifndef WEPOLL_REFLOCK_H_
|
||||
#define WEPOLL_REFLOCK_H_
|
||||
|
||||
/* The reflock is a special kind of lock that normally prevents a chunk of
|
||||
* memory from being freed, but does allow the chunk of memory to eventually be
|
||||
@ -27,11 +27,11 @@ typedef struct reflock {
|
||||
uint32_t state;
|
||||
} reflock_t;
|
||||
|
||||
EPOLL_INTERNAL int reflock_global_init(void);
|
||||
WEPOLL_INTERNAL int reflock_global_init(void);
|
||||
|
||||
EPOLL_INTERNAL void reflock_init(reflock_t* reflock);
|
||||
EPOLL_INTERNAL void reflock_ref(reflock_t* reflock);
|
||||
EPOLL_INTERNAL void reflock_unref(reflock_t* reflock);
|
||||
EPOLL_INTERNAL void reflock_unref_and_destroy(reflock_t* reflock);
|
||||
WEPOLL_INTERNAL void reflock_init(reflock_t* reflock);
|
||||
WEPOLL_INTERNAL void reflock_ref(reflock_t* reflock);
|
||||
WEPOLL_INTERNAL void reflock_unref(reflock_t* reflock);
|
||||
WEPOLL_INTERNAL void reflock_unref_and_destroy(reflock_t* reflock);
|
||||
|
||||
#endif /* EPOLL_REFLOCK_H_ */
|
||||
#endif /* WEPOLL_REFLOCK_H_ */
|
||||
|
||||
19
src/sock.h
19
src/sock.h
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_SOCK_H_
|
||||
#define EPOLL_SOCK_H_
|
||||
#ifndef WEPOLL_SOCK_H_
|
||||
#define WEPOLL_SOCK_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -19,18 +19,19 @@ typedef struct ep_sock {
|
||||
queue_node_t queue_node;
|
||||
} ep_sock_t;
|
||||
|
||||
EPOLL_INTERNAL ep_sock_t* ep_sock_new(ep_port_t* port_info, SOCKET socket);
|
||||
EPOLL_INTERNAL void ep_sock_delete(ep_port_t* port_info, ep_sock_t* sock_info);
|
||||
EPOLL_INTERNAL void ep_sock_force_delete(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL ep_sock_t* ep_sock_new(ep_port_t* port_info, SOCKET socket);
|
||||
WEPOLL_INTERNAL void ep_sock_delete(ep_port_t* port_info,
|
||||
ep_sock_t* sock_info);
|
||||
WEPOLL_INTERNAL void ep_sock_force_delete(ep_port_t* port_info,
|
||||
ep_sock_t* sock_info);
|
||||
|
||||
EPOLL_INTERNAL int ep_sock_set_event(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL int ep_sock_set_event(ep_port_t* port_info,
|
||||
ep_sock_t* sock_info,
|
||||
const struct epoll_event* ev);
|
||||
|
||||
EPOLL_INTERNAL int ep_sock_update(ep_port_t* port_info, ep_sock_t* sock_info);
|
||||
EPOLL_INTERNAL int ep_sock_feed_event(ep_port_t* port_info,
|
||||
WEPOLL_INTERNAL int ep_sock_update(ep_port_t* port_info, ep_sock_t* sock_info);
|
||||
WEPOLL_INTERNAL int ep_sock_feed_event(ep_port_t* port_info,
|
||||
OVERLAPPED* overlapped,
|
||||
struct epoll_event* ev);
|
||||
|
||||
#endif /* EPOLL_SOCK_H_ */
|
||||
#endif /* WEPOLL_SOCK_H_ */
|
||||
|
||||
18
src/tree.h
18
src/tree.h
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_TREE_H_
|
||||
#define EPOLL_TREE_H_
|
||||
#ifndef WEPOLL_TREE_H_
|
||||
#define WEPOLL_TREE_H_
|
||||
|
||||
#include "internal.h"
|
||||
#include "rb.h"
|
||||
@ -16,13 +16,13 @@ typedef struct tree_node {
|
||||
uintptr_t key;
|
||||
} tree_node_t;
|
||||
|
||||
EPOLL_INTERNAL void tree_init(tree_t* tree);
|
||||
EPOLL_INTERNAL void tree_node_init(tree_node_t* node);
|
||||
WEPOLL_INTERNAL void tree_init(tree_t* tree);
|
||||
WEPOLL_INTERNAL void tree_node_init(tree_node_t* node);
|
||||
|
||||
EPOLL_INTERNAL int tree_add(tree_t* tree, tree_node_t* node, uintptr_t key);
|
||||
EPOLL_INTERNAL int tree_del(tree_t* tree, tree_node_t* node);
|
||||
WEPOLL_INTERNAL int tree_add(tree_t* tree, tree_node_t* node, uintptr_t key);
|
||||
WEPOLL_INTERNAL int tree_del(tree_t* tree, tree_node_t* node);
|
||||
|
||||
EPOLL_INTERNAL tree_node_t* tree_find(tree_t* tree, uintptr_t key);
|
||||
EPOLL_INTERNAL tree_node_t* tree_root(tree_t* tree);
|
||||
WEPOLL_INTERNAL tree_node_t* tree_find(tree_t* tree, uintptr_t key);
|
||||
WEPOLL_INTERNAL tree_node_t* tree_root(tree_t* tree);
|
||||
|
||||
#endif /* EPOLL_TREE_H_ */
|
||||
#endif /* WEPOLL_TREE_H_ */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef EPOLL_UTIL_H_
|
||||
#define EPOLL_UTIL_H_
|
||||
#ifndef WEPOLL_UTIL_H_
|
||||
#define WEPOLL_UTIL_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@ -26,6 +26,6 @@ typedef intptr_t ssize_t;
|
||||
(unused)) int __static_assert_##__LINE__[(condition) ? 1 : -1];
|
||||
#endif
|
||||
|
||||
EPOLL_INTERNAL void* util_safe_container_of_helper(void* ptr, size_t offset);
|
||||
WEPOLL_INTERNAL void* util_safe_container_of_helper(void* ptr, size_t offset);
|
||||
|
||||
#endif /* EPOLL_UTIL_H_ */
|
||||
#endif /* WEPOLL_UTIL_H_ */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user