forked from arnaud-lb/php-rdkafka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.h
73 lines (63 loc) · 2.48 KB
/
conf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
+----------------------------------------------------------------------+
| php-rdkafka |
+----------------------------------------------------------------------+
| Copyright (c) 2016 Arnaud Le Blanc |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Arnaud Le Blanc <[email protected]> |
+----------------------------------------------------------------------+
*/
#ifndef KAFKA_CONF_H
#define KAFKA_CONF_H
enum {
MSG_PARTITIONER_RANDOM = 2
#ifdef HAVE_RD_KAFKA_MSG_PARTIIONER_CONSISTENT
, MSG_PARTITIONER_CONSISTENT = 3
#endif
};
typedef enum {
KAFKA_CONF = 1,
KAFKA_TOPIC_CONF
} kafka_conf_type;
typedef struct _kafka_conf_callback {
zend_fcall_info fci;
zend_fcall_info_cache fcc;
} kafka_conf_callback;
typedef struct _kafka_conf_callbacks {
zval rk;
kafka_conf_callback *error;
kafka_conf_callback *rebalance;
kafka_conf_callback *dr_msg;
kafka_conf_callback *stats;
kafka_conf_callback *consume;
kafka_conf_callback *offset_commit;
} kafka_conf_callbacks;
typedef struct _kafka_conf_object {
#if PHP_MAJOR_VERSION < 7
zend_object std;
#endif
kafka_conf_type type;
union {
rd_kafka_conf_t *conf;
rd_kafka_topic_conf_t *topic_conf;
} u;
kafka_conf_callbacks cbs;
#if PHP_MAJOR_VERSION >= 7
zend_object std;
#endif
} kafka_conf_object;
kafka_conf_object * get_kafka_conf_object(zval *zconf TSRMLS_DC);
void kafka_conf_minit(TSRMLS_D);
void kafka_conf_callbacks_dtor(kafka_conf_callbacks *cbs TSRMLS_DC);
void kafka_conf_callbacks_copy(kafka_conf_callbacks *to, kafka_conf_callbacks *from TSRMLS_DC);
extern zend_class_entry * ce_kafka_conf;
extern zend_class_entry * ce_kafka_topic_conf;
#endif /* KAFKA_CONF_H */