Commit graph

72 commits

Author SHA1 Message Date
Kees Cook
54540d7cba libX11: check size of GetReqExtra after XFlush
Two users of GetReqExtra pass arbitrarily sized allocations from the
caller (ModMap and Host). Adjust _XGetRequest() (called by the GetReqExtra
macro) to double-check the requested length and invalidate "req" when
this happens. Users of GetReqExtra passing lengths greater than the Xlib
buffer size (normally 16K) must check "req" and fail gracefully instead
of crashing.

Any callers of GetReqExtra that do not check "req" for NULL
will experience this change, in the pathological case, as a NULL
dereference instead of a buffer overflow. This is an improvement, but
the documentation for GetReqExtra has been updated to reflect the need
to check the value of "req" after the call.

Bug that manifested the problem:
https://bugs.launchpad.net/ubuntu/+source/x11-xserver-utils/+bug/792628

Signed-off-by: Kees Cook <kees@outflux.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-22 23:51:38 -07:00
Alan Coopersmith
9dfb0f3c0a troff macro expansion in specs/libX11
Many of the custom nroff macros (.ds <macro> <contents>) were left
unsubstituted in the nroff->docbook conversion.   This substitution
is now performed, via the following perl script:

#! /usr/bin/perl -w -i

use Text::Wrap;

while ($_ = <>) {
    while ($_ =~ m/\((\w+)\b/g) {
        my $m = $1;
        if (exists $macro{$m}) {
            $_ =~ s/\($m/$macro{$m}/;
            $_ = wrap('', '', $_);
            $_ =~ s/[ \t]+$//;
        }
    }

    if ($_ =~ /\<!-- .ds (\w+) (.*) -->/) {
        my ($m, $s) = ($1, $2);
        $macro{$m} = $s;
        while ($macro{$m} =~ /\\\s*$/) {
            $macro{$m} =~ s/\\\s*$//ms;
            $macro{$m} .= <>;
            chomp($macro{$m});
        }
        $macro{$m} =~ s/\\ / /g;
    } else {
        print $_;
    }
}

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-06-07 20:12:25 -07:00
Alan Coopersmith
20c17bd9eb specs/libX11: correct prototype for XListPixmapFormats/XImageByteOrder
The XListPixmapFormats arguments was being shown with XImageByteOrder's
name and return types.   Appears to have been a glitch in the nroff ->
docbook conversion.

Reported-by: ZHANG Zhaolong <zhangzl2013@126.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-06-07 20:12:02 -07:00
Alan Coopersmith
dce84b8c39 libX11 spec: Correct prototype for XConvertSelection
selection & target parameters were accidentally run together

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-06-06 13:31:19 -07:00
Alan Coopersmith
b64969f0e5 Add X11R7 sections to the libX11 & XKBlib credits to cover Docbook conversion
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-04-17 18:17:53 -07:00
Alan Coopersmith
9ea611696f Add olinks from libX11 & localedb specs to ICCCM spec
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-04-17 18:01:36 -07:00
Alan Coopersmith
b3c1b8cdab Add olinks from libX11 spec to ICCCM spec
Also convert ICCCM title mentions from <emphasis> to <citetitle>

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-04-17 17:49:50 -07:00
Alan Coopersmith
ebebb65e75 libX11 AppC: Fix section headers that didn't translate from nroff properly
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-04-17 09:20:13 -07:00
Alan Coopersmith
d5ab4ae0e7 Add olinks from libX11 spec to x11protocol spec
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-04-17 09:20:06 -07:00
Alan Coopersmith
83878a0e34 libX11 spec: Remove .br nroff macro left behind in XGetWindowProperty prototype
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-04-14 22:28:53 -07:00
Matt Dew
cadcbd376f informaltable & table 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>
2012-01-21 17:59:51 -07:00
Matt Dew
22ba43d198 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>
2011-10-07 22:52:30 -06:00
Gaetan Nadon
154430268c libX11 specs: use <copyright> for first holder of multi license
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-09-20 16:08:21 -04:00
Gaetan Nadon
4519c89a87 specs: fix The Open Group license text
The warranty referred to the X Consortium

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-09-19 08:05:32 -04:00
Gaetan Nadon
08ac378423 specs: The strandard name is still "X Consortium Standard"
This spec, and fsproto spec, are the only two docs with a different
standard name.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-09-19 08:03:39 -04:00
Gaetan Nadon
8dfbeb1b1b specs: 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>
2011-09-18 13:22:34 -04:00
Gaetan Nadon
7ff012bb43 specs: handle multiple sets of copyright notice/license/warranty
Docbook groups all the <copyright> elements together and all the
<legalnotice> elements together.

We cannot have a sequence:
<copyright> <legalnotice> <copyright> <legalnotice> [...]

A workaround, which was done in some documents, is to put the copyright
notice inside the legalnotice in plain text without the <copyright> element.
A formal paragraph title is added here which makes the copyright notice bold,
and makes it much easier to locate.

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-09-17 09:44:01 -04:00
Gaetan Nadon
719f16570d docs: use the &fullrelvers; entity to set X11 release information
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-09-11 17:46:59 -04:00
Gaetan Nadon
a6b2992f50 docs: remove orphan <affiliation>
Somehow created during the conversion from roff. Unable to locate
the author to which it belongs.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-09-11 17:38:42 -04:00
Gaetan Nadon
c7420060b6 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>
2011-09-11 17:38:05 -04:00
Gaetan Nadon
7f23c72c94 libX11 specs: review doclifter generated tables
Many tables had a questionnable layout and some had information dropped.
Each table was cross-referenced with a pre-docbook version
to ensure semantic integrity.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-08-19 21:16:01 -04:00
Gaetan Nadon
1efdbeb8cd credits.xml: remove toc from Acknowledgments
There should be no toc for a simple preface with only one
Acknowledgments section.

Use <simplesect> markup rather than sect1.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-08-19 21:16:01 -04:00
Gaetan Nadon
77cc17ed08 libX11 specs: move </para> above <varaiablelist>
Many, but not all, function synopsis have a paragraph that
nests the variable list. The code was generated by doclifter
and there is no apprent reasons as to why it was done this way.
Found while investigating a spacing issue.

Before the patch:
<para>Some blurb about the function
<funcsynopsis>
</funcsynopsis>
<variablelist>
</variablelist>
</para>

After the patch:
<para>Some blurb about the function</para>
<funcsynopsis>
</funcsynopsis>
<variablelist>
</variablelist>

There are no noticable differences when reading the doc
other than than the removed few pixels of spacing between
the function sysnopsis and the variable list block.

In some cases, there are no "blurb about the fucntion"
and the empty paragraph is removed.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-08-19 21:16:01 -04:00
Matt Dew
ab1f302317 Add id attributes to error codes to allow linking from other docs.
Signed-off-by: Matt Dew <marcoz@osource.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
2011-07-17 10:28:42 -06:00
Alan Coopersmith
4e741654b7 specs/libX11: Turn appendix references into links
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-07 18:41:30 -07:00
Alan Coopersmith
a3d1152bc4 specs/libX11: Turn chapter references into links
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-07 18:37:41 -07:00
Alan Coopersmith
d0cc949dfe specs/libX11: Turn many "see section ..." into links
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-07 00:52:32 -07:00
Alan Coopersmith
02d4c08dea specs/libX11: Convert some header filenames to filename tags
perl -i -p -e 's{^&lt;(.*\.h)&gt;\ *}{<filename class="headerfile">&lt;\1&gt;</filename>}' *.xml

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-05 22:50:37 -07:00
Alan Coopersmith
6841260c8b Bug 37624 - parameter x is missing from synopsis of XDrawString in libX11.html
https://bugs.freedesktop.org/show_bug.cgi?id=37624

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-27 20:14:36 -07:00
Matt Dew
205af6a4e5 Add id's to functions, to make clickable links.
Signed-off-by: Matt Dew <marcoz@osource.org>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-05-24 12:42:43 -06:00
Alan Coopersmith
5c06bc5944 libX11 spec: fix monospaced column alignment after deligaturization
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-20 15:38:08 -07:00
James Cloos
ef0019c714 Expand latin ligatures out to their NFKC equivalents.
Ligatures should be done by the typesetting system.
Manuscripts should not bother with them.

Signed-off-by: James Cloos <cloos@jhcloos.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-05-20 17:37:44 -04:00
Gaetan Nadon
159bf29247 Remove misplaced hyphens in libX11 DocBook/XML #37364
Reported-by: Christopher Yeleighton <giecrilj@stegny.2a.pl>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-05-20 11:21:36 -04:00
Alan Coopersmith
b9ff9cfd5c specs/libX11: Fix XOpenDisplay() prototype in chapter 2 [bug 36244]
Was incorrectly showing AllPlanes() instead when describing XOpenDisplay()

https://bugs.freedesktop.org/show_bug.cgi?id=36244

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-18 17:49:23 -07:00
Alan Coopersmith
7103b83a88 Make doc install subdirectories more like the pre-docbook.am paths
Haven't restored the "specs" path in the install path, but have restored
libX11 & i18n subdirectories in the path for better logical grouping.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-04-12 18:18:39 -07:00
Alan Coopersmith
9a1ae7a90f Install xml versions of specs even if HAVE_XMLTO is false
Moves HAVE_XMLTO check into docbook.am, more closely matches behaviour
from before docbook.am changes (commit e8c76407d2)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-04-12 18:18:22 -07:00
Gaetan Nadon
e8c76407d2 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>
2011-03-30 20:18:35 -04:00
Alan Coopersmith
d2714d65e8 Revert "Mark atom names argument to XInternAtoms as const"
This reverts commit c870111546.

The constification of a pointer to a pointer caused unexpected issues,
and xorg-devel was unable to come up with a clean, safe, reasonable way
to handle them, so we're chalking this up for now as yet another mistake
in the Xlib API definition we'll be living with.

See https://bugs.freedesktop.org/show_bug.cgi?id=32098 for details.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-12-21 18:51:17 -08:00
Alan Coopersmith
c870111546 Mark atom names argument to XInternAtoms as const
Updates code & docs for XInternAtoms.

The single atom name argument to XInternAtom was already const char *
in the code, but not the docs, so updated it in the docs too.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-24 15:23:27 -08:00
Gaetan Nadon
511c4f6d29 specs: move indexterm from glossdef to glossterm
This move fixes a Java class cast exception in the glossary.
The problem was introduced in commit
26f4f0d508

It may not happen on all versions of the doc toolchain.
There is no reason why indexterm cannot appear in glossdef,
this is a workaround to an implementation problem found by
trial and error.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-28 14:06:00 -07:00
Matt Dew
87a108f3aa specs: replace troff source with docbook-xml source
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-07-25 09:16:16 -04:00
Alan Coopersmith
3df45ed0c2 specs/libX11: Fix column count of Gravity Attributes table
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-19 17:58:27 -07:00
Alan Coopersmith
53bcba0d1d specs/libX11: Convert \- to &minus; and \^ to either &hairsp; or removed
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-19 17:58:04 -07:00
Alan Coopersmith
5a0b452756 specs/libX11: Manual cleanup pass over Ch. 1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-19 14:56:37 -07:00
Alan Coopersmith
2156799295 specs/libX11: make sure all files have DOCTYPEs so standard entities work
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-19 14:55:43 -07:00
Alan Coopersmith
c944a8521f specs/libX11: Fix up list of header files in Ch.1 & add index entries
Combination of manual editing and automatic substitution via:

perl -i -p -00 -e 's{<varlistentry>(\s+)<term>&lt;X11/([^&]+)&gt;</term>(\s+)<listitem>(\s+)<para>}{<varlistentry id="Standard_Header_Files:$2">$1<term><filename class="headerfile">&lt;X11/$2&gt;</filename></term>$3<listitem>$4<indexterm type="file"><primary><filename class="headerfile">X11/$2</filename></primary></indexterm>$4<indexterm><primary>Files</primary><secondary>&lt;X11/$2&gt;</secondary></indexterm>$4<indexterm><primary>Headers</primary><secondary>&lt;X11/$2&gt;</secondary></indexterm>$4<para>}g' CH01.xml

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-18 13:47:35 -07:00
Alan Coopersmith
bb66e8f1ce specs/libX11: Add indexterms for headerfiles that .hN used to provide
Automatic substitution performed via:
perl -i -p -e 's{^&lt;<filename class="headerfile">([^<]+)</filename>&gt;(.*)$}{<filename class="headerfile">&lt;$1&gt;</filename>$2\n<indexterm type="file"><primary><filename class="headerfile">$1</filename></primary></indexterm>\n<indexterm><primary>Files</primary><secondary><filename class="headerfile">&lt;$1&gt;</filename></secondary></indexterm>\n<indexterm><primary>Headers</primary><secondary><filename class="headerfile">&lt;$1&gt;</filename></secondary></indexterm>}' *.xml

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-18 13:47:16 -07:00
Alan Coopersmith
d0b0d215cb specs/libX11: convert multicolumn lists from tables to <simplelist>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-16 21:15:13 -07:00
Alan Coopersmith
e679f80c62 specs/libX11: Tag WM_* as <property>
Mass substitution done by:
 perl -i -p -e 'if ($_ !~ m{^\<}) { $_ =~ s{(WM_\w+)}{<property>$1</property>}g; }' *.xml

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-16 20:51:52 -07:00
Alan Coopersmith
c7b7e59b3b specs/libX11: Convert simpler eqn markup to docbook tags
Mostly "sup" to <superscript>

There's several more complicated equations that will probably need
MathML or SVG to solve.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-07-16 20:41:33 -07:00