mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Merge from stable-2.2
This commit is contained in:
commit
aad64cf381
4 changed files with 8 additions and 32 deletions
|
@ -2420,30 +2420,6 @@ The address of the local host using the loopback device, ie.@:
|
||||||
@c No address.
|
@c No address.
|
||||||
@c @end defvar
|
@c @end defvar
|
||||||
|
|
||||||
@deffn {Scheme Procedure} inet-aton address
|
|
||||||
@deffnx {C Function} scm_inet_aton (address)
|
|
||||||
This function is deprecated in favor of @code{inet-pton}.
|
|
||||||
|
|
||||||
Convert an IPv4 Internet address from printable string
|
|
||||||
(dotted decimal notation) to an integer. E.g.,
|
|
||||||
|
|
||||||
@lisp
|
|
||||||
(inet-aton "127.0.0.1") @result{} 2130706433
|
|
||||||
@end lisp
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} inet-ntoa inetid
|
|
||||||
@deffnx {C Function} scm_inet_ntoa (inetid)
|
|
||||||
This function is deprecated in favor of @code{inet-ntop}.
|
|
||||||
|
|
||||||
Convert an IPv4 Internet address to a printable
|
|
||||||
(dotted decimal notation) string. E.g.,
|
|
||||||
|
|
||||||
@lisp
|
|
||||||
(inet-ntoa 2130706433) @result{} "127.0.0.1"
|
|
||||||
@end lisp
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} inet-netof address
|
@deffn {Scheme Procedure} inet-netof address
|
||||||
@deffnx {C Function} scm_inet_netof (address)
|
@deffnx {C Function} scm_inet_netof (address)
|
||||||
Return the network number part of the given IPv4
|
Return the network number part of the given IPv4
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
@c -*-texinfo-*-
|
@c -*-texinfo-*-
|
||||||
@c This is part of the GNU Guile Reference Manual.
|
@c This is part of the GNU Guile Reference Manual.
|
||||||
@c Copyright (C) 2010, 2011, 2012, 2013, 2015, 2018 Free Software Foundation, Inc.
|
@c Copyright (C) 2010, 2011, 2012, 2013, 2015, 2018, 2019 Free Software Foundation, Inc.
|
||||||
@c See the file guile.texi for copying conditions.
|
@c See the file guile.texi for copying conditions.
|
||||||
|
|
||||||
@node Web
|
@node Web
|
||||||
|
@ -454,11 +454,11 @@ HTTP stack like this:
|
||||||
@example
|
@example
|
||||||
(declare-header! "X-Client-Address"
|
(declare-header! "X-Client-Address"
|
||||||
(lambda (str)
|
(lambda (str)
|
||||||
(inet-aton str))
|
(inet-pton AF_INET str))
|
||||||
(lambda (ip)
|
(lambda (ip)
|
||||||
(and (integer? ip) (exact? ip) (<= 0 ip #xffffffff)))
|
(and (integer? ip) (exact? ip) (<= 0 ip #xffffffff)))
|
||||||
(lambda (ip port)
|
(lambda (ip port)
|
||||||
(display (inet-ntoa ip) port)))
|
(display (inet-ntop AF_INET ip) port)))
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@deffn {Scheme Procedure} declare-opaque-header! name
|
@deffn {Scheme Procedure} declare-opaque-header! name
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef SCM_SOCKET_H
|
#ifndef SCM_SOCKET_H
|
||||||
#define SCM_SOCKET_H
|
#define SCM_SOCKET_H
|
||||||
|
|
||||||
/* Copyright 1995-1997,2000-2001,2004-2006,2008,2014,2018
|
/* Copyright 1995-1997,2000-2001,2004-2006,2008,2014,2018-2019
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Guile.
|
This file is part of Guile.
|
||||||
|
@ -26,8 +26,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SCM_API SCM scm_inet_aton (SCM address);
|
|
||||||
SCM_API SCM scm_inet_ntoa (SCM inetid);
|
|
||||||
SCM_API SCM scm_inet_netof (SCM address);
|
SCM_API SCM scm_inet_netof (SCM address);
|
||||||
SCM_API SCM scm_lnaof (SCM address);
|
SCM_API SCM scm_lnaof (SCM address);
|
||||||
SCM_API SCM scm_inet_makeaddr (SCM net, SCM lna);
|
SCM_API SCM scm_inet_makeaddr (SCM net, SCM lna);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;;; Repl server
|
;;; Repl server
|
||||||
|
|
||||||
;; Copyright (C) 2003, 2010, 2011, 2014, 2016 Free Software Foundation, Inc.
|
;; Copyright (C) 2003, 2010, 2011, 2014, 2016, 2019 Free Software Foundation, Inc.
|
||||||
|
|
||||||
;; This library is free software; you can redistribute it and/or
|
;; This library is free software; you can redistribute it and/or
|
||||||
;; modify it under the terms of the GNU Lesser General Public
|
;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -71,7 +71,9 @@
|
||||||
|
|
||||||
(define* (make-tcp-server-socket #:key
|
(define* (make-tcp-server-socket #:key
|
||||||
(host #f)
|
(host #f)
|
||||||
(addr (if host (inet-aton host) INADDR_LOOPBACK))
|
(addr (if host
|
||||||
|
(inet-pton AF_INET host)
|
||||||
|
INADDR_LOOPBACK))
|
||||||
(port 37146))
|
(port 37146))
|
||||||
(let ((sock (socket PF_INET SOCK_STREAM 0)))
|
(let ((sock (socket PF_INET SOCK_STREAM 0)))
|
||||||
(setsockopt sock SOL_SOCKET SO_REUSEADDR 1)
|
(setsockopt sock SOL_SOCKET SO_REUSEADDR 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue