upload tizen2.0 source 2.0alpha master 2.0_alpha submit/master/20120920.151141
authorBoram Park <boram1288.park@samsung.com>
Tue, 21 Aug 2012 09:04:21 +0000 (18:04 +0900)
committerBoram Park <boram1288.park@samsung.com>
Tue, 21 Aug 2012 09:04:21 +0000 (18:04 +0900)
32 files changed:
COPYING [changed mode: 0755->0644]
ChangeLog [changed mode: 0755->0644]
INSTALL [new file with mode: 0644]
Makefile.am [changed mode: 0755->0644]
NEWS [deleted file]
README [changed mode: 0755->0644]
Xtrans.c [changed mode: 0755->0644]
Xtrans.h
Xtransint.h [changed mode: 0755->0644]
Xtranslcl.c [changed mode: 0755->0644]
Xtranssock.c [changed mode: 0755->0644]
Xtranstli.c
Xtransutil.c
autogen.sh [deleted file]
configure.ac [changed mode: 0755->0644]
debian/README.source [deleted file]
debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/copyright [deleted file]
debian/rules [deleted file]
debian/watch [deleted file]
debian/xsfbs/repack.sh [deleted file]
debian/xsfbs/xsfbs.mk [deleted file]
debian/xsfbs/xsfbs.sh [deleted file]
debian/xtrans-dev.install [deleted file]
doc/Makefile.am [changed mode: 0755->0644]
doc/xtrans.xml [changed mode: 0755->0644]
docbook.am [new file with mode: 0644]
packaging/xorg-x11-xtrans-devel.spec
transport.c
xtrans.m4 [changed mode: 0755->0644]

diff --git a/COPYING b/COPYING
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index ea88052..66b30c2
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,463 @@
+commit 8ce5ecd33b05becc054dbd07f87e385165b6c979
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Thu Mar 22 20:04:07 2012 -0700
+
+    xtrans 1.2.7
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit f8eea0bf256de59602790b6a7c7877b31520440f
+Author: Matt Dew <marcoz@osource.org>
+Date:   Wed Jan 11 22:23:32 2012 -0700
+
+    informaltable cleanup
+
+    On certain tables, add top and bottom borders to table
+    header and a bottom border to the table. This matches
+    what those tables in the old pdfs looked like.
+
+    the <?dbfo keep-together='always'> prevents tables from
+    splitting across pages. Useful for tiny tables.
+
+    Converting the colwidth to a floating point,
+    IE, 1* -> 1.0* cleans up these build errors:
+    WARNING: table-layout="fixed" and column-width unspecified
+    => falling back to proportional-column-width(1)
+
+    Signed-off-by: Matt Dew <marcoz@osource.org>
+
+commit 6086f6c1d0e0a1c9e590879acb2319dea0eb6e96
+Author: Robert Bragg <robert@linux.intel.com>
+Date:   Mon Dec 12 00:30:43 2011 +0000
+
+    Xtranssock.c: avoid buffer overrun in SocketReopen
+
+    This function was constructing an address from a port string allocating
+    a buffer according to the size of the string but then later copying
+    the address according to sizeof(struct sockaddr).
+
+    This patch ensures that we allocate a struct sockaddr buffer with enough
+    space for the port string to be copied into sa_data[] and uses that
+    combined length to determine how much should be copied at the end of the
+    function.
+
+    This fixes a crash when using xwayland which uses ListenOnOpenFD() that
+    will call _XSERVTransReopenCOTSServer() with a short port string like
+    ":1".
+
+    Signed-off-by: Robert Bragg <robert@linux.intel.com>
+    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit a04a45cb94f7f569e6dd77df93258fa167d0a4ea
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Wed Nov 30 18:40:46 2011 -0800
+
+    Remove unnecessary casts on malloc, calloc & free calls
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
+
+commit a0bfb4fefd20b396e3d88eff0c60602fc436dad5
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Wed Nov 30 18:11:15 2011 -0800
+
+    Replace malloc(strlen)+strcpy with strdup
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
+
+commit b89e1b45198c48996750b5da3d715c10f974243f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Wed Nov 30 18:05:05 2011 -0800
+
+    Finish conversion to standard C allocation functions
+
+    Commit 4ac40cd5451 started this, by no longer special casing the
+    xserver to include it's former custom allocation functions, this
+    just takes the remaining #defines and pre-substitutes them into
+    the code.
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit ff992be7b05483f9a0586a27ee0edb6d99580b84
+Author: Alan Hourihane <alanh@fairlite.co.uk>
+Date:   Thu Dec 1 12:04:22 2011 +0000
+
+    Fix some resource & memory leaks in libxtrans.
+
+    Signed-off-by: Alan Hourihane <alanh@vmware.com>
+    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 29c9e101f7ad72556aa6b3dbc17d66a1ace9b2b1
+Author: Matt Dew <marcoz@osource.org>
+Date:   Tue Oct 4 21:59:50 2011 -0600
+
+    Cleanup IDs and links in doc
+
+    1 - fix the capitalization of the ID attributes to match either the
+         <title> or <funcdef> string it goes with.
+    2 - fix any <linkend>'s that were affected by 1.
+    3 - any <function> in the docs that has an actual funcdef,
+    will become an olink.
+
+    Signed-off-by: Matt Dew <marcoz@osource.org>
+
+commit 0f942e5f015cb3270e6f2e17c308bee894cb5fe3
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Sep 25 11:39:13 2011 -0700
+
+    Convert a bunch of sprintf calls to snprintf
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit eb9a8904fbef61a57ff01c90627ead57055ed62b
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Sep 25 11:18:26 2011 -0700
+
+    Add const attributes to fix gcc -Wwrite-strings warnings
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 4e610d4bbcf29cca9dc5dbad29ca820996aaa8c7
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Sep 25 10:59:45 2011 -0700
+
+    Fix warning: unused variable 'tmpport' with various configurations
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit a74c5d915c3095059356f83d1b845192e5c472c2
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Sep 25 10:57:00 2011 -0700
+
+    Add _X_UNUSED attributes to silence unused parameter warnings
+
+    Not all the transport variants use all the arguments to every function,
+    but as long as one transport type needs it, they all get the args passed.
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 64f765de138cb9b757df315469b3136d32222ea2
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sat Sep 24 00:04:40 2011 -0700
+
+    Mark __xtransname strings for debug messages as const char *
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit ea921932dae7049b231bead7f8f3f088d7beaf9e
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Sep 23 23:03:09 2011 -0700
+
+    Fix unused variable warnings
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit c1968d10f97d62ac05d698822c2688151f70a9eb
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Sep 23 22:59:11 2011 -0700
+
+    Fix warning: ISO C90 forbids mixed declarations and code
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 225c45b3accab56fab361104a3d14b80f6cec954
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Sep 23 22:57:56 2011 -0700
+
+    Fix printf format string warnings
+
+    Now that prmsg lets arguments types actually be checked, fix
+    the warnings found.
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit b1b69ce8e8e4fe0f190c8bd85b537309e71055c8
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Sep 23 22:35:03 2011 -0700
+
+    Convert PRMSG macro to prmsg inline function
+
+    Allows using varargs to have the correct number of arguments passed to
+    get rid of the many gcc warnings about variable printf format strings,
+    and to reduce the duplication from having 5 implementations of the
+    PRMSG macro depending on the debug options defined & output method used.
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit cbdb434033da1725a69014cc6e4d89c691a6fd95
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sat Sep 24 07:43:07 2011 -0700
+
+    Fix warnings about static functions declared but never defined
+
+    Add #define XTRANS_TRANSPORT_C to transport.c and check for it
+    before making static function declarations and other bits needed
+    only when compiling the Xtrans code itself, not from other sources
+    that include the Xtransint.h header for the struct definitions.
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit cf39d738086b0a7c668fb3720d64de8d711a1a97
+Author: Arvind Umrao <arvind.umrao@oracle.com>
+Date:   Tue Sep 20 22:56:52 2011 +0530
+
+    Removing SUN specific code, let solaris create .X11-pipe with sticky bit on
+
+    Alan told me, named pipe support was added around Solaris 2.6 when that was a much better performing transport than Unix sockets on the Solaris kernels of the time. By Solaris 10, Unix sockets had been reimplemented in the kernel to be faster, so they became the default again. In Solaris 11, we don't even have named pipe support in the libxcb library that implements X client connection code now, so the named pipes would only be accessed by code with a different libX11 or a statically linked libX11 from Solaris 2.6-9
+
+    Signed-off-by: Arvind Umrao <arvind.umrao@oracle.com>
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit a477713b89686480cf59a9c75c0aaeeba2386d0a
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Tue Sep 20 18:56:47 2011 -0400
+
+    specs: regroup <author> <editor> <othercredit> under authorgroup
+
+    Some elements are not displayed when outside authorgroup
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 1ad48fb9bc18d0c7a8fbec1d2cd232877e945047
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Tue Sep 20 15:47:09 2011 -0400
+
+    specs: refactor copyright legal text for multi licensing
+
+    we can use <copyright> markup for the first holder
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit bd93bf86fd914a9cc54e2bedec5b063e5a38b732
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Sep 19 10:58:40 2011 -0400
+
+    doc: support multi licensed copyright notice and license text
+
+    For documentation having multiple licenses, the copyright and legalnotice
+    elements sequence cannot instantiated multiple times.
+    The copyright notice and license text are therefore coded inside a
+    legalnotice element. The role attribute on the paragraph is used to allow
+    styling of the copyright notice text which should not be italicized.
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit eb9ec458b7fb5332f7ae7b8faf59443a9075ec60
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Sep 16 22:54:41 2011 -0700
+
+    Strip trailing whitespace
+
+    Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
+    git diff -w & git diff -b show no diffs from this change
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 36174eb06e805fa51c9c2e9e914fdfad4a99f50f
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Sep 14 15:29:19 2011 -0400
+
+    docs: fix authors affiliation
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 9b6c2473be2848ce0a4986ddaa59e5f5ef028bfc
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Sep 12 16:37:24 2011 -0400
+
+    docs: use the &fullrelvers; entity to set X11 release information
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit b5754cdf64f3396a5853413eda1943cf75ff3cbd
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Sep 11 19:49:54 2011 -0400
+
+    docs: remove <productnumber> which is not used by default
+
+    This element is not rendered by default on the title. A template
+    customization is required to display it.
+    X Window System does not have a product number.
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 20f338c548e5fcb16650a4e2c25c2008c1fdac36
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Sep 8 20:00:00 2011 -0400
+
+    docbook.am: embed css styles inside the HTML HEAD element
+
+    Rather than referring to the external xorg.css stylesheet, embed the content
+    of the file in the html output produced. This is accomplished by using
+    version 1.10 of xorg-xhtml.xsl.
+
+    This makes the whole html docs tree much more relocatable.
+    In addition, it eliminates xorg.css as a runtime file which makes
+    xorg-sgml-doctools a build time only package.
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 8eb827af1b57ec52be183cddaf32257968c02878
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Sep 7 10:31:04 2011 -0400
+
+    docbook.am: global maintenance update - entities, images and olinking
+
+    Adding support in libX11 for html chunking caused a reorg of docbook.am
+    as well as the xorg-sgml-doctools masterdb for olinking.
+    The parameter img.src.path is added for pdf images.
+    A searchpath to the root builddir is added for local entities, if present.
+
+    The docbook.am makefile hides all the details and is identical for
+    all 22 modules having DocBook documentation. It is included by a thin
+    Makefile.am which requires no docbook knowledge.
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit b710cdadc92fc212af361bee48f5af6333ec3e6d
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Jun 12 18:39:46 2011 -0400
+
+    Install xml versions of specs even if HAVE_XMLTO is false
+
+    DocBook/XML input source is also a usefull output format that can be viewed
+    with an XML viewer or editor and by some O/S help system.
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 78d1f7d29145567e11b985042e917a435bef95f9
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Jun 5 16:27:37 2011 -0400
+
+    Install target dbs alongside generated documents
+
+    This matches a change in xorg-sgml-docs whereby the masterdb will look for
+    the target dbs into the same location as the generated documents.
+
+    The target dbs are now installed alongside the generated documents.
+    Previously they are installed in $prefix/sgml/X11/dbs alongside masterdb which
+    has the potential of installing outside the package prefix and cause
+    distcheck to fail when user does not have write permission in this package.
+
+    Requires XORG_CHECK_SGML_DOCTOOLS(1.8) which was released 2011-06-11
+
+commit e05d7abbcf880099058b699ac52f65edcac95582
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Sun Apr 24 19:39:26 2011 -0700
+
+    Silence warnings when building with clang
+
+    /usr/X11/include/X11/Xtrans/Xtransint.h:349:12: error: unused function 'is_numeric' [-Werror,-Wunused-function]
+    static int is_numeric (
+              ^
+    /usr/X11/include/X11/Xtrans/Xtransint.h:354:12: error: unused function 'trans_mkdir' [-Werror,-Wunused-function]
+    static int trans_mkdir (
+              ^
+
+    In file included from /usr/X11/include/X11/Xtrans/transport.c:67:
+    ...
+    fatal error: too many errors emitted, stopping now [-ferror-limit=]
+
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 27ae0ad1406a33919ea9f76034495bca7cccf051
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Feb 27 15:06:18 2011 -0500
+
+    Documentation: add Docbook external references support
+
+    When writing technical documentation, it is often necessary to cross
+    reference to other information. When that other information is not in the
+    current document, additional support is needed, namely <olink>.
+
+    A new feature with version 1.7 of xorg-sgml-doctools adds references to
+    other documents within or outside this package.
+
+    This patch adds technical support for this feature but does not change
+    the content of the documentation as seen by the end user.
+
+    Each book or article must generate a database containing the href
+    of sections that can be referred to from another document. This database
+    is installed in DATAROOTDIR/sgml/X11/dbs. There is a requirement that
+    the value of DATAROOTDIR for xorg-sgml-doctools and for the package
+    documentation is the same. This forms a virtual document tree.
+
+    This database is consulted by other documents while they are being generated
+    in order to fulfill the missing information for linking.
+    Refer to the xorg-sgml-doctools for further technical information.
+
+    Co-authored-by: Matt Dew <marcoz@osource.org>
+
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit cc199c31465b258032bdb9083879699202db7ee9
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Mon Feb 21 12:44:06 2011 -0500
+
+    Remove a decnet leftover
+
+    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 91620213d2bd75fe322df06c5b6f55b85a10e55a
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Tue Mar 15 15:47:08 2011 -0400
+
+    Remove K&R token pasting macros
+
+    Reviewed-by: Julien Cristau <jcristau@debian.org>
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 4ac40cd5451983e6f62527700cdf9e2f8a29c013
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Tue Mar 15 15:45:56 2011 -0400
+
+    Don't special-case allocation for the X server
+
+    xserver uses malloc/free directly now, don't route through the Xalloc
+    wrappers.
+
+    Reviewed-by: Julien Cristau <jcristau@debian.org>
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 638caa2053330038c5ba5a5682ff02be6aa0faa6
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Feb 2 11:43:46 2011 -0500
+
+    config: comment, minor upgrade, quote and layout configure.ac
+
+    Group statements per section as per Autoconf standard layout
+    Quote statements where appropriate.
+    Autoconf recommends not using dnl instead of # for comments
+
+    Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters.
+    Add AC_CONFIG_SRCDIR([Makefile.am])
+
+    This helps automated maintenance and release activities.
+    Details can be found in http://wiki.x.org/wiki/NewModuleGuidelines
+
+commit a26753b7b20cd5cadc1e7fa007cec063f39a49e8
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Thu Dec 16 23:59:20 2010 -0800
+
+    doc: Correct column count in transport configuration table
+
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
 commit 59f57d1a19d4091fef115b9eafa139bf620332cb
 Author: Alan Coopersmith <alan.coopersmith@oracle.com>
 Date:   Mon Nov 8 16:33:45 2010 -0800
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..c9fd2c0
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,290 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
old mode 100755 (executable)
new mode 100644 (file)
index 7ce7cbf..9ff1723
@@ -14,7 +14,7 @@ Xtransinclude_HEADERS = \
 aclocaldir = $(datadir)/aclocal
 aclocal_DATA = xtrans.m4
 
-pkgconfigdir = $(libdir)/pkgconfig
+pkgconfigdir = $(datadir)/pkgconfig
 pkgconfig_DATA = xtrans.pc
 
 MAINTAINERCLEANFILES = ChangeLog INSTALL
diff --git a/NEWS b/NEWS
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/README b/README
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index f59bd61..54e3bdc
--- a/Xtrans.c
+++ b/Xtrans.c
@@ -132,31 +132,31 @@ void
 TRANS(FreeConnInfo) (XtransConnInfo ciptr)
 
 {
-    PRMSG (3,"FreeConnInfo(%p)\n", ciptr, 0, 0);
+    prmsg (3,"FreeConnInfo(%p)\n", ciptr);
 
     if (ciptr->addr)
-       xfree (ciptr->addr);
+       free (ciptr->addr);
 
     if (ciptr->peeraddr)
-       xfree (ciptr->peeraddr);
+       free (ciptr->peeraddr);
 
     if (ciptr->port)
-       xfree (ciptr->port);
+       free (ciptr->port);
 
-    xfree ((char *) ciptr);
+    free (ciptr);
 }
 
 
 #define PROTOBUFSIZE   20
 
 static Xtransport *
-TRANS(SelectTransport) (char *protocol)
+TRANS(SelectTransport) (const char *protocol)
 
 {
     char       protobuf[PROTOBUFSIZE];
     int                i;
 
-    PRMSG (3,"SelectTransport(%s)\n", protocol, 0, 0);
+    prmsg (3,"SelectTransport(%s)\n", protocol);
 
     /*
      * Force Protocol to be lowercase as a way of doing
@@ -203,19 +203,19 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
      */
 
     char       *mybuf, *tmpptr;
-    char       *_protocol, *_host, *_port;
+    const char *_protocol;
+    char       *_host, *_port;
     char       hostnamebuf[256];
     int                _host_len;
 
-    PRMSG (3,"ParseAddress(%s)\n", address, 0, 0);
+    prmsg (3,"ParseAddress(%s)\n", address);
 
     /* Copy the string so it can be changed */
 
-    tmpptr = mybuf = (char *) xalloc (strlen (address) + 1);
-    strcpy (mybuf, address);
+    tmpptr = mybuf = strdup (address);
 
     /* Parse the string to get each component */
-    
+
     /* Get the protocol part */
 
     _protocol = mybuf;
@@ -228,7 +228,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
        *protocol = NULL;
        *host = NULL;
        *port = NULL;
-       xfree (tmpptr);
+       free (tmpptr);
        return 0;
     }
 
@@ -278,26 +278,10 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
        *protocol = NULL;
        *host = NULL;
        *port = NULL;
-       xfree (tmpptr);
+       free (tmpptr);
        return 0;
     }
 
-    /* Check for DECnet */
-
-    if ((mybuf != _host) && (*(mybuf - 1) == ':')
-#if defined(IPv6) && defined(AF_INET6)
-      /* An IPv6 address can end in :: so three : in a row is assumed to be
-        an IPv6 host and not a DECnet node with a : in it's name, unless
-         DECnet is specifically requested */
-      && ( ((mybuf - 1) == _host) || (*(mybuf - 2) != ':') ||
-       ((_protocol != NULL) && (strcmp(_protocol, "dnet") == 0)) )
-#endif
-       )
-    {
-       _protocol = "dnet";
-       *(mybuf - 1) = '\0';
-    }
-
     *mybuf ++= '\0';
 
     _host_len = strlen(_host);
@@ -308,9 +292,9 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
     }
 #if defined(IPv6) && defined(AF_INET6)
     /* hostname in IPv6 [numeric_addr]:0 form? */
-    else if ( (_host_len > 3) && 
+    else if ( (_host_len > 3) &&
       ((strcmp(_protocol, "tcp") == 0) || (strcmp(_protocol, "inet6") == 0))
-      && (*_host == '[') && (*(_host + _host_len - 1) == ']') ) { 
+      && (*_host == '[') && (*(_host + _host_len - 1) == ']') ) {
        struct sockaddr_in6 sin6;
 
        *(_host + _host_len - 1) = '\0';
@@ -361,46 +345,40 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
      * string space for them.
      */
 
-    if ((*protocol = (char *) xalloc(strlen (_protocol) + 1)) == NULL)
+    if ((*protocol = strdup (_protocol)) == NULL)
     {
        /* Malloc failed */
        *port = NULL;
        *host = NULL;
        *protocol = NULL;
-       xfree (tmpptr);
+       free (tmpptr);
        return 0;
     }
-    else
-        strcpy (*protocol, _protocol);
 
-    if ((*host = (char *) xalloc (strlen (_host) + 1)) == NULL)
+    if ((*host = strdup (_host)) == NULL)
     {
        /* Malloc failed */
        *port = NULL;
        *host = NULL;
-       xfree (*protocol);
+       free (*protocol);
        *protocol = NULL;
-       xfree (tmpptr);
+       free (tmpptr);
        return 0;
-       }
-    else
-        strcpy (*host, _host);
+    }
 
-    if ((*port = (char *) xalloc (strlen (_port) + 1)) == NULL)
+    if ((*port = strdup (_port)) == NULL)
     {
        /* Malloc failed */
        *port = NULL;
-       xfree (*host);
+       free (*host);
        *host = NULL;
-       xfree (*protocol);
+       free (*protocol);
        *protocol = NULL;
-       xfree (tmpptr);
+       free (tmpptr);
        return 0;
     }
-    else
-        strcpy (*port, _port);
 
-    xfree (tmpptr);
+    free (tmpptr);
 
     return 1;
 }
@@ -420,12 +398,12 @@ TRANS(Open) (int type, char *address)
     XtransConnInfo     ciptr = NULL;
     Xtransport         *thistrans;
 
-    PRMSG (2,"Open(%d,%s)\n", type, address, 0);
+    prmsg (2,"Open(%d,%s)\n", type, address);
 
-#if defined(WIN32) && defined(TCPCONN) 
+#if defined(WIN32) && defined(TCPCONN)
     if (TRANS(WSAStartup)())
     {
-       PRMSG (1,"Open: WSAStartup failed\n", 0, 0, 0);
+       prmsg (1,"Open: WSAStartup failed\n");
        return NULL;
     }
 #endif
@@ -434,7 +412,7 @@ TRANS(Open) (int type, char *address)
 
     if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0)
     {
-       PRMSG (1,"Open: Unable to Parse address %s\n", address, 0, 0);
+       prmsg (1,"Open: Unable to Parse address %s\n", address);
        return NULL;
     }
 
@@ -442,12 +420,12 @@ TRANS(Open) (int type, char *address)
 
     if ((thistrans = TRANS(SelectTransport) (protocol)) == NULL)
     {
-       PRMSG (1,"Open: Unable to find transport for %s\n",
-              protocol, 0, 0);
+       prmsg (1,"Open: Unable to find transport for %s\n",
+              protocol);
 
-       xfree (protocol);
-       xfree (host);
-       xfree (port);
+       free (protocol);
+       free (host);
+       free (port);
        return NULL;
     }
 
@@ -476,27 +454,27 @@ TRANS(Open) (int type, char *address)
 #endif /* TRANS_SERVER */
        break;
     default:
-       PRMSG (1,"Open: Unknown Open type %d\n", type, 0, 0);
+       prmsg (1,"Open: Unknown Open type %d\n", type);
     }
 
     if (ciptr == NULL)
     {
-       if (!(thistrans->flags & TRANS_DISABLED)) 
+       if (!(thistrans->flags & TRANS_DISABLED))
        {
-           PRMSG (1,"Open: transport open failed for %s/%s:%s\n",
+           prmsg (1,"Open: transport open failed for %s/%s:%s\n",
                   protocol, host, port);
        }
-       xfree (protocol);
-       xfree (host);
-       xfree (port);
+       free (protocol);
+       free (host);
+       free (port);
        return NULL;
     }
 
     ciptr->transptr = thistrans;
     ciptr->port = port;                        /* We need this for TRANS(Reopen) */
 
-    xfree (protocol);
-    xfree (host);
+    free (protocol);
+    free (host);
 
     return ciptr;
 }
@@ -519,7 +497,7 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
     char               *save_port;
     int                        i;
 
-    PRMSG (2,"Reopen(%d,%d,%s)\n", trans_id, fd, port);
+    prmsg (2,"Reopen(%d,%d,%s)\n", trans_id, fd, port);
 
     /* Determine the transport type */
 
@@ -532,21 +510,19 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
 
     if (thistrans == NULL)
     {
-       PRMSG (1,"Reopen: Unable to find transport id %d\n",
-              trans_id, 0, 0);
+       prmsg (1,"Reopen: Unable to find transport id %d\n",
+              trans_id);
 
        return NULL;
     }
 
-    if ((save_port = (char *) xalloc (strlen (port) + 1)) == NULL)
+    if ((save_port = strdup (port)) == NULL)
     {
-       PRMSG (1,"Reopen: Unable to malloc port string\n", 0, 0, 0);
+       prmsg (1,"Reopen: Unable to malloc port string\n");
 
        return NULL;
     }
 
-    strcpy (save_port, port);
-
     /* Get a new XtransConnInfo object */
 
     switch (type)
@@ -558,12 +534,13 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
        ciptr = thistrans->ReopenCLTSServer(thistrans, fd, port);
        break;
     default:
-       PRMSG (1,"Reopen: Bad Open type %d\n", type, 0, 0);
+       prmsg (1,"Reopen: Bad Open type %d\n", type);
     }
 
     if (ciptr == NULL)
     {
-       PRMSG (1,"Reopen: transport open failed\n", 0, 0, 0);
+       prmsg (1,"Reopen: transport open failed\n");
+       free (save_port);
        return NULL;
     }
 
@@ -589,7 +566,7 @@ XtransConnInfo
 TRANS(OpenCOTSClient) (char *address)
 
 {
-    PRMSG (2,"OpenCOTSClient(%s)\n", address, 0, 0);
+    prmsg (2,"OpenCOTSClient(%s)\n", address);
     return TRANS(Open) (XTRANS_OPEN_COTS_CLIENT, address);
 }
 
@@ -602,7 +579,7 @@ XtransConnInfo
 TRANS(OpenCOTSServer) (char *address)
 
 {
-    PRMSG (2,"OpenCOTSServer(%s)\n", address, 0, 0);
+    prmsg (2,"OpenCOTSServer(%s)\n", address);
     return TRANS(Open) (XTRANS_OPEN_COTS_SERVER, address);
 }
 
@@ -615,7 +592,7 @@ XtransConnInfo
 TRANS(OpenCLTSClient) (char *address)
 
 {
-    PRMSG (2,"OpenCLTSClient(%s)\n", address, 0, 0);
+    prmsg (2,"OpenCLTSClient(%s)\n", address);
     return TRANS(Open) (XTRANS_OPEN_CLTS_CLIENT, address);
 }
 
@@ -628,7 +605,7 @@ XtransConnInfo
 TRANS(OpenCLTSServer) (char *address)
 
 {
-    PRMSG (2,"OpenCLTSServer(%s)\n", address, 0, 0);
+    prmsg (2,"OpenCLTSServer(%s)\n", address);
     return TRANS(Open) (XTRANS_OPEN_CLTS_SERVER, address);
 }
 
@@ -641,7 +618,7 @@ XtransConnInfo
 TRANS(ReopenCOTSServer) (int trans_id, int fd, char *port)
 
 {
-    PRMSG (2,"ReopenCOTSServer(%d, %d, %s)\n", trans_id, fd, port);
+    prmsg (2,"ReopenCOTSServer(%d, %d, %s)\n", trans_id, fd, port);
     return TRANS(Reopen) (XTRANS_OPEN_COTS_SERVER, trans_id, fd, port);
 }
 
@@ -649,13 +626,13 @@ XtransConnInfo
 TRANS(ReopenCLTSServer) (int trans_id, int fd, char *port)
 
 {
-    PRMSG (2,"ReopenCLTSServer(%d, %d, %s)\n", trans_id, fd, port);
+    prmsg (2,"ReopenCLTSServer(%d, %d, %s)\n", trans_id, fd, port);
     return TRANS(Reopen) (XTRANS_OPEN_CLTS_SERVER, trans_id, fd, port);
 }
 
 
 int
-TRANS(GetReopenInfo) (XtransConnInfo ciptr, 
+TRANS(GetReopenInfo) (XtransConnInfo ciptr,
                      int *trans_id, int *fd, char **port)
 
 {
@@ -667,13 +644,10 @@ TRANS(GetReopenInfo) (XtransConnInfo ciptr,
            *trans_id = Xtransports[i].transport_id;
            *fd = ciptr->fd;
 
-           if ((*port = (char *) xalloc (strlen (ciptr->port) + 1)) == NULL)
+           if ((*port = strdup (ciptr->port)) == NULL)
                return 0;
            else
-           {
-               strcpy (*port, ciptr->port);
                return 1;
-           }
        }
 
     return 0;
@@ -689,7 +663,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
     int        fd = ciptr->fd;
     int        ret = 0;
 
-    PRMSG (2,"SetOption(%d,%d,%d)\n", fd, option, arg);
+    prmsg (2,"SetOption(%d,%d,%d)\n", fd, option, arg);
 
     /*
      * For now, all transport type use the same stuff for setting options.
@@ -711,7 +685,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
            break;
        case 1: /* Set to non-blocking mode */
 
-#if defined(O_NONBLOCK) && !defined(SCO325) 
+#if defined(O_NONBLOCK) && !defined(SCO325)
            ret = fcntl (fd, F_GETFL, 0);
            if (ret != -1)
                ret = fcntl (fd, F_SETFL, ret | O_NONBLOCK);
@@ -723,7 +697,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
            ret = ioctl (fd, FIOSNBIO, &arg);
        }
 #else
-#if defined(WIN32) 
+#if defined(WIN32)
        {
 #ifdef WIN32
            u_long arg;
@@ -761,7 +735,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
 #endif /* F_SETFD */
        break;
     }
-    
+
     return ret;
 }
 
@@ -775,16 +749,16 @@ TRANS(CreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
 }
 
 int
-TRANS(NoListen) (char * protocol)
-       
+TRANS(NoListen) (const char * protocol)
+
 {
    Xtransport *trans;
    int i = 0, ret = 0;
-   
-   if ((trans = TRANS(SelectTransport)(protocol)) == NULL) 
+
+   if ((trans = TRANS(SelectTransport)(protocol)) == NULL)
    {
-       PRMSG (1,"TransNoListen: unable to find transport: %s\n", 
-              protocol, 0, 0);
+       prmsg (1,"TransNoListen: unable to find transport: %s\n",
+              protocol);
 
        return -1;
    }
@@ -817,7 +791,7 @@ TRANS(Accept) (XtransConnInfo ciptr, int *status)
 {
     XtransConnInfo     newciptr;
 
-    PRMSG (2,"Accept(%d)\n", ciptr->fd, 0, 0);
+    prmsg (2,"Accept(%d)\n", ciptr->fd);
 
     newciptr = ciptr->transptr->Accept (ciptr, status);
 
@@ -841,12 +815,12 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address)
     char       *port;
     int                ret;
 
-    PRMSG (2,"Connect(%d,%s)\n", ciptr->fd, address, 0);
+    prmsg (2,"Connect(%d,%s)\n", ciptr->fd, address);
 
     if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0)
     {
-       PRMSG (1,"Connect: Unable to Parse address %s\n",
-              address, 0, 0);
+       prmsg (1,"Connect: Unable to Parse address %s\n",
+              address);
        return -1;
     }
 
@@ -856,19 +830,19 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address)
 
     if (!port || !*port)
     {
-       PRMSG (1,"Connect: Missing port specification in %s\n",
-             address, 0, 0);
-       if (protocol) xfree (protocol);
-       if (host) xfree (host);
+       prmsg (1,"Connect: Missing port specification in %s\n",
+             address);
+       if (protocol) free (protocol);
+       if (host) free (host);
        return -1;
     }
 
     ret = ciptr->transptr->Connect (ciptr, host, port);
 
-    if (protocol) xfree (protocol);
-    if (host) xfree (host);
-    if (port) xfree (port);
-    
+    if (protocol) free (protocol);
+    if (host) free (host);
+    if (port) free (port);
+
     return ret;
 }
 
@@ -923,7 +897,7 @@ TRANS(Close) (XtransConnInfo ciptr)
 {
     int ret;
 
-    PRMSG (2,"Close(%d)\n", ciptr->fd, 0, 0);
+    prmsg (2,"Close(%d)\n", ciptr->fd);
 
     ret = ciptr->transptr->Close (ciptr);
 
@@ -938,7 +912,7 @@ TRANS(CloseForCloning) (XtransConnInfo ciptr)
 {
     int ret;
 
-    PRMSG (2,"CloseForCloning(%d)\n", ciptr->fd, 0, 0);
+    prmsg (2,"CloseForCloning(%d)\n", ciptr->fd);
 
     ret = ciptr->transptr->CloseForCloning (ciptr);
 
@@ -956,18 +930,18 @@ TRANS(IsLocal) (XtransConnInfo ciptr)
 
 
 int
-TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, 
+TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
                  Xtransaddr **addrp)
 
 {
-    PRMSG (2,"GetMyAddr(%d)\n", ciptr->fd, 0, 0);
+    prmsg (2,"GetMyAddr(%d)\n", ciptr->fd);
 
     *familyp = ciptr->family;
     *addrlenp = ciptr->addrlen;
 
-    if ((*addrp = (Xtransaddr *) xalloc (ciptr->addrlen)) == NULL)
+    if ((*addrp = malloc (ciptr->addrlen)) == NULL)
     {
-       PRMSG (1,"GetMyAddr: malloc failed\n", 0, 0, 0);
+       prmsg (1,"GetMyAddr: malloc failed\n");
        return -1;
     }
     memcpy(*addrp, ciptr->addr, ciptr->addrlen);
@@ -976,18 +950,18 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
 }
 
 int
-TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, 
+TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
                    Xtransaddr **addrp)
 
 {
-    PRMSG (2,"GetPeerAddr(%d)\n", ciptr->fd, 0, 0);
+    prmsg (2,"GetPeerAddr(%d)\n", ciptr->fd);
 
     *familyp = ciptr->family;
     *addrlenp = ciptr->peeraddrlen;
 
-    if ((*addrp = (Xtransaddr *) xalloc (ciptr->peeraddrlen)) == NULL)
+    if ((*addrp = malloc (ciptr->peeraddrlen)) == NULL)
     {
-       PRMSG (1,"GetPeerAddr: malloc failed\n", 0, 0, 0);
+       prmsg (1,"GetPeerAddr: malloc failed\n");
        return -1;
     }
     memcpy(*addrp, ciptr->peeraddr, ciptr->peeraddrlen);
@@ -1045,7 +1019,7 @@ extern int xquartz_launchd_fd;
 #endif
 
 int
-TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret, 
+TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
                                   XtransConnInfo **ciptrs_ret)
 
 {
@@ -1056,8 +1030,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
 #if defined(IPv6) && defined(AF_INET6)
     int                ipv6_succ = 0;
 #endif
-    PRMSG (2,"MakeAllCOTSServerListeners(%s,%p)\n",
-          port ? port : "NULL", ciptrs_ret, 0);
+    prmsg (2,"MakeAllCOTSServerListeners(%s,%p)\n",
+          port ? port : "NULL", ciptrs_ret);
 
     *count_ret = 0;
 
@@ -1067,7 +1041,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
         if((ciptr = TRANS(ReopenCOTSServer(TRANS_SOCKET_LOCAL_INDEX,
                                            xquartz_launchd_fd, getenv("DISPLAY"))))==NULL)
             fprintf(stderr,"Got NULL while trying to Reopen launchd port\n");
-        else 
+        else
             temp_ciptrs[(*count_ret)++] = ciptr;
     }
 #endif
@@ -1083,17 +1057,17 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
        snprintf(buffer, sizeof(buffer), "%s/:%s",
                 trans->TransName, port ? port : "");
 
-       PRMSG (5,"MakeAllCOTSServerListeners: opening %s\n",
-              buffer, 0, 0);
+       prmsg (5,"MakeAllCOTSServerListeners: opening %s\n",
+              buffer);
 
        if ((ciptr = TRANS(OpenCOTSServer(buffer))) == NULL)
        {
            if (trans->flags & TRANS_DISABLED)
                continue;
 
-           PRMSG (1,
+           prmsg (1,
          "MakeAllCOTSServerListeners: failed to open listener for %s\n",
-                 trans->TransName, 0, 0);
+                 trans->TransName);
            continue;
        }
 #if defined(IPv6) && defined(AF_INET6)
@@ -1112,9 +1086,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
                 * running at this address, and this function should fail.
                 */
 
-               PRMSG (1,
-               "MakeAllCOTSServerListeners: server already running\n",
-                 0, 0, 0);
+               prmsg (1,
+               "MakeAllCOTSServerListeners: server already running\n");
 
                for (j = 0; j < *count_ret; j++)
                    TRANS(Close) (temp_ciptrs[j]);
@@ -1126,9 +1099,9 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
            }
            else
            {
-               PRMSG (1,
+               prmsg (1,
        "MakeAllCOTSServerListeners: failed to create listener for %s\n",
-                 trans->TransName, 0, 0);
+                 trans->TransName);
 
                continue;
            }
@@ -1138,10 +1111,10 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
        if (Xtransports[i].transport_id == TRANS_SOCKET_INET6_INDEX)
            ipv6_succ = 1;
 #endif
-       
-       PRMSG (5,
+
+       prmsg (5,
              "MakeAllCOTSServerListeners: opened listener for %s, %d\n",
-             trans->TransName, ciptr->fd, 0);
+             trans->TransName, ciptr->fd);
 
        temp_ciptrs[*count_ret] = ciptr;
        (*count_ret)++;
@@ -1149,13 +1122,13 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
 
     *partial = (*count_ret < complete_network_count());
 
-    PRMSG (5,
+    prmsg (5,
      "MakeAllCOTSServerListeners: partial=%d, actual=%d, complete=%d \n",
        *partial, *count_ret, complete_network_count());
 
     if (*count_ret > 0)
     {
-       if ((*ciptrs_ret = (XtransConnInfo *) xalloc (
+       if ((*ciptrs_ret = malloc (
            *count_ret * sizeof (XtransConnInfo))) == NULL)
        {
            return -1;
@@ -1168,12 +1141,12 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
     }
     else
        *ciptrs_ret = NULL;
+
     return 0;
 }
 
 int
-TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret, 
+TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
                                   XtransConnInfo **ciptrs_ret)
 
 {
@@ -1181,8 +1154,8 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
     XtransConnInfo     ciptr, temp_ciptrs[NUMTRANS];
     int                        status, i, j;
 
-    PRMSG (2,"MakeAllCLTSServerListeners(%s,%p)\n",
-       port ? port : "NULL", ciptrs_ret, 0);
+    prmsg (2,"MakeAllCLTSServerListeners(%s,%p)\n",
+       port ? port : "NULL", ciptrs_ret);
 
     *count_ret = 0;
 
@@ -1196,14 +1169,14 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
        snprintf(buffer, sizeof(buffer), "%s/:%s",
                 trans->TransName, port ? port : "");
 
-       PRMSG (5,"MakeAllCLTSServerListeners: opening %s\n",
-           buffer, 0, 0);
+       prmsg (5,"MakeAllCLTSServerListeners: opening %s\n",
+           buffer);
 
        if ((ciptr = TRANS(OpenCLTSServer (buffer))) == NULL)
        {
-           PRMSG (1,
+           prmsg (1,
        "MakeAllCLTSServerListeners: failed to open listener for %s\n",
-                 trans->TransName, 0, 0);
+                 trans->TransName);
            continue;
        }
 
@@ -1217,9 +1190,8 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
                 * running at this address, and this function should fail.
                 */
 
-               PRMSG (1,
-               "MakeAllCLTSServerListeners: server already running\n",
-                 0, 0, 0);
+               prmsg (1,
+               "MakeAllCLTSServerListeners: server already running\n");
 
                for (j = 0; j < *count_ret; j++)
                    TRANS(Close) (temp_ciptrs[j]);
@@ -1231,30 +1203,30 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
            }
            else
            {
-               PRMSG (1,
+               prmsg (1,
        "MakeAllCLTSServerListeners: failed to create listener for %s\n",
-                 trans->TransName, 0, 0);
+                 trans->TransName);
 
                continue;
            }
        }
 
-       PRMSG (5,
+       prmsg (5,
        "MakeAllCLTSServerListeners: opened listener for %s, %d\n",
-             trans->TransName, ciptr->fd, 0);
+             trans->TransName, ciptr->fd);
        temp_ciptrs[*count_ret] = ciptr;
        (*count_ret)++;
     }
 
     *partial = (*count_ret < complete_network_count());
 
-    PRMSG (5,
+    prmsg (5,
      "MakeAllCLTSServerListeners: partial=%d, actual=%d, complete=%d \n",
        *partial, *count_ret, complete_network_count());
 
     if (*count_ret > 0)
     {
-       if ((*ciptrs_ret = (XtransConnInfo *) xalloc (
+       if ((*ciptrs_ret = malloc (
            *count_ret * sizeof (XtransConnInfo))) == NULL)
        {
            return -1;
@@ -1267,7 +1239,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
     }
     else
        *ciptrs_ret = NULL;
-    
+
     return 0;
 }
 
@@ -1281,7 +1253,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
  */
 
 
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) 
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
 
 /*
  * emulate readv
@@ -1313,7 +1285,7 @@ static int TRANS(ReadV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt)
 
 #endif /* SYSV && __i386__ || WIN32 || __sxg__ */
 
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) 
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
 
 /*
  * emulate writev
index cb83196..2945b2a 100644 (file)
--- a/Xtrans.h
+++ b/Xtrans.h
@@ -57,112 +57,84 @@ from The Open Group.
 #include <sys/socket.h>
 #endif
 
+#ifdef __clang__
+/* Not all clients make use of all provided statics */
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
 
 /*
  * Set the functions names according to where this code is being compiled.
  */
 
 #ifdef X11_t
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define TRANS(func) _X11Trans##func
-#else
-#define TRANS(func) _X11Trans/**/func
-#endif
 #ifdef XTRANSDEBUG
-static char* __xtransname = "_X11Trans";
+static const char *__xtransname = "_X11Trans";
 #endif
 #endif /* X11_t */
 
 #ifdef XSERV_t
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define TRANS(func) _XSERVTrans##func
-#else
-#define TRANS(func) _XSERVTrans/**/func
-#endif
 #ifdef XTRANSDEBUG
-static char* __xtransname = "_XSERVTrans";
+static const char *__xtransname = "_XSERVTrans";
 #endif
 #define X11_t
 #endif /* XSERV_t */
 
 #ifdef XIM_t
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define TRANS(func) _XimXTrans##func
-#else
-#define TRANS(func) _XimXTrans/**/func
-#endif
 #ifdef XTRANSDEBUG
-static char* __xtransname = "_XimTrans";
+static const char *__xtransname = "_XimTrans";
 #endif
 #endif /* XIM_t */
 
 #ifdef FS_t
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define TRANS(func) _FSTrans##func
-#else
-#define TRANS(func) _FSTrans/**/func
-#endif
 #ifdef XTRANSDEBUG
-static char* __xtransname = "_FSTrans";
+static const char *__xtransname = "_FSTrans";
 #endif
 #endif /* FS_t */
 
 #ifdef FONT_t
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define TRANS(func) _FontTrans##func
-#else
-#define TRANS(func) _FontTrans/**/func
-#endif
 #ifdef XTRANSDEBUG
-static char* __xtransname = "_FontTrans";
+static const char *__xtransname = "_FontTrans";
 #endif
 #endif /* FONT_t */
 
 #ifdef ICE_t
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define TRANS(func) _IceTrans##func
-#else
-#define TRANS(func) _IceTrans/**/func
-#endif
 #ifdef XTRANSDEBUG
-static char* __xtransname = "_IceTrans";
+static const char *__xtransname = "_IceTrans";
 #endif
 #endif /* ICE_t */
 
 #ifdef TEST_t
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define TRANS(func) _TESTTrans##func
-#else
-#define TRANS(func) _TESTTrans/**/func
-#endif
 #ifdef XTRANSDEBUG
-static char* __xtransname = "_TESTTrans";
+static const char *__xtransname = "_TESTTrans";
 #endif
 #endif /* TEST_t */
 
 #ifdef LBXPROXY_t
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define TRANS(func) _LBXPROXYTrans##func
-#else
-#define TRANS(func) _LBXPROXYTrans/**/func
-#endif
 #define X11_t          /* The server defines this - so should the LBX proxy */
 #ifdef XTRANSDEBUG
-static char* __xtransname = "_LBXPROXYTrans";
+static const char *__xtransname = "_LBXPROXYTrans";
 #endif
 #endif /* LBXPROXY_t */
 
 #if !defined(TRANS)
-#if !defined(UNIXCPP) || defined(ANSICPP)
 #define TRANS(func) _XTrans##func
-#else
-#define TRANS(func) _XTrans/**/func
-#endif
 #ifdef XTRANSDEBUG
-static char* __xtransname = "_XTrans";
+static const char *__xtransname = "_XTrans";
 #endif
 #endif /* !TRANS */
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
 
 /*
  * Create a single address structure that can be used wherever
@@ -190,7 +162,7 @@ typedef long BytesReadable_t;
 #endif
 
 
-#if defined(WIN32) || defined(USG) 
+#if defined(WIN32) || defined(USG)
 
 /*
  *      TRANS(Readv) and TRANS(Writev) use struct iovec, normally found
@@ -332,7 +304,7 @@ int TRANS(CreateListener)(
 );
 
 int TRANS(NoListen) (
-    char*               /* protocol*/
+    const char*         /* protocol*/
 );
 
 int TRANS(ResetListener)(
@@ -465,13 +437,13 @@ TRANS(GetPeerNetworkId)(
 
 #endif /* ICE_t */
 
-int 
+int
 TRANS(GetHostname) (
     char *     /* buf */,
     int        /* maxlen */
 );
 
-#if defined(WIN32) && defined(TCPCONN) 
+#if defined(WIN32) && defined(TCPCONN)
 int TRANS(WSAStartup)();
 #endif
 
old mode 100755 (executable)
new mode 100644 (file)
index dd1f683..3bce8dc
@@ -51,10 +51,10 @@ from The Open Group.
 #define _XTRANSINT_H_
 
 /*
- * XTRANSDEBUG will enable the PRMSG() macros used in the X Transport 
- * Interface code. Each use of the PRMSG macro has a level associated with 
- * it. XTRANSDEBUG is defined to be a level. If the invocation level is =< 
- * the value of XTRANSDEBUG, then the message will be printed out to stderr. 
+ * XTRANSDEBUG will enable the PRMSG() macros used in the X Transport
+ * Interface code. Each use of the PRMSG macro has a level associated with
+ * it. XTRANSDEBUG is defined to be a level. If the invocation level is =<
+ * the value of XTRANSDEBUG, then the message will be printed out to stderr.
  * Recommended levels are:
  *
  *     XTRANSDEBUG=1   Error messages
@@ -68,7 +68,7 @@ from The Open Group.
  * message.
  */
 
-#ifndef XTRANSDEBUG
+#if !defined(XTRANSDEBUG) && defined(XTRANS_TRANSPORT_C)
 #  define XTRANSDEBUG 1
 #endif
 
@@ -78,6 +78,10 @@ from The Open Group.
 
 #include "Xtrans.h"
 
+#ifndef _X_UNUSED  /* Defined in Xfuncproto.h in xproto >= 7.0.22 */
+# define _X_UNUSED  /* */
+#endif
+
 #ifdef XTRANSDEBUG
 # include <stdio.h>
 #endif /* XTRANSDEBUG */
@@ -140,7 +144,7 @@ struct _XtransConnInfo {
 
 
 typedef struct _Xtransport {
-    char       *TransName;
+    const char *TransName;
     int                flags;
 
 #ifdef TRANS_CLIENT
@@ -155,7 +159,7 @@ typedef struct _Xtransport {
 #endif /* TRANS_CLIENT */
 
 #ifdef TRANS_SERVER
-    char **    nolisten;
+    const char **      nolisten;
     XtransConnInfo (*OpenCOTSServer)(
        struct _Xtransport *,   /* transport */
        char *,                 /* protocol */
@@ -307,12 +311,21 @@ typedef struct _Xtransport_table {
 /* Flags to preserve when setting others */
 #define TRANS_KEEPFLAGS        (TRANS_NOUNLINK|TRANS_ABSTRACT)
 
+#ifdef XTRANS_TRANSPORT_C /* only provide static function prototypes when
+                            building the transport.c file that has them in */
+
+#ifdef __clang__
+/* Not all clients make use of all provided statics */
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
 /*
  * readv() and writev() don't exist or don't work correctly on some
  * systems, so they may be emulated.
  */
 
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) 
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
 
 #define READV(ciptr, iov, iovcnt)      TRANS(ReadV)(ciptr, iov, iovcnt)
 
@@ -329,7 +342,7 @@ static      int TRANS(ReadV)(
 #endif /* CRAY || (SYSV && __i386__) || WIN32 || __sxg__ || */
 
 
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) 
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
 
 #define WRITEV(ciptr, iov, iovcnt)     TRANS(WriteV)(ciptr, iov, iovcnt)
 
@@ -357,58 +370,70 @@ static int trans_mkdir (
 );
 #endif
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 /*
  * Some XTRANSDEBUG stuff
  */
 
-#if defined(XTRANSDEBUG)
-/* add hack to the format string to avoid warnings about extra arguments
- * to fprintf.
+#ifdef XTRANSDEBUG
+#include <stdarg.h>
+
+/*
+ * The X server provides ErrorF() & VErrorF(), for other software that uses
+ * xtrans, we provide our own simple versions.
  */
-#ifdef XTRANSDEBUGTIMESTAMP
-#if defined(XSERV_t) && defined(TRANS_SERVER)
-/* Use ErrorF() for the X server */
-#define PRMSG(lvl,x,a,b,c)     if (lvl <= XTRANSDEBUG){ \
-                       int hack= 0, saveerrno=errno; \
-                        struct timeval tp;\
-                        gettimeofday(&tp,0); \
-                       ErrorF("%s",__xtransname);      \
-                       ErrorF(x+hack,a,b,c); \
-                        ErrorF("timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \
-                       errno=saveerrno; \
-                       } else ((void)0)
-#else
-#define PRMSG(lvl,x,a,b,c)     if (lvl <= XTRANSDEBUG){ \
-                       int hack= 0, saveerrno=errno; \
-                        struct timeval tp;\
-                        gettimeofday(&tp,0); \
-                       fprintf(stderr, "%s", __xtransname); fflush(stderr); \
-                       fprintf(stderr, x+hack,a,b,c); fflush(stderr); \
-                        fprintf(stderr, "timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \
-                        fflush(stderr); \
-                       errno=saveerrno; \
-                       } else ((void)0)
-#endif /* XSERV_t && TRANS_SERVER */
-#else /* XTRANSDEBUGTIMESTAMP */
-#if defined(XSERV_t) && defined(TRANS_SERVER)
-/* Use ErrorF() for the X server */
-#define PRMSG(lvl,x,a,b,c)     if (lvl <= XTRANSDEBUG){ \
-                       int hack= 0, saveerrno=errno; \
-                       ErrorF("%s",__xtransname);    \
-                       ErrorF(x+hack,a,b,c); \
-                       errno=saveerrno; \
-                       } else ((void)0)
-#else
-#define PRMSG(lvl,x,a,b,c)     if (lvl <= XTRANSDEBUG){ \
-                       int hack= 0, saveerrno=errno; \
-                       fprintf(stderr, "%s", __xtransname); fflush(stderr); \
-                       fprintf(stderr, x+hack,a,b,c); fflush(stderr); \
-                       errno=saveerrno; \
-                       } else ((void)0)
-#endif /* XSERV_t && TRANS_SERVER */
-#endif /* XTRANSDEBUGTIMESTAMP */
-#else
-#define PRMSG(lvl,x,a,b,c)     ((void)0)
+# if defined(XSERV_t) && defined(TRANS_SERVER)
+#  include "os.h"
+# else
+static inline void _X_ATTRIBUTE_PRINTF(1, 0)
+VErrorF(const char *f, va_list args)
+{
+    vfprintf(stderr, f, args);
+    fflush(stderr);
+}
+
+static inline void  _X_ATTRIBUTE_PRINTF(1, 2)
+ErrorF(const char *f, ...)
+{
+    va_list args;
+
+    va_start(args, f);
+    VErrorF(f, args);
+    va_end(args);
+}
+# endif /* xserver */
 #endif /* XTRANSDEBUG */
 
+static inline void  _X_ATTRIBUTE_PRINTF(2, 3)
+prmsg(int lvl, const char *f, ...)
+{
+#ifdef XTRANSDEBUG
+    va_list args;
+
+    va_start(args, f);
+    if (lvl <= XTRANSDEBUG) {
+       int saveerrno = errno;
+
+       ErrorF("%s", __xtransname);
+       VErrorF(f, args);
+
+# ifdef XTRANSDEBUGTIMESTAMP
+       {
+           struct timeval tp;
+           gettimeofday(&tp, 0);
+           ErrorF("timestamp (ms): %d\n",
+                  tp.tv_sec * 1000 + tp.tv_usec / 1000);
+       }
+# endif
+       errno = saveerrno;
+    }
+    va_end(args);
+#endif /* XTRANSDEBUG */
+}
+
+#endif /* XTRANS_TRANSPORT_C */
+
 #endif /* _XTRANSINT_H_ */
old mode 100755 (executable)
new mode 100644 (file)
index ca04e7f..5beef7c
@@ -49,7 +49,7 @@ from The Open Group.
 
 /*
  *
- * The connection code/ideas in lib/X and server/os for SVR4/Intel 
+ * The connection code/ideas in lib/X and server/os for SVR4/Intel
  * environments was contributed by the following companies/groups:
  *
  *     MetroLink Inc
@@ -61,12 +61,12 @@ from The Open Group.
  *
  * The goal is to have common connection code among all SVR4/Intel vendors.
  *
- * ALL THE ABOVE COMPANIES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, 
- * IN NO EVENT SHALL THESE COMPANIES * BE LIABLE FOR ANY SPECIAL, INDIRECT 
- * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 
- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE 
+ * ALL THE ABOVE COMPANIES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+ * IN NO EVENT SHALL THESE COMPANIES * BE LIABLE FOR ANY SPECIAL, INDIRECT
+ * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  * OR PERFORMANCE OF THIS SOFTWARE.
  */
 
@@ -123,7 +123,7 @@ static int TRANS(LocalClose)(XtransConnInfo ciptr);
 /* Type Not Supported */
 
 static int
-TRANS(OpenFail)(XtransConnInfo ciptr, char *port)
+TRANS(OpenFail)(XtransConnInfo ciptr _X_UNUSED, char *port _X_UNUSED)
 
 {
     return -1;
@@ -132,7 +132,7 @@ TRANS(OpenFail)(XtransConnInfo ciptr, char *port)
 #ifdef TRANS_REOPEN
 
 static int
-TRANS(ReopenFail)(XtransConnInfo ciptr, int fd, char *port)
+TRANS(ReopenFail)(XtransConnInfo ciptr _X_UNUSED, int fd _X_UNUSED, char *port _X_UNUSED)
 
 {
     return 0;
@@ -152,21 +152,21 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
     ciptr->family = AF_UNIX;
     ciptr->addrlen = sizeof (struct sockaddr_un);
 
-    if ((sunaddr = (struct sockaddr_un *) xalloc (ciptr->addrlen)) == NULL)
+    if ((sunaddr = malloc (ciptr->addrlen)) == NULL)
     {
-       PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n", 0, 0, 0);
+       prmsg(1,"FillAddrInfo: failed to allocate memory for addr\n");
        return 0;
     }
 
     sunaddr->sun_family = AF_UNIX;
 
     if (strlen(sun_path) > sizeof(sunaddr->sun_path) - 1) {
-       PRMSG(1, "FillAddrInfo: path too long\n", 0, 0, 0);
-       xfree((char *) sunaddr);
+       prmsg(1, "FillAddrInfo: path too long\n");
+       free((char *) sunaddr);
        return 0;
     }
     strcpy (sunaddr->sun_path, sun_path);
-#if defined(BSD44SOCKETS) 
+#if defined(BSD44SOCKETS)
     sunaddr->sun_len = strlen (sunaddr->sun_path);
 #endif
 
@@ -174,13 +174,11 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
 
     ciptr->peeraddrlen = sizeof (struct sockaddr_un);
 
-    if ((p_sunaddr = (struct sockaddr_un *) xalloc (
-       ciptr->peeraddrlen)) == NULL)
+    if ((p_sunaddr = malloc (ciptr->peeraddrlen)) == NULL)
     {
-       PRMSG(1,
-          "FillAddrInfo: failed to allocate memory for peer addr\n",
-                                                                       0,0,0);
-       xfree ((char *) sunaddr);
+       prmsg(1,
+          "FillAddrInfo: failed to allocate memory for peer addr\n");
+       free (sunaddr);
        ciptr->addr = NULL;
 
        return 0;
@@ -189,12 +187,12 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
     p_sunaddr->sun_family = AF_UNIX;
 
     if (strlen(peer_sun_path) > sizeof(p_sunaddr->sun_path) - 1) {
-       PRMSG(1, "FillAddrInfo: peer path too long\n", 0, 0, 0);
-       xfree((char *) p_sunaddr);
+       prmsg(1, "FillAddrInfo: peer path too long\n");
+       free((char *) p_sunaddr);
        return 0;
     }
     strcpy (p_sunaddr->sun_path, peer_sun_path);
-#if defined(BSD44SOCKETS) 
+#if defined(BSD44SOCKETS)
     p_sunaddr->sun_len = strlen (p_sunaddr->sun_path);
 #endif
 
@@ -208,7 +206,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
 #ifdef LOCAL_TRANS_PTS
 /* PTS */
 
-#if defined(SYSV) && !defined(__SCO__) 
+#if defined(SYSV) && !defined(__SCO__)
 #define SIGNAL_T int
 #else
 #define SIGNAL_T void
@@ -222,7 +220,7 @@ extern char *ptsname(
     int
 );
 
-static void _dummy(int sig)
+static void _dummy(int sig _X_UNUSED)
 
 {
 }
@@ -315,20 +313,22 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
     pid_t              saved_pid;
 #endif
 
-    PRMSG(2,"PTSOpenClient(%s)\n", port, 0,0 );
+    prmsg(2,"PTSOpenClient(%s)\n", port);
 
 #if !defined(PTSNODENAME)
-    PRMSG(1,"PTSOpenClient: Protocol is not supported by a pts connection\n", 0,0,0);
+    prmsg(1,"PTSOpenClient: Protocol is not supported by a pts connection\n");
     return -1;
 #else
     if (port && *port ) {
        if( *port == '/' ) { /* A full pathname */
-               (void) sprintf(server_path, "%s", port);
-           } else {
-               (void) sprintf(server_path, "%s%s", PTSNODENAME, port);
-           }
+           snprintf(server_path, sizeof(server_path), "%s", port);
+       } else {
+           snprintf(server_path, sizeof(server_path), "%s%s",
+                    PTSNODENAME, port);
+       }
     } else {
-       (void) sprintf(server_path, "%s%d", PTSNODENAME, getpid());
+       snprintf(server_path, sizeof(server_path), "%s%d",
+                PTSNODENAME, getpid());
     }
 
 
@@ -337,7 +337,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
      */
 
     if ((server = open (server_path, O_RDWR)) < 0) {
-       PRMSG(1,"PTSOpenClient: failed to open %s\n", server_path, 0,0);
+       prmsg(1,"PTSOpenClient: failed to open %s\n", server_path);
        return -1;
     }
 
@@ -347,7 +347,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
      */
 
     if ((fd = open(DEV_PTMX, O_RDWR)) < 0) {
-       PRMSG(1,"PTSOpenClient: failed to open %s\n", DEV_PTMX, 0,0);
+       prmsg(1,"PTSOpenClient: failed to open %s\n", DEV_PTMX);
        close(server);
        return(-1);
     }
@@ -358,7 +358,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
     slave = ptsname(fd); /* get name */
 
     if( slave == NULL ) {
-       PRMSG(1,"PTSOpenClient: failed to get ptsname()\n", 0,0,0);
+       prmsg(1,"PTSOpenClient: failed to get ptsname()\n");
        close(fd);
        close(server);
        return -1;
@@ -391,14 +391,14 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
     if (WIFEXITED(exitval) && WEXITSTATUS(exitval) != 0) {
        close(fd);
        close(server);
-       PRMSG(1, "PTSOpenClient: cannot set the owner of %s\n",
-             slave, 0, 0);
+       prmsg(1, "PTSOpenClient: cannot set the owner of %s\n",
+             slave);
        return(-1);
     }
     if (chmod(slave, 0666) < 0) {
        close(fd);
        close(server);
-       PRMSG(1,"PTSOpenClient: Cannot chmod %s\n", slave, 0,0);
+       prmsg(1,"PTSOpenClient: Cannot chmod %s\n", slave);
        return(-1);
     }
 
@@ -425,8 +425,8 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
     (void) signal(SIGALRM, savef);
 
     if (ret != 1) {
-       PRMSG(1,
-       "PTSOpenClient: failed to get acknoledgement from server\n", 0, 0, 0);
+       prmsg(1,
+       "PTSOpenClient: failed to get acknoledgement from server\n");
        (void) close(fd);
        fd = -1;
     }
@@ -437,7 +437,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
 
     if (TRANS(FillAddrInfo) (ciptr, slave, server_path) == 0)
     {
-       PRMSG(1,"PTSOpenClient: failed to fill in addr info\n", 0, 0, 0);
+       prmsg(1,"PTSOpenClient: failed to fill in addr info\n");
        close(fd);
        return -1;
     }
@@ -462,10 +462,10 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
     int mode;
 #endif
 
-    PRMSG(2,"PTSOpenServer(%s)\n", port, 0,0 );
+    prmsg(2,"PTSOpenServer(%s)\n", port);
 
 #if !defined(PTSNODENAME)
-    PRMSG(1,"PTSOpenServer: Protocol is not supported by a pts connection\n", 0,0,0);
+    prmsg(1,"PTSOpenServer: Protocol is not supported by a pts connection\n");
     return -1;
 #else
     if (port && *port ) {
@@ -484,8 +484,8 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
     mode = 0777;
 #endif
     if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
-       PRMSG (1, "PTSOpenServer: mkdir(%s) failed, errno = %d\n",
-              X_STREAMS_DIR, errno, 0);
+       prmsg (1, "PTSOpenServer: mkdir(%s) failed, errno = %d\n",
+              X_STREAMS_DIR, errno);
        return(-1);
     }
 
@@ -496,8 +496,8 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
         * prevent clients from trying to connect to the in-use PTS (which
         * is often in use by something other than another server).
         */
-       PRMSG(1, "PTSOpenServer: A server is already running on port %s\n", port, 0,0 );
-       PRMSG(1, "PTSOpenServer: Remove %s if this is incorrect.\n", server_path, 0,0 );
+       prmsg(1, "PTSOpenServer: A server is already running on port %s\n", port);
+       prmsg(1, "PTSOpenServer: Remove %s if this is incorrect.\n", server_path);
        close(fd);
        return(-1);
     }
@@ -508,7 +508,7 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
     unlink(server_path);
 
     if( (fd=open(DEV_PTMX, O_RDWR)) < 0) {
-       PRMSG(1, "PTSOpenServer: Unable to open %s\n", DEV_PTMX, 0,0 );
+       prmsg(1, "PTSOpenServer: Unable to open %s\n", DEV_PTMX);
        return(-1);
     }
 
@@ -516,25 +516,25 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
     unlockpt(fd);
 
     if( (slave=ptsname(fd)) == NULL) {
-       PRMSG(1, "PTSOpenServer: Unable to get slave device name\n", 0,0,0 );
+       prmsg(1, "PTSOpenServer: Unable to get slave device name\n");
        close(fd);
        return(-1);
     }
 
     if( link(slave,server_path) < 0 ) {
-       PRMSG(1, "PTSOpenServer: Unable to link %s to %s\n", slave, server_path,0 );
+       prmsg(1, "PTSOpenServer: Unable to link %s to %s\n", slave, server_path);
        close(fd);
        return(-1);
     }
 
     if( chmod(server_path, 0666) < 0 ) {
-       PRMSG(1, "PTSOpenServer: Unable to chmod %s to 0666\n", server_path,0,0 );
+       prmsg(1, "PTSOpenServer: Unable to chmod %s to 0666\n", server_path);
        close(fd);
        return(-1);
     }
 
     if( (server=open(server_path, O_RDWR)) < 0 ) {
-       PRMSG(1, "PTSOpenServer: Unable to open server device %s\n", server_path,0,0 );
+       prmsg(1, "PTSOpenServer: Unable to open server device %s\n", server_path);
        close(fd);
        return(-1);
     }
@@ -547,7 +547,7 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
 
     if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
     {
-       PRMSG(1,"PTSOpenServer: failed to fill in addr info\n", 0, 0, 0);
+       prmsg(1,"PTSOpenServer: failed to fill in addr info\n");
        close(fd);
        return -1;
     }
@@ -567,17 +567,17 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
     char               buf[256];
     struct sockaddr_un *sunaddr;
 
-    PRMSG(2,"PTSAccept(%x->%d)\n",ciptr,ciptr->fd,0);
+    prmsg(2,"PTSAccept(%x->%d)\n",ciptr,ciptr->fd);
 
     if( (in=read(ciptr->fd,&length,1)) <= 0 ){
        if( !in ) {
-               PRMSG(2,
-               "PTSAccept: Incoming connection closed\n",0,0,0);
+               prmsg(2,
+               "PTSAccept: Incoming connection closed\n");
                }
        else {
-               PRMSG(1,
+               prmsg(1,
        "PTSAccept: Error reading incoming connection. errno=%d \n",
-                                                               errno,0,0);
+                                                               errno);
                }
        *status = TRANS_ACCEPT_MISC_ERROR;
        return -1;
@@ -585,13 +585,13 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
 
     if( (in=read(ciptr->fd,buf,length)) <= 0 ){
        if( !in ) {
-               PRMSG(2,
-               "PTSAccept: Incoming connection closed\n",0,0,0);
+               prmsg(2,
+               "PTSAccept: Incoming connection closed\n");
                }
        else {
-               PRMSG(1,
+               prmsg(1,
 "PTSAccept: Error reading device name for new connection. errno=%d \n",
-                                                               errno,0,0);
+                                                               errno);
                }
        *status = TRANS_ACCEPT_MISC_ERROR;
        return -1;
@@ -600,7 +600,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
     buf[length] = '\0';
 
     if( (newfd=open(buf,O_RDWR)) < 0 ) {
-       PRMSG(1, "PTSAccept: Failed to open %s\n",buf,0,0);
+       prmsg(1, "PTSAccept: Failed to open %s\n",buf);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return -1;
     }
@@ -612,9 +612,8 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
      */
 
     newciptr->addrlen=ciptr->addrlen;
-    if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
-       PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n",
-                                                                       0,0,0);
+    if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) {
+       prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n");
        close(newfd);
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return -1;
@@ -623,10 +622,9 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
     memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen);
 
     newciptr->peeraddrlen=sizeof(struct sockaddr_un);
-    if( (sunaddr=(struct sockaddr_un *)xalloc(newciptr->peeraddrlen)) == NULL ) {
-       PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n",
-                                                                       0,0,0);
-       xfree(newciptr->addr);
+    if( (sunaddr = malloc(newciptr->peeraddrlen)) == NULL ) {
+       prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n");
+       free(newciptr->addr);
        close(newfd);
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return -1;
@@ -634,7 +632,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
 
     sunaddr->sun_family=AF_UNIX;
     strcpy(sunaddr->sun_path,buf);
-#if defined(BSD44SOCKETS) 
+#if defined(BSD44SOCKETS)
     sunaddr->sun_len=strlen(sunaddr->sun_path);
 #endif
 
@@ -663,15 +661,15 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
     int                        fd;
     char               server_path[64];
     struct stat                filestat;
-# ifndef sun    
+# ifndef sun
     extern int         isastream(int);
 # endif
 #endif
 
-    PRMSG(2,"NAMEDOpenClient(%s)\n", port, 0,0 );
+    prmsg(2,"NAMEDOpenClient(%s)\n", port);
 
 #if !defined(NAMEDNODENAME)
-    PRMSG(1,"NAMEDOpenClient: Protocol is not supported by a NAMED connection\n", 0,0,0);
+    prmsg(1,"NAMEDOpenClient: Protocol is not supported by a NAMED connection\n");
     return -1;
 #else
     if ( port && *port ) {
@@ -685,26 +683,26 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
     }
 
     if ((fd = open(server_path, O_RDWR)) < 0) {
-       PRMSG(1,"NAMEDOpenClient: Cannot open %s for NAMED connection\n", server_path, 0,0 );
+       prmsg(1,"NAMEDOpenClient: Cannot open %s for NAMED connection\n", server_path);
        return -1;
     }
 
     if (fstat(fd, &filestat) < 0 ) {
-       PRMSG(1,"NAMEDOpenClient: Cannot stat %s for NAMED connection\n", server_path, 0,0 );
+       prmsg(1,"NAMEDOpenClient: Cannot stat %s for NAMED connection\n", server_path);
        (void) close(fd);
        return -1;
     }
 
     if ((filestat.st_mode & S_IFMT) != S_IFIFO) {
-       PRMSG(1,"NAMEDOpenClient: Device %s is not a FIFO\n", server_path, 0,0 );
+       prmsg(1,"NAMEDOpenClient: Device %s is not a FIFO\n", server_path);
        /* Is this really a failure? */
-       (void) close(fd);       
+       (void) close(fd);
        return -1;
     }
 
 
     if (isastream(fd) <= 0) {
-       PRMSG(1,"NAMEDOpenClient: %s is not a streams device\n", server_path, 0,0 );
+       prmsg(1,"NAMEDOpenClient: %s is not a streams device\n", server_path);
        (void) close(fd);
        return -1;
     }
@@ -715,8 +713,7 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
 
     if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
     {
-       PRMSG(1,"NAMEDOpenClient: failed to fill in addr info\n",
-                                                               0,0,0);
+       prmsg(1,"NAMEDOpenClient: failed to fill in addr info\n");
        close(fd);
        return -1;
     }
@@ -736,58 +733,54 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
 static int
 TRANS(NAMEDOpenPipe)(const char *server_path)
 {
-    PRMSG(2,"NAMEDOpenPipe(%s)\n", server_path, 0,0 );
-
     int                        fd, pipefd[2];
     struct stat                sbuf;
     int                        mode;
-    
-#if defined(sun) && defined(X11_t)
-    mode = 0775;       /* Solaris requires uid or gid 0 to create X11 pipes */
-#else    
+
+    prmsg(2,"NAMEDOpenPipe(%s)\n", server_path);
+
 #ifdef HAS_STICKY_DIR_BIT
     mode = 01777;
 #else
     mode = 0777;
 #endif
-#endif
     if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
-       PRMSG (1, "NAMEDOpenPipe: mkdir(%s) failed, errno = %d\n",
-              X_STREAMS_DIR, errno, 0);
+       prmsg (1, "NAMEDOpenPipe: mkdir(%s) failed, errno = %d\n",
+              X_STREAMS_DIR, errno);
        return(-1);
     }
 
     if(stat(server_path, &sbuf) != 0) {
        if (errno == ENOENT) {
            if ((fd = creat(server_path, (mode_t)0666)) == -1) {
-               PRMSG(1, "NAMEDOpenPipe: Can't open %s\n", server_path, 0,0 );
+               prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
                return(-1);
            }
            close(fd);
            if (chmod(server_path, (mode_t)0666) < 0) {
-               PRMSG(1, "NAMEDOpenPipe: Can't open %s\n", server_path, 0,0 );
+               prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
                return(-1);
            }
        } else {
-           PRMSG(1, "NAMEDOpenPipe: stat on %s failed\n", server_path, 0,0 );
+           prmsg(1, "NAMEDOpenPipe: stat on %s failed\n", server_path);
            return(-1);
        }
     }
 
     if( pipe(pipefd) != 0) {
-       PRMSG(1, "NAMEDOpenPipe: pipe() failed, errno=%d\n",errno, 0,0 );
+       prmsg(1, "NAMEDOpenPipe: pipe() failed, errno=%d\n",errno);
        return(-1);
     }
 
     if( ioctl(pipefd[0], I_PUSH, "connld") != 0) {
-       PRMSG(1, "NAMEDOpenPipe: ioctl(I_PUSH,\"connld\") failed, errno=%d\n",errno, 0,0 );
+       prmsg(1, "NAMEDOpenPipe: ioctl(I_PUSH,\"connld\") failed, errno=%d\n",errno);
        close(pipefd[0]);
        close(pipefd[1]);
        return(-1);
     }
 
     if( fattach(pipefd[0], server_path) != 0) {
-       PRMSG(1, "NAMEDOpenPipe: fattach(%s) failed, errno=%d\n", server_path,errno, 0 );
+       prmsg(1, "NAMEDOpenPipe: fattach(%s) failed, errno=%d\n", server_path,errno);
        close(pipefd[0]);
        close(pipefd[1]);
        return(-1);
@@ -805,10 +798,10 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
     char               server_path[64];
 #endif
 
-    PRMSG(2,"NAMEDOpenServer(%s)\n", port, 0,0 );
+    prmsg(2,"NAMEDOpenServer(%s)\n", port);
 
 #if !defined(NAMEDNODENAME)
-    PRMSG(1,"NAMEDOpenServer: Protocol is not supported by a NAMED connection\n", 0,0,0);
+    prmsg(1,"NAMEDOpenServer: Protocol is not supported by a NAMED connection\n");
     return -1;
 #else
     if ( port && *port ) {
@@ -827,14 +820,14 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
     if (fd < 0) {
        return -1;
     }
-    
+
     /*
      * Everything looks good: fill in the XtransConnInfo structure.
      */
 
     if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
     {
-       PRMSG(1,"NAMEDOpenServer: failed to fill in addr info\n", 0,0,0);
+       prmsg(1,"NAMEDOpenServer: failed to fill in addr info\n");
        TRANS(LocalClose)(ciptr);
        return -1;
     }
@@ -848,12 +841,11 @@ static int
 TRANS(NAMEDResetListener) (XtransConnInfo ciptr)
 
 {
-  int status = TRANS_RESET_NOOP;
   struct sockaddr_un      *sockname=(struct sockaddr_un *) ciptr->addr;
   struct stat     statb;
-  
-  PRMSG(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd, 0 );
-  
+
+  prmsg(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd);
+
   if (ciptr->fd != -1) {
     /*
      * see if the pipe has disappeared
@@ -861,7 +853,7 @@ TRANS(NAMEDResetListener) (XtransConnInfo ciptr)
 
     if (stat (sockname->sun_path, &statb) == -1 ||
        (statb.st_mode & S_IFMT) != S_IFIFO) {
-      PRMSG(3, "Pipe %s trashed, recreating\n", sockname->sun_path, 0, 0);
+      prmsg(3, "Pipe %s trashed, recreating\n", sockname->sun_path);
       TRANS(LocalClose)(ciptr);
       ciptr->fd = TRANS(NAMEDOpenPipe)(sockname->sun_path);
       if (ciptr->fd >= 0)
@@ -879,10 +871,10 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
 {
     struct strrecvfd str;
 
-    PRMSG(2,"NAMEDAccept(%x->%d)\n", ciptr, ciptr->fd, 0 );
+    prmsg(2,"NAMEDAccept(%p->%d)\n", ciptr, ciptr->fd);
 
     if( ioctl(ciptr->fd, I_RECVFD, &str ) < 0 ) {
-       PRMSG(1, "NAMEDAccept: ioctl(I_RECVFD) failed, errno=%d\n", errno, 0,0 );
+       prmsg(1, "NAMEDAccept: ioctl(I_RECVFD) failed, errno=%d\n", errno);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return(-1);
     }
@@ -892,10 +884,9 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
      */
     newciptr->family=ciptr->family;
     newciptr->addrlen=ciptr->addrlen;
-    if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
-       PRMSG(1,
-             "NAMEDAccept: failed to allocate memory for pipe addr\n",
-                                                                       0,0,0);
+    if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) {
+       prmsg(1,
+             "NAMEDAccept: failed to allocate memory for pipe addr\n");
        close(str.fd);
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return -1;
@@ -904,11 +895,10 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
     memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen);
 
     newciptr->peeraddrlen=newciptr->addrlen;
-    if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) {
-       PRMSG(1,
-       "NAMEDAccept: failed to allocate memory for peer addr\n",
-                                                                       0,0,0);
-       xfree(newciptr->addr);
+    if( (newciptr->peeraddr = malloc(newciptr->peeraddrlen)) == NULL ) {
+       prmsg(1,
+       "NAMEDAccept: failed to allocate memory for peer addr\n");
+       free(newciptr->addr);
        close(str.fd);
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return -1;
@@ -1019,23 +1009,23 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
     extern int getmsg(), putmsg();
 #endif
 
-    PRMSG(2,"SCOOpenClient(%s)\n", port, 0,0 );
+    prmsg(2,"SCOOpenClient(%s)\n", port);
     if (!port || !port[0])
        port = "0";
 
 #if !defined(SCORNODENAME)
-    PRMSG(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n", 0,0,0);
+    prmsg(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n");
     return -1;
 #else
     (void) sprintf(server_path, SCORNODENAME, port);
 
     if ((server = open(server_path, O_RDWR)) < 0) {
-       PRMSG(1,"SCOOpenClient: failed to open %s\n", server_path, 0,0 );
+       prmsg(1,"SCOOpenClient: failed to open %s\n", server_path);
        return -1;
     }
 
     if ((fd = open(DEV_SPX, O_RDWR)) < 0) {
-       PRMSG(1,"SCOOpenClient: failed to open %s\n", DEV_SPX, 0,0 );
+       prmsg(1,"SCOOpenClient: failed to open %s\n", DEV_SPX);
        close(server);
        return -1;
     }
@@ -1055,7 +1045,7 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
     (void) signal(SIGALRM, savef);
 
     if (ret < 0) {
-       PRMSG(1,"SCOOpenClient: error from getmsg\n", 0,0,0 );
+       prmsg(1,"SCOOpenClient: error from getmsg\n");
        close(fd);
        close(server);
        return -1;
@@ -1079,7 +1069,7 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
 #endif
     if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
     {
-       PRMSG(1,"SCOOpenClient: failed to fill addr info\n", 0, 0, 0);
+       prmsg(1,"SCOOpenClient: failed to fill addr info\n");
        close(fd);
        return -1;
     }
@@ -1105,12 +1095,12 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
     int                        fds = -1;
 #endif
 
-    PRMSG(2,"SCOOpenServer(%s)\n", port, 0,0 );
+    prmsg(2,"SCOOpenServer(%s)\n", port);
     if (!port || !port[0])
        port = "0";
 
 #if !defined(SCORNODENAME)
-    PRMSG(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
+    prmsg(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n");
     return -1;
 #else
     (void) sprintf(serverR_path, SCORNODENAME, port);
@@ -1122,7 +1112,7 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
 
     if ((fds = open(DEV_SPX, O_RDWR)) < 0 ||
        (fdr = open(DEV_SPX, O_RDWR)) < 0 ) {
-       PRMSG(1,"SCOOpenServer: failed to open %s\n", DEV_SPX, 0,0 );
+       prmsg(1,"SCOOpenServer: failed to open %s\n", DEV_SPX);
        if (fds >= 0)
                close(fds);
        if (fdr >= 0)
@@ -1131,14 +1121,14 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
     }
 
     if (named_spipe (fds, serverS_path) == -1) {
-       PRMSG(1,"SCOOpenServer: failed to create %s\n", serverS_path, 0, 0);
+       prmsg(1,"SCOOpenServer: failed to create %s\n", serverS_path);
        close (fdr);
        close (fds);
        return -1;
     }
 
     if (named_spipe (fdr, serverR_path) == -1) {
-       PRMSG(1,"SCOOpenServer: failed to create %s\n", serverR_path, 0, 0);
+       prmsg(1,"SCOOpenServer: failed to create %s\n", serverR_path);
        close (fdr);
        close (fds);
        return -1;
@@ -1147,7 +1137,7 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
 
     fds = open (serverS_path, O_RDWR | O_NDELAY);
     if (fds < 0) {
-       PRMSG(1,"SCOOpenServer: failed to open %s\n", serverS_path, 0, 0);
+       prmsg(1,"SCOOpenServer: failed to open %s\n", serverS_path);
        return -1;
     }
 
@@ -1160,22 +1150,22 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
     mylock.l_start     = 0;
     mylock.l_len       = 0;
     if (fcntl (fds, F_SETLK, &mylock) < 0) {
-       PRMSG(1,"SCOOpenServer: failed to lock %s\n", serverS_path, 0, 0);
+       prmsg(1,"SCOOpenServer: failed to lock %s\n", serverS_path);
        close (fds);
        return -1;
     }
 
     fdr = open (serverR_path, O_RDWR | O_NDELAY);
     if (fdr < 0) {
-       PRMSG(1,"SCOOpenServer: failed to open %s\n", serverR_path, 0, 0);
+       prmsg(1,"SCOOpenServer: failed to open %s\n", serverR_path);
        close (fds);
        return -1;
     }
 #endif /* X11_t */
 
     if (connect_spipe(fds, fdr)) {
-       PRMSG(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n",
-             serverS_path, 0, 0);
+       prmsg(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n",
+             serverS_path);
        close (fdr);
        close (fds);
        return -1;
@@ -1189,7 +1179,7 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
     ciptr->flags |= TRANS_NOUNLINK;
 #endif
     if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0) {
-       PRMSG(1,"SCOOpenServer: failed to fill in addr info\n", 0,0,0);
+       prmsg(1,"SCOOpenServer: failed to fill in addr info\n");
        close(fds);
        close(fdr);
        return -1;
@@ -1206,22 +1196,22 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
     char               c;
     int                        fd;
 
-    PRMSG(2,"SCOAccept(%d)\n", ciptr->fd, 0,0 );
+    prmsg(2,"SCOAccept(%d)\n", ciptr->fd);
 
     if (read(ciptr->fd, &c, 1) < 0) {
-       PRMSG(1,"SCOAccept: can't read from client\n",0,0,0);
+       prmsg(1,"SCOAccept: can't read from client\n");
        *status = TRANS_ACCEPT_MISC_ERROR;
        return(-1);
     }
 
     if( (fd = open(DEV_SPX, O_RDWR)) < 0 ) {
-       PRMSG(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX, 0,0 );
+       prmsg(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return(-1);
     }
 
     if (connect_spipe (ciptr->fd, fd) < 0) {
-       PRMSG(1,"SCOAccept: ioctl(I_FDINSERT) failed\n", 0, 0, 0);
+       prmsg(1,"SCOAccept: ioctl(I_FDINSERT) failed\n");
        close (fd);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return -1;
@@ -1232,10 +1222,9 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
      */
 
     newciptr->addrlen=ciptr->addrlen;
-    if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
-       PRMSG(1,
-             "SCOAccept: failed to allocate memory for peer addr\n",
-             0,0,0);
+    if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) {
+       prmsg(1,
+             "SCOAccept: failed to allocate memory for peer addr\n");
        close(fd);
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return -1;
@@ -1247,11 +1236,10 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
 #endif
 
     newciptr->peeraddrlen=newciptr->addrlen;
-    if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) {
-       PRMSG(1,
-             "SCOAccept: failed to allocate memory for peer addr\n",
-             0,0,0);
-       xfree(newciptr->addr);
+    if( (newciptr->peeraddr = malloc(newciptr->peeraddrlen)) == NULL ) {
+       prmsg(1,
+             "SCOAccept: failed to allocate memory for peer addr\n");
+       free(newciptr->addr);
        close(fd);
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return -1;
@@ -1280,26 +1268,27 @@ TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, char *port)
     char server_path[64];
 #endif
 
-    PRMSG(2,"PTSReopenServer(%d,%s)\n", fd, port, 0 );
+    prmsg(2,"PTSReopenServer(%d,%s)\n", fd, port);
 
 #if !defined(PTSNODENAME)
-    PRMSG(1,"PTSReopenServer: Protocol is not supported by a pts connection\n", 0,0,0);
+    prmsg(1,"PTSReopenServer: Protocol is not supported by a pts connection\n");
     return 0;
 #else
     if (port && *port ) {
        if( *port == '/' ) { /* A full pathname */
-               (void) sprintf(server_path, "%s", port);
-           } else {
-               (void) sprintf(server_path, "%s%s", PTSNODENAME, port);
-           }
+           snprintf(server_path, sizeof(server_path), "%s", port);
+       } else {
+           snprintf(server_path, sizeof(server_path), "%s%s",
+                    PTSNODENAME, port);
+       }
     } else {
-       (void) sprintf(server_path, "%s%ld", PTSNODENAME, (long)getpid());
+       snprintf(server_path, sizeof(server_path), "%s%ld",
+               PTSNODENAME, (long)getpid());
     }
 
     if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
     {
-       PRMSG(1,"PTSReopenServer: failed to fill in addr info\n",
-                                                               0,0,0);
+       prmsg(1,"PTSReopenServer: failed to fill in addr info\n");
        return 0;
     }
 
@@ -1313,33 +1302,34 @@ TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, char *port)
 #ifdef LOCAL_TRANS_NAMED
 
 static int
-TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd, char *port)
+TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, char *port)
 
 {
 #ifdef NAMEDNODENAME
     char server_path[64];
 #endif
 
-    PRMSG(2,"NAMEDReopenServer(%s)\n", port, 0,0 );
+    prmsg(2,"NAMEDReopenServer(%s)\n", port);
 
 #if !defined(NAMEDNODENAME)
-    PRMSG(1,"NAMEDReopenServer: Protocol is not supported by a NAMED connection\n", 0,0,0);
+    prmsg(1,"NAMEDReopenServer: Protocol is not supported by a NAMED connection\n");
     return 0;
 #else
     if ( port && *port ) {
        if( *port == '/' ) { /* A full pathname */
-           (void) sprintf(server_path, "%s", port);
+           snprintf(server_path, sizeof(server_path),"%s", port);
        } else {
-           (void) sprintf(server_path, "%s%s", NAMEDNODENAME, port);
+           snprintf(server_path, sizeof(server_path), "%s%s",
+                    NAMEDNODENAME, port);
        }
     } else {
-       (void) sprintf(server_path, "%s%ld", NAMEDNODENAME, (long)getpid());
+       snprintf(server_path, sizeof(server_path), "%s%ld",
+               NAMEDNODENAME, (long)getpid());
     }
 
     if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
     {
-       PRMSG(1,"NAMEDReopenServer: failed to fill in addr info\n",
-                                                               0,0,0);
+       prmsg(1,"NAMEDReopenServer: failed to fill in addr info\n");
        return 0;
     }
 
@@ -1360,12 +1350,12 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
     char serverR_path[64], serverS_path[64];
 #endif
 
-    PRMSG(2,"SCOReopenServer(%s)\n", port, 0,0 );
+    prmsg(2,"SCOReopenServer(%s)\n", port);
     if (!port || !port[0])
       port = "0";
 
 #if !defined(SCORNODENAME)
-    PRMSG(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
+    prmsg(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n");
     return 0;
 #else
     (void) sprintf(serverR_path, SCORNODENAME, port);
@@ -1376,7 +1366,7 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
 #endif
     if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0)
     {
-       PRMSG(1, "SCOReopenServer: failed to fill in addr info\n", 0,0,0);
+       prmsg(1, "SCOReopenServer: failed to fill in addr info\n");
        return 0;
     }
 
@@ -1397,7 +1387,7 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
  */
 
 typedef struct _LOCALtrans2dev {
-    char       *transname;
+    const char *transname;
 
 #ifdef TRANS_CLIENT
 
@@ -1658,7 +1648,7 @@ static LOCALtrans2dev LOCALtrans2devtab[] = {
 
 #define NUMTRANSPORTS  (sizeof(LOCALtrans2devtab)/sizeof(LOCALtrans2dev))
 
-static char    *XLOCAL=NULL;
+static const char      *XLOCAL=NULL;
 static char    *workingXLOCAL=NULL;
 static char    *freeXLOCAL=NULL;
 
@@ -1673,24 +1663,20 @@ static  char    *freeXLOCAL=NULL;
 #endif
 
 static void
-TRANS(LocalInitTransports)(char *protocol)
+TRANS(LocalInitTransports)(const char *protocol)
 
 {
-    PRMSG(3,"LocalInitTransports(%s)\n", protocol, 0,0 );
+    prmsg(3,"LocalInitTransports(%s)\n", protocol);
 
     if( strcmp(protocol,"local") && strcmp(protocol,"LOCAL") )
     {
-       workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (protocol) + 1);
-       if (workingXLOCAL)
-           strcpy (workingXLOCAL, protocol);
+       workingXLOCAL = freeXLOCAL = strdup (protocol);
     }
     else {
        XLOCAL=(char *)getenv("XLOCAL");
        if(XLOCAL==NULL)
            XLOCAL=DEF_XLOCAL;
-       workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (XLOCAL) + 1);
-       if (workingXLOCAL)
-           strcpy (workingXLOCAL, XLOCAL);
+       workingXLOCAL = freeXLOCAL = strdup (XLOCAL);
     }
 }
 
@@ -1698,8 +1684,8 @@ static void
 TRANS(LocalEndTransports)(void)
 
 {
-    PRMSG(3,"LocalEndTransports()\n", 0,0,0 );
-    xfree(freeXLOCAL);
+    prmsg(3,"LocalEndTransports()\n");
+    free(freeXLOCAL);
 }
 
 #define TYPEBUFSIZE    32
@@ -1713,7 +1699,7 @@ TRANS(LocalGetNextTransport)(void)
     int        i,j;
     char       *typetocheck;
     char       typebuf[TYPEBUFSIZE];
-    PRMSG(3,"LocalGetNextTransport()\n", 0,0,0 );
+    prmsg(3,"LocalGetNextTransport()\n");
 
     while(1)
     {
@@ -1793,7 +1779,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
     XtransConnInfo ciptr;
     int index;
 
-    PRMSG(3,"LocalOpenClient()\n", 0,0,0 );
+    prmsg(3,"LocalOpenClient()\n");
 
     /*
      * Make sure 'host' is really local.  If not, we return failure.
@@ -1805,9 +1791,9 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
 
     if (strcmp (host, "unix") != 0 && !HostReallyLocal (host))
     {
-       PRMSG (1,
+       prmsg (1,
           "LocalOpenClient: Cannot connect to non-local host %s\n",
-              host, 0, 0);
+              host);
        return NULL;
     }
 
@@ -1824,10 +1810,10 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
      */
 #endif /* X11_t */
 
-    if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
+    if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
     {
-       PRMSG(1,"LocalOpenClient: calloc(1,%d) failed\n",
-             sizeof(struct _XtransConnInfo),0,0 );
+       prmsg(1,"LocalOpenClient: calloc(1,%lu) failed\n",
+             sizeof(struct _XtransConnInfo));
        return NULL;
     }
 
@@ -1849,14 +1835,13 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
            break;
        case XTRANS_OPEN_COTS_SERVER:
        case XTRANS_OPEN_CLTS_SERVER:
-           PRMSG(1,
-                 "LocalOpenClient: Should not be opening a server with this function\n",
-                 0,0,0);
+           prmsg(1,
+                 "LocalOpenClient: Should not be opening a server with this function\n");
            break;
        default:
-           PRMSG(1,
+           prmsg(1,
                  "LocalOpenClient: Unknown Open type %d\n",
-                 type, 0,0 );
+                 type);
        }
        if( ciptr->fd >= 0 )
            break;
@@ -1866,7 +1851,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
 
     if( ciptr->fd < 0 )
     {
-       xfree(ciptr);
+       free(ciptr);
        return NULL;
     }
 
@@ -1882,13 +1867,13 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
 #ifdef TRANS_SERVER
 
 static XtransConnInfo
-TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
+TRANS(LocalOpenServer)(int type, char *protocol, char *host _X_UNUSED, char *port)
 
 {
     int        i;
     XtransConnInfo ciptr;
 
-    PRMSG(2,"LocalOpenServer(%d,%s,%s)\n", type, protocol, port);
+    prmsg(2,"LocalOpenServer(%d,%s,%s)\n", type, protocol, port);
 
 #if defined(X11_t)
     /*
@@ -1899,10 +1884,10 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
      */
 #endif /* X11_t */
 
-    if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
+    if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
     {
-       PRMSG(1,"LocalOpenServer: calloc(1,%d) failed\n",
-             sizeof(struct _XtransConnInfo),0,0 );
+       prmsg(1,"LocalOpenServer: calloc(1,%lu) failed\n",
+             sizeof(struct _XtransConnInfo));
        return NULL;
     }
 
@@ -1914,9 +1899,8 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
        {
        case XTRANS_OPEN_COTS_CLIENT:
        case XTRANS_OPEN_CLTS_CLIENT:
-           PRMSG(1,
-                 "LocalOpenServer: Should not be opening a client with this function\n",
-                 0,0,0);
+           prmsg(1,
+                 "LocalOpenServer: Should not be opening a client with this function\n");
            break;
        case XTRANS_OPEN_COTS_SERVER:
            ciptr->fd=LOCALtrans2devtab[i].devcotsopenserver(ciptr,port);
@@ -1925,8 +1909,8 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
            ciptr->fd=LOCALtrans2devtab[i].devcltsopenserver(ciptr,port);
            break;
        default:
-           PRMSG(1,"LocalOpenServer: Unknown Open type %d\n",
-                 type ,0,0);
+           prmsg(1,"LocalOpenServer: Unknown Open type %d\n",
+                 type );
        }
        if( ciptr->fd >= 0 ) {
            ciptr->priv=(char *)&LOCALtrans2devtab[i];
@@ -1936,7 +1920,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
        }
     }
 
-    xfree(ciptr);
+    free(ciptr);
     return NULL;
 }
 
@@ -1952,12 +1936,12 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
     XtransConnInfo ciptr;
     int stat = 0;
 
-    PRMSG(2,"LocalReopenServer(%d,%d,%d)\n", type, index, fd);
+    prmsg(2,"LocalReopenServer(%d,%d,%d)\n", type, index, fd);
 
-    if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
+    if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
     {
-       PRMSG(1,"LocalReopenServer: calloc(1,%d) failed\n",
-             sizeof(struct _XtransConnInfo),0,0 );
+       prmsg(1,"LocalReopenServer: calloc(1,%lu) failed\n",
+             sizeof(struct _XtransConnInfo));
        return NULL;
     }
 
@@ -1972,8 +1956,8 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
        stat = LOCALtrans2devtab[index].devcltsreopenserver(ciptr,fd,port);
        break;
     default:
-       PRMSG(1,"LocalReopenServer: Unknown Open type %d\n",
-         type ,0,0);
+       prmsg(1,"LocalReopenServer: Unknown Open type %d\n",
+         type );
     }
 
     if( stat > 0 ) {
@@ -1983,7 +1967,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
        return ciptr;
     }
 
-    xfree(ciptr);
+    free(ciptr);
     return NULL;
 }
 
@@ -1998,11 +1982,11 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
 #ifdef TRANS_CLIENT
 
 static XtransConnInfo
-TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol, 
+TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
                           char *host, char *port)
 
 {
-    PRMSG(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port);
+    prmsg(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port);
 
     return TRANS(LocalOpenClient)(XTRANS_OPEN_COTS_CLIENT, protocol, host, port);
 }
@@ -2013,7 +1997,7 @@ TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol,
 #ifdef TRANS_SERVER
 
 static XtransConnInfo
-TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol, 
+TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
                           char *host, char *port)
 
 {
@@ -2021,7 +2005,7 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
     int found = 0;
     char typebuf[TYPEBUFSIZE];
 
-    PRMSG(2,"LocalOpenCOTSServer(%s,%s,%s)\n",protocol,host,port);
+    prmsg(2,"LocalOpenCOTSServer(%s,%s,%s)\n",protocol,host,port);
 
     /* Check if this local type is in the XLOCAL list */
     TRANS(LocalInitTransports)("local");
@@ -2043,7 +2027,7 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
     TRANS(LocalEndTransports)();
 
     if (!found) {
-       PRMSG(3,"LocalOpenCOTSServer: disabling %s\n",thistrans->TransName,0,0);
+       prmsg(3,"LocalOpenCOTSServer: disabling %s\n",thistrans->TransName);
        thistrans->flags |= TRANS_DISABLED;
        return NULL;
     }
@@ -2057,11 +2041,11 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
 #ifdef TRANS_CLIENT
 
 static XtransConnInfo
-TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol, 
+TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
                           char *host, char *port)
 
 {
-    PRMSG(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port);
+    prmsg(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port);
 
     return TRANS(LocalOpenClient)(XTRANS_OPEN_CLTS_CLIENT, protocol, host, port);
 }
@@ -2072,11 +2056,11 @@ TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
 #ifdef TRANS_SERVER
 
 static XtransConnInfo
-TRANS(LocalOpenCLTSServer)(Xtransport *thistrans, char *protocol, 
+TRANS(LocalOpenCLTSServer)(Xtransport *thistrans _X_UNUSED, char *protocol,
                           char *host, char *port)
 
 {
-    PRMSG(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port);
+    prmsg(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port);
 
     return TRANS(LocalOpenServer)(XTRANS_OPEN_CLTS_SERVER, protocol, host, port);
 }
@@ -2092,7 +2076,7 @@ TRANS(LocalReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
 {
     int index;
 
-    PRMSG(2,"LocalReopenCOTSServer(%d,%s)\n", fd, port, 0);
+    prmsg(2,"LocalReopenCOTSServer(%d,%s)\n", fd, port);
 
     for(index=1;index<NUMTRANSPORTS;index++)
     {
@@ -2116,7 +2100,7 @@ TRANS(LocalReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
 {
     int index;
 
-    PRMSG(2,"LocalReopenCLTSServer(%d,%s)\n", fd, port, 0);
+    prmsg(2,"LocalReopenCLTSServer(%d,%s)\n", fd, port);
 
     for(index=1;index<NUMTRANSPORTS;index++)
     {
@@ -2142,7 +2126,7 @@ static int
 TRANS(LocalSetOption)(XtransConnInfo ciptr, int option, int arg)
 
 {
-    PRMSG(2,"LocalSetOption(%d,%d,%d)\n",ciptr->fd,option,arg);
+    prmsg(2,"LocalSetOption(%d,%d,%d)\n",ciptr->fd,option,arg);
 
     return -1;
 }
@@ -2151,10 +2135,10 @@ TRANS(LocalSetOption)(XtransConnInfo ciptr, int option, int arg)
 #ifdef TRANS_SERVER
 
 static int
-TRANS(LocalCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags)
+TRANS(LocalCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags _X_UNUSED)
 
 {
-    PRMSG(2,"LocalCreateListener(%x->%d,%s)\n",ciptr,ciptr->fd,port);
+    prmsg(2,"LocalCreateListener(%p->%d,%s)\n",ciptr,ciptr->fd,port);
 
     return 0;
 }
@@ -2164,8 +2148,8 @@ TRANS(LocalResetListener)(XtransConnInfo ciptr)
 
 {
     LOCALtrans2dev     *transptr;
-    
-    PRMSG(2,"LocalResetListener(%x)\n",ciptr,0,0);
+
+    prmsg(2,"LocalResetListener(%p)\n",ciptr);
 
     transptr=(LOCALtrans2dev *)ciptr->priv;
     if (transptr->devreset != NULL) {
@@ -2182,14 +2166,14 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
     XtransConnInfo     newciptr;
     LOCALtrans2dev     *transptr;
 
-    PRMSG(2,"LocalAccept(%x->%d)\n", ciptr, ciptr->fd,0);
+    prmsg(2,"LocalAccept(%p->%d)\n", ciptr, ciptr->fd);
 
     transptr=(LOCALtrans2dev *)ciptr->priv;
 
-    if( (newciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo)))==NULL )
+    if( (newciptr = calloc(1,sizeof(struct _XtransConnInfo)))==NULL )
     {
-       PRMSG(1,"LocalAccept: calloc(1,%d) failed\n",
-             sizeof(struct _XtransConnInfo),0,0 );
+       prmsg(1,"LocalAccept: calloc(1,%lu) failed\n",
+             sizeof(struct _XtransConnInfo));
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return NULL;
     }
@@ -2198,7 +2182,7 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
 
     if( newciptr->fd < 0 )
     {
-       xfree(newciptr);
+       free(newciptr);
        return NULL;
     }
 
@@ -2216,10 +2200,10 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
 #ifdef TRANS_CLIENT
 
 static int
-TRANS(LocalConnect)(XtransConnInfo ciptr, char *host, char *port)
+TRANS(LocalConnect)(XtransConnInfo ciptr, char *host _X_UNUSED, char *port)
 
 {
-    PRMSG(2,"LocalConnect(%x->%d,%s)\n", ciptr, ciptr->fd, port);
+    prmsg(2,"LocalConnect(%p->%d,%s)\n", ciptr, ciptr->fd, port);
 
     return 0;
 }
@@ -2231,7 +2215,7 @@ static int
 TRANS(LocalBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend )
 
 {
-    PRMSG(2,"LocalBytesReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend);
+    prmsg(2,"LocalBytesReadable(%p->%d,%p)\n", ciptr, ciptr->fd, pend);
 
 #if defined(SCO325)
     return ioctl(ciptr->fd, I_NREAD, (char *)pend);
@@ -2244,7 +2228,7 @@ static int
 TRANS(LocalRead)(XtransConnInfo ciptr, char *buf, int size)
 
 {
-    PRMSG(2,"LocalRead(%d,%x,%d)\n", ciptr->fd, buf, size );
+    prmsg(2,"LocalRead(%d,%p,%d)\n", ciptr->fd, buf, size );
 
     return read(ciptr->fd,buf,size);
 }
@@ -2253,7 +2237,7 @@ static int
 TRANS(LocalWrite)(XtransConnInfo ciptr, char *buf, int size)
 
 {
-    PRMSG(2,"LocalWrite(%d,%x,%d)\n", ciptr->fd, buf, size );
+    prmsg(2,"LocalWrite(%d,%p,%d)\n", ciptr->fd, buf, size );
 
     return write(ciptr->fd,buf,size);
 }
@@ -2262,7 +2246,7 @@ static int
 TRANS(LocalReadv)(XtransConnInfo ciptr, struct iovec *buf, int size)
 
 {
-    PRMSG(2,"LocalReadv(%d,%x,%d)\n", ciptr->fd, buf, size );
+    prmsg(2,"LocalReadv(%d,%p,%d)\n", ciptr->fd, buf, size );
 
     return READV(ciptr,buf,size);
 }
@@ -2271,7 +2255,7 @@ static int
 TRANS(LocalWritev)(XtransConnInfo ciptr, struct iovec *buf, int size)
 
 {
-    PRMSG(2,"LocalWritev(%d,%x,%d)\n", ciptr->fd, buf, size );
+    prmsg(2,"LocalWritev(%d,%p,%d)\n", ciptr->fd, buf, size );
 
     return WRITEV(ciptr,buf,size);
 }
@@ -2280,7 +2264,7 @@ static int
 TRANS(LocalDisconnect)(XtransConnInfo ciptr)
 
 {
-    PRMSG(2,"LocalDisconnect(%x->%d)\n", ciptr, ciptr->fd, 0);
+    prmsg(2,"LocalDisconnect(%p->%d)\n", ciptr, ciptr->fd);
 
     return 0;
 }
@@ -2292,7 +2276,7 @@ TRANS(LocalClose)(XtransConnInfo ciptr)
     struct sockaddr_un      *sockname=(struct sockaddr_un *) ciptr->addr;
     int        ret;
 
-    PRMSG(2,"LocalClose(%x->%d)\n", ciptr, ciptr->fd ,0);
+    prmsg(2,"LocalClose(%p->%d)\n", ciptr, ciptr->fd );
 
     ret=close(ciptr->fd);
 
@@ -2314,7 +2298,7 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr)
 {
     int ret;
 
-    PRMSG(2,"LocalCloseForCloning(%x->%d)\n", ciptr, ciptr->fd ,0);
+    prmsg(2,"LocalCloseForCloning(%p->%d)\n", ciptr, ciptr->fd );
 
     /* Don't unlink path */
 
@@ -2328,22 +2312,22 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr)
  * MakeAllCOTSServerListeners() will go through the entire Xtransports[]
  * array defined in Xtrans.c and try to OpenCOTSServer() for each entry.
  * We will add duplicate entries to that table so that the OpenCOTSServer()
- * function will get called once for each type of local transport. 
+ * function will get called once for each type of local transport.
  *
  * The TransName is in lowercase, so it will never match during a normal
  * call to SelectTransport() in Xtrans.c.
  */
 
 #ifdef TRANS_SERVER
-static char * local_aliases[] = {
+static const char * local_aliases[] = {
 # ifdef LOCAL_TRANS_PTS
                                   "pts",
 # endif
                                  "named",
 # ifdef sun
                                  "pipe", /* compatibility with Solaris Xlib */
-# endif                                  
-# ifdef LOCAL_TRANS_SCO                                  
+# endif
+# ifdef LOCAL_TRANS_SCO
                                  "sco",
 # endif
                                  NULL };
old mode 100755 (executable)
new mode 100644 (file)
index 5f65738..dfa41cf
@@ -97,7 +97,7 @@ from the copyright holders.
 
 
 #ifndef NO_TCP_H
-#if defined(linux) || defined(__GLIBC__) 
+#if defined(linux) || defined(__GLIBC__)
 #include <sys/param.h>
 #endif /* osf */
 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
@@ -114,11 +114,11 @@ from the copyright holders.
 
 #if (defined(__i386__) && defined(SYSV)) && !defined(SCO325) && !defined(sun)
 #include <net/errno.h>
-#endif 
+#endif
 
-#if defined(__i386__) && defined(SYSV) 
+#if defined(__i386__) && defined(SYSV)
 #include <sys/stropts.h>
-#endif 
+#endif
 
 #include <unistd.h>
 
@@ -171,8 +171,8 @@ from the copyright holders.
  *
  */
 
-typedef struct _Sockettrans2dev {      
-    char       *transname;
+typedef struct _Sockettrans2dev {
+    const char *transname;
     int                family;
     int                devcotsname;
     int                devcltsname;
@@ -244,7 +244,7 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr);
 #if defined HAVE_SOCKLEN_T || (defined(IPv6) && defined(AF_INET6))
 # define SOCKLEN_T socklen_t
 #elif defined(SVR4) || defined(__SVR4) || defined(__SCO__)
-# define SOCKLEN_T size_t 
+# define SOCKLEN_T size_t
 #else
 # define SOCKLEN_T int
 #endif
@@ -254,12 +254,12 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr);
  */
 
 static int
-TRANS(SocketSelectFamily) (int first, char *family)
+TRANS(SocketSelectFamily) (int first, const char *family)
 
 {
     int     i;
 
-    PRMSG (3,"SocketSelectFamily(%s)\n", family, 0, 0);
+    prmsg (3,"SocketSelectFamily(%s)\n", family);
 
     for (i = first + 1; i < NUMSOCKETFAMILIES;i++)
     {
@@ -288,7 +288,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
     void *socknamePtr;
     SOCKLEN_T namelen;
 
-    PRMSG (3,"SocketINETGetAddr(%p)\n", ciptr, 0, 0);
+    prmsg (3,"SocketINETGetAddr(%p)\n", ciptr);
 
 #if defined(IPv6) && defined(AF_INET6)
     namelen = sizeof(socknamev6);
@@ -299,15 +299,15 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
 #endif
 
     bzero(socknamePtr, namelen);
-    
+
     if (getsockname (ciptr->fd,(struct sockaddr *) socknamePtr,
                     (void *)&namelen) < 0)
     {
 #ifdef WIN32
        errno = WSAGetLastError();
 #endif
-       PRMSG (1,"SocketINETGetAddr: getsockname() failed: %d\n",
-           EGET(),0, 0);
+       prmsg (1,"SocketINETGetAddr: getsockname() failed: %d\n",
+           EGET());
        return -1;
     }
 
@@ -315,11 +315,10 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
      * Everything looks good: fill in the XtransConnInfo structure.
      */
 
-    if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
+    if ((ciptr->addr = malloc (namelen)) == NULL)
     {
-        PRMSG (1,
-           "SocketINETGetAddr: Can't allocate space for the addr\n",
-           0, 0, 0);
+        prmsg (1,
+           "SocketINETGetAddr: Can't allocate space for the addr\n");
         return -1;
     }
 
@@ -365,8 +364,8 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
     }
 
     bzero(socknamePtr, namelen);
-    
-    PRMSG (3,"SocketINETGetPeerAddr(%p)\n", ciptr, 0, 0);
+
+    prmsg (3,"SocketINETGetPeerAddr(%p)\n", ciptr);
 
     if (getpeername (ciptr->fd, (struct sockaddr *) socknamePtr,
                     (void *)&namelen) < 0)
@@ -374,8 +373,8 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
 #ifdef WIN32
        errno = WSAGetLastError();
 #endif
-       PRMSG (1,"SocketINETGetPeerAddr: getpeername() failed: %d\n",
-           EGET(), 0, 0);
+       prmsg (1,"SocketINETGetPeerAddr: getpeername() failed: %d\n",
+           EGET());
        return -1;
     }
 
@@ -383,11 +382,10 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
      * Everything looks good: fill in the XtransConnInfo structure.
      */
 
-    if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
+    if ((ciptr->peeraddr = malloc (namelen)) == NULL)
     {
-        PRMSG (1,
-          "SocketINETGetPeerAddr: Can't allocate space for the addr\n",
-          0, 0, 0);
+        prmsg (1,
+          "SocketINETGetPeerAddr: Can't allocate space for the addr\n");
         return -1;
     }
 
@@ -404,12 +402,11 @@ TRANS(SocketOpen) (int i, int type)
 {
     XtransConnInfo     ciptr;
 
-    PRMSG (3,"SocketOpen(%d,%d)\n", i, type, 0);
+    prmsg (3,"SocketOpen(%d,%d)\n", i, type);
 
-    if ((ciptr = (XtransConnInfo) xcalloc (
-       1, sizeof(struct _XtransConnInfo))) == NULL)
+    if ((ciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL)
     {
-       PRMSG (1, "SocketOpen: malloc failed\n", 0, 0, 0);
+       prmsg (1, "SocketOpen: malloc failed\n");
        return NULL;
     }
 
@@ -424,10 +421,10 @@ TRANS(SocketOpen) (int i, int type)
 #ifdef WIN32
        errno = WSAGetLastError();
 #endif
-       PRMSG (2, "SocketOpen: socket() failed for %s\n",
-           Sockettrans2devtab[i].transname, 0, 0);
+       prmsg (2, "SocketOpen: socket() failed for %s\n",
+           Sockettrans2devtab[i].transname);
 
-       xfree ((char *) ciptr);
+       free (ciptr);
        return NULL;
     }
 
@@ -455,60 +452,64 @@ TRANS(SocketOpen) (int i, int type)
 #ifdef TRANS_REOPEN
 
 static XtransConnInfo
-TRANS(SocketReopen) (int i, int type, int fd, char *port)
+TRANS(SocketReopen) (int i _X_UNUSED, int type, int fd, char *port)
 
 {
     XtransConnInfo     ciptr;
     int portlen;
     struct sockaddr *addr;
+    size_t addrlen;
 
-    PRMSG (3,"SocketReopen(%d,%d,%s)\n", type, fd, port);
+    prmsg (3,"SocketReopen(%d,%d,%s)\n", type, fd, port);
 
     if (port == NULL) {
-      PRMSG (1, "SocketReopen: port was null!\n", 0, 0, 0);
+      prmsg (1, "SocketReopen: port was null!\n");
       return NULL;
     }
 
     portlen = strlen(port) + 1; // include space for trailing null
 #ifdef SOCK_MAXADDRLEN
     if (portlen < 0 || portlen > (SOCK_MAXADDRLEN + 2)) {
-      PRMSG (1, "SocketReopen: invalid portlen %d\n", portlen, 0, 0);
+      prmsg (1, "SocketReopen: invalid portlen %d\n", portlen);
       return NULL;
     }
     if (portlen < 14) portlen = 14;
 #else
     if (portlen < 0 || portlen > 14) {
-      PRMSG (1, "SocketReopen: invalid portlen %d\n", portlen, 0, 0);
+      prmsg (1, "SocketReopen: invalid portlen %d\n", portlen);
       return NULL;
     }
 #endif /*SOCK_MAXADDRLEN*/
 
-    if ((ciptr = (XtransConnInfo) xcalloc (
-       1, sizeof(struct _XtransConnInfo))) == NULL)
+    if ((ciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL)
     {
-       PRMSG (1, "SocketReopen: malloc(ciptr) failed\n", 0, 0, 0);
+       prmsg (1, "SocketReopen: malloc(ciptr) failed\n");
        return NULL;
     }
 
     ciptr->fd = fd;
 
-    if ((addr = (struct sockaddr *) xcalloc (1, portlen + 2)) == NULL) {
-       PRMSG (1, "SocketReopen: malloc(addr) failed\n", 0, 0, 0);
+    addrlen = portlen + offsetof(struct sockaddr, sa_data);
+    if ((addr = calloc (1, addrlen)) == NULL) {
+       prmsg (1, "SocketReopen: malloc(addr) failed\n");
+       free (ciptr);
        return NULL;
     }
     ciptr->addr = (char *) addr;
-    ciptr->addrlen = portlen + 2;
+    ciptr->addrlen = addrlen;
 
-    if ((ciptr->peeraddr = (char *) xcalloc (1, portlen + 2)) == NULL) {
-       PRMSG (1, "SocketReopen: malloc(portaddr) failed\n", 0, 0, 0);
+    if ((ciptr->peeraddr = calloc (1, addrlen)) == NULL) {
+       prmsg (1, "SocketReopen: malloc(portaddr) failed\n");
+       free (addr);
+       free (ciptr);
        return NULL;
     }
-    ciptr->peeraddrlen = portlen + 2;
+    ciptr->peeraddrlen = addrlen;
 
     /* Initialize ciptr structure as if it were a normally-opened unix socket */
     ciptr->flags = TRANS_LOCAL | TRANS_NOUNLINK;
 #ifdef BSD44SOCKETS
-    addr->sa_len = portlen + 1;
+    addr->sa_len = addrlen;
 #endif
     addr->sa_family = AF_UNIX;
 #ifdef HAS_STRLCPY
@@ -517,7 +518,7 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
     strncpy(addr->sa_data, port, portlen);
 #endif
     ciptr->family = AF_UNIX;
-    memcpy(ciptr->peeraddr, ciptr->addr, sizeof(struct sockaddr));
+    memcpy(ciptr->peeraddr, ciptr->addr, addrlen);
     ciptr->port = rindex(addr->sa_data, ':');
     if (ciptr->port == NULL) {
        if (is_numeric(addr->sa_data)) {
@@ -540,13 +541,13 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
 #ifdef TRANS_CLIENT
 
 static XtransConnInfo
-TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
-                               char *host, char *port, int previndex)
+TRANS(SocketOpenCOTSClientBase) (const char *transname, const char *protocol,
+                          const char *host, const char *port, int previndex)
 {
     XtransConnInfo     ciptr;
     int                        i = previndex;
 
-    PRMSG (2, "SocketOpenCOTSClient(%s,%s,%s)\n",
+    prmsg (2, "SocketOpenCOTSClient(%s,%s,%s)\n",
        protocol, host, port);
 
     SocketInitOnce();
@@ -562,11 +563,11 @@ TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
     }
     if (i < 0) {
        if (i == -1)
-           PRMSG (1,"SocketOpenCOTSClient: Unable to open socket for %s\n",
-                  transname, 0, 0);
+           prmsg (1,"SocketOpenCOTSClient: Unable to open socket for %s\n",
+                  transname);
        else
-           PRMSG (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n",
-                  transname, 0, 0);
+           prmsg (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n",
+                  transname);
        return NULL;
     }
 
@@ -574,7 +575,7 @@ TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
 }
 
 static XtransConnInfo
-TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol, 
+TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol,
                             char *host, char *port)
 {
     return TRANS(SocketOpenCOTSClientBase)(
@@ -588,14 +589,14 @@ TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol,
 #ifdef TRANS_SERVER
 
 static XtransConnInfo
-TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol, 
+TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
                             char *host, char *port)
 
 {
     XtransConnInfo     ciptr;
     int        i = -1;
 
-    PRMSG (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port);
+    prmsg (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port);
 
     SocketInitOnce();
 
@@ -606,11 +607,11 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
     }
     if (i < 0) {
        if (i == -1)
-           PRMSG (1,"SocketOpenCOTSServer: Unable to open socket for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketOpenCOTSServer: Unable to open socket for %s\n",
+                  thistrans->TransName);
        else
-           PRMSG (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n",
+                  thistrans->TransName);
        return NULL;
     }
 
@@ -655,14 +656,14 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
 #ifdef TRANS_CLIENT
 
 static XtransConnInfo
-TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol, 
+TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
                             char *host, char *port)
 
 {
     XtransConnInfo     ciptr;
     int                        i = -1;
 
-    PRMSG (2,"SocketOpenCLTSClient(%s,%s,%s)\n", protocol, host, port);
+    prmsg (2,"SocketOpenCLTSClient(%s,%s,%s)\n", protocol, host, port);
 
     SocketInitOnce();
 
@@ -673,11 +674,11 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
     }
     if (i < 0) {
        if (i == -1)
-           PRMSG (1,"SocketOpenCLTSClient: Unable to open socket for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketOpenCLTSClient: Unable to open socket for %s\n",
+                  thistrans->TransName);
        else
-           PRMSG (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n",
+                  thistrans->TransName);
        return NULL;
     }
 
@@ -694,14 +695,14 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
 #ifdef TRANS_SERVER
 
 static XtransConnInfo
-TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol, 
+TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
                             char *host, char *port)
 
 {
     XtransConnInfo     ciptr;
     int        i = -1;
 
-    PRMSG (2,"SocketOpenCLTSServer(%s,%s,%s)\n", protocol, host, port);
+    prmsg (2,"SocketOpenCLTSServer(%s,%s,%s)\n", protocol, host, port);
 
     SocketInitOnce();
 
@@ -712,11 +713,11 @@ TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
     }
     if (i < 0) {
        if (i == -1)
-           PRMSG (1,"SocketOpenCLTSServer: Unable to open socket for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketOpenCLTSServer: Unable to open socket for %s\n",
+                  thistrans->TransName);
        else
-           PRMSG (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n",
+                  thistrans->TransName);
        return NULL;
     }
 
@@ -746,8 +747,8 @@ TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
     XtransConnInfo     ciptr;
     int                        i = -1;
 
-    PRMSG (2,
-       "SocketReopenCOTSServer(%d, %s)\n", fd, port, 0);
+    prmsg (2,
+       "SocketReopenCOTSServer(%d, %s)\n", fd, port);
 
     SocketInitOnce();
 
@@ -758,11 +759,11 @@ TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
     }
     if (i < 0) {
        if (i == -1)
-           PRMSG (1,"SocketReopenCOTSServer: Unable to open socket for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketReopenCOTSServer: Unable to open socket for %s\n",
+                  thistrans->TransName);
        else
-           PRMSG (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n",
+                  thistrans->TransName);
        return NULL;
     }
 
@@ -780,8 +781,8 @@ TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
     XtransConnInfo     ciptr;
     int                        i = -1;
 
-    PRMSG (2,
-       "SocketReopenCLTSServer(%d, %s)\n", fd, port, 0);
+    prmsg (2,
+       "SocketReopenCLTSServer(%d, %s)\n", fd, port);
 
     SocketInitOnce();
 
@@ -792,11 +793,11 @@ TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
     }
     if (i < 0) {
        if (i == -1)
-           PRMSG (1,"SocketReopenCLTSServer: Unable to open socket for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketReopenCLTSServer: Unable to open socket for %s\n",
+                  thistrans->TransName);
        else
-           PRMSG (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n",
-                  thistrans->TransName, 0, 0);
+           prmsg (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n",
+                  thistrans->TransName);
        return NULL;
     }
 
@@ -814,7 +815,7 @@ static int
 TRANS(SocketSetOption) (XtransConnInfo ciptr, int option, int arg)
 
 {
-    PRMSG (2,"SocketSetOption(%d,%d,%d)\n", ciptr->fd, option, arg);
+    prmsg (2,"SocketSetOption(%d,%d,%d)\n", ciptr->fd, option, arg);
 
     return -1;
 }
@@ -842,7 +843,7 @@ set_sun_path(const char *port, const char *upath, char *path, int abstract)
 
     if (strlen(port) + strlen(upath) > maxlen)
        return -1;
-    sprintf(path, "%s%s%s", at, upath, port);
+    snprintf(path, sizeof(s.sun_path), "%s%s%s", at, upath, port);
     return 0;
 }
 #endif
@@ -850,7 +851,7 @@ set_sun_path(const char *port, const char *upath, char *path, int abstract)
 #ifdef TRANS_SERVER
 
 static int
-TRANS(SocketCreateListener) (XtransConnInfo ciptr, 
+TRANS(SocketCreateListener) (XtransConnInfo ciptr,
                             struct sockaddr *sockname,
                             int socknamelen, unsigned int flags)
 
@@ -859,7 +860,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
     int        fd = ciptr->fd;
     int        retry;
 
-    PRMSG (3, "SocketCreateListener(%x,%p)\n", ciptr, fd, 0);
+    prmsg (3, "SocketCreateListener(%p,%d)\n", ciptr, fd);
 
     if (Sockettrans2devtab[ciptr->index].family == AF_INET
 #if defined(IPv6) && defined(AF_INET6)
@@ -878,10 +879,9 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
            else
                return TRANS_ADDR_IN_USE;
        }
-       
+
        if (retry-- == 0) {
-           PRMSG (1, "SocketCreateListener: failed to bind listener\n",
-               0, 0, 0);
+           prmsg (1, "SocketCreateListener: failed to bind listener\n");
            close (fd);
            return TRANS_CREATE_LISTENER_FAILED;
        }
@@ -912,11 +912,11 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
 
     if (listen (fd, BACKLOG) < 0)
     {
-       PRMSG (1, "SocketCreateListener: listen() failed\n", 0, 0, 0);
+       prmsg (1, "SocketCreateListener: listen() failed\n");
        close (fd);
        return TRANS_CREATE_LISTENER_FAILED;
     }
-       
+
     /* Set a flag to indicate that this connection is a listener */
 
     ciptr->flags = 1 | (ciptr->flags & TRANS_KEEPFLAGS);
@@ -946,8 +946,8 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
 #ifdef X11_t
     char       portbuf[PORTBUFSIZE];
 #endif
-    
-    PRMSG (2, "SocketINETCreateListener(%s)\n", port, 0, 0);
+
+    prmsg (2, "SocketINETCreateListener(%s)\n", port);
 
 #ifdef X11_t
     /*
@@ -963,7 +963,7 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
     {
        /* fixup the server port address */
        tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
-       sprintf (portbuf,"%lu", tmpport);
+       snprintf (portbuf, sizeof(portbuf), "%lu", tmpport);
        port = portbuf;
     }
 #endif
@@ -976,9 +976,9 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
        {
            if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL)
            {
-               PRMSG (1,
+               prmsg (1,
             "SocketINETCreateListener: Unable to get service for %s\n",
-                     port, 0, 0);
+                     port);
                return TRANS_CREATE_LISTENER_FAILED;
            }
            /* we trust getservbyname to return a valid number */
@@ -987,11 +987,11 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
        else
        {
            tmpport = strtol (port, (char**)NULL, 10);
-           /* 
+           /*
             * check that somehow the port address isn't negative or in
             * the range of reserved port addresses. This can happen and
-            * be very bad if the server is suid-root and the user does 
-            * something (dumb) like `X :60049`. 
+            * be very bad if the server is suid-root and the user does
+            * something (dumb) like `X :60049`.
             */
            if (tmpport < 1024 || tmpport > USHRT_MAX)
                return TRANS_CREATE_LISTENER_FAILED;
@@ -1033,17 +1033,15 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
     if ((status = TRANS(SocketCreateListener) (ciptr,
        (struct sockaddr *) &sockname, namelen, flags)) < 0)
     {
-       PRMSG (1,
-    "SocketINETCreateListener: ...SocketCreateListener() failed\n",
-           0, 0, 0);
+       prmsg (1,
+    "SocketINETCreateListener: ...SocketCreateListener() failed\n");
        return status;
     }
 
     if (TRANS(SocketINETGetAddr) (ciptr) < 0)
     {
-       PRMSG (1,
-       "SocketINETCreateListener: ...SocketINETGetAddr() failed\n",
-           0, 0, 0);
+       prmsg (1,
+       "SocketINETCreateListener: ...SocketINETGetAddr() failed\n");
        return TRANS_CREATE_LISTENER_FAILED;
     }
 
@@ -1072,8 +1070,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
     abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
 #endif
 
-    PRMSG (2, "SocketUNIXCreateListener(%s)\n",
-       port ? port : "NULL", 0, 0);
+    prmsg (2, "SocketUNIXCreateListener(%s)\n",
+       port ? port : "NULL");
 
     /* Make sure the directory is created */
 
@@ -1086,8 +1084,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
     mode = 0777;
 #endif
     if (!abstract && trans_mkdir(UNIX_DIR, mode) == -1) {
-       PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n",
-              UNIX_DIR, errno, 0);
+       prmsg (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n",
+              UNIX_DIR, errno);
        (void) umask (oldUmask);
        return TRANS_CREATE_LISTENER_FAILED;
     }
@@ -1101,11 +1099,11 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
        port = tmpport;
     }
     if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
-       PRMSG (1, "SocketUNIXCreateListener: path too long\n", 0, 0, 0);
+       prmsg (1, "SocketUNIXCreateListener: path too long\n");
        return TRANS_CREATE_LISTENER_FAILED;
     }
 
-#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) 
+#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__))
     sockname.sun_len = strlen(sockname.sun_path);
 #endif
 
@@ -1125,9 +1123,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
     if ((status = TRANS(SocketCreateListener) (ciptr,
        (struct sockaddr *) &sockname, namelen, flags)) < 0)
     {
-       PRMSG (1,
-    "SocketUNIXCreateListener: ...SocketCreateListener() failed\n",
-           0, 0, 0);
+       prmsg (1,
+    "SocketUNIXCreateListener: ...SocketCreateListener() failed\n");
        (void) umask (oldUmask);
        return status;
     }
@@ -1141,11 +1138,10 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
 
     namelen = sizeof (sockname); /* this will always make it the same size */
 
-    if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
+    if ((ciptr->addr = malloc (namelen)) == NULL)
     {
-        PRMSG (1,
-        "SocketUNIXCreateListener: Can't allocate space for the addr\n",
-           0, 0, 0);
+        prmsg (1,
+        "SocketUNIXCreateListener: Can't allocate space for the addr\n");
        (void) umask (oldUmask);
         return TRANS_CREATE_LISTENER_FAILED;
     }
@@ -1180,7 +1176,7 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
     abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
 #endif
 
-    PRMSG (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd, 0);
+    prmsg (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd);
 
     if (!abstract && (
        stat (unsock->sun_path, &statb) == -1 ||
@@ -1201,8 +1197,8 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
        mode = 0777;
 #endif
         if (trans_mkdir(UNIX_DIR, mode) == -1) {
-            PRMSG (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n",
-           UNIX_DIR, errno, 0);
+            prmsg (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n",
+           UNIX_DIR, errno);
            (void) umask (oldUmask);
            return TRANS_RESET_FAILURE;
         }
@@ -1254,12 +1250,11 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
     struct sockaddr_in sockname;
     SOCKLEN_T          namelen = sizeof(sockname);
 
-    PRMSG (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd, 0);
+    prmsg (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd);
 
-    if ((newciptr = (XtransConnInfo) xcalloc (
-       1, sizeof(struct _XtransConnInfo))) == NULL)
+    if ((newciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL)
     {
-       PRMSG (1, "SocketINETAccept: malloc failed\n", 0, 0, 0);
+       prmsg (1, "SocketINETAccept: malloc failed\n");
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return NULL;
     }
@@ -1270,8 +1265,8 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
 #ifdef WIN32
        errno = WSAGetLastError();
 #endif
-       PRMSG (1, "SocketINETAccept: accept() failed\n", 0, 0, 0);
-       xfree (newciptr);
+       prmsg (1, "SocketINETAccept: accept() failed\n");
+       free (newciptr);
        *status = TRANS_ACCEPT_FAILED;
        return NULL;
     }
@@ -1289,29 +1284,27 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
 #endif
 
     /*
-     * Get this address again because the transport may give a more 
+     * Get this address again because the transport may give a more
      * specific address now that a connection is established.
      */
 
     if (TRANS(SocketINETGetAddr) (newciptr) < 0)
     {
-       PRMSG (1,
-           "SocketINETAccept: ...SocketINETGetAddr() failed:\n",
-           0, 0, 0);
+       prmsg (1,
+           "SocketINETAccept: ...SocketINETGetAddr() failed:\n");
        close (newciptr->fd);
-       xfree (newciptr);
+       free (newciptr);
        *status = TRANS_ACCEPT_MISC_ERROR;
         return NULL;
     }
 
     if (TRANS(SocketINETGetPeerAddr) (newciptr) < 0)
     {
-       PRMSG (1,
-         "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n",
-               0, 0, 0);
+       prmsg (1,
+         "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n");
        close (newciptr->fd);
-       if (newciptr->addr) xfree (newciptr->addr);
-       xfree (newciptr);
+       if (newciptr->addr) free (newciptr->addr);
+       free (newciptr);
        *status = TRANS_ACCEPT_MISC_ERROR;
         return NULL;
     }
@@ -1333,12 +1326,11 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
     struct sockaddr_un sockname;
     SOCKLEN_T          namelen = sizeof sockname;
 
-    PRMSG (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd, 0);
+    prmsg (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd);
 
-    if ((newciptr = (XtransConnInfo) xcalloc (
-       1, sizeof(struct _XtransConnInfo))) == NULL)
+    if ((newciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL)
     {
-       PRMSG (1, "SocketUNIXAccept: malloc() failed\n", 0, 0, 0);
+       prmsg (1, "SocketUNIXAccept: malloc() failed\n");
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return NULL;
     }
@@ -1346,8 +1338,8 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
     if ((newciptr->fd = accept (ciptr->fd,
        (struct sockaddr *) &sockname, (void *)&namelen)) < 0)
     {
-       PRMSG (1, "SocketUNIXAccept: accept() failed\n", 0, 0, 0);
-       xfree (newciptr);
+       prmsg (1, "SocketUNIXAccept: accept() failed\n");
+       free (newciptr);
        *status = TRANS_ACCEPT_FAILED;
        return NULL;
     }
@@ -1358,13 +1350,12 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
      * since this is unix domain.
      */
 
-    if ((newciptr->addr = (char *) xalloc (ciptr->addrlen)) == NULL)
+    if ((newciptr->addr = malloc (ciptr->addrlen)) == NULL)
     {
-        PRMSG (1,
-        "SocketUNIXAccept: Can't allocate space for the addr\n",
-             0, 0, 0);
+        prmsg (1,
+        "SocketUNIXAccept: Can't allocate space for the addr\n");
        close (newciptr->fd);
-       xfree (newciptr);
+       free (newciptr);
        *status = TRANS_ACCEPT_BAD_MALLOC;
         return NULL;
     }
@@ -1377,18 +1368,17 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
     newciptr->addrlen = ciptr->addrlen;
     memcpy (newciptr->addr, ciptr->addr, newciptr->addrlen);
 
-    if ((newciptr->peeraddr = (char *) xalloc (ciptr->addrlen)) == NULL)
+    if ((newciptr->peeraddr = malloc (ciptr->addrlen)) == NULL)
     {
-        PRMSG (1,
-             "SocketUNIXAccept: Can't allocate space for the addr\n",
-             0, 0, 0);
+        prmsg (1,
+             "SocketUNIXAccept: Can't allocate space for the addr\n");
        close (newciptr->fd);
-       if (newciptr->addr) xfree (newciptr->addr);
-       xfree (newciptr);
+       if (newciptr->addr) free (newciptr->addr);
+       free (newciptr);
        *status = TRANS_ACCEPT_BAD_MALLOC;
         return NULL;
     }
-    
+
     newciptr->peeraddrlen = ciptr->addrlen;
     memcpy (newciptr->peeraddr, ciptr->addr, newciptr->addrlen);
 
@@ -1411,7 +1401,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
 #if defined(IPv6) && defined(AF_INET6)
 struct addrlist {
     struct addrinfo *  addr;
-    struct addrinfo *  firstaddr; 
+    struct addrinfo *  firstaddr;
     char               port[PORTBUFSIZE];
     char               host[MAXHOSTNAMELEN];
 };
@@ -1430,23 +1420,23 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
     struct addrinfo    hints;
     char               ntopbuf[INET6_ADDRSTRLEN];
     int                        resetonce = 0;
-#endif
+#else
     struct sockaddr_in sockname;
+    struct hostent     *hostp;
+    struct servent     *servp;
+    unsigned long      tmpaddr;
+#endif
 #ifdef XTHREADS_NEEDS_BYNAMEPARAMS
     _Xgethostbynameparams hparams;
     _Xgetservbynameparams sparams;
 #endif
-    struct hostent     *hostp;
-    struct servent     *servp;
-    unsigned long      tmpaddr;
 #ifdef X11_t
     char       portbuf[PORTBUFSIZE];
 #endif
 
-    long               tmpport;
     char               hostnamebuf[256];               /* tmp space */
 
-    PRMSG (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port);
+    prmsg (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port);
 
     if (!host)
     {
@@ -1467,8 +1457,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
 
     if (is_numeric (port))
     {
-       tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
-       sprintf (portbuf, "%lu", tmpport);
+       long tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
+       snprintf (portbuf, sizeof(portbuf), "%lu", tmpport);
        port = portbuf;
     }
 #endif
@@ -1497,7 +1487,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
 
            res = getaddrinfo(host,port,&hints,&addrlist->firstaddr);
            if (res != 0) {
-               PRMSG (1, "SocketINETConnect() can't get address "
+               prmsg (1, "SocketINETConnect() can't get address "
                        "for %s:%s: %s\n", host, port, gai_strerror(res));
                ESET(EINVAL);
                return TRANS_CONNECT_FAILED;
@@ -1506,24 +1496,24 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
                 addrlist->addr ; res++) {
                addrlist->addr = addrlist->addr->ai_next;
            }
-           PRMSG(4,"Got New Address list with %d addresses\n", res, 0, 0);
+           prmsg(4,"Got New Address list with %d addresses\n", res);
            res = 0;
            addrlist->addr = NULL;
        }
 
        while (socketaddr == NULL) {
            if (addrlist->addr == NULL) {
-               if (resetonce) { 
+               if (resetonce) {
                    /* Already checked entire list - no usable addresses */
-                   PRMSG (1, "SocketINETConnect() no usable address "
-                          "for %s:%s\n", host, port, 0);
+                   prmsg (1, "SocketINETConnect() no usable address "
+                          "for %s:%s\n", host, port);
                    return TRANS_CONNECT_FAILED;
                } else {
                    /* Go back to beginning of list */
                    resetonce = 1;
                    addrlist->addr = addrlist->firstaddr;
                }
-           } 
+           }
 
            socketaddr = addrlist->addr->ai_addr;
            socketaddrlen = addrlist->addr->ai_addrlen;
@@ -1531,12 +1521,12 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
            if (addrlist->addr->ai_family == AF_INET) {
                struct sockaddr_in *sin = (struct sockaddr_in *) socketaddr;
 
-               PRMSG (4,"SocketINETConnect() sockname.sin_addr = %s\n",
+               prmsg (4,"SocketINETConnect() sockname.sin_addr = %s\n",
                        inet_ntop(addrlist->addr->ai_family,&sin->sin_addr,
-                       ntopbuf,sizeof(ntopbuf)), 0, 0); 
+                       ntopbuf,sizeof(ntopbuf)));
 
-               PRMSG (4,"SocketINETConnect() sockname.sin_port = %d\n",
-                       ntohs(sin->sin_port), 0, 0); 
+               prmsg (4,"SocketINETConnect() sockname.sin_port = %d\n",
+                       ntohs(sin->sin_port));
 
                if (Sockettrans2devtab[ciptr->index].family == AF_INET6) {
                    if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -1558,26 +1548,24 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
                            Sockettrans2devtab[newciptr->index].family !=
                                AF_INET) {
                            socketaddr = NULL;
-                           PRMSG (4,"SocketINETConnect() Cannot get IPv4 "
-                                       " socketfor IPv4 address\n", 0,0,0);
+                           prmsg (4,"SocketINETConnect() Cannot get IPv4 "
+                                       " socketfor IPv4 address\n");
                        }
                        if (newciptr)
-                           xfree(newciptr);
+                           free(newciptr);
                    } else {
                        socketaddr = NULL;
-                       PRMSG (4,"SocketINETConnect Skipping IPv4 address\n",
-                               0,0,0);
+                       prmsg (4,"SocketINETConnect Skipping IPv4 address\n");
                    }
                }
            } else if (addrlist->addr->ai_family == AF_INET6) {
                struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) socketaddr;
-       
-               PRMSG (4,"SocketINETConnect() sockname.sin6_addr = %s\n",
+
+               prmsg (4,"SocketINETConnect() sockname.sin6_addr = %s\n",
                        inet_ntop(addrlist->addr->ai_family,
-                                 &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)),
-                       0, 0); 
-               PRMSG (4,"SocketINETConnect() sockname.sin6_port = %d\n",
-                       ntohs(sin6->sin6_port), 0, 0); 
+                                 &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)));
+               prmsg (4,"SocketINETConnect() sockname.sin6_port = %d\n",
+                       ntohs(sin6->sin6_port));
 
                if (Sockettrans2devtab[ciptr->index].family == AF_INET) {
                    if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -1596,17 +1584,16 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
                            Sockettrans2devtab[newciptr->index].family !=
                                        AF_INET6) {
                            socketaddr = NULL;
-                           PRMSG (4,"SocketINETConnect() Cannot get IPv6 "
-                                  "socket for IPv6 address\n", 0,0,0);
+                           prmsg (4,"SocketINETConnect() Cannot get IPv6 "
+                                  "socket for IPv6 address\n");
                        }
                        if (newciptr)
-                           xfree(newciptr);
+                           free(newciptr);
                    }
                    else
                    {
                        socketaddr = NULL;
-                       PRMSG (4,"SocketINETConnect() Skipping IPv6 address\n",
-                               0,0,0);
+                       prmsg (4,"SocketINETConnect() Skipping IPv6 address\n");
                    }
                }
            } else {
@@ -1615,7 +1602,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
            if (socketaddr == NULL) {
                addrlist->addr = addrlist->addr->ai_next;
            }
-       } 
+       }
     }
 #else
     {
@@ -1644,21 +1631,21 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
            tmpaddr = INADDR_NONE;
        }
 
-       PRMSG (4,"SocketINETConnect() inet_addr(%s) = %x\n", host, tmpaddr, 0);
+       prmsg (4,"SocketINETConnect() inet_addr(%s) = %x\n", host, tmpaddr);
 
        if (tmpaddr == INADDR_NONE) {
            if ((hostp = _XGethostbyname(host,hparams)) == NULL) {
-               PRMSG (1,"SocketINETConnect: Can't get address for %s\n",
-                       host, 0, 0);
+               prmsg (1,"SocketINETConnect: Can't get address for %s\n",
+                       host);
                ESET(EINVAL);
                return TRANS_CONNECT_FAILED;
            }
            if (hostp->h_addrtype != AF_INET) {  /* is IP host? */
-               PRMSG (1,"SocketINETConnect: not INET host%s\n", host, 0, 0);
+               prmsg (1,"SocketINETConnect: not INET host%s\n", host);
                ESET(EPROTOTYPE);
                return TRANS_CONNECT_FAILED;
            }
-       
+
            memcpy ((char *) &sockname.sin_addr, (char *) hostp->h_addr,
                    sizeof (sockname.sin_addr));
 
@@ -1674,20 +1661,20 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
 
        if (!is_numeric (port)) {
            if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL) {
-               PRMSG (1,"SocketINETConnect: can't get service for %s\n",
-                       port, 0, 0);
+               prmsg (1,"SocketINETConnect: can't get service for %s\n",
+                       port);
                return TRANS_CONNECT_FAILED;
            }
            sockname.sin_port = htons (servp->s_port);
        } else {
-           tmpport = strtol (port, (char**)NULL, 10);
+           long tmpport = strtol (port, (char**)NULL, 10);
            if (tmpport < 1024 || tmpport > USHRT_MAX)
                return TRANS_CONNECT_FAILED;
            sockname.sin_port = htons (((unsigned short) tmpport));
        }
 
-       PRMSG (4,"SocketINETConnect: sockname.sin_port = %d\n",
-               ntohs(sockname.sin_port), 0, 0);
+       prmsg (4,"SocketINETConnect: sockname.sin_port = %d\n",
+               ntohs(sockname.sin_port));
        socketaddr = (struct sockaddr *) &sockname;
        socketaddrlen = sizeof(sockname);
     }
@@ -1737,7 +1724,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
         * number of errors that made us quit before, since those
         * could be caused by trying to use an IPv6 address to contact
         * a machine with an IPv4-only server or other reasons that
-        * only affect one of a set of addresses.  
+        * only affect one of a set of addresses.
         */
 
        if (olderrno == ECONNREFUSED || olderrno == EINTR
@@ -1757,32 +1744,30 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
            res = TRANS_IN_PROGRESS;
        else
        {
-           PRMSG (2,"SocketINETConnect: Can't connect: errno = %d\n",
-                  olderrno,0, 0);
+           prmsg (2,"SocketINETConnect: Can't connect: errno = %d\n",
+                  olderrno);
 
-           res = TRANS_CONNECT_FAILED; 
+           res = TRANS_CONNECT_FAILED;
        }
     } else {
        res = 0;
-    
+
 
        /*
         * Sync up the address fields of ciptr.
         */
-    
+
        if (TRANS(SocketINETGetAddr) (ciptr) < 0)
        {
-           PRMSG (1,
-            "SocketINETConnect: ...SocketINETGetAddr() failed:\n",
-             0, 0, 0);
+           prmsg (1,
+            "SocketINETConnect: ...SocketINETGetAddr() failed:\n");
            res = TRANS_CONNECT_FAILED;
        }
 
        else if (TRANS(SocketINETGetPeerAddr) (ciptr) < 0)
        {
-           PRMSG (1,
-             "SocketINETConnect: ...SocketINETGetPeerAddr() failed:\n",
-             0, 0, 0);
+           prmsg (1,
+             "SocketINETConnect: ...SocketINETGetPeerAddr() failed:\n");
            res = TRANS_CONNECT_FAILED;
        }
     }
@@ -1835,7 +1820,7 @@ UnixHostReallyLocal (char *host)
            for (j = otherhostaddr; j != NULL && equiv == 0; j = j->ai_next) {
                if (i->ai_family == j->ai_family) {
                    if (i->ai_family == AF_INET) {
-                       struct sockaddr_in *sinA 
+                       struct sockaddr_in *sinA
                          = (struct sockaddr_in *) i->ai_addr;
                        struct sockaddr_in *sinB
                          = (struct sockaddr_in *) j->ai_addr;
@@ -1846,9 +1831,9 @@ UnixHostReallyLocal (char *host)
                            equiv = 1;
                        }
                    } else if (i->ai_family == AF_INET6) {
-                       struct sockaddr_in6 *sinA 
+                       struct sockaddr_in6 *sinA
                          = (struct sockaddr_in6 *) i->ai_addr;
-                       struct sockaddr_in6 *sinB 
+                       struct sockaddr_in6 *sinB
                          = (struct sockaddr_in6 *) j->ai_addr;
                        struct in6_addr *A = &sinA->sin6_addr;
                        struct in6_addr *B = &sinB->sin6_addr;
@@ -1860,7 +1845,7 @@ UnixHostReallyLocal (char *host)
                }
            }
        }
-       
+
        freeaddrinfo(localhostaddr);
        freeaddrinfo(otherhostaddr);
        return equiv;
@@ -1890,13 +1875,13 @@ UnixHostReallyLocal (char *host)
             * from the 1st call, so we must save the address list.
             */
 
-           specified_local_addr_list[scount][0] = 
+           specified_local_addr_list[scount][0] =
                                hostp->h_addr_list[scount][0];
-           specified_local_addr_list[scount][1] = 
+           specified_local_addr_list[scount][1] =
                                hostp->h_addr_list[scount][1];
-           specified_local_addr_list[scount][2] = 
+           specified_local_addr_list[scount][2] =
                                hostp->h_addr_list[scount][2];
-           specified_local_addr_list[scount][3] = 
+           specified_local_addr_list[scount][3] =
                                hostp->h_addr_list[scount][3];
            scount++;
        }
@@ -1912,17 +1897,17 @@ UnixHostReallyLocal (char *host)
 
            while (hostp->h_addr_list[j])
            {
-               if ((specified_local_addr_list[i][0] == 
+               if ((specified_local_addr_list[i][0] ==
                                        hostp->h_addr_list[j][0]) &&
-                   (specified_local_addr_list[i][1] == 
+                   (specified_local_addr_list[i][1] ==
                                        hostp->h_addr_list[j][1]) &&
-                   (specified_local_addr_list[i][2] == 
+                   (specified_local_addr_list[i][2] ==
                                        hostp->h_addr_list[j][2]) &&
-                   (specified_local_addr_list[i][3] == 
+                   (specified_local_addr_list[i][3] ==
                                        hostp->h_addr_list[j][3]))
                {
                    /* They're equal, so we're done */
-                   
+
                    equiv = 1;
                    break;
                }
@@ -1950,8 +1935,8 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
     abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
 #endif
 
-    PRMSG (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port);
-    
+    prmsg (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port);
+
     /*
      * Make sure 'host' is really local.  If not, we return failure.
      * The reason we make this check is because a process may advertise
@@ -1962,9 +1947,9 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
 
     if (host && *host && host[0]!='/' && strcmp (host, "unix") != 0 && !UnixHostReallyLocal (host))
     {
-       PRMSG (1,
+       prmsg (1,
           "SocketUNIXConnect: Cannot connect to non-local host %s\n",
-              host, 0, 0);
+              host);
        return TRANS_CONNECT_FAILED;
     }
 
@@ -1975,23 +1960,22 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
 
     if (!port || !*port)
     {
-       PRMSG (1,"SocketUNIXConnect: Missing port specification\n",
-             0, 0, 0);
+       prmsg (1,"SocketUNIXConnect: Missing port specification\n");
        return TRANS_CONNECT_FAILED;
     }
 
     /*
      * Build the socket name.
      */
-    
+
     sockname.sun_family = AF_UNIX;
 
     if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
-       PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0);
+       prmsg (1, "SocketUNIXConnect: path too long\n");
        return TRANS_CONNECT_FAILED;
     }
 
-#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) 
+#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__))
     sockname.sun_len = strlen (sockname.sun_path);
 #endif
 
@@ -2020,11 +2004,11 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
     {
        int olderrno = errno;
        int connected = 0;
-       
+
        if (!connected)
        {
            errno = olderrno;
-           
+
            /*
             * If the error was ENOENT, the server may be starting up; we used
             * to suggest to try again in this case with
@@ -2054,8 +2038,8 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
                    return TRANS_CONNECT_FAILED;
                }
            } else {
-               PRMSG (2,"SocketUNIXConnect: Can't connect: errno = %d\n",
-                      EGET(),0, 0);
+               prmsg (2,"SocketUNIXConnect: Can't connect: errno = %d\n",
+                      EGET());
 
                return TRANS_CONNECT_FAILED;
            }
@@ -2067,12 +2051,11 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
      * since this is unix domain.
      */
 
-    if ((ciptr->addr = (char *) xalloc(namelen)) == NULL ||
-       (ciptr->peeraddr = (char *) xalloc(namelen)) == NULL)
+    if ((ciptr->addr = malloc(namelen)) == NULL ||
+       (ciptr->peeraddr = malloc(namelen)) == NULL)
     {
-        PRMSG (1,
-       "SocketUNIXCreateListener: Can't allocate space for the addr\n",
-             0, 0, 0);
+        prmsg (1,
+       "SocketUNIXCreateListener: Can't allocate space for the addr\n");
         return TRANS_CONNECT_FAILED;
     }
 
@@ -2097,7 +2080,7 @@ static int
 TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend)
 
 {
-    PRMSG (2,"SocketBytesReadable(%p,%d,%p)\n",
+    prmsg (2,"SocketBytesReadable(%p,%d,%p)\n",
        ciptr, ciptr->fd, pend);
 #ifdef WIN32
     {
@@ -2106,7 +2089,7 @@ TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend)
        return ret;
     }
 #else
-#if defined(__i386__) && defined(SYSV) && !defined(SCO325) 
+#if defined(__i386__) && defined(SYSV) && !defined(SCO325)
     return ioctl (ciptr->fd, I_NREAD, (char *) pend);
 #else
     return ioctl (ciptr->fd, FIONREAD, (char *) pend);
@@ -2119,9 +2102,9 @@ static int
 TRANS(SocketRead) (XtransConnInfo ciptr, char *buf, int size)
 
 {
-    PRMSG (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size);
+    prmsg (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size);
 
-#if defined(WIN32) 
+#if defined(WIN32)
     {
        int ret = recv ((SOCKET)ciptr->fd, buf, size, 0);
 #ifdef WIN32
@@ -2139,9 +2122,9 @@ static int
 TRANS(SocketWrite) (XtransConnInfo ciptr, char *buf, int size)
 
 {
-    PRMSG (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size);
+    prmsg (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size);
 
-#if defined(WIN32) 
+#if defined(WIN32)
     {
        int ret = send ((SOCKET)ciptr->fd, buf, size, 0);
 #ifdef WIN32
@@ -2159,7 +2142,7 @@ static int
 TRANS(SocketReadv) (XtransConnInfo ciptr, struct iovec *buf, int size)
 
 {
-    PRMSG (2,"SocketReadv(%d,%p,%d)\n", ciptr->fd, buf, size);
+    prmsg (2,"SocketReadv(%d,%p,%d)\n", ciptr->fd, buf, size);
 
     return READV (ciptr, buf, size);
 }
@@ -2169,7 +2152,7 @@ static int
 TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size)
 
 {
-    PRMSG (2,"SocketWritev(%d,%p,%d)\n", ciptr->fd, buf, size);
+    prmsg (2,"SocketWritev(%d,%p,%d)\n", ciptr->fd, buf, size);
 
     return WRITEV (ciptr, buf, size);
 }
@@ -2179,10 +2162,10 @@ static int
 TRANS(SocketDisconnect) (XtransConnInfo ciptr)
 
 {
-    PRMSG (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd, 0);
+    prmsg (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd);
 
 #ifdef WIN32
-    { 
+    {
        int ret = shutdown (ciptr->fd, 2);
        if (ret == SOCKET_ERROR) errno = WSAGetLastError();
        return ret;
@@ -2198,7 +2181,7 @@ static int
 TRANS(SocketINETClose) (XtransConnInfo ciptr)
 
 {
-    PRMSG (2,"SocketINETClose(%p,%d)\n", ciptr, ciptr->fd, 0);
+    prmsg (2,"SocketINETClose(%p,%d)\n", ciptr, ciptr->fd);
 
 #ifdef WIN32
     {
@@ -2226,7 +2209,7 @@ TRANS(SocketUNIXClose) (XtransConnInfo ciptr)
     struct sockaddr_un *sockname = (struct sockaddr_un *) ciptr->addr;
     int ret;
 
-    PRMSG (2,"SocketUNIXClose(%p,%d)\n", ciptr, ciptr->fd, 0);
+    prmsg (2,"SocketUNIXClose(%p,%d)\n", ciptr, ciptr->fd);
 
     ret = close(ciptr->fd);
 
@@ -2253,8 +2236,8 @@ TRANS(SocketUNIXCloseForCloning) (XtransConnInfo ciptr)
 
     int ret;
 
-    PRMSG (2,"SocketUNIXCloseForCloning(%p,%d)\n",
-       ciptr, ciptr->fd, 0);
+    prmsg (2,"SocketUNIXCloseForCloning(%p,%d)\n",
+       ciptr, ciptr->fd);
 
     ret = close(ciptr->fd);
 
@@ -2266,7 +2249,7 @@ TRANS(SocketUNIXCloseForCloning) (XtransConnInfo ciptr)
 
 #ifdef TCPCONN
 # ifdef TRANS_SERVER
-static char* tcp_nolisten[] = {
+static const char* tcp_nolisten[] = {
        "inet",
 #if defined(IPv6) && defined(AF_INET6)
        "inet6",
@@ -2449,7 +2432,7 @@ Xtransport        TRANS(SocketLocalFuncs) = {
 static char* unix_nolisten[] = { "local" , NULL };
 #  endif
 # endif
-           
+
 Xtransport     TRANS(SocketUNIXFuncs) = {
        /* Socket Interface */
        "unix",
index a9dfc21..397c946 100644 (file)
@@ -75,33 +75,33 @@ static TLItrans2dev TLItrans2devtab[] = {
 };
 
 #define NUMTLIFAMILIES (sizeof(TLItrans2devtab)/sizeof(TLItrans2dev))
-    
+
 /*
  * The local TLI connection, is a form of a local connection, so use a
  * sockaddr_un for the address so that it will be treated just like the other
  * local transports such as UNIX domain sockets, pts, and named.
  */
-    
+
 #if defined(X11_t)
 #define TLINODENAME    "TLI:xserver"
 #endif
-    
+
 #if defined(XIM_t)
 #define TLINODENAME    "TLI:xim"
 #endif
-    
+
 #if defined(FS_t) || defined(FONT_t)
 #define TLINODENAME    "TLI:fontserver"
 #endif
-    
+
 #if defined(ICE_t)
 #define TLINODENAME    "TLI:ICE"
 #endif
-    
+
 #if defined(TEST_t)
 #define TLINODENAME    "TLI:test"
 #endif
-    
+
 #ifndef PORTBUFSIZE
 #ifdef TRANS_SERVER
 #define PORTBUFSIZE    64
@@ -122,9 +122,9 @@ TRANS(TLISelectFamily)(char *family)
 
 {
     int     i;
-    
-    PRMSG(3,"TLISelectFamily(%s)\n", family, 0,0 );
-    
+
+    prmsg(3,"TLISelectFamily(%s)\n", family);
+
     for(i=0;i<NUMTLIFAMILIES;i++)
     {
        if( !strcmp(family,TLItrans2devtab[i].transname) )
@@ -145,41 +145,40 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
 {
     Xtransaddr         sockname;
     struct netbuf      netbuf;
-    
-    PRMSG(3,"TLIGetAddr(%x)\n", ciptr, 0,0 );
-    
+
+    prmsg(3,"TLIGetAddr(%x)\n", ciptr);
+
     netbuf.buf=(char *)&sockname;
     netbuf.len=sizeof(sockname);
     netbuf.maxlen=sizeof(sockname);
-    
+
     if( t_getname(ciptr->fd,&netbuf,LOCALNAME) < 0 )
     {
-       PRMSG(1,"TLIGetAddr: t_getname(LOCALNAME) failed: %d\n",
-             errno, 0,0 );
+       prmsg(1,"TLIGetAddr: t_getname(LOCALNAME) failed: %d\n",
+             errno);
        return -1;
     }
-    
-    PRMSG(4,"TLIGetAddr: got family %d len %d\n",
-         ((struct sockaddr *) &sockname)->sa_family ,netbuf.len, 0 );
-    
+
+    prmsg(4,"TLIGetAddr: got family %d len %d\n",
+         ((struct sockaddr *) &sockname)->sa_family ,netbuf.len);
+
     /*
      * Everything looks good: fill in the XtransConnInfo structure.
      */
-    
+
     if( ciptr->addr )
-       xfree(ciptr->addr);
-    
-    if( (ciptr->addr=(char *)xalloc(netbuf.len)) == NULL )
+       free(ciptr->addr);
+
+    if( (ciptr->addr = malloc(netbuf.len)) == NULL )
     {
-       PRMSG(1, "TLIGetAddr: Can't allocate space for the addr\n",
-             0,0,0);
+       prmsg(1, "TLIGetAddr: Can't allocate space for the addr\n");
        return -1;
     }
-    
+
     ciptr->family=((struct sockaddr *) &sockname)->sa_family;
     ciptr->addrlen=netbuf.len;
     memcpy(ciptr->addr,&sockname,ciptr->addrlen);
-    
+
     return 0;
 }
 
@@ -195,41 +194,40 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
 {
     Xtransaddr         sockname;
     struct netbuf      netbuf;
-    
-    PRMSG(3,"TLIGetPeerAddr(%x)\n", ciptr, 0,0 );
-    
+
+    prmsg(3,"TLIGetPeerAddr(%x)\n", ciptr);
+
     netbuf.buf=(char *)&sockname;
     netbuf.len=sizeof(sockname);
     netbuf.maxlen=sizeof(sockname);
-    
+
     if( t_getname(ciptr->fd,&netbuf,REMOTENAME) < 0 )
     {
-       PRMSG(1,"TLIGetPeerAddr: t_getname(REMOTENAME) failed: %d\n",
-             errno, 0,0 );
+       prmsg(1,"TLIGetPeerAddr: t_getname(REMOTENAME) failed: %d\n",
+             errno);
        return -1;
     }
-    
-    PRMSG(4,"TLIGetPeerAddr: got family %d len %d\n",
-         ((struct sockaddr *) &sockname)->sa_family ,netbuf.len, 0 );
-    
+
+    prmsg(4,"TLIGetPeerAddr: got family %d len %d\n",
+         ((struct sockaddr *) &sockname)->sa_family ,netbuf.len);
+
     /*
      * Everything looks good: fill in the XtransConnInfo structure.
      */
-    
+
     if( ciptr->peeraddr )
-       xfree(ciptr->peeraddr);
-    
-    if( (ciptr->peeraddr=(char *)xalloc(netbuf.len)) == NULL )
+       free(ciptr->peeraddr);
+
+    if( (ciptr->peeraddr = malloc(netbuf.len)) == NULL )
     {
-       PRMSG(1,
-             "TLIGetPeerAddr: Can't allocate space for the addr\n",
-             0,0,0);
+       prmsg(1,
+             "TLIGetPeerAddr: Can't allocate space for the addr\n");
        return -1;
     }
-    
+
     ciptr->peeraddrlen=netbuf.len;
     memcpy(ciptr->peeraddr,&sockname,ciptr->peeraddrlen);
-    
+
     return 0;
 }
 
@@ -250,31 +248,29 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
 {
     struct sockaddr_un *sunaddr=NULL;
     struct t_bind      *req=NULL;
-    
-    PRMSG(2, "TLITLIBindLocal(%d,%d,%s)\n", fd, family, port);
-    
+
+    prmsg(2, "TLITLIBindLocal(%d,%d,%s)\n", fd, family, port);
+
     if( family == AF_UNIX )
     {
        if( (req=(struct t_bind *)t_alloc(fd,T_BIND,0)) == NULL )
        {
-           PRMSG(1,
-                 "TLITLIBindLocal() failed to allocate a t_bind\n",
-                 0,0,0 );
+           prmsg(1,
+                 "TLITLIBindLocal() failed to allocate a t_bind\n");
            return -1;
        }
-       
+
        if( (sunaddr=(struct sockaddr_un *)
             malloc(sizeof(struct sockaddr_un))) == NULL )
        {
-           PRMSG(1,
-                 "TLITLIBindLocal: failed to allocate a sockaddr_un\n",
-                 0,0,0 );
+           prmsg(1,
+                 "TLITLIBindLocal: failed to allocate a sockaddr_un\n");
            t_free((char *)req,T_BIND);
            return -1;
        }
-       
+
        sunaddr->sun_family=AF_UNIX;
-       
+
 #ifdef nuke
        if( *port == '/' ) { /* A full pathname */
            (void) strcpy(sunaddr->sun_path, port);
@@ -282,23 +278,23 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
            (void) sprintf(sunaddr->sun_path,"%s%s", TLINODENAME, port );
        }
 #endif /*NUKE*/
-       
+
        (void) sprintf(sunaddr->sun_path,"%s%d",
                       TLINODENAME, getpid()^time(NULL) );
-       
-       PRMSG(4, "TLITLIBindLocal: binding to %s\n",
-             sunaddr->sun_path, 0,0);
-       
+
+       prmsg(4, "TLITLIBindLocal: binding to %s\n",
+             sunaddr->sun_path);
+
        req->addr.buf=(char *)sunaddr;
        req->addr.len=sizeof(*sunaddr);
        req->addr.maxlen=sizeof(*sunaddr);
     }
-    
+
     if( t_bind(fd, req, NULL) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIBindLocal: Unable to bind TLI device to %s\n",
-             port, 0,0 );
+             port);
        if (sunaddr)
            free((char *) sunaddr);
        if (req)
@@ -313,22 +309,22 @@ TRANS(TLIOpen)(char *device)
 
 {
     XtransConnInfo     ciptr;
-    
-    PRMSG(3,"TLIOpen(%s)\n", device, 0,0 );
-    
-    if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
+
+    prmsg(3,"TLIOpen(%s)\n", device);
+
+    if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
     {
-       PRMSG(1, "TLIOpen: calloc failed\n", 0,0,0 );
+       prmsg(1, "TLIOpen: calloc failed\n");
        return NULL;
     }
-    
+
     if( (ciptr->fd=t_open( device, O_RDWR, NULL )) < 0 )
     {
-       PRMSG(1, "TLIOpen: t_open failed for %s\n", device, 0,0 );
+       prmsg(1, "TLIOpen: t_open failed for %s\n", device);
        free(ciptr);
        return NULL;
     }
-    
+
     return ciptr;
 }
 
@@ -340,23 +336,23 @@ TRANS(TLIReopen)(char *device, int fd, char *port)
 
 {
     XtransConnInfo     ciptr;
-    
-    PRMSG(3,"TLIReopen(%s,%d, %s)\n", device, fd, port );
-    
+
+    prmsg(3,"TLIReopen(%s,%d, %s)\n", device, fd, port );
+
     if (t_sync (fd) < 0)
     {
-       PRMSG(1, "TLIReopen: t_sync failed\n", 0,0,0 );
+       prmsg(1, "TLIReopen: t_sync failed\n");
        return NULL;
     }
 
-    if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
+    if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
     {
-       PRMSG(1, "TLIReopen: calloc failed\n", 0,0,0 );
+       prmsg(1, "TLIReopen: calloc failed\n");
        return NULL;
     }
-    
+
     ciptr->fd = fd;
-    
+
     return ciptr;
 }
 
@@ -364,7 +360,7 @@ TRANS(TLIReopen)(char *device, int fd, char *port)
 
 
 static int
-TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port, 
+TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
                       struct netbuf *netbufp)
 
 {
@@ -373,38 +369,37 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
     struct nd_addrlist *nd_addrlistp = NULL;
     void *handlep;
     long lport;
-    
-    PRMSG(3,"TLIAddrToNetbuf(%d,%s,%s)\n", tlifamily, host, port );
-    
+
+    prmsg(3,"TLIAddrToNetbuf(%d,%s,%s)\n", tlifamily, host, port );
+
     if( (handlep=setnetconfig()) == NULL )
        return -1;
 
     lport = strtol (port, (char**)NULL, 10);
     if (lport < 1024 || lport > USHRT_MAX)
        return -1;
-    
+
     nd_hostserv.h_host = host;
     if( port && *port ) {
        nd_hostserv.h_serv = port;
     } else {
        nd_hostserv.h_serv = NULL;
     }
-    
+
     while( (netconfigp=getnetconfig(handlep)) != NULL )
     {
        if( strcmp(netconfigp->nc_protofmly,
                   TLItrans2devtab[tlifamily].protofamily) != 0 )
            continue;
-       PRMSG(5,"TLIAddrToNetbuf: Trying to resolve %s.%s for %s\n",
+       prmsg(5,"TLIAddrToNetbuf: Trying to resolve %s.%s for %s\n",
              host, port, TLItrans2devtab[tlifamily].protofamily );
        if( netdir_getbyname(netconfigp,&nd_hostserv, &nd_addrlistp) == 0 )
        {
            /* we have at least one address to use */
-           
-           PRMSG(5, "TLIAddrToNetbuf: found address for %s.%s\n", host, port, 0 );
-           PRMSG(5, "TLIAddrToNetbuf: %s\n",taddr2uaddr(netconfigp,nd_addrlistp->n_addrs),
-                 0,0 );
-           
+
+           prmsg(5, "TLIAddrToNetbuf: found address for %s.%s\n", host, port);
+           prmsg(5, "TLIAddrToNetbuf: %s\n",taddr2uaddr(netconfigp,nd_addrlistp->n_addrs));
+
            memcpy(netbufp->buf,nd_addrlistp->n_addrs->buf,
                   nd_addrlistp->n_addrs->len);
            netbufp->len=nd_addrlistp->n_addrs->len;
@@ -413,7 +408,7 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
        }
     }
     endnetconfig(handlep);
-    
+
     return -1;
 }
 
@@ -424,52 +419,52 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
 #ifdef TRANS_CLIENT
 
 static XtransConnInfo
-TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol, 
+TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
                         char *host, char *port)
 
 {
     XtransConnInfo     ciptr;
     int                i;
-    
-    PRMSG(2,"TLIOpenCOTSClient(%s,%s,%s)\n", protocol, host, port );
-    
+
+    prmsg(2,"TLIOpenCOTSClient(%s,%s,%s)\n", protocol, host, port );
+
     if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
     {
-       PRMSG(1,"TLIOpenCOTSClient: Unable to determine device for %s\n",
-             thistrans->TransName, 0,0 );
+       prmsg(1,"TLIOpenCOTSClient: Unable to determine device for %s\n",
+             thistrans->TransName);
        return NULL;
     }
-    
+
     if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
     {
-       PRMSG(1,"TLIOpenCOTSClient: Unable to open device for %s\n",
-             thistrans->TransName, 0,0 );
+       prmsg(1,"TLIOpenCOTSClient: Unable to open device for %s\n",
+             thistrans->TransName);
        return NULL;
     }
-    
+
     if( TRANS(TLITLIBindLocal)(ciptr->fd,TLItrans2devtab[i].family,port) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCOTSClient: ...TLITLIBindLocal() failed: %d\n",
-             errno, 0,0 );
+             errno);
        t_close(ciptr->fd);
-       xfree(ciptr);
+       free(ciptr);
        return NULL;
     }
-    
+
     if( TRANS(TLIGetAddr)(ciptr) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCOTSClient: ...TLIGetAddr() failed: %d\n",
-             errno, 0,0 );
+             errno);
        t_close(ciptr->fd);
-       xfree(ciptr);
+       free(ciptr);
        return NULL;
     }
-    
+
     /* Save the TLIFamily for later use in TLIAddrToNetbuf() lookups */
     ciptr->index = i;
-    
+
     return ciptr;
 }
 
@@ -479,40 +474,40 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
 #ifdef TRANS_SERVER
 
 static XtransConnInfo
-TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol, 
+TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol,
                         char *host, char *port)
 
 {
     XtransConnInfo     ciptr;
     int                i;
-    
-    PRMSG(2,"TLIOpenCOTSServer(%s,%s,%s)\n", protocol, host, port );
-    
+
+    prmsg(2,"TLIOpenCOTSServer(%s,%s,%s)\n", protocol, host, port );
+
     if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCOTSServer: Unable to determine device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
-    
+
     if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCOTSServer: Unable to open device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
-    
+
     /* Set the family type */
 
     ciptr->family = TLItrans2devtab[i].family;
 
 
     /* Save the TLIFamily for later use in TLIAddrToNetbuf() lookups */
-    
+
     ciptr->index = i;
-    
+
     return ciptr;
 }
 
@@ -522,53 +517,53 @@ TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol,
 #ifdef TRANS_CLIENT
 
 static XtransConnInfo
-TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol, 
+TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
                         char *host, char *port)
 
 {
     XtransConnInfo     ciptr;
     int                i;
-    
-    PRMSG(2,"TLIOpenCLTSClient(%s,%s,%s)\n", protocol, host, port );
-    
+
+    prmsg(2,"TLIOpenCLTSClient(%s,%s,%s)\n", protocol, host, port );
+
     if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCLTSClient: Unable to determine device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
-    
+
     if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCLTSClient: Unable to open device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
-    
+
     if( TRANS(TLITLIBindLocal)(ciptr->fd,TLItrans2devtab[i].family,port) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCLTSClient: ...TLITLIBindLocal() failed: %d\n",
-             errno, 0,0 );
+             errno);
        t_close(ciptr->fd);
-       xfree(ciptr);
+       free(ciptr);
        return NULL;
     }
-    
+
     if( TRANS(TLIGetAddr)(ciptr) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCLTSClient: ...TLIGetPeerAddr() failed: %d\n",
-             errno, 0,0 );
+             errno);
        t_close(ciptr->fd);
-       xfree(ciptr);
+       free(ciptr);
        return NULL;
     }
-    
+
     return ciptr;
-}                      
+}
 
 #endif /* TRANS_CLIENT */
 
@@ -576,33 +571,33 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
 #ifdef TRANS_SERVER
 
 static XtransConnInfo
-TRANS(TLIOpenCLTSServer)(Xtransport *thistrans, char *protocol, 
+TRANS(TLIOpenCLTSServer)(Xtransport *thistrans, char *protocol,
                         char *host, char *port)
 
 {
     XtransConnInfo     ciptr;
     int                i;
-    
-    PRMSG(2,"TLIOpenCLTSServer(%s,%s,%s)\n", protocol, host, port );
-    
+
+    prmsg(2,"TLIOpenCLTSServer(%s,%s,%s)\n", protocol, host, port );
+
     if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCLTSServer: Unable to determine device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
-    
+
     if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIOpenCLTSServer: Unable to open device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
-    
+
     return ciptr;
-}                      
+}
 
 #endif /* TRANS_SERVER */
 
@@ -615,30 +610,30 @@ TRANS(TLIReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
 {
     XtransConnInfo     ciptr;
     int                        i;
-    
-    PRMSG(2,"TLIReopenCOTSServer(%d, %s)\n", fd, port, 0 );
-    
+
+    prmsg(2,"TLIReopenCOTSServer(%d, %s)\n", fd, port);
+
     if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIReopenCOTSServer: Unable to determine device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
 
     if( (ciptr=TRANS(TLIReopen)(
        TLItrans2devtab[i].devcotsname, fd, port)) == NULL )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIReopenCOTSServer: Unable to open device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
-    
+
     /* Save the TLIFamily for later use in TLIAddrToNetbuf() lookups */
-    
+
     ciptr->index = i;
-    
+
     return ciptr;
 }
 
@@ -649,30 +644,30 @@ TRANS(TLIReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
 {
     XtransConnInfo     ciptr;
     int                i;
-    
-    PRMSG(2,"TLIReopenCLTSServer(%d, %s)\n", fd, port, 0 );
-    
+
+    prmsg(2,"TLIReopenCLTSServer(%d, %s)\n", fd, port);
+
     if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIReopenCLTSServer: Unable to determine device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
 
     if( (ciptr=TRANS(TLIReopen)(
        TLItrans2devtab[i].devcltsname, fd, port)) == NULL )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIReopenCLTSServer: Unable to open device for %s\n",
-             thistrans->TransName, 0,0 );
+             thistrans->TransName);
        return NULL;
     }
-    
+
     ciptr->index = i;
 
     return ciptr;
-}                      
+}
 
 #endif /* TRANS_REOPEN */
 
@@ -681,8 +676,8 @@ static int
 TRANS(TLISetOption)(XtransConnInfo ciptr, int option, int arg)
 
 {
-    PRMSG(2,"TLISetOption(%d,%d,%d)\n", ciptr->fd, option, arg );
-    
+    prmsg(2,"TLISetOption(%d,%d,%d)\n", ciptr->fd, option, arg );
+
     return -1;
 }
 
@@ -694,54 +689,52 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
 
 {
     struct t_bind      *ret;
-    
-    PRMSG(2,"TLICreateListener(%x->%d,%x)\n", ciptr, ciptr->fd, req );
-    
+
+    prmsg(2,"TLICreateListener(%x->%d,%x)\n", ciptr, ciptr->fd, req );
+
     if( (ret=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,T_ALL)) == NULL )
     {
-       PRMSG(1, "TLICreateListener: failed to allocate a t_bind\n",
-             0,0,0 );
+       prmsg(1, "TLICreateListener: failed to allocate a t_bind\n");
        t_free((char *)req,T_BIND);
        return TRANS_CREATE_LISTENER_FAILED;
     }
-    
+
     if( t_bind(ciptr->fd, req, ret) < 0 )
     {
-       PRMSG(1, "TLICreateListener: t_bind failed\n", 0,0,0 );
+       prmsg(1, "TLICreateListener: t_bind failed\n");
        t_free((char *)req,T_BIND);
        t_free((char *)ret,T_BIND);
        return TRANS_CREATE_LISTENER_FAILED;
     }
-    
+
     if( memcmp(req->addr.buf,ret->addr.buf,req->addr.len) != 0 )
     {
-       PRMSG(1, "TLICreateListener: unable to bind to %x\n",
-             req, 0,0 );
+       prmsg(1, "TLICreateListener: unable to bind to %x\n",
+             req);
        t_free((char *)req,T_BIND);
        t_free((char *)ret,T_BIND);
        return TRANS_ADDR_IN_USE;
     }
-    
+
     /*
      * Everything looks good: fill in the XtransConnInfo structure.
      */
-    
-    if( (ciptr->addr=(char *)xalloc(ret->addr.len)) == NULL )
+
+    if( (ciptr->addr = malloc(ret->addr.len)) == NULL )
     {
-       PRMSG(1,
-             "TLICreateListener: Unable to allocate space for the address\n",
-             0,0,0 );
+       prmsg(1,
+             "TLICreateListener: Unable to allocate space for the address\n");
        t_free((char *)req,T_BIND);
        t_free((char *)ret, T_BIND);
        return TRANS_CREATE_LISTENER_FAILED;
     }
-    
+
     ciptr->addrlen=ret->addr.len;
     memcpy(ciptr->addr,ret->addr.buf,ret->addr.len);
-    
+
     t_free((char *)req,T_BIND);
     t_free((char *)ret, T_BIND);
-    
+
     return 0;
 }
 
@@ -754,10 +747,10 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
     struct t_bind      *req;
     struct sockaddr_in *sinaddr;
     long               tmpport;
-    
-    PRMSG(2,"TLIINETCreateListener(%x->%d,%s)\n", ciptr,
+
+    prmsg(2,"TLIINETCreateListener(%x->%d,%s)\n", ciptr,
        ciptr->fd, port ? port : "NULL" );
-    
+
 #ifdef X11_t
     /*
      * X has a well known port, that is transport dependent. It is easier
@@ -767,7 +760,7 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
      * The port that is passed here is really a string containing the idisplay
      * from ConnectDisplay().
      */
-    
+
     if (is_numeric (port))
     {
        tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
@@ -775,21 +768,20 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
        port = portbuf;
     }
 #endif
-    
+
     if( (req=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,T_ALL)) == NULL )
     {
-       PRMSG(1,
-           "TLIINETCreateListener: failed to allocate a t_bind\n",
-           0,0,0 );
+       prmsg(1,
+           "TLIINETCreateListener: failed to allocate a t_bind\n");
        return TRANS_CREATE_LISTENER_FAILED;
     }
 
     if( port && *port ) {
        if(TRANS(TLIAddrToNetbuf)(ciptr->index,HOST_SELF,port,&(req->addr)) < 0)
        {
-           PRMSG(1,
+           prmsg(1,
                  "TLIINETCreateListener: can't resolve name:HOST_SELF.%s\n",
-                 port, 0,0 );
+                 port);
            t_free((char *)req,T_BIND);
            return TRANS_CREATE_LISTENER_FAILED;
        }
@@ -803,7 +795,7 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
     /* Set the qlen */
 
     req->qlen=1;
-    
+
     return TRANS(TLICreateListener)(ciptr, req);
 }
 
@@ -815,28 +807,26 @@ TRANS(TLITLICreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags
     struct t_bind      *req;
     struct sockaddr_un *sunaddr;
     int                ret_value;
-    
-    PRMSG(2,"TLITLICreateListener(%x->%d,%s)\n", ciptr, ciptr->fd,
+
+    prmsg(2,"TLITLICreateListener(%x->%d,%s)\n", ciptr, ciptr->fd,
        port ? port : "NULL");
-    
+
     if( (req=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,0)) == NULL )
     {
-       PRMSG(1,
-             "TLITLICreateListener: failed to allocate a t_bind\n",
-             0,0,0 );
+       prmsg(1,
+             "TLITLICreateListener: failed to allocate a t_bind\n");
        return TRANS_CREATE_LISTENER_FAILED;
     }
-    
+
     if( (sunaddr=(struct sockaddr_un *)
         malloc(sizeof(struct sockaddr_un))) == NULL )
     {
-       PRMSG(1,
-             "TLITLICreateListener: failed to allocate a sockaddr_un\n",
-             0,0,0 );
+       prmsg(1,
+             "TLITLICreateListener: failed to allocate a sockaddr_un\n");
        t_free((char *)req,T_BIND);
        return TRANS_CREATE_LISTENER_FAILED;
     }
-    
+
     sunaddr->sun_family=AF_UNIX;
     if( port && *port ) {
        if( *port == '/' ) { /* A full pathname */
@@ -847,15 +837,15 @@ TRANS(TLITLICreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags
     } else {
        (void) sprintf(sunaddr->sun_path,"%s%d", TLINODENAME, getpid());
     }
-    
+
     req->addr.buf=(char *)sunaddr;
     req->addr.len=sizeof(*sunaddr);
     req->addr.maxlen=sizeof(*sunaddr);
-    
+
     /* Set the qlen */
-    
+
     req->qlen=1;
-    
+
     ret_value = TRANS(TLICreateListener)(ciptr, req);
 
     free((char *) sunaddr);
@@ -871,71 +861,71 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
     struct t_call      *call;
     XtransConnInfo     newciptr;
     int        i;
-    
-    PRMSG(2,"TLIAccept(%x->%d)\n", ciptr, ciptr->fd, 0 );
-    
+
+    prmsg(2,"TLIAccept(%x->%d)\n", ciptr, ciptr->fd);
+
     if( (call=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_ALL)) == NULL )
     {
-       PRMSG(1, "TLIAccept() failed to allocate a t_call\n", 0,0,0 );
+       prmsg(1, "TLIAccept() failed to allocate a t_call\n");
        *status = TRANS_ACCEPT_BAD_MALLOC;
        return NULL;
     }
-    
+
     if( t_listen(ciptr->fd,call) < 0 )
     {
        extern char *t_errlist[];
        extern int t_errno;
-       PRMSG(1, "TLIAccept() t_listen() failed\n", 0,0,0 );
-       PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno], 0,0 );
+       prmsg(1, "TLIAccept() t_listen() failed\n");
+       prmsg(1, "TLIAccept: %s\n", t_errlist[t_errno]);
        t_free((char *)call,T_CALL);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return NULL;
     }
-    
+
     /*
      * Now we need to set up the new endpoint for the incoming connection.
      */
-    
+
     i=ciptr->index; /* Makes the next line more readable */
-    
+
     if( (newciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
     {
-       PRMSG(1, "TLIAccept() failed to open a new endpoint\n", 0,0,0 );
+       prmsg(1, "TLIAccept() failed to open a new endpoint\n");
        t_free((char *)call,T_CALL);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return NULL;
     }
-    
+
     if( TRANS(TLITLIBindLocal)(newciptr->fd,TLItrans2devtab[i].family,"") < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIAccept: TRANS(TLITLIBindLocal)() failed: %d\n",
-             errno, 0,0 );
+             errno);
        t_free((char *)call,T_CALL);
        t_close(newciptr->fd);
-       xfree(newciptr);
+       free(newciptr);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return NULL;
     }
-    
-    
+
+
     if( t_accept(ciptr->fd,newciptr->fd,call) < 0 )
     {
        extern char *t_errlist[];
        extern int t_errno;
-       PRMSG(1, "TLIAccept() t_accept() failed\n", 0,0,0 );
-       PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno], 0,0 );
+       prmsg(1, "TLIAccept() t_accept() failed\n");
+       prmsg(1, "TLIAccept: %s\n", t_errlist[t_errno]);
        if( t_errno == TLOOK )
        {
            int evtype = t_look(ciptr->fd);
-           PRMSG(1, "TLIAccept() t_look() returned %d\n", evtype,0,0 );
+           prmsg(1, "TLIAccept() t_look() returned %d\n", evtype);
            switch( evtype )
            {
                case T_DISCONNECT:
                    if( t_rcvdis(ciptr->fd, NULL) < 0 )
                    {
-                       PRMSG(1, "TLIAccept() t_rcvdis() failed\n", 0,0,0 );
-                       PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno], 0,0 );
+                       prmsg(1, "TLIAccept() t_rcvdis() failed\n");
+                       prmsg(1, "TLIAccept: %s\n", t_errlist[t_errno]);
                    }
                    break;
                default:
@@ -948,54 +938,54 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
        *status = TRANS_ACCEPT_FAILED;
        return NULL;
     }
-    
+
     t_free((char *)call,T_CALL);
-    
+
     if( TRANS(TLIGetAddr)(newciptr) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",
-             errno, 0,0 );
+             errno);
        t_close(newciptr->fd);
-       xfree(newciptr);
+       free(newciptr);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return NULL;
     }
-    
+
     if( TRANS(TLIGetPeerAddr)(newciptr) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",
-             errno, 0,0 );
+             errno);
        t_close(newciptr->fd);
-       xfree(newciptr->addr);
-       xfree(newciptr);
+       free(newciptr->addr);
+       free(newciptr);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return NULL;
     }
-    
+
     if( ioctl(newciptr->fd, I_POP,"timod") < 0 )
     {
-       PRMSG(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n",
-             errno,0,0 );
+       prmsg(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n",
+             errno);
        t_close(newciptr->fd);
-       xfree(newciptr->addr);
-       xfree(newciptr);
+       free(newciptr->addr);
+       free(newciptr);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return NULL;
     }
-    
+
     if( ioctl(newciptr->fd, I_PUSH,"tirdwr") < 0 )
     {
-       PRMSG(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
-             errno,0,0 );
+       prmsg(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
+             errno);
        t_close(newciptr->fd);
-       xfree(newciptr->addr);
-       xfree(newciptr);
+       free(newciptr->addr);
+       free(newciptr);
        *status = TRANS_ACCEPT_MISC_ERROR;
        return NULL;
     }
-    
+
     *status = 0;
 
     return newciptr;
@@ -1010,14 +1000,14 @@ static int
 TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
 
 {
-    PRMSG(2, "TLIConnect(%x->%d,%x)\n", ciptr, ciptr->fd, sndcall);
-    
+    prmsg(2, "TLIConnect(%x->%d,%x)\n", ciptr, ciptr->fd, sndcall);
+
     if( t_connect(ciptr->fd,sndcall,NULL) < 0 )
     {
        extern char *t_errlist[];
        extern int t_errno;
-       PRMSG(1, "TLIConnect() t_connect() failed\n", 0,0,0 );
-       PRMSG(1, "TLIConnect: %s\n", t_errlist[t_errno], 0,0 );
+       prmsg(1, "TLIConnect() t_connect() failed\n");
+       prmsg(1, "TLIConnect: %s\n", t_errlist[t_errno]);
        t_free((char *)sndcall,T_CALL);
        if (t_errno == TLOOK && t_look(ciptr->fd) == T_DISCONNECT)
        {
@@ -1027,43 +1017,43 @@ TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
        else
            return TRANS_CONNECT_FAILED;
     }
-    
+
     t_free((char *)sndcall,T_CALL);
-    
+
     /*
      * Sync up the address fields of ciptr.
      */
-    
+
     if( TRANS(TLIGetAddr)(ciptr) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIConnect: ...TLIGetAddr() failed: %d\n",
-             errno, 0,0 );
+             errno);
        return TRANS_CONNECT_FAILED;
     }
-    
+
     if( TRANS(TLIGetPeerAddr)(ciptr) < 0 )
     {
-       PRMSG(1,
+       prmsg(1,
              "TLIConnect: ...TLIGetPeerAddr() failed: %d\n",
-             errno, 0,0 );
+             errno);
        return TRANS_CONNECT_FAILED;
     }
-    
+
     if( ioctl(ciptr->fd, I_POP,"timod") < 0 )
     {
-       PRMSG(1, "TLIConnect() ioctl(I_POP,\"timod\") failed %d\n",
-             errno,0,0 );
+       prmsg(1, "TLIConnect() ioctl(I_POP,\"timod\") failed %d\n",
+             errno);
        return TRANS_CONNECT_FAILED;
     }
-    
+
     if( ioctl(ciptr->fd, I_PUSH,"tirdwr") < 0 )
     {
-       PRMSG(1, "TLIConnect() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
-             errno,0,0 );
+       prmsg(1, "TLIConnect() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
+             errno);
        return TRANS_CONNECT_FAILED;
     }
-    
+
     return 0;
 }
 
@@ -1072,12 +1062,12 @@ static int
 TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
 
 {
-    char       portbuf[PORTBUFSIZE];   
+    char       portbuf[PORTBUFSIZE];
     struct     t_call  *sndcall;
     long       tmpport;
-    
-    PRMSG(2, "TLIINETConnect(%s,%s)\n", host, port, 0);
-    
+
+    prmsg(2, "TLIINETConnect(%s,%s)\n", host, port);
+
 #ifdef X11_t
     /*
      * X has a well known port, that is transport dependant. It is easier
@@ -1087,7 +1077,7 @@ TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
      * The port that is passed here is really a string containing the idisplay
      * from ConnectDisplay().
      */
-    
+
     if (is_numeric (port))
     {
        tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
@@ -1095,21 +1085,21 @@ TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
        port = portbuf;
     }
 #endif
-    
+
     if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_ALL)) == NULL )
     {
-       PRMSG(1, "TLIINETConnect() failed to allocate a t_call\n", 0,0,0 );
+       prmsg(1, "TLIINETConnect() failed to allocate a t_call\n");
        return TRANS_CONNECT_FAILED;
     }
-    
+
     if( TRANS(TLIAddrToNetbuf)(ciptr->index, host, port, &(sndcall->addr) ) < 0 )
     {
-       PRMSG(1, "TLIINETConnect() unable to resolve name:%s.%s\n",
-             host, port, 0 );
+       prmsg(1, "TLIINETConnect() unable to resolve name:%s.%s\n",
+             host, port);
        t_free((char *)sndcall,T_CALL);
        return TRANS_CONNECT_FAILED;
     }
-    
+
     return TRANS(TLIConnect)(ciptr, sndcall );
 }
 
@@ -1121,25 +1111,24 @@ TRANS(TLITLIConnect)(XtransConnInfo ciptr, char *host, char *port)
     struct t_call      *sndcall;
     struct sockaddr_un *sunaddr;
     int                        ret_value;
-    
-    PRMSG(2, "TLITLIConnect(%s,%s)\n", host, port, 0);
-    
+
+    prmsg(2, "TLITLIConnect(%s,%s)\n", host, port);
+
     if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_OPT|T_UDATA)) == NULL )
     {
-       PRMSG(1, "TLITLIConnect() failed to allocate a t_call\n", 0,0,0 );
+       prmsg(1, "TLITLIConnect() failed to allocate a t_call\n");
        return TRANS_CONNECT_FAILED;
     }
-    
+
     if( (sunaddr=(struct sockaddr_un *)
         malloc(sizeof(struct sockaddr_un))) == NULL )
     {
-       PRMSG(1,
-             "TLITLIConnect: failed to allocate a sockaddr_un\n",
-             0,0,0 );
+       prmsg(1,
+             "TLITLIConnect: failed to allocate a sockaddr_un\n");
        t_free((char *)sndcall,T_CALL);
        return TRANS_CONNECT_FAILED;
     }
-    
+
     sunaddr->sun_family=AF_UNIX;
     if( *port == '/' ||
        strncmp (port, TLINODENAME, strlen (TLINODENAME)) == 0) {
@@ -1152,7 +1141,7 @@ TRANS(TLITLIConnect)(XtransConnInfo ciptr, char *host, char *port)
     sndcall->addr.buf=(char *)sunaddr;
     sndcall->addr.len=sizeof(*sunaddr);
     sndcall->addr.maxlen=sizeof(*sunaddr);
-    
+
     ret_value = TRANS(TLIConnect)(ciptr, sndcall );
 
     free((char *) sunaddr);
@@ -1170,7 +1159,7 @@ TRANS(TLIBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend)
     int ret;
     struct pollfd filedes;
 
-    PRMSG(2, "TLIByteReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend );
+    prmsg(2, "TLIByteReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend );
 
     /*
      * This function should detect hangup conditions. Use poll to check
@@ -1178,7 +1167,7 @@ TRANS(TLIBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend)
      * streams head, and ioctl(N_READ) keeps returning 0 because there is
      * no data available. The hangup goes undetected, and the client hangs.
      */
-    
+
     ret=ioctl(ciptr->fd, I_NREAD, (char *)pend);
 
     if( ret != 0 )
@@ -1191,7 +1180,7 @@ TRANS(TLIBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend)
     filedes.events=POLLIN;
 
     ret=poll(&filedes, 1, 0);
+
     if( ret == 0 ) {
        *pend=0;
        return 0; /* Really, no data */
@@ -1212,8 +1201,8 @@ static int
 TRANS(TLIRead)(XtransConnInfo ciptr, char *buf, int size)
 
 {
-    PRMSG(2, "TLIRead(%d,%x,%d)\n", ciptr->fd, buf, size );
-    
+    prmsg(2, "TLIRead(%d,%x,%d)\n", ciptr->fd, buf, size );
+
     return read(ciptr->fd,buf,size);
 }
 
@@ -1222,8 +1211,8 @@ static int
 TRANS(TLIWrite)(XtransConnInfo ciptr, char *buf, int size)
 
 {
-    PRMSG(2, "TLIWrite(%d,%x,%d)\n", ciptr->fd, buf, size );
-    
+    prmsg(2, "TLIWrite(%d,%x,%d)\n", ciptr->fd, buf, size );
+
     return write(ciptr->fd,buf,size);
 }
 
@@ -1232,8 +1221,8 @@ static int
 TRANS(TLIReadv)(XtransConnInfo ciptr, struct iovec *buf, int size)
 
 {
-    PRMSG(2, "TLIReadv(%d,%x,%d)\n", ciptr->fd, buf, size );
-    
+    prmsg(2, "TLIReadv(%d,%x,%d)\n", ciptr->fd, buf, size );
+
     return READV(ciptr,buf,size);
 }
 
@@ -1242,8 +1231,8 @@ static int
 TRANS(TLIWritev)(XtransConnInfo ciptr, struct iovec *buf, int size)
 
 {
-    PRMSG(2, "TLIWritev(%d,%x,%d)\n", ciptr->fd, buf, size );
-    
+    prmsg(2, "TLIWritev(%d,%x,%d)\n", ciptr->fd, buf, size );
+
     return WRITEV(ciptr,buf,size);
 }
 
@@ -1252,8 +1241,8 @@ static int
 TRANS(TLIDisconnect)(XtransConnInfo ciptr)
 
 {
-    PRMSG(2, "TLIDisconnect(%x->%d)\n", ciptr, ciptr->fd, 0 );
-    
+    prmsg(2, "TLIDisconnect(%x->%d)\n", ciptr, ciptr->fd);
+
     /*
      * Restore the TLI modules so that the connection can be properly shutdown.
      * This avoids the situation where a connection goes into the TIME_WAIT
@@ -1263,7 +1252,7 @@ TRANS(TLIDisconnect)(XtransConnInfo ciptr)
     ioctl(ciptr->fd, I_PUSH,"timod");
 
     t_snddis(ciptr->fd,NULL);
-    
+
     return 0;
 }
 
@@ -1272,8 +1261,8 @@ static int
 TRANS(TLIClose)(XtransConnInfo ciptr)
 
 {
-    PRMSG(2, "TLIClose(%x->%d)\n", ciptr, ciptr->fd, 0 );
-    
+    prmsg(2, "TLIClose(%x->%d)\n", ciptr, ciptr->fd);
+
     t_unbind(ciptr->fd);
 
     return (t_close(ciptr->fd));
@@ -1288,8 +1277,8 @@ TRANS(TLICloseForCloning)(XtransConnInfo ciptr)
      * Don't unbind.
      */
 
-    PRMSG(2, "TLICloseForCloning(%x->%d)\n", ciptr, ciptr->fd, 0 );
-    
+    prmsg(2, "TLICloseForCloning(%x->%d)\n", ciptr, ciptr->fd);
+
     return (t_close(ciptr->fd));
 }
 
index 42f09c4..52c937b 100644 (file)
@@ -91,7 +91,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
 
 {
 
-    PRMSG(2,"ConvertAddress(%d,%d,%x)\n",*familyp,*addrlenp,*addrp);
+    prmsg(2,"ConvertAddress(%d,%d,%p)\n",*familyp,*addrlenp,*addrp);
 
     switch( *familyp )
     {
@@ -142,7 +142,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
            {
                *familyp=FamilyLocal;
            }
-           else 
+           else
            {
                *familyp=FamilyInternet;
                *addrlenp = sizeof (struct in_addr);
@@ -161,7 +161,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
 #endif /* defined(TCPCONN) || defined(STREAMSCONN) */
 
 
-#if defined(UNIXCONN) || defined(LOCALCONN) 
+#if defined(UNIXCONN) || defined(LOCALCONN)
     case AF_UNIX:
     {
        *familyp=FamilyLocal;
@@ -178,8 +178,8 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
 #endif
 
     default:
-       PRMSG(1,"ConvertAddress: Unknown family type %d\n",
-             *familyp, 0,0 );
+       prmsg(1,"ConvertAddress: Unknown family type %d\n",
+             *familyp);
        return -1;
     }
 
@@ -190,18 +190,18 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
         * In the case of a local connection, we need to get the
         * host name for authentication.
         */
-       
+
        char hostnamebuf[256];
        int len = TRANS(GetHostname) (hostnamebuf, sizeof hostnamebuf);
 
        if (len > 0) {
            if (*addrp && *addrlenp < (len + 1))
            {
-               xfree ((char *) *addrp);
+               free (*addrp);
                *addrp = NULL;
            }
            if (!*addrp)
-               *addrp = (Xtransaddr *) xalloc (len + 1);
+               *addrp = malloc (len + 1);
            if (*addrp) {
                strcpy ((char *) *addrp, hostnamebuf);
                *addrlenp = len;
@@ -212,7 +212,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
        else
        {
            if (*addrp)
-               xfree ((char *) *addrp);
+               free (*addrp);
            *addrp = NULL;
            *addrlenp = 0;
        }
@@ -242,7 +242,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
     char       *addr = ciptr->addr;
     char       hostnamebuf[256];
     char       *networkId = NULL;
-    char       *transName = ciptr->transptr->TransName;
+    const char *transName = ciptr->transptr->TransName;
 
     if (gethostname (hostnamebuf, sizeof (hostnamebuf)) < 0)
     {
@@ -251,11 +251,11 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
 
     switch (family)
     {
-#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) 
+#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN)
     case AF_UNIX:
     {
        struct sockaddr_un *saddr = (struct sockaddr_un *) addr;
-       networkId = (char *) xalloc (3 + strlen (transName) +
+       networkId = malloc (3 + strlen (transName) +
            strlen (hostnamebuf) + strlen (saddr->sun_path));
        sprintf (networkId, "%s/%s:%s", transName,
            hostnamebuf, saddr->sun_path);
@@ -285,7 +285,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
            portnum = ntohs (saddr->sin_port);
 
        snprintf (portnumbuf, sizeof(portnumbuf), "%d", portnum);
-       networkId = (char *) xalloc (3 + strlen (transName) +
+       networkId = malloc (3 + strlen (transName) +
            strlen (hostnamebuf) + strlen (portnumbuf));
        sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, portnumbuf);
        break;
@@ -316,7 +316,7 @@ int
 void
 #endif
 #endif
-nameserver_lost(int sig)
+nameserver_lost(int sig _X_UNUSED)
 {
   nameserver_timedout = 1;
   longjmp (env, -1);
@@ -341,7 +341,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
     switch (family)
     {
     case AF_UNSPEC:
-#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) 
+#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN)
     case AF_UNIX:
     {
        if (gethostname (addrbuf, sizeof (addrbuf)) == 0)
@@ -386,7 +386,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
         * Assume that if it does not respond in NAMESERVER_TIMEOUT seconds
         * that something is wrong and do not make the user wait.
         * gethostbyaddr will continue after a signal, so we have to
-        * jump out of it. 
+        * jump out of it.
         */
 
        nameserver_timedout = 0;
@@ -418,8 +418,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
     }
 
 
-    hostname = (char *) xalloc (
-       strlen (ciptr->transptr->TransName) + strlen (addr) + 2);
+    hostname = malloc (strlen (ciptr->transptr->TransName) + strlen (addr) + 2);
     strcpy (hostname, ciptr->transptr->TransName);
     strcat (hostname, "/");
     if (addr)
@@ -431,13 +430,13 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
 #endif /* ICE_t */
 
 
-#if defined(WIN32) && defined(TCPCONN) 
+#if defined(WIN32) && defined(TCPCONN)
 int
 TRANS(WSAStartup) (void)
 {
     static WSADATA wsadata;
 
-    PRMSG (2,"WSAStartup()\n", 0, 0, 0);
+    prmsg (2,"WSAStartup()\n");
 
     if (!wsadata.wVersion && WSAStartup(MAKEWORD(2,2), &wsadata))
         return 1;
@@ -478,15 +477,15 @@ is_numeric (const char *str)
  * it's not save if the directory has non-root ownership or the sticky
  * bit cannot be set and fail.
  */
-static int 
+static int
 trans_mkdir(const char *path, int mode)
 {
     struct stat buf;
 
     if (lstat(path, &buf) != 0) {
        if (errno != ENOENT) {
-           PRMSG(1, "mkdir: ERROR: (l)stat failed for %s (%d)\n",
-                 path, errno, 0);
+           prmsg(1, "mkdir: ERROR: (l)stat failed for %s (%d)\n",
+                 path, errno);
            return -1;
        }
        /* Dir doesn't exist. Try to create it */
@@ -499,15 +498,15 @@ trans_mkdir(const char *path, int mode)
         */
        if (geteuid() != 0) {
            if (mode & 01000) {
-               PRMSG(1, "mkdir: ERROR: euid != 0,"
+               prmsg(1, "mkdir: ERROR: euid != 0,"
                      "directory %s will not be created.\n",
-                     path, 0, 0);          
+                     path);
 #ifdef FAIL_HARD
                return -1;
 #endif
            } else {
-               PRMSG(1, "mkdir: Cannot create %s with root ownership\n",
-                     path, 0, 0);
+               prmsg(1, "mkdir: Cannot create %s with root ownership\n",
+                     path);
            }
        }
 #endif
@@ -515,8 +514,8 @@ trans_mkdir(const char *path, int mode)
 #ifndef WIN32
        if (mkdir(path, mode) == 0) {
            if (chmod(path, mode)) {
-               PRMSG(1, "mkdir: ERROR: Mode of %s should be set to %04o\n",
-                     path, mode, 0);
+               prmsg(1, "mkdir: ERROR: Mode of %s should be set to %04o\n",
+                     path, mode);
 #ifdef FAIL_HARD
                return -1;
 #endif
@@ -525,13 +524,13 @@ trans_mkdir(const char *path, int mode)
        if (mkdir(path) == 0) {
 #endif
        } else {
-           PRMSG(1, "mkdir: ERROR: Cannot create %s\n",
-                 path, 0, 0);
+           prmsg(1, "mkdir: ERROR: Cannot create %s\n",
+                 path);
            return -1;
        }
 
        return 0;
-       
+
     } else {
        if (S_ISDIR(buf.st_mode)) {
            int updateOwner = 0;
@@ -550,7 +549,7 @@ trans_mkdir(const char *path, int mode)
             */
            if ((~mode) & 0077 & buf.st_mode)
                updateMode = 1;
-           
+
            /*
             * If the directory is not writeable not everybody may
             * be able to create sockets. Therefore warn if mode
@@ -560,7 +559,7 @@ trans_mkdir(const char *path, int mode)
                updateMode = 1;
                status |= WARN_NO_ACCESS;
            }
-           
+
            /*
             * If 'sticky' bit is requested fail if owner isn't root
             * as we assume the caller makes certain security implications
@@ -572,7 +571,7 @@ trans_mkdir(const char *path, int mode)
                    updateMode = 1;
                }
            }
-           
+
 #ifdef HAS_FCHOWN
            /*
             * If fchown(2) and fchmod(2) are available, try to correct the
@@ -584,8 +583,9 @@ trans_mkdir(const char *path, int mode)
                struct stat fbuf;
                if ((fd = open(path, O_RDONLY)) != -1) {
                    if (fstat(fd, &fbuf) == -1) {
-                       PRMSG(1, "mkdir: ERROR: fstat failed for %s (%d)\n",
-                             path, errno, 0);
+                       prmsg(1, "mkdir: ERROR: fstat failed for %s (%d)\n",
+                             path, errno);
+                       close(fd);
                        return -1;
                    }
                    /*
@@ -595,8 +595,9 @@ trans_mkdir(const char *path, int mode)
                    if (!S_ISDIR(fbuf.st_mode) ||
                        buf.st_dev != fbuf.st_dev ||
                        buf.st_ino != fbuf.st_ino) {
-                       PRMSG(1, "mkdir: ERROR: inode for %s changed\n",
-                             path, 0, 0);
+                       prmsg(1, "mkdir: ERROR: inode for %s changed\n",
+                             path);
+                       close(fd);
                        return -1;
                    }
                    if (updateOwner && fchown(fd, 0, 0) == 0)
@@ -607,34 +608,33 @@ trans_mkdir(const char *path, int mode)
                }
            }
 #endif
-           
+
            if (updateOwner && !updatedOwner) {
 #ifdef FAIL_HARD
                if (status & FAIL_IF_NOT_ROOT) {
-                   PRMSG(1, "mkdir: ERROR: Owner of %s must be set to root\n",
-                         path, 0, 0);
+                   prmsg(1, "mkdir: ERROR: Owner of %s must be set to root\n",
+                         path);
                    return -1;
                }
 #endif
 #if !defined(__APPLE_CC__) && !defined(__CYGWIN__)
-               PRMSG(1, "mkdir: Owner of %s should be set to root\n",
-                     path, 0, 0);
+               prmsg(1, "mkdir: Owner of %s should be set to root\n",
+                     path);
 #endif
            }
-           
+
            if (updateMode && !updatedMode) {
 #ifdef FAIL_HARD
                if (status & FAIL_IF_NOMODE) {
-                   PRMSG(1, "mkdir: ERROR: Mode of %s must be set to %04o\n",
-                         path, mode, 0);
+                   prmsg(1, "mkdir: ERROR: Mode of %s must be set to %04o\n",
+                         path, mode);
                    return -1;
                }
 #endif
-               PRMSG(1, "mkdir: Mode of %s should be set to %04o\n",
-                     path, mode, 0);
+               prmsg(1, "mkdir: Mode of %s should be set to %04o\n",
+                     path, mode);
                if (status & WARN_NO_ACCESS) {
-                   PRMSG(1, "mkdir: this may cause subsequent errors\n",
-                         0, 0, 0);
+                   prmsg(1, "mkdir: this may cause subsequent errors\n");
                }
            }
            return 0;
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100644 (file)
index 904cd67..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/sh
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-ORIGDIR=`pwd`
-cd $srcdir
-
-autoreconf -v --install || exit 1
-cd $ORIGDIR || exit $?
-
-$srcdir/configure --enable-maintainer-mode "$@"
old mode 100755 (executable)
new mode 100644 (file)
index ce521bb..3d11c34
@@ -1,40 +1,44 @@
-dnl  Copyright Â© 2003 Keith Packard, Noah Levitt
-dnl 
-dnl  Permission to use, copy, modify, distribute, and sell this software and its
-dnl  documentation for any purpose is hereby granted without fee, provided that
-dnl  the above copyright notice appear in all copies and that both that
-dnl  copyright notice and this permission notice appear in supporting
-dnl  documentation, and that the name of Keith Packard not be used in
-dnl  advertising or publicity pertaining to distribution of the software without
-dnl  specific, written prior permission.  Keith Packard makes no
-dnl  representations about the suitability of this software for any purpose.  It
-dnl  is provided "as is" without express or implied warranty.
-dnl 
-dnl  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-dnl  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-dnl  PERFORMANCE OF THIS SOFTWARE.
-dnl
-dnl Process this file with autoconf to create configure.
+#  Copyright Â© 2003 Keith Packard, Noah Levitt
+#
+#  Permission to use, copy, modify, distribute, and sell this software and its
+#  documentation for any purpose is hereby granted without fee, provided that
+#  the above copyright notice appear in all copies and that both that
+#  copyright notice and this permission notice appear in supporting
+#  documentation, and that the name of Keith Packard not be used in
+#  advertising or publicity pertaining to distribution of the software without
+#  specific, written prior permission.  Keith Packard makes no
+#  representations about the suitability of this software for any purpose.  It
+#  is provided "as is" without express or implied warranty.
+#
+#  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+#  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+#  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+#  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+#  PERFORMANCE OF THIS SOFTWARE.
+#
 
+# Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([xtrans], [1.2.6],
+AC_INIT([xtrans], [1.2.7],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xtrans])
+AC_CONFIG_SRCDIR([Makefile.am])
+
+# Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
-# Require xorg-macros minimum of 1.10 for DocBook XML documentation
+# Require xorg-macros minimum of 1.12 for DocBook external references
 m4_ifndef([XORG_MACROS_VERSION],
-          [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.10)
+          [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.12)
 XORG_DEFAULT_OPTIONS
 XORG_ENABLE_DOCS
-XORG_WITH_XMLTO(0.0.20)
+XORG_WITH_XMLTO(0.0.22)
 XORG_WITH_FOP
-XORG_CHECK_SGML_DOCTOOLS(1.5)
+XORG_WITH_XSLTPROC
+XORG_CHECK_SGML_DOCTOOLS(1.8)
 
 # Because xtrans is included into other modules rather than being linked
 # with, these defines have to be added to the cflags line
@@ -46,14 +50,15 @@ AC_CHECK_FUNC(fchown, [fchown_define="-DHAS_FCHOWN"], [fchown_define=""])
 AC_SUBST(fchown_define)
 
 # sticky bit
-# 
-# if any system exists without sticky dir bits this 
+#
+# if any system exists without sticky dir bits this
 # needs to be redone with a real autoconf test
 
 sticky_bit_define="-DHAS_STICKY_DIR_BIT"
 
 AC_SUBST(sticky_bit_define)
 
-AC_OUTPUT([Makefile
-           doc/Makefile
-           xtrans.pc])
+AC_CONFIG_FILES([Makefile
+               doc/Makefile
+               xtrans.pc])
+AC_OUTPUT
diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644 (file)
index 34ab4bf..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-------------------------------------------------------
-Quick Guide To Patching This Package For The Impatient
-------------------------------------------------------
-
-1. Make sure you have quilt installed
-2. Unpack the package as usual with "dpkg-source -x"
-3. Run the "patch" target in debian/rules
-4. Create a new patch with "quilt new" (see quilt(1))
-5. Edit all the files you want to include in the patch with "quilt edit" 
-   (see quilt(1)).
-6. Write the patch with "quilt refresh" (see quilt(1))
-7. Run the "clean" target in debian/rules
-
-Alternatively, instead of using quilt directly, you can drop the patch in to 
-debian/patches and add the name of the patch to debian/patches/series.
-
-------------------------------------
-Guide To The X Strike Force Packages
-------------------------------------
-
-The X Strike Force team maintains X packages in git repositories on
-git.debian.org in the pkg-xorg subdirectory. Most upstream packages
-are actually maintained in git repositories as well, so they often
-just need to be pulled into git.debian.org in a "upstream-*" branch.
-Otherwise, the upstream sources are manually installed in the Debian
-git repository.
-
-The .orig.tar.gz upstream source file could be generated this
-"upstream-*" branch in the Debian git repository but it is actually
-copied from upstream tarballs directly.
-
-Due to X.org being highly modular, packaging all X.org applications
-as their own independent packages would have created too many Debian
-packages. For this reason, some X.org applications have been grouped
-into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
-x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
-Most packages, including the X.org server itself and all libraries
-and drivers are, however maintained independently.
-
-The Debian packaging is added by creating the "debian-*" git branch
-which contains the aforementioned "upstream-*" branch plus the debian/
-repository files.
-When a patch has to be applied to the Debian package, two solutions
-are involved:
-* If the patch is available in one of the upstream branches, it
-  may be git'cherry-picked into the Debian repository. In this
-  case, it appears directly in the .diff.gz.
-* Otherwise, the patch is added to debian/patches/ which is managed
-  with quilt as documented in /usr/share/doc/quilt/README.source.
-
-quilt is actually invoked by the Debian X packaging through a larger
-set of scripts called XSFBS. XSFBS brings some other X specific
-features such as managing dependencies and conflicts due to the video
-and input driver ABIs.
-XSFBS itself is maintained in a separate repository at
-  git://git.debian.org/pkg-xorg/xsfbs.git
-and it is pulled inside the other Debian X repositories when needed.
-
-The XSFBS patching system requires a build dependency on quilt. Also
-a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
-so that the XSFBS patching occurs before the actual build. So the
-very first target of the build (likely the one running autoreconf)
-should depend on $(STAMP_DIR)/patch. It should also not depend on
-anything so that parallel builds are correctly supported (nothing
-should probably run while patching is being done). And finally, the
-clean target should depend on the xsfclean target so that patches
-are unapplied on clean.
-
-When the upstream sources contain some DFSG-nonfree files, they are
-listed in text files in debian/prune/ in the "debian-*" branch of
-the Debian repository. XSFBS' scripts then take care of removing
-these listed files during the build so as to generate a modified
-DFSG-free .orig.tar.gz tarball.
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100755 (executable)
index 87c1f47..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-xtrans (1.2.6-1slp2) unstable; urgency=low
-
-  * [X11R7.6] upgrade package
-  * Git: 165.213.180.234:slp/pkgs/xorg/lib/xtrans
-  * Tag: xtrans_1.2.6-1slp2
-
- -- SooChan Lim <sc1.lim@samsung.com>  Tue, 04 Jan 2011 11:52:23 +0900
-
-xtrans (1.2.5-3slp2) unstable; urgency=low
-
-  * Update maintainer
-  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
-  * Tag: xtrans_1.2.5-3slp2
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 21 Apr 2010 11:55:57 +0900
-
-xtrans (1.2.5-2slp2) unstable; urgency=low
-
-  * Change revision
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Thu, 25 Mar 2010 18:02:14 +0900
-
-xtrans (1.2.5-1) unstable; urgency=low
-
-  * Initial release
-
- -- Sung-Jin Park <sj76.park@samsung.com>  Sat, 01 Aug 2009 09:26:20 +0200
-
-xtrans (1.2.5-1) unstable; urgency=low
-
-  * New upstream release.
-  * Bump xutils-dev build-dep for new util-macros.
-  * xtrans.pc moved to /usr/share/.
-  * Bump Standards-Version to 3.8.3.
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 07 Dec 2009 15:00:56 +0100
-
-xtrans (1.2.4-1) unstable; urgency=low
-
-  * New upstream release.
-  * Add README.source, bump Standards-Version to 3.8.2.
-
- -- Brice Goglin <bgoglin@debian.org>  Sat, 01 Aug 2009 09:26:20 +0200
-
-xtrans (1.2.3-3) unstable; urgency=low
-
-  * Upload to unstable.  Now really.
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 16 Feb 2009 21:58:58 +0100
-
-xtrans (1.2.3-2) experimental; urgency=low
-
-  * Upload to unstable.
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 16 Feb 2009 01:34:31 +0100
-
-xtrans (1.2.3-1) experimental; urgency=low
-
-  * New upstream release.
-  * Bump xutils-dev build-dep to >= 1:7.4+4 for util-macros 1.2.
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 16 Jan 2009 04:53:05 +0100
-
-xtrans (1.2.2-1) experimental; urgency=low
-
-  [ Brice Goglin ]
-  * Add a link to www.X.org and a reference to the upstream module
-    in the long description.
-
-  [ Julien Cristau ]
-  * New upstream release.
-  * Switch to running autoreconf at build time.  Update debian/rules, and
-    build-depend on automake and xutils-dev.
-  * Stop looking for nostrip (we don't build anything anyway); allow parallel
-    builds using sample code from policy.
-
- -- Julien Cristau <jcristau@debian.org>  Tue, 23 Dec 2008 16:39:04 +0100
-
-xtrans (1.2-2) unstable; urgency=low
-
-  * Pull from upstream git, yet more fixes for abstract socket handling.
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 22 May 2008 17:26:57 +0200
-
-xtrans (1.2-1) unstable; urgency=high
-
-  * High urgency upload for RC bug fix.
-  * New upstream release
-    + fixes abstract unix domain sockets (closes: #480142)
-    + fixes xserver build on kfreebsd (closes: #472357)
-    + returns failure instead of 'try again' when opening a unix domain socket
-      returns ENOENT (closes: #385976)
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 09 May 2008 11:21:29 +0200
-
-xtrans (1.1-1) unstable; urgency=low
-
-  * New upstream release.
-  * debian/control updates:
-    + Add myself to Uploaders
-    + Bump Standards-Version to 3.7.3 (no changes)
-    + Drop the XS- prefix for Vcs headers
-
- -- Julien Cristau <jcristau@debian.org>  Fri, 07 Mar 2008 13:29:58 +0100
-
-xtrans (1.0.4-1) unstable; urgency=low
-
-  * New upstream release.
-  * Add upstream URL to debian/copyright.
-  * Add myself to Uploaders, and remove Branden with his permission.
-
- -- Brice Goglin <bgoglin@debian.org>  Wed, 22 Aug 2007 20:02:32 +0200
-
-xtrans (1.0.3-2) unstable; urgency=low
-
-  * Remove Fabio from Uploaders, with his permission.
-  * Add XS-Vcs-Git and XS-Vcs-Browser.
-  * Drop outdated CVS info from the long description.
-  * Complete debian/copyright from COPYING.
-  * Install the upstream README.
-  * Upload to unstable.
-
- -- Julien Cristau <jcristau@debian.org>  Thu, 12 Apr 2007 18:23:54 +0200
-
-xtrans (1.0.3-1) experimental; urgency=low
-
-  * New upstream release.
-    + All our patches are now included upstream.
-  * Install upstream ChangeLog.
-
- -- Julien Cristau <jcristau@debian.org>  Mon, 12 Feb 2007 19:14:55 +0100
-
-xtrans (1.0.1-3) unstable; urgency=low
-
-  * Include patch 02_sunlen_nonbsd_sock.patch from upstream (see
-    upstream bug #4982). Follows on from 02_gnu-kbsd_sock_un.diff.
-    Closes: #338290.
-
- -- Drew Parsons <dparsons@debian.org>  Mon, 16 Oct 2006 22:39:05 +1000
-
-xtrans (1.0.1-2) unstable; urgency=low
-
-  [ Andres Salomon ]
-  * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build;
-    idempotency fix.
-
-  [ David Nusinow ]
-  * Upload to unstable
-
- -- David Nusinow <dnusinow@debian.org>  Mon, 28 Aug 2006 21:28:23 +0000
-
-xtrans (1.0.1-1) experimental; urgency=low
-
-  * New upstream release
-  * Remove security patch from previous upload. It's now included in this
-    release by upstream.
-  * Append a super-minor version number to x11-common pre-depends to shut
-    lintian up
-  * Bump debhelper compat to 5
-  * Run dh_install with --list-missing
-
- -- David Nusinow <dnusinow@debian.org>  Sat,  1 Jul 2006 23:27:34 -0400
-
-xtrans (1.0.0-6) unstable; urgency=high
-
-  * Security update. Fix for setuid privledge escalation vulernabilities.
-    See http://lists.freedesktop.org/archives/xorg/2006-June/016146.html for
-    the full advisory.
-  * Bump standards version to 3.7.2.0
-  * Change build-depends-indep to build-depends because of quilt and debhelper
-    being used in the clean target
-
- -- David Nusinow <dnusinow@debian.org>  Fri, 30 Jun 2006 02:15:39 -0400
-
-xtrans (1.0.0-5) unstable; urgency=low
-
-  * Reorder makeshlib command in rules file so that ldconfig is run
-    properly. Thanks Drew Parsons and Steve Langasek.
-  * Add quilt to build-depends
-
- -- David Nusinow <dnusinow@debian.org>  Wed, 19 Apr 2006 02:48:22 -0400
-
-xtrans (1.0.0-4) unstable; urgency=low
-
-  * Upload to unstable
-
- -- David Nusinow <dnusinow@debian.org>  Thu, 23 Mar 2006 22:46:37 -0500
-
-xtrans (1.0.0-3) experimental; urgency=low
-
-  * Bump x11-common version requirement. Thanks Kurt Roeckx. (closes: #351779)
-
- -- David Nusinow <dnusinow@debian.org>  Sun, 19 Mar 2006 23:29:08 -0500
-
-xtrans (1.0.0-2) experimental; urgency=low
-
-  * Port patches from trunk
-    + hurd/804_maxhostnamelen.diff
-    + freebsd/003_gnu-kbsd_sock_un.diff
-
- -- David Nusinow <dnusinow@debian.org>  Sun,  5 Mar 2006 20:51:47 -0500
-
-xtrans (1.0.0-1) experimental; urgency=low
-
-  * First upload to Debian
-
- -- David Nusinow <dnusinow@debian.org>  Thu, 29 Dec 2005 20:55:24 -0500
-
-xtrans (0.99.0-1) breezy; urgency=low
-
-  * Bump to new upstream.
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Wed, 10 Aug 2005 20:04:46 +1000
-
-xtrans (0.2+cvs.20050513-1) breezy; urgency=low
-
-  * First xtrans release.
-
- -- Daniel Stone <daniel.stone@ubuntu.com>  Sun, 13 May 2005 00:12:17 +1000
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100755 (executable)
index 86e8cb3..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-Source: xtrans
-Section: x11
-Priority: optional
-Maintainer: Sung-Jin Park <sj76.park@samsung.com>, Sangjin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org>
-Uploaders: SooChan Lim <sc1.lim@samsung.com>, Sung-Jin Park <sj76.park@samsung.com>, David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>, Julien Cristau <jcristau@debian.org>
-Build-Depends: debhelper (>= 5.0.0), quilt, automake, xutils-dev (>= 1:7.5),
-Standards-Version: 3.8.3
-Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/xtrans
-Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/xtrans.git
-
-Package: xtrans-dev
-Architecture: all
-Pre-Depends: x11-common (>= 1:7.0.0)
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: X transport library (development files)
- xtrans includes a number of routines to make X implementations
- transport-independent; at time of writing, it includes support for UNIX
- sockets, IPv4, IPv6, and DECnet.
- .
- xtrans is not actually a library in itself; it includes .c files which are
- then used in the compilation of X servers, libraries, et al.
- .
- More information about X.Org can be found at:
- <URL:http://www.X.org>
- <URL:http://xorg.freedesktop.org>
- <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
- .
- This module can be found at
- git://anongit.freedesktop.org/git/xorg/lib/libxtrans
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644 (file)
index 05ae4b2..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-This package was downloaded from
-http://xorg.freedesktop.org/releases/individual/lib/
-
-Debianised by Daniel Stone <daniel.stone@ubuntu.com>.
-
-Contributors to this package include The Open Group (another words, the
-X Consortium), NCR Corporation, Sebastien Marineau and Holger Veit
-(OS/2 support), Sun Microsystems, David Dawes, Egbert Eich, Alan Coopersmith
-Marc La France, J. Kean Johnston, Frank Giessler, Jean-Claude Michot, and
-Matthieu Herrb.
-
-Our apologies if we missed anyone.
-
-Copyright 1993, 1994, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-______________________________________________________________________________
-
-Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
-
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted, provided
-that the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation, and that the name NCR not be used in advertising
-or publicity pertaining to distribution of the software without specific,
-written prior permission.  NCR makes no representations about the
-suitability of this software for any purpose.  It is provided "as is"
-without express or implied warranty.
-
-NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
-NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-______________________________________________________________________________
-
-Copyright 2002, 2005 Sun Microsystems, Inc.  All rights reserved.
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the copyright holders shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the copyright holders.
-
-______________________________________________________________________________
-
-(c) Copyright 1996 by Sebastien Marineau and Holger Veit
-                     <marineau@genie.uottawa.ca>
-                     <Holger.Veit@gmd.de>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-HOLGER VEIT  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-Except as contained in this notice, the name of Sebastien Marineau or
-Holger Veit shall not be used in advertising or otherwise to promote
-the sale, use or other dealings in this Software without prior written
-authorization from Holger Veit or Sebastien Marineau.
-
-______________________________________________________________________________
-
-Copyright Â© 2003 Keith Packard, Noah Levitt
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation, and that the name of Keith Packard not be used in
-advertising or publicity pertaining to distribution of the software without
-specific, written prior permission.  Keith Packard makes no
-representations about the suitability of this software for any purpose.  It
-is provided "as is" without express or implied warranty.
-
-KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
diff --git a/debian/rules b/debian/rules
deleted file mode 100755 (executable)
index e7f7513..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/make -f
-# debian/rules for the Debian xtrans-dev package.
-# Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>
-# Copyright Â© 2005 Daniel Stone <daniel@fooishbar.org>
-# Copyright Â© 2005 David Nusinow <dnusinow@debian.org>
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-PACKAGE = xtrans-dev
-
-include debian/xsfbs/xsfbs.mk
-
-CFLAGS = -Wall -g
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-else
-       CFLAGS += -O2
-endif
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-       NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-       MAKEFLAGS += -j$(NUMJOBS)
-endif
-
-DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-       confflags += --build=$(DEB_HOST_GNU_TYPE)
-else
-       confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
-#      confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
-endif
-
-configure: $(STAMP_DIR)/patch
-       dh_testdir
-       autoreconf -vfi
-
-obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure
-       dh_testdir
-       test -d obj-$(DEB_BUILD_GNU_TYPE) || mkdir obj-$(DEB_BUILD_GNU_TYPE)
-       cd obj-$(DEB_BUILD_GNU_TYPE) && \
-       ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
-                    --infodir=\$${prefix}/share/info --disable-shared \
-                    $(confflags) CFLAGS="$(CFLAGS)" 
-
-build: build-stamp
-build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status
-       dh_testdir
-       cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
-       >$@
-
-clean: xsfclean
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp
-
-       rm -f config.cache config.log config.status
-       rm -f */config.cache */config.log */config.status
-       rm -f conftest* */conftest*
-       rm -rf autom4te.cache */autom4te.cache
-       rm -rf obj-*
-       rm -f $$(find -name Makefile.in)
-       rm -f compile config.guess config.sub configure depcomp install-sh
-       rm -f ltmain.sh missing INSTALL aclocal.m4 config.h.in mkinstalldirs
-
-       dh_clean
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k
-       dh_installdirs
-
-       cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-# Build architecture-independent files here.
-binary-indep: build install
-       dh_testdir
-       dh_testroot
-
-#      dh_installdocs README
-#      dh_installman
-       dh_install --sourcedir=debian/tmp --list-missing
-#      dh_installchangelogs ChangeLog
-       dh_link
-       dh_strip
-       dh_compress
-       dh_fixperms
-       dh_shlibdeps
-       dh_installdeb
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-# Build architecture-dependent files here.
-binary-arch: build install
-# Nothing to do
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/watch b/debian/watch
deleted file mode 100644 (file)
index 27b1be0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-version=3
-http://xorg.freedesktop.org/releases/individual/lib/ xtrans-(.*)\.tar\.gz
diff --git a/debian/xsfbs/repack.sh b/debian/xsfbs/repack.sh
deleted file mode 100644 (file)
index 5935cc9..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if ! [ -d debian/prune ]; then
-       exit 0
-fi
-
-if [ "x$1" != x--upstream-version ]; then
-       exit 1
-fi
-
-version="$2"
-filename="$3"
-
-if [ -z "$version" ] || ! [ -f "$filename" ]; then
-       exit 1
-fi
-
-dir="$(pwd)"
-tempdir="$(mktemp -d)"
-
-cd "$tempdir"
-tar xf "$dir/$filename"
-cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
-
-tar czf "$dir/$filename" *
-cd "$dir"
-rm -rf "$tempdir"
-echo "Done pruning upstream tarball"
-
-exit 0
diff --git a/debian/xsfbs/xsfbs.mk b/debian/xsfbs/xsfbs.mk
deleted file mode 100644 (file)
index 5e16b10..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/usr/bin/make -f
-
-# Debian X Strike Force Build System (XSFBS): Make portion
-
-# Copyright 1996 Stephen Early
-# Copyright 1997 Mark Eichin
-# Copyright 1998-2005, 2007 Branden Robinson
-# Copyright 2005 David Nusinow
-#
-# Licensed under the GNU General Public License, version 2.  See the file
-# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
-
-# Originally by Stephen Early <sde1000@debian.org>
-# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us>
-# Modified by Adam Heath <doogie@debian.org>
-# Modified by Branden Robinson <branden@debian.org>
-# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net>
-# Modified by David Nusinow <dnusinow@debian.org>
-# Acknowledgements to Manoj Srivastava.
-
-# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
-export DH_OPTIONS
-
-# force quilt to not use ~/.quiltrc and to use debian/patches
-QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
-
-# Set up parameters for the upstream build environment.
-
-# Determine (source) package name from Debian changelog.
-SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
-                        | grep '^Source:' | awk '{print $$2}')
-
-# Determine package version from Debian changelog.
-SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
-                        | grep '^Version:' | awk '{print $$2}')
-
-# Determine upstream version number.
-UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
-
-# Determine the source version without the epoch for make-orig-tar-gz
-NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://')
-
-# Figure out who's building this package.
-BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}})
-
-# Find out if this is an official build; an official build has nothing but
-# digits, dots, and/or the codename of a release in the Debian part of the
-# version number.  Anything else indicates an unofficial build.
-OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi)
-
-# Set up parameters for the Debian build environment.
-
-# Determine our architecture.
-BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
-# Work around some old-time dpkg braindamage.
-BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH))
-# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy.
-ifdef DEB_HOST_ARCH
- ARCH:=$(DEB_HOST_ARCH)
-else
- # dpkg-cross sets the ARCH environment variable; if set, use it.
- ifdef ARCH
-  ARCH:=$(ARCH)
- else
-  ARCH:=$(BUILD_ARCH)
- endif
-endif
-
-# $(STAMP_DIR) houses stamp files for complex targets.
-STAMP_DIR:=stampdir
-
-# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place
-# their files.
-DEBTREEDIR:=$(CURDIR)/debian/tmp
-
-# All "important" targets have four lines:
-#   1) A target name that is invoked by a package-building tool or the user.
-#      This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart.
-#   2) A line delcaring 1) as a phony target (".PHONY:").
-#   3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may
-#   depend on other targets.
-#   4) A line declaring 3) as a member of the $(stampdir_targets) variable; the
-#   "$(STAMP_DIR)/" prefix is omitted.
-#
-# This indirection is needed so that the "stamp" files that signify when a rule
-# is done can be located in a separate "stampdir".  Recall that make has no way
-# to know when a goal has been met for a phony target (like "build" or
-# "install").
-#
-# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@"
-# so that the target will not be run again.  Removing the file will make Make
-# run the target over.
-
-# All phony targets should be declared as dependencies of .PHONY, even if they
-# do not have "($STAMP_DIR)/"-prefixed counterparts.
-
-# Define a harmless default rule to keep things from going nuts by accident.
-.PHONY: default
-default:
-
-# Set up the $(STAMP_DIR) directory.
-.PHONY: stampdir
-stampdir_targets+=stampdir
-stampdir: $(STAMP_DIR)/stampdir
-$(STAMP_DIR)/stampdir:
-       mkdir $(STAMP_DIR)
-       >$@
-
-# Set up the package build directory as quilt expects to find it.
-.PHONY: prepare
-stampdir_targets+=prepare
-prepare: $(STAMP_DIR)/prepare
-$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts
-       >$@
-
-.PHONY: log
-stampdir_targets+=log
-log: $(STAMP_DIR)/log
-$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir
-       mkdir -p $(STAMP_DIR)/log
-
-# Apply all patches to the upstream source.
-.PHONY: patch
-stampdir_targets+=patch
-patch: $(STAMP_DIR)/patch
-$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare
-       if ! [ `which quilt` ]; then \
-               echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \
-               exit 1; \
-       fi; \
-       if $(QUILT) next >/dev/null 2>&1; then \
-         echo -n "Applying patches..."; \
-         if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \
-           cat $(STAMP_DIR)/log/patch; \
-           echo "successful."; \
-         else \
-           cat $(STAMP_DIR)/log/patch; \
-           echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \
-           exit 1; \
-         fi; \
-       else \
-         echo "No patches to apply"; \
-       fi; \
-       >$@
-
-# Revert all patches to the upstream source.
-.PHONY: unpatch
-unpatch: $(STAMP_DIR)/log
-       rm -f $(STAMP_DIR)/patch
-       @echo -n "Unapplying patches..."; \
-       if $(QUILT) applied >/dev/null 2>/dev/null; then \
-         if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
-           cat $(STAMP_DIR)/log/unpatch; \
-           echo "successful."; \
-         else \
-           cat $(STAMP_DIR)/log/unpatch; \
-           echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \
-           exit 1; \
-         fi; \
-       else \
-         echo "nothing to do."; \
-       fi
-
-# Clean the generated maintainer scripts.
-.PHONY: cleanscripts
-cleanscripts:
-       rm -f $(STAMP_DIR)/genscripts
-       rm -f debian/*.config \
-             debian/*.postinst \
-             debian/*.postrm \
-             debian/*.preinst \
-             debian/*.prerm
-
-# Clean the package build tree.
-.PHONY: xsfclean
-xsfclean: cleanscripts unpatch
-       dh_testdir
-       rm -rf .pc
-       rm -rf $(STAMP_DIR)
-       dh_clean
-
-# Remove files from the upstream source tree that we don't need, or which have
-# licensing problems.  It must be run before creating the .orig.tar.gz.
-#
-# Note: This rule is for Debian package maintainers' convenience, and is not
-# needed for conventional build scenarios.
-.PHONY: prune-upstream-tree
-prune-upstream-tree:
-       # Ensure we're in the correct directory.
-       dh_testdir
-       grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
-
-# Verify that there are no offsets or fuzz in the patches we apply.
-#
-# Note: This rule is for Debian package maintainers' convenience, and is not
-# needed for conventional build scenarios.
-.PHONY: patch-audit
-patch-audit: prepare unpatch
-       @echo -n "Auditing patches..."; \
-       >$(STAMP_DIR)/log/patch; \
-       FUZZY=; \
-       while [ -n "$$($(QUILT) next)" ]; do \
-         RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\
-         case "$$RESULT" in \
-           succeeded) \
-             echo "fuzzy patch: $$($(QUILT) top)" \
-               | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \
-             FUZZY=yes; \
-             ;; \
-           FAILED) \
-             echo "broken patch: $$($(QUILT) next)" \
-               | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \
-             exit 1; \
-             ;; \
-         esac; \
-       done; \
-       if [ -n "$$FUZZY" ]; then \
-         echo "there were fuzzy patches; please fix."; \
-         exit 1; \
-       else \
-         echo "done."; \
-       fi
-
-# Generate the maintainer scripts.
-.PHONY: genscripts
-stampdir_targets+=genscripts
-genscripts: $(STAMP_DIR)/genscripts
-$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir
-       for FILE in debian/*.config.in \
-                   debian/*.postinst.in \
-                   debian/*.postrm.in \
-                   debian/*.preinst.in \
-                   debian/*.prerm.in; do \
-         if [ -e "$$FILE" ]; then \
-           MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \
-           sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \
-             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \
-           cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \
-           sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \
-             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \
-           sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \
-               -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \
-             <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \
-           rm $$MAINTSCRIPT.tmp; \
-         fi; \
-       done
-       # Validate syntax of generated shell scripts.
-       #sh debian/scripts/validate-posix-sh debian/*.config \
-       #                                    debian/*.postinst \
-       #                                    debian/*.postrm \
-       #                                    debian/*.preinst \
-       #                                    debian/*.prerm
-       >$@
-
-SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
-VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
-INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
-SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS))
-VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
-INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI)
-ifeq ($(PACKAGE),)
-PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
-endif
-
-.PHONY: serverabi
-serverabi: install
-ifeq ($(SERVERMINVERS),)
-       @echo error: xserver-xorg-dev needs to be installed
-       @exit 1
-else
-       echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars
-       echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
-       echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
-endif
-
-# vim:set noet ai sts=8 sw=8 tw=0:
diff --git a/debian/xsfbs/xsfbs.sh b/debian/xsfbs/xsfbs.sh
deleted file mode 100644 (file)
index 813fd8d..0000000
+++ /dev/null
@@ -1,622 +0,0 @@
-# This is the X Strike Force shell library for X Window System package
-# maintainer scripts.  It serves to define shell functions commonly used by
-# such packages, and performs some error checking necessary for proper operation
-# of those functions.  By itself, it does not "do" much; the maintainer scripts
-# invoke the functions defined here to accomplish package installation and
-# removal tasks.
-
-# If you are reading this within a Debian package maintainer script (e.g.,
-# /var/lib/dpkg/info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
-# skip past this library by scanning forward in this file to the string
-# "GOBSTOPPER".
-
-SOURCE_VERSION=@SOURCE_VERSION@
-OFFICIAL_BUILD=@OFFICIAL_BUILD@
-
-# Use special abnormal exit codes so that problems with this library are more
-# easily tracked down.
-SHELL_LIB_INTERNAL_ERROR=86
-SHELL_LIB_THROWN_ERROR=74
-SHELL_LIB_USAGE_ERROR=99
-
-# old -> new variable names
-if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
-  DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
-fi
-if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
-  DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
-fi
-
-# initial sanity checks
-if [ -z "$THIS_PACKAGE" ]; then
-  cat >&2 <<EOF
-Error: package maintainer script attempted to use shell library without
-definining \$THIS_PACKAGE shell variable.  Please report the package name,
-version, and the text of this error message to the Debian Bug Tracking System.
-Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
-instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
-"doc-debian" package, or install the "reportbug" package and use the command of
-the same name to file a report against version $SOURCE_VERSION of this package.
-EOF
-  exit $SHELL_LIB_USAGE_ERROR
-fi
-
-if [ -z "$THIS_SCRIPT" ]; then
-  cat >&2 <<EOF
-Error: package maintainer script attempted to use shell library without
-definining \$THIS_SCRIPT shell variable.  Please report the package name,
-version, and the text of this error message to the Debian Bug Tracking System.
-Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
-instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
-"doc-debian" package, or install the "reportbug" package and use the command of
-the same name to file a report against version $SOURCE_VERSION of the
-"$THIS_PACKAGE" package.
-EOF
-  exit $SHELL_LIB_USAGE_ERROR
-fi
-
-if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
-  RECONFIGURE="true"
-else
-  RECONFIGURE=
-fi
-
-if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
-  FIRSTINST="yes"
-fi
-
-if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
-  UPGRADE="yes"
-fi
-
-trap "message;\
-      message \"Received signal.  Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
-      message;\
-      exit 1" HUP INT QUIT TERM
-
-reject_nondigits () {
-  # syntax: reject_nondigits [ operand ... ]
-  #
-  # scan operands (typically shell variables whose values cannot be trusted) for
-  # characters other than decimal digits and barf if any are found
-  while [ -n "$1" ]; do
-    # does the operand contain anything but digits?
-    if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
-      # can't use die(), because it wraps message() which wraps this function
-      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
-           "possibly malicious garbage \"$1\"" >&2
-      exit $SHELL_LIB_THROWN_ERROR
-    fi
-    shift
-  done
-}
-
-reject_unlikely_path_chars () {
-  # syntax: reject_unlikely_path_chars [ operand ... ]
-  #
-  # scan operands (typically shell variables whose values cannot be trusted) for
-  # characters unlikely to be seen in a path and which the shell might
-  # interpret and barf if any are found
-  while [ -n "$1" ]; do
-    # does the operand contain any funny characters?
-    if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
-      # can't use die(), because I want to avoid forward references
-      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
-           "encountered possibly malicious garbage \"$1\"" >&2
-      exit $SHELL_LIB_THROWN_ERROR
-    fi
-    shift
-  done
-}
-
-# Query the terminal to establish a default number of columns to use for
-# displaying messages to the user.  This is used only as a fallback in the
-# event the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while
-# the script is running, and this cannot, only being calculated once.)
-DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
-if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
-  DEFCOLUMNS=80
-fi
-
-message () {
-  # pretty-print messages of arbitrary length
-  reject_nondigits "$COLUMNS"
-  echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
-}
-
-observe () {
-  # syntax: observe message ...
-  #
-  # issue observational message suitable for logging someday when support for
-  # it exists in dpkg
-  if [ -n "$DEBUG_XORG_PACKAGE" ]; then
-    message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
-  fi
-}
-
-warn () {
-  # syntax: warn message ...
-  #
-  # issue warning message suitable for logging someday when support for
-  # it exists in dpkg; also send to standard error
-  message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
-}
-
-die () {
-  # syntax: die message ...
-  #
-  # exit script with error message
-  message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
-  exit $SHELL_LIB_THROWN_ERROR
-}
-
-internal_error () {
-  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
-  message "internal error: $*"
-  if [ -n "$OFFICIAL_BUILD" ]; then
-    message "Please report a bug in the $THIS_SCRIPT script of the" \
-            "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
-            "Tracking System.  Include all messages above that mention the" \
-            "$THIS_PACKAGE package.  Visit " \
-            "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
-            "instructions, read the file" \
-            "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
-            "package, or install the reportbug package and use the command of" \
-            "the same name to file a report."
-  fi
-  exit $SHELL_LIB_INTERNAL_ERROR
-}
-
-usage_error () {
-  message "usage error: $*"
-  message "Please report a bug in the $THIS_SCRIPT script of the" \
-          "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
-          "Tracking System.  Include all messages above that mention the" \
-          "$THIS_PACKAGE package.  Visit " \
-          "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
-          "instructions, read the file" \
-          "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
-          "package, or install the reportbug package and use the command of" \
-          "the same name to file a report."
-  exit $SHELL_LIB_USAGE_ERROR
-}
-
-font_update () {
-  # run $UPDATECMDS in $FONTDIRS
-
-  local dir cmd shortcmd x_font_dir_prefix
-
-  x_font_dir_prefix="/usr/share/fonts/X11"
-
-  if [ -z "$UPDATECMDS" ]; then
-    usage_error "font_update() called but \$UPDATECMDS not set"
-  fi
-  if [ -z "$FONTDIRS" ]; then
-    usage_error "font_update() called but \$FONTDIRS not set"
-  fi
-
-  reject_unlikely_path_chars "$UPDATECMDS"
-  reject_unlikely_path_chars "$FONTDIRS"
-
-  for dir in $FONTDIRS; do
-    if [ -d "$x_font_dir_prefix/$dir" ]; then
-      for cmd in $UPDATECMDS; do
-        if which "$cmd" > /dev/null 2>&1; then
-          shortcmd=${cmd##*/}
-          observe "running $shortcmd in $dir font directory"
-         cmd_opts=
-          if [ "$shortcmd" = "update-fonts-alias" ]; then
-            cmd_opts=--x11r7-layout
-          fi
-          if [ "$shortcmd" = "update-fonts-dir" ]; then
-            cmd_opts=--x11r7-layout
-          fi
-          if [ "$shortcmd" = "update-fonts-scale" ]; then
-            cmd_opts=--x11r7-layout
-          fi
-          $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
-                              "failed; font directory data may not" \
-                              "be up to date"
-        else
-          warn "$cmd not found; not updating corresponding $dir font" \
-               "directory data"
-        fi
-      done
-    else
-      warn "$dir is not a directory; not updating font directory data"
-    fi
-  done
-}
-
-remove_conffile_prepare () {
-  # syntax: remove_conffile_prepare filename official_md5sum ...
-  #
-  # Check a conffile "filename" against a list of canonical MD5 checksums.
-  # If the file's current MD5 checksum matches one of the "official_md5sum"
-  # operands provided, then prepare the conffile for removal from the system.
-  # We defer actual deletion until the package is configured so that we can
-  # roll this operation back if package installation fails.
-  #
-  # Call this function from a preinst script in the event $1 is "upgrade" or
-  # "install" and verify $2 to ensure the package is being upgraded from a
-  # version (or installed over a version removed-but-not-purged) prior to the
-  # one in which the conffile was obsoleted.
-
-  local conffile current_checksum
-
-  # validate arguments
-  if [ $# -lt 2 ]; then
-    usage_error "remove_conffile_prepare() called with wrong number of" \
-                "arguments; expected at least 2, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  conffile="$1"
-  shift
-
-  # does the conffile even exist?
-  if [ -e "$conffile" ]; then
-    # calculate its checksum
-    current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
-    # compare it to each supplied checksum
-    while [ -n "$1" ]; do
-      if [ "$current_checksum" = "$1" ]; then
-        # we found a match; move the confffile and stop looking
-        observe "preparing obsolete conffile $conffile for removal"
-        mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
-        break
-      fi
-      shift
-    done
-  fi
-}
-
-remove_conffile_lookup () {
-  # syntax: remove_conffile_lookup package filename
-  #
-  # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
-  # if it matches the actual file's md5sum.
-  #
-  # Call this function when you would call remove_conffile_prepare but only
-  # want to check against dpkg's status database instead of known checksums.
-
-  local package conffile old_md5sum
-
-  # validate arguments
-  if [ $# -ne 2 ]; then
-    usage_error "remove_conffile_lookup() called with wrong number of" \
-                "arguments; expected 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  package="$1"
-  conffile="$2"
-
-  if ! [ -e "$conffile" ]; then
-    return
-  fi
-  old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
-    awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
-  if [ -n "$old_md5sum" ]; then
-    remove_conffile_prepare "$conffile" "$old_md5sum"
-  fi
-}
-
-remove_conffile_commit () {
-  # syntax: remove_conffile_commit filename
-  #
-  # Complete the removal of a conffile "filename" that has become obsolete.
-  #
-  # Call this function from a postinst script after having used
-  # remove_conffile_prepare() in the preinst.
-
-  local conffile
-
-  # validate arguments
-  if [ $# -ne 1 ]; then
-    usage_error "remove_conffile_commit() called with wrong number of" \
-                "arguments; expected 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  conffile="$1"
-
-  # if the temporary file created by remove_conffile_prepare() exists, remove it
-  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
-    observe "committing removal of obsolete conffile $conffile"
-    rm "$conffile.$THIS_PACKAGE-tmp"
-  fi
-}
-
-remove_conffile_rollback () {
-  # syntax: remove_conffile_rollback filename
-  #
-  # Roll back the removal of a conffile "filename".
-  #
-  # Call this function from a postrm script in the event $1 is "abort-upgrade"
-  # or "abort-install" is  after having used remove_conffile_prepare() in the
-  # preinst.
-
-  local conffile
-
-  # validate arguments
-  if [ $# -ne 1 ]; then
-    usage_error "remove_conffile_rollback() called with wrong number of" \
-                "arguments; expected 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  conffile="$1"
-
-  # if the temporary file created by remove_conffile_prepare() exists, move it
-  # back
-  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
-    observe "rolling back removal of obsolete conffile $conffile"
-    mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
-  fi
-}
-
-replace_conffile_with_symlink_prepare () {
-  # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
-  # official_md5sum ...
-  #
-  # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
-  # If the file's current MD5 checksum matches one of the "official_md5sum"
-  # operands provided, then prepare the conffile for removal from the system.
-  # We defer actual deletion until the package is configured so that we can
-  # roll this operation back if package installation fails. Otherwise copy it
-  # to newfilename and let dpkg handle it through conffiles mechanism.
-  #
-  # Call this function from a preinst script in the event $1 is "upgrade" or
-  # "install" and verify $2 to ensure the package is being upgraded from a
-  # version (or installed over a version removed-but-not-purged) prior to the
-  # one in which the conffile was obsoleted.
-
-  local conffile current_checksum
-
-  # validate arguments
-  if [ $# -lt 3 ]; then
-    usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
-                " number of arguments; expected at least 3, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  oldconffile="$1"
-  shift
-  newconffile="$1"
-  shift
-
-  remove_conffile_prepare "$_oldconffile" "$@"
-  # If $oldconffile still exists, then md5sums didn't match.
-  # Copy it to new one.
-  if [ -f "$oldconffile" ]; then
-    cp "$oldconffile" "$newconffile"
-  fi
-
-}
-
-replace_conffile_with_symlink_commit () {
-  # syntax: replace_conffile_with_symlink_commit oldfilename
-  #
-  # Complete the removal of a conffile "oldfilename" that has been
-  # replaced by a symlink.
-  #
-  # Call this function from a postinst script after having used
-  # replace_conffile_with_symlink_prepare() in the preinst.
-
-  local conffile
-
-  # validate arguments
-  if [ $# -ne 1 ]; then
-    usage_error "replace_conffile_with_symlink_commit() called with wrong" \
-                "number of arguments; expected 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  conffile="$1"
-
-  remove_conffile_commit "$conffile"
-}
-
-replace_conffile_with_symlink_rollback () {
-  # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
-  #
-  # Roll back the replacing of a conffile "oldfilename" with symlink to
-  # "newfilename".
-  #
-  # Call this function from a postrm script in the event $1 is "abort-upgrade"
-  # or "abort-install" and verify $2 to ensure the package failed to upgrade
-  # from a version (or install over a version removed-but-not-purged) prior
-  # to the one in which the conffile was obsoleted.
-  # You should have  used replace_conffile_with_symlink_prepare() in the
-  # preinst.
-
-  local conffile
-
-  # validate arguments
-  if [ $# -ne 2 ]; then
-    usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
-                "number of arguments; expected 2, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  oldconffile="$1"
-  newconffile="$2"
-
-  remove_conffile_rollback "$_oldconffile"
-  if [ -f "$newconffile" ]; then
-    rm "$newconffile"
-  fi
-}
-
-run () {
-  # syntax: run command [ argument ... ]
-  #
-  # Run specified command with optional arguments and report its exit status.
-  # Useful for commands whose exit status may be nonzero, but still acceptable,
-  # or commands whose failure is not fatal to us.
-  #
-  # NOTE: Do *not* use this function with db_get or db_metaget commands; in
-  # those cases the return value of the debconf command *must* be checked
-  # before the string returned by debconf is used for anything.
-
-  local retval
-
-  # validate arguments
-  if [ $# -lt 1 ]; then
-    usage_error "run() called with wrong number of arguments; expected at" \
-                "least 1, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  "$@" || retval=$?
-
-  if [ ${retval:-0} -ne 0 ]; then
-    observe "command \"$*\" exited with status $retval"
-  fi
-}
-
-make_symlink_sane () {
-  # syntax: make_symlink_sane symlink target
-  #
-  # Ensure that the symbolic link symlink exists, and points to target.
-  #
-  # If symlink does not exist, create it and point it at target.
-  #
-  # If symlink exists but is not a symbolic link, back it up.
-  #
-  # If symlink exists, is a symbolic link, but points to the wrong location, fix
-  # it.
-  #
-  # If symlink exists, is a symbolic link, and already points to target, do
-  # nothing.
-  #
-  # This function wouldn't be needed if ln had an -I, --idempotent option.
-
-  # Validate arguments.
-  if [ $# -ne 2 ]; then
-    usage_error "make_symlink_sane() called with wrong number of arguments;" \
-      "expected 2, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  # We could just use the positional parameters as-is, but that makes things
-  # harder to follow.
-  local symlink target
-
-  symlink="$1"
-  target="$2"
-
-  if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
-      observe "link from $symlink to $target already exists"
-  else
-    observe "creating symbolic link from $symlink to $target"
-    mkdir -p "${target%/*}" "${symlink%/*}"
-    ln -s -b -S ".dpkg-old" "$target" "$symlink"
-  fi
-}
-
-migrate_dir_to_symlink () {
-  # syntax: migrate_dir_to_symlink old_location new_location
-  #
-  # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
-  # symbolic link to a directory or vice versa; instead, the existing state
-  # (symlink or not) will be left alone and dpkg will follow the symlink if
-  # there is one."
-  #
-  # We have to do it ourselves.
-  #
-  # This function moves the contents of old_location, a directory, into
-  # new_location, a directory, then makes old_location a symbolic link to
-  # new_location.
-  #
-  # old_location need not exist, but if it does, it must be a directory (or a
-  # symlink to a directory).  If it is not, it is backed up.  If new_location
-  # exists already and is not a directory, it is backed up.
-  #
-  # This function should be called from a package's preinst so that other
-  # packages unpacked after this one --- but before this package's postinst runs
-  # --- are unpacked into new_location even if their payloads contain
-  # old_location filespecs.
-
-  # Validate arguments.
-  if [ $# -ne 2 ]; then
-    usage_error "migrate_dir_to_symlink() called with wrong number of"
-                "arguments; expected 2, got $#"
-    exit $SHELL_LIB_USAGE_ERROR
-  fi
-
-  # We could just use the positional parameters as-is, but that makes things
-  # harder to follow.
-  local new old
-
-  old="$1"
-  new="$2"
-
-  # Is old location a symlink?
-  if [ -L "$old" ]; then
-    # Does it already point to new location?
-    if [ "$(readlink "$old")" = "$new" ]; then
-      # Nothing to do; migration has already been done.
-      observe "migration of $old to $new already done"
-      return 0
-    else
-      # Back it up.
-      warn "backing up symbolic link $old as $old.dpkg-old"
-      mv -b "$old" "$old.dpkg-old"
-    fi
-  fi
-
-  # Does old location exist, but is not a directory?
-  if [ -e "$old" ] && ! [ -d "$old" ]; then
-      # Back it up.
-      warn "backing up non-directory $old as $old.dpkg-old"
-      mv -b "$old" "$old.dpkg-old"
-  fi
-
-  observe "migrating $old to $new"
-
-  # Is new location a symlink?
-  if [ -L "$new" ]; then
-    # Does it point the wrong way, i.e., back to where we're migrating from?
-    if [ "$(readlink "$new")" = "$old" ]; then
-      # Get rid of it.
-      observe "removing symbolic link $new which points to $old"
-      rm "$new"
-    else
-      # Back it up.
-      warn "backing up symbolic link $new as $new.dpkg-old"
-      mv -b "$new" "$new.dpkg-old"
-    fi
-  fi
-
-  # Does new location exist, but is not a directory?
-  if [ -e "$new" ] && ! [ -d "$new" ]; then
-    warn "backing up non-directory $new as $new.dpkg-old"
-    mv -b "$new" "$new.dpkg-old"
-  fi
-
-  # Create new directory if it does not yet exist.
-  if ! [ -e "$new" ]; then
-    observe "creating $new"
-    mkdir -p "$new"
-  fi
-
-  # Copy files in old location to new location.  Back up any filenames that
-  # already exist in the new location with the extension ".dpkg-old".
-  observe "copying files from $old to $new"
-  if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
-    die "error(s) encountered while copying files from $old to $new"
-  fi
-
-  # Remove files at old location.
-  observe "removing $old"
-  rm -r "$old"
-
-  # Create symlink from old location to new location.
-  make_symlink_sane "$old" "$new"
-}
-
-# vim:set ai et sw=2 ts=2 tw=80:
-
-# GOBSTOPPER: The X Strike Force shell library ends here.
diff --git a/debian/xtrans-dev.install b/debian/xtrans-dev.install
deleted file mode 100755 (executable)
index 645aa11..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/include/X11/Xtrans/*
-usr/share/aclocal/xtrans.m4
-usr/lib/pkgconfig/xtrans.pc
old mode 100755 (executable)
new mode 100644 (file)
index 19ad939..014c956
@@ -1,62 +1,13 @@
-#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-#
 
 if ENABLE_DOCS
-doc_sources = xtrans.xml
-dist_doc_DATA = $(doc_sources)
 
-if HAVE_XMLTO
-doc_DATA = $(doc_sources:.xml=.html)
+# Main DocBook/XML files (DOCTYPE book)
+docbook = xtrans.xml
 
-if HAVE_FOP
-doc_DATA += $(doc_sources:.xml=.ps) $(doc_sources:.xml=.pdf)
-endif
+# The location where the DocBook/XML files and their generated formats are installed
+shelfdir = $(docdir)
 
-if HAVE_XMLTO_TEXT
-doc_DATA += $(doc_sources:.xml=.txt)
-endif
+# Generate DocBook/XML output formats with or without stylesheets
+include $(top_srcdir)/docbook.am
 
-if HAVE_STYLESHEETS
-XMLTO_FLAGS =                                                          \
-       -m $(XSL_STYLESHEET)                                            \
-       --stringparam html.stylesheet="$(STYLESHEET_SRCDIR)/xorg.css"
-endif
-
-CLEANFILES = $(doc_DATA)
-
-SUFFIXES = .xml .ps .pdf .txt .html
-
-.xml.txt:
-       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $<
-
-.xml.html:
-       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $<
-
-.xml.pdf:
-       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop pdf $<
-
-.xml.ps:
-       $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop ps $<
-
-endif HAVE_XMLTO
 endif ENABLE_DOCS
old mode 100755 (executable)
new mode 100644 (file)
index ec8b42d..12dbe3c
@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
-                      "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+                      "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
 
 <!-- lifted from troff+ms+XMan by doclifter -->
 <book id="xtrans">
 <bookinfo>
    <title>X Transport Interface</title>
    <subtitle>X Consortium Standard</subtitle>
-   <releaseinfo>X Version 11, Release 7.X</releaseinfo>
    <authorgroup>
-      <author>
-         <firstname>Stuart</firstname><surname>Anderson</surname>
-      </author>
+     <author>
+       <firstname>Stuart</firstname><surname>Anderson</surname>
+       <affiliation><orgname>NCR Corporation</orgname></affiliation>
+     </author>
+     <othercredit><firstname>Ralph</firstname><surname>Mor</surname>
+       <affiliation><orgname>X Consortium</orgname></affiliation>
+     </othercredit>
+     <othercredit><firstname>Alan</firstname><surname>Coopersmith</surname>
+       <affiliation><orgname>Oracle Corp.</orgname></affiliation>
+     </othercredit>
    </authorgroup>
-   <othercredit><firstname>Ralph</firstname><surname>Mor</surname></othercredit>
-   <othercredit><firstname>Alan</firstname><surname>Coopersmith</surname></othercredit>
-   <corpname>NCR Corporation</corpname>
+   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
    <releaseinfo>Version 0.7</releaseinfo>
-   <affiliation><orgname>The Open Group</orgname></affiliation>
-   <productnumber>X Version 11, Release 7.x</productnumber>
+   <copyright><year>1993</year><year>1994</year>
+     <holder>NCR Corporation - Dayton, Ohio, USA</holder>
+   </copyright>
 
 <legalnotice>
 <para>
-Copyright &copy; 1993, 1994 NCR Corporation - Dayton, Ohio, USA
-</para>
-
-<para>
 All Rights Reserved
 </para>
-
 <para>
 Permission to use, copy, modify, and distribute this software and its
 documentation for any purpose and without fee is hereby granted, provided
@@ -41,7 +44,6 @@ written prior permission.  NCR makes no representations about the
 suitability of this software for any purpose.  It is provided "as is"
 without express or implied warranty.
 </para>
-
 <para>
 NCR DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
@@ -51,14 +53,12 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 </para>
-
 </legalnotice>
 
 <legalnotice>
-<para>
+<para role="multiLicensing">
 Copyright &copy; 1993, 1994, 2002 The Open Group
 </para>
-
 <para>
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the &ldquo;Software&rdquo;), to deal
@@ -67,12 +67,10 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:
 </para>
-
 <para>
 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.
 </para>
-
 <para>
 THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@@ -81,19 +79,15 @@ OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 </para>
-
 <para>
 Except as contained in this notice, the name of The Open Group shall not be
 used in advertising or otherwise to promote the sale, use or other dealings
 in this Software without prior written authorization from The Open Group.
 </para>
-
 <para>
 X Window System is a trademark of The Open Group, Inc.
 </para>
-
 </legalnotice>
-
 </bookinfo>
 
 <preface><title>The X Transport Interface</title>
@@ -109,7 +103,7 @@ for client vs. server code.
 </para></note>
 </preface>
 
-<chapter id='purposes_and_goals'>
+<chapter id='Purposes_and_Goals'>
 <title>Purposes and Goals</title>
 
 <para>The X Transport Interface is intended to combine all system and
@@ -127,7 +121,7 @@ FS, and connection-less oriented protocols such as XDMCP.</para>
 
 </chapter>
 
-<chapter id='overview_of_the_interface'>
+<chapter id='Overview_of_the_Interface'>
 <title>Overview of the Interface</title>
 
 <para>
@@ -148,7 +142,7 @@ an interface would affect performance.
 </para>
 </chapter>
 
-<chapter id='definition_of_address_specification_format'>
+<chapter id='Definition_of_Address_Specification_Format'>
 <title>Definition of Address Specification Format</title>
 
 <para>
@@ -175,14 +169,14 @@ part of an address.
 </para>
 </chapter>
 
-<chapter id='internal_data_structures'>
+<chapter id='Internal_Data_Structures'>
 <title>Internal Data Structures</title>
 <para>
 There are two major data structures associated with the transport
 independent portion of this interface.  Additional data structures
 may be used internally by each transport.
 </para>
-<sect1 id="xtransport">
+<sect1 id='Xtransport'>
 <title>Xtransport</title>
 <para>
 Each transport supported has an entry in the transport table. The transport
@@ -343,7 +337,7 @@ should not be unlinked.
 </para>
 </sect1>
 
-<sect1 id="xtransconninfo">
+<sect1 id='XtransConnInfo'>
 <title>XtransConnInfo</title>
 <para>
 Each connection will have an opaque <structname>XtransConnInfo</structname>
@@ -370,7 +364,7 @@ struct _XtransConnInfo {
 </sect1>
 </chapter>
 
-<chapter id='exposed_transport_independent_api'>
+<chapter id='Exposed_Transport_Independent_API'>
 <title>Exposed Transport Independent API</title>
 
 <para>
@@ -391,7 +385,7 @@ All failures are considered fatal, and the connection should be closed
 and re-established if desired. In most cases, however, the value of
 errno will be available for debugging purposes.
 </para>
-<sect1 id="core_interface_api">
+<sect1 id='Core_Interface_API'>
 <title>Core Interface API</title>
 <itemizedlist mark='bullet'>
   <listitem>
@@ -665,7 +659,7 @@ is the list of transports.
 </itemizedlist>
 </sect1>
 
-<sect1 id="utility_api">
+<sect1 id='Utility_API'>
 <title>Utility API</title>
 <para>
 This section describes a few useful functions that have been implemented on
@@ -687,7 +681,7 @@ FamilyLocal)).
 </sect1>
 </chapter>
 
-<chapter id="transport_option_definition">
+<chapter id='Transport_Option_Definition'>
 <title>Transport Option Definition</title>
 <para>
 The following options are defined for the
@@ -721,7 +715,7 @@ connection will not be closed when an exec occurs.
 </itemizedlist>
 </chapter>
 
-<chapter id="hidden_transport_dependent_api">
+<chapter id='Hidden_Transport_Dependent_API'>
 <title>Hidden Transport Dependent API</title>
 <para>
 The hidden transport dependent functions are placed in the Xtransport record.
@@ -941,7 +935,7 @@ This function will break the connection, and close the endpoint.
   </listitem>
 </itemizedlist>
 </chapter>
-<chapter id="configuration">
+<chapter id='Configuration'>
 <title>Configuration</title>
 
 <para>
@@ -962,13 +956,14 @@ In X11R7 modular releases, these flags are set when running
 <function>XTRANS_CONNECTION_FLAGS</function> macro from
 <filename>xtrans.m4</filename>.
 </para>
-<informaltable pgwide='0' frame='none'>
-  <tgroup cols='4' align='left'>
-    <colspec colname='define' align='center'/>
-    <colspec colname='enable'/>
-    <colspec colname='desc'/>
+
+<informaltable frame='topbot'>
+  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
+    <colspec colname='define' colwidth='1.0*' />
+    <colspec colname='enable' colwidth='2.0*' />
+    <colspec colname='desc'   colwidth='2.0*'/>
     <thead>
-      <row>
+      <row rowsep='1'>
        <entry><code>#define</code></entry>
        <entry>configure flag</entry>
        <entry>Description</entry>
@@ -1024,18 +1019,18 @@ In X11R7 modular releases, these flags are set when running
 
 </chapter>
 
-<chapter id="transport_specific_definitions">
+<chapter id='Transport_Specific_Definitions'>
 <title>Transport Specific Definitions</title>
 
-<informaltable pgwide='0' frame='none'>
+<informaltable frame='all' colsep='1' rowsep='1'>
   <tgroup cols='4' align='center'>
-    <colspec colname='c1'/>
-    <colspec colname='c2'/>
-    <colspec colname='c3'/>
-    <colspec colname='c4'/>
+    <colspec colname='c1' colwidth='1.0*'/>
+    <colspec colname='c2' colwidth='1.0*'/>
+    <colspec colname='c3' colwidth='3.0*'/>
+    <colspec colname='c4' colwidth='2.0*'/>
     <thead>
       <row>
-        <entry morerows="1" align='center'>Protocol Family</entry>
+        <entry morerows="1">Protocol Family</entry>
         <entry namest="c2" nameend="c4"  align='center'>Address Component</entry>
       </row>
       <row>
@@ -1046,34 +1041,34 @@ In X11R7 modular releases, these flags are set when running
     </thead>
     <tbody>
       <row>
-        <entry align='center'>Internet</entry>
-        <entry align='center'>inet inet6 tcp udp</entry>
-        <entry align='center'>name of an internet addressable host</entry>
-        <entry align='center'>string containing the name of a service or a valid port number.  Example: "xserver0", "7100"</entry>
+        <entry>Internet</entry>
+        <entry>inet inet6 tcp udp</entry>
+        <entry>name of an internet addressable host</entry>
+        <entry>string containing the name of a service or a valid port number.  Example: "xserver0", "7100"</entry>
       </row>
       <row>
-        <entry align='center'>DECnet</entry>
-        <entry align='center'>decnet</entry>
-        <entry align='center'>name of a DECnet addressable host</entry>
-        <entry align='center'>string containing the complete name of the object.  Example: "X$X0"</entry>
+        <entry>DECnet</entry>
+        <entry>decnet</entry>
+        <entry>name of a DECnet addressable host</entry>
+        <entry>string containing the complete name of the object.  Example: "X$X0"</entry>
       </row>
       <row>
-        <entry align='center'>NETware</entry>
-        <entry align='center'>ipx</entry>
-        <entry align='center'>name of a NETware addressable host</entry>
-        <entry align='center'>Not sure of the specifics yet.</entry>
+        <entry>NETware</entry>
+        <entry>ipx</entry>
+        <entry>name of a NETware addressable host</entry>
+        <entry>Not sure of the specifics yet.</entry>
       </row>
       <row>
-        <entry align='center'>OSI</entry>
-        <entry align='center'>osi</entry>
-        <entry align='center'>name of an OSI adressable host.</entry>
-        <entry align='center'>Not sure of the specifics yet.</entry>
+        <entry>OSI</entry>
+        <entry>osi</entry>
+        <entry>name of an OSI adressable host.</entry>
+        <entry>Not sure of the specifics yet.</entry>
       </row>
       <row>
-        <entry align='center'>Local</entry>
-        <entry align='center'>local pts named sco isc</entry>
-        <entry align='center'>(ignored)</entry>
-        <entry align='center'>String containing the port name, ie "xserver0", "fontserver0".</entry>
+        <entry>Local</entry>
+        <entry>local pts named sco isc</entry>
+        <entry>(ignored)</entry>
+        <entry>String containing the port name, ie "xserver0", "fontserver0".</entry>
       </row>
     </tbody>
   </tgroup>
@@ -1081,7 +1076,7 @@ In X11R7 modular releases, these flags are set when running
 
 </chapter>
 
-<chapter id="implementation_notes">
+<chapter id='Implementation_Notes'>
 <title>Implementation Notes</title>
 <para>
 This section refers to the prototype implementation that is being developed
diff --git a/docbook.am b/docbook.am
new file mode 100644 (file)
index 0000000..bba4d54
--- /dev/null
@@ -0,0 +1,105 @@
+#
+# Generate output formats for a single DocBook/XML with/without chapters
+#
+# Variables set by the calling Makefile:
+# shelfdir: the location where the docs/specs are installed. Typically $(docdir)
+# docbook:  the main DocBook/XML file, no chapters, appendix or image files
+# chapters: all files pulled in by an XInclude statement and images.
+#
+
+#
+# This makefile is intended for Users Documentation and Functional Specifications.
+# Do not use for Developer Documentation which is not installed and does not require olink.
+# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393
+# for an explanation on documents classification.
+#
+
+# DocBook/XML generated output formats to be installed
+shelf_DATA =
+
+# DocBook/XML file with chapters, appendix and images it includes
+dist_shelf_DATA = $(docbook) $(chapters)
+
+if HAVE_XMLTO
+if HAVE_STYLESHEETS
+
+XMLTO_SEARCHPATH_FLAGS =                               \
+       --searchpath "$(XORG_SGML_PATH)/X11"            \
+       --searchpath "$(abs_top_builddir)"
+XMLTO_HTML_OLINK_FLAGS = \
+       --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \
+       --stringparam current.docid="$(<:.xml=)"
+XMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
+XMLTO_HTML_FLAGS =                                     \
+       $(XMLTO_SEARCHPATH_FLAGS)                       \
+       $(XMLTO_HTML_STYLESHEET_FLAGS)                  \
+       $(XMLTO_HTML_OLINK_FLAGS)
+
+shelf_DATA += $(docbook:.xml=.html)
+%.html: %.xml $(chapters)
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
+
+if HAVE_XMLTO_TEXT
+
+shelf_DATA += $(docbook:.xml=.txt)
+%.txt: %.xml $(chapters)
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
+endif HAVE_XMLTO_TEXT
+
+if HAVE_FOP
+XMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/
+XMLTO_PDF_OLINK_FLAGS = \
+       --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \
+       --stringparam current.docid="$(<:.xml=)"
+XMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
+
+XMLTO_FO_FLAGS =                                       \
+       $(XMLTO_SEARCHPATH_FLAGS)                       \
+       $(XMLTO_FO_STYLESHEET_FLAGS)                    \
+       $(XMLTO_FO_IMAGEPATH_FLAGS)                     \
+       $(XMLTO_PDF_OLINK_FLAGS)
+
+shelf_DATA += $(docbook:.xml=.pdf)
+%.pdf: %.xml $(chapters)
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
+
+shelf_DATA += $(docbook:.xml=.ps)
+%.ps: %.xml $(chapters)
+       $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
+endif HAVE_FOP
+
+# Generate documents cross-reference target databases
+if HAVE_XSLTPROC
+
+XSLT_SEARCHPATH_FLAGS =                                \
+       --path "$(XORG_SGML_PATH)/X11"                  \
+       --path "$(abs_top_builddir)"
+XSLT_OLINK_FLAGS =                                     \
+       --stringparam targets.filename "$@"             \
+       --stringparam collect.xref.targets "only"       \
+       --stringparam olink.base.uri "$(@:.db=)"
+
+XSLT_HTML_FLAGS =                                      \
+       $(XSLT_SEARCHPATH_FLAGS)                        \
+       $(XSLT_OLINK_FLAGS)                             \
+       --nonet --xinclude                              \
+       $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
+XSLT_PDF_FLAGS =                                       \
+       $(XSLT_SEARCHPATH_FLAGS)                        \
+       $(XSLT_OLINK_FLAGS)                             \
+       --nonet --xinclude                              \
+       $(STYLESHEET_SRCDIR)/xorg-fo.xsl
+
+shelf_DATA += $(docbook:.xml=.html.db)
+%.html.db: %.xml  $(chapters)
+       $(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $<
+
+shelf_DATA += $(docbook:.xml=.pdf.db)
+%.pdf.db: %.xml $(chapters)
+       $(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $<
+
+endif HAVE_XSLTPROC
+endif HAVE_STYLESHEETS
+endif HAVE_XMLTO
+
+CLEANFILES = $(shelf_DATA)
index 95af75a..ff9b5ce 100644 (file)
@@ -1,45 +1,44 @@
-
-Name:       xorg-x11-xtrans-devel
-Summary:    X.Org X11 developmental X transport library
-Version:    1.2.6
-Release:    1
-Group:      System/Libraries
-License:    MIT/X11
-URL:        http://www.x.org
-Source0:    http://xorg.freedesktop.org/releases/individual/lib/xtrans-%{version}.tar.gz
+# NOTE: This package contains only C source and header files and pkg-config
+# *.pc files, and does not contain any ELF binaries or DSOs, so we disable
+# debuginfo generation.
+%define debug_package %{nil}
+
+Summary: X.Org X11 developmental X transport library
+Name: xorg-x11-xtrans-devel
+Version: 1.2.7
+Release: 1
+License: MIT
+Group: System Environment/Libraries
+URL: http://www.x.org
+BuildArch: noarch
+
+Source0: %{name}-%{version}.tar.gz
+
+BuildRequires: pkgconfig
 BuildRequires:  pkgconfig(xorg-macros)
+BuildRequires: xorg-x11-xutils-dev
 
 %description
-Description: %{summary}
-
-
+X.Org X11 developmental X transport library
 
 %prep
-%setup -q -n xtrans-%{version}
-
+%setup -q
 
 %build
 
-%reconfigure --disable-shared
-# Call make instruction with smp support
-make %{?jobs:-j%jobs}
+# yes, this looks horrible, but it's to get the .pc file in datadir
+%reconfigure --libdir=%{_datadir} \
+          --docdir=%{_docdir}/%{name}-%{version}-%{release}
+# Running 'make' not needed.
 
 %install
-rm -rf %{buildroot}
-%make_install
-
-
-%clean
-rm -rf %{buildroot}
-
-
-
-
+make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
 
+%remove_docs
 
 %files
 %defattr(-,root,root,-)
-%doc AUTHORS COPYING README
+%doc AUTHORS ChangeLog COPYING README
 %dir %{_includedir}/X11
 %dir %{_includedir}/X11/Xtrans
 %{_includedir}/X11/Xtrans/Xtrans.c
@@ -50,8 +49,7 @@ rm -rf %{buildroot}
 %{_includedir}/X11/Xtrans/Xtranstli.c
 %{_includedir}/X11/Xtrans/Xtransutil.c
 %{_includedir}/X11/Xtrans/transport.c
-%{_libdir}/pkgconfig/xtrans.pc
 %{_datadir}/aclocal/xtrans.m4
-%{_docdir}/xtrans/xtrans.xml
-
-
+%{_datadir}/pkgconfig/xtrans.pc
+#%dir %{_docdir}/%{name}-%{version}-%{release}
+#%{_docdir}/%{name}-%{version}-%{release}/xtrans.xml
index 5131d99..2cb8882 100644 (file)
@@ -47,19 +47,19 @@ from The Open Group.
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-
-#ifdef XSERV_t
-#include "os.h"
-#else
 #include <stdlib.h>
-#define xalloc(_size)          malloc(_size)
-#define xcalloc(_num,_size)    calloc(_num,_size)
-#define xrealloc(_ptr,_size)   realloc(_ptr,_size)
-#define xfree(_ptr)            free(_ptr)
-#endif
+
+#define XTRANS_TRANSPORT_C  /* used to flag Xtransint.h that it's being used
+                              here, not just #included in another file */
 
 #include "Xtransint.h"
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat-nonliteral"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #ifdef LOCALCONN
 #include "Xtranslcl.c"
 #endif
@@ -71,3 +71,7 @@ from The Open Group.
 #endif
 #include "Xtrans.c"
 #include "Xtransutil.c"
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index da35a75..91c6f9d
--- a/xtrans.m4
+++ b/xtrans.m4
@@ -33,9 +33,9 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[
  fi
 
  # Needs to come after above checks for libsocket & libnsl for SVR4 systems
- AC_ARG_ENABLE(ipv6, 
+ AC_ARG_ENABLE(ipv6,
        AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
-       [IPV6CONN=$enableval], 
+       [IPV6CONN=$enableval],
        [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
  AC_MSG_CHECKING([if IPv6 support should be built])
  if test "$IPV6CONN" = "yes"; then
@@ -44,7 +44,7 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[
  AC_MSG_RESULT($IPV6CONN)
 
  # 4.3BSD-Reno added a new member to struct sockaddr_in
- AC_CHECK_MEMBER([struct sockaddr_in.sin_len], 
+ AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
        AC_DEFINE([BSD44SOCKETS],1,
            [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
 #include <sys/types.h>
@@ -56,7 +56,7 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[
  AC_CHECK_TYPES([socklen_t], [], [], [
 AC_INCLUDES_DEFAULT
 #include <sys/socket.h>])
+
 ]) # XTRANS_TCP_FLAGS
 
 # XTRANS_CONNECTION_FLAGS()
@@ -78,7 +78,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
        AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
  fi
  AC_MSG_RESULT($UNIXCONN)
- AC_ARG_ENABLE(tcp-transport, 
+ AC_ARG_ENABLE(tcp-transport,
        AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
        [TCPCONN=$enableval], [TCPCONN=yes])
  AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
@@ -99,7 +99,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
  if test "$LOCALCONN" = "yes"; then
        AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
  fi
+
 ]) # XTRANS_CONNECTION_FLAGS
 
 
@@ -109,7 +109,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
 # so that any necessary networking libraries are already found
 AC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
 [AC_REQUIRE([XTRANS_TCP_FLAGS])
- AC_ARG_ENABLE(secure-rpc, 
+ AC_ARG_ENABLE(secure-rpc,
        AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
         [SECURE_RPC=$enableval], [SECURE_RPC="try"])
 
@@ -120,7 +120,7 @@ AC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
        if test "x$FOUND_SECURE_RPC" = "xno" ; then
                if test "x$SECURE_RPC" = "xyes" ; then
        AC_MSG_ERROR([Secure RPC requested, but required functions not found])
-               fi      
+               fi
                SECURE_RPC="no"
        else
                dnl FreeBSD keeps getsecretkey in librpcsvc