/** * * GMythURI utils * - Extracts and parses a URI char string, in according with the RFC 2396 * [http://www.ietf.org/rfc/rfc2396.txt] * * @author Rosfran Borges (rosfran.borges@indt.org.br) * */ #ifndef _GMYTH_URI_H_ #define _GMYTH_URI_H_ #include /**************************************** * Define ****************************************/ #define GMYTH_URI_KNKOWN_PORT (-1) #define GMYTH_URI_DEFAULT_HTTP_PORT 80 #define GMYTH_URI_DEFAULT_FTP_PORT 21 #define GMYTH_URI_DEFAULT_PATH "/" #define GMYTH_URI_MAXLEN 256 #define GMYTH_URI_PROTOCOL_DELIM "://" #define GMYTH_URI_USER_DELIM "@" #define GMYTH_URI_COLON_DELIM ":" #define GMYTH_URI_SLASH_DELIM "/" #define GMYTH_URI_SBLACET_DELIM "[" #define GMYTH_URI_EBLACET_DELIM "]" #define GMYTH_URI_SHARP_DELIM "#" #define GMYTH_URI_QUESTION_DELIM "?" #define GMYTH_URI_ESCAPING_CHAR "%" #define GMYTH_URI_PROTOCOL_MYTH "myth" #define GMYTH_URI_PROTOCOL_HTTP "http" #define GMYTH_URI_PROTOCOL_FTP "ftp" /**************************************** * Data Type ****************************************/ typedef struct _GMythURI { GString *uri; GString *host; gint port; GString *protocol; GString *path; GString *fragment; GString *user; GString *password; GString *query; } GMythURI; const GMythURI *gmyth_uri_new( gchar *value ); #define gmyth_uri_gethost(urip) (urip->host->str) #define gmyth_uri_getport(urip) (urip->port) #define gmyth_uri_getprotocol(urip) (urip->protocol->str) #define gmyth_uri_getpath(urip) (urip->path->str) #endif