chiark / gitweb /
new socket id arrangements, working on tun
[chiark-tcl.git] / base / hook.c
index a9d0316f0c90089cce1f1383caa5030b30dfc8f0..b84306a1e12c8a516b21aedf9ca27ae200ca3751 100644 (file)
@@ -22,6 +22,13 @@ int posixerr(Tcl_Interp *ip, int errnoval, const char *m) {
   return TCL_ERROR;
 }
 
+int newfdposixerr(Tcl_Interp *ip, int fd, const char *m) {
+  int e;
+  e= errno;
+  close(fd);
+  return posixerr(ip,e,m);
+}
+
 void objfreeir(Tcl_Obj *o) {
   if (o->typePtr && o->typePtr->freeIntRepProc)
     o->typePtr->freeIntRepProc(o);
@@ -361,6 +368,12 @@ int do_toplevel_dgram_socket(ClientData cd, Tcl_Interp *ip,
   return subcmd->func(0,ip,objc,objv);
 }
 
+int do_toplevel_tuntap_socket(ClientData cd, Tcl_Interp *ip,
+                            const TunSocket_SubCommand *subcmd,
+                            int objc, Tcl_Obj *const *objv) {
+  return subcmd->func(0,ip,objc,objv);
+}
+
 int do_toplevel_ulong(ClientData cd, Tcl_Interp *ip,
                      const ULong_SubCommand *subcmd,
                      int objc, Tcl_Obj *const *objv) {
@@ -400,7 +413,7 @@ int Hbytes_Init(Tcl_Interp *ip) {
   Tcl_RegisterObjType(&enum_nearlytype);
   Tcl_RegisterObjType(&enum1_nearlytype);
   Tcl_RegisterObjType(&sockaddr_type);
-  Tcl_RegisterObjType(&dgramsockid_type);
+  Tcl_RegisterObjType(&tabledataid_nearlytype);
   Tcl_RegisterObjType(&ulong_type);
 
   for (cmd=toplevel_commands;