Tcl Source Code

Check-in [3c9828933f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:rebase TIP 414 implementation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | initsubsystems
Files: files | file ages | folders
SHA1: 3c9828933f0b421cbe326106b90eef9c11977db1
User & Date: jan.nijtmans 2013-08-19 09:05:33
Context
2013-09-07
08:06
Rebase TIP #414 implementation. check-in: eb51174a19 user: jan.nijtmans tags: initsubsystems
2013-08-19
09:05
rebase TIP 414 implementation check-in: 3c9828933f user: jan.nijtmans tags: initsubsystems
2013-08-15
19:59
Make sure the errors raised by execution traces become errors raised by the traced command, as docum... check-in: 04da25f2f5 user: dgp tags: trunk
2013-08-11
15:21
rebase check-in: 73c73ec2b4 user: jan.nijtmans tags: initsubsystems
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added doc/InitSubSyst.3.



















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'\"
'\" Copyright (c) 2013 Tcl Core Team
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
.so man.macros
.TH Tcl_InitSubsystems 3 8.6.1 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_InitSubsystems \- initialize the Tcl library.
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
const char *
\fBTcl_InitSubsystems\fR(\fIpanicProc\fR)
.SH ARGUMENTS
.SH ARGUMENTS
.AS Tcl_PanicProc *panicProc
.AP Tcl_PanicProc *panicProc in
Desired panic function, for error reporting. If NULL, the default
panicProc is used, which normally writes the message to stderr.
.BE

.SH DESCRIPTION
.PP
The \fBTcl_InitSubsystems\fR procedure initializes the Tcl
library. This procedure is typically invoked as the very
first thing in the application's main program.
.PP
\fBTcl_InitSubsystems\fR is very similar in use to
\fBTcl_FindExecutable\fR. It can be used when Tcl is
used as utility library, no other encodings than utf8,
iso8859-1 or unicode are used, and no interest exists in the
value of \fBinfo nameofexecutable\fR. The system encoding will not
be extracted from the environment, but falls back to iso8859-1.
.PP
The return value is the Tcl version.
.SH KEYWORDS
binary, executable file

Changes to generic/tcl.h.

2393
2394
2395
2396
2397
2398
2399

2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412






2413
2414
2415
2416
2417
2418
2419
 * main library in case an extension is statically linked into an application.
 */

const char *		Tcl_InitStubs(Tcl_Interp *interp, const char *version,
			    int exact);
const char *		TclTomMathInitializeStubs(Tcl_Interp *interp,
			    const char *version, int epoch, int revision);


/*
 * When not using stubs, make it a macro.
 */

#ifndef USE_TCL_STUBS
#define Tcl_InitStubs(interp, version, exact) \
    Tcl_PkgInitStubsCheck(interp, version, exact)
#endif

/*
 * TODO - tommath stubs export goes here!
 */







/*
 * Public functions that are not accessible via the stubs table.
 * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
 */

#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \







>













>
>
>
>
>
>







2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
 * main library in case an extension is statically linked into an application.
 */

const char *		Tcl_InitStubs(Tcl_Interp *interp, const char *version,
			    int exact);
const char *		TclTomMathInitializeStubs(Tcl_Interp *interp,
			    const char *version, int epoch, int revision);


/*
 * When not using stubs, make it a macro.
 */

#ifndef USE_TCL_STUBS
#define Tcl_InitStubs(interp, version, exact) \
    Tcl_PkgInitStubsCheck(interp, version, exact)
#endif

/*
 * TODO - tommath stubs export goes here!
 */

/* Tcl_InitSubsystems, see TIP #414 */

#ifndef USE_TCL_STUBS
    EXTERN const char *Tcl_InitSubsystems(Tcl_PanicProc *panicProc);
#endif

/*
 * Public functions that are not accessible via the stubs table.
 * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
 */

#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \

Changes to generic/tclEncoding.c.

1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427

















1428
1429
1430
1431
1432
1433
1434

    return result;
}

/*
 *---------------------------------------------------------------------------
 *
 * Tcl_FindExecutable --
 *
 *	This function computes the absolute path name of the current
 *	application, given its argv[0] value.
 *
 * Results:
 *	None.
 *
 * Side effects:
 *	The absolute pathname for the application is computed and stored to be
 *	returned later be [info nameofexecutable].
 *
 *---------------------------------------------------------------------------
 */

















#undef Tcl_FindExecutable
void
Tcl_FindExecutable(
    const char *argv0)		/* The value of the application's argv[0]
				 * (native). */
{
    TclInitSubsystems();







|

|
|






|



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451

    return result;
}

/*
 *---------------------------------------------------------------------------
 *
 * Tcl_InitSubsystems/Tcl_FindExecutable --
 *
 *	This function initializes everything needed for the Tcl library
 *	to be able to operate.
 *
 * Results:
 *	None.
 *
 * Side effects:
 *	The absolute pathname for the application is computed and stored to be
 *	returned later by [info nameofexecutable].
 *
 *---------------------------------------------------------------------------
 */
MODULE_SCOPE const TclStubs tclStubs;

static const struct {
    const TclStubs *stubs;
    const char version[12];
} stubInfo = {
    &tclStubs, TCL_PATCH_LEVEL
};

const char *
Tcl_InitSubsystems(Tcl_PanicProc *panicProc)
{
    Tcl_SetPanicProc(panicProc);
    TclInitSubsystems();
    return stubInfo.version;
}

#undef Tcl_FindExecutable
void
Tcl_FindExecutable(
    const char *argv0)		/* The value of the application's argv[0]
				 * (native). */
{
    TclInitSubsystems();