| Ximian Connector for Microsoft Exchange Programmer’s Reference Manual |
|---|
e2k-uri — URI utility routines
struct E2kUri; E2kUri* e2k_uri_new (constchar *uri_string);void e2k_uri_free (E2kUri *uri); constchar * e2k_uri_get_param (E2kUri *uri, constchar *name);void e2k_uri_decode (char *part);char * e2k_uri_encode (constchar *in,gboolean wss_encoding, constchar *extra_enc_chars);void e2k_uri_append_encoded (GString *str, constchar *in,gboolean wss_encoding, constchar *extra_enc_chars); constchar * e2k_uri_path (constchar *uri_string);char * e2k_uri_concat (constchar *uri_prefix, constchar *tail); constchar * e2k_uri_relative (constchar *uri_prefix, constchar *uri);
struct E2kUri {
char *protocol;
char *user;
char *domain;
char *authmech;
char *passwd;
char *host;
int port;
char *path;
GData *params;
char *query;
char *fragment;
};
E2kUri* e2k_uri_new (constchar *uri_string);
Parses uri_string.
| uri_string : | the URI |
| Returns : | a parsed E2kUri |
constchar * e2k_uri_get_param (E2kUri *uri, constchar *name);
Fetches a parameter from uri
| uri : | an E2kUri |
| name : | name of the parameter |
| Returns : | the value of name, or NULL if it is not set |
void e2k_uri_decode (char *part);
Undoes URI-escaping in part in-place.
| part : | a piece of a URI |
char * e2k_uri_encode (constchar *in,gboolean wss_encoding, constchar *extra_enc_chars);
Encodes URI-unsafe characters as in e2k_uri_append_encoded()
| in : | data to encode |
| wss_encoding : | |
| extra_enc_chars : | additional characters beyond the normal URI-reserved characters to encode when appending to str |
| Returns : | the encoded string |
void e2k_uri_append_encoded (GString *str, constchar *in,gboolean wss_encoding, constchar *extra_enc_chars);
Appends in to str, encoding URI-unsafe characters as needed (optionally including some Exchange-specific encodings).
When appending a path, you must append each segment separately; e2k_uri_append_encoded() will encode any "/"s passed in.
| str : | a GString containing part of a URI |
| in : | data to append to str |
| wss_encoding : | |
| extra_enc_chars : | additional characters beyond the normal URI-reserved characters to encode when appending to str |
constchar * e2k_uri_path (constchar *uri_string);
Returns the path component of uri_string, including the initial "/". (The return value is actually a pointer into the passed-in string, meaning this will only really work if the URI has no query/fragment/etc.)
| uri_string : | a well-formed absolute URI |
| Returns : | the path component of uri_string. |
char * e2k_uri_concat (constchar *uri_prefix, constchar *tail);
Constructs a new URI consisting of the concatenation of uri_prefix and tail. If uri_prefix does not end with a "/", one will be inserted between uri_prefix and tail.
| uri_prefix : | an absolute URI |
| tail : | a relative path |
| Returns : | the new URI |
constchar * e2k_uri_relative (constchar *uri_prefix, constchar *uri);
Returns a URI describing uri's relation to uri_prefix; either a relative URI consisting of the subpath of uri underneath uri_prefix, or all of uri if it is not a sub-uri of uri_prefix.
| uri_prefix : | an absolute URI |
| uri : | another URI, presumably a child of uri_prefix |
| Returns : | the relative URI |
| << e2k-autoconfig | test-utils >> |