gst-plugins-mythtv/src/myth_uri.h
author rosfran
Wed Oct 18 23:45:17 2006 +0100 (2006-10-18)
branchtrunk
changeset 34 c71d37b93734
parent 3 265cdb1c59e3
permissions -rwxr-xr-x
[svn r35] Performance optimization.
     1 /**
     2  *
     3  *	MythURI 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 _MYTH_URI_H_
    12 #define _MYTH_URI_H_
    13 
    14 #include <glib.h>
    15 
    16 /****************************************
    17 * Define
    18 ****************************************/
    19 
    20 #define MYTH_URI_KNKOWN_PORT (-1)
    21 #define MYTH_URI_DEFAULT_HTTP_PORT 80
    22 #define MYTH_URI_DEFAULT_FTP_PORT 21
    23 #define MYTH_URI_DEFAULT_PATH "/"
    24 #define MYTH_URI_MAXLEN 256
    25 
    26 #define MYTH_URI_PROTOCOL_DELIM "://"
    27 #define MYTH_URI_USER_DELIM "@"
    28 #define MYTH_URI_COLON_DELIM ":"
    29 #define MYTH_URI_SLASH_DELIM "/"
    30 #define MYTH_URI_SBLACET_DELIM "["
    31 #define MYTH_URI_EBLACET_DELIM "]"
    32 #define MYTH_URI_SHARP_DELIM "#"
    33 #define MYTH_URI_QUESTION_DELIM "?"
    34 #define MYTH_URI_ESCAPING_CHAR "%"
    35 
    36 #define MYTH_URI_PROTOCOL_MYTH "myth"
    37 #define MYTH_URI_PROTOCOL_HTTP "http"
    38 #define MYTH_URI_PROTOCOL_FTP "ftp"
    39 
    40 /****************************************
    41 * Data Type
    42 ****************************************/
    43 
    44 typedef struct _MythURI {
    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 } MythURI;
    55 
    56 const MythURI *myth_uri_new( gchar *value );
    57 
    58 #define myth_uri_gethost(urip) (urip->host->str)
    59 #define myth_uri_getport(urip) (urip->port)
    60 #define myth_uri_getprotocol(urip) (urip->protocol->str)
    61 #define myth_uri_getpath(urip) (urip->path->str)
    62 
    63 #endif