gst-plugins-mythtv/src/gmyth_uri.h
author rosfran
Mon Oct 23 20:02:26 2006 +0100 (2006-10-23)
branchtrunk
changeset 43 c9e53d7250f8
parent 13 f3cdc7844178
permissions -rwxr-xr-x
[svn r44] Some fixes.
     1 /**
     2  *
     3  *	GMythURI utils
     4  *  - Extracts and parses a URI char string, in according with the RFC 2396 
     5  *    [http://www.ietf.org/rfc/rfc2396.txt]
     6  *
     7  * @author Rosfran Borges (rosfran.borges@indt.org.br)
     8  * 
     9  */
    10 
    11 #ifndef _GMYTH_URI_H_
    12 #define _GMYTH_URI_H_
    13 
    14 #include <glib.h>
    15 
    16 /****************************************
    17 * Define
    18 ****************************************/
    19 
    20 #define GMYTH_URI_KNKOWN_PORT (-1)
    21 #define GMYTH_URI_DEFAULT_HTTP_PORT 80
    22 #define GMYTH_URI_DEFAULT_FTP_PORT 21
    23 #define GMYTH_URI_DEFAULT_PATH "/"
    24 #define GMYTH_URI_MAXLEN 256
    25 
    26 #define GMYTH_URI_PROTOCOL_DELIM "://"
    27 #define GMYTH_URI_USER_DELIM "@"
    28 #define GMYTH_URI_COLON_DELIM ":"
    29 #define GMYTH_URI_SLASH_DELIM "/"
    30 #define GMYTH_URI_SBLACET_DELIM "["
    31 #define GMYTH_URI_EBLACET_DELIM "]"
    32 #define GMYTH_URI_SHARP_DELIM "#"
    33 #define GMYTH_URI_QUESTION_DELIM "?"
    34 #define GMYTH_URI_ESCAPING_CHAR "%"
    35 
    36 #define GMYTH_URI_PROTOCOL_MYTH "myth"
    37 #define GMYTH_URI_PROTOCOL_HTTP "http"
    38 #define GMYTH_URI_PROTOCOL_FTP "ftp"
    39 
    40 /****************************************
    41 * Data Type
    42 ****************************************/
    43 
    44 typedef struct _GMythURI {
    45 	GString *uri;
    46 	GString *host;
    47 	gint port;
    48 	GString *protocol;
    49 	GString *path;
    50 	GString *fragment;
    51 	GString *user;
    52 	GString *password;
    53 	GString *query;
    54 } GMythURI;
    55 
    56 const GMythURI *gmyth_uri_new( gchar *value );
    57 
    58 #define gmyth_uri_gethost(urip) (urip->host->str)
    59 #define gmyth_uri_getport(urip) (urip->port)
    60 #define gmyth_uri_getprotocol(urip) (urip->protocol->str)
    61 #define gmyth_uri_getpath(urip) (urip->path->str)
    62 
    63 #endif