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