root/src/jlog/php/php_jlog.h

Revision cc981f5c55100675865b6960135d70148d8585af, 5.1 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 3 years ago)

pull in jlog @ 52

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2005-2008, Message Systems, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  *    * Redistributions of source code must retain the above copyright
10  *      notice, this list of conditions and the following disclaimer.
11  *    * Redistributions in binary form must reproduce the above
12  *      copyright notice, this list of conditions and the following
13  *      disclaimer in the documentation and/or other materials provided
14  *      with the distribution.
15  *    * Neither the name Message Systems, Inc. nor the names
16  *      of its contributors may be used to endorse or promote products
17  *      derived from this software without specific prior written
18  *      permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32
33 #ifndef PHP_JLOG_H
34 #define PHP_JLOG_H
35
36 #ifdef  __cplusplus
37 extern "C" {
38 #endif
39
40 #ifdef HAVE_CONFIG_H
41 #include "config.h"
42 #endif
43
44 #include <php.h>
45
46 #ifdef HAVE_JLOG
47
48 #include <php_ini.h>
49 #include <SAPI.h>
50 #include <ext/standard/info.h>
51 #include <Zend/zend_extensions.h>
52 #ifdef  __cplusplus
53 } // extern "C"
54 #endif
55 #include <jlog.h>
56 #ifdef  __cplusplus
57 extern "C" {
58 #endif
59
60 extern zend_module_entry jlog_module_entry;
61 #define phpext_jlog_ptr &jlog_module_entry
62
63 #ifdef PHP_WIN32
64 #define PHP_JLOG_API __declspec(dllexport)
65 #else
66 #define PHP_JLOG_API
67 #endif
68
69 PHP_MINIT_FUNCTION(jlog);
70 PHP_MSHUTDOWN_FUNCTION(jlog);
71 PHP_RINIT_FUNCTION(jlog);
72 PHP_RSHUTDOWN_FUNCTION(jlog);
73 PHP_MINFO_FUNCTION(jlog);
74
75 #ifdef ZTS
76 #include "TSRM.h"
77 #endif
78
79 #define FREE_RESOURCE(resource) zend_list_delete(Z_LVAL_P(resource))
80
81 #define PROP_GET_LONG(name)    Z_LVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC))
82 #define PROP_SET_LONG(name, l) zend_update_property_long(_this_ce, _this_zval, #name, strlen(#name), l TSRMLS_CC)
83
84 #define PROP_GET_DOUBLE(name)    Z_DVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC))
85 #define PROP_SET_DOUBLE(name, d) zend_update_property_double(_this_ce, _this_zval, #name, strlen(#name), d TSRMLS_CC)
86
87 #define PROP_GET_STRING(name)    Z_STRVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC))
88 #define PROP_GET_STRLEN(name)    Z_STRLEN_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC))
89 #define PROP_SET_STRING(name, s) zend_update_property_string(_this_ce, _this_zval, #name, strlen(#name), s TSRMLS_CC)
90 #define PROP_SET_STRINGL(name, s, l) zend_update_property_string(_this_ce, _this_zval, #name, strlen(#name), s, l TSRMLS_CC)
91
92
93 PHP_METHOD(Jlog, __construct);
94 ZEND_BEGIN_ARG_INFO(Jlog____construct_args, 0)
95   ZEND_ARG_INFO(0, options)
96 ZEND_END_ARG_INFO()
97 PHP_METHOD(Jlog, add_subscriber);
98 ZEND_BEGIN_ARG_INFO(Jlog__add_subscriber_args, 0)
99   ZEND_ARG_INFO(0, subscriber)
100   ZEND_ARG_INFO(0, whence)
101 ZEND_END_ARG_INFO()
102 PHP_METHOD(Jlog, remove_subscriber);
103 ZEND_BEGIN_ARG_INFO(Jlog__remove_subscriber_args, 0)
104   ZEND_ARG_INFO(0, subscriber)
105 ZEND_END_ARG_INFO()
106 PHP_METHOD(Jlog, list_subscribers);
107 ZEND_BEGIN_ARG_INFO(Jlog__list_subscribers_args, 0)
108 ZEND_END_ARG_INFO()
109 PHP_METHOD(Jlog, alter_journal_size);
110 ZEND_BEGIN_ARG_INFO(Jlog__alter_journal_size_args, 0)
111   ZEND_ARG_INFO(0, size)
112 ZEND_END_ARG_INFO()
113 PHP_METHOD(Jlog, raw_size);
114 ZEND_BEGIN_ARG_INFO(Jlog__raw_size_args, 0)
115 ZEND_END_ARG_INFO()
116 PHP_METHOD(Jlog, close);
117 ZEND_BEGIN_ARG_INFO(Jlog__close_args, 0)
118 ZEND_END_ARG_INFO()
119 PHP_METHOD(Jlog_Writer, open);
120 ZEND_BEGIN_ARG_INFO(Jlog_Writer__open_args, 0)
121 ZEND_END_ARG_INFO()
122 PHP_METHOD(Jlog_Writer, write);
123 ZEND_BEGIN_ARG_INFO(Jlog_Writer__write_args, 0)
124   ZEND_ARG_INFO(0, buffer)
125 ZEND_END_ARG_INFO()
126 PHP_METHOD(Jlog_Reader, open);
127 ZEND_BEGIN_ARG_INFO(Jlog_Reader__open_args, 0)
128   ZEND_ARG_INFO(0, subscriber)
129 ZEND_END_ARG_INFO()
130 PHP_METHOD(Jlog_Reader, read);
131 ZEND_BEGIN_ARG_INFO(Jlog_Reader__read_args, 0)
132 ZEND_END_ARG_INFO()
133 PHP_METHOD(Jlog_Reader, checkpoint);
134 ZEND_BEGIN_ARG_INFO(Jlog_Reader__checkpoint_args, 0)
135 ZEND_END_ARG_INFO()
136 PHP_METHOD(Jlog_Reader, auto_checkpoint);
137 ZEND_BEGIN_ARG_INFO(Jlog_Reader__auto_checkpoint_args, 0)
138   ZEND_ARG_INFO(0, state)
139 ZEND_END_ARG_INFO()
140 #ifdef  __cplusplus
141 } // extern "C"
142 #endif
143
144 #endif /* PHP_HAVE_JLOG */
145
146 #endif /* PHP_JLOG_H */
147
148
149 /*
150  * Local variables:
151  * tab-width: 4
152  * c-basic-offset: 4
153  * End:
154  * vim600: noet sw=4 ts=4 fdm=marker
155  * vim<600: noet sw=4 ts=4
156  */
Note: See TracBrowser for help on using the browser.