forked from uperl/Kafka-Librd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
typemap
38 lines (36 loc) · 1.13 KB
/
typemap
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
TYPEMAP
rdkafka_t* T_RDKAFKA
rd_kafka_message_t* T_RD_KAFKA_MSG
rd_kafka_topic_t* T_RD_KAFKA_TOPIC
INPUT
T_RDKAFKA
if(sv_derived_from($arg, \"Kafka::Librd\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else {
croak(\"$var is not of type Kafka::Librd\");
}
T_RD_KAFKA_MSG
if(sv_derived_from($arg, \"Kafka::Librd::Message\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else {
croak(\"$var is not of type Kafka::Librd::Message\");
}
T_RD_KAFKA_TOPIC
if(sv_derived_from($arg, \"Kafka::Librd::Topic\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else {
croak(\"$var is not of type Kafka::Librd::Topic\");
}
OUTPUT
T_RDKAFKA
sv_setref_pv($arg, \"Kafka::Librd\", (void *)$var);
T_RD_KAFKA_MSG
sv_setref_pv($arg, \"Kafka::Librd::Message\", (void *)$var);
T_RD_KAFKA_TOPIC
sv_setref_pv($arg, \"Kafka::Librd::Topic\", (void *)$var);