1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/*
* tclUnixInit.c --
*
* Contains the Unix-specific interpreter initialization functions.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
* Copyright (c) 1999 by Scriptics Corporation.
* All rights reserved.
*
* RCS: @(#) $Id: tclUnixInit.c,v 1.24.8.3 2002/02/05 02:22:05 wolfsuit Exp $
*/
#if defined(HAVE_CFBUNDLE)
#include <CoreFoundation/CoreFoundation.h>
#endif
#include "tclInt.h"
#include "tclPort.h"
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/*
* tclUnixInit.c --
*
* Contains the Unix-specific interpreter initialization functions.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
* Copyright (c) 1999 by Scriptics Corporation.
* All rights reserved.
*
* RCS: @(#) $Id: tclUnixInit.c,v 1.24.8.4 2002/06/10 05:33:18 wolfsuit Exp $
*/
#if defined(HAVE_CFBUNDLE)
#include <CoreFoundation/CoreFoundation.h>
#endif
#include "tclInt.h"
#include "tclPort.h"
|
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
|
/*
* Use a DString so we can overwrite it in name compatability
* checks below.
*/
Tcl_DStringInit(&ds);
Tcl_DStringAppend(&ds, nl_langinfo(CODESET), -1);
encoding = Tcl_DStringValue(&ds);
Tcl_UtfToLower(Tcl_DStringValue(&ds));
#ifdef HAVE_LANGINFO_DEBUG
fprintf(stderr, "encoding '%s'", encoding);
#endif
if (encoding[0] == 'i' && encoding[1] == 's' && encoding[2] == 'o'
&& encoding[3] == '-') {
|
|
<
|
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
|
/*
* Use a DString so we can overwrite it in name compatability
* checks below.
*/
Tcl_DStringInit(&ds);
encoding = Tcl_DStringAppend(&ds, nl_langinfo(CODESET), -1);
Tcl_UtfToLower(Tcl_DStringValue(&ds));
#ifdef HAVE_LANGINFO_DEBUG
fprintf(stderr, "encoding '%s'", encoding);
#endif
if (encoding[0] == 'i' && encoding[1] == 's' && encoding[2] == 'o'
&& encoding[3] == '-') {
|
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
|
p++;
break;
}
}
if (*p != '\0') {
Tcl_DString ds;
Tcl_DStringInit(&ds);
Tcl_DStringAppend(&ds, p, -1);
encoding = Tcl_DStringValue(&ds);
Tcl_UtfToLower(Tcl_DStringValue(&ds));
setSysEncCode = Tcl_SetSystemEncoding(NULL, encoding);
if (setSysEncCode != TCL_OK) {
encoding = NULL;
}
Tcl_DStringFree(&ds);
}
|
|
<
|
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
|
p++;
break;
}
}
if (*p != '\0') {
Tcl_DString ds;
Tcl_DStringInit(&ds);
encoding = Tcl_DStringAppend(&ds, p, -1);
Tcl_UtfToLower(Tcl_DStringValue(&ds));
setSysEncCode = Tcl_SetSystemEncoding(NULL, encoding);
if (setSysEncCode != TCL_OK) {
encoding = NULL;
}
Tcl_DStringFree(&ds);
}
|
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
|
Tcl_SetVar(interp, "tclDefaultLibrary", defaultLibraryDir,
TCL_GLOBAL_ONLY);
Tcl_SetVar(interp, "tcl_pkgPath", pkgPath, TCL_GLOBAL_ONLY);
#ifdef HAVE_CFBUNDLE
}
#endif /* HAVE_CFBUNDLE */
Tcl_SetVar2(interp, "tcl_platform", "platform", "unix", TCL_GLOBAL_ONLY);
unameOK = 0;
#ifndef NO_UNAME
if (uname(&name) >= 0) {
CONST char *native;
unameOK = 1;
|
|
>
>
>
|
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
|
Tcl_SetVar(interp, "tclDefaultLibrary", defaultLibraryDir,
TCL_GLOBAL_ONLY);
Tcl_SetVar(interp, "tcl_pkgPath", pkgPath, TCL_GLOBAL_ONLY);
#ifdef HAVE_CFBUNDLE
}
#endif /* HAVE_CFBUNDLE */
#ifdef DJGPP
Tcl_SetVar2(interp, "tcl_platform", "platform", "dos", TCL_GLOBAL_ONLY);
#else
Tcl_SetVar2(interp, "tcl_platform", "platform", "unix", TCL_GLOBAL_ONLY);
#endif
unameOK = 0;
#ifndef NO_UNAME
if (uname(&name) >= 0) {
CONST char *native;
unameOK = 1;
|