summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.h
blob: afe3f3e48123ae907973f2591e030a09381ee20e (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
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
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
/*
 * tclCompile.h --
 *
 * Copyright (c) 1996-1997 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: tclCompile.h,v 1.8 1998/09/14 18:39:58 stanton Exp $
 */

#ifndef _TCLCOMPILATION
#define _TCLCOMPILATION 1

#ifndef _TCLINT
#include "tclInt.h"
#endif /* _TCLINT */

#ifdef BUILD_tcl
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif

/*
 *------------------------------------------------------------------------
 * Variables related to compilation. These are used in tclCompile.c,
 * tclExecute.c, tclBasic.c, and their clients.
 *------------------------------------------------------------------------
 */

/*
 * Variable that denotes the command name Tcl object type. Objects of this
 * type cache the Command pointer that results from looking up command names
 * in the command hashtable.
 */

extern Tcl_ObjType	tclCmdNameType;

/*
 * Variable that controls whether compilation tracing is enabled and, if so,
 * what level of tracing is desired:
 *    0: no compilation tracing
 *    1: summarize compilation of top level cmds and proc bodies
 *    2: display all instructions of each ByteCode compiled
 * This variable is linked to the Tcl variable "tcl_traceCompile".
 */

extern int 		tclTraceCompile;

/*
 * Variable that controls whether execution tracing is enabled and, if so,
 * what level of tracing is desired:
 *    0: no execution tracing
 *    1: trace invocations of Tcl procs only
 *    2: trace invocations of all (not compiled away) commands
 *    3: display each instruction executed
 * This variable is linked to the Tcl variable "tcl_traceExec".
 */

extern int 		tclTraceExec;

/*
 * The number of bytecode compilations and various other compilation-related
 * statistics. The tclByteCodeCount and tclSourceCount arrays are used to
 * hold the count of ByteCodes and sources whose sizes fall into various
 * binary decades; e.g., tclByteCodeCount[5] is a count of the ByteCodes
 * with size larger than 2**4 and less than or equal to 2**5.
 */

#ifdef TCL_COMPILE_STATS
extern long		tclNumCompilations;
extern double		tclTotalSourceBytes;
extern double		tclTotalCodeBytes;

extern double		tclTotalInstBytes;
extern double		tclTotalObjBytes;
extern double		tclTotalExceptBytes;
extern double		tclTotalAuxBytes;
extern double		tclTotalCmdMapBytes;

extern double		tclCurrentSourceBytes;
extern double		tclCurrentCodeBytes;

extern int		tclSourceCount[32];
extern int		tclByteCodeCount[32];
#endif /* TCL_COMPILE_STATS */

/*
 *------------------------------------------------------------------------
 * Data structures related to compilation.
 *------------------------------------------------------------------------
 */

/*
 * The structure used to implement Tcl "exceptions" (exceptional returns):
 * for example, those generated in loops by the break and continue commands,
 * and those generated by scripts and caught by the catch command. This
 * ExceptionRange structure describes a range of code (e.g., a loop body),
 * the kind of exceptions (e.g., a break or continue) that might occur, and
 * the PC offsets to jump to if a matching exception does occur. Exception
 * ranges can nest so this structure includes a nesting level that is used
 * at runtime to find the closest exception range surrounding a PC. For
 * example, when a break command is executed, the ExceptionRange structure
 * for the most deeply nested loop, if any, is found and used. These
 * structures are also generated for the "next" subcommands of for loops
 * since a break there terminates the for command. This means a for command
 * actually generates two LoopInfo structures.
 */

typedef enum {
    LOOP_EXCEPTION_RANGE,	/* Code range is part of a loop command.
				 * break and continue "exceptions" cause
				 * jumps to appropriate PC offsets. */
    CATCH_EXCEPTION_RANGE	/* Code range is controlled by a catch
				 * command. Errors in the range cause a
				 * jump to a particular PC offset. */
} ExceptionRangeType;

typedef struct ExceptionRange {
    ExceptionRangeType type;	/* The kind of ExceptionRange. */
    int nestingLevel;		/* Static depth of the exception range.
				 * Used to find the most deeply-nested
				 * range surrounding a PC at runtime. */
    int codeOffset;		/* Offset of the first instruction byte of
				 * the code range. */
    int numCodeBytes;		/* Number of bytes in the code range. */
    int breakOffset;		/* If a LOOP_EXCEPTION_RANGE, the target
				 * PC offset for a break command in the
				 * range. */
    int continueOffset;		/* If a LOOP_EXCEPTION_RANGE and not -1,
				 * the target PC offset for a continue
				 * command in the code range. Otherwise,
				 * ignore this range when processing a
				 * continue command. */
    int catchOffset;		/* If a CATCH_EXCEPTION_RANGE, the target PC
				 * offset for an "exception" in range. */
} ExceptionRange;

/*
 * Structure used to map between instruction pc and source locations. It
 * defines for each compiled Tcl command its code's starting offset and 
 * its source's starting offset and length. Note that the code offset
 * increases monotonically: that is, the table is sorted in code offset
 * order. The source offset is not monotonic.
 */

typedef struct CmdLocation {
    int codeOffset;		/* Offset of first byte of command code. */
    int numCodeBytes;		/* Number of bytes for command's code. */
    int srcOffset;		/* Offset of first char of the command. */
    int numSrcChars;		/* Number of command source chars. */
} CmdLocation;

/*
 * CompileProcs need the ability to record information during compilation
 * that can be used by bytecode instructions during execution. The AuxData
 * structure provides this "auxiliary data" mechanism. An arbitrary number
 * of these structures can be stored in the ByteCode record (during
 * compilation they are stored in a CompileEnv structure). Each AuxData
 * record holds one word of client-specified data (often a pointer) and is
 * given an index that instructions can later use to look up the structure
 * and its data.
 *
 * The following definitions declare the types of procedures that are called
 * to duplicate or free this auxiliary data when the containing ByteCode
 * objects are duplicated and freed. Pointers to these procedures are kept
 * in the AuxData structure.
 */

typedef ClientData (AuxDataDupProc)  _ANSI_ARGS_((ClientData clientData));
typedef void       (AuxDataFreeProc) _ANSI_ARGS_((ClientData clientData));

/*
 * We define a separate AuxDataType struct to hold type-related information
 * for the AuxData structure. This separation makes it possible for clients
 * outside of the TCL core to manipulate (in a limited fashion!) AuxData;
 * for example, it makes it possible to pickle and unpickle AuxData structs.
 */

typedef struct AuxDataType {
    char *name;					/* the name of the type. Types can be
                                 * registered and found by name */
    AuxDataDupProc *dupProc;	/* Callback procedure to invoke when the
                                 * aux data is duplicated (e.g., when the
                                 * ByteCode structure containing the aux
                                 * data is duplicated). NULL means just
                                 * copy the source clientData bits; no
                                 * proc need be called. */
    AuxDataFreeProc *freeProc;	/* Callback procedure to invoke when the
                                 * aux data is freed. NULL means no
                                 * proc need be called. */
} AuxDataType;

/*
 * The definition of the AuxData structure that holds information created
 * during compilation by CompileProcs and used by instructions during
 * execution.
 */

typedef struct AuxData {
    AuxDataType *type;		/* pointer to the AuxData type associated with
                             * this ClientData. */
    ClientData clientData;	/* The compilation data itself. */
} AuxData;

/*
 * Structure defining the compilation environment. After compilation, fields
 * describing bytecode instructions are copied out into the more compact
 * ByteCode structure defined below.
 */

#define COMPILEENV_INIT_CODE_BYTES    250
#define COMPILEENV_INIT_NUM_OBJECTS    40
#define COMPILEENV_INIT_EXCEPT_RANGES   5
#define COMPILEENV_INIT_CMD_MAP_SIZE   40
#define COMPILEENV_INIT_AUX_DATA_SIZE   5

typedef struct CompileEnv {
    Interp *iPtr;		/* Interpreter containing the code being
				 * compiled. Commands and their compile
				 * procs are specific to an interpreter so
				 * the code emitted will depend on the
				 * interpreter. */
    char *source;		/* The source string being compiled by
				 * SetByteCodeFromAny. This pointer is not
				 * owned by the CompileEnv and must not be
				 * freed or changed by it. */
    Proc *procPtr;		/* If a procedure is being compiled, a
				 * pointer to its Proc structure; otherwise
				 * NULL. Used to compile local variables.
				 * Set from information provided by
				 * ObjInterpProc in tclProc.c. */
    int numCommands;		/* Number of commands compiled. */
    int excRangeDepth;		/* Current exception range nesting level;
				 * -1 if not in any range currently. */
    int maxExcRangeDepth;	/* Max nesting level of exception ranges;
				 * -1 if no ranges have been compiled. */
    int maxStackDepth;		/* Maximum number of stack elements needed
				 * to execute the code. Set by compilation
				 * procedures before returning. */
    Tcl_HashTable objTable;	/* Contains all Tcl objects referenced by
				 * the compiled code. Indexed by the string
				 * representations of the objects. Used to
				 * avoid creating duplicate objects. */
    int pushSimpleWords;	/* Set 1 by callers of compilation routines
				 * if they should emit instructions to push
				 * "simple" command words (those that are
				 * just a sequence of characters). If 0, the
				 * callers are responsible for compiling
				 * simple words. */
    int wordIsSimple;		/* Set 1 by compilation procedures before
				 * returning if the previous command word
				 * was just a sequence of characters,
				 * otherwise 0. Used to help determine the
				 * command being compiled. */
    int numSimpleWordChars;	/* If wordIsSimple is 1 then the number of
				 * characters in the simple word, else 0. */
    int exprIsJustVarRef;	/* Set 1 if the expression last compiled by
				 * TclCompileExpr consisted of just a
				 * variable reference as in the expression
				 * of "if $b then...". Otherwise 0. Used
				 * to implement expr's 2 level substitution
				 * semantics properly. */
    int exprIsComparison;	/* Set 1 if the top-level operator in the
				 * expression last compiled is a comparison.
				 * Otherwise 0. If 1, since the operands
				 * might be strings, the expr is compiled
				 * out-of-line to implement expr's 2 level
				 * substitution semantics properly. */
    int termOffset;		/* Offset of character just after the last
				 * one compiled. Set by compilation
				 * procedures before returning. */
    unsigned char *codeStart;	/* Points to the first byte of the code. */
    unsigned char *codeNext;	/* Points to next code array byte to use. */
    unsigned char *codeEnd;	/* Points just after the last allocated
				 * code array byte. */
    int mallocedCodeArray;      /* Set 1 if code array was expanded 
				 * and codeStart points into the heap.*/
    Tcl_Obj **objArrayPtr;	/* Points to start of object array. */
    int objArrayNext;		/* Index of next free object array entry. */
    int objArrayEnd;		/* Index just after last obj array entry. */
    int mallocedObjArray;       /* 1 if object array was expanded and
                                 * objArray points into the heap, else 0. */
    ExceptionRange *excRangeArrayPtr;
    				/* Points to start of the ExceptionRange
				 * array. */
    int excRangeArrayNext;	/* Next free ExceptionRange array index.
				 * excRangeArrayNext is the number of ranges
				 * and (excRangeArrayNext-1) is the index of
				 * the current range's array entry. */
    int excRangeArrayEnd;	/* Index after the last ExceptionRange
				 * array entry. */
    int mallocedExcRangeArray;	/* 1 if ExceptionRange array was expanded
				 * and excRangeArrayPtr points in heap,
				 * else 0. */
    CmdLocation *cmdMapPtr;	/* Points to start of CmdLocation array.
				 * numCommands is the index of the next
				 * entry to use; (numCommands-1) is the
				 * entry index for the last command. */
    int cmdMapEnd;		/* Index after last CmdLocation entry. */
    int mallocedCmdMap;		/* 1 if command map array was expanded and
				 * cmdMapPtr points in the heap, else 0. */
    AuxData *auxDataArrayPtr;   /* Points to auxiliary data array start. */
    int auxDataArrayNext;	/* Next free compile aux data array index.
				 * auxDataArrayNext is the number of aux
				 * data items and (auxDataArrayNext-1) is
				 * index of current aux data array entry. */
    int auxDataArrayEnd;	/* Index after last aux data array entry. */
    int mallocedAuxDataArray;	/* 1 if aux data array was expanded and
				 * auxDataArrayPtr points in heap else 0. */
    unsigned char staticCodeSpace[COMPILEENV_INIT_CODE_BYTES];
                                /* Initial storage for code. */
    Tcl_Obj *staticObjArraySpace[COMPILEENV_INIT_NUM_OBJECTS];
                                /* Initial storage for object array. */
    ExceptionRange staticExcRangeArraySpace[COMPILEENV_INIT_EXCEPT_RANGES];
                                /* Initial ExceptionRange array storage. */
    CmdLocation staticCmdMapSpace[COMPILEENV_INIT_CMD_MAP_SIZE];
                                /* Initial storage for cmd location map. */
    AuxData staticAuxDataArraySpace[COMPILEENV_INIT_AUX_DATA_SIZE];
                                /* Initial storage for aux data array. */
} CompileEnv;

/*
 * The structure defining the bytecode instructions resulting from compiling
 * a Tcl script. Note that this structure is variable length: a single heap
 * object is allocated to hold the ByteCode structure immediately followed
 * by the code bytes, the object array, the ExceptionRange array, the
 * CmdLocation map, and the compilation AuxData array.
 */

/*
 * A PRECOMPILED bytecode struct is one that was generated from a compiled
 * image rather than implicitly compiled from source
 */
#define TCL_BYTECODE_PRECOMPILED		0x0001

typedef struct ByteCode {
    Interp *iPtr;		/* Interpreter containing the code being
				 * compiled. Commands and their compile
				 * procs are specific to an interpreter so
				 * the code emitted will depend on the
				 * interpreter. */
    int compileEpoch;		/* Value of iPtr->compileEpoch when this
				 * ByteCode was compiled. Used to invalidate
				 * code when, e.g., commands with compile
				 * procs are redefined. */
    Namespace *nsPtr;		/* Namespace context in which this code
				 * was compiled. If the code is executed
				 * if a different namespace, it must be
				 * recompiled. */
    int nsEpoch;		/* Value of nsPtr->resolverEpoch when this
				 * ByteCode was compiled. Used to invalidate
				 * code when new namespace resolution rules
				 * are put into effect. */
    int refCount;		/* Reference count: set 1 when created
				 * plus 1 for each execution of the code
				 * currently active. This structure can be
				 * freed when refCount becomes zero. */
    unsigned int flags;		/* flags describing state for the codebyte.
                                 * this variable holds ORed values from the
                                 * TCL_BYTECODE_ masks defined above */
    char *source;		/* The source string from which this
				 * ByteCode was compiled. Note that this
				 * pointer is not owned by the ByteCode and
				 * must not be freed or modified by it. */
    Proc *procPtr;		/* If the ByteCode was compiled from a
				 * procedure body, this is a pointer to its
				 * Proc structure; otherwise NULL. This
				 * pointer is also not owned by the ByteCode
				 * and must not be freed by it. Used for
				 * debugging. */
    size_t totalSize;		/* Total number of bytes required for this
				 * ByteCode structure including the storage
				 * for Tcl objects in its object array. */
    int numCommands;		/* Number of commands compiled. */
    int numSrcChars;		/* Number of source chars compiled. */
    int numCodeBytes;		/* Number of code bytes. */
    int numObjects;		/* Number of Tcl objects in object array. */
    int numExcRanges;		/* Number of ExceptionRange array elems. */
    int numAuxDataItems;	/* Number of AuxData items. */
    int numCmdLocBytes;		/* Number of bytes needed for encoded
				 * command location information. */
    int maxExcRangeDepth;	/* Maximum nesting level of ExceptionRanges;
				 * -1 if no ranges were compiled. */
    int maxStackDepth;		/* Maximum number of stack elements needed
				 * to execute the code. */
    unsigned char *codeStart;	/* Points to the first byte of the code.
				 * This is just after the final ByteCode
				 * member cmdMapPtr. */
    Tcl_Obj **objArrayPtr;	/* Points to the start of the object array.
				 * This is just after the last code byte. */
    ExceptionRange *excRangeArrayPtr;
    				/* Points to the start of the ExceptionRange
				 * array. This is just after the last
				 * object in the object array. */
    AuxData *auxDataArrayPtr;   /* Points to the start of the auxiliary data
				 * array. This is just after the last entry
				 * in the ExceptionRange array. */
    unsigned char *codeDeltaStart;
				/* Points to the first of a sequence of
				 * bytes that encode the change in the
				 * starting offset of each command's code.
				 * If -127<=delta<=127, it is encoded as 1
				 * byte, otherwise 0xFF (128) appears and
				 * the delta is encoded by the next 4 bytes.
				 * Code deltas are always positive. This
				 * sequence is just after the last entry in
				 * the AuxData array. */
    unsigned char *codeLengthStart;
				/* Points to the first of a sequence of
				 * bytes that encode the length of each
				 * command's code. The encoding is the same
				 * as for code deltas. Code lengths are
				 * always positive. This sequence is just
				 * after the last entry in the code delta
				 * sequence. */
    unsigned char *srcDeltaStart;
				/* Points to the first of a sequence of
				 * bytes that encode the change in the
				 * starting offset of each command's source.
				 * The encoding is the same as for code
				 * deltas. Source deltas can be negative.
				 * This sequence is just after the last byte
				 * in the code length sequence. */
    unsigned char *srcLengthStart;
				/* Points to the first of a sequence of
				 * bytes that encode the length of each
				 * command's source. The encoding is the
				 * same as for code deltas. Source lengths
				 * are always positive. This sequence is
				 * just after the last byte in the source
				 * delta sequence. */
} ByteCode;

/*
 * Opcodes for the Tcl bytecode instructions. These opcodes must correspond
 * to the entries in the table of instruction descriptions in tclCompile.c.
 * Also, the order and number of the expression opcodes (e.g., INST_LOR)
 * must match the entries in the array operatorStrings in tclExecute.c.
 */

/* Opcodes 0 to 9 */
#define INST_DONE			0
#define INST_PUSH1			(INST_DONE + 1)
#define INST_PUSH4			(INST_DONE + 2)
#define INST_POP			(INST_DONE + 3)
#define INST_DUP			(INST_DONE + 4)
#define INST_CONCAT1			(INST_DONE + 5)
#define INST_INVOKE_STK1		(INST_DONE + 6)
#define INST_INVOKE_STK4		(INST_DONE + 7)
#define INST_EVAL_STK			(INST_DONE + 8)
#define INST_EXPR_STK			(INST_DONE + 9)

/* Opcodes 10 to 23 */
#define INST_LOAD_SCALAR1		(INST_EXPR_STK + 1)
#define INST_LOAD_SCALAR4		(INST_LOAD_SCALAR1 + 1)
#define INST_LOAD_SCALAR_STK		(INST_LOAD_SCALAR1 + 2)
#define INST_LOAD_ARRAY1		(INST_LOAD_SCALAR1 + 3)
#define INST_LOAD_ARRAY4		(INST_LOAD_SCALAR1 + 4)
#define INST_LOAD_ARRAY_STK		(INST_LOAD_SCALAR1 + 5)
#define INST_LOAD_STK			(INST_LOAD_SCALAR1 + 6)
#define INST_STORE_SCALAR1		(INST_LOAD_SCALAR1 + 7)
#define INST_STORE_SCALAR4		(INST_LOAD_SCALAR1 + 8)
#define INST_STORE_SCALAR_STK		(INST_LOAD_SCALAR1 + 9)
#define INST_STORE_ARRAY1		(INST_LOAD_SCALAR1 + 10)
#define INST_STORE_ARRAY4		(INST_LOAD_SCALAR1 + 11)
#define INST_STORE_ARRAY_STK		(INST_LOAD_SCALAR1 + 12)
#define INST_STORE_STK			(INST_LOAD_SCALAR1 + 13)

/* Opcodes 24 to 33 */
#define INST_INCR_SCALAR1		(INST_STORE_STK + 1)
#define INST_INCR_SCALAR_STK		(INST_INCR_SCALAR1 + 1)
#define INST_INCR_ARRAY1		(INST_INCR_SCALAR1 + 2)
#define INST_INCR_ARRAY_STK		(INST_INCR_SCALAR1 + 3)
#define INST_INCR_STK			(INST_INCR_SCALAR1 + 4)
#define INST_INCR_SCALAR1_IMM		(INST_INCR_SCALAR1 + 5)
#define INST_INCR_SCALAR_STK_IMM	(INST_INCR_SCALAR1 + 6)
#define INST_INCR_ARRAY1_IMM		(INST_INCR_SCALAR1 + 7)
#define INST_INCR_ARRAY_STK_IMM		(INST_INCR_SCALAR1 + 8)
#define INST_INCR_STK_IMM		(INST_INCR_SCALAR1 + 9)

/* Opcodes 34 to 39 */
#define INST_JUMP1			(INST_INCR_STK_IMM + 1)
#define INST_JUMP4			(INST_JUMP1 + 1)
#define INST_JUMP_TRUE1			(INST_JUMP1 + 2)
#define INST_JUMP_TRUE4			(INST_JUMP1 + 3)
#define INST_JUMP_FALSE1		(INST_JUMP1 + 4)
#define INST_JUMP_FALSE4	        (INST_JUMP1 + 5)

/* Opcodes 40 to 64 */
#define INST_LOR			(INST_JUMP_FALSE4 + 1)
#define INST_LAND			(INST_LOR + 1)
#define INST_BITOR			(INST_LOR + 2)
#define INST_BITXOR			(INST_LOR + 3)
#define INST_BITAND			(INST_LOR + 4)
#define INST_EQ				(INST_LOR + 5)
#define INST_NEQ			(INST_LOR + 6)
#define INST_LT				(INST_LOR + 7)
#define INST_GT				(INST_LOR + 8)
#define INST_LE				(INST_LOR + 9)
#define INST_GE				(INST_LOR + 10)
#define INST_LSHIFT			(INST_LOR + 11)
#define INST_RSHIFT			(INST_LOR + 12)
#define INST_ADD			(INST_LOR + 13)
#define INST_SUB			(INST_LOR + 14)
#define INST_MULT			(INST_LOR + 15)
#define INST_DIV			(INST_LOR + 16)
#define INST_MOD			(INST_LOR + 17)
#define INST_UPLUS			(INST_LOR + 18)
#define INST_UMINUS			(INST_LOR + 19)
#define INST_BITNOT			(INST_LOR + 20)
#define INST_LNOT			(INST_LOR + 21)
#define INST_CALL_BUILTIN_FUNC1		(INST_LOR + 22)
#define INST_CALL_FUNC1			(INST_LOR + 23)
#define INST_TRY_CVT_TO_NUMERIC		(INST_LOR + 24)

/* Opcodes 65 to 66 */
#define INST_BREAK			(INST_TRY_CVT_TO_NUMERIC + 1)
#define INST_CONTINUE			(INST_BREAK + 1)

/* Opcodes 67 to 68 */
#define INST_FOREACH_START4		(INST_CONTINUE + 1)
#define INST_FOREACH_STEP4		(INST_FOREACH_START4 + 1)

/* Opcodes 69 to 72 */
#define INST_BEGIN_CATCH4		(INST_FOREACH_STEP4 + 1)
#define INST_END_CATCH			(INST_BEGIN_CATCH4 + 1)
#define INST_PUSH_RESULT		(INST_BEGIN_CATCH4 + 2)
#define INST_PUSH_RETURN_CODE		(INST_BEGIN_CATCH4 + 3)

/* The last opcode */
#define LAST_INST_OPCODE        	INST_PUSH_RETURN_CODE

/*
 * Table describing the Tcl bytecode instructions: their name (for
 * displaying code), total number of code bytes required (including
 * operand bytes), and a description of the type of each operand.
 * These operand types include signed and unsigned integers of length
 * one and four bytes. The unsigned integers are used for indexes or
 * for, e.g., the count of objects to push in a "push" instruction.
 */

#define MAX_INSTRUCTION_OPERANDS 2

typedef enum InstOperandType {
    OPERAND_NONE,
    OPERAND_INT1,		/* One byte signed integer. */
    OPERAND_INT4,		/* Four byte signed integer. */
    OPERAND_UINT1,		/* One byte unsigned integer. */
    OPERAND_UINT4		/* Four byte unsigned integer. */
} InstOperandType;

typedef struct InstructionDesc {
    char *name;			/* Name of instruction. */
    int numBytes;		/* Total number of bytes for instruction. */
    int numOperands;		/* Number of operands. */
    InstOperandType opTypes[MAX_INSTRUCTION_OPERANDS];
				/* The type of each operand. */
} InstructionDesc;

extern InstructionDesc instructionTable[];

/*
 * Definitions of the values of the INST_CALL_BUILTIN_FUNC instruction's
 * operand byte. Each value denotes a builtin Tcl math function. These
 * values must correspond to the entries in the builtinFuncTable array
 * below and to the values stored in the tclInt.h MathFunc structure's
 * builtinFuncIndex field.
 */

#define BUILTIN_FUNC_ACOS		0
#define BUILTIN_FUNC_ASIN		1
#define BUILTIN_FUNC_ATAN		2
#define BUILTIN_FUNC_ATAN2		3
#define BUILTIN_FUNC_CEIL		4
#define BUILTIN_FUNC_COS		5
#define BUILTIN_FUNC_COSH		6
#define BUILTIN_FUNC_EXP		7
#define BUILTIN_FUNC_FLOOR		8
#define BUILTIN_FUNC_FMOD		9
#define BUILTIN_FUNC_HYPOT		10
#define BUILTIN_FUNC_LOG		11
#define BUILTIN_FUNC_LOG10		12
#define BUILTIN_FUNC_POW		13
#define BUILTIN_FUNC_SIN		14
#define BUILTIN_FUNC_SINH		15
#define BUILTIN_FUNC_SQRT		16
#define BUILTIN_FUNC_TAN		17
#define BUILTIN_FUNC_TANH		18
#define BUILTIN_FUNC_ABS		19
#define BUILTIN_FUNC_DOUBLE		20
#define BUILTIN_FUNC_INT		21
#define BUILTIN_FUNC_RAND		22
#define BUILTIN_FUNC_ROUND		23
#define BUILTIN_FUNC_SRAND		24

#define LAST_BUILTIN_FUNC        	BUILTIN_FUNC_SRAND

/*
 * Table describing the built-in math functions. Entries in this table are
 * indexed by the values of the INST_CALL_BUILTIN_FUNC instruction's
 * operand byte.
 */

typedef int (CallBuiltinFuncProc) _ANSI_ARGS_((Tcl_Interp *interp,
        ExecEnv *eePtr, ClientData clientData));

typedef struct {
    char *name;			/* Name of function. */
    int numArgs;		/* Number of arguments for function. */
    Tcl_ValueType argTypes[MAX_MATH_ARGS];
				/* Acceptable types for each argument. */
    CallBuiltinFuncProc *proc;	/* Procedure implementing this function. */
    ClientData clientData;	/* Additional argument to pass to the
				 * function when invoking it. */
} BuiltinFunc;

extern BuiltinFunc builtinFuncTable[];

/*
 * The structure used to hold information about the start and end of each
 * argument word in a command. 
 */

#define ARGINFO_INIT_ENTRIES 5

typedef struct ArgInfo {
    int numArgs;		/* Number of argument words in command. */
    char **startArray;		/* Array of pointers to the first character
				 * of each argument word. */
    char **endArray;		/* Array of pointers to the last character
				 * of each argument word. */
    int allocArgs;		/* Number of array entries currently
				 * allocated. */
    int mallocedArrays;		/* 1 if the arrays were expanded and
				 * wordStartArray/wordEndArray point into
				 * the heap, else 0. */
    char *staticStartSpace[ARGINFO_INIT_ENTRIES];
                                /* Initial storage for word start array. */
    char *staticEndSpace[ARGINFO_INIT_ENTRIES];
                                /* Initial storage for word end array. */
} ArgInfo;

/*
 * Compilation of some Tcl constructs such as if commands and the logical or
 * (||) and logical and (&&) operators in expressions requires the
 * generation of forward jumps. Since the PC target of these jumps isn't
 * known when the jumps are emitted, we record the offset of each jump in an
 * array of JumpFixup structures. There is one array for each sequence of
 * jumps to one target PC. When we learn the target PC, we update the jumps
 * with the correct distance. Also, if the distance is too great (> 127
 * bytes), we replace the single-byte jump with a four byte jump
 * instruction, move the instructions after the jump down, and update the
 * code offsets for any commands between the jump and the target.
 */

typedef enum {
    TCL_UNCONDITIONAL_JUMP,
    TCL_TRUE_JUMP,
    TCL_FALSE_JUMP
} TclJumpType;

typedef struct JumpFixup {
    TclJumpType jumpType;	/* Indicates the kind of jump. */
    int codeOffset;		/* Offset of the first byte of the one-byte
				 * forward jump's code. */
    int cmdIndex;		/* Index of the first command after the one
				 * for which the jump was emitted. Used to
				 * update the code offsets for subsequent
				 * commands if the two-byte jump at jumpPc
				 * must be replaced with a five-byte one. */
    int excRangeIndex;		/* Index of the first range entry in the
				 * ExceptionRange array after the current
				 * one. This field is used to adjust the
				 * code offsets in subsequent ExceptionRange
				 * records when a jump is grown from 2 bytes
				 * to 5 bytes. */
} JumpFixup;

#define JUMPFIXUP_INIT_ENTRIES    10

typedef struct JumpFixupArray {
    JumpFixup *fixup;		/* Points to start of jump fixup array. */
    int next;			/* Index of next free array entry. */
    int end;			/* Index of last usable entry in array. */
    int mallocedArray;		/* 1 if array was expanded and fixups points
				 * into the heap, else 0. */
    JumpFixup staticFixupSpace[JUMPFIXUP_INIT_ENTRIES];
				/* Initial storage for jump fixup array. */
} JumpFixupArray;

/*
 * The structure describing one variable list of a foreach command. Note
 * that only foreach commands inside procedure bodies are compiled inline so
 * a ForeachVarList structure always describes local variables. Furthermore,
 * only scalar variables are supported for inline-compiled foreach loops.
 */

typedef struct ForeachVarList {
    int numVars;		/* The number of variables in the list. */
    int varIndexes[1];		/* An array of the indexes ("slot numbers")
				 * for each variable in the procedure's
				 * array of local variables. Only scalar
				 * variables are supported. The actual
				 * size of this field will be large enough
				 * to numVars indexes. THIS MUST BE THE
				 * LAST FIELD IN THE STRUCTURE! */
} ForeachVarList;

/*
 * Structure used to hold information about a foreach command that is needed
 * during program execution. These structures are stored in CompileEnv and
 * ByteCode structures as auxiliary data.
 */

typedef struct ForeachInfo {
    int numLists;		/* The number of both the variable and value
				 * lists of the foreach command. */
    int firstListTmp;		/* The slot number of the first temporary
				 * variable holding the lists themselves. */
    int loopIterNumTmp;		/* The slot number of the temp var holding
				 * the count of times the loop body has been
				 * executed. This is used to determine which
				 * list element to assign each loop var. */
    ForeachVarList *varLists[1];/* An array of pointers to ForeachVarList
				 * structures describing each var list. The
				 * actual size of this field will be large
				 * enough to numVars indexes. THIS MUST BE
				 * THE LAST FIELD IN THE STRUCTURE! */
} ForeachInfo;

/*
 * Structure containing a cached pointer to a command that is the result
 * of resolving the command's name in some namespace. It is the internal
 * representation for a cmdName object. It contains the pointer along
 * with some information that is used to check the pointer's validity.
 */

typedef struct ResolvedCmdName {
    Command *cmdPtr;		/* A cached Command pointer. */
    Namespace *refNsPtr;	/* Points to the namespace containing the
				 * reference (not the namespace that
				 * contains the referenced command). */
    long refNsId;		/* refNsPtr's unique namespace id. Used to
				 * verify that refNsPtr is still valid
				 * (e.g., it's possible that the cmd's
				 * containing namespace was deleted and a
				 * new one created at the same address). */
    int refNsCmdEpoch;		/* Value of the referencing namespace's
				 * cmdRefEpoch when the pointer was cached.
				 * Before using the cached pointer, we check
				 * if the namespace's epoch was incremented;
				 * if so, this cached pointer is invalid. */
    int cmdEpoch;		/* Value of the command's cmdEpoch when this
				 * pointer was cached. Before using the
				 * cached pointer, we check if the cmd's
				 * epoch was incremented; if so, the cmd was
				 * renamed, deleted, hidden, or exposed, and
				 * so the pointer is invalid. */
    int refCount;		/* Reference count: 1 for each cmdName
				 * object that has a pointer to this
				 * ResolvedCmdName structure as its internal
				 * rep. This structure can be freed when
				 * refCount becomes zero. */
} ResolvedCmdName;

/*
 *----------------------------------------------------------------
 * Procedures shared among Tcl bytecode compilation and execution
 * modules but not used outside:
 *----------------------------------------------------------------
 */

EXTERN void		TclCleanupByteCode _ANSI_ARGS_((ByteCode *codePtr));
EXTERN int		TclCompileExpr _ANSI_ARGS_((Tcl_Interp *interp,
			    char *string, char *lastChar, int flags,
			    CompileEnv *envPtr));
EXTERN int		TclCompileQuotes _ANSI_ARGS_((Tcl_Interp *interp,
			    char *string, char *lastChar, int termChar,
			    int flags, CompileEnv *envPtr));
EXTERN int		TclCompileString _ANSI_ARGS_((Tcl_Interp *interp,
			    char *string, char *lastChar, int flags,
			    CompileEnv *envPtr));
EXTERN int		TclCompileDollarVar _ANSI_ARGS_((Tcl_Interp *interp,
			    char *string, char *lastChar, int flags,
			    CompileEnv *envPtr));
EXTERN int		TclCreateAuxData _ANSI_ARGS_((ClientData clientData,
                AuxDataType *typePtr, CompileEnv *envPtr));
EXTERN ExecEnv *	TclCreateExecEnv _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN void		TclDeleteExecEnv _ANSI_ARGS_((ExecEnv *eePtr));
EXTERN void		TclEmitForwardJump _ANSI_ARGS_((CompileEnv *envPtr,
			    TclJumpType jumpType, JumpFixup *jumpFixupPtr));
EXTERN AuxDataType *TclGetAuxDataType _ANSI_ARGS_((char *typeName));
EXTERN ExceptionRange *	TclGetExceptionRangeForPc _ANSI_ARGS_((
			    unsigned char *pc, int catchOnly,
			    ByteCode* codePtr));
EXTERN InstructionDesc * TclGetInstructionTable _ANSI_ARGS_(());
EXTERN int		TclExecuteByteCode _ANSI_ARGS_((Tcl_Interp *interp,
			    ByteCode *codePtr));
EXTERN void		TclExpandCodeArray _ANSI_ARGS_((
                            CompileEnv *envPtr));
EXTERN void		TclExpandJumpFixupArray _ANSI_ARGS_((
                            JumpFixupArray *fixupArrayPtr));
EXTERN void		TclFinalizeAuxDataTypeTable _ANSI_ARGS_((void));
EXTERN int		TclFixupForwardJump _ANSI_ARGS_((
			    CompileEnv *envPtr, JumpFixup *jumpFixupPtr,
			    int jumpDist, int distThreshold));
EXTERN void		TclFreeCompileEnv _ANSI_ARGS_((CompileEnv *envPtr));
EXTERN void		TclFreeJumpFixupArray _ANSI_ARGS_((
  			    JumpFixupArray *fixupArrayPtr));
EXTERN void		TclInitAuxDataTypeTable _ANSI_ARGS_((void));
EXTERN void		TclInitByteCodeObj _ANSI_ARGS_((Tcl_Obj *objPtr,
			    CompileEnv *envPtr));
EXTERN void		TclInitCompileEnv _ANSI_ARGS_((Tcl_Interp *interp,
			    CompileEnv *envPtr, char *string));
EXTERN void		TclInitJumpFixupArray _ANSI_ARGS_((
			    JumpFixupArray *fixupArrayPtr));
#ifdef TCL_COMPILE_STATS
EXTERN int		TclLog2 _ANSI_ARGS_((int value));
#endif /*TCL_COMPILE_STATS*/
EXTERN int		TclObjIndexForString _ANSI_ARGS_((char *start,
			    int length, int allocStrRep, int inHeap,
			    CompileEnv *envPtr));
EXTERN int		TclPrintInstruction _ANSI_ARGS_((ByteCode* codePtr,
			    unsigned char *pc));
EXTERN void		TclPrintSource _ANSI_ARGS_((FILE *outFile,
			    char *string, int maxChars));
EXTERN void		TclRegisterAuxDataType _ANSI_ARGS_((AuxDataType *typePtr));

/*
 *----------------------------------------------------------------
 * Macros used by Tcl bytecode compilation and execution modules
 * inside the Tcl core but not used outside.
 *----------------------------------------------------------------
 */

/*
 * Macros to ensure there is enough room in a CompileEnv's code array.
 * The ANSI C "prototypes" for these macros are:
 *
 * EXTERN void	TclEnsureCodeSpace1 _ANSI_ARGS_((CompileEnv *envPtr));
 * EXTERN void	TclEnsureCodeSpace _ANSI_ARGS_((int nBytes,
 *		    CompileEnv *envPtr));
 */

#define TclEnsureCodeSpace1(envPtr) \
    if ((envPtr)->codeNext == (envPtr)->codeEnd) \
        TclExpandCodeArray(envPtr)

#define TclEnsureCodeSpace(nBytes, envPtr) \
    if (((envPtr)->codeNext + nBytes) > (envPtr)->codeEnd) \
        TclExpandCodeArray(envPtr)

/*
 * Macro to emit an opcode byte into a CompileEnv's code array.
 * The ANSI C "prototype" for this macro is:
 *
 * EXTERN void	TclEmitOpcode _ANSI_ARGS_((unsigned char op,
 *		    CompileEnv *envPtr));
 */

#define TclEmitOpcode(op, envPtr) \
    TclEnsureCodeSpace1(envPtr); \
    *(envPtr)->codeNext++ = (unsigned char) (op)

/*
 * Macros to emit a (signed or unsigned) int operand. The two variants
 * depend on the number of bytes needed for the int. Four byte integers
 * are stored in "big-endian" order with the high order byte stored at
 * the lowest address. The ANSI C "prototypes" for these macros are:
 *
 * EXTERN void	TclEmitInt1 _ANSI_ARGS_((int i, CompileEnv *envPtr));
 * EXTERN void	TclEmitInt4 _ANSI_ARGS_((int i, CompileEnv *envPtr));
 */

#define TclEmitInt1(i, envPtr) \
    TclEnsureCodeSpace(1, (envPtr)); \
    *(envPtr)->codeNext++ = (unsigned char) ((unsigned int) (i))

#define TclEmitInt4(i, envPtr) \
    TclEnsureCodeSpace(4, (envPtr)); \
    *(envPtr)->codeNext++ = \
        (unsigned char) ((unsigned int) (i) >> 24); \
    *(envPtr)->codeNext++ = \
        (unsigned char) ((unsigned int) (i) >> 16); \
    *(envPtr)->codeNext++ = \
        (unsigned char) ((unsigned int) (i) >>  8); \
    *(envPtr)->codeNext++ = \
        (unsigned char) ((unsigned int) (i)      )

/*
 * Macros to emit an instruction with signed or unsigned int operands.
 * The ANSI C "prototypes" for these macros are:
 *
 * EXTERN void	TclEmitInstInt1 _ANSI_ARGS_((unsigned char op, int i, 
 *		    CompileEnv *envPtr));
 * EXTERN void	TclEmitInstInt4 _ANSI_ARGS_((unsigned char op, int i, 
 *		    CompileEnv *envPtr));
 * EXTERN void	TclEmitInstUInt1 _ANSI_ARGS_((unsigned char op,
 *		    unsigned int i, CompileEnv *envPtr));
 * EXTERN void	TclEmitInstUInt4 _ANSI_ARGS_((unsigned char op,
 *		    unsigned int i, CompileEnv *envPtr));
 */

#define TclEmitInstInt1(op, i, envPtr) \
    TclEnsureCodeSpace(2, (envPtr)); \
    *(envPtr)->codeNext++ = (unsigned char) (op); \
    *(envPtr)->codeNext++ = (unsigned char) ((unsigned int) (i))

#define TclEmitInstInt4(op, i, envPtr) \
    TclEnsureCodeSpace(5, (envPtr)); \
    *(envPtr)->codeNext++ = (unsigned char) (op); \
    *(envPtr)->codeNext++ = \
        (unsigned char) ((unsigned int) (i) >> 24); \
    *(envPtr)->codeNext++ = \
        (unsigned char) ((unsigned int) (i) >> 16); \
    *(envPtr)->codeNext++ = \
        (unsigned char) ((unsigned int) (i) >>  8); \
    *(envPtr)->codeNext++ = \
        (unsigned char) ((unsigned int) (i)      )
    
#define TclEmitInstUInt1(op, i, envPtr) \
    TclEmitInstInt1((op), (i), (envPtr))

#define TclEmitInstUInt4(op, i, envPtr) \
    TclEmitInstInt4((op), (i), (envPtr))
    
/*
 * Macro to push a Tcl object onto the Tcl evaluation stack. It emits the
 * object's one or four byte array index into the CompileEnv's code
 * array. These support, respectively, a maximum of 256 (2**8) and 2**32
 * objects in a CompileEnv. The ANSI C "prototype" for this macro is:
 *
 * EXTERN void	TclEmitPush _ANSI_ARGS_((int objIndex, CompileEnv *envPtr));
 */

#define TclEmitPush(objIndex, envPtr) \
    if ((objIndex) <= 255) { \
	TclEmitInstUInt1(INST_PUSH1, (objIndex), (envPtr)); \
    } else { \
	TclEmitInstUInt4(INST_PUSH4, (objIndex), (envPtr)); \
    }

/*
 * Macros to update a (signed or unsigned) integer starting at a pointer.
 * The two variants depend on the number of bytes. The ANSI C "prototypes"
 * for these macros are:
 *
 * EXTERN void	TclStoreInt1AtPtr _ANSI_ARGS_((int i, unsigned char *p));
 * EXTERN void	TclStoreInt4AtPtr _ANSI_ARGS_((int i, unsigned char *p));
 */
    
#define TclStoreInt1AtPtr(i, p) \
    *(p)   = (unsigned char) ((unsigned int) (i))
    
#define TclStoreInt4AtPtr(i, p) \
    *(p)   = (unsigned char) ((unsigned int) (i) >> 24); \
    *(p+1) = (unsigned char) ((unsigned int) (i) >> 16); \
    *(p+2) = (unsigned char) ((unsigned int) (i) >>  8); \
    *(p+3) = (unsigned char) ((unsigned int) (i)      )

/*
 * Macros to update instructions at a particular pc with a new op code
 * and a (signed or unsigned) int operand. The ANSI C "prototypes" for
 * these macros are:
 *
 * EXTERN void	TclUpdateInstInt1AtPc _ANSI_ARGS_((unsigned char op, int i,
 *		    unsigned char *pc));
 * EXTERN void	TclUpdateInstInt4AtPc _ANSI_ARGS_((unsigned char op, int i,
 *		    unsigned char *pc));
 */

#define TclUpdateInstInt1AtPc(op, i, pc) \
    *(pc) = (unsigned char) (op); \
    TclStoreInt1AtPtr((i), ((pc)+1))

#define TclUpdateInstInt4AtPc(op, i, pc) \
    *(pc) = (unsigned char) (op); \
    TclStoreInt4AtPtr((i), ((pc)+1))
    
/*
 * Macros to get a signed integer (GET_INT{1,2}) or an unsigned int
 * (GET_UINT{1,2}) from a pointer. There are two variants for each
 * return type that depend on the number of bytes fetched.
 * The ANSI C "prototypes" for these macros are:
 *
 * EXTERN int	        TclGetInt1AtPtr  _ANSI_ARGS_((unsigned char *p));
 * EXTERN int	        TclGetInt4AtPtr  _ANSI_ARGS_((unsigned char *p));
 * EXTERN unsigned int	TclGetUInt1AtPtr _ANSI_ARGS_((unsigned char *p));
 * EXTERN unsigned int	TclGetUInt4AtPtr _ANSI_ARGS_((unsigned char *p));
 */

/*
 * The TclGetInt1AtPtr macro is tricky because we want to do sign
 * extension on the 1-byte value. Unfortunately the "char" type isn't
 * signed on all platforms so sign-extension doesn't always happen
 * automatically. Sometimes we can explicitly declare the pointer to be
 * signed, but other times we have to explicitly sign-extend the value
 * in software.
 */

#ifndef __CHAR_UNSIGNED__
#   define TclGetInt1AtPtr(p) ((int) *((char *) p))
#else
#   ifdef HAVE_SIGNED_CHAR
#	define TclGetInt1AtPtr(p) ((int) *((signed char *) p))
#    else
#	define TclGetInt1AtPtr(p) (((int) *((char *) p)) \
		| ((*(p) & 0200) ? (-256) : 0))
#    endif
#endif

#define TclGetInt4AtPtr(p) (((int) TclGetInt1AtPtr(p) << 24) | \
		                  	    (*((p)+1) << 16) | \
				  	    (*((p)+2) <<  8) | \
				  	    (*((p)+3)))

#define TclGetUInt1AtPtr(p) ((unsigned int) *(p))
#define TclGetUInt4AtPtr(p) ((unsigned int) (*(p)     << 24) | \
		                            (*((p)+1) << 16) | \
				            (*((p)+2) <<  8) | \
				            (*((p)+3)))

/*
 * Macros used to compute the minimum and maximum of two integers.
 * The ANSI C "prototypes" for these macros are:
 *
 * EXTERN int  TclMin _ANSI_ARGS_((int i, int j));
 * EXTERN int  TclMax _ANSI_ARGS_((int i, int j));
 */

#define TclMin(i, j)   ((((int) i) < ((int) j))? (i) : (j))
#define TclMax(i, j)   ((((int) i) > ((int) j))? (i) : (j))

/*
 * Macro used to compute the offset of the current instruction in the
 * bytecode instruction stream. The ANSI C "prototypes" for this macro is:
 *
 * EXTERN int  TclCurrCodeOffset _ANSI_ARGS_((void));
 */

#define TclCurrCodeOffset()  ((envPtr)->codeNext - (envPtr)->codeStart)

/*
 * Upper bound for legal jump distances. Checked during compilation if
 * debugging.
 */

#define MAX_JUMP_DIST   5000

# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT

#endif /* _TCLCOMPILATION */
TCL_DONT_USE_BRACES) && (conversion & CONVERT_BRACE)) { conversion = CONVERT_ESCAPE; } - if ((src == NULL) || (length == 0)) { + + /* No matter what the caller demands, empty string must be braced! */ + if ((src == NULL) || (length == 0) || ((*src == '\0') && (length == -1))) { src = tclEmptyStringRep; length = 0; conversion = CONVERT_BRACE; } + + /* Escape leading hash as needed and requested. */ if ((*src == '#') && !(flags & TCL_DONT_QUOTE_HASH)) { if (conversion == CONVERT_ESCAPE) { p[0] = '\\'; @@ -963,6 +1258,8 @@ int TclConvertElement( conversion = CONVERT_BRACE; } } + + /* No escape or quoting needed. Copy the literal string value. */ if (conversion == CONVERT_NONE) { if (length == -1) { /* TODO: INT_MAX overflow? */ @@ -975,6 +1272,8 @@ int TclConvertElement( return length; } } + + /* Formatted string is original string enclosed in braces. */ if (conversion == CONVERT_BRACE) { *p = '{'; p++; @@ -991,8 +1290,10 @@ int TclConvertElement( p++; return p - dst; } + /* conversion == CONVERT_ESCAPE or CONVERT_MASK */ + /* Formatted string is original string converted to escape sequences. */ for ( ; length; src++, length -= (length > 0)) { switch (*src) { case ']': @@ -1125,7 +1426,7 @@ Tcl_Merge( * the size limits on the formatted string anyway, so just issue * that same panic early. */ - Tcl_Panic("Tcl_Merge: size requirement exceeds limits"); + Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } else { flagPtr = (int *) ckalloc((unsigned) argc*sizeof(int)); } @@ -1133,11 +1434,11 @@ Tcl_Merge( flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 ); bytesNeeded += TclScanElement(argv[i], -1, &flagPtr[i]); if (bytesNeeded < 0) { - Tcl_Panic("Tcl_Merge: size requirement exceeds limits"); + Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } } if (bytesNeeded > INT_MAX - argc + 1) { - Tcl_Panic("Tcl_Merge: size requirement exceeds limits"); + Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } bytesNeeded += argc; @@ -1198,6 +1499,141 @@ Tcl_Backslash( /* *---------------------------------------------------------------------- * + * TclTrimRight -- + * Takes two counted strings in the Tcl encoding which must both be + * null terminated. Conceptually trims from the right side of the + * first string all characters found in the second string. + * + * Results: + * The number of bytes to be removed from the end of the string. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +TclTrimRight( + const char *bytes, /* String to be trimmed... */ + int numBytes, /* ...and its length in bytes */ + const char *trim, /* String of trim characters... */ + int numTrim) /* ...and its length in bytes */ +{ + const char *p = bytes + numBytes; + int pInc; + + if ((bytes[numBytes] != '\0') || (trim[numTrim] != '\0')) { + Tcl_Panic("TclTrimRight works only on null-terminated strings"); + } + + /* Empty strings -> nothing to do */ + if ((numBytes == 0) || (numTrim == 0)) { + return 0; + } + + /* Outer loop: iterate over string to be trimmed */ + do { + Tcl_UniChar ch1; + const char *q = trim; + int bytesLeft = numTrim; + + p = Tcl_UtfPrev(p, bytes); + pInc = TclUtfToUniChar(p, &ch1); + + /* Inner loop: scan trim string for match to current character */ + do { + Tcl_UniChar ch2; + int qInc = TclUtfToUniChar(q, &ch2); + + if (ch1 == ch2) { + break; + } + + q += qInc; + bytesLeft -= qInc; + } while (bytesLeft); + + if (bytesLeft == 0) { + /* No match; trim task done; *p is last non-trimmed char */ + p += pInc; + break; + } + } while (p > bytes); + + return numBytes - (p - bytes); +} + +/* + *---------------------------------------------------------------------- + * + * TclTrimLeft -- + * Takes two counted strings in the Tcl encoding which must both be + * null terminated. Conceptually trims from the left side of the + * first string all characters found in the second string. + * + * Results: + * The number of bytes to be removed from the start of the string. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +TclTrimLeft( + const char *bytes, /* String to be trimmed... */ + int numBytes, /* ...and its length in bytes */ + const char *trim, /* String of trim characters... */ + int numTrim) /* ...and its length in bytes */ +{ + const char *p = bytes; + + if ((bytes[numBytes] != '\0') || (trim[numTrim] != '\0')) { + Tcl_Panic("TclTrimLeft works only on null-terminated strings"); + } + + /* Empty strings -> nothing to do */ + if ((numBytes == 0) || (numTrim == 0)) { + return 0; + } + + /* Outer loop: iterate over string to be trimmed */ + do { + Tcl_UniChar ch1; + int pInc = TclUtfToUniChar(p, &ch1); + const char *q = trim; + int bytesLeft = numTrim; + + /* Inner loop: scan trim string for match to current character */ + do { + Tcl_UniChar ch2; + int qInc = TclUtfToUniChar(q, &ch2); + + if (ch1 == ch2) { + break; + } + + q += qInc; + bytesLeft -= qInc; + } while (bytesLeft); + + if (bytesLeft == 0) { + /* No match; trim task done; *p is first non-trimmed char */ + break; + } + + p += pInc; + numBytes -= pInc; + } while (numBytes); + + return p - bytes; +} + +/* + *---------------------------------------------------------------------- + * * Tcl_Concat -- * * Concatenate a set of strings into a single large string. @@ -1214,56 +1650,77 @@ Tcl_Backslash( *---------------------------------------------------------------------- */ +/* The whitespace characters trimmed during [concat] operations */ +#define CONCAT_WS " \f\v\r\t\n" +#define CONCAT_WS_SIZE (int) (sizeof(CONCAT_WS "") - 1) + char * Tcl_Concat( int argc, /* Number of strings to concatenate. */ CONST char * CONST *argv) /* Array of strings to concatenate. */ { - int totalSize, i; - char *p; - char *result; + int i, needSpace = 0, bytesNeeded = 0; + char *result, *p; - for (totalSize = 1, i = 0; i < argc; i++) { - totalSize += strlen(argv[i]) + 1; - } - result = (char *) ckalloc((unsigned) totalSize); + /* Dispose of the empty result corner case first to simplify later code */ if (argc == 0) { - *result = '\0'; + result = (char *) ckalloc(1); + result[0] = '\0'; return result; } - for (p = result, i = 0; i < argc; i++) { - CONST char *element; - int length; + /* First allocate the result buffer at the size required */ + for (i = 0; i < argc; i++) { + bytesNeeded += strlen(argv[i]); + if (bytesNeeded < 0) { + Tcl_Panic("Tcl_Concat: max size of Tcl value exceeded"); + } + } + if (bytesNeeded + argc - 1 < 0) { /* - * Clip white space off the front and back of the string to generate a - * neater result, and ignore any empty elements. + * Panic test could be tighter, but not going to bother for + * this legacy routine. */ + Tcl_Panic("Tcl_Concat: max size of Tcl value exceeded"); + } + /* All element bytes + (argc - 1) spaces + 1 terminating NULL */ + result = (char *) ckalloc((unsigned) (bytesNeeded + argc)); + for (p = result, i = 0; i < argc; i++) { + int trim, elemLength; + const char *element; + element = argv[i]; - while (isspace(UCHAR(*element))) { /* INTL: ISO space. */ - element++; - } - for (length = strlen(element); - (length > 0) - && (isspace(UCHAR(element[length-1]))) /* INTL: ISO space. */ - && ((length < 2) || (element[length-2] != '\\')); - length--) { - /* Null loop body. */ - } - if (length == 0) { + elemLength = strlen(argv[i]); + + /* Trim away the leading whitespace */ + trim = TclTrimLeft(element, elemLength, CONCAT_WS, CONCAT_WS_SIZE); + element += trim; + elemLength -= trim; + + /* + * Trim away the trailing whitespace. Do not permit trimming + * to expose a final backslash character. + */ + + trim = TclTrimRight(element, elemLength, CONCAT_WS, CONCAT_WS_SIZE); + trim -= trim && (element[elemLength - trim - 1] == '\\'); + elemLength -= trim; + + /* If we're left with empty element after trimming, do nothing */ + if (elemLength == 0) { continue; } - memcpy(p, element, (size_t) length); - p += length; - *p = ' '; - p++; - } - if (p != result) { - p[-1] = 0; - } else { - *p = 0; + + /* Append to the result with space if needed */ + if (needSpace) { + *p++ = ' '; + } + memcpy(p, element, (size_t) elemLength); + p += elemLength; + needSpace = 1; } + *p = '\0'; return result; } @@ -1290,35 +1747,25 @@ Tcl_ConcatObj( int objc, /* Number of objects to concatenate. */ Tcl_Obj *CONST objv[]) /* Array of objects to concatenate. */ { - int allocSize, finalSize, length, elemLength, i; - char *p; - char *element; - char *concatStr; + int i, elemLength, needSpace = 0, bytesNeeded = 0; + const char *element; Tcl_Obj *objPtr, *resPtr; /* * Check first to see if all the items are of list type or empty. If so, * we will concat them together as lists, and return a list object. This - * is only valid when the lists have no current string representation, - * since we don't know what the original type was. An original string rep - * may have lost some whitespace info when converted which could be - * important. + * is only valid when the lists are in canonical form. */ for (i = 0; i < objc; i++) { - List *listRepPtr; + int length; objPtr = objv[i]; - if (objPtr->typePtr != &tclListType) { - TclGetString(objPtr); - if (objPtr->length) { - break; - } else { - continue; - } + if (TclListObjIsCanonical(objPtr)) { + continue; } - listRepPtr = (List *) objPtr->internalRep.twoPtrValue.ptr1; - if (objPtr->bytes != NULL && !listRepPtr->canonicalFlag) { + Tcl_GetStringFromObj(objPtr, &length); + if (length > 0) { break; } } @@ -1338,7 +1785,7 @@ Tcl_ConcatObj( */ objPtr = objv[i]; - if (objPtr->bytes && !objPtr->length) { + if (objPtr->bytes && objPtr->length == 0) { continue; } TclListObjGetElements(NULL, objPtr, &listc, &listv); @@ -1361,79 +1808,55 @@ Tcl_ConcatObj( * the slow way, using the string representations. */ - allocSize = 0; + /* First try to pre-allocate the size required */ for (i = 0; i < objc; i++) { - objPtr = objv[i]; - element = TclGetStringFromObj(objPtr, &length); - if ((element != NULL) && (length > 0)) { - allocSize += (length + 1); + element = TclGetStringFromObj(objv[i], &elemLength); + bytesNeeded += elemLength; + if (bytesNeeded < 0) { + break; } } - if (allocSize == 0) { - allocSize = 1; /* enough for the NULL byte at end */ - } - /* - * Allocate storage for the concatenated result. Note that allocSize is - * one more than the total number of characters, and so includes room for - * the terminating NULL byte. + * Does not matter if this fails, will simply try later to build up + * the string with each Append reallocating as needed with the usual + * string append algorithm. When that fails it will report the error. */ + TclNewObj(resPtr); + Tcl_AttemptSetObjLength(resPtr, bytesNeeded + objc - 1); + Tcl_SetObjLength(resPtr, 0); - concatStr = ckalloc((unsigned) allocSize); + for (i = 0; i < objc; i++) { + int trim; + + element = TclGetStringFromObj(objv[i], &elemLength); - /* - * Now concatenate the elements. Clip white space off the front and back - * to generate a neater result, and ignore any empty elements. Also put a - * null byte at the end. - */ + /* Trim away the leading whitespace */ + trim = TclTrimLeft(element, elemLength, CONCAT_WS, CONCAT_WS_SIZE); + element += trim; + elemLength -= trim; - finalSize = 0; - if (objc == 0) { - *concatStr = '\0'; - } else { - p = concatStr; - for (i = 0; i < objc; i++) { - objPtr = objv[i]; - element = TclGetStringFromObj(objPtr, &elemLength); - while ((elemLength > 0) && (UCHAR(*element) < 127) - && isspace(UCHAR(*element))) { /* INTL: ISO C space. */ - element++; - elemLength--; - } + /* + * Trim away the trailing whitespace. Do not permit trimming + * to expose a final backslash character. + */ - /* - * Trim trailing white space. But, be careful not to trim a space - * character if it is preceded by a backslash: in this case it - * could be significant. - */ + trim = TclTrimRight(element, elemLength, CONCAT_WS, CONCAT_WS_SIZE); + trim -= trim && (element[elemLength - trim - 1] == '\\'); + elemLength -= trim; - while ((elemLength > 0) && (UCHAR(element[elemLength-1]) < 127) - && isspace(UCHAR(element[elemLength-1])) - /* INTL: ISO C space. */ - && ((elemLength < 2) || (element[elemLength-2] != '\\'))) { - elemLength--; - } - if (elemLength == 0) { - continue; /* nothing left of this element */ - } - memcpy(p, element, (size_t) elemLength); - p += elemLength; - *p = ' '; - p++; - finalSize += (elemLength + 1); + /* If we're left with empty element after trimming, do nothing */ + if (elemLength == 0) { + continue; } - if (p != concatStr) { - p[-1] = 0; - finalSize -= 1; /* we overwrote the final ' ' */ - } else { - *p = 0; + + /* Append to the result with space if needed */ + if (needSpace) { + Tcl_AppendToObj(resPtr, " ", 1); } + Tcl_AppendToObj(resPtr, element, elemLength); + needSpace = 1; } - - TclNewObj(objPtr); - objPtr->bytes = concatStr; - objPtr->length = finalSize; - return objPtr; + return resPtr; } /* @@ -2835,7 +3258,7 @@ TclGetIntForIndex( * Leading whitespace is acceptable in an index. */ - while (length && isspace(UCHAR(*bytes))) { /* INTL: ISO space. */ + while (length && TclIsSpaceProc(*bytes)) { bytes++; length--; } @@ -2848,7 +3271,7 @@ TclGetIntForIndex( if ((savedOp != '+') && (savedOp != '-')) { goto parseError; } - if (isspace(UCHAR(opPtr[1]))) { + if (TclIsSpaceProc(opPtr[1])) { goto parseError; } *opPtr = '\0'; @@ -2994,7 +3417,7 @@ SetEndOffsetFromAny( * after "end-" to Tcl_GetInt, then reverse for offset. */ - if (isspace(UCHAR(bytes[4]))) { + if (TclIsSpaceProc(bytes[4])) { return TCL_ERROR; } if (Tcl_GetInt(interp, bytes+4, &offset) != TCL_OK) { @@ -3059,7 +3482,7 @@ TclCheckBadOctal( * zero. Try to generate a meaningful error message. */ - while (isspace(UCHAR(*p))) { /* INTL: ISO space. */ + while (TclIsSpaceProc(*p)) { p++; } if (*p == '+' || *p == '-') { @@ -3072,7 +3495,7 @@ TclCheckBadOctal( while (isdigit(UCHAR(*p))) { /* INTL: digit. */ p++; } - while (isspace(UCHAR(*p))) { /* INTL: ISO space. */ + while (TclIsSpaceProc(*p)) { p++; } if (*p == '\0') { diff --git a/generic/tclVar.c b/generic/tclVar.c index 9815469..aaf1cb9 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -2554,13 +2554,14 @@ Tcl_AppendObjCmd( /* * Note that we do not need to increase the refCount of the Var * pointers: should a trace delete the variable, the return value - * of TclPtrSetVar will be NULL, and we will not access the - * variable again. + * of TclPtrSetVar will be NULL or emptyObjPtr, and we will not + * access the variable again. */ varValuePtr = TclPtrSetVar(interp, varPtr, arrayPtr, objv[1], NULL, objv[i], TCL_APPEND_VALUE|TCL_LEAVE_ERR_MSG, -1); - if (varValuePtr == NULL) { + if ((varValuePtr == NULL) || + (varValuePtr == ((Interp *) interp)->emptyObjPtr)) { return TCL_ERROR; } } @@ -4775,6 +4776,7 @@ FreeLocalVarName( if (namePtr) { Tcl_DecrRefCount(namePtr); } + objPtr->typePtr = NULL; } static void @@ -4816,6 +4818,7 @@ FreeNsVarName( CleanupVar(varPtr, NULL); } } + objPtr->typePtr = NULL; } static void @@ -4855,6 +4858,7 @@ FreeParsedVarName( TclDecrRefCount(arrayPtr); ckfree(elem); } + objPtr->typePtr = NULL; } static void diff --git a/library/tzdata/Africa/Casablanca b/library/tzdata/Africa/Casablanca index 996dd5d..0eef1ac 100644 --- a/library/tzdata/Africa/Casablanca +++ b/library/tzdata/Africa/Casablanca @@ -27,4 +27,6 @@ set TZData(:Africa/Casablanca) { {1250809200 0 0 WET} {1272758400 3600 1 WEST} {1281222000 0 0 WET} + {1301788800 3600 1 WEST} + {1312066800 0 0 WET} } diff --git a/library/tzdata/America/Havana b/library/tzdata/America/Havana index 7fc6305..f37b98e 100644 --- a/library/tzdata/America/Havana +++ b/library/tzdata/America/Havana @@ -104,7 +104,7 @@ set TZData(:America/Havana) { {1256446800 -18000 0 CST} {1268542800 -14400 1 CDT} {1288501200 -18000 0 CST} - {1299992400 -14400 1 CDT} + {1300597200 -14400 1 CDT} {1319950800 -18000 0 CST} {1331442000 -14400 1 CDT} {1351400400 -18000 0 CST} diff --git a/library/tzdata/America/Juneau b/library/tzdata/America/Juneau index 88fe0ce..fead810 100644 --- a/library/tzdata/America/Juneau +++ b/library/tzdata/America/Juneau @@ -32,8 +32,9 @@ set TZData(:America/Juneau) { {278499600 -28800 0 PST} {294228000 -25200 1 PDT} {309949200 -28800 0 PST} - {325677600 -25200 1 PDT} - {341398800 -28800 0 PST} + {325677600 -32400 0 YST} + {325681200 -28800 1 YDT} + {341406000 -28800 0 PST} {357127200 -25200 1 PDT} {372848400 -28800 0 PST} {388576800 -25200 1 PDT} diff --git a/library/tzdata/America/Metlakatla b/library/tzdata/America/Metlakatla new file mode 100644 index 0000000..19337bf --- /dev/null +++ b/library/tzdata/America/Metlakatla @@ -0,0 +1,275 @@ +# created by tools/tclZIC.tcl - do not edit + +set TZData(:America/Metlakatla) { + {-9223372036854775808 54822 0 LMT} + {-3225366822 -31578 0 LMT} + {-2188955622 -28800 0 PST} + {-883584000 -28800 0 PST} + {-880207200 -25200 1 PWT} + {-769395600 -25200 1 PPT} + {-765385200 -28800 0 PST} + {-757353600 -28800 0 PST} + {-31507200 -28800 0 PST} + {-21477600 -25200 1 PDT} + {-5756400 -28800 0 PST} + {9972000 -25200 1 PDT} + {25693200 -28800 0 PST} + {41421600 -25200 1 PDT} + {57747600 -28800 0 PST} + {73476000 -25200 1 PDT} + {89197200 -28800 0 PST} + {104925600 -25200 1 PDT} + {120646800 -28800 0 PST} + {126698400 -25200 1 PDT} + {152096400 -28800 0 PST} + {162381600 -25200 1 PDT} + {183546000 -28800 0 PST} + {199274400 -25200 1 PDT} + {215600400 -28800 0 PST} + {230724000 -25200 1 PDT} + {247050000 -28800 0 PST} + {262778400 -25200 1 PDT} + {278499600 -28800 0 PST} + {294228000 -25200 1 PDT} + {309949200 -28800 0 PST} + {325677600 -25200 1 PDT} + {341398800 -28800 0 PST} + {357127200 -25200 1 PDT} + {372848400 -28800 0 PST} + {388576800 -25200 1 PDT} + {404902800 -28800 0 PST} + {420026400 -25200 1 PDT} + {436356000 -28800 0 MeST} + {452080800 -25200 1 MeST} + {467802000 -28800 0 MeST} + {483530400 -25200 1 MeST} + {499251600 -28800 0 MeST} + {514980000 -25200 1 MeST} + {530701200 -28800 0 MeST} + {544615200 -25200 1 MeST} + {562150800 -28800 0 MeST} + {576064800 -25200 1 MeST} + {594205200 -28800 0 MeST} + {607514400 -25200 1 MeST} + {625654800 -28800 0 MeST} + {638964000 -25200 1 MeST} + {657104400 -28800 0 MeST} + {671018400 -25200 1 MeST} + {688554000 -28800 0 MeST} + {702468000 -25200 1 MeST} + {720003600 -28800 0 MeST} + {733917600 -25200 1 MeST} + {752058000 -28800 0 MeST} + {765367200 -25200 1 MeST} + {783507600 -28800 0 MeST} + {796816800 -25200 1 MeST} + {814957200 -28800 0 MeST} + {828871200 -25200 1 MeST} + {846406800 -28800 0 MeST} + {860320800 -25200 1 MeST} + {877856400 -28800 0 MeST} + {891770400 -25200 1 MeST} + {909306000 -28800 0 MeST} + {923220000 -25200 1 MeST} + {941360400 -28800 0 MeST} + {954669600 -25200 1 MeST} + {972810000 -28800 0 MeST} + {986119200 -25200 1 MeST} + {1004259600 -28800 0 MeST} + {1018173600 -25200 1 MeST} + {1035709200 -28800 0 MeST} + {1049623200 -25200 1 MeST} + {1067158800 -28800 0 MeST} + {1081072800 -25200 1 MeST} + {1099213200 -28800 0 MeST} + {1112522400 -25200 1 MeST} + {1130662800 -28800 0 MeST} + {1143972000 -25200 1 MeST} + {1162112400 -28800 0 MeST} + {1173607200 -25200 1 MeST} + {1194166800 -28800 0 MeST} + {1205056800 -25200 1 MeST} + {1225616400 -28800 0 MeST} + {1236506400 -25200 1 MeST} + {1257066000 -28800 0 MeST} + {1268560800 -25200 1 MeST} + {1289120400 -28800 0 MeST} + {1300010400 -25200 1 MeST} + {1320570000 -28800 0 MeST} + {1331460000 -25200 1 MeST} + {1352019600 -28800 0 MeST} + {1362909600 -25200 1 MeST} + {1383469200 -28800 0 MeST} + {1394359200 -25200 1 MeST} + {1414918800 -28800 0 MeST} + {1425808800 -25200 1 MeST} + {1446368400 -28800 0 MeST} + {1457863200 -25200 1 MeST} + {1478422800 -28800 0 MeST} + {1489312800 -25200 1 MeST} + {1509872400 -28800 0 MeST} + {1520762400 -25200 1 MeST} + {1541322000 -28800 0 MeST} + {1552212000 -25200 1 MeST} + {1572771600 -28800 0 MeST} + {1583661600 -25200 1 MeST} + {1604221200 -28800 0 MeST} + {1615716000 -25200 1 MeST} + {1636275600 -28800 0 MeST} + {1647165600 -25200 1 MeST} + {1667725200 -28800 0 MeST} + {1678615200 -25200 1 MeST} + {1699174800 -28800 0 MeST} + {1710064800 -25200 1 MeST} + {1730624400 -28800 0 MeST} + {1741514400 -25200 1 MeST} + {1762074000 -28800 0 MeST} + {1772964000 -25200 1 MeST} + {1793523600 -28800 0 MeST} + {1805018400 -25200 1 MeST} + {1825578000 -28800 0 MeST} + {1836468000 -25200 1 MeST} + {1857027600 -28800 0 MeST} + {1867917600 -25200 1 MeST} + {1888477200 -28800 0 MeST} + {1899367200 -25200 1 MeST} + {1919926800 -28800 0 MeST} + {1930816800 -25200 1 MeST} + {1951376400 -28800 0 MeST} + {1962871200 -25200 1 MeST} + {1983430800 -28800 0 MeST} + {1994320800 -25200 1 MeST} + {2014880400 -28800 0 MeST} + {2025770400 -25200 1 MeST} + {2046330000 -28800 0 MeST} + {2057220000 -25200 1 MeST} + {2077779600 -28800 0 MeST} + {2088669600 -25200 1 MeST} + {2109229200 -28800 0 MeST} + {2120119200 -25200 1 MeST} + {2140678800 -28800 0 MeST} + {2152173600 -25200 1 MeST} + {2172733200 -28800 0 MeST} + {2183623200 -25200 1 MeST} + {2204182800 -28800 0 MeST} + {2215072800 -25200 1 MeST} + {2235632400 -28800 0 MeST} + {2246522400 -25200 1 MeST} + {2267082000 -28800 0 MeST} + {2277972000 -25200 1 MeST} + {2298531600 -28800 0 MeST} + {2309421600 -25200 1 MeST} + {2329981200 -28800 0 MeST} + {2341476000 -25200 1 MeST} + {2362035600 -28800 0 MeST} + {2372925600 -25200 1 MeST} + {2393485200 -28800 0 MeST} + {2404375200 -25200 1 MeST} + {2424934800 -28800 0 MeST} + {2435824800 -25200 1 MeST} + {2456384400 -28800 0 MeST} + {2467274400 -25200 1 MeST} + {2487834000 -28800 0 MeST} + {2499328800 -25200 1 MeST} + {2519888400 -28800 0 MeST} + {2530778400 -25200 1 MeST} + {2551338000 -28800 0 MeST} + {2562228000 -25200 1 MeST} + {2582787600 -28800 0 MeST} + {2593677600 -25200 1 MeST} + {2614237200 -28800 0 MeST} + {2625127200 -25200 1 MeST} + {2645686800 -28800 0 MeST} + {2656576800 -25200 1 MeST} + {2677136400 -28800 0 MeST} + {2688631200 -25200 1 MeST} + {2709190800 -28800 0 MeST} + {2720080800 -25200 1 MeST} + {2740640400 -28800 0 MeST} + {2751530400 -25200 1 MeST} + {2772090000 -28800 0 MeST} + {2782980000 -25200 1 MeST} + {2803539600 -28800 0 MeST} + {2814429600 -25200 1 MeST} + {2834989200 -28800 0 MeST} + {2846484000 -25200 1 MeST} + {2867043600 -28800 0 MeST} + {2877933600 -25200 1 MeST} + {2898493200 -28800 0 MeST} + {2909383200 -25200 1 MeST} + {2929942800 -28800 0 MeST} + {2940832800 -25200 1 MeST} + {2961392400 -28800 0 MeST} + {2972282400 -25200 1 MeST} + {2992842000 -28800 0 MeST} + {3003732000 -25200 1 MeST} + {3024291600 -28800 0 MeST} + {3035786400 -25200 1 MeST} + {3056346000 -28800 0 MeST} + {3067236000 -25200 1 MeST} + {3087795600 -28800 0 MeST} + {3098685600 -25200 1 MeST} + {3119245200 -28800 0 MeST} + {3130135200 -25200 1 MeST} + {3150694800 -28800 0 MeST} + {3161584800 -25200 1 MeST} + {3182144400 -28800 0 MeST} + {3193034400 -25200 1 MeST} + {3213594000 -28800 0 MeST} + {3225088800 -25200 1 MeST} + {3245648400 -28800 0 MeST} + {3256538400 -25200 1 MeST} + {3277098000 -28800 0 MeST} + {3287988000 -25200 1 MeST} + {3308547600 -28800 0 MeST} + {3319437600 -25200 1 MeST} + {3339997200 -28800 0 MeST} + {3350887200 -25200 1 MeST} + {3371446800 -28800 0 MeST} + {3382941600 -25200 1 MeST} + {3403501200 -28800 0 MeST} + {3414391200 -25200 1 MeST} + {3434950800 -28800 0 MeST} + {3445840800 -25200 1 MeST} + {3466400400 -28800 0 MeST} + {3477290400 -25200 1 MeST} + {3497850000 -28800 0 MeST} + {3508740000 -25200 1 MeST} + {3529299600 -28800 0 MeST} + {3540189600 -25200 1 MeST} + {3560749200 -28800 0 MeST} + {3572244000 -25200 1 MeST} + {3592803600 -28800 0 MeST} + {3603693600 -25200 1 MeST} + {3624253200 -28800 0 MeST} + {3635143200 -25200 1 MeST} + {3655702800 -28800 0 MeST} + {3666592800 -25200 1 MeST} + {3687152400 -28800 0 MeST} + {3698042400 -25200 1 MeST} + {3718602000 -28800 0 MeST} + {3730096800 -25200 1 MeST} + {3750656400 -28800 0 MeST} + {3761546400 -25200 1 MeST} + {3782106000 -28800 0 MeST} + {3792996000 -25200 1 MeST} + {3813555600 -28800 0 MeST} + {3824445600 -25200 1 MeST} + {3845005200 -28800 0 MeST} + {3855895200 -25200 1 MeST} + {3876454800 -28800 0 MeST} + {3887344800 -25200 1 MeST} + {3907904400 -28800 0 MeST} + {3919399200 -25200 1 MeST} + {3939958800 -28800 0 MeST} + {3950848800 -25200 1 MeST} + {3971408400 -28800 0 MeST} + {3982298400 -25200 1 MeST} + {4002858000 -28800 0 MeST} + {4013748000 -25200 1 MeST} + {4034307600 -28800 0 MeST} + {4045197600 -25200 1 MeST} + {4065757200 -28800 0 MeST} + {4076647200 -25200 1 MeST} + {4097206800 -28800 0 MeST} +} diff --git a/library/tzdata/America/North_Dakota/Beulah b/library/tzdata/America/North_Dakota/Beulah new file mode 100644 index 0000000..95407c6 --- /dev/null +++ b/library/tzdata/America/North_Dakota/Beulah @@ -0,0 +1,279 @@ +# created by tools/tclZIC.tcl - do not edit + +set TZData(:America/North_Dakota/Beulah) { + {-9223372036854775808 -24427 0 LMT} + {-2717643600 -25200 0 MST} + {-1633273200 -21600 1 MDT} + {-1615132800 -25200 0 MST} + {-1601823600 -21600 1 MDT} + {-1583683200 -25200 0 MST} + {-880210800 -21600 1 MWT} + {-769395600 -21600 1 MPT} + {-765388800 -25200 0 MST} + {-84380400 -21600 1 MDT} + {-68659200 -25200 0 MST} + {-52930800 -21600 1 MDT} + {-37209600 -25200 0 MST} + {-21481200 -21600 1 MDT} + {-5760000 -25200 0 MST} + {9968400 -21600 1 MDT} + {25689600 -25200 0 MST} + {41418000 -21600 1 MDT} + {57744000 -25200 0 MST} + {73472400 -21600 1 MDT} + {89193600 -25200 0 MST} + {104922000 -21600 1 MDT} + {120643200 -25200 0 MST} + {126694800 -21600 1 MDT} + {152092800 -25200 0 MST} + {162378000 -21600 1 MDT} + {183542400 -25200 0 MST} + {199270800 -21600 1 MDT} + {215596800 -25200 0 MST} + {230720400 -21600 1 MDT} + {247046400 -25200 0 MST} + {262774800 -21600 1 MDT} + {278496000 -25200 0 MST} + {294224400 -21600 1 MDT} + {309945600 -25200 0 MST} + {325674000 -21600 1 MDT} + {341395200 -25200 0 MST} + {357123600 -21600 1 MDT} + {372844800 -25200 0 MST} + {388573200 -21600 1 MDT} + {404899200 -25200 0 MST} + {420022800 -21600 1 MDT} + {436348800 -25200 0 MST} + {452077200 -21600 1 MDT} + {467798400 -25200 0 MST} + {483526800 -21600 1 MDT} + {499248000 -25200 0 MST} + {514976400 -21600 1 MDT} + {530697600 -25200 0 MST} + {544611600 -21600 1 MDT} + {562147200 -25200 0 MST} + {576061200 -21600 1 MDT} + {594201600 -25200 0 MST} + {607510800 -21600 1 MDT} + {625651200 -25200 0 MST} + {638960400 -21600 1 MDT} + {657100800 -25200 0 MST} + {671014800 -21600 1 MDT} + {688550400 -25200 0 MST} + {702464400 -21600 1 MDT} + {720000000 -25200 0 MST} + {733914000 -21600 1 MDT} + {752054400 -25200 0 MST} + {765363600 -21600 1 MDT} + {783504000 -25200 0 MST} + {796813200 -21600 1 MDT} + {814953600 -25200 0 MST} + {828867600 -21600 1 MDT} + {846403200 -25200 0 MST} + {860317200 -21600 1 MDT} + {877852800 -25200 0 MST} + {891766800 -21600 1 MDT} + {909302400 -25200 0 MST} + {923216400 -21600 1 MDT} + {941356800 -25200 0 MST} + {954666000 -21600 1 MDT} + {972806400 -25200 0 MST} + {986115600 -21600 1 MDT} + {1004256000 -25200 0 MST} + {1018170000 -21600 1 MDT} + {1035705600 -25200 0 MST} + {1049619600 -21600 1 MDT} + {1067155200 -25200 0 MST} + {1081069200 -21600 1 MDT} + {1099209600 -25200 0 MST} + {1112518800 -21600 1 MDT} + {1130659200 -25200 0 MST} + {1143968400 -21600 1 MDT} + {1162108800 -25200 0 MST} + {1173603600 -21600 1 MDT} + {1194163200 -25200 0 MST} + {1205053200 -21600 1 MDT} + {1225612800 -25200 0 MST} + {1236502800 -21600 1 MDT} + {1257062400 -25200 0 MST} + {1268557200 -21600 1 MDT} + {1289120400 -21600 0 CST} + {1300003200 -18000 1 CDT} + {1320562800 -21600 0 CST} + {1331452800 -18000 1 CDT} + {1352012400 -21600 0 CST} + {1362902400 -18000 1 CDT} + {1383462000 -21600 0 CST} + {1394352000 -18000 1 CDT} + {1414911600 -21600 0 CST} + {1425801600 -18000 1 CDT} + {1446361200 -21600 0 CST} + {1457856000 -18000 1 CDT} + {1478415600 -21600 0 CST} + {1489305600 -18000 1 CDT} + {1509865200 -21600 0 CST} + {1520755200 -18000 1 CDT} + {1541314800 -21600 0 CST} + {1552204800 -18000 1 CDT} + {1572764400 -21600 0 CST} + {1583654400 -18000 1 CDT} + {1604214000 -21600 0 CST} + {1615708800 -18000 1 CDT} + {1636268400 -21600 0 CST} + {1647158400 -18000 1 CDT} + {1667718000 -21600 0 CST} + {1678608000 -18000 1 CDT} + {1699167600 -21600 0 CST} + {1710057600 -18000 1 CDT} + {1730617200 -21600 0 CST} + {1741507200 -18000 1 CDT} + {1762066800 -21600 0 CST} + {1772956800 -18000 1 CDT} + {1793516400 -21600 0 CST} + {1805011200 -18000 1 CDT} + {1825570800 -21600 0 CST} + {1836460800 -18000 1 CDT} + {1857020400 -21600 0 CST} + {1867910400 -18000 1 CDT} + {1888470000 -21600 0 CST} + {1899360000 -18000 1 CDT} + {1919919600 -21600 0 CST} + {1930809600 -18000 1 CDT} + {1951369200 -21600 0 CST} + {1962864000 -18000 1 CDT} + {1983423600 -21600 0 CST} + {1994313600 -18000 1 CDT} + {2014873200 -21600 0 CST} + {2025763200 -18000 1 CDT} + {2046322800 -21600 0 CST} + {2057212800 -18000 1 CDT} + {2077772400 -21600 0 CST} + {2088662400 -18000 1 CDT} + {2109222000 -21600 0 CST} + {2120112000 -18000 1 CDT} + {2140671600 -21600 0 CST} + {2152166400 -18000 1 CDT} + {2172726000 -21600 0 CST} + {2183616000 -18000 1 CDT} + {2204175600 -21600 0 CST} + {2215065600 -18000 1 CDT} + {2235625200 -21600 0 CST} + {2246515200 -18000 1 CDT} + {2267074800 -21600 0 CST} + {2277964800 -18000 1 CDT} + {2298524400 -21600 0 CST} + {2309414400 -18000 1 CDT} + {2329974000 -21600 0 CST} + {2341468800 -18000 1 CDT} + {2362028400 -21600 0 CST} + {2372918400 -18000 1 CDT} + {2393478000 -21600 0 CST} + {2404368000 -18000 1 CDT} + {2424927600 -21600 0 CST} + {2435817600 -18000 1 CDT} + {2456377200 -21600 0 CST} + {2467267200 -18000 1 CDT} + {2487826800 -21600 0 CST} + {2499321600 -18000 1 CDT} + {2519881200 -21600 0 CST} + {2530771200 -18000 1 CDT} + {2551330800 -21600 0 CST} + {2562220800 -18000 1 CDT} + {2582780400 -21600 0 CST} + {2593670400 -18000 1 CDT} + {2614230000 -21600 0 CST} + {2625120000 -18000 1 CDT} + {2645679600 -21600 0 CST} + {2656569600 -18000 1 CDT} + {2677129200 -21600 0 CST} + {2688624000 -18000 1 CDT} + {2709183600 -21600 0 CST} + {2720073600 -18000 1 CDT} + {2740633200 -21600 0 CST} + {2751523200 -18000 1 CDT} + {2772082800 -21600 0 CST} + {2782972800 -18000 1 CDT} + {2803532400 -21600 0 CST} + {2814422400 -18000 1 CDT} + {2834982000 -21600 0 CST} + {2846476800 -18000 1 CDT} + {2867036400 -21600 0 CST} + {2877926400 -18000 1 CDT} + {2898486000 -21600 0 CST} + {2909376000 -18000 1 CDT} + {2929935600 -21600 0 CST} + {2940825600 -18000 1 CDT} + {2961385200 -21600 0 CST} + {2972275200 -18000 1 CDT} + {2992834800 -21600 0 CST} + {3003724800 -18000 1 CDT} + {3024284400 -21600 0 CST} + {3035779200 -18000 1 CDT} + {3056338800 -21600 0 CST} + {3067228800 -18000 1 CDT} + {3087788400 -21600 0 CST} + {3098678400 -18000 1 CDT} + {3119238000 -21600 0 CST} + {3130128000 -18000 1 CDT} + {3150687600 -21600 0 CST} + {3161577600 -18000 1 CDT} + {3182137200 -21600 0 CST} + {3193027200 -18000 1 CDT} + {3213586800 -21600 0 CST} + {3225081600 -18000 1 CDT} + {3245641200 -21600 0 CST} + {3256531200 -18000 1 CDT} + {3277090800 -21600 0 CST} + {3287980800 -18000 1 CDT} + {3308540400 -21600 0 CST} + {3319430400 -18000 1 CDT} + {3339990000 -21600 0 CST} + {3350880000 -18000 1 CDT} + {3371439600 -21600 0 CST} + {3382934400 -18000 1 CDT} + {3403494000 -21600 0 CST} + {3414384000 -18000 1 CDT} + {3434943600 -21600 0 CST} + {3445833600 -18000 1 CDT} + {3466393200 -21600 0 CST} + {3477283200 -18000 1 CDT} + {3497842800 -21600 0 CST} + {3508732800 -18000 1 CDT} + {3529292400 -21600 0 CST} + {3540182400 -18000 1 CDT} + {3560742000 -21600 0 CST} + {3572236800 -18000 1 CDT} + {3592796400 -21600 0 CST} + {3603686400 -18000 1 CDT} + {3624246000 -21600 0 CST} + {3635136000 -18000 1 CDT} + {3655695600 -21600 0 CST} + {3666585600 -18000 1 CDT} + {3687145200 -21600 0 CST} + {3698035200 -18000 1 CDT} + {3718594800 -21600 0 CST} + {3730089600 -18000 1 CDT} + {3750649200 -21600 0 CST} + {3761539200 -18000 1 CDT} + {3782098800 -21600 0 CST} + {3792988800 -18000 1 CDT} + {3813548400 -21600 0 CST} + {3824438400 -18000 1 CDT} + {3844998000 -21600 0 CST} + {3855888000 -18000 1 CDT} + {3876447600 -21600 0 CST} + {3887337600 -18000 1 CDT} + {3907897200 -21600 0 CST} + {3919392000 -18000 1 CDT} + {3939951600 -21600 0 CST} + {3950841600 -18000 1 CDT} + {3971401200 -21600 0 CST} + {3982291200 -18000 1 CDT} + {4002850800 -21600 0 CST} + {4013740800 -18000 1 CDT} + {4034300400 -21600 0 CST} + {4045190400 -18000 1 CDT} + {4065750000 -21600 0 CST} + {4076640000 -18000 1 CDT} + {4097199600 -21600 0 CST} +} diff --git a/library/tzdata/America/Santiago b/library/tzdata/America/Santiago index a3cd817..c631bd1 100644 --- a/library/tzdata/America/Santiago +++ b/library/tzdata/America/Santiago @@ -110,8 +110,8 @@ set TZData(:America/Santiago) { {1255233600 -10800 1 CLST} {1270350000 -14400 0 CLT} {1286683200 -10800 1 CLST} - {1299985200 -14400 0 CLT} - {1318132800 -10800 1 CLST} + {1304823600 -14400 0 CLT} + {1313899200 -10800 1 CLST} {1331434800 -14400 0 CLT} {1350187200 -10800 1 CLST} {1362884400 -14400 0 CLT} diff --git a/library/tzdata/America/Sitka b/library/tzdata/America/Sitka new file mode 100644 index 0000000..c096fc9 --- /dev/null +++ b/library/tzdata/America/Sitka @@ -0,0 +1,275 @@ +# created by tools/tclZIC.tcl - do not edit + +set TZData(:America/Sitka) { + {-9223372036854775808 -53927 0 LMT} + {-3225258073 -32473 0 LMT} + {-2188954727 -28800 0 PST} + {-883584000 -28800 0 PST} + {-880207200 -25200 1 PWT} + {-769395600 -25200 1 PPT} + {-765385200 -28800 0 PST} + {-757353600 -28800 0 PST} + {-31507200 -28800 0 PST} + {-21477600 -25200 1 PDT} + {-5756400 -28800 0 PST} + {9972000 -25200 1 PDT} + {25693200 -28800 0 PST} + {41421600 -25200 1 PDT} + {57747600 -28800 0 PST} + {73476000 -25200 1 PDT} + {89197200 -28800 0 PST} + {104925600 -25200 1 PDT} + {120646800 -28800 0 PST} + {126698400 -25200 1 PDT} + {152096400 -28800 0 PST} + {162381600 -25200 1 PDT} + {183546000 -28800 0 PST} + {199274400 -25200 1 PDT} + {215600400 -28800 0 PST} + {230724000 -25200 1 PDT} + {247050000 -28800 0 PST} + {262778400 -25200 1 PDT} + {278499600 -28800 0 PST} + {294228000 -25200 1 PDT} + {309949200 -28800 0 PST} + {325677600 -25200 1 PDT} + {341398800 -28800 0 PST} + {357127200 -25200 1 PDT} + {372848400 -28800 0 PST} + {388576800 -25200 1 PDT} + {404902800 -28800 0 PST} + {420026400 -25200 1 PDT} + {439030800 -32400 0 AKST} + {452084400 -28800 1 AKDT} + {467805600 -32400 0 AKST} + {483534000 -28800 1 AKDT} + {499255200 -32400 0 AKST} + {514983600 -28800 1 AKDT} + {530704800 -32400 0 AKST} + {544618800 -28800 1 AKDT} + {562154400 -32400 0 AKST} + {576068400 -28800 1 AKDT} + {594208800 -32400 0 AKST} + {607518000 -28800 1 AKDT} + {625658400 -32400 0 AKST} + {638967600 -28800 1 AKDT} + {657108000 -32400 0 AKST} + {671022000 -28800 1 AKDT} + {688557600 -32400 0 AKST} + {702471600 -28800 1 AKDT} + {720007200 -32400 0 AKST} + {733921200 -28800 1 AKDT} + {752061600 -32400 0 AKST} + {765370800 -28800 1 AKDT} + {783511200 -32400 0 AKST} + {796820400 -28800 1 AKDT} + {814960800 -32400 0 AKST} + {828874800 -28800 1 AKDT} + {846410400 -32400 0 AKST} + {860324400 -28800 1 AKDT} + {877860000 -32400 0 AKST} + {891774000 -28800 1 AKDT} + {909309600 -32400 0 AKST} + {923223600 -28800 1 AKDT} + {941364000 -32400 0 AKST} + {954673200 -28800 1 AKDT} + {972813600 -32400 0 AKST} + {986122800 -28800 1 AKDT} + {1004263200 -32400 0 AKST} + {1018177200 -28800 1 AKDT} + {1035712800 -32400 0 AKST} + {1049626800 -28800 1 AKDT} + {1067162400 -32400 0 AKST} + {1081076400 -28800 1 AKDT} + {1099216800 -32400 0 AKST} + {1112526000 -28800 1 AKDT} + {1130666400 -32400 0 AKST} + {1143975600 -28800 1 AKDT} + {1162116000 -32400 0 AKST} + {1173610800 -28800 1 AKDT} + {1194170400 -32400 0 AKST} + {1205060400 -28800 1 AKDT} + {1225620000 -32400 0 AKST} + {1236510000 -28800 1 AKDT} + {1257069600 -32400 0 AKST} + {1268564400 -28800 1 AKDT} + {1289124000 -32400 0 AKST} + {1300014000 -28800 1 AKDT} + {1320573600 -32400 0 AKST} + {1331463600 -28800 1 AKDT} + {1352023200 -32400 0 AKST} + {1362913200 -28800 1 AKDT} + {1383472800 -32400 0 AKST} + {1394362800 -28800 1 AKDT} + {1414922400 -32400 0 AKST} + {1425812400 -28800 1 AKDT} + {1446372000 -32400 0 AKST} + {1457866800 -28800 1 AKDT} + {1478426400 -32400 0 AKST} + {1489316400 -28800 1 AKDT} + {1509876000 -32400 0 AKST} + {1520766000 -28800 1 AKDT} + {1541325600 -32400 0 AKST} + {1552215600 -28800 1 AKDT} + {1572775200 -32400 0 AKST} + {1583665200 -28800 1 AKDT} + {1604224800 -32400 0 AKST} + {1615719600 -28800 1 AKDT} + {1636279200 -32400 0 AKST} + {1647169200 -28800 1 AKDT} + {1667728800 -32400 0 AKST} + {1678618800 -28800 1 AKDT} + {1699178400 -32400 0 AKST} + {1710068400 -28800 1 AKDT} + {1730628000 -32400 0 AKST} + {1741518000 -28800 1 AKDT} + {1762077600 -32400 0 AKST} + {1772967600 -28800 1 AKDT} + {1793527200 -32400 0 AKST} + {1805022000 -28800 1 AKDT} + {1825581600 -32400 0 AKST} + {1836471600 -28800 1 AKDT} + {1857031200 -32400 0 AKST} + {1867921200 -28800 1 AKDT} + {1888480800 -32400 0 AKST} + {1899370800 -28800 1 AKDT} + {1919930400 -32400 0 AKST} + {1930820400 -28800 1 AKDT} + {1951380000 -32400 0 AKST} + {1962874800 -28800 1 AKDT} + {1983434400 -32400 0 AKST} + {1994324400 -28800 1 AKDT} + {2014884000 -32400 0 AKST} + {2025774000 -28800 1 AKDT} + {2046333600 -32400 0 AKST} + {2057223600 -28800 1 AKDT} + {2077783200 -32400 0 AKST} + {2088673200 -28800 1 AKDT} + {2109232800 -32400 0 AKST} + {2120122800 -28800 1 AKDT} + {2140682400 -32400 0 AKST} + {2152177200 -28800 1 AKDT} + {2172736800 -32400 0 AKST} + {2183626800 -28800 1 AKDT} + {2204186400 -32400 0 AKST} + {2215076400 -28800 1 AKDT} + {2235636000 -32400 0 AKST} + {2246526000 -28800 1 AKDT} + {2267085600 -32400 0 AKST} + {2277975600 -28800 1 AKDT} + {2298535200 -32400 0 AKST} + {2309425200 -28800 1 AKDT} + {2329984800 -32400 0 AKST} + {2341479600 -28800 1 AKDT} + {2362039200 -32400 0 AKST} + {2372929200 -28800 1 AKDT} + {2393488800 -32400 0 AKST} + {2404378800 -28800 1 AKDT} + {2424938400 -32400 0 AKST} + {2435828400 -28800 1 AKDT} + {2456388000 -32400 0 AKST} + {2467278000 -28800 1 AKDT} + {2487837600 -32400 0 AKST} + {2499332400 -28800 1 AKDT} + {2519892000 -32400 0 AKST} + {2530782000 -28800 1 AKDT} + {2551341600 -32400 0 AKST} + {2562231600 -28800 1 AKDT} + {2582791200 -32400 0 AKST} + {2593681200 -28800 1 AKDT} + {2614240800 -32400 0 AKST} + {2625130800 -28800 1 AKDT} + {2645690400 -32400 0 AKST} + {2656580400 -28800 1 AKDT} + {2677140000 -32400 0 AKST} + {2688634800 -28800 1 AKDT} + {2709194400 -32400 0 AKST} + {2720084400 -28800 1 AKDT} + {2740644000 -32400 0 AKST} + {2751534000 -28800 1 AKDT} + {2772093600 -32400 0 AKST} + {2782983600 -28800 1 AKDT} + {2803543200 -32400 0 AKST} + {2814433200 -28800 1 AKDT} + {2834992800 -32400 0 AKST} + {2846487600 -28800 1 AKDT} + {2867047200 -32400 0 AKST} + {2877937200 -28800 1 AKDT} + {2898496800 -32400 0 AKST} + {2909386800 -28800 1 AKDT} + {2929946400 -32400 0 AKST} + {2940836400 -28800 1 AKDT} + {2961396000 -32400 0 AKST} + {2972286000 -28800 1 AKDT} + {2992845600 -32400 0 AKST} + {3003735600 -28800 1 AKDT} + {3024295200 -32400 0 AKST} + {3035790000 -28800 1 AKDT} + {3056349600 -32400 0 AKST} + {3067239600 -28800 1 AKDT} + {3087799200 -32400 0 AKST} + {3098689200 -28800 1 AKDT} + {3119248800 -32400 0 AKST} + {3130138800 -28800 1 AKDT} + {3150698400 -32400 0 AKST} + {3161588400 -28800 1 AKDT} + {3182148000 -32400 0 AKST} + {3193038000 -28800 1 AKDT} + {3213597600 -32400 0 AKST} + {3225092400 -28800 1 AKDT} + {3245652000 -32400 0 AKST} + {3256542000 -28800 1 AKDT} + {3277101600 -32400 0 AKST} + {3287991600 -28800 1 AKDT} + {3308551200 -32400 0 AKST} + {3319441200 -28800 1 AKDT} + {3340000800 -32400 0 AKST} + {3350890800 -28800 1 AKDT} + {3371450400 -32400 0 AKST} + {3382945200 -28800 1 AKDT} + {3403504800 -32400 0 AKST} + {3414394800 -28800 1 AKDT} + {3434954400 -32400 0 AKST} + {3445844400 -28800 1 AKDT} + {3466404000 -32400 0 AKST} + {3477294000 -28800 1 AKDT} + {3497853600 -32400 0 AKST} + {3508743600 -28800 1 AKDT} + {3529303200 -32400 0 AKST} + {3540193200 -28800 1 AKDT} + {3560752800 -32400 0 AKST} + {3572247600 -28800 1 AKDT} + {3592807200 -32400 0 AKST} + {3603697200 -28800 1 AKDT} + {3624256800 -32400 0 AKST} + {3635146800 -28800 1 AKDT} + {3655706400 -32400 0 AKST} + {3666596400 -28800 1 AKDT} + {3687156000 -32400 0 AKST} + {3698046000 -28800 1 AKDT} + {3718605600 -32400 0 AKST} + {3730100400 -28800 1 AKDT} + {3750660000 -32400 0 AKST} + {3761550000 -28800 1 AKDT} + {3782109600 -32400 0 AKST} + {3792999600 -28800 1 AKDT} + {3813559200 -32400 0 AKST} + {3824449200 -28800 1 AKDT} + {3845008800 -32400 0 AKST} + {3855898800 -28800 1 AKDT} + {3876458400 -32400 0 AKST} + {3887348400 -28800 1 AKDT} + {3907908000 -32400 0 AKST} + {3919402800 -28800 1 AKDT} + {3939962400 -32400 0 AKST} + {3950852400 -28800 1 AKDT} + {3971412000 -32400 0 AKST} + {3982302000 -28800 1 AKDT} + {4002861600 -32400 0 AKST} + {4013751600 -28800 1 AKDT} + {4034311200 -32400 0 AKST} + {4045201200 -28800 1 AKDT} + {4065760800 -32400 0 AKST} + {4076650800 -28800 1 AKDT} + {4097210400 -32400 0 AKST} +} diff --git a/library/tzdata/Atlantic/Stanley b/library/tzdata/Atlantic/Stanley index 70dc402..545b91c 100644 --- a/library/tzdata/Atlantic/Stanley +++ b/library/tzdata/Atlantic/Stanley @@ -72,8 +72,7 @@ set TZData(:Atlantic/Stanley) { {1252216800 -10800 1 FKST} {1271566800 -14400 0 FKT} {1283666400 -10800 1 FKST} - {1303016400 -14400 0 FKT} - {1315116000 -10800 1 FKST} + {1315112400 -10800 1 FKST} {1334466000 -14400 0 FKT} {1346565600 -10800 1 FKST} {1366520400 -14400 0 FKT} diff --git a/library/tzdata/Europe/Istanbul b/library/tzdata/Europe/Istanbul index 06b2f88..7737d75 100644 --- a/library/tzdata/Europe/Istanbul +++ b/library/tzdata/Europe/Istanbul @@ -122,7 +122,8 @@ set TZData(:Europe/Istanbul) { {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} - {1301187600 10800 1 EEST} + {1301187600 7200 0 EET} + {1301274000 10800 0 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} diff --git a/library/tzdata/Pacific/Apia b/library/tzdata/Pacific/Apia index 2db52b6..25b047d 100644 --- a/library/tzdata/Pacific/Apia +++ b/library/tzdata/Pacific/Apia @@ -6,5 +6,5 @@ set TZData(:Pacific/Apia) { {-1861878784 -41400 0 SAMT} {-631110600 -39600 0 WST} {1285498800 -36000 1 WSDT} - {1301828400 -39600 0 WST} + {1301752800 -39600 0 WST} } diff --git a/library/tzdata/Pacific/Easter b/library/tzdata/Pacific/Easter index be661fc..f8e63a8 100644 --- a/library/tzdata/Pacific/Easter +++ b/library/tzdata/Pacific/Easter @@ -94,8 +94,8 @@ set TZData(:Pacific/Easter) { {1255233600 -18000 1 EASST} {1270350000 -21600 0 EAST} {1286683200 -18000 1 EASST} - {1299985200 -21600 0 EAST} - {1318132800 -18000 1 EASST} + {1304823600 -21600 0 EAST} + {1313899200 -18000 1 EASST} {1331434800 -21600 0 EAST} {1350187200 -18000 1 EASST} {1362884400 -21600 0 EAST} diff --git a/library/tzdata/Pacific/Honolulu b/library/tzdata/Pacific/Honolulu index f441a02..e24b096 100644 --- a/library/tzdata/Pacific/Honolulu +++ b/library/tzdata/Pacific/Honolulu @@ -2,11 +2,9 @@ set TZData(:Pacific/Honolulu) { {-9223372036854775808 -37886 0 LMT} - {-2208907714 -37800 0 HST} + {-2334101314 -37800 0 HST} {-1157283000 -34200 1 HDT} - {-1155472200 -34200 0 HST} - {-880201800 -34200 1 HWT} - {-769395600 -34200 1 HPT} - {-765376200 -37800 0 HST} + {-1155436200 -37800 0 HST} + {-880198200 -34200 1 HDT} {-712150200 -36000 0 HST} } diff --git a/libtommath/bn_mp_div_d.c b/libtommath/bn_mp_div_d.c index f2729d2..af18d0a 100644 --- a/libtommath/bn_mp_div_d.c +++ b/libtommath/bn_mp_div_d.c @@ -20,7 +20,7 @@ static int s_is_power_of_two(mp_digit b, int *p) int x; /* quick out - if (b & (b-1)) isn't zero, b isn't a power of two */ - if ((b & (b-1)) != 0) { + if ((b==0) || (b & (b-1))) { return 0; } for (x = 1; x < DIGIT_BIT; x++) { diff --git a/libtommath/bn_mp_montgomery_setup.c b/libtommath/bn_mp_montgomery_setup.c index 9bbe0c8..b8e1887 100644 --- a/libtommath/bn_mp_montgomery_setup.c +++ b/libtommath/bn_mp_montgomery_setup.c @@ -48,7 +48,7 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) #endif /* rho = -1/m mod b */ - *rho = (((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; + *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; return MP_OKAY; } diff --git a/libtommath/bn_mp_prime_next_prime.c b/libtommath/bn_mp_prime_next_prime.c index 3171d61..2433e8c 100644 --- a/libtommath/bn_mp_prime_next_prime.c +++ b/libtommath/bn_mp_prime_next_prime.c @@ -143,7 +143,7 @@ int mp_prime_next_prime(mp_int *a, int t, int bbs_style) /* is this prime? */ for (x = 0; x < t; x++) { - mp_set(&b, ltm_prime_tab[t]); + mp_set(&b, ltm_prime_tab[x]); if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_ERR; } diff --git a/libtommath/bn_mp_shrink.c b/libtommath/bn_mp_shrink.c index 482ca48..bfdf93a 100644 --- a/libtommath/bn_mp_shrink.c +++ b/libtommath/bn_mp_shrink.c @@ -19,12 +19,17 @@ int mp_shrink (mp_int * a) { mp_digit *tmp; - if (a->alloc != a->used && a->used > 0) { - if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) { + int used = 1; + + if(a->used > 0) + used = a->used; + + if (a->alloc != used) { + if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * used)) == NULL) { return MP_MEM; } a->dp = tmp; - a->alloc = a->used; + a->alloc = used; } return MP_OKAY; } diff --git a/libtommath/changes.txt b/libtommath/changes.txt index 9498d36..4fc0913 100644 --- a/libtommath/changes.txt +++ b/libtommath/changes.txt @@ -1,3 +1,17 @@ +July 23rd, 2010 +v0.42.0 + -- Fix for mp_prime_next_prime() bug when checking generated prime + -- allow mp_shrink to shrink initialized, but empty MPI's + -- Added project and solution files for Visual Studio 2005 and Visual Studio 2008. + +March 10th, 2007 +v0.41 -- Wolfgang Ehrhardt suggested a quick fix to mp_div_d() which makes the detection of powers of two quicker. + -- [CRI] Added libtommath.dsp for Visual C++ users. + +December 24th, 2006 +v0.40 -- Updated makefile to properly support LIBNAME + -- Fixed bug in fast_s_mp_mul_high_digs() which overflowed (line 83), thanks Valgrind! + April 4th, 2006 v0.39 -- Jim Wigginton pointed out my Montgomery examples in figures 6.4 and 6.6 were off by one, k should be 9 not 8 -- Bruce Guenter suggested I use --tag=CC for libtool builds where the compiler may think it's C++. diff --git a/libtommath/etc/drprimes.txt b/libtommath/etc/drprimes.txt index 2c887ea..7c97f67 100644 --- a/libtommath/etc/drprimes.txt +++ b/libtommath/etc/drprimes.txt @@ -1,6 +1,9 @@ -280-bit prime: -p == 1942668892225729070919461906823518906642406839052139521251812409738904285204940164839 +300-bit prime: +p == 2037035976334486086268445688409378161051468393665936250636140449354381298610415201576637819 -532-bit prime: -p == 14059105607947488696282932836518693308967803494693489478439861164411992439598399594747002144074658928593502845729752797260025831423419686528151609940203368691747 +540-bit prime: +p == 3599131035634557106248430806148785487095757694641533306480604458089470064537190296255232548883112685719936728506816716098566612844395439751206810991770626477344739 + +780-bit prime: +p == 6359114106063703798370219984742410466332205126109989319225557147754704702203399726411277962562135973685197744935448875852478791860694279747355800678568677946181447581781401213133886609947027230004277244697462656003655947791725966271167 diff --git a/libtommath/makefile b/libtommath/makefile index e08a888..70de306 100644 --- a/libtommath/makefile +++ b/libtommath/makefile @@ -3,7 +3,7 @@ #Tom St Denis #version of library -VERSION=0.39 +VERSION=0.42.0 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare @@ -40,12 +40,13 @@ else USER=$(INSTALL_USER) endif -default: libtommath.a - #default files to install ifndef LIBNAME LIBNAME=libtommath.a endif + +default: ${LIBNAME} + HEADERS=tommath.h tommath_class.h tommath_superclass.h #LIBPATH-The directory for libtommath to be installed to. diff --git a/libtommath/makefile.shared b/libtommath/makefile.shared index 8522d44..f17bbbd 100644 --- a/libtommath/makefile.shared +++ b/libtommath/makefile.shared @@ -1,7 +1,7 @@ #Makefile for GCC # #Tom St Denis -VERSION=0:39 +VERSION=0:41 CC = libtool --mode=compile --tag=CC gcc diff --git a/libtommath/pre_gen/mpi.c b/libtommath/pre_gen/mpi.c index b7a5bed..d2224c0 100644 --- a/libtommath/pre_gen/mpi.c +++ b/libtommath/pre_gen/mpi.c @@ -553,7 +553,7 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) register mp_digit *tmpc; tmpc = c->dp + digs; - for (ix = digs; ix <= pa; ix++) { + for (ix = digs; ix < pa; ix++) { /* now extract the previous digit [below the carry] */ *tmpc++ = W[ix]; } @@ -2026,7 +2026,12 @@ static int s_is_power_of_two(mp_digit b, int *p) { int x; - for (x = 1; x < DIGIT_BIT; x++) { + /* fast return if no power of two */ + if ((b==0) || (b & (b-1))) { + return 0; + } + + for (x = 0; x < DIGIT_BIT; x++) { if (b == (((mp_digit)1)<alloc != a->used && a->used > 0) { - if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) { + int used = 1; + + if(a->used > 0) + used = a->used; + + if (a->alloc != used) { + if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * used)) == NULL) { return MP_MEM; } a->dp = tmp; - a->alloc = a->used; + a->alloc = used; } return MP_OKAY; } diff --git a/macosx/README b/macosx/README index 3496969..80bed14 100644 --- a/macosx/README +++ b/macosx/README @@ -17,16 +17,11 @@ before asking on the list, many questions have already been answered). http://groups.google.com/group/comp.lang.tcl/ - The Tcl'ers Wiki also has many pages dealing with Tcl & Tk on Mac OS X, see - http://wiki.tcl.tk/references/3753! - http://wiki.tcl.tk/references/8361! + http://wiki.tcl.tk/_/ref?N=3753 + http://wiki.tcl.tk/_/ref?N=8361 - Please report bugs with Tcl or Tk on Mac OS X to the sourceforge bug trackers: - Tcl: http://sf.net/tracker/?func=add&group_id=10894&atid=110894 - Tk: http://sf.net/tracker/?func=add&group_id=12997&atid=112997 -please make sure that your report Tk specific bugs to the tktoolkit project bug -tracker rather than the tcl project bug tracker. -Mac OS X specific bugs should usually be assigned to 'das' or 'wolfsuit'. - + http://tcl.sourceforge.net/ 2. Using Tcl on Mac OS X ------------------------ diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index 8eb3e57..09ee96d 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -623,8 +623,10 @@ SetOSTypeFromAny( Tcl_UtfToExternalDString(encoding, string, length, &ds); if (Tcl_DStringLength(&ds) > 4) { - Tcl_AppendResult(interp, "expected Macintosh OS type but got \"", - string, "\": ", NULL); + if (interp) { + Tcl_AppendResult(interp, "expected Macintosh OS type but got \"", + string, "\": ", NULL); + } result = TCL_ERROR; } else { OSType osType; diff --git a/tests/namespace.test b/tests/namespace.test index 89f6759..504d532 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -24,6 +24,12 @@ if {[lsearch [namespace children] ::tcltest] == -1} { # Clear out any namespaces called test_ns_* catch {namespace delete {*}[namespace children :: test_ns_*]} +proc fq {ns} { + if {[string match ::* $ns]} {return $ns} + set current [uplevel 1 {namespace current}] + return [string trimright $current :]::[string trimleft $ns :] +} + test namespace-1.1 {TclInitNamespaces, GetNamespaceFromObj, NamespaceChildrenCmd} { namespace children :: test_ns_* } {} @@ -929,9 +935,8 @@ test namespace-21.7 {NamespaceChildrenCmd, glob-style pattern given} { } [lsort {::test_ns_1::test_ns_2 ::test_ns_1::test_ns_foo}] test namespace-21.8 {NamespaceChildrenCmd, trivial pattern starting with ::} { namespace eval test_ns_1 {} - namespace children [namespace current] \ - [string trimright [namespace current] :]::test_ns_1 -} [string trimright [namespace current] :]::test_ns_1 + namespace children [namespace current] [fq test_ns_1] +} [fq test_ns_1] test namespace-22.1 {NamespaceCodeCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} @@ -942,11 +947,11 @@ test namespace-22.2 {NamespaceCodeCmd, arg is already scoped value} { namespace eval test_ns_1 { proc cmd {} {return "test_ns_1::cmd"} } - namespace code {namespace inscope ::test_ns_1 cmd} -} {namespace inscope ::test_ns_1 cmd} + namespace code {::namespace inscope ::test_ns_1 cmd} +} {::namespace inscope ::test_ns_1 cmd} test namespace-22.3 {NamespaceCodeCmd, arg is already scoped value} { namespace code {namespace inscope ::test_ns_1 cmd} -} {namespace inscope ::test_ns_1 cmd} +} {::namespace inscope :: {namespace inscope ::test_ns_1 cmd}} test namespace-22.4 {NamespaceCodeCmd, in :: namespace} { namespace code unknown } {::namespace inscope :: unknown} @@ -966,6 +971,12 @@ test namespace-22.6 {NamespaceCodeCmd, in other namespace} { namespace code {set v} }] } {42} +test namespace-22.7 {NamespaceCodeCmd, Bug 3202171} { + namespace eval demo { + proc namespace args {puts $args} + ::namespace code {namespace inscope foo} + } +} [list ::namespace inscope [fq demo] {namespace inscope foo}] test namespace-23.1 {NamespaceCurrentCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} diff --git a/tests/parse.test b/tests/parse.test index b5211e7..37c44d5 100644 --- a/tests/parse.test +++ b/tests/parse.test @@ -227,6 +227,18 @@ test parse-5.26 {Tcl_ParseCommand: {*} parsing} testparser { test parse-5.27 {Tcl_ParseCommand: {*} parsing} testparser { testparser "{*}\\\n foo bar" 0 } {- \{*\}\\\n\ foo\ bar 3 simple {{*}} 1 text * 0 simple foo 1 text foo 0 simple bar 1 text bar 0 {}} +test parse-5.28 {Tcl_ParseCommand: {*} parsing, expanded literals} testparser { + testparser {{*}{a b}} 0 +} {- {{*}{a b}} 2 simple a 1 text a 0 simple b 1 text b 0 {}} +test parse-5.29 {Tcl_ParseCommand: {*} parsing, expanded literals, naked backslashes} testparser { + testparser {{*}{a \n b}} 0 +} {- {{*}{a \n b}} 1 expand {{*}{a \n b}} 1 text {a \n b} 0 {}} +test parse-5.30 {Tcl_ParseCommand: {*} parsing, expanded literals} testparser { + testparser {{*}"a b"} 0 +} {- {{*}"a b"} 2 simple a 1 text a 0 simple b 1 text b 0 {}} +test parse-5.31 {Tcl_ParseCommand: {*} parsing, expanded literals, naked backslashes} testparser { + testparser {{*}"a \n b"} 0 +} {- {{*}"a \n b"} 1 expand {{*}"a \n b"} 3 text {a } 0 backslash {\n} 0 text { b} 0 {}} test parse-6.1 {ParseTokens procedure, empty word} testparser { testparser {""} 0 diff --git a/tests/string.test b/tests/string.test index 6b00f3a..c3cfc3c 100644 --- a/tests/string.test +++ b/tests/string.test @@ -601,18 +601,18 @@ test string-6.91 {string is double, bad doubles} { } set result } {1 1 0 0 0 1 0 0} -test string-6.92 {string is double, 32-bit overflow} { +test string-6.92 {string is integer, 32-bit overflow} { # Bug 718878 set x 0x100000000 list [string is integer -failindex var $x] $var } {0 -1} -test string-6.93 {string is double, 32-bit overflow} { +test string-6.93 {string is integer, 32-bit overflow} { # Bug 718878 set x 0x100000000 append x "" list [string is integer -failindex var $x] $var } {0 -1} -test string-6.94 {string is double, 32-bit overflow} { +test string-6.94 {string is integer, 32-bit overflow} { # Bug 718878 set x 0x100000000 list [string is integer -failindex var [expr {$x}]] $var @@ -1608,6 +1608,11 @@ test string-24.11 {string reverse command - corner case} { set y \udead string reverse $x$y } \udead\ubeef +test string-24.12 {string reverse command - corner case} { + set x \ubeef + set y \udead + string is ascii [string reverse $x$y] +} 0 test string-25.1 {string is list} { string is list {a b c} diff --git a/tools/configure b/tools/configure index e8661fa..98b5867 100644 --- a/tools/configure +++ b/tools/configure @@ -1,9 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. +# Generated by GNU Autoconf 2.59. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -20,9 +19,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -41,7 +41,7 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -218,16 +218,17 @@ rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -630,7 +631,7 @@ done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -670,10 +671,10 @@ if test -z "$srcdir"; then # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -745,9 +746,9 @@ _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -817,12 +818,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. @@ -833,7 +867,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else @@ -847,8 +881,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -860,7 +893,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -937,19 +970,19 @@ do 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. @@ -983,12 +1016,12 @@ _ASBOX case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } @@ -1017,7 +1050,7 @@ _ASBOX for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -1036,7 +1069,7 @@ _ASBOX echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && + rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1116,7 +1149,7 @@ fi # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" @@ -1133,13 +1166,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -1188,6 +1221,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Recover information that Tcl computed with its configure script. #-------------------------------------------------------------------- @@ -1256,13 +1290,13 @@ _ACEOF # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -1292,13 +1326,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ + ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; +s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; -s/^[^=]*=[ ]*$//; +s/^[^=]*=[ ]*$//; }' fi @@ -1312,13 +1346,13 @@ fi cat >confdef2opt.sed <<\_ACEOF t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g @@ -1340,7 +1374,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' @@ -1384,9 +1418,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -1405,7 +1440,7 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -1584,16 +1619,17 @@ rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -1620,7 +1656,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -1664,7 +1700,7 @@ Usage: $0 [OPTIONS] [FILE]... -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files @@ -1675,11 +1711,10 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.57, +configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir @@ -1899,9 +1934,9 @@ _ACEOF (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end @@ -1919,21 +1954,21 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -1949,10 +1984,10 @@ echo X"$ac_file" | as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -1990,12 +2025,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac @@ -2013,7 +2081,7 @@ echo "$as_me: creating $ac_file" >&6;} configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. @@ -2022,24 +2090,24 @@ echo "$as_me: creating $ac_file" >&6;} case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo $f;; + echo "$f";; *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } _ACEOF diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl index 01ae467..464ba50 100644 --- a/tools/genStubs.tcl +++ b/tools/genStubs.tcl @@ -304,7 +304,7 @@ proc genStubs::addPlatformGuard {plat iftxt {eltxt {}}} { proc genStubs::emitSlots {name textVar} { upvar $textVar text - forAllStubs $name makeSlot 1 text {" void *reserved$i;\n"} + forAllStubs $name makeSlot 1 text {" VOID *reserved$i;\n"} return } diff --git a/tools/tclZIC.tcl b/tools/tclZIC.tcl index 6169696..1b19d82 100755 --- a/tools/tclZIC.tcl +++ b/tools/tclZIC.tcl @@ -394,6 +394,9 @@ proc parseON {on} { #---------------------------------------------------------------------- proc onDayOfMonth {day year month} { + scan $day %d day + scan $year %d year + scan $month %d month set date [::tcl::clock::GetJulianDayFromEraYearMonthDay \ [dict create era CE year $year month $month dayOfMonth $day] \ 2361222] diff --git a/unix/.cvsignore b/unix/.cvsignore deleted file mode 100644 index ed12ed2..0000000 --- a/unix/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -autom4te.cache -config.status -Makefile -*.exe -*.sh -*.dll -*.a diff --git a/unix/Makefile.in b/unix/Makefile.in index 6f193f1..782a89b 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -944,11 +944,8 @@ regerror.o: $(REGHDRS) $(GENERIC_DIR)/regerrs.h $(GENERIC_DIR)/regerror.c tclAppInit.o: $(UNIX_DIR)/tclAppInit.c $(CC) -c $(APP_CC_SWITCHES) $(UNIX_DIR)/tclAppInit.c -# On Unix we want to use the normal malloc/free implementation, so we -# specifically set the USE_TCLALLOC flag. - tclAlloc.o: $(GENERIC_DIR)/tclAlloc.c - $(CC) -c $(CC_SWITCHES) -DUSE_TCLALLOC=0 $(GENERIC_DIR)/tclAlloc.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAlloc.c tclAsync.o: $(GENERIC_DIR)/tclAsync.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAsync.c diff --git a/unix/README b/unix/README index 96be762..87b151a 100644 --- a/unix/README +++ b/unix/README @@ -166,8 +166,3 @@ a test is failing consistently, please send us a bug report with as much detail as you can manage. Please use the online database at http://tcl.sourceforge.net/ -The Tcl test suite is very sensitive to proper implementation of ANSI C -library procedures such as sprintf and sscanf. If the test suite generates -errors, most likely they are due to non-conformance of your system's ANSI C -library; such problems are unlikely to affect any real applications so it's -probably safe to ignore them. diff --git a/unix/configure b/unix/configure index 8fbaebc..af64e51 100755 --- a/unix/configure +++ b/unix/configure @@ -6630,6 +6630,8 @@ fi # Step 3: set configuration options based on system name and version. do64bit_ok=no + # default to '{$LIBS}' and set to "" on per-platform necessary basis + SHLIB_LD_LIBS='${LIBS}' LDFLAGS_ORIG="$LDFLAGS" # When ld needs options to work in 64-bit mode, put them in # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] @@ -6754,9 +6756,6 @@ fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -6831,7 +6830,6 @@ fi BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' - SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" @@ -6913,7 +6911,6 @@ fi BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" @@ -6923,7 +6920,6 @@ fi BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' - SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" @@ -6934,7 +6930,6 @@ fi CYGWIN_*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' - SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" @@ -6954,7 +6949,6 @@ fi Haiku*) LDFLAGS="$LDFLAGS -Wl,--export-dynamic" SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' DL_OBJS="tclLoadDl.o" @@ -7126,7 +7120,6 @@ fi SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" @@ -7139,7 +7132,6 @@ fi if test "$GCC" = yes; then