/************************************************************************* * * HTCd - Copyright (C) 1998-2006 Henrik Rydberg * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include using namespace std; const mstring compat="(compatibility)"; const int zkey=0; OP2_IMPL(lti) {out<<(atoi(L)=atoi(R));} OP2_IMPL(gti) {out<<(atoi(L)>atoi(R));} void dbmap::setup() { MLOCK(mutex); if(M.empty()) { opAddComp(M); OP_ADDN(20,lti,lt.int,compat); OP_ADDN(20,lei,le.int,compat); OP_ADDN(20,gei,ge.int,compat); OP_ADDN(20,gti,gt.int,compat); M.add(new op_t("lt.case",20,M.get(sref("lt"))->f2,compat)); M.add(new op_t("gt.case",20,M.get(sref("gt"))->f2,compat)); M.add(new op_t("lt.nocase",20,M.get(sref("ltn"))->f2,compat)); M.add(new op_t("gt.nocase",20,M.get(sref("gtn"))->f2,compat)); } } const op_t* dbmap::CompOperator(const sref& s) { if(M.empty()) setup(); const op_t* p=M.get(s); if(!p) THROW("dbmap: could not find operator "<head()->setcomp(index,compname); remap_tabs(); } }