Skip to content

Commit 1a17f70

Browse files
committed
dependent: OPEN-X-STREAM supports IPv6 addresses on SBCL, ECL, CLASP
1 parent 67f058c commit 1a17f70

File tree

2 files changed

+39
-28
lines changed

2 files changed

+39
-28
lines changed

dependent.lisp

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -928,21 +928,32 @@
928928

929929
#+(or sbcl ecl clasp)
930930
(defun make-inet-x-socket (host port)
931-
(let* ((result (handler-case
932-
(get-host-by-name host)
931+
(multiple-value-bind (host-ent/v4 host-ent/v6)
932+
(handler-case
933+
(get-host-by-name host)
934+
(error (condition)
935+
(return-from make-inet-x-socket
936+
(values nil (list "~@<Host ~S not found: ~A~@:>" host condition)))))
937+
(let ((addresses/v4 (host-ent-addresses host-ent/v4))
938+
(addresses/v6 (when host-ent/v6
939+
(host-ent-addresses host-ent/v6)))
940+
(errors '()))
941+
(flet ((try (socket-class addresses)
942+
(let ((address (first addresses)))
943+
(handler-case
944+
(let ((socket (make-instance socket-class :type :stream :protocol :tcp)))
945+
(socket-connect socket address port)
946+
socket)
933947
(error (condition)
934-
(return-from make-inet-x-socket
935-
(values nil (list "~@<Host ~S not found: ~A~@:>" host condition))))))
936-
(addresses (host-ent-addresses result))
937-
(address (first addresses)))
938-
(handler-case
939-
(let ((socket (make-instance 'inet-socket :type :stream :protocol :tcp)))
940-
(socket-connect socket address port)
941-
socket)
942-
(error (condition)
943-
(values nil (list "~@<Could not connect to host ~A (at address ~
944-
~S), port ~S: ~A~@:>"
945-
host address port condition))))))
948+
(push (list socket-class address condition) errors)
949+
nil)))))
950+
(or (when addresses/v4 (try 'inet-socket addresses/v4))
951+
(when addresses/v6 (try 'inet6-socket addresses/v6))
952+
(values nil (list "~@<Could not connect to X server socket ~
953+
on host ~S, port ~S:~@:_~
954+
~{~{* ~@<Using ~S address ~S failed: ~
955+
~A~@:>~}~^~@:_~}~:>"
956+
host port errors)))))))
946957

947958
#+(or sbcl ecl clasp)
948959
(defun make-x-socket-stream (socket)

manual/clx.texinfo

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ Extensions
240240
* Extensions (Extensions)::
241241
* SHAPE - The X11 Nonrectangular Window Shape Extension::
242242
* RENDER - A new rendering system for X11::
243-
* DPMS - The X11 Display Power Management Signaling Extension::
244-
* BIG-REQUESTS - Big Requests Extension::
243+
* DPMS - The X11 Display Power Management Signaling Extension::
244+
* BIG-REQUESTS - Big Requests Extension::
245245

246246
RENDER - A new rendering system for X11
247247

@@ -2280,7 +2280,7 @@ display 0 (zero).
22802280
A keyword argument that specifies which network protocol should be
22812281
used for connecting to the server (for example, @var{:tcp},
22822282
@var{:dna}, or @var{:chaos}). The set of possible values and the
2283-
default value are implementation specific.
2283+
default value are implementation specific. TODO :tcp or :internet
22842284

22852285
@end table
22862286

@@ -15903,11 +15903,11 @@ of zero is a hint that no repetition should occur.
1590315903
@node Extensions, Errors, Control Functions, Top
1590415904
@chapter Extensions
1590515905
@menu
15906-
* Extensions (Extensions)::
15907-
* SHAPE - The X11 Nonrectangular Window Shape Extension::
15908-
* RENDER - A new rendering system for X11::
15909-
* DPMS - The X11 Display Power Management Signaling Extension::
15910-
* BIG-REQUESTS - Big Requests Extension::
15906+
* Extensions (Extensions)::
15907+
* SHAPE - The X11 Nonrectangular Window Shape Extension::
15908+
* RENDER - A new rendering system for X11::
15909+
* DPMS - The X11 Display Power Management Signaling Extension::
15910+
* BIG-REQUESTS - Big Requests Extension::
1591115911
@end menu
1591215912

1591315913
@node Extensions (Extensions), SHAPE - The X11 Nonrectangular Window Shape Extension, Extensions, Extensions
@@ -16014,7 +16014,7 @@ server and rendering sets of them.
1601416014
* The picture object::
1601516015
* Glyphs and Glyphsets::
1601616016
* Using glyphs::
16017-
* Using cursors::
16017+
* Using cursors::
1601816018
* Errors (Extensions)::
1601916019
@end menu
1602016020

@@ -16333,7 +16333,7 @@ Requests the sequence of glyphs to be drawn with the glyph-set.
1633316333
@defun render-create-cursor picture &optional (x 0) (y 0))
1633416334

1633516335

16336-
Creates cursor object from xrender @var{picture}.
16336+
Creates cursor object from xrender @var{picture}.
1633716337
The @var{x} and @var{y} coordinates define the hotspot relative to the source's
1633816338
origin and must be a point within the source. The resulting picture will
1633916339
nominally be drawn to the screen with :over operator.
@@ -16343,7 +16343,7 @@ display limitations. In particular, if the display supports only
1634316343
two colors cursors without translucency, the cursor will be
1634416344
transformed so that areas less than .5 alpha will be transparent,
1634516345
else opaque, and areas darker than 50% gray will be black else
16346-
white.
16346+
white.
1634716347

1634816348
The source picture can be freed immediately if no further explicit
1634916349
references to it are to be made.
@@ -16429,15 +16429,15 @@ value indicates that the mode is disabled.
1642916429
@var{card16}
1643016430
@item suspend
1643116431
@var{card16}
16432-
@item off
16432+
@item off
1643316433
@var{card16}
1643416434
@end table
1643516435

1643616436

1643716437
Set the values of the DPMS timeouts. All values are in units of
1643816438
seconds. A value of zero for any timeout value disables that mode.
1643916439
@end defun
16440-
16440+
1644116441
@defun dpms-enable display
1644216442
@table @var
1644316443
@item display
@@ -16487,7 +16487,7 @@ Forces a specific DPMS level on the server.
1648716487
Returns two values: the DPMS power-level and state value for the
1648816488
display.
1648916489

16490-
State is one of the keywords DPMS-ENABLED or DPMS-DISABLED.
16490+
State is one of the keywords DPMS-ENABLED or DPMS-DISABLED.
1649116491

1649216492
If state is DPMS-ENABLED, then power-level is returned as one of the
1649316493
keywords DPMS-MODE-ON, DPMS-MODE-STANDBY, DPMS-MODE-SUSPEND or

0 commit comments

Comments
 (0)