diff options
-rw-r--r-- | lisplib.c | 2 | ||||
-rw-r--r-- | share/txr/stdlib/socket.tl | 12 | ||||
-rw-r--r-- | txr.1 | 32 |
3 files changed, 37 insertions, 9 deletions
@@ -306,8 +306,8 @@ static val sock_set_entries(val dlt, val fun) static val sock_instantiate(val set_fun) { funcall1(set_fun, nil); - load(format(nil, lit("~asocket.tl"), stdlib_path, nao)); sock_load_init(); + load(format(nil, lit("~asocket.tl"), stdlib_path, nao)); return nil; } diff --git a/share/txr/stdlib/socket.tl b/share/txr/stdlib/socket.tl index 187f9c52..45a9cc73 100644 --- a/share/txr/stdlib/socket.tl +++ b/share/txr/stdlib/socket.tl @@ -24,16 +24,20 @@ ;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -(defstruct sockaddr nil) +(defstruct sockaddr nil + (:static family nil)) (defstruct sockaddr-in sockaddr - (addr 0) (port 0)) + (addr 0) (port 0) + (:static family af-inet)) (defstruct sockaddr-in6 sockaddr - (addr 0) (port 0) (flow-info 0) (scope-id 0)) + (addr 0) (port 0) (flow-info 0) (scope-id 0) + (:static family af-inet6)) (defstruct sockaddr-un sockaddr - path) + path + (:static family af-unix)) (defstruct addrinfo nil (flags 0) @@ -43009,7 +43009,8 @@ newly created datagram socket which is returned. .coNP Structure @ sockaddr .synb -.mets (defstruct sockaddr nil) +.mets (defstruct sockaddr nil +.mets \ \ (:static family nil)) .syne .desc The @@ -43021,10 +43022,16 @@ several other types are derived: and .codn sockaddr-un . +It has a single slot called +.code family +which is static, and initialized to +.codn nil . + .coNP Structure @ sockaddr-in .synb .mets (defstruct sockaddr-in sockaddr -.mets \ \ (addr 0) (port 0)) +.mets \ \ (addr 0) (port 0) +.mets \ \ (:static family af-inet)) .syne .desc The @@ -43056,10 +43063,16 @@ for instance, when the function is used with the aim of looking up the address of a host, without caring about the port number. +The +.code family +static slot holds the value +.codn af-inet . + .coNP Structure @ sockaddr-in6 .synb .mets (defstruct sockaddr-in6 sockaddr -.mets \ \ (addr 0) (port 0) (flow-info 0) (scope-id 0)) +.mets \ \ (addr 0) (port 0) (flow-info 0) (scope-id 0) +.mets \ \ (:static family af-inet6)) .syne .desc The @@ -43092,10 +43105,16 @@ members of the .code sockaddr_in6 C language structure. Their meaning and use are beyond the scope of this document. +The +.code family +static slot holds the value +.codn af-inet . + .coNP Structure @ sockaddr-un .synb .mets (defstruct sockaddr-un sockaddr -.mets \ \ path) +.mets \ \ path +.mets \ \ (:static family af-unix)) .syne .desc The @@ -43144,6 +43163,11 @@ is valid and represents an abstract address consisting of the three bytes .str "foo" followed by null padding bytes. +The +.code family +static slot holds the value +.codn af-inet . + .coNP Structure @ addrinfo .synb .mets (defstruct addrinfo nil |