878
|
1 /* GNet - Networking library
|
|
2 * Copyright (C) 2000-2001 David Helder, David Bolcsfoldi
|
|
3 *
|
|
4 * This library is free software; you can redistribute it and/or
|
|
5 * modify it under the terms of the GNU Library General Public
|
|
6 * License as published by the Free Software Foundation; either
|
|
7 * version 2 of the License, or (at your option) any later version.
|
|
8 *
|
|
9 * This library is distributed in the hope that it will be useful,
|
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
12 * Library General Public License for more details.
|
|
13 *
|
|
14 * You should have received a copy of the GNU Library General Public
|
|
15 * License along with this library; if not, write to the
|
|
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
17 * Boston, MA 02110-1301, USA.
|
|
18 */
|
|
19
|
|
20
|
|
21 #ifndef _GNET_URI_H
|
|
22 #define _GNET_URI_H
|
|
23
|
|
24 #include <glib.h>
|
|
25
|
|
26 #ifdef __cplusplus
|
|
27 extern "C" {
|
|
28 #endif /* __cplusplus */
|
|
29
|
|
30
|
|
31 /**
|
|
32 * GURI:
|
|
33 * @scheme: Scheme (or protocol)
|
|
34 * @userinfo: User info
|
|
35 * @hostname: Host name
|
|
36 * @port: Port number
|
|
37 * @path: Path
|
|
38 * @query: Query
|
|
39 * @fragment: Fragment
|
|
40 *
|
|
41 * The #GURI structure represents a URI. All fields in this
|
|
42 * structure are publicly readable.
|
|
43 *
|
|
44 **/
|
|
45 typedef struct _GURI GURI;
|
|
46
|
|
47 struct _GURI
|
|
48 {
|
|
49 char* scheme;
|
|
50 char* user;
|
|
51 char* passwd;
|
|
52 char* hostname;
|
|
53 gint port;
|
|
54 char* path;
|
|
55 char* query;
|
|
56 char* fragment;
|
|
57 };
|
|
58
|
|
59
|
|
60
|
|
61 GURI* gnet_uri_new (const char* uri);
|
|
62 GURI* gnet_uri_new_fields (const char* scheme, const char* hostname,
|
|
63 const gint port, const char* path);
|
|
64 GURI*
|
|
65 gnet_uri_new_fields_all (const char* scheme, const char* user,
|
|
66 const char* passwd, const char* hostname,
|
|
67 const gint port, const char* path,
|
|
68 const char* query, const char* fragment);
|
|
69 GURI* gnet_uri_clone (const GURI* uri);
|
|
70 void gnet_uri_delete (GURI* uri);
|
|
71
|
|
72 gboolean gnet_uri_equal (gconstpointer p1, gconstpointer p2);
|
|
73 guint gnet_uri_hash (gconstpointer p);
|
|
74
|
|
75 void gnet_uri_escape (GURI* uri);
|
|
76 void gnet_uri_unescape (GURI* uri);
|
|
77
|
|
78 char* gnet_uri_get_string (const GURI* uri);
|
|
79
|
|
80 void gnet_uri_set_scheme (GURI* uri, const char* scheme);
|
|
81 void gnet_uri_set_userinfo (GURI* uri, const char* user, const char* passwd);
|
|
82 void gnet_uri_set_hostname (GURI* uri, const char* hostname);
|
|
83 void gnet_uri_set_port (GURI* uri, gint port);
|
|
84 void gnet_uri_set_path (GURI* uri, const char* path);
|
|
85 void gnet_uri_set_query (GURI* uri, const char* query);
|
|
86 void gnet_uri_set_fragment (GURI* uri, const char* fragment);
|
|
87
|
|
88 #ifdef __cplusplus
|
|
89 }
|
|
90 #endif /* __cplusplus */
|
|
91
|
|
92 #endif /* _GNET_URI_H */
|