removed awkward custom error handling and http\Object base class
[m6w6/ext-http] / php_http_version.c
index 45f7a30d9f03202073edf8805985856f0b01434e..4b80504cb7ad5e7be0a53b559a07c7f5383ab4f6 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "php_http_api.h"
 
-PHP_HTTP_API php_http_version_t *php_http_version_init(php_http_version_t *v, unsigned major, unsigned minor TSRMLS_DC)
+php_http_version_t *php_http_version_init(php_http_version_t *v, unsigned major, unsigned minor TSRMLS_DC)
 {
        if (!v) {
                v = emalloc(sizeof(*v));
@@ -24,35 +24,35 @@ PHP_HTTP_API php_http_version_t *php_http_version_init(php_http_version_t *v, un
        return v;
 }
 
-PHP_HTTP_API php_http_version_t *php_http_version_parse(php_http_version_t *v, const char *str TSRMLS_DC)
+php_http_version_t *php_http_version_parse(php_http_version_t *v, const char *str TSRMLS_DC)
 {
        php_http_version_t tmp;
        char separator = 0;
 
        if (3 != sscanf(str, "HTTP/%u%c%u", &tmp.major, &separator, &tmp.minor)
        &&      3 != sscanf(str, "%u%c%u", &tmp.major, &separator, &tmp.minor)) {
-               php_http_error(HE_WARNING, PHP_HTTP_E_MALFORMED_HEADERS, "Could not parse HTTP protocol version '%s'", str);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not parse HTTP protocol version '%s'", str);
                return NULL;
        }
 
        if (separator && separator != '.' && separator != ',') {
-               php_http_error(HE_NOTICE, PHP_HTTP_E_MALFORMED_HEADERS, "Non-standard version separator '%c' in HTTP protocol version '%s'", separator, str);
+               php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Non-standard version separator '%c' in HTTP protocol version '%s'", separator, str);
        }
 
        return php_http_version_init(v, tmp.major, tmp.minor TSRMLS_CC);
 }
 
-PHP_HTTP_API void php_http_version_to_string(php_http_version_t *v, char **str, size_t *len, const char *pre, const char *post TSRMLS_DC)
+void php_http_version_to_string(php_http_version_t *v, char **str, size_t *len, const char *pre, const char *post TSRMLS_DC)
 {
        *len = spprintf(str, 0, "%s%u.%u%s", pre ? pre : "", v->major, v->minor, post ? post : "");
 }
 
-PHP_HTTP_API void php_http_version_dtor(php_http_version_t *v)
+void php_http_version_dtor(php_http_version_t *v)
 {
        (void) v;
 }
 
-PHP_HTTP_API void php_http_version_free(php_http_version_t **v)
+void php_http_version_free(php_http_version_t **v)
 {
        if (*v) {
                php_http_version_dtor(*v);