diff options
author | cvs2fossil <cvs2fossil> | 2011-01-25 19:02:56 (GMT) |
---|---|---|
committer | cvs2fossil <cvs2fossil> | 2011-01-25 19:02:56 (GMT) |
commit | 352fce86be9d102b2284de839b7f7ff94ed971f2 (patch) | |
tree | e454e0d4460f15029e4ed5ae3f3131a992445426 /win | |
parent | 75f084f6970d2344bb5a82fdff6a73825bc6e64e (diff) | |
download | tcl-dgp_refactor_merge_synthetic.zip tcl-dgp_refactor_merge_synthetic.tar.gz tcl-dgp_refactor_merge_synthetic.tar.bz2 |
Created branch dgp-refactor-merge-syntheticdgp_refactor_mergedgp_refactor_merge_synthetic
Diffstat (limited to 'win')
-rw-r--r-- | win/README.binary | 143 | ||||
-rw-r--r-- | win/stub16.c | 197 | ||||
-rw-r--r-- | win/tclWinMtherr.c | 53 | ||||
-rw-r--r-- | win/tclWinThrd.h | 21 |
4 files changed, 414 insertions, 0 deletions
diff --git a/win/README.binary b/win/README.binary new file mode 100644 index 0000000..c5d1285 --- /dev/null +++ b/win/README.binary @@ -0,0 +1,143 @@ +Tcl/Tk 8.5 for Windows, Binary Distribution + +RCS: @(#) $Id: README.binary,v 1.43 2006/10/23 19:42:19 dgp Exp $ + +1. Introduction +--------------- + +This directory contains the binary distribution of Tcl/Tk 8.5a6 for +Windows. It was compiled with Microsoft Visual C++ 6.0 using Win32 +API, so that it will run under Windows 98, NT, 2000 and XP. + +Tcl provides a powerful platform for creating integration applications +that tie together diverse applications, protocols, devices, and +frameworks. When paired with the Tk toolkit, Tcl provides the fastest +and most powerful way to create GUI applications that run on PCs, Unix, +and Mac OS X. Tcl can also be used for a variety of web-related +tasks and for creating powerful command languages for applications. + +Tcl is maintained, enhanced, and distributed freely by the Tcl community. + +2. Documentation +---------------- + +The home of Tcl and Tk sources and bug database on the Web is at: + http://tcl.sourceforge.net/ + +The home page for the Tcl Developer Xchange is at: + http://www.tcl.tk/ + +The home page for the Tcl/Tk 8.5 release is + http://www.tcl.tk/software/tcltk/8.5.html + +Detailed release notes can be found at the file distributions page +by clicking on the relevant version. + http://sourceforge.net/project/showfiles.php?group_id=10894 + +Information about Tcl itself can be found at + http://www.tcl.tk/scripting/ + +There are many Tcl books on the market. Most are listed at + http://www.tcl.tk/resource/doc/books/ + +There are notes about compiling Tcl at + http://www.tcl.tk/doc/howto/compile.html + +3. Installation +--------------- + +The binary release is distributed as a self-extracting archive called +tcl<version>.exe. The setup program which will prompt you for an +installation directory. It will create the installation heirarchy +under the specified directory, and install a wish application icon +under the program manager group of your choice. + +We are no longer supporting use of Tcl with 16-bit versions of +Windows. Microsoft has completely dropped support of the Win32s +subsystem. + +4. Linking against the binary release +-------------------------------------- + +In order to link your applications against the .dll files shipped with +this release, you will need to use the appropriate .lib file for your +compiler. In the lib directory of the installation directory, there +are library files for the Microsoft Visual C++ compiler: + + tcl85.lib + tk85.lib + +5. Building dynamically loadable extensions +-------------------------------------------- + +Please refer to the example dynamically loadable extension provided on +our ftp site: + + ftp://ftp.scriptics.com/pub/tcl/misc/example.zip + +This archive contains a template that you can use for building +extensions that will be loadable on Unix, Windows, and Mac OS X +systems. + +6. Reporting Bugs +----------------- +If you have comments or bug reports for the Windows version of Tcl, +please use our online database at: + + http://tcl.sourceforge.net/ + +or post them to the newsgroup comp.lang.tcl. + +7. Tcl newsgroup +----------------- + +There is a network news group "comp.lang.tcl" intended for the exchange +of information about Tcl, Tk, and related applications. Feel free to use +the newsgroup both for general information questions and for bug reports. +We read the newsgroup and will attempt to fix bugs and problems reported +to it. + +When using comp.lang.tcl, please be sure that your e-mail return address +is correctly set in your postings. This allows people to respond directly +to you, rather than the entire newsgroup, for answers that are not of +general interest. A bad e-mail return address may prevent you from +getting answers to your questions. You may have to reconfigure your news +reading software to ensure that it is supplying valid e-mail addresses. + +8. Tcl contributed archive +-------------------------- + +Many people have created exciting packages and applications based on Tcl +and/or Tk and made them freely available to the Tcl community. An archive +of these contributions is kept on the machine ftp.neosoft.com. You +can access the archive using anonymous FTP; the Tcl contributed archive is +in the directory "/pub/tcl". The archive also contains several FAQ +("frequently asked questions") documents that provide solutions to problems +that are commonly encountered by TCL newcomers. + +9. Tcl Resource Center +---------------------- + +Visit http://www.tcl.tk/resource/ to see an annotated index of +many Tcl resources available on the World Wide Web. This includes papers, +books, and FAQs, as well as extensions, applications, binary releases, and +patches. You can contribute patches by using the Tracker at + + http://tcl.sourceforge.net/ + +You can also recommend more URLs for the resource center using the forms +labeled "Add a Resource". + +10. Mailing lists +---------------- + +Several mailing lists are hosted at SourceForge to discuss development or +use issues (like Macintosh and Windows topics). For more information and +to subscribe, visit: + + http://sourceforge.net/projects/tcl/ + +and go to the Mailing Lists page. There are also Special Interest Groups +(SIGs) setup for these topics and more at: + + http://www.tcl.tk/ diff --git a/win/stub16.c b/win/stub16.c new file mode 100644 index 0000000..52460c3 --- /dev/null +++ b/win/stub16.c @@ -0,0 +1,197 @@ +/* + * stub16.c + * + * A helper program used for running 16-bit DOS applications under + * Windows 95. + * + * Copyright (c) 1996 by Sun Microsystems, Inc. + * + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: @(#) $Id: stub16.c,v 1.6 2010/03/20 12:00:41 nijtmans Exp $ + */ + +#define STRICT + +#include <windows.h> +#include <stdio.h> + +static HANDLE CreateTempFile(void); + +/* + *--------------------------------------------------------------------------- + * + * main + * + * Entry point for the 32-bit console mode app used by Windows 95 to help + * run the 16-bit program specified on the command line. + * + * 1. EOF on a pipe that connects a detached 16-bit process and a 32-bit + * process is never seen. So, this process runs the 16-bit process + * _attached_, and then it is run detached from the calling 32-bit + * process. + * + * 2. If a 16-bit process blocks reading from or writing to a pipe, it + * never wakes up, and eventually brings the whole system down with it if + * you try to kill the process. This app simulates pipes. If any of the + * stdio handles is a pipe, this program accumulates information into + * temp files and forwards it to or from the DOS application as + * appropriate. This means that this program must receive EOF from a + * stdin pipe before it will actually start the DOS app, and the DOS app + * must finish generating stdout or stderr before the data will be sent + * to the next stage of the pipe. If the stdio handles are not pipes, no + * accumulation occurs and the data is passed straight through to and + * from the DOS application. + * + * Results: + * None. + * + * Side effects: + * The child process is created and this process waits for it to + * complete. + * + *--------------------------------------------------------------------------- + */ + +int +main(void) +{ + DWORD dwRead, dwWrite; + char *cmdLine; + HANDLE hStdInput, hStdOutput, hStdError; + HANDLE hFileInput, hFileOutput, hFileError; + STARTUPINFOA si; + PROCESS_INFORMATION pi; + char buf[8192]; + DWORD result; + + hFileInput = INVALID_HANDLE_VALUE; + hFileOutput = INVALID_HANDLE_VALUE; + hFileError = INVALID_HANDLE_VALUE; + result = 1; + + /* + * Don't get command line from argc, argv, because the command line + * tokenizer will have stripped off all the escape sequences needed for + * quotes and backslashes, and then we'd have to put them all back in + * again. Get the raw command line and parse off what we want ourselves. + * The command line should be of the form: + * + * stub16.exe program arg1 arg2 ... + */ + + cmdLine = strchr(GetCommandLineA(), ' '); + if (cmdLine == NULL) { + return 1; + } + cmdLine++; + + hStdInput = GetStdHandle(STD_INPUT_HANDLE); + hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); + hStdError = GetStdHandle(STD_ERROR_HANDLE); + + if (GetFileType(hStdInput) == FILE_TYPE_PIPE) { + hFileInput = CreateTempFile(); + if (hFileInput == INVALID_HANDLE_VALUE) { + goto cleanup; + } + while (ReadFile(hStdInput, buf, sizeof(buf), &dwRead, NULL) != FALSE) { + if (dwRead == 0) { + break; + } + if (WriteFile(hFileInput, buf, dwRead, &dwWrite, NULL) == FALSE) { + goto cleanup; + } + } + SetFilePointer(hFileInput, 0, 0, FILE_BEGIN); + SetStdHandle(STD_INPUT_HANDLE, hFileInput); + } + if (GetFileType(hStdOutput) == FILE_TYPE_PIPE) { + hFileOutput = CreateTempFile(); + if (hFileOutput == INVALID_HANDLE_VALUE) { + goto cleanup; + } + SetStdHandle(STD_OUTPUT_HANDLE, hFileOutput); + } + if (GetFileType(hStdError) == FILE_TYPE_PIPE) { + hFileError = CreateTempFile(); + if (hFileError == INVALID_HANDLE_VALUE) { + goto cleanup; + } + SetStdHandle(STD_ERROR_HANDLE, hFileError); + } + + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); + if (CreateProcessA(NULL, cmdLine, NULL, NULL, TRUE, 0, NULL, NULL, &si, + &pi) == FALSE) { + goto cleanup; + } + + WaitForInputIdle(pi.hProcess, 5000); + WaitForSingleObject(pi.hProcess, INFINITE); + GetExitCodeProcess(pi.hProcess, &result); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + + if (hFileOutput != INVALID_HANDLE_VALUE) { + SetFilePointer(hFileOutput, 0, 0, FILE_BEGIN); + while (ReadFile(hFileOutput, buf, sizeof(buf), &dwRead, NULL) != FALSE) { + if (dwRead == 0) { + break; + } + if (WriteFile(hStdOutput, buf, dwRead, &dwWrite, NULL) == FALSE) { + break; + } + } + } + if (hFileError != INVALID_HANDLE_VALUE) { + SetFilePointer(hFileError, 0, 0, FILE_BEGIN); + while (ReadFile(hFileError, buf, sizeof(buf), &dwRead, NULL) != FALSE) { + if (dwRead == 0) { + break; + } + if (WriteFile(hStdError, buf, dwRead, &dwWrite, NULL) == FALSE) { + break; + } + } + } + + cleanup: + if (hFileInput != INVALID_HANDLE_VALUE) { + CloseHandle(hFileInput); + } + if (hFileOutput != INVALID_HANDLE_VALUE) { + CloseHandle(hFileOutput); + } + if (hFileError != INVALID_HANDLE_VALUE) { + CloseHandle(hFileError); + } + CloseHandle(hStdInput); + CloseHandle(hStdOutput); + CloseHandle(hStdError); + ExitProcess(result); + return 1; +} + +static HANDLE +CreateTempFile(void) +{ + char name[MAX_PATH]; + SECURITY_ATTRIBUTES sa; + + if (GetTempPathA(MAX_PATH, name) == 0) { + return INVALID_HANDLE_VALUE; + } + if (GetTempFileNameA(name, "tcl", 0, name) == 0) { + return INVALID_HANDLE_VALUE; + } + + sa.nLength = sizeof(sa); + sa.lpSecurityDescriptor = NULL; + sa.bInheritHandle = TRUE; + return CreateFileA(name, GENERIC_READ | GENERIC_WRITE, 0, &sa, + CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, + NULL); +} diff --git a/win/tclWinMtherr.c b/win/tclWinMtherr.c new file mode 100644 index 0000000..b90c0f2 --- /dev/null +++ b/win/tclWinMtherr.c @@ -0,0 +1,53 @@ +/* + * tclWinMtherr.c -- + * + * This function provides a default implementation of the + * _matherr function for Borland C++. + * + * Copyright (c) 1995 Sun Microsystems, Inc. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: @(#) $Id: tclWinMtherr.c,v 1.5 2002/05/31 22:20:22 dgp Exp $ + */ + +#include "tclWinInt.h" +#include <math.h> + + +/* + *---------------------------------------------------------------------- + * + * _matherr -- + * + * This procedure is invoked by Borland C++ when certain + * errors occur in mathematical functions. This procedure + * replaces the default implementation which generates pop-up + * warnings. + * + * Results: + * Returns 1 to indicate that we've handled the error + * locally. + * + * Side effects: + * Sets errno based on what's in xPtr. + * + *---------------------------------------------------------------------- + */ + +int +_matherr(xPtr) + struct exception *xPtr; /* Describes error that occurred. */ +{ + if ((xPtr->type == DOMAIN) +#ifdef __BORLANDC__ + || (xPtr->type == TLOSS) +#endif + || (xPtr->type == SING)) { + errno = EDOM; + } else { + errno = ERANGE; + } + return 1; +} diff --git a/win/tclWinThrd.h b/win/tclWinThrd.h new file mode 100644 index 0000000..2572d1b --- /dev/null +++ b/win/tclWinThrd.h @@ -0,0 +1,21 @@ +/* + * tclWinThrd.h -- + * + * This header file defines things for thread support. + * + * Copyright (c) 1998 Sun Microsystems, Inc. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * SCCS: @(#) tclWinThrd.h 1.2 98/01/27 11:48:05 + */ + +#ifndef _TCLWINTHRD +#define _TCLWINTHRD + +#ifdef TCL_THREADS + +#endif /* TCL_THREADS */ + +#endif /* _TCLWINTHRD */ |