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

url.h

Go to the documentation of this file.
00001 /*
00002  * $Id: url.h 13958 2007-06-24 04:31:11Z cbiere $
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 "common.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 gchar *url_escape_shell(const gchar *url);
00068 gchar *url_fix_escape(const gchar *url);
00069 gint url_escape_into(const gchar *url, gchar *target, gint len);
00070 gchar *url_escape_cntrl(const gchar *url);
00071 gchar *url_unescape(gchar *url, gboolean inplace);
00072 gchar *url_from_absolute_path(const gchar *path);
00073 
00074 url_params_t *url_params_parse(gchar *query);
00075 const gchar *url_params_get(url_params_t *up, const gchar *name);
00076 void url_params_free(url_params_t *up);
00077 gchar *url_normalize(gchar *url, url_policy_t pol);
00078 
00079 #endif  /* _url_h_ */
00080 
00081 /* vi: set ts=4 sw=4 cindent: */
00082 

Generated on Sat Jun 30 17:53:24 2007 for gtk-gnutella by  doxygen 1.3.9.1