Diff

Differences From Artifact [901380bcbe]:

To Artifact [50169ff8c3]:


133
134
135
136
137
138
139

140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157


158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
	"info script $old\n"
	"if {$code == 2} { set code 0 }\n"
	"return -code $code $res\n"
"}\n"
#endif /* _WIN32_WCE && !TCLKIT_DLL */
"proc tclKitInit {} {\n"
	"rename tclKitInit {}\n"

#ifdef KIT_INCLUDES_ZLIB
	"catch { load {} zlib }\n"
#endif
#ifdef KIT_INCLUDES_MK4TCL
	"catch { load {} Mk4tcl }\n"
#endif
#ifdef TCLKIT_DLL
	"load {} tclkit::init\n"
	"::tclkit::init::initInterp\n"
	"rename ::tclkit::init::initInterp {}\n"
#endif /* TCLKIT_DLL */
	"set bootfile [file join " TCLKIT_MOUNTPOINT " boot.tcl]\n"
	"if {[file exists $bootfile]} {\n"
		"catch {\n"
			"set f [open $bootfile]\n"
			"set s [read $f]\n"
			"close $f\n"
		"}\n"


	"}\n"
#ifdef KIT_STORAGE_MK4
	"set ::tclKitStorage \"mk4\"\n"
	"if {![info exists s]} {\n"
		"mk::file open exe " TCLKIT_VFSSOURCE " -readonly\n"
		"set n [mk::select exe.dirs!0.files name boot.tcl]\n"
		"if {$n != \"\"} {\n"
			"set s [mk::get exe.dirs!0.files!$n contents]\n"
			"if {![string length $s]} { error \"empty boot.tcl\" }\n"
			"catch {load {} zlib}\n"
			"if {[mk::get exe.dirs!0.files!$n size] != [string length $s]} {\n"
				"set s [zlib decompress $s]\n"
			"}\n"
		"}\n"
	"}\n"
#endif /* KIT_STORAGE_MK4 */
#ifdef KIT_STORAGE_ZIP
	"set ::tclKitStorage \"zip\"\n"
	"catch { load {} vfs }\n"
	"if {![info exists s]} {\n"
#  include "zipvfs.tcl.h"
		"catch {\n"
			"set ::tclKitStorage_fd [::zip::open " TCLKIT_VFSSOURCE "]\n"
			"::zip::stat $::tclKitStorage_fd boot.tcl sb\n"
			"seek $::tclKitStorage_fd $sb(ino)\n"
			"::zip::Data $::tclKitStorage_fd sb s\n"
		"}\n"
	"}\n"
#endif /* KIT_STORAGE_ZIP */
#ifdef KIT_STORAGE_CVFS
	"set ::tclKitStorage \"cvfs\"\n"
	"load {} rechan\n"
	"load {} vfs\n"
	"load {} cvfs_data_tcl\n"
#include "cvfs.tcl.h"
	"if {![info exists s]} {\n"
		"catch {\n"
			"set s [::vfs::cvfs::data::getData tcl boot.tcl]\n"
		"}\n"
	"}\n"







>


















>
>


















<













<







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178

179
180
181
182
183
184
185
186
187
188
189
190
191

192
193
194
195
196
197
198
	"info script $old\n"
	"if {$code == 2} { set code 0 }\n"
	"return -code $code $res\n"
"}\n"
#endif /* _WIN32_WCE && !TCLKIT_DLL */
"proc tclKitInit {} {\n"
	"rename tclKitInit {}\n"
	"catch { load {} vfs }\n"
#ifdef KIT_INCLUDES_ZLIB
	"catch { load {} zlib }\n"
#endif
#ifdef KIT_INCLUDES_MK4TCL
	"catch { load {} Mk4tcl }\n"
#endif
#ifdef TCLKIT_DLL
	"load {} tclkit::init\n"
	"::tclkit::init::initInterp\n"
	"rename ::tclkit::init::initInterp {}\n"
#endif /* TCLKIT_DLL */
	"set bootfile [file join " TCLKIT_MOUNTPOINT " boot.tcl]\n"
	"if {[file exists $bootfile]} {\n"
		"catch {\n"
			"set f [open $bootfile]\n"
			"set s [read $f]\n"
			"close $f\n"
		"}\n"
	"} else {\n"
		"set ::TCLKIT_INITVFS 1\n"
	"}\n"
#ifdef KIT_STORAGE_MK4
	"set ::tclKitStorage \"mk4\"\n"
	"if {![info exists s]} {\n"
		"mk::file open exe " TCLKIT_VFSSOURCE " -readonly\n"
		"set n [mk::select exe.dirs!0.files name boot.tcl]\n"
		"if {$n != \"\"} {\n"
			"set s [mk::get exe.dirs!0.files!$n contents]\n"
			"if {![string length $s]} { error \"empty boot.tcl\" }\n"
			"catch {load {} zlib}\n"
			"if {[mk::get exe.dirs!0.files!$n size] != [string length $s]} {\n"
				"set s [zlib decompress $s]\n"
			"}\n"
		"}\n"
	"}\n"
#endif /* KIT_STORAGE_MK4 */
#ifdef KIT_STORAGE_ZIP
	"set ::tclKitStorage \"zip\"\n"

	"if {![info exists s]} {\n"
#  include "zipvfs.tcl.h"
		"catch {\n"
			"set ::tclKitStorage_fd [::zip::open " TCLKIT_VFSSOURCE "]\n"
			"::zip::stat $::tclKitStorage_fd boot.tcl sb\n"
			"seek $::tclKitStorage_fd $sb(ino)\n"
			"::zip::Data $::tclKitStorage_fd sb s\n"
		"}\n"
	"}\n"
#endif /* KIT_STORAGE_ZIP */
#ifdef KIT_STORAGE_CVFS
	"set ::tclKitStorage \"cvfs\"\n"
	"load {} rechan\n"

	"load {} cvfs_data_tcl\n"
#include "cvfs.tcl.h"
	"if {![info exists s]} {\n"
		"catch {\n"
			"set s [::vfs::cvfs::data::getData tcl boot.tcl]\n"
		"}\n"
	"}\n"
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
	/* the tcl_rcFileName variable only exists in the initial interpreter */
#  ifdef _WIN32
	Tcl_SetVar(interp, "tcl_rcFileName", "~/tclkitrc.tcl", TCL_GLOBAL_ONLY);
#  else
	Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclkitrc", TCL_GLOBAL_ONLY);
#  endif /* _WIN32 */
#endif /* !TCLKIT_DLL */
	Tcl_SetVar(interp, "TCLKIT_INITVFS", "1", TCL_GLOBAL_ONLY);

#ifdef TCLKIT_CAN_SET_ENCODING
	/* Set the encoding from the Environment */
	Tcl_GetEncodingNameFromEnvironment(&encodingName);
	Tcl_SetSystemEncoding(NULL, Tcl_DStringValue(&encodingName));
	Tcl_SetVar(interp, "tclkit_system_encoding", Tcl_DStringValue(&encodingName), 0);
	Tcl_DStringFree(&encodingName);







<







383
384
385
386
387
388
389

390
391
392
393
394
395
396
	/* the tcl_rcFileName variable only exists in the initial interpreter */
#  ifdef _WIN32
	Tcl_SetVar(interp, "tcl_rcFileName", "~/tclkitrc.tcl", TCL_GLOBAL_ONLY);
#  else
	Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclkitrc", TCL_GLOBAL_ONLY);
#  endif /* _WIN32 */
#endif /* !TCLKIT_DLL */


#ifdef TCLKIT_CAN_SET_ENCODING
	/* Set the encoding from the Environment */
	Tcl_GetEncodingNameFromEnvironment(&encodingName);
	Tcl_SetSystemEncoding(NULL, Tcl_DStringValue(&encodingName));
	Tcl_SetVar(interp, "tclkit_system_encoding", Tcl_DStringValue(&encodingName), 0);
	Tcl_DStringFree(&encodingName);