/***************************************************************************
*
* probe-xkb.c : Probe for keyboard device information
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Licensed under the Academic Free License version 2.1
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <priv.h>
#include <libhal.h>
#include <logger.h>
static int global_linenumber = 0;
static void
{
/*
* Start with the 'basic' privilege set and then remove any
* of the 'basic' privileges that will not be needed.
*/
HAL_INFO(("Error in setting the priv"));
return;
}
/* Clear privileges we will not need from the 'basic' set */
/* Set the permitted privilege set. */
return;
}
/* Clear the limit set. */
return;
}
return;
}
}
static int
{
goto out;
}
/*
* For usb keyboard devices, we need to first push "usbkbm" module upon
* the stream.
*/
}
}
HAL_DEBUG(("get keyboard type failed %s: %s",
goto out;
}
HAL_DEBUG(("get keyboard layout failed %s: %s",
goto out;
}
ret = 0;
}
return (ret);
}
/* Skips over the white space character in the string. */
static char *
{
ptr++;
}
/* This should not occur. but .. */
if (*ptr == '\n') {
ptr = '\0';
}
return (ptr);
}
static char *
{
char *ptr;
char *tmp;
int index;
int c;
while (1) {
if (!ptr) {
return (NULL);
}
/* Comment line */
if (ptr[0] == COMMENTCHAR) {
continue;
}
/* Blank line */
if (ptr[0] == '\n') {
continue;
}
*tmp = '\0';
}
/* get rid of '\n' */
}
if (*ptr) {
break;
}
}
return (ptr);
}
static int
char **xkb_model, char **xkb_layout)
{
return (ret);
}
global_linenumber = 0;
found_error = 1;
}
found_error = 1;
}
found_error = 1;
}
/* These two are optional entries */
} else {
}
}
if (found_error) {
found_error = 0;
continue;
}
if (*type == '*') {
}
if (*layout == '*') {
found_keytable = 1;
break;
}
}
}
if (!found_keytable) {
}
*xkb_keymap = keymap;
}
}
*xkb_layout = xkblay;
}
return (0);
}
int
{
char *udi;
char *device_file;
goto out;
}
goto out;
}
setup_logger();
goto out;
}
HAL_DEBUG(("Cannot allocate changeset"));
goto out;
}
goto out;
}
/*
* For some usb keyboard that is not self-identifying, get keyboard's
*/
&kbd_type, &kbd_layout)) {
goto out;
}
}
goto out;
}
/*
* If doesn't find matching entry in xkbtable.map, using default
* values setting in 10-x11-input.fdi
*/
"input.x11_options.XkbModel", xkbmodel);
"input.x11_options.XkbLayout", xkblayout);
}
ret = 0;
out:
}
if (dbus_error_is_set(&error)) {
}
}
return (ret);
}