This repository has been archived by the owner on Mar 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgetdns_dict.xs
232 lines (206 loc) · 4.83 KB
/
getdns_dict.xs
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#include "net_getdns.h"
MODULE = Net::GetDNS::XS PACKAGE = Net::GetDNS::XS
PROTOTYPES: ENABLE
Net::GetDNS::XS::Dict *
getdns_dict_create()
PROTOTYPE: DISABLE
OUTPUT:
RETVAL
Net::GetDNS::XS::Dict *
getdns_dict_create_with_context(context)
Net::GetDNS::XS::Context * context
PROTOTYPE: $
OUTPUT:
RETVAL
void
getdns_dict_destroy(dict)
Net::GetDNS::XS::Dict * dict
PROTOTYPE: $
getdns_return_t
getdns_dict_get_names(dict, answer)
Net::GetDNS::XS::Dict * dict
Net::GetDNS::XS::List * answer = NO_INIT
PROTOTYPE: $$
CODE:
/* TODO: Free answer if set */
RETVAL = getdns_dict_get_names(dict, &answer);
OUTPUT:
answer
RETVAL
getdns_return_t
getdns_dict_get_data_type(dict, name, answer)
Net::GetDNS::XS::Dict * dict
char * name
getdns_data_type answer
PROTOTYPE: $$$
CODE:
RETVAL = getdns_dict_get_data_type(dict, name, &answer);
OUTPUT:
answer
RETVAL
getdns_return_t
getdns_dict_get_dict(dict, name, answer)
Net::GetDNS::XS::Dict * dict
char * name
Net::GetDNS::XS::Dict * answer = NO_INIT
PROTOTYPE: $$$
CODE:
/* TODO: Free answer if set */
RETVAL = getdns_dict_get_dict(dict, name, &answer);
OUTPUT:
answer
RETVAL
getdns_return_t
getdns_dict_get_list(dict, name, answer)
Net::GetDNS::XS::Dict * dict
char * name
Net::GetDNS::XS::List * answer = NO_INIT
PROTOTYPE: $$$
CODE:
/* TODO: Free answer if set */
RETVAL = getdns_dict_get_list(dict, name, &answer);
OUTPUT:
answer
RETVAL
getdns_return_t
getdns_dict_get_bindata(dict, name, answer)
Net::GetDNS::XS::Dict * dict
char * name
Net::GetDNS::XS::Bindata * answer
PROTOTYPE: $$$
CODE:
getdns_bindata * bindata = 0;
RETVAL = getdns_dict_get_bindata(dict, name, &bindata);
if (bindata && bindata->data && bindata->size) {
if (answer->data) Safefree(answer->data);
answer->size = 0;
Newxz(answer->data, bindata->size, uint8_t);
if (answer->data) {
memcpy(answer->data, bindata->data, bindata->size);
answer->size = bindata->size;
}
}
OUTPUT:
RETVAL
getdns_return_t
getdns_dict_get_int(dict, name, answer)
Net::GetDNS::XS::Dict * dict
char * name
uint32_t answer
PROTOTYPE: $$$
CODE:
RETVAL = getdns_dict_get_int(dict, name, &answer);
OUTPUT:
answer
RETVAL
getdns_return_t
getdns_dict_set_dict(dict, name, child_dict)
Net::GetDNS::XS::Dict * dict
char * name
Net::GetDNS::XS::Dict * child_dict
PROTOTYPE: $$$
CODE:
RETVAL = getdns_dict_set_dict(dict, name, child_dict);
OUTPUT:
RETVAL
getdns_return_t
getdns_dict_set_list(dict, name, child_list)
Net::GetDNS::XS::Dict * dict
char * name
Net::GetDNS::XS::List * child_list
PROTOTYPE: $$$
CODE:
RETVAL = getdns_dict_set_list(dict, name, child_list);
OUTPUT:
RETVAL
getdns_return_t
getdns_dict_set_bindata(dict, name, child_bindata)
Net::GetDNS::XS::Dict * dict
char * name
Net::GetDNS::XS::Bindata * child_bindata
PROTOTYPE: $$$
CODE:
RETVAL = getdns_dict_set_bindata(dict, name, child_bindata);
OUTPUT:
RETVAL
getdns_return_t
getdns_dict_set_int(dict, name, child_uint32)
Net::GetDNS::XS::Dict * dict
char * name
uint32_t child_uint32
PROTOTYPE: $$$
CODE:
RETVAL = getdns_dict_set_int(dict, name, child_uint32);
OUTPUT:
RETVAL
getdns_return_t
getdns_dict_remove_name(dict, name)
Net::GetDNS::XS::Dict * dict
char * name
PROTOTYPE: $$
CODE:
RETVAL = getdns_dict_remove_name(dict, name);
OUTPUT:
RETVAL
char *
getdns_pretty_print_dict(some_dict)
Net::GetDNS::XS::Dict * some_dict
PROTOTYPE: $
OUTPUT:
RETVAL
getdns_return_t
getdns_dict_util_set_string(dict, name, value)
Net::GetDNS::XS::Dict * dict
char * name
const char * value
PROTOTYPE: $$$
OUTPUT:
RETVAL
getdns_return_t
getdns_dict_util_get_string(dict, name, result)
Net::GetDNS::XS::Dict * dict
char * name
char * result = NO_INIT
PROTOTYPE: $$$
CODE:
/* TODO: Check that result is not set */
RETVAL = getdns_dict_util_get_string(dict, name, &result);
OUTPUT:
result
RETVAL
int
getdns_pretty_snprint_dict(str, dict)
SV * str
Net::GetDNS::XS::Dict * dict
PROTOTYPE: $$
CODE:
char buf[4096];
memset(buf, 0, sizeof(buf));
RETVAL = getdns_pretty_snprint_dict(buf, sizeof(buf)-1, dict);
sv_setpv_mg(str, buf);
OUTPUT:
str
RETVAL
char *
getdns_print_json_dict(some_dict, pretty)
Net::GetDNS::XS::Dict * some_dict
int pretty
PROTOTYPE: $$
OUTPUT:
RETVAL
int
getdns_snprint_json_dict(str, dict, pretty)
SV * str
Net::GetDNS::XS::Dict * dict
int pretty
PROTOTYPE: $$
CODE:
char buf[4096];
memset(buf, 0, sizeof(buf));
RETVAL = getdns_snprint_json_dict(buf, sizeof(buf)-1, dict, pretty);
sv_setpv_mg(str, buf);
OUTPUT:
str
RETVAL
MODULE = Net::GetDNS::XS::Dict PACKAGE = Net::GetDNS::XS::Dict
PROTOTYPES: ENABLE