return url(buf);
}
-void php_http_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)
-{
- php_http_url_t *url = php_http_url_mod((const php_http_url_t *) old_url, (const php_http_url_t *) new_url, flags TSRMLS_CC);
-
- if (url_ptr) {
- *url_ptr = php_http_url_to_php_url(url);
- }
- if (url_str) {
- php_http_url_to_string(url, url_str, url_len, 0);
- }
-
- php_http_url_free(&url);
-}
-
#define url_isset(u,n) \
((u)&&(u)->n)
#define url_append(buf, append) do { \
PHP_HTTP_API php_http_url_t *php_http_url_parse(const char *str, size_t len, unsigned flags TSRMLS_DC);
PHP_HTTP_API php_http_url_t *php_http_url_parse_authority(const char *str, size_t len, unsigned flags TSRMLS_DC);
-/* deprecated */
-PHP_HTTP_API void php_http_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);
-/* use this instead */
PHP_HTTP_API php_http_url_t *php_http_url_mod(const php_http_url_t *old_url, const php_http_url_t *new_url, unsigned flags TSRMLS_DC);
PHP_HTTP_API php_http_url_t *php_http_url_copy(const php_http_url_t *url, zend_bool persistent);
PHP_HTTP_API php_http_url_t *php_http_url_from_struct(HashTable *ht);
static inline void php_http_url_argsep(const char **str, size_t *len TSRMLS_DC)
{
- if (SUCCESS != php_http_ini_entry(ZEND_STRL("arg_separator.output"), str, len, 0 TSRMLS_CC) || !*len) {
- *str = PHP_HTTP_URL_ARGSEP;
- *len = lenof(PHP_HTTP_URL_ARGSEP);
- }
-}
-
-static inline php_url *php_http_url_to_php_url(php_http_url_t *url)
-{
- php_url *purl = ecalloc(1, sizeof(*purl));
-
- if (url->scheme) purl->scheme = estrdup(url->scheme);
- if (url->pass) purl->pass = estrdup(url->pass);
- if (url->user) purl->user = estrdup(url->user);
- if (url->host) purl->host = estrdup(url->host);
- if (url->path) purl->path = estrdup(url->path);
- if (url->query) purl->query = estrdup(url->query);
- if (url->fragment) purl->fragment = estrdup(url->fragment);
-
- return purl;
+ php_http_ini_entry(ZEND_STRL("arg_separator.output"), str, len, 0 TSRMLS_CC);
}
static inline zend_bool php_http_url_is_empty(const php_http_url_t *url) {