1 /*
2   +----------------------------------------------------------------------+
3   | php-rdkafka                                                          |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 2016 Arnaud Le Blanc                                   |
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   | Author: Arnaud Le Blanc <arnaud.lb@gmail.com>                        |
16   +----------------------------------------------------------------------+
17 */
18 
19 /* $Id$ */
20 
21 #ifndef PHP_RDKAFKA_H
22 #define PHP_RDKAFKA_H
23 
24 #include "librdkafka/rdkafka.h"
25 #include "compat.h"
26 #include "conf.h"
27 
28 #ifndef PHP_FE_END
29 #define PHP_FE_END { NULL, NULL, NULL, 0, 0 }
30 #endif
31 
32 typedef struct _kafka_object {
33 #if PHP_MAJOR_VERSION < 7
34     zend_object             std;
35 #endif
36     rd_kafka_type_t         type;
37     rd_kafka_t              *rk;
38     kafka_conf_callbacks    cbs;
39     HashTable               consuming;
40 	HashTable				topics;
41 	HashTable				queues;
42 #if PHP_MAJOR_VERSION >= 7
43     zend_object             std;
44 #endif
45 } kafka_object;
46 
47 PHP_METHOD(RdKafka, __construct);
48 
49 extern zend_module_entry rdkafka_module_entry;
50 #define phpext_rdkafka_ptr &rdkafka_module_entry
51 
52 #define PHP_RDKAFKA_VERSION "4.0.4"
53 
54 extern zend_object_handlers kafka_default_object_handlers;
55 extern zend_class_entry * ce_kafka_exception;
56 
57 #ifdef PHP_WIN32
58 #	define PHP_RDKAFKA_API __declspec(dllexport)
59 #elif defined(__GNUC__) && __GNUC__ >= 4
60 #	define PHP_RDKAFKA_API __attribute__ ((visibility("default")))
61 #else
62 #	define PHP_RDKAFKA_API
63 #endif
64 
65 #ifdef ZTS
66 #include "TSRM.h"
67 #endif
68 
69 #endif	/* PHP_RDKAFKA_H */
70