From 478ae133483a91b35028eca9666689669fe55015 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 8 Apr 2017 13:10:56 -0700 Subject: New path slot in stat struct. * ftw.c (ftw_callback): Pass path to stat_to_struct function. * socket.c (path_s): Variable definition removed from here. (sock_load_init): Do not intern path symbol here. * sysif.c (path_s): Variable definition moved here. (stat_to_struct): New parameter, path. Store its argument in the path slot of the structure. (stat_impl): New parameter, path. Pass argument to stat_to_struct. (statp, statl): Pass path down to stat_impl. (statf): Pass nil down as path argument of stat_impl. (sysif_init): Intern path symbol here. Add path_s to the slot list in the make_struct_type call which creates the stat structure type. * sysif.h (path_s): Declared here now. (stat_to_struct): Declaration updated. * txr.1: Documented new slot of stat structure and behavior of stat, lstat and fstat w.r.t. this slot. --- socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'socket.c') diff --git a/socket.c b/socket.c index 5ecaa78c..aca7240c 100644 --- a/socket.c +++ b/socket.c @@ -50,6 +50,7 @@ #include "args.h" #include "struct.h" #include "arith.h" +#include "sysif.h" #include "socket.h" #define MIN(A, B) ((A) < (B) ? (A) : (B)) @@ -76,7 +77,7 @@ struct dgram_stream { val sockaddr_in_s, sockaddr_in6_s, sockaddr_un_s, addrinfo_s; val flags_s, family_s, socktype_s, protocol_s, addr_s, canonname_s; -val port_s, flow_info_s, scope_id_s, path_s; +val port_s, flow_info_s, scope_id_s; static val ipv4_addr_to_num(struct in_addr *src) { @@ -1073,7 +1074,6 @@ void sock_load_init(void) port_s = intern(lit("port"), user_package); flow_info_s = intern(lit("flow-info"), user_package); scope_id_s = intern(lit("scope-id"), user_package); - path_s = intern(lit("path"), user_package); #ifdef HAVE_GETADDRINFO reg_fun(intern(lit("getaddrinfo"), user_package), func_n3o(getaddrinfo_wrap, 1)); -- cgit v1.2.3