[svn r328] Some fixes on program info, and some memory clean ups.
4 * @file gmyth/gmyth_uri.h
6 * @brief <p> GMythURI utils
7 * - Extracts and parses a URI char string, in according with the RFC 2396
8 * [http://www.ietf.org/rfc/rfc2396.txt]
10 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
11 * @author Rosfran Borges <rosfran.borges@indt.org.br>
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 #include <glib-object.h>
42 #define GMYTH_URI_TYPE (gmyth_uri_get_type ())
43 #define GMYTH_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_URI_TYPE, GMythURI))
44 #define GMYTH_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_URI_TYPE, GMythURIClass))
45 #define IS_GMYTH_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_URI_TYPE))
46 #define IS_GMYTH_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_URI_TYPE))
47 #define GMYTH_URI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_URI_TYPE, GMythURIClass))
49 typedef struct _GMythURI GMythURI;
50 typedef struct _GMythURIClass GMythURIClass;
52 /****************************************
54 ****************************************/
56 #define GMYTH_URI_KNKOWN_PORT (-1)
57 #define GMYTH_URI_DEFAULT_HTTP_PORT 80
58 #define GMYTH_URI_DEFAULT_FTP_PORT 21
59 #define GMYTH_URI_DEFAULT_PATH "/"
60 #define GMYTH_URI_MAXLEN 256
62 #define GMYTH_URI_PROTOCOL_DELIM "://"
63 #define GMYTH_URI_USER_DELIM "@"
64 #define GMYTH_URI_COLON_DELIM ":"
65 #define GMYTH_URI_SLASH_DELIM "/"
66 #define GMYTH_URI_SBLACET_DELIM "["
67 #define GMYTH_URI_EBLACET_DELIM "]"
68 #define GMYTH_URI_SHARP_DELIM "#"
69 #define GMYTH_URI_QUESTION_DELIM "?"
70 #define GMYTH_URI_E_DELIM "&"
71 #define GMYTH_URI_ESCAPING_CHAR "%"
73 #define GMYTH_URI_PROTOCOL_MYTH "myth"
74 #define GMYTH_URI_PROTOCOL_HTTP "http"
75 #define GMYTH_URI_PROTOCOL_FTP "ftp"
77 /****************************************
79 ****************************************/
83 GObjectClass parent_class;
105 GType gmyth_uri_get_type (void);
106 GMythURI* gmyth_uri_new (void);
107 GMythURI* gmyth_uri_new_with_value (const gchar *value);
108 gboolean gmyth_uri_is_equals ( GMythURI* uri1, GMythURI* uri2 );
109 gboolean gmyth_uri_is_livetv ( GMythURI* uri );
110 gint gmyth_uri_get_channel_num( GMythURI* uri );
111 gchar* gmyth_uri_get_channel_name( GMythURI* uri );
114 #define gmyth_uri_get_host(urip) ( urip->host != NULL ? urip->host->str : "" )
115 #define gmyth_uri_get_port(urip) ( urip->port )
116 #define gmyth_uri_get_protocol(urip) ( urip->protocol != NULL ? urip->protocol->str : "" )
117 #define gmyth_uri_get_path(urip) ( urip->path != NULL ? urip->path->str : "" )
118 #define gmyth_uri_get_user(urip) ( urip->user != NULL ? urip->user->str : "" )
119 #define gmyth_uri_get_password(urip) ( urip->password != NULL ? urip->password->str : "" )
120 #define gmyth_uri_get_fragment(urip) ( urip->fragment != NULL ? urip->fragment->str : "" )
121 #define gmyth_uri_get_query(urip) ( urip->query != NULL ? urip->query->str : "" )
125 #endif /* _GMYTH_URI_H_ */