Address parsing
[D-Bus low-level public API]

Parsing addresses of D-Bus servers. More...

Typedefs

typedef struct DBusAddressEntry DBusAddressEntry
 Opaque type representing one of the semicolon-separated items in an address.

Functions

void dbus_address_entries_free (DBusAddressEntry **entries)
 Frees a NULL-terminated array of address entries.
const char * dbus_address_entry_get_method (DBusAddressEntry *entry)
 Returns the method string of an address entry.
const char * dbus_address_entry_get_value (DBusAddressEntry *entry, const char *key)
 Returns a value from a key of an entry.
dbus_bool_t dbus_parse_address (const char *address, DBusAddressEntry ***entry, int *array_len, DBusError *error)
 Parses an address string of the form:.
char * dbus_address_escape_value (const char *value)
 Escapes the given string as a value in a key=value pair for a D-Bus address.
char * dbus_address_unescape_value (const char *value, DBusError *error)
 Unescapes the given string as a value in a key=value pair for a D-Bus address.

Detailed Description

Parsing addresses of D-Bus servers.


Function Documentation

void dbus_address_entries_free ( DBusAddressEntry **  entries  ) 

Frees a NULL-terminated array of address entries.

Parameters:
entries the array.
const char * dbus_address_entry_get_method ( DBusAddressEntry entry  ) 

Returns the method string of an address entry.

For example, given the address entry "tcp:host=example.com" it would return the string "tcp"

Parameters:
entry the entry.
Returns:
a string describing the method. This string must not be freed.

Referenced by _dbus_server_listen_platform_specific(), _dbus_server_listen_socket(), _dbus_transport_open_platform_specific(), and _dbus_transport_open_socket().

const char * dbus_address_entry_get_value ( DBusAddressEntry entry,
const char *  key 
)

Returns a value from a key of an entry.

For example, given the address "tcp:host=example.com,port=8073" if you asked for the key "host" you would get the value "example.com"

The returned value is already unescaped.

Parameters:
entry the entry.
key the key.
Returns:
the key value. This string must not be freed.

Referenced by _dbus_server_listen_platform_specific(), _dbus_server_listen_socket(), _dbus_transport_open(), _dbus_transport_open_platform_specific(), and _dbus_transport_open_socket().

char * dbus_address_escape_value ( const char *  value  ) 

Escapes the given string as a value in a key=value pair for a D-Bus address.

Parameters:
value the unescaped value
Returns:
newly-allocated escaped value or NULL if no memory
char * dbus_address_unescape_value ( const char *  value,
DBusError error 
)

Unescapes the given string as a value in a key=value pair for a D-Bus address.

Note that dbus_address_entry_get_value() returns an already-unescaped value.

Parameters:
value the escaped value
error error to set if the unescaping fails
Returns:
newly-allocated unescaped value or NULL if no memory
dbus_bool_t dbus_parse_address ( const char *  address,
DBusAddressEntry ***  entry,
int *  array_len,
DBusError error 
)

Parses an address string of the form:.

method:key=value,key=value;method:key=value

See the D-Bus specification for complete docs on the format.

When connecting to an address, the first address entries in the semicolon-separated list should be tried first.

Parameters:
address the address.
entry return location to an array of entries.
array_len return location for array length.
error address where an error can be returned.
Returns:
TRUE on success, FALSE otherwise.

Generated on 25 Jun 2011 for D-Bus by  doxygen 1.6.1