Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
|
|
Currently Xorg uses hal's fdi files to decide what configuration options
are applied to automatically added input devices. This is sub-optimal
since it requires users to use a new and different configuration store
than xorg.conf.
The InputClass section attempts to provide a system similar to hal where
configuration can be applied to all devices with certain attributes. For
now, devices can be matched to:
* A substring of the product name via a MatchProduct entry
* A substring of the vendir name via a MatchVendor entry
* A pathname pattern of the device file via a MatchDevicePath entry
* A device type via boolean entries for MatchIsKeyboard, MatchIsPointer,
MatchIsJoystick, MatchIsTablet, MatchIsTouchpad and MatchIsTouchscreen
See the INPUTCLASS section in xorg.conf(5) for more details.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Refactored code into the parser to allow the freeform boolean types used
in Option entries to be used in other configuration entries. This isn't
as powerful as allowing "No" to precede the option names, but it atleast
gives a common handling of "yes", "no", etc.
A type xf86TriState has been added to support an optional boolean. This
allows the boolean sense of the value to be kept while providing a means
to signal that it is unset.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
|
|
Any input device with this option will be automatically added to whichever
server layout is selected at startup. This removes the need to reference a
device from the ServerLayout section. The two following configuration are
identical:
CONFIG 1:
Section "ServerLayout"
InputDevice "foo"
EndSection
Section "InputDevice"
Identifier "foo"
...
EndSection
CONFIG 2:
Section "InputDevice"
Identifier "foo"
Option "AutoServerLayout" "on"
...
EndSection
The selection of the server layout affects both explicitly specified
layouts and the implicit layout.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp at keithp.com>
|
|
Add a new command line parameter, -configdir, to specify the config
directory to be used. Rules are the same as -config for root vs. user
privileges.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
|
|
Currently there is a single file, xorg.conf, for configuring the server.
This works fine most of the time, but it becomes a problem when packages
or system services need to adjust the configuration. Instead, allow
multiple configuration files to live in a directory. Typically this will
be /etc/X11/xorg.conf.d.
Files with a suffix of .conf will be read and added to the server
configuration after xorg.conf. The server won't fall back to using the
auto configuration unless there is no config file and there are no files
in the config directory.
Right now this uses a simpler search template than the config file
search path by not using the command line or environment variable
parameters. The matching code was refactored a bit to make this more
coherent. Any DDX wanting to read the config files will need to call
xf86initConfigFiles before opening/reading them. This is to allow
xf86openConfigFile without xf86openConfigDirFiles and vice-versa.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
|
|
These functions should not be used outside of DDXs, so no need to put
them in the ABI.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
|
|
2003 called, they want their ifdefs back.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
GCC warns about casting a double return value to int.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|