summaryrefslogtreecommitdiff
path: root/examples/url-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/url-parse.c')
-rw-r--r--examples/url-parse.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/examples/url-parse.c b/examples/url-parse.c
index 7c6b1c856..528df09ad 100644
--- a/examples/url-parse.c
+++ b/examples/url-parse.c
@@ -33,46 +33,46 @@ main ()
{
int rc;
- str[strlen (str) - 1] = '\0'; /* chop newline */
+ str[strlen (str) - 1] = '\0'; /* chop newline */
if (strspn (str, " \t") == strlen (str))
- continue; /* skip empty lines */
+ continue; /* skip empty lines */
if ((rc = url_create (&u, str)) != 0)
- {
- fprintf (stderr, "url_create %s ERROR: [%d] %s",
- str, rc, mu_errstring (rc));
- exit (1);
- }
+ {
+ fprintf (stderr, "url_create %s ERROR: [%d] %s",
+ str, rc, mu_errstring (rc));
+ exit (1);
+ }
if ((rc = url_parse (u)) != 0)
- {
- printf ("%s => FAILED: [%d] %s\n",
- str, rc, mu_errstring (rc));
- continue;
- }
+ {
+ printf ("%s => FAILED: [%d] %s\n",
+ str, rc, mu_errstring (rc));
+ continue;
+ }
printf ("%s => SUCCESS\n", str);
url_get_scheme (u, buffer, len, NULL);
- printf (" scheme <%s>\n", buffer);
+ printf (" scheme <%s>\n", buffer);
url_get_user (u, buffer, len, NULL);
- printf (" user <%s>\n", buffer);
+ printf (" user <%s>\n", buffer);
url_get_passwd (u, buffer, len, NULL);
- printf (" passwd <%s>\n", buffer);
+ printf (" passwd <%s>\n", buffer);
url_get_auth (u, buffer, len, NULL);
- printf (" auth <%s>\n", buffer);
+ printf (" auth <%s>\n", buffer);
url_get_host (u, buffer, len, NULL);
- printf (" host <%s>\n", buffer);
+ printf (" host <%s>\n", buffer);
url_get_port (u, &port);
- printf (" port %ld\n", port);
+ printf (" port %ld\n", port);
url_get_path (u, buffer, len, NULL);
- printf (" path <%s>\n", buffer);
+ printf (" path <%s>\n", buffer);
url_get_query (u, buffer, len, NULL);
- printf (" query <%s>\n", buffer);
+ printf (" query <%s>\n", buffer);
url_destroy (&u);

Return to:

Send suggestions and report system problems to the System administrator.