X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_buffer.h;h=93776d527c1677d573f22f2eba0671393d6b6714;hp=012c8cffb15cbd4968e8fe93cffd068076e278fe;hb=25f0c16244fc5f8b2c9d9bfddab8a541d2521789;hpb=9de008496a220c769a745cd1eead0a3b3d7d6cca diff --git a/php_http_buffer.h b/php_http_buffer.h index 012c8cf..93776d5 100644 --- a/php_http_buffer.h +++ b/php_http_buffer.h @@ -74,8 +74,6 @@ static inline void *estrndup(void *p, size_t s) #endif #define PHP_HTTP_BUFFER(p) ((php_http_buffer_t *) (p)) -#define PHP_HTTP_BUFFER_VAL(p) (PHP_HTTP_BUFFER(p))->data -#define PHP_HTTP_BUFFER_LEN(p) (PHP_HTTP_BUFFER(p))->used #define FREE_PHP_HTTP_BUFFER_PTR(STR) pefree(STR, STR->pmem) #define FREE_PHP_HTTP_BUFFER_VAL(STR) php_http_buffer_dtor(STR) @@ -83,16 +81,21 @@ static inline void *estrndup(void *p, size_t s) #define FREE_PHP_HTTP_BUFFER(free, STR) \ switch (free) \ { \ - case PHP_HTTP_BUFFER_FREE_NOT: break; \ - case PHP_HTTP_BUFFER_FREE_PTR: pefree(STR, STR->pmem); break; \ - case PHP_HTTP_BUFFER_FREE_VAL: php_http_buffer_dtor(STR); break; \ - case PHP_HTTP_BUFFER_FREE_ALL: \ - { \ - php_http_buffer_t *PTR = (STR); \ - php_http_buffer_free(&PTR); \ - } \ + case PHP_HTTP_BUFFER_FREE_NOT: \ + break; \ + case PHP_HTTP_BUFFER_FREE_PTR: \ + pefree(STR, STR->pmem); break; \ + break; \ + case PHP_HTTP_BUFFER_FREE_VAL: \ + php_http_buffer_dtor(STR); \ + break; \ + case PHP_HTTP_BUFFER_FREE_ALL: { \ + php_http_buffer_t *PTR = (STR); \ + php_http_buffer_free(&PTR); \ + break; \ + } \ + default:\ break; \ - default: break; \ } #define RETURN_PHP_HTTP_BUFFER_PTR(STR) RETURN_PHP_HTTP_BUFFER((STR), PHP_HTTP_BUFFER_FREE_PTR, 0)