1 /*
2 +-----------------------------------------------------------------------------------+
3 |  ZMQ extension for PHP                                                            |
4 |  Copyright (c) 2010-2013, Mikko Koppanen <mkoppanen@php.net>                      |
5 |  All rights reserved.                                                             |
6 +-----------------------------------------------------------------------------------+
7 |  Redistribution and use in source and binary forms, with or without               |
8 |  modification, are permitted provided that the following conditions are met:      |
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 copyright           |
12 |       notice, this list of conditions and the following disclaimer in the         |
13 |       documentation and/or other materials provided with the distribution.        |
14 |     * Neither the name of the copyright holder nor the                            |
15 |       names of its contributors may be used to endorse or promote products        |
16 |       derived from this software without specific prior written permission.       |
17 +-----------------------------------------------------------------------------------+
18 |  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND  |
19 |  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED    |
20 |  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE           |
21 |  DISCLAIMED. IN NO EVENT SHALL MIKKO KOPPANEN BE LIABLE FOR ANY                   |
22 |  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES       |
23 |  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;     |
24 |  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND      |
25 |  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT       |
26 |  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS    |
27 |  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                     |
28 +-----------------------------------------------------------------------------------+
29 */
30 
31 #ifndef _PHP_ZMQ_POLLSET_H_
32 # define _PHP_ZMQ_POLLSET_H_
33 
34 #define PHP_ZMQ_POLLSET_ERR_NO_STREAM    -1
35 #define PHP_ZMQ_POLLSET_ERR_CANNOT_CAST  -2
36 #define PHP_ZMQ_POLLSET_ERR_CAST_FAILED  -3
37 #define PHP_ZMQ_POLLSET_ERR_NO_INIT      -4
38 #define PHP_ZMQ_POLLSET_ERR_NO_POLL      -5
39 #define PHP_ZMQ_POLLSET_ERR_KEY_FAIL     -6
40 #define PHP_ZMQ_POLLSET_ERR_INVALID_TYPE -7
41 
42 /** {{{ void php_zmq_pollset_init(php_zmq_pollset *set);
43 */
44 void php_zmq_pollset_init(php_zmq_pollset *set);
45 /* }}} */
46 
47 /** {{{ void php_zmq_pollset_deinit(php_zmq_pollset *set TSRMLS_DC);
48 */
49 void php_zmq_pollset_deinit(php_zmq_pollset *set TSRMLS_DC);
50 /* }}} */
51 
52 /** {{{ void php_zmq_pollset_clear(php_zmq_pollset *set, zend_bool reinit);
53 */
54 void php_zmq_pollset_clear(php_zmq_pollset *set, zend_bool reinit TSRMLS_DC);
55 /* }}} */
56 
57 /** {{{ int php_zmq_pollset_add(php_zmq_pollset *set, zval *entry, int events TSRMLS_DC);
58 */
59 int php_zmq_pollset_add(php_zmq_pollset *set, zval *entry, int events TSRMLS_DC);
60 /* }}} */
61 
62 /** {{{ void php_zmq_pollset_rebuild(php_zmq_pollset *set);
63 */
64 void php_zmq_pollset_rebuild(php_zmq_pollset *set);
65 /* }}} */
66 
67 /** {{{ zend_bool php_zmq_pollset_delete(php_zmq_pollset *set, zval *entry TSRMLS_DC);
68 */
69 zend_bool php_zmq_pollset_delete(php_zmq_pollset *set, zval *entry TSRMLS_DC);
70 /* }}} */
71 
72 /** {{{ int php_zmq_pollset_poll(php_zmq_pollset *set, int timeout, zval *r_array, zval *w_array, zval *e_array);
73 */
74 int php_zmq_pollset_poll(php_zmq_pollset *set, int timeout, zval *r_array, zval *w_array, zval *e_array);
75 /* }}} */
76 
77 /** {{{ zend_bool php_zmq_pollset_get_key(php_zmq_pollset *set, int pos, char key[35], int *key_len TSRMLS_DC);
78 */
79 zend_bool php_zmq_pollset_get_key(php_zmq_pollset *set, int pos, char key[35], int *key_len TSRMLS_DC);
80 /* }}} */
81 
82 /** {{{ zend_bool php_zmq_pollset_delete_by_key(php_zmq_pollset *set, char key[35], int key_len TSRMLS_DC);
83 */
84 zend_bool php_zmq_pollset_delete_by_key(php_zmq_pollset *set, char key[35], int key_len TSRMLS_DC);
85 /* }}} */
86 
87 /** {{{ void php_zmq_pollset_delete_all(php_zmq_pollset *set TSRMLS_DC);
88 */
89 void php_zmq_pollset_delete_all(php_zmq_pollset *set TSRMLS_DC);
90 /* }}} */
91 
92 #endif /* _PHP_ZMQ_POLLSET_H_ */
93