/***************************************************************************
* CVSID: $Id$
*
* property.c : HalProperty 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 <string.h>
#include <glib.h>
#include "logger.h"
#include "property.h"
struct _HalProperty {
char *key;
int type;
union {
char *str_value;
double double_value;
} v;
};
void
{
GSList *i;
}
}
}
{
char *endchar;
(const char **) &endchar)) {
*endchar = '?';
}
if (!validated) {
HAL_WARNING (("Key '%s' has invalid UTF-8 string '%s'",
}
return prop;
}
{
return prop;
}
{
return prop;
}
{
return prop;
}
{
return prop;
}
const char *
{
}
int
{
}
const char *
{
}
{
}
{
return prop->v.uint64_value;
}
{
return prop->v.bool_value;
}
char *
{
case HAL_PROPERTY_TYPE_STRING:
case HAL_PROPERTY_TYPE_INT32:
case HAL_PROPERTY_TYPE_UINT64:
/* FIXME: Maybe use 1 and 0 here instead? */
case HAL_PROPERTY_TYPE_DOUBLE:
{
guint i;
i = 0;
buf[0] = '\0';
const char *str;
i += len;
buf[i] = '\t';
i++;
}
}
}
default:
return NULL;
}
}
double
{
return prop->v.double_value;
}
void
{
char *endchar;
(const char **) &endchar)) {
*endchar = '?';
}
if (!validated) {
HAL_WARNING (("Key '%s' has invalid UTF-8 string '%s'",
}
}
void
{
}
void
{
}
void
{
}
void
{
}
void
enum PropertyAttribute attr,
{
switch (attr) {
case READONLY:
break;
case PERSISTENCE:
break;
case CALLOUT:
break;
}
}
enum PropertyAttribute attr)
{
switch (attr) {
case READONLY:
case PERSISTENCE:
return prop->persistence;
case CALLOUT:
default:
return -1;
}
}
{
return prop;
}
GSList *
{
return prop->v.strlist_value;
}
{
return TRUE;
}
{
return TRUE;
}
{
return FALSE;
return FALSE;
return TRUE;
}
{
return FALSE;
}
}
}
{
guint i;
return hal_property_strlist_remove_elem (prop, i);
}
}
return FALSE;
}
{
}
return FALSE;
}