gst-plugins-mythtv/src/gmyth_uri.h
branchtrunk
changeset 43 c9e53d7250f8
parent 13 f3cdc7844178
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gst-plugins-mythtv/src/gmyth_uri.h	Mon Oct 23 20:02:26 2006 +0100
     1.3 @@ -0,0 +1,63 @@
     1.4 +/**
     1.5 + *
     1.6 + *	GMythURI utils
     1.7 + *  - Extracts and parses a URI char string, in according with the RFC 2396 
     1.8 + *    [http://www.ietf.org/rfc/rfc2396.txt]
     1.9 + *
    1.10 + * @author Rosfran Borges (rosfran.borges@indt.org.br)
    1.11 + * 
    1.12 + */
    1.13 +
    1.14 +#ifndef _GMYTH_URI_H_
    1.15 +#define _GMYTH_URI_H_
    1.16 +
    1.17 +#include <glib.h>
    1.18 +
    1.19 +/****************************************
    1.20 +* Define
    1.21 +****************************************/
    1.22 +
    1.23 +#define GMYTH_URI_KNKOWN_PORT (-1)
    1.24 +#define GMYTH_URI_DEFAULT_HTTP_PORT 80
    1.25 +#define GMYTH_URI_DEFAULT_FTP_PORT 21
    1.26 +#define GMYTH_URI_DEFAULT_PATH "/"
    1.27 +#define GMYTH_URI_MAXLEN 256
    1.28 +
    1.29 +#define GMYTH_URI_PROTOCOL_DELIM "://"
    1.30 +#define GMYTH_URI_USER_DELIM "@"
    1.31 +#define GMYTH_URI_COLON_DELIM ":"
    1.32 +#define GMYTH_URI_SLASH_DELIM "/"
    1.33 +#define GMYTH_URI_SBLACET_DELIM "["
    1.34 +#define GMYTH_URI_EBLACET_DELIM "]"
    1.35 +#define GMYTH_URI_SHARP_DELIM "#"
    1.36 +#define GMYTH_URI_QUESTION_DELIM "?"
    1.37 +#define GMYTH_URI_ESCAPING_CHAR "%"
    1.38 +
    1.39 +#define GMYTH_URI_PROTOCOL_MYTH "myth"
    1.40 +#define GMYTH_URI_PROTOCOL_HTTP "http"
    1.41 +#define GMYTH_URI_PROTOCOL_FTP "ftp"
    1.42 +
    1.43 +/****************************************
    1.44 +* Data Type
    1.45 +****************************************/
    1.46 +
    1.47 +typedef struct _GMythURI {
    1.48 +	GString *uri;
    1.49 +	GString *host;
    1.50 +	gint port;
    1.51 +	GString *protocol;
    1.52 +	GString *path;
    1.53 +	GString *fragment;
    1.54 +	GString *user;
    1.55 +	GString *password;
    1.56 +	GString *query;
    1.57 +} GMythURI;
    1.58 +
    1.59 +const GMythURI *gmyth_uri_new( gchar *value );
    1.60 +
    1.61 +#define gmyth_uri_gethost(urip) (urip->host->str)
    1.62 +#define gmyth_uri_getport(urip) (urip->port)
    1.63 +#define gmyth_uri_getprotocol(urip) (urip->protocol->str)
    1.64 +#define gmyth_uri_getpath(urip) (urip->path->str)
    1.65 +
    1.66 +#endif