1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 /* Copyright (C) 2002-2004 Novell, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public
7 * License as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 * This program takes account URL as input and dups E2KUri structure
34 #include "test-utils.h"
36 const char *test_program_name = "urltest";
39 dump_uri (E2kUri *euri) {
42 printf ("URI contents \n");
43 printf ("==================== \n");
46 printf("Protocol : %s \n", euri->protocol);
48 printf ("Protocol : NULL \n");
50 printf("User : %s \n", euri->user);
52 printf ("User : NULL \n");
54 printf("Domain : %s \n", euri->domain);
56 printf ("Domain : NULL \n");
58 printf("Authmech : %s \n", euri->authmech);
60 printf ("Authmech : NULL \n");
62 printf("Password : %s \n", euri->passwd);
64 printf ("Password : NULL \n");
66 printf("Host : %s \n", euri->host);
68 printf ("Host : NULL \n");
70 printf("Port : %d \n", euri->port);
72 printf ("Port : NULL \n");
74 printf("Path : %s \n", euri->path);
76 printf ("Path : NULL \n");
78 printf("\nParams : \n");
79 temp = e2k_uri_get_param (euri, "ad_server");
80 if (temp) printf ("\tAd server = %s\n", temp);
81 else printf ("\tAd server = NULL \n");
83 temp = e2k_uri_get_param (euri, "ad_limit");
84 if (temp) printf ("\tAd Limit = %s\n", temp);
85 else printf ("\tAd Limit = NULL\n");
87 temp = e2k_uri_get_param (euri, "passwd_exp_warn_period");
88 if (temp) printf ("\tPasswd expiry warn period = %s\n", temp);
89 else printf ("\tPasswd expiry warn period = NULL \n");
91 temp = e2k_uri_get_param (euri, "offline_sync");
92 if (temp) printf ("\tOffline Sync = %s\n", temp);
93 else printf ("\tOffline Sync = NULL \n");
95 temp = e2k_uri_get_param (euri, "owa_path");
96 if (temp) printf ("\tOwa path = %s\n", temp);
97 else printf ("\tOwa path = NULL \n");
99 temp = e2k_uri_get_param (euri, "pf_server");
100 if (temp) printf ("\tPf server = %s\n", temp);
101 else printf ("\tPf server = NULL \n");
103 temp = e2k_uri_get_param (euri, "use_ssl");
104 if (temp) printf ("\tSSL = %s\n", temp);
105 else printf ("\tSSL = NULL\n");
107 temp = e2k_uri_get_param (euri, "mailbox");
108 if (temp) printf ("\tMailbox = %s\n", temp);
109 else printf ("\tMailbox = NULL \n");
111 temp = e2k_uri_get_param (euri, "filter");
112 if (temp) printf ("\tFilter = %s\n", temp);
113 else printf ("\tFilter = NULL \n");
115 temp = e2k_uri_get_param (euri, "filter_junk");
116 if (temp) printf ("\tFilter junk = %s\n", temp);
117 else printf ("\tFilter junk = NULL \n");
119 temp = e2k_uri_get_param (euri, "filter_junk_inbox");
120 if (temp) printf ("\tFilter junk inbox = %s\n", temp);
121 else printf ("\tFilter junk inbox = NULL \n");
123 temp = e2k_uri_get_param (euri, "owa_protocol");
124 if (temp) printf ("\tOwa protocol = %s\n", temp);
125 else printf ("\tOwa protocol = NULL \n");
127 temp = e2k_uri_get_param (euri, "owa_url");
128 if (temp) printf ("\tOwa url = %s\n", temp);
129 else printf ("\tOwa url = NULL \n");
132 printf ("Params : NULL \n");
134 printf("Query : %s \n", euri->query);
136 printf ("Query : NULL \n");
138 printf("Fragment : %s \n", euri->fragment);
140 printf ("Fragment : NULL \n");
144 test_main (int argc, char **argv)
150 fprintf (stderr, "Usage: %s url \n", argv[0]);
155 euri = e2k_uri_new (url);