MPD 0.17~git
Functions
src/resolver.h File Reference
#include <glib.h>

Go to the source code of this file.

Functions

static G_GNUC_CONST GQuark resolver_quark (void)
G_GNUC_MALLOC char * sockaddr_to_string (const struct sockaddr *sa, size_t length, GError **error)
 Converts the specified socket address into a string in the form "IP:PORT".
struct addrinfo * resolve_host_port (const char *host_port, unsigned default_port, int flags, int socktype, GError **error_r)
 Resolve a specification in the form "host", "host:port", "[host]:port".

Function Documentation

struct addrinfo* resolve_host_port ( const char *  host_port,
unsigned  default_port,
int  flags,
int  socktype,
GError **  error_r 
) [read]

Resolve a specification in the form "host", "host:port", "[host]:port".

This is a convenience wrapper for getaddrinfo().

Parameters:
default_porta default port number that will be used if none is given in the string (if applicable); pass 0 to go without a default
Returns:
an #addrinfo linked list that must be freed with freeaddrinfo(), or NULL on error
static G_GNUC_CONST GQuark resolver_quark ( void  ) [inline, static]

Definition at line 30 of file resolver.h.

G_GNUC_MALLOC char* sockaddr_to_string ( const struct sockaddr *  sa,
size_t  length,
GError **  error 
)

Converts the specified socket address into a string in the form "IP:PORT".

The return value must be freed with g_free() when you don't need it anymore.

Parameters:
sathe sockaddr struct
lengththe length of #sa in bytes
errorlocation to store the error occurring, or NULL to ignore errors