7 static void enum_nt_dup(Tcl_Obj *src, Tcl_Obj *dup) {
8 dup->internalRep= src->internalRep;
11 static void enum_nt_ustr(Tcl_Obj *o) {
15 static int enum_nt_sfa(Tcl_Interp *ip, Tcl_Obj *o) {
19 Tcl_ObjType enum_nearlytype = {
21 0, enum_nt_dup, enum_nt_ustr, enum_nt_sfa
24 const void *enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
25 size_t entrysize, const void *firstentry,
27 const char *supplied, *found;
30 if (o->typePtr == &enum_nearlytype &&
31 o->internalRep.twoPtrValue.ptr1 == firstentry)
32 return o->internalRep.twoPtrValue.ptr2;
34 supplied= Tcl_GetStringFromObj(o,0); assert(supplied);
36 (found= *(const char*const*)ep) && strcmp(supplied,found);
41 o->typePtr= &enum_nearlytype;
42 o->internalRep.twoPtrValue.ptr1= (void*)firstentry;
43 o->internalRep.twoPtrValue.ptr2= (void*)ep;
48 Tcl_AppendResult(ip, "invalid ",what," - must be one of:",(char*)0);
50 (found= *(const char*const*)ep);
52 Tcl_AppendResult(ip, " ",found,(char*)0);