mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 14:19:18 +02:00
adding make-address-info and necessary constants to (chibi net)
This commit is contained in:
parent
ae3291962e
commit
475b5ee01d
2 changed files with 12 additions and 2 deletions
|
@ -1,10 +1,12 @@
|
||||||
|
|
||||||
(module (chibi net)
|
(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
|
socket connect bind accept listen
|
||||||
with-net-io open-net-io
|
with-net-io open-net-io
|
||||||
address-info-family address-info-socket-type address-info-protocol
|
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 (scheme))
|
||||||
(import (chibi filesystem))
|
(import (chibi filesystem))
|
||||||
(include-shared "net")
|
(include-shared "net")
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
predicate: sockaddr?)
|
predicate: sockaddr?)
|
||||||
|
|
||||||
(define-c-struct addrinfo
|
(define-c-struct addrinfo
|
||||||
|
constructor: (make-address-info ai_family ai_socktype ai_protocol)
|
||||||
finalizer: freeaddrinfo
|
finalizer: freeaddrinfo
|
||||||
predicate: address-info?
|
predicate: address-info?
|
||||||
(int ai_family address-info-family)
|
(int ai_family address-info-family)
|
||||||
|
@ -44,3 +45,10 @@
|
||||||
;;> Initiate a connection on a socket.
|
;;> Initiate a connection on a socket.
|
||||||
|
|
||||||
(define-c int connect (int sockaddr int))
|
(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"))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue