123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- #ifndef PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_
- #define PLUGINS_ARCH_UA_ARCHITECTURE_FUNCTIONS_H_
- #include "ua_config.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- #ifndef UA_malloc
- void* UA_malloc(size_t size);
- #endif
- #ifndef UA_calloc
- void* UA_calloc(size_t num, size_t size);
- #endif
- #ifndef UA_realloc
- void* UA_realloc(void *ptr, size_t new_size);
- #endif
- #ifndef UA_free
- void UA_free(void* ptr);
- #endif
- #ifndef UA_alloca
- # if defined(__GNUC__) || defined(__clang__)
- # define UA_alloca(size) __builtin_alloca (size)
- # elif defined(_WIN32)
- # define UA_alloca(SIZE) _alloca(SIZE)
- # else
- # include <alloca.h>
- # define UA_alloca(SIZE) alloca(SIZE)
- # endif
- #endif
- #ifndef UA_STACKARRAY
- # if defined(__GNUC__) || defined(__clang__)
- # define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
- # else
- # define UA_STACKARRAY(TYPE, NAME, SIZE) \
- TYPE *NAME = (TYPE*)UA_alloca(sizeof(TYPE) * SIZE)
- # endif
- #endif
- #ifndef UA_sleep_ms
- int UA_sleep_ms(unsigned int miliSeconds);
- #endif
- #ifndef UA_send
- ssize_t UA_send(UA_SOCKET sockfd, const void *buf, size_t len, int flags);
- #endif
- #ifndef UA_sendto
- ssize_t sendto(UA_SOCKET sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen);
- #endif
- #ifndef UA_select
- int UA_select(UA_SOCKET nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
- #endif
- #ifndef UA_recv
- ssize_t UA_recv(UA_SOCKET sockfd, void *buf, size_t len, int flags);
- #endif
- #ifndef UA_recvfrom
- ssize_t recvfrom(UA_SOCKET sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen);
- #endif
- #ifndef UA_shutdown
- int UA_shutdown(UA_SOCKET sockfd, int how);
- #endif
- #ifndef UA_socket
- UA_SOCKET UA_socket(int domain, int type, int protocol);
- #endif
- #ifndef UA_bind
- int UA_bind(UA_SOCKET sockfd, const struct sockaddr *addr, socklen_t addrlen);
- #endif
- #ifndef UA_listen
- int UA_listen(UA_SOCKET sockfd, int backlog);
- #endif
- #ifndef UA_accept
- int UA_accept(UA_SOCKET sockfd, struct sockaddr *addr, socklen_t *addrlen);
- #endif
- #ifndef UA_close
- int UA_close(UA_SOCKET sockfd);
- #endif
- #ifndef UA_connect
- int UA_connect(UA_SOCKET sockfd, const struct sockaddr *addr, socklen_t addrlen);
- #endif
- #ifndef UA_fd_set
- void UA_fd_set(UA_SOCKET fd, fd_set *set);
- #endif
- #ifndef UA_fd_isset
- int UA_fd_isset(UA_SOCKET fd, fd_set *set);
- #endif
- #ifndef UA_getaddrinfo
- int UA_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res);
- #endif
- #ifndef UA_htonl
- uint32_t UA_htonl(uint32_t hostlong);
- #endif
- #ifndef UA_ntohl
- uint32_t UA_ntohl(uint32_t netlong);
- #endif
- #ifndef UA_inet_pton
- int UA_inet_pton(int af, const char *src, void *dst);
- #endif
- #if UA_IPV6
- # ifndef UA_if_nametoindex
- unsigned int UA_if_nametoindex(const char *ifname);
- # endif
- #endif
- #ifndef UA_socket_set_blocking
- unsigned int UA_socket_set_blocking(UA_SOCKET sockfd);
- #endif
- #ifndef UA_socket_set_nonblocking
- unsigned int UA_socket_set_nonblocking(UA_SOCKET sockfd);
- #endif
- #ifndef UA_getsockopt
- int UA_getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen);
- #endif
- #ifndef UA_setsockopt
- int UA_setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen);
- #endif
- #ifndef UA_freeaddrinfo
- void UA_freeaddrinfo(struct addrinfo *res);
- #endif
- #ifndef UA_gethostname
- int UA_gethostname(char *name, size_t len);
- #endif
- #ifndef UA_initialize_architecture_network
- void UA_initialize_architecture_network(void);
- #endif
- #ifndef UA_deinitialize_architecture_network
- void UA_deinitialize_architecture_network(void);
- #endif
- #ifndef UA_snprintf
- int UA_snprintf(char* pa_stream, size_t pa_size, const char* pa_format, ...);
- #endif
- #ifndef UA_access
- int UA_access(const char *pathname, int mode);
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|