Function

Giodbus_address_escape_value

since: 2.36

Declaration

gchar*
g_dbus_address_escape_value (
  const gchar* string
)

Description

Escape string so it can appear in a D-Bus address as the value part of a key-value pair.

For instance, if string is /run/bus-for-:0, this function would return /run/bus-for-3A0, which could be used in a D-Bus address like `unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-`3A0.

Available since: 2.36

Parameters

string

Type: const gchar*

An unescaped string to be included in a D-Bus address as the value in a key-value pair.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: gchar*

A copy of string with all non-optionally-escaped bytes escaped.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.