GNet Network Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# url

## Name

url --

## 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);
    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);
    gchar*      gnet_url_get_nice_string        (const GURL *url);

## 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` : |
Returns : |

### 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` : |
`hostname` : |
`port` : |
`resource` : |
Returns : |

### 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` : |
`user` : |
`password` : |
`hostname` : |
`port` : |
`resource` : |
`query` : |
`fragment` : |
Returns : |

### gnet_url_clone ()

    GURL*       gnet_url_clone                  (const GURL *url);

Create a URL from another one.

`url` : |
Returns : |

### gnet_url_delete ()

    void        gnet_url_delete                 (GURL *url);

Delete a GURL.

`url` : |

### gnet_url_hash ()

    guint       gnet_url_hash                   (gconstpointer p);

Hash the GURL hash value.

`p` : |
Returns : |

### gnet_url_equal ()

    gint        gnet_url_equal                  (gconstpointer p1,
                                                 gconstpointer p2);

Compare two GURL's.

`p1` : |
`p2` : |
Returns : |

### gnet_url_set_protocol ()

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

Set the protocol in the URL.

`url` : |
`protocol` : |

### gnet_url_set_user ()

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

Set the user in the URL.

`url` : |
`user` : |

### gnet_url_set_password ()

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

Set the password in the URL.

`url` : |
`password` : |

### gnet_url_set_hostname ()

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

Set the hostname in the URL.

`url` : |
`hostname` : |

### gnet_url_set_port ()

    void        gnet_url_set_port               (GURL *url,
                                                 gint port);

Set the port in the URL.

`url` : |
`port` : |

### gnet_url_set_resource ()

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

Set the path in the URL.

`url` : |
`resource` : |

### gnet_url_set_query ()

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

Set the query in the URL.

`url` : |
`query` : |

### gnet_url_set_fragment ()

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

Set the fragment in the URL.

`url` : |
`fragment` : |

### 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` : |
Returns : |

<<< Previous Page | Home | Up | Next Page >>>
sha | conn