X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_send_api.h;h=84a08588d2373c09672541fbd1400538cb38911e;hp=5b9e016946f49538ef62382347486aa9ff9fc9b5;hb=0d925a2820b9d75b8e32c451fd400863e51e22fe;hpb=1d37eec22d2a073acd8785431621c26c2312a246 diff --git a/php_http_send_api.h b/php_http_send_api.h index 5b9e016..84a0858 100644 --- a/php_http_send_api.h +++ b/php_http_send_api.h @@ -29,21 +29,23 @@ typedef enum { #define http_send_status(s) sapi_header_op(SAPI_HEADER_SET_STATUS, (void *) (s) TSRMLS_CC) #define http_send_header(n, v, r) _http_send_header_ex((n), strlen(n), (v), strlen(v), (r) TSRMLS_CC) -#define http_send_header_ex(n, nl, v, vl, r) _http_send_header_ex((n), (nl), (v), (vl), (r) TSRMLS_CC) -PHP_HTTP_API STATUS _http_send_header_ex(const char *name, size_t name_len, const char *value, size_t value_len, zend_bool replace TSRMLS_DC); +#define http_send_header_ex(n, nl, v, vl, r, s) _http_send_header_ex((n), (nl), (v), (vl), (r), (s) TSRMLS_CC) +PHP_HTTP_API STATUS _http_send_header_ex(const char *name, size_t name_len, const char *value, size_t value_len, zend_bool replace, char **sent_header TSRMLS_DC); #define http_send_header_string(h) _http_send_status_header_ex(0, (h), 1 TSRMLS_CC) #define http_send_header_string_ex(h, r) _http_send_status_header_ex(0, (h), (r) TSRMLS_CC) #define http_send_status_header(s, h) _http_send_status_header_ex((s), (h), 1 TSRMLS_CC) #define http_send_status_header_ex(s, h, r) _http_send_status_header_ex((s), (h), (r) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_status_header_ex(int status, const char *header, zend_bool replace TSRMLS_DC); -#define http_send_last_modified(t) _http_send_last_modified((t) TSRMLS_CC) -PHP_HTTP_API STATUS _http_send_last_modified(time_t t TSRMLS_DC); +#define http_send_last_modified(t) _http_send_last_modified_ex((t), NULL TSRMLS_CC) +#define http_send_last_modified_ex(t, s) _http_send_last_modified_ex((t), (s) TSRMLS_CC) +PHP_HTTP_API STATUS _http_send_last_modified_ex(time_t t, char **sent_header TSRMLS_DC); -#define http_send_etag(e, l) _http_send_etag((e), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_send_etag(const char *etag, size_t etag_len TSRMLS_DC); +#define http_send_etag(e, l) _http_send_etag_ex((e), (l), NULL TSRMLS_CC) +#define http_send_etag_ex(e, l, s) _http_send_etag_ex((e), (l), (s) TSRMLS_CC) +PHP_HTTP_API STATUS _http_send_etag_ex(const char *etag, size_t etag_len, char **sent_header TSRMLS_DC); -#define http_send_cache_control(cc, cl) http_send_header_ex("Cache-Control", lenof("Cache-Control"), (cc), (cl), 1) +#define http_send_cache_control(cc, cl) http_send_header_ex("Cache-Control", lenof("Cache-Control"), (cc), (cl), 1, NULL) #define http_send_content_type(c, l) _http_send_content_type((c), (l) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_content_type(const char *content_type, size_t ct_len TSRMLS_DC);