#include "ext/standard/url.h"
+extern PHP_MINIT_FUNCTION(http_url);
+
#define http_absolute_url(u) _http_absolute_url((u) TSRMLS_CC)
PHP_HTTP_API char *_http_absolute_url(const char *url TSRMLS_DC);
-#define http_build_url(o, n, p, s, l) _http_build_url((o), (n), (p), (s), (l) TSRMLS_CC)
-PHP_HTTP_API void _http_build_url(const php_url *old_url, const php_url *new_url, php_url **url_ptr, char **url_str, size_t *url_len TSRMLS_DC);
+#define HTTP_URL_REPLACE 0x000
+#define HTTP_URL_JOIN_PATH 0x001
+#define HTTP_URL_JOIN_QUERY 0x002
+#define HTTP_URL_STRIP_USER 0x004
+#define HTTP_URL_STRIP_PASS 0x008
+#define HTTP_URL_STRIP_AUTH 0x010
+#define HTTP_URL_STRIP_PORT 0x020
+#define HTTP_URL_STRIP_PATH 0x040
+#define HTTP_URL_STRIP_QUERY 0x080
+#define HTTP_URL_STRIP_FRAGMENT 0x100
+
+#define http_build_url(f, o, n, p, s, l) _http_build_url((f), (o), (n), (p), (s), (l) TSRMLS_CC)
+PHP_HTTP_API void _http_build_url(int flags, const php_url *old_url, const php_url *new_url, php_url **url_ptr, char **url_str, size_t *url_len TSRMLS_DC);
#define http_urlencode_hash(h, q) _http_urlencode_hash_ex((h), 1, NULL, 0, (q), NULL TSRMLS_CC)
#define http_urlencode_hash_ex(h, o, p, pl, q, ql) _http_urlencode_hash_ex((h), (o), (p), (pl), (q), (ql) TSRMLS_CC)