X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/adns/blobdiff_plain/f7f83b4a88b5168130a7bb9cb3d3811eb8c1c260..2b1c6979bb36a0e3a5aaa7f18b0c72b528f886b9:/src/internal.h diff --git a/src/internal.h b/src/internal.h index 02951a6..4fc7d7f 100644 --- a/src/internal.h +++ b/src/internal.h @@ -677,22 +677,15 @@ void adns__consistency(adns_state ads, adns_query qu, consistency_checks cc); /* Useful static inline functions: */ -static inline void timevaladd(struct timeval *tv_io, long ms) { - struct timeval tmp; - assert(ms>=0); - tmp= *tv_io; - tmp.tv_usec += (ms%1000)*1000000; - tmp.tv_sec += ms/1000; - if (tmp.tv_usec >= 1000000) { tmp.tv_sec++; tmp.tv_usec -= 1000; } - *tv_io= tmp; -} - static inline int ctype_whitespace(int c) { return c==' ' || c=='\n' || c=='\t'; } static inline int ctype_digit(int c) { return c>='0' && c<='9'; } static inline int ctype_alpha(int c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } static inline int ctype_822special(int c) { return strchr("()<>@,;:\\\".[]",c) != 0; } +static inline int ctype_domainunquoted(int c) { + return ctype_alpha(c) || ctype_digit(c) || (strchr("-_/+",c) != 0); +} static inline int errno_resources(int e) { return e==ENOMEM || e==ENOBUFS; }