|
@@ -0,0 +1,22 @@
|
|
1
|
+#ifndef URL_H
|
|
2
|
+#define URL_H
|
|
3
|
+
|
|
4
|
+/*
|
|
5
|
+ * Information parsed from a URL string. "char *" pointers will point
|
|
6
|
+ * to the start of the relevant portion of the original URL string,
|
|
7
|
+ * which will have been modified by inserting terminating NULs at the
|
|
8
|
+ * appropriate points. Use unparse_url() if you want to get back the
|
|
9
|
+ * original string.
|
|
10
|
+ *
|
|
11
|
+ */
|
|
12
|
+struct url_info {
|
|
13
|
+ char *protocol;
|
|
14
|
+ char *host;
|
|
15
|
+ char *port;
|
|
16
|
+ char *file;
|
|
17
|
+};
|
|
18
|
+
|
|
19
|
+extern void parse_url ( struct url_info *info, char *url );
|
|
20
|
+extern char * unparse_url ( struct url_info *info );
|
|
21
|
+
|
|
22
|
+#endif /* URL_H */
|