1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-url.h : utility functions to parse URLs */
6 * Bertrand Guiheneuf <bertrand@helixcode.com>
7 * Dan Winship <danw@ximian.com>
9 * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of version 2 of the GNU Lesser General Public
13 * License as published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
31 #include <camel/camel-types.h>
35 /* if this changes, remember to change camel_url_copy */
36 typedef struct _CamelURL {
49 #define CAMEL_URL_HIDE_PASSWORD (1 << 0)
50 #define CAMEL_URL_HIDE_PARAMS (1 << 1)
51 #define CAMEL_URL_HIDE_AUTH (1 << 2)
53 #define CAMEL_URL_HIDE_ALL (CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS | CAMEL_URL_HIDE_AUTH)
55 CamelURL *camel_url_new_with_base (CamelURL *base, const char *url_string);
56 CamelURL *camel_url_new (const char *url_string, CamelException *ex);
57 char *camel_url_to_string (CamelURL *url, guint32 flags);
58 void camel_url_free (CamelURL *url);
60 char *camel_url_encode (const char *part, const char *escape_extra);
61 void camel_url_decode (char *part);
62 char *camel_url_decode_path (const char *path);
64 /* for editing url's */
65 void camel_url_set_protocol (CamelURL *url, const char *protocol);
66 void camel_url_set_user (CamelURL *url, const char *user);
67 void camel_url_set_authmech (CamelURL *url, const char *authmech);
68 void camel_url_set_passwd (CamelURL *url, const char *passwd);
69 void camel_url_set_host (CamelURL *url, const char *host);
70 void camel_url_set_port (CamelURL *url, int port);
71 void camel_url_set_path (CamelURL *url, const char *path);
72 void camel_url_set_param (CamelURL *url, const char *name, const char *value);
73 void camel_url_set_query (CamelURL *url, const char *query);
74 void camel_url_set_fragment (CamelURL *url, const char *fragment);
76 const char *camel_url_get_param (CamelURL *url, const char *name);
78 /* for putting url's into hash tables */
79 guint camel_url_hash (const void *v);
80 int camel_url_equal(const void *v, const void *v2);
81 CamelURL *camel_url_copy(const CamelURL *in);
85 #endif /* URL_UTIL_H */