Update to xtrans 1.2.7
This commit is contained in:
parent
a577557f31
commit
0e15740580
@ -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
|
||||
|
@ -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,21 +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;
|
||||
size_t len;
|
||||
|
||||
PRMSG (3,"ParseAddress(%s)\n", address, 0, 0);
|
||||
prmsg (3,"ParseAddress(%s)\n", address);
|
||||
|
||||
/* Copy the string so it can be changed */
|
||||
|
||||
len = strlen (address) + 1;
|
||||
tmpptr = mybuf = (char *) xalloc (len);
|
||||
strlcpy (mybuf, address, len);
|
||||
tmpptr = mybuf = strdup (address);
|
||||
|
||||
/* Parse the string to get each component */
|
||||
|
||||
|
||||
/* Get the protocol part */
|
||||
|
||||
_protocol = mybuf;
|
||||
@ -230,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;
|
||||
}
|
||||
|
||||
@ -280,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);
|
||||
@ -310,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';
|
||||
@ -362,49 +344,41 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
|
||||
* Now that we have all of the components, allocate new
|
||||
* string space for them.
|
||||
*/
|
||||
len = strlen (_protocol) + 1;
|
||||
if ((*protocol = (char *) xalloc(len)) == NULL)
|
||||
|
||||
if ((*protocol = strdup (_protocol)) == NULL)
|
||||
{
|
||||
/* Malloc failed */
|
||||
*port = NULL;
|
||||
*host = NULL;
|
||||
*protocol = NULL;
|
||||
xfree (tmpptr);
|
||||
free (tmpptr);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
strlcpy (*protocol, _protocol, len);
|
||||
|
||||
len = strlen (_host) + 1;
|
||||
if ((*host = (char *) xalloc (len)) == NULL)
|
||||
if ((*host = strdup (_host)) == NULL)
|
||||
{
|
||||
/* Malloc failed */
|
||||
*port = NULL;
|
||||
*host = NULL;
|
||||
xfree (*protocol);
|
||||
free (*protocol);
|
||||
*protocol = NULL;
|
||||
xfree (tmpptr);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
strlcpy (*host, _host, len);
|
||||
|
||||
len = strlen (_port) + 1;
|
||||
if ((*port = (char *) xalloc (len)) == NULL)
|
||||
{
|
||||
/* Malloc failed */
|
||||
*port = NULL;
|
||||
xfree (*host);
|
||||
*host = NULL;
|
||||
xfree (*protocol);
|
||||
*protocol = NULL;
|
||||
xfree (tmpptr);
|
||||
free (tmpptr);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
strlcpy (*port, _port, len);
|
||||
|
||||
xfree (tmpptr);
|
||||
if ((*port = strdup (_port)) == NULL)
|
||||
{
|
||||
/* Malloc failed */
|
||||
*port = NULL;
|
||||
free (*host);
|
||||
*host = NULL;
|
||||
free (*protocol);
|
||||
*protocol = NULL;
|
||||
free (tmpptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
free (tmpptr);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -424,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
|
||||
@ -438,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;
|
||||
}
|
||||
|
||||
@ -446,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;
|
||||
}
|
||||
|
||||
@ -480,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;
|
||||
}
|
||||
@ -522,9 +496,8 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
|
||||
Xtransport *thistrans = NULL;
|
||||
char *save_port;
|
||||
int i;
|
||||
size_t len;
|
||||
|
||||
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 */
|
||||
|
||||
@ -537,22 +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;
|
||||
}
|
||||
|
||||
len = strlen (port) + 1;
|
||||
if ((save_port = (char *) xalloc (len)) == 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;
|
||||
}
|
||||
|
||||
strlcpy (save_port, port, len);
|
||||
|
||||
/* Get a new XtransConnInfo object */
|
||||
|
||||
switch (type)
|
||||
@ -564,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;
|
||||
}
|
||||
|
||||
@ -595,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);
|
||||
}
|
||||
|
||||
@ -608,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);
|
||||
}
|
||||
|
||||
@ -621,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);
|
||||
}
|
||||
|
||||
@ -634,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);
|
||||
}
|
||||
|
||||
@ -647,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);
|
||||
}
|
||||
|
||||
@ -655,33 +626,28 @@ 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)
|
||||
|
||||
{
|
||||
int i;
|
||||
size_t len;
|
||||
|
||||
for (i = 0; i < NUMTRANS; i++)
|
||||
if (Xtransports[i].transport == ciptr->transptr)
|
||||
{
|
||||
*trans_id = Xtransports[i].transport_id;
|
||||
*fd = ciptr->fd;
|
||||
|
||||
len = strlen (ciptr->port) + 1;
|
||||
if ((*port = (char *) xalloc (len)) == NULL)
|
||||
|
||||
if ((*port = strdup (ciptr->port)) == NULL)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
strlcpy (*port, ciptr->port, len);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -697,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.
|
||||
@ -719,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);
|
||||
@ -731,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;
|
||||
@ -769,7 +735,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
|
||||
#endif /* F_SETFD */
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -783,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;
|
||||
}
|
||||
@ -825,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);
|
||||
|
||||
@ -849,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;
|
||||
}
|
||||
|
||||
@ -864,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;
|
||||
}
|
||||
|
||||
@ -931,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);
|
||||
|
||||
@ -946,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);
|
||||
|
||||
@ -964,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);
|
||||
@ -984,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);
|
||||
@ -1053,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)
|
||||
|
||||
{
|
||||
@ -1064,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;
|
||||
|
||||
@ -1075,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
|
||||
@ -1091,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)
|
||||
@ -1120,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]);
|
||||
@ -1134,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;
|
||||
}
|
||||
@ -1146,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)++;
|
||||
@ -1157,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;
|
||||
@ -1176,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)
|
||||
|
||||
{
|
||||
@ -1189,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;
|
||||
|
||||
@ -1204,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;
|
||||
}
|
||||
|
||||
@ -1225,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]);
|
||||
@ -1239,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;
|
||||
@ -1275,7 +1239,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
|
||||
}
|
||||
else
|
||||
*ciptrs_ret = NULL;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1289,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
|
||||
@ -1321,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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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_ */
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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) {
|
||||
strlcpy ((char *) *addrp, hostnamebuf, len + 1);
|
||||
*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;
|
||||
size_t len;
|
||||
|
||||
if (gethostname (hostnamebuf, sizeof (hostnamebuf)) < 0)
|
||||
@ -258,7 +258,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
|
||||
struct sockaddr_un *saddr = (struct sockaddr_un *) addr;
|
||||
len = 3 + strlen (transName) +
|
||||
strlen (hostnamebuf) + strlen (saddr->sun_path);
|
||||
networkId = (char *) xalloc (len);
|
||||
networkId = (char *) malloc (len);
|
||||
snprintf (networkId, len, "%s/%s:%s", transName,
|
||||
hostnamebuf, saddr->sun_path);
|
||||
break;
|
||||
@ -289,7 +289,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
|
||||
snprintf (portnumbuf, sizeof(portnumbuf), "%d", portnum);
|
||||
len = 3 + strlen (transName) +
|
||||
strlen (hostnamebuf) + strlen (portnumbuf);
|
||||
networkId = (char *) xalloc (len);
|
||||
networkId = (char *) malloc (len);
|
||||
snprintf (networkId, len, "%s/%s:%s", transName, hostnamebuf,
|
||||
portnumbuf);
|
||||
break;
|
||||
@ -319,7 +319,7 @@ int
|
||||
void
|
||||
#endif
|
||||
#endif
|
||||
nameserver_lost(int sig)
|
||||
nameserver_lost(int sig _X_UNUSED)
|
||||
{
|
||||
nameserver_timedout = 1;
|
||||
longjmp (env, -1);
|
||||
@ -345,7 +345,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)
|
||||
@ -390,7 +390,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;
|
||||
@ -421,7 +421,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
|
||||
}
|
||||
|
||||
len = strlen (ciptr->transptr->TransName) + strlen (addr) + 2;
|
||||
hostname = (char *) xalloc (len);
|
||||
hostname = (char *) malloc (len);
|
||||
strlcpy (hostname, ciptr->transptr->TransName, len);
|
||||
strlcat (hostname, "/", len);
|
||||
if (addr)
|
||||
@ -433,13 +433,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;
|
||||
@ -480,15 +480,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 */
|
||||
@ -501,15 +501,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
|
||||
@ -517,8 +517,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
|
||||
@ -527,13 +527,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;
|
||||
@ -552,7 +552,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
|
||||
@ -562,7 +562,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
|
||||
@ -574,7 +574,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
|
||||
@ -586,8 +586,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;
|
||||
}
|
||||
/*
|
||||
@ -597,8 +598,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)
|
||||
@ -609,34 +611,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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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">
|
||||
@ -8,28 +11,28 @@
|
||||
<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 © 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 © 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 “Software”), 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 “AS IS”, 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
|
||||
|
105
lib/libxtrans/docbook.am
Normal file
105
lib/libxtrans/docbook.am
Normal file
@ -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)
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user