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 void soup_uri_set_scheme (SoupURI *uri,
67 void soup_uri_set_user (SoupURI *uri,
69 void soup_uri_set_password (SoupURI *uri,
70 const char *password);
71 void soup_uri_set_host (SoupURI *uri,
73 void soup_uri_set_port (SoupURI *uri,
75 void soup_uri_set_path (SoupURI *uri,
77 void soup_uri_set_query (SoupURI *uri,
79 void soup_uri_set_query_from_form (SoupURI *uri,
81 void soup_uri_set_query_from_fields (SoupURI *uri,
82 const char *first_field,
83 ...) G_GNUC_NULL_TERMINATED;
84 void soup_uri_set_fragment (SoupURI *uri,
85 const char *fragment);
87 SoupURI *soup_uri_copy_host (SoupURI *uri);
88 guint soup_uri_host_hash (gconstpointer key);
89 gboolean soup_uri_host_equal (gconstpointer v1,
92 #define SOUP_URI_VALID_FOR_HTTP(uri) ((uri) && ((uri)->scheme == SOUP_URI_SCHEME_HTTP || (uri)->scheme == SOUP_URI_SCHEME_HTTPS) && (uri)->host && (uri)->path)