## Item Attributes Item Attributes — Attributes of individual keyring items. |

## Synopsis

    enum                MateKeyringAttributeType;
    typedef             MateKeyringAttributeList;
                        MateKeyringAttribute;
    #define             mate_keyring_attribute_list_index   (a,
                                                             i)
    #define             mate_keyring_attribute_list_new
    void                mate_keyring_attribute_list_append_string
                                                            (MateKeyringAttributeList *attributes,
                                                             const char *name,
                                                             const char *value);
    void                mate_keyring_attribute_list_append_uint32
                                                            (MateKeyringAttributeList *attributes,
                                                             const char *name,
                                                             guint32 value);
    void                mate_keyring_attribute_list_free    (MateKeyringAttributeList *attributes);
    MateKeyringAttributeList * mate_keyring_attribute_list_copy
                                                            (MateKeyringAttributeList *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 `mate_keyring_item_get_attributes()` or `mate_keyring_item_set_attributes()`.

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

## Details

### enum MateKeyringAttributeType

    typedef enum {
    	MATE_KEYRING_ATTRIBUTE_TYPE_STRING,
    	MATE_KEYRING_ATTRIBUTE_TYPE_UINT32
    } MateKeyringAttributeType;

`MATE_KEYRING_ATTRIBUTE_TYPE_STRING` |
`MATE_KEYRING_ATTRIBUTE_TYPE_UINT32` |

### MateKeyringAttributeList

    typedef GArray MateKeyringAttributeList;

### MateKeyringAttribute

    typedef struct {
    	char *name;
    	MateKeyringAttributeType type;
    	union {
    		char *string;
    		guint32 integer;
    	} value;
    } MateKeyringAttribute;

### mate_keyring_attribute_list_index()

    #define mate_keyring_attribute_list_index(a, i) g_array_index ((a), MateKeyringAttribute, (i))

### mate_keyring_attribute_list_new

    #define mate_keyring_attribute_list_new() (g_array_new (FALSE, FALSE, sizeof (MateKeyringAttribute)))

### mate_keyring_attribute_list_append_string ()

    void                mate_keyring_attribute_list_append_string
                                                            (MateKeyringAttributeList *attributes,
                                                             const char *name,
                                                             const char *value);

Store a key-value-pair with a string value in `attributes`.

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

### mate_keyring_attribute_list_append_uint32 ()

    void                mate_keyring_attribute_list_append_uint32
                                                            (MateKeyringAttributeList *attributes,
                                                             const char *name,
                                                             guint32 value);

Store a key-value-pair with an unsigned 32bit number value in `attributes`.

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

### mate_keyring_attribute_list_free ()

    void                mate_keyring_attribute_list_free    (MateKeyringAttributeList *attributes);

Free the memory used by `attributes`.

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

`attributes` : | A MateKeyringAttributeList

### mate_keyring_attribute_list_copy ()

    MateKeyringAttributeList * mate_keyring_attribute_list_copy
                                                            (MateKeyringAttributeList *attributes);

Copy a list of item attributes.

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