#include <string.h>
-#include "hbytes.h"
+#include "chiark-tcl.h"
+#include "tables.h"
static void enum_nt_dup(Tcl_Obj *src, Tcl_Obj *dup) {
dup->internalRep= src->internalRep;
abort();
}
-Tcl_ObjType enum_nearlytype = {
+Tcl_ObjType cht_enum_nearlytype = {
"enum-nearly",
0, enum_nt_dup, enum_nt_ustr, enum_nt_sfa
};
-Tcl_ObjType enum1_nearlytype = {
+Tcl_ObjType cht_enum1_nearlytype = {
"enum1-nearly",
0, enum_nt_dup, enum_nt_ustr, enum_nt_sfa
};
Tcl_AppendResult(ip, enum_str(p), (char*)0);
}
-const void *enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
+const void *cht_enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
const void *firstentry, size_t entrysize,
const char *what) {
const char *supplied, *found;
const char *ep;
- if (o->typePtr == &enum_nearlytype &&
+ if (o->typePtr == &cht_enum_nearlytype &&
o->internalRep.twoPtrValue.ptr1 == firstentry)
return o->internalRep.twoPtrValue.ptr2;
ep += entrysize);
if (found) {
- objfreeir(o);
- o->typePtr= &enum_nearlytype;
+ cht_objfreeir(o);
+ o->typePtr= &cht_enum_nearlytype;
o->internalRep.twoPtrValue.ptr1= (void*)firstentry;
o->internalRep.twoPtrValue.ptr2= (void*)ep;
return ep;
Tcl_AppendResult(ip, buf, (char*)0);
}
-int enum1_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
+int cht_enum1_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
const char *opts, const char *what) {
const char *supplied, *fp;
- if (o->typePtr != &enum1_nearlytype ||
+ if (o->typePtr != &cht_enum1_nearlytype ||
o->internalRep.twoPtrValue.ptr1 != opts) {
supplied= Tcl_GetStringFromObj(o,0); assert(supplied);
return -1;
}
- objfreeir(o);
- o->typePtr= &enum1_nearlytype;
+ cht_objfreeir(o);
+ o->typePtr= &cht_enum1_nearlytype;
o->internalRep.twoPtrValue.ptr1= (void*)opts;
o->internalRep.twoPtrValue.ptr2= (void*)fp;
}