added build rules for urltest command
[libmvfs.git] / cmd / urltest.c
blobf87cfe29652c5944703a714f2e7a4bbac633b462
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <mvfs/url.h>
6 int test_url(const char* url)
8 MVFS_URL* u = mvfs_url_parse(url);
9 printf("url: %s\n", u->url);
10 printf("type: %s\n", u->type);
11 printf("hostname: %s\n", u->hostname);
12 printf("port: %s\n", u->port);
13 printf("username: %s\n", u->username);
14 printf("secret: %s\n", u->secret);
15 printf("pathname: %s\n", u->pathname);
16 printf("error: %d\n", u->error);
17 printf("----\n");
18 printf("\n");
19 free(u);
22 int main(int argc, char* argv[])
24 if (!argc)
26 test_url("9p://localhost:999");
27 test_url("http://www.metux.de/");
28 test_url("http://foo@thur.de/");
29 test_url("ftp://foo:bar@ftpserv.foo.org/test/blah");
30 test_url("file:///");
31 test_url("file://");
32 test_url("fish://user:pass@server/blah/tmp/");
33 test_url("/var/tmp/foo/bar");
35 else
36 test_url(argv[1]);