URL

Name

URL -- Universal Resource Locator (e.g. http://www.gnetlibrary.org/index.html)

Synopsis



GURL*       gnet_url_new                    (const gchar *url);
GURL*       gnet_url_new_fields             (const gchar *protocol,
                                             const gchar *hostname,
                                             const gint port,
                                             const gchar *resource);
GURL*       gnet_url_new_fields_all         (const gchar *protocol,
                                             const gchar *user,
                                             const gchar *password,
                                             const gchar *hostname,
                                             const gint port,
                                             const gchar *resource,
                                             const gchar *query,
                                             const gchar *fragment);
GURL*       gnet_url_clone                  (const GURL *url);
void        gnet_url_delete                 (GURL *url);
guint       gnet_url_hash                   (gconstpointer p);
gint        gnet_url_equal                  (gconstpointer p1,
                                             gconstpointer p2);
gchar*      gnet_url_get_nice_string        (const GURL *url);
void        gnet_url_set_protocol           (GURL *url,
                                             const gchar *protocol);
void        gnet_url_set_user               (GURL *url,
                                             const gchar *user);
void        gnet_url_set_password           (GURL *url,
                                             const gchar *password);
void        gnet_url_set_hostname           (GURL *url,
                                             const gchar *hostname);
void        gnet_url_set_port               (GURL *url,
                                             gint port);
void        gnet_url_set_resource           (GURL *url,
                                             const gchar *resource);
void        gnet_url_set_query              (GURL *url,
                                             const gchar *query);
void        gnet_url_set_fragment           (GURL *url,
                                             const gchar *fragment);

Description

Details

gnet_url_new ()

GURL*       gnet_url_new                    (const gchar *url);

Create a GURL from the URL argument. Fields are set to NULL if they are not set. The path does not necessarily start with a /. The parser is not validating -- it will accept some malformed URL.

url : URL string
Returns : A new GURL, or NULL if there was a failure.


gnet_url_new_fields ()

GURL*       gnet_url_new_fields             (const gchar *protocol,
                                             const gchar *hostname,
                                             const gint port,
                                             const gchar *resource);

Create a GURL from the fields. This is the short version. Use gnet_url_new_fields_all() to specify all fields.

protocol : protocol
hostname : hostname
port : port
resource : path
Returns : A new GURL.


gnet_url_new_fields_all ()

GURL*       gnet_url_new_fields_all         (const gchar *protocol,
                                             const gchar *user,
                                             const gchar *password,
                                             const gchar *hostname,
                                             const gint port,
                                             const gchar *resource,
                                             const gchar *query,
                                             const gchar *fragment);

Create a GURL from the fields. This is the short version. Use gnet_url_new_fields_all() to specify all fields.

protocol : protocol
user : user
password : password
hostname : hostname
port : port
resource : path
query : query
fragment : fragment
Returns : A new GURL.


gnet_url_clone ()

GURL*       gnet_url_clone                  (const GURL *url);

Create a URL from another one.

url : URL to clone.
Returns : a new GURL.


gnet_url_delete ()

void        gnet_url_delete                 (GURL *url);

Delete a GURL.

url : GURL to delete


gnet_url_hash ()

guint       gnet_url_hash                   (gconstpointer p);

Hash the GURL hash value.

p : GURL to get hash value of
Returns : hash value.


gnet_url_equal ()

gint        gnet_url_equal                  (gconstpointer p1,
                                             gconstpointer p2);

Compare two GURL's.

p1 : Pointer to first GURL.
p2 : Pointer to second GURL.
Returns : 1 if they are the same; 0 otherwise.


gnet_url_get_nice_string ()

gchar*      gnet_url_get_nice_string        (const GURL *url);

Convert the URL to a human-readable string. Currently, no escaping or unescaping is done.

url : URL
Returns : Nice, caller-owned string.


gnet_url_set_protocol ()

void        gnet_url_set_protocol           (GURL *url,
                                             const gchar *protocol);

Set the protocol in the URL.

url : url
protocol : protocol


gnet_url_set_user ()

void        gnet_url_set_user               (GURL *url,
                                             const gchar *user);

Set the user in the URL.

url : url
user : user


gnet_url_set_password ()

void        gnet_url_set_password           (GURL *url,
                                             const gchar *password);

Set the password in the URL.

url : url
password : password


gnet_url_set_hostname ()

void        gnet_url_set_hostname           (GURL *url,
                                             const gchar *hostname);

Set the hostname in the URL.

url : url
hostname : hostname


gnet_url_set_port ()

void        gnet_url_set_port               (GURL *url,
                                             gint port);

Set the port in the URL.

url : url
port : port


gnet_url_set_resource ()

void        gnet_url_set_resource           (GURL *url,
                                             const gchar *resource);

Set the path in the URL.

url : url
resource : path


gnet_url_set_query ()

void        gnet_url_set_query              (GURL *url,
                                             const gchar *query);

Set the query in the URL.

url : url
query : query


gnet_url_set_fragment ()

void        gnet_url_set_fragment           (GURL *url,
                                             const gchar *fragment);

Set the fragment in the URL.

url : url
fragment : fragment