39 #include <ldns/ldns.h>
41 static const char* adapter_str =
"adapter";
51 ldns_rr *cur_rr = NULL;
53 ldns_status status = LDNS_STATUS_OK;
57 while (line_len >= 0) {
63 status = ldns_rr_new_frm_str(&cur_rr, line, 0, NULL, NULL);
64 if (status == LDNS_STATUS_OK) {
65 if (ldns_rr_get_type(cur_rr) == LDNS_RR_TYPE_SOA) {
97 while (c != EOF && c !=
'\n') {
104 ods_log_error(
"[%s] read line: bracket mismatch discovered at "
105 "line %i, missing ')'", adapter_str, l&&*l?*l:0);
113 }
else if (c ==
'"' && lc !=
'\\') {
114 in_string = 1 - in_string;
117 }
else if (c ==
'(') {
121 }
else if (lc !=
'\\') {
129 }
else if (c ==
')') {
133 }
else if (lc !=
'\\') {
136 "discovered at line %i, missing '('", adapter_str,
148 }
else if (c ==
';') {
152 }
else if (lc !=
'\\') {
158 }
else if (c ==
'\n' && lc !=
'\\') {
166 }
else if (c ==
'\t' && lc !=
'\\') {
179 ods_log_error(
"[%s] read line: bracket mismatch discovered at line %i,"
180 " missing ')'", adapter_str, l&&*l?*l:0);
195 int i = strlen(line), nl = 0;
200 if (line[i] ==
'\n') {
203 if (line[i] ==
' ' || line[i] ==
'\t' || line[i] ==
'\n') {
213 *line_len -= trimmed;
226 for (i = 0; i < line_len; i++) {
227 if (!isspace((
int)line[i])) {