## Utilities Utilities — Utility and miscellaneous functions. |

## Synopsis

    #include <libtracker-client/tracker-client.h>

    gchar *             tracker_sparql_escape               (const gchar *str);
    gchar *             tracker_uri_printf_escaped          (const gchar *format,
                                                             ...);
    gchar *             tracker_uri_vprintf_escaped         (const gchar *format,
                                                             va_list args);

## Description

This is miscellaneous API that may be useful to users.

## Details

### tracker_sparql_escape ()

    gchar *             tracker_sparql_escape               (const gchar *str);

Escapes a string so it can be passed as a SPARQL parameter in any query/update.

`str` : | a string to escape.
Returns : | the newly allocated escaped string which must be freed using `g_free()`.

Since 0.8

### tracker_uri_printf_escaped ()

    gchar *             tracker_uri_printf_escaped          (const gchar *format,
                                                             ...);

Calls `tracker_uri_vprintf_escaped()` with the `Varargs` supplied.

`format` : | a standard `printf()` format string, but notice string precision pitfalls
`...` : | the parameters to insert into the format string
Returns : | a newly-allocated string holding the result which should be freed with `g_free()` when finished with.

Since 0.8

### tracker_uri_vprintf_escaped ()

    gchar *             tracker_uri_vprintf_escaped         (const gchar *format,
                                                             va_list args);

Similar to the standard C `vsprintf()` function but safer, since it calculates the maximum space required and allocates memory to hold the result.

The result is escaped using `g_uri_escape_string()`.

`format` : | a standard `printf()` format string, but notice string precision pitfalls
`args` : | the list of parameters to insert into the format string
Returns : | a newly-allocated string holding the result which should be freed with `g_free()` when finished with.

Since 0.8