Changes On Branch tk-win32-noconsole-fix

Changes In Branch tk-win32-noconsole-fix Excluding Merge-Ins

This is equivalent to a diff from d228cbfac5 to be67e6913f

2014-03-03
21:58
Merged console fixes in check-in: 4ae3806806 user: rkeene tags: trunk
2014-02-25
02:59
Updated to use single routine for initializing interpreters Closed-Leaf check-in: be67e6913f user: rkeene tags: tk-win32-noconsole-fix
2014-02-24
17:22
Added start of test for Tk on Win32 with noconsole check-in: 9481ffeac5 user: rkeene tags: tk-win32-noconsole-fix
2014-01-22
23:34
Updated to clean up additional projects check-in: d228cbfac5 user: rkeene tags: trunk
2014-01-08
08:26
Updated to remove some extraneous libraries on Windows from being considered sub-projects check-in: b98cd9cfd8 user: rkeene tags: trunk

Modified kitsh/buildsrc/kitsh-0.0/kitInit.c from [9995cd87d7] to [8905d676cc].

99
100
101
102
103
104
105






106
107
108
109
110
111
112
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118







+
+
+
+
+
+







#      else
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow);
#      endif /* _WIN32_WCE */
#    endif /* KITSH_NEED_WINMAIN */
int main(int argc, char **argv);
#  endif /* HAVE_ACCEPTABLE_DLADDR */
#endif /* !TCLKIT_DLL */

#ifdef TCLKIT_DLL
void __attribute__((constructor)) _Tclkit_Init(void);
#else
static void _Tclkit_Init(void);
#endif

#ifdef TCLKIT_REQUIRE_TCLEXECUTABLENAME
char *tclExecutableName;
#endif

/*
 *  Attempt to load a "boot.tcl" entry from the embedded MetaKit file.
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
145
146
147
148
149
150
151

152
153
154

155
156
157
158
159
160
161







-



-







	"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"
392
393
394
395
396
397
398





399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415

416
417
418
419
420
421
422
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421



422
423
424
425
426
427
428
429







+
+
+
+
+














-
-
-
+







#endif /* TCLKIT_CAN_SET_ENCODING */

	/* Hack to get around Tcl bug 1224888.  This must be run here and
	 * in LibraryPathObjCmd because this information is needed both
	 * before and after that command is run. */
	FindAndSetExecName(interp);

#if defined(_WIN32) && defined(KIT_INCLUDES_TK)
	/* Every interpreter needs this done */
	Tk_InitConsoleChannels(interp);
#endif /* _WIN32 and KIT_INCLUDES_TK */

	return;
}

#ifndef TCLKIT_DLL
int TclKit_AppInit(Tcl_Interp *interp) {
#ifdef KIT_INCLUDES_TK
#  ifdef _WIN32
#    ifndef _WIN32_WCE
	char msgBuf[2049];
#    endif /* !_WIN32_WCE */
#  endif /* _WIN32 */
#endif /* KIT_INCLUDES_TK */

	/* Perform common initialization */
	_Tclkit_Generic_Init();

	_Tclkit_Interp_Init(interp);
	_Tclkit_Init();

	if (Tcl_Init(interp) == TCL_ERROR) {
		goto error;
	}

#ifdef KIT_INCLUDES_TK
#  ifdef _WIN32
510
511
512
513
514
515
516



517
518
519
520
521
522
523
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533







+
+
+







	if (gmfn_ret != 0) {
		return(strdup(modulename));
	}
#endif /* _WIN32 */

	return(NULL);
}
#else
# define find_tclkit_dll_path() NULL
#endif

/*
 * This function exists to allow C code to initialize a particular
 * interpreter.
 */
static int tclkit_init_initinterp(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
	char *kitdll_path;
554
555
556
557
558
559
560

561



562
563
564
565
566
567
568
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581








+

+
+
+






-
	return(tclPkgProv_ret);
}

/*
 * Initialize the Tcl system when we are loaded, that way Tcl functions
 * are ready to be used when invoked.
 */
#ifdef TCLKIT_DLL
void __attribute__((constructor)) _Tclkit_Init(void) {
#else
static void _Tclkit_Init(void) {
#endif
	Tcl_StaticPackage(0, "tclkit::init", Tclkit_init_Init, NULL);

	_Tclkit_Generic_Init();

	return;
}
#endif