README and rename of startup script.
[ir-tcl-moved-to-github.git] / ir-tcl.c
index aac5e4d..bb22467 100644 (file)
--- a/ir-tcl.c
+++ b/ir-tcl.c
@@ -5,7 +5,13 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ir-tcl.c,v $
- * Revision 1.32  1995-05-29 08:44:16  adam
+ * Revision 1.34  1995-05-29 10:33:42  adam
+ * README and rename of startup script.
+ *
+ * Revision 1.33  1995/05/29  09:15:11  quinn
+ * Changed CS_SR to PROTO_SR, etc.
+ *
+ * Revision 1.32  1995/05/29  08:44:16  adam
  * Work on delete of objects.
  *
  * Revision 1.31  1995/05/26  11:44:10  adam
@@ -759,7 +765,7 @@ static int do_connect (void *obj, Tcl_Interp *interp,
     void *addr;
     IRObj *p = obj;
     int r;
-    int protocol_type = CS_Z3950;
+    int protocol_type = PROTO_Z3950;
 
     if (argc <= 0)
         return TCL_OK;
@@ -771,9 +777,9 @@ static int do_connect (void *obj, Tcl_Interp *interp,
             return TCL_ERROR;
         }
         if (!strcmp (p->protocol_type, "Z3950"))
-            protocol_type = CS_Z3950;
+            protocol_type = PROTO_Z3950;
         else if (!strcmp (p->protocol_type, "SR"))
-            protocol_type = CS_SR;
+            protocol_type = PROTO_SR;
         else
         {
             interp->result = "bad protocol type";
@@ -1806,7 +1812,7 @@ static void ir_set_obj_delete (ClientData clientData)
  * ir_set_obj_mk: IR Set Object creation
  */
 static int ir_set_obj_mk (ClientData clientData, Tcl_Interp *interp,
-                            int argc, char **argv)
+                          int argc, char **argv)
 {
     IRMethods tabs[3];
     IRSetObj *obj;
@@ -1816,6 +1822,8 @@ static int ir_set_obj_mk (ClientData clientData, Tcl_Interp *interp,
         interp->result = "wrong # args";
         return TCL_ERROR;
     }
+    if (!(obj = ir_malloc (interp, sizeof(*obj))))
+        return TCL_ERROR;
     else if (argc == 3)
     {
         Tcl_CmdInfo parent_info;
@@ -1828,8 +1836,6 @@ static int ir_set_obj_mk (ClientData clientData, Tcl_Interp *interp,
             interp->result = "No parent";
             return TCL_ERROR;
         }
-        if (!(obj = ir_malloc (interp, sizeof(*obj))))
-            return TCL_ERROR;
         obj->parent = (IRObj *) parent_info.clientData;
 
         dst = &obj->set_inher;
@@ -2172,7 +2178,7 @@ static int ir_scan_obj_mk (ClientData clientData, Tcl_Interp *interp,
         return TCL_ERROR;
 
     tabs[0].tab = ir_scan_method_tab;
-    tabs[0].obj = clientData;
+    tabs[0].obj = obj;
     tabs[1].tab = NULL;
 
     if (ir_method (interp, 0, NULL, tabs) == TCL_ERROR)