Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/murymi/url
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/murymi/url
- Owner: murymi
- Created: 2024-01-08T07:26:17.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-08T07:27:21.000Z (11 months ago)
- Last Synced: 2024-07-23T23:36:45.431Z (4 months ago)
- Language: C
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### example
```c
char *str = "http://hello.world:3000/foo?bar=foo#bar";
url *u = url_parse(url);
#include
#includeif(u == NULL) {
/* invalid url */
exit(1);
}assert(strcmp("http", u->scheme) == 0);
assert(strcmp("hello.world", u->address) == 0);
assert(strcmp("foo", u->path) == 0);
assert(strcmp("foo", map_get(u->params, "bar")) == 0);
assert(strcmp("bar", string_array_list_get(u->flags, 0)) == 0);
```