[comp.windows.x] Xlib code/doc discrepancies

drk@twinkie.Rational.COM (David Kaelbling) (10/24/90)

What is the "definition of the truth" for Xlib?  There are a few
discrepancies between the code and the documentation, and I don't know
which one to trust.  An example is the definition of a resource name:
the docs say (around page 224) that only alphanumerics, underscores,
and dashes are allowed in component names, but XrmStringToQuarkList et
al cheerfully accept all manner of "illegal" characters.
--
David Kaelbling                                       (408) 496-3600
c/o Rational; 3320 Scott Boulevard; Santa Clara, CA       95054-3197
Email: drk@Rational.COM, or uucp {uunet,ubvax,amdcad,aeras}!igor!drk

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (10/24/90)

    What is the "definition of the truth" for Xlib?

The specification, of course.

    An example is the definition of a resource name:
    the docs say (around page 224) that only alphanumerics, underscores,
    and dashes are allowed in component names, but XrmStringToQuarkList et
    al cheerfully accept all manner of "illegal" characters.

You should treat this as an example of an implicit statement:  "The
specification says the argument must satisfy <blah>, and if the argument
doesn't satisfy <blah>, the results are undefined."  Naturally, the
implementation has to choose some result.

jg@crl.dec.com (Jim Gettys) (10/24/90)

The definition of the truth is the specification.

Of course, specifications can have errors as well.

You are using a page number; but you don't say what edition
of what book you are referring to.  This makes it real hard to
help you (or anyone else).  Page 224 is certainly no where
near XrmStringToQuarkList in the Digital Press book, either
first or second edition, or in the O'Reilly books I have
(though these are reorganized from the MIT masters, and we can take
no responsibility for any errors).

As to what the definition of the truth is, that is a good
question.  It has ultimately been the specification shipped on
the MIT X distribution (with whatever modifications that have been
made in the X Consortium since the last release); 
this will likely change to the ANSI spec when it is approved.  
I have some misgivings about this, as ANSI currently
sells their documents rather than them being freely available.
(This is how standards bodies fund themselves, strangely enough:
they sell the specifications...).

The Digital Press book, "The X Window System", 2nd edition, 
by Bob Scheifler and myself is as close to the truth as we could make it.
(DP ISBN 1-55558-050-5, PH ISBN 0-13-972050-2).  As far as
we know, it is word for word identical to the MIT specification for
the protocol and Xlib, typeset from the original files to a more
reasonable style.  

The XLFD and ICCCM in the second edition (by Jim Flowers and David Rosenthal)
of the Digital Press book have had a copy edit performed from the MIT
originals; I don't know if the changes in wording may
yet have been approved by the X Consortium for these specifications,
though they are much clearer than the original (Bob, what is the
current state?).

-- 
Jim Gettys
Digital Equipment Corporation
Cambridge Research Laboratory