diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-04-14 07:17:48 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-04-14 07:17:48 -0700 |
commit | a6ee9c3ac657e479d338df1b298704ba09c7066e (patch) | |
tree | 86b4746725934e5740b552dfd51c4cf04e9da94e /socket.c | |
parent | 2f989999779dbd9b2b91819317beda6a2560570c (diff) | |
download | txr-a6ee9c3ac657e479d338df1b298704ba09c7066e.tar.gz txr-a6ee9c3ac657e479d338df1b298704ba09c7066e.tar.bz2 txr-a6ee9c3ac657e479d338df1b298704ba09c7066e.zip |
Make open_socket static and register in socket.c.
* lisplib.c (sock_set_entries): Add auto-load entry
for open-socket.
* socket.c (open_socket): Change to static.
(sock_load_init): Register open-socket intrinsic
here rather than in stream.c.
* stream.c (stream_init): Remove registration of
open-socket intrinsic.
* stream.h (open_socket): Declaration removed.
Diffstat (limited to 'socket.c')
-rw-r--r-- | socket.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -998,7 +998,7 @@ static val sock_recv_timeout(val sock, val usec) } #endif -val open_socket(val family, val type, val mode_str) +static val open_socket(val family, val type, val mode_str) { int fd = socket(c_num(family), c_num(type), 0); return open_sockfd(num(fd), family, type, mode_str); @@ -1090,6 +1090,7 @@ void sock_load_init(void) reg_fun(intern(lit("sock-listen"), user_package), func_n2o(sock_listen, 1)); reg_fun(intern(lit("sock-accept"), user_package), func_n3o(sock_accept, 1)); reg_fun(intern(lit("sock-shutdown"), user_package), func_n2o(sock_shutdown, 1)); + reg_fun(intern(lit("open-socket"), user_package), func_n3o(open_socket, 2)); reg_fun(intern(lit("open-socket-pair"), user_package), func_n3o(socketpair_wrap, 2)); #if defined SO_SNDTIMEO && defined SO_RCVTIMEO reg_fun(intern(lit("sock-send-timeout"), user_package), func_n2(sock_send_timeout)); |