chiark / gitweb /
Table-generated stuff. Now need parsing funcs.
[chiark-tcl.git] / base / parse.c
diff --git a/base/parse.c b/base/parse.c
new file mode 100644 (file)
index 0000000..125dd61
--- /dev/null
@@ -0,0 +1,16 @@
+  sc= enum_lookup_cached(ip,objv[1],subcommands,"hbytes subcommand");
+
+
+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;
+}
+