author | rosfran |
Wed Sep 27 00:08:03 2006 +0100 (2006-09-27) | |
branch | trunk |
changeset 17 | b45e9fe9f593 |
parent 3 | 265cdb1c59e3 |
permissions | -rwxr-xr-x |
leo_sobral@2 | 1 |
/** |
leo_sobral@2 | 2 |
* |
leo_sobral@2 | 3 |
* MythURI 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 |
|
leo_sobral@2 | 11 |
#ifndef _MYTH_URI_H_ |
leo_sobral@2 | 12 |
#define _MYTH_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 |
|
leo_sobral@2 | 20 |
#define MYTH_URI_KNKOWN_PORT (-1) |
leo_sobral@2 | 21 |
#define MYTH_URI_DEFAULT_HTTP_PORT 80 |
leo_sobral@2 | 22 |
#define MYTH_URI_DEFAULT_FTP_PORT 21 |
leo_sobral@2 | 23 |
#define MYTH_URI_DEFAULT_PATH "/" |
leo_sobral@2 | 24 |
#define MYTH_URI_MAXLEN 256 |
leo_sobral@2 | 25 |
|
leo_sobral@2 | 26 |
#define MYTH_URI_PROTOCOL_DELIM "://" |
leo_sobral@2 | 27 |
#define MYTH_URI_USER_DELIM "@" |
leo_sobral@2 | 28 |
#define MYTH_URI_COLON_DELIM ":" |
leo_sobral@2 | 29 |
#define MYTH_URI_SLASH_DELIM "/" |
leo_sobral@2 | 30 |
#define MYTH_URI_SBLACET_DELIM "[" |
leo_sobral@2 | 31 |
#define MYTH_URI_EBLACET_DELIM "]" |
leo_sobral@2 | 32 |
#define MYTH_URI_SHARP_DELIM "#" |
leo_sobral@2 | 33 |
#define MYTH_URI_QUESTION_DELIM "?" |
leo_sobral@2 | 34 |
#define MYTH_URI_ESCAPING_CHAR "%" |
leo_sobral@2 | 35 |
|
leo_sobral@2 | 36 |
#define MYTH_URI_PROTOCOL_MYTH "myth" |
leo_sobral@2 | 37 |
#define MYTH_URI_PROTOCOL_HTTP "http" |
leo_sobral@2 | 38 |
#define MYTH_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 |
|
leo_sobral@2 | 44 |
typedef struct _MythURI { |
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; |
leo_sobral@2 | 54 |
} MythURI; |
leo_sobral@2 | 55 |
|
leo_sobral@2 | 56 |
const MythURI *myth_uri_new( gchar *value ); |
leo_sobral@2 | 57 |
|
leo_sobral@2 | 58 |
#define myth_uri_gethost(urip) (urip->host->str) |
leo_sobral@2 | 59 |
#define myth_uri_getport(urip) (urip->port) |
leo_sobral@2 | 60 |
#define myth_uri_getprotocol(urip) (urip->protocol->str) |
leo_sobral@2 | 61 |
#define myth_uri_getpath(urip) (urip->path->str) |
leo_sobral@2 | 62 |
|
leo_sobral@2 | 63 |
#endif |