acl  3.5.3.0
fiber_hook.h
浏览该文件的文档.
1 #ifndef FIBER_HOOK_INCLUDE_H
2 #define FIBER_HOOK_INCLUDE_H
3 
4 #include "fiber_define.h"
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 #if defined(_WIN32) || defined(_WIN64)
11 
12 FIBER_API socket_t WINAPI acl_fiber_socket(int domain, int type, int protocol);
13 FIBER_API int WINAPI acl_fiber_listen(socket_t, int backlog);
14 
15 FIBER_API int WINAPI acl_fiber_close(socket_t fd);
17  socket_t, struct sockaddr *, socklen_t *);
18 FIBER_API int WINAPI acl_fiber_connect(
19  socket_t , const struct sockaddr *, socklen_t );
20 
21 FIBER_API int WINAPI acl_fiber_recv(
22  socket_t, char* buf, int len, int flags);
23 FIBER_API int WINAPI acl_fiber_recvfrom(socket_t, char* buf, int len,
24  int flags, struct sockaddr* src_addr, socklen_t* addrlen);
25 
26 FIBER_API int WINAPI acl_fiber_send(socket_t, const char* buf,
27  int len, int flags);
28 FIBER_API int WINAPI acl_fiber_sendto(socket_t, const char* buf, int len,
29  int flags, const struct sockaddr* dest_addr, socklen_t addrlen);
30 
31 FIBER_API int WINAPI acl_fiber_select(int nfds, fd_set *readfds,
32  fd_set *writefds, fd_set *exceptfds, const struct timeval *timeout);
33 FIBER_API int WINAPI acl_fiber_poll(struct pollfd *fds,
34  unsigned long nfds, int timeout);
35 
36 FIBER_API int WINAPI acl_fiber_WSARecv(socket_t sockfd,
37  LPWSABUF lpBuffers,
38  DWORD dwBufferCount,
39  LPDWORD lpNumberOfBytesRecvd,
40  LPDWORD lpFlags,
41  LPWSAOVERLAPPED lpOverlapped,
42  LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
43 FIBER_API socket_t WSAAPI acl_fiber_WSAAccept(
44  SOCKET s,
45  struct sockaddr FAR * addr,
46  LPINT addrlen,
47  LPCONDITIONPROC lpfnCondition,
48  DWORD_PTR dwCallbackData);
49 
50 FIBER_API struct hostent * WINAPI acl_fiber_gethostbyname(const char *name);
51 FIBER_API int WINAPI acl_fiber_gethostbyname_r(const char *name, struct hostent *ent,
52  char *buf, size_t buflen, struct hostent **result, int *h_errnop);
53 FIBER_API int WINAPI acl_fiber_getaddrinfo(const char *node, const char *service,
54  const struct addrinfo* hints, struct addrinfo **res);
55 FIBER_API void WINAPI acl_fiber_freeaddrinfo(struct addrinfo *res);
56 
57 #else
58 
59 FIBER_API socket_t acl_fiber_socket(int domain, int type, int protocol);
60 FIBER_API int acl_fiber_listen(socket_t, int backlog);
62 FIBER_API socket_t acl_fiber_accept(socket_t , struct sockaddr *, socklen_t *);
63 FIBER_API int acl_fiber_connect(socket_t , const struct sockaddr *, socklen_t );
64 FIBER_API ssize_t acl_fiber_read(socket_t, void* buf, size_t count);
65 FIBER_API ssize_t acl_fiber_readv(socket_t, const struct iovec* iov, int iovcnt);
66 FIBER_API ssize_t acl_fiber_recvmsg(socket_t, struct msghdr* msg, int flags);
67 
68 FIBER_API ssize_t acl_fiber_write(socket_t, const void* buf, size_t count);
69 FIBER_API ssize_t acl_fiber_writev(socket_t, const struct iovec* iov, int iovcnt);
70 FIBER_API ssize_t acl_fiber_sendmsg(socket_t, const struct msghdr* msg, int flags);
71 
72 FIBER_API ssize_t acl_fiber_recv(socket_t, void* buf, size_t len, int flags);
73 FIBER_API ssize_t acl_fiber_recvfrom(socket_t, void* buf, size_t len, int flags,
74  struct sockaddr* src_addr, socklen_t* addrlen);
75 
76 FIBER_API ssize_t acl_fiber_send(socket_t, const void* buf, size_t len, int flags);
77 FIBER_API ssize_t acl_fiber_sendto(socket_t, const void* buf, size_t len, int flags,
78  const struct sockaddr* dest_addr, socklen_t addrlen);
79 
80 FIBER_API int acl_fiber_select(int nfds, fd_set *readfds, fd_set *writefds,
81  fd_set *exceptfds, struct timeval *timeout);
82 FIBER_API int acl_fiber_poll(struct pollfd *fds, nfds_t nfds, int timeout);
83 
84 FIBER_API struct hostent *acl_fiber_gethostbyname(const char *name);
85 FIBER_API int acl_fiber_gethostbyname_r(const char *name, struct hostent *ent,
86  char *buf, size_t buflen, struct hostent **result, int *h_errnop);
87 FIBER_API int acl_fiber_getaddrinfo(const char *node, const char *service,
88  const struct addrinfo* hints, struct addrinfo **res);
89 FIBER_API void acl_fiber_freeaddrinfo(struct addrinfo *res);
90 
91 #endif
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif
FIBER_API int acl_fiber_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res)
int socket_t
Definition: fiber_define.h:59
FIBER_API ssize_t acl_fiber_write(socket_t, const void *buf, size_t count)
FIBER_API socket_t acl_fiber_accept(socket_t, struct sockaddr *, socklen_t *)
HTTP_API void const char * name
Definition: lib_http.h:620
FIBER_API ssize_t acl_fiber_sendto(socket_t, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
#define FIBER_API
Definition: fiber_define.h:94
FIBER_API ssize_t acl_fiber_sendmsg(socket_t, const struct msghdr *msg, int flags)
FIBER_API int acl_fiber_poll(struct pollfd *fds, nfds_t nfds, int timeout)
FIBER_API ssize_t acl_fiber_writev(socket_t, const struct iovec *iov, int iovcnt)
FIBER_API ssize_t acl_fiber_recvfrom(socket_t, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
FIBER_API ssize_t acl_fiber_recvmsg(socket_t, struct msghdr *msg, int flags)
FIBER_API int acl_fiber_connect(socket_t, const struct sockaddr *, socklen_t)
FIBER_API ssize_t acl_fiber_send(socket_t, const void *buf, size_t len, int flags)
FIBER_API ssize_t acl_fiber_read(socket_t, void *buf, size_t count)
FIBER_API int acl_fiber_gethostbyname_r(const char *name, struct hostent *ent, char *buf, size_t buflen, struct hostent **result, int *h_errnop)
FIBER_API void acl_fiber_freeaddrinfo(struct addrinfo *res)
FIBER_API socket_t acl_fiber_socket(int domain, int type, int protocol)
FIBER_API ssize_t acl_fiber_recv(socket_t, void *buf, size_t len, int flags)
FIBER_API int acl_fiber_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
FIBER_API int acl_fiber_listen(socket_t, int backlog)
FIBER_API struct hostent * acl_fiber_gethostbyname(const char *name)
FIBER_API int acl_fiber_close(socket_t fd)
FIBER_API ssize_t acl_fiber_readv(socket_t, const struct iovec *iov, int iovcnt)