This repository has been archived by the owner on Nov 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exception.h
66 lines (55 loc) · 3.4 KB
/
exception.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
+------------------------------------------------------------------------+
| Zephir Language |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2014 Zephir Team (http://www.zephir-lang.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to [email protected] so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Andres Gutierrez <[email protected]> |
| Eduar Carvajal <[email protected]> |
| Vladimir Kolesnikov <[email protected]> |
+------------------------------------------------------------------------+
*/
#ifndef ZEPHIR_KERNEL_EXCEPTIONS_H
#define ZEPHIR_KERNEL_EXCEPTIONS_H
#include "Zend/zend.h"
/** Exceptions */
#define ZEPHIR_THROW_EXCEPTION_STR(class_entry, message) \
do { \
zephir_throw_exception_string(class_entry, message, strlen(message) TSRMLS_CC); \
ZEPHIR_MM_RESTORE(); \
} while (0)
#define ZEPHIR_THROW_EXCEPTION_DEBUG_STR(class_entry, message, file, line) \
do { \
zephir_throw_exception_string_debug(class_entry, message, strlen(message), file, line TSRMLS_CC); \
ZEPHIR_MM_RESTORE(); \
} while (0)
#define ZEPHIR_THROW_EXCEPTION_ZVAL(class_entry, message) \
do { \
zephir_throw_exception_zval(class_entry, message TSRMLS_CC); \
ZEPHIR_MM_RESTORE(); \
} while (0)
#define ZEPHIR_THROW_EXCEPTION_DEBUG_ZVAL(class_entry, message, file, line) \
do { \
zephir_throw_exception_zval(class_entry, message, file, line TSRMLS_CC); \
ZEPHIR_MM_RESTORE(); \
} while (0)
#define ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(class_entry, message, file, line) zephir_throw_exception_string_debug(class_entry, message, strlen(message), file, line TSRMLS_CC)
#define ZEPHIR_THROW_EXCEPTION_STRW(class_entry, message) zephir_throw_exception_string(class_entry, message, strlen(message) TSRMLS_CC)
#define ZEPHIR_THROW_EXCEPTION_ZVALW(class_entry, message) zephir_throw_exception_zval(class_entry, message TSRMLS_CC)
#define ZEPHIR_THROW_EXCEPTION_DEBUG_ZVALW(class_entry, message, file, line) zephir_throw_exception_zval_debug(class_entry, message, file, line TSRMLS_CC)
/** Throw Exceptions */
void zephir_throw_exception(zval *object TSRMLS_DC);
void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line TSRMLS_DC);
void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *message, zend_uint message_len, const char *file, zend_uint line TSRMLS_DC);
void zephir_throw_exception_string(zend_class_entry *ce, const char *message, zend_uint message_len TSRMLS_DC);
void zephir_throw_exception_zval(zend_class_entry *ce, zval *message TSRMLS_DC);
void zephir_throw_exception_zval_debug(zend_class_entry *ce, zval *message, const char *file, zend_uint line TSRMLS_DC);
void zephir_throw_exception_internal(zval *exception TSRMLS_DC);
#endif /* ZEPHIR_KERNEL_EXCEPTIONS_H */