e7683428f9b9f73f814edf0fc9e7c44d9e3d7754
[platform/upstream/libsoup.git] / libsoup / soup-uri.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* url-util.h : utility functions to parse URLs */
3
4 /* 
5  * Copyright 1999-2002 Ximian, Inc.
6  */
7
8
9 #ifndef  SOUP_URI_H
10 #define  SOUP_URI_H 1
11
12 #include <glib.h>
13
14 typedef GQuark SoupProtocol;
15 #define SOUP_PROTOCOL_HTTP (g_quark_from_static_string ("http"))
16 #define SOUP_PROTOCOL_HTTPS (g_quark_from_static_string ("https"))
17
18 typedef struct {
19         SoupProtocol  protocol;
20
21         char         *user;
22         char         *authmech;
23         char         *passwd;
24
25         char         *host;
26         guint         port;
27
28         char         *path;
29         char         *query;
30
31         char         *fragment;
32 } SoupUri;
33
34 SoupUri *soup_uri_new_with_base (const SoupUri *base,
35                                  const char    *uri_string);
36 SoupUri *soup_uri_new           (const char    *uri_string);
37
38 char    *soup_uri_to_string     (const SoupUri *uri, 
39                                  gboolean       just_path);
40
41 SoupUri *soup_uri_copy          (const SoupUri *uri);
42
43 gboolean soup_uri_equal         (const SoupUri *uri1, 
44                                  const SoupUri *uri2);
45
46 void     soup_uri_free          (SoupUri       *uri);
47
48 void     soup_uri_set_auth      (SoupUri       *uri, 
49                                  const char    *user, 
50                                  const char    *passwd, 
51                                  const char    *authmech);
52
53 char    *soup_uri_encode        (const char    *part,
54                                  const char    *escape_extra);
55 void     soup_uri_decode        (char          *part);
56
57 #endif /*SOUP_URI_H*/