URI parsing example
if (argc < 3) {
fprintf(stderr, "Missing arguments\n");
return EXIT_FAILURE;
}
fprintf(stderr,
"%s", status.
message);
goto err_exit;
}
if (strcmp(uri.
scheme, argv[2]) != 0) {
fprintf(stderr,
"Expected scheme %s does not match returned one %s",
argv[2],
goto err_exit;
}
if (strcmp(uri.
host, argv[3]) != 0) {
fprintf(
stderr,
"Expected host %s does not match returned one %s", argv[3], uri.
host);
goto err_exit;
}
if (uri.
port != atoi(argv[4])) {
fprintf(
stderr,
"Expected port %s does not match returned one %d", argv[2], uri.
port);
goto err_exit;
}
if (strcmp(uri.
path, argv[5]) != 0) {
fprintf(
stderr,
"Expected path %s does not match returned one %s", argv[5], uri.
path);
goto err_exit;
}
return EXIT_SUCCESS;
err_exit:
return EXIT_FAILURE;
}
int main(
int argc,
char **argv) {
}