Function silc_attribute_get_object
SYNOPSIS
SilcBool silc_attribute_get_object(SilcAttributePayload payload,
void *object,
SilcUInt32 object_size);
DESCRIPTION
Returns the already parsed attribute object from the payload
indicated by `payload'. Copies the data into the `object' which
must be sent as argument (and must be of correct type and size).
The `object_size' indicates the size of the `*object' sent.
Returns TRUE if the `attribute' attribute was found and FALSE
if such attribute is not present in the `payload', or the `object_size'
is not sufficient. See the definition of SilcAttribute for the
list of attributes and the required object types for attributes.
You can use silc_attribute_get_attribute to get the SilcAttribute
type from the `payload'.
EXAMPLE
SilcAttributeObjDevice dev;
...
case SILC_ATTRIBUTE_DEVICE_INFO:
memset(&dev, 0, sizeof(dev));
if (!silc_attribute_get_object(payload, (void *)&dev, sizeof(dev)))
error();
case SILC_ATTRIBUTE_USER_ICON:
mime = silc_mime_alloc();
if (!silc_attribute_get_object(payload, (void *)mime, sizeof(*mime)))
error();
...
|