Galago - desktop presence framework

galago-value.h File Reference

Value wrapper API. More...

#include <libgalago/galago-types.h>
#include <libgalago/galago-list.h>
#include <libgalago/galago-object.h>

Go to the source code of this file.


Typedefs

typedef _GalagoValue GalagoValue

Enumerations

enum  GalagoType {
  GALAGO_TYPE_UNKNOWN = 0, GALAGO_TYPE_CHAR, GALAGO_TYPE_UCHAR, GALAGO_TYPE_BOOLEAN,
  GALAGO_TYPE_SHORT, GALAGO_TYPE_USHORT, GALAGO_TYPE_INT, GALAGO_TYPE_UINT,
  GALAGO_TYPE_LONG, GALAGO_TYPE_ULONG, GALAGO_TYPE_STRING, GALAGO_TYPE_OBJECT,
  GALAGO_TYPE_POINTER, GALAGO_TYPE_LIST, GALAGO_TYPE_ARRAY
}
 Specific value types. More...

Functions

GalagoValue * galago_value_new (GalagoType type, const void *data, void *detail)
 Creates a new GalagoValue.
GalagoValue * galago_value_new_list (GalagoType type, const GalagoList *list, void *detail)
 Creates a new, special GalagoValue that takes only a list of values of the specified type.
GalagoValue * galago_value_new_array (GalagoType type, const void *array, size_t size, void *detail)
 Creates a new, special GalagoValue that takes only an array of values of the specified type.
void galago_value_destroy (GalagoValue *value)
 Destroys a GalagoValue.
GalagoType galago_value_get_type (const GalagoValue *value)
 Returns a value's type.
GalagoType galago_value_get_subtype (const GalagoValue *value)
 Returns a value's subtype.
GalagoObjectClassgalago_value_get_object_class (const GalagoValue *value)
 Returns the object's class type, if the value's type is GALAGO_TYPE_OBJECT.
void galago_value_set_char (GalagoValue *value, char data)
 Sets the value's character data.
void galago_value_set_uchar (GalagoValue *value, unsigned char data)
 Sets the value's unsigned character data.
void galago_value_set_boolean (GalagoValue *value, galago_bool data)
 Sets the value's boolean data.
void galago_value_set_short (GalagoValue *value, short data)
 Sets the value's short integer data.
void galago_value_set_ushort (GalagoValue *value, unsigned short data)
 Sets the value's unsigned short integer data.
void galago_value_set_int (GalagoValue *value, int data)
 Sets the value's integer data.
void galago_value_set_uint (GalagoValue *value, unsigned int data)
 Sets the value's unsigned integer data.
void galago_value_set_long (GalagoValue *value, long data)
 Sets the value's long integer data.
void galago_value_set_ulong (GalagoValue *value, unsigned long data)
 Sets the value's unsigned long integer data.
void galago_value_set_string (GalagoValue *value, const char *data)
 Sets the value's string data.
void galago_value_set_object (GalagoValue *value, void *data)
 Sets the value's object data.
void galago_value_set_pointer (GalagoValue *value, void *data)
 Sets the value's pointer data.
void galago_value_set_list (GalagoValue *value, const GalagoList *data)
 Sets the value's list of values.
void galago_value_set_array (GalagoValue *value, const void *data, size_t size)
 Sets the value's array of values.
char galago_value_get_char (const GalagoValue *value)
 Returns the value's character data.
unsigned char galago_value_get_uchar (const GalagoValue *value)
 Returns the value's unsigned character data.
galago_bool galago_value_get_boolean (const GalagoValue *value)
 Returns the value's boolean data.
short galago_value_get_short (const GalagoValue *value)
 Returns the value's short integer data.
unsigned short galago_value_get_ushort (const GalagoValue *value)
 Returns the value's unsigned short integer data.
int galago_value_get_int (const GalagoValue *value)
 Returns the value's integer data.
unsigned int galago_value_get_uint (const GalagoValue *value)
 Returns the value's unsigned integer data.
long galago_value_get_long (const GalagoValue *value)
 Returns the value's long integer data.
unsigned long galago_value_get_ulong (const GalagoValue *value)
 Returns the value's unsigned long integer data.
const char * galago_value_get_string (const GalagoValue *value)
 Returns the value's string data.
void * galago_value_get_object (const GalagoValue *value)
 Returns the value's object data.
void * galago_value_get_pointer (const GalagoValue *value)
 Returns the value's pointer data.
const GalagoListgalago_value_get_list (const GalagoValue *value)
 Returns the value's list of values.
void galago_value_get_array (const GalagoValue *value, const void **ret_array, size_t *ret_size)
 Returns the value's array of values.

Detailed Description

Value wrapper API.

Copyright:
(C) 2004-2005 Christian Hammond
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file galago-value.h.


Enumeration Type Documentation

enum GalagoType
 

Specific value types.

Enumeration values:
GALAGO_TYPE_UNKNOWN  Unknown type.
GALAGO_TYPE_CHAR  Character.
GALAGO_TYPE_UCHAR  Unsigned character.
GALAGO_TYPE_BOOLEAN  Boolean.
GALAGO_TYPE_SHORT  Short integer.
GALAGO_TYPE_USHORT  Unsigned short integer.
GALAGO_TYPE_INT  Integer.
GALAGO_TYPE_UINT  Unsigned integer.
GALAGO_TYPE_LONG  Long integer.
GALAGO_TYPE_ULONG  Unsigned long integer.
GALAGO_TYPE_STRING  String.
GALAGO_TYPE_OBJECT  Object pointer.
GALAGO_TYPE_POINTER  Generic pointer.
GALAGO_TYPE_LIST  A list of values.
GALAGO_TYPE_ARRAY  An array of values.

Definition at line 33 of file galago-value.h.


Function Documentation

void galago_value_destroy GalagoValue *  value  ) 
 

Destroys a GalagoValue.

Parameters:
value The value to destroy.

void galago_value_get_array const GalagoValue *  value,
const void **  ret_array,
size_t *  ret_size
 

Returns the value's array of values.

Parameters:
value The value.
ret_array The returned array.
ret_size The returned size of the array.

galago_bool galago_value_get_boolean const GalagoValue *  value  ) 
 

Returns the value's boolean data.

Parameters:
value The value.
Returns:
The boolean data.

char galago_value_get_char const GalagoValue *  value  ) 
 

Returns the value's character data.

Parameters:
value The value.
Returns:
The character data.

int galago_value_get_int const GalagoValue *  value  ) 
 

Returns the value's integer data.

Parameters:
value The value.
Returns:
The integer data.

const GalagoList* galago_value_get_list const GalagoValue *  value  ) 
 

Returns the value's list of values.

Parameters:
value The value.
Returns:
The list of values.

long galago_value_get_long const GalagoValue *  value  ) 
 

Returns the value's long integer data.

Parameters:
value The value.
Returns:
The long integer data.

void* galago_value_get_object const GalagoValue *  value  ) 
 

Returns the value's object data.

Parameters:
value The value.
Returns:
The object data.

GalagoObjectClass* galago_value_get_object_class const GalagoValue *  value  ) 
 

Returns the object's class type, if the value's type is GALAGO_TYPE_OBJECT.

Parameters:
value The value.
Returns:
The object's class type, or NULL.

void* galago_value_get_pointer const GalagoValue *  value  ) 
 

Returns the value's pointer data.

Parameters:
value The value.
Returns:
The pointer data.

short galago_value_get_short const GalagoValue *  value  ) 
 

Returns the value's short integer data.

Parameters:
value The value.
Returns:
The short integer data.

const char* galago_value_get_string const GalagoValue *  value  ) 
 

Returns the value's string data.

Parameters:
value The value.
Returns:
The string data.

GalagoType galago_value_get_subtype const GalagoValue *  value  ) 
 

Returns a value's subtype.

This is only usable for lists and arrays.

Returns:
The value's list type.

GalagoType galago_value_get_type const GalagoValue *  value  ) 
 

Returns a value's type.

Returns:
The value's type.

unsigned char galago_value_get_uchar const GalagoValue *  value  ) 
 

Returns the value's unsigned character data.

Parameters:
value The value.
Returns:
The unsigned character data.

unsigned int galago_value_get_uint const GalagoValue *  value  ) 
 

Returns the value's unsigned integer data.

Parameters:
value The value.
Returns:
The unsigned integer data.

unsigned long galago_value_get_ulong const GalagoValue *  value  ) 
 

Returns the value's unsigned long integer data.

Parameters:
value The value.
Returns:
The unsigned long integer data.

unsigned short galago_value_get_ushort const GalagoValue *  value  ) 
 

Returns the value's unsigned short integer data.

Parameters:
value The value.
Returns:
The unsigned short integer data.

GalagoValue* galago_value_new GalagoType  type,
const void *  data,
void *  detail
 

Creates a new GalagoValue.

If type is GALAGO_TYPE_OBJECT, detail must be the class type.

Parameters:
type The type.
detail Extra detail, type-specific.
Returns:
The new value.

GalagoValue* galago_value_new_array GalagoType  type,
const void *  array,
size_t  size,
void *  detail
 

Creates a new, special GalagoValue that takes only an array of values of the specified type.

If type is GALAGO_TYPE_OBJECT, detail must be the class type.

Parameters:
type The type of list values.
array The optional default array of values.
size The size of the array.
detail Extra detail, type-specific.
Returns:
The new value.

GalagoValue* galago_value_new_list GalagoType  type,
const GalagoList list,
void *  detail
 

Creates a new, special GalagoValue that takes only a list of values of the specified type.

If type is GALAGO_TYPE_OBJECT, detail must be the class type.

Parameters:
type The type of list values.
list The optional default list of values.
detail Extra detail, type-specific.
Returns:
The new value.

void galago_value_set_array GalagoValue *  value,
const void *  data,
size_t  size
 

Sets the value's array of values.

Parameters:
value The value.
data The array of values.
size The size of the array.

void galago_value_set_boolean GalagoValue *  value,
galago_bool  data
 

Sets the value's boolean data.

Parameters:
value The value.
data The boolean data.

void galago_value_set_char GalagoValue *  value,
char  data
 

Sets the value's character data.

Parameters:
value The value.
data The character data.

void galago_value_set_int GalagoValue *  value,
int  data
 

Sets the value's integer data.

Parameters:
value The value.
data The integer data.

void galago_value_set_list GalagoValue *  value,
const GalagoList data
 

Sets the value's list of values.

Parameters:
value The value.
data The list of values.

void galago_value_set_long GalagoValue *  value,
long  data
 

Sets the value's long integer data.

Parameters:
value The value.
data The long integer data.

void galago_value_set_object GalagoValue *  value,
void *  data
 

Sets the value's object data.

Parameters:
value The value.
data The object data.

void galago_value_set_pointer GalagoValue *  value,
void *  data
 

Sets the value's pointer data.

Parameters:
value The value.
data The pointer data.

void galago_value_set_short GalagoValue *  value,
short  data
 

Sets the value's short integer data.

Parameters:
value The value.
data The short integer data.

void galago_value_set_string GalagoValue *  value,
const char *  data
 

Sets the value's string data.

Parameters:
value The value.
data The string data.

void galago_value_set_uchar GalagoValue *  value,
unsigned char  data
 

Sets the value's unsigned character data.

Parameters:
value The value.
data The unsigned character data.

void galago_value_set_uint GalagoValue *  value,
unsigned int  data
 

Sets the value's unsigned integer data.

Parameters:
value The value.
data The unsigned integer data.

void galago_value_set_ulong GalagoValue *  value,
unsigned long  data
 

Sets the value's unsigned long integer data.

Parameters:
value The value.
data The unsigned long integer data.

void galago_value_set_ushort GalagoValue *  value,
unsigned short  data
 

Sets the value's unsigned short integer data.

Parameters:
value The value.
data The unsigned short integer data.