29 if (!x) x =
"/etc/dnsrewrite";
37 for (j = 0; j < data.
len; ++j)
38 if (data.
s[j] ==
'\n') {
41 if (rules->
s[rules->
len - 1] !=
' ')
42 if (rules->
s[rules->
len - 1] !=
'\t')
43 if (rules->
s[rules->
len - 1] !=
'\r')
59 for (j = 0; j < data.
len; ++j)
60 if (data.
s[j] ==
' ') {
77 for (j = 0; j < data.
len; ++j)
78 if (data.
s[j] ==
'\n') {
88 if (!k) { ++i;
continue; }
103 if (gethostname(host,
sizeof(host)) == -1)
return DNS_ERR;
104 host[(
sizeof(host)) - 1] = 0;
118static unsigned int uses;
119static struct taia deadline;
131 if (init(&rules) < 0)
return DNS_INT;
int dns_resolvconfrewrite(stralloc *out)
int taia_less(struct taia *, struct taia *)
void taia_add(struct taia *, struct taia *, struct taia *)
void taia_uint(struct taia *, unsigned int)
int taia_now(struct taia *)
int openreadclose(const char *, stralloc *, unsigned int)
unsigned int byte_chr(char *, unsigned int, int)
#define byte_equal(s, n, t)
unsigned int str_chr(const char *, int)
int stralloc_copy(stralloc *, stralloc *)
int stralloc_catb(stralloc *, const char *, unsigned int)
int stralloc_append(stralloc *sa, const char *in)
int stralloc_cats(stralloc *, const char *)
int stralloc_copys(stralloc *, const char *)