chiark / gitweb /
Introduce adns__labels_equal and ctype_toupper
[adns.git] / src / internal.h
index c2656c80fe173e2a84e46e3fc54833c0391e84f3..55da2b928593eec651e072da94f8ce4d6519d4b5 100644 (file)
@@ -851,6 +851,8 @@ void adns__update_expires(adns_query qu, unsigned long ttl,
 
 int vbuf__append_quoted1035(vbuf *vb, const byte *buf, int len);
 
+bool adns__labels_equal(const byte *a, int al, const byte *b, int bl);
+
 /* From event.c: */
 
 void adns__tcp_broken(adns_state ads, const char *what, const char *why);
@@ -898,6 +900,9 @@ 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_toupper(int c) {
+  return ctype_alpha(c) ? (c & ~32) : c;
+}
 static inline int ctype_822special(int c) {
   return strchr("()<>@,;:\\\".[]",c) != 0;
 }