From: Thiago Farina Date: Mon, 17 Apr 2017 00:59:28 +0000 (-0300) Subject: move two other functions into ascii.hh X-Git-Tag: rec-4.1.0-alpha1~153^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a416d39860668abdd1c1ef2afef50c3f048a505a;p=pdns move two other functions into ascii.hh dns_isspace() and dns_toupper() are all functions operating upon ASCII characters. So lets move them into ascii.hh and keep them together with dns_tolower(). --- diff --git a/pdns/ascii.hh b/pdns/ascii.hh index 69b1a3935..09f42de6f 100644 --- a/pdns/ascii.hh +++ b/pdns/ascii.hh @@ -21,6 +21,18 @@ */ #pragma once +inline bool dns_isspace(char c) +{ + return c==' ' || c=='\t' || c=='\r' || c=='\n'; +} + +inline unsigned char dns_toupper(unsigned char c) +{ + if(c>='a' && c<='z') + c+='A'-'a'; + return c; +} + inline unsigned char dns_tolower(unsigned char c) { if(c>='A' && c<='Z') diff --git a/pdns/misc.hh b/pdns/misc.hh index fe5f796fd..47cfcc9dd 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -229,19 +229,6 @@ inline int DTime::udiffNoReset() return ret; } - -inline bool dns_isspace(char c) -{ - return c==' ' || c=='\t' || c=='\r' || c=='\n'; -} - -inline unsigned char dns_toupper(unsigned char c) -{ - if(c>='a' && c<='z') - c+='A'-'a'; - return c; -} - inline const string toLower(const string &upper) { string reply(upper); diff --git a/pdns/rcpgenerator.cc b/pdns/rcpgenerator.cc index 1acb1d829..aea5c4437 100644 --- a/pdns/rcpgenerator.cc +++ b/pdns/rcpgenerator.cc @@ -23,6 +23,7 @@ #include "config.h" #endif #include "rcpgenerator.hh" +#include "ascii.hh" #include "dnsparser.hh" #include "misc.hh" #include "utility.hh" diff --git a/pdns/zoneparser-tng.cc b/pdns/zoneparser-tng.cc index 36777795c..153d89239 100644 --- a/pdns/zoneparser-tng.cc +++ b/pdns/zoneparser-tng.cc @@ -22,6 +22,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "ascii.hh" #include "dnsparser.hh" #include "sstuff.hh" #include "misc.hh"