summaryrefslogtreecommitdiffstats
path: root/nanohttp/nanohttp-url.h
diff options
context:
space:
mode:
Diffstat (limited to 'nanohttp/nanohttp-url.h')
-rw-r--r--nanohttp/nanohttp-url.h87
1 files changed, 35 insertions, 52 deletions
diff --git a/nanohttp/nanohttp-url.h b/nanohttp/nanohttp-url.h
index 6e72749..8b07fa7 100644
--- a/nanohttp/nanohttp-url.h
+++ b/nanohttp/nanohttp-url.h
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: nanohttp-url.h,v 1.3 2006/12/11 08:13:19 m0gg Exp $
+ * $Id: nanohttp-url.h,v 1.4 2007/11/03 22:40:15 m0gg Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -24,23 +24,27 @@
#ifndef __nanohttp_url_h
#define __nanohttp_url_h
-/**
+/** @file nanohttp-url.h URL handling
*
- * URL errors
+ * @defgroup NANOHTTP_URL URL handling
+ * @ingroup NANOHTTP
*
*/
+/*@{*/
+
+/** URL errors
+ */
+/**@{*/
#define URL_ERROR 1100
#define URL_ERROR_UNKNOWN_PROTOCOL (URL_ERROR + 1)
#define URL_ERROR_NO_PROTOCOL (URL_ERROR + 2)
#define URL_ERROR_NO_HOST (URL_ERROR + 3)
+/**@}*/
-/**
- *
- * The protocol types in enumeration format. Used in some other nanohttp objects
- * like hurl_t.
+/** The protocol types in enumeration format. Used in some other
+ * nanohttp objects like hurl_t.
*
* @see hurl_t
- *
*/
typedef enum _hprotocol
{
@@ -48,58 +52,39 @@ typedef enum _hprotocol
PROTOCOL_HTTPS
} hprotocol_t;
-/**
+/** The URL object. A representation of an URL like:
*
- * The URL object. A representation of an URL like:
- *
- * [protocol]://[user]@[host]:[port]/[context]['#' fragment]['?' query]
+ @verbatim
+ [protocol]://[user]@[host]:[port]/[context]['#' fragment]['?' query]
+ @endverbatim
*
* @see http://www.ietf.org/rfc/rfc2396.txt
- *
*/
struct hurl_t
{
- /**
- *
- * The transfer protocol. Note that only PROTOCOL_HTTP and PROTOCOL_HTTPS are
- * supported by nanohttp.
- *
- */
- hprotocol_t protocol;
-
- /**
- *
- * The port number. If no port number was given in the URL, one of the default
- * port numbers will be selected:
- * - HTTP_DEFAULT_PORT
- * - HTTPS_DEFAULT_PORT
- *
- */
- unsigned short port;
-
- /**
- *
- * The hostname
- *
- */
- char *host;
-
- /**
- *
- * The string after the hostname.
- *
- */
- char *context;
+ hprotocol_t protocol; /**< The transfer protocol. Note that only
+ - PROTOCOL_HTTP and
+ - PROTOCOL_HTTPS
+ are supported by nanohttp. */
+ unsigned short port; /**< The port number. If no port number was given
+ in the URL, one of the default port numbers
+ will be selected:
+ - HTTP_DEFAULT_PORT
+ - HTTPS_DEFAULT_PORT */
+ char *host; /**< The hostname */
+ char *context; /** The string after the hostname. */
};
#ifdef __cplusplus
extern "C" {
#endif
-/**
+/** This function parses the given 'urlstr' and fills the given hurl_t
+ * object. Parse an URI
*
- * Parses the given 'urlstr' and fills the given hurl_t object.
- * Parse an URI URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
+ @verbatim
+ URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
+ @endverbatim
*
* @param obj the destination URL object to fill
* @param url the URL in string format
@@ -108,16 +93,12 @@ extern "C" {
* - URL_ERROR_UNKNOWN_PROTOCOL
* - URL_ERROR_NO_PROTOCOL
* - URL_ERROR_NO_HOST
- *
*/
extern herror_t hurl_parse(struct hurl_t * obj, const char *url);
-/**
- *
- * Frees the resources within a url and the url itself.
+/** This function frees the resources within a url and the url itself.
*
* @param url pointer to an hurl_t
- *
*/
extern void hurl_free(struct hurl_t *url);
@@ -125,4 +106,6 @@ extern void hurl_free(struct hurl_t *url);
}
#endif
+/**@}*/
+
#endif