pidgin  2.14.10
value.h File Reference

Value wrapper API. More...

#include <glib.h>

Go to the source code of this file.

Data Structures

struct  PurpleValue
 A wrapper for a type, subtype, and specific type of value. More...
 

Enumerations

enum  PurpleType {
  PURPLE_TYPE_UNKNOWN = 0 , PURPLE_TYPE_SUBTYPE , PURPLE_TYPE_CHAR , PURPLE_TYPE_UCHAR ,
  PURPLE_TYPE_BOOLEAN , PURPLE_TYPE_SHORT , PURPLE_TYPE_USHORT , PURPLE_TYPE_INT ,
  PURPLE_TYPE_UINT , PURPLE_TYPE_LONG , PURPLE_TYPE_ULONG , PURPLE_TYPE_INT64 ,
  PURPLE_TYPE_UINT64 , PURPLE_TYPE_STRING , PURPLE_TYPE_OBJECT , PURPLE_TYPE_POINTER ,
  PURPLE_TYPE_ENUM , PURPLE_TYPE_BOXED
}
 Specific value types. More...
 
enum  PurpleSubType {
  PURPLE_SUBTYPE_UNKNOWN = 0 , PURPLE_SUBTYPE_ACCOUNT , PURPLE_SUBTYPE_BLIST , PURPLE_SUBTYPE_BLIST_BUDDY ,
  PURPLE_SUBTYPE_BLIST_GROUP , PURPLE_SUBTYPE_BLIST_CHAT , PURPLE_SUBTYPE_BUDDY_ICON , PURPLE_SUBTYPE_CONNECTION ,
  PURPLE_SUBTYPE_CONVERSATION , PURPLE_SUBTYPE_PLUGIN , PURPLE_SUBTYPE_BLIST_NODE , PURPLE_SUBTYPE_CIPHER ,
  PURPLE_SUBTYPE_STATUS , PURPLE_SUBTYPE_LOG , PURPLE_SUBTYPE_XFER , PURPLE_SUBTYPE_SAVEDSTATUS ,
  PURPLE_SUBTYPE_XMLNODE , PURPLE_SUBTYPE_USERINFO , PURPLE_SUBTYPE_STORED_IMAGE , PURPLE_SUBTYPE_CERTIFICATEPOOL ,
  PURPLE_SUBTYPE_CHATBUDDY
}
 Purple-specific subtype values.
 

Functions

PurpleValuepurple_value_new (PurpleType type,...)
 Creates a new PurpleValue. More...
 
PurpleValuepurple_value_new_outgoing (PurpleType type,...)
 Creates a new outgoing PurpleValue. More...
 
void purple_value_destroy (PurpleValue *value)
 Destroys a PurpleValue. More...
 
PurpleValuepurple_value_dup (const PurpleValue *value)
 Duplicated a PurpleValue. More...
 
PurpleType purple_value_get_type (const PurpleValue *value)
 Returns a value's type. More...
 
unsigned int purple_value_get_subtype (const PurpleValue *value)
 Returns a value's subtype. More...
 
const char * purple_value_get_specific_type (const PurpleValue *value)
 Returns a value's specific type. More...
 
gboolean purple_value_is_outgoing (const PurpleValue *value)
 Returns whether or not the value is an outgoing value. More...
 
void purple_value_set_char (PurpleValue *value, char data)
 Sets the value's character data. More...
 
void purple_value_set_uchar (PurpleValue *value, unsigned char data)
 Sets the value's unsigned character data. More...
 
void purple_value_set_boolean (PurpleValue *value, gboolean data)
 Sets the value's boolean data. More...
 
void purple_value_set_short (PurpleValue *value, short data)
 Sets the value's short integer data. More...
 
void purple_value_set_ushort (PurpleValue *value, unsigned short data)
 Sets the value's unsigned short integer data. More...
 
void purple_value_set_int (PurpleValue *value, int data)
 Sets the value's integer data. More...
 
void purple_value_set_uint (PurpleValue *value, unsigned int data)
 Sets the value's unsigned integer data. More...
 
void purple_value_set_long (PurpleValue *value, long data)
 Sets the value's long integer data. More...
 
void purple_value_set_ulong (PurpleValue *value, unsigned long data)
 Sets the value's unsigned long integer data. More...
 
void purple_value_set_int64 (PurpleValue *value, gint64 data)
 Sets the value's 64-bit integer data. More...
 
void purple_value_set_uint64 (PurpleValue *value, guint64 data)
 Sets the value's unsigned 64-bit integer data. More...
 
void purple_value_set_string (PurpleValue *value, const char *data)
 Sets the value's string data. More...
 
void purple_value_set_object (PurpleValue *value, void *data)
 Sets the value's object data. More...
 
void purple_value_set_pointer (PurpleValue *value, void *data)
 Sets the value's pointer data. More...
 
void purple_value_set_enum (PurpleValue *value, int data)
 Sets the value's enum data. More...
 
void purple_value_set_boxed (PurpleValue *value, void *data)
 Sets the value's boxed data. More...
 
char purple_value_get_char (const PurpleValue *value)
 Returns the value's character data. More...
 
unsigned char purple_value_get_uchar (const PurpleValue *value)
 Returns the value's unsigned character data. More...
 
gboolean purple_value_get_boolean (const PurpleValue *value)
 Returns the value's boolean data. More...
 
short purple_value_get_short (const PurpleValue *value)
 Returns the value's short integer data. More...
 
unsigned short purple_value_get_ushort (const PurpleValue *value)
 Returns the value's unsigned short integer data. More...
 
int purple_value_get_int (const PurpleValue *value)
 Returns the value's integer data. More...
 
unsigned int purple_value_get_uint (const PurpleValue *value)
 Returns the value's unsigned integer data. More...
 
long purple_value_get_long (const PurpleValue *value)
 Returns the value's long integer data. More...
 
unsigned long purple_value_get_ulong (const PurpleValue *value)
 Returns the value's unsigned long integer data. More...
 
gint64 purple_value_get_int64 (const PurpleValue *value)
 Returns the value's 64-bit integer data. More...
 
guint64 purple_value_get_uint64 (const PurpleValue *value)
 Returns the value's unsigned 64-bit integer data. More...
 
const char * purple_value_get_string (const PurpleValue *value)
 Returns the value's string data. More...
 
void * purple_value_get_object (const PurpleValue *value)
 Returns the value's object data. More...
 
void * purple_value_get_pointer (const PurpleValue *value)
 Returns the value's pointer data. More...
 
int purple_value_get_enum (const PurpleValue *value)
 Returns the value's enum data. More...
 
void * purple_value_get_boxed (const PurpleValue *value)
 Returns the value's boxed data. More...
 

Detailed Description

Value wrapper API.

Definition in file value.h.

Enumeration Type Documentation

◆ PurpleType

enum PurpleType

Specific value types.

Enumerator
PURPLE_TYPE_UNKNOWN 

Unknown type.


PURPLE_TYPE_SUBTYPE 

Subtype.


PURPLE_TYPE_CHAR 

Character.


PURPLE_TYPE_UCHAR 

Unsigned character.


PURPLE_TYPE_BOOLEAN 

Boolean.


PURPLE_TYPE_SHORT 

Short integer.


PURPLE_TYPE_USHORT 

Unsigned short integer.


PURPLE_TYPE_INT 

Integer.


PURPLE_TYPE_UINT 

Unsigned integer.


PURPLE_TYPE_LONG 

Long integer.


PURPLE_TYPE_ULONG 

Unsigned long integer.


PURPLE_TYPE_INT64 

64-bit integer.


PURPLE_TYPE_UINT64 

64-bit unsigned integer.


PURPLE_TYPE_STRING 

String.


PURPLE_TYPE_OBJECT 

Object pointer.


PURPLE_TYPE_POINTER 

Generic pointer.


PURPLE_TYPE_ENUM 

Enum.


PURPLE_TYPE_BOXED 

Boxed pointer with specific type.

Definition at line 34 of file value.h.

Function Documentation

◆ purple_value_destroy()

void purple_value_destroy ( PurpleValue value)

Destroys a PurpleValue.

Parameters
valueThe value to destroy.

◆ purple_value_dup()

PurpleValue* purple_value_dup ( const PurpleValue value)

Duplicated a PurpleValue.

Parameters
valueThe value to duplicate.
Returns
The duplicate value.

◆ purple_value_get_boolean()

gboolean purple_value_get_boolean ( const PurpleValue value)

Returns the value's boolean data.

Parameters
valueThe value.
Returns
The boolean data.

◆ purple_value_get_boxed()

void* purple_value_get_boxed ( const PurpleValue value)

Returns the value's boxed data.

Parameters
valueThe value.
Returns
The boxed data.

◆ purple_value_get_char()

char purple_value_get_char ( const PurpleValue value)

Returns the value's character data.

Parameters
valueThe value.
Returns
The character data.

◆ purple_value_get_enum()

int purple_value_get_enum ( const PurpleValue value)

Returns the value's enum data.

Parameters
valueThe value.
Returns
The enum data.

◆ purple_value_get_int()

int purple_value_get_int ( const PurpleValue value)

Returns the value's integer data.

Parameters
valueThe value.
Returns
The integer data.

◆ purple_value_get_int64()

gint64 purple_value_get_int64 ( const PurpleValue value)

Returns the value's 64-bit integer data.

Parameters
valueThe value.
Returns
The 64-bit integer data.

◆ purple_value_get_long()

long purple_value_get_long ( const PurpleValue value)

Returns the value's long integer data.

Parameters
valueThe value.
Returns
The long integer data.

◆ purple_value_get_object()

void* purple_value_get_object ( const PurpleValue value)

Returns the value's object data.

Parameters
valueThe value.
Returns
The object data.

◆ purple_value_get_pointer()

void* purple_value_get_pointer ( const PurpleValue value)

Returns the value's pointer data.

Parameters
valueThe value.
Returns
The pointer data.

◆ purple_value_get_short()

short purple_value_get_short ( const PurpleValue value)

Returns the value's short integer data.

Parameters
valueThe value.
Returns
The short integer data.

◆ purple_value_get_specific_type()

const char* purple_value_get_specific_type ( const PurpleValue value)

Returns a value's specific type.

If the value's type is not PURPLE_TYPE_BOXED, this will return NULL.

Parameters
valueThe value whose specific type you want.
Returns
The value's specific type, or NULL if not PURPLE_TYPE_BOXED.

◆ purple_value_get_string()

const char* purple_value_get_string ( const PurpleValue value)

Returns the value's string data.

Parameters
valueThe value.
Returns
The string data.

◆ purple_value_get_subtype()

unsigned int purple_value_get_subtype ( const PurpleValue value)

Returns a value's subtype.

If the value's type is not PURPLE_TYPE_SUBTYPE, this will return 0. Subtypes should never have a subtype of 0.

Parameters
valueThe value whose subtype you want.
Returns
The value's subtype, or 0 if type is not PURPLE_TYPE_SUBTYPE.

◆ purple_value_get_type()

PurpleType purple_value_get_type ( const PurpleValue value)

Returns a value's type.

Parameters
valueThe value whose type you want.
Returns
The value's type.

◆ purple_value_get_uchar()

unsigned char purple_value_get_uchar ( const PurpleValue value)

Returns the value's unsigned character data.

Parameters
valueThe value.
Returns
The unsigned character data.

◆ purple_value_get_uint()

unsigned int purple_value_get_uint ( const PurpleValue value)

Returns the value's unsigned integer data.

Parameters
valueThe value.
Returns
The unsigned integer data.

◆ purple_value_get_uint64()

guint64 purple_value_get_uint64 ( const PurpleValue value)

Returns the value's unsigned 64-bit integer data.

Parameters
valueThe value.
Returns
The unsigned 64-bit integer data.

◆ purple_value_get_ulong()

unsigned long purple_value_get_ulong ( const PurpleValue value)

Returns the value's unsigned long integer data.

Parameters
valueThe value.
Returns
The unsigned long integer data.

◆ purple_value_get_ushort()

unsigned short purple_value_get_ushort ( const PurpleValue value)

Returns the value's unsigned short integer data.

Parameters
valueThe value.
Returns
The unsigned short integer data.

◆ purple_value_is_outgoing()

gboolean purple_value_is_outgoing ( const PurpleValue value)

Returns whether or not the value is an outgoing value.

Parameters
valueThe value.
Returns
TRUE if the value is outgoing, or FALSE otherwise.

◆ purple_value_new()

PurpleValue* purple_value_new ( PurpleType  type,
  ... 
)

Creates a new PurpleValue.

This function takes a type and, depending on that type, a sub-type or specific type.

If type is PURPLE_TYPE_BOXED, the next parameter must be a string representing the specific type.

If type is PURPLE_TYPE_SUBTYPE, the next parameter must be a integer or enum representing the sub-type.

If the subtype or specific type is not set when required, random errors may occur. You have been warned.

Parameters
typeThe type.
Returns
The new value.

◆ purple_value_new_outgoing()

PurpleValue* purple_value_new_outgoing ( PurpleType  type,
  ... 
)

Creates a new outgoing PurpleValue.

If a value is an "outgoing" value it means the value can be modified by plugins and scripts.

This function takes a type and, depending on that type, a sub-type or specific type.

If type is PURPLE_TYPE_BOXED, the next parameter must be a string representing the specific type.

If type is PURPLE_TYPE_SUBTYPE, the next parameter must be a integer or enum representing the sub-type.

If the sub-type or specific type is not set when required, random errors may occur. You have been warned.

Parameters
typeThe type.
Returns
The new value.

◆ purple_value_set_boolean()

void purple_value_set_boolean ( PurpleValue value,
gboolean  data 
)

Sets the value's boolean data.

Parameters
valueThe value.
dataThe boolean data.

◆ purple_value_set_boxed()

void purple_value_set_boxed ( PurpleValue value,
void *  data 
)

Sets the value's boxed data.

Parameters
valueThe value.
dataThe boxed data.

◆ purple_value_set_char()

void purple_value_set_char ( PurpleValue value,
char  data 
)

Sets the value's character data.

Parameters
valueThe value.
dataThe character data.

◆ purple_value_set_enum()

void purple_value_set_enum ( PurpleValue value,
int  data 
)

Sets the value's enum data.

Parameters
valueThe value.
dataThe enum data.

◆ purple_value_set_int()

void purple_value_set_int ( PurpleValue value,
int  data 
)

Sets the value's integer data.

Parameters
valueThe value.
dataThe integer data.

◆ purple_value_set_int64()

void purple_value_set_int64 ( PurpleValue value,
gint64  data 
)

Sets the value's 64-bit integer data.

Parameters
valueThe value.
dataThe 64-bit integer data.

◆ purple_value_set_long()

void purple_value_set_long ( PurpleValue value,
long  data 
)

Sets the value's long integer data.

Parameters
valueThe value.
dataThe long integer data.

◆ purple_value_set_object()

void purple_value_set_object ( PurpleValue value,
void *  data 
)

Sets the value's object data.

Parameters
valueThe value.
dataThe object data.

◆ purple_value_set_pointer()

void purple_value_set_pointer ( PurpleValue value,
void *  data 
)

Sets the value's pointer data.

Parameters
valueThe value.
dataThe pointer data.

◆ purple_value_set_short()

void purple_value_set_short ( PurpleValue value,
short  data 
)

Sets the value's short integer data.

Parameters
valueThe value.
dataThe short integer data.

◆ purple_value_set_string()

void purple_value_set_string ( PurpleValue value,
const char *  data 
)

Sets the value's string data.

Parameters
valueThe value.
dataThe string data.

◆ purple_value_set_uchar()

void purple_value_set_uchar ( PurpleValue value,
unsigned char  data 
)

Sets the value's unsigned character data.

Parameters
valueThe value.
dataThe unsigned character data.

◆ purple_value_set_uint()

void purple_value_set_uint ( PurpleValue value,
unsigned int  data 
)

Sets the value's unsigned integer data.

Parameters
valueThe value.
dataThe unsigned integer data.

◆ purple_value_set_uint64()

void purple_value_set_uint64 ( PurpleValue value,
guint64  data 
)

Sets the value's unsigned 64-bit integer data.

Parameters
valueThe value.
dataThe unsigned 64-bit integer data.

◆ purple_value_set_ulong()

void purple_value_set_ulong ( PurpleValue value,
unsigned long  data 
)

Sets the value's unsigned long integer data.

Parameters
valueThe value.
dataThe unsigned long integer data.

◆ purple_value_set_ushort()

void purple_value_set_ushort ( PurpleValue value,
unsigned short  data 
)

Sets the value's unsigned short integer data.

Parameters
valueThe value.
dataThe unsigned short integer data.