xref: /PHP-5.5/Zend/zend_exceptions.h (revision 73c1be26)
1 /*
2    +----------------------------------------------------------------------+
3    | Zend Engine                                                          |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 2.00 of the Zend license,     |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.zend.com/license/2_00.txt.                                |
11    | If you did not receive a copy of the Zend license and are unable to  |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@zend.com so we can mail you a copy immediately.              |
14    +----------------------------------------------------------------------+
15    | Authors: Andi Gutmans <andi@zend.com>                                |
16    |          Marcus Boerger <helly@php.net>                              |
17    |          Sterling Hughes <sterling@php.net>                          |
18    |          Zeev Suraski <zeev@zend.com>                                |
19    +----------------------------------------------------------------------+
20 */
21 
22 /* $Id$ */
23 
24 #ifndef ZEND_EXCEPTIONS_H
25 #define ZEND_EXCEPTIONS_H
26 
27 BEGIN_EXTERN_C()
28 
29 ZEND_API void zend_exception_set_previous(zval *exception, zval *add_previous TSRMLS_DC);
30 ZEND_API void zend_exception_save(TSRMLS_D);
31 ZEND_API void zend_exception_restore(TSRMLS_D);
32 
33 void zend_throw_exception_internal(zval *exception TSRMLS_DC);
34 
35 void zend_register_default_exception(TSRMLS_D);
36 
37 ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D);
38 ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D);
39 ZEND_API void zend_register_default_classes(TSRMLS_D);
40 
41 /* exception_ce   NULL or zend_exception_get_default() or a derived class
42  * message        NULL or the message of the exception */
43 ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC);
44 ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...);
45 ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
46 ZEND_API void zend_clear_exception(TSRMLS_D);
47 
48 ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC);
49 
50 extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
51 
52 /* show an exception using zend_error(severity,...), severity should be E_ERROR */
53 ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC);
54 
55 /* do not export, in php it's available thru spprintf directly */
56 int zend_spprintf(char **message, int max_len, const char *format, ...);
57 
58 END_EXTERN_C()
59 
60 #endif
61 
62 /*
63  * Local variables:
64  * tab-width: 4
65  * c-basic-offset: 4
66  * indent-tabs-mode: t
67  * End:
68  */
69