## Miscellaneous Functions Miscellaneous Functions — Other miscellaneous functions. |

## Synopsis

    GList*              gp11_list_ref_copy                  (GList *reflist);
    void                gp11_list_unref_free                (GList *reflist);
    gchar*              gp11_string_from_chars              (const guchar *data,
                                                             gsize max);

## Description

A few supporting functions that come in handy when dealing with the GP11 library or PKCS11 in general.

## Details

### gp11_list_ref_copy ()

    GList*              gp11_list_ref_copy                  (GList *reflist);

Copy a list of GObject based pointers. All objects in the list will be reffed and the list will be copied.

`reflist` : |
Returns : | The copied and reffed list. When done, free it with `gp11_list_unref_free()`

### gp11_list_unref_free ()

    void                gp11_list_unref_free                (GList *reflist);

Free a list of GObject based pointers. All objects in the list will be unreffed and then the list itself will be freed.

`reflist` : |

### gp11_string_from_chars ()

    gchar*              gp11_string_from_chars              (const guchar *data,
                                                             gsize max);

Create a string from a set of PKCS11 characters. This is similar to g_strndup, except for that it also strips trailing spaces. These space padded strings are often used in PKCS11 structures.

`data` : | The character data to turn into a null terminated string.
`max` : | The maximum length of the charater data.
Returns : | The null terminated string.