Age | Commit message (Collapse) | Author | Files | Lines |
|
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:
-bap
-psl
-T PrivatePtr
-T pmWait
-T _XFUNCPROTOBEGIN
-T _XFUNCPROTOEND
-T _X_EXPORT
The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.
The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.
The comparison was done with this script:
dir1=$1
dir2=$2
for dir in $dir1 $dir2; do
(cd $dir && find . -name '*.o' | while read file; do
dir=`dirname $file`
base=`basename $file .o`
dump=$dir/$base.dump
objdump -d $file > $dump
done)
done
find $dir1 -name '*.dump' | while read dump; do
otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
diff -u $dump $otherdump
done
Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Rename functions/macros from list_* to xorg_list_*
Rename struct from struct list to struct xorg_list.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
In-sed-I-trust: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Previously it always passed a format string with exactly one argument,
using NULL when the format string needed none. Now pass the right number
of arguments to clear gcc warnings of 'too many arguments for format'.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Treat a scandir error from a missing (or unusable) directory return as
if it simply returned no files at all, which is what we want.
cc: Paulo Zanoni <przanoni@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
After we tokenize val.str, we discard it.
This is just one example:
6 bytes in 1 blocks are definitely lost in loss record 24 of 652
at 0x4C2779D: malloc (in vgpreload_memcheck-amd64-linux.so)
by 0x4D744D: xf86getToken (scan.c:400)
by 0x4D75F1: xf86getSubToken (scan.c:462)
by 0x4DB060: xf86parseInputClassSection (InputClass.c:145)
by 0x4D664C: xf86readConfigFile (read.c:184)
by 0x490556: xf86HandleConfigFile (xf86Config.c:2360)
by 0x49AA77: InitOutput (xf86Init.c:365)
by 0x425A7A: main (main.c:204)
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
|
After we convert the value to a boolean, we discard the string.
This is just one example:
3 bytes in 1 blocks are definitely lost in loss record 5 of 657
at 0x4C2779D: malloc (vgpreload_memcheck-amd64-linux.so)
by 0x4D744D: xf86getToken (scan.c:400)
by 0x4D75F1: xf86getSubToken (scan.c:462)
by 0x4DB3E0: xf86parseInputClassSection (InputClass.c:189)
by 0x4D664C: xf86readConfigFile (read.c:184)
by 0x490556: xf86HandleConfigFile (xf86Config.c:2360)
by 0x49AA77: InitOutput (xf86Init.c:365)
by 0x425A7A: main (main.c:204)
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
|
v2: move the free()s to the function that calls scandir
80 bytes in 1 blocks are definitely lost in loss record 411 of 631
at 0x4C2779D: malloc (vgpreload_memcheck-amd64-linux.so)
by 0x4C27927: realloc (vgpreload_memcheck-amd64-linux.so)
by 0x696A80D: scandir (scandir.c:108)
by 0x4D8828: OpenConfigDir (scan.c:854)
by 0x4D8A43: xf86openConfigDirFiles (scan.c:952)
by 0x49031F: xf86HandleConfigFile (xf86Config.c:2327)
by 0x49A9E3: InitOutput (xf86Init.c:365)
by 0x425A7A: main (main.c:204)
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
We call xf86penConfigDirFiles twice, so we overwrite the configDirPath
variable, losing the pointer. If we move the pointer management to the
upper layer (the function callers), they will be able to call these
functions as many times as they want, but they'll have to free those
returned values.
v2: don't leak inside XWin
4,097 bytes in 1 blocks are definitely lost in loss record 625 of 632
at 0x4C2779D: malloc (in vgpreload_memcheck-amd64-linux.so)
by 0x4D7899: DoSubstitution (scan.c:615)
by 0x4D87B0: OpenConfigDir (scan.c:845)
by 0x4D8A2D: xf86openConfigDirFiles (scan.c:955)
by 0x49031F: xf86HandleConfigFile (xf86Config.c:2327)
by 0x49A9BF: InitOutput (xf86Init.c:365)
by 0x425A7A: main (main.c:204)
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
As long as we're carrying around a compatibility copy in os/strl*.c,
might as well use them.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
The patch below fixes a potential buffer overflow in xf86addComment().
This occurs if curlen > 0 && eol_seen == 0 && iscomment == 0 , as
follows from the code:
char *xf86addComment(char *cur, char *add)
<...>
len = strlen(add);
endnewline = add[len - 1] == '\n';
len += 1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen;
if ((str = realloc(cur, len + curlen)) == NULL)
return cur;
cur = str;
if (eol_seen || (curlen && !hasnewline))
cur[curlen++] = '\n';
if (!iscomment)
cur[curlen++] = '#';
strcpy(cur + curlen, add);
if (!endnewline)
strcat(cur, "\n");
Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
[whot: added buffer overflow test case]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Use the same struct for both InputOption and XF86OptionRec so we don't need
to convert to and fro the two in the config backends.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
|
|
In all cases, the pointer was simply type-cast anyway. Let's get some
compile-time type safety going, how about that.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Squashed in:
xfree86: Move definition of xf86OptionPtr into separate header file
The pile of spaghettis that is the xfree86 include dependencies make it
rather hard to have a single typedef somewhere that's not interfering with
everything else or drags in a whole bunch of other includes.
Move the xf86OptionRec and GenericListRec declarations into a separate
header.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Usage example (tested on a dual-seat PC):
Section "InputClass"
Identifier "keyboard-all"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
MatchLayout "!GeForce|!Matrox"
Driver "evdev"
Option "XkbLayout" "us"
Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
It disables auto keyboard configuration for layouts "GeForce" and "Matrox".
Note that "" in patterns means "no Layout sections found", e.g.
MatchLayout "GeForce|"
is "in layout GeForce or without explicit layout at all".
Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Pointer.c: In function 'xf86parsePointerSection':
Pointer.c:192:5: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
|
|
In order to use libxf86config in a shared library, all the code must be
compiled with -fPIC. Add proper PIC support for libxf86config by turning
it into a libtool library. However, since we don't want to guarantee API
or ABI stability, make sure it's only built static.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=32436
Fix typo introduced in 2416255f7e3fd9190a9 that breaks builds when
configured --enable-install-libxf86config
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Tested-by: Simon Thum <simon.thum@gmx.de>
|
|
Requires linking xprintf.c into libxf86config for those who build it.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
|
Not used in the initial import, and also not documented.
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
|
|
This was only ever used from the glint driver, which has since lost its
DRI support.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
This was to distinguish XFree86 3.x files from XFree86 4.x files. It
never really made sense to be looking for xorg.conf-4.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Jesse Adkins <jesserayadkins@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
We assume already that our X implementation is POSIX compliant anyway. So
remove those redundant checking.
SA_SIGINFO is left there.
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
|
|
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
This was included in the original commit, and then never used.
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
AUTOREPEAT_MSG, MOVED_TO_FLAGS_MSG, and XLEDS_MSG made obsolete by
81913a12910e39d7ea6af8657c1c66cc6791cd65 Jul 21 2006 (remove undead files from master)
UNDEFINED_DEVICE_MSG made obsolete by
6033d8150be3a115b90226eaa42f237bb0cf3369 Oct 9 2007 (first pass at video driver autoloading)
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
[mattst88: fixed whitespace and a missing semicolon]
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
These are leftovers from when X still used Xmalloc and friends for allocation.
Now that those are gone, these comments are just confusing.
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
When the parser sees the "keyboard" driver, it automatically (and
silently) replaces it with the constant string "kbd".
Everybody else uses malloc'd memory for the driver name, so input
device closure assumes it can use free.
Free val.str, so this crash doesn't turn into a memory leak. Whew.
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
Often we want to apply a driver specific option to a set of devices and
don't care how the driver was selected for that device. The MatchDriver
entry can be used to match the current driver string:
MatchDriver "evdev|mouse"
Option "Emulate3Buttons" "yes"
The driver string is a case sensitive match.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Currently when there multiple InputClass entries of the same type, only
the last entry is used and the previous ones are ignored. Instead,
multiple entries are used to create multiple matching conditions.
For instance, an InputClass with
MatchProduct "foo"
MatchProduct "bar"
will require that the device's product name contain both foo and bar.
This provides a complement to the || style matching when an entry is
split using the "|" token.
The xorg.conf man page has added an example to hopefully clarify the two
types of compound matches.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Sometimes the vendor and product names aren't specific enough to target
a USB device, so expose the numeric codes in the ID. A MatchUSBID entry
has been added that supports shell pattern matching when fnmatch(3) is
available. For example:
MatchUSBID "046d:*"
The IDs are stored in lowercase hex separated by a ':' like "lsusb" or
"lspci -n".
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Serial input devices lack properties such as product or vendor name. This
makes matching InputClass sections difficult. Add a MatchPnPID entry to
test against the PnP ID of the device. The entry supports a shell pattern
match on platforms that support fnmatch(3). For example:
MatchPnPID "WACf*"
A match type for non-path pattern matching, match_pattern, has been added.
The difference between this and match_path_pattern is the FNM_PATHNAME
flag in fnmatch(3).
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This patch was generated by the following Perl code:
perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Allow InputClass sections to match against the running operating system
to narrow the application of rules. An example where this could be used
is to specify that the default input driver on Linux is evdev while it's
mouse/kbd everywhere else.
The operating system name is the same as `uname -s`, and matching is
case-insensitive.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This patch has been generated by the following Coccinelle semantic patch:
@@
expression E;
@@
-if(E) { free(E); }
+free(E);
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
|
|
xorg.conf has been used since the X11R6.7 release in April 2004.
6 years has been a generous transition period for users to
"mv XF86Config xorg.conf" and for distros to update their
configuration tools and packages.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: James Cloos <cloos@jhcloos.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
xorg.conf has been used since the X11R6.7 release in April 2004.
6 years has been a generous transition period for users to
"mv XF86Config xorg.conf" and for distros to update their
configuration tools and packages.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: James Cloos <cloos@jhcloos.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Seems to be harmless. Meh.
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
|
...because Error is a macro that returns NULL.
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
|
We could just use $projectroot/etc and $projectroot/share, but the user
might have other plans for them.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
commit c6e8637e29e0ca11dfb35c02da7ca6002ac8c597 introduced this
regression; it can cause existing config files to be parsed incorrectly.
Acked-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Tags may be a list of comma-separated strings that match against a MatchTag
InputClass section. If any of the tags specified for a device match against
the MatchTag of the section, this match is evaluated true and passed on to
the next match condition.
Tags are specified as "input.tags" (hal) or "ID_INPUT.tags" (udev), the
value of the tags is case-sensitive and require an exact match (not a
substring match).
i.e. "quirk" will not match "QUIRK", "need_quirk" or "quirk_needed".
Example configuration:
udev:
ENV{ID_INPUT.tags}="foo,bar"
hal:
<merge key="input.tags" type="string">foo,bar</merge>
xorg.conf:
Section "InputClass"
Identifier "foobar quirks"
MatchTag "foo|foobar"
Option "Foobar" "on"
EndSection
Where the xorg.conf section matches against any device with the tag "foo"
or tag "foobar" set.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
|
Move tokenize out of the parser, make it a dix util function instead.
Splitting a string into multiple substrings is useful by other places, so
let's use it across the line. Future users include config/hal, config/udev
and of course the parser.
Example usage:
char **substrings = xstrtokenize(my_string, "\n");
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
|
In order to keep the number of InputClass sections manageable, allow
matches to contain multiple arguments. The arguments will be separated
by the '|' character. This allows a policy to apply to multiple types of
devices. For example:
Section "InputClass"
Identifier "Inverted Mice"
MatchProduct "Crazy Mouse|Silly Mouse"
Option "InvertX" "yes"
EndSection
This applies to the MatchProduct, MatchVendor and MatchDevicePath
entries. Currently there is no way to escape characters, so names or
patterns cannot contain '|'.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The config parser expects to find a newline at the end of each line, so
files ending without one would confuse it. A newline is inserted at the
end of the buffer in these situations. Additionally, switching to the
next config file is moved to the higher level to allow parsing of the
last line of the previous file to complete before shifting the index and
resetting the line number.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Stephan Raue<stephan.raue@gmx.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|