summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorPaul A. Patience <paul@apatience.com>2021-09-11 22:19:18 -0400
committerKaz Kylheku <kaz@kylheku.com>2021-09-12 10:13:03 -0700
commit521ab968ee48e4e40a3e1a5ea00851d39e59b4b3 (patch)
tree560dd8b023d5d7bb2492b2944c46f59d130aafdf /lisplib.c
parent68ad6419262bf60874f034c62d29b83ed4bb2a48 (diff)
downloadtxr-521ab968ee48e4e40a3e1a5ea00851d39e59b4b3.tar.gz
txr-521ab968ee48e4e40a3e1a5ea00851d39e59b4b3.tar.bz2
txr-521ab968ee48e4e40a3e1a5ea00851d39e59b4b3.zip
ffi, sockets: add sock-opt and sock-set-opt.
The new sock-opt and sock-set-opt functions are wrappers around getsockopt and setsockopt, respectively. All POSIX socket options are registered. Platform-specific options may be added in the future. * ffi.c (sock_opt, sock_set_opt): New functions. (ffi_init): Register sock-opt, sock-set-opt, sol-socket, ipproto-ip, ipproto-ipv6, ipproto-tcp, ipproto-udp, so-acceptconn, so-broadcast, so-debug, so-dontroute, so-error, so-keepalive, so-linger, so-oobinline, so-rcvbuf, so-rcvlowat, so-rcvtimeo, so-reuseaddr, so-sndbuf, so-sndlowat, so-sndtimeo, so-type, ipv6-join-group, ipv6-leave-group, ipv6-multicast-hops, ipv6-multicast-if, ipv6-multicast-loop, ipv6-unicast-hops, ipv6-v6only, tcp-nodelay. * lisplib.c (sock_set_entries): Add sock-opt and sock-set-opt. * stdlib/socket.tl (sock-opt): Define as syntactic place. * tests/014/socket-misc.tl: New cases, for sock-opt. (set-and-get): New macro. * txr.1: Documented. Also, mention that sock-bind enables so-reuseaddr. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'lisplib.c')
-rw-r--r--lisplib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lisplib.c b/lisplib.c
index f1e41547..582788f2 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -350,6 +350,7 @@ static val sock_set_entries(val dlt, val fun)
lit("sock-bind"), lit("sock-connect"), lit("sock-listen"),
lit("sock-accept"), lit("sock-shutdown"), lit("open-socket"),
lit("open-socket-pair"), lit("sock-send-timeout"), lit("sock-recv-timeout"),
+ lit("sock-opt"), lit("sock-set-opt"),
nil
};
val name_noload[] = {