/************************************************************************* * * 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 ////////////////////////////////////////////////////// struct xop_t : public op_t { typedef void (*xop1_t)(mstream&,Env&,const sref&); typedef void (*xop2_t)(mstream&,Env&,const sref&,const sref&); xop_t(const mstring& s,int p1,int p2,int l,int r, xop1_t op1,xop2_t op2,const mstring& d): op_t(s,p1,p2,l,r,(op1_t)op1,(op2_t)op2,d) {} }; ////////////////////////////////////////////////////// #define X1_IMPL(name) \ static void impl_##name(mstream& out,Env& env,const sref& a) throw(merror_t) #define X2_IMPL(name) \ static void impl_##name(mstream& out,Env& env,const sref& L,const sref& R) throw(merror_t) #define X1_ADDN(p,l,r,f,n,d) M.add(new xop_t(#n,p,0,l,r,impl_##f,0,d)) #define X2_ADDN(p,l,r,f,n,d) M.add(new xop_t(#n,0,p,l,r,0,impl_##f,d)) ////////////////////////////////////////////////////// X1_IMPL(exist) { mstring name; swrite sw(name); env.eval(sw,a,0); out<, "Copy local record\n" "Syntax: (partial name) -> (partial name)\n" "Returns: nothing\n" "\n" "The partial name @ for data base records works in both arguments.\n" "\n" "Generates an error if any of the expanded names of the right\n" "partial argument does not exist.\n" ); }