## Item Attributes

Item Attributes — Attributes of individual keyring items.

## Synopsis

    enum                GnomeKeyringAttributeType;
    typedef             GnomeKeyringAttributeList;
                        GnomeKeyringAttribute;
    #define             gnome_keyring_attribute_list_index  (a, i)
    #define             gnome_keyring_attribute_list_new    ()
    void                gnome_keyring_attribute_list_append_string
                                                            (GnomeKeyringAttributeList *attributes,
                                                             const char *name,
                                                             const char *value);
    void                gnome_keyring_attribute_list_append_uint32
                                                            (GnomeKeyringAttributeList *attributes,
                                                             const char *name,
                                                             guint32 value);
    void                gnome_keyring_attribute_list_free   (GnomeKeyringAttributeList *attributes);
    GnomeKeyringAttributeList * gnome_keyring_attribute_list_copy
                                                            (GnomeKeyringAttributeList *attributes);

## Description

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()`.

Each attribute has either a string, or unsigned integer value.

## Details

### enum GnomeKeyringAttributeType

    typedef enum {
    	GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
    	GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32
    } GnomeKeyringAttributeType;

### GnomeKeyringAttributeList

    typedef GArray GnomeKeyringAttributeList;

### GnomeKeyringAttribute

    typedef struct {
    	char *name;
    	GnomeKeyringAttributeType type;
    	union {
    		char *string;
    		guint32 integer;
    	} value;
    } GnomeKeyringAttribute;

### gnome_keyring_attribute_list_index()

    #define             gnome_keyring_attribute_list_index(a, i)

`a` : |
`i` : |

### gnome_keyring_attribute_list_new()

    #define             gnome_keyring_attribute_list_new()

### gnome_keyring_attribute_list_append_string ()

    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`.

`attributes` : | A GnomeKeyringAttributeList
`name` : | The name of the new attribute
`value` : | The value to store in `attributes`

### gnome_keyring_attribute_list_append_uint32 ()

    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`.

`attributes` : | A GnomeKeyringAttributeList
`name` : | The name of the new attribute
`value` : | The value to store in `attributes`

### gnome_keyring_attribute_list_free ()

    void                gnome_keyring_attribute_list_free   (GnomeKeyringAttributeList *attributes);

Free the memory used by `attributes`.

If a `NULL` pointer is passed, it is ignored.

`attributes` : | A GnomeKeyringAttributeList

### gnome_keyring_attribute_list_copy ()

    GnomeKeyringAttributeList * gnome_keyring_attribute_list_copy
                                                            (GnomeKeyringAttributeList *attributes);

Copy a list of item attributes.

`attributes` : | A GnomeKeyringAttributeList to copy.
Returns : | The new GnomeKeyringAttributeList