summaryrefslogtreecommitdiff
path: root/source/luametatex/source/luacore/luasocket/src/usocket.h
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-09-16 15:53:42 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-09-16 15:53:42 +0200
commitc161b7d6fe142231346cc1844e6e27c0ab7718c1 (patch)
tree3fd877b8986137703e987e4651a2db8e946a0f72 /source/luametatex/source/luacore/luasocket/src/usocket.h
parente94fa4dc30ec28a6727aa85e17aaac18b76aeadb (diff)
downloadcontext-c161b7d6fe142231346cc1844e6e27c0ab7718c1.tar.gz
2022-09-16 14:41:00
Diffstat (limited to 'source/luametatex/source/luacore/luasocket/src/usocket.h')
-rw-r--r--source/luametatex/source/luacore/luasocket/src/usocket.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/source/luametatex/source/luacore/luasocket/src/usocket.h b/source/luametatex/source/luacore/luasocket/src/usocket.h
new file mode 100644
index 000000000..45f2f99f7
--- /dev/null
+++ b/source/luametatex/source/luacore/luasocket/src/usocket.h
@@ -0,0 +1,59 @@
+#ifndef USOCKET_H
+#define USOCKET_H
+/*=========================================================================*\
+* Socket compatibilization module for Unix
+* LuaSocket toolkit
+\*=========================================================================*/
+
+/*=========================================================================*\
+* BSD include files
+\*=========================================================================*/
+/* error codes */
+#include <errno.h>
+/* close function */
+#include <unistd.h>
+/* fnctnl function and associated constants */
+#include <fcntl.h>
+/* struct sockaddr */
+#include <sys/types.h>
+/* socket function */
+#include <sys/socket.h>
+/* struct timeval */
+#include <sys/time.h>
+/* gethostbyname and gethostbyaddr functions */
+#include <netdb.h>
+/* sigpipe handling */
+#include <signal.h>
+/* IP stuff*/
+#include <netinet/in.h>
+#include <arpa/inet.h>
+/* TCP options (nagle algorithm disable) */
+#include <netinet/tcp.h>
+#include <net/if.h>
+
+#ifndef SO_REUSEPORT
+#define SO_REUSEPORT SO_REUSEADDR
+#endif
+
+/* Some platforms use IPV6_JOIN_GROUP instead if
+ * IPV6_ADD_MEMBERSHIP. The semantics are same, though. */
+#ifndef IPV6_ADD_MEMBERSHIP
+#ifdef IPV6_JOIN_GROUP
+#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+#endif /* IPV6_JOIN_GROUP */
+#endif /* !IPV6_ADD_MEMBERSHIP */
+
+/* Same with IPV6_DROP_MEMBERSHIP / IPV6_LEAVE_GROUP. */
+#ifndef IPV6_DROP_MEMBERSHIP
+#ifdef IPV6_LEAVE_GROUP
+#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#endif /* IPV6_LEAVE_GROUP */
+#endif /* !IPV6_DROP_MEMBERSHIP */
+
+typedef int t_socket;
+typedef t_socket *p_socket;
+typedef struct sockaddr_storage t_sockaddr_storage;
+
+#define SOCKET_INVALID (-1)
+
+#endif /* USOCKET_H */