config: remove trailing whitespaces.
It makes my vim look ugly. Put "let c_space_errors=1" into your .vimrc.
This commit is contained in:
parent
1a314a1ef0
commit
1f54c05cf8
52
config/hal.c
52
config/hal.c
|
@ -119,7 +119,7 @@ get_prop_string(LibHalContext *hal_ctx, const char *udi, const char *name)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this function is no longer used... keep it here in case its needed in
|
/* this function is no longer used... keep it here in case its needed in
|
||||||
* the future. */
|
* the future. */
|
||||||
#if 0
|
#if 0
|
||||||
static char *
|
static char *
|
||||||
|
@ -155,7 +155,7 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
device_added(LibHalContext *hal_ctx, const char *udi)
|
device_added(LibHalContext *hal_ctx, const char *udi)
|
||||||
|
@ -164,12 +164,12 @@ device_added(LibHalContext *hal_ctx, const char *udi)
|
||||||
InputOption *options = NULL, *tmpo = NULL;
|
InputOption *options = NULL, *tmpo = NULL;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
DBusError error;
|
DBusError error;
|
||||||
|
|
||||||
LibHalPropertySet *set = NULL;
|
LibHalPropertySet *set = NULL;
|
||||||
LibHalPropertySetIterator set_iter;
|
LibHalPropertySetIterator set_iter;
|
||||||
char *psi_key = NULL, *tmp_val, *tmp_key;
|
char *psi_key = NULL, *tmp_val, *tmp_key;
|
||||||
|
|
||||||
|
|
||||||
dbus_error_init(&error);
|
dbus_error_init(&error);
|
||||||
|
|
||||||
driver = get_prop_string(hal_ctx, udi, "input.x11_driver");
|
driver = get_prop_string(hal_ctx, udi, "input.x11_driver");
|
||||||
|
@ -178,13 +178,13 @@ device_added(LibHalContext *hal_ctx, const char *udi)
|
||||||
LogMessageVerb(X_INFO,7,"config/hal: no driver specified for device %s\n", udi);
|
LogMessageVerb(X_INFO,7,"config/hal: no driver specified for device %s\n", udi);
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = get_prop_string(hal_ctx, udi, "input.device");
|
path = get_prop_string(hal_ctx, udi, "input.device");
|
||||||
if (!path) {
|
if (!path) {
|
||||||
LogMessage(X_WARNING,"config/hal: no driver or path specified for %s\n", udi);
|
LogMessage(X_WARNING,"config/hal: no driver or path specified for %s\n", udi);
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
||||||
name = get_prop_string(hal_ctx, udi, "info.product");
|
name = get_prop_string(hal_ctx, udi, "info.product");
|
||||||
if (!name)
|
if (!name)
|
||||||
name = xstrdup("(unnamed)");
|
name = xstrdup("(unnamed)");
|
||||||
|
@ -194,7 +194,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
|
||||||
LogMessage(X_ERROR, "config/hal: couldn't allocate space for input options!\n");
|
LogMessage(X_ERROR, "config/hal: couldn't allocate space for input options!\n");
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
||||||
options->key = xstrdup("_source");
|
options->key = xstrdup("_source");
|
||||||
options->value = xstrdup("server/hal");
|
options->value = xstrdup("server/hal");
|
||||||
if (!options->key || !options->value) {
|
if (!options->key || !options->value) {
|
||||||
|
@ -202,14 +202,14 @@ device_added(LibHalContext *hal_ctx, const char *udi)
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* most drivers use device.. not path. evdev uses both however, but the
|
/* most drivers use device.. not path. evdev uses both however, but the
|
||||||
* path version isn't documented apparently. support both for now. */
|
* path version isn't documented apparently. support both for now. */
|
||||||
add_option(&options, "path", path);
|
add_option(&options, "path", path);
|
||||||
add_option(&options, "device", path);
|
add_option(&options, "device", path);
|
||||||
|
|
||||||
add_option(&options, "driver", driver);
|
add_option(&options, "driver", driver);
|
||||||
add_option(&options, "name", name);
|
add_option(&options, "name", name);
|
||||||
|
|
||||||
config_info = xalloc(strlen(udi) + 5); /* "hal:" and NULL */
|
config_info = xalloc(strlen(udi) + 5); /* "hal:" and NULL */
|
||||||
if (!config_info) {
|
if (!config_info) {
|
||||||
LogMessage(X_ERROR, "config/hal: couldn't allocate name\n");
|
LogMessage(X_ERROR, "config/hal: couldn't allocate name\n");
|
||||||
|
@ -220,58 +220,58 @@ device_added(LibHalContext *hal_ctx, const char *udi)
|
||||||
/* ok, grab options from hal.. iterate through all properties
|
/* ok, grab options from hal.. iterate through all properties
|
||||||
* and lets see if any of them are options that we can add */
|
* and lets see if any of them are options that we can add */
|
||||||
set = libhal_device_get_all_properties(hal_ctx, udi, &error);
|
set = libhal_device_get_all_properties(hal_ctx, udi, &error);
|
||||||
|
|
||||||
if (!set) {
|
if (!set) {
|
||||||
LogMessage(X_ERROR, "config/hal: couldn't get property list for %s: %s (%s)\n",
|
LogMessage(X_ERROR, "config/hal: couldn't get property list for %s: %s (%s)\n",
|
||||||
udi, error.name, error.message);
|
udi, error.name, error.message);
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
||||||
libhal_psi_init(&set_iter,set);
|
libhal_psi_init(&set_iter,set);
|
||||||
while (libhal_psi_has_more(&set_iter)) {
|
while (libhal_psi_has_more(&set_iter)) {
|
||||||
/* we are looking for supported keys.. extract and add to options */
|
/* we are looking for supported keys.. extract and add to options */
|
||||||
psi_key = libhal_psi_get_key(&set_iter);
|
psi_key = libhal_psi_get_key(&set_iter);
|
||||||
|
|
||||||
if (psi_key){
|
if (psi_key){
|
||||||
|
|
||||||
/* normal options first (input.x11_options.<propname>) */
|
/* normal options first (input.x11_options.<propname>) */
|
||||||
if (!strncasecmp(psi_key, LIBHAL_PROP_KEY, sizeof(LIBHAL_PROP_KEY)-1)){
|
if (!strncasecmp(psi_key, LIBHAL_PROP_KEY, sizeof(LIBHAL_PROP_KEY)-1)){
|
||||||
|
|
||||||
/* only support strings for all values */
|
/* only support strings for all values */
|
||||||
tmp_val = get_prop_string(hal_ctx, udi, psi_key);
|
tmp_val = get_prop_string(hal_ctx, udi, psi_key);
|
||||||
|
|
||||||
if (tmp_val){
|
if (tmp_val){
|
||||||
add_option(&options, psi_key + sizeof(LIBHAL_PROP_KEY)-1, tmp_val);
|
add_option(&options, psi_key + sizeof(LIBHAL_PROP_KEY)-1, tmp_val);
|
||||||
xfree(tmp_val);
|
xfree(tmp_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* evdev's XKB options... we should probably depreciate this usage */
|
/* evdev's XKB options... we should probably depreciate this usage */
|
||||||
} else if (!strncasecmp(psi_key, LIBHAL_XKB_PROP_KEY, sizeof(LIBHAL_XKB_PROP_KEY)-1)){
|
} else if (!strncasecmp(psi_key, LIBHAL_XKB_PROP_KEY, sizeof(LIBHAL_XKB_PROP_KEY)-1)){
|
||||||
|
|
||||||
/* only support strings for all values */
|
/* only support strings for all values */
|
||||||
tmp_val = get_prop_string(hal_ctx, udi, psi_key);
|
tmp_val = get_prop_string(hal_ctx, udi, psi_key);
|
||||||
|
|
||||||
if (tmp_val){
|
if (tmp_val){
|
||||||
/* add "xkb_" + NULL */
|
/* add "xkb_" + NULL */
|
||||||
tmp_key = xalloc(strlen(psi_key) - ( sizeof(LIBHAL_XKB_PROP_KEY) - 1) + 5);
|
tmp_key = xalloc(strlen(psi_key) - ( sizeof(LIBHAL_XKB_PROP_KEY) - 1) + 5);
|
||||||
|
|
||||||
if (!tmp_key){
|
if (!tmp_key){
|
||||||
LogMessage(X_ERROR, "config/hal: couldn't allocate memory for option %s\n", psi_key);
|
LogMessage(X_ERROR, "config/hal: couldn't allocate memory for option %s\n", psi_key);
|
||||||
} else {
|
} else {
|
||||||
sprintf(tmp_key, "xkb_%s", psi_key + sizeof(LIBHAL_XKB_PROP_KEY)-1);
|
sprintf(tmp_key, "xkb_%s", psi_key + sizeof(LIBHAL_XKB_PROP_KEY)-1);
|
||||||
add_option(&options, tmp_key, tmp_val);
|
add_option(&options, tmp_key, tmp_val);
|
||||||
|
|
||||||
xfree(tmp_key);
|
xfree(tmp_key);
|
||||||
}
|
}
|
||||||
xfree(tmp_val);
|
xfree(tmp_val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* psi_key doesn't need to be freed */
|
/* psi_key doesn't need to be freed */
|
||||||
libhal_psi_next(&set_iter);
|
libhal_psi_next(&set_iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this isn't an error, but how else do you output something that the user can see? */
|
/* this isn't an error, but how else do you output something that the user can see? */
|
||||||
LogMessage(X_INFO, "config/hal: Adding input device %s\n", name);
|
LogMessage(X_INFO, "config/hal: Adding input device %s\n", name);
|
||||||
if (NewInputDeviceRequest(options, &dev) != Success) {
|
if (NewInputDeviceRequest(options, &dev) != Success) {
|
||||||
|
@ -413,7 +413,7 @@ config_hal_init(void)
|
||||||
|
|
||||||
/* verbose message */
|
/* verbose message */
|
||||||
LogMessageVerb(X_INFO,7,"config/hal: initialized");
|
LogMessageVerb(X_INFO,7,"config/hal: initialized");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user