From: Pieter Lexis Date: Fri, 22 Jul 2016 17:34:28 +0000 (+0200) Subject: lua-recursor4.cc: whitespace fixes X-Git-Tag: rec-4.0.2~1^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=805f3e034ba265861e1ade271dc03a9430b5e2c1;p=thirdparty%2Fpdns.git lua-recursor4.cc: whitespace fixes --- diff --git a/pdns/lua-recursor4.cc b/pdns/lua-recursor4.cc index 5dd6613501..40f056ac09 100644 --- a/pdns/lua-recursor4.cc +++ b/pdns/lua-recursor4.cc @@ -257,8 +257,12 @@ RecursorLua4::RecursorLua4(const std::string& fname) return DNSName(boost::get(dom)); }); d_lw->registerFunction("isPartOf", &DNSName::isPartOf); - d_lw->registerFunction("equal", - [](const DNSName& lhs, const std::string& rhs) { return lhs==DNSName(rhs); }); + d_lw->registerFunction( + "equal", + [](const DNSName& lhs, const std::string& rhs) { + return lhs==DNSName(rhs); + } + ); d_lw->registerFunction("__eq", &DNSName::operator==); d_lw->registerFunction("toString", [](const ComboAddress& ca) { return ca.toString(); }); @@ -277,32 +281,35 @@ RecursorLua4::RecursorLua4(const std::string& fname) d_lw->writeFunction("newCAS", []{ return cas_t(); }); - d_lw->registerFunction > >)>("add", - [](cas_t& cas, const boost::variant > >& in) - { - try { - if(auto s = boost::get(&in)) { - cas.insert(ComboAddress(*s)); - } - else if(auto v = boost::get > >(&in)) { - for(const auto& s : *v) - cas.insert(ComboAddress(s.second)); - } - else - cas.insert(boost::get(in)); - } - catch(std::exception& e) { theL() <registerFunction > >)>( + "add", + [](cas_t& cas, const boost::variant > >& in) + { + try { + if(auto s = boost::get(&in)) { + cas.insert(ComboAddress(*s)); + } + else if(auto v = boost::get > >(&in)) { + for(const auto& s : *v) + cas.insert(ComboAddress(s.second)); + } + else { + cas.insert(boost::get(in)); + } + } + catch(std::exception& e) { theL() <registerFunction("check",[](const cas_t& cas, const ComboAddress&ca) { return (bool)cas.count(ca); }); - - - d_lw->registerFunction("equal", [](const ComboAddress& lhs, const ComboAddress& rhs) { + d_lw->registerFunction( + "equal", + [](const ComboAddress& lhs, const ComboAddress& rhs) { return ComboAddress::addressOnlyEqual()(lhs, rhs); - }); + } + ); d_lw->registerFunction("getNetwork", [](const Netmask& nm) { return nm.getNetwork(); } ); // const reference makes this necessary @@ -316,16 +323,19 @@ RecursorLua4::RecursorLua4(const std::string& fname) d_lw->registerFunction("__eq", &Netmask::operator==); d_lw->writeFunction("newNMG", []() { return NetmaskGroup(); }); - d_lw->registerFunction("addMask", [](NetmaskGroup&nmg, const std::string& mask) - { - nmg.addMask(mask); - }); + d_lw->registerFunction( + "addMask", [](NetmaskGroup&nmg, const std::string& mask){ + nmg.addMask(mask); + } + ); - d_lw->registerFunction>&)>("addMasks", [](NetmaskGroup&nmg, const vector>& masks) - { - for(const auto& mask: masks) - nmg.addMask(mask.second); - }); + d_lw->registerFunction>&)>( + "addMasks", + [](NetmaskGroup&nmg, const vector>& masks){ + for(const auto& mask: masks) + nmg.addMask(mask.second); + } + ); d_lw->registerFunction("match", (bool (NetmaskGroup::*)(const ComboAddress&) const)&NetmaskGroup::match); @@ -396,22 +406,27 @@ RecursorLua4::RecursorLua4(const std::string& fname) }); d_lw->writeFunction("newDS", []() { return SuffixMatchNode(); }); - d_lw->registerFunction > >)>("add", - [](SuffixMatchNode&smn, const boost::variant > >& in) - { - try { - if(auto s = boost::get(&in)) { - smn.add(DNSName(*s)); - } - else if(auto v = boost::get > >(&in)) { - for(const auto& s : *v) - smn.add(DNSName(s.second)); - } - else - smn.add(boost::get(in)); - } - catch(std::exception& e) { theL() <registerFunction > >)>( + "add", + [](SuffixMatchNode&smn, const boost::variant > >& in){ + try { + if(auto s = boost::get(&in)) { + smn.add(DNSName(*s)); + } + else if(auto v = boost::get > >(&in)) { + for(const auto& s : *v) + smn.add(DNSName(s.second)); + } + else { + smn.add(boost::get(in)); + } + } + catch(std::exception& e) { + theL() <registerFunction("check",(bool (SuffixMatchNode::*)(const DNSName&) const) &SuffixMatchNode::check); d_lw->registerFunction("toString",(string (SuffixMatchNode::*)() const) &SuffixMatchNode::toString);