Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

url.h

Go to the documentation of this file.
00001 /*
00002  * $Id: url.h,v 1.6 2005/09/30 15:07:39 cbiere Exp $
00003  *
00004  * Copyright (c) 2002-2003, Raphael Manfredi
00005  *
00006  *----------------------------------------------------------------------
00007  * This file is part of gtk-gnutella.
00008  *
00009  *  gtk-gnutella is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  gtk-gnutella is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with gtk-gnutella; if not, write to the Free Software
00021  *  Foundation, Inc.:
00022  *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *----------------------------------------------------------------------
00024  */
00025 
00036 #ifndef _url_h_
00037 #define _url_h_
00038 
00039 #include <glib.h>
00040 
00044 typedef struct {
00045     GHashTable *params;     
00046     gint count;             
00047 } url_params_t;
00048 
00049 #define url_params_count(x) ((x)->count)
00050 
00051 typedef enum {
00052     URL_POLICY_ALLOW_IP_AS_HOST     = (1 << 0),
00053     URL_POLICY_ALLOW_LOCAL_HOSTS    = (1 << 1),
00054     URL_POLICY_ALLOW_ANY_PORT       = (1 << 2),
00055     URL_POLICY_ALLOW_STATIC_FILES   = (1 << 3),
00056     URL_POLICY_ALLOW_ANY_CHAR       = (1 << 4),
00057 
00058     URL_POLICY_GWC_RULES            = 0 
00059 } url_policy_t;
00060 
00061 /*
00062  * Public interface.
00063  */
00064 
00065 gchar *url_escape(const gchar *url);
00066 gchar *url_escape_query(const gchar *url);
00067 gint url_escape_into(const gchar *url, gchar *target, gint len);
00068 gchar *url_escape_cntrl(gchar *url);
00069 gchar *url_unescape(gchar *url, gboolean inplace);
00070 
00071 url_params_t *url_params_parse(gchar *query);
00072 const gchar *url_params_get(url_params_t *up, const gchar *name);
00073 void url_params_free(url_params_t *up);
00074 gchar *url_normalize(gchar *url, url_policy_t pol);
00075 
00076 #endif  /* _url_h_ */
00077 
00078 /* vi: set ts=4 sw=4 cindent: */
00079 

Generated on Sun Feb 12 10:49:58 2006 for Gtk-Gnutella by doxygen 1.3.6