### Struct

# Cogl UserDataKey

since: 13

#### Description [src]

    struct CoglUserDataKey {
      int unused;
    }

A `CoglUserDataKey` is used to declare a key for attaching data to a `CoglObject` using cogl_object_set_user_data. The typedef only exists as a formality to make code self documenting since only the unique address of a `CoglUserDataKey` is used.

Typically you would declare a static `CoglUserDataKey` and set private data on an object something like this:

    static CoglUserDataKey path_private_key;

    static void
    destroy_path_private_cb (void *data)
    {
      g_free (data);
    }

    static void
    my_path_set_data (CoglPipeline *pipeline, void *data)
    {
      cogl_object_set_user_data (COGL_OBJECT (pipeline),
                                 &private_key,
                                 data,
                                 destroy_pipeline_private_cb);
    }

###### Structure members

`unused`

  Ignored.

Available since: 13