aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/net/unix/aasocket.c.v
diff options
context:
space:
mode:
authorIndrajith K L2022-12-03 17:00:20 +0530
committerIndrajith K L2022-12-03 17:00:20 +0530
commitf5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch)
tree2764fc62da58f2ba8da7ed341643fc359873142f /v_windows/v/vlib/net/unix/aasocket.c.v
downloadcli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.gz
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.bz2
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.zip
Adds most of the toolsHEADmaster
Diffstat (limited to 'v_windows/v/vlib/net/unix/aasocket.c.v')
-rw-r--r--v_windows/v/vlib/net/unix/aasocket.c.v104
1 files changed, 104 insertions, 0 deletions
diff --git a/v_windows/v/vlib/net/unix/aasocket.c.v b/v_windows/v/vlib/net/unix/aasocket.c.v
new file mode 100644
index 0000000..7f762a5
--- /dev/null
+++ b/v_windows/v/vlib/net/unix/aasocket.c.v
@@ -0,0 +1,104 @@
+module unix
+
+#include <sys/un.h>
+
+// Select represents a select operation
+enum Select {
+ read
+ write
+ except
+}
+
+// SocketType are the available sockets
+// enum SocketType {
+// dgram = C.SOCK_DGRAM
+// stream = C.SOCK_STREAM
+// seqpacket = C.SOCK_SEQPACKET
+// }
+
+struct C.sockaddr {
+ sa_family u16
+}
+
+const max_sun_path = 104
+
+// 104 for macos, 108 for linux => use the minimum
+
+struct C.sockaddr_un {
+mut:
+ // sun_len byte // only on macos
+ sun_family int
+ sun_path [104]char // on linux that is 108
+}
+
+struct C.addrinfo {
+mut:
+ ai_family int
+ ai_socktype int
+ ai_flags int
+ ai_protocol int
+ ai_addrlen int
+ ai_addr voidptr
+ ai_canonname voidptr
+ ai_next voidptr
+}
+
+struct C.sockaddr_storage {
+}
+
+// fn C.socket() int
+
+// fn C.setsockopt() int
+
+// fn C.htonl() int
+
+// fn C.htons() int
+
+// fn C.bind() int
+
+// fn C.listen() int
+
+// fn C.accept() int
+
+// fn C.getaddrinfo() int
+
+// fn C.connect() int
+
+// fn C.send() int
+
+// fn C.sendto() int
+
+// fn C.recv() int
+
+// fn C.recvfrom() int
+
+// fn C.shutdown() int
+
+// fn C.ntohs() int
+
+// fn C.getpeername() int
+
+// fn C.inet_ntop(af int, src voidptr, dst charptr, dst_size int) charptr
+
+fn C.WSAAddressToStringA() int
+
+// fn C.getsockname() int
+
+// defined in builtin
+// fn C.read() int
+// fn C.close() int
+
+fn C.ioctlsocket() int
+
+// fn C.fcntl() int
+
+// fn C.@select() int
+
+// fn C.FD_ZERO()
+
+// fn C.FD_SET()
+
+// fn C.FD_ISSET() bool
+
+[typedef]
+struct C.fd_set {}