af840465c116e035ce39640223c5ef875d4b0a11
[m6w6/ext-http] / http_exception_object.c
1 /*
2 +----------------------------------------------------------------------+
3 | PECL :: http |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.0 of the PHP license, that |
6 | is bundled with this package in the file LICENSE, and is available |
7 | through the world-wide-web at http://www.php.net/license/3_0.txt. |
8 | If you did not receive a copy of the PHP license and are unable to |
9 | obtain it through the world-wide-web, please send a note to |
10 | license@php.net so we can mail you a copy immediately. |
11 +----------------------------------------------------------------------+
12 | Copyright (c) 2004-2005 Michael Wallner <mike@php.net> |
13 +----------------------------------------------------------------------+
14 */
15
16 /* $Id$ */
17
18
19 #ifdef HAVE_CONFIG_H
20 # include "config.h"
21 #endif
22 #include "php.h"
23
24 #ifdef ZEND_ENGINE_2
25
26 #include "zend_exceptions.h"
27
28 #include "php_http.h"
29 #include "php_http_std_defs.h"
30 #include "php_http_exception_object.h"
31
32 zend_class_entry *http_exception_object_ce;
33 zend_function_entry http_exception_object_fe[] = {{NULL, NULL, NULL}};
34
35 void _http_exception_object_init(INIT_FUNC_ARGS)
36 {
37 HTTP_REGISTER_CLASS(HttpException, http_exception_object, zend_exception_get_default(), 0);
38
39 HTTP_LONG_CONSTANT("HTTP_E_UNKNOWN", HTTP_E_UNKOWN);
40 HTTP_LONG_CONSTANT("HTTP_E_PARSE", HTTP_E_PARSE);
41 HTTP_LONG_CONSTANT("HTTP_E_HEADER", HTTP_E_HEADER);
42 HTTP_LONG_CONSTANT("HTTP_E_OBUFFER", HTTP_E_OBUFFER);
43 HTTP_LONG_CONSTANT("HTTP_E_CURL", HTTP_E_CURL);
44 HTTP_LONG_CONSTANT("HTTP_E_ENCODE", HTTP_E_ENCODE);
45 HTTP_LONG_CONSTANT("HTTP_E_PARAM", HTTP_E_PARAM);
46 HTTP_LONG_CONSTANT("HTTP_E_URL", HTTP_E_URL);
47 HTTP_LONG_CONSTANT("HTTP_E_MSG", HTTP_E_MSG);
48 }
49
50 zend_class_entry *_http_exception_get_default()
51 {
52 return http_exception_object_ce;
53 }
54
55 zend_class_entry *_http_exception_get_for_code(long code)
56 {
57 return http_exception_object_ce;
58 }
59
60 #endif
61
62 /*
63 * Local variables:
64 * tab-width: 4
65 * c-basic-offset: 4
66 * End:
67 * vim600: noet sw=4 ts=4 fdm=marker
68 * vim<600: noet sw=4 ts=4
69 */
70