GIMP Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# gimputils

## Name

gimputils -- Simple utility functions that don't have their own category.

## Synopsis

    gchar*      gimp_strescape                  (const gchar *source,
                                                 const gchar *exceptions);
    gchar*      gimp_strcompress                (const gchar *source);

## Description

Right now all you find here is a function taken from glib-1.3 that we need in several places. Since Gimp doesn't rely on glib-1.3, we provide it here.

## Details

### gimp_strescape ()

    gchar*      gimp_strescape                  (const gchar *source,
                                                 const gchar *exceptions);

Escapes special characters in a string in the same way as in the C language, i.e. either with one of the sequences \b, \f, \n, \r, \t, \\, \", or as a three-digit octal escape sequence \nnn.

If the list of exceptions is NULL, all ASCII control characters, the backslash character, the double-quote character, and all non-ASCII characters are escaped.

If glib > 1.3 is installed this function is identical to g_strescape(). For systems using glib-1.2 this function provides the added functionality from glib-1.3.

`source` : | A string to escape special characters in.
`exceptions` : | A string holding characters not to be escaped.
Returns : | A newly allocated copy of the string, with all special characters escaped as in the C language.

### gimp_strcompress ()

    gchar*      gimp_strcompress                (const gchar *source);

Does the opposite of g_strescape(), that is it converts escaped characters back to their unescaped form.

Escaped characters are either one of the sequences \b, \f, \n, \r, \t, \\, \", or a three-digit octal escape sequence \nnn.

If glib > 1.3 is installed this function is identical to g_strcompress(). For systems using glib-1.2 this function provides the functionality from glib-1.3.

`source` : | A string to that has special characters escaped.
Returns : | A newly allocated copy of the string, with all escaped special characters converted to their unescaped form.

## See Also

g_strescape()

<<< Previous Page | Home | Up | Next Page >>>
gimpunit | gimpvector