xref: /PHP-5.5/ext/spl/spl_exceptions.c (revision 73c1be26)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 5                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2015 The PHP Group                                |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP 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.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Authors: Marcus Boerger <helly@php.net>                              |
16    +----------------------------------------------------------------------+
17  */
18 
19 /* $Id$ */
20 
21 #ifdef HAVE_CONFIG_H
22 # include "config.h"
23 #endif
24 
25 #include "php.h"
26 #include "php_ini.h"
27 #include "ext/standard/info.h"
28 #include "zend_interfaces.h"
29 #include "zend_exceptions.h"
30 
31 #include "php_spl.h"
32 #include "spl_functions.h"
33 #include "spl_engine.h"
34 #include "spl_exceptions.h"
35 
36 PHPAPI zend_class_entry *spl_ce_LogicException;
37 PHPAPI zend_class_entry *spl_ce_BadFunctionCallException;
38 PHPAPI zend_class_entry *spl_ce_BadMethodCallException;
39 PHPAPI zend_class_entry *spl_ce_DomainException;
40 PHPAPI zend_class_entry *spl_ce_InvalidArgumentException;
41 PHPAPI zend_class_entry *spl_ce_LengthException;
42 PHPAPI zend_class_entry *spl_ce_OutOfRangeException;
43 PHPAPI zend_class_entry *spl_ce_RuntimeException;
44 PHPAPI zend_class_entry *spl_ce_OutOfBoundsException;
45 PHPAPI zend_class_entry *spl_ce_OverflowException;
46 PHPAPI zend_class_entry *spl_ce_RangeException;
47 PHPAPI zend_class_entry *spl_ce_UnderflowException;
48 PHPAPI zend_class_entry *spl_ce_UnexpectedValueException;
49 
50 #define spl_ce_Exception zend_exception_get_default(TSRMLS_C)
51 
52 /* {{{ PHP_MINIT_FUNCTION(spl_exceptions) */
PHP_MINIT_FUNCTION(spl_exceptions)53 PHP_MINIT_FUNCTION(spl_exceptions)
54 {
55     REGISTER_SPL_SUB_CLASS_EX(LogicException,           Exception,        NULL, NULL);
56     REGISTER_SPL_SUB_CLASS_EX(BadFunctionCallException, LogicException,   NULL, NULL);
57     REGISTER_SPL_SUB_CLASS_EX(BadMethodCallException,   BadFunctionCallException,   NULL, NULL);
58     REGISTER_SPL_SUB_CLASS_EX(DomainException,          LogicException,   NULL, NULL);
59     REGISTER_SPL_SUB_CLASS_EX(InvalidArgumentException, LogicException,   NULL, NULL);
60     REGISTER_SPL_SUB_CLASS_EX(LengthException,          LogicException,   NULL, NULL);
61     REGISTER_SPL_SUB_CLASS_EX(OutOfRangeException,      LogicException,   NULL, NULL);
62 
63     REGISTER_SPL_SUB_CLASS_EX(RuntimeException,         Exception,        NULL, NULL);
64     REGISTER_SPL_SUB_CLASS_EX(OutOfBoundsException,     RuntimeException, NULL, NULL);
65     REGISTER_SPL_SUB_CLASS_EX(OverflowException,        RuntimeException, NULL, NULL);
66     REGISTER_SPL_SUB_CLASS_EX(RangeException,           RuntimeException, NULL, NULL);
67     REGISTER_SPL_SUB_CLASS_EX(UnderflowException,       RuntimeException, NULL, NULL);
68     REGISTER_SPL_SUB_CLASS_EX(UnexpectedValueException, RuntimeException, NULL, NULL);
69 
70 	return SUCCESS;
71 }
72 /* }}} */
73 
74 /*
75  * Local variables:
76  * tab-width: 4
77  * c-basic-offset: 4
78  * End:
79  * vim600: fdm=marker
80  * vim: noet sw=4 ts=4
81  */
82