/***************************************************************************
* CVSID: $Id$
*
* device_store.c : HalDeviceStore methods
*
* Copyright (C) 2003 David Zeuthen, <david@fubar.dk>
* Copyright (C) 2004 Novell, Inc.
*
* Licensed under the Academic Free License version 2.1
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <string.h>
#include "device_store.h"
#include "hald_marshal.h"
#include "logger.h"
enum {
};
static void
{
if (parent_class->finalize)
}
static void
{
g_signal_new ("store_changed",
G_TYPE_NONE, 2,
g_signal_new ("device_property_changed",
G_TYPE_NONE, 4,
g_signal_new ("device_capability_added",
G_TYPE_NONE, 2,
}
static void
{
}
hal_device_store_get_type (void)
{
if (!type) {
sizeof (HalDeviceStoreClass),
sizeof (HalDeviceStore),
0,
};
"HalDeviceStore",
0);
}
return type;
}
hal_device_store_new (void)
{
return store;
}
static void
const char *key,
{
}
static void
const char *capability,
{
device, capability);
}
void
{
HAL_ERROR(("Can't add HalDevice with incorrect UDI. Valid "
"UDI must start with '/org/freedesktop/Hal/devices/'"));
goto out;
}
g_object_ref (device));
out:
;
}
{
return FALSE;
store);
store);
return TRUE;
}
{
return d;
}
return NULL;
}
void
{
return;
}
}
static gboolean
{
return TRUE;
}
void
{
NULL);
}
const char *key,
const char *value)
{
int type;
if (!hal_device_has_property (d, key))
continue;
if (type != HAL_PROPERTY_TYPE_STRING)
continue;
value) == 0)
return d;
}
return NULL;
}
const char *key,
int value)
{
int type;
if (!hal_device_has_property (d, key))
continue;
if (type != HAL_PROPERTY_TYPE_INT32)
continue;
return d;
}
return NULL;
}
GSList *
const char *key,
const char *value)
{
int type;
if (!hal_device_has_property (d, key))
continue;
if (type != HAL_PROPERTY_TYPE_STRING)
continue;
value) == 0)
}
return matches;
}
typedef struct {
char *key;
char *value;
static void
{
}
static void
{
/* Only want to do it for added or changed properties */
if (removed)
return;
/* Keys have to match */
return;
/* Values have to match */
return;
}
static void
{
if (!added)
return;
return;
return;
}
static gboolean
{
return FALSE;
}
void
const char *key,
const char *value,
int timeout)
{
/* First check to see if it's already there */
return;
}
"device_property_changed",
info);
"store_changed",
info);
info);
}