Top | ![]() |
![]() |
![]() |
![]() |
Attributes allow various other pieces of information to be associated with an item.
These can also be used to search for relevant items. Use gnome_keyring_item_get_attributes()
or gnome_keyring_item_set_attributes()
.
Attributes are not stored in a secret or encrypted manner by gnome-keyring. Do not store sensitive information in attributes.
Each attribute has either a string, or unsigned integer value.
GnomeKeyringAttributeList *
gnome_keyring_attribute_list_new (void
);
Create a new GnomeKeyringAttributeList.
void gnome_keyring_attribute_list_append_string (GnomeKeyringAttributeList *attributes
,const char *name
,const char *value
);
Store a key-value-pair with a string value in attributes
.
void gnome_keyring_attribute_list_append_uint32 (GnomeKeyringAttributeList *attributes
,const char *name
,guint32 value
);
Store a key-value-pair with an unsigned 32bit number value in attributes
.
void
gnome_keyring_attribute_list_free (GnomeKeyringAttributeList *attributes
);
Free the memory used by attributes
.
If a NULL
pointer is passed, it is ignored.
GnomeKeyringAttributeList *
gnome_keyring_attribute_list_copy (GnomeKeyringAttributeList *attributes
);
Copy a list of item attributes.
const gchar *
gnome_keyring_attribute_get_string (GnomeKeyringAttribute *attribute
);
Return the string value. It is an error to call this method if
attribute.type
is not GNOME_KEYRING_ATTRIBUTE_TYPE_STRING. This method is
mostly useful for language bindings which do not provide union access. In C
you should just use attribute->value.string.
guint32
gnome_keyring_attribute_get_uint32 (GnomeKeyringAttribute *attribute
);
Return the uint32 value. It is an error to call this method if
attribute.type
is not GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32. This method is
mostly useful for language bindings which do not provide union access. In C
you should just use attribute->value.integer.
typedef struct { char *name; GnomeKeyringAttributeType type; union { char *string; guint32 integer; } value; } GnomeKeyringAttribute;
An item attribute. Set string
if data type is
GNOME_KEYRING_ATTRIBUTE_TYPE_STRING
or integer
if data type is
GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32