![]() |
![]() |
![]() |
libgalago Reference Manual | ![]() |
---|---|---|---|---|
GalagoValue; enum GalagoType; GalagoValue* galago_value_new (GalagoType type, const void *data, void *detail); GalagoValue* galago_value_new_object (GType type, const GObject *obj); GalagoValue* galago_value_new_list (GalagoType type, GList *list, void *detail); GalagoValue* galago_value_new_array (GalagoType type, const void *array, gsize size, void *detail); void galago_value_destroy (GalagoValue *value); GalagoType galago_value_get_type (const GalagoValue *value); GalagoType galago_value_get_subtype (const GalagoValue *value); GType galago_value_get_gtype (const GalagoValue *value); void galago_value_set_char (GalagoValue *value, char data); void galago_value_set_uchar (GalagoValue *value, unsigned char data); void galago_value_set_boolean (GalagoValue *value, gboolean data); void galago_value_set_short (GalagoValue *value, short data); void galago_value_set_ushort (GalagoValue *value, unsigned short data); void galago_value_set_int (GalagoValue *value, int data); void galago_value_set_uint (GalagoValue *value, unsigned int data); void galago_value_set_long (GalagoValue *value, long data); void galago_value_set_ulong (GalagoValue *value, unsigned long data); void galago_value_set_string (GalagoValue *value, const char *data); void galago_value_set_object (GalagoValue *value, void *data); void galago_value_set_pointer (GalagoValue *value, void *data); void galago_value_set_list (GalagoValue *value, GList *data); void galago_value_set_array (GalagoValue *value, const void *data, gsize size); char galago_value_get_char (const GalagoValue *value); unsigned char galago_value_get_uchar (const GalagoValue *value); gboolean galago_value_get_boolean (const GalagoValue *value); short galago_value_get_short (const GalagoValue *value); unsigned short galago_value_get_ushort (const GalagoValue *value); int galago_value_get_int (const GalagoValue *value); unsigned int galago_value_get_uint (const GalagoValue *value); long galago_value_get_long (const GalagoValue *value); unsigned long galago_value_get_ulong (const GalagoValue *value); const char* galago_value_get_string (const GalagoValue *value); void* galago_value_get_object (const GalagoValue *value); void* galago_value_get_pointer (const GalagoValue *value); GList* galago_value_get_list (const GalagoValue *value); void galago_value_get_array (const GalagoValue *value, const void **ret_array, gsize *ret_size);
This is a generic data type container, similar in ways to GValue. It was originally written before libgalago was glib-based. It will go away in time, to be replaced with GValue. Currently, this is used only in the D-BUS utility functions.
typedef enum { GALAGO_VALUE_TYPE_UNKNOWN = 0, /* Unknown type. */ GALAGO_VALUE_TYPE_CHAR, /* Character. */ GALAGO_VALUE_TYPE_UCHAR, /* Unsigned character. */ GALAGO_VALUE_TYPE_BOOLEAN, /* Boolean. */ GALAGO_VALUE_TYPE_SHORT, /* Short integer. */ GALAGO_VALUE_TYPE_USHORT, /* Unsigned short integer. */ GALAGO_VALUE_TYPE_INT, /* Integer. */ GALAGO_VALUE_TYPE_UINT, /* Unsigned integer. */ GALAGO_VALUE_TYPE_LONG, /* Long integer. */ GALAGO_VALUE_TYPE_ULONG, /* Unsigned long integer. */ GALAGO_VALUE_TYPE_STRING, /* String. */ GALAGO_VALUE_TYPE_OBJECT, /* Object pointer. */ GALAGO_VALUE_TYPE_POINTER, /* Generic pointer. */ GALAGO_VALUE_TYPE_LIST, /* A list of values. */ GALAGO_VALUE_TYPE_ARRAY /* An array of values. */ } GalagoType;
GalagoValue* galago_value_new (GalagoType type, const void *data, void *detail);
Creates a new GalagoValue.
type : |
The type. |
data : |
The optional data to set. |
detail : |
Extra detail, type-specific. Currently unused. |
Returns : | The new value. |
GalagoValue* galago_value_new_object (GType type, const GObject *obj);
Creates a new, special GalagoValue that takes an object type and an optional object.
type : |
The GType. |
obj : |
The object. |
Returns : | The new value. |
GalagoValue* galago_value_new_list (GalagoType type, GList *list, void *detail);
Creates a new, special GalagoValue that takes only a list of values of the specified type.
If type
is GALAGO_VALUE_TYPE_OBJECT
, detail
must be the class type.
type : |
The type of list values. |
list : |
The optional default list of values. |
detail : |
Extra detail, type-specific. |
Returns : | The new value. |
GalagoValue* galago_value_new_array (GalagoType type, const void *array, gsize size, void *detail);
Creates a new, special GalagoValue that takes only an array of values of the specified type.
If type
is GALAGO_VALUE_TYPE_OBJECT
, detail
must be the class type.
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. |
void galago_value_destroy (GalagoValue *value);
Destroys a GalagoValue.
value : |
The GalagoValue. |
GalagoType galago_value_get_type (const GalagoValue *value);
Returns a GalagoValue's type.
value : |
The GalagoValue. |
Returns : | The GalagoValue's type. |
GalagoType galago_value_get_subtype (const GalagoValue *value);
Returns a value's subtype. This is only usable for lists and arrays.
value : |
The GalagoValue. |
Returns : | The value's list type. |
GType galago_value_get_gtype (const GalagoValue *value);
Returns the contained object's GType, if the GalagoValue's type is
GALAGO_VALUE_TYPE_OBJECT
.
value : |
The GalagoValue. |
Returns : | The object's GType, or NULL .
|
void galago_value_set_char (GalagoValue *value, char data);
Sets the value's character data.
value : |
The GalagoValue. |
data : |
The character data. |
void galago_value_set_uchar (GalagoValue *value, unsigned char data);
Sets the value's unsigned char data.
value : |
The GalagoValue. |
data : |
The unsigned char data. |
void galago_value_set_boolean (GalagoValue *value, gboolean data);
Sets the value's boolean data.
value : |
The GalagoValue. |
data : |
The boolean data. |
void galago_value_set_short (GalagoValue *value, short data);
Sets the value's short integer data.
value : |
The GalagoValue. |
Param2 : |
The short integer data. |
void galago_value_set_ushort (GalagoValue *value, unsigned short data);
Sets the value's unsigned short integer data.
value : |
The GalagoValue. |
Param2 : |
The unsigned short integer data. |
void galago_value_set_int (GalagoValue *value, int data);
Sets the value's integer data.
value : |
The GalagoValue. |
data : |
The integer data. |
void galago_value_set_uint (GalagoValue *value, unsigned int data);
Sets the value's unsigned integer data.
value : |
The GalagoValue. |
data : |
The unsigned integer data. |
void galago_value_set_long (GalagoValue *value, long data);
Sets the value's long integer data.
value : |
The GalagoValue. |
Param2 : |
The long integer data. |
void galago_value_set_ulong (GalagoValue *value, unsigned long data);
Sets the value's unsigned long integer data.
value : |
The GalagoValue. |
Param2 : |
The unsigned long integer data. |
void galago_value_set_string (GalagoValue *value, const char *data);
Sets the value's string data.
value : |
The GalagoValue. |
data : |
The string data. |
void galago_value_set_object (GalagoValue *value, void *data);
Sets the value's object data.
value : |
The GalagoValue. |
data : |
The object data. |
void galago_value_set_pointer (GalagoValue *value, void *data);
Sets the value's pointer data.
value : |
The GalagoValue. |
data : |
The pointer data. |
void galago_value_set_list (GalagoValue *value, GList *data);
Sets the value's list of values.
value : |
The GalagoValue. |
data : |
The list of values. |
void galago_value_set_array (GalagoValue *value, const void *data, gsize size);
Sets the value's array of values.
value : |
The GalagoValue. |
data : |
The array of values. |
size : |
The size of the array. |
char galago_value_get_char (const GalagoValue *value);
Returns the value's char data.
value : |
The GalagoValue. |
Returns : | The char data. |
unsigned char galago_value_get_uchar (const GalagoValue *value);
Returns the value's unsigned character data.
value : |
The GalagoValue. |
Returns : | The unsigned char data. |
gboolean galago_value_get_boolean (const GalagoValue *value);
Returns the value's boolean data.
value : |
The GalagoValue. |
Returns : | The boolean data. |
short galago_value_get_short (const GalagoValue *value);
Returns the value's short integer data.
value : |
The GalagoValue. |
Returns : | The short integer data. |
unsigned short galago_value_get_ushort (const GalagoValue *value);
Returns the value's unsigned short integer data.
value : |
The GalagoValue. |
Returns : | The unsigned short integer data. |
int galago_value_get_int (const GalagoValue *value);
Returns the value's integer data.
value : |
The GalagoValue. |
Returns : | The integer data. |
unsigned int galago_value_get_uint (const GalagoValue *value);
Returns the value's unsigned integer data.
value : |
The GalagoValue. |
Returns : | The unsigned integer data. |
long galago_value_get_long (const GalagoValue *value);
Returns the value's long integer data.
value : |
The GalagoValue. |
Returns : | The long integer data. |
unsigned long galago_value_get_ulong (const GalagoValue *value);
Returns the value's unsigned long integer data.
value : |
The GalagoValue. |
Returns : | The unsigned long integer data. |
const char* galago_value_get_string (const GalagoValue *value);
Returns the value's string data.
value : |
The GalagoValue. |
Returns : | The string data. |
void* galago_value_get_object (const GalagoValue *value);
Returns the value's object data.
value : |
The GalagoValue. |
Returns : | The object data. |
void* galago_value_get_pointer (const GalagoValue *value);
Returns the value's pointer data.
value : |
The GalagoValue. |
Returns : | The pointer data. |
GList* galago_value_get_list (const GalagoValue *value);
Returns the value's list of values.
value : |
The GalagoValue. |
Returns : | The list of values. |
void galago_value_get_array (const GalagoValue *value, const void **ret_array, gsize *ret_size);
Returns the value's array of values.
value : |
The GalagoValue. |
ret_array : |
The returned array. |
ret_size : |
The returned size of the array. |