2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2014, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
13 #ifndef PHP_HTTP_EXCEPTION_H
14 #define PHP_HTTP_EXCEPTION_H
16 /* short hand for zend_throw_exception_ex */
17 #define php_http_throw(e, ...) \
18 zend_throw_exception_ex(php_http_get_exception_ ##e## _class_entry(), 0, __VA_ARGS__)
20 /* wrap a call with replaced zend_error_handling */
21 #define php_http_expect(test, e, fail) \
23 zend_error_handling __zeh; \
24 zend_replace_error_handling(EH_THROW, php_http_get_exception_ ##e## _class_entry(), &__zeh); \
25 if (UNEXPECTED(!(test))) { \
26 zend_restore_error_handling(&__zeh); \
29 zend_restore_error_handling(&__zeh); \
32 PHP_HTTP_API zend_class_entry
*php_http_get_exception_interface_class_entry(void);
33 PHP_HTTP_API zend_class_entry
*php_http_get_exception_runtime_class_entry(void);
34 PHP_HTTP_API zend_class_entry
*php_http_get_exception_unexpected_val_class_entry(void);
35 PHP_HTTP_API zend_class_entry
*php_http_get_exception_bad_method_call_class_entry(void);
36 PHP_HTTP_API zend_class_entry
*php_http_get_exception_invalid_arg_class_entry(void);
37 PHP_HTTP_API zend_class_entry
*php_http_get_exception_bad_header_class_entry(void);
38 PHP_HTTP_API zend_class_entry
*php_http_get_exception_bad_url_class_entry(void);
39 PHP_HTTP_API zend_class_entry
*php_http_get_exception_bad_message_class_entry(void);
40 PHP_HTTP_API zend_class_entry
*php_http_get_exception_bad_conversion_class_entry(void);
41 PHP_HTTP_API zend_class_entry
*php_http_get_exception_bad_querystring_class_entry(void);
43 PHP_MINIT_FUNCTION(http_exception
);
52 * vim600: noet sw=4 ts=4 fdm=marker
53 * vim<600: noet sw=4 ts=4