chiark / gitweb /
fix it so it compiles
[chiark-tcl.git] / base / scriptinv.c
index 29651b254769d61680f542a4671d156847acea74..644459a0f0ec8ebd261ea39c10d399df2509dcc3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  */
 
-#include "chiark-tcl.h"
+#include "chiark-tcl-base.h"
 
 void cht_scriptinv_init(ScriptToInvoke *si) {
   si->obj= 0;
@@ -34,7 +34,8 @@ int cht_scriptinv_set(ScriptToInvoke *si, Tcl_Interp *ip,
   return 0;
 }  
   
-void cht_scriptinv_invoke(ScriptToInvoke *si, int argc, Tcl_Obj *const *argv) {
+int cht_scriptinv_invoke_fg(ScriptToInvoke *si, int argc,
+                           Tcl_Obj *const *argv) {
   Tcl_Obj *invoke=0;
   int i, rc;
 
@@ -60,5 +61,11 @@ void cht_scriptinv_invoke(ScriptToInvoke *si, int argc, Tcl_Obj *const *argv) {
 x_rc:
   for (i=0; i<argc; i++) Tcl_DecrRefCount(argv[i]);
   if (invoke) Tcl_DecrRefCount(invoke);
-  if (rc) Tcl_BackgroundError(si->ip);
+  return rc;
 }
+
+void cht_scriptinv_invoke(ScriptToInvoke *si, int argc, Tcl_Obj *const *argv) {
+  int rc;
+  rc= cht_scriptinv_invoke_fg(si, argc, argv);
+  if (rc) Tcl_BackgroundError(si->ip);
+}