-
Notifications
You must be signed in to change notification settings - Fork 10
/
typemap
74 lines (72 loc) · 2.44 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
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
74
TYPEMAP
plrd_kafka_t* T_RDKAFKA
rd_kafka_message_t* T_RD_KAFKA_MSG
rd_kafka_topic_t* T_RD_KAFKA_TOPIC
rd_kafka_topic_partition_list_t* T_RD_KAFKA_TOPIC_PARTITION_LIST
rd_kafka_headers_t* T_RD_KAFKA_HEADERS
rd_kafka_event_t* T_RD_KAFKA_EVENT
HV* T_HVREF_REFCOUNT_FIXED
INPUT
T_RDKAFKA
if(sv_derived_from($arg, \"Net::Kafka\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else {
croak(\"$var is not of type Net::Kafka\");
}
T_RD_KAFKA_MSG
if(sv_derived_from($arg, \"Net::Kafka::Message\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else {
croak(\"$var is not of type Net::Kafka::Message\");
}
T_RD_KAFKA_TOPIC
if(sv_derived_from($arg, \"Net::Kafka::Topic\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else {
croak(\"$var is not of type Net::Kafka::Topic\");
}
T_RD_KAFKA_TOPIC_PARTITION_LIST
if(sv_derived_from($arg, \"Net::Kafka::TopicPartitionList\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else {
croak(\"$var is not of type Net::Kafka::TopicPartitionList\");
}
T_RD_KAFKA_HEADERS
if(!SvOK($arg)) {
$var = NULL;
} else if(sv_derived_from($arg, \"Net::Kafka::Headers\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else {
croak(\"$var is not of type Net::Kafka::Headers\");
}
T_RD_KAFKA_EVENT
if(sv_derived_from($arg, \"Net::Kafka::Event\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else {
croak(\"$var is not of type Net::Kafka::Event\");
}
OUTPUT
T_RDKAFKA
sv_setref_pv($arg, \"Net::Kafka\", (void *)$var);
T_RD_KAFKA_MSG
sv_setref_pv($arg, \"Net::Kafka::Message\", (void *)$var);
T_RD_KAFKA_TOPIC
sv_setref_pv($arg, \"Net::Kafka::Topic\", (void *)$var);
T_RD_KAFKA_TOPIC_PARTITION_LIST
sv_setref_pv($arg, \"Net::Kafka::TopicPartitionList\", (void *)$var);
T_RD_KAFKA_HEADERS
sv_setref_pv($arg, \"Net::Kafka::Headers\", (void *)$var);
T_RD_KAFKA_EVENT
sv_setref_pv($arg, \"Net::Kafka::Event\", (void *)$var);