diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2001-01-18 20:07:38 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2001-01-18 20:07:38 +0000 |
commit | 3c2bc464caefadbf493820130dd797c51cdd8bea (patch) | |
tree | a21755e522129a30298b67dc1e39a2e239cbf263 /network_io | |
parent | 298e2f33de5191cf40e0bb7c1c455e587d798385 (diff) | |
download | apr-3c2bc464caefadbf493820130dd797c51cdd8bea.tar.gz |
Add remaining APR_DECLARE()s to all headers. Conditionally added
APR_DECLARES() to the sources, based on compilation emits (there
are many that should be changed eventually, but the compiler will
emit errors if those sources are added for win32).
This change also splits libapr from apr, so the two projects are
compiled seperately. Both .dsp files must be kept up-to-date with
source file revisions.
Finally, libapr.def is no longer needed - so it is gone.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61072 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/unix/sa_common.c | 41 | ||||
-rw-r--r-- | network_io/win32/poll.c | 35 | ||||
-rw-r--r-- | network_io/win32/sendrecv.c | 17 | ||||
-rw-r--r-- | network_io/win32/sockets.c | 40 | ||||
-rw-r--r-- | network_io/win32/sockopt.c | 9 |
5 files changed, 86 insertions, 56 deletions
diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 42e9fae9e..d4444c381 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -70,7 +70,8 @@ #include <stdlib.h> #endif -apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) +APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, + apr_port_t port) { /* XXX IPv6: assumes sin_port and sin6_port at same offset */ sockaddr->sa.sin.sin_port = htons(port); @@ -81,7 +82,8 @@ apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) * since we have apr_getaddrinfo(), but we need to clean up Apache's * listen.c a bit more first. */ -apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr) +APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, + const char *addr) { u_long ipaddr; @@ -103,14 +105,16 @@ apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr) return APR_SUCCESS; } -apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr) +APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, + apr_sockaddr_t *sockaddr) { /* XXX IPv6 - assumes sin_port and sin6_port at same offset */ *port = ntohs(sockaddr->sa.sin.sin_port); return APR_SUCCESS; } -apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr) +APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr, + apr_sockaddr_t *sockaddr) { *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); apr_inet_ntop(sockaddr->sa.sin.sin_family, @@ -150,7 +154,9 @@ static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) #endif } -apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa, + apr_interface_e which, + apr_socket_t *sock) { if (which == APR_LOCAL) { if (sock->local_interface_unknown || sock->local_port_unknown) { @@ -172,11 +178,11 @@ apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_so return APR_SUCCESS; } -apr_status_t apr_parse_addr_port(char **addr, - char **scope_id, - apr_port_t *port, - const char *str, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, + char **scope_id, + apr_port_t *port, + const char *str, + apr_pool_t *p) { const char *ch, *lastchar; int big_port; @@ -297,9 +303,10 @@ static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, } #endif -apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, - apr_int32_t family, apr_port_t port, - apr_int32_t flags, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_getaddrinfo(apr_sockaddr_t **sa, + const char *hostname, + apr_int32_t family, apr_port_t port, + apr_int32_t flags, apr_pool_t *p) { (*sa) = (apr_sockaddr_t *)apr_pcalloc(p, sizeof(apr_sockaddr_t)); if ((*sa) == NULL) @@ -417,8 +424,9 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, return APR_SUCCESS; } -apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr, - apr_int32_t flags) +APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, + apr_sockaddr_t *sockaddr, + apr_int32_t flags) { #if defined(HAVE_GETNAMEINFO) && APR_HAVE_IPV6 int rc; @@ -472,7 +480,8 @@ apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr, #endif } -apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname) +APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, + const char *servname) { struct servent *se; diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 925fd7da7..5baa00768 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -60,7 +60,8 @@ #include <time.h> -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, + apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { @@ -79,8 +80,9 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con return APR_SUCCESS; } -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t event) +APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->sock, aprset->read); @@ -97,8 +99,8 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, - apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; struct timeval tv, *tvptr; @@ -140,7 +142,9 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, + apr_socket_t *sock, + apr_pollfd_t *aprset) { apr_int16_t revents = 0; WSABUF data; @@ -194,19 +198,22 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ return APR_SUCCESS; } -apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) +APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd, + const char *key, void *data) { return apr_get_userdata(data, key, pollfd->cntxt); } -apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_set_polldata(apr_pollfd_t *pollfd, void *data, + const char *key, + apr_status_t (*cleanup)(void *)) { return apr_set_userdata(data, key, cleanup, pollfd->cntxt); } -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t events) +APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t events) { if (events & APR_POLLIN) { FD_CLR(sock->sock, aprset->read); @@ -223,12 +230,14 @@ apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock) { return apr_mask_poll_socket(aprset, sock, ~0); } -apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) +APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset, + apr_int16_t events) { if (events & APR_POLLIN) { FD_ZERO(aprset->read); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 06eec4989..1aa12dca3 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -69,7 +69,8 @@ * bytes. */ #define MAX_SEGMENT_SIZE 65536 -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, + apr_size_t *len) { apr_ssize_t rv; WSABUF wsaData; @@ -90,7 +91,8 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) return APR_SUCCESS; } -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, + apr_size_t *len) { apr_ssize_t rv; WSABUF wsaData; @@ -113,8 +115,9 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) } -apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, - apr_int32_t nvec, apr_int32_t *nbytes) +APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, + const struct iovec *vec, + apr_int32_t nvec, apr_int32_t *nbytes) { apr_ssize_t rv; int i; @@ -189,9 +192,9 @@ static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec * arg 5) Number of bytes to send out of the file * arg 6) APR flags that are mapped to OS specific flags */ -apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, - apr_int32_t flags) +APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags) { apr_status_t status = APR_SUCCESS; apr_ssize_t rv; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 84ca396b0..9d792332c 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -112,8 +112,8 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) sizeof(apr_sockaddr_t)); } -apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new, int ofamily, + int type, apr_pool_t *cont) { int family = ofamily; @@ -159,7 +159,8 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, return APR_SUCCESS; } -apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) +APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, + apr_shutdown_how_e how) { int winhow; @@ -185,13 +186,13 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) } } -apr_status_t apr_close_socket(apr_socket_t *thesocket) +APR_DECLARE(apr_status_t) apr_close_socket(apr_socket_t *thesocket) { apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->sock, (struct sockaddr *)&sa->sa, @@ -207,7 +208,7 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) } } -apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) +APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->sock, backlog) == SOCKET_ERROR) return apr_get_netos_error(); @@ -215,7 +216,8 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) return APR_SUCCESS; } -apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) +APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, + apr_pool_t *connection_context) { alloc_socket(new, connection_context); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family); @@ -263,7 +265,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { apr_status_t lasterror; fd_set temp; @@ -297,26 +299,29 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) return APR_SUCCESS; } -apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *socket) +APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key, + apr_socket_t *socket) { return apr_get_userdata(data, key, socket->cntxt); } -apr_status_t apr_set_socketdata(apr_socket_t *socket, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_set_socketdata(apr_socket_t *socket, void *data, + const char *key, + apr_status_t (*cleanup)(void *)) { return apr_set_userdata(data, key, cleanup, socket->cntxt); } -apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_get_os_sock(apr_os_sock_t *thesock, + apr_socket_t *sock) { *thesock = sock->sock; return APR_SUCCESS; } -apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, - apr_os_sock_info_t *os_sock_info, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, + apr_os_sock_info_t *os_sock_info, + apr_pool_t *cont) { alloc_socket(apr_sock, cont); set_socket_vars(*apr_sock, os_sock_info->family); @@ -345,8 +350,9 @@ apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, return APR_SUCCESS; } -apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock, + apr_os_sock_t *thesock, + apr_pool_t *cont) { if ((*sock) == NULL) { alloc_socket(sock, cont); diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index ecc990701..29d5edae5 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -78,7 +78,8 @@ apr_status_t sononblock(SOCKET sd) return APR_SUCCESS; } -apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on) { int one; apr_status_t stat; @@ -169,7 +170,8 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o return APR_SUCCESS; } -apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) +APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t *on) { switch (opt) { case APR_SO_TIMEOUT: @@ -193,7 +195,8 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t * } -apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, + apr_pool_t *cont) { if (gethostname(buf, len) == -1) return apr_get_netos_error(); |