zend_exceptions.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Zend Engine |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1998-2016 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. /* $Id$ */
  22. #ifndef ZEND_EXCEPTIONS_H
  23. #define ZEND_EXCEPTIONS_H
  24. BEGIN_EXTERN_C()
  25. ZEND_API void zend_exception_set_previous(zval *exception, zval *add_previous TSRMLS_DC);
  26. ZEND_API void zend_exception_save(TSRMLS_D);
  27. ZEND_API void zend_exception_restore(TSRMLS_D);
  28. void zend_throw_exception_internal(zval *exception TSRMLS_DC);
  29. void zend_register_default_exception(TSRMLS_D);
  30. ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D);
  31. ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D);
  32. ZEND_API void zend_register_default_classes(TSRMLS_D);
  33. /* exception_ce NULL or zend_exception_get_default() or a derived class
  34. * message NULL or the message of the exception */
  35. ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC);
  36. ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...);
  37. ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
  38. ZEND_API void zend_clear_exception(TSRMLS_D);
  39. ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC);
  40. extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
  41. /* show an exception using zend_error(severity,...), severity should be E_ERROR */
  42. ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC);
  43. /* do not export, in php it's available thru spprintf directly */
  44. int zend_spprintf(char **message, int max_len, const char *format, ...);
  45. END_EXTERN_C()
  46. #endif
  47. /*
  48. * Local variables:
  49. * tab-width: 4
  50. * c-basic-offset: 4
  51. * indent-tabs-mode: t
  52. * End:
  53. */