chiark / gitweb /
initial import and build-faff, wip
[chiark-tcl.git] / hbytes / hbglue.c
1 int cht_pat_hbv(Tcl_Interp *ip, Tcl_Obj *var, HBytes_Var *agg) {
2   int rc;
3   rc= pat_somethingv(ip,var,&agg->sth,&hbytes_type);  if (rc) return rc;
4   agg->hb= OBJ_HBYTES(agg->sth.obj);
5   return TCL_OK;
6 }
7
8 int cht_pat_hb(Tcl_Interp *ip, Tcl_Obj *obj, HBytes_Value *val) {
9   int rc;
10   rc= Tcl_ConvertToType(ip,obj,&hbytes_type);  if (rc) return rc;
11   *val= *OBJ_HBYTES(obj);
12   return TCL_OK;
13 }
14
15 Tcl_Obj *cht_ret_hb(Tcl_Interp *ip, HBytes_Value val) {
16   Tcl_Obj *obj;
17   obj= Tcl_NewObj();
18   Tcl_InvalidateStringRep(obj);
19   *OBJ_HBYTES(obj)= val;
20   obj->typePtr= &hbytes_type;
21   return obj;
22 }
23