+/* for assisting tcmdifgen and tcmdiflib.c */
+
+typedef struct TopLevel_Command TopLevel_Command;
+
+struct TopLevel_Command {
+ const char *name;
+ Tcl_ObjCmdProc *func;
+};
+
+void cht_setstringresult(Tcl_Interp*, const char*);
+int cht_pat_enum(Tcl_Interp*, Tcl_Obj*, const void**,
+ const void*, size_t, const char *what);
+
+/* from scriptinv.c */
+
+typedef struct { /* opaque; comments are for scriptinv.c impl'n only */
+ /* states: Cancelled Set */
+ Tcl_Interp *ipq; /* 0 valid, non-0, useable */
+ Tcl_Obj *script; /* 0 valid, non-0 */
+ Tcl_Obj *xargs; /* 0 valid, may be 0 */
+ int llen; /* undefined llength of script + xargs */
+} ScriptToInvoke;
+
+void cht_scriptinv_init(ScriptToInvoke *si); /* undefined -> Cancelled */
+int cht_scriptinv_set(ScriptToInvoke *si, Tcl_Interp *ip,
+ Tcl_Obj *newscript, Tcl_Obj *xargs);
+ /* Cancelled/Set -> Set (newscript!=0, ok) / Cancelled (otherwise) */
+void cht_scriptinv_cancel(ScriptToInvoke *si);
+ /* Cancelled/Set -> Cancelled. No separate free function - just cancel. */
+#define cht_scriptinv_interp(si) ((si)->ipq)
+ /* int cht_scriptinv_interp(ScriptToInvoke *si); returns 0 if Cancelled */
+
+int cht_scriptinv_invoke_fg(ScriptToInvoke *si, int argc,
+ Tcl_Obj *const *argv);
+ /* is a no-op if Cancelled rather than Set */
+ /* if script fails, returns that error */
+
+void cht_scriptinv_invoke(ScriptToInvoke *si, int argc, Tcl_Obj *const *argv);
+ /* if script fails, reports it with Tcl_BackgroundError */
+
+/* from idtable.c */