## crack-xserver-address.api
#
# API for a little utility to analyse
# user-level X server specs. This is
# basically dedicated support for
#
#
src/lib/x-kit/xclient/src/wire/display-old.pkg#
# Our input string is a string containing a
# user-level X server name, often taken from
# a DISPLAY unix environment variable, something
# like:
# ":0.0"
# "unix:0.0"
# "foo.com:0.0"
# "192.168.0.0:0.0"
#
# This consists logically "hostname:display.screen".
# In the typical case where the host is the local
# machine, which has only one display with in turn
# only one logical screen (possibly spready across
# multiple monitors) this is likely to be something
# like
# "127.0.0.1:0.0"
# "unix:0.0"
# ":0.0"
#
# We return a:
#
# UNIX address if the hostname part is empty or the string "unix".
# INET_ADDR address if the hostname starts with a digit
# INET_HOSTNAME address otherwise.
#
# We raise XSERVER_CONNECT_ERROR if display or screen values are not integers,
# or are otherwise malformed.
# Compiled by:
#
src/lib/x-kit/xclient/xclient-internals.sublib# This api is implemented in:
#
#
src/lib/x-kit/xclient/src/wire/crack-xserver-address.pkgapi Crack_Xserver_Address {
Xserver_Address
= UNIX String # ":display.screen" E.g., ":0.0"
| INET_HOSTNAME (String, Int)
# "hostname: display.screen" E.g., "foo.com:0.0"
| INET_ADDRESS (String, Int)
# "ddd.ddd.ddd.ddd: display.screen" E.g., "192.168.0.1:0.0"
;
exception XSERVER_CONNECT_ERROR String;
crack_xserver_address
:
String # Raw display name, often from unix DISPLAY environment variable.
->
{ address: Xserver_Address, # For socket-opening logic.
canonical_display_name: String, # Normalized, for display to humans.
screen: Int
};
to_string: Xserver_Address -> String;
};
## COPYRIGHT (c) 1990, 1991 by John H. Reppy. See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.