X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_send_api.h;h=5d75ee80abc6fc4117e470c5a56144d9bc3fd02e;hp=ff4e2c0d3c319bfc6b3939db17de871605853a7f;hb=aca5a5a21e4514707a71cfa69cc19ae50a78f5d3;hpb=fa1a275e2b5e1b9dfb5bcbf97b51ef2b568e433c diff --git a/php_http_send_api.h b/php_http_send_api.h index ff4e2c0..5d75ee8 100644 --- a/php_http_send_api.h +++ b/php_http_send_api.h @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2006, Michael Wallner | + | Copyright (c) 2004-2007, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -15,15 +15,16 @@ #ifndef PHP_HTTP_SEND_API_H #define PHP_HTTP_SEND_API_H -typedef enum { +typedef enum _http_send_mode_t { SEND_DATA, SEND_RSRC } http_send_mode; -#define HTTP_REDIRECT 302L -#define HTTP_REDIRECT_AUTO 0L +#define HTTP_REDIRECT 0L #define HTTP_REDIRECT_PERM 301L +#define HTTP_REDIRECT_FOUND 302L #define HTTP_REDIRECT_POST 303L +#define HTTP_REDIRECT_PROXY 305L #define HTTP_REDIRECT_TEMP 307L extern PHP_MINIT_FUNCTION(http_send); @@ -38,6 +39,14 @@ PHP_HTTP_API STATUS _http_send_header_ex(const char *name, size_t name_len, cons #define http_send_status_header_ex(s, h, l, r) _http_send_status_header_ex((s), (h), (l), (r) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_status_header_ex(int status, const char *header, size_t header_len, zend_bool replace TSRMLS_DC); +#define http_send_header_zval(n, z, r) http_send_header_zval_ex((n), strlen(n), (z), (r)) +#define http_send_header_zval_ex(n, l, z, r) _http_send_header_zval_ex((n), (l), (z), (r) TSRMLS_CC) +PHP_HTTP_API void _http_send_header_zval_ex(const char *name, size_t name_len, zval **val, zend_bool replace TSRMLS_DC); + +#define http_hide_header(h) http_hide_header_ex((h), strlen(h)) +#define http_hide_header_ex(h, l) _http_hide_header_ex((h), (l) TSRMLS_CC) +PHP_HTTP_API void _http_hide_header_ex(const char *name, size_t name_len 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); @@ -60,8 +69,8 @@ PHP_HTTP_API STATUS _http_send_content_disposition(const char *filename, size_t #define http_send_ex(d, s, m, nc) _http_send_ex((d), (s), (m), (nc) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_ex(const void *data, size_t data_size, http_send_mode mode, zend_bool no_cache TSRMLS_DC); -#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL), 1, 0) -#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL), 1, (nc)) +#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper_ex(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT), 1, 0) +#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper_ex(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT), 1, (nc)) #define http_send_stream(s) http_send_stream_ex((s), 0, 0) #define http_send_stream_ex(s, c, nc) _http_send_stream_ex((s), (c), (nc) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_stream_ex(php_stream *s, zend_bool close_stream, zend_bool no_cache TSRMLS_DC);