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 | |
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.
-rw-r--r-- | lisplib.c | 2 | ||||
-rw-r--r-- | socket.c | 3 | ||||
-rw-r--r-- | stream.c | 3 | ||||
-rw-r--r-- | stream.h | 3 |
4 files changed, 3 insertions, 8 deletions
@@ -292,7 +292,7 @@ static val sock_set_entries(val dlt, val fun) lit("ai-numericserv"), lit("str-inaddr"), lit("str-in6addr"), lit("str-inaddr-net"), lit("str-in6addr-net"), - lit("open-socket-pair"), + lit("open-socket"), lit("open-socket-pair"), nil }; set_dlt_entries(dlt, name, fun); @@ -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)); @@ -3856,9 +3856,6 @@ void stream_init(void) reg_fun(intern(lit("open-directory"), user_package), func_n1(open_directory)); reg_fun(intern(lit("open-file"), user_package), func_n2o(open_file, 1)); reg_fun(intern(lit("open-fileno"), user_package), func_n2o(open_fileno, 1)); -#ifdef HAVE_SOCKETS - reg_fun(intern(lit("open-socket"), user_package), func_n3o(open_socket, 2)); -#endif reg_fun(intern(lit("open-tail"), user_package), func_n3o(open_tail, 1)); reg_fun(intern(lit("open-command"), user_package), func_n2o(open_command, 1)); reg_fun(intern(lit("open-pipe"), user_package), func_n2(open_command)); @@ -191,9 +191,6 @@ val get_string(val stream, val nchars, val close_after_p); val open_directory(val path); val open_file(val path, val mode_str); val open_fileno(val fd, val mode_str); -#if HAVE_SOCKETS -val open_socket(val family, val type, val mode_str); -#endif val open_tail(val path, val mode_str, val seek_end_p); val open_command(val path, val mode_str); val open_process(val path, val mode_str, val args); |