1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
4 * Copyright 1999-2002 Ximian, Inc.
11 #include <libsoup/soup-types.h>
12 #include <libsoup/soup-misc.h>
31 GType soup_uri_get_type (void);
32 #define SOUP_TYPE_URI (soup_uri_get_type ())
34 #define SOUP_URI_SCHEME_HTTP _SOUP_ATOMIC_INTERN_STRING (_SOUP_URI_SCHEME_HTTP, "http")
35 #define SOUP_URI_SCHEME_HTTPS _SOUP_ATOMIC_INTERN_STRING (_SOUP_URI_SCHEME_HTTPS, "https")
36 #define SOUP_URI_SCHEME_FTP _SOUP_ATOMIC_INTERN_STRING (_SOUP_URI_SCHEME_FTP, "ftp")
37 #define SOUP_URI_SCHEME_FILE _SOUP_ATOMIC_INTERN_STRING (_SOUP_URI_SCHEME_FILE, "file")
38 #define SOUP_URI_SCHEME_DATA _SOUP_ATOMIC_INTERN_STRING (_SOUP_URI_SCHEME_DATA, "data")
39 extern gpointer _SOUP_URI_SCHEME_HTTP, _SOUP_URI_SCHEME_HTTPS;
40 extern gpointer _SOUP_URI_SCHEME_FTP;
41 extern gpointer _SOUP_URI_SCHEME_FILE, _SOUP_URI_SCHEME_DATA;
43 SoupURI *soup_uri_new_with_base (SoupURI *base,
44 const char *uri_string);
45 SoupURI *soup_uri_new (const char *uri_string);
47 char *soup_uri_to_string (SoupURI *uri,
48 gboolean just_path_and_query);
50 SoupURI *soup_uri_copy (SoupURI *uri);
52 gboolean soup_uri_equal (SoupURI *uri1,
55 void soup_uri_free (SoupURI *uri);
57 char *soup_uri_encode (const char *part,
58 const char *escape_extra);
59 char *soup_uri_decode (const char *part);
60 char *soup_uri_normalize (const char *part,
61 const char *unescape_extra);
63 gboolean soup_uri_uses_default_port (SoupURI *uri);
65 const char *soup_uri_get_scheme (SoupURI *uri);
66 void soup_uri_set_scheme (SoupURI *uri,
68 const char *soup_uri_get_user (SoupURI *uri);
69 void soup_uri_set_user (SoupURI *uri,
71 const char *soup_uri_get_password (SoupURI *uri);
72 void soup_uri_set_password (SoupURI *uri,
73 const char *password);
74 const char *soup_uri_get_host (SoupURI *uri);
75 void soup_uri_set_host (SoupURI *uri,
77 guint soup_uri_get_port (SoupURI *uri);
78 void soup_uri_set_port (SoupURI *uri,
80 const char *soup_uri_get_path (SoupURI *uri);
81 void soup_uri_set_path (SoupURI *uri,
83 const char *soup_uri_get_query (SoupURI *uri);
84 void soup_uri_set_query (SoupURI *uri,
86 void soup_uri_set_query_from_form (SoupURI *uri,
88 void soup_uri_set_query_from_fields (SoupURI *uri,
89 const char *first_field,
90 ...) G_GNUC_NULL_TERMINATED;
91 const char *soup_uri_get_fragment (SoupURI *uri);
92 void soup_uri_set_fragment (SoupURI *uri,
93 const char *fragment);
95 SoupURI *soup_uri_copy_host (SoupURI *uri);
96 guint soup_uri_host_hash (gconstpointer key);
97 gboolean soup_uri_host_equal (gconstpointer v1,
100 #define SOUP_URI_IS_VALID(uri) ((uri) && (uri)->scheme && (uri)->path)
101 #define SOUP_URI_VALID_FOR_HTTP(uri) ((uri) && ((uri)->scheme == SOUP_URI_SCHEME_HTTP || (uri)->scheme == SOUP_URI_SCHEME_HTTPS) && (uri)->host && (uri)->path)
105 #endif /*SOUP_URI_H*/