X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=base%2Ftcmdiflib.c;h=85b181ed34a2791a735fafcca5518396d81e24df;hb=f63331266eb17877332738f80f622c94e924c118;hp=8bddc02b8a49979579381606b6750d0ea9150752;hpb=a43cdb5c69224a60f9e87110093e35a0f1f0b468;p=chiark-tcl.git diff --git a/base/tcmdiflib.c b/base/tcmdiflib.c index 8bddc02..85b181e 100644 --- a/base/tcmdiflib.c +++ b/base/tcmdiflib.c @@ -1,29 +1,46 @@ /* + * base code for various Tcl extensions + * Copyright 2006 Ian Jackson + * + * 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301, USA. */ -#include "tcmdiflib.h" +#include "chiark-tcl-base.h" -int pat_enum(Tcl_Interp *ip, Tcl_Obj *obj, const void **val, +int cht_pat_enum(Tcl_Interp *ip, Tcl_Obj *obj, const void **val, const void *opts, size_t sz, const char *what) { - *val= enum_lookup_cached_func(ip,obj,opts,sz,what); + *val= cht_enum_lookup_cached_func(ip,obj,opts,sz,what); if (!*val) return TCL_ERROR; return TCL_OK; } -int pat_obj(Tcl_Interp *ip, Tcl_Obj *obj, Tcl_Obj **val) { +int cht_pat_obj(Tcl_Interp *ip, Tcl_Obj *obj, Tcl_Obj **val) { *val= obj; return TCL_OK; } -Tcl_Obj *ret_int(Tcl_Interp *ip, int val) { +Tcl_Obj *cht_ret_int(Tcl_Interp *ip, int val) { return Tcl_NewIntObj(val); } -Tcl_Obj *ret_obj(Tcl_Interp *ip, Tcl_Obj *val) { +Tcl_Obj *cht_ret_obj(Tcl_Interp *ip, Tcl_Obj *val) { return val; } -void setstringresult(Tcl_Interp *ip, const char *m) { +void cht_setstringresult(Tcl_Interp *ip, const char *m) { Tcl_ResetResult(ip); Tcl_AppendResult(ip, m, (char*)0); }