From 475b5ee01d6bf8d2394069494dd646f12e95f403 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Wed, 29 Jun 2011 23:53:26 +0900 Subject: [PATCH] adding make-address-info and necessary constants to (chibi net) --- lib/chibi/net.module | 6 ++++-- lib/chibi/net.stub | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/chibi/net.module b/lib/chibi/net.module index 0e907669..7943f5c9 100644 --- a/lib/chibi/net.module +++ b/lib/chibi/net.module @@ -1,10 +1,12 @@ (module (chibi net) - (export sockaddr? address-info? get-address-info + (export sockaddr? address-info? get-address-info make-address-info socket connect bind accept listen with-net-io open-net-io address-info-family address-info-socket-type address-info-protocol - address-info-address address-info-address-length address-info-next) + address-info-address address-info-address-length address-info-next + address-family/unix address-family/inet + socket-type/stream socket-type/datagram socket-type/raw) (import (scheme)) (import (chibi filesystem)) (include-shared "net") diff --git a/lib/chibi/net.stub b/lib/chibi/net.stub index 70109cf9..45642fc8 100644 --- a/lib/chibi/net.stub +++ b/lib/chibi/net.stub @@ -7,6 +7,7 @@ predicate: sockaddr?) (define-c-struct addrinfo + constructor: (make-address-info ai_family ai_socktype ai_protocol) finalizer: freeaddrinfo predicate: address-info? (int ai_family address-info-family) @@ -44,3 +45,10 @@ ;;> Initiate a connection on a socket. (define-c int connect (int sockaddr int)) + +(define-c-const int (address-family/unix "AF_UNIX")) +(define-c-const int (address-family/inet "AF_INET")) +(define-c-const int (socket-type/stream "SOCK_STREAM")) +(define-c-const int (socket-type/datagram "SOCK_DGRAM")) +(define-c-const int (socket-type/raw "SOCK_RAW")) +