-static Tcl_Obj *hb_getvar(Tcl_Interp *ip, Tcl_Obj *varname) {
- int ec;
- Tcl_Obj *value;
-
- value= Tcl_ObjGetVar2(ip,varname,0,TCL_LEAVE_ERR_MSG);
- if (!value) return 0;
-
- ec= Tcl_ConvertToType(ip,value,&hbytes_type);
- if (ec) return 0;
-
- return value;
+int cht_pat_hb(Tcl_Interp *ip, Tcl_Obj *obj, HBytes_Value *val) {
+ int rc;
+ rc= Tcl_ConvertToType(ip,obj,&cht_hbytes_type); if (rc) return rc;
+ *val= *OBJ_HBYTES(obj);
+ return TCL_OK;